浏览代码

提交代码

JX.Li 1 年之前
父节点
当前提交
c013c3db79

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zdsz/ZEngineeringIndustryController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.web.controller.zdsz;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.annotation.SaIgnore;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
@@ -14,8 +15,10 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.zdsz.domain.bo.ZEngineeringIndustryBo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryTypeVo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryVo;
+import com.ruoyi.zdsz.mapper.ZEngineeringCivilMapper;
 import com.ruoyi.zdsz.service.IZEngineeringIndustryService;
 import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -23,6 +26,7 @@ import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.util.Arrays;
+import java.util.LinkedList;
 import java.util.List;
 
 /**
@@ -39,6 +43,11 @@ public class ZEngineeringIndustryController extends BaseController {
 
     private final IZEngineeringIndustryService iZEngineeringIndustryService;
 
+    @GetMapping("getByUserList")
+    public R<?> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery){
+        return R.ok(iZEngineeringIndustryService.getByUserList(type,enginName,enginType,enginProcedure,enginStatus, pageQuery));
+    }
+
     /**
      * 查询工业工程|市政工程列表
      */
@@ -82,6 +91,10 @@ public class ZEngineeringIndustryController extends BaseController {
         return toAjax(iZEngineeringIndustryService.insertByBo(bo));
     }
 
+    @GetMapping("query/{id}/{type}")
+    public R<ZEngineeringIndustryVo> querys(@NotNull(message = "主键不能为空") @PathVariable String id) {
+        return R.ok(iZEngineeringIndustryService.query(id));
+    }
     /**
      * 修改工业工程|市政工程
      */

+ 34 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zdsz/ZEngineeringPipeJackingController.java

@@ -1,17 +1,20 @@
 package com.ruoyi.web.controller.zdsz;
 
+import java.io.File;
 import java.util.Date;
 import java.util.List;
 import java.util.Arrays;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
+import com.ruoyi.common.utils.file.FolderToZipUtil;
 import com.ruoyi.zdsz.service.IZEngineeringNodeService;
 import lombok.RequiredArgsConstructor;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.*;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.validation.annotation.Validated;
 import com.ruoyi.common.annotation.RepeatSubmit;
@@ -112,7 +115,38 @@ public class ZEngineeringPipeJackingController extends BaseController {
         bo.setCreateTime(new Date());
         return toAjax(iZEngineeringPipeJackingService.insertByBo(bo));
     }
+    @Value("${filePath}")
+    private String filePath;
 
+    @GetMapping(value = "/downloadZip/{type}/{name}")
+    public void downloadZip(@PathVariable String type,@PathVariable String name,HttpServletResponse response) {
+//        File file = new File(zipPath);//创建指定目录和文件名称的文件对象
+        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() + "/" + type).getBytes("UTF-8");
+            // 使用UTF-8编码创建文件
+            File typeFile = new File(new String(typeFileNameBytes, "UTF-8"));
+            if (!typeFile.exists()) {
+                typeFile.mkdirs();
+            }
+            byte[] enginNameFileNameBytes = (typeFile.getPath() + "/" + name).getBytes("UTF-8");
+            // 使用UTF-8编码创建文件
+            File enginNameFile = new File(new String(enginNameFileNameBytes, "UTF-8"));
+            if (!enginNameFile.exists()) {
+                enginNameFile.mkdirs();
+            }
+            System.out.println(enginNameFile.getPath());
+            FolderToZipUtil.zip(enginNameFile.getPath(),name,response);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
     /**
      * 新增顶管工程App
      */

+ 87 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FolderToZipUtil.java

