dengyj 3 éve
szülő
commit
87996a3da8

+ 11 - 9
src/main/java/com/jisco/dynamicweight/dynamicworkauditdata/service/impl/DynamicWorkAuditdataServiceImpl.java

@@ -21,6 +21,7 @@ import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -109,14 +110,15 @@ public class DynamicWorkAuditdataServiceImpl extends BaseServiceImpl<DynamicWork
             auditdata.setEndTime(endTime);
             auditdata.setUploaded("0");
             auditdata.setValidFlag("1");
-            auditdata.setAuditingFlag("1");
+            auditdata.setAuditingFlag("0");
             auditdata.setCreateManNo(UserUtil.getCurrentUserId());
             auditdata.setCreateManName(UserUtil.getCurrentUserName());
             auditdata.setCreateTime(new Date());
+            BigDecimal weight = dynamicWorkUpdataMapper.getWeightForAuditOrUnaudit(auditdata);
+            dynamicWorkUpdataMapper.setAudit(auditdata);
+            Assert.isTrue(weight.compareTo(auditdata.getWeight()) == 0, "数据不一致,请刷新页面并检查数据!");
+            auditdata.setAuditingFlag("1");
             dynamicWorkAuditdataMapper.save(auditdata);
-            int count = dynamicWorkUpdataMapper.getCountForAuditOrUnaudit(auditdata);
-            int setAudit = dynamicWorkUpdataMapper.setAudit(auditdata);
-            Assert.isTrue(count == setAudit, "数据不一致,请刷新页面并检查数据是否已审核!");
         }
     }
 
@@ -140,9 +142,9 @@ public class DynamicWorkAuditdataServiceImpl extends BaseServiceImpl<DynamicWork
             Assert.isTrue(dynamicWorkAuditdata.getUploaded().equals("0"), "数据已上传,请先撤销上传:" + dynamicWorkAuditdata);
 //            Assert.isTrue(dynamicWorkAuditdata.getAuditingFlag()!=null && dynamicWorkAuditdata.getAuditingFlag().equals("1"), "数据未审核,不能撤销审核:" + dynamicWorkAuditdata);
             dynamicWorkAuditdataMapper.deleteByPrimaryKey(dynamicWorkAuditdata.getId());
-            int count = dynamicWorkUpdataMapper.getCountForAuditOrUnaudit(dynamicWorkAuditdata);
-            int setUnAudit = dynamicWorkUpdataMapper.setUnAudit(dynamicWorkAuditdata);
-            Assert.isTrue(count == setUnAudit, "数据不一致,请刷新页面并检查数据!");
+            BigDecimal weight = dynamicWorkUpdataMapper.getWeightForAuditOrUnaudit(dynamicWorkAuditdata);
+            dynamicWorkUpdataMapper.setUnAudit(dynamicWorkAuditdata);
+            Assert.isTrue(weight.compareTo(dynamicWorkAuditdata.getWeight()) == 0, "数据不一致,请刷新页面并检查数据!");
         }
     }
 
@@ -164,7 +166,7 @@ public class DynamicWorkAuditdataServiceImpl extends BaseServiceImpl<DynamicWork
                 platformTransactionManager.commit(transactionStatus);
             } catch (Exception e) {
                 platformTransactionManager.rollback(transactionStatus);
-                throw e;
+//                throw e;
             }
         }
 //        this.batchUpdate(list);
@@ -189,7 +191,7 @@ public class DynamicWorkAuditdataServiceImpl extends BaseServiceImpl<DynamicWork
                 platformTransactionManager.commit(transactionStatus);
             } catch (Exception e) {
                 platformTransactionManager.rollback(transactionStatus);
-                throw e;
+//                throw e;
             }
         }
 //        this.batchUpdate(listDB);

+ 1 - 1
src/main/java/com/jisco/dynamicweight/dynamicworkupdata/mapper/DynamicWorkUpdataMapper.java

@@ -115,5 +115,5 @@ public interface DynamicWorkUpdataMapper extends IBaseMapper<DynamicWorkUpdata,
      * 查询审核或者取消审核的记录条数
      * @param auditDataVO
      */
