| | |
| | | // 设置流水号 |
| | | complaint.setSerialNumber(serialNumber); |
| | | Optional<SystemUser> systemUserOpt = systemUserService.getSystemUserByPhone(loginUserInfoVO.getPhone()); |
| | | if (systemUserOpt.isPresent()){ |
| | | Long superiorId = null; |
| | | Integer accountLevel = 5; |
| | | Long superiorId = null; |
| | | if (systemUserOpt.isPresent()) { |
| | | SystemUser systemUser = systemUserOpt.get(); |
| | | Integer accountLevel = systemUser.getAccountLevel(); |
| | | accountLevel = systemUser.getAccountLevel(); |
| | | switch (accountLevel) { |
| | | case 1: |
| | | //市级 |
| | |
| | | //社区 |
| | | superiorId = systemUser.getCommunityId(); |
| | | break; |
| | | case 5: |
| | | //社区 |
| | | superiorId = loginUserInfoVO.getUserId(); |
| | | break; |
| | | } |
| | | complaint.setSuperiorType(accountLevel); |
| | | complaint.setSuperiorId(superiorId); |
| | | }else{ |
| | | superiorId = loginUserInfoVO.getUserId(); |
| | | } |
| | | complaint.setReportType(accountLevel); |
| | | // 设置其他字段 |
| | | complaint.setStatus(ProcessStatusEnum.PROCESSING.getCode()); |
| | | complaint.setCreateTime(new Date(System.currentTimeMillis())); |
| | |
| | | complaint.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | //查询系统配置诉求处理期限,设置截止日期 |
| | | WorkOrderItemConfig config = workOrderItemConfigService.lambdaQuery().orderByDesc(WorkOrderItemConfig::getId).last("LIMIT 1").one(); |
| | | if (Objects.isNull(config)){ |
| | | if (Objects.isNull(config)) { |
| | | throw new ServiceException("工单事项未配置,请联系管理员"); |
| | | } |
| | | complaint.setClosingTime(new Date(System.currentTimeMillis() + config.getDemandProcessingTime() * 24 * 60 * 60 * 1000)); |
| | | // 保存诉求记录 |
| | | save(complaint); |
| | | //保存记录 |
| | | ComplaintAuditRecord complaintAuditRecord = new ComplaintAuditRecord(); |
| | | complaintAuditRecord.setComplaintId(complaint.getId()); |
| | | complaintAuditRecord.setLatestFlag(true); |
| | | complaintAuditRecord.setAuditType(0); |
| | | complaintAuditRecord.setAuditStatus(-1); |
| | | complaintAuditRecord.setCreateBy(loginUserInfoVO.getUserId()); |
| | | complaintAuditRecord.setCreateTime(new Date(System.currentTimeMillis())); |
| | | complaintAuditRecord.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | complaintAuditRecord.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | complaintAuditRecord.setReportType(accountLevel); |
| | | complaintAuditRecord.setSuperiorId(superiorId); |
| | | complaintAuditRecordService.save(complaintAuditRecord); |
| | | } |
| | | |
| | | /** |
| | |
| | | Optional<SystemUser> systemUserByPhone = systemUserService.getSystemUserByPhone(loginUserInfoVO.getPhone()); |
| | | String targetId = ""; |
| | | int isSuperior = 0; |
| | | Integer accountLevel = 5; |
| | | //上级 |
| | | if (systemUserByPhone.isPresent()) { |
| | | SystemUser systemUser = systemUserByPhone.get(); |
| | | Integer accountLevel = systemUser.getAccountLevel(); |
| | | accountLevel = systemUser.getAccountLevel(); |
| | | switch (accountLevel) { |
| | | case 1: |
| | | //市级 |
| | |
| | | //社区 |
| | | targetId = systemUser.getCommunityId().toString(); |
| | | break; |
| | | case 5: |
| | | //党员 |
| | | targetId = loginUserInfoVO.getUserId().toString(); |
| | | break; |
| | | } |
| | | isSuperior = 1; |
| | | } else { |
| | | //党员 |
| | | //党员 |
| | | targetId = loginUserInfoVO.getUserId().toString(); |
| | | } |
| | | //查询对应诉求 |
| | | query.setUserId(loginUserInfoVO.getUserId());//当前登录用户id |
| | | page = baseMapper.selectComplaintPage(page, query, targetId,isSuperior); |
| | | //page = baseMapper.selectComplaintPage(page, query, targetId, isSuperior); |
| | | page = baseMapper.selectComplaintPage1(page, query, accountLevel, targetId); |
| | | return page; |
| | | } |
| | | |
| | | /** |
| | | * 工单详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ComplaintVO detail(Long id) { |
| | | ComplaintVO detail = baseMapper.getDetail(id); |
| | | public ComplaintVO detail(Long id, LoginUserInfoVO loginUserInfoVO) { |
| | | Optional<SystemUser> systemUserByPhone = systemUserService.getSystemUserByPhone(loginUserInfoVO.getPhone()); |
| | | String targetId = ""; |
| | | int isSuperior = 0; |
| | | Integer accountLevel = 5; |
| | | //上级 |
| | | if (systemUserByPhone.isPresent()) { |
| | | SystemUser systemUser = systemUserByPhone.get(); |
| | | accountLevel = systemUser.getAccountLevel(); |
| | | switch (accountLevel) { |
| | | case 1: |
| | | //市级 |
| | | targetId = "510400"; |
| | | break; |
| | | case 2: |
| | | //区县级 |
| | | targetId = systemUser.getDistrictsCode(); |
| | | break; |
| | | case 3: |
| | | //街道 |
| | | targetId = systemUser.getStreetId().toString(); |
| | | break; |
| | | case 4: |
| | | //社区 |
| | | targetId = systemUser.getCommunityId().toString(); |
| | | break; |
| | | case 5: |
| | | //社区 |
| | | targetId = loginUserInfoVO.getUserId().toString(); |
| | | break; |
| | | } |
| | | isSuperior = 1; |
| | | } else { |
| | | //党员 |
| | | targetId = loginUserInfoVO.getUserId().toString(); |
| | | } |
| | | |
| | | |
| | | ComplaintVO detail = baseMapper.getDetail(id,targetId, isSuperior); |
| | | if (detail.getStatus().equals(0)) { |
| | | List<ComplaintFlow> list = complaintFlowService.lambdaQuery().eq(ComplaintFlow::getComplaintId, id).orderByAsc(ComplaintFlow::getCreateTime).list(); |
| | | detail.setComplaintFlows(list); |
| | |
| | | List<ComplaintProgress> list = complaintProgressService.lambdaQuery().eq(ComplaintProgress::getComplaintId, id) |
| | | .orderByAsc(ComplaintProgress::getCreateTime).list(); |
| | | detail.setComplaintProgresses(list); |
| | | detail.setAuditButtonStatus(1); |
| | | Long superiorId = detail.getSuperiorId(); |
| | | Integer superiorType = detail.getSuperiorType(); |
| | | if(detail.getStatus() == 5 && systemUserByPhone.isPresent()){ |
| | | if(superiorType.equals(accountLevel) && superiorId.toString().equals(targetId)){ |
| | | detail.setAuditButtonStatus(0); |
| | | } |
| | | } |
| | | |
| | | return detail; |
| | | } |
| | | |
| | |
| | | complaint.setCompletionTime(new Date()); |
| | | this.updateById(complaint); |
| | | } |
| | | |
| | | /** |
| | | * 办理进度列表 |
| | | * |
| | | * @param complaintId |
| | | * @return |
| | | */ |
| | |
| | | .last("LIMIT 1")); |
| | | |
| | | Long superiorId; |
| | | Long currentId; |
| | | int reportType; |
| | | if (adminUser == null) { |
| | | superiorId = loginUserInfoVO.getCommunityId(); |
| | | if (Objects.isNull(superiorId)){ |
| | | currentId = 0L; |
| | | if (Objects.isNull(superiorId)) { |
| | | throw new ServiceException("上报失败,请绑定社区"); |
| | | } |
| | | reportType = ReportTypeEnum.COMMUNITY.getCode(); |
| | | currentId = loginUserInfoVO.getUserId(); |
| | | } else { |
| | | int accountLevel = adminUser.getAccountLevel(); // 改为基本类型 |
| | | if (accountLevel == 1) { |
| | |
| | | // 使用基本类型比较并补充默认分支 |
| | | if (accountLevel == ReportTypeEnum.COMMUNITY.getCode()) { |
| | | superiorId = Long.parseLong(adminUser.getStreetId()); |
| | | currentId = adminUser.getCommunityId(); |
| | | } else if (accountLevel == ReportTypeEnum.STREET.getCode()) { |
| | | superiorId = Long.parseLong(adminUser.getDistrictsCode()); |
| | | currentId = Long.valueOf(adminUser.getStreetId()); |
| | | } else if (accountLevel == ReportTypeEnum.DISTRICT.getCode()) { |
| | | superiorId = 510400L; // 攀枝花市 |
| | | currentId = Long.valueOf(adminUser.getDistrictsCode()); |
| | | } else if(accountLevel == ReportTypeEnum.PARTY.getCode()){ |
| | | superiorId = adminUser.getCommunityId(); |
| | | currentId = loginUserInfoVO.getUserId(); |
| | | } else { |
| | | // 处理未预期的账号等级 |
| | | throw new ServiceException("未知的账号等级"); |
| | |
| | | } |
| | | |
| | | Complaint complaint = getById(dto.getComplaintId()); |
| | | complaint.setReportType(reportType); |
| | | //complaint.setReportType(+); |
| | | complaint.setSuperiorType(reportType); |
| | | complaint.setSuperiorId(superiorId); |
| | | updateById(complaint); |
| | | |
| | | // 标记最新 |
| | | complaintAuditRecordService.update(new LambdaUpdateWrapper<ComplaintAuditRecord>() |
| | | .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId()) |
| | | .set(ComplaintAuditRecord::getLatestFlag,false)); |
| | | .set(ComplaintAuditRecord::getLatestFlag, false)); |
| | | |
| | | // 添加审核记录 |
| | | complaintAuditRecordService.createComplaintAuditRecord(dto.getComplaintId(), 2, dto.getComment(), loginUserInfoVO,adminUser); |
| | | //complaintAuditRecordService.createComplaintAuditRecord(dto.getComplaintId(), 2, dto.getComment(), loginUserInfoVO,adminUser); |
| | | |
| | | ComplaintAuditRecord complaintAuditRecord = new ComplaintAuditRecord(); |
| | | complaintAuditRecord.setComplaintId(complaint.getId()); |
| | | complaintAuditRecord.setLatestFlag(true); |
| | | complaintAuditRecord.setAuditType(2); |
| | | complaintAuditRecord.setAuditStatus(0); |
| | | complaintAuditRecord.setCreateBy(loginUserInfoVO.getUserId()); |
| | | complaintAuditRecord.setCreateTime(new Date(System.currentTimeMillis())); |
| | | complaintAuditRecord.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | complaintAuditRecord.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | complaintAuditRecord.setReporter(loginUserInfoVO.getNickName()); |
| | | complaintAuditRecord.setReportType(Objects.isNull(adminUser) ? 5 : adminUser.getAccountLevel()); |
| | | complaintAuditRecord.setSuperiorId(currentId); |
| | | complaintAuditRecord.setComment(dto.getComment()); |
| | | complaintAuditRecordService.save(complaintAuditRecord); |
| | | |
| | | |
| | | ComplaintAuditRecord complaintAuditRecord2 = new ComplaintAuditRecord(); |
| | | complaintAuditRecord2.setComplaintId(complaint.getId()); |
| | | complaintAuditRecord2.setLatestFlag(true); |
| | | complaintAuditRecord2.setAuditType(2); |
| | | complaintAuditRecord2.setAuditStatus(0); |
| | | complaintAuditRecord2.setCreateBy(loginUserInfoVO.getUserId()); |
| | | complaintAuditRecord2.setCreateTime(new Date(System.currentTimeMillis())); |
| | | complaintAuditRecord2.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | complaintAuditRecord2.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | complaintAuditRecord2.setReporter(loginUserInfoVO.getNickName()); |
| | | complaintAuditRecord2.setReportType(reportType); |
| | | complaintAuditRecord2.setSuperiorId(superiorId); |
| | | complaintAuditRecord2.setComment(dto.getComment()); |
| | | complaintAuditRecordService.save(complaintAuditRecord2); |
| | | } |
| | | |
| | | @Override |
| | |
| | | throw new ServiceException("无权下派"); |
| | | } |
| | | |
| | | |
| | | long superiorId; |
| | | int accountLevel = adminUser.getAccountLevel(); // 改为基本类型 |
| | | if (accountLevel == 4) { |
| | | throw new ServiceException("社区账号,无法下派!"); |
| | | } |
| | | accountLevel++; |
| | | |
| | | // 使用基本类型比较并补充默认分支 |
| | | if (accountLevel == ReportTypeEnum.STREET.getCode()) { |
| | | superiorId = adminUser.getCommunityId().longValue(); |
| | | } else if (accountLevel == ReportTypeEnum.DISTRICT.getCode()) { |
| | | superiorId = Long.parseLong(adminUser.getStreetId()); |
| | | } else if (accountLevel == ReportTypeEnum.CITY.getCode()) { |
| | | superiorId = Long.parseLong(adminUser.getDistrictsCode()); |
| | | } else { |
| | | // 处理未预期的账号等级 |
| | | throw new ServiceException("未知的账号等级"); |
| | | } |
| | | |
| | | Long superiorOrgId; |
| | | Complaint complaint = getById(dto.getComplaintId()); |
| | | superiorOrgId = complaint.getSuperiorId(); |
| | | complaint.setReportType(accountLevel + 1); |
| | | complaint.setSuperiorId(superiorId); |
| | | complaint.setSuperiorType(accountLevel); |
| | | complaint.setSuperiorId(dto.getDispatchId()); |
| | | updateById(complaint); |
| | | Long superiorOrgId = complaint.getSuperiorId(); |
| | | Integer superiorType = complaint.getSuperiorType(); |
| | | |
| | | // 添加流转记录 |
| | | complaintFlowService.createFlow(dto.getComplaintId(), superiorOrgId, accountLevel, 1, loginUserInfoVO.getUserId()); |
| | | complaintFlowService.createFlow(dto.getComplaintId(), superiorOrgId, superiorType, 1, loginUserInfoVO.getUserId()); |
| | | |
| | | // 标记最新 |
| | | complaintAuditRecordService.update(new LambdaUpdateWrapper<ComplaintAuditRecord>() |
| | | .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId()) |
| | | .set(ComplaintAuditRecord::getLatestFlag, false)); |
| | | |
| | | ComplaintAuditRecord record = new ComplaintAuditRecord(); |
| | | record.setComplaintId(complaint.getId()); |
| | | record.setLatestFlag(true); |
| | | record.setAuditType(0); |
| | | record.setAuditStatus(1); |
| | | record.setCreateBy(loginUserInfoVO.getUserId()); |
| | | record.setCreateTime(new Date(System.currentTimeMillis())); |
| | | record.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | record.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | record.setReporter(loginUserInfoVO.getNickName()); |
| | | record.setReportType(accountLevel); |
| | | record.setSuperiorId(dto.getDispatchId()); |
| | | complaintAuditRecordService.save(record); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (!systemUserByPhone.isPresent()) { |
| | | throw new ServiceException("无权审核"); |
| | | } |
| | | |
| | | SystemUser systemUser = systemUserByPhone.get(); |
| | | Long superiorId = 0L; |
| | | switch (systemUser.getAccountLevel()) { |
| | | case 1: |
| | | superiorId = 510400L;//默认市级 |
| | | break; |
| | | case 2: |
| | | superiorId = Long.parseLong(systemUser.getDistrictsCode()); |
| | | break; |
| | | case 3: |
| | | superiorId = Long.parseLong(systemUser.getStreetId()); |
| | | break; |
| | | case 4: |
| | | superiorId = systemUser.getCommunityId(); |
| | | break; |
| | | } |
| | | |
| | | //查询上报审核记录 |
| | | ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.lambdaQuery().eq(ComplaintAuditRecord::getComplaintId, complaintReporAuditDTO.getId()) |
| | | ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.lambdaQuery() |
| | | .eq(ComplaintAuditRecord::getComplaintId, complaintReporAuditDTO.getId()) |
| | | .eq(ComplaintAuditRecord::getAuditType, 2) |
| | | .eq(ComplaintAuditRecord::getLatestFlag, true) |
| | | .eq(ComplaintAuditRecord::getReportType, systemUser.getAccountLevel()) |
| | | .eq(ComplaintAuditRecord::getSuperiorId, superiorId) |
| | | .last("LIMIT 1").one(); |
| | | if (Objects.isNull(complaintAuditRecord)) { |
| | | throw new ServiceException("上报申请记录不存在"); |
| | | } |
| | | //查询待审核诉求 |
| | | complaintAuditRecordService.audit(complaintAuditRecord, loginUserInfoVO.getUserId(), |
| | | complaintReporAuditDTO.getAuditResult(), complaintReporAuditDTO.getRejectReason()); |
| | | //complaintAuditRecordService.audit(complaintAuditRecord, loginUserInfoVO.getUserId(), |
| | | // complaintReporAuditDTO.getAuditResult(), complaintReporAuditDTO.getRejectReason()); |
| | | |
| | | // 添加流转记录 |
| | | Complaint complaint = getById(complaintAuditRecord.getComplaintId()); |
| | | |
| | | Long superiorId = null; |
| | | if (Objects.nonNull(complaint) && complaintReporAuditDTO.getAuditResult().equals(1)) { |
| | | superiorId = complaint.getCreateBy(); |
| | | // 标记最新 |
| | | complaintAuditRecordService.update(new LambdaUpdateWrapper<ComplaintAuditRecord>() |
| | | .eq(ComplaintAuditRecord::getComplaintId, complaintAuditRecord.getComplaintId()) |
| | | .set(ComplaintAuditRecord::getLatestFlag, false)); |
| | | |
| | | if (complaintReporAuditDTO.getAuditResult().equals(1)) { |
| | | ComplaintAuditRecord record = new ComplaintAuditRecord(); |
| | | record.setComplaintId(complaint.getId()); |
| | | record.setLatestFlag(true); |
| | | record.setAuditorId(loginUserInfoVO.getUserId()); |
| | | record.setAuditType(0); |
| | | record.setAuditStatus(1); |
| | | record.setCreateBy(loginUserInfoVO.getUserId()); |
| | | record.setCreateTime(new Date(System.currentTimeMillis())); |
| | | record.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | record.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | record.setReporter(complaintAuditRecord.getReporter()); |
| | | record.setReportType(complaintAuditRecord.getReportType()); |
| | | record.setSuperiorId(superiorId); |
| | | complaintAuditRecordService.save(record); |
| | | |
| | | |
| | | if (Objects.nonNull(complaint.getSuperiorId())) { |
| | | superiorId = complaint.getSuperiorId(); |
| | | complaintFlowService.createFlow(complaintAuditRecord.getComplaintId(), complaint.getSuperiorId(), complaint.getSuperiorType(), 0, loginUserInfoVO.getUserId()); |
| | | } else { |
| | | complaintFlowService.createFlow(complaintAuditRecord.getComplaintId(), complaint.getCreateBy(), complaint.getReportType(), 0, loginUserInfoVO.getUserId()); |
| | | } |
| | | complaintFlowService.createFlow(complaintAuditRecord.getComplaintId(), superiorId,complaint.getReportType(),0, loginUserInfoVO.getUserId()); |
| | | //审核通过后,将诉求转移给上级 |
| | | if (complaintAuditRecord.getAuditType().equals(2) && complaintAuditRecord.getAuditStatus().equals(1)){ |
| | | SystemUser systemUser = systemUserByPhone.get(); |
| | | switch (systemUser.getAccountLevel()) { |
| | | case 1: |
| | | superiorId = 510400L;//默认市级 |
| | | break; |
| | | case 2: |
| | | superiorId = Long.parseLong(systemUser.getDistrictsCode()); |
| | | break; |
| | | case 3: |
| | | superiorId = Long.parseLong(systemUser.getStreetId()); |
| | | break; |
| | | case 4: |
| | | superiorId = systemUser.getCommunityId(); |
| | | break; |
| | | } |
| | | } |
| | | complaint.setSuperiorId(superiorId); |
| | | updateById(complaint ); |
| | | |
| | | } else { |
| | | |
| | | switch (systemUser.getAccountLevel() + 1) { |
| | | case 1: |
| | | superiorId = 510400L;//默认市级 |
| | | break; |
| | | case 2: |
| | | superiorId = Long.parseLong(systemUser.getDistrictsCode()); |
| | | break; |
| | | case 3: |
| | | superiorId = Long.parseLong(systemUser.getStreetId()); |
| | | break; |
| | | case 4: |
| | | superiorId = systemUser.getCommunityId(); |
| | | break; |
| | | case 5: |
| | | superiorId = complaint.getCreateBy(); |
| | | break; |
| | | } |
| | | |
| | | ComplaintAuditRecord record2 = new ComplaintAuditRecord(); |
| | | record2.setComplaintId(complaint.getId()); |
| | | record2.setLatestFlag(true); |
| | | record2.setAuditType(2); |
| | | record2.setAuditorId(loginUserInfoVO.getUserId()); |
| | | record2.setAuditStatus(2); |
| | | record2.setCreateBy(loginUserInfoVO.getUserId()); |
| | | record2.setCreateTime(new Date(System.currentTimeMillis())); |
| | | record2.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | record2.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | record2.setReporter(complaintAuditRecord.getReporter()); |
| | | record2.setReportType(systemUser.getAccountLevel() + 1); |
| | | record2.setSuperiorId(superiorId); |
| | | record2.setRejectReason(complaintReporAuditDTO.getRejectReason()); |
| | | complaintAuditRecordService.save(record2); |
| | | } |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveDelay(ComplaintDelayDTO dto, LoginUserInfoVO loginUserInfoVO) { |
| | | // 标记最新 |
| | | // 清除最新记录 |
| | | complaintAuditRecordService.update(new LambdaUpdateWrapper<ComplaintAuditRecord>() |
| | | .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId()) |
| | | .set(ComplaintAuditRecord::getLatestFlag,false)); |
| | | .set(ComplaintAuditRecord::getLatestFlag, false)); |
| | | SystemUser systemUser = systemUserService.getSystemUserByPhone(loginUserInfoVO.getPhone()).orElse(null); |
| | | Long superiorId; |
| | | Long currentId; |
| | | int reportType; |
| | | if (systemUser == null) { |
| | | superiorId = loginUserInfoVO.getCommunityId(); |
| | | if (Objects.isNull(superiorId)){ |
| | | currentId = loginUserInfoVO.getCommunityId(); |
| | | if (Objects.isNull(superiorId)) { |
| | | throw new ServiceException("上报失败,请绑定社区"); |
| | | } |
| | | reportType = ReportTypeEnum.COMMUNITY.getCode(); |
| | |
| | | // 使用基本类型比较并补充默认分支 |
| | | if (accountLevel == ReportTypeEnum.COMMUNITY.getCode()) { |
| | | superiorId = Long.parseLong(systemUser.getStreetId()); |
| | | currentId = systemUser.getCommunityId(); |
| | | } else if (accountLevel == ReportTypeEnum.STREET.getCode()) { |
| | | superiorId = Long.parseLong(systemUser.getDistrictsCode()); |
| | | currentId = Long.parseLong(systemUser.getStreetId()); |
| | | } else if (accountLevel == ReportTypeEnum.DISTRICT.getCode()) { |
| | | superiorId = 510400L; // 攀枝花市 |
| | | currentId = Long.parseLong(systemUser.getDistrictsCode()); |
| | | } else { |
| | | // 处理未预期的账号等级 |
| | | throw new ServiceException("未知的账号等级"); |
| | |
| | | } |
| | | |
| | | Complaint complaint = getById(dto.getComplaintId()); |
| | | complaint.setReportType(reportType); |
| | | complaint.setSuperiorType(reportType); |
| | | complaint.setSuperiorId(superiorId); |
| | | updateById(complaint); |
| | | // 添加审核记录 |
| | | complaintAuditRecordService.createComplaintAuditRecord(dto.getComplaintId(), 1, dto.getComment(), loginUserInfoVO, systemUser); |
| | | //complaintAuditRecordService.createComplaintAuditRecord(dto.getComplaintId(), 1, dto.getComment(), loginUserInfoVO, systemUser); |
| | | |
| | | |
| | | complaintAuditRecordService.update(new LambdaUpdateWrapper<ComplaintAuditRecord>() |
| | | .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId()) |
| | | .set(ComplaintAuditRecord::getLatestFlag, false)); |
| | | |
| | | ComplaintAuditRecord record1 = new ComplaintAuditRecord(); |
| | | record1.setComplaintId(complaint.getId()); |
| | | record1.setLatestFlag(true); |
| | | record1.setAuditType(2); |
| | | record1.setAuditStatus(2); |
| | | record1.setCreateBy(loginUserInfoVO.getUserId()); |
| | | record1.setCreateTime(new Date(System.currentTimeMillis())); |
| | | record1.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | record1.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | record1.setReporter(loginUserInfoVO.getNickName()); |
| | | record1.setReportType(systemUser.getAccountLevel()); |
| | | record1.setSuperiorId(currentId); |
| | | complaintAuditRecordService.save(record1); |
| | | |
| | | ComplaintAuditRecord record2 = new ComplaintAuditRecord(); |
| | | record2.setComplaintId(complaint.getId()); |
| | | record2.setLatestFlag(true); |
| | | record2.setAuditType(2); |
| | | record2.setAuditStatus(2); |
| | | record2.setCreateBy(loginUserInfoVO.getUserId()); |
| | | record2.setCreateTime(new Date(System.currentTimeMillis())); |
| | | record2.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | record2.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | record2.setReporter(loginUserInfoVO.getNickName()); |
| | | record2.setReportType(systemUser.getAccountLevel() - 1); |
| | | record2.setSuperiorId(superiorId); |
| | | complaintAuditRecordService.save(record2); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void delayAudit(ComplaintDelayAuditDTO complaintDelayAuditDTO, LoginUserInfoVO loginUserInfoVO) { |
| | | //查询待审核诉求 |
| | | ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.lambdaQuery().eq(ComplaintAuditRecord::getComplaintId, complaintDelayAuditDTO.getComplaintId()) |
| | | public void delayAudit(ComplaintDelayAuditDTO dto, LoginUserInfoVO loginUserInfoVO) { |
| | | |
| | | SystemUser systemUser = systemUserService.getSystemUserByPhone(loginUserInfoVO.getPhone()).orElse(null); |
| | | |
| | | int accountLevel = systemUser.getAccountLevel(); // 改为基本类型 |
| | | Long cunrrentId; |
| | | // 使用基本类型比较并补充默认分支 |
| | | if (accountLevel == ReportTypeEnum.COMMUNITY.getCode()) { |
| | | cunrrentId = systemUser.getCommunityId(); |
| | | } else if (accountLevel == ReportTypeEnum.STREET.getCode()) { |
| | | cunrrentId = Long.parseLong(systemUser.getStreetId()); |
| | | } else if (accountLevel == ReportTypeEnum.DISTRICT.getCode()) { |
| | | cunrrentId = Long.parseLong(systemUser.getDistrictsCode()); |
| | | } else { |
| | | // 处理未预期的账号等级 |
| | | throw new ServiceException("未知的账号等级"); |
| | | } |
| | | |
| | | |
| | | ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.getOne(new LambdaQueryWrapper<ComplaintAuditRecord>() |
| | | .eq(ComplaintAuditRecord::getAuditType, 1) |
| | | .eq(ComplaintAuditRecord::getLatestFlag, 1) |
| | | .eq(ComplaintAuditRecord::getAuditStatus, 0) |
| | | .eq(ComplaintAuditRecord::getLatestFlag, true) |
| | | .last("LIMIT 1").one(); |
| | | .eq(ComplaintAuditRecord::getSuperiorId, cunrrentId) |
| | | .eq(ComplaintAuditRecord::getReportType, accountLevel) |
| | | .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId()) |
| | | .last("LIMIT 1")); |
| | | |
| | | |
| | | if (Objects.isNull(complaintAuditRecord)) { |
| | | throw new ServiceException("诉求延期申请不存在"); |
| | | } |
| | | complaintAuditRecordService.audit(complaintAuditRecord, loginUserInfoVO.getUserId(), |
| | | complaintDelayAuditDTO.getAuditResult(), complaintDelayAuditDTO.getRejectReason()); |
| | | dto.getAuditResult(), dto.getRejectReason()); |
| | | //审核通过后,设置诉求延期 |
| | | if (complaintAuditRecord.getAuditType().equals(1) && complaintAuditRecord.getAuditStatus().equals(1)){ |
| | | if (complaintAuditRecord.getAuditType().equals(1) && complaintAuditRecord.getAuditStatus().equals(1)) { |
| | | Complaint complaint = getById(complaintAuditRecord.getComplaintId()); |
| | | complaint.setStatus(1); |
| | | updateById(complaint); |
| | | } |
| | | |
| | | |
| | | complaintAuditRecordService.update(new LambdaUpdateWrapper<ComplaintAuditRecord>() |
| | | .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId()) |
| | | .set(ComplaintAuditRecord::getLatestFlag, false)); |
| | | |
| | | ComplaintAuditRecord record1 = new ComplaintAuditRecord(); |
| | | record1.setComplaintId(dto.getComplaintId()); |
| | | record1.setLatestFlag(true); |
| | | record1.setAuditType(2); |
| | | record1.setAuditorId(loginUserInfoVO.getUserId()); |
| | | record1.setAuditStatus(2); |
| | | record1.setCreateBy(loginUserInfoVO.getUserId()); |
| | | record1.setCreateTime(new Date(System.currentTimeMillis())); |
| | | record1.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | record1.setUpdateTime(new Date(System.currentTimeMillis())); |
| | | record1.setReporter(complaintAuditRecord.getReporter()); |
| | | record1.setReportType(systemUser.getAccountLevel()); |
| | | record1.setSuperiorId(cunrrentId); |
| | | complaintAuditRecordService.save(record1); |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<ComAct> list = comActService.list(); |
| | | for (ComAct comAct : list) { |
| | | DispatchVO dispatchVO = new DispatchVO(); |
| | | dispatchVO.setId(comAct.getCommunityId()); |
| | | dispatchVO.setId(comAct.getCommunityId().toString()); |
| | | dispatchVO.setName(comAct.getName()); |
| | | dispatchVOList.add(dispatchVO); |
| | | } |
| | |
| | | List<ComStreet> list = comStreetService.list(); |
| | | for (ComStreet street : list) { |
| | | DispatchVO dispatchVO = new DispatchVO(); |
| | | dispatchVO.setId(Long.valueOf(street.getStreetId())); |
| | | dispatchVO.setId(street.getStreetId().toString()); |
| | | dispatchVO.setName(street.getName()); |
| | | dispatchVOList.add(dispatchVO); |
| | | } |
| | |
| | | .eq(BcRegion::getHierarchyOrder, 3).eq(BcRegion::getParentId, 510400));//获取攀枝花市下的区县 |
| | | for (BcRegion region : list) { |
| | | DispatchVO dispatchVO = new DispatchVO(); |
| | | dispatchVO.setId(Long.valueOf(region.getRegionCode())); |
| | | dispatchVO.setId(region.getRegionCode()); |
| | | dispatchVO.setName(region.getRegionName()); |
| | | dispatchVOList.add(dispatchVO); |
| | | } |
| | |
| | | } |
| | | return dispatchVOList; |
| | | } |
| | | |
| | | /** |
| | | * 获取待办诉求 |
| | | * |
| | | * @param basePage |
| | | * @param loginUserInfo |
| | | * @return |
| | |
| | | //党员 |
| | | targetId = loginUserInfo.getUserId().toString(); |
| | | } |
| | | Page<ComplaintTodoVO> page = baseMapper.getTodoList(new Page<>(basePage.getPageNum(), basePage.getPageSize()), targetId,isSuperior); |
| | | Page<ComplaintTodoVO> page = baseMapper.getTodoList(new Page<>(basePage.getPageNum(), basePage.getPageSize()), targetId, isSuperior); |
| | | return page; |
| | | } |
| | | |
| | | /** |
| | | * 延期情况说明 |
| | | * |
| | | * @param complaintId |
| | | * @return |
| | | */ |