lange hace 5 años
padre
commit
323705b8ae

+ 27 - 1
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -208,7 +208,7 @@ public class MsReportService {
                         //上一天的上报记录.3天内
                         List<MsSuspected> listSuspected1 = msSuspectedMapper.selectNext3Suspected(userCreate);
                         if (listSuspected1 != null && listSuspected1.size() == 1) {
-                            if (listSuspected1.get(0).getTodayLocal() != 0 && msSuspected.getTodayLocal() != 0) {
+                            if (listSuspected1.get(0).getTodayLocal() != null && msSuspected.getTodayLocal() != null && listSuspected1.get(0).getTodayLocal() != 0 && msSuspected.getTodayLocal() != 0) {
                                 if (listSuspected1.get(0).getTodayLocalOther() != msSuspected.getTodayLocalOther() && listSuspected1.get(0).getTodayLocal() != msSuspected.getTodayLocal() && msSuspected.getIsTrip() == 0) {
                                     return 4;
                                 }
@@ -230,6 +230,32 @@ public class MsReportService {
         return 1;
     }
 
+    //ly修改上报
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public Integer addReportLy(Long reportId, Long suspectedId, Long userCreate) {
+        //如果是凌云,判断出行是否填写异常
+        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 && 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;
+                    }
+                }
+            }
+            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 void getNowByYesterday(Long userCreate) {

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

@@ -269,7 +269,7 @@ public class MsTripService {
             UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userCreate);
             if (unit != null) {
                 if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5) {
-                    Integer rezuitNum = msReportService.addReport(userCreate);
+                    Integer rezuitNum = msReportService.addReportLy(reportId,suspectedId,userCreate);
                     if (rezuitNum == 4)
                         reportId = 4L;
                 }