|
@@ -1,11 +1,16 @@
|
|
|
package com.qmth.sop.server.api;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.qmth.boot.api.annotation.Aac;
|
|
|
+import com.qmth.boot.api.annotation.BOOL;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
import com.qmth.sop.business.bean.result.SysCustomResult;
|
|
|
-import com.qmth.sop.business.entity.SysCustom;
|
|
|
-import com.qmth.sop.business.entity.TBTask;
|
|
|
+import com.qmth.sop.business.bean.result.SysLevelResult;
|
|
|
+import com.qmth.sop.business.entity.*;
|
|
|
+import com.qmth.sop.business.service.SysCustomRoleService;
|
|
|
import com.qmth.sop.business.service.SysCustomService;
|
|
|
import com.qmth.sop.business.service.TBTaskService;
|
|
|
import com.qmth.sop.business.templete.execute.AsyncSysCustomImportService;
|
|
@@ -49,6 +54,10 @@ public class SysCustomController {
|
|
|
@Resource
|
|
|
TBTaskService tbTaskService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ SysCustomRoleService sysCustomRoleService;
|
|
|
+
|
|
|
+ @Aac(auth= BOOL.FALSE)
|
|
|
@ApiOperation(value = "客户表查询接口")
|
|
|
@RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "客户表列表信息", response = SysCustomResult.class)})
|
|
@@ -63,24 +72,24 @@ public class SysCustomController {
|
|
|
return ResultUtil.ok(resultIPage);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Aac(auth= BOOL.FALSE)
|
|
|
@ApiOperation(value = "新增客户表接口")
|
|
|
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "新增客户表信息", response = Object.class)})
|
|
|
- public Result add(@ApiParam(value = "客户信息", required = true) @RequestBody(required = true) SysCustom sysCustom) {
|
|
|
+ public Result add(@ApiParam(value = "客户信息", required = true) @RequestBody(required = true) SysCustomResult sysCustom) {
|
|
|
sysCustomService.add(sysCustom);
|
|
|
return ResultUtil.ok();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Aac(auth= BOOL.FALSE)
|
|
|
@ApiOperation(value = "修改客户表接口")
|
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "修改客户表信息", response = Object.class)})
|
|
|
- public Result update(@ApiParam(value = "客户信息", required = true) @RequestBody(required = true) SysCustom sysCustom) {
|
|
|
+ public Result update(@ApiParam(value = "客户信息", required = true) @RequestBody(required = true) SysCustomResult sysCustom) {
|
|
|
sysCustomService.update(sysCustom);
|
|
|
return ResultUtil.ok();
|
|
|
}
|
|
|
-
|
|
|
+ @Aac(auth= BOOL.FALSE)
|
|
|
@ApiOperation(value = "删除客户表接口")
|
|
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "删除客户表信息", response = Object.class)})
|
|
@@ -94,13 +103,15 @@ public class SysCustomController {
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
-
|
|
|
+ @Aac(auth= BOOL.FALSE)
|
|
|
@ApiOperation(value = "获取单个客户")
|
|
|
@RequestMapping(value = "/get", method = RequestMethod.GET)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "获取单个客户", response = SysCustom.class)})
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "获取单个客户", response = SysCustomResult.class)})
|
|
|
public Result detail(@ApiParam(value = "客户id", required = true) @RequestParam(required = true) long id) {
|
|
|
SysCustom sysCustom = sysCustomService.getById(id);
|
|
|
- return ResultUtil.ok(sysCustom);
|
|
|
+ SysCustomResult sysCustomResult= JSON.toJavaObject((JSON) JSON.toJSON(sysCustom),SysCustomResult.class);
|
|
|
+ sysCustomResult.setRoleList(sysCustomRoleService.list(new QueryWrapper<SysCustomRole>().lambda().eq(SysCustomRole::getCustomId, sysCustom.getId())));
|
|
|
+ return ResultUtil.ok(sysCustomResult);
|
|
|
}
|
|
|
|
|
|
|