Sfoglia il codice sorgente

202406市政修改

qinhouyu 1 anno fa
parent
commit
2bfdfef19a

+ 4 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zdsz/ZEngineeringIndustryController.java

@@ -72,7 +72,7 @@ public class ZEngineeringIndustryController extends BaseController {
      * 导出市政工程列表
      */
 //    @SaCheckPermission("zdsz:engineeringIndustry:export")
-    @Log(title = "工业工程|市政工程", businessType = BusinessType.EXPORT)
+    @Log(title = "市政工程", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(ZEngineeringIndustryBo bo, HttpServletResponse response) {
         List<ZEngineeringIndustryVo> list = iZEngineeringIndustryService.queryList(bo);
@@ -106,7 +106,7 @@ public class ZEngineeringIndustryController extends BaseController {
         return R.ok(iZEngineeringIndustryService.query(id));
     }
     /**
-     * 修改工业工程|市政工程
+     * 修改市政工程
      */
 //    @SaCheckPermission("zdsz:engineeringIndustry:edit")
     @Log(title = "市政工程", businessType = BusinessType.UPDATE)
@@ -122,7 +122,7 @@ public class ZEngineeringIndustryController extends BaseController {
      * @param ids 主键串
      */
 //    @SaCheckPermission("zdsz:engineeringIndustry:remove")
-    @Log(title = "工业工程|市政工程", businessType = BusinessType.DELETE)
+    @Log(title = "市政工程", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public R<Void> remove(@NotEmpty(message = "主键不能为空")@PathVariable String[] ids) {
         return toAjax(iZEngineeringIndustryService.deleteWithValidByIds(Arrays.asList(ids), true));
@@ -139,7 +139,7 @@ public class ZEngineeringIndustryController extends BaseController {
     }
 
     /**
-     * 市政工程根据工程类查询工程名称
+     * 工程类查询市政工程
      */
     @GetMapping("/queryNameByType")
 //    @SaCheckPermission("zdsz:engineeringIndustry:type")
@@ -153,7 +153,6 @@ public class ZEngineeringIndustryController extends BaseController {
     @PutMapping("/updateNodeByBo")
     @Log(title = "市政工程", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
-//    @SaCheckPermission("zdsz:engineeringIndustry:removeNode")
     public R<Void> updateNodeByBo(@Validated(EditGroup.class) @RequestBody ZEngineeringIndustryBo bo) {
         return toAjax(iZEngineeringIndustryService.updateNodeByBo(bo));
     }

+ 28 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/bo/ZEngineeringInfoBo.java

@@ -146,6 +146,34 @@ public class ZEngineeringInfoBo extends BaseEntity {
     @NotNull(message = "沟上部分不能为空", groups = { AddGroup.class, EditGroup.class })
     public List<String> onTheDitch;
 
+    public List<String> getzEngiineeringPhotoBoListThree() {
+        return zEngiineeringPhotoBoListThree;
+    }
+
+    public void setzEngiineeringPhotoBoListThree(List<String> zEngiineeringPhotoBoListThree) {
+        this.zEngiineeringPhotoBoListThree = zEngiineeringPhotoBoListThree;
+    }
+
+    public List<String> getzEngiineeringPhotoBoListTwo() {
+        return zEngiineeringPhotoBoListTwo;
+    }
+
+    public void setzEngiineeringPhotoBoListTwo(List<String> zEngiineeringPhotoBoListTwo) {
+        this.zEngiineeringPhotoBoListTwo = zEngiineeringPhotoBoListTwo;
+    }
+
+    public List<String> getzEngiineeringPhotoBoListOne() {
+        return zEngiineeringPhotoBoListOne;
+    }
+
+    public void setzEngiineeringPhotoBoListOne(List<String> zEngiineeringPhotoBoListOne) {
+        this.zEngiineeringPhotoBoListOne = zEngiineeringPhotoBoListOne;
+    }
+
+    public List<String> zEngiineeringPhotoBoListThree;
+    public List<String> zEngiineeringPhotoBoListTwo;
+    public List<String> zEngiineeringPhotoBoListOne;
+
     // 市政施工-沟上施工 焊接
     public List<String> welding;
     // 市政施工-沟上施工 防腐

+ 5 - 1
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/enums/photoType.java

@@ -135,6 +135,10 @@ public enum photoType {
      * 调压箱护栏及地面硬化(远景)
      *
      */
-    GroundHardening;
+    GroundHardening,
+
+    beforeBack,
+    afterBack,
+    warnBack,
 
 }

+ 14 - 116
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringIndustryServiceImpl.java

@@ -63,7 +63,7 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
     @Resource
     private IZEngiineeringPhotoService photoService;
 
-    @Autowired
+    @Resource
     private ZEngineeringCivilMapper zEngineeringCivilMapper;
 
     @Override
@@ -390,6 +390,8 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
         else if (StringUtils.isNotBlank(bo.getId())){
             ZEngineeringIndustryVo voById = baseMapper.selectVoById(bo.getId());
             List<ZEngineeringNodeBo> zEngineeringNodeBoList = bo.getzEngineeringNodeBoList();
+            ZEngineeringNodeBo entity = bo.getzEngineeringNodeBo();
+            //pc
             if (!ObjectUtils.isEmpty(zEngineeringNodeBoList)) {
                 for (ZEngineeringNodeBo zEngineeringNodeBo : zEngineeringNodeBoList) {
                     zEngineeringNodeBo.setCivliId(voById.getId());
@@ -401,6 +403,16 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
                     izEngineeringNodeService.insert(zEngineeringNodeBo);
                 }
             }
+            //uniapp
+            if (!ObjectUtils.isEmpty(entity)) {
+                entity.setCivliId(voById.getId());
+                entity.setCreateTime(voById.getCreateTime());
+                ZEngineeringNodeBo query = izEngineeringNodeService.query(entity);
+                if (!ObjectUtils.isEmpty(query)) {
+                    entity.setId(query.getId());
+                }
+                izEngineeringNodeService.insert(entity);
+            }
             return true;
         }
         return false;
@@ -458,100 +470,11 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
         //节点表与info表
         if (!ObjectUtils.isEmpty(bo.getzEngineeringNodeBo())) {
             bo.getzEngineeringNodeBo().setCreateTime(voById.getCreateTime());
-            izEngineeringNodeService.updateMuch(bo.getzEngineeringNodeBo());
+            izEngineeringNodeService.update(bo.getzEngineeringNodeBo());
         }
         return flag;
     }
 
-    private void batchUpdatePic(ZEngineeringIndustryBo bo,  String methodName, String type) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
-        // 获取类对象
-        Class<?> cls = ZEngineeringInfoBo.class;
-        // 获取指定方法
-        Method method = cls.getDeclaredMethod(methodName);
-//        System.out.println("method.invoke(obj);==="+method.invoke(bo.getzEngineeringNodeBo().getzEngineeringInfoBoList().get(0)));
-        // 故事正文开始
-        List<ZEngineeringInfoBo> zEngineeringInfoBoList = bo.getzEngineeringNodeBo().getzEngineeringInfoBoList();
-        for (int i = 0; i < zEngineeringInfoBoList.size(); i++) {
-            ZEngineeringInfoBo zEngineeringInfoBo = zEngineeringInfoBoList.get(i);
-            if (!ObjectUtils.isEmpty(method.invoke(zEngineeringInfoBo))) {
-                List<ZEngiineeringPhoto> list = new ArrayList<>();
-                // 查询数据库中已存在的文件列表
-                ZEngiineeringPhotoBo zEngiineeringPhotoBo = new ZEngiineeringPhotoBo();
-                zEngiineeringPhotoBo.setCreateTime(zEngineeringInfoBo.getCreateTime());//
-                zEngiineeringPhotoBo.setType(type);
-                zEngiineeringPhotoBo.setParentId(zEngineeringInfoBo.getId());
-                List<String> existingPhotos = photoService.queryList(zEngiineeringPhotoBo).stream().map(ZEngiineeringPhotoVo::getPicUrl).collect(Collectors.toList());
-                // 插入前端传来的新文件
-                for (String pic : (List<String>)method.invoke(zEngineeringInfoBo)) {
-                    if (!existingPhotos.contains(pic)) {
-                        ZEngiineeringPhoto newPhoto = new ZEngiineeringPhoto();
-                        newPhoto.setParentId(zEngineeringInfoBo.getId());
-                        newPhoto.setPicUrl(pic);
-                        newPhoto.setFileName(pic);
-                        newPhoto.setType(type);
-                        newPhoto.setCreateBy(String.valueOf(LoginHelper.getUsername()));
-                        newPhoto.setCreateTime(bo.getCreateTime());
-                        newPhoto.setUpdateTime(new Date());
-                        list.add(newPhoto);
-                    }
-                }
-                // 删除数据库中多余的文件
-                List<String> photosToDelete = existingPhotos.stream().filter(pic -> {
-                    try {
-                        return !((List<String>)(method.invoke(zEngineeringInfoBo))).contains(pic);
-                    } catch (IllegalAccessException e) {
-                        throw new RuntimeException(e);
-                    } catch (InvocationTargetException e) {
-                        throw new RuntimeException(e);
-                    }
-                }).collect(Collectors.toList());
-                if (!photosToDelete.isEmpty()) {
-                    photosToDelete.forEach(item -> {
-                        ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
-                        zEngiineeringPhoto.setType(type);
-                        zEngiineeringPhoto.setPicUrl(item);
-                        zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
-                        photoService.deleteWithValid(zEngiineeringPhoto);
-                    });
-                }
-                // 批量插入新图片
-                if (!list.isEmpty()) {
-                    photoService.insertBatch(list);
-                }
-            }else {
-                // 查询数据库中已存在的文件列表
-                ZEngiineeringPhotoBo zEngiineeringPhotoBo = new ZEngiineeringPhotoBo();
-                zEngiineeringPhotoBo.setCreateTime(zEngineeringInfoBo.getCreateTime());//
-                zEngiineeringPhotoBo.setParentId(zEngineeringInfoBo.getId());
-                zEngiineeringPhotoBo.setType(type);
-                List<String> existingPhotos = photoService.queryList(zEngiineeringPhotoBo).stream().map(ZEngiineeringPhotoVo::getPicUrl).collect(Collectors.toList());
-                // 删除数据库中多余的文件
-                List<String> photosToDelete = null;
-                try {
-                    photosToDelete = existingPhotos.stream().filter(pic -> {
-                        try {
-                            return !((List<String>)(method.invoke(zEngineeringInfoBo))).contains(pic);
-                        } catch (IllegalAccessException e) {
-                            throw new RuntimeException(e);
-                        } catch (InvocationTargetException e) {
-                            throw new RuntimeException(e);
-                        }
-                    }).collect(Collectors.toList());
-                }catch (Exception e){
-
-                }
-                if (!photosToDelete.isEmpty()) {
-                    photosToDelete.forEach(item -> {
-                        ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
-                        zEngiineeringPhoto.setType(type);
-                        zEngiineeringPhoto.setPicUrl(item);
-                        zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
-                        photoService.deleteWithValid(zEngiineeringPhoto);
-                    });
-                }
-            }
-        }
-    }
 
     /**
      * 修改市政工程
@@ -599,31 +522,6 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
                     photoService.insertBatch(list);
                 }
             }
-
-//            // 市政施工-沟上施工 焊接
-//            public List<String> welding;
-//            // 市政施工-沟上施工 防腐
-//            public List<String> aczoiling;
-//            // 市政施工-沟下施工 管道下沟
-//            public List<String> piping;
-//            // 市政施工-沟下施工 警示带铺设
-//            public List<String> warning;
-//            // 市政施工-沟下施工 回填
-//            public List<String> backfilling;
-            /**
-             * 焊接照片
-             * 防腐照片
-             *
-             */
-            try {
-                batchUpdatePic(bo,  "getWelding", "welding");
-                batchUpdatePic(bo,  "getAczoiling", "aczoiling");
-                batchUpdatePic(bo,  "getPiping", "piping");
-                batchUpdatePic(bo,  "getWarning", "warning");
-                batchUpdatePic(bo,  "getBackfilling", "backfilling");
-            }catch (Exception e){
-                e.printStackTrace();
-            }
         }
         return flag;
     }

+ 75 - 17
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringInfoServiceImpl.java

@@ -107,23 +107,9 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
             zEngineeringInfoBo1.setConstructionRecords(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.constructionRecords.name()));
             zEngineeringInfoBo1.setOnTheDitch(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.onTheDitch.name()));
             // 市政施工-查询 start
-            /*
-                // 市政施工-沟上施工 焊接
-                welding,
-                // 市政施工-沟上施工 防腐
-                aczoiling,
-                // 市政施工-沟下施工 管道下沟
-                piping,
-                // 市政施工-沟下施工 警示带铺设
-                warning,
-                // 市政施工-沟下施工 回填
-                backfilling
-            */
-            zEngineeringInfoBo1.setWelding(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.welding.name()));
-            zEngineeringInfoBo1.setAczoiling(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.aczoiling.name()));
-            zEngineeringInfoBo1.setPiping(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.piping.name()));
-            zEngineeringInfoBo1.setWarning(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.warning.name()));
-            zEngineeringInfoBo1.setBackfilling(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.backfilling.name()));
+            zEngineeringInfoBo1.setzEngiineeringPhotoBoListOne(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.beforeBack.name()));
+            zEngineeringInfoBo1.setzEngiineeringPhotoBoListTwo(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.warnBack.name()));
+            zEngineeringInfoBo1.setzEngiineeringPhotoBoListThree(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.afterBack.name()));
             // 市政施工-查询 end
 
             // 带气封堵施工-查询 start
