|
|
|
@ -109,9 +109,8 @@ public class InspectionResultController extends DafController { |
|
|
|
|
@PostMapping("/submit") |
|
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入inspectionResult") |
|
|
|
|
public R submit(@Valid @RequestBody InspectionResult inspectionResult, @ApiParam(value = "编号", required = true) @RequestParam String taskNo) { |
|
|
|
|
inspectionResult.setTaskNo(taskNo); |
|
|
|
|
String maxResultNo = inspectionResultService.getMaxResultNo("'%" + taskNo + "%'"); |
|
|
|
|
public R submit(@Valid @RequestBody InspectionResult inspectionResult) { |
|
|
|
|
String maxResultNo = inspectionResultService.getMaxResultNo("'%" + inspectionResult.getTaskNo() + "%'"); |
|
|
|
|
int number; |
|
|
|
|
if (StringUtil.isNotEmpty(maxResultNo)){ |
|
|
|
|
number = Integer.parseInt(maxResultNo.substring(13)); |
|
|
|
@ -120,7 +119,8 @@ public class InspectionResultController extends DafController { |
|
|
|
|
number = 1; |
|
|
|
|
} |
|
|
|
|
String numFormat = String.format("%04d", number); |
|
|
|
|
String resultNo = taskNo + numFormat; |
|
|
|
|
String resultNo = inspectionResult.getTaskNo() + numFormat; |
|
|
|
|
inspectionResult.setResultNo(resultNo); |
|
|
|
|
return R.status(inspectionResultService.saveOrUpdate(inspectionResult)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|