|
@@ -1,12 +1,10 @@
|
|
|
package com.usky.fire.service.impl;
|
|
|
|
|
|
-import ch.qos.logback.core.pattern.FormatInfo;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.usky.common.core.exception.BusinessException;
|
|
|
-import com.usky.common.core.util.DateUtils;
|
|
|
import com.usky.common.core.util.StringUtils;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
@@ -198,6 +196,20 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
List<Integer> personnelIdList = this.getpersonId();
|
|
|
if (personnelIdList.size() <= 0) {
|
|
|
+ PatrolInspectionAbnormal patrolInspectionAbnormal = new PatrolInspectionAbnormal();
|
|
|
+ patrolInspectionAbnormal.setCreateTime(LocalDateTime.now());
|
|
|
+ patrolInspectionAbnormal.setCreator(SecurityUtils.getUsername());
|
|
|
+ patrolInspectionAbnormal.setPlanSonId(planSonId);
|
|
|
+ patrolInspectionAbnormal.setSiteId(siteId);
|
|
|
+ patrolInspectionAbnormal.setSiteNubmber(siteNubmber);
|
|
|
+ patrolInspectionAbnormal.setAbnormalStatus(2);
|
|
|
+ patrolInspectionAbnormal.setTenantId(SecurityUtils.getTenantId());
|
|
|
+ patrolInspectionAbnormal.setAreaName("未知区域1");
|
|
|
+ patrolInspectionAbnormal.setName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
|
+ patrolInspectionAbnormal.setPhone(SecurityUtils.getLoginUser().getSysUser().getPhonenumber());
|
|
|
+ patrolInspectionAbnormal.setEndDate(LocalDateTime.now());
|
|
|
+ patrolInspectionAbnormal.setStartDate(LocalDateTime.now());
|
|
|
+ patrolInspectionAbnormalService.save(patrolInspectionAbnormal);
|
|
|
throw new BusinessException("该地点不在计划中");
|
|
|
}
|
|
|
LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
|
|
@@ -211,10 +223,38 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
}
|
|
|
List<PatrolInspectionSite> siteList = patrolInspectionSiteService.list(queryWrapper);
|
|
|
if (siteList.size() <= 0) {
|
|
|
+ PatrolInspectionAbnormal patrolInspectionAbnormal = new PatrolInspectionAbnormal();
|
|
|
+ patrolInspectionAbnormal.setCreateTime(LocalDateTime.now());
|
|
|
+ patrolInspectionAbnormal.setCreator(SecurityUtils.getUsername());
|
|
|
+ patrolInspectionAbnormal.setPlanSonId(planSonId);
|
|
|
+ patrolInspectionAbnormal.setSiteId(siteId);
|
|
|
+ patrolInspectionAbnormal.setSiteNubmber(siteNubmber);
|
|
|
+ patrolInspectionAbnormal.setAbnormalStatus(2);
|
|
|
+ patrolInspectionAbnormal.setTenantId(SecurityUtils.getTenantId());
|
|
|
+ patrolInspectionAbnormal.setAreaName("未知区域2");
|
|
|
+ patrolInspectionAbnormal.setName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
|
+ patrolInspectionAbnormal.setPhone(SecurityUtils.getLoginUser().getSysUser().getPhonenumber());
|
|
|
+ patrolInspectionAbnormal.setEndDate(LocalDateTime.now());
|
|
|
+ patrolInspectionAbnormal.setStartDate(LocalDateTime.now());
|
|
|
+ patrolInspectionAbnormalService.save(patrolInspectionAbnormal);
|
|
|
throw new BusinessException("无效地点,请联系管理人员添加点位");
|
|
|
}
|
|
|
int planSonSiteCount = patrolInspectionPlanMapper.planSiteCount(personnelIdList, siteList.get(0).getId(), dateFormat.format(new Date()));
|
|
|
if (planSonSiteCount <= 0) {
|
|
|
+ PatrolInspectionAbnormal patrolInspectionAbnormal = new PatrolInspectionAbnormal();
|
|
|
+ patrolInspectionAbnormal.setCreateTime(LocalDateTime.now());
|
|
|
+ patrolInspectionAbnormal.setCreator(SecurityUtils.getUsername());
|
|
|
+ patrolInspectionAbnormal.setPlanSonId(planSonId);
|
|
|
+ patrolInspectionAbnormal.setSiteId(siteId);
|
|
|
+ patrolInspectionAbnormal.setSiteNubmber(siteNubmber);
|
|
|
+ patrolInspectionAbnormal.setAbnormalStatus(2);
|
|
|
+ patrolInspectionAbnormal.setTenantId(SecurityUtils.getTenantId());
|
|
|
+ patrolInspectionAbnormal.setAreaName("未知区域3");
|
|
|
+ patrolInspectionAbnormal.setName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
|
+ patrolInspectionAbnormal.setPhone(SecurityUtils.getLoginUser().getSysUser().getPhonenumber());
|
|
|
+ patrolInspectionAbnormal.setEndDate(LocalDateTime.now());
|
|
|
+ patrolInspectionAbnormal.setStartDate(LocalDateTime.now());
|
|
|
+ patrolInspectionAbnormalService.save(patrolInspectionAbnormal);
|
|
|
throw new BusinessException("此地点尚未采集,请采集该点位");
|
|
|
}
|
|
|
Integer siteIdOne = 0;
|