Przeglądaj źródła

项目三级校审

sangwenwei 1 rok temu
rodzic
commit
4371e77eab
22 zmienionych plików z 8433 dodań i 38 usunięć
  1. 27 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/JyProjectApiFallbackFactory.java
  2. 30 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IJyProjectApi.java
  3. 6 0
      jeeplus-common/jeeplus-common-core/src/main/java/com/jeeplus/common/constant/AppNameConstants.java
  4. 223 2
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/controller/JyProjectController.java
  5. 7 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProject.java
  6. 88 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProjectAudit.java
  7. 31 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectAuditMapper.java
  8. 127 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectAuditMapper.xml
  9. 25 4
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml
  10. 12 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectAuditService.java
  11. 498 18
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java
  12. 110 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectAuditDTO.java
  13. 84 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectDTO.java
  14. 17 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/mapstruct/JyProjectAuditWrapper.java
  15. 20 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/mapper/xml/JyWorkClientLinkmanMapper.xml
  16. 2305 0
      jeeplus-modules/jeeplus-business/src/main/resources/freemarker/firstAudit.ftl
  17. 2305 0
      jeeplus-modules/jeeplus-business/src/main/resources/freemarker/secondAudit.ftl
  18. 2305 0
      jeeplus-modules/jeeplus-business/src/main/resources/freemarker/thirdAudit.ftl
  19. 17 13
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java
  20. 81 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/JyAudit.java
  21. 9 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/feign/JyProjectAuditFeignApi.java
  22. 106 1
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

+ 27 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/JyProjectApiFallbackFactory.java

@@ -0,0 +1,27 @@
+package com.jeeplus.flowable.factory;
+
+import com.jeeplus.flowable.feign.IJyProjectApi;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@Component
+public class JyProjectApiFallbackFactory implements FallbackFactory<IJyProjectApi> {
+    @Override
+    public IJyProjectApi create(Throwable cause) {
+        log.error ( "嘉溢项目服务调用失败:{}", cause.getMessage ( ) );
+        return new IJyProjectApi() {
+
+            @Override
+            public String selectAudit() {
+                return null;
+            }
+
+            @Override
+            public void updateStatus(String id) {
+
+            }
+        };
+    }
+}

+ 30 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IJyProjectApi.java

@@ -0,0 +1,30 @@
+package com.jeeplus.flowable.feign;
+
+import com.jeeplus.common.constant.AppNameConstants;
+import com.jeeplus.flowable.factory.AssessApiFallbackFactory;
+import com.jeeplus.flowable.factory.JyProjectApiFallbackFactory;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+@FeignClient(contextId = "jyProjectApi", name = AppNameConstants.APP_JYPROJECT_MODULES, fallbackFactory = JyProjectApiFallbackFactory.class)
+public interface IJyProjectApi {
+
+    /**
+     * 查询项目一级校审中逾期未发起的项目
+     */
+    @GetMapping(value = "/jyProject/selectAudit")
+    String selectAudit();
+
+    /**
+     * 修改一级校审逾期状态
+     */
+    @GetMapping(value = "/jyProject/updateStatus")
+    void updateStatus(@RequestParam(value = "id") String id);
+
+}

+ 6 - 0
jeeplus-common/jeeplus-common-core/src/main/java/com/jeeplus/common/constant/AppNameConstants.java

@@ -25,4 +25,10 @@ public interface AppNameConstants {
      * 评估模块
      */
     String APP_ASSESS_MODULES = "jeeplus-assess";
+
+    /**
+     * 嘉溢项目模块
+     */
+    String APP_JYPROJECT_MODULES = "jeeplus-business";
+
 }

+ 223 - 2
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/controller/JyProjectController.java

@@ -1,18 +1,27 @@
 package com.jeeplus.business.project.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.aop.demo.annotation.DemoMode;
+import com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo;
 import com.jeeplus.assess.program.configuration.projectList.service.dto.ContractDto;
+import com.jeeplus.assess.program.configuration.projectList.service.dto.ProgramAuditDto;
 import com.jeeplus.assess.program.configuration.projectList.service.dto.ProjectListDto;
+import com.jeeplus.assess.utils.FreemarkerUtil;
 import com.jeeplus.assess.workContract.domain.WorkContractInfo;
 import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.domain.JyProjectAudit;
+import com.jeeplus.business.project.service.JyProjectAuditService;
 import com.jeeplus.business.project.service.JyProjectService;
+import com.jeeplus.business.project.service.dto.JyProjectAuditDTO;
 import com.jeeplus.business.project.service.dto.JyProjectDTO;
 import com.jeeplus.business.workContractInfo.domain.JyWorkContractInfo;
 import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.logging.annotation.ApiLog;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -21,7 +30,11 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
 import java.util.List;
+import java.util.Map;
 
 @Slf4j
 @Api(tags ="嘉溢项目登记")
