Przeglądaj źródła

feat: 参数配置开发

chenjianhua 7 miesięcy temu
rodzic
commit
b34cac4385

+ 16 - 7
service-base/src/main/resources/mapper/system/SysConfigMapper.xml

@@ -5,11 +5,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <mapper namespace="com.simuwang.base.mapper.system.SysConfigMapper">
     
     <resultMap type="com.simuwang.base.pojo.dos.SysConfigDO" id="SysConfigResult">
-    	<id     property="configId"      column="configId"      />
-        <result property="configName"    column="configName"    />
-        <result property="configKey"     column="configKey"     />
-        <result property="configValue"   column="configNalue"   />
-        <result property="configType"    column="configType"    />
+    	<id     property="configId"      column="config_id"      />
+        <result property="configName"    column="config_name"    />
+        <result property="configKey"     column="config_key"     />
+        <result property="configValue"   column="config_value"   />
+        <result property="configType"    column="config_type"    />
         <result property="creatorId"     column="creatorid"      />
         <result property="createTime"    column="createtime"    />
         <result property="updaterId"     column="updaterid"      />
@@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <!-- 查询条件 -->
 	<sql id="sqlwhereSearch">
 		<where>
+            isvalid=1
 			<if test="configId !=null">
 				and config_id = #{configId}
 			</if>
@@ -67,7 +68,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="countConfigList" resultType="java.lang.Long">
         select count(1) from PPW_EMAIL.sys_config
-        <include refid="sqlwhereSearch"/>
+        <where>
+            isvalid=1
+            <if test="configName != null and configName != ''">
+                AND config_name like concat('%', #{configName}, '%')
+            </if>
+            <if test="configKey != null and configKey != ''">
+                AND config_key like concat('%', #{configKey}, '%')
+            </if>
+        </where>
     </select>
 
     <insert id="insertConfig" parameterType="com.simuwang.base.pojo.dos.SysConfigDO">
@@ -81,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="remark != null and remark != ''">remark,</if>
             isvalid,
  			createtime,
-            updatetime,
+            updatetime
         )values(
 			<if test="configName != null and configName != ''">#{configName},</if>
 			<if test="configKey != null and configKey != ''">#{configKey},</if>

+ 3 - 3
service-manage/src/main/java/com/simuwang/manage/api/system/SysConfigController.java

@@ -18,8 +18,8 @@ import org.springframework.web.bind.annotation.*;
  * @author ruoyi
  */
 @SystemLog(value = "参数配置管理")
-@Controller
-@RequestMapping("/v1/system/config")
+@RestController
+@RequestMapping("/v1/sys/config")
 public class SysConfigController
 {
     @Autowired
@@ -54,7 +54,7 @@ public class SysConfigController
      * @return
      */
     @SystemLog("编辑查询")
-    @PostMapping("/search-config")
+    @GetMapping("/search-config")
     public ResultVo searchConfigList(@RequestBody ConfigIdVO configIdVO) {
         SysConfigVO sysConfigVO = configService.searchConfigById(configIdVO.getConfigId());
         return new ResultVo(sysConfigVO==null?false:sysConfigVO);

+ 1 - 1
service-manage/src/main/java/com/simuwang/manage/service/impl/system/SysConfigServiceImpl.java

@@ -68,7 +68,7 @@ public class SysConfigServiceImpl implements SysConfigService {
         Integer userId = UserUtils.getLoginUser().getUserId();
         ResultVo vo = new ResultVo(ResultCode.SAVE_SUCCESS);
         vo.setData(true);
-        if(sysConfigVO.getConfigId() == null && checkConfigKeyUnique(sysConfigVO)){
+        if(sysConfigVO.getConfigId() == null && !checkConfigKeyUnique(sysConfigVO)){
             vo.setMsg("已存在相同的参数配置信息,无须重复添加");
             vo.setData(false);
             return vo;