| | |
| | | package com.ycl.controller.caseHandler; |
| | | |
| | | |
| | | import com.ycl.annotation.LogSave; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.bo.AdminUserDetails; |
| | | import com.ycl.dto.caseHandler.DispatchInfoParam; |
| | | import com.ycl.dto.dispatch.UploadDisposingResultParam; |
| | | import com.ycl.entity.caseHandler.*; |
| | | import com.ycl.entity.caseHandler.DispatchInfo; |
| | | import com.ycl.service.caseHandler.*; |
| | | import com.ycl.service.resources.IImageResourcesService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dispatch_handle") |
| | | @Api(tags = "调度处理") |
| | | @Api(tags = "调度") |
| | | public class DispatchHandleController { |
| | | |
| | | |
| | |
| | | IPartyInfoService iPartyInfoService; |
| | | @Autowired |
| | | IWritService iWritService; |
| | | @Autowired |
| | | IBaseCaseService baseCaseService; |
| | | @Autowired |
| | | IDisposeRecordService iDisposeRecordService; |
| | | @Autowired |
| | | IImageResourcesService iImageResourcesService; |
| | | |
| | | @ApiOperation(value = "调度") |
| | | @RequestMapping(value = "/dispatch", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | @LogSave(operationType = "事项处置管理", contain = "案件调度") |
| | | public CommonResult<DispatchInfo> dispatch(@Validated @RequestBody DispatchInfoParam dispatchInfoParam) { |
| | | AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); |
| | | dispatchInfoParam.setCreateUser(user.getUserId()); |
| | | return CommonResult.success(iDispatchHandleService.dispatch(dispatchInfoParam)); |
| | | } |
| | | |
| | | @ApiOperation(value = "上传违规/违建处置结果") |
| | | @GetMapping("/addition_dispose_result") |
| | | public CommonResult searchDisposeList(@RequestParam Integer caseId, @RequestParam Integer type, @RequestBody UploadDisposingResultParam uploadDisposingResultParam) { |
| | | AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); |
| | | //当事人 |
| | | PartyInfo partyInfo = new PartyInfo(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, partyInfo); |
| | | partyInfo.setCreateUser(user.getUserId().intValue()); |
| | | partyInfo.setCreateTime(LocalDateTime.now()); |
| | | iPartyInfoService.save(partyInfo); |
| | | //调查取证 |
| | | Investigation investigation = new Investigation(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, investigation); |
| | | investigation.setBaseCaseId(caseId); |
| | | investigation.setCreateTime(LocalDateTime.now()); |
| | | investigation.setCreateUser(user.getUserId().intValue()); |
| | | investigation.setPartyId(partyInfo.getId()); |
| | | iInvestigationService.save(investigation); |
| | | //到达 |
| | | ArrivalSituation arrivalSituation = new ArrivalSituation(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, arrivalSituation); |
| | | arrivalSituation.setBaseCaseId(caseId); |
| | | arrivalSituation.setCreateTime(LocalDateTime.now()); |
| | | arrivalSituation.setCreateUser(user.getUserId().intValue()); |
| | | iArrivalSituationService.save(arrivalSituation); |
| | | //文书 |
| | | Integer illegalBuildingType = 02; |
| | | if (type == illegalBuildingType) { |
| | | Writ writ = new Writ(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, writ); |
| | | writ.setBaseCaseId(caseId); |
| | | writ.setIllegalBuildingId(caseId); |
| | | writ.setCreateTime(LocalDateTime.now()); |
| | | writ.setCreateUser(user.getUserId().intValue()); |
| | | iWritService.save(writ); |
| | | } |
| | | /// TODO: 2022/9/30 添加成功后修改案件专题 添加流程 |
| | | return CommonResult.success("add success"); |
| | | @PostMapping("/addition_dispose_result") |
| | | @LogSave(operationType = "事项处置管理", contain = "案件上传处置结果") |
| | | public CommonResult searchDisposeList(@RequestBody UploadDisposingResultParam uploadDisposingResultParam) { |
| | | return iDisposeRecordService.saveOrUpdateUpload(uploadDisposingResultParam); |
| | | } |
| | | } |