| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; |
| | | import com.panzhihua.sangeshenbian.dao.ComplaintMapper; |
| | | import com.panzhihua.sangeshenbian.enums.AuditStatusEnum; |
| | | import com.panzhihua.sangeshenbian.enums.ProcessStatusEnum; |
| | | import com.panzhihua.sangeshenbian.enums.RateEnum; |
| | | import com.panzhihua.sangeshenbian.enums.ReportTypeEnum; |
| | |
| | | */ |
| | | @Override |
| | | public void saveResult(ComplaintCompletionDTO dto, LoginUserInfoVO loginUserInfoVO) { |
| | | //获取当前身份 |
| | | IdentityInformation identityInformationVO = identityInformationService.getIdentityInformation(loginUserInfoVO); |
| | | |
| | | List<PermissionsVO> permissions = identityInformationVO.getPermissions(); |
| | | if (permissions.isEmpty()) { |
| | | throw new ServiceException("请先完善个人信息"); |
| | | } |
| | | Integer accountLevel = null; |
| | | //上级 |
| | | if (identityInformationVO.getIdentity() == 2) { |
| | | //1=党员,2=管理员 |
| | | SystemUser systemUser = identityInformationVO.getSystemUser(); |
| | | accountLevel = systemUser.getAccountLevel(); |
| | | }else if (identityInformationVO.getIdentity() == 1){ |
| | | accountLevel = 5; |
| | | } |
| | | Complaint complaint = BeanUtil.copyProperties(dto, Complaint.class); |
| | | complaint.setUpdateTime(new Date()); |
| | | complaint.setCompletionUserId(loginUserInfoVO.getUserId()); |
| | | complaint.setCompletionUsername(loginUserInfoVO.getNickName()); |
| | | complaint.setCompletionUserPhone(loginUserInfoVO.getPhone()); |
| | | complaint.setCompletionTime(new Date()); |
| | | complaint.setCompletionUserLevel(accountLevel); |
| | | this.updateById(complaint); |
| | | } |
| | | |
| | |
| | | Complaint complaint = getById(id); |
| | | ComplaintVO complaintVO = BeanUtil.copyProperties(complaint, ComplaintVO.class); |
| | | //查询办理进度 |
| | | List<ComplaintProgress> complaintProgresses = complaintProgressService.lambdaQuery().eq(ComplaintProgress::getComplaintId, id).orderByAsc(ComplaintProgress::getCreateTime).list(); |
| | | List<ComplaintProgress> complaintProgresses = complaintProgressService.lambdaQuery() |
| | | .eq(ComplaintProgress::getComplaintId, id).orderByDesc(ComplaintProgress::getCreateTime).list(); |
| | | complaintVO.setComplaintProgresses(complaintProgresses); |
| | | //查询诉求流转记录 |
| | | List<ComplaintFlow> complaintFlows = complaintFlowService.lambdaQuery() |
| | | .eq(ComplaintFlow::getComplaintId, id) |
| | | .orderByDesc(ComplaintFlow::getCreateTime) |
| | | .orderByAsc(ComplaintFlow::getCreateTime) |
| | | .list(); |
| | | complaintVO.setComplaintFlows(complaintFlows); |
| | | //查询评价 |
| | |
| | | if (Objects.nonNull(partyMember)) { |
| | | community = community + "-" + partyMember.getServiceTarget(); |
| | | } |
| | | reportType = complaint.getCompletionUserLevel(); |
| | | break; |
| | | case 3: |
| | | //如果上报或下派了,取当前操作人的层级 |
| | | ComplaintAuditRecord record = complaintAuditRecordService.lambdaQuery().eq(ComplaintAuditRecord::getComplaintId, complaint.getId()) |
| | | .in(ComplaintAuditRecord::getAuditType, 2, 3) |
| | | .eq(ComplaintAuditRecord::getAuditStatus, AuditStatusEnum.APPROVED.getCode()) |
| | | .eq(ComplaintAuditRecord::getLatestFlag, true) |
| | | .last("LIMIT 1").one(); |
| | | if (Objects.nonNull(record)) { |
| | | reportType = record.getReportType(); |
| | | } |
| | | fileName = "协调通知单"; |
| | | break; |
| | | } |
| | |
| | | map.put("community", community); |
| | | map.put("problemType", complaint.getProblemType()); |
| | | map.put("descriptionContent", complaint.getDescriptionContent()); |
| | | map.put("reportType", ReportTypeEnum.fromCode(reportType).getDescription()); |
| | | map.put("reportType", ReportTypeEnum.getDescriptionByCode(reportType)); |
| | | map.put("partyOrganization", Objects.nonNull(partyMember) ? partyMember.getPartyOrganization() : ""); |
| | | map.put("name", complaint.getName()); |
| | | map.put("contactNumber", complaint.getContactNumber()); |