Sfoglia il codice sorgente

Merge branch 'div-20251104' of http://git.dgtis.com/qxp/suishenbang-oneportal into div-20251104

yanym 3 settimane fa
parent
commit
36c0b95cb2

+ 11 - 8
suishenbang-admin/src/main/java/com/dgtly/web/controller/system/AlertConfigurationController.java

@@ -1,12 +1,11 @@
 package com.dgtly.web.controller.system;
 
-import java.util.ArrayList;
-import java.util.HashMap;
+
 import java.util.List;
-import java.util.Map;
 
+import com.alibaba.fastjson2.JSON;
 import com.dgtly.common.utils.StringUtils;
-import com.dgtly.system.domain.OrderSalesParameter;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -27,6 +26,7 @@ import com.dgtly.common.core.page.TableDataInfo;
  * @author chenyn
  * @date 2023-06-13
  */
+@Slf4j
 @Controller
 @RequestMapping("/system/configuration")
 public class AlertConfigurationController extends BaseController
@@ -88,17 +88,17 @@ public class AlertConfigurationController extends BaseController
     @ResponseBody
     public AjaxResult addSave(AlertConfiguration alertConfiguration)
     {
-      /*  int num = alertConfigurationService.selectAlertConfigurationListFilter(alertConfiguration);
-        if ( num==1){
-            return error("弹幕通知只能有一个该组织下启动,请先关闭该组织下已启动的后重新添加");
-        }*/
+        log.info("11111111111{}", JSON.toJSON(alertConfiguration));
         //如果userType为空,则添加所有人通知
         if (StringUtils.isEmpty(alertConfiguration.getUserType())){
             alertConfiguration.setUserType("2");
         }
+        log.info("3333333333{}", JSON.toJSON(alertConfiguration));
         return toAjax(alertConfigurationService.insertAlertConfiguration(alertConfiguration));
     }
 
+
+
     /**
      * 修改弹框配置
      */
