zouxuan 3 роки тому
батько
коміт
db9a2ec17e

+ 39 - 39
mec-web/src/main/java/com/ym/mec/web/controller/SysTenantConfigController.java

@@ -4,6 +4,7 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.SysConfig;
 import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysTenantConfigService;
 import com.ym.mec.common.controller.BaseController;
 import com.yonge.log.model.AuditLogAnnotation;
 import io.swagger.annotations.Api;
@@ -30,7 +31,7 @@ import java.util.Map;
 public class SysTenantConfigController extends BaseController {
 
 	@Autowired
-	private SysConfigService sysConfigService;
+	private SysTenantConfigService sysTenantConfigService;
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
 
@@ -39,11 +40,10 @@ public class SysTenantConfigController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('sysConfig/list')")
 	public Object configList(String group) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		Map<String,Object> params = new HashMap<String, Object>();
+		Map<String,Object> params = new HashMap<String, Object>(2);
 		params.put("group", group);
 		params.put("tenantId", sysUser.getTenantId());
-		List<SysConfig> configs = sysConfigService.findAll(params);
-		return succeed(configs);
+		return succeed(sysTenantConfigService.findAll(params));
 	}
 
 	@ApiOperation(value = "修改参数")
@@ -52,43 +52,43 @@ public class SysTenantConfigController extends BaseController {
 	@AuditLogAnnotation(operateName = "修改参数")
 	public Object update(SysConfig config) {
 		config.setModifyOn(new Date());
-		sysConfigService.update(config);
+//		sysConfigService.update(config);
 		return succeed();
 	}
 
-	@ApiOperation(value = "新增参数")
-	@PostMapping(value = "add")
-    @PreAuthorize("@pcs.hasPermissions('sysConfig/add')")
-	public Object addConfig(SysConfig config) {
-		if (config == null)
-			return failed("参数无效");
-		if (StringUtils.isBlank(config.getParamName())) {
-			return failed("参数名称不能为空");
-		}
-		if (StringUtils.isBlank(config.getParanValue())) {
-			return failed("参数值不能为空");
-		}
-		config.setCreateOn(new Date());
-		config.setModifyOn(new Date());
-		return sysConfigService.insert(config) > 0 ? succeed() : failed("添加失败");
-	}
+//	@ApiOperation(value = "新增参数")
+//	@PostMapping(value = "add")
+//    @PreAuthorize("@pcs.hasPermissions('sysConfig/add')")
+//	public Object addConfig(SysConfig config) {
+//		if (config == null)
+//			return failed("参数无效");
+//		if (StringUtils.isBlank(config.getParamName())) {
+//			return failed("参数名称不能为空");
+//		}
+//		if (StringUtils.isBlank(config.getParanValue())) {
+//			return failed("参数值不能为空");
+//		}
+//		config.setCreateOn(new Date());
+//		config.setModifyOn(new Date());
+//		return sysConfigService.insert(config) > 0 ? succeed() : failed("添加失败");
+//	}
 
-	@ApiOperation(value = "查询参数")
-	@GetMapping(value = "get")
-    @PreAuthorize("@pcs.hasPermissions('sysConfig/get')")
-	public Object getConfig(Long id) {
-		if (id == null || id <= 0)
-			return failed("请检查输入的ID");
-		return succeed(sysConfigService.get(id));
-	}
-
-	@ApiOperation(value = "查询参数")
-	@GetMapping(value = "queryByParamName")
-    @PreAuthorize("@pcs.hasPermissions('sysConfig/queryByParamName')")
-	public Object queryByParamName(String paramName) {
-		if(StringUtils.isBlank(paramName)){
-			return failed("参数不能为空");
-		}
-		return succeed(sysConfigService.findByParamName(paramName));
-	}
+//	@ApiOperation(value = "查询参数")
+//	@GetMapping(value = "get")
+//    @PreAuthorize("@pcs.hasPermissions('sysConfig/get')")
+//	public Object getConfig(Long id) {
+//		if (id == null || id <= 0)
+//			return failed("请检查输入的ID");
+//		return succeed(sysConfigService.get(id));
+//	}
+//
+//	@ApiOperation(value = "查询参数")
+//	@GetMapping(value = "queryByParamName")
+//    @PreAuthorize("@pcs.hasPermissions('sysConfig/queryByParamName')")
+//	public Object queryByParamName(String paramName) {
+//		if(StringUtils.isBlank(paramName)){
+//			return failed("参数不能为空");
+//		}
+//		return succeed(sysConfigService.findByParamName(paramName));
+//	}
 }