...
|
...
|
@@ -20,9 +20,7 @@ import com.yohoufo.order.service.impl.SellerOrderService; |
|
|
import com.yohoufo.order.service.impl.SellerService;
|
|
|
import com.yohoufo.order.service.impl.SkupListService;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import org.apache.kafka.common.requests.LeaderAndIsrRequest;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
...
|
...
|
@@ -54,7 +52,7 @@ public class SellerOrderController { |
|
|
@Autowired
|
|
|
private SkupListService skupListService;
|
|
|
|
|
|
|
|
|
static final String DEFAULT_SKUP_TYPE = "1";
|
|
|
/**
|
|
|
* 根据卖家提交价格来计算各项费用
|
|
|
* @param uid
|
...
|
...
|
@@ -68,9 +66,11 @@ public class SellerOrderController { |
|
|
public ApiResponse computePublishPrd(@RequestParam(name = "uid", required = true)int uid,
|
|
|
@RequestParam(name = "storage_id", required = true)int storage_id,
|
|
|
@RequestParam(name="price", required = true)String price,
|
|
|
@RequestParam(name="num", defaultValue = "1", required = false)int num) throws GatewayException {
|
|
|
@RequestParam(name="num", defaultValue = "1", required = false)int num,
|
|
|
@RequestParam(name="skupType", defaultValue = DEFAULT_SKUP_TYPE, required = false) Integer skupType) throws GatewayException {
|
|
|
SellerOrderComputeReq req = SellerOrderComputeReq.builder().uid(uid).storageId(storage_id).price(price)
|
|
|
.num(num).build();
|
|
|
.num(num).skupType(skupType).build();
|
|
|
|
|
|
logger.info("in ufo.sellerOrder.computePublishPrd, req {}", req);
|
|
|
SoldPrdComputeBo computeBo = sellerOrderService.computePublishPrd(req);
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).data(computeBo).message("算费成功").build();
|
...
|
...
|
@@ -92,13 +92,15 @@ public class SellerOrderController { |
|
|
@RequestParam(name = "storage_id", required = true)int storage_id,
|
|
|
@RequestParam(name="price", required = true)String price,
|
|
|
@RequestParam(name="address_id")String address_id,
|
|
|
@RequestParam(name="num", defaultValue = "1", required = false)int num) throws GatewayException {
|
|
|
@RequestParam(name="num", defaultValue = "1", required = false)int num,
|
|
|
@RequestParam(name="skupType", defaultValue = DEFAULT_SKUP_TYPE, required = false) Integer skupType) throws GatewayException {
|
|
|
SellerOrderSubmitReq req = SellerOrderSubmitReq.builder()
|
|
|
.uid(uid)
|
|
|
.storageId(storage_id)
|
|
|
.price(price)
|
|
|
.addressId(address_id)
|
|
|
.num(num)
|
|
|
.skupType(skupType)
|
|
|
.build();
|
|
|
logger.info("in ufo.sellerOrder.publishPrd, req {}", req);
|
|
|
OrderSubmitResp resp = sellerOrderService.publishPrd(req);
|
...
|
...
|
@@ -107,6 +109,8 @@ public class SellerOrderController { |
|
|
|
|
|
/**
|
|
|
* 入驻商家的批量下架 已经售出的不会下架
|
|
|
* @since 6.8.3
|
|
|
* @deprecated 6.8.4
|
|
|
* @param uid
|
|
|
* @param batchNo
|
|
|
* @param num
|
...
|
...
|
@@ -213,6 +217,8 @@ public class SellerOrderController { |
|
|
|
|
|
/**
|
|
|
* 批量调价
|
|
|
* @since 6.8.3
|
|
|
* @deprecated 6.8.4
|
|
|
* @param uid
|
|
|
* @param batchNo
|
|
|
* @param price
|
...
|
...
|
@@ -221,6 +227,7 @@ public class SellerOrderController { |
|
|
*/
|
|
|
@RequestMapping(params = "method=ufo.sellerOrder.batchChangePrice")
|
|
|
@ResponseBody
|
|
|
@Deprecated
|
|
|
public ApiResponse batchChangePrice(@RequestParam(name = "uid", required = true)int uid,
|
|
|
@RequestParam(name = "price", required = true)String price,
|
|
|
@RequestParam(name = "batchNo", required = true)String batchNo,
|
...
|
...
|
@@ -240,8 +247,23 @@ public class SellerOrderController { |
|
|
return new ApiResponse.ApiResponseBuilder().data(result).code(200).message(result.getTips()).build();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 变价计算
|
|
|
* 仅仅支持6.8.3,从6.8.4后使用 {@link #computeAdjustPrice(int, int, BigDecimal, String, int, int)}
|
|
|
* @since 6.8.3
|
|
|
* @deprecated 6.8.4
|
|
|
* @param uid
|
|
|
* @param storage_id
|
|
|
* @param price
|
|
|
* @param batchNo
|
|
|
* @param skupList
|
|
|
* @param num
|
|
|
* @return
|
|
|
* @throws GatewayException
|
|
|
*/
|
|
|
@RequestMapping(params = "method=ufo.sellerOrder.computeChangePrice")
|
|
|
@ResponseBody
|
|
|
@Deprecated
|
|
|
public ApiResponse computeChangePrice(@RequestParam(name = "uid", required = true)int uid,
|
|
|
@RequestParam(name = "storage_id", required = true)int storage_id,
|
|
|
@RequestParam(name="price", required = true)String price,
|
...
|
...
|
@@ -264,6 +286,7 @@ public class SellerOrderController { |
|
|
|
|
|
/**
|
|
|
* 调价计算
|
|
|
* @since 6.8.5
|
|
|
* @param uid
|
|
|
* @param storage_id
|
|
|
* @param old_price
|
...
|
...
|
@@ -318,7 +341,8 @@ public class SellerOrderController { |
|
|
@RequestParam(name = "old_price") BigDecimal old_price,
|
|
|
@RequestParam(name = "new_price") String new_price,
|
|
|
@RequestParam(name = "product_id") int product_id,
|
|
|
@RequestParam(name = "num") int num) throws GatewayException {
|
|
|
@RequestParam(name = "num") int num,
|
|
|
@RequestParam(name="skupType", defaultValue = DEFAULT_SKUP_TYPE, required = false) Integer skupType) throws GatewayException {
|
|
|
SellerBatchChangeReq req = new SellerBatchChangeReq();
|
|
|
req.setStorageId(storage_id);
|
|
|
req.setUid(uid);
|
...
|
...
|
@@ -326,6 +350,7 @@ public class SellerOrderController { |
|
|
req.setPrice(new_price);
|
|
|
req.setProductId(product_id);
|
|
|
req.setNum(num);
|
|
|
req.setSkupType(skupType);
|
|
|
req.setShowPriceError(true);
|
|
|
logger.info("in ufo.sellerOrder.batchAdjustPrice, req {}", req);
|
|
|
try {
|
...
|
...
|
@@ -351,13 +376,16 @@ public class SellerOrderController { |
|
|
@RequestParam(name = "storage_id") int storage_id,
|
|
|
@RequestParam(name = "product_id") int product_id,
|
|
|
@RequestParam(name = "old_price") BigDecimal old_price,
|
|
|
@RequestParam(name = "num") int num) throws GatewayException {
|
|
|
@RequestParam(name = "num") int num,
|
|
|
@RequestParam(name="skupType", defaultValue = DEFAULT_SKUP_TYPE, required = false) Integer skupType
|
|
|
) throws GatewayException {
|
|
|
SellerBatchChangeReq req = new SellerBatchChangeReq();
|
|
|
req.setStorageId(storage_id);
|
|
|
req.setUid(uid);
|
|
|
req.setProductId(product_id);
|
|
|
req.setOldPrice(old_price);
|
|
|
req.setNum(num);
|
|
|
req.setSkupType(skupType);
|
|
|
logger.info("in ufo.sellerOrder.batchDownShelf, req {}", req);
|
|
|
boolean result = sellerOrderService.batchDownShelf(req);
|
|
|
String msg = "批量取消成功";
|
...
|
...
|
|