|
|
|
@ -2,24 +2,33 @@ package com.daqing.financial.guarantee.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.daqing.financial.guarantee.feign.HrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgComplianceInvestigationMapper; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgLoanCommitteeConsiderMapper; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgWorkConferenceConsiderMapper; |
|
|
|
|
import com.daqing.financial.guarantee.model.response.AuditOpinionResponse; |
|
|
|
|
import com.daqing.financial.guarantee.model.response.DgWorkConferenceResponse; |
|
|
|
|
import com.daqing.financial.guarantee.model.response.GuaranteeDetailResponse; |
|
|
|
|
import com.daqing.financial.guarantee.service.IDgGuaranteeAssignUserService; |
|
|
|
|
import com.daqing.financial.guarantee.service.IDgWorkConferenceConsiderService; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.daqing.framework.domain.crms.response.CrmsCode; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgComplianceInvestigation; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgLoanCommitteeConsider; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgWorkConferenceConsider; |
|
|
|
|
import com.daqing.framework.domain.guarantee.GuaranteeCode; |
|
|
|
|
import com.daqing.framework.domain.guarantee.po.AuditOpinionPO; |
|
|
|
|
import com.daqing.framework.domain.guarantee.po.DgWorkConferencePO; |
|
|
|
|
import com.daqing.framework.domain.hrms.ext.EmployeeVO; |
|
|
|
|
import com.daqing.framework.exception.ExceptionCast; |
|
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
|
import com.daqing.framework.model.response.CommonCode; |
|
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
import com.daqing.framework.utils.excel.ExcelUtil; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
@ -31,6 +40,7 @@ import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <p> |
|
|
|
@ -50,6 +60,12 @@ public class DgWorkConferenceConsiderServiceImpl extends ServiceImpl<DgWorkConfe |
|
|
|
|
@Autowired |
|
|
|
|
private DgComplianceInvestigationMapper dgComplianceInvestigationMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IDgGuaranteeAssignUserService guaranteeAssignUserService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private HrmsFeignService hrmsFeignService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 列表 |
|
|
|
|
*/ |
|
|
|
@ -73,7 +89,27 @@ public class DgWorkConferenceConsiderServiceImpl extends ServiceImpl<DgWorkConfe |
|
|
|
|
roleList.add(Integer.parseInt(roleId)); |
|
|
|
|
} |
|
|
|
|
IPage<DgWorkConferencePO> list = this.getBaseMapper().list(new Page(page, size), codeOrName, roleList, Integer.parseInt(userId)); |
|
|
|
|
return new PageUtils(list); |
|
|
|
|
List<DgWorkConferencePO> dgWorkConferencePOS = list.getRecords(); |
|
|
|
|
System.out.println(dgWorkConferencePOS); |
|
|
|
|
Integer[] userIds = new Integer[dgWorkConferencePOS.size() * 5]; |
|
|
|
|
for (int i = 0; i < userIds.length; i += 5) { |
|
|
|
|
for (int j = i / 5; j < i / 5 + 1; j++) { |
|
|
|
|
userIds[i] = dgWorkConferencePOS.get(j).getAUserId(); |
|
|
|
|
userIds[i + 1] = dgWorkConferencePOS.get(j).getBUserId(); |
|
|
|
|
userIds[i + 2] = dgWorkConferencePOS.get(j).getIUserId(); |
|
|
|
|
userIds[i + 3] = dgWorkConferencePOS.get(j).getAssUserId(); |
|
|
|
|
userIds[i + 4] = dgWorkConferencePOS.get(j).getMUserId(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 根据userId获取对应的员工姓名
|
|
|
|
|
ResponseResult<List<EmployeeVO>> responseResult = hrmsFeignService.listEmpNameByUserId(userIds); |
|
|
|
|
System.out.println(responseResult.getData()); |
|
|
|
|
// 将对应的userId转换为name
|
|
|
|
|
List<DgWorkConferenceResponse> workConferenceResponses = this.transitionUserName(dgWorkConferencePOS, responseResult.getData()); |
|
|
|
|
IPage<DgWorkConferenceResponse> iPage = new Page<>(); |
|
|
|
|
BeanUtils.copyProperties(list, iPage); |
|
|
|
|
iPage.setRecords(workConferenceResponses); |
|
|
|
|
return new PageUtils(iPage); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -135,6 +171,27 @@ public class DgWorkConferenceConsiderServiceImpl extends ServiceImpl<DgWorkConfe |
|
|
|
|
if (opinion == null || opinion.length() == 0) { |
|
|
|
|
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL); |
|
|
|
|
} |
|
|
|
|
// 先修改工作会的审核状态为驳回
|
|
|
|
|
Boolean result = this.getBaseMapper().updateAuditStatusByBusinessId(this.getBaseMapper() |
|
|
|
|
.getWorkConferenceConsider(id).getBusinessId(), StatusCode.SP_REJECT); |
|
|
|
|
if (result) { |
|
|
|
|
// 再修改自己的状态为已处理
|
|
|
|
|
Boolean result1 = this.getBaseMapper().updateOperationStatusById(id, StatusCode.CZ_PROCESSED, opinion); |
|
|
|
|
if (result1) { |
|
|
|
|
// 修改合规调查的审核状态为驳回
|
|
|
|
|
Boolean result2 = dgComplianceInvestigationMapper.updateAuditStatusByBusinessId(this.getBaseMapper() |
|
|
|
|
.getWorkConferenceConsider(id).getBusinessId(), StatusCode.SP_REJECT); |
|
|
|
|
if (result2) { |
|
|
|
|
// 修改法规领导的操作状态为待处理
|
|
|
|
|
Boolean result3 = dgComplianceInvestigationMapper.updateToAudit(this.getBaseMapper() |
|
|
|
|
.getWorkConferenceConsider(id).getBusinessId(), StatusCode.CZ_ON_HAND, PromptSuccess.FG_LD_ID); |
|
|
|
|
if (result3) { |
|
|
|
|
// 在业务流程表中插入一条工作会驳回的数据
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -193,9 +250,41 @@ public class DgWorkConferenceConsiderServiceImpl extends ServiceImpl<DgWorkConfe |
|
|
|
|
ExceptionCast.cast(CommonCode.INVALID_PARAM); |
|
|
|
|
} |
|
|
|
|
AuditOpinionPO auditOpinion = dgLoanCommitteeConsiderMapper.getAuditOpinion(businessId); |
|
|
|
|
AuditOpinionResponse auditOpinionResponse = new AuditOpinionResponse(); |
|
|
|
|
// 将对应的用户id转换成姓名返回回去
|
|
|
|
|
System.out.println(auditOpinion); |
|
|
|
|
return null; |
|
|
|
|
Integer[] userIds = new Integer[5]; |
|
|
|
|
userIds[0] = auditOpinion.getAEmpId(); |
|
|
|
|
userIds[1] = auditOpinion.getBEmpId(); |
|
|
|
|
userIds[2] = auditOpinion.getAssetEmpId(); |
|
|
|
|
userIds[3] = auditOpinion.getMessageEmpId(); |
|
|
|
|
userIds[4] = auditOpinion.getRegulationEmpId(); |
|
|
|
|
ResponseResult<List<EmployeeVO>> responseResult = hrmsFeignService.listEmpNameByUserId(userIds); |
|
|
|
|
List<EmployeeVO> employees = responseResult.getData(); |
|
|
|
|
for (EmployeeVO employee : employees) { |
|
|
|
|
if (Objects.equals(employee.getId(), auditOpinion.getAEmpId().longValue())){ |
|
|
|
|
auditOpinionResponse.setAName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
if (Objects.equals(employee.getId(), auditOpinion.getBEmpId().longValue())){ |
|
|
|
|
auditOpinionResponse.setBName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
if (Objects.equals(employee.getId(), auditOpinion.getAssetEmpId().longValue())){ |
|
|
|
|
auditOpinionResponse.setAssetName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
if (Objects.equals(employee.getId(), auditOpinion.getMessageEmpId().longValue())){ |
|
|
|
|
auditOpinionResponse.setMessageName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
if (Objects.equals(employee.getId(), auditOpinion.getRegulationEmpId().longValue())){ |
|
|
|
|
auditOpinionResponse.setRegulationName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
BeanUtils.copyProperties(auditOpinion, auditOpinionResponse); |
|
|
|
|
// 获取担保信息
|
|
|
|
|
Integer guaranteeId = dgComplianceInvestigationMapper.getGuaranteeId(businessId, PromptSuccess.DB_LD_ID); |
|
|
|
|
GuaranteeDetailResponse guaranteeDetailResponse = guaranteeAssignUserService.guaranteeDetail(guaranteeId); |
|
|
|
|
auditOpinionResponse.setDgApplyAmountInfo(guaranteeDetailResponse.getDgApplyAmountInfo()); |
|
|
|
|
auditOpinionResponse.setLinkedHashMap(guaranteeDetailResponse.getLinkedHashMap()); |
|
|
|
|
return auditOpinionResponse; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -212,9 +301,40 @@ public class DgWorkConferenceConsiderServiceImpl extends ServiceImpl<DgWorkConfe |
|
|
|
|
/** |
|
|
|
|
* 导出 |
|
|
|
|
*/ |
|
|
|
|
@Transactional |
|
|
|
|
@Override |
|
|
|
|
public Boolean excelExport(HttpServletResponse response, List<String> ids) { |
|
|
|
|
return null; |
|
|
|
|
if (ids == null || ids.size() == 0) { |
|
|
|
|
ExceptionCast.cast(GuaranteeCode.EXCEL_ID_NOT_NULL); |
|
|
|
|
} |
|
|
|
|
List<Integer> idList = new ArrayList<>(); |
|
|
|
|
for (String id : ids) { |
|
|
|
|
idList.add(Integer.parseInt(id)); |
|
|
|
|
} |
|
|
|
|
List<DgWorkConferencePO> list = this.getBaseMapper().excelList(idList); |
|
|
|
|
System.out.println(list); |
|
|
|
|
// 获取所有的userId
|
|
|
|
|
Integer[] userIds = new Integer[list.size() * 5]; |
|
|
|
|
for (int i = 0; i < userIds.length; i += 5) { |
|
|
|
|
for (int j = i / 5; j < i / 5 + 1; j++) { |
|
|
|
|
userIds[i] = list.get(j).getAUserId(); |
|
|
|
|
userIds[i + 1] = list.get(j).getBUserId(); |
|
|
|
|
userIds[i + 2] = list.get(j).getIUserId(); |
|
|
|
|
userIds[i + 3] = list.get(j).getAssUserId(); |
|
|
|
|
userIds[i + 4] = list.get(j).getMUserId(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 根据userId获取对应的员工姓名
|
|
|
|
|
ResponseResult<List<EmployeeVO>> responseResult = hrmsFeignService.listEmpNameByUserId(userIds); |
|
|
|
|
System.out.println(responseResult.getData()); |
|
|
|
|
List<DgWorkConferenceResponse> excelList = this.transitionUserName(list, responseResult.getData()); |
|
|
|
|
try { |
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, excelList, "工作会数据一览表", "NO.1", new DgWorkConferenceResponse()) |
|
|
|
|
.finish(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -229,4 +349,35 @@ public class DgWorkConferenceConsiderServiceImpl extends ServiceImpl<DgWorkConfe |
|
|
|
|
} |
|
|
|
|
return userId; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 将userId转换为对应的名字返回给前端 |
|
|
|
|
*/ |
|
|
|
|
private List<DgWorkConferenceResponse> transitionUserName(List<DgWorkConferencePO> workConferences, List<EmployeeVO> employees) { |
|
|
|
|
List<DgWorkConferenceResponse> workConferenceResponses = new ArrayList<>(); |
|
|
|
|
DgWorkConferenceResponse workConferenceResponse; |
|
|
|
|
for (DgWorkConferencePO workConference : workConferences) { |
|
|
|
|
workConferenceResponse = new DgWorkConferenceResponse(); |
|
|
|
|
for (EmployeeVO employee : employees) { |
|
|
|
|
if (Objects.equals(workConference.getAUserId().longValue(), employee.getId())) { |
|
|
|
|
workConferenceResponse.setARoleName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
if (Objects.equals(workConference.getBUserId().longValue(), employee.getId())) { |
|
|
|
|
workConferenceResponse.setBRoleName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
if (Objects.equals(workConference.getIUserId().longValue(), employee.getId())) { |
|
|
|
|
workConferenceResponse.setRegulationName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
if (Objects.equals(workConference.getAssUserId().longValue(), employee.getId())) { |
|
|
|
|
workConferenceResponse.setAssetName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
if (Objects.equals(workConference.getMUserId().longValue(), employee.getId())) { |
|
|
|
|
workConferenceResponse.setMessageName(employee.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
BeanUtils.copyProperties(workConference, workConferenceResponse); |
|
|
|
|
workConferenceResponses.add(workConferenceResponse); |
|
|
|
|
} |
|
|
|
|
return workConferenceResponses; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|