Przeglądaj źródła

内部报验-问题修复

wangming 1 rok temu
rodzic
commit
40b18eba88

+ 19 - 16
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxInsideInspectionServiceImpl.java

@@ -802,27 +802,23 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * @return
      */
     private List<String> editColsHistory(ZhcxInsideInspectionDo oldInside, Map<String,Object> updatecolumns) {
-
-        log.info("修改前:{}", JSONUtil.toJsonStr(oldInside));
-
-        log.info("修改后:{}", JSONUtil.toJsonStr(updatecolumns));
-
         List<String> editDataList = new ArrayList<>();
         //预约报验时间
-//        if(ObjectUtil.isNotEmpty(updatecolumns.get("RESERVATIONINSPECTIONTIME"))) {
-//            String reservationinspectiontime = updatecolumns.get("RESERVATIONINSPECTIONTIME").toString();
-//            if(reservationinspectiontime.split(":").length == 3) {
-//
-//            }
-//        }
-        String reTime = DateUtil.format(oldInside.getReservationinspectiontime(), "yyyy-MM-dd HH:mm");
-        if(ObjectUtil.isNotNull(reTime)
+        String reTime = DateUtil.format(oldInside.getReservationinspectiontime(), "yyyy-MM-dd HH:mm:ss");
+        if(ObjectUtil.isNotNull(oldInside.getReservationinspectiontime())
                 && ObjectUtil.isNotNull(updatecolumns.get("RESERVATIONINSPECTIONTIME"))) {
-            if(!reTime.equals(updatecolumns.get("RESERVATIONINSPECTIONTIME").toString())) {
+
+            int times = updatecolumns.get("RESERVATIONINSPECTIONTIME").toString().split(":").length - 1;
+            String reservationtime = updatecolumns.get("RESERVATIONINSPECTIONTIME").toString();
+            if(times == 1) {
+                reservationtime = reservationtime.concat(":00");
+            }
+
+            if(!reTime.equals(reservationtime)) {
                 String reservationinspectiontime = StrUtil.concat(true, "预约报验时间:"
                         , DateUtil.format(oldInside.getReservationinspectiontime(), "yyyy-MM-dd HH:mm")
                         , " 变更为:"
-                        , updatecolumns.get("RESERVATIONINSPECTIONTIME").toString()
+                        , reservationtime
                 );
                 editDataList.add(reservationinspectiontime);
             }
@@ -836,7 +832,14 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
                 editDataList.add(reservationinspectiontime);
             }
         } else if(ObjectUtil.isNotNull(updatecolumns.get("RESERVATIONINSPECTIONTIME"))) {
-            if(!updatecolumns.get("RESERVATIONINSPECTIONTIME").toString().equals(reTime)) {
+
+            int times = updatecolumns.get("RESERVATIONINSPECTIONTIME").toString().split(":").length - 1;
+            String reservationtime = updatecolumns.get("RESERVATIONINSPECTIONTIME").toString();
+            if(times == 1) {
+                reservationtime = reservationtime.concat(":00");
+            }
+
+            if(!reservationtime.equals(reTime)) {
                 String reservationinspectiontime = StrUtil.concat(true, "预约报验时间:"
                         , " 变更为:"
                         , updatecolumns.get("RESERVATIONINSPECTIONTIME").toString()