|
|
@@ -1739,7 +1739,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
return new ResultMap(CodeType.NOT_EXiST, "数据库找不到对应的信息,请重新操作");
|
|
|
}
|
|
|
Product persistProduct = productDao.findOne(id);
|
|
|
- if (productPrivate.getB2cEnabled() != IntegerConstant.YES_SHORT) {
|
|
|
+ if (IntegerConstant.NO_SHORT.equals(productPrivate.getB2cEnabled())) {
|
|
|
return new ResultMap(CodeType.NOT_PERMIT, "该物料商城未启用,不能操作");
|
|
|
}
|
|
|
persistProduct.setMinPackQty(product.getMinPackQty());
|
|
|
@@ -2447,7 +2447,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
productInfo = productInfo.setByPrivate(existProducts.get(0));
|
|
|
// 用户填写库存量是需要做对应的出入库。如果新填写的库存数大于原库存数,做入库。否则做出库。
|
|
|
inOutbound = recordInventory(product, existProducts.get(0));
|
|
|
- BeanUtils.copyProperties(product, productInfo, "id");
|
|
|
+ BeanUtils.copyProperties(product, productInfo, "id,standard");
|
|
|
} else {
|
|
|
// 物料不存在,新增操作
|
|
|
productInfo = product;
|
|
|
@@ -2680,7 +2680,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
private void bindToPerson(Product productInfo, Long userUU, Long enUU) {
|
|
|
List<ProductPerson> productPersonList = productPersonDao.findByProductIdAndUserUU(productInfo.getId(), userUU);
|
|
|
if (CollectionUtils.isEmpty(productPersonList)) {
|
|
|
- ProductPerson productPerson = new ProductPerson(userUU, enUU, productInfo.getId());
|
|
|
+ ProductPerson productPerson = new ProductPerson(enUU, userUU, productInfo.getId());
|
|
|
productPerson = productPersonDao.save(productPerson);
|
|
|
logger.info("个人物料", "新增个人物料", "通过卖家中心单个物料上传绑定个人物料", productInfo.getProdNum(), productPerson.getId());
|
|
|
}
|
|
|
@@ -2722,19 +2722,19 @@ public class ProductServiceImpl implements ProductService {
|
|
|
throw new IllegalOperatorException("第 " + errMsg.toString() + " 行价格未填写");
|
|
|
}
|
|
|
}
|
|
|
- if (!StringUtils.isEmpty(goods.getQtyPrice())) {
|
|
|
+ if (!StringUtils.isEmpty(qtyPrices)) {
|
|
|
if (CollectionUtils.isNotEmpty(goods.getOriginalPrices())) {
|
|
|
- goods.getOriginalPrices().forEach(subPrice -> {
|
|
|
+ qtyPrices.forEach(qtyPrice -> {
|
|
|
// 分段数量不能超过最大数量
|
|
|
- Double endQty = NumberUtil.compare(subPrice.getEnd(), DoubleConstant.maxReserve) == 1 ? DoubleConstant.maxReserve : subPrice.getEnd();
|
|
|
- subPrice.setEnd(endQty);
|
|
|
-
|
|
|
- // 起始数量不能大于最小订购数
|
|
|
- Double startQty = NumberUtil.compare(minBuyQty, subPrice.getStart()) == 1 ? subPrice.getStart() : minBuyQty;
|
|
|
- subPrice.setStart(startQty);
|
|
|
+ Double endQty = NumberUtil.compare(qtyPrice.getEnd(), DoubleConstant.maxReserve) == 1 ? DoubleConstant.maxReserve : qtyPrice.getEnd();
|
|
|
+ qtyPrice.setEnd(endQty);
|
|
|
});
|
|
|
+
|
|
|
+ // 起始数量不能大于最小订购数
|
|
|
+ Double startQty = NumberUtil.compare(minBuyQty, qtyPrices.get(0).getStart()) == 1 ? qtyPrices.get(0).getStart() : minBuyQty;
|
|
|
+ qtyPrices.get(0).setStart(startQty);
|
|
|
}
|
|
|
- goods.setQtyPrice(JSON.toJSONString(goods.getOriginalPrices()));
|
|
|
+ goods.setQtyPrice(JSON.toJSONString(qtyPrices));
|
|
|
}
|
|
|
goodsService.setGoodsDefault(goods);
|
|
|
boolean autoPublish = goods.getAutoPublish() == null ? true : goods.getAutoPublish();
|