@@ -143,8 +156,216 @@ public class JyProjectController {
     /**
      * 根据id获取三级校审信息
      */
-//    @ApiOperation(value = "根据id获取三级校审信息")
-//    @GetMapping(value = "/get")
+    @ApiOperation(value = "根据id获取三级校审信息")
+    @GetMapping(value = "/findByIdAudit")
+    public ResponseEntity<JyProjectAuditDTO> findByIdAudit(@RequestParam String id){
+        JyProjectAuditDTO dto = jyProjectService.findByIdAudit(id);
+        return ResponseEntity.ok(dto);
+    }
+
+    /**
+     * 新增/修改三级校审
+     */
+    @ApiOperation(value = "新增/修改三级校审")
+    @PostMapping(value = "/saveFormThree")
+    public ResponseEntity saveFormThree(@RequestBody JyProjectAuditDTO jyProjectAuditDTO) throws Exception{
+        String id = jyProjectService.saveFormThree(jyProjectAuditDTO);
+        return ResponseUtil.newInstance().add("businessTable", "jy_project_audit").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改三级校审状态值status
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "根据id修改三级校审状态值status")
+    @PostMapping(value = "/updateStatusByAuditId")
+    public ResponseEntity<String> updateStatusByAuditId(@RequestBody JyProjectAuditDTO dto) {
+        String s = jyProjectService.updateStatusByAuditId(dto);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 查询项目一级校审中逾期未发起的项目
+     */
+    @ApiOperation(value = "查询项目一级校审中逾期未发起的项目")
+    @GetMapping(value = "/selectAudit")
+    public String selectAudit() {
+        List<JyProjectAudit> list = jyProjectService.selectAudit();
+        return JSON.toJSONString(list);
+    }
+
+    /**
+     * 修改一级校审逾期状态
+     */
+    @ApiOperation(value = "修改一级校审逾期状态")
+    @GetMapping(value = "/updateStatus")
+    public void updateStatus(@RequestParam String id) {
+        jyProjectService.updateStatus(id);
+
+    }
+
+    /**
+     * 下载一级校审表
+     * @param response
+     * @param info
+     */
+    @RequestMapping(value="downloadFirstAuditTpl")
+    @ResponseBody
+    public void downloadFirstAuditTpl(HttpServletResponse response, JyProject info)  {
+        Map data = jyProjectService.getAuditInfoMap(info);
+
+
+        //模板对象
+        Template template=null;
+        //下载文件地址
+        String filePath = null;
+        if(System.getProperty("os.name").toLowerCase().contains("win")){
+            filePath = this.getClass().getResource("/").getPath()+"/freemarker";
+        }else{
+            filePath = "/mnt/project/cloud/freemarker";
+        }
+        //freemaker模板路径
+        File path = new File(filePath);
+
+        Configuration cfg = new Configuration();
+        try {
+            cfg.setDirectoryForTemplateLoading(path);
+            //选择对应的ftl文件
+            template = cfg.getTemplate("firstAudit.ftl","UTF-8");
+
+            File docFile = new File("嘉溢一级校审.doc");
+            FreemarkerUtil.generateFile(data,template,docFile);
+            com.jeeplus.assess.utils.ResponseUtil.docResponse("嘉溢一级校审.doc",docFile,response);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally {
+
+            if(System.getProperty("os.name").toLowerCase().contains("win")){
+                //获取tomcat的路径
+                String tomcatFilePath=System.getProperty("catalina.home");
+                //删除tomcat目录下的处理后的文件信息
+                File tomcatFile = new File(tomcatFilePath+"/bin/"+"嘉溢一级校审.doc");
+                if (tomcatFile.isFile()) {
+                    tomcatFile.delete();
+                }
+            }else{
+                //删除目录下的处理后的文件信息
+                File tomcatFile = new File("/mnt/project/cloud/"+"嘉溢一级校审.doc");
+                if (tomcatFile.isFile()) {
+                    tomcatFile.delete();
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 下载二级校审表
+     * @param response
+     * @param info
+     */
+    @RequestMapping(value="downloadSecondAuditTpl")
+    @ResponseBody
+    public void downloadSecondAuditTpl(HttpServletResponse response, JyProject info)  {
+        Map data = jyProjectService.getAuditInfoMap(info);
+
+
+        //模板对象
+        Template template=null;
+        //下载文件地址
+        String filePath = null;
+        if(System.getProperty("os.name").toLowerCase().contains("win")){
+            filePath = this.getClass().getResource("/").getPath()+"/freemarker";
+        }else{
+            filePath = "/mnt/project/cloud/freemarker";
+        }
+        //freemaker模板路径
+        File path = new File(filePath);
+        Configuration cfg = new Configuration();
+        try {
+            cfg.setDirectoryForTemplateLoading(path);
+            //选择对应的ftl文件
+            template = cfg.getTemplate("secondAudit.ftl","UTF-8");
+
+            File docFile = new File("嘉溢二级校审.doc");
+            FreemarkerUtil.generateFile(data,template,docFile);
+            com.jeeplus.assess.utils.ResponseUtil.docResponse("嘉溢二级校审.doc",docFile,response);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally {
+            if(System.getProperty("os.name").toLowerCase().contains("win")){
+                //获取tomcat的路径
+                String tomcatFilePath=System.getProperty("catalina.home");
+                //删除tomcat目录下的处理后的文件信息
+                File tomcatFile = new File(tomcatFilePath+"/bin/"+"嘉溢二级校审.doc");
+                if (tomcatFile.isFile()) {
+                    tomcatFile.delete();
+                }
+            }else{
+                //删除目录下的处理后的文件信息
+                File tomcatFile = new File("/mnt/project/cloud/"+"嘉溢二级校审.doc");
+                if (tomcatFile.isFile()) {
+                    tomcatFile.delete();
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 下载三级校审表
+     * @param response
+     * @param info
+     */
+    @RequestMapping(value="downloadThirdlyAuditTpl")
+    @ResponseBody
+    public void downloadThirdlyAuditTpl(HttpServletResponse response, JyProject info)  {
+        Map data = jyProjectService.getAuditInfoMap(info);
+
+
+        //模板对象
+        Template template=null;
+        //下载文件地址
+        String filePath = null;
+        if(System.getProperty("os.name").toLowerCase().contains("win")){
+            filePath = this.getClass().getResource("/").getPath()+"/freemarker";
+        }else{
+            filePath = "/mnt/project/cloud/freemarker";
+        }
+        //freemaker模板路径
+        File path = new File(filePath);
+        Configuration cfg = new Configuration();
+        try {
+            cfg.setDirectoryForTemplateLoading(path);
+            //选择对应的ftl文件
+            template = cfg.getTemplate("thirdAudit.ftl","UTF-8");
+
+            File docFile = new File("嘉溢三级校审.doc");
+            FreemarkerUtil.generateFile(data,template,docFile);
+            com.jeeplus.assess.utils.ResponseUtil.docResponse("嘉溢三级校审.doc",docFile,response);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally {
+            if(System.getProperty("os.name").toLowerCase().contains("win")){
+                //获取tomcat的路径
+                String tomcatFilePath=System.getProperty("catalina.home");
+                //删除tomcat目录下的处理后的文件信息
+                File tomcatFile = new File(tomcatFilePath+"/bin/"+"嘉溢三级校审.doc");
+                if (tomcatFile.isFile()) {
+                    tomcatFile.delete();
+                }
+            }else{
+                //删除目录下的处理后的文件信息
+                File tomcatFile = new File("/mnt/project/cloud/"+"嘉溢三级校审.doc");
+                if (tomcatFile.isFile()) {
+                    tomcatFile.delete();
+                }
+            }
+        }
+
+    }
+
 
 
 

+ 7 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProject.java

@@ -256,6 +256,13 @@ public class JyProject extends BaseEntity implements Serializable {
      * 超期状态
      */
     private String exceedTimeStatus;
+    @TableField(exist = false)
+    private String place;
+    @TableField(exist = false)
+    private String leader;
+
+    @TableField(exist = false)
+    private String auditOffice;
 
 
 

+ 88 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProjectAudit.java

@@ -0,0 +1,88 @@
+package com.jeeplus.business.project.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+@TableName("jy_project_audit")
+public class JyProjectAudit extends BaseEntity {
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 校审级别
+     */
+    private String auditLevel;
+
+    /**
+     * 审核人
+     */
+    private String auditPeople;
+
+    /**
+     * 项目审核通过时间
+     */
+    private Date projectAgreeTime;
+
+    /**
+     * 初始审核意见
+     */
+    private String initialAuditOpinion;
+
+    /**
+     * 初始修改意见
+     */
+    private String initialEditOpinion;
+
+    /**
+     * 审核意见
+     */
+    private String auditOpinion;
+
+    /**
+     * 修改意见
+     */
+    private String editOpinion;
+
+    /**
+     * 流程id,流程信息
+     */
+    private String procInsId;
+    private String processDefinitionId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 超期状态(0:未超期;1:超期)
+     */
+    private String exceedTimeStatus;
+
+    /**
+     * 附件信息
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentInfo> workAttachmentDtoList;
+
+    @TableField(exist = false)
+    private String projectName;
+    @TableField(exist = false)
+    private String taskId;
+
+    private static final long serialVersionUID = 1L;
+
+
+
+
+}

+ 31 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectAuditMapper.java

@@ -0,0 +1,31 @@
+package com.jeeplus.business.project.mapper;
+
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.project.domain.JyProjectAudit;
+import com.jeeplus.business.project.service.dto.JyProjectAuditDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+@Mapper
+public interface JyProjectAuditMapper extends BaseMapper<JyProjectAudit> {
+    @InterceptorIgnore(tenantLine = "true")
+    JyProjectAuditDTO findByIdAudit(@Param("id") String id);
+
+    List<String> getIDsByProId(@Param("projectId") String projectId);
+
+    JyProjectAudit getIdByProId(@Param("id")String id);
+
+    List<JyProjectAudit> findFirstLevel();
+    @InterceptorIgnore(tenantLine = "true")
+    void updateStatus(@Param("id")String id);
+    @InterceptorIgnore(tenantLine = "true")
+    void updateStatus2(String id);
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyProjectAudit> selectAudit(@Param("newDate")Date newDate);
+
+    List<JyProjectAuditDTO> getByProjectId(@Param("projectId") String projectId);
+}

+ 127 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectAuditMapper.xml

@@ -0,0 +1,127 @@
+<?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.jeeplus.business.project.mapper.JyProjectAuditMapper">
+    <resultMap id="BaseResultMap" type="com.jeeplus.business.project.service.dto.JyProjectAuditDTO">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+        <result property="projectId" column="project_id" jdbcType="VARCHAR"/>
+        <result property="auditLevel" column="audit_level" jdbcType="VARCHAR"/>
+        <result property="auditPeople" column="audit_people" jdbcType="VARCHAR"/>
+        <result property="projectAgreeTime" column="project_agree_time" jdbcType="TIMESTAMP"/>
+        <result property="initialAuditOpinion" column="initial_audit_opinion" jdbcType="VARCHAR"/>
+        <result property="initialEditOpinion" column="initial_edit_opinion" jdbcType="VARCHAR"/>
+        <result property="editOpinion" column="edit_opinion" jdbcType="VARCHAR"/>
+        <result property="auditOpinion" column="audit_opinion" jdbcType="VARCHAR"/>
+        <result property="procInsId" column="proc_ins_id" jdbcType="VARCHAR"/>
+        <result property="processDefinitionId" column="process_definition_id" jdbcType="VARCHAR"/>
+        <result property="status" column="status" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Audit_Column_List">
+        pa.id,
+        pa.create_by_id,
+        pa.create_time,
+        pa.update_by_id,
+        pa.update_time,
+        pa.del_flag,
+        pa.project_id,
+        pa.audit_level,
+        pa.audit_people,
+        pa.project_agree_time,
+        pa.initial_audit_opinion,
+        pa.initial_edit_opinion,
+        pa.edit_opinion,
+        pa.audit_opinion,
+        pa.proc_ins_id,
+        pa.process_definition_id,
+        pa.status,
+        pa.exceed_time_status
+    </sql>
+
+
+    <select id="findByIdAudit" resultMap="BaseResultMap">
+        select
+            <include refid="Audit_Column_List"></include>
+        from jy_project_audit pa
+        where pa.del_flag = '0' and pa.id = #{id}
+    </select>
+
+
+    <select id="getIDsByProId" resultType="string">
+        SELECT id
+        FROM jy_project_audit
+        WHERE project_id = #{projectId} and del_flag = '0'
+        ORDER BY
+        CASE WHEN project_agree_time IS NULL THEN 1 ELSE 0 END,
+        project_agree_time ASC
+    </select>
+
+    <select id="getIdByProId" resultType="com.jeeplus.business.project.domain.JyProjectAudit">
+        select
+        <include refid="Audit_Column_List"></include>
+        from jy_project_audit pa
+        where pa.del_flag = '0' and pa.project_id = #{id} and pa.audit_level = '1'
+    </select>
+
+    <select id="findFirstLevel" resultType="com.jeeplus.business.project.domain.JyProjectAudit">
+        select
+        <include refid="Audit_Column_List"></include>
+        from jy_project_audit pa
+        where pa.del_flag = '0' and pa.audit_level = '1'
+    </select>
+    
+    <update id="updateStatus">
+        update
+            jy_project_audit
+        set status='6' , exceed_time_status ='1' where id=#{id}
+    </update>
+
+    <update id="updateStatus2">
+        update
+            jy_project_audit
+        set status='7' where id=#{id}
+    </update>
+
+    <select id="selectAudit" resultType="com.jeeplus.business.project.domain.JyProjectAudit">
+        select
+        <include refid="Audit_Column_List"></include>,
+        pr.name as projectName,
+        art.ID_ as task_id
+        from jy_project_audit pa
+        left join jy_project_record pr on pa.project_id = pr.id
+        LEFT JOIN act_ru_task art ON pa.proc_ins_id = art.PROC_INST_ID_
+        where pa.del_flag = '0'
+              and pa.audit_level = '1'
+              and (pa.status = '0' or pa.status = null)
+              and pa.project_agree_time &lt;= #{newDate}
+    </select>
+
+
+    <select id="getByProjectId" resultType="com.jeeplus.business.project.service.dto.JyProjectAuditDTO">
+        select
+        <include refid="Audit_Column_List"></include>
+        from jy_project_audit pa
+        where pa.del_flag = '0' and pa.project_id=#{projectId}
+    </select>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</mapper>

+ 25 - 4
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml

@@ -142,9 +142,6 @@
            a.client,
            a.client_name,
            a.status,
-           a.first_instance_status,
-           a.second_instance_status,
-           a.third_instance_status,
            a.report_issuance,
            a.out_instance,
            a.reports_submit,
@@ -159,10 +156,13 @@
            a.proc_ins_id,
            a.process_definition_id,
            b.name AS create_by_id,
+           (select sa.name from sys_area sa where a.project_place=sa.id) as place,
+           (select su.name from sys_user su where a.project_leader=su.id) as leader,
            art.ID_ as taskId,
            wci.primary_linkman as primaryLinkman,
            wci.contract_amount,
            wci.contract_type,
+           wci.name as contractName,
            (SELECT dv.label FROM `sys_dict_value` dv
 			LEFT JOIN sys_dict_type dt on dt.id=dv.dict_type_id
 			where dt.type='jy_contract_type_up' and wci.contract_type_first=dv.value) as contractTypeFirst,
@@ -170,14 +170,35 @@
 			cl.name as clientName,
 			cl.link_phone as phone,
 			cl.link_mobile as mobile,
-			cl.position as position
+			cl.position as position,
+			pa1.status as firstInstanceStatus,
+           pa1.id as auditId1,
+           pa1.proc_ins_id as procInsId1,
+           pa1.exceed_time_status as exceedTimeStatus,
+           pa2.status as secondInstanceStatus,
+           pa2.id as auditId2,
+           pa2.proc_ins_id as procInsId2,
+           pa3.status as thirdInstanceStatus,
+           pa3.id as auditId3,
+           pa3.proc_ins_id as procInsId3,
+           art1.ID_ as task_id_audit1,
+           art2.ID_ as task_id_audit2,
+           art3.ID_ as task_id_audit3,
+           so.name as auditOffice
         FROM
             jy_project_record a
             LEFT JOIN sys_user b ON a.create_by_id = b.id
             LEFT JOIN sys_user c ON a.project_leader = c.id
+            left join sys_office so on c.office_id = so.id
             LEFT JOIN jy_work_contract_info wci ON wci.id = a.contract_id and wci.del_flag = '0'
             LEFT JOIN act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
             left join jy_work_client_linkman cl on a.client=cl.id
+            left join jy_project_audit pa1 on pa1.project_id = a.id and pa1.audit_level = '1' and pa1.del_flag = '0'
+            LEFT JOIN jy_project_audit pa2 ON pa2.project_id = a.id and pa2.audit_level = '2' and pa2.del_flag = '0'
+            LEFT JOIN jy_project_audit pa3 ON pa3.project_id = a.id and pa3.audit_level = '3' and pa3.del_flag = '0'
+            LEFT JOIN act_ru_task art1 ON pa1.proc_ins_id = art1.PROC_INST_ID_
+            LEFT JOIN act_ru_task art2 ON pa2.proc_ins_id = art2.PROC_INST_ID_
+            LEFT JOIN act_ru_task art3 ON pa3.proc_ins_id = art3.PROC_INST_ID_
         where a.id = #{id}
     </select>
 

+ 12 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectAuditService.java

@@ -0,0 +1,12 @@
+package com.jeeplus.business.project.service;
+
+import org.springframework.stereotype.Service;
+
+@Service
+public class JyProjectAuditService {
+
+
+
+
+
+}

+ 498 - 18
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java

@@ -9,17 +9,20 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jeeplus.assess.program.configuration.projectList.domain.*;
-import com.jeeplus.assess.program.configuration.projectList.service.dto.ProgramReportNoDto;
+import com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo;
+import com.jeeplus.assess.program.configuration.projectList.service.dto.ProgramAuditAssessPeopleDto;
+import com.jeeplus.assess.program.configuration.projectList.service.dto.ProgramAuditDto;
 import com.jeeplus.assess.program.configuration.projectList.service.dto.ProjectListDto;
-import com.jeeplus.assess.workContract.domain.WorkContractInfo;
-import com.jeeplus.assess.workContract.service.WorkContractService;
-import com.jeeplus.assess.workContract.service.dto.WorkContractInfoDto;
+import com.jeeplus.assess.workContract.mapper.WorkContractInfoMapper;
 import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.domain.JyProjectAudit;
 import com.jeeplus.business.project.domain.JyProjectMembers;
+import com.jeeplus.business.project.mapper.JyProjectAuditMapper;
 import com.jeeplus.business.project.mapper.JyProjectMapper;
 import com.jeeplus.business.project.mapper.JyProjectMemberMapper;
+import com.jeeplus.business.project.service.dto.JyProjectAuditDTO;
 import com.jeeplus.business.project.service.dto.JyProjectDTO;
+import com.jeeplus.business.project.service.mapstruct.JyProjectAuditWrapper;
 import com.jeeplus.business.workClientInfo.domain.JyWorkClientLinkman;
 import com.jeeplus.business.workClientInfo.mapper.JyWorkClientInfoMapper;
 import com.jeeplus.business.workClientInfo.mapper.JyWorkClientLinkmanMapper;
@@ -35,47 +38,55 @@ import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
 import com.jeeplus.sys.mapper.DictValueMapper;
-import com.jeeplus.sys.service.DictValueService;
 import com.jeeplus.sys.service.dto.UserDTO;
+import org.apache.commons.compress.utils.Lists;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.stream.Collectors;
+
 
 @Service
 public class JyProjectService {
 
-    @Autowired
+    @Resource
     private JyProjectMapper jyProjectMapper;
 
-    @Autowired
+    @Resource
     private IFlowableApi flowTaskService;
 
-    @Autowired
+    @Resource
     private JyWorkContractInfoMapper jyWorkContractInfoMapper;
 
-    @Autowired
+    @Resource
     private JyWorkClientInfoMapper jyWorkClientInfoMapper;
 
-    @Autowired
+    @Resource
     private JyProjectMemberMapper jyProjectMemberMapper;
 
 
-    @Autowired
+    @Resource
     private JyWorkClientLinkmanMapper jyWorkClientLinkmanMapper;
 
-    @Autowired
-    private JyWorkContractService jyWorkContractService;
+//    @Autowired
+//    private JyWorkContractService jyWorkContractService;
 
-    @Autowired
+    @Resource
     private DictValueMapper dictValueMapper;
 
+    @Resource
+    private JyProjectAuditMapper jyProjectAuditMapper;
+
+    @Resource
+    private WorkContractInfoMapper workContractInfoMapper;
+
 
     /**
      * 项目登记列表
@@ -153,9 +164,10 @@ public class JyProjectService {
                     item.setAuditUserIds(flowTaskService.getTaskAuditUsers(item.getTaskId()));  // 获取数据审核人
                 }
             }
-            //合同名称
+            //合同名称及委托方联系人
             if (StringUtils.isEmpty(item.getContractName())){
                 item.setContractName("暂无合同");
+                item.setPrimaryLinkman(item.getClientName());
             }
         });
         return pageList;
@@ -275,6 +287,24 @@ public class JyProjectService {
             jyProjectMembers.setStatus("0");
             jyProjectMemberMapper.insert(jyProjectMembers);
         }
+        //三级校审添加
+        JyProjectAudit jyProjectAudit1 = new JyProjectAudit();
+        jyProjectAudit1.setProjectId(jyProject.getId());
+        jyProjectAudit1.setStatus("0");
+        jyProjectAudit1.setAuditLevel("1");
+        jyProjectAudit1.setExceedTimeStatus("0");
+        jyProjectAuditMapper.insert(jyProjectAudit1);
+        JyProjectAudit jyProjectAudit2 = new JyProjectAudit();
+        jyProjectAudit2.setProjectId(jyProject.getId());
+        jyProjectAudit2.setStatus("0");
+        jyProjectAudit2.setAuditLevel("2");
+        jyProjectAuditMapper.insert(jyProjectAudit2);
+        JyProjectAudit jyProjectAudit3 = new JyProjectAudit();
+        jyProjectAudit3.setProjectId(jyProject.getId());
+        jyProjectAudit3.setStatus("0");
+        jyProjectAudit3.setAuditLevel("3");
+        jyProjectAuditMapper.insert(jyProjectAudit3);
+
 
 
         // 保存附件信息
@@ -404,7 +434,9 @@ public class JyProjectService {
         // 查询主表信息
         JyProject info = jyProjectMapper.getById(id);
         //保存项目信息
-        BeanUtils.copyProperties(info, jyProjectDTO);
+        if (ObjectUtil.isNotEmpty(info)){
+            BeanUtils.copyProperties(info, jyProjectDTO);
+        }
         // 查询联系人列表
         ArrayList<JyWorkClientLinkman> jyWorkClientLinkmen = new ArrayList<>();
         JyWorkClientLinkman jyWorkClientLinkman = jyWorkClientLinkmanMapper.selectById(info.getClient());
@@ -466,6 +498,15 @@ public class JyProjectService {
      */
     public void updateStatusById(JyProjectDTO jyProjectDTO) {
         jyProjectMapper.updateStatusById(jyProjectDTO.getId(), jyProjectDTO.getStatus());
+        //获取到项目登记通过的信息
+        JyProject byId = jyProjectMapper.getById(jyProjectDTO.getId());
+        if (byId.getStatus().equals("5")){
+            //获取到项目校审一级的信息
+           JyProjectAudit jyProjectAudit= jyProjectAuditMapper.getIdByProId(byId.getId());
+           //设置项目登记通过的时间
+            jyProjectAudit.setProjectAgreeTime(byId.getUpdateTime());
+            jyProjectAuditMapper.updateById(jyProjectAudit);
+        }
     }
 
 
@@ -504,4 +545,443 @@ public class JyProjectService {
         IPage<JyProject> projectIPage=jyProjectMapper.getByCreate(userDTO.getId(),page,wrapper);
         return projectIPage;
     }
+
+    /**
+     * 获取三级校审信息
+     * @param id
+     * @return
+     */
+    public JyProjectAuditDTO findByIdAudit(String id) {
+        //根据id获取校审信息
+        JyProjectAuditDTO jyProjectAuditDTO=jyProjectAuditMapper.findByIdAudit(id);
+        // 查询附件信息
+        List<WorkAttachmentInfo> files = workContractInfoMapper.findDtos(id);
+        if (CollectionUtils.isNotEmpty(files)) {
+            for (WorkAttachmentInfo i : files) {
+                i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+            }
+            jyProjectAuditDTO.setWorkAttachmentDtoList(files);
+        }
+        //获取项目信息
+        JyProjectDTO byId = findById(jyProjectAuditDTO.getProjectId());
+        jyProjectAuditDTO.setJyProjectList(byId);
+
+
+        //根据项目的id去查校审的id
+        List<String> ids = jyProjectAuditMapper.getIDsByProId(jyProjectAuditDTO.getProjectId());
+        if (ids.size() >= 1) {
+            jyProjectAuditDTO.setId1(ids.get(0));
+        }
+        if (ids.size() >= 2) {
+            jyProjectAuditDTO.setId2(ids.get(1));
+        }
+        if (ids.size() >= 3) {
+            jyProjectAuditDTO.setId3(ids.get(2));
+        }
+        return jyProjectAuditDTO;
+
+    }
+
+    /**
+     * 三级校审新增或修改
+     * @param jyProjectAuditDTO
+     * @return
+     * @throws Exception
+     */
+    public String saveFormThree(JyProjectAuditDTO jyProjectAuditDTO) throws Exception {
+        //代码转化,将dto中的对象赋到实体类中
+        JyProjectAudit jyProjectAudit = JyProjectAuditWrapper.INSTANCE.toEntity(jyProjectAuditDTO);
+        //获取审核信息
+        JyProjectAuditDTO byIdAudit = jyProjectAuditMapper.findByIdAudit(jyProjectAuditDTO.getId());
+        if (ObjectUtil.isNotEmpty(byIdAudit)){
+            String audit="";
+            //对审核意见进行赋值
+            if (StringUtils.isNotBlank(byIdAudit.getInitialAuditOpinion())){
+                if (StringUtils.isNotBlank(jyProjectAuditDTO.getAuditOpinion())){
+                    audit=byIdAudit.getInitialAuditOpinion()+"<br/>"+jyProjectAuditDTO.getAuditOpinion();
+                }else {
+                    audit=byIdAudit.getInitialAuditOpinion();
+                }
+            }else {
+                audit=jyProjectAuditDTO.getAuditOpinion();
+            }
+            jyProjectAudit.setInitialAuditOpinion(audit);
+            jyProjectAudit.setAuditOpinion("");
+            //对修改意见赋值
+            String edit="";
+            if (StringUtils.isNotBlank(byIdAudit.getInitialEditOpinion())){
+                if (StringUtils.isNotBlank(jyProjectAuditDTO.getEditOpinion())){
+                    edit=byIdAudit.getInitialEditOpinion()+"<br/>"+jyProjectAuditDTO.getEditOpinion();
+                }else {
+                    edit=byIdAudit.getInitialEditOpinion();
+                }
+            }else {
+                edit=jyProjectAuditDTO.getEditOpinion();
+            }
+            jyProjectAudit.setInitialEditOpinion(edit);
+            jyProjectAudit.setEditOpinion("");
+        }
+        jyProjectAudit.setAuditPeople(jyProjectAuditDTO.getAuditPeople());
+        if (StringUtils.isNotBlank(jyProjectAudit.getId())){
+            jyProjectAuditMapper.updateById(jyProjectAudit);
+        }else{
+            jyProjectAuditMapper.insert(jyProjectAudit);
+        }
+        if (ObjectUtil.isNotEmpty(jyProjectAudit)) {
+            //附件
+            Map<String,String> map = new HashMap<>();
+            String fileList = JSON.toJSONString((jyProjectAudit.getWorkAttachmentDtoList()));
+            String attachmentId = jyProjectAudit.getId();
+            String attachmentFlag = "jyProjectAudit";
+            map.put("fileList",fileList);
+            map.put("attachmentId",attachmentId);
+            map.put("attachmentFlag",attachmentFlag);
+            map.put("currentToken", TokenProvider.getCurrentToken ( ));
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileList(map);
+
+        }
+        return jyProjectAudit.getId();
+    }
+
+    /**
+     * 根据id修改审核状态
+     * @param dto
+     * @return
+     */
+    public String updateStatusByAuditId(JyProjectAuditDTO dto) {
+        JyProjectAudit jyProjectAudit = new JyProjectAudit();
+        jyProjectAudit.setId(dto.getId());
+        jyProjectAudit.setStatus(dto.getStatus());
+        jyProjectAuditMapper.update(jyProjectAudit,new QueryWrapper<JyProjectAudit>().lambda().eq(JyProjectAudit::getId,jyProjectAudit.getId()));
+        return "操作成功";
+    }
+
+    /**
+     * 查询项目一级校审中逾期未发起的项目
+     * @return
+     */
+    public List<JyProjectAudit> selectAudit() {
+        //获取一个月前的时间
+        //创建时间格式化对象
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        //获取当前时间
+        Date currentDate = new Date();
+        //将当前时间转化为字符串
+        String format = simpleDateFormat.format(currentDate);
+        //创建calendar对象
+        Calendar instance = Calendar.getInstance();
+        //将日期设置为当前时间
+        instance.setTime(currentDate);
+        //将日期往前推一个月
+        instance.add(Calendar.MONTH,-1);
+        //获取推送后的日期
+        Date newDate = instance.getTime();
+        List<JyProjectAudit> list=jyProjectAuditMapper.selectAudit(newDate);
+        return list;
+    }
+
+    /**
+     * 修改一级校审逾期状态
+     * @param
+     */
+    public void updateStatus(String id) {
+        JyProjectAuditDTO data = jyProjectAuditMapper.findByIdAudit(id);
+        //判断一级校审是否发起
+        if (StringUtils.isNotBlank(data.getStatus())){
+            if (data.getStatus().equals("0")){
+                jyProjectAuditMapper.updateStatus(data.getId());
+            }
+        }
+            //判断一级校审是否在规定期限内完成
+            if (StringUtils.isNotBlank(data.getExceedTimeStatus())){
+                if (data.getExceedTimeStatus().equals("1")){
+                    if (data.getStatus().equals("5")){
+                        jyProjectAuditMapper.updateStatus2(data.getId());
+                    }
+                }
+            }
+
+    }
+
+    /**
+     * 查询校审数据信息并导出文档
+     * @param info
+     * @return
+     */
+    public Map<String,Object> getAuditInfoMap(JyProject info){
+        Map data = new HashMap();
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年 MM月 dd日");
+
+        //查询项目信息
+        JyProjectDTO projectDTO = findById(info.getProjectId());
+
+        //项目名称
+        if(StringUtils.isNotBlank(projectDTO.getName())){
+            data.put("projectName",projectDTO.getName());
+        }else{
+            data.put("projectName","");
+        }
+        //项目地点
+        if (StringUtils.isNotBlank(projectDTO.getBuildPlace())){
+            data.put("buildPlace",projectDTO.getBuildPlace());
+        }else {
+            data.put("buildPlace","");
+        }
+        //建设单位
+        if (StringUtils.isNotBlank(projectDTO.getClientName())){
+            data.put("clientName",projectDTO.getClientName());
+        }else {
+            data.put("clientName","");
+        }
+        //审批部门
+        if (StringUtils.isNotBlank(projectDTO.getAuditOffice())){
+            data.put("auditOffice",projectDTO.getAuditOffice());
+        }else {
+            data.put("auditOffice","");
+        }
+        //项目负责人
+        if(StringUtils.isBlank(projectDTO.getLeader())){
+            data.put("projectMaster","");
+        }else{
+            data.put("projectMaster",projectDTO.getLeader());
+        }
+        //其他参与人员
+        if (ObjectUtil.isNotEmpty(projectDTO.getProjectMembers())){
+            ArrayList<String> strings = new ArrayList<>();
+            for (JyProjectMembers projectMember : projectDTO.getProjectMembers()) {
+                strings.add(projectMember.getName());
+            }
+            data.put("otherPeople",strings);
+        }else {
+            data.put("otherPeople","");
+        }
+        //根据项目id获取到所有的校审信息
+        List<JyProjectAuditDTO> jyProjectAuditDTOS=jyProjectAuditMapper.getByProjectId(info.getProjectId());
+        //如果存在审核意见则进行处理
+        if(null != jyProjectAuditDTOS){
+            if (jyProjectAuditDTOS.size()>=1){
+                //审核意见
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getInitialAuditOpinion())){
+                    String[] split = jyProjectAuditDTOS.get(0).getInitialAuditOpinion().split("<br/>");
+                    //将审核意见放入集合中
+                    ArrayList<String> strings = new ArrayList<>();
+                    for (String s : split) {
+                        strings.add(s);
+                    }
+                    data.put("firstAuditList",strings);
+                }else {
+                    data.put("firstAuditList","");
+                }
+                //审核人
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getAuditPeople())){
+                    data.put("firstAuditPeople",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(0).getAuditPeople()).getName());
+                }else {
+                    data.put("firstAuditPeople","");
+
+                }
+                //日期
+                String format = sdf.format(jyProjectAuditDTOS.get(0).getUpdateTime());
+                if (null == jyProjectAuditDTOS.get(0).getUpdateTime()){
+                    data.put("firstAuditDate","");
+                    data.put("firstDate","");
+                }else {
+                    data.put("firstAuditDate",format);
+                    data.put("firstDate",format);
+                }
+                //修改意见
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getInitialEditOpinion())){
+                    String[] split = jyProjectAuditDTOS.get(0).getInitialEditOpinion().split("<br/>");
+                    ArrayList<String> strings = new ArrayList<>();
+                    for (String s : split) {
+                        strings.add(s);
+                    }
+                    data.put("firstEditList",strings);
+                }else {
+                    data.put("firstEditList","");
+                }
+                //签名
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getCreateById())){
+                    data.put("firstName",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(0).getCreateById()).getName());
+                }else {
+                    data.put("firstName","");
+                }
+                //校核修改结果认可意见及签名和日期
+                data.put("firstAgreeOpinion","");
+                data.put("firstAgreeName","");
+                data.put("firstAgreeDate","");
+
+            } else if (jyProjectAuditDTOS.size()>=2){
+                //审核意见
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getInitialAuditOpinion())){
+                    String[] split = jyProjectAuditDTOS.get(1).getInitialAuditOpinion().split("<br/>");
+                    //将审核意见放入集合中
+                    ArrayList<String> strings = new ArrayList<>();
+                    for (String s : split) {
+                        strings.add(s);
+                    }
+                    data.put("secondAuditList",strings);
+                }else {
+                    data.put("secondAuditList","");
+
+                }
+                //审核人
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getAuditPeople())){
+                    data.put("secondAuditPeople",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(1).getAuditPeople()).getName());
+                }else {
+                    data.put("secondAuditPeople","");
+                }
+                //日期
+                String format = sdf.format(jyProjectAuditDTOS.get(1).getUpdateTime());
+                if (null == jyProjectAuditDTOS.get(1).getUpdateTime()){
+                    data.put("secondAuditDate","");
+                    data.put("secondDate","");
+                }else {
+                    data.put("secondAuditDate",format);
+                    data.put("secondDate",format);
+                }
+                //修改意见
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getInitialEditOpinion())){
+                    String[] split = jyProjectAuditDTOS.get(1).getInitialEditOpinion().split("<br/>");
+                    ArrayList<String> strings = new ArrayList<>();
+                    for (String s : split) {
+                        strings.add(s);
+                    }
+                    data.put("secondEditList",strings);
+                }else {
+                    data.put("secondEditList","");
+                }
+                //签名及日期
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getCreateById())){
+                    data.put("secondName",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(1).getCreateById()).getName());
+                }else {
+                    data.put("secondName","");
+                }
+                //校核修改结果认可意见
+                data.put("secondAgreeOpinion","");
+                data.put("secondAgreeName","");
+                data.put("secondAgreeDate","");
+
+
+            }else if (jyProjectAuditDTOS.size()>=3){
+                //审核意见
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getInitialAuditOpinion())){
+                    String[] split = jyProjectAuditDTOS.get(2).getInitialAuditOpinion().split("<br/>");
+                    //将审核意见放入集合中
+                    ArrayList<String> strings = new ArrayList<>();
+                    for (String s : split) {
+                        strings.add(s);
+                    }
+                    data.put("thirdAuditList",strings);
+                }else {
+                    data.put("thirdAuditList","");
+                }
+                //审核人
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getAuditPeople())){
+                    data.put("thirdAuditPeople",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(2).getAuditPeople()).getName());
+                }else {
+                    data.put("thirdAuditPeople","");
+                }
+                //日期
+                String format = sdf.format(jyProjectAuditDTOS.get(2).getUpdateTime());
+                if (null == jyProjectAuditDTOS.get(2).getUpdateTime()){
+                    data.put("thirdAuditDate","");
+                    data.put("thirdDate","");
+                }
+                data.put("thirdAuditDate",format);
+                data.put("thirdDate",format);
+                //修改意见
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getInitialEditOpinion())){
+                    String[] split = jyProjectAuditDTOS.get(2).getInitialEditOpinion().split("<br/>");
+                    ArrayList<String> strings = new ArrayList<>();
+                    for (String s : split) {
+                        strings.add(s);
+                    }
+                    data.put("thirdEditList",strings);
+                }else {
+                    data.put("thirdEditList","");
+                }
+                //签名
+                if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getCreateById())){
+                    data.put("thirdName",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(2).getCreateById()).getName());
+                }else {
+                    data.put("thirdName","");
+                }
+                //校核修改结果认可意见
+                data.put("thirdAgreeOpinion","");
+                data.put("thirdAgreeName","");
+                data.put("thirdAgreeDate","");
+
+            }
+            //签发人
+            data.put("submitPeople","");
+            //签发日期
+            data.put("submitDate","");
+        }else{
+            //一级复核意见
+            data.put("firstAuditList","");
+            //一级认可意见
+            data.put("firstAgreeOpinion","");
+            //一级审核人
+            data.put("firstAuditPeople","");
+            //一级认可签名
+            data.put("firstAgreeName","");
+            //一级审核日期
+            data.put("firstAuditDate","");
+            //一级认可日期
+            data.put("firstAgreeDate","");
+            //一级修改时间
+            data.put("firstDate","");
+            //一级修改意见
+            data.put("firstEditList","");
+            //一级修改人
+            data.put("firstName","");
+            //二级审核意见
+            data.put("secondAuditList","");
+            //二级认可意见
+            data.put("secondAgreeOpinion","");
+            //二级审核人
+            data.put("secondAuditPeople","");
+            //二级认可人
+            data.put("secondAgreeName","");
+            //二级审核时间
+            data.put("secondAuditDate","");
+            //二级认可时间
+            data.put("secondAgreeDate","");
+            //二级修改时间
+            data.put("secondDate","");
+            //二级修改意见
+            data.put("secondEditList","");
+            //二级修改人
+            data.put("secondName","");
+            //三级审核意见
+            data.put("thirdAuditList","");
+            //三级认可意见
+            data.put("thirdAgreeOpinion","");
+            //三级审核人
+            data.put("thirdAuditPeople","");
+            //三级认可人
+            data.put("thirdAgreeName","");
+            //三级审核日期
+            data.put("thirdAuditDate","");
+            //三级认可时间
+            data.put("thirdAgreeDate","");
+            //三级修改时间
+            data.put("thirdDate","");
+            //三级修改意见
+            data.put("thirdEditList","");
+            //三级修改人
+            data.put("thirdName","");
+            //签发人
+            data.put("submitPeople","");
+            //签发日期
+            data.put("submitDate","");
+
+        }
+        return data;
+    }
+
+
+
+
 }

