Browse Source

fix 新增批量下载接口

DYH2020 2 years ago
parent
commit
65349a7589

+ 6 - 0
pom.xml

@@ -188,6 +188,12 @@
             <artifactId>mysql-binlog-connector-java</artifactId>
             <version>0.13.0</version>
         </dependency>
+        <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
     </dependencies>
     <profiles>
         <profile>

+ 89 - 0
src/main/java/com/ywt/mg/core/utils/FileUtil.java

@@ -0,0 +1,89 @@
+package com.ywt.mg.core.utils;
+
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.*;
+import java.nio.file.attribute.BasicFileAttributes;
+
+
+/**
+ * @author daiyihua
+ * @create 2020-11-24 11:15
+ * @program bank_service
+ * @description Zip文件处理工具类
+ **/
+public class FileUtil {
+
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(FileUtil.class);
+
+    /**
+     * 删除指定文件夹下文件
+     *
+     * @param filePath
+     */
+    public static void deleteFolders(String filePath) {
+        Path path = Paths.get(filePath);
+        try {
+            Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
+                @Override
+                public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException {
+                    Files.delete(file);
+                    LOGGER.info("删除文件: {}", file);
+                    return FileVisitResult.CONTINUE;
+                }
+
+                @Override
+                public FileVisitResult postVisitDirectory(Path dir,
+                                                          IOException exc) throws IOException {
+                    Files.delete(dir);
+                    LOGGER.info("文件夹被删除: {}", dir);
+                    return FileVisitResult.CONTINUE;
+                }
+            });
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 删除文件
+     *
+     * @param fileName 文件路径
+     */
+    public void deleteFile(String fileName) {
+        try {
+            //创建一个文件对象
+            File file = new File(fileName);
+            // 删除文件
+            boolean value = file.delete();
+            if (value) {
+                LOGGER.info(fileName + "已成功删除.");
+            } else {
+                LOGGER.info(fileName + "文件不存在");
+            }
+        } catch (Exception e) {
+            LOGGER.error("delete file error:{}", e, e.getMessage());
+        }
+    }
+
+    /**
+     * 判断是否存在文件夹,如果不存在,那就创建
+     *
+     * @param filePath 文件路径
+     */
+    public static void createFoldersIfNotExit(String filePath) {
+        try {
+            File file = new File(filePath);
+            if (!file.getParentFile().exists()) {
+                file.getParentFile().mkdirs();
+            }
+        } catch (Exception e) {
+            LOGGER.error("FileUtil#createFoldersIfNotExit error:{}", e, e.getMessage());
+        }
+    }
+}

+ 278 - 0
src/main/java/com/ywt/mg/core/utils/ZipFileUtil.java

