| | |
| | | package com.ycl.service.caseHandler.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean saveUpload(Long caseId, Integer type, UploadDisposingResultParam uploadDisposingResultParam) { |
| | | public Boolean saveOrUpdateUpload(UploadDisposingResultParam uploadDisposingResultParam) { |
| | | AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); |
| | | ArrivalSituation arrivalSituationed = iArrivalSituationService.getOne(new LambdaQueryWrapper<ArrivalSituation>().eq(ArrivalSituation::getBaseCaseId, uploadDisposingResultParam.getCaseId())); |
| | | if (arrivalSituationed!=null || arrivalSituationed.getId()!=null){ |
| | | //当事人 |
| | | PartyInfo partyInfo = new PartyInfo(); |
| | | if (StringUtils.isNotEmpty(uploadDisposingResultParam.getName())) { |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, partyInfo); |
| | | partyInfo.setCreateUser(user.getUserId().intValue()); |
| | | partyInfo.setCreateTime(LocalDateTime.now()); |
| | | partyInfo.setId(uploadDisposingResultParam.getPartyInfoId()); |
| | | iPartyInfoService.updateById(partyInfo); |
| | | } |
| | | //调查取证 |
| | | Investigation investigation = new Investigation(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, investigation); |
| | | investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId()); |
| | | investigation.setCreateTime(LocalDateTime.now()); |
| | | investigation.setCreateUser(user.getUserId()); |
| | | investigation.setPartyId(partyInfo.getId()); |
| | | investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | investigation.setId(uploadDisposingResultParam.getInvestigationId()); |
| | | iInvestigationService.updateById(investigation); |
| | | //到达 |
| | | ArrivalSituation arrivalSituation = new ArrivalSituation(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, arrivalSituation); |
| | | arrivalSituation.setBaseCaseId(uploadDisposingResultParam.getCaseId()); |
| | | arrivalSituation.setCreateTime(LocalDateTime.now()); |
| | | arrivalSituation.setCreateUser(user.getUserId()); |
| | | arrivalSituation.setArrivalTime(LocalDateTime.parse(uploadDisposingResultParam.getArrivalTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | arrivalSituation.setId(uploadDisposingResultParam.getArrivalSituationId()); |
| | | iArrivalSituationService.updateById(arrivalSituation); |
| | | //文书 |
| | | String handType = "02"; |
| | | ImageResources imageResources = new ImageResources(); |
| | | imageResources.setType(handType); |
| | | imageResources.setBelongToId(uploadDisposingResultParam.getCaseId()); |
| | | imageResources.setCreateTime(LocalDateTime.now()); |
| | | imageResources.setCreateUser(user.getUserId()); |
| | | imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic())); |
| | | imageResources.setId(uploadDisposingResultParam.getImageResourcesId()); |
| | | iImageResourcesService.updateById(imageResources); |
| | | if (uploadDisposingResultParam.getWritCode() == null || uploadDisposingResultParam.getWritType() == null) { |
| | | Writ writ = new Writ(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, writ); |
| | | writ.setBaseCaseId(uploadDisposingResultParam.getCaseId()); |
| | | writ.setIllegalBuildingId(uploadDisposingResultParam.getCaseId()); |
| | | writ.setCreateTime(LocalDateTime.now()); |
| | | writ.setCreateUser(user.getUserId()); |
| | | writ.setLimitTime(LocalDateTime.parse(uploadDisposingResultParam.getLimitTime(), DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm:ss"))); |
| | | writ.setRectifyTime(LocalDateTime.parse(uploadDisposingResultParam.getRectifyTime(), DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm:ss"))); |
| | | writ.setSendTime(LocalDateTime.parse(uploadDisposingResultParam.getSendTime(), DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm:ss"))); |
| | | writ.setBaseCaseId(uploadDisposingResultParam.getCaseId()); |
| | | iWritService.updateById(writ); |
| | | imageResources.setUrl(StringUtils |
| | | .joinWith(",", uploadDisposingResultParam.getPic() |
| | | , uploadDisposingResultParam.getSituationPic() |
| | | , uploadDisposingResultParam.getOriginalPic() |
| | | , uploadDisposingResultParam.getOtherPic() |
| | | , uploadDisposingResultParam.getRectifiedPic() |
| | | , uploadDisposingResultParam.getWritPic())); |
| | | iImageResourcesService.updateById(imageResources); |
| | | } |
| | | } |
| | | |
| | | //当事人 |
| | | PartyInfo partyInfo = new PartyInfo(); |
| | | if (StringUtils.isNotEmpty(uploadDisposingResultParam.getName())) { |
| | |
| | | //调查取证 |
| | | Investigation investigation = new Investigation(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, investigation); |
| | | investigation.setBaseCaseId(caseId); |
| | | investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId()); |
| | | investigation.setCreateTime(LocalDateTime.now()); |
| | | investigation.setCreateUser(user.getUserId()); |
| | | investigation.setPartyId(partyInfo.getId()); |
| | |
| | | //到达 |
| | | ArrivalSituation arrivalSituation = new ArrivalSituation(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, arrivalSituation); |
| | | arrivalSituation.setBaseCaseId(caseId); |
| | | arrivalSituation.setBaseCaseId(uploadDisposingResultParam.getCaseId()); |
| | | arrivalSituation.setCreateTime(LocalDateTime.now()); |
| | | arrivalSituation.setCreateUser(user.getUserId()); |
| | | arrivalSituation.setArrivalTime(LocalDateTime.parse(uploadDisposingResultParam.getArrivalTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | iArrivalSituationService.save(arrivalSituation); |
| | | //文书 |
| | | Integer illegalBuildingType = 2; |
| | | Integer violation = 1; |
| | | String handType = "02"; |
| | | ImageResources imageResources = new ImageResources(); |
| | | imageResources.setType(handType); |
| | | imageResources.setBelongToId(caseId); |
| | | imageResources.setBelongToId(uploadDisposingResultParam.getCaseId()); |
| | | imageResources.setCreateTime(LocalDateTime.now()); |
| | | imageResources.setCreateUser(user.getUserId()); |
| | | if (type == violation) { |
| | | imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic())); |
| | | iImageResourcesService.save(imageResources); |
| | | } |
| | | if (type == illegalBuildingType) { |
| | | imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic())); |
| | | iImageResourcesService.save(imageResources); |
| | | if (uploadDisposingResultParam.getWritCode() == null || uploadDisposingResultParam.getWritType() == null) { |
| | | Writ writ = new Writ(); |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, writ); |
| | | writ.setBaseCaseId(caseId); |
| | | writ.setIllegalBuildingId(caseId); |
| | | writ.setBaseCaseId(uploadDisposingResultParam.getCaseId()); |
| | | writ.setIllegalBuildingId(uploadDisposingResultParam.getCaseId()); |
| | | writ.setCreateTime(LocalDateTime.now()); |
| | | writ.setCreateUser(user.getUserId()); |
| | | writ.setLimitTime(LocalDateTime.parse(uploadDisposingResultParam.getLimitTime(), DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm:ss"))); |
| | |
| | | , uploadDisposingResultParam.getOtherPic() |
| | | , uploadDisposingResultParam.getRectifiedPic() |
| | | , uploadDisposingResultParam.getWritPic())); |
| | | iImageResourcesService.save(imageResources); |
| | | iImageResourcesService.updateById(imageResources); |
| | | } |
| | | baseCaseService.update(new LambdaUpdateWrapper<BaseCase>().eq(BaseCase::getId, caseId).set(BaseCase::getState, BaseCaseStatus.DISPOSE)); |
| | | |
| | | baseCaseService.update(new LambdaUpdateWrapper<BaseCase>().eq(BaseCase::getId, uploadDisposingResultParam.getCaseId()).set(BaseCase::getState, BaseCaseStatus.DISPOSE)); |
| | | String stepName = StepName.CHECK.getName(); |
| | | DisposeRecord disposeRecord = new DisposeRecord(); |
| | | disposeRecord.setBaseCaseId(caseId); |
| | | disposeRecord.setBaseCaseId(uploadDisposingResultParam.getCaseId()); |
| | | disposeRecord.setState(0); |
| | | disposeRecord.setCreateTime(LocalDateTime.now()); |
| | | disposeRecord.setCreateUser(user.getUserId()); |