@@ -0,0 +1,87 @@
+package com.ruoyi.common.utils.file;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * @program: microfront-server
+ * @description: 文件夹压缩为zip文件
+ * @author: zhangy
+ * @create: 2021-04-01 09:43
+ */
+public class FolderToZipUtil {
+
+    public static void zip(String sourceFileName, String objName,HttpServletResponse response){
+        ZipOutputStream out = null;
+        BufferedOutputStream bos = null;
+        try {
+            //将zip以流的形式输出到前台
+            response.setHeader("content-type", "application/octet-stream");
+            response.setCharacterEncoding("utf-8");
+            // 设置浏览器响应头对应的Content-disposition
+            //参数中 testZip 为压缩包文件名,尾部的.zip 为文件后缀
+            response.setHeader("Content-disposition",
+                    "attachment;filename=" + new String(objName.getBytes("gbk"), "iso8859-1")+".zip");
+            //创建zip输出流
+            out = new ZipOutputStream(response.getOutputStream());
+            //创建缓冲输出流
+            bos = new BufferedOutputStream(out);
+            File sourceFile = new File(sourceFileName);
+            //调用压缩函数
+            compress(out, bos, sourceFile, sourceFile.getName());
+            out.flush();
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }finally {
+            IOCloseUtil.close(bos, out);
+        }
+    }
+
+    /**
+     * 文件压缩
+     * @param out
+     * @param bos
+     * @param sourceFile
+     * @param base
+     */
+    public static void compress(ZipOutputStream out, BufferedOutputStream bos, File sourceFile, String base){
+        FileInputStream fos = null;
+        BufferedInputStream bis = null;
+        try {
+            //如果路径为目录(文件夹)
+            if (sourceFile.isDirectory()) {
+                //取出文件夹中的文件(或子文件夹)
+                File[] flist = sourceFile.listFiles();
+                if (flist.length == 0) {//如果文件夹为空,则只需在目的地zip文件中写入一个目录进入点
+                    out.putNextEntry(new ZipEntry(base + "/"));
+                } else {//如果文件夹不为空,则递归调用compress,文件夹中的每一个文件(或文件夹)进行压缩
+                    for (int i = 0; i < flist.length; i++) {
+                        compress(out, bos, flist[i], base + "/" + flist[i].getName());
+                    }
+                }
+            } else {//如果不是目录(文件夹),即为文件,则先写入目录进入点,之后将文件写入zip文件中
+                out.putNextEntry(new ZipEntry(base));
+                fos = new FileInputStream(sourceFile);
+                bis = new BufferedInputStream(fos);
+
+                int tag;
+                //将源文件写入到zip文件中
+                while ((tag = bis.read()) != -1) {
+                    out.write(tag);
+                }
+                bis.close();
+                fos.close();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }finally {
+            IOCloseUtil.close(bis,fos);
+        }
+    }
+}

+ 39 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/IOCloseUtil.java

@@ -0,0 +1,39 @@
+package com.ruoyi.common.utils.file;
+
+import java.io.Closeable;
+import java.io.IOException;
+
+/**
+ * @program: microfront-server
+ * @description: IO流关闭工具Utils
+ * @author: zhangy
+ * @create: 2021-04-01 09:28
+ */
+public class IOCloseUtil {
+
+    /**
+     *   IO流关闭工具类
+     */
+    public static void close(Closeable... io) {
+        for (Closeable temp : io) {
+            try {
+                if (null != temp)
+                    temp.close();
+            } catch (IOException e) {
+                System.out.println("" + e.getMessage());
+            }
+        }
+    }
+
+    public static <T extends Closeable> void closeAll(T... io) {
+        for (Closeable temp : io) {
+            try {
+                if (null != temp)
+                    temp.close();
+            } catch (IOException e) {
+                System.out.println("" + e.getMessage());
+            }
+        }
+
+    }
+}

+ 8 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/mapper/ZEngineeringIndustryMapper.java

@@ -1,8 +1,13 @@
 package com.ruoyi.zdsz.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.mapper.BaseMapperPlus;
 import com.ruoyi.zdsz.domain.ZEngineeringIndustry;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * 工业工程|市政工程Mapper接口
@@ -12,4 +17,7 @@ import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryVo;
  */
 public interface ZEngineeringIndustryMapper extends BaseMapperPlus<ZEngineeringIndustryMapper, ZEngineeringIndustry, ZEngineeringIndustryVo> {
 
+    List<Map<String,Object>> getByUserList(@Param("names") List DateList, @Param("by")String name, @Param("type")String type,@Param("szAndGy")String szAndGy,@Param("pa") Page<?> page);
+    List<Map<String,String>> getReviewStatusByNodeId(@Param("id") String id);
+
 }

+ 4 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/IZEngineeringIndustryService.java

@@ -8,6 +8,7 @@ import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryVo;
 
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 工业工程|市政工程Service接口
@@ -17,6 +18,8 @@ import java.util.List;
  */
 public interface IZEngineeringIndustryService {
 
+    List<Map<String,Object>> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery);
+
     /**
      * 查询工业工程|市政工程
      */
@@ -51,5 +54,6 @@ public interface IZEngineeringIndustryService {
 
     ZEngineeringIndustryVo query(String id, String type);
 
+    ZEngineeringIndustryVo query(String id);
     List<ZEngineeringIndustryTypeVo> queryNameByType(ZEngineeringIndustryBo bo);
 }

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

@@ -333,13 +333,7 @@ public class ZEngiineeringPhotoServiceImpl implements IZEngiineeringPhotoService
                         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");
+                        byte[] enginNameFileNameBytes = (typeFile.getPath() + "/" + objInfo.get("engin_name")).getBytes("UTF-8");
                         // 使用UTF-8编码创建文件
                         File enginNameFile = new File(new String(enginNameFileNameBytes, "UTF-8"));
                         if (!enginNameFile.exists()) {

+ 168 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringIndustryServiceImpl.java

@@ -6,9 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.domain.PageQuery;
+import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.helper.LoginHelper;
+import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.redis.RedisUtils;
 import com.ruoyi.framework.handler.MonthTableNameHandler;
 import com.ruoyi.zdsz.domain.ZEngiineeringPhoto;
 import com.ruoyi.zdsz.domain.ZEngineeringIndustry;
@@ -16,11 +19,14 @@ import com.ruoyi.zdsz.domain.bo.*;
 import com.ruoyi.zdsz.domain.vo.ZEngiineeringPhotoVo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryTypeVo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryVo;
+import com.ruoyi.zdsz.mapper.ZEngineeringCivilMapper;
 import com.ruoyi.zdsz.mapper.ZEngineeringIndustryMapper;
 import com.ruoyi.zdsz.service.IZEngiineeringPhotoService;
 import com.ruoyi.zdsz.service.IZEngineeringIndustryService;
 import com.ruoyi.zdsz.service.IZEngineeringNodeService;
 import lombok.RequiredArgsConstructor;
+import org.apache.poi.ss.formula.functions.T;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
@@ -28,6 +34,9 @@ import org.springframework.util.ObjectUtils;
 import javax.annotation.Resource;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -53,6 +62,155 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
     @Resource
     private IZEngiineeringPhotoService photoService;
 
+    @Autowired
+    private ZEngineeringCivilMapper zEngineeringCivilMapper;
+
+    @Override
+    public List<Map<String, Object>> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery) {
+        Page<T> page = new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize());
+        String leftJoin = null;
+        String szAndGy = null;
+        if ("1".equals(type)){
+            leftJoin = "z_engineering_pipe_jacking"; // 顶管
+        }
+        else if ("2".equals(type)){
+            leftJoin = "z_engineering_infrastructure"; // 基建
+        }
+        else if ("3".equals(type)){
+            leftJoin = "z_engineering_dangerous"; // 危险工程
+        }
+        else if ("4".equals(type)){
+            leftJoin = "z_engineering_industry"; // 市政工程
+            szAndGy = "gy";
+        }
+        else if ("5".equals(type)){
+            leftJoin = "z_engineering_industry"; // 工业工程
+            szAndGy = "sz";
+        }
+        LinkedList<String> list = zEngineeringCivilMapper.getTableNames("z_engineering_info");
+        List DateList = new ArrayList();
+        list.removeLast();
+        list.stream().forEach(item -> {
+            DateList.add(item.substring(item.indexOf("2")));
+        });
+        String username = LoginHelper.getUsername();
+        List<Map<String, Object>> byUserList = baseMapper.getByUserList(DateList, username, leftJoin,szAndGy, page);
+
+        if ("1".equals(type)){ // 顶管
+            byUserList.forEach(item -> {
+
+                String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));
+                MonthTableNameHandler.setData(date);
+
+                List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
+                Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
+                List<SysDictData> municipalEngineeringNode = sysDictMap.get("pipe_jack");
+                mapList.forEach(ite -> {
+                    String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
+                    // "municipal_engineering_node";
+                    ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
+                    ite.put("reviewStatus", str);
+                });
+                municipalEngineeringNode.forEach(ite -> {
+                    String dictLabel = ite.getDictLabel();
+                    List<Map<String, String>> type1 = mapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
+                    if (type1.size() == 0) {
+                        HashMap<String, String> objectObjectHashMap = new HashMap<>();
+                        objectObjectHashMap.put("reviewStatus","未审核");
+                        objectObjectHashMap.put("type",dictLabel);
+                        mapList.add(objectObjectHashMap);
+                    }
+                });
+                item.put("status",mapList);
+                MonthTableNameHandler.removeData();
+            });
+        }
+        else if ("2".equals(type)){ // 基建
+            byUserList.forEach(item -> {
+                String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
+                MonthTableNameHandler.setData(date);
+                List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
+                Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
+                List<SysDictData> municipalEngineeringNode = sysDictMap.get("engineering_infrastructure");
+                mapList.forEach(ite -> {
+                    String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
+                    // "municipal_engineering_node";
+                    ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
+                    ite.put("reviewStatus", str);
+                });
+                municipalEngineeringNode.forEach(ite -> {
+                    String dictLabel = ite.getDictLabel();
+                    List<Map<String, String>> type1 = mapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
+                    if (type1.size() == 0) {
+                        HashMap<String, String> objectObjectHashMap = new HashMap<>();
+                        objectObjectHashMap.put("reviewStatus","未审核");
+                        objectObjectHashMap.put("type",dictLabel);
+                        mapList.add(objectObjectHashMap);
+                    }
+                });
+                item.put("status",mapList);
+                MonthTableNameHandler.removeData();
+            });
+        }
+        else if ("3".equals(type)){ // 危险工程
+            byUserList.forEach(item -> {
+                String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
+;
+                MonthTableNameHandler.setData(date);
+                List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
+                mapList.forEach(ite -> {
+                    String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
+                    ite.put("reviewStatus", str);
+                });
+                item.put("status",mapList);
+                MonthTableNameHandler.removeData();
+            });
+        }
+        else if ("4".equals(type)){ // 市政工程
+            byUserList.forEach(item -> {
+                String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
+;
+                MonthTableNameHandler.setData(date);
+                List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
+                Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
+                List<SysDictData> municipalEngineeringNode = sysDictMap.get("municipal_engineering_node");
+                mapList.forEach(ite -> {
+                    String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
+                    // "municipal_engineering_node";
+                    ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
+                    ite.put("reviewStatus", str);
+                });
+                municipalEngineeringNode.forEach(ite -> {
+                    String dictLabel = ite.getDictLabel();
+                    List<Map<String, String>> type1 = mapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
+                    if (type1.size() == 0) {
+                        HashMap<String, String> objectObjectHashMap = new HashMap<>();
+                        objectObjectHashMap.put("reviewStatus","未审核");
+                        objectObjectHashMap.put("type",dictLabel);
+                        mapList.add(objectObjectHashMap);
+                    }
+                });
+                item.put("status",mapList);
+                MonthTableNameHandler.removeData();
+            });
+        }
+        else if ("5".equals(type)){ // 工业工程
+            byUserList.forEach(item -> {
+                String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
+;
+                MonthTableNameHandler.setData(date);
+                List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
+                mapList.forEach(ite -> {
+                    String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
+                    ite.put("reviewStatus", str);
+                });
+                item.put("status",mapList);
+            });
+            MonthTableNameHandler.removeData();
+        }
+        return byUserList;
+    }
+
     /**
      * 查询工业工程|市政工程
      */
