|
@@ -9,6 +9,8 @@ import com.snb.fsos.bean.AccountInfoQuery;
|
|
|
import com.snb.fsos.bean.ProductCreditApplyV2;
|
|
|
import com.snb.fsos.bean.SMBFileUpload;
|
|
|
import com.sunxung.factoring.component.enums.CreditInvestigationTypeEnums;
|
|
|
+import com.sunxung.factoring.component.enums.SmbCreditStatusEnum;
|
|
|
+import com.sunxung.factoring.component.enums.SmbLimitStatusEnum;
|
|
|
import com.sunxung.factoring.component.enums.SupplierStatusEnums;
|
|
|
import com.sunxung.factoring.component.exception.BusinessException;
|
|
|
import com.sunxung.factoring.component.exception.ValidatorException;
|
|
@@ -367,17 +369,17 @@ public class FinancingFromInvestorsServiceImpl extends ServiceImpl<FinancingFrom
|
|
|
log.info("苏商银行授信请求結果:" + creditApplyResp.toString());
|
|
|
// 状态 01 待审批;02 审批中;03 审批通过;04 审批拒绝;06 已归档;07 处理中
|
|
|
if (creditApplyResp.getStatus().equals("01")) {
|
|
|
- financingFromInvestors.setCreditStatus("待审批");
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_01.getCode());
|
|
|
} else if (creditApplyResp.getStatus().equals("02")) {
|
|
|
- financingFromInvestors.setCreditStatus("审批中");
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_02.getCode());
|
|
|
} else if (creditApplyResp.getStatus().equals("03")) {
|
|
|
- financingFromInvestors.setCreditStatus("审批通过");
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_03.getCode());
|
|
|
} else if (creditApplyResp.getStatus().equals("04")) {
|
|
|
- financingFromInvestors.setCreditStatus("审批拒绝");
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_04.getCode());
|
|
|
} else if (creditApplyResp.getStatus().equals("06")) {
|
|
|
- financingFromInvestors.setCreditStatus("已归档");
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_06.getCode());
|
|
|
} else if (creditApplyResp.getStatus().equals("07")) {
|
|
|
- financingFromInvestors.setCreditStatus("处理中");
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_07.getCode());
|
|
|
}
|
|
|
financingFromInvestors.setOpenId(creditApplyResp.getOpenId());
|
|
|
//保存历史
|
|
@@ -689,11 +691,12 @@ public class FinancingFromInvestorsServiceImpl extends ServiceImpl<FinancingFrom
|
|
|
FinancingFromInvestorsHistory financingFromInvestorsHistory = financingFromInvestorsHistories.get(0);
|
|
|
FinancingFromInvestorsNotice financingFromInvestorsNotice = financingFromInvestorsNoticeService.lambdaQuery().eq(FinancingFromInvestorsNotice::getFinancingFromInvestorsHistoryId, financingFromInvestorsHistory.getId()).one();
|
|
|
if (financingFromInvestorsNotice != null && financingFromInvestorsNotice.getExpiringDate().compareTo(new Date()) < 1) {
|
|
|
- financingFromInvestors.setCreditStatus("授信过期");
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_12.getCode());
|
|
|
this.updateById(financingFromInvestors);
|
|
|
}
|
|
|
financingFromInvestors.setFinancingFromInvestorsNotice(financingFromInvestorsNotice);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
return new GridPage<>(financingFromInvestorsSearchVo.getRows(), financingFromInvestorsSearchVo.getPage(), page.getTotal(), list);
|
|
|
}
|
|
@@ -872,26 +875,26 @@ public class FinancingFromInvestorsServiceImpl extends ServiceImpl<FinancingFrom
|
|
|
financingFromInvestorsNotice.setApplyDate(DateUtil.parseDate(creditProcessQueryResp.getApplyDate()));
|
|
|
// 状态 01 待审批 02 审批中 03 审批通过 04审批拒绝 06 已归档 07 处理中 11 运营岗审核
|
|
|
if (creditProcessQueryResp.getApplyStatus().equals("01")) {
|
|
|
- financingFromInvestorsNotice.setApplyStatus("待审批");
|
|
|
- financingFromInvestors.setCreditStatus("待审批");
|
|
|
+ financingFromInvestorsNotice.setApplyStatus(SmbCreditStatusEnum.STATUS_01.getCode());
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_01.getCode());
|
|
|
} else if (creditProcessQueryResp.getApplyStatus().equals("02")) {
|
|
|
- financingFromInvestorsNotice.setApplyStatus("审批中");
|
|
|
- financingFromInvestors.setCreditStatus("审批中");
|
|
|
+ financingFromInvestorsNotice.setApplyStatus(SmbCreditStatusEnum.STATUS_02.getCode());
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_02.getCode());
|
|
|
} else if (creditProcessQueryResp.getApplyStatus().equals("03")) {
|
|
|
- financingFromInvestorsNotice.setApplyStatus("审批通过");
|
|
|
- financingFromInvestors.setCreditStatus("审批通过");
|
|
|
+ financingFromInvestorsNotice.setApplyStatus(SmbCreditStatusEnum.STATUS_03.getCode());
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_03.getCode());
|
|
|
} else if (creditProcessQueryResp.getApplyStatus().equals("04")) {
|
|
|
- financingFromInvestorsNotice.setApplyStatus("审批拒绝");
|
|
|
- financingFromInvestors.setCreditStatus("审批拒绝");
|
|
|
+ financingFromInvestorsNotice.setApplyStatus(SmbCreditStatusEnum.STATUS_04.getCode());
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_04.getCode());
|
|
|
} else if (creditProcessQueryResp.getApplyStatus().equals("06")) {
|
|
|
- financingFromInvestorsNotice.setApplyStatus("已归档");
|
|
|
- financingFromInvestors.setCreditStatus("已归档");
|
|
|
+ financingFromInvestorsNotice.setApplyStatus(SmbCreditStatusEnum.STATUS_06.getCode());
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_06.getCode());
|
|
|
} else if (creditProcessQueryResp.getApplyStatus().equals("07")) {
|
|
|
- financingFromInvestorsNotice.setApplyStatus("处理中");
|
|
|
- financingFromInvestors.setCreditStatus("处理中");
|
|
|
+ financingFromInvestorsNotice.setApplyStatus(SmbCreditStatusEnum.STATUS_07.getCode());
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_07.getCode());
|
|
|
} else if (creditProcessQueryResp.getApplyStatus().equals("11")) {
|
|
|
- financingFromInvestorsNotice.setApplyStatus("运营岗审核");
|
|
|
- financingFromInvestors.setCreditStatus("运营岗审核");
|
|
|
+ financingFromInvestorsNotice.setApplyStatus(SmbCreditStatusEnum.STATUS_11.getCode());
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_11.getCode());
|
|
|
}
|
|
|
this.updateById(financingFromInvestors);
|
|
|
if(StringUtil.isNotEmpty(creditProcessQueryResp.getNextApplyTime())){
|
|
@@ -900,13 +903,13 @@ public class FinancingFromInvestorsServiceImpl extends ServiceImpl<FinancingFrom
|
|
|
financingFromInvestorsNotice.setRejectReason(creditProcessQueryResp.getReasonMsg());
|
|
|
// 额度状态 001-未激活;002-生效;004-冻结;005-失效
|
|
|
if (creditProcessQueryResp.getLimitStatus().equals("001")) {
|
|
|
- financingFromInvestorsNotice.setLimitStatus("未激活");
|
|
|
+ financingFromInvestorsNotice.setLimitStatus(SmbLimitStatusEnum.LIMIT_STATUS_001.getCode());
|
|
|
} else if (creditProcessQueryResp.getLimitStatus().equals("002")) {
|
|
|
- financingFromInvestorsNotice.setLimitStatus("生效");
|
|
|
+ financingFromInvestorsNotice.setLimitStatus(SmbLimitStatusEnum.LIMIT_STATUS_002.getCode());
|
|
|
} else if (creditProcessQueryResp.getLimitStatus().equals("004")) {
|
|
|
- financingFromInvestorsNotice.setLimitStatus("冻结");
|
|
|
+ financingFromInvestorsNotice.setLimitStatus(SmbLimitStatusEnum.LIMIT_STATUS_004.getCode());
|
|
|
} else if (creditProcessQueryResp.getLimitStatus().equals("005")) {
|
|
|
- financingFromInvestorsNotice.setLimitStatus("失效");
|
|
|
+ financingFromInvestorsNotice.setLimitStatus(SmbLimitStatusEnum.LIMIT_STATUS_005.getCode());
|
|
|
}
|
|
|
financingFromInvestorsNotice.setValidityPeriod(DateUtil.parseDate(creditProcessQueryResp.getAuthEndDate()));
|
|
|
if(creditProcessQueryResp.getCycleType().equals("0")){
|
|
@@ -948,6 +951,25 @@ public class FinancingFromInvestorsServiceImpl extends ServiceImpl<FinancingFrom
|
|
|
return financingFromInvestorsNotice;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void updateStatus() {
|
|
|
+ Date date = new Date();
|
|
|
+ List<FinancingFromInvestorsNotice> list = financingFromInvestorsNoticeService.lambdaQuery().lt(FinancingFromInvestorsNotice::getExpiringDate, date).list();
|
|
|
+ for (FinancingFromInvestorsNotice financingFromInvestorsNotice : list) {
|
|
|
+ FinancingFromInvestorsHistory financingFromInvestorsHistory = financingFromInvestorsHistoryService.lambdaQuery().eq(FinancingFromInvestorsHistory::getId, financingFromInvestorsNotice.getFinancingFromInvestorsHistoryId()).one();
|
|
|
+ FinancingFromInvestors financingFromInvestors = this.getById(financingFromInvestorsHistory.getFinancingFromInvestorsId());
|
|
|
+ financingFromInvestors.setCreditStatus(SmbCreditStatusEnum.STATUS_12.getCode());
|
|
|
+ this.updateById(financingFromInvestors);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<FinancingFromInvestors> financingFromInvestorsList = this.lambdaQuery().in(FinancingFromInvestors::getCreditStatus, SmbCreditStatusEnum.STATUS_01.getCode(), SmbCreditStatusEnum.STATUS_02.getCode(), SmbCreditStatusEnum.STATUS_03.getCode(), SmbCreditStatusEnum.STATUS_11.getCode()).list();
|
|
|
+ for (FinancingFromInvestors financingFromInvestors : financingFromInvestorsList) {
|
|
|
+ findCreditDetail(financingFromInvestors.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private FileStorage downloadFile(String remoteFilePath){
|
|
|
|