|
@@ -104,7 +104,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
public List<PatrolInspectionPlanSonVo> patrolInspectionPlan(String currentDate, String sort) {
|
|
|
List<PatrolInspectionPlanSonVo> planList = new ArrayList<>();
|
|
|
List<Integer> personnelIdList = this.getpersonId();
|
|
|
- if (personnelIdList.size()>0){
|
|
|
+ if (personnelIdList.size() > 0) {
|
|
|
LambdaQueryWrapper<PatrolInspectionPlanSchedule> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.select(PatrolInspectionPlanSchedule::getPlanId)
|
|
|
.in(PatrolInspectionPlanSchedule::getPersonnelId, personnelIdList)
|
|
@@ -127,7 +127,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
List<PatrolInspectionPlanSonVo> list = new ArrayList<>();
|
|
|
List<Integer> personnelIdList = this.getpersonId();
|
|
|
- if (personnelIdList.size()>0){
|
|
|
+ if (personnelIdList.size() > 0) {
|
|
|
LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(PatrolInspectionSite::getEnable, 1);
|
|
|
queryWrapper
|
|
@@ -174,7 +174,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> siteDetails(Integer siteId, String siteNubmber) {
|
|
|
+ public Map<String, Object> siteDetails(Integer siteId, String siteNubmber, Integer planSonId) {
|
|
|
LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
|
|
|
queryWrapper.eq(PatrolInspectionSite::getEnable, 1);
|
|
@@ -188,11 +188,22 @@ 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);
|
|
|
+ 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());
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("siteList", siteList);
|
|
|
map.put("contentList", contentList);
|
|
|
- map.put("contentCount", contentList.size());
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@@ -377,9 +388,15 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
List<PatrolInspectionRecord> recordList = patrolInspectionRecordMapper.selectList(queryWrapperOne);
|
|
|
if (recordList.size() > 0) {
|
|
|
List<Integer> siteIdList = new ArrayList<>();
|
|
|
+ List<Integer> recordIdList = new ArrayList<>();
|
|
|
for (int i = 0; i < recordList.size(); i++) {
|
|
|
siteIdList.add(recordList.get(i).getSiteId());
|
|
|
+ recordIdList.add(recordList.get(i).getId());
|
|
|
}
|
|
|
+ LambdaQueryWrapper<PatrolInspectionRecordPicture> queryOne = Wrappers.lambdaQuery();
|
|
|
+ queryOne.in(PatrolInspectionRecordPicture::getRecordId, recordIdList);
|
|
|
+ List<PatrolInspectionRecordPicture> recordPictureList = patrolInspectionRecordPictureService.list(queryOne);
|
|
|
+
|
|
|
LambdaQueryWrapper<PatrolInspectionSiteContent> queryWrapperTwo = Wrappers.lambdaQuery();
|
|
|
queryWrapperTwo.in(PatrolInspectionSiteContent::getSiteId, siteIdList);
|
|
|
List<PatrolInspectionSiteContent> siteContentLsit = patrolInspectionSiteContentService.list(queryWrapperTwo);
|
|
@@ -418,6 +435,17 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
record.setCreator(recordList.get(i).getCreator());
|
|
|
record.setRemarks(recordList.get(i).getRemarks());
|
|
|
record.setContentCount(0);
|
|
|
+ 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()){
|
|
|
+ patrolInspectionRecordPicture.setRecordId(recordPictureList.get(j).getRecordId());
|
|
|
+ patrolInspectionRecordPicture.setPictureUrl(recordPictureList.get(j).getPictureUrl());
|
|
|
+ patrolInspectionRecordPicture.setId(recordPictureList.get(j).getId());
|
|
|
+ }
|
|
|
+ PatrolInspectionRecordPictureList.add(patrolInspectionRecordPicture);
|
|
|
+ }
|
|
|
+ record.setRecordPictureList(PatrolInspectionRecordPictureList);
|
|
|
for (int j = 0; j < dataCountVoList.size(); j++) {
|
|
|
if (recordList.get(i).getSiteId() == dataCountVoList.get(i).getId()) {
|
|
|
record.setContentCount(dataCountVoList.get(i).getListCount());
|