Commit 9ccfe51f authored by suntao's avatar suntao

我也不知道 提交的什么了

parent cf69cdb7
...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; ...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository;
public interface OrderApproveRepository extends JpaRepository<OrderApprove, Long> { public interface OrderApproveRepository extends JpaRepository<OrderApprove, Long> {
OrderApprove findByChannelOrderNumber(String channelOrderNumber); OrderApprove findByChannelOrderNumber(String channelOrderNumber);
OrderApprove findByCreditNumber(String creditOrderNumber); OrderApprove findByCreditNumber(String creditOrderNumber);
} }
...@@ -222,7 +222,13 @@ public class OrderService { ...@@ -222,7 +222,13 @@ public class OrderService {
String fundFormat = String.format(OrderUtil.financeProductsFormat, approveVo.getAmount(), approveVo.getAmount(), String fundFormat = String.format(OrderUtil.financeProductsFormat, approveVo.getAmount(), approveVo.getAmount(),
approveVo.getPeriod(), fundId); approveVo.getPeriod(), fundId);
OrderApprove orderApproveExsit = orderApproveRepository.findByChannelOrderNumber(approveVo.getChannelOrderNumber());
if (orderApproveExsit != null) {
orderApproveExsit.setFundId(fundId);
orderApproveExsit.setFundType(approveVo.getFundType());
orderApproveExsit.setUpdateTime(new Date());
orderApproveRepository.save(orderApproveExsit);
} else {
OrderApprove orderApprove = new OrderApprove(); OrderApprove orderApprove = new OrderApprove();
orderApprove.setChannelOrderNumber(approveVo.getChannelOrderNumber()); orderApprove.setChannelOrderNumber(approveVo.getChannelOrderNumber());
orderApprove.setCreditNumber(orderMapping.getApplyNo()); orderApprove.setCreditNumber(orderMapping.getApplyNo());
...@@ -232,6 +238,8 @@ public class OrderService { ...@@ -232,6 +238,8 @@ public class OrderService {
orderApprove.setCreateTime(new Date()); orderApprove.setCreateTime(new Date());
orderApprove.setUpdateTime(new Date()); orderApprove.setUpdateTime(new Date());
orderApproveRepository.save(orderApprove); orderApproveRepository.save(orderApprove);
}
Map<String, Object> data = new HashMap<>(16); Map<String, Object> data = new HashMap<>(16);
......
...@@ -8,6 +8,9 @@ import cn.quantgroup.cashloanflowboss.api.order.model.QueryXyqbOrderStatus; ...@@ -8,6 +8,9 @@ import cn.quantgroup.cashloanflowboss.api.order.model.QueryXyqbOrderStatus;
import cn.quantgroup.cashloanflowboss.core.base.Tuple; import cn.quantgroup.cashloanflowboss.core.base.Tuple;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ApplyRequestHistory; import cn.quantgroup.cashloanflowboss.spi.clf.entity.ApplyRequestHistory;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping; import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping;
import cn.quantgroup.cashloanflowboss.spi.clf.model.KANoticeType;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -140,6 +143,103 @@ public class OrderUtil { ...@@ -140,6 +143,103 @@ public class OrderUtil {
return tuple; return tuple;
} }
public static Tuple<String, String> KaNoticeTypeConvert(KANoticeType kaNoticeType) {
if (kaNoticeType != null) {
switch (kaNoticeType.name()) {
case "CREDIT_SUCC" :
// 授信成功 需要 审批
// return new Tuple("授信成功", "CREDIT_SUCC");
// case "APPROVE_ING" :
// if (orderApprove == null) {
// OrderVo.OptButton buttonApprove2 = new OrderVo.OptButton();
// buttonApprove2.setAction(OrderVo.OptButtonAction.audit.name());
// buttonApprove2.setName(OrderVo.OptButtonAction.audit.getDesc());
// buttonList.add(buttonApprove2);
// buttonList.add(buttonBeforeCancel);
// tuple.setKey("授信成功,待审批");
// tuple.setValue(buttonList);
// } else {
// tuple.setKey("审批中");
// buttonList.add(buttonBeforeCancel);
// tuple.setValue(buttonList);
// }
// return tuple;
// case "REJECT" :
// tuple.setKey("审批拒绝");
// tuple.setValue(buttonList);
// return tuple;
// case "FUAD_ASSIFN_SUCC" :
// tuple.setKey("审批通过,待提现");
// buttonList.add(buttonBeforeCancel);
// tuple.setValue(buttonList);
// return tuple;
// case "WITHDRAW" :
// // 提现申请成功 需要放款
// tuple.setKey("申请提现成功");
// OrderVo.OptButton buttonPaySucc = new OrderVo.OptButton();
// buttonPaySucc.setAction(OrderVo.OptButtonAction.pay_succ.name());
// buttonPaySucc.setName(OrderVo.OptButtonAction.pay_succ.getDesc());
// buttonList.add(buttonPaySucc);
// OrderVo.OptButton buttonPayFail = new OrderVo.OptButton();
// buttonPayFail.setAction(OrderVo.OptButtonAction.pay_fail.name());
// buttonPayFail.setName(OrderVo.OptButtonAction.pay_fail.getDesc());
// buttonList.add(buttonPayFail);
// buttonList.add(buttonBeforeCancel);
// tuple.setValue(buttonList);
// return tuple;
// case "PAY_ING" :
// tuple.setKey("放款中");
// buttonList.add(buttonBeforeCancel);
// tuple.setValue(buttonList);
// return tuple;
// case "FUND_SUCC" :
// if (orderApprove != null && orderApprove.getFundType() != 0) {
// // 是存管
// tuple.setKey("放款到存管,待提现");
// OrderVo.OptButton cancelAfterButton = new OrderVo.OptButton();
// cancelAfterButton.setAction(OrderVo.OptButtonAction.cancel_after.name());
// cancelAfterButton.setName(OrderVo.OptButtonAction.cancel_after.getDesc());
// buttonList.add(cancelAfterButton);
// OrderVo.OptButton withdrawSecondButton = new OrderVo.OptButton();
// withdrawSecondButton.setAction(OrderVo.OptButtonAction.withdraw_second.name());
// withdrawSecondButton.setName(OrderVo.OptButtonAction.withdraw_second.getDesc());
// buttonList.add(withdrawSecondButton);
// } else {
// tuple.setKey("放款成功");
// }
// tuple.setValue(buttonList);
// return tuple;
// case "FUND_WITHDRAW_SUCC" :
// tuple.setKey("存管提现成功");
// tuple.setValue(buttonList);
// return tuple;
// case "FUND_FAIL" :
// tuple.setKey("放款失败");
// tuple.setValue(buttonList);
// return tuple;
// case "ALL_REPAID" :
// tuple.setKey("已结清");
// tuple.setValue(buttonList);
// return tuple;
// case "CANCEL_LOAN" :
// tuple.setKey("已关单");
// tuple.setValue(buttonList);
// return tuple;
// case "CANCEL_AFTER_LOAN" :
// tuple.setKey("存管提现超时或贷后关单");
// tuple.setValue(buttonList);
// return tuple;
// default:
// tuple.setKey("未知状态");
// tuple.setValue(buttonList);
// return tuple;
}
}
return null;
}
public static List<OptHistoryLog> convertApplyRequestHistoryList2OptHistoryLogList(List<ApplyRequestHistory> applyRequestHistoryList, ClfOrderMapping orderMapping) { public static List<OptHistoryLog> convertApplyRequestHistoryList2OptHistoryLogList(List<ApplyRequestHistory> applyRequestHistoryList, ClfOrderMapping orderMapping) {
List<OptHistoryLog> optHistoryLogs = new ArrayList<>(); List<OptHistoryLog> optHistoryLogs = new ArrayList<>();
for (ApplyRequestHistory applyRequestHistory : applyRequestHistoryList) { for (ApplyRequestHistory applyRequestHistory : applyRequestHistoryList) {
......
...@@ -4,6 +4,7 @@ import cn.quantgroup.cashloanflowboss.api.login.model.Principal; ...@@ -4,6 +4,7 @@ import cn.quantgroup.cashloanflowboss.api.login.model.Principal;
import cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationDictionary; import cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationDictionary;
import cn.quantgroup.cashloanflowboss.utils.JSONTools; import cn.quantgroup.cashloanflowboss.utils.JSONTools;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEvent;
...@@ -28,6 +29,7 @@ public class Application implements ApplicationContextAware, ServletContextAware ...@@ -28,6 +29,7 @@ public class Application implements ApplicationContextAware, ServletContextAware
private static ServletContext servletContext; private static ServletContext servletContext;
public static ApplicationContext getApplicationContext() { public static ApplicationContext getApplicationContext() {
return applicationContext; return applicationContext;
} }
......
...@@ -6,6 +6,7 @@ import cn.quantgroup.cashloanflowboss.spi.clotho.model.LendingServiceModel; ...@@ -6,6 +6,7 @@ import cn.quantgroup.cashloanflowboss.spi.clotho.model.LendingServiceModel;
import cn.quantgroup.cashloanflowboss.utils.JSONTools; import cn.quantgroup.cashloanflowboss.utils.JSONTools;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
...@@ -23,6 +24,8 @@ public class ClothoCenterService { ...@@ -23,6 +24,8 @@ public class ClothoCenterService {
@Autowired @Autowired
private ClothoCenter clothoCenter; private ClothoCenter clothoCenter;
@Value("${debug.model}")
public Boolean debugModel;
/** /**
* 生成放款MQ消息 * 生成放款MQ消息
* *
...@@ -39,7 +42,7 @@ public class ClothoCenterService { ...@@ -39,7 +42,7 @@ public class ClothoCenterService {
*/ */
public boolean lending(Integer fundId, BigDecimal amountLimit, Integer pepoleLimit) { public boolean lending(Integer fundId, BigDecimal amountLimit, Integer pepoleLimit) {
if (Application.getPrincipal().getDebugModel()) { if (debugModel) {
String data = this.clothoCenter.lending(new HashMap(4) {{ String data = this.clothoCenter.lending(new HashMap(4) {{
put("fundingCorpId", fundId); put("fundingCorpId", fundId);
put("amountLimit", amountLimit); put("amountLimit", amountLimit);
...@@ -60,7 +63,7 @@ public class ClothoCenterService { ...@@ -60,7 +63,7 @@ public class ClothoCenterService {
* @return * @return
*/ */
public String approve(Map<String, Object> approveData) { public String approve(Map<String, Object> approveData) {
if (Application.getPrincipal().getDebugModel()) { if (debugModel) {
return clothoCenter.approve(approveData); return clothoCenter.approve(approveData);
} else { } else {
return "error"; return "error";
...@@ -68,7 +71,7 @@ public class ClothoCenterService { ...@@ -68,7 +71,7 @@ public class ClothoCenterService {
} }
public String cancelPreLoan(Map<Object, Object> data) { public String cancelPreLoan(Map<Object, Object> data) {
if (Application.getPrincipal().getDebugModel()) { if (debugModel) {
return clothoCenter.cancelPreLoan(data); return clothoCenter.cancelPreLoan(data);
} else { } else {
return "error"; return "error";
...@@ -76,7 +79,7 @@ public class ClothoCenterService { ...@@ -76,7 +79,7 @@ public class ClothoCenterService {
} }
public String cancelAfterLoan(Map<Object, Object> data) { public String cancelAfterLoan(Map<Object, Object> data) {
if (Application.getPrincipal().getDebugModel()) { if (debugModel) {
return clothoCenter.cancelAfterLoan(data); return clothoCenter.cancelAfterLoan(data);
} else { } else {
return "error"; return "error";
......
...@@ -14,6 +14,7 @@ import cn.quantgroup.cashloanflowboss.spi.xyqb.util.SignUtil; ...@@ -14,6 +14,7 @@ import cn.quantgroup.cashloanflowboss.spi.xyqb.util.SignUtil;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -39,6 +40,8 @@ public class XYQBCenterService { ...@@ -39,6 +40,8 @@ public class XYQBCenterService {
private FundingAssetAllocationsProgramsRepository fundingAssetAllocationsProgramsRepository; private FundingAssetAllocationsProgramsRepository fundingAssetAllocationsProgramsRepository;
@Value("${debug.model}")
public Boolean debugModel;
@Autowired @Autowired
private XYQBCenter xyqbCenter; private XYQBCenter xyqbCenter;
...@@ -187,7 +190,7 @@ public class XYQBCenterService { ...@@ -187,7 +190,7 @@ public class XYQBCenterService {
* @return * @return
*/ */
public boolean payResultNotify(Long loanId, Boolean expectPayResult) { public boolean payResultNotify(Long loanId, Boolean expectPayResult) {
if (Application.getPrincipal().getDebugModel()) { if (debugModel) {
Map paramMap = Maps.newHashMap(); Map paramMap = Maps.newHashMap();
paramMap.put("orderNo", loanId); paramMap.put("orderNo", loanId);
paramMap.put("payOrderNo", loanId); paramMap.put("payOrderNo", loanId);
......
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