+ 110 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectAuditDTO.java

@@ -0,0 +1,110 @@
+package com.jeeplus.business.project.service.dto;
+
+import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.workContractInfo.domain.JyWorkContractInfo;
+import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class JyProjectAuditDTO extends BaseDTO {
+    //校审id1
+    private String id1;
+    //校审id2
+    private String id2;
+    //校审id3
+    private String id3;
+
+    /**
+     * 创建人
+     */
+    private String createById;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 校审级别
+     */
+    private String auditLevel;
+
+    /**
+     * 审核人
+     */
+    private String auditPeople;
+
+    /**
+     * 项目审核通过时间
+     */
+    private Date projectAgreeTime;
+
+    /**
+     * 初始审核意见
+     */
+    private String initialAuditOpinion;
+
+    /**
+     * 初始修改意见
+     */
+    private String initialEditOpinion;
+
+    /**
+     * 审核意见
+     */
+    private String auditOpinion;
+
+    /**
+     * 修改意见
+     */
+    private String editOpinion;
+
+    /**
+     * 流程id,流程信息
+     */
+    private String procInsId;
+    private String processDefinitionId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 超期状态(0:未超期;1:超期)
+     */
+    private String exceedTimeStatus;
+
+
+    private JyProjectDTO jyProjectList;
+
+    private JyWorkContractInfoDto jyWorkContractInfoList;
+
+    /**
+     * 附件信息
+     */
+    private List<WorkAttachmentInfo> workAttachmentDtoList;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 校核修改结果认可意见
+     */
+    private String agreeOpinion;
+    private String agreeName;//签名
+    private Date agreeDate; //日期
+
+    /**
+     * 签发人及日期
+     */
+    private String submitPeople;
+    private Date submitDate;
+
+
+
+}

