|
@@ -86,18 +86,15 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
|
|
|
|
|
|
|
|
QueryWrapper<TMonitoringRetrievalPlan> query = new QueryWrapper<>(tMonitoringRetrievalPlan);
|
|
QueryWrapper<TMonitoringRetrievalPlan> query = new QueryWrapper<>(tMonitoringRetrievalPlan);
|
|
|
//下穿
|
|
//下穿
|
|
|
- // tMonitoringRetrievalPlan.setCheckSub(true);
|
|
|
|
|
List<SysOrg> data = remoteOrgService.selectSysOrgByParentId(MINUS_ONE.longValue(), SecurityConstants.INNER);
|
|
List<SysOrg> data = remoteOrgService.selectSysOrgByParentId(MINUS_ONE.longValue(), SecurityConstants.INNER);
|
|
|
if (null == tMonitoringRetrievalPlan.getOrgId()) {
|
|
if (null == tMonitoringRetrievalPlan.getOrgId()) {
|
|
|
tMonitoringRetrievalPlan.setOrgId(data.get(0).getId());
|
|
tMonitoringRetrievalPlan.setOrgId(data.get(0).getId());
|
|
|
}
|
|
}
|
|
|
Boolean checkSub = tMonitoringRetrievalPlan.getCheckSub();
|
|
Boolean checkSub = tMonitoringRetrievalPlan.getCheckSub();
|
|
|
if (Boolean.TRUE.equals(checkSub)) {
|
|
if (Boolean.TRUE.equals(checkSub)) {
|
|
|
- List<Long> ids = remoteOrgService.selectCheckSubOrgIdList(tMonitoringRetrievalPlan.getOrgId(), SecurityConstants.INNER);
|
|
|
|
|
- //清空前端传递的org_id
|
|
|
|
|
|
|
+ SysOrg sysOrg = remoteOrgService.selectSysOrgById(tMonitoringRetrievalPlan.getOrgId(), SecurityConstants.INNER);
|
|
|
tMonitoringRetrievalPlan.setOrgId(null);
|
|
tMonitoringRetrievalPlan.setOrgId(null);
|
|
|
- //添加in条件
|
|
|
|
|
- query.in("org_id", ids);
|
|
|
|
|
|
|
+ query.lambda().likeRight(TMonitoringRetrievalPlan::getOrgPath,sysOrg.getPath());
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotEmpty(planName)) {
|
|
if (StringUtils.isNotEmpty(planName)) {
|
|
|
query.like("plan_name", planName);
|
|
query.like("plan_name", planName);
|
|
@@ -147,8 +144,9 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
|
|
|
public int distribute(Long id) {
|
|
public int distribute(Long id) {
|
|
|
//查询
|
|
//查询
|
|
|
TMonitoringRetrievalPlan tMonitoringRetrievalPlan = tMonitoringRetrievalPlanMapper.selectById(id);
|
|
TMonitoringRetrievalPlan tMonitoringRetrievalPlan = tMonitoringRetrievalPlanMapper.selectById(id);
|
|
|
- tMonitoringRetrievalPlan.setPlanStatus(ZERO);
|
|
|
|
|
- tMonitoringRetrievalPlanMapper.updateById(tMonitoringRetrievalPlan);
|
|
|
|
|
|
|
+ if (tMonitoringRetrievalPlan.getPlanStatus()==1){
|
|
|
|
|
+ throw new ServiceException("禁用中,不能下发");
|
|
|
|
|
+ }
|
|
|
List<SysOrg> list = remoteOrgService.selectSysOrgByParentId(tMonitoringRetrievalPlan.getOrgId(), SecurityConstants.INNER);
|
|
List<SysOrg> list = remoteOrgService.selectSysOrgByParentId(tMonitoringRetrievalPlan.getOrgId(), SecurityConstants.INNER);
|
|
|
Integer i = ZERO;
|
|
Integer i = ZERO;
|
|
|
List<TMonitoringRetrievalPlan> tMonitoringRetrievalPlans = new ArrayList<>();
|
|
List<TMonitoringRetrievalPlan> tMonitoringRetrievalPlans = new ArrayList<>();
|
|
@@ -216,6 +214,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
|
|
|
tMonitoringRetrievalPlan.setRoleName(sysRole.getRoleName());
|
|
tMonitoringRetrievalPlan.setRoleName(sysRole.getRoleName());
|
|
|
long id = IdWorker.getId();
|
|
long id = IdWorker.getId();
|
|
|
tMonitoringRetrievalPlan.setId(id);
|
|
tMonitoringRetrievalPlan.setId(id);
|
|
|
|
|
+ tMonitoringRetrievalPlan.setOrgPath(data.getPath());
|
|
|
if (tMonitoringRetrievalPlan.getOrgType().equals("1")) {
|
|
if (tMonitoringRetrievalPlan.getOrgType().equals("1")) {
|
|
|
tMonitoringRetrievalPlan.setPlanStatus(1);
|
|
tMonitoringRetrievalPlan.setPlanStatus(1);
|
|
|
tMonitoringRetrievalPlan.setCreateType(ZERO);
|
|
tMonitoringRetrievalPlan.setCreateType(ZERO);
|
|
@@ -241,6 +240,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
|
|
|
@Override
|
|
@Override
|
|
|
public int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
|
|
public int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
|
|
|
tMonitoringRetrievalPlan.setUpdateTime(DateUtils.getNowDate());
|
|
tMonitoringRetrievalPlan.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
+ tMonitoringRetrievalPlan.setUpdateBy(SecurityUtils.getUsername());
|
|
|
return tMonitoringRetrievalPlanMapper.updateById(tMonitoringRetrievalPlan);
|
|
return tMonitoringRetrievalPlanMapper.updateById(tMonitoringRetrievalPlan);
|
|
|
}
|
|
}
|
|
|
|
|
|