Parcourir la source

修改多个问题

yousongbo il y a 4 semaines
Parent
commit
5f51b8f3e7

+ 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");