Procházet zdrojové kódy

孕检展示修改

wujunjie před 7 roky
rodič
revize
815270d420

+ 9 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PrenatalInspectorPlanDao.java

@ -16,12 +16,17 @@ public interface PrenatalInspectorPlanDao extends PagingAndSortingRepository<Pre
    @Query("select a from PrenatalInspectorPlan a where a.inspectionCode = ?1 and a.status = '0' and a.del='1' order by a.inspectionTime asc")
    List<PrenatalInspectorPlan> findByCode(String inspectionCode);
    //查询最近15天数据
    @Query(value = "SELECT a.* FROM wlyy_prenatal_inspector_plan a WHERE a.patient = ?1 AND a. STATUS = '0' AND a.del = '1' " +
            " AND DATE_ADD(CURDATE(),INTERVAL -14 DAY) <= a.inspection_time " +
            " AND a.inspection_time <= CURDATE() ORDER BY a.inspection_time DESC ",nativeQuery = true)
    //查询当前时间14天前之后所有产检计划
    @Query(value = "select a.* from wlyy_prenatal_inspector_plan a where a.patient = ?1 and a.status = '0' and a.del='1' " +
            " AND a.inspection_time >= DATE_ADD(CURDATE(),INTERVAL -14 DAY) order by a.inspection_time asc",nativeQuery = true)
    List<PrenatalInspectorPlan> findByPatient(String patient);
    //查询当前时间14天前之后所有产检计划中距当前时间最近的记录
    @Query(value = "SELECT a.id,a.inspection_time FROM wlyy_prenatal_inspector_plan a WHERE a.patient = ?1 " +
            " AND a. STATUS = '0' AND a.del = '1' AND a.inspection_time >= DATE_ADD(CURDATE(),INTERVAL -14 DAY) " +
            " ORDER BY ABS(DATEDIFF(NOW(),inspection_time)) ASC LIMIT 0,1 ",nativeQuery = true)
    PrenatalInspectorPlan findByPatientlateliest(String patient);
    //应产检时间前14天后14天待产检计划(不包括应产检当天)
    @Query(value = "SELECT a.* FROM wlyy_prenatal_inspector_plan a, (SELECT t.* from wlyy_prenatal_inspector_plan t where t.id = ?1 )b  " +
            " WHERE a.inspection_time >= DATE_ADD(b.inspection_time,INTERVAL -14 DAY) and a.inspection_time <= DATE_ADD(b.inspection_time,INTERVAL 14 DAY) " +

+ 7 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -167,9 +167,10 @@ public class PrenatalInspectorPreCardService extends BaseService {
                            plans = new ArrayList<>();
                            PrenatalInspectorPlan plan = null;
                            for (PrenatalInspectorPlanLibrary library : libraries) {
                                //                                    只取最近15天数据
                                //                                    只取当前时间14天前之后的数据
                                Date inspectorDate = DateUtil.getPrenatalInspectorDate(dueDay, -library.getEndDay().intValue());
                                if (DateUtil.getDays(date, inspectorDate) <= 15 && DateUtil.getDays(date, inspectorDate) >= 0) {
//                                if (DateUtil.getDays(date, inspectorDate) <= 15 && DateUtil.getDays(date, inspectorDate) >= 0) {
                                if (inspectorDate.getTime() >= DateUtil.getPreDays(date,-14).getTime()) {
                                    plan = new PrenatalInspectorPlan();
                                    plan.setInspectionPhase(library.getInspectionPhase());
                                    plan.setStatus("0");
@ -200,7 +201,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
                        }
                        planJson.put("plans", plans);//待产检列表
                        if (plans != null && plans.size()>0) {
                            PrenatalInspectorPlan prenatalInspectorPlan = plans.get(0);
                            PrenatalInspectorPlan prenatalInspectorPlan = prenatalInspectorPlanDao.findByPatientlateliest(patientCode);
                            JSONObject status = getPrenatalStatus(prenatalInspectorPlan.getId());
                            planJson.put("inspectStatus", status);//最近一条状态
                        }
@ -265,9 +266,9 @@ public class PrenatalInspectorPreCardService extends BaseService {
                                plans = new ArrayList<>();
                                PrenatalInspectorPlan plan = null;
                                for (PrenatalInspectorPlanLibrary library : libraries) {
//                                    只取最近15天数据
//                                    只取当前时间14天前之后的数据
                                    Date inspectorDate = DateUtil.getPrenatalInspectorDate(dueday, -library.getEndDay().intValue());
                                    if (DateUtil.getDays(date, inspectorDate) <= 15 && DateUtil.getDays(date, inspectorDate) >= 0) {
                                    if (inspectorDate.getTime() >= DateUtil.getPreDays(date,-14).getTime()) {
                                        plan = new PrenatalInspectorPlan();
                                        plan.setInspectionPhase(library.getInspectionPhase());
                                        plan.setStatus("0");
@ -298,7 +299,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
                            }
                            planJson.put("plans", plans);//待产检列表
                            if (plans != null && plans.size()>0) {
                                PrenatalInspectorPlan prenatalInspectorPlan = plans.get(0);
                                PrenatalInspectorPlan prenatalInspectorPlan = prenatalInspectorPlanDao.findByPatientlateliest(patientCode);
                                JSONObject status = getPrenatalStatus(prenatalInspectorPlan.getId());
                                planJson.put("inspectStatus", status);//最近一条状态
                            }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/template/ThirdMessageController.java

@ -64,7 +64,7 @@ public class ThirdMessageController extends BaseController {
            @RequestParam(value = "medicalNo", required = true) String medicalNo,
            @ApiParam(name = "medicalOrg", defaultValue = "201712111825")
            @RequestParam(value = "medicalOrg", required = true) String medicalOrg,
            @ApiParam(name = "medicalTime", defaultValue = "2017-12-11 20:30")
            @ApiParam(name = "medicalTime", defaultValue = "2017-12-11 20:30:00")
            @RequestParam(value = "medicalTime", required = true) String medicalTime) {
        try {
            JSONObject response = thirdMessageService.physicalExamination(idCard, medicalNo, medicalOrg, medicalTime);