|
@@ -341,7 +341,8 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- public List<PatrolInspectionRecordVo> recordList(String currentDate, String sort,Integer id) {
|
|
|
+ @Override
|
|
|
+ public List<PatrolInspectionRecordVo> recordList(String currentDate, String sort, Integer id) {
|
|
|
List<Integer> personnelIdList = this.getpersonId();
|
|
|
LambdaQueryWrapper<PatrolInspectionPlanSchedule> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.select(PatrolInspectionPlanSchedule::getPlanId)
|
|
@@ -358,7 +359,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
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);
|
|
|
+ queryWrapperOne.eq(PatrolInspectionRecord::getId, id);
|
|
|
}
|
|
|
if (sort.equals("ASC")) {
|
|
|
queryWrapperOne.orderByAsc(PatrolInspectionRecord::getId);
|
|
@@ -422,6 +423,87 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> recordOption(Integer recordId, Integer siteId) {
|
|
|
+ LambdaQueryWrapper<PatrolInspectionSiteContent> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
+ queryWrapperOne.eq(PatrolInspectionSiteContent::getSiteId, siteId);
|
|
|
+ List<PatrolInspectionSiteContent> siteContentList = patrolInspectionSiteContentService.list(queryWrapperOne);
|
|
|
+ List<PatrolInspectionContentVo> list = new ArrayList<>();
|
|
|
+ List<Integer> contentOptionIdList = new ArrayList<>();
|
|
|
+ if (siteContentList.size() > 0) {
|
|
|
+ List<Integer> contentIdList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < siteContentList.size(); i++) {
|
|
|
+ contentIdList.add(siteContentList.get(i).getContentId());
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<PatrolInspectionContent> queryWrapperTwo = Wrappers.lambdaQuery();
|
|
|
+ queryWrapperTwo.in(PatrolInspectionContent::getId, contentIdList)
|
|
|
+ .eq(PatrolInspectionContent::getEnable, 1);
|
|
|
+ List<PatrolInspectionContent> contentList = patrolInspectionContentService.list(queryWrapperTwo);
|
|
|
+ if (contentList.size() > 0) {
|
|
|
+ LambdaQueryWrapper<PatrolInspectionContentOption> queryWrapperThree = Wrappers.lambdaQuery();
|
|
|
+ queryWrapperThree.in(PatrolInspectionContentOption::getContentId, contentIdList)
|
|
|
+ .eq(PatrolInspectionContentOption::getEnable, 1);
|
|
|
+ List<PatrolInspectionContentOption> contentOptionList = patrolInspectionContentOptionService.list(queryWrapperThree);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<PatrolInspectionRecordOption> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(PatrolInspectionRecordOption::getRecordId, recordId);
|
|
|
+ List<PatrolInspectionRecordOption> recordOptionList = patrolInspectionRecordOptionService.list(queryWrapper);
|
|
|
+ for (int i = 0; i < recordOptionList.size(); i++) {
|
|
|
+ contentOptionIdList.add(recordOptionList.get(i).getContentOptionId());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ContentOptionVo> 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);
|
|
|
+ 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());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ contentOptionVoList.add(contentOptionVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ContentOptionVo> contentOptionVoListOne = new ArrayList<>();
|
|
|
+ for (int i = 0; i < contentList.size(); i++) {
|
|
|
+ PatrolInspectionContentVo contentVo = new PatrolInspectionContentVo();
|
|
|
+ contentVo.setXh(i + 1);
|
|
|
+ contentVo.setId(contentList.get(i).getId());
|
|
|
+ contentVo.setContentTitle(contentList.get(i).getContentTitle());
|
|
|
+ contentVo.setContentDescribe(contentList.get(i).getContentDescribe());
|
|
|
+ contentVo.setSubmissionMethod(contentList.get(i).getSubmissionMethod());
|
|
|
+ contentVo.setTenantId(contentList.get(i).getTenantId());
|
|
|
+ contentVo.setCreator(contentList.get(i).getCreator());
|
|
|
+ contentVo.setCreateTime(contentList.get(i).getCreateTime());
|
|
|
+ contentVo.setEnable(contentList.get(i).getEnable());
|
|
|
+ contentVo.setCompanyId(contentList.get(i).getCompanyId());
|
|
|
+ for (int j = 0; j < contentOptionVoList.size(); j++) {
|
|
|
+ if (contentList.get(i).getId() == contentOptionVoList.get(j).getContentId()) {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list.add(contentVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("list", list);
|
|
|
+ map.put("contentOptionIdList", contentOptionIdList);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public List<Integer> getpersonId() {
|
|
|
LambdaQueryWrapper<PatrolInspectionPersonnel> queryWrapper = Wrappers.lambdaQuery();
|