guarantee-lsq 2 سال پیش
والد
کامیت
f4641c68fc

+ 1 - 0
platform-dao/src/main/java/com/platform/dao/dto/sb/SbInfoDTO.java

@@ -35,6 +35,7 @@ public class SbInfoDTO extends BaseDTO implements Serializable {
     /**
      * 设备位号
      */
+    @FieldCompared(name="设备位号")
     private String positionNo;
     /**
      * 父设备位号

+ 6 - 2
platform-dao/src/main/java/com/platform/dao/util/compare/FieldComparedUtils.java

@@ -1,9 +1,12 @@
 package com.platform.dao.util.compare;
 
 import com.platform.common.cache.DictCache;
+import com.platform.common.constant.UpmsRedisKeyConstants;
 import com.platform.common.util.BeanUtils;
 import com.platform.common.util.DateUtils;
+import com.platform.common.util.RedisUtils;
 import com.platform.common.util.StringUtils;
+import com.platform.dao.entity.upms.SysDict;
 import com.platform.dao.util.compare.annotation.FieldCompared;
 
 import javax.persistence.Transient;
@@ -87,10 +90,11 @@ public class FieldComparedUtils {
                     String afterVal = "-";
                     // 根据type类型比较
                     if(fieldCompared.type() == 1){  // 数据字典
+                        Map<Integer, SysDict> maps = RedisUtils.hget(UpmsRedisKeyConstants.DICT_OBJ_BY_VALUE, fieldCompared.value());
                         if(requestField != null){
-                            beforeVal = DictCache.getObjByValue(fieldCompared.value(), requestField);
+                            beforeVal = maps.get(requestField).getLabel();
                         }
-                        afterVal = DictCache.getObjByValue(fieldCompared.value(), fitField);
+                        afterVal = maps.get(fitField).getLabel();
                     } else if(fieldCompared.type() == 2){ // 通过ID查询
                         Object targetObj = BeanUtils.getBean(fieldCompared.value());  // mapper-Bean
                         Class cla = targetObj.getClass();

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

@@ -290,9 +290,9 @@ public class SbMeasureLogServiceImpl extends BaseServiceImpl<SbMeasureLogMapper,
         }*/
         // 更新设备状态
         if (model.getSbStatus()) {
-            sbInfo.setStatus(SbInfoStatusEnum.IN_STORE.getValue());
             String remark = "设备状态由【" + SbInfoStatusEnum.getNameByValue(sbInfo.getStatus()) + "】 ---> 【";
             remark += "在库】";
+            sbInfo.setStatus(SbInfoStatusEnum.IN_STORE.getValue());
             handleSbChangeRecord(remark, model, sbInfo, CommonConstants.CHANGE_TYPE_SB_STATUS);
         }
         sbInfoMapper.updateByPrimaryKey(sbInfo);