...
|
...
|
@@ -63,39 +63,39 @@ public class MerchantServiceImpl { |
|
|
info.setUid(sellerWalletDetail.getUid());
|
|
|
info.setType(sellerWalletDetail.getType());
|
|
|
info.setTime(sdf.get().format(new Date(sellerWalletDetail.getCreateTime() * 1000L)));
|
|
|
SellerWalletDetail.Type curType = null;
|
|
|
SellerWalletDetail.TypeSearch curType = null;
|
|
|
//如果类型不存在,则不进行处理
|
|
|
if(info.getType()==null || (curType = SellerWalletDetail.Type.of(new int[]{info.getType().intValue()}))==null){
|
|
|
if(info.getType()==null || (curType = SellerWalletDetail.TypeSearch.of(new int[]{info.getType().intValue()}))==null){
|
|
|
return info;
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.RE_CHARGE)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.RE_CHARGE)){
|
|
|
return dealReCharge(info,sellerWalletDetail);//保证金充值
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.SELLER_ONSHELF)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_ONSHELF)){
|
|
|
return dealSellerOnShelf(info,sellerWalletDetail);//卖家上架商品
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.SELLER_OFFSHELF)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_OFFSHELF)){
|
|
|
return dealSellerOffShelf(info,sellerWalletDetail);//卖家下架商品
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.TRADE_COMPLETE)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.TRADE_COMPLETE)){
|
|
|
return dealTradeComplete(info,sellerWalletDetail);//商品交易完成
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.SELLER_TRADEFAILED)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_TRADEFAILED)){
|
|
|
return dealSellerTradeFailed(info,sellerWalletDetail);//卖家原因交易失败
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.SELLER_ADDPRICE)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_ADDPRICE)){
|
|
|
return dealSellerAddPrice(info,sellerWalletDetail);//卖家上调价格
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.SELLER_REDUCEPRICE)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_REDUCEPRICE)){
|
|
|
return dealSellerReducePrice(info,sellerWalletDetail);//卖家下调价格
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.BUYER_CANCEL)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.BUYER_CANCEL)){
|
|
|
return dealBuyerCancel(info,sellerWalletDetail);//买家付款后取消订单
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.SYSTEM_OFFSHELF)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.SYSTEM_OFFSHELF)){
|
|
|
return dealSystemOffShelf(info,sellerWalletDetail);//系统下架商品
|
|
|
}
|
|
|
if(curType.equals(SellerWalletDetail.Type.SELLER_QUIT)){
|
|
|
if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_QUIT)){
|
|
|
return dealSellerQuit(info,sellerWalletDetail);//卖家退出入驻
|
|
|
}
|
|
|
return info;
|
...
|
...
|
@@ -230,7 +230,7 @@ public class MerchantServiceImpl { |
|
|
Integer stratTime = parse(req.getStartTime());
|
|
|
Integer endTime = parse(req.getEndTime());
|
|
|
List<Integer> uids = null;
|
|
|
if(StringUtils.isNotBlank(req.getMerchantName()) || req.getUid() !=null){
|
|
|
if(StringUtils.isNotBlank(req.getMerchantName()) || StringUtils.isNotBlank(req.getUid())){
|
|
|
uids = storedSellerMapper.selectUidByCertNameAndUid(req.getMerchantName(),req.getUid());
|
|
|
if(CollectionUtils.isEmpty(uids)){
|
|
|
return new PageResponseBO<>();
|
...
|
...
|
@@ -241,15 +241,19 @@ public class MerchantServiceImpl { |
|
|
return new PageResponseBO<>();
|
|
|
}
|
|
|
List<SellerWalletDetail> beanList = mapper.selectMerchantInfo(CollectionUtils.isEmpty(uids)?null:uids, stratTime, endTime, req.getStateList(),req.getOrderCode(), req.getStart(), req.getRows());
|
|
|
if(CollectionUtils.isEmpty(beanList)){
|
|
|
PageResponseBO<MerchantOrderAttachInfo> result=new PageResponseBO<>();
|
|
|
result.setPage(req.getPage());
|
|
|
result.setSize(req.getSize());
|
|
|
result.setTotal(total);
|
|
|
return result;
|
|
|
}
|
|
|
Map<Integer,Map<String,Object>> storedSellerMap = this.storedSellerMapper.selectNameByUids(beanList.stream().map(cell->cell.getUid()).collect(Collectors.toList()));
|
|
|
List<MerchantOrderAttachInfo> boList = new ArrayList<>();
|
|
|
for(SellerWalletDetail detail : beanList) {
|
|
|
MerchantOrderAttachInfo info = JSON.parseObject(detail.getAttachValue(), MerchantOrderAttachInfo.class);
|
|
|
info=info == null?new MerchantOrderAttachInfo():info;
|
|
|
MerchantOrderAttachInfo info = exchange(detail);
|
|
|
info.setOrderCode(detail.getOrderCode());
|
|
|
info.setTime(sdf.get().format(new Date(detail.getCreateTime() * 1000L)));
|
|
|
info.setMerchantName((String)storedSellerMap.get(detail.getUid()).get("cert_name"));
|
|
|
info.setUid(detail.getUid());
|
|
|
boList.add(info);
|
|
|
}
|
|
|
PageResponseBO<MerchantOrderAttachInfo> result=new PageResponseBO<>();
|
...
|
...
|
@@ -265,24 +269,30 @@ public class MerchantServiceImpl { |
|
|
MerchantOrderAttachInfo info = new MerchantOrderAttachInfo();
|
|
|
if(StringUtils.isNotBlank(detail.getAttachValue())) {
|
|
|
info = JSON.parseObject(detail.getAttachValue(), MerchantOrderAttachInfo.class);
|
|
|
info=info == null?new MerchantOrderAttachInfo():info;
|
|
|
}
|
|
|
info.setId(detail.getId());
|
|
|
info.setUid(detail.getUid());
|
|
|
info.setType(detail.getType());
|
|
|
info.setUserName("");
|
|
|
if(null != info.getType()){
|
|
|
info.setTypeName(SellerWalletDetail.Type.of(detail.getType()).getName());
|
|
|
}
|
|
|
info.setTime(sdf.get().format(new Date(detail.getCreateTime() * 1000L)));
|
|
|
if (info.getType() / 10 == 3 || info.getType()==61) {
|
|
|
info.setAccountAmount(detail.getAmount().toString());
|
|
|
info.setLockEarnestMoney(detail.getAmount().toString());
|
|
|
info.setAccountAmount(detail.getAmount()==null?null:detail.getAmount().toString());
|
|
|
info.setLockEarnestMoney(detail.getAmount()==null?null:detail.getAmount().toString());
|
|
|
info.setAvailEarnestMoney("/");
|
|
|
} else {
|
|
|
info.setAccountAmount("/");
|
|
|
info.setLockEarnestMoney("/");
|
|
|
info.setAvailEarnestMoney(detail.getAmount().toString());
|
|
|
info.setAvailEarnestMoney(detail.getAmount()==null?null:detail.getAmount().toString());
|
|
|
}
|
|
|
if(detail.getAvailAmount()!=null){
|
|
|
info.setAccountAllAmount(detail.getLockAmount()==null?
|
|
|
detail.getAvailAmount().toString():detail.getAvailAmount().add(detail.getLockAmount()).toString());
|
|
|
info.setAvailAllEarnestMoney(detail.getAvailAmount().toString());
|
|
|
}
|
|
|
info.setAccountAllAmount(detail.getAvailAmount().add(detail.getLockAmount()).toString());
|
|
|
info.setLockAllEarnestMoney(detail.getLockAmount().toString());
|
|
|
info.setAvailAllEarnestMoney(detail.getAvailAmount().toString());
|
|
|
info.setLockAllEarnestMoney(detail.getLockAmount()==null?null:detail.getLockAmount().toString());
|
|
|
return info;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -311,6 +321,13 @@ public class MerchantServiceImpl { |
|
|
return new PageResponseBO<>();
|
|
|
}
|
|
|
List<SellerWallet> sellerWallets = this.sellerWalletMapper.selectByUidAndMerchantUids(req.getUid(),uids,req.getStart(),req.getSize());
|
|
|
if(CollectionUtils.isEmpty(sellerWallets)){
|
|
|
PageResponseBO<MerchantOrderAttachInfo> result = new PageResponseBO<>();
|
|
|
result.setTotal(total);
|
|
|
result.setPage(req.getPage());
|
|
|
result.setSize(req.getSize());
|
|
|
return result;
|
|
|
}
|
|
|
List<MerchantOrderAttachInfo> infos = initMerchantOrderAttachInfos(sellerWallets);
|
|
|
PageResponseBO<MerchantOrderAttachInfo> result = new PageResponseBO<>();
|
|
|
result.setTotal(total);
|
...
|
...
|
|