|
@@ -3,22 +3,26 @@ package com.qmth.sop.server.api;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.sop.business.bean.result.EditResult;
|
|
import com.qmth.sop.business.bean.result.EditResult;
|
|
|
|
+import com.qmth.sop.business.entity.TBCrmDetail;
|
|
import com.qmth.sop.business.service.TBCrmDetailService;
|
|
import com.qmth.sop.business.service.TBCrmDetailService;
|
|
|
|
+import com.qmth.sop.common.annotation.OperationLog;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.enums.ExceptionResultEnum;
|
|
import com.qmth.sop.common.enums.ExceptionResultEnum;
|
|
|
|
+import com.qmth.sop.common.enums.LogTypeEnum;
|
|
import com.qmth.sop.common.lock.MemoryLock;
|
|
import com.qmth.sop.common.lock.MemoryLock;
|
|
import com.qmth.sop.common.util.Result;
|
|
import com.qmth.sop.common.util.Result;
|
|
import com.qmth.sop.common.util.ResultUtil;
|
|
import com.qmth.sop.common.util.ResultUtil;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.validation.BindingResult;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import javax.validation.Valid;
|
|
|
|
+import javax.validation.constraints.Max;
|
|
|
|
+import javax.validation.constraints.Min;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -41,16 +45,63 @@ public class TBCrmDetailController {
|
|
@Resource
|
|
@Resource
|
|
TBCrmDetailService tbCrmDetailService;
|
|
TBCrmDetailService tbCrmDetailService;
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "获取派单信息")
|
|
|
|
+ @RequestMapping(value = "/sop/var/info", method = RequestMethod.POST)
|
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "派单信息", response = EditResult.class) })
|
|
|
|
+ public Result info(@ApiParam(value = "派单号", required = true) @RequestParam String crmNo) {
|
|
|
|
+ return ResultUtil.ok(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "派单明细sop变量保存")
|
|
@ApiOperation(value = "派单明细sop变量保存")
|
|
@RequestMapping(value = "/sop/var/save", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/sop/var/save", method = RequestMethod.POST)
|
|
|
|
+ @OperationLog(logType = LogTypeEnum.UPDATE)
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "派单明细sop变量信息", response = EditResult.class) })
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "派单明细sop变量信息", response = EditResult.class) })
|
|
public Result sopVarSave(@ApiParam(value = "派单号", required = true) @RequestParam String crmNo,
|
|
public Result sopVarSave(@ApiParam(value = "派单号", required = true) @RequestParam String crmNo,
|
|
@ApiParam(value = "过程变量", required = true) @RequestParam String processVar) {
|
|
@ApiParam(value = "过程变量", required = true) @RequestParam String processVar) {
|
|
return ResultUtil.ok(tbCrmDetailService.sopVarSave(crmNo, processVar));
|
|
return ResultUtil.ok(tbCrmDetailService.sopVarSave(crmNo, processVar));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "获取派单明细sop信息")
|
|
|
|
+ @RequestMapping(value = "/sop/info", method = RequestMethod.POST)
|
|
|
|
+ @OperationLog(logType = LogTypeEnum.SEARCH)
|
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "派单明细sop信息", response = EditResult.class) })
|
|
|
|
+ public Result sopInfo(@ApiParam(value = "派单号", required = true) @RequestParam String crmNo,
|
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
+ @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
|
+ return ResultUtil.ok(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "创建/编辑派单明细sop")
|
|
|
|
+ @RequestMapping(value = "/sop/save", method = RequestMethod.POST)
|
|
|
|
+ @OperationLog(logType = LogTypeEnum.ADD)
|
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "派单明细sop信息", response = EditResult.class) })
|
|
|
|
+ public Result sopCreate(@Valid @ApiParam(value = "派单明细sop信息", required = true) @RequestBody TBCrmDetail tbCrmDetail,
|
|
|
|
+ BindingResult bindingResult) {
|
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
|
+ return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
|
|
+ }
|
|
|
|
+ return ResultUtil.ok(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "派单明细sop发布")
|
|
|
|
+ @RequestMapping(value = "/sop/publish", method = RequestMethod.POST)
|
|
|
|
+ @OperationLog(logType = LogTypeEnum.EDIT)
|
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "派单明细sop发布", response = EditResult.class) })
|
|
|
|
+ public Result sopPublish(@ApiParam(value = "派单明细sopId", required = true) @RequestParam Long id) {
|
|
|
|
+ return ResultUtil.ok(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "派单明细sop删除")
|
|
|
|
+ @RequestMapping(value = "/sop/delete", method = RequestMethod.POST)
|
|
|
|
+ @OperationLog(logType = LogTypeEnum.DELETE)
|
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "派单明细sop删除", response = EditResult.class) })
|
|
|
|
+ public Result sopDelete(@ApiParam(value = "派单明细sopId", required = true) @RequestParam Long id) {
|
|
|
|
+ return ResultUtil.ok(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "导入派单明细")
|
|
@ApiOperation(value = "导入派单明细")
|
|
@RequestMapping(value = "/sop/import", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/sop/import", method = RequestMethod.POST)
|
|
|
|
+ @OperationLog(logType = LogTypeEnum.IMPORT)
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "导入成功", response = EditResult.class) })
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "导入成功", response = EditResult.class) })
|
|
public Result sopImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
|
|
public Result sopImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
|
|
@ApiParam(value = "派单号", required = true) @RequestParam String crmNo) {
|
|
@ApiParam(value = "派单号", required = true) @RequestParam String crmNo) {
|