guarantee-lsq 2 gadi atpakaļ
vecāks
revīzija
e887dfb80b

+ 19 - 4
platform-dao/src/main/java/com/platform/dao/util/compare/FieldComparedUtils.java

@@ -68,8 +68,12 @@ public class FieldComparedUtils {
                 // 获取Field属性值
                 Object requestField = getRequestMethod.invoke(requestBean);
                 Object fitField = getFitMethod.invoke(fitBean);
+               /* if(fieldCompared.name().equals("自定义参数列表")){
+                    System.out.println("-------requestField------------"+requestField);
+                    System.out.println("-------fitField------------"+fitField);
+                }*/
                 // 返回异常信息
-                if (!Objects.equals(requestField, fitField)) {
+                if (!equals(requestField, fitField)) {
                     // 当累类型为BigDecimal
                     if(requestField instanceof BigDecimal){
                         BigDecimal req = (BigDecimal)requestField;
@@ -140,9 +144,10 @@ public class FieldComparedUtils {
         String result = compareBean(userInfo, userInfo2);
         System.out.println(result);*/
 
-        String info = "[<a href='https://www.yuexiang.cn/yx/borrow/1712291375973093.do' target=_blank>购车周转贷171230-04</a>]借款入账10,000元。";
-        String ss = info.split("target=_blank>")[1].split("</a>")[0];
-        System.out.println(ss);
+        Object old = null;
+        Object current = null;
+        System.out.println(equals(old,current));
+        System.out.println(Objects.equals(old, current));
     }
 
     public static String getGetMethod(String fieldName){
@@ -150,6 +155,16 @@ public class FieldComparedUtils {
         return "get" + Character.toUpperCase(cha) + fieldName.substring(1);
     }
 
+    public static boolean equals(Object old,Object current){
+        if(old == null || "".equals(old) || "[]".equals(old) || "null".equals(old)){
+            old = "";
+        }
+        if(current == null || "".equals(current) || "[]".equals(current) || "null".equals(current)){
+            current = "";
+        }
+        return old.equals(current);
+    }
+
 }
 
 

+ 13 - 0
platform-dao/src/main/java/com/platform/dao/vo/export/sb/ExportSbInfoVO.java

@@ -1,5 +1,6 @@
 package com.platform.dao.vo.export.sb;
 
+import com.platform.dao.util.compare.annotation.FieldCompared;
 import com.platform.office.annotation.Excel;
 import lombok.Data;
 import lombok.experimental.Accessors;
@@ -145,4 +146,16 @@ public class ExportSbInfoVO implements Serializable {
     @Excel(name = "预警天数", orderNum = "24")
     private Integer seatNumber;
 
+    /**
+     * 固定资产
+     */
+    @Excel(name = "固定资产", orderNum = "25", dicCode="SB_IS_FINANCING")
+    private Integer isFinancing;
+
+    /**
+     * 使用寿命
+     */
+    @Excel(name = "使用寿命", orderNum = "26")
+    private Double workYear;
+
 }

+ 8 - 0
platform-office/src/main/java/com/platform/office/poi/excel/imports/CellValueServer.java

@@ -66,6 +66,7 @@ public class CellValueServer {
                 Date date = cell.getDateCellValue();
                 return DateUtils.dateToLocalDate(date);
             } else {
+                entity.setFormat(DateUtils.PATTERN_YMD);
                 cell.setCellType(Cell.CELL_TYPE_STRING);
                 return getLocalDateData(entity, cell.getStringCellValue());
             }
@@ -164,6 +165,7 @@ public class CellValueServer {
             result = replaceValue(entity.getReplace(), result);
         }
         result = hanlderValue(dataHanlder, object, result, titleString);
+        System.out.println("-------------result----------------"+result + "------" + xclass);
         return getValueByType(xclass, result, entity);
     }
 
@@ -229,6 +231,9 @@ public class CellValueServer {
                 return Float.valueOf(String.valueOf(result));
             }
             if ("class java.lang.Integer".equals(xclass) || "int".equals(xclass)) {
+                if(result == null || "".equals(result)){
+                    return null;
+                }
                 return new BigDecimal(String.valueOf(result)).intValue();
             }
             if ("class java.math.BigDecimal".equals(xclass)) {
@@ -255,6 +260,9 @@ public class CellValueServer {
         }
     }
 
+    public static void main(String[] args) {
+    }
+
     /**
      * 调用处理接口处理值
      *

+ 1 - 1
platform-office/src/main/java/com/platform/office/poi/util/DateUtils.java

@@ -25,7 +25,7 @@ import java.util.Date;
 @UtilityClass
 public class DateUtils {
     public final static String PATTERN_YMD_HMS = "yyyy-MM-dd HH:mm:ss";
-
+    public final static String PATTERN_YMD = "yyyy-MM-dd";
     private final static ZoneId ZONE_ID = ZoneId.systemDefault();
 
     /**

+ 1 - 1
platform-rest/src/main/java/com/platform/rest/controller/fill/FillGatherTaskController.java

@@ -186,7 +186,7 @@ public class FillGatherTaskController {
      */
     @SysLog("审核巡检任务")
     @PutMapping("/verify/{id}")
-    @PreAuthorize("@pms.hasPermission('fill-tasks-dispatch')")
+    @PreAuthorize("@pms.hasPermission('fill-tasks-verify')")
     public R verify(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody FillGatherTaskDTO fillGatherTaskDTO) {
         fillGatherTaskDTO.setId(id);
         fillGatherTaskService.verifyTask(fillGatherTaskDTO);

+ 3 - 1
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -756,7 +756,9 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
                 SbInfoDTO beforeDTO = BeanConverterUtil.copyObjectProperties(old,SbInfoDTO.class);
                 mapper.updateByPrimaryKeySelective(sbInfo);
                 String info = FieldComparedUtils.compareBean(beforeDTO,afterDTO);
-                packageLogInfo(info,sbInfo.getId()); // 保存修改记录
+                if(StringUtils.isNotBlank(info)){
+                    packageLogInfo(info,sbInfo.getId()); // 保存修改记录
+                }
             }
         }
     }