mg
2022-10-14 75c3c13b083e2d3ffa0aefdf5e1c117697a032e7
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -96,6 +96,10 @@
    WorkflowConfigMapper workflowConfigMapper;
    @Resource
    ImageResourcesMapper imageResourcesMapper;
    @Resource
    DispatchInfoMapper dispatchInfoMapper;
    @Resource
    PartyInfoMapper partyInfoMapper;
    @Override
@@ -166,6 +170,7 @@
                    }
                    casePoolViolationVO.setCategory(dataDictionaryMapper.selectById(item.getCategoryId()).getName());
                    casePoolViolationVO.setType(dataDictionaryMapper.selectById(item.getTypeId()).getName());
                    casePoolViolationVO.setStreet(dataDictionaryMapper.selectById(item.getStreetId()).getName());
                    return casePoolViolationVO;
                }).collect(Collectors.toList());
        Page<CasePoolViolationVO> casePoolViolationVOPage = new Page<>();
@@ -186,6 +191,7 @@
                            CasePoolIllegalBuildingVO casePoolIllegalBuildingVO = new CasePoolIllegalBuildingVO();
                            BeanUtils.copyProperties(item, casePoolIllegalBuildingVO);
                            casePoolIllegalBuildingVO.setCategory(dataDictionaryMapper.selectById(item.getCategoryId()).getName());
                            casePoolIllegalBuildingVO.setCommunity(dataDictionaryMapper.selectById(item.getCommunityId()).getName());
                            return casePoolIllegalBuildingVO;
                        }
                ).collect(Collectors.toList());
@@ -196,20 +202,36 @@
    }
    @Override
    public Boolean saveViolationCase(ViolationParam violationParam, Integer id) {
    public Boolean saveViolationCase(ViolationParam violationParam, Long id) {
        Violations violations = new Violations();
        BeanUtils.copyProperties(violationParam, violations);
        violations.setId(id);
        Integer value = 1;
        violations.setId(id);
        setDisposeRecord(id);
        return violationsMapper.insert(violations) == value ? true : false;
    }
    private void setDisposeRecord(Long id) {
        String stepName = "调度";
        Integer state = 0;
        DisposeRecord disposeRecord = new DisposeRecord();
        disposeRecord.setBaseCaseId(id);
        disposeRecord.setState(state);
        disposeRecord.setCreateTime(LocalDateTime.now());
        AdminUserDetails userDetails = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        disposeRecord.setCreateUser(userDetails.getUserId());
        disposeRecord.setStartTime(LocalDateTime.now());
        disposeRecord.setStepName(stepName);
        disposeRecordMapper.insert(disposeRecord);
    }
    @Override
    public Boolean saveIllegalBuildingCase(IllegalBuildingParam illegalBuildingParam, Integer id) {
    public Boolean saveIllegalBuildingCase(IllegalBuildingParam illegalBuildingParam, Long id) {
        IllegalBuilding illegalBuilding = new IllegalBuilding();
        BeanUtils.copyProperties(illegalBuildingParam, illegalBuilding);
        illegalBuilding.setBaseCaseId(id);
        setDisposeRecord(id);
        Integer value = 1;
        illegalBuilding.setBaseCaseId(id);
        return illegalBuildingMapper.insert(illegalBuilding) == value ? true : false;
    }
@@ -217,13 +239,29 @@
    public BaseCaseDetail baseCaseDetail(String code) {
        BaseCaseDetail bcd = new BaseCaseDetail();
        //1.查询案件基本信息
        QueryWrapper<BaseCase> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(BaseCase::getCode, code);
        BaseCase baseCase = baseCaseMapper.selectOne(wrapper);
        Map map = new HashMap();
        map.put("code", code);
        BaseCase baseCase = baseCaseMapper.selectCondMap(map);
        if (baseCase == null) {
            return null;
        }
        //查询案件违规信息
        if (baseCase.getCategory() == 1) {
            Map mapV = new HashMap();
            mapV.put("id", baseCase.getId());
            Violations violations = violationsMapper.selectCondMap(mapV);
            baseCase.setViolations(violations);
        } else {
            IllegalBuilding illegalBuilding = illegalBuildingMapper.selectById(baseCase.getId());
            baseCase.setIllegalBuilding(illegalBuilding);
        }
        //获取调度信息
        Map mapD = new HashMap();
        mapD.put("baseCaseId",baseCase.getId());
        DispatchInfo dispatchInfo = dispatchInfoMapper.selectCondMap(mapD);
        baseCase.setDispatchInfo(dispatchInfo);
        bcd.setBaseCase(baseCase);
        //案件相关信息
        //2.查询办理经过信息
        //2.1查询处置流程配置
        HandlePassVo handlePassVo = new HandlePassVo();
@@ -242,7 +280,7 @@
        //2.2查询处置流程环节配置
        Map mapWcs = new HashMap();
        mapWcs.put("workflowConfigId", ddlcId);
        mapWcs.put("baseCaseId", ddlcId);
        mapWcs.put("baseCaseId", baseCase.getId());
        List<WorkflowConfigStep> listWcs = workflowConfigStepMapper.selectRecordByWorkflowConfigStepId(mapWcs);
        //处理用环节时间
        for (WorkflowConfigStep step : listWcs) {
@@ -251,10 +289,12 @@
                continue;
            }
            for (DisposeRecord record : records) {
                record.setLinkTime(
                        DateUtil.getDistanceDateTime(
                                DateUtil.fromLocalDateTime(baseCase.getAlarmTime()),
                                DateUtil.fromLocalDateTime(record.getCreateTime())));
                if (record != null && record.getCreateTime() != null) {
                    record.setLinkTime(
                            DateUtil.getDistanceDateTime(
                                    DateUtil.fromLocalDateTime(baseCase.getAlarmTime()),
                                    DateUtil.fromLocalDateTime(record.getCreateTime())));
                }
            }
            step.setDisposeRecords(records);
        }
@@ -287,6 +327,14 @@
        QueryWrapper<Investigation> wrapperI = new QueryWrapper<>();
        wrapperI.lambda().eq(Investigation::getBaseCaseId, baseCase.getId());
        Investigation investigation = investigationMapper.selectOne(wrapperI);
        if (investigation != null && investigation.getPartyId() != null) {
            //获取当事人信息
            Map mapP = new HashMap();
            mapP.put("id", investigation.getPartyId());
            PartyInfo partyInfo = partyInfoMapper.selectCondMap(mapP);
            //填充当事人
            investigation.setPartyInfo(partyInfo);
        }
        currentSitVo.setInvestigation(investigation);
        //设置告知违法
        QueryWrapper<Writ> wrapperW = new QueryWrapper<>();
@@ -318,7 +366,7 @@
    }
    @Override
    public void endCase(Integer caseId, String result) {
    public void endCase(Long caseId, String result) {
        AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        Integer state = 1;
        String endCaseName = "结案";
@@ -331,7 +379,7 @@
        disposeRecord.setWorkflowConfigStepId(workflowConfigStepMapper
                .selectOne(new LambdaQueryWrapper<WorkflowConfigStep>().eq(WorkflowConfigStep::getName, endCaseName))
                .getWorkflowConfigId());
        disposeRecord.setCreateUser(user.getUserId().intValue());
        disposeRecord.setCreateUser(user.getUserId().longValue());
        disposeRecord.setResult(result);
        disposeRecord.setState(state);
        disposeRecord.setCreateTime(LocalDateTime.now());