@@ -438,6 +596,16 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
     }
 
     @Override
+    public ZEngineeringIndustryVo query(String id) {
+        ZEngineeringIndustryVo zEngineeringIndustryVo = baseMapper.selectVoById(id);
+        ZEngineeringNodeBo zEngineeringNodeBo = new ZEngineeringNodeBo();
+        zEngineeringNodeBo.setCreateTime(zEngineeringIndustryVo.getCreateTime());
+        zEngineeringNodeBo.setCivliId(zEngineeringIndustryVo.getId());
+        zEngineeringIndustryVo.setZEngineeringNodeBo(izEngineeringNodeService.query(zEngineeringNodeBo));
+        return zEngineeringIndustryVo;
+    }
+
+    @Override
     public List<ZEngineeringIndustryTypeVo> queryNameByType(ZEngineeringIndustryBo bo) {
         LambdaQueryWrapper<ZEngineeringIndustry> zEngineeringIndustryBoLambdaQueryWrapper = buildListByType(bo);
         zEngineeringIndustryBoLambdaQueryWrapper.orderByDesc(ZEngineeringIndustry::getCreateTime);

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

@@ -136,7 +136,12 @@ public class ZEngineeringPipeJackingServiceImpl implements IZEngineeringPipeJack
     public Boolean insertByBo(ZEngineeringPipeJackingBo bo) {
         ZEngineeringPipeJacking add = BeanUtil.toBean(bo, ZEngineeringPipeJacking.class);
         validEntityBeforeSave(add);
-
+        LambdaQueryWrapper<ZEngineeringPipeJacking> wrapper = Wrappers.lambdaQuery();
+        wrapper.eq(StringUtils.isNotEmpty(bo.getEnginName()),ZEngineeringPipeJacking::getEnginName,bo.getEnginName());
+        List<ZEngineeringPipeJacking> zEngineeringPipeJackings = baseMapper.selectList(wrapper);
+        if (zEngineeringPipeJackings.size() > 0){
+            return false;
+        }
         LambdaQueryWrapper<ZEngineeringPipeJacking> lqw = Wrappers.lambdaQuery();
         lqw.eq(StringUtils.isNotBlank(bo.getId()), ZEngineeringPipeJacking::getId, bo.getId());
         lqw.eq(StringUtils.isNotBlank(bo.getEnginId()), ZEngineeringPipeJacking::getEnginId, bo.getEnginId());
@@ -227,6 +232,12 @@ public class ZEngineeringPipeJackingServiceImpl implements IZEngineeringPipeJack
     @Override
     @Transactional(rollbackFor=Exception.class)
     public Boolean updateByBo(ZEngineeringPipeJackingBo bo) {
+        LambdaQueryWrapper<ZEngineeringPipeJacking> wrapper = Wrappers.lambdaQuery();
+        wrapper.eq(StringUtils.isNotEmpty(bo.getEnginName()),ZEngineeringPipeJacking::getEnginName,bo.getEnginName());
+        List<ZEngineeringPipeJacking> zEngineeringPipeJackings = baseMapper.selectList(wrapper);
+        if (zEngineeringPipeJackings.size() > 0){
+            return false;
+        }
         ZEngineeringPipeJacking update = BeanUtil.toBean(bo, ZEngineeringPipeJacking.class);
         validEntityBeforeSave(update);
         int i = baseMapper.updateById(update);

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

@@ -39,7 +39,6 @@
     <select id="getObjInfo" resultType="java.util.Map">
         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

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

@@ -285,7 +285,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
             information_schema.TABLES
         WHERE
-            table_name like CONCAT(#{tableName},'%')
+            table_name like CONCAT(#{tableName},'%') GROUP BY table_name
     </select>
     <select id="getsumId" resultType="com.ruoyi.zdsz.domain.bo.ZEngineeringInfoBo">
         SELECT

+ 50 - 0
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZEngineeringIndustryMapper.xml

@@ -26,5 +26,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+    <select id="getReviewStatusByNodeId" resultType="java.util.Map">
+        SELECT
+            en.type,
+            COALESCE(
+                    (SELECT er.review_status FROM z_engineering_review er WHERE er.eng_info_id = en.id AND er.del_flag = 0 ORDER BY er.update_info_time DESC LIMIT 1),
+        '2'
+    ) AS reviewStatus
+        FROM
+            z_engineering_node en
+        WHERE
+            en.civli_id = #{id};
+    </select>
+    <select id="getByUserList" resultType="java.util.Map">
+        SELECT
+            epj.id AS id,
+            epj.engin_name AS enginName,
+            epj.create_time AS createTime
+        FROM z_engineering_info  ei
+                 LEFT JOIN z_engineering_node en ON ei.eng_info_id = en.id
+                 LEFT JOIN ${type} epj ON epj.id = en.civli_id
+                <if test="szAndGy != null and szAndGy != ''">
+                    <if test="szAndGy == 'sz'">
+                        and epj.type = '1'
+                    </if>
+                    <if test="szAndGy == 'gy'">
+                        and epj.type = '2'
+                    </if>
+                </if>
+        WHERE ei.create_by = #{by} AND epj.id IS NOT NULL GROUP BY epj.id
+        <foreach collection="names" item="name">
+            union
+            SELECT
+            epj.id AS id,
+            epj.engin_name AS enginName,
+            epj.create_time AS createTime
+            FROM z_engineering_info_${name}  ei
+            LEFT JOIN z_engineering_node_${name} en ON ei.eng_info_id = en.id
+            LEFT JOIN ${type} epj ON epj.id = en.civli_id
+            <if test="szAndGy != null and szAndGy != ''">
+                <if test="szAndGy == 'sz'">
+                    and epj.type = '1'
+                </if>
+                <if test="szAndGy == 'gy'">
+                    and epj.type = '2'
+                </if>
+            </if>
+            WHERE ei.create_by = #{by} AND epj.id IS NOT NULL GROUP BY epj.id
+
+        </foreach>
+    </select>
 
 </mapper>