|
|
@@ -37,7 +37,7 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AlertConfiguration selectAlertConfigurationByAlertStatus(String orgCode) {
|
|
|
+ public AlertConfiguration selectAlertConfigurationByAlertStatus(List<String> userTypeList,String orgCode) {
|
|
|
//查询有效弹窗
|
|
|
List<AlertConfiguration> alertConfigurationList = alertConfigurationMapper.selectAlertConfigurationByAlertStatus();
|
|
|
if(alertConfigurationList !=null && alertConfigurationList.size()> 0 ){
|
|
|
@@ -47,12 +47,26 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
|
|
|
AlertConfiguration alert = it.next();
|
|
|
//diy
|
|
|
if( alert.getOrgCode() ==null || ("null").equals(alert.getOrgCode())){
|
|
|
- return alert;
|
|
|
+ for (String userType:userTypeList){
|
|
|
+ String [] userTypes = userType.split(",");
|
|
|
+ boolean exists = Arrays.stream(userTypes)
|
|
|
+ .anyMatch(str -> str.equals(userType));
|
|
|
+ if (exists){
|
|
|
+ return alert;
|
|
|
+ }
|
|
|
+ }
|
|
|
}else {
|
|
|
List<String> orgCodes = alertConfigurationMapper.selectOrgCodeByInterface(alert.getSalesLevel(),alert.getOrgCode());
|
|
|
if(orgCodes !=null && orgCodes.size()>0){
|
|
|
if(orgCodes.contains(orgCode)){
|
|
|
- return alert;
|
|
|
+ for (String userType:userTypeList){
|
|
|
+ String [] userTypes = userType.split(",");
|
|
|
+ boolean exists = Arrays.stream(userTypes)
|
|
|
+ .anyMatch(str -> str.equals(userType));
|
|
|
+ if (exists){
|
|
|
+ return alert;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -62,7 +76,7 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AlertConfiguration selectAlertConfiguration() {
|
|
|
+ public AlertConfiguration selectAlertConfiguration(List<String> userTypeList) {
|
|
|
//查询有效弹窗
|
|
|
List<AlertConfiguration> alertConfigurationList = alertConfigurationMapper.selectAlertConfigurationByAlertStatus();
|
|
|
if(alertConfigurationList !=null && alertConfigurationList.size()> 0 ){
|
|
|
@@ -72,7 +86,14 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
|
|
|
AlertConfiguration alert = it.next();
|
|
|
//diy
|
|
|
if( alert.getOrgCode() ==null || ("null").equals(alert.getOrgCode())){
|
|
|
- return alert;
|
|
|
+ for (String userType:userTypeList){
|
|
|
+ String [] userTypes = userType.split(",");
|
|
|
+ boolean exists = Arrays.stream(userTypes)
|
|
|
+ .anyMatch(str -> str.equals(userType));
|
|
|
+ if (exists){
|
|
|
+ return alert;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|