...
|
...
|
@@ -5,8 +5,10 @@ import com.google.common.cache.Cache; |
|
|
import com.google.common.cache.CacheBuilder;
|
|
|
import com.yoho.core.common.utils.DateUtil;
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.order.dal.TradeBillsMapper;
|
|
|
import com.yoho.order.model.*;
|
|
|
import com.yoho.ufo.order.constant.MoneyTypeEnum;
|
|
|
import com.yoho.ufo.order.constant.TradeStatusEnum;
|
|
|
import com.yoho.ufo.order.service.ITradeBillsService;
|
|
|
import com.yoho.ufo.service.impl.UserHelper;
|
...
|
...
|
@@ -56,9 +58,15 @@ public class TradeBillsServiceImpl implements ITradeBillsService { |
|
|
private TradeBillsMapper tradeBillsMapper;
|
|
|
|
|
|
public PageResponseBO<TradeBillsResp> queryTradeBillsList(TradeBillsReq req) {
|
|
|
if(!checkAndBuildParam(req)) {
|
|
|
return null;
|
|
|
}
|
|
|
if(req.getMoneyType()!=null){
|
|
|
MoneyTypeEnum moneyTypeClass =MoneyTypeEnum.getMoneyTypeByCode(req.getMoneyType());
|
|
|
if(moneyTypeClass!=null){
|
|
|
req.setUserType(moneyTypeClass.getUserType());
|
|
|
req.setTradeType(moneyTypeClass.getTradeType());
|
|
|
}else{
|
|
|
throw new ServiceException(400,"参数错误:不合法的金额类型");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(req.getUid()==null&&StringUtils.isNotBlank(req.getMobile())){
|
|
|
Integer uid = getUidByMobile(req.getMobile());
|
...
|
...
|
@@ -88,12 +96,6 @@ public class TradeBillsServiceImpl implements ITradeBillsService { |
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private boolean checkAndBuildParam(TradeBillsReq req){
|
|
|
/*if(req.getUid()==null&&req.getOrderCode()==null&&StringUtils.isBlank(req.getMobile())){
|
|
|
return false;
|
|
|
}*/
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
private List<TradeBillsResp> convertToResp(List<TradeBills> tradeBillsList){
|
|
|
List<TradeBillsResp> respList = Lists.newArrayList();
|
...
|
...
|
@@ -110,6 +112,14 @@ public class TradeBillsServiceImpl implements ITradeBillsService { |
|
|
resp.setOperatorUid(item.getDealUid());
|
|
|
resp.setOperatorName((item.getDealUid()==null||item.getDealUid()==0)?"系统":item.getDealUserName());
|
|
|
resp.setTradeStatus(item.getTradeStatus());
|
|
|
|
|
|
//金额类型
|
|
|
MoneyTypeEnum moneyTypeClass=MoneyTypeEnum.getMoneyTypeByUserTypeAndTradeType(item.getUserType(),item.getTradeType());
|
|
|
if(moneyTypeClass!=null){
|
|
|
resp.setMoneyType(moneyTypeClass.getCode());
|
|
|
resp.setMoneyTypeDesc(moneyTypeClass.getDesc());
|
|
|
}
|
|
|
|
|
|
//打款失败原因
|
|
|
if(100!=item.getTradeStatus()){
|
|
|
String failReason = TradeStatusEnum.getDescByCode(item.getTradeStatus());
|
...
|
...
|
|