瀏覽代碼

Merge branch 'dev' of trick9191/wlyy2.0 into dev

trick9191 5 年之前
父節點
當前提交
06db00ce6b

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

@ -33,4 +33,6 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    List<WlyyOutpatientDO> findByStatus(String status);
    List<WlyyOutpatientDO> findByDoctorAndCreateTimeAndPatientCancelRemark(String doctor,Date createTime,String patientCancelRemark);
}

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

@ -4,6 +4,7 @@ import com.yihu.jw.entity.hospital.prescription.WlyyPatientRegisterDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
@ -15,4 +16,5 @@ public interface PatientRegisterDao extends PagingAndSortingRepository<WlyyPatie
    List<WlyyPatientRegisterDO> findByPatientAndDateAndDoctor(String patient,String date,String doctor);
    List<WlyyPatientRegisterDO> findByPatientAndCreateTime(String patient, Date createTime);
}

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

@ -31,4 +31,6 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    WlyyPrescriptionDO findByRealOrder(String realOrder);
    List<WlyyPrescriptionDO> findByDoctorAndCreateTimeAndRemark(String doctor,Date createTime,String remark);
}

+ 42 - 0
business/base-service/src/main/java/com/yihu/jw/internet/service/DataGeneratorService.java

@ -91,6 +91,45 @@ public class DataGeneratorService extends BaseJpaService<InternetUpErrorLogDO, I
        return "success";
    }
    public String delData(String doctor,String date){
        //居民门诊记录数据源
        Iterable<PatientMappingDO> patientMappingDOs = patientMappingDao.findAll();
        Iterator it = patientMappingDOs.iterator();
        //遍历居民删除预约记录
        while (it.hasNext()) {
            PatientMappingDO patientMappingDO = (PatientMappingDO) it.next();
            List<WlyyPatientRegisterDO> registerDOs = patientRegisterDao.findByPatientAndCreateTime(patientMappingDO.getPatient(),DateUtil.strToDate(date+" 08:00:00"));
            if(registerDOs!=null&&registerDOs.size()>0){
                patientRegisterDao.delete(registerDOs);
            }
        }
        //删除复诊
        List<WlyyOutpatientDO> outpatientDOs = outpatientDao.findByDoctorAndCreateTimeAndPatientCancelRemark(doctor,DateUtil.strToDate(date+" 09:30:00"),"test_info");
        if(outpatientDOs!=null&&outpatientDOs.size()>0){
            outpatientDao.delete(outpatientDOs);
        }
        //删除复诊
        List<WlyyPrescriptionDO> prescriptionDOs = prescriptionDao.findByDoctorAndCreateTimeAndRemark(doctor,DateUtil.strToDate(date+" 10:00:00"),"test_info");
        if(prescriptionDOs!=null&&prescriptionDOs.size()>0){
            for(WlyyPrescriptionDO prescriptionDO :prescriptionDOs){
                List<WlyyPrescriptionInfoDO> infoDOs = prescriptionInfoDao.findByPrescriptionId(prescriptionDO.getId());
                if(infoDOs!=null&&infoDOs.size()>0){
                    prescriptionInfoDao.delete(infoDOs);
                }
                List<WlyyInspectionDO> inspectionDOs = wlyyInspectionDao.findByPrescriptionId(prescriptionDO.getId());
                if(inspectionDOs!=null&&inspectionDOs.size()>0){
                    wlyyInspectionDao.delete(inspectionDOs);
                }
            }
            prescriptionDao.delete(prescriptionDOs);
        }
        return "success";
    }
    /**
     * 生成门诊记录
     * @param date
@ -133,6 +172,7 @@ public class DataGeneratorService extends BaseJpaService<InternetUpErrorLogDO, I
        outpatientDO.setRegisterNo(getCode());
        outpatientDO.setConNo(getCode());
        outpatientDO.setPatientCancelRemark("test_info");
        return outpatientDao.save(outpatientDO);
    }
@ -158,6 +198,8 @@ public class DataGeneratorService extends BaseJpaService<InternetUpErrorLogDO, I
        prescriptionDO.setType(1);
        prescriptionDO.setCreateTime(DateUtil.strToDate(date+" 10:00:00"));
        prescriptionDO.setRemark("test_info");
        return prescriptionDao.save(prescriptionDO);
    }

+ 14 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -291,10 +291,22 @@ public class JobController extends BaseController {
    public String setData(String doctor,String date) {
        try {
            dataGeneratorService.setData(doctor,date);
            return write(200, "启动成功");
            return write(200, "数据已经生成");
        } catch (Exception e) {
            error(e);
            return error(-1, "启动失败");
            return error(-1, "数据已经生成");
        }
    }
    @RequestMapping(value = "/delData", method = RequestMethod.POST)
    @ApiOperation("删除数据")
    public String delData(String doctor,String date) {
        try {
            dataGeneratorService.delData(doctor,date);
            return write(200, "数据已经删除");
        } catch (Exception e) {
            error(e);
            return error(-1, "数据已经删除");
        }
    }
}