|
@@ -1,61 +1,94 @@
|
|
|
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.constant.ApiConstant;
|
|
|
+import com.qmth.boot.api.annotation.Aac;
|
|
|
+import com.qmth.boot.api.annotation.BOOL;
|
|
|
+import com.qmth.sop.business.bean.result.EditResult;
|
|
|
+import com.qmth.sop.business.bean.result.TBQualityProblemApplyResult;
|
|
|
import com.qmth.sop.business.entity.TBQualityProblemApply;
|
|
|
import com.qmth.sop.business.service.TBQualityProblemApplyService;
|
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
|
+import com.qmth.sop.common.enums.*;
|
|
|
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.validation.BindingResult;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import javax.validation.Valid;
|
|
|
import javax.validation.constraints.Max;
|
|
|
import javax.validation.constraints.Min;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
- * <p>
|
|
|
- * 质量问题反馈表 前端控制器
|
|
|
- * </p>
|
|
|
+ * 质量问题反馈表 控制器
|
|
|
*
|
|
|
- * @author wangliang
|
|
|
- * @since 2023-08-01
|
|
|
+ * @author: shudonghui
|
|
|
+ * @date: 2023-08-14 14:00:01
|
|
|
+ * @version: 1.0
|
|
|
+ * @email: shudonghui@qmth.com.cn
|
|
|
+ * @Company: www.qmth.com.cn
|
|
|
*/
|
|
|
-@Api(tags = "质量问题反馈Controller")
|
|
|
+@Api(tags = "质量问题反馈表 Controller")
|
|
|
@RestController
|
|
|
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_QUALITY_PROBLEM)
|
|
|
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_QUALITY_PROBLEM_APPLY)
|
|
|
+@Validated
|
|
|
public class TBQualityProblemApplyController {
|
|
|
- private final static Logger log = LoggerFactory.getLogger(TBQualityProblemApplyController.class);
|
|
|
+
|
|
|
|
|
|
@Resource
|
|
|
- TBQualityProblemApplyService tbQualityProblemApplyService;
|
|
|
+ TBQualityProblemApplyService tBQualityProblemApplyService;
|
|
|
|
|
|
- @ApiOperation(value = "质量问题反馈申请")
|
|
|
- @RequestMapping(value = "/apply", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
|
|
|
- public Result apply(@Valid @RequestBody TBQualityProblemApply tbQualityProblemApply, BindingResult bindingResult) throws InterruptedException {
|
|
|
- if (bindingResult.hasErrors()) {
|
|
|
- return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
|
- }
|
|
|
- return ResultUtil.ok(tbQualityProblemApplyService.saveOrUpdateInfo(tbQualityProblemApply));
|
|
|
+
|
|
|
+ @ApiOperation(value = "质量问题反馈表查询接口")
|
|
|
+ @RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "质量问题反馈表查询结果", response = TBQualityProblemApplyResult.class)})
|
|
|
+ public Result query(
|
|
|
+ @ApiParam(value = "服务单元", required = false) @RequestParam(required = false) Long serviceId,
|
|
|
+ @ApiParam(value = "责任人", required = false) @RequestParam(required = false) Long userId,
|
|
|
+ @ApiParam(value = "问题类型", required = false) @RequestParam(required = false) QualityProblemTypeEnum type,
|
|
|
+ @ApiParam(value = "问题归因", required = false) @RequestParam(required = false) QualityProblemReasonEnum reason,
|
|
|
+ @ApiParam(value = "影响度", required = false) @RequestParam(required = false) InfluenceDegreeEnum degree,
|
|
|
+ @ApiParam(value = "客户名称(模糊查询)", required = false) @RequestParam(required = false) String custom,
|
|
|
+ @ApiParam(value = "质量问题编号(模糊查询) ", required = false) @RequestParam(required = false) String problemNo,
|
|
|
+ @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<TBQualityProblemApplyResult> resultIPage = tBQualityProblemApplyService.query(new Page<>(pageNumber, pageSize), serviceId,userId,type,reason,degree,custom,problemNo,startTime,endTime);
|
|
|
+
|
|
|
+ return ResultUtil.ok(resultIPage);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "质量问题反馈查询")
|
|
|
- @RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
|
+
|
|
|
+ @ApiOperation(value = "质量问题反馈表新增修改接口")
|
|
|
+ @RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
|
|
|
- public Result list(@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();
|
|
|
+ public Result save(@ApiParam(value = "质量问题反馈表信息", required = true) @RequestBody(required = true) TBQualityProblemApply tBQualityProblemApply) {
|
|
|
+ return ResultUtil.ok(tBQualityProblemApplyService.saveTBQualityProblemApply(tBQualityProblemApply));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "质量问题反馈作废")
|
|
|
- @RequestMapping(value = "/cancel", method = RequestMethod.POST)
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "质量问题反馈表删除接口")
|
|
|
+ @RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
|
|
|
- public Result cancel() {
|
|
|
- return ResultUtil.ok();
|
|
|
+ public Result delete(@ApiParam(value = "质量问题反馈表id", required = true) @RequestParam(required = true) long[] ids) {
|
|
|
+ return ResultUtil.ok(tBQualityProblemApplyService.delete(ids));
|
|
|
}
|
|
|
-}
|
|
|
+
|
|
|
+//
|
|
|
+// @Aac(auth= BOOL.FALSE)
|
|
|
+// @ApiOperation(value = "质量问题反馈表获取单个接口")
|
|
|
+// @RequestMapping(value = "/get", method = RequestMethod.GET)
|
|
|
+// @ApiResponses({@ApiResponse(code = 200, message = "质量问题反馈表信息", response = TBQualityProblemApply.class)})
|
|
|
+// public Result get(@ApiParam(value = "质量问题反馈表id", required = true) @RequestParam long id) {
|
|
|
+// return ResultUtil.ok(tBQualityProblemApplyService.getById(id));
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+}
|