@@ -0,0 +1,278 @@
+package com.ywt.mg.core.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * @author daiyihua
+ * @create 2020-11-24 11:15
+ * @program bank_service
+ * @description Zip文件处理工具类
+ **/
+public class ZipFileUtil {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(ZipFileUtil.class);
+    /**
+     * 功能:把 sourceDir 目录下的所有文件进行 zip 格式的压缩,保存为指定 zip 文件
+     *
+     * @param sourceDir 原文件
+     * @param zipFile   压缩之后的文件
+     */
+    public static void zip(String sourceDir, String zipFile) {
+        OutputStream os = null;
+        ZipOutputStream zos = null;
+        try {
+            os = new FileOutputStream(zipFile);
+            BufferedOutputStream bos = new BufferedOutputStream(os);
+            zos = new ZipOutputStream(bos);
+            File file = new File(sourceDir);
+            String basePath = null;
+            if (file.isDirectory()) {
+                basePath = file.getPath();
+            } else {//直接压缩单个文件时,取父目录
+                basePath = file.getParent();
+            }
+            zipFile(file, basePath, zos);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (zos != null) {
+                try {
+                    zos.closeEntry();
+                    zos.close();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            if (os != null) {
+                try {
+                    os.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 功能:执行文件压缩成zip文件
+     *
+     * @param source   原文件
+     * @param basePath 待压缩文件根目录
+     * @param zos      {@link ZipOutputStream}
+     */
+    private static void zipFile(File source, String basePath, ZipOutputStream zos) {
+        File[] files = new File[0];
+        if (source.isDirectory()) {
+            files = source.listFiles();
+        } else {
+            files = new File[1];
+            files[0] = source;
+        }
+        String pathName;//存相对路径(相对于待压缩的根目录)
+        byte[] buf = new byte[1024];
+        int length = 0;
+        try {
+            for (File file : files) {
+                if (file.isDirectory()) {
+                    pathName = file.getPath().substring(basePath.length() + 1) + "/";
+                    zos.putNextEntry(new ZipEntry(pathName));
+                    zipFile(file, basePath, zos);
+                } else {
+                    pathName = file.getPath().substring(basePath.length() + 1);
+                    InputStream is = new FileInputStream(file);
+                    BufferedInputStream bis = new BufferedInputStream(is);
+                    zos.putNextEntry(new ZipEntry(pathName));
+                    while ((length = bis.read(buf)) > 0) {
+                        zos.write(buf, 0, length);
+                    }
+                    is.close();
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    /**
+     * 功能:解压 zip 文件,只能解压 zip 文件
+     *
+     * @param zipfile 压缩文件
+     * @param destDir 解压路径
+     */
+    public static String unZip(String zipfile, String destDir) {
+        byte b[] = new byte[1024];
+        int length;
+        ZipFile zipFile;
+        // 获取第一个文件的名称
+        String firstFileName = "";
+        OutputStream outputStream = null;
+        InputStream inputStream = null;
+        try {
+            zipFile = new ZipFile(new File(zipfile));
+            Enumeration enumeration = zipFile.entries();
+            ZipEntry zipEntry = null;
+            int i = 0;
+            while (enumeration.hasMoreElements()) {
+                zipEntry = (ZipEntry) enumeration.nextElement();
+                // 获取第一个文件的文件名
+                if (i == 0) {
+                    firstFileName = zipEntry.getName();
+                }
+                i++;
+                File loadFile = new File(destDir + zipEntry.getName());
+                // 判断是否为文件夹
+                if (zipEntry.isDirectory()) {
+                    loadFile.mkdirs();
+                } else {
+                    // 如果父类文件夹不存在,那就生成
+                    if (!loadFile.getParentFile().exists()) {
+                        loadFile.getParentFile().mkdirs();
+                    }
+                    outputStream = new FileOutputStream(loadFile);
+                    inputStream = zipFile.getInputStream(zipEntry);
+                    while ((length = inputStream.read(b)) > 0) {
+                        outputStream.write(b, 0, length);
+                    }
+                }
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (IOException e1) {
+                    e1.printStackTrace();
+                }
+            }
+            if (outputStream != null) {
+                try {
+                    outputStream.close();
+                } catch (IOException e1) {
+                    e1.printStackTrace();
+                }
+            }
+        }
+        LOGGER.info(firstFileName);
+        return firstFileName;
+    }
+
+    /**
+     * 压缩成ZIP  一次性压缩多个文件
+     *
+     * @param srcFiles 需要压缩的文件列表
+     * @param zipFileName 压缩文件输出
+     * @throws RuntimeException 压缩失败会抛出运行时异常
+     */
+    public static void stringFileUrlToZip(String zipFileName, List<String> srcFiles) throws Exception {
+        long start = System.currentTimeMillis();
+        List<File> fileList = new ArrayList<>();
+        try {
+            for (String srcFile : srcFiles) {
+                File file = new File(srcFile);
+                if (!Checker.isNone(file)){
+                    fileList.add(file);
+                }
+            }
+            toZip(zipFileName, fileList);
+            long end = System.currentTimeMillis();
+            LOGGER.info("ZipFileUtil#stringFileUrlToZip 压缩完成,耗时:" + (end - start) + " 毫秒");
+        } catch (Exception e) {
+            throw new RuntimeException("stringFileUrlToZip zip error from ZipUtils", e);
+        }
+    }
+    /**
+     * 压缩成ZIP  一次性压缩多个文件
+     *
+     * @param srcFiles 需要压缩的文件列表
+     * @param zipFileName 压缩文件输出
+     * @throws RuntimeException 压缩失败会抛出运行时异常
+     */
+    public static void toZip(String zipFileName, List<File> srcFiles) throws Exception {
+        long start = System.currentTimeMillis();
+        ZipOutputStream zos = null;
+        try {
+            FileOutputStream fileOutputStream = new FileOutputStream(zipFileName);
+            zos = new ZipOutputStream(fileOutputStream);
+            for (File srcFile : srcFiles) {
+                compress(srcFile, zos, srcFile.getName(), true);
+            }
+            long end = System.currentTimeMillis();
+            LOGGER.info("ZipFileUtil#toZip 压缩完成,耗时:" + (end - start) + " 毫秒");
+        } catch (Exception e) {
+            throw new RuntimeException("zip error from ZipUtils", e);
+        } finally {
+            if (zos != null) {
+                try {
+                    zos.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    /**
+     * 递归压缩方法
+     *
+     * @param sourceFile       源文件
+     * @param zos              zip输出流
+     * @param name             压缩后的名称
+     * @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
+     *                         false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
+     * @throws Exception
+     */
+    public static void compress(File sourceFile, ZipOutputStream zos, String name,
+                                boolean KeepDirStructure) throws Exception {
+        byte[] buf = new byte[1024];
+        if (sourceFile.isFile()) {
+            // 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字
+            zos.putNextEntry(new ZipEntry(name));
+            // copy文件到zip输出流中
+            int len;
+            FileInputStream in = new FileInputStream(sourceFile);
+            while ((len = in.read(buf)) != -1) {
+                zos.write(buf, 0, len);
+            }
+            // Complete the entry
+            zos.closeEntry();
+            in.close();
+        } else {
+            File[] listFiles = sourceFile.listFiles();
+            if (listFiles == null || listFiles.length == 0) {
+                // 需要保留原来的文件结构时,需要对空文件夹进行处理
+                if (KeepDirStructure) {
+                    // 空文件夹的处理
+                    zos.putNextEntry(new ZipEntry(name + "/"));
+                    // 没有文件,不需要文件的copy
+                    zos.closeEntry();
+                }
+            } else {
+                for (File file : listFiles) {
+                    // 判断是否需要保留原来的文件结构
+                    if (KeepDirStructure) {
+                        // 注意:file.getName()前面需要带上父文件夹的名字加一斜杠,
+                        // 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
+                        compress(file, zos, name + "/" + file.getName(), KeepDirStructure);
+                    } else {
+                        compress(file, zos, file.getName(), KeepDirStructure);
+                    }
+
+                }
+            }
+        }
+    }
+
+
+}

+ 970 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingApply.java

@@ -0,0 +1,970 @@
+package com.ywt.mg.domain.entities;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 数字营销-任务申请验收表
+ */
+@Table(name = "marketing_apply")
+@Entity
+public class MarketingApply implements Serializable {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * 主键id
+   */
+  @Id
+  @GeneratedValue(strategy = GenerationType.IDENTITY)
+  @Column(name = "id", insertable = false, nullable = false)
+  private Integer id;
+
+  /**
+   * 任务表ID,对应 marketing_project 表ID
+   */
+  @Column(name = "marketing_project_id", nullable = false)
+  private Integer marketingProjectId;
+
+  /**
+   * 用户的工种资料IDs, marketing_job_type_user 表IDs
+   */
+  @Column(name = "marketing_job_type_user_ids")
+  private String marketingJobTypeUserIds;
+
+  /**
+   * 任务编号
+   */
+  @Column(name = "biz_no", nullable = false)
+  private String bizNo;
+
+  /**
+   * 任务名称
+   */
+  @Column(name = "name", nullable = false)
+  private String name;
+
+  /**
+   * 任务类型ID,对应 sys_dict_type_item 表ID
+   */
+  @Column(name = "project_type_id", nullable = false)
+  private String projectTypeId;
+
+  /**
+   * 任务类型名称,对应 sys_dict_type_item 表(type_code:marketing_project_type) item_name
+   */
+  @Column(name = "project_type_name", nullable = false)
+  private String projectTypeName = "";
+
+  /**
+   * 验收资料备注
+   */
+  @Column(name = "material_acceptance_remark")
+  private String materialAcceptanceRemark = "";
+
+  /**
+   * 申请人ID,对应user表ID
+   */
+  @Column(name = "apply_user_id", nullable = false)
+  private Integer applyUserId = 0;
+
+  /**
+   * 申请人
+   */
+  @Column(name = "apply_name", nullable = false)
+  private String applyName = "";
+
+  /**
+   * 申请手机号
+   */
+  @Column(name = "apply_mobile", nullable = false)
+  private String applyMobile = "";
+
+  /**
+   * 任务申请审核状态,0-待审核、1-审核通过、2-审核不通过
+   */
+  @Column(name = "apply_audit_status")
+  private Integer applyAuditStatus = 0;
+
+  /**
+   * 任务申请审核备注
+   */
+  @Column(name = "apply_audit_remark")
+  private String applyAuditRemark = "";
+
+  /**
+   * 资料验收审核状态,0-待审核、1-审核通过、2-审核不通过
+   */
+  @Column(name = "material_acceptance_status")
+  private Integer materialAcceptanceStatus = 0;
+
+  /**
+   * 资料验收审核状态备注
+   */
+  @Column(name = "material_acceptance_audit_remark")
+  private String materialAcceptanceAuditRemark = "";
+
+  /**
+   * 是否删除,0-否,1-是
+   */
+  @Column(name = "deleted", nullable = false)
+  private Integer deleted = 0;
+
+  /**
+   * 创建时间
+   */
+  @Column(name = "create_time", nullable = false)
+  private Date createTime;
+
+  /**
+   * 修改时间
+   */
+  @Column(name = "update_time", nullable = false)
+  private Date updateTime;
+
+  /**
+   * 审核人姓名
+   */
+  @Column(name = "check_name")
+  private String checkName;
+
+  /**
+   * 验收人姓名
+   */
+  @Column(name = "accept_name")
+  private String acceptName;
+
+  /**
+   * 上一次申请的id,对应marketing_apply 主键 id
+   */
+  @Column(name = "before_apply_id")
+  private Integer beforeApplyId;
+
+  /**
+   * 企业id
+   */
+  @Column(name = "enterprise_id")
+  private Integer enterpriseId;
+
+  /**
+   * 是否需要认证资料,0-否,1-是
+   */
+  @Column(name = "need_certification")
+  private Integer needCertification = 0;
+
+  /**
+   * 提交验收资料时间时间
+   */
+  @Column(name = "submit_time")
+  private Date submitTime;
+
+  /**
+   * 年龄要求,如:20岁≤年龄≤40岁
+   */
+  @Column(name = "apply_age_requirements")
+  private String applyAgeRequirements;
+
+  /**
+   * 经验要求
+   */
+  @Column(name = "apply_experience_requirements")
+  private String applyExperienceRequirements;
+
+  /**
+   * 学历要求名称,中间用","隔开,对应 sys_dict_type_item 表(type_code:marketing_degree_type) item_name
+   */
+  @Column(name = "degree_type_name")
+  private String degreeTypeName;
+
+  /**
+   * 发布时间
+   */
+  @Column(name = "release_time")
+  private Date releaseTime;
+
+  /**
+   * 截止时间
+   */
+  @Column(name = "end_time")
+  private Date endTime;
+
+  /**
+   * 工作方式名称,对应 sys_dict_type_item 表(type_code:marketing_work_way) item_name
+   */
+  @Column(name = "marketing_work_way_name")
+  private String marketingWorkWayName;
+
+  /**
+   * 工作时间名称,对应 sys_dict_type_item 表(type_code:marketing_work_time) item_name
+   */
+  @Column(name = "marketing_work_time_name")
+  private String marketingWorkTimeName;
+
+  /**
+   * 任务周期-开始时间
+   */
+  @Column(name = "task_cycle_start")
+  private Date taskCycleStart;
+
+  /**
+   * 任务周期-截止时间
+   */
+  @Column(name = "task_cycle_end")
+  private Date taskCycleEnd;
+
+  /**
+   * 项目备注
+   */
+  @Column(name = "project_remark")
+  private String projectRemark;
+
+  /**
+   * 是否正常,0-正常,1-禁用
+   */
+  @Column(name = "project_status")
+  private Integer projectStatus = 0;
+
+  /**
+   * 项目手机号
+   */
+  @Column(name = "project_mobile")
+  private String projectMobile = "";
+
+  /**
+   * 任务描述
+   */
+  @Column(name = "project_describe")
+  private String projectDescribe;
+
+  /**
+   * 金额,格式:2k~4k、面谈等
+   */
+  @Column(name = "total")
+  private String total = "";
+
+  /**
+   * 名额,如:100人
+   */
+  @Column(name = "places")
+  private String places = "";
+
+  /**
+   * 性别要求名称,对应 sys_dict_type_item 表(type_code:marketing_gender_requirements) item_name
+   */
+  @Column(name = "apply_gender_requirements_name")
+  private String applyGenderRequirementsName;
+
+  /**
+   * 附件id, 对应marketing_image 主键id
+   */
+  @Column(name = "file_ids")
+  private String fileIds;
+
+  /**
+   * 工作地点
+   */
+  @Column(name = "work_address")
+  private String workAddress = "";
+
+  /**
+   * 创建企业
+   */
+  @Column(name = "enterprise_name")
+  private String enterpriseName;
+
+  /**
+   * 工种详情
+   */
+  @Column(name = "job_detail")
+  private String jobDetail;
+
+  /**
+   * 辨别是否是后台上传的验收资料,0为用户上传,1为后台上传
+   */
+  @Column(name = "upload")
+  private Integer upload = 0;
+
+  /**
+   * 主键id
+   */
+  public Integer getId() {
+    return id;
+  }
+
+  /**
+   * 主键id
+   */
+  public void setId(Integer id) {
+    this.id = id;
+  }
+
+  /**
+   * 任务表ID,对应 marketing_project 表ID
+   */
+  public Integer getMarketingProjectId() {
+    return marketingProjectId;
+  }
+
+  /**
+   * 任务表ID,对应 marketing_project 表ID
+   */
+  public void setMarketingProjectId(Integer marketingProjectId) {
+    this.marketingProjectId = marketingProjectId;
+  }
+
+  /**
+   * 用户的工种资料IDs, marketing_job_type_user 表IDs
+   */
+  public String getMarketingJobTypeUserIds() {
+    return marketingJobTypeUserIds;
+  }
+
+  /**
+   * 用户的工种资料IDs, marketing_job_type_user 表IDs
+   */
+  public void setMarketingJobTypeUserIds(String marketingJobTypeUserIds) {
+    this.marketingJobTypeUserIds = marketingJobTypeUserIds;
+  }
+
+  /**
+   * 任务编号
+   */
+  public String getBizNo() {
+    return bizNo;
+  }
+
+  /**
+   * 任务编号
+   */
+  public void setBizNo(String bizNo) {
+    this.bizNo = bizNo;
+  }
+
+  /**
+   * 任务名称
+   */
+  public String getName() {
+    return name;
+  }
+
+  /**
+   * 任务名称
+   */
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  /**
+   * 任务类型ID,对应 sys_dict_type_item 表ID
+   */
+  public String getProjectTypeId() {
+    return projectTypeId;
+  }
+
+  /**
+   * 任务类型ID,对应 sys_dict_type_item 表ID
+   */
+  public void setProjectTypeId(String projectTypeId) {
+    this.projectTypeId = projectTypeId;
+  }
+
+  /**
+   * 任务类型名称,对应 sys_dict_type_item 表(type_code:marketing_project_type) item_name
+   */
+  public String getProjectTypeName() {
+    return projectTypeName;
+  }
+
+  /**
+   * 任务类型名称,对应 sys_dict_type_item 表(type_code:marketing_project_type) item_name
+   */
+  public void setProjectTypeName(String projectTypeName) {
+    this.projectTypeName = projectTypeName;
+  }
+
+  /**
+   * 验收资料备注
+   */
+  public String getMaterialAcceptanceRemark() {
+    return materialAcceptanceRemark;
+  }
+
+  /**
+   * 验收资料备注
+   */
+  public void setMaterialAcceptanceRemark(String materialAcceptanceRemark) {
+    this.materialAcceptanceRemark = materialAcceptanceRemark;
+  }
+
+  /**
+   * 申请人ID,对应user表ID
+   */
+  public Integer getApplyUserId() {
+    return applyUserId;
+  }
+
+  /**
+   * 申请人ID,对应user表ID
+   */
+  public void setApplyUserId(Integer applyUserId) {
+    this.applyUserId = applyUserId;
+  }
+
+  /**
+   * 申请人
+   */
+  public String getApplyName() {
+    return applyName;
+  }
+
+  /**
+   * 申请人
+   */
+  public void setApplyName(String applyName) {
+    this.applyName = applyName;
+  }
+
+  /**
+   * 申请手机号
+   */
+  public String getApplyMobile() {
+    return applyMobile;
+  }
+
+  /**
+   * 申请手机号
+   */
+  public void setApplyMobile(String applyMobile) {
+    this.applyMobile = applyMobile;
+  }
+
+  /**
+   * 任务申请审核状态,0-待审核、1-审核通过、2-审核不通过
+   */
+  public Integer getApplyAuditStatus() {
+    return applyAuditStatus;
+  }
+
+  /**
+   * 任务申请审核状态,0-待审核、1-审核通过、2-审核不通过
+   */
+  public void setApplyAuditStatus(Integer applyAuditStatus) {
+    this.applyAuditStatus = applyAuditStatus;
+  }
+
+  /**
+   * 任务申请审核备注
+   */
+  public String getApplyAuditRemark() {
+    return applyAuditRemark;
+  }
+
+  /**
+   * 任务申请审核备注
+   */
+  public void setApplyAuditRemark(String applyAuditRemark) {
+    this.applyAuditRemark = applyAuditRemark;
+  }
+
+  /**
+   * 资料验收审核状态,0-待审核、1-审核通过、2-审核不通过
+   */
+  public Integer getMaterialAcceptanceStatus() {
+    return materialAcceptanceStatus;
+  }
+
+  /**
+   * 资料验收审核状态,0-待审核、1-审核通过、2-审核不通过
+   */
+  public void setMaterialAcceptanceStatus(Integer materialAcceptanceStatus) {
+    this.materialAcceptanceStatus = materialAcceptanceStatus;
+  }
+
+  /**
+   * 资料验收审核状态备注
+   */
+  public String getMaterialAcceptanceAuditRemark() {
+    return materialAcceptanceAuditRemark;
+  }
+
+  /**
+   * 资料验收审核状态备注
+   */
+  public void setMaterialAcceptanceAuditRemark(String materialAcceptanceAuditRemark) {
+    this.materialAcceptanceAuditRemark = materialAcceptanceAuditRemark;
+  }
+
+  /**
+   * 是否删除,0-否,1-是
+   */
+  public Integer getDeleted() {
+    return deleted;
+  }
+
+  /**
+   * 是否删除,0-否,1-是
+   */
+  public void setDeleted(Integer deleted) {
+    this.deleted = deleted;
+  }
+
+  /**
+   * 创建时间
+   */
+  public Date getCreateTime() {
+    return createTime;
+  }
+
+  /**
+   * 创建时间
+   */
+  public void setCreateTime(Date createTime) {
+    this.createTime = createTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public Date getUpdateTime() {
+    return updateTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public void setUpdateTime(Date updateTime) {
+    this.updateTime = updateTime;
+  }
+
+  /**
+   * 审核人姓名
+   */
+  public String getCheckName() {
+    return checkName;
+  }
+
+  /**
+   * 审核人姓名
+   */
+  public void setCheckName(String checkName) {
+    this.checkName = checkName;
+  }
+
+  /**
+   * 验收人姓名
+   */
+  public String getAcceptName() {
+    return acceptName;
+  }
+
+  /**
+   * 验收人姓名
+   */
+  public void setAcceptName(String acceptName) {
+    this.acceptName = acceptName;
+  }
+
+  /**
+   * 上一次申请的id,对应marketing_apply 主键 id
+   */
+  public Integer getBeforeApplyId() {
+    return beforeApplyId;
+  }
+
+  /**
+   * 上一次申请的id,对应marketing_apply 主键 id
+   */
+  public void setBeforeApplyId(Integer beforeApplyId) {
+    this.beforeApplyId = beforeApplyId;
+  }
+
+  /**
+   * 企业id
+   */
+  public Integer getEnterpriseId() {
+    return enterpriseId;
+  }
+
+  /**
+   * 企业id
+   */
+  public void setEnterpriseId(Integer enterpriseId) {
+    this.enterpriseId = enterpriseId;
+  }
+
+  /**
+   * 是否需要认证资料,0-否,1-是
+   */
+  public Integer getNeedCertification() {
+    return needCertification;
+  }
+
+  /**
+   * 是否需要认证资料,0-否,1-是
+   */
+  public void setNeedCertification(Integer needCertification) {
+    this.needCertification = needCertification;
+  }
+
+  /**
+   * 提交验收资料时间时间
+   */
+  public Date getSubmitTime() {
+    return submitTime;
+  }
+
+  /**
+   * 提交验收资料时间时间
+   */
+  public void setSubmitTime(Date submitTime) {
+    this.submitTime = submitTime;
+  }
+
+  /**
+   * 年龄要求,如:20岁≤年龄≤40岁
+   */
+  public String getApplyAgeRequirements() {
+    return applyAgeRequirements;
+  }
+
+  /**
+   * 年龄要求,如:20岁≤年龄≤40岁
+   */
+  public void setApplyAgeRequirements(String applyAgeRequirements) {
+    this.applyAgeRequirements = applyAgeRequirements;
+  }
+
+  /**
+   * 经验要求
+   */
+  public String getApplyExperienceRequirements() {
+    return applyExperienceRequirements;
+  }
+
+  /**
+   * 经验要求
+   */
+  public void setApplyExperienceRequirements(String applyExperienceRequirements) {
+    this.applyExperienceRequirements = applyExperienceRequirements;
+  }
+
+  /**
+   * 学历要求名称,中间用","隔开,对应 sys_dict_type_item 表(type_code:marketing_degree_type) item_name
+   */
+  public String getDegreeTypeName() {
+    return degreeTypeName;
+  }
+
+  /**
+   * 学历要求名称,中间用","隔开,对应 sys_dict_type_item 表(type_code:marketing_degree_type) item_name
+   */
+  public void setDegreeTypeName(String degreeTypeName) {
+    this.degreeTypeName = degreeTypeName;
+  }
+
+  /**
+   * 发布时间
+   */
+  public Date getReleaseTime() {
+    return releaseTime;
+  }
+
+  /**
+   * 发布时间
+   */
+  public void setReleaseTime(Date releaseTime) {
+    this.releaseTime = releaseTime;
+  }
+
+  /**
+   * 截止时间
+   */
+  public Date getEndTime() {
+    return endTime;
+  }
+
+  /**
+   * 截止时间
+   */
+  public void setEndTime(Date endTime) {
+    this.endTime = endTime;
+  }
+
+  /**
+   * 工作方式名称,对应 sys_dict_type_item 表(type_code:marketing_work_way) item_name
+   */
+  public String getMarketingWorkWayName() {
+    return marketingWorkWayName;
+  }
+
+  /**
+   * 工作方式名称,对应 sys_dict_type_item 表(type_code:marketing_work_way) item_name
+   */
+  public void setMarketingWorkWayName(String marketingWorkWayName) {
+    this.marketingWorkWayName = marketingWorkWayName;
+  }
+
+  /**
+   * 工作时间名称,对应 sys_dict_type_item 表(type_code:marketing_work_time) item_name
+   */
+  public String getMarketingWorkTimeName() {
+    return marketingWorkTimeName;
+  }
+
+  /**
+   * 工作时间名称,对应 sys_dict_type_item 表(type_code:marketing_work_time) item_name
+   */
+  public void setMarketingWorkTimeName(String marketingWorkTimeName) {
+    this.marketingWorkTimeName = marketingWorkTimeName;
+  }
+
+  /**
+   * 任务周期-开始时间
+   */
+  public Date getTaskCycleStart() {
+    return taskCycleStart;
+  }
+
+  /**
+   * 任务周期-开始时间
+   */
+  public void setTaskCycleStart(Date taskCycleStart) {
+    this.taskCycleStart = taskCycleStart;
+  }
+
+  /**
+   * 任务周期-截止时间
+   */
+  public Date getTaskCycleEnd() {
+    return taskCycleEnd;
+  }
+
+  /**
+   * 任务周期-截止时间
+   */
+  public void setTaskCycleEnd(Date taskCycleEnd) {
+    this.taskCycleEnd = taskCycleEnd;
+  }
+
+  /**
+   * 项目备注
+   */
+  public String getProjectRemark() {
+    return projectRemark;
+  }
+
+  /**
+   * 项目备注
+   */
+  public void setProjectRemark(String projectRemark) {
+    this.projectRemark = projectRemark;
+  }
+
+  /**
+   * 是否正常,0-正常,1-禁用
+   */
+  public Integer getProjectStatus() {
+    return projectStatus;
+  }
+
+  /**
+   * 是否正常,0-正常,1-禁用
+   */
+  public void setProjectStatus(Integer projectStatus) {
+    this.projectStatus = projectStatus;
+  }
+
+  /**
+   * 项目手机号
+   */
+  public String getProjectMobile() {
+    return projectMobile;
+  }
+
+  /**
+   * 项目手机号
+   */
+  public void setProjectMobile(String projectMobile) {
+    this.projectMobile = projectMobile;
+  }
+
+  /**
+   * 任务描述
+   */
+  public String getProjectDescribe() {
+    return projectDescribe;
+  }
+
+  /**
+   * 任务描述
+   */
+  public void setProjectDescribe(String projectDescribe) {
+    this.projectDescribe = projectDescribe;
+  }
+
+  /**
+   * 金额,格式:2k~4k、面谈等
+   */
+  public String getTotal() {
+    return total;
+  }
+
+  /**
+   * 金额,格式:2k~4k、面谈等
+   */
+  public void setTotal(String total) {
+    this.total = total;
+  }
+
+  /**
+   * 名额,如:100人
+   */
+  public String getPlaces() {
+    return places;
+  }
+
+  /**
+   * 名额,如:100人
+   */
+  public void setPlaces(String places) {
+    this.places = places;
+  }
+
+  /**
+   * 性别要求名称,对应 sys_dict_type_item 表(type_code:marketing_gender_requirements) item_name
+   */
+  public String getApplyGenderRequirementsName() {
+    return applyGenderRequirementsName;
+  }
+
+  /**
+   * 性别要求名称,对应 sys_dict_type_item 表(type_code:marketing_gender_requirements) item_name
+   */
+  public void setApplyGenderRequirementsName(String applyGenderRequirementsName) {
+    this.applyGenderRequirementsName = applyGenderRequirementsName;
+  }
+
+  /**
+   * 附件id, 对应marketing_image 主键id
+   */
+  public String getFileIds() {
+    return fileIds;
+  }
+
+  /**
+   * 附件id, 对应marketing_image 主键id
+   */
+  public void setFileIds(String fileIds) {
+    this.fileIds = fileIds;
+  }
+
+  /**
+   * 工作地点
+   */
+  public String getWorkAddress() {
+    return workAddress;
+  }
+
+  /**
+   * 工作地点
+   */
+  public void setWorkAddress(String workAddress) {
+    this.workAddress = workAddress;
+  }
+
+  /**
+   * 创建企业
+   */
+  public String getEnterpriseName() {
+    return enterpriseName;
+  }
+
+  /**
+   * 创建企业
+   */
+  public void setEnterpriseName(String enterpriseName) {
+    this.enterpriseName = enterpriseName;
+  }
+
+  /**
+   * 工种详情
+   */
+  public String getJobDetail() {
+    return jobDetail;
+  }
+
+  /**
+   * 工种详情
+   */
+  public void setJobDetail(String jobDetail) {
+    this.jobDetail = jobDetail;
+  }
+
+  /**
+   * 辨别是否是后台上传的验收资料,0为用户上传,1为后台上传
+   */
+  public Integer getUpload() {
+    return upload;
+  }
+
+  /**
+   * 辨别是否是后台上传的验收资料,0为用户上传,1为后台上传
+   */
+  public void setUpload(Integer upload) {
+    this.upload = upload;
+  }
+
+  public String toString() {
+    return "MarketingApply{id=" + id + 
+      ", marketingProjectId=" + marketingProjectId + 
+      ", marketingJobTypeUserIds=" + marketingJobTypeUserIds + 
+      ", bizNo=" + bizNo + 
+      ", name=" + name + 
+      ", projectTypeId=" + projectTypeId + 
+      ", projectTypeName=" + projectTypeName + 
+      ", materialAcceptanceRemark=" + materialAcceptanceRemark + 
+      ", applyUserId=" + applyUserId + 
+      ", applyName=" + applyName + 
+      ", applyMobile=" + applyMobile + 
+      ", applyAuditStatus=" + applyAuditStatus + 
+      ", applyAuditRemark=" + applyAuditRemark + 
+      ", materialAcceptanceStatus=" + materialAcceptanceStatus + 
+      ", materialAcceptanceAuditRemark=" + materialAcceptanceAuditRemark + 
+      ", deleted=" + deleted + 
+      ", createTime=" + createTime + 
+      ", updateTime=" + updateTime + 
+      ", checkName=" + checkName + 
+      ", acceptName=" + acceptName + 
+      ", beforeApplyId=" + beforeApplyId + 
+      ", enterpriseId=" + enterpriseId + 
+      ", needCertification=" + needCertification + 
+      ", submitTime=" + submitTime + 
+      ", applyAgeRequirements=" + applyAgeRequirements + 
+      ", applyExperienceRequirements=" + applyExperienceRequirements + 
+      ", degreeTypeName=" + degreeTypeName + 
+      ", releaseTime=" + releaseTime + 
+      ", endTime=" + endTime + 
+      ", marketingWorkWayName=" + marketingWorkWayName + 
+      ", marketingWorkTimeName=" + marketingWorkTimeName + 
+      ", taskCycleStart=" + taskCycleStart + 
+      ", taskCycleEnd=" + taskCycleEnd + 
+      ", projectRemark=" + projectRemark + 
+      ", projectStatus=" + projectStatus + 
+      ", projectMobile=" + projectMobile + 
+      ", projectDescribe=" + projectDescribe + 
+      ", total=" + total + 
+      ", places=" + places + 
+      ", applyGenderRequirementsName=" + applyGenderRequirementsName + 
+      ", fileIds=" + fileIds + 
+      ", workAddress=" + workAddress + 
+      ", enterpriseName=" + enterpriseName + 
+      ", jobDetail=" + jobDetail + 
+      ", upload=" + upload + 
+      "}";
+  }
+}

+ 9 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingApplyRepository.java

@@ -0,0 +1,9 @@
+package com.ywt.mg.domain.entities;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import com.ywt.mg.domain.entities.MarketingApply;
+
+public interface MarketingApplyRepository extends JpaRepository<MarketingApply, Integer>, JpaSpecificationExecutor<MarketingApply> {
+
+}

+ 151 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingCollection.java

@@ -0,0 +1,151 @@
+package com.ywt.mg.domain.entities;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 数字营销-收藏表
+ */
+@Table(name = "marketing_collection")
+@Entity
+public class MarketingCollection implements Serializable {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * 主键id
+   */
+  @Id
+  @GeneratedValue(strategy = GenerationType.IDENTITY)
+  @Column(name = "id", insertable = false, nullable = false)
+  private Integer id;
+
+  /**
+   * 任务表ID,对应 marketing_project 表ID
+   */
+  @Column(name = "marketing_project_id", nullable = false)
+  private Integer marketingProjectId;
+
+  /**
+   * 用户ID,对应user表ID
+   */
+  @Column(name = "user_id", nullable = false)
+  private Integer userId = 0;
+
+  /**
+   * 是否删除,0-否,1-是
+   */
+  @Column(name = "deleted", nullable = false)
+  private Integer deleted = 0;
+
+  /**
+   * 创建时间
+   */
+  @Column(name = "create_time", nullable = false)
+  private Date createTime;
+
+  /**
+   * 修改时间
+   */
+  @Column(name = "update_time", nullable = false)
+  private Date updateTime;
+
+  /**
+   * 主键id
+   */
+  public Integer getId() {
+    return id;
+  }
+
+  /**
+   * 主键id
+   */
+  public void setId(Integer id) {
+    this.id = id;
+  }
+
+  /**
+   * 任务表ID,对应 marketing_project 表ID
+   */
+  public Integer getMarketingProjectId() {
+    return marketingProjectId;
+  }
+
+  /**
+   * 任务表ID,对应 marketing_project 表ID
+   */
+  public void setMarketingProjectId(Integer marketingProjectId) {
+    this.marketingProjectId = marketingProjectId;
+  }
+
+  /**
+   * 用户ID,对应user表ID
+   */
+  public Integer getUserId() {
+    return userId;
+  }
+
+  /**
+   * 用户ID,对应user表ID
+   */
+  public void setUserId(Integer userId) {
+    this.userId = userId;
+  }
+
+  /**
+   * 是否删除,0-否,1-是
+   */
+  public Integer getDeleted() {
+    return deleted;
+  }
+
+  /**
+   * 是否删除,0-否,1-是
+   */
+  public void setDeleted(Integer deleted) {
+    this.deleted = deleted;
+  }
+
+  /**
+   * 创建时间
+   */
+  public Date getCreateTime() {
+    return createTime;
+  }
+
+  /**
+   * 创建时间
+   */
+  public void setCreateTime(Date createTime) {
+    this.createTime = createTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public Date getUpdateTime() {
+    return updateTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public void setUpdateTime(Date updateTime) {
+    this.updateTime = updateTime;
+  }
+
+  public String toString() {
+    return "MarketingCollection{id=" + id + 
+      ", marketingProjectId=" + marketingProjectId + 
+      ", userId=" + userId + 
+      ", deleted=" + deleted + 
+      ", createTime=" + createTime + 
+      ", updateTime=" + updateTime + 
+      "}";
+  }
+}

+ 9 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingCollectionRepository.java

@@ -0,0 +1,9 @@
+package com.ywt.mg.domain.entities;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import com.ywt.mg.domain.entities.MarketingCollection;
+
+public interface MarketingCollectionRepository extends JpaRepository<MarketingCollection, Integer>, JpaSpecificationExecutor<MarketingCollection> {
+
+}

+ 340 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingImage.java

@@ -0,0 +1,340 @@
+package com.ywt.mg.domain.entities;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 数字营销-图片表
+ */
+@Entity
+@Table(name = "marketing_image")
+public class MarketingImage implements Serializable {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * 数字营销图片表ID
+   */
+  @Id
+  @GeneratedValue(strategy = GenerationType.IDENTITY)
+  @Column(name = "id", insertable = false, nullable = false)
+  private Integer id;
+
+  /**
+   * 用户ID,对应 user 表ID
+   */
+  @Column(name = "user_id", nullable = false)
+  private Integer userId = 0;
+
+  /**
+   * 任务ID,对应 marketing_project 表ID
+   */
+  @Column(name = "project_id")
+  private Integer projectId = 0;
+
+  /**
+   * 用户工种信息ID,对应 marketing_job_type_user 表ID
+   */
+  @Column(name = "job_type_user_id", nullable = false)
+  private Integer jobTypeUserId;
+
+  /**
+   * 工种类型ID,对应 sys_dict_type_item 表ID
+   */
+  @Column(name = "job_type_id", nullable = false)
+  private Integer jobTypeId = 0;
+
+  /**
+   * 工种类型名称,对应 sys_dict_type_item 表(type_code:marketing_job_type) item_name
+   */
+  @Column(name = "job_type_name", nullable = false)
+  private String jobTypeName = "";
+
+  /**
+   * 文件(word、pdf、图片)名称
+   */
+  @Column(name = "name")
+  private String name;
+
+  /**
+   * 图片链接
+   */
+  @Column(name = "image_url", nullable = false)
+  private String imageUrl;
+
+  /**
+   * 图片类型,1-医药代表,2-医生,3-护士,4-药师,5-任务附件(可以是word、pdf、图片),6-验收资料
+   */
+  @Column(name = "type")
+  private Integer type = 0;
+
+  /**
+   * 图片审核状态,0-待审核,1-审核通过,2-审核不通过
+   */
+  @Column(name = "status")
+  private Integer status = 0;
+
+  /**
+   * 是否删除
+   */
+  @Column(name = "deleted", nullable = false)
+  private Integer deleted = 0;
+
+  /**
+   * 创建时间
+   */
+  @Column(name = "create_time", nullable = false)
+  private Date createTime;
+
+  /**
+   * 修改时间
+   */
+  @Column(name = "update_time", nullable = false)
+  private Date updateTime;
+
+  /**
+   * 申请表id
+   */
+  @Column(name = "apply_id")
+  private Integer applyId;
+
+  /**
+   * 文件类型(jpg,pdf,docx)
+   */
+  @Column(name = "image_type")
+  private String imageType;
+
+  /**
+   * 数字营销图片表ID
+   */
+  public Integer getId() {
+    return id;
+  }
+
+  /**
+   * 数字营销图片表ID
+   */
+  public void setId(Integer id) {
+    this.id = id;
+  }
+
+  /**
+   * 用户ID,对应 user 表ID
+   */
+  public Integer getUserId() {
+    return userId;
+  }
+
+  /**
+   * 用户ID,对应 user 表ID
+   */
+  public void setUserId(Integer userId) {
+    this.userId = userId;
+  }
+
+  /**
+   * 任务ID,对应 marketing_project 表ID
+   */
+  public Integer getProjectId() {
+    return projectId;
+  }
+
+  /**
+   * 任务ID,对应 marketing_project 表ID
+   */
+  public void setProjectId(Integer projectId) {
+    this.projectId = projectId;
+  }
+
+  /**
+   * 用户工种信息ID,对应 marketing_job_type_user 表ID
+   */
+  public Integer getJobTypeUserId() {
+    return jobTypeUserId;
+  }
+
+  /**
+   * 用户工种信息ID,对应 marketing_job_type_user 表ID
+   */
+  public void setJobTypeUserId(Integer jobTypeUserId) {
+    this.jobTypeUserId = jobTypeUserId;
+  }
+
+  /**
+   * 工种类型ID,对应 sys_dict_type_item 表ID
+   */
+  public Integer getJobTypeId() {
+    return jobTypeId;
+  }
+
+  /**
+   * 工种类型ID,对应 sys_dict_type_item 表ID
+   */
+  public void setJobTypeId(Integer jobTypeId) {
+    this.jobTypeId = jobTypeId;
+  }
+
+  /**
+   * 工种类型名称,对应 sys_dict_type_item 表(type_code:marketing_job_type) item_name
+   */
+  public String getJobTypeName() {
+    return jobTypeName;
+  }
+
+  /**
+   * 工种类型名称,对应 sys_dict_type_item 表(type_code:marketing_job_type) item_name
+   */
+  public void setJobTypeName(String jobTypeName) {
+    this.jobTypeName = jobTypeName;
+  }
+
+  /**
+   * 文件(word、pdf、图片)名称
+   */
+  public String getName() {
+    return name;
+  }
+
+  /**
+   * 文件(word、pdf、图片)名称
+   */
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  /**
+   * 图片链接
+   */
+  public String getImageUrl() {
+    return imageUrl;
+  }
+
+  /**
+   * 图片链接
+   */
+  public void setImageUrl(String imageUrl) {
+    this.imageUrl = imageUrl;
+  }
+
+  /**
+   * 图片类型,1-医药代表,2-医生,3-护士,4-药师,5-任务附件(可以是word、pdf、图片),6-验收资料
+   */
+  public Integer getType() {
+    return type;
+  }
+
+  /**
+   * 图片类型,1-医药代表,2-医生,3-护士,4-药师,5-任务附件(可以是word、pdf、图片),6-验收资料
+   */
+  public void setType(Integer type) {
+    this.type = type;
+  }
+
+  /**
+   * 图片审核状态,0-待审核,1-审核通过,2-审核不通过
+   */
+  public Integer getStatus() {
+    return status;
+  }
+
+  /**
+   * 图片审核状态,0-待审核,1-审核通过,2-审核不通过
+   */
+  public void setStatus(Integer status) {
+    this.status = status;
+  }
+
+  /**
+   * 是否删除
+   */
+  public Integer getDeleted() {
+    return deleted;
+  }
+
+  /**
+   * 是否删除
+   */
+  public void setDeleted(Integer deleted) {
+    this.deleted = deleted;
+  }
+
+  /**
+   * 创建时间
+   */
+  public Date getCreateTime() {
+    return createTime;
+  }
+
+  /**
+   * 创建时间
+   */
+  public void setCreateTime(Date createTime) {
+    this.createTime = createTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public Date getUpdateTime() {
+    return updateTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public void setUpdateTime(Date updateTime) {
+    this.updateTime = updateTime;
+  }
+
+  /**
+   * 申请表id
+   */
+  public Integer getApplyId() {
+    return applyId;
+  }
+
+  /**
+   * 申请表id
+   */
+  public void setApplyId(Integer applyId) {
+    this.applyId = applyId;
+  }
+
+  /**
+   * 文件类型(jpg,pdf,docx)
+   */
+  public String getImageType() {
+    return imageType;
+  }
+
+  /**
+   * 文件类型(jpg,pdf,docx)
+   */
+  public void setImageType(String imageType) {
+    this.imageType = imageType;
+  }
+
+  public String toString() {
+    return "MarketingImage{id=" + id + 
+      ", userId=" + userId + 
+      ", projectId=" + projectId + 
+      ", jobTypeUserId=" + jobTypeUserId + 
+      ", jobTypeId=" + jobTypeId + 
+      ", jobTypeName=" + jobTypeName + 
+      ", name=" + name + 
+      ", imageUrl=" + imageUrl + 
+      ", type=" + type + 
+      ", status=" + status + 
+      ", deleted=" + deleted + 
+      ", createTime=" + createTime + 
+      ", updateTime=" + updateTime + 
+      ", applyId=" + applyId + 
+      ", imageType=" + imageType + 
+      "}";
+  }
+}

+ 9 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingImageRepository.java

@@ -0,0 +1,9 @@
+package com.ywt.mg.domain.entities;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import com.ywt.mg.domain.entities.MarketingImage;
+
+public interface MarketingImageRepository extends JpaRepository<MarketingImage, Integer>, JpaSpecificationExecutor<MarketingImage> {
+
+}

+ 193 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingJobTypeUser.java

@@ -0,0 +1,193 @@
+package com.ywt.mg.domain.entities;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 数字营销-用户工种信息表
+ */
+@Entity
+@Table(name = "marketing_job_type_user")
+public class MarketingJobTypeUser implements Serializable {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * 用户的工种资料ID
+   */
+  @Id
+  @GeneratedValue(strategy = GenerationType.IDENTITY)
+  @Column(name = "id", insertable = false, nullable = false)
+  private Integer id;
+
+  /**
+   * 用户ID,对应 user 表ID
+   */
+  @Column(name = "user_id", nullable = false)
+  private Integer userId;
+
+  /**
+   * 工种类型ID,对应 sys_dict_type_item 表ID
+   */
+  @Column(name = "job_type_id", nullable = false)
+  private Integer jobTypeId;
+
+  /**
+   * 工种类型名称,对应 sys_dict_type_item 表(type_code:marketing_job_type) item_name
+   */
+  @Column(name = "job_type_name", nullable = false)
+  private String jobTypeName = "";
+
+  /**
+   * 其他描述
+   */
+  @Column(name = "other_description")
+  private String otherDescription = "";
+
+  /**
+   * 是否删除
+   */
+  @Column(name = "deleted", nullable = false)
+  private Integer deleted = 0;
+
+  /**
+   * 创建时间
+   */
+  @Column(name = "create_time", nullable = false)
+  private Date createTime;
+
+  /**
+   * 修改时间
+   */
+  @Column(name = "update_time", nullable = false)
+  private Date updateTime;
+
+  /**
+   * 用户的工种资料ID
+   */
+  public Integer getId() {
+    return id;
+  }
+
+  /**
+   * 用户的工种资料ID
+   */
+  public void setId(Integer id) {
+    this.id = id;
+  }
+
+  /**
+   * 用户ID,对应 user 表ID
+   */
+  public Integer getUserId() {
+    return userId;
+  }
+
+  /**
+   * 用户ID,对应 user 表ID
+   */
+  public void setUserId(Integer userId) {
+    this.userId = userId;
+  }
+
+  /**
+   * 工种类型ID,对应 sys_dict_type_item 表ID
+   */
+  public Integer getJobTypeId() {
+    return jobTypeId;
+  }
+
+  /**
+   * 工种类型ID,对应 sys_dict_type_item 表ID
+   */
+  public void setJobTypeId(Integer jobTypeId) {
+    this.jobTypeId = jobTypeId;
+  }
+
+  /**
+   * 工种类型名称,对应 sys_dict_type_item 表(type_code:marketing_job_type) item_name
+   */
+  public String getJobTypeName() {
+    return jobTypeName;
+  }
+
+  /**
+   * 工种类型名称,对应 sys_dict_type_item 表(type_code:marketing_job_type) item_name
+   */
+  public void setJobTypeName(String jobTypeName) {
+    this.jobTypeName = jobTypeName;
+  }
+
+  /**
+   * 其他描述
+   */
+  public String getOtherDescription() {
+    return otherDescription;
+  }
+
+  /**
+   * 其他描述
+   */
+  public void setOtherDescription(String otherDescription) {
+    this.otherDescription = otherDescription;
+  }
+
+  /**
+   * 是否删除
+   */
+  public Integer getDeleted() {
+    return deleted;
+  }
+
+  /**
+   * 是否删除
+   */
+  public void setDeleted(Integer deleted) {
+    this.deleted = deleted;
+  }
+
+  /**
+   * 创建时间
+   */
+  public Date getCreateTime() {
+    return createTime;
+  }
+
+  /**
+   * 创建时间
+   */
+  public void setCreateTime(Date createTime) {
+    this.createTime = createTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public Date getUpdateTime() {
+    return updateTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public void setUpdateTime(Date updateTime) {
+    this.updateTime = updateTime;
+  }
+
+  public String toString() {
+    return "MarketingJobTypeUser{id=" + id + 
+      ", userId=" + userId + 
+      ", jobTypeId=" + jobTypeId + 
+      ", jobTypeName=" + jobTypeName + 
+      ", otherDescription=" + otherDescription + 
+      ", deleted=" + deleted + 
+      ", createTime=" + createTime + 
+      ", updateTime=" + updateTime + 
+      "}";
+  }
+}

+ 9 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingJobTypeUserRepository.java

@@ -0,0 +1,9 @@
+package com.ywt.mg.domain.entities;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import com.ywt.mg.domain.entities.MarketingJobTypeUser;
+
+public interface MarketingJobTypeUserRepository extends JpaRepository<MarketingJobTypeUser, Integer>, JpaSpecificationExecutor<MarketingJobTypeUser> {
+
+}

+ 736 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingProject.java

@@ -0,0 +1,736 @@
+package com.ywt.mg.domain.entities;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 数字营销-任务表
+ */
+@Entity
+@Table(name = "marketing_project")
+public class MarketingProject implements Serializable {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * 主键id
+   */
+  @Id
+  @Column(name = "id", insertable = false, nullable = false)
+  private Integer id;
+
+  /**
+   * 任务编号
+   */
+  @Column(name = "biz_no", nullable = false)
+  private String bizNo;
+
+  /**
+   * 任务名称
+   */
+  @Column(name = "name", nullable = false)
+  private String name;
+
+  /**
+   * 任务类型IDs,比如:",1,3,",对应 sys_dict_type_item 表ID
+   */
+  @Column(name = "project_type_ids", nullable = false)
+  private String projectTypeIds = "";
+
+  /**
+   * 任务类型名称,对应 sys_dict_type_item 表(type_code:marketing_project_type) item_name
+   */
+  @Column(name = "project_type_name", nullable = false)
+  private String projectTypeName = "";
+
+  /**
+   * 任务描述
+   */
+  @Column(name = "project_description", nullable = false)
+  private String projectDescription;
+
+  /**
+   * 金额,格式:2k~4k、面谈等
+   */
+  @Column(name = "total")
+  private String total = "";
+
+  /**
+   * 名额,如:100人
+   */
+  @Column(name = "places")
+  private String places = "";
+
+  /**
+   * 性别要求ID,对应 sys_dict_type_item 表ID
+   */
+  @Column(name = "apply_gender_requirements_id")
+  private Integer applyGenderRequirementsId;
+
+  /**
+   * 性别要求名称,对应 sys_dict_type_item 表(type_code:marketing_gender_requirements) item_name
+   */
+  @Column(name = "apply_gender_requirements_name")
+  private String applyGenderRequirementsName = "";
+
+  /**
+   * 年龄要求,如:20岁≤年龄≤40岁
+   */
+  @Column(name = "apply_age_requirements")
+  private String applyAgeRequirements = "";
+
+  /**
+   * 经验要求
+   */
+  @Column(name = "apply_experience_requirements")
+  private String applyExperienceRequirements = "";
+
+  /**
+   * 学历要求ID,对应 sys_dict_type_item 表ID
+   */
+  @Column(name = "degree_type_id")
+  private Integer degreeTypeId;
+
+  /**
+   * 学历要求名称,中间用","隔开,对应 sys_dict_type_item 表(type_code:marketing_degree_type) item_name
+   */
+  @Column(name = "degree_type_name")
+  private String degreeTypeName = "";
+
+  /**
+   * 发布时间
+   */
+  @Column(name = "release_time")
+  private Date releaseTime;
+
+  /**
+   * 截止时间
+   */
+  @Column(name = "end_time")
+  private Date endTime;
+
+  /**
+   * 工作地点
+   */
+  @Column(name = "work_address")
+  private String workAddress = "";
+
+  /**
+   * 工作方式ID,对应 sys_dict_type_item 表ID
+   */
+  @Column(name = "marketing_work_way_id")
+  private Integer marketingWorkWayId;
+
+  /**
+   * 工作方式名称,对应 sys_dict_type_item 表(type_code:marketing_work_way) item_name
+   */
+  @Column(name = "marketing_work_way_name")
+  private String marketingWorkWayName = "";
+
+  /**
+   * 工作时间ID,对应 sys_dict_type_item 表ID
+   */
+  @Column(name = "marketing_work_time_id")
+  private Integer marketingWorkTimeId;
+
+  /**
+   * 工作时间名称,对应 sys_dict_type_item 表(type_code:marketing_work_time) item_name
+   */
+  @Column(name = "marketing_work_time_name")
+  private String marketingWorkTimeName = "";
+
+  /**
+   * 任务周期-开始时间
+   */
+  @Column(name = "task_cycle_start")
+  private Date taskCycleStart;
+
+  /**
+   * 任务周期-截止时间
+   */
+  @Column(name = "task_cycle_end")
+  private Date taskCycleEnd;
+
+  /**
+   * 手机号
+   */
+  @Column(name = "mobile")
+  private String mobile = "";
+
+  /**
+   * 备注
+   */
+  @Column(name = "remark")
+  private String remark;
+
+  /**
+   * 是否需要认证资料,0-否,1-是
+   */
+  @Column(name = "need_certification")
+  private Integer needCertification = 0;
+
+  /**
+   * 是否正常,0-正常,1-禁用
+   */
+  @Column(name = "status")
+  private Integer status = 0;
+
+  /**
+   * 是否删除,0-否,1-是
+   */
+  @Column(name = "deleted", nullable = false)
+  private Integer deleted = 0;
+
+  /**
+   * 创建时间
+   */
+  @Column(name = "create_time", nullable = false)
+  private Date createTime;
+
+  /**
+   * 修改时间
+   */
+  @Column(name = "update_time", nullable = false)
+  private Date updateTime;
+
+  /**
+   * 创建人id
+   */
+  @Column(name = "create_admin_id")
+  private Integer createAdminId;
+
+  /**
+   * 创建人姓名
+   */
+  @Column(name = "create_admin_name")
+  private String createAdminName;
+
+  /**
+   * 创建企业,对应health_enterprise表
+   */
+  @Column(name = "enterprise_id")
+  private Integer enterpriseId;
+
+  /**
+   * 创建企业
+   */
+  @Column(name = "enterprise_name")
+  private String enterpriseName;
+
+  /**
+   * 主键id
+   */
+  public Integer getId() {
+    return id;
+  }
+
+  /**
+   * 主键id
+   */
+  public void setId(Integer id) {
+    this.id = id;
+  }
+
+  /**
+   * 任务编号
+   */
+  public String getBizNo() {
+    return bizNo;
+  }
+
+  /**
+   * 任务编号
+   */
+  public void setBizNo(String bizNo) {
+    this.bizNo = bizNo;
+  }
+
+  /**
+   * 任务名称
+   */
+  public String getName() {
+    return name;
+  }
+
+  /**
+   * 任务名称
+   */
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  /**
+   * 任务类型IDs,比如:",1,3,",对应 sys_dict_type_item 表ID
+   */
+  public String getProjectTypeIds() {
+    return projectTypeIds;
+  }
+
+  /**
+   * 任务类型IDs,比如:",1,3,",对应 sys_dict_type_item 表ID
+   */
+  public void setProjectTypeIds(String projectTypeIds) {
+    this.projectTypeIds = projectTypeIds;
+  }
+
+  /**
+   * 任务类型名称,对应 sys_dict_type_item 表(type_code:marketing_project_type) item_name
+   */
+  public String getProjectTypeName() {
+    return projectTypeName;
+  }
+
+  /**
+   * 任务类型名称,对应 sys_dict_type_item 表(type_code:marketing_project_type) item_name
+   */
+  public void setProjectTypeName(String projectTypeName) {
+    this.projectTypeName = projectTypeName;
+  }
+
+  /**
+   * 任务描述
+   */
+  public String getProjectDescription() {
+    return projectDescription;
+  }
+
+  /**
+   * 任务描述
+   */
+  public void setProjectDescription(String projectDescription) {
+    this.projectDescription = projectDescription;
+  }
+
+  /**
+   * 金额,格式:2k~4k、面谈等
+   */
+  public String getTotal() {
+    return total;
+  }
+
+  /**
+   * 金额,格式:2k~4k、面谈等
+   */
+  public void setTotal(String total) {
+    this.total = total;
+  }
+
+  /**
+   * 名额,如:100人
+   */
+  public String getPlaces() {
+    return places;
+  }
+
+  /**
+   * 名额,如:100人
+   */
+  public void setPlaces(String places) {
+    this.places = places;
+  }
+
+  /**
+   * 性别要求ID,对应 sys_dict_type_item 表ID
+   */
+  public Integer getApplyGenderRequirementsId() {
+    return applyGenderRequirementsId;
+  }
+
+  /**
+   * 性别要求ID,对应 sys_dict_type_item 表ID
+   */
+  public void setApplyGenderRequirementsId(Integer applyGenderRequirementsId) {
+    this.applyGenderRequirementsId = applyGenderRequirementsId;
+  }
+
+  /**
+   * 性别要求名称,对应 sys_dict_type_item 表(type_code:marketing_gender_requirements) item_name
+   */
+  public String getApplyGenderRequirementsName() {
+    return applyGenderRequirementsName;
+  }
+
+  /**
+   * 性别要求名称,对应 sys_dict_type_item 表(type_code:marketing_gender_requirements) item_name
+   */
+  public void setApplyGenderRequirementsName(String applyGenderRequirementsName) {
+    this.applyGenderRequirementsName = applyGenderRequirementsName;
+  }
+
+  /**
+   * 年龄要求,如:20岁≤年龄≤40岁
+   */
+  public String getApplyAgeRequirements() {
+    return applyAgeRequirements;
+  }
+
+  /**
+   * 年龄要求,如:20岁≤年龄≤40岁
+   */
+  public void setApplyAgeRequirements(String applyAgeRequirements) {
+    this.applyAgeRequirements = applyAgeRequirements;
+  }
+
+  /**
+   * 经验要求
+   */
+  public String getApplyExperienceRequirements() {
+    return applyExperienceRequirements;
+  }
+
+  /**
+   * 经验要求
+   */
+  public void setApplyExperienceRequirements(String applyExperienceRequirements) {
+    this.applyExperienceRequirements = applyExperienceRequirements;
+  }
+
+  /**
+   * 学历要求ID,对应 sys_dict_type_item 表ID
+   */
+  public Integer getDegreeTypeId() {
+    return degreeTypeId;
+  }
+
+  /**
+   * 学历要求ID,对应 sys_dict_type_item 表ID
+   */
+  public void setDegreeTypeId(Integer degreeTypeId) {
+    this.degreeTypeId = degreeTypeId;
+  }
+
+  /**
+   * 学历要求名称,中间用","隔开,对应 sys_dict_type_item 表(type_code:marketing_degree_type) item_name
+   */
+  public String getDegreeTypeName() {
+    return degreeTypeName;
+  }
+
+  /**
+   * 学历要求名称,中间用","隔开,对应 sys_dict_type_item 表(type_code:marketing_degree_type) item_name
+   */
+  public void setDegreeTypeName(String degreeTypeName) {
+    this.degreeTypeName = degreeTypeName;
+  }
+
+  /**
+   * 发布时间
+   */
+  public Date getReleaseTime() {
+    return releaseTime;
+  }
+
+  /**
+   * 发布时间
+   */
+  public void setReleaseTime(Date releaseTime) {
+    this.releaseTime = releaseTime;
+  }
+
+  /**
+   * 截止时间
+   */
+  public Date getEndTime() {
+    return endTime;
+  }
+
+  /**
+   * 截止时间
+   */
+  public void setEndTime(Date endTime) {
+    this.endTime = endTime;
+  }
+
+  /**
+   * 工作地点
+   */
+  public String getWorkAddress() {
+    return workAddress;
+  }
+
+  /**
+   * 工作地点
+   */
+  public void setWorkAddress(String workAddress) {
+    this.workAddress = workAddress;
+  }
+
+  /**
+   * 工作方式ID,对应 sys_dict_type_item 表ID
+   */
+  public Integer getMarketingWorkWayId() {
+    return marketingWorkWayId;
+  }
+
+  /**
+   * 工作方式ID,对应 sys_dict_type_item 表ID
+   */
+  public void setMarketingWorkWayId(Integer marketingWorkWayId) {
+    this.marketingWorkWayId = marketingWorkWayId;
+  }
+
+  /**
+   * 工作方式名称,对应 sys_dict_type_item 表(type_code:marketing_work_way) item_name
+   */
+  public String getMarketingWorkWayName() {
+    return marketingWorkWayName;
+  }
+
+  /**
+   * 工作方式名称,对应 sys_dict_type_item 表(type_code:marketing_work_way) item_name
+   */
+  public void setMarketingWorkWayName(String marketingWorkWayName) {
+    this.marketingWorkWayName = marketingWorkWayName;
+  }
+
+  /**
+   * 工作时间ID,对应 sys_dict_type_item 表ID
+   */
+  public Integer getMarketingWorkTimeId() {
+    return marketingWorkTimeId;
+  }
+
+  /**
+   * 工作时间ID,对应 sys_dict_type_item 表ID
+   */
+  public void setMarketingWorkTimeId(Integer marketingWorkTimeId) {
+    this.marketingWorkTimeId = marketingWorkTimeId;
+  }
+
+  /**
+   * 工作时间名称,对应 sys_dict_type_item 表(type_code:marketing_work_time) item_name
+   */
+  public String getMarketingWorkTimeName() {
+    return marketingWorkTimeName;
+  }
+
+  /**
+   * 工作时间名称,对应 sys_dict_type_item 表(type_code:marketing_work_time) item_name
+   */
+  public void setMarketingWorkTimeName(String marketingWorkTimeName) {
+    this.marketingWorkTimeName = marketingWorkTimeName;
+  }
+
+  /**
+   * 任务周期-开始时间
+   */
+  public Date getTaskCycleStart() {
+    return taskCycleStart;
+  }
+
+  /**
+   * 任务周期-开始时间
+   */
+  public void setTaskCycleStart(Date taskCycleStart) {
+    this.taskCycleStart = taskCycleStart;
+  }
+
+  /**
+   * 任务周期-截止时间
+   */
+  public Date getTaskCycleEnd() {
+    return taskCycleEnd;
+  }
+
+  /**
+   * 任务周期-截止时间
+   */
+  public void setTaskCycleEnd(Date taskCycleEnd) {
+    this.taskCycleEnd = taskCycleEnd;
+  }
+
+  /**
+   * 手机号
+   */
+  public String getMobile() {
+    return mobile;
+  }
+
+  /**
+   * 手机号
+   */
+  public void setMobile(String mobile) {
+    this.mobile = mobile;
+  }
+
+  /**
+   * 备注
+   */
+  public String getRemark() {
+    return remark;
+  }
+
+  /**
+   * 备注
+   */
+  public void setRemark(String remark) {
+    this.remark = remark;
+  }
+
+  /**
+   * 是否需要认证资料,0-否,1-是
+   */
+  public Integer getNeedCertification() {
+    return needCertification;
+  }
+
+  /**
+   * 是否需要认证资料,0-否,1-是
+   */
+  public void setNeedCertification(Integer needCertification) {
+    this.needCertification = needCertification;
+  }
+
+  /**
+   * 是否正常,0-正常,1-禁用
+   */
+  public Integer getStatus() {
+    return status;
+  }
+
+  /**
+   * 是否正常,0-正常,1-禁用
+   */
+  public void setStatus(Integer status) {
+    this.status = status;
+  }
+
+  /**
+   * 是否删除,0-否,1-是
+   */
+  public Integer getDeleted() {
+    return deleted;
+  }
+
+  /**
+   * 是否删除,0-否,1-是
+   */
+  public void setDeleted(Integer deleted) {
+    this.deleted = deleted;
+  }
+
+  /**
+   * 创建时间
+   */
+  public Date getCreateTime() {
+    return createTime;
+  }
+
+  /**
+   * 创建时间
+   */
+  public void setCreateTime(Date createTime) {
+    this.createTime = createTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public Date getUpdateTime() {
+    return updateTime;
+  }
+
+  /**
+   * 修改时间
+   */
+  public void setUpdateTime(Date updateTime) {
+    this.updateTime = updateTime;
+  }
+
+  /**
+   * 创建人id
+   */
+  public Integer getCreateAdminId() {
+    return createAdminId;
+  }
+
+  /**
+   * 创建人id
+   */
+  public void setCreateAdminId(Integer createAdminId) {
+    this.createAdminId = createAdminId;
+  }
+
+  /**
+   * 创建人姓名
+   */
+  public String getCreateAdminName() {
+    return createAdminName;
+  }
+
+  /**
+   * 创建人姓名
+   */
+  public void setCreateAdminName(String createAdminName) {
+    this.createAdminName = createAdminName;
+  }
+
+  /**
+   * 创建企业,对应health_enterprise表
+   */
+  public Integer getEnterpriseId() {
+    return enterpriseId;
+  }
+
+  /**
+   * 创建企业,对应health_enterprise表
+   */
+  public void setEnterpriseId(Integer enterpriseId) {
+    this.enterpriseId = enterpriseId;
+  }
+
+  /**
+   * 创建企业
+   */
+  public String getEnterpriseName() {
+    return enterpriseName;
+  }
+
+  /**
+   * 创建企业
+   */
+  public void setEnterpriseName(String enterpriseName) {
+    this.enterpriseName = enterpriseName;
+  }
+
+  public String toString() {
+    return "MarketingProject{id=" + id + 
+      ", bizNo=" + bizNo + 
+      ", name=" + name + 
+      ", projectTypeIds=" + projectTypeIds + 
+      ", projectTypeName=" + projectTypeName + 
+      ", projectDescription=" + projectDescription + 
+      ", total=" + total + 
+      ", places=" + places + 
+      ", applyGenderRequirementsId=" + applyGenderRequirementsId + 
+      ", applyGenderRequirementsName=" + applyGenderRequirementsName + 
+      ", applyAgeRequirements=" + applyAgeRequirements + 
+      ", applyExperienceRequirements=" + applyExperienceRequirements + 
+      ", degreeTypeId=" + degreeTypeId + 
+      ", degreeTypeName=" + degreeTypeName + 
+      ", releaseTime=" + releaseTime + 
+      ", endTime=" + endTime + 
+      ", workAddress=" + workAddress + 
+      ", marketingWorkWayId=" + marketingWorkWayId + 
+      ", marketingWorkWayName=" + marketingWorkWayName + 
+      ", marketingWorkTimeId=" + marketingWorkTimeId + 
+      ", marketingWorkTimeName=" + marketingWorkTimeName + 
+      ", taskCycleStart=" + taskCycleStart + 
+      ", taskCycleEnd=" + taskCycleEnd + 
+      ", mobile=" + mobile + 
+      ", remark=" + remark + 
+      ", needCertification=" + needCertification + 
+      ", status=" + status + 
+      ", deleted=" + deleted + 
+      ", createTime=" + createTime + 
+      ", updateTime=" + updateTime + 
+      ", createAdminId=" + createAdminId + 
+      ", createAdminName=" + createAdminName + 
+      ", enterpriseId=" + enterpriseId + 
+      ", enterpriseName=" + enterpriseName + 
+      "}";
+  }
+}

+ 9 - 0
src/main/java/com/ywt/mg/domain/entities/MarketingProjectRepository.java

@@ -0,0 +1,9 @@
+package com.ywt.mg.domain.entities;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import com.ywt.mg.domain.entities.MarketingProject;
+
+public interface MarketingProjectRepository extends JpaRepository<MarketingProject, Integer>, JpaSpecificationExecutor<MarketingProject> {
+
+}

+ 42 - 0
src/main/java/com/ywt/mg/params/enterprise/marketting/BatchDownloadFilesRequest.java

@@ -0,0 +1,42 @@
+package com.ywt.mg.params.enterprise.marketting;
+
+import com.ywt.mg.params.PageRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+public class BatchDownloadFilesRequest extends PageRequest implements Serializable {
+
+    @ApiModelProperty(value = "申请id", example = "")
+    private Integer id;
+
+    @ApiModelProperty(value = "上传时间查询开始时间", example = "")
+    private String uploadTimeStart;
+
+    @ApiModelProperty(value = "上传时间查询截止时间", example = "")
+    private String uploadTimeEnd;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUploadTimeStart() {
+        return uploadTimeStart;
+    }
+
+    public void setUploadTimeStart(String uploadTimeStart) {
+        this.uploadTimeStart = uploadTimeStart;
+    }
+
+    public String getUploadTimeEnd() {
+        return uploadTimeEnd;
+    }
+
+    public void setUploadTimeEnd(String uploadTimeEnd) {
+        this.uploadTimeEnd = uploadTimeEnd;
+    }
+}

+ 172 - 0
src/main/java/com/ywt/mg/services/enterprise/ApplyProjectService.java

@@ -0,0 +1,172 @@
+package com.ywt.mg.services.enterprise;
+
+import com.ywt.mg.configs.DomainConfigurer;
+import com.ywt.mg.core.SqlHelper;
+import com.ywt.mg.core.utils.Checker;
+import com.ywt.mg.core.utils.FileUtil;
+import com.ywt.mg.core.utils.ZipFileUtil;
+import com.ywt.mg.core.utils.serializers.JsonSerializer;
+import com.ywt.mg.domain.entities.*;
+import com.ywt.mg.params.enterprise.marketting.BatchDownloadFilesRequest;
+import com.ywt.mg.services.AuthService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class ApplyProjectService {
+
+    private static final Logger logger = LoggerFactory.getLogger(ApplyProjectService.class);
+
+    @Autowired
+    private SqlHelper sqlHelper;
+    @Autowired
+    private AuthService authservice;
+    @Autowired
+    private MarketingApplyRepository marketingApplyRepository;
+    @Autowired
+    private UserRepository userRepository;
+    @Autowired
+    private MarketingImageRepository marketingImageRepository;
+    @Autowired
+    private MarketingJobTypeUserRepository marketingJobTypeUserRepository;
+    @Autowired
+    private DomainConfigurer domainConfigurer;
+    @Autowired
+    private MarketingProjectRepository marketingProjectRepository;
+
+    public static final String APPLY_PROJECT_FILE_PATH = "./apply_project_file/files/";
+    public static final String APPLY_PROJECT_ROOT_PATH = "./apply_project_file/";
+
+
+    /**
+     * 批量下载文件:
+     * 1、先根据从前端选择的条件去数据库查找对应的记录
+     * 2、遍历记录去下载对应的文件到服务器;
+     * 3、将下载的文件打包;
+     * 4、将打包的文件传给客户端
+     * 5、删掉之前所有的文件;
+     *
+     * @param request
+     * @return
+     */
+    public void batchDownloadFiles(BatchDownloadFilesRequest request, HttpServletResponse response) {
+        try {
+            // 1、先根据从前端选择的条件去数据库查找对应的记录
+            Map<String, String> item = new HashMap<>();
+            item.put("测试文档测试文档测试文档测试文档.doc", "https://ywt-files.oss-cn-shenzhen.aliyuncs.com//up/marketting_project/public/9-a30e19ed1c8d4b28ba83eb7a88a4f985.doc");
+            item.put("下载.jpg", "https://ywt-files.oss-cn-shenzhen.aliyuncs.com//up/marketting_project/public/9-bb077b3512074ddaae0a12d797f20d02.jpg");
+            item.put("测试文档.pdf", "https://ywt-files.oss-cn-shenzhen.aliyuncs.com//up/marketting_project/public/9-1b9a0a24f2be4cef882a22d1a5750ae5.pdf");
+
+            // 2、遍历记录去下载对应的文件到服务器;
+            List<String> fileUrl = new ArrayList<>();
+            for (Map.Entry<String, String> entry : item.entrySet()) {
+                logger.info(entry.getKey() + "--->" + entry.getValue());
+                if (Checker.isNone(entry.getKey()) || Checker.isNone(entry.getValue())) {
+                    continue;
+                }
+                String urlLink = entry.getValue();
+                String pathName = APPLY_PROJECT_FILE_PATH + entry.getKey();
+                // 下载单个文件
+                downloadSingleFile(urlLink, pathName);
+                fileUrl.add(pathName);
+            }
+
+            // 3、将下载的文件打包
+            String zipFileName = "资料";
+            if (!Checker.isNone(request.getUploadTimeStart()) && !Checker.isNone(request.getUploadTimeEnd())) {
+                zipFileName += request.getUploadTimeStart().replace("-", "") + "~" + request.getUploadTimeEnd().replace("-", "");
+            }
+            zipFileName += ".zip";
+            ZipFileUtil.stringFileUrlToZip(APPLY_PROJECT_ROOT_PATH + zipFileName, fileUrl);
+
+            // 4、将打包的文件传给客户端
+            downFile(response, APPLY_PROJECT_ROOT_PATH, zipFileName);
+        } catch (Exception e) {
+            logger.error("ApplyProjectService#batchDownloadFiles(request:{}){}", JsonSerializer.toJson(request), e.getMessage(), e);
+        } finally {
+            // 5、删掉之前所有的文件;
+            FileUtil.deleteFolders(APPLY_PROJECT_ROOT_PATH);
+        }
+    }
+
+    /**
+     * 下载单个文件到服务器
+     *
+     * @param urlLink  oss的路径地址
+     * @param pathName 本地文件(包含文件所在路径以及文件名称)
+     */
+    private static void downloadSingleFile(String urlLink, String pathName) {
+        try {
+            FileUtil.createFoldersIfNotExit(pathName);
+            URL url = new URL(urlLink);
+            //打开到此 URL 的连接并返回一个用于从该连接读入的 InputStream。
+            InputStream inputStream = url.openStream();
+            File file = new File(pathName);
+            OutputStream outputStream = new FileOutputStream(file);
+            int byteCount = 0;
+            //1M逐个读取
+            byte[] bytes = new byte[1024 * 1024];
+            while ((byteCount = inputStream.read(bytes)) != -1) {
+                outputStream.write(bytes, 0, byteCount);
+            }
+            inputStream.close();
+            outputStream.close();
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 将本地zip返回给前端
+     *
+     * @param response
+     * @param FilePath
+     * @param str
+     */
+    private void downFile(HttpServletResponse response, String FilePath, String str) {
+        Map m = new HashMap();
+        try {
+            String path = FilePath + str;
+            File file = new File(path);
+            if (file.exists()) {
+                InputStream ins = new FileInputStream(path);
+                // 放到缓冲流里面
+                BufferedInputStream bins = new BufferedInputStream(ins);
+                // 获取文件输出IO流
+                OutputStream outs = response.getOutputStream();
+                BufferedOutputStream bouts = new BufferedOutputStream(outs);
+                response.addHeader("content-disposition", "attachment;filename="+ new String(str.getBytes(), "iso-8859-1"));
+                int bytesRead = 0;
+                //1M逐个读取
+                byte[] bytes = new byte[1024 * 1024];
+                // 开始向网络传输文件流
+                while ((bytesRead = bins.read(bytes)) != -1) {
+                    bouts.write(bytes, 0, bytesRead);
+                }
+                // 这里一定要调用flush()方法
+                bouts.flush();
+                ins.close();
+                bins.close();
+                outs.close();
+                bouts.close();
+            }
+        } catch (IOException e) {
+            m.put("code", "-1");
+            m.put("text", "附件下载出错:" + e.getMessage());
+            e.printStackTrace();
+        }
+    }
+
+}

+ 37 - 0
src/main/java/com/ywt/mg/web/controllers/enterprise/MarketApplyController.java

@@ -0,0 +1,37 @@
+package com.ywt.mg.web.controllers.enterprise;
+
+import com.ywt.mg.core.MGRight;
+import com.ywt.mg.core.MGRightTypeDef;
+import com.ywt.mg.params.enterprise.marketting.BatchDownloadFilesRequest;
+import com.ywt.mg.services.enterprise.ApplyProjectService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+
+@RestController("/enterprise/marketApply")
+@RequestMapping({"/enterprise/marketApply"})
+@MGRight
+@Api(description = "企业后台审核任务列表")
+public class MarketApplyController {
+
+    private static Logger logger = LoggerFactory.getLogger(MarketApplyController.class);
+
+    @Autowired
+    private ApplyProjectService applyProjectService;
+
+    @ApiOperation(value = "批量下载")
+    @RequestMapping({"/batchDownloadFiles"})
+    @MGRight(menuCode = {"/batchDownloadFiles"}, type = MGRightTypeDef.Menu | MGRightTypeDef.Logined)
+    void getProjectDetail(@RequestBody BatchDownloadFilesRequest request, HttpServletResponse response) {
+        applyProjectService.batchDownloadFiles(request, response);
+    }
+
+
+}

+ 1 - 2
src/main/java/com/ywt/mg/web/controllers/pharmacy/PharmacyController.java

@@ -19,7 +19,6 @@ import com.ywt.mg.services.IdGenerator;
 import com.ywt.mg.services.PharmacyService;
 import com.ywt.mg.web.BaseResponse;
 import com.ywt.mg.web.DataResponse;
-import com.ywt.mg.web.controllers.hospital.HospNatOrderController;
 import io.swagger.annotations.ApiOperation;
 import org.eclipse.jetty.util.UrlEncoded;
 import org.slf4j.Logger;
@@ -37,7 +36,7 @@ import java.util.Map;
 @MGRight
 public class PharmacyController {
 
-    private static Logger logger = LoggerFactory.getLogger(HospNatOrderController.class);
+    private static Logger logger = LoggerFactory.getLogger(PharmacyController.class);
 
     @Autowired
     private IdGenerator idGenerator;