فهرست منبع

凌云集团更改公司

peiguo 5 سال پیش
والد
کامیت
6c283a3a2d

+ 11 - 0
whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java

@@ -156,6 +156,9 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
             "union select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 3 day) and user_create=#{userId} union select * from ms_report where report_status=1 and report_date=curdate() and user_create=#{userId}) aa where aa.ms_status = 2")
     List<MsReport> selectMsReportThereError(@Param("userId") Long userId);
 
+    @Select("select * from ms_report where report_status=1 and report_date > date_sub(curdate(),interval 29 day) and user_create=#{userId} and ms_status = 2")
+    List<MsReport> selectMsReportThirtyError(@Param("userId") Long userId);
+
     /**
      * 最近15天确诊,疑似,密切接触者
      *
@@ -175,6 +178,14 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
     MsReport queryMsReportIsXG(@Param("userId") Long userId);
 
     /**
+     * 家人确诊,疑似,密切接触者
+     * @param userId
+     * @return
+     */
+    @Select("select b.is_contact from ms_report a INNER JOIN ms_suspected b on a.report_id=b.report_id where a.report_status=1 and a.user_create=#{userId}")
+    Integer queryMsReportIsXGHome(@Param("userId") Long userId);
+
+    /**
      * 最近状态 0无,1确诊,2疑似,3密切接触者,4解除隔离
      *
      * @param userId

+ 62 - 17
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -194,15 +194,30 @@ public class ScanController {
                     MsReport msReport = msReportMapper.queryMsReportIsXG(userOpen.getUserId());
                     SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
                     if (msReport != null) {
-                        List<MsReport> msReports1 = msReportMapper.queryLateStatus(userOpen.getUserId(), s.format(msReport.getReportDate()));
-                        if (msReports1.size() == 0) {
-                            model.put("collor", "red");
-                            model.put("collor2", "red");
-                            model.put("into", "不许进入");
-                            model.put("errorMsg", "由于您上报过新冠确诊、新冠疑似或密切接触者,且未解除医学隔离,不许进入,如有疑问请联系直管领导。");
-                            scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
-                            return new ModelAndView("/user/scan.ftl", model);
-                        }
+                        model.put("collor", "red");
+                        model.put("collor2", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "由于您上报过新冠确诊、新冠疑似或密切接触者,不许进入,如有疑问请联系直管领导。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scan.ftl", model);
+//                        List<MsReport> msReports1 = msReportMapper.queryLateStatus(userOpen.getUserId(), s.format(msReport.getReportDate()));
+//                        if (msReports1.size() == 0) {
+//                            model.put("collor", "red");
+//                            model.put("collor2", "red");
+//                            model.put("into", "不许进入");
+//                            model.put("errorMsg", "由于您上报过新冠确诊、新冠疑似或密切接触者,且未解除医学隔离,不许进入,如有疑问请联系直管领导。");
+//                            scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+//                            return new ModelAndView("/user/scan.ftl", model);
+//                        }
+                    }
+                    Integer isContact = msReportMapper.queryMsReportIsXGHome(userOpen.getUserId());
+                    if (isContact != null && isContact == 1) {
+                        model.put("collor", "red");
+                        model.put("collor2", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "由于您的家庭成员有新冠确诊或密切接触史人员,不许进入,如有疑问请联系直管领导。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scan.ftl", model);
                     }
                     List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
                     if (msReports.size() < 4) {
@@ -222,6 +237,15 @@ public class ScanController {
                         scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
                         return new ModelAndView("/user/scan.ftl", model);
                     }
+                    List<MsReport> msReports3 = msReportMapper.selectMsReportThirtyError(userOpen.getUserId());
+                    if (msReports3.size() > 0) {
+                        model.put("collor", "red");
+                        model.put("collor2", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "由于最近30天您健康评估存在问题,不许进入,如有疑问请联系直管领导。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scan.ftl", model);
+                    }
                     String returnWork = msReportMapper.returnWork(userOpen.getUserId());
                     if (returnWork != null) {
                         if (sdf.parse(returnWork + " 00:00:00").getTime() + 1000L * 3600 * 24 * 15 > sdf.parse(s.format(new Date()) + " 00:00:00").getTime()) {
@@ -578,14 +602,27 @@ public class ScanController {
             }
             MsReport msReport = msReportMapper.queryMsReportIsXG(userId);
             if (msReport != null) {
-                List<MsReport> msReports1 = msReportMapper.queryLateStatus(userId, s.format(msReport.getReportDate()));
-                if (msReports1.size() == 0) {
-                    model.put("collor", "red");
-                    model.put("collor2", "red");
-                    model.put("into", "不可复工");
-                    model.put("errorMsg", "由于您上报过新冠确诊、新冠疑似或密切接触者,且未解除医学隔离,不可复工,如有疑问请联系直管领导。");
-                    return new ModelAndView("/user/returnWork.ftl", model);
-                }
+                model.put("collor", "red");
+                model.put("collor2", "red");
+                model.put("into", "不可复工");
+                model.put("errorMsg", "由于您上报过新冠确诊、新冠疑似或密切接触者,且未解除医学隔离,不可复工,如有疑问请联系直管领导。");
+                return new ModelAndView("/user/returnWork.ftl", model);
+//                List<MsReport> msReports1 = msReportMapper.queryLateStatus(userId, s.format(msReport.getReportDate()));
+//                if (msReports1.size() == 0) {
+//                    model.put("collor", "red");
+//                    model.put("collor2", "red");
+//                    model.put("into", "不可复工");
+//                    model.put("errorMsg", "由于您上报过新冠确诊、新冠疑似或密切接触者,且未解除医学隔离,不可复工,如有疑问请联系直管领导。");
+//                    return new ModelAndView("/user/returnWork.ftl", model);
+//                }
+            }
+            Integer isContact = msReportMapper.queryMsReportIsXGHome(userId);
+            if (isContact != null && isContact == 1) {
+                model.put("collor", "red");
+                model.put("collor2", "red");
+                model.put("into", "不可复工");
+                model.put("errorMsg", "由于您的家庭成员有新冠确诊或密切接触史人员,不可复工,如有疑问请联系直管领导。");
+                return new ModelAndView("/user/returnWork.ftl", model);
             }
             List<MsReport> msReports = msReportMapper.selectMsReportLate(userId);
             if (msReports.size() < 4) {
@@ -603,6 +640,14 @@ public class ScanController {
                 model.put("errorMsg", "由于近期您健康评估存在问题,不可复工,如有疑问请联系直管领导。");
                 return new ModelAndView("/user/returnWork.ftl", model);
             }
+            List<MsReport> msReports3 = msReportMapper.selectMsReportThirtyError(userId);
+            if (msReports3.size() > 0) {
+                model.put("collor", "red");
+                model.put("collor2", "red");
+                model.put("into", "不可复工");
+                model.put("errorMsg", "由于最近30天您健康评估存在问题,不可复工,如有疑问请联系直管领导。");
+                return new ModelAndView("/user/returnWork.ftl", model);
+            }
             String returnWork = msReportMapper.returnWork(userId);
             if (returnWork != null) {
                 if (sdf.parse(returnWork + " 00:00:00").getTime() + 1000L * 3600 * 24 * 15 > sdf.parse(s.format(new Date()) + " 00:00:00").getTime()) {