From c9efa958aaf1e0d1073315e96e8b7ba755f3d20f Mon Sep 17 00:00:00 2001 From: wl <173@qq.com> Date: 星期六, 08 十月 2022 14:52:04 +0800 Subject: [PATCH] 修改状态和处置完成 --- ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java | 9 ++++----- ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java | 8 ++++---- ycl-platform/src/main/java/com/ycl/controller/caseHandler/DispatchHandleController.java | 24 ++++++++++++++++++------ ycl-platform/src/main/java/com/ycl/dto/casePool/IllegalBuildingParam.java | 4 ++-- 4 files changed, 28 insertions(+), 17 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 d54c7d6..8ac83fb 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 @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ycl.api.CommonResult; +import com.ycl.common.constant.BaseCaseStatus; import com.ycl.controller.BaseController; import com.ycl.dto.casePool.IllegalBuildingParam; import com.ycl.dto.casePool.ViolationParam; @@ -164,13 +165,12 @@ public CommonResult addViolationCase(@RequestBody @Validated ViolationParam violationParam) { Integer violation = 1; Integer resource = 2; - Integer state = 7; BaseCase baseCase = new BaseCase(); BeanUtils.copyProperties(violationParam, baseCase); baseCase.setEventSource(resource); baseCase.setCategory(violation); baseCase.setCode(UUID.randomUUID().toString()); - baseCase.setState(state); + baseCase.setState(BaseCaseStatus.PENDING); baseCaseService.save(baseCase); return CommonResult.success(baseCaseService.saveViolationCase(violationParam, baseCase.getId())); } @@ -185,13 +185,12 @@ public CommonResult addIllegalBuildingCase(@RequestBody @Validated IllegalBuildingParam illegalBuildingParam) { Integer illegalBuilding = 2; Integer resource = 2; - Integer state = 7; BaseCase baseCase = new BaseCase(); BeanUtils.copyProperties(illegalBuildingParam, baseCase); baseCase.setCategory(illegalBuilding); baseCase.setEventSource(resource); baseCase.setCode(UUID.randomUUID().toString()); - baseCase.setState(state); + baseCase.setState(BaseCaseStatus.PENDING); baseCaseService.save(baseCase); return CommonResult.success(baseCaseService.saveIllegalBuildingCase(illegalBuildingParam, baseCase.getId())); } @@ -222,7 +221,7 @@ @ApiOperation(value = "妗堜欢鐘舵�佷慨鏀�") @PutMapping("/case_status_update") @ApiImplicitParams({ - @ApiImplicitParam(value = "澶勭悊鐘舵��(0璇姤 1涓婃姤 2绔嬫 3娲鹃仯 4澶勭疆 5鏍告煡 6缁撴7澶勭悊涓�8鏆備笉澶勭悊)", name = "state") + @ApiImplicitParam(value = "澶勭悊鐘舵��(0-寰呭鐞�1-璇姤2-涓婃姤3-鍐嶅涔�/鍐嶈缁�4鏆備笉澶勭悊5绔嬫6璋冨害7澶勭疆8鏍告煡9缁撴)", name = "state") }) public CommonResult updateCaseStatus(@RequestParam Integer caseId, @RequestParam Integer state) { return CommonResult.success(baseCaseService diff --git a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/DispatchHandleController.java b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/DispatchHandleController.java index b8dfafa..d1a11f1 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/DispatchHandleController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/DispatchHandleController.java @@ -1,6 +1,7 @@ package com.ycl.controller.caseHandler; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.ycl.api.CommonResult; import com.ycl.bo.AdminUserDetails; import com.ycl.common.constant.BaseCaseStatus; @@ -43,7 +44,9 @@ @Autowired IWritService iWritService; @Autowired - private IBaseCaseService baseCaseService; + IBaseCaseService baseCaseService; + @Autowired + IDisposeRecordService iDisposeRecordService; @ApiOperation(value = "璋冨害") @RequestMapping(value = "/dispatch", method = RequestMethod.POST) @@ -53,8 +56,10 @@ } @ApiOperation(value = "涓婁紶杩濊/杩濆缓澶勭疆缁撴灉") - @RequestMapping(value = "/addition_dispose_result/{caseId}/{type}", method = RequestMethod.POST) - public CommonResult searchDisposeList(@PathVariable(value = "caseId") Integer caseId, @PathVariable(value = "type") Integer type, @RequestBody UploadDisposingResultParam uploadDisposingResultParam) { + @PostMapping("/addition_dispose_result") + public CommonResult searchDisposeList(@RequestParam Integer caseId, + @RequestParam Integer type, + @RequestBody UploadDisposingResultParam uploadDisposingResultParam) { AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); //淇敼妗堜欢鐘舵�佷负澶勭疆 @@ -85,8 +90,8 @@ arrivalSituation.setCreateUser(user.getUserId().intValue()); iArrivalSituationService.save(arrivalSituation); //鏂囦功 - Integer illegalBuildingType = 02; - if (type == illegalBuildingType) { + Integer illegalBuildingType = 2; + if (type.equals(illegalBuildingType)) { Writ writ = new Writ(); BeanUtils.copyProperties(uploadDisposingResultParam, writ); writ.setBaseCaseId(caseId); @@ -95,7 +100,14 @@ writ.setCreateUser(user.getUserId().intValue()); iWritService.save(writ); } - /// TODO: 2022/9/30 娣诲姞鎴愬姛鍚庝慨鏀规浠朵笓棰� 娣诲姞娴佺▼ + baseCaseService.update(new LambdaUpdateWrapper<BaseCase>().eq(BaseCase::getId, caseId).set(BaseCase::getState, BaseCaseStatus.CHECK)); + DisposeRecord disposeRecord = new DisposeRecord(); + disposeRecord.setBaseCaseId(caseId); + disposeRecord.setState(0); + disposeRecord.setCreateTime(LocalDateTime.now()); + disposeRecord.setCreateUser(user.getUserId().intValue()); + disposeRecord.setStepName("鏍告煡"); + iDisposeRecordService.save(disposeRecord); return CommonResult.success("add success"); } } diff --git a/ycl-platform/src/main/java/com/ycl/dto/casePool/IllegalBuildingParam.java b/ycl-platform/src/main/java/com/ycl/dto/casePool/IllegalBuildingParam.java index 87ffd9c..cd8091e 100644 --- a/ycl-platform/src/main/java/com/ycl/dto/casePool/IllegalBuildingParam.java +++ b/ycl-platform/src/main/java/com/ycl/dto/casePool/IllegalBuildingParam.java @@ -31,7 +31,7 @@ * 鎵�灞炵ぞ鍖� */ @ApiModelProperty(value = "鎵�灞炵ぞ鍖�") - @NotBlank(message = "涓嶅厑璁告墍灞炵ぞ鍖轰负绌�") + @NotNull(message = "涓嶅厑璁告墍灞炵ぞ鍖轰负绌�") private Integer communityId; @@ -81,7 +81,7 @@ * 杩濆缓鍏蜂綋浣嶇疆 */ @ApiModelProperty(value = "杩濆缓鍏蜂綋浣嶇疆") - @NotNull(message = "涓嶅厑璁歌繚寤哄叿浣撲綅缃负绌�") + @NotBlank(message = "涓嶅厑璁歌繚寤哄叿浣撲綅缃负绌�") private String position; /** diff --git a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java index 5e32871..0532b04 100644 --- a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java +++ b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java @@ -8,6 +8,7 @@ import com.ycl.bo.AdminUserDetails; import com.ycl.bo.casePool.CasePoolIllegalBuildingDO; import com.ycl.bo.casePool.CasePoolViolationDO; +import com.ycl.common.constant.BaseCaseStatus; import com.ycl.common.util.DateUtil; import com.ycl.dto.casePool.IllegalBuildingParam; import com.ycl.dto.casePool.ViolationParam; @@ -206,7 +207,7 @@ @Override public Boolean saveIllegalBuildingCase(IllegalBuildingParam illegalBuildingParam, Integer id) { IllegalBuilding illegalBuilding = new IllegalBuilding(); - BeanUtils.copyProperties(illegalBuilding, illegalBuildingParam); + BeanUtils.copyProperties(illegalBuildingParam, illegalBuilding); illegalBuilding.setBaseCaseId(id); Integer value = 1; return illegalBuildingMapper.insert(illegalBuilding) == value ? true : false; @@ -319,11 +320,10 @@ @Override public void endCase(Integer caseId, String result) { AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - Integer endCaseState = 6; - Integer state = 2; + Integer state = 1; String endCaseName = "缁撴"; BaseCase baseCase = new BaseCase(); - baseCase.setState(endCaseState); + baseCase.setState(BaseCaseStatus.CLOSING_REGISTER); baseCase.setId(caseId); baseCaseMapper.updateById(baseCase); DisposeRecord disposeRecord = new DisposeRecord(); -- Gitblit v1.8.0