|
@@ -84,6 +84,9 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PatrolInspectionAbnormalService patrolInspectionAbnormalService;
|
|
private PatrolInspectionAbnormalService patrolInspectionAbnormalService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private PatrolInspectionSiteStoreService patrolInspectionSiteStoreService;
|
|
|
|
|
+
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(PatrolInspectionPlanSonServiceImpl.class);
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(PatrolInspectionPlanSonServiceImpl.class);
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -608,9 +611,13 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
queryWrapper.eq(PatrolInspectionSite::getSiteNubmber, patrolInspectionSite.getSiteNubmber())
|
|
queryWrapper.eq(PatrolInspectionSite::getSiteNubmber, patrolInspectionSite.getSiteNubmber())
|
|
|
.eq(PatrolInspectionSite::getEnable, 1);
|
|
.eq(PatrolInspectionSite::getEnable, 1);
|
|
|
int list = patrolInspectionSiteService.count(queryWrapper);
|
|
int list = patrolInspectionSiteService.count(queryWrapper);
|
|
|
|
|
+ int siteCount = patrolInspectionSiteStoreService.siteStoreCount(patrolInspectionSite.getSiteNubmber());
|
|
|
if (list > 0) {
|
|
if (list > 0) {
|
|
|
throw new BusinessException("不可重复采集地点");
|
|
throw new BusinessException("不可重复采集地点");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (siteCount <= 0) {
|
|
|
|
|
+ throw new BusinessException("采集点位不合法,请采集合法点位");
|
|
|
|
|
+ }
|
|
|
patrolInspectionSite.setCreator(SecurityUtils.getUsername());
|
|
patrolInspectionSite.setCreator(SecurityUtils.getUsername());
|
|
|
patrolInspectionSite.setCollector(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
patrolInspectionSite.setCollector(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
|
patrolInspectionSite.setCreateTime(LocalDateTime.now());
|
|
patrolInspectionSite.setCreateTime(LocalDateTime.now());
|