浏览代码

配置文件,新增配置文件是否同步集采商城

ms-blue 1 月之前
父节点
当前提交
39ebcef6ab

+ 9 - 0
src/main/java/com/jsh/erp/service/SyncTescoSystemService.java

@@ -60,6 +60,9 @@ public class SyncTescoSystemService {
     @Resource
     private MaterialCurrentStockMapperEx materialCurrentStockMapperEx;
 
+    @Value("${tesco.openSycn}")
+    private boolean openSycn;
+    
     @Value("${tesco.sycnErpMaterialStockUrl}")
     private String sycnErpMaterialStockUrl;
 
@@ -195,6 +198,9 @@ public class SyncTescoSystemService {
     }
 
     public String sycnTescoStock(List<Long> mIdList) {
+        if (!openSycn) {
+            return "tesco系统同步未开启";
+        }
         List<MaterialCurrentStock4SystemSku> stockList = materialCurrentStockMapperEx.getCurrentStockMapByMdIdList(mIdList);
         if (!CollectionUtils.isEmpty(stockList)) {
             try {
@@ -249,6 +255,9 @@ public class SyncTescoSystemService {
     }
 
     public String sycnTescoSalePrice(List<Long> mIdList) {
+        if (!openSycn) {
+            return "tesco系统同步未开启";
+        }
         try {
             List<MaterialCurrentStock4SystemSku> mList = materialService.getMaterialCurrentPriceByIdList(mIdList);
             if (!CollectionUtils.isEmpty(mList)) {

+ 2 - 1
src/main/resources/application-dev.yml

@@ -31,5 +31,6 @@ aliyun:
     miniProgramAppId: wxd716cb744e32271a
     linkUrl: https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com
 tesco:
+  openSycn: false
   sycnErpMaterialStockUrl: http://localhost:8088/no-auth/erp/sync-stock
-  sycnErpMaterialPriceUrl: http://localhost:8088/no-auth/erp/sync-saleprice
+  sycnErpMaterialPriceUrl: http://localhost:8088/no-auth/erp/sync-saleprice

+ 1 - 0
src/main/resources/application-pro.yml

@@ -32,5 +32,6 @@ aliyun:
     linkUrl: https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com
 
 tesco:
+  openSycn: true
   sycnErpMaterialStockUrl: https://tesco.xianglitech.com.cn/prod-api/no-auth/erp/sync-stock
   sycnErpMaterialPriceUrl: https://tesco.xianglitech.com.cn/prod-api/no-auth/erp/sync-saleprice

+ 1 - 0
src/main/resources/application-test.yml

@@ -32,5 +32,6 @@ aliyun:
     linkUrl: https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com
 
 tesco:
+  openSycn: false
   sycnErpMaterialStockUrl: https://test.xianglitech.com.cn/stage-api/no-auth/erp/sync-stock
   sycnErpMaterialPriceUrl: https://test.xianglitech.com.cn/stage-api/no-auth/erp/sync-saleprice