Просмотр исходного кода

1. 小程序信息采集帮助用户二次确认 2.优化推送ERP订单缺少barCode问题

wjj 1 месяц назад
Родитель
Сommit
a7cfc6f6b2

+ 32 - 0
fs-service/src/main/java/com/fs/erp/service/impl/JSTErpOrderServiceImpl.java

@@ -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");
+    }
 }
 

+ 12 - 0
fs-user-app/src/main/java/com/fs/app/controller/UserInfoCollectionController.java

@@ -7,6 +7,7 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.course.param.CollectionInfoConfirmParam;
 import com.fs.course.vo.FsUserInfoCollectionUVO;
+import com.fs.framework.security.SecurityUtils;
 import com.fs.his.domain.FsUser;
 import com.fs.his.domain.FsUserInformationCollectionSchedule;
 import com.fs.his.enums.PrescriptionTaskStepEnum;
@@ -159,4 +160,15 @@ public class UserInfoCollectionController extends AppBaseController {
         List<OptionsVO> list = fsPackageService.selectAllPrivatePackageList();
         return getDataTable(list);
     }
+
+    @PostMapping("/salesHelpConfirm")
+    public R salesHelpConfirm(@RequestBody FsUserInformationCollectionSchedule param){
+        if (param.getCollectionId() == null) {
+            return R.error("collectionId不能为空");
+        }
+        if (param.getCompanyUserId() == null) {
+            return R.error("companyUserId不能为空");
+        }
+        return userInformationCollectionService.salesHelpConfirm(param.getCollectionId(),param.getCompanyUserId());
+    }
 }