Showing
3 changed files
with
28 additions
and
2 deletions
1 | package com.yohoufo.order.controller; | 1 | package com.yohoufo.order.controller; |
2 | 2 | ||
3 | +import com.alibaba.fastjson.JSONObject; | ||
3 | import com.yohobuy.ufo.model.order.bo.DepositDetailBo; | 4 | import com.yohobuy.ufo.model.order.bo.DepositDetailBo; |
4 | import com.yohobuy.ufo.model.order.bo.DepositProductBo; | 5 | import com.yohobuy.ufo.model.order.bo.DepositProductBo; |
5 | import com.yohoufo.common.ApiResponse; | 6 | import com.yohoufo.common.ApiResponse; |
@@ -67,7 +68,11 @@ public class DepositController { | @@ -67,7 +68,11 @@ public class DepositController { | ||
67 | } | 68 | } |
68 | 69 | ||
69 | List<DepositDetailBo> depositDetailBoList = depositService.queryUserProductDopositingDetail(uid, productId, page, limit); | 70 | List<DepositDetailBo> depositDetailBoList = depositService.queryUserProductDopositingDetail(uid, productId, page, limit); |
70 | - LOG.info("queryUserDopositing result: {}", depositDetailBoList); | ||
71 | - return new ApiResponse.ApiResponseBuilder().code(200).data(depositDetailBoList).build(); | 71 | + DepositProductBo countBo = depositService.queryUserDepositProductCountInfo(uid, productId); |
72 | + JSONObject result = new JSONObject(); | ||
73 | + result.put("product", countBo); | ||
74 | + result.put("items", depositDetailBoList); | ||
75 | + LOG.info("queryUserDopositing result: {}", result); | ||
76 | + return new ApiResponse.ApiResponseBuilder().code(200).data(result).build(); | ||
72 | } | 77 | } |
73 | } | 78 | } |
@@ -17,6 +17,8 @@ public interface DepositService { | @@ -17,6 +17,8 @@ public interface DepositService { | ||
17 | 17 | ||
18 | List<DepositDetailBo> queryUserProductDopositingDetail(Integer uid, Integer productId, Integer page, Integer limit); | 18 | List<DepositDetailBo> queryUserProductDopositingDetail(Integer uid, Integer productId, Integer page, Integer limit); |
19 | 19 | ||
20 | + DepositProductBo queryUserDepositProductCountInfo(Integer uid, Integer productId); | ||
21 | + | ||
20 | boolean changeSaleStatusOn(Integer uid, String depositCode, Integer skup); | 22 | boolean changeSaleStatusOn(Integer uid, String depositCode, Integer skup); |
21 | boolean changeSaleStatusOff(Integer uid, Integer skup); | 23 | boolean changeSaleStatusOff(Integer uid, Integer skup); |
22 | boolean changeOwner(Integer uid, Integer skup, long buyOrderCode, Integer newUid); | 24 | boolean changeOwner(Integer uid, Integer skup, long buyOrderCode, Integer newUid); |
@@ -141,6 +141,25 @@ public class DepositServiceImpl implements DepositService { | @@ -141,6 +141,25 @@ public class DepositServiceImpl implements DepositService { | ||
141 | return result; | 141 | return result; |
142 | } | 142 | } |
143 | 143 | ||
144 | + public DepositProductBo queryUserDepositProductCountInfo(Integer uid, Integer productId) { | ||
145 | + List<StorageDepositCount> countInfoList = storageDepositMapper.queryUserDepositProduct(uid, Arrays.asList(productId)); | ||
146 | + if (countInfoList.isEmpty()) { | ||
147 | + return null; | ||
148 | + } | ||
149 | + StorageDepositCount countInfo = countInfoList.get(0); | ||
150 | + DepositProductBo bo = new DepositProductBo(); | ||
151 | + SellerOrderGoods goods = sellerOrderGoodsMapper.selectByPrimaryKey(countInfo.getSkup()); | ||
152 | + bo.setProductId(productId); | ||
153 | + if (goods != null) { | ||
154 | + bo.setProductName(goods.getProductName()); | ||
155 | + bo.setColorName(goods.getColorName()); | ||
156 | + bo.setPic(goods.getImageUrl()); | ||
157 | + } | ||
158 | + bo.setSizeCount(countInfo.getStorageIdCount()); | ||
159 | + bo.setStorageCount(countInfo.getStorageCount()); | ||
160 | + return bo; | ||
161 | + } | ||
162 | + | ||
144 | 163 | ||
145 | // 上架 | 164 | // 上架 |
146 | @Override | 165 | @Override |
-
Please register or login to post a comment