Browse Source

【修改】修改弹框权限设置

lichen 3 months ago
parent
commit
cfedd7a15d

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

@@ -4,6 +4,7 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 
 import com.dgtly.common.utils.DateUtils;
+import com.dgtly.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.dgtly.system.mapper.AlertConfigurationMapper;
@@ -38,25 +39,34 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
     @Override
     public AlertConfiguration selectAlertConfigurationByAlertStatus(String userType,String salesLevel,String orgCode) {
         List<AlertConfiguration> alertConfigurationList = alertConfigurationMapper.selectAlertConfigurationByAlertStatus(userType);
-        // todo
         if(alertConfigurationList !=null && alertConfigurationList.size()> 0 ){
-            // todo 通知类型
+            //判断弹框的组织 如果弹框有组织 对比该组织与员工的组织是否一致
             Iterator<AlertConfiguration> it = alertConfigurationList.iterator();
             while (it.hasNext()) {
                 AlertConfiguration alert = it.next();
                 //diy
-                if(orgCode ==null || ("").equals(orgCode)){
-                    if( alert.getOrgCode() ==null || ("null").equals(alert.getOrgCode())){
-                        return alert;
-                    }
-                }else{
+                if(StringUtils.isNotEmpty(alert.getOrgCode())){
                     List<String>  orgCodes = alertConfigurationMapper.selectOrgCodeByInterface(alert.getSalesLevel(),alert.getOrgCode());
                     if(orgCodes !=null && orgCodes.size()>0){
                         if(orgCodes.contains(orgCode)){
                             return alert;
                         }
                     }
+                }else {
+                    return alert;
                 }
+//                if(orgCode ==null || ("").equals(orgCode)){
+//                    if( alert.getOrgCode() ==null || ("null").equals(alert.getOrgCode())){
+//                        return alert;
+//                    }
+//                }else{
+//                    List<String>  orgCodes = alertConfigurationMapper.selectOrgCodeByInterface(alert.getSalesLevel(),alert.getOrgCode());
+//                    if(orgCodes !=null && orgCodes.size()>0){
+//                        if(orgCodes.contains(orgCode)){
+//                            return alert;
+//                        }
+//                    }
+//                }
             }
         }
         return  null;