+ 84 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectDTO.java

@@ -176,4 +176,88 @@ public class JyProjectDTO extends BaseEntity implements Serializable {
     @TableField(exist = false)
     private String contractTypeFirst;
 
+    @TableField(exist = false)
+    private String place;
+    @TableField(exist = false)
+    private String leader;
+
+    private String primaryLinkman;
+
+    /**
+     * 一级校审id
+     */
+    @TableField(exist = false)
+    private String auditId1;
+
+    /**
+     * 二级校审id
+     */
+    @TableField(exist = false)
+    private String auditId2;
+
+    /**
+     * 三级校审id
+     */
+    @TableField(exist = false)
+    private String auditId3;
+
+    /**
+     * 一级校审流程id
+     */
+    @TableField(exist = false)
+    private String procInsId1;
+
+    /**
+     * 二级校审流程id
+     */
+    @TableField(exist = false)
+    private String procInsId2;
+
+    /**
+     * 三级校审流程id
+     */
+    @TableField(exist = false)
+    private String procInsId3;
+
+    /**
+     * 一级校审  taskId
+     */
+    @TableField(exist = false)
+    private String taskIdAudit1;
+
+    /**
+     * 二级校审  taskId
+     */
+    @TableField(exist = false)
+    private String taskIdAudit2;
+
+    /**
+     * 三级校审  taskId
+     */
+    @TableField(exist = false)
+    private String taskIdAudit3;
+
+    /**
+     * 数据审核人  一级校审
+     */
+    @TableField(exist = false)
+    private String auditUserIds1;
+
+    /**
+     * 数据审核人  二级校审
+     */
+    @TableField(exist = false)
+    private String auditUserIds2;
+
+    /**
+     * 数据审核人  三级校审
+     */
+    @TableField(exist = false)
+    private String auditUserIds3;
+
+    /**
+     * 审批部门
+     */
+    private String auditOffice;
+
 }

