|
@@ -2,8 +2,6 @@ package com.qmth.sop.server.api;
|
|
|
|
|
|
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.TBViolationResult;
|
|
|
import com.qmth.sop.business.entity.TBViolation;
|
|
@@ -15,7 +13,6 @@ import com.qmth.sop.common.util.Result;
|
|
|
import com.qmth.sop.common.util.ResultUtil;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -25,7 +22,7 @@ import javax.validation.constraints.Min;
|
|
|
|
|
|
/**
|
|
|
* sop违规登记表 控制器
|
|
|
- *
|
|
|
+ *
|
|
|
* @author: shudonghui
|
|
|
* @date: 2023-08-09 10:33:08
|
|
|
* @version: 1.0
|
|
@@ -34,37 +31,35 @@ import javax.validation.constraints.Min;
|
|
|
*/
|
|
|
@Api(tags = "sop违规登记表 Controller")
|
|
|
@RestController
|
|
|
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX+SystemConstant.PREFIX_URL_VIOLATION)
|
|
|
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_VIOLATION)
|
|
|
public class TBViolationController {
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
TBViolationService tBViolationService;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
@ApiOperation(value = "sop违规登记表查询接口")
|
|
|
@RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "sop违规登记表查询结果", response = TBViolationResult.class)})
|
|
|
public Result query(
|
|
|
- @ApiParam(value = "服务单元", required = false) @RequestParam(required = false) Long serviceId,
|
|
|
- @ApiParam(value = "违规类型", required = false) @RequestParam(required = false) ViolationTypeEnum type,
|
|
|
- @ApiParam(value = "跟进状态", required = false) @RequestParam(required = false) ViolationStatusEnum status,
|
|
|
- @ApiParam(value = "节点负责人", required = false) @RequestParam(required = false) Long userId,
|
|
|
- @ApiParam(value = "客户名称(模糊查询)", required = false) @RequestParam(required = false) String custom,
|
|
|
- @ApiParam(value = "SOP流水号(模糊查询)", required = false) @RequestParam(required = false) String sopNo,
|
|
|
- @ApiParam(value = "登记人", required = false) @RequestParam(required = false) Long createId,
|
|
|
- @ApiParam(value = "登记时间开始", required = false) @RequestParam(required = false) Long startTime,
|
|
|
- @ApiParam(value = "登记时间结束", required = false) @RequestParam(required = false) Long endTime,
|
|
|
- @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) {
|
|
|
- IPage<TBViolationResult> resultIPage = tBViolationService.query(new Page<>(pageNumber, pageSize),serviceId,type,status,userId,custom,sopNo,createId,startTime,endTime,null);
|
|
|
+ @ApiParam(value = "服务单元", required = false) @RequestParam(required = false) Long serviceId,
|
|
|
+ @ApiParam(value = "违规类型", required = false) @RequestParam(required = false) ViolationTypeEnum type,
|
|
|
+ @ApiParam(value = "跟进状态", required = false) @RequestParam(required = false) ViolationStatusEnum status,
|
|
|
+ @ApiParam(value = "节点负责人", required = false) @RequestParam(required = false) Long userId,
|
|
|
+ @ApiParam(value = "客户名称(模糊查询)", required = false) @RequestParam(required = false) String custom,
|
|
|
+ @ApiParam(value = "SOP流水号(模糊查询)", required = false) @RequestParam(required = false) String sopNo,
|
|
|
+ @ApiParam(value = "登记人", required = false) @RequestParam(required = false) Long createId,
|
|
|
+ @ApiParam(value = "登记时间开始", required = false) @RequestParam(required = false) Long startTime,
|
|
|
+ @ApiParam(value = "登记时间结束", required = false) @RequestParam(required = false) Long endTime,
|
|
|
+ @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) {
|
|
|
+ IPage<TBViolationResult> resultIPage = tBViolationService.query(new Page<>(pageNumber, pageSize), serviceId, type, status, userId, custom, sopNo, createId, startTime, endTime, null);
|
|
|
|
|
|
return ResultUtil.ok(resultIPage);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@ApiOperation(value = "sop违规登记表新增修改接口")
|
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
|
|
@@ -77,35 +72,33 @@ public class TBViolationController {
|
|
|
|
|
|
|
|
|
//关闭违规登记
|
|
|
-
|
|
|
+
|
|
|
@ApiOperation(value = "关闭违规登记")
|
|
|
@RequestMapping(value = "/close", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "关闭成功")})
|
|
|
public Result close(@ApiParam(value = "违规登记id", required = true) @RequestParam(required = true) long id) {
|
|
|
- TBViolation tBViolation = tBViolationService.getById(id);
|
|
|
+ TBViolation tBViolation = tBViolationService.getById(id);
|
|
|
tBViolation.setStatus(ViolationStatusEnum.CLOSE);
|
|
|
return ResultUtil.ok(tBViolationService.saveTBViolation(tBViolation));
|
|
|
}
|
|
|
|
|
|
//重启违规登记
|
|
|
-
|
|
|
+
|
|
|
@ApiOperation(value = "重启违规登记")
|
|
|
@RequestMapping(value = "/restart", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "重启成功")})
|
|
|
public Result restart(@ApiParam(value = "违规登记id", required = true) @RequestParam(required = true) long id) {
|
|
|
- TBViolation tBViolation = tBViolationService.getById(id);
|
|
|
+ TBViolation tBViolation = tBViolationService.getById(id);
|
|
|
tBViolation.setStatus(ViolationStatusEnum.RESTART);
|
|
|
return ResultUtil.ok(tBViolationService.saveTBViolation(tBViolation));
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@ApiOperation(value = "sop违规登记表获取单个接口")
|
|
|
@RequestMapping(value = "/get", method = RequestMethod.GET)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "sop违规登记表信息", response = TBViolationResult.class)})
|
|
|
public Result get(@ApiParam(value = "sop违规登记表id", required = true) @RequestParam long id) {
|
|
|
- IPage<TBViolationResult> resultIPage = tBViolationService.query(new Page<>(1, 1),null,null,null,null,null,null,null,null,null,null);
|
|
|
+ IPage<TBViolationResult> resultIPage = tBViolationService.query(new Page<>(1, 1), null, null, null, null, null, null, null, null, null, null);
|
|
|
return ResultUtil.ok(resultIPage.getRecords().get(0));
|
|
|
}
|
|
|
|