-    int getCountForAuditOrUnaudit(DynamicWorkAuditdata auditDataVO);
+    BigDecimal getWeightForAuditOrUnaudit(DynamicWorkAuditdata auditDataVO);
 }

+ 5 - 2
src/main/java/com/jisco/dynamicweight/dynamicworkupdata/mapper/DynamicWorkUpdataMapper.xml

@@ -1449,6 +1449,7 @@
           AND t.SENDER_TYPE = #{senderType}
           AND t.END_TIME &gt;= #{startTime}
           AND t.END_TIME &lt;= #{endTime}
+          and t.VALID_FLAG = '1'
           and t.AUDITING_FLAG = '0'
     </update>
     <update id="setUnAudit">
@@ -1466,11 +1467,12 @@
           AND t.SENDER_TYPE = #{senderType}
           AND t.END_TIME &gt;= #{startTime}
           AND t.END_TIME &lt;= #{endTime}
+          and t.VALID_FLAG = '1'
           and t.AUDITING_FLAG = '1'
     </update>
     <!--    查询审核或者取消审核的记录条数-->
-    <select id="getCountForAuditOrUnaudit" resultType="int" parameterType="map">
-        select count(1) as count
+    <select id="getWeightForAuditOrUnaudit" resultType="java.math.BigDecimal" parameterType="map">
+        select sum(WEIGHT) as WEIGHT
         from DYNAMIC_WORK_UPDATA t
         WHERE t.STATION_NAME = #{stationName}
           AND t.STATION_CODE = #{stationCode}
@@ -1484,6 +1486,7 @@
           AND t.SENDER_TYPE = #{senderType}
           AND t.END_TIME &gt;= #{startTime}
           AND t.END_TIME &lt;= #{endTime}
+          and t.VALID_FLAG = '1'
           and t.AUDITING_FLAG = #{auditingFlag}
     </select>
 </mapper>

+ 24 - 8
src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/impl/MeterWorkCarActualServiceImpl.java

@@ -2654,14 +2654,30 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
             for (String s : firstNoList) {
                 MeterWorkImage imageModel = meterWorkImageMapper.selectByPrimaryKey("C" + s);
                 if(Objects.isNull(imageModel)) continue;
-                imageList.add(imageModel.getImageFile1());
-                imageList.add(imageModel.getImageFile2());
-                imageList.add(imageModel.getImageFile3());
-                imageList.add(imageModel.getImageFile4());
-                imageList.add(imageModel.getImageFile5());
-                imageList.add(imageModel.getImageFile6());
-                imageList.add(imageModel.getImageFile7());
-                imageList.add(imageModel.getImageFile8());
+                if(StringUtils.isNotEmpty(imageModel.getImageFile1())) {
+                    imageList.add(imageModel.getImageFile1());
+                }
+                if(StringUtils.isNotEmpty(imageModel.getImageFile2())) {
+                    imageList.add(imageModel.getImageFile2());
+                }
+                if(StringUtils.isNotEmpty(imageModel.getImageFile3())) {
+                    imageList.add(imageModel.getImageFile3());
+                }
+                if(StringUtils.isNotEmpty(imageModel.getImageFile4())) {
+                    imageList.add(imageModel.getImageFile4());
+                }
+                if(StringUtils.isNotEmpty(imageModel.getImageFile5())) {
+                    imageList.add(imageModel.getImageFile5());
+                }
+                if(StringUtils.isNotEmpty(imageModel.getImageFile6())) {
+                    imageList.add(imageModel.getImageFile6());
+                }
+                if(StringUtils.isNotEmpty(imageModel.getImageFile7())) {
+                    imageList.add(imageModel.getImageFile7());
+                }
+                if(StringUtils.isNotEmpty(imageModel.getImageFile8())) {
+                    imageList.add(imageModel.getImageFile8());
+                }
             }
             rm.setSucceed();
             rm.setCode("200");

+ 2 - 2
src/main/java/com/steerinfo/meterwork/meterworkcarnoidentify/mapper/MeterWorkCarnoIdentifyMapper.xml

@@ -451,9 +451,9 @@
        B.car_no first_car_no,
        A.car_no,
        A.video_car_no1,
