1
|
package com.yohoufo.order.service.impl;
|
1
|
package com.yohoufo.order.service.impl;
|
2
|
|
2
|
|
|
|
3
|
+import com.alibaba.fastjson.JSONObject;
|
3
|
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
|
4
|
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
|
4
|
import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
|
5
|
import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
|
5
|
import com.yohobuy.ufo.model.order.bo.DepositProductBo;
|
6
|
import com.yohobuy.ufo.model.order.bo.DepositProductBo;
|
|
|
7
|
+import com.yohobuy.ufo.model.order.resp.PageResp;
|
6
|
import com.yohoufo.common.exception.UfoServiceException;
|
8
|
import com.yohoufo.common.exception.UfoServiceException;
|
7
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
9
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
8
|
import com.yohoufo.dal.order.StorageDepositMapper;
|
10
|
import com.yohoufo.dal.order.StorageDepositMapper;
|
|
@@ -43,10 +45,10 @@ public class DepositServiceImpl implements DepositService { |
|
@@ -43,10 +45,10 @@ public class DepositServiceImpl implements DepositService { |
43
|
|
45
|
|
44
|
|
46
|
|
45
|
@Override
|
47
|
@Override
|
46
|
- public List<DepositProductBo> queryUserDoposit(Integer uid, Integer page, Integer limit) {
|
48
|
+ public PageResp<List<DepositProductBo>> queryUserDoposit(Integer uid, Integer page, Integer limit) {
|
47
|
int count = storageDepositMapper.queryUserDepositProductCount(uid);
|
49
|
int count = storageDepositMapper.queryUserDepositProductCount(uid);
|
48
|
if (count == 0) {
|
50
|
if (count == 0) {
|
49
|
- return new ArrayList<>();
|
51
|
+ return new PageResp<>();
|
50
|
}
|
52
|
}
|
51
|
List<Integer> productIdList = storageDepositMapper.queryUserDepositProductId(uid, (page - 1) * limit, limit);
|
53
|
List<Integer> productIdList = storageDepositMapper.queryUserDepositProductId(uid, (page - 1) * limit, limit);
|
52
|
LOGGER.info("productIdList is {}", productIdList);
|
54
|
LOGGER.info("productIdList is {}", productIdList);
|
|
@@ -75,14 +77,20 @@ public class DepositServiceImpl implements DepositService { |
|
@@ -75,14 +77,20 @@ public class DepositServiceImpl implements DepositService { |
75
|
}
|
77
|
}
|
76
|
result.add(bo);
|
78
|
result.add(bo);
|
77
|
}
|
79
|
}
|
78
|
- return result;
|
80
|
+ PageResp resp = new PageResp();
|
|
|
81
|
+ resp.setData(result);
|
|
|
82
|
+ resp.setPage(page);
|
|
|
83
|
+ resp.setPageSize(limit);
|
|
|
84
|
+ resp.setPagetotal((int) Math.ceil(count * 1.0 / limit));
|
|
|
85
|
+ resp.setTotal(count);
|
|
|
86
|
+ return resp;
|
79
|
}
|
87
|
}
|
80
|
|
88
|
|
81
|
@Override
|
89
|
@Override
|
82
|
- public List<DepositDetailBo> queryUserDopositBackDetail(Integer uid, Integer page, Integer limit) {
|
90
|
+ public PageResp<List<DepositDetailBo>> queryUserDopositBackDetail(Integer uid, Integer page, Integer limit) {
|
83
|
int count = storageDepositMapper.queryUserDopositBackCount(uid);
|
91
|
int count = storageDepositMapper.queryUserDopositBackCount(uid);
|
84
|
if (count == 0) {
|
92
|
if (count == 0) {
|
85
|
- return new ArrayList<>();
|
93
|
+ return new PageResp<>();
|
86
|
}
|
94
|
}
|
87
|
// 召回或者到期退回的
|
95
|
// 召回或者到期退回的
|
88
|
List<StorageDeposit> depositList = storageDepositMapper.queryUserDopositBack(uid, (page - 1) * limit, limit);
|
96
|
List<StorageDeposit> depositList = storageDepositMapper.queryUserDopositBack(uid, (page - 1) * limit, limit);
|
|
@@ -105,15 +113,21 @@ public class DepositServiceImpl implements DepositService { |
|
@@ -105,15 +113,21 @@ public class DepositServiceImpl implements DepositService { |
105
|
bo.setButtons(Arrays.asList(ButtonShowBo.detail()));
|
113
|
bo.setButtons(Arrays.asList(ButtonShowBo.detail()));
|
106
|
result.add(bo);
|
114
|
result.add(bo);
|
107
|
}
|
115
|
}
|
108
|
- return result;
|
116
|
+ PageResp resp = new PageResp();
|
|
|
117
|
+ resp.setData(result);
|
|
|
118
|
+ resp.setPage(page);
|
|
|
119
|
+ resp.setPageSize(limit);
|
|
|
120
|
+ resp.setPagetotal((int) Math.ceil(count * 1.0 / limit));
|
|
|
121
|
+ resp.setTotal(count);
|
|
|
122
|
+ return resp;
|
109
|
}
|
123
|
}
|
110
|
|
124
|
|
111
|
// 寄存中
|
125
|
// 寄存中
|
112
|
@Override
|
126
|
@Override
|
113
|
- public List<DepositDetailBo> queryUserProductDopositingDetail(Integer uid, Integer productId, Integer page, Integer limit) {
|
127
|
+ public PageResp<List<DepositDetailBo>> queryUserProductDopositingDetail(Integer uid, Integer productId, Integer page, Integer limit) {
|
114
|
int count = storageDepositMapper.queryUserProductDopositingCount(uid, productId);
|
128
|
int count = storageDepositMapper.queryUserProductDopositingCount(uid, productId);
|
115
|
if (count == 0) {
|
129
|
if (count == 0) {
|
116
|
- return new ArrayList<>();
|
130
|
+ return new PageResp<>();
|
117
|
}
|
131
|
}
|
118
|
List<StorageDeposit> depositList = storageDepositMapper.queryUserProductDopositing(uid, productId, (page - 1) * limit, limit);
|
132
|
List<StorageDeposit> depositList = storageDepositMapper.queryUserProductDopositing(uid, productId, (page - 1) * limit, limit);
|
119
|
List<Integer> skupList = depositList.stream().map(StorageDeposit::getSkup).collect(Collectors.toList());
|
133
|
List<Integer> skupList = depositList.stream().map(StorageDeposit::getSkup).collect(Collectors.toList());
|
|
@@ -140,7 +154,13 @@ public class DepositServiceImpl implements DepositService { |
|
@@ -140,7 +154,13 @@ public class DepositServiceImpl implements DepositService { |
140
|
bo.setButtons(Arrays.asList(ButtonShowBo.back(), ButtonShowBo.addDepositDays(), depo.getOrderStatus() == 0 ? ButtonShowBo.grounding() : ButtonShowBo.detail("详情")));
|
154
|
bo.setButtons(Arrays.asList(ButtonShowBo.back(), ButtonShowBo.addDepositDays(), depo.getOrderStatus() == 0 ? ButtonShowBo.grounding() : ButtonShowBo.detail("详情")));
|
141
|
result.add(bo);
|
155
|
result.add(bo);
|
142
|
}
|
156
|
}
|
143
|
- return result;
|
157
|
+ PageResp resp = new PageResp();
|
|
|
158
|
+ resp.setData(result);
|
|
|
159
|
+ resp.setPage(page);
|
|
|
160
|
+ resp.setPageSize(limit);
|
|
|
161
|
+ resp.setPagetotal((int) Math.ceil(count * 1.0 / limit));
|
|
|
162
|
+ resp.setTotal(count);
|
|
|
163
|
+ return resp;
|
144
|
}
|
164
|
}
|
145
|
|
165
|
|
146
|
public DepositProductBo queryUserDepositProductCountInfo(Integer uid, Integer productId) {
|
166
|
public DepositProductBo queryUserDepositProductCountInfo(Integer uid, Integer productId) {
|