|
@@ -3,11 +3,15 @@ package com.fs.his.service.impl;
|
|
|
import cn.hutool.core.codec.Base64Decoder;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fs.erp.domain.ErpGoods;
|
|
|
+import com.fs.erp.dto.BaseResponse;
|
|
|
import com.fs.erp.dto.sdk.HzOMS.utils.HzOMSUtils;
|
|
|
+import com.fs.erp.service.IErpGoodsService;
|
|
|
import com.fs.his.config.FsSysConfig;
|
|
|
import com.fs.his.domain.FsStoreOrder;
|
|
|
import com.fs.his.domain.FsStoreProduct;
|
|
|
import com.fs.his.domain.FsStoreProductAttrValue;
|
|
|
+import com.fs.his.mapper.FsStoreProductMapper;
|
|
|
import com.fs.his.param.HzOMSErpApiParam;
|
|
|
import com.fs.his.service.ErpApiService;
|
|
|
import com.fs.his.service.IFsStoreOrderService;
|
|
@@ -18,6 +22,7 @@ import com.fs.his.vo.HzOMSErpResponseDetailVO;
|
|
|
import com.fs.his.vo.HzOMSErpResponseErrorItemVO;
|
|
|
import com.fs.his.vo.HzOMSErpResponseVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.Base64Utils;
|
|
|
|
|
@@ -90,6 +95,7 @@ public class HzOMSErpApiServiceImpl implements ErpApiService {
|
|
|
|
|
|
/**
|
|
|
* 用于将瀚智商品库存同步到第三方
|
|
|
+ *
|
|
|
* @param param
|
|
|
* @return
|
|
|
*/
|
|
@@ -235,4 +241,28 @@ public class HzOMSErpApiServiceImpl implements ErpApiService {
|
|
|
JSONArray arr = JSONArray.parseArray(new String(Base64Utils.decode(s.getBytes(StandardCharsets.UTF_8))));
|
|
|
return arr;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ FsStoreProductMapper fsStoreProductMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ @Qualifier("hzOMSErpGoodsServiceImpl")
|
|
|
+ IErpGoodsService hzGoodsService;
|
|
|
+ /**
|
|
|
+ * 同步药品信息到瀚智ERP
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void syncShop() {
|
|
|
+ //获取所有商品
|
|
|
+ List<FsStoreProduct> allProduct = fsStoreProductMapper.getAllProduct();
|
|
|
+ System.out.println("总共待推送商品数量:" + allProduct.size());
|
|
|
+ Integer i = 1;
|
|
|
+ for (FsStoreProduct fsStoreProduct : allProduct) {
|
|
|
+ ErpGoods p = new ErpGoods();
|
|
|
+ p.setStoreProductId(fsStoreProduct.getProductId());
|
|
|
+ hzGoodsService.addGoods(p);
|
|
|
+ System.out.println("当前同步第" + i++ + " 条数据,数据id:" + fsStoreProduct.getProductId());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|