浏览代码

feat: 限购数量

xdd 3 天之前
父节点
当前提交
f2569c0549

+ 2 - 2
deploy.sh

@@ -52,13 +52,13 @@ deploy_jar() {
 # 主要部署流程
 
 # 部署 fs-admin
-deploy_jar "$LOCAL_FS_ADMIN_JAR" "fs-admin"
+#deploy_jar "$LOCAL_FS_ADMIN_JAR" "fs-admin"
 
 # 部署 fs-company
 #deploy_jar "$LOCAL_FS_COMPANY_JAR" "fs-company"
 
 # 部署 fs-user-app
-#deploy_jar "$LOCAL_FS_USER_APP_JAR" "fs-user-app"
+deploy_jar "$LOCAL_FS_USER_APP_JAR" "fs-user-app"
 #deploy_jar "$LOCAL_FS_API_APP_JAR" "fs-api"
 
 echo "Deployment completed."

+ 1 - 1
fs-admin/src/main/resources/application-dev.yml

@@ -29,7 +29,7 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://172.16.0.31:3306/fs_ffhx_hospital?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://172.16.0.31:3306/fs_ffhx_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
                 password: Ylrz_1q2w3e4r5t6y
             # 从库数据源

+ 1 - 1
fs-api/src/main/resources/application-dev.yml

@@ -27,7 +27,7 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://172.16.0.31:3306/fs_ffhx_hospital?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://172.16.0.31:3306/fs_ffhx_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
                 password: Ylrz_1q2w3e4r5t6y
             # 从库数据源

+ 1 - 1
fs-company/src/main/resources/application-dev.yml

@@ -40,7 +40,7 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://172.16.0.31:3306/fs_ffhx_hospital?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://172.16.0.31:3306/fs_ffhx_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
                 password: Ylrz_1q2w3e4r5t6y
             # 从库数据源

+ 9 - 5
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreCartServiceImpl.java

@@ -23,6 +23,7 @@ import com.fs.store.param.FsStoreCartNumParam;
 import com.fs.store.param.FsStoreCartParam;
 import com.fs.store.vo.FsStoreCartVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import com.fs.store.domain.FsStoreCart;
 import com.fs.store.service.IFsStoreCartService;
@@ -45,7 +46,10 @@ public class FsStoreCartServiceImpl implements IFsStoreCartService
     @Autowired
     private FsStoreProductGroupMapper productGroupMapper;
     @Autowired
-    IErpGoodsService goodsService;
+    private IErpGoodsService goodsService;
+
+    @Value("${fsConfig.limitPurchaseNum}")
+    private Long limitPurchaseNum;
     /**
      * 查询购物车
      *
@@ -139,8 +143,8 @@ public class FsStoreCartServiceImpl implements IFsStoreCartService
             FsStoreProductAttrValue productAttrValue = valueMapper.selectFsStoreProductAttrValueById(storeCart.getProductAttrValueId());
 
                 if (StringUtils.isEmpty(productAttrValue.getGroupBarCode())) {
-                    if (cartParam.getCartNum() > 10) {
-                        return R.error("限购10个");
+                    if (cartParam.getCartNum() > limitPurchaseNum) {
+                        return R.error(String.format("限购%d个",limitPurchaseNum));
                     }
                 } else {
                     FsStoreProductGroup group=productGroupMapper.selectFsStoreProductGroupByBarCode(productAttrValue.getGroupBarCode());
@@ -151,8 +155,8 @@ public class FsStoreCartServiceImpl implements IFsStoreCartService
                         for (StoreProductGroupDTO productGroupDTO : productGroupDTOS) {
                             num += productGroupDTO.getCount() * cartParam.getCartNum();
                         }
-                        if (num > 10) {
-                            return R.error("限购10个");
+                        if (num > limitPurchaseNum) {
+                            return R.error(String.format("限购%d个",limitPurchaseNum));
                         }
                     } else {
                         return R.error("组合码错误");

+ 6 - 4
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreOrderServiceImpl.java

@@ -269,6 +269,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
     @Autowired
     private FsWarehousesMapper fsWarehousesMapper;
 
+    @Value("${fsConfig.limitPurchaseNum}")
+    private Long limitPurchaseNum;
 
     @Override
     public void syncExpressToWx() {
@@ -769,8 +771,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
 
                 if(param.getCompanyId()==null){
                     if(StringUtils.isEmpty(cart.getGroupBarCode())){
-                        if (cart.getCartNum()>10){
-                            return R.error("限购10个");
+                        if (cart.getCartNum()>limitPurchaseNum){
+                            return R.error(String.format("限购%d个",limitPurchaseNum));
                         }
                     }else {
                         FsStoreProductGroup group=storeProductGroupService.selectFsStoreProductGroupByBarCode(cart.getGroupBarCode());
@@ -781,8 +783,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                             for (StoreProductGroupDTO productGroupDTO : productGroupDTOS) {
                                num+= productGroupDTO.getCount()*cart.getCartNum();
                             }
-                            if (num>10){
-                                return R.error("限购10个");
+                            if (num>limitPurchaseNum){
+                                return R.error(String.format("限购%d个",limitPurchaseNum));
                             }
                         }else {
                             return R.error("组合码错误");

+ 2 - 0
fs-service-system/src/main/resources/application-config.yml

@@ -48,6 +48,8 @@ fsConfig:
 #  appId: 1661496555
 #  manuId: 0212af1e742b41b09089afeec98f8276
 #  callbackUrl: https://api.yjf.runtzh.com/app/prescribe/presribeNotify
+  # 限购数量
+  limitPurchaseNum: 10000
 
 # 聚水潭API配置
 jst: