|
@@ -1,5 +1,6 @@
|
|
|
package com.dgtly.system.service.impl;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
import com.dgtly.common.utils.DateUtils;
|
|
@@ -73,24 +74,41 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
|
|
|
|
|
|
@Override
|
|
|
public int selectAlertConfigurationListFilter(AlertConfiguration alertConfiguration) {
|
|
|
+ Date start1 = alertConfiguration.getAlertStartTime();
|
|
|
+ Date end1 = alertConfiguration.getAlertEndTime();
|
|
|
List<AlertConfiguration> alertConfigurationList= alertConfigurationMapper.selectAlertConfigurationListFilter(alertConfiguration);
|
|
|
if(alertConfigurationList !=null && alertConfigurationList.size()>0){
|
|
|
Iterator<AlertConfiguration> it = alertConfigurationList.iterator();
|
|
|
List<String> orgCodes =new ArrayList<>();
|
|
|
if(alertConfiguration.getOrgCode() !=null && !("null").equals(alertConfiguration.getOrgCode() ) ) {
|
|
|
orgCodes = alertConfigurationMapper.selectOrgCode(alertConfiguration.getSalesLevel(), alertConfiguration.getOrgCode());
|
|
|
- }else{
|
|
|
- //diy
|
|
|
- return 1;
|
|
|
}
|
|
|
while (it.hasNext()) {
|
|
|
AlertConfiguration alert = it.next();
|
|
|
if(orgCodes !=null && orgCodes.size()>0 && alert.getOrgCode() !=null && !("null").equals(alert.getOrgCode())){
|
|
|
if(orgCodes.contains(alert.getOrgCode())){
|
|
|
- return 1;
|
|
|
+ Date start2 = alert.getAlertStartTime();
|
|
|
+ Date end2 = alert.getAlertEndTime();
|
|
|
+ if ((start1.after(start2) && start1.before(end2)) ||
|
|
|
+ (end1.after(start2) && end1.before(end2)) ||
|
|
|
+ (start2.after(start1) && start2.before(end1)) ||
|
|
|
+ (end2.after(start1) && end2.before(end1))) {
|
|
|
+ return 1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
}
|
|
|
}else{
|
|
|
- return 1;
|
|
|
+ Date start2 = alert.getAlertStartTime();
|
|
|
+ Date end2 = alert.getAlertEndTime();
|
|
|
+ if ((start1.after(start2) && start1.before(end2)) ||
|
|
|
+ (end1.after(start2) && end1.before(end2)) ||
|
|
|
+ (start2.after(start1) && start2.before(end1)) ||
|
|
|
+ (end2.after(start1) && end2.before(end1))) {
|
|
|
+ return 1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}else{
|