Explorar el Código

Merge remote-tracking branch 'origin/zdsz3.0' into zdsz3.0

wangzhe hace 1 año
padre
commit
e9b9e96da7

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

@@ -146,6 +146,48 @@ public class ZEngineeringInfoBo extends BaseEntity {
     // 市政施工-沟下施工 回填
     public List<String> backfilling;
 
+    public List<String> getBoxBrand() {
+        return boxBrand;
+    }
+
+    public void setBoxBrand(List<String> boxBrand) {
+        this.boxBrand = boxBrand;
+    }
+
+    public List<String> getLightning() {
+        return Lightning;
+    }
+
+    public void setLightning(List<String> lightning) {
+        Lightning = lightning;
+    }
+
+    public List<String> getBottomLeg() {
+        return BottomLeg;
+    }
+
+    public void setBottomLeg(List<String> bottomLeg) {
+        BottomLeg = bottomLeg;
+    }
+
+    public List<String> getGroundHardening() {
+        return GroundHardening;
+    }
+
+    public void setGroundHardening(List<String> groundHardening) {
+        GroundHardening = groundHardening;
+    }
+
+    // 调压箱名牌
+    public List<String> boxBrand;
+    //调压箱防雷接地
+    public List<String> Lightning;
+    //调压箱底腿连接
+    public List<String> BottomLeg;
+    //调压箱护栏及地面硬化(远景)
+    public List<String> GroundHardening;
+
+
     public List<String> getBeforeBottom() {
         return beforeBottom;
     }

+ 34 - 6
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/enums/photoType.java

@@ -60,15 +60,43 @@ public enum photoType {
      */
     onTheDitch,
 
-    // 市政施工-沟上施工 焊接
+    /**
+     市政施工-沟上施工 焊接
+     */
     welding,
-    // 市政施工-沟上施工 防腐
+    /**
+     *  市政施工-沟上施工 防腐
+     */
     aczoiling,
-    // 市政施工-沟下施工 管道下沟
+    /**
+     * 市政施工-沟下施工 管道下沟
+     */
     piping,
-    // 市政施工-沟下施工 警示带铺设
+    /**
+     * 市政施工-沟下施工 警示带铺设
+      */
+
     warning,
-    // 市政施工-沟下施工 回填
-    backfilling
+    /**
+     * 市政施工-沟下施工 回填
+     */
+    backfilling,
+    /**
+     * 调压箱名牌
+      */
+     boxBrand,
+    /**
+     * 调压箱防雷接地
+     */
+    Lightning,
+    /**
+     * 调压箱底腿连接
+     */
+    BottomLeg,
+    /**
+     * 调压箱护栏及地面硬化(远景)
+     *
+     */
+    GroundHardening;
 
 }

+ 1 - 1
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/IZEngiineeringPhotoService.java

@@ -84,5 +84,5 @@ public interface IZEngiineeringPhotoService {
     Boolean deleteWithValidByurls(String url);
     Boolean deleteWithValid(ZEngiineeringPhoto bo);
     void write(ZEngineeringCivilBo zEngineeringCivilBo);
-    void writeImg(String id, List<ZEngineeringInfoBo> infoIdList, ZEngineeringInfoBo bo);
+    void writeImg(List<ZEngineeringInfoBo> infoIdList, ZEngineeringInfoBo bo);
 }

+ 59 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngiineeringPhotoServiceImpl.java

@@ -309,11 +309,68 @@ public class ZEngiineeringPhotoServiceImpl implements IZEngiineeringPhotoService
 
     @Override
     @DynamicName(spel = "#bo.createTime")
-    public void writeImg(String id, List<ZEngineeringInfoBo> infoIdList,ZEngineeringInfoBo bo) {
-        Map<String, String> objInfo = baseMapper.getObjInfo(id);
+    public void writeImg(List<ZEngineeringInfoBo> infoIdList,ZEngineeringInfoBo bo) {
+        Map<String, String> objInfo = baseMapper.getObjInfo(bo.getEngInfoId());
         System.out.println("-------------节点信息-------------");
         System.out.println(objInfo);
         System.out.println("--------------------------------");
+        infoIdList.forEach(item -> {
+            item.getzEngiineeringPhotoBoList().forEach(photo -> {
+                if (StringUtils.isNotBlank(photo)) {
+                    try {
+                        // 创建最外层文件夹
+                        byte[] fileNameBytes = filePath.getBytes("UTF-8");
+                        // 使用UTF-8编码创建文件
+                        File file = new File(new String(fileNameBytes, "UTF-8"));
+                        if (!file.exists()) {
+                            file.mkdirs();
+                        }
+                       byte[] typeFileNameBytes = (file.getPath() + "/" + objInfo.get("type")).getBytes("UTF-8");
+                        // 使用UTF-8编码创建文件
+                        File typeFile = new File(new String(typeFileNameBytes, "UTF-8"));
+                        if (!typeFile.exists()) {
+                            typeFile.mkdirs();
+                        }
+                        byte[] idNameBytes = (typeFile.getPath() + "/" + objInfo.get("id")).getBytes("UTF-8");
+                        // 使用UTF-8编码创建文件
+                        File idFile = new File(new String(idNameBytes, "UTF-8"));
+                        if (!idFile.exists()) {
+                            idFile.mkdirs();
+                        }
+                        byte[] enginNameFileNameBytes = (idFile.getPath() + "/" + objInfo.get("engin_name")).getBytes("UTF-8");
+                        // 使用UTF-8编码创建文件
+                        File enginNameFile = new File(new String(enginNameFileNameBytes, "UTF-8"));
+                        if (!enginNameFile.exists()) {
+                            enginNameFile.mkdirs();
+                        }
+
+                        // 时间
+                        //                        File CreateTimeFile = new File(Type.getPath() + "/" + new SimpleDateFormat("yyyy-MM-dd").format(zEngineeringInfoBo.getCreateTime()) );
+                        byte[] CreateTimeFileNameBytes = (enginNameFile.getPath() + "/" + new SimpleDateFormat("yyyy-MM-dd").format(item.getUpdateTime())).getBytes("UTF-8");
+                        // 使用UTF-8编码创建文件
+                        File CreateTimeFile = new File(new String(CreateTimeFileNameBytes, "UTF-8"));
+                        if (!CreateTimeFile.exists()) {
+                            CreateTimeFile.mkdirs();
+                        }
+                        //                        File CreateByFile = new File(CreateTimeFile.getPath() + "/" + zEngineeringInfoBo.getConstructUser());
+                        byte[] CreateByFileNameBytes = (CreateTimeFile.getPath() + "/" + item.getConstructUser()).getBytes("UTF-8");
+                        // 使用UTF-8编码创建文件
+                        File CreateByFile = new File(new String(CreateByFileNameBytes, "UTF-8"));
+                        if (!CreateByFile.exists()) {
+                            CreateByFile.mkdirs();
+                        }
+                        obsService.download(CreateByFile.getPath(), photo.substring(photo.lastIndexOf("/")+1));
+                        System.out.println(photo.substring(photo.lastIndexOf("/")+1));
+                        System.out.println(photo);
+                        System.out.println(CreateByFile.getPath());
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+
+
+                }
+            });
+        });
     }
 
     @Override

+ 1 - 1
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringCivilServiceImpl.java

@@ -1059,7 +1059,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
                 MonthTableNameHandler.setData(format.format(item.getCreateTime()));
                 zEngineeringInfoMapper.update(lqw);
                 MonthTableNameHandler.removeData();
-                izEngiineeringPhotoService.writeImg(zEngineeringReviewBo.getEngInfoId(),infoIdList.getInfoIdList(), item);
+                izEngiineeringPhotoService.writeImg(infoIdList.getInfoIdList(), item);
             });
 
             izEngineeringReviewService.insert(zEngineeringReviewBo);

+ 120 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringInfoServiceImpl.java

@@ -91,6 +91,10 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
             List<ZEngineeringMaterialBo> zEngineeringMaterialBo = izEngineeringMaterialService.query(zEngineeringInfoBo1);
             zEngineeringInfoBo1.setzEngiineeringPhotoBoList(photoList);
             zEngineeringInfoBo1.setzEngineeringMaterialBo(zEngineeringMaterialBo);
+            zEngineeringInfoBo1.setBoxBrand(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.boxBrand.name()));
+            zEngineeringInfoBo1.setLightning(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.Lightning.name()));
+            zEngineeringInfoBo1.setBottomLeg(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.BottomLeg.name()));
+            zEngineeringInfoBo1.setGroundHardening(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.GroundHardening.name()));
             zEngineeringInfoBo1.setPhotosAfter(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.photosAfter.name()));
             zEngineeringInfoBo1.setStonePowder(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.stonePowder.name()));
             zEngineeringInfoBo1.setDuctalEpithelium(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.ductalEpithelium.name()));