+ 17 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/mapstruct/JyProjectAuditWrapper.java

@@ -0,0 +1,17 @@
+package com.jeeplus.business.project.service.mapstruct;
+
+import com.jeeplus.assess.program.configuration.projectList.domain.ProgramAudit;
+import com.jeeplus.assess.program.configuration.projectList.service.dto.ProgramAuditDto;
+import com.jeeplus.business.project.domain.JyProjectAudit;
+import com.jeeplus.business.project.service.dto.JyProjectAuditDTO;
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface JyProjectAuditWrapper extends EntityWrapper<JyProjectAuditDTO, JyProjectAudit>{
+
+        JyProjectAuditWrapper INSTANCE = Mappers.getMapper(JyProjectAuditWrapper.class);
+
+}

+ 20 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/mapper/xml/JyWorkClientLinkmanMapper.xml

@@ -0,0 +1,20 @@
+<?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.jeeplus.business.workClientInfo.mapper.JyWorkClientLinkmanMapper">
+    <select id="selectByClientId" resultType="com.jeeplus.business.workClientInfo.domain.JyWorkClientLinkman">
+        select
+            name,
+            office,
+            position,
+            qq,
+            link_phone,
+            link_mobile,
+            email
+        from
+            jy_work_client_linkman
+        where client_id=#{client}
+    </select>
+
+
+
+</mapper>

