Commit 7c08e63c authored by suntao's avatar suntao

订到状态查询 存管提现

parent 1a1d5ffa
......@@ -21,6 +21,7 @@ import cn.quantgroup.cashloanflowboss.spi.clf.repository.ClfOrderMappingReposito
import cn.quantgroup.cashloanflowboss.spi.clf.service.CLFCenterService;
import cn.quantgroup.cashloanflowboss.spi.clotho.service.ClothoCenterService;
import cn.quantgroup.cashloanflowboss.spi.jolyne.JolyneCenter;
import cn.quantgroup.cashloanflowboss.spi.jolyne.JolyneUtil;
import cn.quantgroup.cashloanflowboss.spi.user.service.XyqbUserService;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.Contract;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.LoanApplicationHistory;
......@@ -339,8 +340,8 @@ public class OrderService {
optHistoryLog.setCreateTime(new Date());
optHistoryLogService.save(optHistoryLog);
conscont.setGenerateStatus(2);
xyqbCenterService.saveContract(conscont);
// conscont.setGenerateStatus(2);
// xyqbCenterService.saveContract(conscont);
}
} else {
// 合同为空 log表记录问题,UI用户查询
......@@ -391,14 +392,11 @@ public class OrderService {
result = true;
}
// 更新待放款时间(5分钟之前)
WaitingFundingCorpOperatePeople waitingFundingCorpOperatePeopledb = xyqbCenterService.findWaitingFundingCorpOperatePeopleByLoanId(orderMapping.getLoanId());
if (waitingFundingCorpOperatePeopledb != null) {
LocalDateTime localDateTime = waitingFundingCorpOperatePeopledb.getCreatedAt().toLocalDateTime();
LocalDateTime createdAt = localDateTime.plusMinutes(-6L);
waitingFundingCorpOperatePeopledb.setCreatedAt(new Timestamp(createdAt.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()));
xyqbCenterService.saveWaitingFundingCorpOperatePeople(waitingFundingCorpOperatePeopledb);
}
ArrayList<String> updateWaitingFundingCorpOperatePeople = Lists.newArrayList();
updateWaitingFundingCorpOperatePeople.add("update waiting_funding_corp_operate_people set created_at = DATE_SUB(created_at, interval 5 minute) where loan_application_history_id = " + orderMapping.getLoanId());
jolyneCenter.sqlXyqb(JolyneUtil.getJolneSql(updateWaitingFundingCorpOperatePeople));
optHistoryLog.setOptLogDetail("二次风控操作成功");
optHistoryLog.setOptResult(true);
......@@ -479,13 +477,13 @@ public class OrderService {
public boolean cancel(OrderVo orderVo) {
ClfOrderMapping orderMapping = clfOrderMappingRepository.findByChannelOrderNoLastOne(orderVo.getChannelOrderNumber());
if (orderMapping == null) {
log.info("cancel,关单失败,无订单 channelOrderNumber={}", orderVo.getChannelOrderNumber());
log.info("sqlXyqb,关单失败,无订单 channelOrderNumber={}", orderVo.getChannelOrderNumber());
return false;
}
XUser xUser = xyqbUserService.findXUserById(orderMapping.getQgUserId());
if (xUser == null) {
log.info("cancel,关单失败,未找到用户 channelOrderNumber={}", orderVo.getChannelOrderNumber());
log.info("sqlXyqb,关单失败,未找到用户 channelOrderNumber={}", orderVo.getChannelOrderNumber());
return false;
}
Long userId = xUser.getId();
......@@ -498,7 +496,7 @@ public class OrderService {
cancel_list.add("delete from apply_quota_record where user_id=" + userId);
cancel_list.add("delete from user_operation_history where user_id=" + userId);
data.put("sql", cancel_list);
String cancel_result = jolyneCenter.cancel(JSONTools.serialize(data));
String cancel_result = jolyneCenter.sqlXyqb(JSONTools.serialize(data));
return "success".equals(cancel_result);
}
......
......@@ -103,6 +103,8 @@ public class OrderUtil {
return new Tuple(kaNoticeType, "申请提现成功");
case "PAY_ING" :
return new Tuple("PAY_ING", "放款中");
case "FUND_WAITING_WITHDRAW" :
return new Tuple("FUND_WAITING_WITHDRAW", "放款到存管账户,待二次提现");
case "FUND_SUCC" :
if (orderApprove != null && orderApprove.getFundType() != 0) {
// 是存管
......
......@@ -8,14 +8,16 @@ import org.springframework.web.bind.annotation.RequestParam;
@Component
@FeignClient(name = "JolyneServiceCenter", url = "http://192.168.4.156:9001/executeSQL/{{NAMESPACE}}", fallback = JolyneCenter.Fallback.class)
public interface JolyneCenter {
@PostMapping(value = "/xyqb", consumes = "application/json")
String cancel(@RequestParam("json") String cancelData);
String sqlXyqb(@RequestParam("json") String cancelData);
@Component
class Fallback implements JolyneCenter {
@Override
public String cancel(String cancelData) {
public String sqlXyqb(String cancelData) {
return null;
}
}
......
package cn.quantgroup.cashloanflowboss.spi.jolyne;
import cn.quantgroup.cashloanflowboss.utils.JSONTools;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.List;
import java.util.concurrent.ConcurrentMap;
/**
* function:
* date: 2019/9/12
*
* @author: suntao
*/
public class JolyneUtil {
public static String getJolneSql(List<String> slqList) {
ConcurrentMap<String, Object> data = Maps.newConcurrentMap();
data.put("sql", slqList);
return JSONTools.serialize(data);
}
}
package cn.quantgroup.cashloanflowboss.spi.user.service;
import cn.quantgroup.cashloanflowboss.api.order.model.OrderVo;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping;
import cn.quantgroup.cashloanflowboss.spi.jolyne.JolyneCenter;
import cn.quantgroup.cashloanflowboss.spi.user.repository.UserDetailRepository;
import cn.quantgroup.cashloanflowboss.spi.user.repository.UserExtInfoRepository;
......@@ -19,7 +17,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.concurrent.ConcurrentMap;
import lombok.extern.log4j.Log4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -181,7 +179,7 @@ public class XyqbUserServiceImpl implements XyqbUserService {
cancel_list.add("delete from apply_quota_record where user_id="+userId);
cancel_list.add("delete from user_operation_history where user_id="+userId);
data.put("sql",cancel_list);
String cancel_result = jolyneCenter.cancel(JSONTools.serialize(data));
String cancel_result = jolyneCenter.sqlXyqb(JSONTools.serialize(data));
return "success".equals(cancel_result);
}
......
......@@ -95,6 +95,7 @@ public class XYQBCenterService {
contractRepository.save(contract);
}
public WaitingFundingCorpOperatePeople findWaitingFundingCorpOperatePeopleByLoanId(Long loanId) {
return waitingFundingCorpOperatePeopleRepository.findByLoanApplicationHistoryId(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