瀏覽代碼

主题配置多选

lidongyu 1 年之前
父節點
當前提交
686eff2700

+ 5 - 1
sooka-jnb/src/main/java/com/sooka/jnb/handleAffairs/domain/TopicType.java

@@ -7,6 +7,8 @@ import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
 
 /**
  * 主题类型配置对象 jnb_topic_type
@@ -33,7 +35,9 @@ public class TopicType extends BaseEntity
 
     /** 办理对象(字典值:个人or法人) */
     @Excel(name = "办理对象", readConverterExp = "字=典值:个人or法人",dictType = "object_application")
-    @NotBlank(message = "办理对象不能为空")
     private String objectOfHandling;
 
+    @NotEmpty(message = "办理对象不能为空")
+    private List<String> objectOfHandlingArray;
+
 }

+ 11 - 4
sooka-jnb/src/main/java/com/sooka/jnb/handleAffairs/service/impl/TopicTypeServiceImpl.java

@@ -1,5 +1,6 @@
 package com.sooka.jnb.handleAffairs.service.impl;
 
+import java.util.Arrays;
 import java.util.List;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
@@ -29,8 +30,9 @@ public class TopicTypeServiceImpl implements ITopicTypeService
      */
     @Override
     public TopicType selectTopicTypeById(Long id)
-    {
-        return topicTypeMapper.selectTopicTypeById(id);
+    {   TopicType topicType = topicTypeMapper.selectTopicTypeById(id);
+        topicType.setObjectOfHandlingArray(Arrays.asList(topicType.getObjectOfHandling().split(",")));
+        return topicType;
     }
 
     /**
@@ -41,8 +43,11 @@ public class TopicTypeServiceImpl implements ITopicTypeService
      */
     @Override
     public List<TopicType> selectTopicTypeList(TopicType topicType)
-    {
-        return topicTypeMapper.selectTopicTypeList(topicType);
+    {   List<TopicType> list = topicTypeMapper.selectTopicTypeList(topicType);
+        list.forEach(e->{
+            e.setObjectOfHandlingArray(Arrays.asList(e.getObjectOfHandling().split(",")));
+        });
+        return list;
     }
 
     /**
@@ -57,6 +62,7 @@ public class TopicTypeServiceImpl implements ITopicTypeService
         topicType.setCreateTime(DateUtils.getNowDate());
         topicType.setCreateBy(SecurityUtils.getUserId().toString());
         topicType.setDelFlag("0");
+        topicType.setObjectOfHandling(String.join(",",topicType.getObjectOfHandlingArray()));
         return topicTypeMapper.insertTopicType(topicType);
     }
 
@@ -71,6 +77,7 @@ public class TopicTypeServiceImpl implements ITopicTypeService
     {
         topicType.setUpdateTime(DateUtils.getNowDate());
         topicType.setUpdateBy(SecurityUtils.getUserId().toString());
+        topicType.setObjectOfHandling(String.join(",",topicType.getObjectOfHandlingArray()));
         return topicTypeMapper.updateTopicType(topicType);
     }