add input param 4 advance sale
Showing
1 changed file
with
36 additions
and
8 deletions
@@ -20,9 +20,7 @@ import com.yohoufo.order.service.impl.SellerOrderService; | @@ -20,9 +20,7 @@ import com.yohoufo.order.service.impl.SellerOrderService; | ||
20 | import com.yohoufo.order.service.impl.SellerService; | 20 | import com.yohoufo.order.service.impl.SellerService; |
21 | import com.yohoufo.order.service.impl.SkupListService; | 21 | import com.yohoufo.order.service.impl.SkupListService; |
22 | import com.yohoufo.order.utils.LoggerUtils; | 22 | import com.yohoufo.order.utils.LoggerUtils; |
23 | -import org.apache.kafka.common.requests.LeaderAndIsrRequest; | ||
24 | import org.slf4j.Logger; | 23 | import org.slf4j.Logger; |
25 | -import org.slf4j.LoggerFactory; | ||
26 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
27 | import org.springframework.stereotype.Controller; | 25 | import org.springframework.stereotype.Controller; |
28 | import org.springframework.web.bind.annotation.RequestBody; | 26 | import org.springframework.web.bind.annotation.RequestBody; |
@@ -54,7 +52,7 @@ public class SellerOrderController { | @@ -54,7 +52,7 @@ public class SellerOrderController { | ||
54 | @Autowired | 52 | @Autowired |
55 | private SkupListService skupListService; | 53 | private SkupListService skupListService; |
56 | 54 | ||
57 | - | 55 | + static final String DEFAULT_SKUP_TYPE = "1"; |
58 | /** | 56 | /** |
59 | * 根据卖家提交价格来计算各项费用 | 57 | * 根据卖家提交价格来计算各项费用 |
60 | * @param uid | 58 | * @param uid |
@@ -68,9 +66,11 @@ public class SellerOrderController { | @@ -68,9 +66,11 @@ public class SellerOrderController { | ||
68 | public ApiResponse computePublishPrd(@RequestParam(name = "uid", required = true)int uid, | 66 | public ApiResponse computePublishPrd(@RequestParam(name = "uid", required = true)int uid, |
69 | @RequestParam(name = "storage_id", required = true)int storage_id, | 67 | @RequestParam(name = "storage_id", required = true)int storage_id, |
70 | @RequestParam(name="price", required = true)String price, | 68 | @RequestParam(name="price", required = true)String price, |
71 | - @RequestParam(name="num", defaultValue = "1", required = false)int num) throws GatewayException { | 69 | + @RequestParam(name="num", defaultValue = "1", required = false)int num, |
70 | + @RequestParam(name="skupType", defaultValue = DEFAULT_SKUP_TYPE, required = false) Integer skupType) throws GatewayException { | ||
72 | SellerOrderComputeReq req = SellerOrderComputeReq.builder().uid(uid).storageId(storage_id).price(price) | 71 | SellerOrderComputeReq req = SellerOrderComputeReq.builder().uid(uid).storageId(storage_id).price(price) |
73 | - .num(num).build(); | 72 | + .num(num).skupType(skupType).build(); |
73 | + | ||
74 | logger.info("in ufo.sellerOrder.computePublishPrd, req {}", req); | 74 | logger.info("in ufo.sellerOrder.computePublishPrd, req {}", req); |
75 | SoldPrdComputeBo computeBo = sellerOrderService.computePublishPrd(req); | 75 | SoldPrdComputeBo computeBo = sellerOrderService.computePublishPrd(req); |
76 | return new ApiResponse.ApiResponseBuilder().code(200).data(computeBo).message("算费成功").build(); | 76 | return new ApiResponse.ApiResponseBuilder().code(200).data(computeBo).message("算费成功").build(); |
@@ -92,13 +92,15 @@ public class SellerOrderController { | @@ -92,13 +92,15 @@ public class SellerOrderController { | ||
92 | @RequestParam(name = "storage_id", required = true)int storage_id, | 92 | @RequestParam(name = "storage_id", required = true)int storage_id, |
93 | @RequestParam(name="price", required = true)String price, | 93 | @RequestParam(name="price", required = true)String price, |
94 | @RequestParam(name="address_id")String address_id, | 94 | @RequestParam(name="address_id")String address_id, |
95 | - @RequestParam(name="num", defaultValue = "1", required = false)int num) throws GatewayException { | 95 | + @RequestParam(name="num", defaultValue = "1", required = false)int num, |
96 | + @RequestParam(name="skupType", defaultValue = DEFAULT_SKUP_TYPE, required = false) Integer skupType) throws GatewayException { | ||
96 | SellerOrderSubmitReq req = SellerOrderSubmitReq.builder() | 97 | SellerOrderSubmitReq req = SellerOrderSubmitReq.builder() |
97 | .uid(uid) | 98 | .uid(uid) |
98 | .storageId(storage_id) | 99 | .storageId(storage_id) |
99 | .price(price) | 100 | .price(price) |
100 | .addressId(address_id) | 101 | .addressId(address_id) |
101 | .num(num) | 102 | .num(num) |
103 | + .skupType(skupType) | ||
102 | .build(); | 104 | .build(); |
103 | logger.info("in ufo.sellerOrder.publishPrd, req {}", req); | 105 | logger.info("in ufo.sellerOrder.publishPrd, req {}", req); |
104 | OrderSubmitResp resp = sellerOrderService.publishPrd(req); | 106 | OrderSubmitResp resp = sellerOrderService.publishPrd(req); |
@@ -107,6 +109,8 @@ public class SellerOrderController { | @@ -107,6 +109,8 @@ public class SellerOrderController { | ||
107 | 109 | ||
108 | /** | 110 | /** |
109 | * 入驻商家的批量下架 已经售出的不会下架 | 111 | * 入驻商家的批量下架 已经售出的不会下架 |
112 | + * @since 6.8.3 | ||
113 | + * @deprecated 6.8.4 | ||
110 | * @param uid | 114 | * @param uid |
111 | * @param batchNo | 115 | * @param batchNo |
112 | * @param num | 116 | * @param num |
@@ -213,6 +217,8 @@ public class SellerOrderController { | @@ -213,6 +217,8 @@ public class SellerOrderController { | ||
213 | 217 | ||
214 | /** | 218 | /** |
215 | * 批量调价 | 219 | * 批量调价 |
220 | + * @since 6.8.3 | ||
221 | + * @deprecated 6.8.4 | ||
216 | * @param uid | 222 | * @param uid |
217 | * @param batchNo | 223 | * @param batchNo |
218 | * @param price | 224 | * @param price |
@@ -221,6 +227,7 @@ public class SellerOrderController { | @@ -221,6 +227,7 @@ public class SellerOrderController { | ||
221 | */ | 227 | */ |
222 | @RequestMapping(params = "method=ufo.sellerOrder.batchChangePrice") | 228 | @RequestMapping(params = "method=ufo.sellerOrder.batchChangePrice") |
223 | @ResponseBody | 229 | @ResponseBody |
230 | + @Deprecated | ||
224 | public ApiResponse batchChangePrice(@RequestParam(name = "uid", required = true)int uid, | 231 | public ApiResponse batchChangePrice(@RequestParam(name = "uid", required = true)int uid, |
225 | @RequestParam(name = "price", required = true)String price, | 232 | @RequestParam(name = "price", required = true)String price, |
226 | @RequestParam(name = "batchNo", required = true)String batchNo, | 233 | @RequestParam(name = "batchNo", required = true)String batchNo, |
@@ -240,8 +247,23 @@ public class SellerOrderController { | @@ -240,8 +247,23 @@ public class SellerOrderController { | ||
240 | return new ApiResponse.ApiResponseBuilder().data(result).code(200).message(result.getTips()).build(); | 247 | return new ApiResponse.ApiResponseBuilder().data(result).code(200).message(result.getTips()).build(); |
241 | } | 248 | } |
242 | 249 | ||
250 | + /** | ||
251 | + * 变价计算 | ||
252 | + * 仅仅支持6.8.3,从6.8.4后使用 {@link #computeAdjustPrice(int, int, BigDecimal, String, int, int)} | ||
253 | + * @since 6.8.3 | ||
254 | + * @deprecated 6.8.4 | ||
255 | + * @param uid | ||
256 | + * @param storage_id | ||
257 | + * @param price | ||
258 | + * @param batchNo | ||
259 | + * @param skupList | ||
260 | + * @param num | ||
261 | + * @return | ||
262 | + * @throws GatewayException | ||
263 | + */ | ||
243 | @RequestMapping(params = "method=ufo.sellerOrder.computeChangePrice") | 264 | @RequestMapping(params = "method=ufo.sellerOrder.computeChangePrice") |
244 | @ResponseBody | 265 | @ResponseBody |
266 | + @Deprecated | ||
245 | public ApiResponse computeChangePrice(@RequestParam(name = "uid", required = true)int uid, | 267 | public ApiResponse computeChangePrice(@RequestParam(name = "uid", required = true)int uid, |
246 | @RequestParam(name = "storage_id", required = true)int storage_id, | 268 | @RequestParam(name = "storage_id", required = true)int storage_id, |
247 | @RequestParam(name="price", required = true)String price, | 269 | @RequestParam(name="price", required = true)String price, |
@@ -264,6 +286,7 @@ public class SellerOrderController { | @@ -264,6 +286,7 @@ public class SellerOrderController { | ||
264 | 286 | ||
265 | /** | 287 | /** |
266 | * 调价计算 | 288 | * 调价计算 |
289 | + * @since 6.8.5 | ||
267 | * @param uid | 290 | * @param uid |
268 | * @param storage_id | 291 | * @param storage_id |
269 | * @param old_price | 292 | * @param old_price |
@@ -318,7 +341,8 @@ public class SellerOrderController { | @@ -318,7 +341,8 @@ public class SellerOrderController { | ||
318 | @RequestParam(name = "old_price") BigDecimal old_price, | 341 | @RequestParam(name = "old_price") BigDecimal old_price, |
319 | @RequestParam(name = "new_price") String new_price, | 342 | @RequestParam(name = "new_price") String new_price, |
320 | @RequestParam(name = "product_id") int product_id, | 343 | @RequestParam(name = "product_id") int product_id, |
321 | - @RequestParam(name = "num") int num) throws GatewayException { | 344 | + @RequestParam(name = "num") int num, |
345 | + @RequestParam(name="skupType", defaultValue = DEFAULT_SKUP_TYPE, required = false) Integer skupType) throws GatewayException { | ||
322 | SellerBatchChangeReq req = new SellerBatchChangeReq(); | 346 | SellerBatchChangeReq req = new SellerBatchChangeReq(); |
323 | req.setStorageId(storage_id); | 347 | req.setStorageId(storage_id); |
324 | req.setUid(uid); | 348 | req.setUid(uid); |
@@ -326,6 +350,7 @@ public class SellerOrderController { | @@ -326,6 +350,7 @@ public class SellerOrderController { | ||
326 | req.setPrice(new_price); | 350 | req.setPrice(new_price); |
327 | req.setProductId(product_id); | 351 | req.setProductId(product_id); |
328 | req.setNum(num); | 352 | req.setNum(num); |
353 | + req.setSkupType(skupType); | ||
329 | req.setShowPriceError(true); | 354 | req.setShowPriceError(true); |
330 | logger.info("in ufo.sellerOrder.batchAdjustPrice, req {}", req); | 355 | logger.info("in ufo.sellerOrder.batchAdjustPrice, req {}", req); |
331 | try { | 356 | try { |
@@ -351,13 +376,16 @@ public class SellerOrderController { | @@ -351,13 +376,16 @@ public class SellerOrderController { | ||
351 | @RequestParam(name = "storage_id") int storage_id, | 376 | @RequestParam(name = "storage_id") int storage_id, |
352 | @RequestParam(name = "product_id") int product_id, | 377 | @RequestParam(name = "product_id") int product_id, |
353 | @RequestParam(name = "old_price") BigDecimal old_price, | 378 | @RequestParam(name = "old_price") BigDecimal old_price, |
354 | - @RequestParam(name = "num") int num) throws GatewayException { | 379 | + @RequestParam(name = "num") int num, |
380 | + @RequestParam(name="skupType", defaultValue = DEFAULT_SKUP_TYPE, required = false) Integer skupType | ||
381 | + ) throws GatewayException { | ||
355 | SellerBatchChangeReq req = new SellerBatchChangeReq(); | 382 | SellerBatchChangeReq req = new SellerBatchChangeReq(); |
356 | req.setStorageId(storage_id); | 383 | req.setStorageId(storage_id); |
357 | req.setUid(uid); | 384 | req.setUid(uid); |
358 | req.setProductId(product_id); | 385 | req.setProductId(product_id); |
359 | req.setOldPrice(old_price); | 386 | req.setOldPrice(old_price); |
360 | req.setNum(num); | 387 | req.setNum(num); |
388 | + req.setSkupType(skupType); | ||
361 | logger.info("in ufo.sellerOrder.batchDownShelf, req {}", req); | 389 | logger.info("in ufo.sellerOrder.batchDownShelf, req {}", req); |
362 | boolean result = sellerOrderService.batchDownShelf(req); | 390 | boolean result = sellerOrderService.batchDownShelf(req); |
363 | String msg = "批量取消成功"; | 391 | String msg = "批量取消成功"; |
-
Please register or login to post a comment