-       case when (select C.video_car_no1 from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and A.Car_No_type = '1' and C.video_car_no1 = A.car_no) is  not null then '是' else '否' end vedio_car_no1_flag,
+       case when (select C.video_car_no1 from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and C.video_car_no1 = A.car_no) is  not null then '是' else '否' end vedio_car_no1_flag,
        A.video_car_no2,
-       case when (select C.video_car_no2 from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and A.Car_No_type = '1' and C.video_car_no2 = A.car_no) is not null then '是' else '否' end vedio_car_no2_flag,
+       case when (select C.video_car_no2 from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and C.video_car_no2 = A.car_no) is not null then '是' else '否' end vedio_car_no2_flag,
        A.Rfid_Car_No,
        (select D.car_No from meter_base_rfid_info D where D.RFID_code in (select C.rfid_car_no from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and A.Car_No_type = '2')) rfid_carNo
     from Meter_Work_Carno_Identify A

+ 38 - 16
src/main/java/com/steerinfo/meterwork/meterworkcarnoidentify/service/impl/MeterWorkCarnoIdentifyServiceImpl.java

@@ -73,15 +73,21 @@ public class MeterWorkCarnoIdentifyServiceImpl extends BaseServiceImpl<MeterWork
                 long countCarFirst = 0L;
                 //球机车号识别数
                 long countBallIdentify = 0L;
+                //球机车号未识别数
+                long countBallIdentifyTemp = 0L;
                 //枪机车号识别数
                 long countGunIdentify = 0L;
+                //枪机车号未识别数
+                long countGunIdentifyTemp = 0L;
                 //视觉识别数
                 long countVisualIdentify = 0L;
+                //视觉未识别数
+                long countVisualIdentifyTemp = 0L;
                 //视觉识别率
                 double countVisualIdentifyRate = 0;
                 //枪机球机识别差异数
                 long countBallDifferGun = 0L;
-                //Rfid车号识别数
+                //Rfid车号识别数
                 long countRfidIdentify = 0L;
                 //修正车号数
                 long countResetCar = 0L;
@@ -101,20 +107,32 @@ public class MeterWorkCarnoIdentifyServiceImpl extends BaseServiceImpl<MeterWork
                     //一次计量车数
                     countCarFirst = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())).count();
+                    //Rfid车号识别数
+                    countRfidIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
+                            && model.getBaseSpotName().equals(spot.getBaseSpotName())
+                            && model.getCarNoType().equals("2")
+                            && StringUtils.isNotEmpty(model.getRfidCarNo())).count();
                     //球机车号识别数
                     countBallIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())
-                            && model.getCarNoType().equals("1")
                             && StringUtils.isNotEmpty(model.getVideoCarNo1())).count();
+                    //球机车号未识别数
+                    countBallIdentifyTemp = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
+                            && model.getBaseSpotName().equals(spot.getBaseSpotName())
+                            && (StringUtils.isEmpty(model.getVideoCarNo1())
+                            ||  (model.getCarNoType().equals("2")
+                            && StringUtils.isNotEmpty(model.getRfidCarNo())))).count()-countRfidIdentify;
                     //枪机车号识别数
                     countGunIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())
-                            && model.getCarNoType().equals("1")
                             && StringUtils.isNotEmpty(model.getVideoCarNo2())).count();
+                    //枪机车号未识别数
+                    countGunIdentifyTemp = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
+                            && model.getBaseSpotName().equals(spot.getBaseSpotName())
+                            && StringUtils.isEmpty(model.getVideoCarNo2())).count()-countRfidIdentify;
                     //视觉识别数
                     countVisualIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())
-                            && model.getCarNoType().equals("1")
                             && (    (
                                         StringUtils.isNotEmpty(model.getVideoCarNo1())
                                         && StringUtils.isNotEmpty(model.getVideoCarNo2())
@@ -122,22 +140,28 @@ public class MeterWorkCarnoIdentifyServiceImpl extends BaseServiceImpl<MeterWork
                                     ) ||
                                     (StringUtils.isNotEmpty(model.getVideoCarNo1()) || StringUtils.isNotEmpty(model.getVideoCarNo2())
                                     )))).count();
