Commit fa7392b5 authored by shangying's avatar shangying

放款20状态需要修改合同状态

parent 93b4bb39
...@@ -18,7 +18,8 @@ public enum ResposeResultEnum { ...@@ -18,7 +18,8 @@ public enum ResposeResultEnum {
CREDIT_FAIL(9,"false"), CREDIT_FAIL(9,"false"),
CONTEXT_FAIL(10, "FAIL"), CONTEXT_FAIL(10, "FAIL"),
CONTEXT_SUCCESS(11, "SUCCESS"), CONTEXT_SUCCESS(11, "SUCCESS"),
STATUSCODEONE(12,"0"); STATUSCODEONE(12,"0"),
GENERATESTATUS(13,"2");
private int code; private int code;
private String desc; private String desc;
......
...@@ -10,8 +10,10 @@ import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.*; ...@@ -10,8 +10,10 @@ import cn.quantgroup.cashloanflowboss.api.oneclickdata.service.*;
import cn.quantgroup.cashloanflowboss.core.base.Result; import cn.quantgroup.cashloanflowboss.core.base.Result;
import cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus; import cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus;
import cn.quantgroup.cashloanflowboss.spi.clf.model.LoanProgress; import cn.quantgroup.cashloanflowboss.spi.clf.model.LoanProgress;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.Contract;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.LoanApplicationHistory; import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.LoanApplicationHistory;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.QuotaCredit; import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.QuotaCredit;
import cn.quantgroup.cashloanflowboss.spi.xyqb.service.XYQBCenterService;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -37,6 +39,8 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe ...@@ -37,6 +39,8 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe
private CreditGrantingService creditGrantingService; private CreditGrantingService creditGrantingService;
@Autowired @Autowired
private RepaymentPlatService repaymentPlatService; private RepaymentPlatService repaymentPlatService;
@Autowired
private XYQBCenterService xyqbCenterService;
@Override @Override
public void getCreditNotifyIsSucess(String queueMsg) { public void getCreditNotifyIsSucess(String queueMsg) {
...@@ -213,6 +217,17 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe ...@@ -213,6 +217,17 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe
@Override @Override
public JSONObject applyLendingNotifyOnly(OneClickData oneClickData){ public JSONObject applyLendingNotifyOnly(OneClickData oneClickData){
JSONObject result=null;
// 检查当前的合同是否更新状态
Contract contract= xyqbCenterService.findContractByUserId(Long.parseLong(oneClickData.getUserId()));
if(Objects.nonNull(contract)){
log.info("查到当前的合同contract={}", contract);
if(contract.getGenerateStatus() != Integer.parseInt(ResposeResultEnum.GENERATESTATUS.getDesc())){
updatContractStatus(oneClickData);
}
}else {
return result;
}
String payStatus="3"; String payStatus="3";
// 通过申请类型确定是否要放款成功、失败 // 通过申请类型确定是否要放款成功、失败
// 放款成功、清单修改状态成功,放款失败修改状态失败 // 放款成功、清单修改状态成功,放款失败修改状态失败
...@@ -221,7 +236,7 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe ...@@ -221,7 +236,7 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe
}else { }else {
payStatus="3"; payStatus="3";
} }
JSONObject result= loanOperationService.fundsPlanLoanApply(oneClickData, payStatus); result= loanOperationService.fundsPlanLoanApply(oneClickData, payStatus);
log.info("放款结果result={}", result); log.info("放款结果result={}", result);
// 放款结果判断 // 放款结果判断
...@@ -305,7 +320,17 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe ...@@ -305,7 +320,17 @@ public class OneClickDataQueueOperateServiceImpl implements OneClickDataQueueOpe
} }
} }
public void updatContractStatus(OneClickData oneClickData){
boolean boo= loanOperationService.updatContractStatus(oneClickData);
if(boo){
log.info("合同修改成功!!!");
}else{
//修改合同失败
oneClickDataRespository.updateLoanStatusById(LoanStatusEnum.NOTHAVECONTRACT.getCode(), oneClickData.getId());
}
}
public static void main(String[] arg){ public static void main(String[] arg){
// String queueMsg="{\"data\":{\"applyNo\":\"FM624168161855715731904356\",\"loanId\":0,\"loanProgress\":\"LOAN_APPLICATION_MANIFEST_COMPLETE\",\"termNo\":-1},\"extraData\":\"{\\\"amount\\\":\\\"10000.00\\\",\\\"annualInterest\\\":\\\"0.36\\\",\\\"assignTime\\\":1577153040895,\\\"term\\\":\\\"12\\\"}\",\"noticeType\":\"FUAD_ASSIFN_SUCC\"}\n"; // String queueMsg="{\"data\":{\"applyNo\":\"FM624168161855715731904356\",\"loanId\":0,\"loanProgress\":\"LOAN_APPLICATION_MANIFEST_COMPLETE\",\"termNo\":-1},\"extraData\":\"{\\\"amount\\\":\\\"10000.00\\\",\\\"annualInterest\\\":\\\"0.36\\\",\\\"assignTime\\\":1577153040895,\\\"term\\\":\\\"12\\\"}\",\"noticeType\":\"FUAD_ASSIFN_SUCC\"}\n";
System.out.print(LoanProgress.WAITING_FUND.toString()); System.out.print(LoanProgress.WAITING_FUND.toString());
......
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