浏览代码

Merge branch 'master' of http://62.234.61.92:3000/wjm/mec-cloud_IntelligentManufacturing_CLIENT

lph 1 年之前
父节点
当前提交
c3585e5c41

+ 361 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysEngineeringController.java

@@ -0,0 +1,361 @@
+package com.zkqy.web.controller.system;
+
+import java.io.*;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.*;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import com.zkqy.common.config.ZkqyConfig;
+import com.zkqy.common.core.domain.entity.DataSource;
+import com.zkqy.common.core.domain.entity.SysUser;
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.common.utils.SecurityUtils;
+import com.zkqy.common.utils.ZipUtils;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.system.domain.SysEngineering;
+import com.zkqy.system.service.ISysEngineeringService;
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.common.core.page.TableDataInfo;
+import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
+
+/**
+ * 工程部署Controller
+ *
+ * @author zkqy
+ * @date 2024-01-03
+ */
+@RestController
+@RequestMapping("/system/engineering")
+public class SysEngineeringController extends BaseController {
+    @Autowired
+    private ISysEngineeringService sysEngineeringService;
+
+    /**
+     * 查询工程部署列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询工程部署列表")
+    public TableDataInfo list(SysEngineering sysEngineering) {
+        startPage();
+        List<SysEngineering> list = sysEngineeringService.selectSysEngineeringList(sysEngineering);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出工程部署列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:export')")
+    @Log(title = "工程部署", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出工程部署列表")
+    public void export(HttpServletResponse response, SysEngineering sysEngineering) {
+        List<SysEngineering> list = sysEngineeringService.selectSysEngineeringList(sysEngineering);
+        ExcelUtil<SysEngineering> util = new ExcelUtil<SysEngineering>(SysEngineering.class);
+        util.exportExcel(response, list, "工程部署数据");
+    }
+
+    /**
+     * 获取工程部署详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取工程部署详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(sysEngineeringService.selectSysEngineeringById(id));
+    }
+
+    /**
+     * 新增工程部署
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:add')")
+    @Log(title = "工程部署", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增工程部署")
+    public AjaxResult add(@RequestBody SysEngineering sysEngineering) {
+        return toAjax(sysEngineeringService.insertSysEngineering(sysEngineering));
+    }
+
+    /**
+     * 修改工程部署
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:edit')")
+    @Log(title = "工程部署", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改工程部署")
+    public AjaxResult edit(@RequestBody SysEngineering sysEngineering) {
+        return toAjax(sysEngineeringService.updateSysEngineering(sysEngineering));
+    }
+
+    /**
+     * 删除工程部署
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:remove')")
+    @Log(title = "工程部署", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除工程部署")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(sysEngineeringService.deleteSysEngineeringByIds(ids));
+    }
+
+    /**
+     * 下载压缩包
+     */
+    @GetMapping("/download")
+    public ResponseEntity<StreamingResponseBody> downloadZip() {
+        System.err.println("开始调用" + DateUtils.getTime());
+        // 指定要打包的文件或目录路径
+        String sourceFilePath = ZkqyConfig.getUploadPath() + "/engineeringdownload/";
+
+        File dir = new File(sourceFilePath);
+        // 判断文件夹路径是否存在,不存在创建
+        if (!dir.exists()) {
+            boolean isCreated = dir.mkdirs();
+            if (!isCreated) {
+                System.out.println("目录 '" + sourceFilePath + "' 创建失败.");
+            }
+        }
+
+        //当前用户数据源信息
+        DataSource datasourceInfo = SecurityUtils.getDatasourceInfo();
+        //导出数据库集合
+        Set<String> databaseList = new LinkedHashSet<>();
+        databaseList.add("ry-vue-call");
+//        databaseList.add("zkqy-template");
+//        databaseList.add("zkqy-call");
+        databaseList.add(datasourceInfo.getDatabaseName());
+        //将sql文件导出到指定目录下
+        System.err.println("SQL文件开始生成" + DateUtils.getTime());
+        exportMultipleDatabasesToLocal(databaseList, sourceFilePath, datasourceInfo);
+        System.err.println("SQL文件生成完毕" + DateUtils.getTime());
+        //下载成功插入数据
+        SysUser sysUser = SecurityUtils.getLoginUser().getUser();
+        SysEngineering sysEngineering = new SysEngineering();
+        sysEngineering.setCreateTime(DateUtils.getNowDate());
+        sysEngineering.setDownloadTime(DateUtils.getNowDate());
+        sysEngineering.setEngineeringName(sysUser.getTenantName() + "-mes");
+        sysEngineeringService.insertSysEngineering(sysEngineering);
+
+        String zipFileName = new Date().getTime() + ".zip";
+        HttpHeaders headers = new HttpHeaders();
+        headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + zipFileName + "\"");
+        headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
+
+        return ResponseEntity.ok()
+                .headers(headers)
+                .contentType(MediaType.APPLICATION_OCTET_STREAM)
+                .body(outputStream -> {
+                    try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(Paths.get(sourceFilePath));
+                         ZipOutputStream zipOut = new ZipOutputStream(outputStream)) {
+                        System.err.println("开始导出文件" + DateUtils.getTime());
+                        addFilesToZipRecursively(zipOut, Paths.get(sourceFilePath), directoryStream);
+                        System.err.println("成功导出文件" + DateUtils.getTime());
+                    } catch (IOException e) {
+                        throw new RuntimeException("Failed to create the ZIP stream.", e);
+                    }
+                });
+    }
+
+    /**
+     * 下载压缩包
+     */
+    @GetMapping("/download1")
+    public void downloadZip1(HttpServletResponse response) {
+        System.err.println("开始调用" + DateUtils.getTime());
+
+        // 指定要打包的文件或目录路径
+        String sourceFilePath = ZkqyConfig.getUploadPath() + "/engineeringdownload/";
+
+        File dir = new File(sourceFilePath);
+        // 判断文件夹路径是否存在,不存在创建
+        if (!dir.exists()) {
+            boolean isCreated = dir.mkdirs();
+            if (!isCreated) {
+                System.out.println("目录 '" + sourceFilePath + "' 创建失败.");
+            }
+        }
+
+
+        //当前用户数据源信息
+        DataSource datasourceInfo = SecurityUtils.getDatasourceInfo();
+        //导出数据库集合
+        Set<String> databaseList = new LinkedHashSet<>();
+        databaseList.add("ry-vue-call");
+        databaseList.add(datasourceInfo.getDatabaseName());
+        //将sql文件导出到指定目录下
+        System.err.println("SQL文件开始生成" + DateUtils.getTime());
+        exportMultipleDatabasesToLocal(databaseList, sourceFilePath, datasourceInfo);
+        System.err.println("SQL文件生成完毕" + DateUtils.getTime());
+
+        //下载成功插入数据
+        SysUser sysUser = SecurityUtils.getLoginUser().getUser();
+        SysEngineering sysEngineering = new SysEngineering();
+        sysEngineering.setCreateTime(DateUtils.getNowDate());
+        sysEngineering.setDownloadTime(DateUtils.getNowDate());
+        sysEngineering.setEngineeringName(sysUser.getTenantName() + "-mes");
+        sysEngineeringService.insertSysEngineering(sysEngineering);
+        List<Map<String, String>> fileList = listFiles(sourceFilePath);
+        System.err.println("开始导出文件" + DateUtils.getTime());
+        ZipUtils.createZip(response, fileList);
+        System.err.println("成功导出文件" + DateUtils.getTime());
+    }
+
+    private void addFilesToZipRecursively(ZipOutputStream zipOut, Path rootPath, DirectoryStream<Path> dirStream) throws IOException {
+        for (Path filePath : dirStream) {
+            if (Files.isDirectory(filePath)) {
+                // 添加目录条目到ZIP
+                String entryName = filePath.toString().substring(rootPath.toString().length() + 1) + "/";
+                zipOut.putNextEntry(new ZipEntry(entryName));
+                zipOut.closeEntry();
+
+                // 递归处理子目录中的文件
+                try (DirectoryStream<Path> subDirStream = Files.newDirectoryStream(filePath)) {
+                    addFilesToZipRecursively(zipOut, rootPath, subDirStream);
+                }
+            } else if (Files.isRegularFile(filePath)) {
+                // 添加文件到ZIP
+                String entryName = filePath.toString().substring(rootPath.toString().length() + 1);
+                zipOut.putNextEntry(new ZipEntry(entryName));
+
+                try (InputStream fileIn = Files.newInputStream(filePath)) {
+                    byte[] buffer = new byte[4096];
+                    int read;
+                    while ((read = fileIn.read(buffer)) != -1) {
+                        zipOut.write(buffer, 0, read);
+                    }
+                }
+
+                zipOut.closeEntry();
+            }
+        }
+    }
+
+    /**
+     * 导出数据库文件
+     */
+    public void exportMultipleDatabasesToLocal(Set<String> databaseNames, String outputPath, DataSource dataSource) {
+        outputPath = outputPath + "sql/";
+
+        File dir = new File(outputPath);
+        // 判断文件夹路径是否存在,不存在创建
+        if (!dir.exists()) {
+            boolean isCreated = dir.mkdirs();
+            if (!isCreated) {
+                System.out.println("目录 '" + outputPath + "' 创建失败.");
+            }
+        }
+        for (String databaseName : databaseNames) {
+            try {
+                // 构建命令参数列表
+                List<String> cmd = new ArrayList<>();
+//                cmd.add("mysqldump");
+                cmd.add("/usr/local/mysql/bin/mysqldump");
+//                cmd.add("--column-statistics=0");
+                cmd.add("-h");
+                cmd.add(dataSource.getDatabaseIp());
+                cmd.add("-u");
+                cmd.add(dataSource.getUsername());
+                cmd.add("-p" + dataSource.getPassword());
+                cmd.add(databaseName);
+
+                ProcessBuilder pb = new ProcessBuilder(cmd);
+                // 设置MySQL bin目录到PATH环境变量,确保mysqldump可执行文件能找到
+//                Map<String, String> env = pb.environment();
+//                env.put("PATH", env.get("PATH") + File.pathSeparator + "\\usr\\local\\mysql\\bin");
+
+                // 创建进程并获取输出流
+                Process process = pb.start();
+
+                // 将mysqldump的输出重定向到文件
+                OutputStream outStream = new FileOutputStream(Paths.get(outputPath + databaseName + ".sql").toFile());
+                InputStream processOutput = process.getInputStream();
+                byte[] buffer = new byte[4096];
+                int read;
+                while ((read = processOutput.read(buffer)) != -1) {
+                    outStream.write(buffer, 0, read);
+                }
+                outStream.close();
+                processOutput.close();
+
+                // 获取错误流,并打印或处理任何错误信息
+                InputStream errorStream = process.getErrorStream();
+                BufferedReader errorReader = new BufferedReader(new InputStreamReader(errorStream));
+                String line;
+                while ((line = errorReader.readLine()) != null) {
+                    System.err.println(line);
+                }
+                errorReader.close();
+                errorStream.close();
+
+                // 等待进程结束并检查退出码
+                int exitCode = process.waitFor();
+                if (exitCode == 0) {
+                    System.out.println("数据库备份成功,导出文件: " + outputPath);
+                } else {
+                    System.err.println("mysqldump命令执行失败,退出代码: " + exitCode);
+                }
+
+            } catch (IOException | InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public static List<Map<String, String>> listFiles(String directoryPath) {
+        List<Map<String, String>> fileList = new ArrayList<>();
+        File directory = new File(directoryPath);
+
+        if (directory.exists() && directory.isDirectory()) {
+            listFilesRecursively(directory, fileList);
+        }
+
+        return fileList;
+    }
+
+    private static void listFilesRecursively(File directory, List<Map<String, String>> fileList) {
+        File[] files = directory.listFiles();
+
+        if (files != null) {
+            for (File file : files) {
+                if (file.isFile()) {
+                    Map<String, String> fileMap = new HashMap<>();
+                    fileMap.put("fileName", file.getName());
+                    fileMap.put("filePath", file.getAbsolutePath());
+                    fileList.add(fileMap);
+                } else if (file.isDirectory()) {
+                    listFilesRecursively(file, fileList);
+                }
+            }
+        }
+    }
+
+    public static void main(String[] args) {
+        String directoryPath = "/path/to/your/directory"; // 替换为你的文件夹路径
+        List<Map<String, String>> fileList = listFiles(directoryPath);
+
+        for (Map<String, String> fileMap : fileList) {
+            System.out.println("FileName: " + fileMap.get("fileName") + ", FilePath: " + fileMap.get("filePath"));
+        }
+    }
+}

+ 10 - 0
zkqy-common/pom.xml

@@ -137,28 +137,38 @@
             <artifactId>hutool-all</artifactId>
             <version>5.8.16</version>
         </dependency>
+        <!--阿里巴巴数据源-->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>druid</artifactId>
             <version>1.2.16</version>
             <scope>compile</scope>
         </dependency>
+        <!--springmvc依赖-->
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-webmvc</artifactId>
         </dependency>
+        <!--阿里的excel导出依赖-->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>easyexcel</artifactId>
             <version>3.3.2</version>
             <scope>compile</scope>
         </dependency>
+        <!--Json转换依赖-->
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
             <version>2.10.1</version>
             <scope>compile</scope>
         </dependency>
+        <!--Zip压缩-->
+        <dependency>
+            <groupId>org.apache.ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.9.1</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 55 - 0
zkqy-common/src/main/java/com/zkqy/common/utils/ZipUtils.java

@@ -0,0 +1,55 @@
+package com.zkqy.common.utils;
+
+
+import org.apache.tools.zip.ZipEntry;
+import org.apache.tools.zip.ZipOutputStream;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+public class ZipUtils {
+
+    /**
+     * 创建多文件压缩包
+     *
+     * @param response
+     * @param fileList 文件信息集合
+     */
+    public static void createZip(HttpServletResponse response, List<Map<String, String>> fileList) {
+
+        try {
+            //设置下载的文件名称, 注意中文名需要做编码类型转换
+            response.setContentType("application/x-octet-stream");
+            response.setHeader("Content-Disposition", "attachment;");
+            response.setCharacterEncoding("utf-8");
+            //创建zip输出流
+            ZipOutputStream zos = new ZipOutputStream(response.getOutputStream());
+            byte[] buffer = new byte[1024];
+            BufferedInputStream bufferStream = null;
+            int index = 1;
+            for (int i = 0; i < fileList.size(); i++) {
+                //设置zip里面每个文件的名称
+                zos.putNextEntry(new ZipEntry(fileList.get(i).get("fileName").toString()));
+                //根据文件地址获取输入流
+                InputStream is = new URL("file:///" + fileList.get(i).get("filePath").toString()).openConnection().getInputStream();
+                int length;
+                while ((length = is.read(buffer)) > 0) {
+                    zos.write(buffer, 0, length);
+                }
+                is.close();
+                index++;
+            }
+            zos.closeEntry();
+            zos.close();
+            zos.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+}

+ 2 - 0
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

@@ -255,6 +255,7 @@
             IFNULL( bep.task_node_next_key, '' ),
             IFNULL( bep.task_process_key, '' ),
             IFNULL( bep.task_process_note, '' ),
+            IFNULL( plan.${planName}, '' ),
             IFNULL( task_process_type, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
 
@@ -388,6 +389,7 @@
             IFNULL( bep.task_node_next_key, '' ),
             IFNULL( bep.task_process_key, '' ),
             IFNULL( bep.task_process_note, '' ),
+            IFNULL( plan.${planName}, '' ),
             IFNULL( task_process_type, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
         order by ben.create_time desc

+ 157 - 0
zkqy-system/src/main/java/com/zkqy/system/domain/SysEngineering.java

@@ -0,0 +1,157 @@
+package com.zkqy.system.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zkqy.common.annotation.Excel;
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 工程部署对象 sys_engineering
+ * 
+ * @author zkqy
+ * @date 2024-01-03
+ */
+public class SysEngineering extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 工程key */
+    @Excel(name = "工程key")
+    private String engineeringKey;
+
+    /** 工程名称 */
+    @Excel(name = "工程名称")
+    private String engineeringName;
+
+    /** 下载次数 */
+    @Excel(name = "下载次数")
+    private Long downloadNumber;
+
+    /** 下载时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "下载时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date downloadTime;
+
+    /** 租户编号 */
+    @Excel(name = "租户编号")
+    private Long tenantId;
+
+    /** 是否删除(0:否;2:是) */
+    private String delFlag;
+
+    /** 创建者ID */
+    @Excel(name = "创建者ID")
+    private Long createById;
+
+    /** 更新者ID */
+    @Excel(name = "更新者ID")
+    private Long updateById;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setEngineeringKey(String engineeringKey) 
+    {
+        this.engineeringKey = engineeringKey;
+    }
+
+    public String getEngineeringKey() 
+    {
+        return engineeringKey;
+    }
+    public void setEngineeringName(String engineeringName) 
+    {
+        this.engineeringName = engineeringName;
+    }
+
+    public String getEngineeringName() 
+    {
+        return engineeringName;
+    }
+    public void setDownloadNumber(Long downloadNumber) 
+    {
+        this.downloadNumber = downloadNumber;
+    }
+
+    public Long getDownloadNumber() 
+    {
+        return downloadNumber;
+    }
+    public void setDownloadTime(Date downloadTime) 
+    {
+        this.downloadTime = downloadTime;
+    }
+
+    public Date getDownloadTime() 
+    {
+        return downloadTime;
+    }
+    public void setTenantId(Long tenantId) 
+    {
+        this.tenantId = tenantId;
+    }
+
+    public Long getTenantId() 
+    {
+        return tenantId;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setCreateById(Long createById) 
+    {
+        this.createById = createById;
+    }
+
+    public Long getCreateById() 
+    {
+        return createById;
+    }
+    public void setUpdateById(Long updateById) 
+    {
+        this.updateById = updateById;
+    }
+
+    public Long getUpdateById() 
+    {
+        return updateById;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("engineeringKey", getEngineeringKey())
+            .append("engineeringName", getEngineeringName())
+            .append("downloadNumber", getDownloadNumber())
+            .append("downloadTime", getDownloadTime())
+            .append("tenantId", getTenantId())
+            .append("remark", getRemark())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createById", getCreateById())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateById", getUpdateById())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 62 - 0
zkqy-system/src/main/java/com/zkqy/system/mapper/SysEngineeringMapper.java

@@ -0,0 +1,62 @@
+package com.zkqy.system.mapper;
+
+import com.zkqy.system.domain.SysEngineering;
+
+import java.util.List;
+
+/**
+ * 工程部署Mapper接口
+ * 
+ * @author zkqy
+ * @date 2024-01-03
+ */
+public interface SysEngineeringMapper 
+{
+    /**
+     * 查询工程部署
+     * 
+     * @param id 工程部署主键
+     * @return 工程部署
+     */
+    public SysEngineering selectSysEngineeringById(Long id);
+
+    /**
+     * 查询工程部署列表
+     * 
+     * @param sysEngineering 工程部署
+     * @return 工程部署集合
+     */
+    public List<SysEngineering> selectSysEngineeringList(SysEngineering sysEngineering);
+
+    /**
+     * 新增工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    public int insertSysEngineering(SysEngineering sysEngineering);
+
+    /**
+     * 修改工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    public int updateSysEngineering(SysEngineering sysEngineering);
+
+    /**
+     * 删除工程部署
+     * 
+     * @param id 工程部署主键
+     * @return 结果
+     */
+    public int deleteSysEngineeringById(Long id);
+
+    /**
+     * 批量删除工程部署
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysEngineeringByIds(Long[] ids);
+}

+ 62 - 0
zkqy-system/src/main/java/com/zkqy/system/service/ISysEngineeringService.java

@@ -0,0 +1,62 @@
+package com.zkqy.system.service;
+
+import com.zkqy.system.domain.SysEngineering;
+
+import java.util.List;
+
+/**
+ * 工程部署Service接口
+ * 
+ * @author zkqy
+ * @date 2024-01-03
+ */
+public interface ISysEngineeringService 
+{
+    /**
+     * 查询工程部署
+     * 
+     * @param id 工程部署主键
+     * @return 工程部署
+     */
+    public SysEngineering selectSysEngineeringById(Long id);
+
+    /**
+     * 查询工程部署列表
+     * 
+     * @param sysEngineering 工程部署
+     * @return 工程部署集合
+     */
+    public List<SysEngineering> selectSysEngineeringList(SysEngineering sysEngineering);
+
+    /**
+     * 新增工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    public int insertSysEngineering(SysEngineering sysEngineering);
+
+    /**
+     * 修改工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    public int updateSysEngineering(SysEngineering sysEngineering);
+
+    /**
+     * 批量删除工程部署
+     * 
+     * @param ids 需要删除的工程部署主键集合
+     * @return 结果
+     */
+    public int deleteSysEngineeringByIds(Long[] ids);
+
+    /**
+     * 删除工程部署信息
+     * 
+     * @param id 工程部署主键
+     * @return 结果
+     */
+    public int deleteSysEngineeringById(Long id);
+}

+ 97 - 0
zkqy-system/src/main/java/com/zkqy/system/service/impl/SysEngineeringServiceImpl.java

@@ -0,0 +1,97 @@
+package com.zkqy.system.service.impl;
+
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.system.domain.SysEngineering;
+import com.zkqy.system.mapper.SysEngineeringMapper;
+import com.zkqy.system.service.ISysEngineeringService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 工程部署Service业务层处理
+ * 
+ * @author zkqy
+ * @date 2024-01-03
+ */
+@Service
+public class SysEngineeringServiceImpl implements ISysEngineeringService 
+{
+    @Autowired
+    private SysEngineeringMapper sysEngineeringMapper;
+
+    /**
+     * 查询工程部署
+     * 
+     * @param id 工程部署主键
+     * @return 工程部署
+     */
+    @Override
+    public SysEngineering selectSysEngineeringById(Long id)
+    {
+        return sysEngineeringMapper.selectSysEngineeringById(id);
+    }
+
+    /**
+     * 查询工程部署列表
+     * 
+     * @param sysEngineering 工程部署
+     * @return 工程部署
+     */
+    @Override
+    public List<SysEngineering> selectSysEngineeringList(SysEngineering sysEngineering)
+    {
+        return sysEngineeringMapper.selectSysEngineeringList(sysEngineering);
+    }
+
+    /**
+     * 新增工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    @Override
+    public int insertSysEngineering(SysEngineering sysEngineering)
+    {
+        sysEngineering.setCreateTime(DateUtils.getNowDate());
+        return sysEngineeringMapper.insertSysEngineering(sysEngineering);
+    }
+
+    /**
+     * 修改工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    @Override
+    public int updateSysEngineering(SysEngineering sysEngineering)
+    {
+        sysEngineering.setUpdateTime(DateUtils.getNowDate());
+        return sysEngineeringMapper.updateSysEngineering(sysEngineering);
+    }
+
+    /**
+     * 批量删除工程部署
+     * 
+     * @param ids 需要删除的工程部署主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysEngineeringByIds(Long[] ids)
+    {
+        return sysEngineeringMapper.deleteSysEngineeringByIds(ids);
+    }
+
+    /**
+     * 删除工程部署信息
+     * 
+     * @param id 工程部署主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysEngineeringById(Long id)
+    {
+        return sysEngineeringMapper.deleteSysEngineeringById(id);
+    }
+}

+ 111 - 0
zkqy-system/src/main/resources/mapper/system/SysEngineeringMapper.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zkqy.system.mapper.SysEngineeringMapper">
+    
+    <resultMap type="SysEngineering" id="SysEngineeringResult">
+        <result property="id"    column="id"    />
+        <result property="engineeringKey"    column="engineering_key"    />
+        <result property="engineeringName"    column="engineering_name"    />
+        <result property="downloadNumber"    column="download_number"    />
+        <result property="downloadTime"    column="download_time"    />
+        <result property="tenantId"    column="tenant_id" />
+        <result property="remark"    column="remark"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createById"    column="create_by_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateById"    column="update_by_id"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectSysEngineeringVo">
+        select id, engineering_key, engineering_name, download_number, download_time, tenant_id, remark, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time from sys_engineering
+    </sql>
+
+    <select id="selectSysEngineeringList" parameterType="SysEngineering" resultMap="SysEngineeringResult">
+        <include refid="selectSysEngineeringVo"/>
+        <where>  
+            <if test="engineeringKey != null  and engineeringKey != ''"> and engineering_key = #{engineeringKey}</if>
+            <if test="engineeringName != null  and engineeringName != ''"> and engineering_name like concat('%', #{engineeringName}, '%')</if>
+            <if test="downloadNumber != null "> and download_number = #{downloadNumber}</if>
+            <if test="downloadTime != null "> and download_time = #{downloadTime}</if>
+            <if test="tenantId != null "> and tenant_id = #{tenantId}</if>
+            <if test="createById != null "> and create_by_id = #{createById}</if>
+            <if test="updateById != null "> and update_by_id = #{updateById}</if>
+        </where>
+        order by download_time desc
+    </select>
+    
+    <select id="selectSysEngineeringById" parameterType="Long" resultMap="SysEngineeringResult">
+        <include refid="selectSysEngineeringVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertSysEngineering" parameterType="SysEngineering">
+        insert into sys_engineering
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="engineeringKey != null">engineering_key,</if>
+            <if test="engineeringName != null">engineering_name,</if>
+            <if test="downloadNumber != null">download_number,</if>
+            <if test="downloadTime != null">download_time,</if>
+            <if test="tenantId != null">tenant_id,</if>
+            <if test="remark != null">remark,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createById != null">create_by_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateById != null">update_by_id,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="engineeringKey != null">#{engineeringKey},</if>
+            <if test="engineeringName != null">#{engineeringName},</if>
+            <if test="downloadNumber != null">#{downloadNumber},</if>
+            <if test="downloadTime != null">#{downloadTime},</if>
+            <if test="tenantId != null">#{tenantId},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createById != null">#{createById},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateById != null">#{updateById},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSysEngineering" parameterType="SysEngineering">
+        update sys_engineering
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="engineeringKey != null">engineering_key = #{engineeringKey},</if>
+            <if test="engineeringName != null">engineering_name = #{engineeringName},</if>
+            <if test="downloadNumber != null">download_number = #{downloadNumber},</if>
+            <if test="downloadTime != null">download_time = #{downloadTime},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSysEngineeringById" parameterType="Long">
+        delete from sys_engineering where id = #{id}
+    </delete>
+
+    <delete id="deleteSysEngineeringByIds" parameterType="String">
+        delete from sys_engineering where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>