Plik diff jest za duży
+ 2305 - 0
jeeplus-modules/jeeplus-business/src/main/resources/freemarker/firstAudit.ftl


Plik diff jest za duży
+ 2305 - 0
jeeplus-modules/jeeplus-business/src/main/resources/freemarker/secondAudit.ftl


Plik diff jest za duży
+ 2305 - 0
jeeplus-modules/jeeplus-business/src/main/resources/freemarker/thirdAudit.ftl


+ 17 - 13
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -452,18 +452,22 @@ public class UserController {
 //     * @param page
 //     * @return
 //     */
-//    @ApiLog("用户数据列表")
-//    @ApiOperation(value = "用户数据列表")
-//    @PreAuthorize("hasAuthority('sys:user:list')")
-//    @GetMapping("list2")
-//    public ResponseEntity list2(UserDTO userDTO, Page <UserDTO> page) throws Exception {
-//        QueryWrapper <UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( userDTO, UserDTO.class );
-//        if ( userDTO.getTenantDTO ( ) != null && StrUtil.isNotBlank ( userDTO.getTenantDTO ( ).getId ( ) ) ) {
-//            queryWrapper.eq ( "a.tenant_id", userDTO.getTenantDTO ( ).getId ( ) );
-//        }
-//        IPage <UserDTO> result = userService.findPage2 ( page, queryWrapper );
-//        return ResponseEntity.ok ( result );
-//    }
+    @ApiLog("用户数据列表")
+    @ApiOperation(value = "用户数据列表")
+    @GetMapping("list3")
+    public ResponseEntity list3(UserDTO userDTO, Page <UserDTO> page) throws Exception {
+        QueryWrapper <UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( userDTO, UserDTO.class );
+        String id = UserUtils.getCurrentUserDTO().getCompanyDTO().getId();
+        queryWrapper.eq("a.company_id",id);
+        if (StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())){
+            queryWrapper.eq("a.office_id",userDTO.getOfficeDTO().getId());
+        }
+        if ( userDTO.getTenantDTO ( ) != null && StrUtil.isNotBlank ( userDTO.getTenantDTO ( ).getId ( ) ) ) {
+            queryWrapper.eq ( "a.tenant_id", userDTO.getTenantDTO ( ).getId ( ) );
+        }
+        IPage <UserDTO> result = userService.findPage2 ( page, queryWrapper );
+        return ResponseEntity.ok ( result );
+    }
 
     /**
      * 保存人员执业资质
@@ -786,7 +790,7 @@ public class UserController {
      * @param showAll 是否显示不可用数据 1 显示 0 隐藏
      * @return
      */
