Browse Source

多店铺区分

ct 3 weeks ago
parent
commit
62ef0870f5

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreCartScrmMapper.java

@@ -73,7 +73,9 @@ public interface FsStoreCartScrmMapper
             "v.price,v.sku as product_attr_name,v.image as product_attr_image,v.stock " +
             "from fs_store_cart_scrm c " +
             "inner join fs_store_product_scrm p on p.product_id=c.product_id " +
+            "<if test='config.isStores == \"1\"'>" +
             "inner join fs_store_scrm fs on fs.store_id = p.store_id " +
+            "</if>" +
             "<if test='config.isAudit == \"1\"'>" +
             "and fs.is_audit = 1 " +
             "</if>" +

+ 13 - 9
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreAfterSalesScrmServiceImpl.java

@@ -11,6 +11,7 @@ import com.fs.common.annotation.DataScope;
 import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.CustomException;
+import com.fs.common.utils.CloudHostUtils;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.service.ICompanyService;
@@ -275,7 +276,8 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
             return R.error("未支付订单不能申请售后");
         }
         if("1".equals(configUtil.generateConfigByKey(SysConfigEnum.HIS_CONFIG.getKey()).getString("erpOpen"))
-                && StringUtils.isEmpty(order.getExtendOrderId())){
+                && StringUtils.isEmpty(order.getExtendOrderId())
+                && !CloudHostUtils.hasCloudHostName("康年堂")){
             logger.info("erpOpen:{}",configUtil.generateConfigByKey(SysConfigEnum.HIS_CONFIG.getKey()).getString("erpOpen"));
             return R.error("仓库未生成订单,暂时不能申请退款,请联系客服");
         }
@@ -389,15 +391,17 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
         request.setOid(order.getOrderCode());
         request.setRefund_state(1);
         request.setStoreAfterSalesId(storeAfterSales.getId());
-        BaseResponse response=erpOrderService.refundUpdateScrm(request);
-        if(response.getSuccess()){
-            return R.ok();
-        }
-        else{
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            return R.error(response.getErrorDesc());
+        if (StringUtils.isNotBlank(order.getExtendOrderId())){
+            BaseResponse response=erpOrderService.refundUpdateScrm(request);
+            if(response.getSuccess()){
+                return R.ok();
+            }
+            else{
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return R.error(response.getErrorDesc());
+            }
         }
-
+        return R.ok();
     }
 
     private IErpOrderService getErpService() {

+ 11 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -22,6 +22,7 @@ import com.fs.common.event.TemplateEvent;
 import com.fs.common.event.TemplateListenEnum;
 import com.fs.common.exception.CustomException;
 import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.CloudHostUtils;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.Company;
@@ -1999,7 +2000,10 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         if (order.getStatus() != 1 && order.getStatus() != 2) {
             return R.error("非法操作");
         }
-        if (erpConfig.getErpOpen() != null && erpConfig.getErpOpen() == 1 && order.getExtendOrderId() == null) {
+        if (erpConfig.getErpOpen() != null
+                && erpConfig.getErpOpen() == 1
+                && order.getExtendOrderId() == null
+                && !CloudHostUtils.hasCloudHostName("康年堂")) {
             return R.error("暂未推送至erp,请稍后再试!");
         }
         if (StringUtils.isNotEmpty(order.getExtendOrderId())) {
@@ -2057,7 +2061,12 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             //将钱退还给用户
             List<FsStorePaymentScrm> payments = paymentService.selectFsStorePaymentByOrderId(order.getId());
             if (payments != null) {
-                String json = configService.selectConfigByKey("store.pay");
+                String json;
+                if (CloudHostUtils.hasCloudHostName("康年堂")) {
+                    json = configService.selectConfigByKey("his.pay");
+                } else {
+                    json = configService.selectConfigByKey("store.pay");
+                }
                 FsPayConfigScrm fsPayConfig = JSON.parseObject(json, FsPayConfigScrm.class);
                 for (FsStorePaymentScrm payment : payments) {
                     if (payment.getPayMode() == null || payment.getPayMode().equals("wx")) {

+ 3 - 1
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -435,7 +435,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM fs_store_product_scrm fsp
         left join (select GROUP_CONCAT(distinct fsp1.store_id SEPARATOR ',' ) AS storeIds,fsp1.product_name
         from  fs_store_product_scrm fsp1 group by fsp1.product_name) p1 on p1.product_name = fsp.product_name
-        inner join fs_store_scrm fs on fs.store_id = fsp.store_id
+        <if test='config.isStores == "1" '>
+            inner join fs_store_scrm fs on fs.store_id = fsp.store_id
+        </if>
         <if test='config.isAudit == "1" '>
         and fs.is_audit = '1'
         </if>