wangjun преди 4 години
родител
ревизия
f11112e9b7

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java

@ -60,7 +60,7 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    List<WlyyPrescriptionDO> findByOutPatientIdList(String outpatientId);
    List<WlyyPrescriptionDO> findByDoctorAndCreateTimeAndRemark(String doctor,Date createTime,String remark);
    @Query("select a from WlyyPrescriptionDO a where  a.createTime <?1 and a.status <30 and a.status>=0")
    List<WlyyPrescriptionDO> findListByCheckStatus(Date createTime);
    @Query("select a from WlyyPrescriptionDO a where a.createTime>?1 and  a.createTime <?2 and a.status <30 and a.status>=0")
    List<WlyyPrescriptionDO> findListByCheckStatus(Date startTime,Date endTime);
}

+ 5 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionDeleteService.java

@ -39,10 +39,13 @@ public class PrescriptionDeleteService {
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    //定时作废处方
    public void deletePrescription() throws Exception{
        Date d = new Date();
        Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
        ca.setTime(new Date()); //设置时间为当前时间
        ca.add(Calendar.DATE, -1); //年份减1
        Date d = ca.getTime();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String s = sdf.format(d);
        List<WlyyPrescriptionDO> prescriptionDOS = prescriptionDao.findListByCheckStatus(DateUtil.strToDate(s+" 00:00:00"));
        List<WlyyPrescriptionDO> prescriptionDOS = prescriptionDao.findListByCheckStatus(DateUtil.strToDate(s+" 00:00:00"),DateUtil.strToDate(s+" 23:59:59"));
        if (null!=prescriptionDOS&&prescriptionDOS.size()>0){
            for (WlyyPrescriptionDO prescriptionDO:prescriptionDOS){
                logger.info("处方删除时间满足条件");