Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

peiguo 5 gadi atpakaļ
vecāks
revīzija
7fb5b3ab6f

+ 2 - 1
whepi-ui/templates/home/ribao.js

@@ -1474,7 +1474,7 @@ function updateSuspected(suspectedId) {
             }
             listcx.splice(0, listcx.length);
             $('#tabtr').empty();
-            var person = new Object();
+            var person;
             // var xxIds = [];
             // var xxName = [
             //   "序号",
@@ -1497,6 +1497,7 @@ function updateSuspected(suspectedId) {
             // html += "</tr>"
             data.data.forEach(function (v) {
               {
+                person = new Object();
                 person.startLocal = v.startLocal;
                 person.startLocalOther = v.startLocalOther;
                 person.endLocal = v.endLocal;

+ 48 - 23
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 && msSuspected.getIsTrip() != 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 && 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;
+                    }
+                }
+            }
+            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) {
@@ -511,7 +537,7 @@ public class MsReportService {
                 //添加行程
                 MsTrip msTrip = new MsTrip();
                 msTrip.setTripId(msSuspected1.getSuspectedId());
-                msTrip.setIsTrip(msSuspected.getIsTrip());
+                msTrip.setIsTrip(0);
                 msTrip.setTodayLocal(msSuspected.getTodayLocal());
                 msTrip.setTodayLocalOther(msSuspected.getTodayLocalOther());
                 msTrip.setWorkLocal(msSuspected.getWorkLocal());
@@ -519,27 +545,26 @@ public class MsReportService {
                 msTripMapper.insert(msTrip);
 
                 //添加出行详细
-                List<MsTripDet> listTripDet = msSuspectedMapper.selectTripSuspected(msSuspected.getSuspectedId());
-                if (listTripDet != null && listTripDet.size() > 0) {
-                    for (MsTripDet msTripDet : listTripDet) {
-                        MsTripDet msTripDet1 = new MsTripDet();
-                        msTripDet1.setTripDetId(IdWorker.getId());
-                        msTripDet1.setTripId(msSuspected1.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);
-                    }
-                }
-
+                // List<MsTripDet> listTripDet = msSuspectedMapper.selectTripSuspected(msSuspected.getSuspectedId());
+                // if (listTripDet != null && listTripDet.size() > 0) {
+                //     for (MsTripDet msTripDet : listTripDet) {
+                //         MsTripDet msTripDet1 = new MsTripDet();
+                //         msTripDet1.setTripDetId(IdWorker.getId());
+                //         msTripDet1.setTripId(msSuspected1.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);
+                //     }
+                // }
             }
         }
     }

+ 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;
                 }