@@ -149,6 +153,10 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
             List<ZEngineeringMaterialBo> zEngineeringMaterialBo = izEngineeringMaterialService.query(zEngineeringInfoBo1);
             zEngineeringInfoBo1.setzEngiineeringPhotoBoList(photoList);
             zEngineeringInfoBo1.setzEngineeringMaterialBo(zEngineeringMaterialBo);
+            zEngineeringInfoBo1.setBoxBrand(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.boxBrand.name()));
+            zEngineeringInfoBo1.setLightning(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.Lightning.name()));
+            zEngineeringInfoBo1.setBottomLeg(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.BottomLeg.name()));
+            zEngineeringInfoBo1.setGroundHardening(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.GroundHardening.name()));
             zEngineeringInfoBo1.setPhotosAfter(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.photosAfter.name()));
             zEngineeringInfoBo1.setStonePowder(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.stonePowder.name()));
             zEngineeringInfoBo1.setDuctalEpithelium(izEngiineeringPhotoService.queryTypeList(zEngineeringInfoBo1,photoType.ductalEpithelium.name()));
@@ -262,6 +270,62 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
 
 
         }
+        if (!ObjectUtils.isEmpty(bo.getBoxBrand()))
+        {
+            bo.getBoxBrand().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.boxBrand.name().toString());
+                photoList.add(zEngiineeringPhoto);
+            });
+
+
+        }
+        if (!ObjectUtils.isEmpty(bo.getLightning()))
+        {
+            bo.getLightning().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.Lightning.name().toString());
+                photoList.add(zEngiineeringPhoto);
+            });
+
+
+        }
+        if (!ObjectUtils.isEmpty(bo.getBottomLeg()))
+        {
+            bo.getBottomLeg().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.BottomLeg.name().toString());
+                photoList.add(zEngiineeringPhoto);
+            });
+
+
+        }
+        if (!ObjectUtils.isEmpty(bo.getGroundHardening()))
+        {
+            bo.getGroundHardening().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.GroundHardening.name().toString());
+                photoList.add(zEngiineeringPhoto);
+            });
+
+
+        }
         if (!ObjectUtils.isEmpty(bo.getOnTheDitch()))
         {
             bo.getOnTheDitch().forEach(item -> {
@@ -535,6 +599,62 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
             });
 
         }
