|
@@ -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);
|
|
|
-
|
|
|
if(alertConfigurationList !=null && alertConfigurationList.size()> 0 ){
|
|
|
-
|
|
|
+
|
|
|
Iterator<AlertConfiguration> it = alertConfigurationList.iterator();
|
|
|
while (it.hasNext()) {
|
|
|
AlertConfiguration alert = it.next();
|
|
|
|
|
|
- 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;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return null;
|