Browse Source

设备位号功能

hfxc226 2 years ago
parent
commit
c2c1a97727

+ 3 - 2
platform-common/src/main/java/com/platform/common/util/BeanConverterUtil.java

@@ -1,6 +1,7 @@
 package com.platform.common.util;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.util.CollectionUtils;
@@ -29,7 +30,7 @@ public final class BeanConverterUtil {
     public static <T> T copyObjectProperties(Object source, Class<? extends T> clazz) {
         try {
             T t = clazz.newInstance();
-            BeanUtil.copyProperties(source,t);
+            BeanUtil.copyProperties(source,t, CopyOptions.create().setIgnoreNullValue(true));
             return t;
         } catch (InstantiationException | IllegalAccessException e) {
             e.printStackTrace();
@@ -46,7 +47,7 @@ public final class BeanConverterUtil {
      */
     @SneakyThrows
     public static <T> T copyObjectProperties(Object source, T t) {
-        BeanUtil.copyProperties(source, t);
+        BeanUtil.copyProperties(source, t, CopyOptions.create().setIgnoreNullValue(true));
         return t;
     }
 

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

@@ -1576,10 +1576,10 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
     @Override
     public SbInfoVO getById(Object id) {
         SbInfoVO vo = mapper.getById(id);
-        if (StringUtils.isNotBlank(vo.getParentId())) {
+        /*if (StringUtils.isNotBlank(vo.getParentId())) {
             SbInfoVO parentVo = mapper.getById(vo.getParentId());
             vo.setParentSbName(parentVo.getName());
-        }
+        }*/
         List<SysFile> sysFiles = sysFileService.getListByTargetAndType(vo.getId(), null);
         List<SysFile> repairFileList = ListUtils.newArrayList();
         List<SysFile> useFileList = ListUtils.newArrayList();