+        if (!ObjectUtils.isEmpty(bo.getBoxBrand()))
+        {
+            bo.getBoxBrand().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.boxBrand.name().toString());
+                photoList2.add(zEngiineeringPhoto);
+            });
+
+
+        }
+        if (!ObjectUtils.isEmpty(bo.getLightning()))
+        {
+            bo.getLightning().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.Lightning.name().toString());
+                photoList2.add(zEngiineeringPhoto);
+            });
+
+
+        }
+        if (!ObjectUtils.isEmpty(bo.getBottomLeg()))
+        {
+            bo.getBottomLeg().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.BottomLeg.name().toString());
+                photoList2.add(zEngiineeringPhoto);
+            });
+
+
+        }
+        if (!ObjectUtils.isEmpty(bo.getGroundHardening()))
+        {
+            bo.getGroundHardening().forEach(item -> {
+                ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
+                zEngiineeringPhoto.setParentId(bo.getId());
+                zEngiineeringPhoto.setPicUrl(item);
+                zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
+                zEngiineeringPhoto.setUpdateTime(new Date());
+                zEngiineeringPhoto.setType(photoType.GroundHardening.name().toString());
+                photoList2.add(zEngiineeringPhoto);
+            });
+
+
+        }
         if (!ObjectUtils.isEmpty(bo.getOnTheDitch()))
         {
             bo.getOnTheDitch().forEach(item -> {

+ 10 - 1
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZEngiineeringPhotoMapper.xml

@@ -37,7 +37,16 @@
     </select>
 
     <select id="getObjInfo" resultType="java.util.Map">
-        SELECT * FROM `z_engineering_node` WHERE id = #{nodeId}
+        SELECT
+            IF(ISNULL(zepj.engin_name),IF(ISNULL(zei.engin_name),IF(ISNULL(zed.engin_name),IF(ISNULL(zein.engin_name),'-',zein.engin_name),zed.engin_name),zei.engin_name),zepj.engin_name) AS engin_name,
+            IF(ISNULL(zepj.engin_name),IF(ISNULL(zei.engin_name),IF(ISNULL(zed.engin_name),IF(ISNULL(zein.engin_name),'-',zein.id),zed.id),zei.id),zepj.id) AS id,
+            IF(ISNULL(zepj.engin_name),IF(ISNULL(zei.engin_name),IF(ISNULL(zed.engin_name),IF(ISNULL(zein.engin_name),'-',IF(zein.type = '1','工业工程','市政工程')),'危险工程'),'基建工程'),'顶管工程') AS type
+        FROM z_engineering_node_2024_05 ze
+                 LEFT JOIN z_engineering_pipe_jacking zepj ON zepj.id = ze.civli_id
+                 LEFT JOIN z_engineering_infrastructure zei ON zei.id = ze.civli_id
+                 LEFT JOIN z_engineering_dangerous zed ON zed.id = ze.civli_id
+                 LEFT JOIN z_engineering_industry zein ON zein.id = ze.civli_id
+        WHERE ze.id = #{nodeId}
     </select>
 
 </mapper>