|
|
@@ -1457,7 +1457,12 @@ public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, PjS
|
|
|
orderItemsShare.setBizType("GX");
|
|
|
orderItemsShare.setUrl(ObjectUtils.isNotNull(item.getFilesList()) && !item.getFilesList().isEmpty() ? item.getFilesList().get(0).getUrl() : "");
|
|
|
orderItemsShare.setGoodsName(item.getGoodsName());
|
|
|
- if (ObjectUtils.isNotNull(productLaunch)) {
|
|
|
+ if (ObjectUtils.isNull(productLaunch) || new BigDecimal("0.00").compareTo(productLaunch.getInventory()) == 0) {
|
|
|
+ orderItemsShare.setInventory(item.getInventory());
|
|
|
+ orderItemsShare.setGoodsNum(item.getGoodsNum());
|
|
|
+ orderItemsShare.setTotalAmount(orderItems.getGoodsNum().multiply(orderItems.getPrice()));
|
|
|
+ orderItemsListShare.add(orderItemsShare);
|
|
|
+ } else {
|
|
|
orderItems.setInventory(productLaunch.getInventory());
|
|
|
orderItems.setGoodsNum(productLaunch.getInventory());
|
|
|
orderItems.setTotalAmount(orderItems.getGoodsNum().multiply(orderItems.getPrice()));
|
|
|
@@ -1476,11 +1481,6 @@ public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, PjS
|
|
|
orderItemsShare.setGoodsNum(item.getGoodsNum().subtract(productLaunch.getInventory()));
|
|
|
orderItemsShare.setTotalAmount(orderItems.getGoodsNum().multiply(orderItems.getPrice()));
|
|
|
orderItemsListShare.add(orderItemsShare);
|
|
|
- } else {
|
|
|
- orderItemsShare.setInventory(item.getInventory());
|
|
|
- orderItemsShare.setGoodsNum(item.getGoodsNum());
|
|
|
- orderItemsShare.setTotalAmount(orderItems.getGoodsNum().multiply(orderItems.getPrice()));
|
|
|
- orderItemsListShare.add(orderItemsShare);
|
|
|
}
|
|
|
}
|
|
|
//生成完毕删除购物车
|
|
|
@@ -1556,7 +1556,7 @@ public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, PjS
|
|
|
corpsDesc.setLimitAmount(corpsDesc.getLimitAmount().subtract(totalMoney));
|
|
|
corpsDescService.updateById(corpsDesc);
|
|
|
}
|
|
|
- if (!orderItemsList.isEmpty()){
|
|
|
+ if (!orderItemsList.isEmpty()) {
|
|
|
//保存销售主表信息-本地销售单
|
|
|
PjOrder order = new PjOrder();
|
|
|
if (list.size() == 1) {//如果只有一个公司,订单编号和主编号一致
|