fuliqi
2023-11-24 d885ffc9f9ed909b0f7cb27da26e8b8fff1f89ea
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java
@@ -30,6 +30,7 @@
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Objects;
/**
 * <p>
@@ -44,12 +45,10 @@
    @Resource
    BaseCaseMapper baseCaseMapper;
    @Resource
    DisposeRecordMapper disposeRecordMapper;
    @Resource
    WorkflowConfigStepMapper workflowConfigStepMapper;
    @Autowired
    IInvestigationService iInvestigationService;
    @Autowired
@@ -64,10 +63,26 @@
    IDisposeRecordService iDisposeRecordService;
    @Autowired
    IImageResourcesService iImageResourcesService;
    public final static Short LAST_WEEK = 0;
    public final static Short LAST_MONTH = 1;
    public final static Short LAST_THREEMONTH = 2;
    @Override
    public Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId) {
        return disposeRecordMapper.selectMyBackList(page,userId, num);
    public Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId, Short type, Short source, Short time) {
        LocalDateTime alarmTimeStart = null;
        LocalDateTime alarmTimeEnd = null;
        if (Objects.equals(time, LAST_WEEK)) {
            alarmTimeStart = LocalDateTime.now().minusDays(7);
            alarmTimeEnd = LocalDateTime.now();
        } else if (Objects.equals(time, LAST_MONTH)) {
            alarmTimeStart = LocalDateTime.now().minusMonths(1);
            alarmTimeEnd = LocalDateTime.now();
        } else if (Objects.equals(time, LAST_THREEMONTH)) {
            alarmTimeStart = LocalDateTime.now().minusMonths(3);
            alarmTimeEnd = LocalDateTime.now();
        }
        //TODO:出现过一次重复数据
        return disposeRecordMapper.selectMyBackList(page, userId, num, alarmTimeStart, alarmTimeEnd, source, type);
    }
    @Override
@@ -76,6 +91,8 @@
        AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        List<ArrivalSituation> list = iArrivalSituationService.list(new LambdaQueryWrapper<ArrivalSituation>().eq(ArrivalSituation::getBaseCaseId, uploadDisposingResultParam.getCaseId()));
        if (!list.isEmpty()) {
            //TODO:违规没有当事人ID,违建才有
            if (uploadDisposingResultParam.getPartyInfoId() != null) {
            //当事人
            PartyInfo partyInfo = new PartyInfo();
            BeanUtils.copyProperties(uploadDisposingResultParam, partyInfo);
@@ -86,22 +103,28 @@
            BeanUtils.copyProperties(uploadDisposingResultParam, investigation);
            investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId());
            investigation.setPartyId(partyInfo.getId());
            investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
                //TODO:改为集合的字符串形式
                investigation.setPic(uploadDisposingResultParam.getPic().toString());
                //TODO:小程序前端页面没有调查时间,暂时不填
                //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.setArrivalTime(LocalDateTime.parse(uploadDisposingResultParam.getArrivalTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
            arrivalSituation.setId(uploadDisposingResultParam.getArrivalSituationId());
            //TODO:改为集合的字符串形式
            arrivalSituation.setSituationPic(uploadDisposingResultParam.getSituationPic().toString());
            iArrivalSituationService.updateById(arrivalSituation);
            //文书
            String handType = "02";
            ImageResources imageResources = new ImageResources();
            imageResources.setType(handType);
            imageResources.setBelongToId(uploadDisposingResultParam.getCaseId());
            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic()));
            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic().toString(), uploadDisposingResultParam.getSituationPic().toString()));
            imageResources.setId(uploadDisposingResultParam.getImageResourcesId());
            iImageResourcesService.updateById(imageResources);
            if (uploadDisposingResultParam.getWritCode() != null && uploadDisposingResultParam.getWritType() != null) {
@@ -135,9 +158,13 @@
            BeanUtils.copyProperties(uploadDisposingResultParam, investigation);
            investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId());
            investigation.setCreateTime(LocalDateTime.now());
            //TODO:改为集合的字符串形式
            investigation.setPic(uploadDisposingResultParam.getPic().toString());
            investigation.setCreateUser(user.getUserId());
            investigation.setPartyId(partyInfo.getId());
            investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
            //TODO:前端页面没有调查时间,暂时不填
//            investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
            iInvestigationService.save(investigation);
            //到达
            ArrivalSituation arrivalSituation = new ArrivalSituation();
@@ -145,6 +172,8 @@
            arrivalSituation.setBaseCaseId(uploadDisposingResultParam.getCaseId());
            arrivalSituation.setCreateTime(LocalDateTime.now());
            arrivalSituation.setCreateUser(user.getUserId());
            //TODO:改为集合的字符串形式
            arrivalSituation.setSituationPic(uploadDisposingResultParam.getSituationPic().toString());
            arrivalSituation.setArrivalTime(LocalDateTime.parse(uploadDisposingResultParam.getArrivalTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
            iArrivalSituationService.save(arrivalSituation);
            //文书
@@ -154,7 +183,7 @@
            imageResources.setBelongToId(uploadDisposingResultParam.getCaseId());
            imageResources.setCreateTime(LocalDateTime.now());
            imageResources.setCreateUser(user.getUserId());
            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic()));
            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic().toString(), uploadDisposingResultParam.getSituationPic().toString()));
            iImageResourcesService.save(imageResources);
            if (uploadDisposingResultParam.getWritCode() != null && uploadDisposingResultParam.getWritType() != null) {
                Writ writ = new Writ();
@@ -168,8 +197,8 @@
                writ.setSendTime(LocalDateTime.parse(uploadDisposingResultParam.getSendTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
                iWritService.save(writ);
                imageResources.setUrl(StringUtils
                        .joinWith(",", uploadDisposingResultParam.getPic()
                                , uploadDisposingResultParam.getSituationPic()
                        .joinWith(",", uploadDisposingResultParam.getPic().toString()
                                , uploadDisposingResultParam.getSituationPic().toString()
                                , uploadDisposingResultParam.getOriginalPic()
                                , uploadDisposingResultParam.getOtherPic()
                                , uploadDisposingResultParam.getRectifiedPic()
@@ -178,8 +207,6 @@
            }
            baseCaseService.update(new LambdaUpdateWrapper<BaseCase>().eq(BaseCase::getId, uploadDisposingResultParam.getCaseId()).set(BaseCase::getState, BaseCaseStatus.DISPOSE));
        }
        String stepName = StepName.CHECK.getName();
        DisposeRecord disposeRecord = new DisposeRecord();