Browse Source

Merge remote-tracking branch 'origin/master'

peiguo 5 years ago
parent
commit
04fa1aaed0

+ 21 - 6
whepi-ui/templates/home/ribao.js

@@ -1009,7 +1009,7 @@ function ribaoCommit() {
   if (cantijiao == false) {
     return
   }
-  cantijiao == false
+  cantijiao = false
   var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
   if (listcx.length == 0 && sf == 1) {
     $.alert("请添加出行");
@@ -1063,7 +1063,6 @@ function ribaoCommit() {
 
 
   var medical = $("input[name='radio']:checked").val();
-  console.log(medical)
   if (medical == undefined) {
     $.alert("请选择新冠肺炎");
     return;
@@ -1220,7 +1219,6 @@ function ribaoCommit() {
     success: function (data) {
       if (data.msgReport == "2") {
         $.toast("家人姓名不能重复,如果重复,可以带上称呼");
-        cantijiao == false
         return;
       }
       if ($('#ribao')[0].style.display == 'none') {
@@ -1230,6 +1228,7 @@ function ribaoCommit() {
         $('#notOpenRibao')[0].style.display = '';
         $('#ribao')[0].style.display = 'none';
       }
+      cantijiao = true
       $('#ribao_jinrijujian').empty();
       $('#ribao_jinrijujian').append(data.safetyNum);
       ribao_refrash();
@@ -1329,9 +1328,18 @@ function updateSuspected(suspectedId) {
         // $("#js_input_user_status").attr("data-values", suspected.familyStatus);
 
         // $("#jibenmiaoshu").val(suspected.statusDesp);
-
-        $("#switchQuezhen").val(getMedical(suspected.medical));
-        $("#switchQuezhen").attr("data-values", suspected.medical);
+        if(suspected.medical==0)
+            $("input[id='s18']").prop("checked", "checked");
+        if(suspected.medical==1)
+          $("input[id='s19']").prop("checked", "checked");
+        if(suspected.medical==2)
+          $("input[id='s20']").prop("checked", "checked");
+        if(suspected.medical==3)
+          $("input[id='s21']").prop("checked", "checked");
+        if(suspected.medical==4)
+          $("input[id='s22']").prop("checked", "checked");
+        // $("#switchQuezhen").val(getMedical(suspected.medical));
+        // $("#switchQuezhen").attr("data-values", suspected.medical);
 
         $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
         $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
@@ -1827,6 +1835,13 @@ function clearShow() {
   $("#js_input_sf").val(getIsTrip(0));
   $("#js_input_sf").attr("data-values", 0);
   $('#none')[0].style.display = 'none';
+
+
+  $("input[id='s18']").removeAttr("checked");
+  $("input[id='s19']").removeAttr("checked");
+  $("input[id='s20']").removeAttr("checked");
+  $("input[id='s21']").removeAttr("checked");
+  $("input[id='s22']").removeAttr("checked");
 }
 
 //健康评估

+ 10 - 1
whepi-web/src/main/java/com/bofeng/dao/MsSuspectedMapper.java

@@ -45,10 +45,19 @@ public interface MsSuspectedMapper extends BaseMapper<MsSuspected> {
             "from ms_suspected a \n" +
             "INNER JOIN ms_report b on a.report_id=b.report_id \n" +
             "left JOIN ms_trip c on a.suspected_id=c.trip_id \n" +
-            "where b.user_create=#{userCreate} and b.report_date=(select report_date from ms_report where user_create=#{userCreate} and report_date<curdate() ORDER BY report_date desc LIMIT 1)\n" +
+            "where b.user_create=#{userCreate} and b.report_status=1 and b.report_date=(select report_date from ms_report where user_create=#{userCreate} and b.report_status=1 and report_date<curdate() ORDER BY report_date desc LIMIT 1)\n" +
             "ORDER by a.time_create ")
     List<MsSuspected> selectNextSuspected(@Param("userCreate") Long userCreate);
 
+    //获取最近的一个人一个家人
+    @Select("select a.*,c.* \n" +
+            "from ms_suspected a \n" +
+            "INNER JOIN ms_report b on a.report_id=b.report_id \n" +
+            "left JOIN ms_trip c on a.suspected_id=c.trip_id \n" +
+            "where b.user_create=#{userCreate}  and b.report_status=1 and b.report_date=(select report_date from ms_report where user_create=#{userCreate} and report_date<curdate()  and report_date>date_sub(curdate(),interval 3 day)  and report_status=1 ORDER BY report_date desc LIMIT 1)\n" +
+            "ORDER by a.time_create ")
+    List<MsSuspected> selectNext3Suspected(@Param("userCreate") Long userCreate);
+
     //选择家人
     @Select("select a.*,b.* from ms_suspected a LEFT JOIN ms_trip b on a.suspected_id=b.trip_id where a.suspected_id =#{suspectedId}")
     MsSuspected selectBySuspectedId(@Param("suspectedId") Long suspectedId);

+ 22 - 8
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -189,21 +189,35 @@ public class MsReportService {
         List<MsSuspected> listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
         if (listSuspected == null || listSuspected.size() == 0)
             return 3;
+        // if (unit != null) {
+        //     if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5) {
+        //         if (listSuspected != null && listSuspected.size() > 1)
+        //             return 5;
+        //     }
+        // }
         else {
             for (MsSuspected msSuspected : listSuspected) {
+                //体温是否填写
                 if (msSuspected.getTemperature().compareTo(new BigDecimal(0)) == 0)
                     return 2;
+
+                //如果是凌云,判断出行是否填写异常
+                UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userCreate);
+                if (unit != null) {
+                    if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5) {
+                        //上一天的上报记录.3天内
+                        List<MsSuspected> listSuspected1 = msSuspectedMapper.selectNext3Suspected(userCreate);
+                        if (listSuspected1 != null && listSuspected1.size() > 0) {
+                            if (listSuspected1.get(0).getTodayLocalOther() != msSuspected.getTodayLocalOther() && listSuspected1.get(0).getTodayLocal() != msSuspected.getTodayLocal() && msSuspected.getIsTrip() == 0) {
+                                return 4;
+                            }
+                        }
+
+                    }
+                }
             }
 
         }
-        // //如果是凌云,判断出行是否填写异常
-        // UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userCreate);
-        // if (unit != null) {
-        //     if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5)
-        //     {
-        //         //上一天的莫弟弟
-        //     }
-        // }
         MsReport msReport = msReportMapper.selectById(Long.parseLong(listReport.get(0).getReportId().toString()));
         if (msReport != null) {
             msReport.setReportStatus(1);

+ 28 - 26
whepi-web/src/main/java/com/bofeng/service/MsTripService.java

@@ -149,32 +149,34 @@ public class MsTripService {
             msSuspectedMapper.insert(msSuspected);
 
             //添加出行
-            MsTrip msTrip = new MsTrip();
-            msTrip.setTripId(msSuspected.getSuspectedId());
-            msTrip.setIsTrip(isTrip);
-            msTrip.setTodayLocal(todayLocal);
-            msTrip.setTodayLocalOther(todayLocalOther);
-            msTrip.setWorkLocal(workLocal);
-            msTrip.setWorkLocalOther(workLocalOther);
-            msTripMapper.insert(msTrip);
-            //添加出行详细
-            if (listTripDet != null && listTripDet.size() > 0) {
-                for (MsTripDet msTripDet : listTripDet) {
-                    MsTripDet msTripDet1 = new MsTripDet();
-                    msTripDet1.setTripDetId(IdWorker.getId());
-                    msTripDet1.setTripId(msSuspected.getSuspectedId());
-                    msTripDet1.setSort(msTripDet.getSort());
-                    msTripDet1.setStartLocal(msTripDet.getStartLocal());
-                    msTripDet1.setStartLocalOther(msTripDet.getStartLocalOther());
-                    msTripDet1.setEndLocal(msTripDet.getEndLocal());
-                    msTripDet1.setEndLocalOther(msTripDet.getEndLocalOther());
-                    msTripDet1.setTripType(msTripDet.getTripType());
-                    msTripDet1.setTripTypeDesp(msTripDet.getTripTypeDesp());
-                    msTripDet1.setTimeCreate(DateTime.now());
-                    msTripDet1.setUserCreate(userCreate);
-                    msTripDet1.setTimeUpdate(DateTime.now());
-                    msTripDet1.setUserUpdate(userCreate);
-                    msTripDetMapper.insert(msTripDet1);
+            if(todayLocal>0 && workLocal>0){
+                MsTrip msTrip = new MsTrip();
+                msTrip.setTripId(msSuspected.getSuspectedId());
+                msTrip.setIsTrip(isTrip);
+                msTrip.setTodayLocal(todayLocal);
+                msTrip.setTodayLocalOther(todayLocalOther);
+                msTrip.setWorkLocal(workLocal);
+                msTrip.setWorkLocalOther(workLocalOther);
+                msTripMapper.insert(msTrip);
+                //添加出行详细
+                if (listTripDet != null && listTripDet.size() > 0) {
+                    for (MsTripDet msTripDet : listTripDet) {
+                        MsTripDet msTripDet1 = new MsTripDet();
+                        msTripDet1.setTripDetId(IdWorker.getId());
+                        msTripDet1.setTripId(msSuspected.getSuspectedId());
+                        msTripDet1.setSort(msTripDet.getSort());
+                        msTripDet1.setStartLocal(msTripDet.getStartLocal());
+                        msTripDet1.setStartLocalOther(msTripDet.getStartLocalOther());
+                        msTripDet1.setEndLocal(msTripDet.getEndLocal());
+                        msTripDet1.setEndLocalOther(msTripDet.getEndLocalOther());
+                        msTripDet1.setTripType(msTripDet.getTripType());
+                        msTripDet1.setTripTypeDesp(msTripDet.getTripTypeDesp());
+                        msTripDet1.setTimeCreate(DateTime.now());
+                        msTripDet1.setUserCreate(userCreate);
+                        msTripDet1.setTimeUpdate(DateTime.now());
+                        msTripDet1.setUserUpdate(userCreate);
+                        msTripDetMapper.insert(msTripDet1);
+                    }
                 }
             }
 

+ 4 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/MsReportController.java

@@ -144,6 +144,10 @@ public class MsReportController {
             return ModelOps.newFail("请填报今日体温!");
         } else if (re == 3) { //没有选择家人
             return ModelOps.newFail("请选择家人!");
+        } else if (re == 4) {
+            return ModelOps.newFail("是否出行,请如实填写!");
+        } else if (re == 5) {
+            return ModelOps.newFail("ly集团,只能选择一个人员!");
         }
         return ModelOps.newFail("上报错误");
     }