lange 5 gadi atpakaļ
vecāks
revīzija
2228b7a2ca

+ 21 - 20
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -35,8 +35,6 @@ public class MsReportService {
     @Autowired
     private MsReportService msReportService;
     @Autowired
-    private MsTripDetMapper msTripDetMapper;
-    @Autowired
     private MsTripMapper msTripMapper;
     @Autowired
     private UptownUnitMapper uptownUnitMapper;
@@ -232,28 +230,31 @@ public class MsReportService {
         return 1;
     }
 
-    //ly修改上报
+    //ly判断是否上报
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
-    public Integer addReportLy(Long reportId, Long suspectedId, Long userCreate) {
+    public Integer addReportLy(Long userCreate, Integer isTrip, Integer todayLacal, String todayLocalOther) {
         //如果是凌云,判断出行是否填写异常
-        MsTrip msTrip = msTripMapper.selectById(suspectedId);
-        if (msTrip != null) {
-            //上一天的上报记录.3天内
-            List<MsSuspected> listSuspected1 = msSuspectedMapper.selectNext3Suspected(userCreate);
-            if (listSuspected1 != null && listSuspected1.size() == 1) {
-                if (listSuspected1.get(0).getTodayLocal() != null && msTrip.getTodayLocal() != null && msTrip.getIsTrip() != null && listSuspected1.get(0).getTodayLocal() != 0 && msTrip.getTodayLocal() != 0) {
-                    if (listSuspected1.get(0).getTodayLocalOther() != msTrip.getTodayLocalOther() && listSuspected1.get(0).getTodayLocal() != msTrip.getTodayLocal() && msTrip.getIsTrip() == 0) {
-                        return 4;
-                    }
+        //上一天的上报记录.3天内
+        List<MsSuspected> listSuspected1 = msSuspectedMapper.selectNext3Suspected(userCreate);
+        if (listSuspected1 != null && listSuspected1.size() == 1) {
+            if (listSuspected1.get(0).getTodayLocal() != null && todayLacal != null && isTrip != null && listSuspected1.get(0).getTodayLocal() != 0 && todayLacal != 0) {
+                if (listSuspected1.get(0).getTodayLocalOther() != todayLocalOther && listSuspected1.get(0).getTodayLocal() != todayLacal && isTrip == 0) {
+                    return 4;
                 }
             }
-            MsReport msReport = msReportMapper.selectById(reportId);
-            if (msReport != null) {
-                msReport.setReportStatus(1);
-                msReport.setUserUpdate(userCreate);
-                msReport.setTimeUpdate(DateTime.now());
-                msReportMapper.updateById(msReport);
-            }
+        }
+        return 1;
+    }
+
+    //修改
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public Integer editReportLy(Long reportId, Long userCreate) {
+        MsReport msReport = msReportMapper.selectById(reportId);
+        if (msReport != null) {
+            msReport.setReportStatus(1);
+            msReport.setUserUpdate(userCreate);
+            msReport.setTimeUpdate(DateTime.now());
+            msReportMapper.updateById(msReport);
         }
         return 1;
     }

+ 14 - 10
whepi-web/src/main/java/com/bofeng/service/MsTripService.java

@@ -45,7 +45,7 @@ public class MsTripService {
     public Long addSuspectedTrip(Long suspectedId, String userName, Integer grender, Integer age, String familyStatus,
                                  String statusDesp, Integer medical, BigDecimal temperature, Integer cough, Integer muscle,
                                  Integer dyspnea, Integer fatigue, Integer diarrhea, Integer singleRoom, String others, Long userCreate, Integer scoreRezult, Integer temperatureScore, Integer scoreHistroy, Integer score
-           ,Integer isContact ,Integer isSuspected , Integer workLocal, String workLocalOther, Integer todayLocal, String todayLocalOther,String autoLocal, String autoAddr, Integer isTrip, List<MsTripDet> listTripDet) {
+            , Integer isContact, Integer isSuspected, Integer workLocal, String workLocalOther, Integer todayLocal, String todayLocalOther, String autoLocal, String autoAddr, Integer isTrip, List<MsTripDet> listTripDet) {
         Long reportId = 0L;
         //如果是当前日期 已经添加
         Date t = new Date();
@@ -195,6 +195,17 @@ public class MsTripService {
                         return 2L;
                 }
             }
+            //判断是否出行
+            //是ly
+            UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userCreate);
+            if (unit != null) {
+                if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5 || unit.getUptownId() == 100000002L) {
+                    Integer rezuitNum = msReportService.addReportLy(userCreate, isTrip, todayLocal, todayLocalOther);
+                    if (rezuitNum == 4)
+                        return 4L;
+                }
+            }
+
             MsSuspected msSuspected2 = msSuspectedService.getScore(suspectedId, userName, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
             if (msSuspected2 != null) {
                 scoreRezult = msSuspected2.getScoreRezult();
@@ -275,15 +286,8 @@ public class MsTripService {
             }
             //更新今日日报,直接上报
             msSuspectedService.updateReport(reportId, medical, singleRoom, temperature);
-            //是ly
-            UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userCreate);
-            if (unit != null) {
-                if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5 || unit.getUptownId() == 100000002L) {
-                    Integer rezuitNum = msReportService.addReportLy(reportId,suspectedId,userCreate);
-                    if (rezuitNum == 4)
-                        reportId = 4L;
-                }
-            }
+            //修改上报状态
+            msReportService.editReportLy(reportId, userCreate);
         }
         return reportId;
     }