|
|
@ -1,10 +1,36 @@ |
|
|
|
package com.daqing.financial.guarantee.service.impl; |
|
|
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
|
|
import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; |
|
|
|
|
|
|
|
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.DgAssetsAssessmentAssetsLogMapper; |
|
|
|
import com.daqing.financial.guarantee.mapper.DgAssetsInvestigationMapper; |
|
|
|
import com.daqing.financial.guarantee.mapper.DgAssetsInvestigationMapper; |
|
|
|
|
|
|
|
import com.daqing.financial.guarantee.model.request.ApprovalAssetsRequest; |
|
|
|
|
|
|
|
import com.daqing.financial.guarantee.model.request.AssetsRequest; |
|
|
|
|
|
|
|
import com.daqing.financial.guarantee.model.request.InvestigateAssetsRequest; |
|
|
|
|
|
|
|
import com.daqing.financial.guarantee.model.response.*; |
|
|
|
import com.daqing.financial.guarantee.service.IDgAssetsInvestigationService; |
|
|
|
import com.daqing.financial.guarantee.service.IDgAssetsInvestigationService; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.daqing.financial.guarantee.util.ArraysUtil; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.guarantee.DgAssetsAssessmentAssetsLog; |
|
|
|
import com.daqing.framework.domain.guarantee.DgAssetsInvestigation; |
|
|
|
import com.daqing.framework.domain.guarantee.DgAssetsInvestigation; |
|
|
|
|
|
|
|
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.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> |
|
|
|
* <p> |
|
|
@ -12,9 +38,197 @@ import org.springframework.stereotype.Service; |
|
|
|
* </p> |
|
|
|
* </p> |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Qyq |
|
|
|
* @author Qyq |
|
|
|
* @since 2020-11-05 |
|
|
|
* @since 2020-11-23 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvestigationMapper, DgAssetsInvestigation> implements IDgAssetsInvestigationService { |
|
|
|
public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvestigationMapper, DgAssetsInvestigation> implements IDgAssetsInvestigationService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private DgApplyAmountInfoController dgApplyAmountInfoController; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private DgAssetsInvestigationMapper dgAssetsInvestigationMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HrmsFeignService hrmsFeignService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private DgApplyAmountInfoMapper dgApplyAmountInfoMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private CrmsFeignService crmsFeignService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private DgAssetsAssessmentAssetsLogMapper dgAssetsAssessmentAssetsLogMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@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<AssetsInvestigationListResponse> positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName,roleIdlist,userId,status); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new PageUtils(positionVO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Boolean assignCorners(AssetsRequest assetsRequest) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据主键id修改当前记录状态为审核中,操作状态为已处理,设置审批人id为当前用户id
|
|
|
|
|
|
|
|
//获取当前登录用户userId
|
|
|
|
|
|
|
|
//String userId = dgApplyAmountInfoController.getUserId();
|
|
|
|
|
|
|
|
String userId ="5"; |
|
|
|
|
|
|
|
DgAssetsInvestigation assetsInvestigation = new DgAssetsInvestigation(); |
|
|
|
|
|
|
|
assetsInvestigation.setStatus(StatusCode.SP_IN_REVIEW);//状态设置为审核中
|
|
|
|
|
|
|
|
assetsInvestigation.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理
|
|
|
|
|
|
|
|
assetsInvestigation.setEmpId(Integer.parseInt(userId)); |
|
|
|
|
|
|
|
assetsInvestigation.setId(assetsRequest.getId()); |
|
|
|
|
|
|
|
dgAssetsInvestigationMapper.updateById(assetsInvestigation); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增资产部调查员记录到资产部记录表
|
|
|
|
|
|
|
|
DgAssetsInvestigation dgAssetsInvestigation = new DgAssetsInvestigation(); |
|
|
|
|
|
|
|
dgAssetsInvestigation.setBusinessId(assetsRequest.getBusinessId());//业务id
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setCompanyId(assetsRequest.getCompanyId());//企业id
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setEmpId(assetsRequest.getEmpId());//资产部调查员id
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setRoleId(PromptSuccess.ZC_ZY_ID);//角色设置为资产部专员
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setType(1);//专员操作
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setStatus(StatusCode.SP_IN_REVIEW);//审批状态为审核中
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
|
|
|
|
|
|
|
|
dgAssetsInvestigationMapper.insert(dgAssetsInvestigation); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//绑定角色关系
|
|
|
|
|
|
|
|
hrmsFeignService.insertUserRole(assetsRequest.getEmpId().longValue(),PromptSuccess.ZC_ZY_ID.longValue()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public AssetsDetailResponse assetsDetail(Integer id) { |
|
|
|
|
|
|
|
//根据主键id查询资产调查详情
|
|
|
|
|
|
|
|
DgAssetsInvestigationResponse assetsResponse = this.getBaseMapper().selectInfoById(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据业务id查询评估价值List
|
|
|
|
|
|
|
|
List<DgAssetsAssessmentAssetsLog> assessmentlist = dgAssetsAssessmentAssetsLogMapper.selectList( |
|
|
|
|
|
|
|
new QueryWrapper<DgAssetsAssessmentAssetsLog>().eq("business_id",assetsResponse.getBusinessId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assetsResponse.setAssessmentList(assessmentlist); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String files=assetsResponse.getFile(); |
|
|
|
|
|
|
|
if(files.length()>0){ |
|
|
|
|
|
|
|
String a = files.substring(1,files.length()-1); |
|
|
|
|
|
|
|
String arry[]=a.split(","); |
|
|
|
|
|
|
|
List<String> demoList = Arrays.asList(arry); |
|
|
|
|
|
|
|
assetsResponse.setFileList(demoList); |
|
|
|
|
|
|
|
System.out.println("arry==============="+demoList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据业务id查询业务申请详细信息
|
|
|
|
|
|
|
|
DgApplyAmountInfoResponse dgApplyAmountInfo = dgApplyAmountInfoMapper.selectApplyAmountInfoById(assetsResponse.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("业务申请详细========="+dgApplyAmountInfo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DgApplyAmountInfoRequest applyAmountInfo = new DgApplyAmountInfoRequest(); |
|
|
|
|
|
|
|
applyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId()); |
|
|
|
|
|
|
|
//根据企业id查询企业详情
|
|
|
|
|
|
|
|
ResponseResult result = crmsFeignService.queryCustomerInfoById(applyAmountInfo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LinkedHashMap linkedList = (LinkedHashMap)result.getData(); |
|
|
|
|
|
|
|
System.out.println("企业详细============"+linkedList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AssetsDetailResponse assetsDetailResponse = new AssetsDetailResponse(); |
|
|
|
|
|
|
|
assetsDetailResponse.setDgApplyAmountInfo(dgApplyAmountInfo); |
|
|
|
|
|
|
|
assetsDetailResponse.setLinkedHashMap(linkedList); |
|
|
|
|
|
|
|
assetsDetailResponse.setAssetsResponse(assetsResponse); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return assetsDetailResponse; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int investigateGuarantee(InvestigateAssetsRequest investigateAssetsRequest) { |
|
|
|
|
|
|
|
//根据主键id查询业务id
|
|
|
|
|
|
|
|
DgAssetsInvestigation dgAssetsInvestigation = this.getBaseMapper().selectById(investigateAssetsRequest.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//资产部调查员调查,修改审核意见以及状态,修改其他数据
|
|
|
|
|
|
|
|
DgAssetsInvestigation assetsInvestigation = new DgAssetsInvestigation(); |
|
|
|
|
|
|
|
assetsInvestigation.setId(investigateAssetsRequest.getId());//主键id
|
|
|
|
|
|
|
|
assetsInvestigation.setStatus(investigateAssetsRequest.getStatus());//状态
|
|
|
|
|
|
|
|
assetsInvestigation.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理
|
|
|
|
|
|
|
|
assetsInvestigation.setApplyContent(investigateAssetsRequest.getApplyContent());//审核意见
|
|
|
|
|
|
|
|
assetsInvestigation.setAmountSum(investigateAssetsRequest.getAmountSum());//合计
|
|
|
|
|
|
|
|
assetsInvestigation.setAssetsName(investigateAssetsRequest.getAssetsName()); |
|
|
|
|
|
|
|
assetsInvestigation.setAssetsCode(investigateAssetsRequest.getAssetsCode()); |
|
|
|
|
|
|
|
assetsInvestigation.setAssetsTime(investigateAssetsRequest.getAssetsTime()); |
|
|
|
|
|
|
|
assetsInvestigation.setAuditName(investigateAssetsRequest.getAuditName()); |
|
|
|
|
|
|
|
assetsInvestigation.setAuditCode(investigateAssetsRequest.getAuditCode()); |
|
|
|
|
|
|
|
assetsInvestigation.setAuditTime(investigateAssetsRequest.getAuditTime()); |
|
|
|
|
|
|
|
assetsInvestigation.setAuditAmount(investigateAssetsRequest.getAuditAmount()); |
|
|
|
|
|
|
|
assetsInvestigation.setFile(ArraysUtil.toString(investigateAssetsRequest.getFile())); |
|
|
|
|
|
|
|
this.baseMapper.updateById(assetsInvestigation); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据业务id批量新增数据到评估价值列表
|
|
|
|
|
|
|
|
dgAssetsAssessmentAssetsLogMapper.insertAssetsList(investigateAssetsRequest.getAssessmentList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断资产部调查员是否调查通过,如果通过,修改资产部经理操作状态为待处理
|
|
|
|
|
|
|
|
if(investigateAssetsRequest.getStatus()==1){//状态为审核中
|
|
|
|
|
|
|
|
DgAssetsInvestigation assetsInvestigation2= new DgAssetsInvestigation(); |
|
|
|
|
|
|
|
assetsInvestigation2.setOperatingStatus(StatusCode.CZ_ON_HAND); |
|
|
|
|
|
|
|
this.baseMapper.update(assetsInvestigation2,new QueryWrapper<DgAssetsInvestigation>(). |
|
|
|
|
|
|
|
eq("business_id",dgAssetsInvestigation.getBusinessId()).eq("type",2)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int approvalAssets(ApprovalAssetsRequest approvalAssetsRequest) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DgAssetsInvestigation dgAssetsInvestigation = new DgAssetsInvestigation(); |
|
|
|
|
|
|
|
dgAssetsInvestigation.setId(approvalAssetsRequest.getId()); |
|
|
|
|
|
|
|
dgAssetsInvestigation.setEmpId(5);//Integer.parseInt(dgApplyAmountInfoController.getUserId())
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setRemark(ArraysUtil.toString(approvalAssetsRequest.getRemark()));//补充原因
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setStatus(approvalAssetsRequest.getStatus()); |
|
|
|
|
|
|
|
dgAssetsInvestigation.setOperatingStatus(StatusCode.CZ_PROCESSED);//状态设置为已处理
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setAmount(approvalAssetsRequest.getAmount());//金额
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setTerm(approvalAssetsRequest.getTerm());//期限
|
|
|
|
|
|
|
|
dgAssetsInvestigation.setApplyContent(approvalAssetsRequest.getApplyContent());//审核意见
|
|
|
|
|
|
|
|
//根据主键id修改资产部记录
|
|
|
|
|
|
|
|
this.baseMapper.updateById(dgAssetsInvestigation); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据主键id查询资产部记录
|
|
|
|
|
|
|
|
DgAssetsInvestigation assetsInvestigation = this.baseMapper.selectById(approvalAssetsRequest.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果资产部经理审核通过,则往担保部分管领导处加一条记录,由分管领导审核
|
|
|
|
|
|
|
|
if(approvalAssetsRequest.getStatus()==StatusCode.SP_IN_REVIEW && assetsInvestigation.getOperatingStatus()==StatusCode.CZ_PROCESSED && assetsInvestigation.getType()==2){//资产部经理审核通过
|
|
|
|
|
|
|
|
//根据主键id查询业务id
|
|
|
|
|
|
|
|
DgAssetsInvestigation assetsInvestigation2 = this.getBaseMapper().selectById(approvalAssetsRequest.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DgAssetsInvestigation assets = new DgAssetsInvestigation(); |
|
|
|
|
|
|
|
assets.setBusinessId(assetsInvestigation2.getBusinessId()); |
|
|
|
|
|
|
|
assets.setCompanyId(assetsInvestigation2.getCompanyId()); |
|
|
|
|
|
|
|
assets.setRoleId(PromptSuccess.ZC_LD_ID);//资产部分管领导
|
|
|
|
|
|
|
|
assets.setType(3);//分管领导审核
|
|
|
|
|
|
|
|
assets.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中
|
|
|
|
|
|
|
|
assets.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
|
|
|
|
|
|
|
|
this.baseMapper.insert(assets); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果担保部分管领导审核通过,同时判断资产部分管领导审核以及信息部分管领导审核是否通过,如果通过就往合规调查中插入一条数据
|
|
|
|
|
|
|
|
//待完善
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|