Authored by LUOXC

不显示订单号

... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.core.config.ConfigReader;
import com.yoho.error.ServiceError;
... ... @@ -32,6 +33,7 @@ import com.yohoufo.order.service.impl.PaymentServiceImpl;
import com.yohoufo.order.service.impl.SellerService;
import com.yohoufo.order.service.impl.SellerWrapper;
import com.yohoufo.order.service.impl.TradeBillsService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -42,6 +44,7 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Supplier;
import java.util.stream.Collectors;
@Service
public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
... ... @@ -592,32 +595,37 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
} else {
List<SellerWalletDetail> resultList = sellerWalletDetailMapper.selectUserDetail(uid,
(page - 1) * limit, limit);
List<JSONObject> array = new ArrayList<>();
pageResp.setData(array);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
for (SellerWalletDetail detail : resultList) {
JSONObject result = new JSONObject();
if (detail.getAmount().compareTo(BigDecimal.ZERO) >= 0) {
result.put("amount", "+" + detail.getAmount().setScale(2).toString());
} else {
result.put("amount", detail.getAmount().setScale(2).toString());
}
result.put("type", detail.getType());
if (detail.getType() == 1) {
result.put("name", "充值保证金");
}
if (detail.getType() / 10 == 3 || detail.getType() == 61) {
result.put("name", "支付保证金");
result.put("order_code", detail.getOrderCode());
}
result.put("info", SellerWalletDetail.Type.of(sw.getType()).getName());
result.put("time", sdf.format(new Date(1000L * detail.getCreateTime())));
array.add(result);
}
pageResp.setData(buildResultData(sw, resultList));
return new com.yohoufo.common.ApiResponse(200, "查询成功", pageResp);
}
}
private List<JSONObject> buildResultData(SellerWallet sw, List<SellerWalletDetail> sellerWalletDetailList) {
List<JSONObject> resultList = Lists.newArrayList();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
for (SellerWalletDetail detail : sellerWalletDetailList) {
JSONObject result = new JSONObject();
if (detail.getAmount().compareTo(BigDecimal.ZERO) >= 0) {
result.put("amount", "+" + detail.getAmount().setScale(2).toString());
} else {
result.put("amount", detail.getAmount().setScale(2).toString());
}
result.put("type", detail.getType());
if (detail.getType() == 1) {
result.put("name", "充值保证金");
}
if (detail.getType() / 10 == 3 || detail.getType() == 61) {
result.put("name", "支付保证金");
// result.put("order_code", detail.getOrderCode());
}
result.put("info", SellerWalletDetail.Type.of(sw.getType()).getName());
result.put("time", sdf.format(new Date(1000L * detail.getCreateTime())));
resultList.add(result);
}
return resultList;
}
// 升级超级卖家:账号资金移动处理
// *后期需要再次调用,清理残留
public int changeWalletToSuperSeller(Integer uid) {
... ...