|
|
|
@ -1,10 +1,34 @@ |
|
|
|
|
package com.daqing.financial.guarantee.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.daqing.financial.guarantee.feign.CrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.feign.HrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgApplyAmountInfoMapper; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgEnclosureInfoMapper; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgMessageInvestigationMapper; |
|
|
|
|
import com.daqing.financial.guarantee.model.request.ApprovalMessageRequest; |
|
|
|
|
import com.daqing.financial.guarantee.model.request.InvestigateMessageRequest; |
|
|
|
|
import com.daqing.financial.guarantee.model.request.MessageRequest; |
|
|
|
|
import com.daqing.financial.guarantee.model.response.*; |
|
|
|
|
import com.daqing.financial.guarantee.service.IDgMessageInvestigationService; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgMessageInvestigation; |
|
|
|
|
import com.daqing.financial.guarantee.util.ArraysUtil; |
|
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
|
import com.daqing.framework.domain.guarantee.*; |
|
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.LinkedHashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <p> |
|
|
|
@ -17,4 +41,211 @@ import org.springframework.stereotype.Service; |
|
|
|
|
@Service |
|
|
|
|
public class DgMessageInvestigationServiceImpl extends ServiceImpl<DgMessageInvestigationMapper, DgMessageInvestigation> implements IDgMessageInvestigationService { |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private DgMessageInvestigationMapper dgMessageInvestigationMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HrmsFeignService hrmsFeignService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private DgApplyAmountInfoMapper dgApplyAmountInfoMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private CrmsFeignService crmsFeignService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private DgEnclosureInfoMapper dgEnclosureInfoMapper; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, List<String> roleIdlist, String userId, Integer status) { |
|
|
|
|
//分页参数
|
|
|
|
|
if (page <= 0) { |
|
|
|
|
page = 1; |
|
|
|
|
} |
|
|
|
|
if (size <= 0) { |
|
|
|
|
size = 10; |
|
|
|
|
} |
|
|
|
|
IPage<MessageInvestigationListResponse> positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName,roleIdlist,userId,status); |
|
|
|
|
|
|
|
|
|
return new PageUtils(positionVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
@Override |
|
|
|
|
public Boolean assignCorners(MessageRequest messageRequest) { |
|
|
|
|
|
|
|
|
|
//根据主键id修改当前记录状态为审核中,操作状态为已处理,设置审批人id为当前用户id
|
|
|
|
|
//获取当前登录用户userId
|
|
|
|
|
//String userId = dgApplyAmountInfoController.getUserId();
|
|
|
|
|
String userId ="5"; |
|
|
|
|
DgMessageInvestigation dgMessageInvestigation = new DgMessageInvestigation(); |
|
|
|
|
dgMessageInvestigation.setStatus(StatusCode.SP_IN_REVIEW);//状态设置为审核中
|
|
|
|
|
dgMessageInvestigation.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理
|
|
|
|
|
dgMessageInvestigation.setEmpId(Integer.parseInt(userId)); |
|
|
|
|
dgMessageInvestigation.setId(messageRequest.getId()); |
|
|
|
|
dgMessageInvestigationMapper.updateById(dgMessageInvestigation); |
|
|
|
|
|
|
|
|
|
//新增信息部调查员记录到信息部记录表
|
|
|
|
|
DgMessageInvestigation messageInvestigation = new DgMessageInvestigation(); |
|
|
|
|
messageInvestigation.setBusinessId(messageRequest.getBusinessId());//业务id
|
|
|
|
|
messageInvestigation.setCompanyId(messageRequest.getCompanyId());//企业id
|
|
|
|
|
messageInvestigation.setEmpId(messageRequest.getEmpId());//信息部调查员id
|
|
|
|
|
messageInvestigation.setRoleId(PromptSuccess.ZC_ZY_ID);//角色设置为信息部专员
|
|
|
|
|
messageInvestigation.setType(1);//专员操作
|
|
|
|
|
messageInvestigation.setStatus(StatusCode.SP_IN_REVIEW);//审批状态为审核中
|
|
|
|
|
messageInvestigation.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
|
|
|
|
|
dgMessageInvestigationMapper.insert(messageInvestigation); |
|
|
|
|
|
|
|
|
|
//绑定角色关系
|
|
|
|
|
hrmsFeignService.insertUserRole(messageRequest.getEmpId().longValue(),PromptSuccess.XX_ZY_ID.longValue()); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
@Override |
|
|
|
|
public MessageDetailResponse messageDetail(Integer id) { |
|
|
|
|
//根据主键id查询业务id
|
|
|
|
|
DgMessageInvestigation dgMessageInvestigation = this.getBaseMapper().selectById(id); |
|
|
|
|
|
|
|
|
|
//根据业务id查询业务申请详细信息
|
|
|
|
|
DgApplyAmountInfoResponse dgApplyAmountInfo = dgApplyAmountInfoMapper.selectApplyAmountInfoById(dgMessageInvestigation.getBusinessId()); |
|
|
|
|
String measures=dgApplyAmountInfo.getEnGuaranteeMeasures(); |
|
|
|
|
if(measures.length()>0){ |
|
|
|
|
String a = measures.substring(1,measures.length()-1); |
|
|
|
|
String arry[]=a.split(","); |
|
|
|
|
List<String> demoList = Arrays.asList(arry); |
|
|
|
|
dgApplyAmountInfo.setEnGuaranteeMeasure(demoList); |
|
|
|
|
System.out.println("arry==============="+demoList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
System.out.println("业务申请详细========="+dgApplyAmountInfo); |
|
|
|
|
|
|
|
|
|
DgApplyAmountInfoRequest applyAmountInfo = new DgApplyAmountInfoRequest(); |
|
|
|
|
applyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId()); |
|
|
|
|
//根据企业id查询企业详情
|
|
|
|
|
ResponseResult result = crmsFeignService.queryCustomerInfoById(applyAmountInfo); |
|
|
|
|
|
|
|
|
|
LinkedHashMap linkedList = (LinkedHashMap)result.getData(); |
|
|
|
|
System.out.println("企业详细============"+linkedList); |
|
|
|
|
|
|
|
|
|
//查询附件详细,附件关联业务主键id
|
|
|
|
|
DgEnclosureInfoResponse dgEnclosureInfo = dgEnclosureInfoMapper.selectByCompanyId(dgMessageInvestigation.getBusinessId()); |
|
|
|
|
|
|
|
|
|
List<String>list = new ArrayList<>(); |
|
|
|
|
list.add(dgEnclosureInfo.getAccountingFirm()); |
|
|
|
|
list.add(dgEnclosureInfo.getAssessmentReport()); |
|
|
|
|
list.add(dgEnclosureInfo.getBusinessLicense()); |
|
|
|
|
list.add(dgEnclosureInfo.getCertificateAuthorization()); |
|
|
|
|
list.add(dgEnclosureInfo.getCompanyConstitution()); |
|
|
|
|
list.add(dgEnclosureInfo.getCompanyCredit()); |
|
|
|
|
list.add(dgEnclosureInfo.getConversationSummary()); |
|
|
|
|
list.add(dgEnclosureInfo.getCreditReport()); |
|
|
|
|
list.add(dgEnclosureInfo.getInspectionPhotos()); |
|
|
|
|
list.add(dgEnclosureInfo.getLegalCardCopy()); |
|
|
|
|
list.add(dgEnclosureInfo.getLegalCopy()); |
|
|
|
|
list.add(dgEnclosureInfo.getTaxCertificate()); |
|
|
|
|
list.add(dgEnclosureInfo.getMeetingMinutes()); |
|
|
|
|
list.add(dgEnclosureInfo.getMarriageCopy()); |
|
|
|
|
|
|
|
|
|
List arr1List2 = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
for(int i=0;i<list.size();i++){ |
|
|
|
|
List<String> arr1List; |
|
|
|
|
if(list.get(i)!=null){ |
|
|
|
|
String a1 = list.get(i).substring(1,list.get(i).length()-1); |
|
|
|
|
String arr1[]=a1.split(","); |
|
|
|
|
arr1List = Arrays.asList(arr1); |
|
|
|
|
arr1List2.add(i,arr1List); |
|
|
|
|
System.out.println("arr1LIst===="+arr1List); |
|
|
|
|
}else{ |
|
|
|
|
arr1List2.add(i,null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
dgEnclosureInfo.setAccountingFirmList((List<String>) arr1List2.get(0)); |
|
|
|
|
dgEnclosureInfo.setAssessmentReportList((List<String>) arr1List2.get(1)); |
|
|
|
|
dgEnclosureInfo.setBusinessLicenseList((List<String>) arr1List2.get(2)); |
|
|
|
|
dgEnclosureInfo.setCertificateAuthorizationList((List<String>) arr1List2.get(3)); |
|
|
|
|
dgEnclosureInfo.setCompanyConstitutionList((List<String>) arr1List2.get(4)); |
|
|
|
|
dgEnclosureInfo.setCompanyCreditList((List<String>) arr1List2.get(5)); |
|
|
|
|
dgEnclosureInfo.setConversationSummaryList((List<String>) arr1List2.get(6)); |
|
|
|
|
dgEnclosureInfo.setCreditReportList((List<String>) arr1List2.get(7)); |
|
|
|
|
dgEnclosureInfo.setInspectionPhotosList((List<String>) arr1List2.get(8)); |
|
|
|
|
dgEnclosureInfo.setLegalCardCopyList((List<String>) arr1List2.get(9)); |
|
|
|
|
dgEnclosureInfo.setLegalCopyList((List<String>) arr1List2.get(10)); |
|
|
|
|
dgEnclosureInfo.setTaxCertificateList((List<String>) arr1List2.get(11)); |
|
|
|
|
dgEnclosureInfo.setMeetingMinutesList((List<String>) arr1List2.get(12)); |
|
|
|
|
dgEnclosureInfo.setMarriageCopyList((List<String>) arr1List2.get(13)); |
|
|
|
|
|
|
|
|
|
System.out.println("附件详细=============="+dgEnclosureInfo); |
|
|
|
|
MessageDetailResponse messageDetailResponse= new MessageDetailResponse(); |
|
|
|
|
messageDetailResponse.setDgApplyAmountInfo(dgApplyAmountInfo); |
|
|
|
|
messageDetailResponse.setDgEnclosureInfo(dgEnclosureInfo); |
|
|
|
|
messageDetailResponse.setLinkedHashMap(linkedList); |
|
|
|
|
return messageDetailResponse; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
@Override |
|
|
|
|
public int investigateMessage(InvestigateMessageRequest investigateMessageRequest) { |
|
|
|
|
//根据主键id查询业务id
|
|
|
|
|
DgMessageInvestigation messageInvestigation = this.getBaseMapper().selectById(investigateMessageRequest.getId()); |
|
|
|
|
|
|
|
|
|
//AB角调查,修改审核意见以及状态
|
|
|
|
|
DgMessageInvestigation dgMessageInvestigation = new DgMessageInvestigation(); |
|
|
|
|
dgMessageInvestigation.setId(investigateMessageRequest.getId());//主键id
|
|
|
|
|
dgMessageInvestigation.setStatus(investigateMessageRequest.getStatus());//状态
|
|
|
|
|
dgMessageInvestigation.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理
|
|
|
|
|
dgMessageInvestigation.setRemark(investigateMessageRequest.getRemark());//审核意见
|
|
|
|
|
dgMessageInvestigation.setFile(ArraysUtil.toString(investigateMessageRequest.getFile())); |
|
|
|
|
this.baseMapper.updateById(dgMessageInvestigation); |
|
|
|
|
|
|
|
|
|
//判断信息部专员是否调查通过,如果通过,修改信息部经理操作状态为待处理
|
|
|
|
|
if(investigateMessageRequest.getStatus()==StatusCode.SP_IN_REVIEW ){ |
|
|
|
|
DgMessageInvestigation messageInvestigation2 = new DgMessageInvestigation(); |
|
|
|
|
messageInvestigation2.setOperatingStatus(StatusCode.CZ_ON_HAND); |
|
|
|
|
this.baseMapper.update(messageInvestigation2,new QueryWrapper<DgMessageInvestigation>() |
|
|
|
|
.eq("business_id",messageInvestigation.getBusinessId()) |
|
|
|
|
.eq("type",2)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
@Override |
|
|
|
|
public int approvalMessage(ApprovalMessageRequest approvalMessageRequest) { |
|
|
|
|
|
|
|
|
|
DgMessageInvestigation dgMessageInvestigation = new DgMessageInvestigation(); |
|
|
|
|
dgMessageInvestigation.setId(approvalMessageRequest.getId()); |
|
|
|
|
dgMessageInvestigation.setEmpId(5);//Integer.parseInt(dgApplyAmountInfoController.getUserId())
|
|
|
|
|
dgMessageInvestigation.setStatus(approvalMessageRequest.getStatus());//状态
|
|
|
|
|
dgMessageInvestigation.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理
|
|
|
|
|
dgMessageInvestigation.setRemark(approvalMessageRequest.getRemark());//审核意见
|
|
|
|
|
//根据主键id修改信息部记录
|
|
|
|
|
this.baseMapper.updateById(dgMessageInvestigation); |
|
|
|
|
|
|
|
|
|
//根据主键id查询信息部记录
|
|
|
|
|
DgMessageInvestigation messageInvestigation = this.baseMapper.selectById(approvalMessageRequest.getId()); |
|
|
|
|
|
|
|
|
|
//如果信息部经理审核通过,则往信息部分管领导处加一条记录,由分管领导审核
|
|
|
|
|
if(approvalMessageRequest.getStatus()==StatusCode.SP_IN_REVIEW && messageInvestigation.getOperatingStatus()==StatusCode.CZ_PROCESSED && messageInvestigation.getType()==2){//信息部经理审核通过
|
|
|
|
|
//根据主键id查询业务id
|
|
|
|
|
DgMessageInvestigation messageInvestigation2 = this.getBaseMapper().selectById(approvalMessageRequest.getId()); |
|
|
|
|
|
|
|
|
|
DgMessageInvestigation message = new DgMessageInvestigation(); |
|
|
|
|
message.setBusinessId(messageInvestigation2.getBusinessId()); |
|
|
|
|
message.setCompanyId(messageInvestigation2.getCompanyId()); |
|
|
|
|
message.setRoleId(PromptSuccess.XX_LD_ID);//担保部分管领导
|
|
|
|
|
message.setType(3);//分管领导审核
|
|
|
|
|
message.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中
|
|
|
|
|
message.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
|
|
|
|
|
this.baseMapper.insert(message); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//如果担保部分管领导审核通过,同时判断资产部分管领导审核以及信息部分管领导审核是否通过,如果通过就往合规调查中插入一条数据
|
|
|
|
|
//待完善
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|