@@ -118,6 +118,9 @@ public class AlertConfigurationController extends BaseController
     @ResponseBody
     public AjaxResult editSave(AlertConfiguration alertConfiguration)
     {
+
+        log.info("新增弹框配置");
+        log.info("222222222{}", JSON.toJSON(alertConfiguration));
         //如果userType为空,则添加所有人通知
         if (StringUtils.isEmpty(alertConfiguration.getUserType())){
             alertConfiguration.setUserType("2");

+ 2 - 2
suishenbang-admin/src/main/resources/application-uat.yml

@@ -9,8 +9,8 @@ ruoyi:
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-#  profile: /home/admin/project/file
-  profile: D:/ruoyi/uploadPath
+  profile: /home/admin/project/file
+#  profile: D:/ruoyi/uploadPath
   # 获取ip地址开关
   addressEnabled: false
   cloudPath: http://127.0.0.1:8000/

+ 1 - 1
suishenbang-system/src/main/java/com/dgtly/system/mapper/SysUserShopExtMapper.java

@@ -19,7 +19,7 @@ public interface SysUserShopExtMapper
      * @param userId 门店人员信息扩展ID
      * @return 门店人员信息扩展
      */
-    public SysUserShopExt selectSysUserShopExtById(String userId);
+    public List<SysUserShopExt> selectSysUserShopExtById(String userId);
 
     /**
      * 查询门店人员信息扩展列表

+ 1 - 1
suishenbang-system/src/main/java/com/dgtly/system/service/IAlertConfigurationService.java

@@ -20,7 +20,7 @@ public interface IAlertConfigurationService
      */
     public AlertConfiguration selectAlertConfigurationById(Long alertId);
 
-    public AlertConfiguration selectAlertConfigurationByAlertStatus(List<String> userTypeList ,String salesLevel,String orgCode);
+    public AlertConfiguration selectAlertConfigurationByAlertStatus(String salesLevel,String orgCode);
 
     /**
      * 查询弹框配置列表

+ 1 - 1
suishenbang-system/src/main/java/com/dgtly/system/service/ISysUserShopExtService.java

@@ -17,7 +17,7 @@ public interface ISysUserShopExtService
      * @param userId 门店人员信息扩展ID
      * @return 门店人员信息扩展
      */
-    public SysUserShopExt selectSysUserShopExtById(String userId);
+    public List<SysUserShopExt>  selectSysUserShopExtById(String userId);
 
     /**
      * 查询门店人员信息扩展列表

+ 1 - 1
suishenbang-system/src/main/java/com/dgtly/system/service/impl/AlertConfigurationServiceImpl.java

@@ -37,7 +37,7 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
     }
 
     @Override
-    public AlertConfiguration selectAlertConfigurationByAlertStatus(List<String> userTypeList,String salesLevel,String orgCode) {
+    public AlertConfiguration selectAlertConfigurationByAlertStatus(String salesLevel,String orgCode) {
         //查询有效弹窗
         List<AlertConfiguration> alertConfigurationList = alertConfigurationMapper.selectAlertConfigurationByAlertStatus();
         if(alertConfigurationList !=null && alertConfigurationList.size()> 0 ){

+ 1 - 1
suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysUserShopExtServiceImpl.java

@@ -28,7 +28,7 @@ public class SysUserShopExtServiceImpl implements ISysUserShopExtService
      * @return 门店人员信息扩展
      */
     @Override
-    public SysUserShopExt selectSysUserShopExtById(String userId)
+    public List<SysUserShopExt>  selectSysUserShopExtById(String userId)
     {
         return sysUserShopExtMapper.selectSysUserShopExtById(userId);
     }

+ 9 - 11
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxAlertLogController.java

@@ -58,22 +58,20 @@ public class WxAlertLogController  extends ApiBaseController {
         SysUserExt sysUserExt = sysUserExtService.selectSysUserExtById(userId);
         String salesLevel = sysUserExt.getSalesLevel();
         List<String> userTypeList = new ArrayList<>();
-        SysUserShopExt sysUserShopExt = sysUserShopExtService.selectSysUserShopExtById(obj.getString("userId"));
+        List<SysUserShopExt>  sysUserShopExt = sysUserShopExtService.selectSysUserShopExtById(obj.getString("userId"));
+        Set<String> userTypeSet = new HashSet<>();
+        for (SysUserShopExt shopExt : sysUserShopExt){
+            userTypeSet.add(shopExt.getIsShopType());
+        }
+
         if(("customer_level").equals(salesLevel)||("reseller_level").equals(salesLevel) ){
             userTypeList.add("1");
         }else{
             userTypeList.add("0");
         }
-        if (sysUserShopExt != null){
-            if ("0".equals(sysUserShopExt.getIsShopType())){
-                userTypeList.add("3");
-            }else {
-                userTypeList.add("4");
-            }
-        }
 
         //是否有启动弹窗
-        AlertConfiguration alertConfiguration1 = alertConfigurationService.selectAlertConfigurationByAlertStatus(userTypeList,sysUserExt.getSalesLevel(),sysUserExt.getOrgCode());
+        AlertConfiguration alertConfiguration1 = alertConfigurationService.selectAlertConfigurationByAlertStatus(sysUserExt.getSalesLevel(),sysUserExt.getOrgCode());
 
         if (alertConfiguration1!=null){
             //有启动
@@ -120,7 +118,7 @@ public class WxAlertLogController  extends ApiBaseController {
 
                 //判断该用户是否为金牌店或仿石漆
                 if (sysUserShopExt != null){
-                    if((strings.contains("3") || strings.contains("2")) && "0".equals(sysUserShopExt.getIsShopType())){
+                    if((strings.contains("3") || strings.contains("2")) && userTypeSet.contains("0")){
                         AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
                         if (alertLog!=null){
                             if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){
@@ -134,7 +132,7 @@ public class WxAlertLogController  extends ApiBaseController {
                             return AjaxResult.success(alertConfiguration1);
                         }
                     }
-                    if((strings.contains("4") || strings.contains("2")) && "1".equals(sysUserShopExt.getIsShopType())){
+                    if((strings.contains("4") || strings.contains("2")) && userTypeSet.contains("1")){
                         AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
                         if (alertLog!=null){
                             if (alertLog.getAlertNum()<alertConfiguration1.getAlertNum()){

+ 7 - 3
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxPortalController.java

@@ -130,9 +130,13 @@ public class WxPortalController extends ApiBaseController {
         }else{
             userTypeList.add("0");
         }
-        SysUserShopExt sysUserShopExt = sysUserShopExtService.selectSysUserShopExtById(obj.getString("userId"));
-        if (sysUserShopExt != null){
-            if ("0".equals(sysUserShopExt.getIsShopType())){
+        List<SysUserShopExt>  sysUserShopExt = sysUserShopExtService.selectSysUserShopExtById(obj.getString("userId"));
+        Set<String> userTypeSet = new HashSet<>();
+        for (SysUserShopExt shopExt : sysUserShopExt){
+            userTypeSet.add(shopExt.getIsShopType());
+        }
+        for (String userType : userTypeSet){
+            if ("0".equals(userType)){
                 userTypeList.add("2");
             }else {
                 userTypeList.add("3");