@@ -339,6 +325,42 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
 
 
         }
+        if (!ObjectUtils.isEmpty(bo.getzEngiineeringPhotoBoListOne()))
+        {
+            bo.getzEngiineeringPhotoBoListOne().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.beforeBack.name().toString());
+                photoList.add(zEngiineeringPhoto);
+            });
+        }
+        if (!ObjectUtils.isEmpty(bo.getzEngiineeringPhotoBoListTwo()))
+        {
+            bo.getzEngiineeringPhotoBoListTwo().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.warnBack.name().toString());
+                photoList.add(zEngiineeringPhoto);
+            });
+        }
+        if (!ObjectUtils.isEmpty(bo.getzEngiineeringPhotoBoListThree()))
+        {
+            bo.getzEngiineeringPhotoBoListThree().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.afterBack.name().toString());
+                photoList.add(zEngiineeringPhoto);
+            });
+        }
         if (!ObjectUtils.isEmpty(bo.getLightning()))
         {
             bo.getLightning().forEach(item -> {
@@ -841,6 +863,42 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
             izEngiineeringPhotoService.updateBatch(photoList);
         }
         List<ZEngiineeringPhoto> photoList2 = new ArrayList<>();
+        if (!ObjectUtils.isEmpty(bo.getzEngiineeringPhotoBoListOne()))
+        {
+            bo.getzEngiineeringPhotoBoListOne().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.beforeBack.name().toString());
+                photoList2.add(zEngiineeringPhoto);
+            });
+        }
+        if (!ObjectUtils.isEmpty(bo.getzEngiineeringPhotoBoListTwo()))
+        {
+            bo.getzEngiineeringPhotoBoListTwo().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.beforeBack.name().toString());
+                photoList2.add(zEngiineeringPhoto);
+            });
+        }
+        if (!ObjectUtils.isEmpty(bo.getzEngiineeringPhotoBoListThree()))
+        {
+            bo.getzEngiineeringPhotoBoListThree().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.beforeBack.name().toString());
+                photoList2.add(zEngiineeringPhoto);
+            });
+        }
         if (!ObjectUtils.isEmpty(bo.getConstructionRecords()))
         {
             bo.getConstructionRecords().forEach(item -> {