| 
					
				 | 
			
			
				@@ -1,7 +1,5 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.xunmei.core.access.service.impl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.baomidou.mybatisplus.core.conditions.Wrapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.core.toolkit.IdWorker; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -27,10 +25,8 @@ import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import javax.annotation.Resource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.ArrayList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.Collection; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.Map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.function.Function; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * 监控调阅计划Service业务层处理 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -41,8 +37,8 @@ import java.util.function.Function; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Lazy 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Service 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoringRetrievalPlanMapper, TMonitoringRetrievalPlan> implements ITMonitoringRetrievalPlanService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private static final Long MINUS_ONE = -1L; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private static final Long ZERO = 0L; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private static final Integer MINUS_ONE = -1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private static final Integer ZERO = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private TMonitoringRetrievalPlanMapper tMonitoringRetrievalPlanMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -58,7 +54,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public TableDataInfo<TMonitoringRetrievalPlan> selectPage(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //未删除 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        tMonitoringRetrievalPlan.setIsDeleted(ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tMonitoringRetrievalPlan.setIsDeleted(ZERO.longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Page<TMonitoringRetrievalPlan> page; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //分页 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (tMonitoringRetrievalPlan.getPageNum() != null && tMonitoringRetrievalPlan.getPageSize() != null) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -73,7 +69,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         QueryWrapper<TMonitoringRetrievalPlan> query = new QueryWrapper<>(tMonitoringRetrievalPlan); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //下穿 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         tMonitoringRetrievalPlan.setCheckSub(true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<SysOrg> data = remoteOrgService.selectSysOrgByParentId(MINUS_ONE, SecurityConstants.INNER); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<SysOrg> data = remoteOrgService.selectSysOrgByParentId(MINUS_ONE.longValue(), SecurityConstants.INNER); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (null == tMonitoringRetrievalPlan.getOrgId()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             tMonitoringRetrievalPlan.setOrgId(data.get(0).getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -117,10 +113,10 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public int distribute(Long id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //查询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         TMonitoringRetrievalPlan tMonitoringRetrievalPlan = tMonitoringRetrievalPlanMapper.selectById(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        tMonitoringRetrievalPlan.setPlanStatus(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tMonitoringRetrievalPlan.setPlanStatus(ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         tMonitoringRetrievalPlanMapper.updateById(tMonitoringRetrievalPlan); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<SysOrg> list = remoteOrgService.selectSysOrgByParentId(MINUS_ONE, SecurityConstants.INNER); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        Integer i = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<SysOrg> list = remoteOrgService.selectSysOrgByParentId(MINUS_ONE.longValue(), SecurityConstants.INNER); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Integer i = ZERO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<TMonitoringRetrievalPlan> tMonitoringRetrievalPlans = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (SysOrg l : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             TMonitoringRetrievalPlan monitoringRetrievalPlan = new TMonitoringRetrievalPlan(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -134,20 +130,21 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             monitoringRetrievalPlan.setRoleId(tMonitoringRetrievalPlan.getRoleId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             monitoringRetrievalPlan.setPlanCycle(tMonitoringRetrievalPlan.getPlanCycle()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             monitoringRetrievalPlan.setPlanFrequency(tMonitoringRetrievalPlan.getPlanFrequency()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            monitoringRetrievalPlan.setPlanStatus(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            monitoringRetrievalPlan.setPlanStatus(ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             monitoringRetrievalPlan.setCreateBy(SecurityUtils.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             monitoringRetrievalPlan.setUpdateTime(DateUtils.getNowDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             monitoringRetrievalPlan.setUpdateBy(SecurityUtils.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             monitoringRetrievalPlan.setCreateTime(DateUtils.getNowDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             monitoringRetrievalPlan.setDescription(tMonitoringRetrievalPlan.getDescription()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             monitoringRetrievalPlan.setCreateType(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            monitoringRetrievalPlan.setId(IdWorker.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             i = tMonitoringRetrievalPlanMapper.insert(monitoringRetrievalPlan); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             tMonitoringRetrievalPlans.add(monitoringRetrievalPlan); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (i < 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (i < ZERO) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return i; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (tMonitoringRetrievalPlan.getPlanCycle().equals("0")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             iCoreMonitoringRetrievalTaskService.noCycleTask(tMonitoringRetrievalPlans); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return i; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -182,20 +179,21 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         tMonitoringRetrievalPlan.setUpdateBy(SecurityUtils.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SysRole sysRole = remoteRoleService.getRoleById(tMonitoringRetrievalPlan.getRoleId(), SecurityConstants.INNER); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         tMonitoringRetrievalPlan.setRoleName(sysRole.getRoleName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        long id = IdWorker.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tMonitoringRetrievalPlan.setId(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (tMonitoringRetrievalPlan.getOrgType().equals("1")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             tMonitoringRetrievalPlan.setPlanStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            tMonitoringRetrievalPlan.setCreateType(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            tMonitoringRetrievalPlan.setCreateType(ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            tMonitoringRetrievalPlan.setPlanStatus(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            tMonitoringRetrievalPlan.setPlanStatus(ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             tMonitoringRetrievalPlan.setCreateType(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //无周期调用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (tMonitoringRetrievalPlan.getPlanCycle().equals("0")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<TMonitoringRetrievalPlan> tMonitoringRetrievalPlans = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 tMonitoringRetrievalPlans.add(tMonitoringRetrievalPlan); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 iCoreMonitoringRetrievalTaskService.noCycleTask(tMonitoringRetrievalPlans); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        tMonitoringRetrievalPlan.setId(IdWorker.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return tMonitoringRetrievalPlanMapper.insert(tMonitoringRetrievalPlan); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -219,7 +217,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public int deleteTMonitoringRetrievalPlanByIds(Long[] ids) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        int i = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        int i = ZERO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (Long id : ids) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             TMonitoringRetrievalPlan tMonitoringRetrievalPlan = new TMonitoringRetrievalPlan(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             tMonitoringRetrievalPlan.setIsDeleted(2L); 
			 |