|
@@ -1,7 +1,6 @@
|
|
|
package com.usky.fire.service.impl;
|
|
|
|
|
|
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.StringUtils;
|
|
@@ -132,8 +131,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
if (personnelIdList.size() > 0) {
|
|
|
LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(PatrolInspectionSite::getEnable, 1);
|
|
|
- queryWrapper
|
|
|
- .eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId())
|
|
|
+ queryWrapper.eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId())
|
|
|
.eq(PatrolInspectionSite::getSiteNubmber, siteNubmber);
|
|
|
List<PatrolInspectionSite> siteList = patrolInspectionSiteService.list(queryWrapper);
|
|
|
if (siteList.size() <= 0) {
|
|
@@ -177,6 +175,11 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> siteDetails(Integer siteId, String siteNubmber, Integer planSonId) {
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ List<Integer> personnelIdList = this.getpersonId();
|
|
|
+ if (personnelIdList.size() <= 0) {
|
|
|
+ throw new BusinessException("该地点不在计划中");
|
|
|
+ }
|
|
|
LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
|
|
|
queryWrapper.eq(PatrolInspectionSite::getEnable, 1);
|
|
@@ -190,23 +193,29 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
if (siteList.size() <= 0) {
|
|
|
throw new BusinessException("无效地点,请联系管理人员添加点位");
|
|
|
}
|
|
|
- List<PatrolInspectionRecordPicture> recordPictureList = new ArrayList<>();
|
|
|
- if (planSonId != null && planSonId != 0) {
|
|
|
- LambdaQueryWrapper<PatrolInspectionRecord> query = Wrappers.lambdaQuery();
|
|
|
- query.eq(PatrolInspectionRecord::getSiteId, siteId)
|
|
|
- .eq(PatrolInspectionRecord::getPlanSonId, planSonId);
|
|
|
- List<PatrolInspectionRecord> recordList = patrolInspectionRecordMapper.selectList(query);
|
|
|
- if (CollectionUtils.isNotEmpty(recordList)){
|
|
|
- siteList.get(0).setRemarks(recordList.get(0).getRemarks());
|
|
|
- LambdaQueryWrapper<PatrolInspectionRecordPicture> queryOne = Wrappers.lambdaQuery();
|
|
|
- queryOne.eq(PatrolInspectionRecordPicture::getRecordId, recordList.get(0).getId());
|
|
|
- recordPictureList = patrolInspectionRecordPictureService.list(queryOne);
|
|
|
- }
|
|
|
+ int planSonSiteCount = patrolInspectionPlanMapper.planSiteCount(personnelIdList, siteList.get(0).getId(), dateFormat.format(new Date()));
|
|
|
+ if (planSonSiteCount <= 0) {
|
|
|
+ throw new BusinessException("此地点尚未采集,请采集该点位");
|
|
|
}
|
|
|
-
|
|
|
- siteList.get(0).setRecordPictureList(recordPictureList);
|
|
|
+ List<PatrolInspectionRecordPicture> recordPictureList = new ArrayList<>();
|
|
|
+// if (planSonId != null && planSonId != 0) {
|
|
|
+// LambdaQueryWrapper<PatrolInspectionRecord> query = Wrappers.lambdaQuery();
|
|
|
+// query.eq(PatrolInspectionRecord::getSiteId, siteId)
|
|
|
+// .eq(PatrolInspectionRecord::getPlanSonId, planSonId);
|
|
|
+// List<PatrolInspectionRecord> recordList = patrolInspectionRecordMapper.selectList(query);
|
|
|
+// if (CollectionUtils.isNotEmpty(recordList)) {
|
|
|
+// siteList.get(0).setRemarks(recordList.get(0).getRemarks());
|
|
|
+// LambdaQueryWrapper<PatrolInspectionRecordPicture> queryOne = Wrappers.lambdaQuery();
|
|
|
+// queryOne.eq(PatrolInspectionRecordPicture::getRecordId, recordList.get(0).getId());
|
|
|
+// recordPictureList = patrolInspectionRecordPictureService.list(queryOne);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// siteList.get(0).setRecordPictureList(recordPictureList);
|
|
|
List<PatrolInspectionContentVo> contentList = this.contentList(siteList.get(0).getId());
|
|
|
siteList.get(0).setContentCount(contentList.size());
|
|
|
+ siteList.get(0).setPlanSonId(planSonId);
|
|
|
+
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("siteList", siteList);
|
|
|
map.put("contentList", contentList);
|
|
@@ -444,7 +453,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
List<PatrolInspectionRecordPicture> PatrolInspectionRecordPictureList = new ArrayList<>();
|
|
|
for (int j = 0; j < recordPictureList.size(); j++) {
|
|
|
PatrolInspectionRecordPicture patrolInspectionRecordPicture = new PatrolInspectionRecordPicture();
|
|
|
- if (recordList.get(i).getId()==recordPictureList.get(j).getRecordId()){
|
|
|
+ if (recordList.get(i).getId() == recordPictureList.get(j).getRecordId()) {
|
|
|
patrolInspectionRecordPicture.setRecordId(recordPictureList.get(j).getRecordId());
|
|
|
patrolInspectionRecordPicture.setPictureUrl(recordPictureList.get(j).getPictureUrl());
|
|
|
patrolInspectionRecordPicture.setId(recordPictureList.get(j).getId());
|