-    @ApiLog("获取财务部门用户数据")
+    @ApiLog("获取嘉溢机构JSON数据")
     @GetMapping("treeUserDataJyOffice")
     public ResponseEntity treeUserDataJyOffice(@RequestParam(required = false) String officeName,@RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
         officeName = "嘉溢";

+ 81 - 0
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/JyAudit.java

@@ -0,0 +1,81 @@
+package com.jeeplus.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class JyAudit extends BaseEntity {
+
+    /**
+     * 创建人id
+     */
+    private String createById;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 校审级别
+     */
+    private String auditLevel;
+
+    /**
+     * 审核人
+     */
+    private String auditPeople;
+
+    /**
+     * 项目审核通过时间
+     */
+    private Date projectAgreeTime;
+
+    /**
+     * 初始审核意见
+     */
+    private String initialAuditOpinion;
+
+    /**
+     * 初始修改意见
+     */
+    private String initialEditOpinion;
+
+    /**
+     * 审核意见
+     */
+    private String auditOpinion;
+
+    /**
+     * 修改意见
+     */
+    private String editOpinion;
+
+    /**
+     * 流程id,流程信息
+     */
+    private String procInsId;
+    private String processDefinitionId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 超期状态(0:未超期;1:超期)
+     */
+    private String exceedTimeStatus;
+
+    private String projectName;
+
+    private static final long serialVersionUID = 1L;
+
+
+
+
+}

+ 9 - 0
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/feign/JyProjectAuditFeignApi.java

@@ -0,0 +1,9 @@
+package com.xxl.job.executor.feign;
+
+import com.jeeplus.common.constant.AppNameConstants;
+import com.jeeplus.flowable.feign.IJyProjectApi;
+import org.springframework.cloud.openfeign.FeignClient;
+
+@FeignClient(contextId = "JyProjectAuditFeignApi", name = AppNameConstants.APP_JYPROJECT_MODULES)
+public interface JyProjectAuditFeignApi extends IJyProjectApi {
+}

+ 106 - 1
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

@@ -3,6 +3,7 @@ package com.xxl.job.executor.service.jobhandler;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.TypeReference;
+import com.jeeplus.domain.JyAudit;
 import com.jeeplus.domain.MyNoticeList;
 import com.jeeplus.domain.ProgramProjectListInfo;
 import com.jeeplus.flowable.feign.IAssessApi;
@@ -10,9 +11,10 @@ import com.jeeplus.flowable.feign.IFlowableApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.IJobHandler;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.executor.feign.AssessFeignApi;
-import com.xxl.job.executor.feign.UserFeignApi;
+import com.xxl.job.executor.feign.JyProjectAuditFeignApi;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -162,6 +164,109 @@ public class SampleXxlJob {
         }
     }
 
