Bläddra i källkod

Merge remote-tracking branch 'origin/dev_1.1.0' into dev_1.1.0

caozixuan 1 år sedan
förälder
incheckning
c0033a93a6

+ 55 - 4
sop-api/src/main/java/com/qmth/sop/server/api/TBCrmDetailController.java

@@ -3,22 +3,26 @@ package com.qmth.sop.server.api;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.exception.ApiException;
 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.common.annotation.OperationLog;
 import com.qmth.sop.common.contant.SystemConstant;
 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.util.Result;
 import com.qmth.sop.common.util.ResultUtil;
 import io.swagger.annotations.*;
 import org.slf4j.Logger;
 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 javax.annotation.Resource;
+import javax.validation.Valid;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
 import java.util.Map;
 
 /**
@@ -41,16 +45,63 @@ public class TBCrmDetailController {
     @Resource
     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变量保存")
     @RequestMapping(value = "/sop/var/save", method = RequestMethod.POST)
+    @OperationLog(logType = LogTypeEnum.UPDATE)
     @ApiResponses({ @ApiResponse(code = 200, message = "派单明细sop变量信息", response = EditResult.class) })
     public Result sopVarSave(@ApiParam(value = "派单号", required = true) @RequestParam String crmNo,
             @ApiParam(value = "过程变量", required = true) @RequestParam String 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 = "导入派单明细")
     @RequestMapping(value = "/sop/import", method = RequestMethod.POST)
+    @OperationLog(logType = LogTypeEnum.IMPORT)
     @ApiResponses({ @ApiResponse(code = 200, message = "导入成功", response = EditResult.class) })
     public Result sopImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
             @ApiParam(value = "派单号", required = true) @RequestParam String crmNo) {

+ 9 - 0
sop-business/src/main/java/com/qmth/sop/business/entity/TBCrmDetail.java

@@ -9,6 +9,7 @@ import com.qmth.sop.common.enums.ServiceScopeEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 
 /**
@@ -25,6 +26,7 @@ public class TBCrmDetail extends BaseEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @ApiModelProperty(value = "派单号")
+    @NotNull(message = "派单号不能为空")
     private String crmNo;
 
     @ApiModelProperty(value = "流程部署id")
@@ -37,9 +39,11 @@ public class TBCrmDetail extends BaseEntity implements Serializable {
     private CrmStatusEnum status;
 
     @ApiModelProperty(value = "科目名称")
+    @NotNull(message = "科目名称不能为空")
     private String courseName;
 
     @ApiModelProperty(value = "考生人数")
+    @NotNull(message = "考生人数不能为空")
     private Integer examStudentCount;
 
     @ApiModelProperty(value = "联系人")
@@ -49,18 +53,23 @@ public class TBCrmDetail extends BaseEntity implements Serializable {
     private String mobileNumber;
 
     @ApiModelProperty(value = "服务范围,SCAN:仅扫描,SCAN_MARK:扫描+阅卷")
+    @NotNull(message = "服务范围不能为空")
     private ServiceScopeEnum serviceScope;
 
     @ApiModelProperty(value = "扫描开始时间")
+    @NotNull(message = "扫描开始时间不能为空")
     private Long scanStartTime;
 
     @ApiModelProperty(value = "扫描结束时间")
+    @NotNull(message = "扫描结束时间不能为空")
     private Long scanEndTime;
 
     @ApiModelProperty(value = "阅卷开始时间")
+    @NotNull(message = "阅卷开始时间不能为空")
     private Long markPaperStartTime;
 
     @ApiModelProperty(value = "阅卷结束时间")
+    @NotNull(message = "阅卷结束时间不能为空")
     private Long markPaperEndTime;
 
     public TBCrmDetail() {

+ 17 - 2
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -47,10 +47,25 @@ CREATE TABLE t_b_crm_detail
 
 INSERT INTO sys_privilege
 (id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
-VALUES(3079, '创建sop', 'CreateSop', 'LINK', 51, 4, 'AUTH', NULL, 1, 0, 1);
+VALUES(3080, '导入派单明细', '/api/admin/tb/crm/detail/sop/import', 'URL', 3079, 1, 'AUTH', NULL, 1, 1, 0);
 INSERT INTO sys_privilege
 (id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
-VALUES(3080, '导入派单明细', '/api/admin/tb/crm/detail/sop/import', 'URL', 3079, 1, 'AUTH', NULL, 1, 1, 0);
+VALUES(3081, '获取派单信息', '/api/admin/tb/crm/detail/sop/var/info', 'URL', 3079, 2, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3082, '派单明细sop变量保存', '/api/admin/tb/crm/detail/sop/var/save', 'URL', 3079, 3, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3083, '获取派单明细sop信息', '/api/admin/tb/crm/detail/sop/info', 'URL', 3079, 4, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3084, '创建/编辑派单明细sop', '/api/admin/tb/crm/detail/sop/save', 'URL', 3079, 5, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3085, '派单明细sop发布', '/api/admin/tb/crm/detail/sop/publish', 'URL', 3079, 6, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3086, '派单明细sop删除', '/api/admin/tb/crm/detail/sop/delete', 'URL', 3079, 7, 'AUTH', NULL, 1, 1, 0);
 
 ALTER TABLE t_b_crm ADD process_var MEDIUMTEXT
     COMMENT '过程变量' NULL after publish_time;