Forráskód Böngészése

修改基础配置

车车 7 hónapja
szülő
commit
5ffc34bc42

+ 16 - 15
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsSystemAttributeController.java

@@ -32,8 +32,7 @@ import java.util.List;
 @Api(tags = "基础数据")
 @RestController
 @RequestMapping("/iscs/attribute")
-public class IsSystemAttributeController extends BaseController
-{
+public class IsSystemAttributeController extends BaseController {
     @Autowired
     private IIsSystemAttributeService isSystemAttributeService;
 
@@ -44,8 +43,7 @@ public class IsSystemAttributeController extends BaseController
     })
     @PreAuthorize("@ss.hasPermi('iscs:attribute:list')")
     @GetMapping("/getIsSystemAttributePage")
-    public CommonResult<Page<IsSystemAttribute>> getIsSystemAttributePage(Page<IsSystemAttribute> page, IsSystemAttribute isSystemAttribute)
-    {
+    public CommonResult<Page<IsSystemAttribute>> getIsSystemAttributePage(Page<IsSystemAttribute> page, IsSystemAttribute isSystemAttribute) {
         Page<IsSystemAttribute> result = isSystemAttributeService.getIsSystemAttributePage(page, isSystemAttribute);
         return CommonResult.success(result);
     }
@@ -55,8 +53,7 @@ public class IsSystemAttributeController extends BaseController
     @PreAuthorize("@ss.hasPermi('iscs:attribute:export')")
     @Log(title = "基础数据", businessType = BusinessType.EXPORT)
     @PostMapping("/exportIsSystemAttribute")
-    public void exportIsSystemAttribute(HttpServletResponse response, IsSystemAttribute isSystemAttribute)
-    {
+    public void exportIsSystemAttribute(HttpServletResponse response, IsSystemAttribute isSystemAttribute) {
         Page<IsSystemAttribute> page = new Page<>();
         page.setSize(-1);
         page.setCurrent(1);
@@ -70,8 +67,7 @@ public class IsSystemAttributeController extends BaseController
     @Parameter(name = "id", description = "id")
     @PreAuthorize("@ss.hasPermi('iscs:attribute:query')")
     @GetMapping(value = "/selectIsSystemAttributeById")
-    public CommonResult<IsSystemAttribute> selectIsSystemAttributeById(Long id)
-    {
+    public CommonResult<IsSystemAttribute> selectIsSystemAttributeById(Long id) {
         return CommonResult.success(isSystemAttributeService.getById(id));
     }
 
@@ -79,8 +75,7 @@ public class IsSystemAttributeController extends BaseController
     @PreAuthorize("@ss.hasPermi('iscs:attribute:add')")
     @Log(title = "基础数据", businessType = BusinessType.INSERT)
     @PostMapping("/insertIsSystemAttribute")
-    public CommonResult<Boolean> insertIsSystemAttribute(@RequestBody @Parameter(name = "isSystemAttribute", description = "新增数据类,放到body") IsSystemAttribute isSystemAttribute)
-    {
+    public CommonResult<Boolean> insertIsSystemAttribute(@RequestBody @Parameter(name = "isSystemAttribute", description = "新增数据类,放到body") IsSystemAttribute isSystemAttribute) {
         return CommonResult.success(isSystemAttributeService.save(isSystemAttribute));
     }
 
@@ -88,19 +83,25 @@ public class IsSystemAttributeController extends BaseController
     @PreAuthorize("@ss.hasPermi('iscs:attribute:edit')")
     @Log(title = "基础数据", businessType = BusinessType.UPDATE)
     @PostMapping("/updateIsSystemAttribute")
-    public CommonResult<Boolean> updateIsSystemAttribute(@RequestBody @Parameter(name = "isSystemAttribute", description = "修改数据类,放到body") IsSystemAttribute isSystemAttribute)
-    {
+    public CommonResult<Boolean> updateIsSystemAttribute(@RequestBody @Parameter(name = "isSystemAttribute", description = "修改数据类,放到body") IsSystemAttribute isSystemAttribute) {
         return CommonResult.success(isSystemAttributeService.updateById(isSystemAttribute));
     }
 
     @ApiOperation("删除基础数据")
     @PreAuthorize("@ss.hasPermi('iscs:attribute:remove')")
     @Log(title = "基础数据", businessType = BusinessType.DELETE)
-	@PostMapping("/deleteIsSystemAttributeByIds")
-    public CommonResult<Boolean> deleteIsSystemAttributeByIds(String ids)
-    {
+    @PostMapping("/deleteIsSystemAttributeByIds")
+    public CommonResult<Boolean> deleteIsSystemAttributeByIds(String ids) {
         Assert.notBlank(ids, "请选择需要删除的数据!");
         Long[] longIds = Convert.toLongArray(ids);
         return CommonResult.success(isSystemAttributeService.removeBatchByIds(Arrays.asList(longIds)));
     }
+
+    @ApiOperation("通过sysAttrKey查询数据")
+    @Parameter(name = "sysAttrKey", description = "参数键名")
+    @GetMapping("/getIsSystemAttributeByKey")
+    public CommonResult<IsSystemAttribute> getIsSystemAttributeByKey(String sysAttrKey) {
+        IsSystemAttribute result = isSystemAttributeService.getIsSystemAttributeByKey(sysAttrKey);
+        return CommonResult.success(result);
+    }
 }

+ 2 - 2
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsSystemAttribute.java

@@ -36,8 +36,8 @@ public class IsSystemAttribute extends BaseBean
     @Excel(name = "参数键值")
     private String sysAttrValue;
 
-    @ApiModelProperty(value = "系统内置(Y是 N否)")
-    @Excel(name = "系统内置(Y是 N否)")
+    @ApiModelProperty(value = "分类")
+    @Excel(name = "分类")
     private String sysAttrType;
 
     @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")

+ 3 - 2
ktg-iscs/src/main/java/com/ktg/iscs/service/IIsSystemAttributeService.java

@@ -1,8 +1,7 @@
 package com.ktg.iscs.service;
 
-import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ktg.iscs.domain.IsSystemAttribute;
 
 /**
@@ -15,4 +14,6 @@ public interface IIsSystemAttributeService extends IService<IsSystemAttribute> {
 
     Page<IsSystemAttribute> getIsSystemAttributePage(Page<IsSystemAttribute> page, IsSystemAttribute isSystemAttribute);
 
+    IsSystemAttribute getIsSystemAttributeByKey(String sysAttrKey);
+
 }

+ 9 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsSystemAttributeServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ktg.iscs.service.impl;
 
+import cn.hutool.core.lang.Assert;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -32,4 +33,12 @@ public class IsSystemAttributeServiceImpl extends ServiceImpl<IsSystemAttributeM
         return result;
     }
 
+    @Override
+    public IsSystemAttribute getIsSystemAttributeByKey(String sysAttrKey) {
+        Assert.notBlank(sysAttrKey, "请传入key");
+        IsSystemAttribute one = getOne(Wrappers.<IsSystemAttribute>lambdaQuery()
+                .eq(IsSystemAttribute::getSysAttrKey, sysAttrKey));
+        return one;
+    }
+
 }