+    /**
+     * 嘉溢项目校审发送通知
+     */
+    @XxlJob("projectAuditTask")
+    public void projectAuditTask(){
+        System.out.println("进来了---");
+        String json = SpringUtil.getBean(JyProjectAuditFeignApi.class).selectAudit();
+        List<JyAudit> projectList = JSON.parseObject(json, new TypeReference<List<JyAudit>>() {});
+        for (JyAudit jyProjectAudit : projectList) {
+            //对逾期状态及审核状态进行修改
+            SpringUtil.getBean(JyProjectAuditFeignApi.class).updateStatus(jyProjectAudit.getId());
+            //对数据进行发送通知
+            String taskName = null;
+            String titleStr = null;
+            //如果当前时间小于项目通过时间
+            if(jyProjectAudit.getProjectAgreeTime().after(new Date())){
+                taskName = "嘉溢-项目一级校审";
+                titleStr = "项目【"+ jyProjectAudit.getProjectName()+"】即将逾期,";
+            }
+
+            //获取当前时间
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date currentDate = new Date();
+            //将当前时间转化为字符串
+            String format = simpleDateFormat.format(currentDate);
+            //创建calendar对象
+            Calendar instance = Calendar.getInstance();
+            //将日期设置为项目通过时间
+            instance.setTime(jyProjectAudit.getProjectAgreeTime());
+            //往后推一个月
+            instance.add(Calendar.MONTH,1);
+            //获取推送后的日期
+            Date newDate = instance.getTime();
+            int interval1 = Integer.parseInt(this.getInterval(currentDate, newDate));
+            //计算天数之差
+            if(interval1 <= 5 && interval1 >=0){
+                titleStr = titleStr + "剩余:" + interval1 + "天。请尽快发起!";
+            }
+
+            Set<String> noticeUserSet = new HashSet<String>();
+            if(StringUtils.isNotBlank(jyProjectAudit.getCreateById())){
+
+                String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(jyProjectAudit.getCreateById());
+                UserDTO createUser = JSON.parseObject(byIdForXXL, new TypeReference<UserDTO>() {});
+                if(null != createUser && StringUtils.isNotBlank(createUser.getId())){
+                    noticeUserSet.add(createUser.getId());
+                }
+            }
+            List<String> noticeUserList = new ArrayList<String>(noticeUserSet);
+            if(noticeUserList.size()>0){
+                MyNoticeList myNotice = new MyNoticeList();
+                myNotice.setCreateById("1");
+                myNotice.setCreateTime(new Date());
+                myNotice.setUpdateById("1");
+                myNotice.setUpdateTime(new Date());
+                myNotice.setDelFlag(0);
+                //根据procInsId获取taskId
+                String currentTask = SpringUtil.getBean(IFlowableApi.class).getTaskIdByprocInstId(jyProjectAudit.getProcInsId());
+                myNotice.setTaskId(currentTask);
+                myNotice.setDefId(jyProjectAudit.getProcessDefinitionId());
+                myNotice.setTitle(titleStr);
+                myNotice.setTaskName(taskName);
+                myNotice.setLink("结束");
+                myNotice.setType("0");
+                myNotice.setCreateUser("管理员");
+                myNotice.setCreateTime(new Date());
+
+                for (String noticeUserId : noticeUserList) {
+                    myNotice.setNoticeId(noticeUserId);
+                    String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(jyProjectAudit.getCreateById());
+                    UserDTO createUser = JSON.parseObject(byIdForXXL, new TypeReference<UserDTO>() {});
+                    myNotice.setNoticeName(createUser.getName());
+                    //根据taskName和通知人 查询重复数量
+                    String myNoticeInfo = JSON.toJSONString(myNotice);
+                    Map<String,String> map = new HashMap();
+                    map.put("myNoticeInfo", myNoticeInfo);
+                    String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getRepetitionCountBymyNoticeTitle(map);
+                    MyNoticeList repetitionCountBymyNotice = JSON.parseObject(jsonInfo, new TypeReference<MyNoticeList>() {});
+
+                    if(null == repetitionCountBymyNotice){
+                        // 生成id
+                        String id = UUID.randomUUID().toString().replace("-", "");
+                        myNotice.setId(id);
+                        myNotice.setRepetitionCount(0);
+
+                        myNoticeInfo = JSON.toJSONString(myNotice);
+                        map.put("myNoticeInfo", myNoticeInfo);
+                        SpringUtil.getBean ( IFlowableApi.class ).insertMyNotice(map);
+                    }else{
+                        myNotice.setId(repetitionCountBymyNotice.getId());
+                        myNotice.setRepetitionCount(repetitionCountBymyNotice.getRepetitionCount()+1);
+
+                        myNoticeInfo = JSON.toJSONString(myNotice);
+                        map.put("myNoticeInfo", myNoticeInfo);
+                        SpringUtil.getBean ( IFlowableApi.class ).updateMyNotice(map);
+                    }
+                }
+            }
+        }
+
+    }
+
+
     public static String dateToString(Date date) {
         SimpleDateFormat sformat = new SimpleDateFormat("yyyy-MM-dd");//日期格式
         return sformat.format(date);