|
|
@@ -25,18 +25,23 @@ import com.fs.erp.service.TlErpOrderService;
|
|
|
import com.fs.his.domain.FsStoreOrder;
|
|
|
import com.fs.his.domain.FsStoreOrderItem;
|
|
|
import com.fs.his.domain.FsStoreProduct;
|
|
|
+import com.fs.his.domain.FsStoreProductAttrValue;
|
|
|
import com.fs.his.mapper.FsStoreAfterSalesMapper;
|
|
|
+import com.fs.his.mapper.FsStoreProductAttrValueMapper;
|
|
|
import com.fs.his.service.IFsStoreOrderItemService;
|
|
|
import com.fs.his.service.IFsStoreOrderService;
|
|
|
import com.fs.his.service.IFsStoreProductService;
|
|
|
import com.fs.hisStore.domain.FsStoreOrderItemScrm;
|
|
|
import com.fs.hisStore.domain.FsStoreOrderScrm;
|
|
|
+import com.fs.hisStore.domain.FsStoreProductAttrValueScrm;
|
|
|
import com.fs.hisStore.domain.FsStoreProductScrm;
|
|
|
+import com.fs.hisStore.mapper.FsStoreProductAttrValueScrmMapper;
|
|
|
import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
|
|
|
import com.fs.hisStore.service.IFsStoreOrderScrmService;
|
|
|
import com.fs.hisStore.service.IFsStoreProductScrmService;
|
|
|
import com.fs.hisStore.service.impl.FsStoreProductScrmServiceImpl;
|
|
|
import com.fs.hisStore.vo.FsStoreOrderItemVO;
|
|
|
+import com.fs.huifuPay.sdk.opps.core.utils.StringUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.ObjectUtils;
|
|
|
import org.apache.http.util.Asserts;
|
|
|
@@ -84,6 +89,12 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
|
|
|
@Autowired
|
|
|
private TlErpOrderService tlErpOrderService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FsStoreProductAttrValueScrmMapper fsStoreProductAttrValueScrmMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FsStoreProductAttrValueMapper fsStoreProductAttrValueMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public ErpOrderResponse addOrder(ErpOrder order) {
|
|
|
FsStoreOrder fsStoreOrder = fsStoreOrderService.selectFsStoreOrderByOrderCode(order.getPlatform_code());
|
|
|
@@ -135,6 +146,12 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
|
|
|
JSONObject jsonObject = JSON.parseObject(item.getJsonInfo());
|
|
|
|
|
|
String barCode = jsonObject.getString("barCode");
|
|
|
+ if (StringUtil.isEmpty(barCode)) {
|
|
|
+ List<FsStoreProductAttrValue> values = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(item.getProductId());
|
|
|
+ if (!CollectionUtils.isEmpty(values)) {
|
|
|
+ barCode = values.get(0).getBarCode();
|
|
|
+ }
|
|
|
+ }
|
|
|
String productName = jsonObject.getString("productName");
|
|
|
String sku=jsonObject.getString("sku");
|
|
|
|
|
|
@@ -280,6 +297,12 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
|
|
|
JSONObject jsonObject = JSON.parseObject(item.getJsonInfo());
|
|
|
|
|
|
String barCode = jsonObject.getString("barCode");
|
|
|
+ if (StringUtil.isEmpty(barCode)) {
|
|
|
+ List<FsStoreProductAttrValueScrm> fsStoreProductAttrValueScrms = fsStoreProductAttrValueScrmMapper.selectFsStoreProductAttrValueByProductId(item.getProductId());
|
|
|
+ if (!CollectionUtils.isEmpty(fsStoreProductAttrValueScrms)) {
|
|
|
+ barCode = fsStoreProductAttrValueScrms.get(0).getBarCode();
|
|
|
+ }
|
|
|
+ }
|
|
|
String productName = jsonObject.getString("productName");
|
|
|
String sku=jsonObject.getString("sku");
|
|
|
|
|
|
@@ -732,5 +755,14 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
|
|
|
log.info("API请求成功 - 结果: {}", JSON.toJSONString(result));
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String s = "{\"image\":\"https://ysy-1329817240.cos.ap-guangzhou.myqcloud.com/ysy/20250920/5d0b2bc5d7f946f1a9d3e6f8bda7d04f.jpg\",\"productId\":151,\"num\":1,\"productName\":\"甘油二酯食用油2瓶+运费38元\",\"price\":38}";
|
|
|
+ JSONObject jsonObject = JSON.parseObject(s);
|
|
|
+
|
|
|
+ String barCode = jsonObject.getString("barCode");
|
|
|
+ String productName = jsonObject.getString("productName");
|
|
|
+ String sku=jsonObject.getString("sku");
|
|
|
+ }
|
|
|
}
|
|
|
|