+                    //视觉未识别数
+                    countVisualIdentifyTemp = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
+                            && model.getBaseSpotName().equals(spot.getBaseSpotName())
+                            && !(
+                                    (
+                                        StringUtils.isNotEmpty(model.getVideoCarNo1())
+                                        && StringUtils.isNotEmpty(model.getVideoCarNo2())
+                                        && model.getVideoCarNo1().equals(model.getVideoCarNo2()
+                                 ) || (StringUtils.isNotEmpty(model.getVideoCarNo1()) || StringUtils.isNotEmpty(model.getVideoCarNo2()))
+                                    ||( model.getCarNoType().equals("2")
+                                                && StringUtils.isNotEmpty(model.getRfidCarNo()))))).count();
                     //视觉识别率
                     if(countVisualIdentify != 0) {
-                        countVisualIdentifyRate = Math.round((countVisualIdentify)/(countCarFirst*1.0)*100*100)/100.0; //(Math.round((*100))/100.0;
+                        countVisualIdentifyRate = Math.round(((countCarFirst-countRfidIdentify)-countVisualIdentifyTemp)/((countCarFirst-countRfidIdentify)*1.0)*100*100)/100.0; //(Math.round((*100))/100.0;
                     }
                     //枪机球机识别差异数
                     countBallDifferGun = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())
-                            && model.getCarNoType().equals("1")
                             && StringUtils.isNotEmpty(model.getVideoCarNo1())
                             && StringUtils.isNotEmpty(model.getVideoCarNo2())
                             && !model.getVideoCarNo1().equals(model.getVideoCarNo2())).count();
-                    //Rfid车号识别数
-                    countRfidIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
-                            && model.getBaseSpotName().equals(spot.getBaseSpotName())
-                            && model.getCarNoType().equals("2")
-                            && StringUtils.isNotEmpty(model.getRfidCarNo())).count();
+
                     //修正车号数
                     countResetCar = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())
@@ -145,26 +169,24 @@ public class MeterWorkCarnoIdentifyServiceImpl extends BaseServiceImpl<MeterWork
                     //枪机修改车号数
                     countGunResetCar = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())
-                            && model.getCarNoType().equals("1")
                             && StringUtils.isNotEmpty(model.getVideoCarNo2())
                             && !model.getVideoCarNo2().equals(model.getFirstCarNo()) ).count();
                     //球机修改车号数
                     countBallResetCar = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())
-                            && model.getCarNoType().equals("1")
                             && StringUtils.isNotEmpty(model.getVideoCarNo1())
                             && !model.getVideoCarNo1().equals(model.getFirstCarNo()) ).count();
                     //枪机车号识别率------枪机车号识别数/一次计量车数
                     if(countCarFirst != 0) {
-                        countGunIndentifyRate = Math.round(countGunIdentify/(countCarFirst*1.0)*100*100)/100.0; //(Math.round(*100))/100.0;
+                        countGunIndentifyRate = Math.round(((countCarFirst-countRfidIdentify)-countGunIdentifyTemp)/((countCarFirst-countRfidIdentify)*1.0)*100*100)/100.0; //(Math.round(*100))/100.0;
                     }
-                    //枪机识别准确率------(枪机识别车号数-枪机识别错误修正数)/枪机识别车号数
+                    //枪机识别准确率------(枪机识别车号数-枪机识别错误修正数)/枪机识别车号数c
                     if(countGunIdentify != 0) {
                         countGunIndentifyAccuracyRate = Math.round((countGunIdentify-countGunResetCar)/(countGunIdentify*1.0)*100*100)/100.0; //(Math.round((*100))/100.0;
                     }
                     //球机车号识别率
                     if(countCarFirst != 0) {
-                        countBallIndentifyRate = Math.round(countBallIdentify/(countCarFirst*1.0)*100*100)/100.0; //(Math.round(*100))/100.0;
+                        countBallIndentifyRate = Math.round(((countCarFirst-countRfidIdentify)-countBallIdentifyTemp)/((countCarFirst-countRfidIdentify)*1.0)*100*100)/100.0; //(Math.round(*100))/100.0;
                     }
                     //球机识别准确率
                     if(countBallIdentify != 0) {