Browse Source

修复内容

2507040827 3 weeks ago
parent
commit
d5ce8b5eee

+ 3 - 3
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/dto/TagImportDto.java

@@ -11,16 +11,16 @@ public class TagImportDto {
     @ExcelProperty("标签名称")
     private String tagNm;
 
-    @ExcelProperty("标签代码")
+    @ExcelProperty("标签编号")
     private String tagCode;
 
     @ExcelProperty("父标签名称")
     private String parentName;
 
-    @ExcelProperty("标签说明")
+    @ExcelProperty("标签定义")
     private String tagRemark;
 
-    @ExcelProperty("标签关键词规则")
+    @ExcelProperty("关键词")
     private String reg;
 
     @ExcelProperty("标签判断说明")

+ 6 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/dto/TagLogDto.java

@@ -40,6 +40,9 @@ public class TagLogDto {
     private LocalDateTime insertTime;
 
     public String getInsertTime() {
+        if(insertTime == null){
+            return "";
+        }
         return insertTime.format(DateTimeFormatter.ofPattern(DateUtils.PATTERN_DATETIME));
     }
 
@@ -97,6 +100,9 @@ public class TagLogDto {
     @ApiModelProperty(value = "反馈时间")
     private LocalDateTime feedbackTime;
     public String getFeedbackTime() {
+        if(feedbackTime == null){
+            return "";
+        }
         return feedbackTime.format(DateTimeFormatter.ofPattern(DateUtils.PATTERN_DATETIME));
     }
 

+ 14 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/AitagTagInfoEntity.java

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Objects;
+
 
 /**
  * 
@@ -113,4 +115,16 @@ public class AitagTagInfoEntity {
     private String reviser;
 
 
+    public boolean valueEqualsValue(AitagTagInfoEntity that) {
+        return  Objects.equals(categoryId, that.categoryId)
+                && Objects.equals(tagNm, that.tagNm)
+                && Objects.equals(tagCode, that.tagCode)
+                && Objects.equals(tagRemark, that.tagRemark)
+                && Objects.equals(parentId, that.parentId)
+                && Objects.equals(reg, that.reg)
+                && Objects.equals(tagLevel, that.tagLevel)
+                && Objects.equals(tagPath, that.tagPath)
+                && Objects.equals(tagPrompt, that.tagPrompt) ;
+    }
+
 }

+ 3 - 1
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/vo/IconResVo.java

@@ -42,10 +42,12 @@ public class IconResVo {
             String month = stat.substring(5, 7);
             String day = stat.substring(8, 10);
             return month + "月" + day + "日";
-        }else{
+        }else if(StringUtils.equals("mother",statType)){
             String year = stat.substring(0, 4);
             String month = stat.substring(5,7);
             return year + "年" + month + "月";
+        }else{
+            return stat;
         }
     }
 }

+ 20 - 17
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/impl/AitagTagInfoServiceImpl.java

@@ -123,14 +123,7 @@ public class AitagTagInfoServiceImpl extends ServiceImpl<AitagTagInfoDao, AitagT
     public String saveTag(AitagTagInfoEntity aitagTagInfo){
         aitagTagInfo.setId(StringUtils.getUUID());
         String parentId = aitagTagInfo.getParentId();
-
-        LambdaQueryWrapper<AitagTagInfoEntity> queryTagInfo = new LambdaQueryWrapper<>();
-        queryTagInfo.eq(AitagTagInfoEntity::getTagCode,aitagTagInfo.getTagCode());
-        queryTagInfo.eq(AitagTagInfoEntity::getIsDelete,TAG_UNDELETED);
-        if(this.baseMapper.selectCount(queryTagInfo) > 0){
-            throw BizException.of("E010");
-        }
-
+        checkTagCodeDuplicate(aitagTagInfo.getTagCode());
         if(!StringUtils.isBlank(parentId)){
             LambdaQueryWrapper<AitagTagInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(AitagTagInfoEntity::getParentId,parentId);
@@ -190,21 +183,20 @@ public class AitagTagInfoServiceImpl extends ServiceImpl<AitagTagInfoDao, AitagT
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void updateTag(AitagTagInfoEntity aitagTagInfoEntity) {
-        AitagTagInfoEntity tagInfo = this.baseMapper.selectById(aitagTagInfoEntity.getId());
+        AitagTagInfoEntity oldTagInfo = this.baseMapper.selectById(aitagTagInfoEntity.getId());
+        if(oldTagInfo.valueEqualsValue(aitagTagInfoEntity)){
+            return;
+        }
         String newTagCode = aitagTagInfoEntity.getTagCode();
-        String oldTagCode = tagInfo.getTagCode();
+        String oldTagCode = oldTagInfo.getTagCode();
         if(!StringUtils.isEmpty(newTagCode) && !StringUtils.equals(oldTagCode,newTagCode)){
-            LambdaQueryWrapper<AitagTagInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(AitagTagInfoEntity::getTagCode,newTagCode);
-            if(this.baseMapper.selectCount(queryWrapper) > 0 ){
-                throw BizException.of("E010");
-            }
+            checkTagCodeDuplicate(newTagCode);
         }
-        AitagTagInfoVersionEntity aitagTagInfoVersionEntity = JSON.parseObject(JSON.toJSONString(tagInfo), AitagTagInfoVersionEntity.class);
+        AitagTagInfoVersionEntity aitagTagInfoVersionEntity = JSON.parseObject(JSON.toJSONString(oldTagInfo), AitagTagInfoVersionEntity.class);
         aitagTagInfoVersionEntity.setId(StringUtils.getUUID());
         this.aitagTagInfoVersionDao.insert(aitagTagInfoVersionEntity);
         aitagTagInfoEntity.setRevisionTime(DateUtils.getCurrDateTimeStr());
-        aitagTagInfoEntity.setTagVersion(Integer.parseInt(tagInfo.getTagVersion())+1+"");
+        aitagTagInfoEntity.setTagVersion(Integer.parseInt(oldTagInfo.getTagVersion())+1+"");
         if(!StringUtils.isBlank(aitagTagInfoEntity.getParentId())){
             AitagTagInfoEntity parentTagInfo = this.baseMapper.selectById(aitagTagInfoEntity.getParentId());
             if(parentTagInfo !=null){
@@ -351,6 +343,8 @@ public class AitagTagInfoServiceImpl extends ServiceImpl<AitagTagInfoDao, AitagT
             throw BizException.of("E018");
         }
         for (TagImportDto tagImportDto: tagImportDtos){
+
+            checkTagCodeDuplicate(tagImportDto.getTagCode());
             AitagTagInfoEntity aitagTagInfo = JSONObject.parseObject(JSONObject.toJSONString(tagImportDto),
                     AitagTagInfoEntity.class);
             String tagPath = tagImportDto.getTagPath();
@@ -371,6 +365,15 @@ public class AitagTagInfoServiceImpl extends ServiceImpl<AitagTagInfoDao, AitagT
 
     }
 
+    private void checkTagCodeDuplicate(String tagCode) {
+        LambdaQueryWrapper<AitagTagInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(AitagTagInfoEntity::getTagCode, tagCode);
+        queryWrapper.eq(AitagTagInfoEntity::getIsDelete,TAG_UNDELETED);
+        if (this.baseMapper.selectCount(queryWrapper) > 0) {
+            throw BizException.of("E010");
+        }
+    }
+
     /**
      * 校验父标签存在性并将赋值parentId
      * @param nameToDtoMap

+ 1 - 1
server/yusp-tagging-core/src/main/resources/messages/yusp_input_msg.properties

@@ -111,7 +111,7 @@ E010=\u6807\u7B7E\u7F16\u7801\u91CD\u590D\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165
 E011=\u6807\u7B7E\u5B58\u5728\u4E0B\u7EA7\u6807\u7B7E\uFF0C\u65E0\u6CD5\u5220\u9664
 E012=\u6807\u7B7E\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A
 E013=\u6807\u7B7E\u4EE3\u7801\u4E0D\u80FD\u4E3A\u7A7A
-E014=\u6A21\u677F\u5217\u6570\u4E0D\u6B63\u786E
+E014=\u6807\u7B7E\u7F16\u53F7\u4E0D\u6B63\u786E
 E015=\u6A21\u677F\u683C\u5F0F\u4E0D\u6B63\u786E
 E016=\u6570\u636E\u884C\u6570\u8D85\u8FC7\u9650\u5236
 E017=\u6587\u4EF6\u5C42\u7EA7\u4E0D\u80FD\u8D85\u8FC74\u7EA7