Commit c541232b authored by 陈宏杰's avatar 陈宏杰

更改D3姓名取值逻辑

parent 99be23c7
...@@ -66,4 +66,6 @@ public interface ApplyLoanInfoMapper { ...@@ -66,4 +66,6 @@ public interface ApplyLoanInfoMapper {
List<ApplyLoanInfoZhuDai> findApplyLoanZhuDai(BaiHangTimeRecord timeRecord); List<ApplyLoanInfoZhuDai> findApplyLoanZhuDai(BaiHangTimeRecord timeRecord);
ApplyLoanInfoZhuDai findApplyLoanInfoZhuDaiOfLately(String applyId);
} }
...@@ -85,5 +85,6 @@ public interface LoanInfoMapper { ...@@ -85,5 +85,6 @@ public interface LoanInfoMapper {
List<RepairDataOfLoanAccountExt> findRepairDataOfLoanAccountExt(String loanApplicationHistoryId); List<RepairDataOfLoanAccountExt> findRepairDataOfLoanAccountExt(String loanApplicationHistoryId);
LoanInfoZhuDai findLoanInfoZhuDaiOfLately(String loanId);
} }
...@@ -21,7 +21,6 @@ import cn.quantgroup.report.service.http.IHttpService; ...@@ -21,7 +21,6 @@ import cn.quantgroup.report.service.http.IHttpService;
import cn.quantgroup.report.utils.DateUtils; import cn.quantgroup.report.utils.DateUtils;
import cn.quantgroup.report.utils.IdUtils; import cn.quantgroup.report.utils.IdUtils;
import cn.quantgroup.report.utils.SftpUtil; import cn.quantgroup.report.utils.SftpUtil;
import cn.quantgroup.report.utils.StringUtil;
import cn.quantgroup.report.utils.dingtalk.DingTalk; import cn.quantgroup.report.utils.dingtalk.DingTalk;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -571,26 +570,20 @@ public class BaiHangFileReportService { ...@@ -571,26 +570,20 @@ public class BaiHangFileReportService {
repaymentLoanInfos = repaymentLoanInfoMapper.queryOverdueRecordOfD3(BaiHangTimeRecord.builder().startTime(startTime).endTime(endTime).loanStartTime(loanStartTime).loanEndTime(loanEndTime).linkPointTime(linkPointTime).build()); repaymentLoanInfos = repaymentLoanInfoMapper.queryOverdueRecordOfD3(BaiHangTimeRecord.builder().startTime(startTime).endTime(endTime).loanStartTime(loanStartTime).loanEndTime(loanEndTime).linkPointTime(linkPointTime).build());
log.info("量化派助贷TO百行报送(D3)-逾期记录查询结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} ", startTime, endTime, repaymentLoanInfos.size(), (queryStopwatch.stop().elapsed(TimeUnit.MILLISECONDS) / 1000) + ".s"); log.info("量化派助贷TO百行报送(D3)-逾期记录查询结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} ", startTime, endTime, repaymentLoanInfos.size(), (queryStopwatch.stop().elapsed(TimeUnit.MILLISECONDS) / 1000) + ".s");
AtomicInteger atomicInteger = new AtomicInteger(); AtomicInteger atomicInteger = new AtomicInteger();
String id = ""; String id = "", nameForD3 = null;
for (int i = 0; i < repaymentLoanInfos.size(); i++) { for (int i = 0; i < repaymentLoanInfos.size(); i++) {
RepaymentInfoZhuDai repaymentLoanInfo = repaymentLoanInfos.get(i); RepaymentInfoZhuDai repaymentLoanInfo = repaymentLoanInfos.get(i);
try { try {
id = UUID.randomUUID().toString().replaceAll("-", ""); id = UUID.randomUUID().toString().replaceAll("-", "");
RepaymentInfoZhuDai record = new RepaymentInfoZhuDai(); RepaymentInfoZhuDai record = new RepaymentInfoZhuDai();
nameForD3 = getNameForD3(repaymentLoanInfo.getLoanId());
if (StringUtils.isNotBlank(nameForD3)) {
repaymentLoanInfo.setName(nameForD3);
}
BeanUtils.copyProperties(repaymentLoanInfo, record); BeanUtils.copyProperties(repaymentLoanInfo, record);
record.setRecordId(id); record.setRecordId(id);
recordList.add(record); recordList.add(record);
repaymentLoanInfo.setReqID(id); repaymentLoanInfo.setReqID(id);
if (StringUtil.getLenOfStr(repaymentLoanInfo.getName())<=1.0) {
log.error("姓名 {} 格式有误,loanId {}",repaymentLoanInfo.getName(),repaymentLoanInfo.getLoanId());
List<ApplyLoanInfoZhuDai> zhuDaiLogList = applyLoanInfoZhuDaiMapper.findByApplyId(repaymentLoanInfo.getLoanId());
if (!CollectionUtils.isEmpty(zhuDaiLogList)) {
repaymentLoanInfo.setName(zhuDaiLogList.get(0).getName());
log.info("loanId {} , 姓名已更改为 {}",repaymentLoanInfo.getLoanId(),repaymentLoanInfo.getName());
} else {
log.error("loanId {} , 姓名未更改",repaymentLoanInfo.getLoanId());
}
}
repaymentLoanInfo.setName(sensitiveFilter(repaymentLoanInfo.getName())); repaymentLoanInfo.setName(sensitiveFilter(repaymentLoanInfo.getName()));
repaymentLoanInfo.setPid(sensitiveFilter(repaymentLoanInfo.getPid())); repaymentLoanInfo.setPid(sensitiveFilter(repaymentLoanInfo.getPid()));
repaymentLoanInfo.setMobile(sensitiveFilter(repaymentLoanInfo.getMobile())); repaymentLoanInfo.setMobile(sensitiveFilter(repaymentLoanInfo.getMobile()));
...@@ -631,7 +624,7 @@ public class BaiHangFileReportService { ...@@ -631,7 +624,7 @@ public class BaiHangFileReportService {
List<RepaymentInfoZhuDai> repaymentLoanInfos = new ArrayList<>(D3_INITIAL_CAPACITY),tempRepaymentLoanInfos = null,recordList = new ArrayList<>(D3_INITIAL_CAPACITY); List<RepaymentInfoZhuDai> repaymentLoanInfos = new ArrayList<>(D3_INITIAL_CAPACITY),tempRepaymentLoanInfos = null,recordList = new ArrayList<>(D3_INITIAL_CAPACITY);
Date stepEndDate = null; Date stepEndDate = null;
Integer step = null; Integer step = null;
String id = ""; String id = "" , nameForD3 = null;
AtomicInteger atomicInteger = new AtomicInteger(); AtomicInteger atomicInteger = new AtomicInteger();
List<String> reportList = new ArrayList<>(D3_INITIAL_CAPACITY); List<String> reportList = new ArrayList<>(D3_INITIAL_CAPACITY);
reportList.add("#singleLoanRepayInfo"); reportList.add("#singleLoanRepayInfo");
...@@ -666,20 +659,14 @@ public class BaiHangFileReportService { ...@@ -666,20 +659,14 @@ public class BaiHangFileReportService {
try { try {
id = UUID.randomUUID().toString().replaceAll("-", ""); id = UUID.randomUUID().toString().replaceAll("-", "");
RepaymentInfoZhuDai record = new RepaymentInfoZhuDai(); RepaymentInfoZhuDai record = new RepaymentInfoZhuDai();
nameForD3 = getNameForD3(repaymentLoanInfo.getLoanId());
if (StringUtils.isNotBlank(nameForD3)) {
repaymentLoanInfo.setName(nameForD3);
}
BeanUtils.copyProperties(repaymentLoanInfo, record); BeanUtils.copyProperties(repaymentLoanInfo, record);
record.setRecordId(id); record.setRecordId(id);
recordList.add(record); recordList.add(record);
repaymentLoanInfo.setReqID(id); repaymentLoanInfo.setReqID(id);
if (StringUtil.getLenOfStr(repaymentLoanInfo.getName())<=1.0) {
log.error("姓名 {} 格式有误,loanId {}",repaymentLoanInfo.getName(),repaymentLoanInfo.getLoanId());
List<ApplyLoanInfoZhuDai> zhuDaiLogList = applyLoanInfoZhuDaiMapper.findByApplyId(repaymentLoanInfo.getLoanId());
if (!CollectionUtils.isEmpty(zhuDaiLogList)) {
repaymentLoanInfo.setName(zhuDaiLogList.get(0).getName());
log.info("loanId {} , 姓名已更改为 {}",repaymentLoanInfo.getLoanId(),repaymentLoanInfo.getName());
} else {
log.error("loanId {} , 姓名未更改",repaymentLoanInfo.getLoanId());
}
}
repaymentLoanInfo.setName(sensitiveFilter(repaymentLoanInfo.getName())); repaymentLoanInfo.setName(sensitiveFilter(repaymentLoanInfo.getName()));
repaymentLoanInfo.setPid(sensitiveFilter(repaymentLoanInfo.getPid())); repaymentLoanInfo.setPid(sensitiveFilter(repaymentLoanInfo.getPid()));
repaymentLoanInfo.setMobile(sensitiveFilter(repaymentLoanInfo.getMobile())); repaymentLoanInfo.setMobile(sensitiveFilter(repaymentLoanInfo.getMobile()));
...@@ -728,7 +715,7 @@ public class BaiHangFileReportService { ...@@ -728,7 +715,7 @@ public class BaiHangFileReportService {
repaymentLoanInfos = repaymentLoanInfoMapper.queryRepayMentRecordOfD3(BaiHangTimeRecord.builder().startTime(startTime).endTime(endTime).loanStartTime(loanStartTime).loanEndTime(loanEndTime).linkPointTime(linkPointTime).build()); repaymentLoanInfos = repaymentLoanInfoMapper.queryRepayMentRecordOfD3(BaiHangTimeRecord.builder().startTime(startTime).endTime(endTime).loanStartTime(loanStartTime).loanEndTime(loanEndTime).linkPointTime(linkPointTime).build());
log.info("量化派助贷TO百行报送(D3)-还款记录查询结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} ", startTime, endTime, repaymentLoanInfos.size(), (queryStopwatch.stop().elapsed(TimeUnit.MILLISECONDS) / 1000) + ".s"); log.info("量化派助贷TO百行报送(D3)-还款记录查询结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} ", startTime, endTime, repaymentLoanInfos.size(), (queryStopwatch.stop().elapsed(TimeUnit.MILLISECONDS) / 1000) + ".s");
AtomicInteger atomicInteger = new AtomicInteger(); AtomicInteger atomicInteger = new AtomicInteger();
String id = ""; String id = "" , nameForD3 = null;
for (int i = 0; i < repaymentLoanInfos.size(); i++) { for (int i = 0; i < repaymentLoanInfos.size(); i++) {
RepaymentInfoZhuDai repaymentLoanInfo = repaymentLoanInfos.get(i); RepaymentInfoZhuDai repaymentLoanInfo = repaymentLoanInfos.get(i);
try { try {
...@@ -741,20 +728,14 @@ public class BaiHangFileReportService { ...@@ -741,20 +728,14 @@ public class BaiHangFileReportService {
} }
id = UUID.randomUUID().toString().replaceAll("-", ""); id = UUID.randomUUID().toString().replaceAll("-", "");
RepaymentInfoZhuDai record = new RepaymentInfoZhuDai(); RepaymentInfoZhuDai record = new RepaymentInfoZhuDai();
nameForD3 = getNameForD3(repaymentLoanInfo.getLoanId());
if (StringUtils.isNotBlank(nameForD3)) {
repaymentLoanInfo.setName(nameForD3);
}
BeanUtils.copyProperties(repaymentLoanInfo, record); BeanUtils.copyProperties(repaymentLoanInfo, record);
record.setRecordId(id); record.setRecordId(id);
recordList.add(record); recordList.add(record);
repaymentLoanInfo.setReqID(id); repaymentLoanInfo.setReqID(id);
if (StringUtil.getLenOfStr(repaymentLoanInfo.getName())<=1.0) {
log.error("姓名 {} 格式有误,loanId {}",repaymentLoanInfo.getName(),repaymentLoanInfo.getLoanId());
List<ApplyLoanInfoZhuDai> zhuDaiLogList = applyLoanInfoZhuDaiMapper.findByApplyId(repaymentLoanInfo.getLoanId());
if (!CollectionUtils.isEmpty(zhuDaiLogList)) {
repaymentLoanInfo.setName(zhuDaiLogList.get(0).getName());
log.info("loanId {} , 姓名已更改为 {}",repaymentLoanInfo.getLoanId(),repaymentLoanInfo.getName());
} else {
log.error("loanId {} , 姓名未更改",repaymentLoanInfo.getLoanId());
}
}
repaymentLoanInfo.setName(sensitiveFilter(repaymentLoanInfo.getName())); repaymentLoanInfo.setName(sensitiveFilter(repaymentLoanInfo.getName()));
repaymentLoanInfo.setPid(sensitiveFilter(repaymentLoanInfo.getPid())); repaymentLoanInfo.setPid(sensitiveFilter(repaymentLoanInfo.getPid()));
repaymentLoanInfo.setMobile(sensitiveFilter(repaymentLoanInfo.getMobile())); repaymentLoanInfo.setMobile(sensitiveFilter(repaymentLoanInfo.getMobile()));
...@@ -1024,4 +1005,16 @@ public class BaiHangFileReportService { ...@@ -1024,4 +1005,16 @@ public class BaiHangFileReportService {
return headMark; return headMark;
} }
private String getNameForD3(String applyId) {
String name = null;
LoanInfoZhuDai loanInfoZhuDaiOfLately = loanInfoMapper.findLoanInfoZhuDaiOfLately(applyId);
if (Objects.nonNull(loanInfoZhuDaiOfLately)) {
name = loanInfoZhuDaiOfLately.getName();
} else {
ApplyLoanInfoZhuDai applyLoanInfoZhuDaiOfLately = applyLoanInfoMapper.findApplyLoanInfoZhuDaiOfLately(applyId);
name = Objects.nonNull(applyLoanInfoZhuDaiOfLately) ? applyLoanInfoZhuDaiOfLately.getName() : null;
}
return name;
}
} }
...@@ -246,5 +246,12 @@ ...@@ -246,5 +246,12 @@
</select> </select>
<select id="findApplyLoanInfoZhuDaiOfLately" parameterType="java.lang.String" resultType="cn.quantgroup.report.domain.baihang.ApplyLoanInfoZhuDai">
select *
from risk_datasource.apply_loan_info_zhudai
where apply_id = #{applyId,jdbcType=VARCHAR}
order by id desc limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -460,4 +460,12 @@ ...@@ -460,4 +460,12 @@
where c.loan_id = #{loanApplicationHistoryId,jdbcType=VARCHAR} where c.loan_id = #{loanApplicationHistoryId,jdbcType=VARCHAR}
</select> </select>
<select id="findLoanInfoZhuDaiOfLately" parameterType="java.lang.String" resultType="cn.quantgroup.report.domain.baihang.LoanInfoZhuDai">
select *
from risk_datasource.loan_info_zhudai
where loan_id = #{loanId,jdbcType=VARCHAR}
order by id desc limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment