From c22b5eb143260a98b9aab8fc3281ffa2a5ca2eed Mon Sep 17 00:00:00 2001 From: mg <maokecheng@163.com> Date: 星期五, 28 十月 2022 18:07:42 +0800 Subject: [PATCH] 修改 --- ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java index 8ac83fb..5ee1b2c 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java @@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ycl.annotation.LogSave; import com.ycl.api.CommonResult; import com.ycl.common.constant.BaseCaseStatus; +import com.ycl.common.util.UtilNumber; import com.ycl.controller.BaseController; import com.ycl.dto.casePool.IllegalBuildingParam; import com.ycl.dto.casePool.ViolationParam; @@ -26,8 +28,9 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; -import java.util.UUID; /** @@ -53,6 +56,9 @@ @Autowired IDisposeRecordService iDisposeRecordService; + + @Autowired + UtilNumber utilNumber; @Autowired @@ -117,6 +123,7 @@ @ApiImplicitParams({ @ApiImplicitParam(name = "type", value = "1 杩濊,2 杩濆缓", dataType = "Integer") }) + @LogSave(operationType = "浜嬮」澶勭疆绠$悊", contain = "鍒犻櫎妗堜欢") public CommonResult removeCase(@RequestParam Integer id, @RequestParam Integer type) { Integer violationType = 1; Integer illegalBuildingType = 2; @@ -141,6 +148,7 @@ @ApiImplicitParams({ @ApiImplicitParam(name = "type", value = "1 杩濊,2 杩濆缓", dataType = "Integer") }) + @LogSave(operationType = "浜嬮」澶勭疆绠$悊", contain = "鎵归噺鍒犻櫎妗堜欢") public CommonResult removeCases(@RequestParam List<Long> ids, @RequestParam Integer type) { Integer violationType = 1; Integer illegalBuildingType = 2; @@ -162,6 +170,7 @@ **/ @ApiOperation(value = "娣诲姞杩濊妗堜欢") @PostMapping("/addition_violation") + @LogSave(operationType = "浜嬮」澶勭疆绠$悊", contain = "鏂板杩濆缓妗堜欢") public CommonResult addViolationCase(@RequestBody @Validated ViolationParam violationParam) { Integer violation = 1; Integer resource = 2; @@ -169,8 +178,9 @@ BeanUtils.copyProperties(violationParam, baseCase); baseCase.setEventSource(resource); baseCase.setCategory(violation); - baseCase.setCode(UUID.randomUUID().toString()); + baseCase.setCode(utilNumber.createCaseCode()); baseCase.setState(BaseCaseStatus.PENDING); + baseCase.setAlarmTime(LocalDateTime.parse(violationParam.getAlarmTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); baseCaseService.save(baseCase); return CommonResult.success(baseCaseService.saveViolationCase(violationParam, baseCase.getId())); } @@ -182,6 +192,7 @@ **/ @ApiOperation(value = "娣诲姞杩濆缓妗堜欢") @PostMapping("/addition_illegal_building") + @LogSave(operationType = "浜嬮」澶勭疆绠$悊", contain = "鏂板杩濊妗堜欢") public CommonResult addIllegalBuildingCase(@RequestBody @Validated IllegalBuildingParam illegalBuildingParam) { Integer illegalBuilding = 2; Integer resource = 2; @@ -189,8 +200,9 @@ BeanUtils.copyProperties(illegalBuildingParam, baseCase); baseCase.setCategory(illegalBuilding); baseCase.setEventSource(resource); - baseCase.setCode(UUID.randomUUID().toString()); + baseCase.setCode(utilNumber.createCaseCode()); baseCase.setState(BaseCaseStatus.PENDING); + baseCase.setAlarmTime(LocalDateTime.parse(illegalBuildingParam.getAlarmTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); baseCaseService.save(baseCase); return CommonResult.success(baseCaseService.saveIllegalBuildingCase(illegalBuildingParam, baseCase.getId())); } @@ -238,7 +250,7 @@ @ApiOperation(value = "鏆備笉澶勭疆閲嶆柊澶勭疆") @PutMapping("/reset") public CommonResult resetCase(@RequestParam Integer caseId) { - Integer firstNum = 0; + Integer firstNum = 1; Integer state = iDisposeRecordService .list(new LambdaQueryWrapper<DisposeRecord>() .eq(DisposeRecord::getBaseCaseId, caseId). @@ -251,8 +263,11 @@ @ApiOperation(value = "缁撴") @PutMapping("/end_case") - public CommonResult endCase(@RequestParam Integer caseId, @RequestParam String result) { - baseCaseService.endCase(caseId, result); + @LogSave(operationType = "浜嬮」澶勭疆绠$悊", contain = "妗堜欢缁撴") + public CommonResult endCase(@RequestParam Long caseId, @RequestParam String result, @RequestParam String opinion) { + baseCaseService.endCase(caseId, result, opinion); return CommonResult.success("end case success~!"); } + + } \ No newline at end of file -- Gitblit v1.8.0