Authored by tanling

参数检查

... ... @@ -34,7 +34,7 @@ public class ErpFastDeliveryController {
/**
* 批量上架
* 货号+尺寸是否存在
* @param req
* @return
*/
... ...
... ... @@ -364,7 +364,7 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
public List<FastDeliveryBatchOnShelfResp> batchOnShelf(FastDeliveryBatchOnShelfReq req) {
// 1.检查入口参数
checkBatchOnShelf(req, true);
checkBatchOnShelf(req, true, true);
// 2.检查用户权限(极速发货权限)
SellerWrapper sellerWrapper = checkFastDeliveryAuth(req.getUid());
... ... @@ -439,7 +439,7 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
*/
public List<StorageCheckResp> getStorageInfo(FastDeliveryBatchOnShelfReq req){
// 1.检查入口参数
checkBatchOnShelf(req, false);
checkBatchOnShelf(req, false,false);
return productProxyService.getStorageInfoList(buildStorageReq(req));
}
... ... @@ -515,7 +515,7 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
}
private void checkBatchOnShelf(FastDeliveryBatchOnShelfReq req, boolean checkPrice) {
private void checkBatchOnShelf(FastDeliveryBatchOnShelfReq req, boolean checkNum, boolean checkPrice) {
if (req.getUid() < 0){
logger.warn("uid is empty");
... ... @@ -529,12 +529,18 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
for(FastDeliveryBatchOnShelfReq.ProductInfo productInfo : req.getProductInfos()){
if (StringUtils.isBlank(productInfo.getSizeName())
|| StringUtils.isBlank(productInfo.getProductCode())
|| productInfo.getNum() == null){
|| StringUtils.isBlank(productInfo.getProductCode())){
logger.warn("productInfo is invalidate {}", productInfo);
throw new UfoServiceException(400, "商品信息不合法");
}
if (checkNum){
if (productInfo.getNum() == null){
logger.warn("productInfo is invalidate {}", productInfo);
throw new UfoServiceException(400, "商品信息不合法");
}
}
if (checkPrice){
// 价格已9结尾
BigDecimal salePrice = priceComputePrepareProcessor.checkAndAcquireSalePrice(productInfo.getPrice(), SkupType.FAST_DELIVERY);
... ...