|
@@ -6,14 +6,22 @@ import cn.hutool.json.JSONArray;
|
|
import cn.hutool.json.JSONObject;
|
|
import cn.hutool.json.JSONObject;
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
+import com.sunxung.factoring.component.util.CollectionUtil;
|
|
|
|
+import com.sunxung.factoring.component.util.StringUtil;
|
|
import com.sunxung.factoring.entity.GridPage;
|
|
import com.sunxung.factoring.entity.GridPage;
|
|
import com.sunxung.factoring.entity.ResponseJson;
|
|
import com.sunxung.factoring.entity.ResponseJson;
|
|
|
|
+import com.sunxung.factoring.entity.financing.apply.CFinancingBasicInfo;
|
|
import com.sunxung.factoring.entity.financing.sop.RefinancingRepaymentPlan;
|
|
import com.sunxung.factoring.entity.financing.sop.RefinancingRepaymentPlan;
|
|
|
|
+import com.sunxung.factoring.entity.smb.FinancingLoanInfo;
|
|
import com.sunxung.factoring.entity.smb.vo.SmbRequestLogVo;
|
|
import com.sunxung.factoring.entity.smb.vo.SmbRequestLogVo;
|
|
import com.sunxung.factoring.entity.smbApi.SMBRequestLogPO;
|
|
import com.sunxung.factoring.entity.smbApi.SMBRequestLogPO;
|
|
import com.sunxung.factoring.entity.underlying.sop.PaymentCollectionPlanFactoring;
|
|
import com.sunxung.factoring.entity.underlying.sop.PaymentCollectionPlanFactoring;
|
|
import com.sunxung.factoring.mapper.smbApi.SMBRequestLogMapper;
|
|
import com.sunxung.factoring.mapper.smbApi.SMBRequestLogMapper;
|
|
|
|
+import com.sunxung.factoring.service.financing.apply.ICFinancingBasicInfoService;
|
|
|
|
+import com.sunxung.factoring.service.smb.IFinancingLoanInfoService;
|
|
import com.sunxung.factoring.service.smbApi.api.SMBRequestLogService;
|
|
import com.sunxung.factoring.service.smbApi.api.SMBRequestLogService;
|
|
|
|
+import com.sunxung.factoring.service.smbApi.constants.TransCodeEnum;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -30,6 +38,12 @@ public class SMBRequestLogServiceImpl implements SMBRequestLogService {
|
|
@Resource
|
|
@Resource
|
|
private SMBRequestLogMapper smbRequestLogMapper;
|
|
private SMBRequestLogMapper smbRequestLogMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IFinancingLoanInfoService financingLoanInfoService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICFinancingBasicInfoService financingBasicInfoService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void add(SMBRequestLogPO po) {
|
|
public void add(SMBRequestLogPO po) {
|
|
smbRequestLogMapper.add(po);
|
|
smbRequestLogMapper.add(po);
|
|
@@ -39,6 +53,19 @@ public class SMBRequestLogServiceImpl implements SMBRequestLogService {
|
|
public GridPage<SMBRequestLogPO> findBySearch(SmbRequestLogVo smbRequestLogVo) {
|
|
public GridPage<SMBRequestLogPO> findBySearch(SmbRequestLogVo smbRequestLogVo) {
|
|
Page page = PageHelper.startPage(smbRequestLogVo.getPage(), smbRequestLogVo.getRows());
|
|
Page page = PageHelper.startPage(smbRequestLogVo.getPage(), smbRequestLogVo.getRows());
|
|
List<SMBRequestLogPO> result = smbRequestLogMapper.findBySearch(smbRequestLogVo.getTransCode());
|
|
List<SMBRequestLogPO> result = smbRequestLogMapper.findBySearch(smbRequestLogVo.getTransCode());
|
|
|
|
+ for (SMBRequestLogPO smbRequestLogPO : result) {
|
|
|
|
+ String requestPayload = smbRequestLogPO.getRequestPayload();
|
|
|
|
+ JSONObject jsonObject = new JSONObject(requestPayload);
|
|
|
|
+ String duebillNo = jsonObject.getStr("duebillNo");
|
|
|
|
+ if(StringUtil.isNotEmpty(duebillNo)){
|
|
|
|
+ FinancingLoanInfo financingLoanInfo = financingLoanInfoService.lambdaQuery().eq(FinancingLoanInfo::getDueBillNo, duebillNo).eq(FinancingLoanInfo::getPayoutStatus, "02").one();
|
|
|
|
+ if(financingLoanInfo.getcFinancingBasicInfoId() != null){
|
|
|
|
+ CFinancingBasicInfo financingBasicInfo = financingBasicInfoService.getById(financingLoanInfo.getcFinancingBasicInfoId());
|
|
|
|
+ String businessNumber = financingBasicInfo.getBusinessNumber();
|
|
|
|
+ smbRequestLogPO.setBusinessNumber(businessNumber);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return new GridPage<>(smbRequestLogVo.getRows(),smbRequestLogVo.getPage(),page.getTotal(),result);
|
|
return new GridPage<>(smbRequestLogVo.getRows(),smbRequestLogVo.getPage(),page.getTotal(),result);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -54,7 +81,7 @@ public class SMBRequestLogServiceImpl implements SMBRequestLogService {
|
|
String requestPayload = smbRequestLogVo.getResponsePayload();
|
|
String requestPayload = smbRequestLogVo.getResponsePayload();
|
|
JSONObject jsonObject = new JSONObject(requestPayload);
|
|
JSONObject jsonObject = new JSONObject(requestPayload);
|
|
JSONArray repay ;
|
|
JSONArray repay ;
|
|
- if(smbRequestLogVo.getTransCode().equals("snb.eloan.ecpms.repay.plan.query")){
|
|
|
|
|
|
+ if(smbRequestLogVo.getTransCode().equals(TransCodeEnum.REPAY_PLAN_QUERY.getCode())){
|
|
repay = jsonObject.getJSONArray("list");
|
|
repay = jsonObject.getJSONArray("list");
|
|
for (Object o : repay) {
|
|
for (Object o : repay) {
|
|
JSONObject object = new JSONObject(o);
|
|
JSONObject object = new JSONObject(o);
|
|
@@ -82,7 +109,7 @@ public class SMBRequestLogServiceImpl implements SMBRequestLogService {
|
|
plans.add(refinancingRepaymentPlan);
|
|
plans.add(refinancingRepaymentPlan);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } else if (smbRequestLogVo.getTransCode().equals("snb.eloan.ecpms.repay.plan.trial")) {
|
|
|
|
|
|
+ } else if (smbRequestLogVo.getTransCode().equals(TransCodeEnum.REPAY_PLAN_TRIAL.getCode())) {
|
|
repay = jsonObject.getJSONArray("repay");
|
|
repay = jsonObject.getJSONArray("repay");
|
|
for (Object o : repay) {
|
|
for (Object o : repay) {
|
|
JSONObject object = new JSONObject(o);
|
|
JSONObject object = new JSONObject(o);
|