|
@@ -1,25 +1,12 @@
|
|
package com.sunxung.factoring.start.impl;
|
|
package com.sunxung.factoring.start.impl;
|
|
|
|
|
|
-import com.sunxung.factoring.component.util.ConstantUtil;
|
|
|
|
-import com.sunxung.factoring.component.util.MockAdminThreadLocalUtil;
|
|
|
|
-import com.sunxung.factoring.entity.financing.apply.CFinancingBasicInfo;
|
|
|
|
-import com.sunxung.factoring.entity.smb.FinancingLoanInfo;
|
|
|
|
import com.sunxung.factoring.entity.sys.SqlVersion;
|
|
import com.sunxung.factoring.entity.sys.SqlVersion;
|
|
-import com.sunxung.factoring.service.financing.apply.ICFinancingBasicInfoService;
|
|
|
|
-import com.sunxung.factoring.service.financing.payment.IPaymentApplyService;
|
|
|
|
-import com.sunxung.factoring.service.smb.IFinancingLoanInfoService;
|
|
|
|
-import com.sunxung.factoring.service.smbApi.dto.SMBNotifyRespDto;
|
|
|
|
-import com.sunxung.factoring.service.smbApi.dto.WithdrawNotifyPayloadDto;
|
|
|
|
-import com.sunxung.factoring.service.smbApi.spi.SMBSpiRegister;
|
|
|
|
import com.sunxung.factoring.start.StartLoad;
|
|
import com.sunxung.factoring.start.StartLoad;
|
|
import org.apache.logging.log4j.LogManager;
|
|
import org.apache.logging.log4j.LogManager;
|
|
import org.apache.logging.log4j.Logger;
|
|
import org.apache.logging.log4j.Logger;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.function.Function;
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 系统启动环境加载实现
|
|
* 系统启动环境加载实现
|
|
*/
|
|
*/
|
|
@@ -28,15 +15,6 @@ public class StartLoadImpl implements StartLoad {
|
|
|
|
|
|
private static Logger log = LogManager.getLogger(StartLoadImpl.class);
|
|
private static Logger log = LogManager.getLogger(StartLoadImpl.class);
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private SMBSpiRegister smbSpiRegister;
|
|
|
|
- @Autowired
|
|
|
|
- private IFinancingLoanInfoService financingLoanInfoService;
|
|
|
|
- @Autowired
|
|
|
|
- private ICFinancingBasicInfoService financingBasicInfoService;
|
|
|
|
- @Autowired
|
|
|
|
- private IPaymentApplyService paymentApplyService;
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 是否初始化
|
|
* 是否初始化
|
|
*/
|
|
*/
|
|
@@ -61,71 +39,29 @@ public class StartLoadImpl implements StartLoad {
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
private void init() throws Exception {
|
|
private void init() throws Exception {
|
|
- long startTime = System.currentTimeMillis();
|
|
|
|
- log.error("开始初始化");
|
|
|
|
- log.error("开始初始化数据库");
|
|
|
|
- MockAdminThreadLocalUtil.mock();
|
|
|
|
- log.error("开始初始化字典项");
|
|
|
|
- new DictionaryInit().run();
|
|
|
|
- log.error("开始初始化权限");
|
|
|
|
- new PermissionInit().run();
|
|
|
|
- log.error("开始初始化组织机构");
|
|
|
|
- new OrgInit().run();
|
|
|
|
- log.error("开始初始化行政区划");
|
|
|
|
- log.error("开始初始化角色");
|
|
|
|
- new RoleInit().run();
|
|
|
|
- log.error("开始初始化用户");
|
|
|
|
- new UserInit().run();
|
|
|
|
- log.error("开始初始化工作日");
|
|
|
|
- new WorkingDayInit().run();
|
|
|
|
- log.error("开始初始化脚本升级最大版本号");
|
|
|
|
- addSqlVersion();
|
|
|
|
- smbNoticeInit();
|
|
|
|
- log.error("成功初始化,耗时:" + (System.currentTimeMillis() - startTime) / 1000.0 + "秒");
|
|
|
|
- MockAdminThreadLocalUtil.destroy();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 苏商注册提款结果通知回调函数初始化
|
|
|
|
- */
|
|
|
|
- private void smbNoticeInit() {
|
|
|
|
- Function<WithdrawNotifyPayloadDto, SMBNotifyRespDto> withdrawNotifyHandler = withdrawNotifyPayloadDto -> {
|
|
|
|
- if (withdrawNotifyPayloadDto.getPayoutNo() != null) {
|
|
|
|
- FinancingLoanInfo loanInfo = financingLoanInfoService.lambdaQuery().eq(FinancingLoanInfo::getPayoutNo, withdrawNotifyPayloadDto.getPayoutNo()).one();
|
|
|
|
- if (loanInfo != null) {
|
|
|
|
- //借据编号
|
|
|
|
- loanInfo.setDueBillNo(withdrawNotifyPayloadDto.getDuebillNo());
|
|
|
|
- //到期日期
|
|
|
|
- loanInfo.setMaturityDate(withdrawNotifyPayloadDto.getMaturity());
|
|
|
|
- //提款申请日期
|
|
|
|
- loanInfo.setLoanApplyDate(withdrawNotifyPayloadDto.getLoanApplyTime());
|
|
|
|
- //放款日期
|
|
|
|
- loanInfo.setPayoutDate(withdrawNotifyPayloadDto.getPayoutDate());
|
|
|
|
- //放款状态
|
|
|
|
- loanInfo.setPayoutStatus(withdrawNotifyPayloadDto.getStatus());
|
|
|
|
- //放款金额
|
|
|
|
- loanInfo.setLoanAmount(withdrawNotifyPayloadDto.getBusiAmt());
|
|
|
|
- if ("03".equals(withdrawNotifyPayloadDto.getStatus())) {
|
|
|
|
- //如果提款失败,添加失败原因
|
|
|
|
- loanInfo.setFailMsg(withdrawNotifyPayloadDto.getRemark());
|
|
|
|
- }
|
|
|
|
- financingLoanInfoService.updateById(loanInfo);
|
|
|
|
- if ("02".equals(withdrawNotifyPayloadDto.getStatus())) {
|
|
|
|
- //如果提款成功后、需要向sop推送融资信息
|
|
|
|
- if (loanInfo.getcFinancingBasicInfoId() != null) {
|
|
|
|
- CFinancingBasicInfo financingBasicInfo = financingBasicInfoService.getById(loanInfo.getcFinancingBasicInfoId());
|
|
|
|
- if (financingBasicInfo != null) {
|
|
|
|
- paymentApplyService.financingToSop(financingBasicInfo, ConstantUtil.JIANGSU_SUSHANG_BANK, loanInfo.getPayoutDate());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- SMBNotifyRespDto respDto = new SMBNotifyRespDto();
|
|
|
|
- respDto.setRespResult(true);
|
|
|
|
- return respDto;
|
|
|
|
- };
|
|
|
|
- smbSpiRegister.registerWithdrawNotifyHandler(withdrawNotifyHandler);
|
|
|
|
|
|
+// long startTime = System.currentTimeMillis();
|
|
|
|
+// log.error("开始初始化");
|
|
|
|
+// log.error("开始初始化数据库");
|
|
|
|
+// MockAdminThreadLocalUtil.mock();
|
|
|
|
+// log.error("开始初始化字典项");
|
|
|
|
+// new DictionaryInit().run();
|
|
|
|
+// log.error("开始初始化权限");
|
|
|
|
+// new PermissionInit().run();
|
|
|
|
+// log.error("开始初始化组织机构");
|
|
|
|
+// new OrgInit().run();
|
|
|
|
+// log.error("开始初始化行政区划");
|
|
|
|
+// log.error("开始初始化角色");
|
|
|
|
+// new RoleInit().run();
|
|
|
|
+// log.error("开始初始化用户");
|
|
|
|
+// new UserInit().run();
|
|
|
|
+// log.error("开始初始化工作日");
|
|
|
|
+// new WorkingDayInit().run();
|
|
|
|
+// log.error("开始初始化脚本升级最大版本号");
|
|
|
|
+// addSqlVersion();
|
|
|
|
+// log.error("成功初始化,耗时:" + (System.currentTimeMillis() - startTime) / 1000.0 + "秒");
|
|
|
|
+// MockAdminThreadLocalUtil.destroy();
|
|
|
|
+ log.error("开始初始化苏商注册提款结果通知回调函数");
|
|
|
|
+ new SMBNoticeInit().run();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|