Browse Source

Merge branch 'usky-zyj' of uskycloud/usky-modules into server-165

James 1 year ago
parent
commit
3598ff2729

+ 33 - 5
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionRecordServiceImpl.java

@@ -103,9 +103,15 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
         List<PatrolInspectionRecordPicture> patrolInspectionRecordPictureList = patrolInspectionRecordPictureService.list(queryWrapperOne);
 
         //内容选中项查询
+        List<Integer> contentOptionIdList = new ArrayList<>();
         LambdaQueryWrapper<PatrolInspectionRecordOption> queryWrapperTwo = Wrappers.lambdaQuery();
         queryWrapperTwo.eq(PatrolInspectionRecordOption::getRecordId, id);
         List<PatrolInspectionRecordOption> patrolInspectionRecordOptionList = patrolInspectionRecordOptionService.list(queryWrapperTwo);
+        for (int i = 0; i < patrolInspectionRecordOptionList.size(); i++) {
+            if (patrolInspectionRecordOptionList.get(i).getContentOptionId() != null) {
+                contentOptionIdList.add(patrolInspectionRecordOptionList.get(i).getContentOptionId());
+            }
+        }
 
         //地点内容ID查询
         LambdaQueryWrapper<PatrolInspectionSiteContent> queryWrapperThree = Wrappers.lambdaQuery();
@@ -164,13 +170,35 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
             patrolInspectionContentVo.setEnable(patrolInspectionContentList.get(i).getEnable());
             patrolInspectionContentVo.setCompanyId(patrolInspectionContentList.get(i).getCompanyId());
             List<ContentOptionVo> contentOptionVoListOne = new ArrayList<>();
-            for (int j = 0; j < contentOptionVoList.size(); j++) {
-                if (patrolInspectionContentList.get(i).getId() == contentOptionVoList.get(j).getContentId()) {
-                    patrolInspectionContentVo.setRemarks(contentOptionVoList.get(j).getRemarks());
-                    contentOptionVoListOne.add(contentOptionVoList.get(j));
+
+            if (patrolInspectionContentList.get(i).getSubmissionMethod() == 3) {
+                for (int j = 0; j < patrolInspectionRecordOptionList.size(); j++) {
+                    if (patrolInspectionRecordOptionList.get(j).getContentOptionId() == null || patrolInspectionRecordOptionList.get(j).getContentOptionId() == 0) {
+                        int id11 = patrolInspectionContentList.get(i).getId();
+                        int id22 = patrolInspectionRecordOptionList.get(j).getContentId();
+                        if (id11 == id22) {
+                            if (patrolInspectionRecordOptionList.get(j).getRemarks() != null && !"".equals(patrolInspectionRecordOptionList.get(j).getRemarks())) {
+                                patrolInspectionContentVo.setRemarks(patrolInspectionRecordOptionList.get(j).getRemarks());
+                            }
+                            patrolInspectionContentVo.setContent(patrolInspectionRecordOptionList.get(j).getContent());
+                        }
+                    }
+                }
+            } else {
+                for (int j = 0; j < contentOptionVoList.size(); j++) {
+                    int id1 = patrolInspectionContentList.get(i).getId();
+                    int id2 = contentOptionVoList.get(j).getContentId();
+                    if (id1 == id2) {
+                        if (contentOptionVoList.get(j).getRemarks() != null && !"".equals(contentOptionVoList.get(j).getRemarks())) {
+                            patrolInspectionContentVo.setRemarks(contentOptionVoList.get(j).getRemarks());
+                        }
+                        contentOptionVoListOne.add(contentOptionVoList.get(j));
+                        patrolInspectionContentVo.setContentOptionVoList(contentOptionVoListOne);
+                    }
                 }
             }
-            patrolInspectionContentVo.setContentOptionVoList(contentOptionVoListOne);
+
+            patrolInspectionContentVo.setContentOptionValue(contentOptionIdList);
             patrolInspectionContentVoList.add(patrolInspectionContentVo);
         }