|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.usky.common.core.exception.BusinessException;
|
|
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.core.util.StringUtils;
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
@@ -238,6 +239,14 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
if (planSonList.size() <= 0) {
|
|
if (planSonList.size() <= 0) {
|
|
throw new BusinessException("计划不存在,可能已被删除,请联系管理人员");
|
|
throw new BusinessException("计划不存在,可能已被删除,请联系管理人员");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
|
+ LocalDateTime inspectionDateTime = LocalDateTime.parse(planSonList.get(0).getInspectionDate() +" "+ planSonList.get(0).getStartTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
|
+ if (inspectionDateTime.isAfter(now)) {
|
|
|
|
+ throw new BusinessException("不能操作未来的计划");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
LambdaQueryWrapper<PatrolInspectionArea> queryWrapperOne = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<PatrolInspectionArea> queryWrapperOne = Wrappers.lambdaQuery();
|
|
queryWrapperOne.select(PatrolInspectionArea::getId, PatrolInspectionArea::getAreaName)
|
|
queryWrapperOne.select(PatrolInspectionArea::getId, PatrolInspectionArea::getAreaName)
|
|
.eq(PatrolInspectionArea::getId, planSonList.get(0).getAreaId());
|
|
.eq(PatrolInspectionArea::getId, planSonList.get(0).getAreaId());
|
|
@@ -254,6 +263,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
patrolInspectionRecord.setSiteStatus(planRecordVo.getSiteStatus());
|
|
patrolInspectionRecord.setSiteStatus(planRecordVo.getSiteStatus());
|
|
patrolInspectionRecord.setLongitude(planRecordVo.getLongitude());
|
|
patrolInspectionRecord.setLongitude(planRecordVo.getLongitude());
|
|
patrolInspectionRecord.setLatitude(planRecordVo.getLatitude());
|
|
patrolInspectionRecord.setLatitude(planRecordVo.getLatitude());
|
|
|
|
+
|
|
String startDate = null;
|
|
String startDate = null;
|
|
String endDate = null;
|
|
String endDate = null;
|
|
if (planSonList.get(0).getPlanType() == 1) {
|
|
if (planSonList.get(0).getPlanType() == 1) {
|