|
@@ -5,6 +5,7 @@ import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.fs.common.exception.ServiceException;
|
|
|
+import com.fs.common.utils.CloudHostUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.erp.domain.*;
|
|
|
import com.fs.erp.dto.*;
|
|
@@ -20,6 +21,7 @@ import com.fs.hisStore.dto.FsStoreCartDTO;
|
|
|
import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
|
|
|
import com.fs.hisStore.mapper.FsStoreProductScrmMapper;
|
|
|
import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
|
|
|
+import com.fs.hisStore.vo.FsStoreOrderItemVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -336,13 +338,27 @@ public class K9OrderScrmServiceImpl implements IErpOrderService {
|
|
|
|
|
|
private List<KingbosOrderD1Data> buildOrderDetailData(FsStoreOrderScrm order, String orderId) {
|
|
|
logger.debug("【金博网络订单】开始构建订单明细,订单号: {}", order.getOrderCode());
|
|
|
- FsStoreOrderItemScrm query = new FsStoreOrderItemScrm();
|
|
|
- query.setOrderId(order.getId());
|
|
|
- List<FsStoreOrderItemScrm> orderItems = storeOrderItemService.selectFsStoreOrderItemList(query);
|
|
|
+// FsStoreOrderItemScrm query = new FsStoreOrderItemScrm();
|
|
|
+// query.setOrderId(order.getId());
|
|
|
+// List<FsStoreOrderItemScrm> orderItems = storeOrderItemService.selectFsStoreOrderItemList(query);
|
|
|
+
|
|
|
+// List<KingbosOrderD1Data> d1Datas = orderItems.stream()
|
|
|
+// .map(item -> buildOrderDetailItem(item, orderId))
|
|
|
+// .collect(Collectors.toList());
|
|
|
+
|
|
|
+
|
|
|
+ List<FsStoreOrderItemVO> orderItems = storeOrderItemService.selectFsStoreOrderItemListAndProductByOrderId(order.getId());
|
|
|
+ //2025.09.19 中康需求只推非药品
|
|
|
+ List<KingbosOrderD1Data> d1Datas = orderItems.stream().filter(item->{
|
|
|
+ if (CloudHostUtils.hasCloudHostName("中康")){
|
|
|
+ return item.getIsDrug() == null || item.getIsDrug() == 1;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .map(item -> buildOrderDetailItem(item, orderId))
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
|
- List<KingbosOrderD1Data> d1Datas = orderItems.stream()
|
|
|
- .map(item -> buildOrderDetailItem(item, orderId))
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
logger.debug("【金博网络订单】订单明细构建完成,订单号: {}, 明细数量: {}", order.getOrderCode(), d1Datas.size());
|
|
|
return d1Datas;
|
|
@@ -355,7 +371,7 @@ public class K9OrderScrmServiceImpl implements IErpOrderService {
|
|
|
return item;
|
|
|
}
|
|
|
|
|
|
- private KingbosOrderD1Data buildOrderDetailItem(FsStoreOrderItemScrm orderItem, String orderId) {
|
|
|
+ private KingbosOrderD1Data buildOrderDetailItem(FsStoreOrderItemVO orderItem, String orderId) {
|
|
|
FsStoreCartDTO cartDTO = JSONUtil.toBean(orderItem.getJsonInfo(), FsStoreCartDTO.class);
|
|
|
BigDecimal quantity = new BigDecimal(orderItem.getNum());
|
|
|
|