|
@@ -1,5 +1,6 @@
|
|
|
package com.usky.fire.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.usky.common.core.exception.BusinessException;
|
|
@@ -199,21 +200,19 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
if (planSonSiteCount <= 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);
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-// siteList.get(0).setRecordPictureList(recordPictureList);
|
|
|
+ Integer siteIdOne = 0;
|
|
|
+ if (siteId != 0 && siteId != null) {
|
|
|
+ siteIdOne = siteId;
|
|
|
+ } else {
|
|
|
+ siteIdOne = siteList.get(0).getId();
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<PatrolInspectionPlanSiteSon> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper1.eq(PatrolInspectionPlanSiteSon::getPlanId, planSonId)
|
|
|
+ .eq(PatrolInspectionPlanSiteSon::getSiteId, siteIdOne);
|
|
|
+ List<PatrolInspectionPlanSiteSon> siteSonslist = patrolInspectionPlanSiteSonService.list(queryWrapper1);
|
|
|
+ if (CollectionUtil.isNotEmpty(siteSonslist)) {
|
|
|
+ siteList.get(0).setInspectionStatus(siteSonslist.get(0).getInspectionStatus());
|
|
|
+ }
|
|
|
List<PatrolInspectionContentVo> contentList = this.contentList(siteList.get(0).getId());
|
|
|
siteList.get(0).setContentCount(contentList.size());
|
|
|
siteList.get(0).setPlanSonId(planSonId);
|
|
@@ -393,16 +392,10 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
}
|
|
|
LambdaQueryWrapper<PatrolInspectionRecord> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
queryWrapperOne.in(PatrolInspectionRecord::getPlanId, planIdList)
|
|
|
- .between(PatrolInspectionRecord::getCreateTime, currentDate + " 00:00:00", currentDate + " 23:59:59");
|
|
|
- if (id != null && id != 0) {
|
|
|
- queryWrapperOne.eq(PatrolInspectionRecord::getId, id);
|
|
|
- }
|
|
|
- if (planSonId != null && planSonId != 0) {
|
|
|
- queryWrapperOne.eq(PatrolInspectionRecord::getPlanSonId, planSonId);
|
|
|
- }
|
|
|
- if (siteId != null && siteId != 0) {
|
|
|
- queryWrapperOne.eq(PatrolInspectionRecord::getSiteId, siteId);
|
|
|
- }
|
|
|
+ .eq(id != null && id != 0, PatrolInspectionRecord::getId, id)
|
|
|
+ .eq(planSonId != null && planSonId != 0, PatrolInspectionRecord::getPlanSonId, planSonId)
|
|
|
+ .eq(siteId != null && siteId != 0, PatrolInspectionRecord::getSiteId, siteId)
|
|
|
+ .between(StringUtils.isNotBlank(currentDate), PatrolInspectionRecord::getCreateTime, currentDate + " 00:00:00", currentDate + " 23:59:59");
|
|
|
if (sort.equals("ASC")) {
|
|
|
queryWrapperOne.orderByAsc(PatrolInspectionRecord::getId);
|
|
|
} else {
|
|
@@ -461,7 +454,9 @@ 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()) {
|
|
|
+ int id1 = recordList.get(i).getId();
|
|
|
+ int recordId1 = recordPictureList.get(j).getRecordId();
|
|
|
+ if (id1 == recordId1) {
|
|
|
patrolInspectionRecordPicture.setRecordId(recordPictureList.get(j).getRecordId());
|
|
|
patrolInspectionRecordPicture.setPictureUrl(recordPictureList.get(j).getPictureUrl());
|
|
|
patrolInspectionRecordPicture.setId(recordPictureList.get(j).getId());
|
|
@@ -470,7 +465,9 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
}
|
|
|
record.setRecordPictureList(PatrolInspectionRecordPictureList);
|
|
|
for (int j = 0; j < dataCountVoList.size(); j++) {
|
|
|
- if (recordList.get(i).getSiteId() == dataCountVoList.get(j).getId()) {
|
|
|
+ int siteId1 = recordList.get(i).getSiteId();
|
|
|
+ int siteId2 = dataCountVoList.get(j).getId();
|
|
|
+ if (siteId1 == siteId2) {
|
|
|
record.setContentCount(dataCountVoList.get(j).getListCount());
|
|
|
}
|
|
|
}
|
|
@@ -511,30 +508,34 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
contentOptionIdList.add(recordOptionList.get(i).getContentOptionId());
|
|
|
}
|
|
|
|
|
|
- List<ContentOptionVo> contentOptionVoList = new ArrayList<>();
|
|
|
+ List<PatrolInspectionContentOption> contentOptionVoList = new ArrayList<>();
|
|
|
for (int i = 0; i < contentOptionList.size(); i++) {
|
|
|
- ContentOptionVo contentOptionVo = new ContentOptionVo();
|
|
|
- contentOptionVo.setId(contentOptionList.get(i).getId());
|
|
|
- contentOptionVo.setContentId(contentOptionList.get(i).getContentId());
|
|
|
- contentOptionVo.setOptionName(contentOptionList.get(i).getOptionName());
|
|
|
- contentOptionVo.setCreateTime(contentOptionList.get(i).getCreateTime());
|
|
|
- contentOptionVo.setCreator(contentOptionList.get(i).getCreator());
|
|
|
- contentOptionVo.setEnable(contentOptionList.get(i).getEnable());
|
|
|
- contentOptionVo.setSelectStatus(false);
|
|
|
+// ContentOptionVo contentOptionVo = new ContentOptionVo();
|
|
|
+ contentOptionList.get(i).setId(contentOptionList.get(i).getId());
|
|
|
+ contentOptionList.get(i).setContentId(contentOptionList.get(i).getContentId());
|
|
|
+ contentOptionList.get(i).setCreateTime(contentOptionList.get(i).getCreateTime());
|
|
|
+ contentOptionList.get(i).setCreator(contentOptionList.get(i).getCreator());
|
|
|
+ contentOptionList.get(i).setEnable(contentOptionList.get(i).getEnable());
|
|
|
+ contentOptionList.get(i).setSelectStatus(false);
|
|
|
for (int j = 0; j < recordOptionList.size(); j++) {
|
|
|
- if (contentOptionList.get(i).getId() == recordOptionList.get(j).getContentOptionId()) {
|
|
|
- contentOptionVo.setSelectStatus(true);
|
|
|
- contentOptionVo.setRemarks(recordOptionList.get(j).getRemarks());
|
|
|
+ int contentOptionId1 = contentOptionList.get(i).getId();
|
|
|
+ int contentOptionId2 = recordOptionList.get(j).getContentOptionId();
|
|
|
+ if (contentOptionId1 == contentOptionId2) {
|
|
|
+ contentOptionList.get(i).setSelectStatus(true);
|
|
|
+ contentOptionList.get(i).setRemarks(recordOptionList.get(j).getRemarks());
|
|
|
}
|
|
|
- if (contentOptionList.get(i).getContentId() == recordOptionList.get(j).getContentId()) {
|
|
|
- contentOptionVo.setContent(recordOptionList.get(i).getContent());
|
|
|
+ int contentId1 = contentOptionList.get(i).getContentId();
|
|
|
+ int contentId2 = recordOptionList.get(j).getContentId();
|
|
|
+ if (contentId1 == contentId2) {
|
|
|
+ contentOptionList.get(i).setContent(recordOptionList.get(i).getContent());
|
|
|
}
|
|
|
}
|
|
|
- contentOptionVoList.add(contentOptionVo);
|
|
|
+ contentOptionVoList.add(contentOptionList.get(i));
|
|
|
}
|
|
|
-
|
|
|
- List<ContentOptionVo> contentOptionVoListOne = new ArrayList<>();
|
|
|
+// List<PatrolInspectionContentOption> contentOptionListOne = new ArrayList<>();
|
|
|
+// contentOptionListOne.addAll(contentOptionVoList);
|
|
|
for (int i = 0; i < contentList.size(); i++) {
|
|
|
+ List<PatrolInspectionContentOption> contentOptionVoListOne = new ArrayList<>();
|
|
|
PatrolInspectionContentVo contentVo = new PatrolInspectionContentVo();
|
|
|
contentVo.setXh(i + 1);
|
|
|
contentVo.setId(contentList.get(i).getId());
|
|
@@ -546,13 +547,16 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
contentVo.setCreateTime(contentList.get(i).getCreateTime());
|
|
|
contentVo.setEnable(contentList.get(i).getEnable());
|
|
|
contentVo.setCompanyId(contentList.get(i).getCompanyId());
|
|
|
+ contentVo.setContentOptionListValue1(contentOptionIdList);
|
|
|
for (int j = 0; j < contentOptionVoList.size(); j++) {
|
|
|
- if (contentList.get(i).getId() == contentOptionVoList.get(j).getContentId()) {
|
|
|
+ int id1 = contentList.get(i).getId();
|
|
|
+ int id2 = contentOptionVoList.get(j).getContentId();
|
|
|
+ if (id1 == id2) {
|
|
|
if (contentOptionVoList.get(j).getRemarks() != null && !"".equals(contentOptionVoList.get(j).getRemarks())) {
|
|
|
contentVo.setRemarks(contentOptionVoList.get(j).getRemarks());
|
|
|
}
|
|
|
contentOptionVoListOne.add(contentOptionVoList.get(j));
|
|
|
- contentVo.setContentOptionVoList(contentOptionVoListOne);
|
|
|
+ contentVo.setContentOptionList(contentOptionVoListOne);
|
|
|
}
|
|
|
}
|
|
|
list.add(contentVo);
|
|
@@ -560,8 +564,8 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
}
|
|
|
}
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("list", list);
|
|
|
- map.put("contentOptionIdList", contentOptionIdList);
|
|
|
+ map.put("contentList", list);
|
|
|
+// map.put("contentOptionIdList", contentOptionIdList);
|
|
|
return map;
|
|
|
}
|
|
|
|