|
@@ -8,6 +8,7 @@ import com.qs.mp.admin.domain.param.ChannelGoodsOrderQueryParam;
|
|
import com.qs.mp.admin.domain.param.ChannelGoodsOrderShipParam;
|
|
import com.qs.mp.admin.domain.param.ChannelGoodsOrderShipParam;
|
|
import com.qs.mp.admin.service.IGoodsService;
|
|
import com.qs.mp.admin.service.IGoodsService;
|
|
import com.qs.mp.channel.domain.Channel;
|
|
import com.qs.mp.channel.domain.Channel;
|
|
|
|
+import com.qs.mp.channel.domain.ChannelGoods;
|
|
import com.qs.mp.channel.domain.ChannelGoodsOrder;
|
|
import com.qs.mp.channel.domain.ChannelGoodsOrder;
|
|
import com.qs.mp.channel.domain.ChannelGoodsOrderItem;
|
|
import com.qs.mp.channel.domain.ChannelGoodsOrderItem;
|
|
import com.qs.mp.channel.domain.excel.ChannelGoodsOrderExcel;
|
|
import com.qs.mp.channel.domain.excel.ChannelGoodsOrderExcel;
|
|
@@ -16,6 +17,7 @@ import com.qs.mp.channel.domain.vo.ChannelGoodsOrderItemVO;
|
|
import com.qs.mp.channel.domain.vo.ChannelGoodsOrderVO;
|
|
import com.qs.mp.channel.domain.vo.ChannelGoodsOrderVO;
|
|
import com.qs.mp.channel.service.IChannelGoodsOrderItemService;
|
|
import com.qs.mp.channel.service.IChannelGoodsOrderItemService;
|
|
import com.qs.mp.channel.service.IChannelGoodsOrderService;
|
|
import com.qs.mp.channel.service.IChannelGoodsOrderService;
|
|
|
|
+import com.qs.mp.channel.service.IChannelGoodsService;
|
|
import com.qs.mp.channel.service.IChannelService;
|
|
import com.qs.mp.channel.service.IChannelService;
|
|
import com.qs.mp.common.annotation.Log;
|
|
import com.qs.mp.common.annotation.Log;
|
|
import com.qs.mp.common.core.domain.AjaxResult;
|
|
import com.qs.mp.common.core.domain.AjaxResult;
|
|
@@ -71,6 +73,9 @@ public class ChannelGoodsOrderMgrController extends BaseApiController {
|
|
@Autowired
|
|
@Autowired
|
|
private IDeliveryCompanyService deliveryCompanyService;
|
|
private IDeliveryCompanyService deliveryCompanyService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IChannelGoodsService channelGoodsService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private MapperFacade mapperFacade;
|
|
private MapperFacade mapperFacade;
|
|
|
|
|
|
@@ -178,6 +183,30 @@ public class ChannelGoodsOrderMgrController extends BaseApiController {
|
|
.set(ChannelGoodsOrder::getStatus, ChannelGoodsOrderStatusEnum.FINISHED)
|
|
.set(ChannelGoodsOrder::getStatus, ChannelGoodsOrderStatusEnum.FINISHED)
|
|
.eq(ChannelGoodsOrder::getOrderId, shipParam.getOrderId()));
|
|
.eq(ChannelGoodsOrder::getOrderId, shipParam.getOrderId()));
|
|
|
|
|
|
|
|
+ // 商品自动入库
|
|
|
|
+ List<ChannelGoodsOrderItem> items = channelGoodsOrderItemService.list(new QueryWrapper<ChannelGoodsOrderItem>().eq("order_id", order.getOrderId()));
|
|
|
|
+ List<ChannelGoods> goodsList = new ArrayList<>();
|
|
|
|
+ for (ChannelGoodsOrderItem item : items) {
|
|
|
|
+ Goods goods = goodsService.getById(item.getGoodsId());
|
|
|
|
+ ChannelGoods channelGoods = new ChannelGoods();
|
|
|
|
+ channelGoods.setChannelId(item.getChannelId());
|
|
|
|
+ channelGoods.setGoodsId(item.getGoodsId());
|
|
|
|
+ channelGoods.setOrderId(item.getOrderId());
|
|
|
|
+ channelGoods.setSkuId(item.getSkuId());
|
|
|
|
+ channelGoods.setProperties(item.getProperties());
|
|
|
|
+ channelGoods.setTitle(item.getTitle());
|
|
|
|
+ channelGoods.setPicUrl(item.getPicUrl());
|
|
|
|
+ channelGoods.setStatus(ChannelGoodsSettleStatusTypeEnum.NO);
|
|
|
|
+ channelGoods.setRefId(goods.getRefId());
|
|
|
|
+ channelGoods.setSupplierId(item.getSupplierId());
|
|
|
|
+ channelGoods.setQuantity(item.getGoodsNum());
|
|
|
|
+ channelGoods.setRemainQty(item.getGoodsNum());
|
|
|
|
+ channelGoods.setPurchasePrice(item.getPurchasePrice());
|
|
|
|
+ channelGoods.setPurchaseCost(item.getPurchaseCost());
|
|
|
|
+ goodsList.add(channelGoods);
|
|
|
|
+ }
|
|
|
|
+ channelGoodsService.saveBatch(goodsList);
|
|
|
|
+
|
|
} else if (DeliverTypeEnum.DELIVER.getValue().equals(deliveryType)) {
|
|
} else if (DeliverTypeEnum.DELIVER.getValue().equals(deliveryType)) {
|
|
// 快递发货,原逻辑
|
|
// 快递发货,原逻辑
|
|
rtn = channelGoodsOrderService.update(new LambdaUpdateWrapper<ChannelGoodsOrder>()
|
|
rtn = channelGoodsOrderService.update(new LambdaUpdateWrapper<ChannelGoodsOrder>()
|