|
@@ -63,39 +63,39 @@ public class MerchantServiceImpl { |
|
@@ -63,39 +63,39 @@ public class MerchantServiceImpl { |
63
|
info.setUid(sellerWalletDetail.getUid());
|
63
|
info.setUid(sellerWalletDetail.getUid());
|
64
|
info.setType(sellerWalletDetail.getType());
|
64
|
info.setType(sellerWalletDetail.getType());
|
65
|
info.setTime(sdf.get().format(new Date(sellerWalletDetail.getCreateTime() * 1000L)));
|
65
|
info.setTime(sdf.get().format(new Date(sellerWalletDetail.getCreateTime() * 1000L)));
|
66
|
- SellerWalletDetail.Type curType = null;
|
66
|
+ SellerWalletDetail.TypeSearch curType = null;
|
67
|
//如果类型不存在,则不进行处理
|
67
|
//如果类型不存在,则不进行处理
|
68
|
- if(info.getType()==null || (curType = SellerWalletDetail.Type.of(new int[]{info.getType().intValue()}))==null){
|
68
|
+ if(info.getType()==null || (curType = SellerWalletDetail.TypeSearch.of(new int[]{info.getType().intValue()}))==null){
|
69
|
return info;
|
69
|
return info;
|
70
|
}
|
70
|
}
|
71
|
- if(curType.equals(SellerWalletDetail.Type.RE_CHARGE)){
|
71
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.RE_CHARGE)){
|
72
|
return dealReCharge(info,sellerWalletDetail);//保证金充值
|
72
|
return dealReCharge(info,sellerWalletDetail);//保证金充值
|
73
|
}
|
73
|
}
|
74
|
- if(curType.equals(SellerWalletDetail.Type.SELLER_ONSHELF)){
|
74
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_ONSHELF)){
|
75
|
return dealSellerOnShelf(info,sellerWalletDetail);//卖家上架商品
|
75
|
return dealSellerOnShelf(info,sellerWalletDetail);//卖家上架商品
|
76
|
}
|
76
|
}
|
77
|
- if(curType.equals(SellerWalletDetail.Type.SELLER_OFFSHELF)){
|
77
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_OFFSHELF)){
|
78
|
return dealSellerOffShelf(info,sellerWalletDetail);//卖家下架商品
|
78
|
return dealSellerOffShelf(info,sellerWalletDetail);//卖家下架商品
|
79
|
}
|
79
|
}
|
80
|
- if(curType.equals(SellerWalletDetail.Type.TRADE_COMPLETE)){
|
80
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.TRADE_COMPLETE)){
|
81
|
return dealTradeComplete(info,sellerWalletDetail);//商品交易完成
|
81
|
return dealTradeComplete(info,sellerWalletDetail);//商品交易完成
|
82
|
}
|
82
|
}
|
83
|
- if(curType.equals(SellerWalletDetail.Type.SELLER_TRADEFAILED)){
|
83
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_TRADEFAILED)){
|
84
|
return dealSellerTradeFailed(info,sellerWalletDetail);//卖家原因交易失败
|
84
|
return dealSellerTradeFailed(info,sellerWalletDetail);//卖家原因交易失败
|
85
|
}
|
85
|
}
|
86
|
- if(curType.equals(SellerWalletDetail.Type.SELLER_ADDPRICE)){
|
86
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_ADDPRICE)){
|
87
|
return dealSellerAddPrice(info,sellerWalletDetail);//卖家上调价格
|
87
|
return dealSellerAddPrice(info,sellerWalletDetail);//卖家上调价格
|
88
|
}
|
88
|
}
|
89
|
- if(curType.equals(SellerWalletDetail.Type.SELLER_REDUCEPRICE)){
|
89
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_REDUCEPRICE)){
|
90
|
return dealSellerReducePrice(info,sellerWalletDetail);//卖家下调价格
|
90
|
return dealSellerReducePrice(info,sellerWalletDetail);//卖家下调价格
|
91
|
}
|
91
|
}
|
92
|
- if(curType.equals(SellerWalletDetail.Type.BUYER_CANCEL)){
|
92
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.BUYER_CANCEL)){
|
93
|
return dealBuyerCancel(info,sellerWalletDetail);//买家付款后取消订单
|
93
|
return dealBuyerCancel(info,sellerWalletDetail);//买家付款后取消订单
|
94
|
}
|
94
|
}
|
95
|
- if(curType.equals(SellerWalletDetail.Type.SYSTEM_OFFSHELF)){
|
95
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.SYSTEM_OFFSHELF)){
|
96
|
return dealSystemOffShelf(info,sellerWalletDetail);//系统下架商品
|
96
|
return dealSystemOffShelf(info,sellerWalletDetail);//系统下架商品
|
97
|
}
|
97
|
}
|
98
|
- if(curType.equals(SellerWalletDetail.Type.SELLER_QUIT)){
|
98
|
+ if(curType.equals(SellerWalletDetail.TypeSearch.SELLER_QUIT)){
|
99
|
return dealSellerQuit(info,sellerWalletDetail);//卖家退出入驻
|
99
|
return dealSellerQuit(info,sellerWalletDetail);//卖家退出入驻
|
100
|
}
|
100
|
}
|
101
|
return info;
|
101
|
return info;
|
|
@@ -230,7 +230,7 @@ public class MerchantServiceImpl { |
|
@@ -230,7 +230,7 @@ public class MerchantServiceImpl { |
230
|
Integer stratTime = parse(req.getStartTime());
|
230
|
Integer stratTime = parse(req.getStartTime());
|
231
|
Integer endTime = parse(req.getEndTime());
|
231
|
Integer endTime = parse(req.getEndTime());
|
232
|
List<Integer> uids = null;
|
232
|
List<Integer> uids = null;
|
233
|
- if(StringUtils.isNotBlank(req.getMerchantName()) || req.getUid() !=null){
|
233
|
+ if(StringUtils.isNotBlank(req.getMerchantName()) || StringUtils.isNotBlank(req.getUid())){
|
234
|
uids = storedSellerMapper.selectUidByCertNameAndUid(req.getMerchantName(),req.getUid());
|
234
|
uids = storedSellerMapper.selectUidByCertNameAndUid(req.getMerchantName(),req.getUid());
|
235
|
if(CollectionUtils.isEmpty(uids)){
|
235
|
if(CollectionUtils.isEmpty(uids)){
|
236
|
return new PageResponseBO<>();
|
236
|
return new PageResponseBO<>();
|
|
@@ -241,15 +241,19 @@ public class MerchantServiceImpl { |
|
@@ -241,15 +241,19 @@ public class MerchantServiceImpl { |
241
|
return new PageResponseBO<>();
|
241
|
return new PageResponseBO<>();
|
242
|
}
|
242
|
}
|
243
|
List<SellerWalletDetail> beanList = mapper.selectMerchantInfo(CollectionUtils.isEmpty(uids)?null:uids, stratTime, endTime, req.getStateList(),req.getOrderCode(), req.getStart(), req.getRows());
|
243
|
List<SellerWalletDetail> beanList = mapper.selectMerchantInfo(CollectionUtils.isEmpty(uids)?null:uids, stratTime, endTime, req.getStateList(),req.getOrderCode(), req.getStart(), req.getRows());
|
|
|
244
|
+ if(CollectionUtils.isEmpty(beanList)){
|
|
|
245
|
+ PageResponseBO<MerchantOrderAttachInfo> result=new PageResponseBO<>();
|
|
|
246
|
+ result.setPage(req.getPage());
|
|
|
247
|
+ result.setSize(req.getSize());
|
|
|
248
|
+ result.setTotal(total);
|
|
|
249
|
+ return result;
|
|
|
250
|
+ }
|
244
|
Map<Integer,Map<String,Object>> storedSellerMap = this.storedSellerMapper.selectNameByUids(beanList.stream().map(cell->cell.getUid()).collect(Collectors.toList()));
|
251
|
Map<Integer,Map<String,Object>> storedSellerMap = this.storedSellerMapper.selectNameByUids(beanList.stream().map(cell->cell.getUid()).collect(Collectors.toList()));
|
245
|
List<MerchantOrderAttachInfo> boList = new ArrayList<>();
|
252
|
List<MerchantOrderAttachInfo> boList = new ArrayList<>();
|
246
|
for(SellerWalletDetail detail : beanList) {
|
253
|
for(SellerWalletDetail detail : beanList) {
|
247
|
- MerchantOrderAttachInfo info = JSON.parseObject(detail.getAttachValue(), MerchantOrderAttachInfo.class);
|
|
|
248
|
- info=info == null?new MerchantOrderAttachInfo():info;
|
254
|
+ MerchantOrderAttachInfo info = exchange(detail);
|
249
|
info.setOrderCode(detail.getOrderCode());
|
255
|
info.setOrderCode(detail.getOrderCode());
|
250
|
- info.setTime(sdf.get().format(new Date(detail.getCreateTime() * 1000L)));
|
|
|
251
|
info.setMerchantName((String)storedSellerMap.get(detail.getUid()).get("cert_name"));
|
256
|
info.setMerchantName((String)storedSellerMap.get(detail.getUid()).get("cert_name"));
|
252
|
- info.setUid(detail.getUid());
|
|
|
253
|
boList.add(info);
|
257
|
boList.add(info);
|
254
|
}
|
258
|
}
|
255
|
PageResponseBO<MerchantOrderAttachInfo> result=new PageResponseBO<>();
|
259
|
PageResponseBO<MerchantOrderAttachInfo> result=new PageResponseBO<>();
|
|
@@ -265,24 +269,30 @@ public class MerchantServiceImpl { |
|
@@ -265,24 +269,30 @@ public class MerchantServiceImpl { |
265
|
MerchantOrderAttachInfo info = new MerchantOrderAttachInfo();
|
269
|
MerchantOrderAttachInfo info = new MerchantOrderAttachInfo();
|
266
|
if(StringUtils.isNotBlank(detail.getAttachValue())) {
|
270
|
if(StringUtils.isNotBlank(detail.getAttachValue())) {
|
267
|
info = JSON.parseObject(detail.getAttachValue(), MerchantOrderAttachInfo.class);
|
271
|
info = JSON.parseObject(detail.getAttachValue(), MerchantOrderAttachInfo.class);
|
|
|
272
|
+ info=info == null?new MerchantOrderAttachInfo():info;
|
268
|
}
|
273
|
}
|
269
|
info.setId(detail.getId());
|
274
|
info.setId(detail.getId());
|
270
|
info.setUid(detail.getUid());
|
275
|
info.setUid(detail.getUid());
|
271
|
info.setType(detail.getType());
|
276
|
info.setType(detail.getType());
|
272
|
- info.setUserName("");
|
277
|
+ if(null != info.getType()){
|
|
|
278
|
+ info.setTypeName(SellerWalletDetail.Type.of(detail.getType()).getName());
|
|
|
279
|
+ }
|
273
|
info.setTime(sdf.get().format(new Date(detail.getCreateTime() * 1000L)));
|
280
|
info.setTime(sdf.get().format(new Date(detail.getCreateTime() * 1000L)));
|
274
|
if (info.getType() / 10 == 3 || info.getType()==61) {
|
281
|
if (info.getType() / 10 == 3 || info.getType()==61) {
|
275
|
- info.setAccountAmount(detail.getAmount().toString());
|
|
|
276
|
- info.setLockEarnestMoney(detail.getAmount().toString());
|
282
|
+ info.setAccountAmount(detail.getAmount()==null?null:detail.getAmount().toString());
|
|
|
283
|
+ info.setLockEarnestMoney(detail.getAmount()==null?null:detail.getAmount().toString());
|
277
|
info.setAvailEarnestMoney("/");
|
284
|
info.setAvailEarnestMoney("/");
|
278
|
} else {
|
285
|
} else {
|
279
|
info.setAccountAmount("/");
|
286
|
info.setAccountAmount("/");
|
280
|
info.setLockEarnestMoney("/");
|
287
|
info.setLockEarnestMoney("/");
|
281
|
- info.setAvailEarnestMoney(detail.getAmount().toString());
|
288
|
+ info.setAvailEarnestMoney(detail.getAmount()==null?null:detail.getAmount().toString());
|
|
|
289
|
+ }
|
|
|
290
|
+ if(detail.getAvailAmount()!=null){
|
|
|
291
|
+ info.setAccountAllAmount(detail.getLockAmount()==null?
|
|
|
292
|
+ detail.getAvailAmount().toString():detail.getAvailAmount().add(detail.getLockAmount()).toString());
|
|
|
293
|
+ info.setAvailAllEarnestMoney(detail.getAvailAmount().toString());
|
282
|
}
|
294
|
}
|
283
|
- info.setAccountAllAmount(detail.getAvailAmount().add(detail.getLockAmount()).toString());
|
|
|
284
|
- info.setLockAllEarnestMoney(detail.getLockAmount().toString());
|
|
|
285
|
- info.setAvailAllEarnestMoney(detail.getAvailAmount().toString());
|
295
|
+ info.setLockAllEarnestMoney(detail.getLockAmount()==null?null:detail.getLockAmount().toString());
|
286
|
return info;
|
296
|
return info;
|
287
|
}
|
297
|
}
|
288
|
|
298
|
|
|
@@ -311,6 +321,13 @@ public class MerchantServiceImpl { |
|
@@ -311,6 +321,13 @@ public class MerchantServiceImpl { |
311
|
return new PageResponseBO<>();
|
321
|
return new PageResponseBO<>();
|
312
|
}
|
322
|
}
|
313
|
List<SellerWallet> sellerWallets = this.sellerWalletMapper.selectByUidAndMerchantUids(req.getUid(),uids,req.getStart(),req.getSize());
|
323
|
List<SellerWallet> sellerWallets = this.sellerWalletMapper.selectByUidAndMerchantUids(req.getUid(),uids,req.getStart(),req.getSize());
|
|
|
324
|
+ if(CollectionUtils.isEmpty(sellerWallets)){
|
|
|
325
|
+ PageResponseBO<MerchantOrderAttachInfo> result = new PageResponseBO<>();
|
|
|
326
|
+ result.setTotal(total);
|
|
|
327
|
+ result.setPage(req.getPage());
|
|
|
328
|
+ result.setSize(req.getSize());
|
|
|
329
|
+ return result;
|
|
|
330
|
+ }
|
314
|
List<MerchantOrderAttachInfo> infos = initMerchantOrderAttachInfos(sellerWallets);
|
331
|
List<MerchantOrderAttachInfo> infos = initMerchantOrderAttachInfos(sellerWallets);
|
315
|
PageResponseBO<MerchantOrderAttachInfo> result = new PageResponseBO<>();
|
332
|
PageResponseBO<MerchantOrderAttachInfo> result = new PageResponseBO<>();
|
316
|
result.setTotal(total);
|
333
|
result.setTotal(total);
|