Commit 14788332 authored by suntao's avatar suntao

提现记录 添加到操作记录

parent f0b7a6ba
......@@ -6,6 +6,7 @@ import cn.quantgroup.cashloanflowboss.api.order.model.OrderBaseModel;
import cn.quantgroup.cashloanflowboss.api.order.util.OrderUtil;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ApplyRequestHistory;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.WithdrawRecord;
import cn.quantgroup.cashloanflowboss.spi.clf.service.CLFCenterService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -45,9 +46,15 @@ public class OptHistoryLogService {
// 管理员操作日志 审批。。。
List<OptHistoryLog> optHistoryLogList = getLocalOptHisttoryLog(orderBaseModel);
// 提现记录
List<WithdrawRecord> withdrawRecordList = clfCenterService.findWithdrawRecordList(orderBaseModel.getChannelOrderNumber(), orderMapping.getRegisteredFrom());
List<OptHistoryLog> withdrawOptHistoryLogList = OrderUtil.convertWithdrawRecordList2UserOptHistoryLogList(withdrawRecordList);
// 转换
List<OptHistoryLog> userOptHistoryLogList = OrderUtil.convertApplyRequestHistoryList2OptHistoryLogList(applyRequestHistoryList, orderMapping);
userOptHistoryLogList.addAll(optHistoryLogList);
userOptHistoryLogList.addAll(withdrawOptHistoryLogList);
userOptHistoryLogList.sort((o1, o2)->{
if (o1.getCreateTime().getTime() < o2.getCreateTime().getTime()) {
......
......@@ -8,9 +8,9 @@ import cn.quantgroup.cashloanflowboss.api.order.model.QueryXyqbOrderStatus;
import cn.quantgroup.cashloanflowboss.core.base.Tuple;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ApplyRequestHistory;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.WithdrawRecord;
import cn.quantgroup.cashloanflowboss.spi.clf.model.KANoticeType;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
......@@ -259,4 +259,24 @@ public class OrderUtil {
}
return optHistoryLogs;
}
public static List<OptHistoryLog> convertWithdrawRecordList2UserOptHistoryLogList(List<WithdrawRecord> withdrawRecordList) {
if (CollectionUtils.isEmpty(withdrawRecordList)) {
return null;
}
List<OptHistoryLog> optHistoryLogList = new ArrayList<>();
for (WithdrawRecord withdrawRecord : withdrawRecordList) {
OptHistoryLog optHistoryLog = new OptHistoryLog();
optHistoryLog.setChannelOrderNumber(withdrawRecord.getChannelOrderNo());
optHistoryLog.setChannelId(withdrawRecord.getChannelId());
optHistoryLog.setOptName("api提现操作");
optHistoryLog.setOptUser("");
optHistoryLog.setOptLogDetail(withdrawRecord.getDescriptionDetail());
optHistoryLog.setExtData("");
optHistoryLog.setOptResult(withdrawRecord.getIsSuccess());
optHistoryLog.setCreateTime(withdrawRecord.getCreatedAt());
optHistoryLogList.add(optHistoryLog);
}
return optHistoryLogList;
}
}
package cn.quantgroup.cashloanflowboss.spi.clf.entity;
import lombok.Data;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created with suntao on 2018/5/24
*/
@Data
@Entity
@Table(name = "withdraw_record", catalog = "cash_loan_flow")
public class WithdrawRecord {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "request_id")
private String requestId;
@Column(name = "user_id")
private Long userId;
@Column(name = "channel_id")
private Long channelId;
@Column(name = "channel_order_no")
private String channelOrderNo;
@Column(name = "is_success")
private Boolean isSuccess;
@Column(name = "description_value")
private String descriptionValue;
@Column(name = "description_detail")
private String descriptionDetail;
@Column(name = "param_info")
private String paramInfo;
@Column(name = "ext_data")
private String extData;
@Column(name = "created_at")
private Timestamp createdAt = new Timestamp(System.currentTimeMillis());
}
package cn.quantgroup.cashloanflowboss.spi.clf.repository;
import cn.quantgroup.cashloanflowboss.core.persistence.CashLoanFlowDataSource;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.WithdrawRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* Created with suntao on 2018/6/4
*/
@CashLoanFlowDataSource
public interface WithdrawRecordRepository extends JpaRepository<WithdrawRecord, Long> {
@Query(value = "select * from withdraw_record where channel_order_no=?1 and channel_id=?2", nativeQuery = true)
List<WithdrawRecord> findByChannelOrderNoAndChannelId(String channelOrderNo, Long channelId);
}
package cn.quantgroup.cashloanflowboss.spi.clf.service;
import cn.quantgroup.cashloanflowboss.api.order.model.OrderBaseModel;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ApplyRequestHistory;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.CallbackFailRecord;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.CallbackRecord;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping;
import cn.quantgroup.cashloanflowboss.spi.clf.repository.ApplyRequestHistoryRepository;
import cn.quantgroup.cashloanflowboss.spi.clf.repository.CallbackFailRecordRepository;
import cn.quantgroup.cashloanflowboss.spi.clf.repository.CallbackRecordRepository;
import cn.quantgroup.cashloanflowboss.spi.clf.repository.ClfOrderMappingRepository;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.*;
import cn.quantgroup.cashloanflowboss.spi.clf.repository.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -36,6 +30,11 @@ public class CLFCenterService {
private ClfOrderMappingRepository orderMappingRepository;
@Autowired
private ApplyRequestHistoryRepository applyRequestHistoryRepository;
@Autowired
private WithdrawRecordRepository withdrawRecordRepository;
public List<CallbackFailRecord> findCallbackFailRecordByApplyNo(String applyNo) {
return callbackFailRecordRepository.findByApplyNo(applyNo);
......@@ -49,6 +48,10 @@ public class CLFCenterService {
return orderMappingRepository.findByChannelOrderNoLastOne(channelOrderNumber);
}
public List<WithdrawRecord> findWithdrawRecordList(String channelOrderNumber, Long channelId) {
return withdrawRecordRepository.findByChannelOrderNoAndChannelId(channelOrderNumber, channelId);
}
public List<ApplyRequestHistory> findApplyRequestHistoryBySpecification(OrderBaseModel orderBaseModel) {
List<ApplyRequestHistory> all = applyRequestHistoryRepository.findAll(((root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> predicates = new ArrayList<>();
......
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