sangwenwei 1 год назад
Родитель
Сommit
91b2f32a89
44 измененных файлов с 2152 добавлено и 270 удалено
  1. 32 1
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/JyProjectApiFallbackFactory.java
  2. 40 2
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IJyProjectApi.java
  3. 126 7
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/controller/JyProjectController.java
  4. 26 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProject.java
  5. 45 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProjectArchive.java
  6. 27 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProjectArchiveFile.java
  7. 75 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProjectReportsSubmit.java
  8. 10 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectArchiveFileMapper.java
  9. 19 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectArchiveMapper.java
  10. 4 2
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectAuditMapper.java
  11. 4 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectMapper.java
  12. 5 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectOutinstanceMapper.java
  13. 24 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectReportsSubmitMapper.java
  14. 7 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectArchiveFileMapper.xml
  15. 33 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectArchiveMapper.xml
  16. 21 2
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectAuditMapper.xml
  17. 18 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectOutinstanceMapper.xml
  18. 88 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectReportsSubmitMapper.xml
  19. 61 5
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml
  20. 609 50
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java
  21. 46 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectArchiveDTO.java
  22. 10 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectDTO.java
  23. 106 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectReportsSubmitDTO.java
  24. 13 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/mapstruct/JyProjectArchiveWrapper.java
  25. 23 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/controller/SignetController.java
  26. 11 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/domain/Signet.java
  27. 7 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/mapper/SignetMapper.java
  28. 35 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/mapper/xml/SignetMapper.xml
  29. 94 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/service/SignetService.java
  30. 5 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/service/dto/SignetDTO.java
  31. 4 2
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/controller/JyWorkClientController.java
  32. 6 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/domain/JyWorkClientLinkman.java
  33. 2 8
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/mapper/xml/JyWorkClientInfoMapper.xml
  34. 2 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/mapper/xml/JyWorkClientLinkmanMapper.xml
  35. 17 2
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/service/JyWorkClientService.java
  36. 7 7
      jeeplus-modules/jeeplus-business/src/main/resources/freemarker/firstAudit.ftl
  37. 7 7
      jeeplus-modules/jeeplus-business/src/main/resources/freemarker/secondAudit.ftl
  38. 7 7
      jeeplus-modules/jeeplus-business/src/main/resources/freemarker/thirdAudit.ftl
  39. 94 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/modules/flowable/listener/JyProjectArchiveListener.java
  40. 1 1
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/modules/flowable/listener/JyProjectExecutionListener.java
  41. 73 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/JyProjectReportsSubmitInfo.java
  42. 8 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/JyUserSeal.java
  43. 9 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/feign/ReportsSubmitFeignApi.java
  44. 291 162
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

+ 32 - 1
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/JyProjectApiFallbackFactory.java

@@ -19,7 +19,12 @@ public class JyProjectApiFallbackFactory implements FallbackFactory<IJyProjectAp
             }
 
             @Override
-            public void updateStatus(String id) {
+            public String selectAuditInTime() {
+                return null;
+            }
+
+            @Override
+            public void updateStatus(String id, String status, String exceedTimeStatus) {
 
             }
 
@@ -27,6 +32,32 @@ public class JyProjectApiFallbackFactory implements FallbackFactory<IJyProjectAp
             public String findSeal() {
                 return null;
             }
+
+            @Override
+            public String findSealInTime() {
+                return null;
+            }
+
+            @Override
+            public void updateSealStatus(String id, String status, String exceedTimeStatus) {
+
+            }
+
+
+            @Override
+            public String findReportsSubmitListExccedTime() {
+                return null;
+            }
+
+            @Override
+            public String findReportsSubmitListInTime() {
+                return null;
+            }
+
+            @Override
+            public void updateExceedTimeStatus(String id, String status, String exceedTimeStatus) {
+
+            }
         };
     }
 }

+ 40 - 2
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IJyProjectApi.java

@@ -5,13 +5,14 @@ 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.context.annotation.Primary;
 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;
-
+@Primary
 @FeignClient(contextId = "jyProjectApi", name = AppNameConstants.APP_JYPROJECT_MODULES, fallbackFactory = JyProjectApiFallbackFactory.class)
 public interface IJyProjectApi {
 
@@ -21,11 +22,14 @@ public interface IJyProjectApi {
     @GetMapping(value = "/jyProject/selectAudit")
     String selectAudit();
 
+    @GetMapping(value = "/jyProject/selectAuditInTime")
+    public String selectAuditInTime();
+
     /**
      * 修改一级校审逾期状态
      */
     @GetMapping(value = "/jyProject/updateStatus")
-    void updateStatus(@RequestParam(value = "id") String id);
+    void updateStatus(@RequestParam(value = "id") String id,@RequestParam(value = "status")String status,@RequestParam(value = "exceedTimeStatus")String exceedTimeStatus);
 
     /**
      * 查询用印信息
@@ -34,4 +38,38 @@ public interface IJyProjectApi {
     @GetMapping("/useSeal/findSeal")
     String findSeal();
 
+    /**
+     * 查询用印未逾期信息
+     */
+    @GetMapping("/useSeal/findSealInTime")
+    String findSealInTime();
+
+    /**
+     * 修改外审状态
+     * @param id
+     */
+    @GetMapping(value = "/useSeal/updateSealStatus")
+    void updateSealStatus(@RequestParam(value = "id") String id,@RequestParam(value = "status") String status,@RequestParam(value = "exceedTimeStatus") String exceedTimeStatus);
+
+
+    /**
+     * 查询报批签发逾期的数据
+     */
+    @GetMapping(value = "/jyProject/findReportsSubmitListExccedTime")
+    String findReportsSubmitListExccedTime();
+
+    /**
+     * 查找报批签发未逾期的数据
+     */
+
+    @GetMapping(value = "/jyProject/findReportsSubmitListInTime")
+    String findReportsSubmitListInTime();
+
+    /**
+     * 修改报批签发逾期的状态
+     */
+    @GetMapping(value = "/jyProject/updateExceedTimeStatus")
+    void updateExceedTimeStatus(@RequestParam(value = "id")String id,@RequestParam(value = "status")String status,@RequestParam(value = "exceedTimeStatus")String exceedTimeStatus);
+
+
 }

+ 126 - 7
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/controller/JyProjectController.java

@@ -12,11 +12,11 @@ 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.domain.JyProjectReportsSubmit;
 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.project.service.dto.JyProjectOutinstanceDTO;
+import com.jeeplus.business.project.service.dto.*;
+import com.jeeplus.business.useSeal.service.dto.SignetDTO;
 import com.jeeplus.business.workContractInfo.domain.JyWorkContractInfo;
 import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
 import com.jeeplus.common.utils.ResponseUtil;
@@ -153,6 +153,16 @@ public class JyProjectController {
         return ResponseEntity.ok (list);
     }
 
+    /**
+     * 根据当前登录人获取外审通过的项目
+     */
+    @ApiOperation(value = "根据当前登录人获取外审通过的项目")
+    @GetMapping(value = "/getByCreateOut")
+    public ResponseEntity<IPage<JyProject>> getByCreateOut(JyProject info, Page<JyProject> page) throws Exception {
+        IPage<JyProject> list = jyProjectService.getByCreateOut(page, info);
+        return ResponseEntity.ok (list);
+    }
+
 
     /**
      * 根据id获取三级校审信息
@@ -187,9 +197,9 @@ public class JyProjectController {
     }
 
     /**
-     * 查询项目一级校审中未发起的项目
+     * 查询项目一级校审中未发起逾期的项目
      */
-    @ApiOperation(value = "查询项目一级校审中未发起的项目")
+    @ApiOperation(value = "查询项目一级校审中未发起逾期的项目")
     @GetMapping(value = "/selectAudit")
     public String selectAudit() {
         List<JyProjectAudit> list = jyProjectService.selectAudit();
@@ -197,12 +207,22 @@ public class JyProjectController {
     }
 
     /**
+     * 查询项目一级校审中未发起未逾期的项目
+     */
+    @ApiOperation(value = "查询项目一级校审中未发起未逾期的项目")
+    @GetMapping(value = "/selectAuditInTime")
+    public String selectAuditInTime() {
+        List<JyProjectAudit> list = jyProjectService.selectAuditInTime();
+        return JSON.toJSONString(list);
+    }
+
+    /**
      * 修改一级校审逾期状态
      */
     @ApiOperation(value = "修改一级校审逾期状态")
     @GetMapping(value = "/updateStatus")
-    public void updateStatus(@RequestParam String id) {
-        jyProjectService.updateStatus(id);
+    public void updateStatus(@RequestParam String id,@RequestParam String status,@RequestParam String exceedTimeStatus) {
+        jyProjectService.updateStatus(id,status,exceedTimeStatus);
 
     }
 
@@ -399,6 +419,105 @@ public class JyProjectController {
         return ResponseEntity.ok(s);
     }
 
+    /**
+     * 根据id查询
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id查询")
+    @GetMapping(value = "/queryReportsById")
+    public ResponseEntity<JyProjectReportsSubmitDTO> queryReportsById(@RequestParam String id){
+        JyProjectReportsSubmitDTO dto = jyProjectService.queryReportsById(id);
+        return ResponseEntity.ok(dto);
+    }
+
+
+    /**
+     * 保存或修改报批签发信息
+     */
+    @ApiOperation(value = "保存或修改报批签发信息")
+    @PostMapping("/saveReportsSubmit")
+    public ResponseEntity saveReportsSubmit(@RequestBody JyProjectReportsSubmitDTO dto) throws Exception{
+        String id = jyProjectService.saveReportsSubmit(dto);
+        return ResponseUtil.newInstance().add("businessTable", "jy_project_reports_submit").add("businessId", id).ok ("操作成功");
+    }
+
+
+    /**
+     * 根据id修改状态status
+     * @param id
+     * @param status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "/updateReportsSubmitById")
+    public void updateReportsSubmitById(String id,String status) {
+        jyProjectService.updateReportsSubmitById(id,status);
+    }
+
+
+    /**
+     * 查找报批签发逾期的数据
+     */
+    @ApiOperation(value = "查找报批签发逾期的数据")
+    @GetMapping(value = "/findReportsSubmitListExccedTime")
+    public String findReportsSubmitListExccedTime(){
+        List<JyProjectReportsSubmit> jyProjectReportsSubmits=jyProjectService.findReportsSubmitListExccedTime();
+        return JSON.toJSONString(jyProjectReportsSubmits);
+    }
+
+    /**
+     * 查找报批签发未逾期的数据
+     */
+    @ApiOperation(value = "查找报批签发未逾期的数据")
+    @GetMapping(value = "/findReportsSubmitListInTime")
+    public String findReportsSubmitListInTime(){
+        List<JyProjectReportsSubmit> jyProjectReportsSubmits=jyProjectService.findReportsSubmitListInTime();
+        return JSON.toJSONString(jyProjectReportsSubmits);
+    }
+
+
+    /**
+     * 修改报批签发逾期的状态
+     */
+    @ApiOperation(value = "修改报批签发逾期的状态")
+    @GetMapping(value = "/updateExceedTimeStatus")
+    public void updateExceedTimeStatus(@RequestParam(value = "id")String id,@RequestParam(value = "status")String status,@RequestParam(value = "exceedTimeStatus")String exceedTimeStatus){
+        jyProjectService.updateExceedTimeStatus(id,status,exceedTimeStatus);
+    }
+
+    /**
+     * 根据id查询归档信息
+     */
+    @ApiOperation(value = "根据id查询归档信息")
+    @GetMapping(value = "/findByIdArchive")
+    public ResponseEntity<JyProjectArchiveDTO> findByIdArchive(@RequestParam String id){
+        JyProjectArchiveDTO dto = jyProjectService.findByIdArchive(id);
+        return ResponseEntity.ok(dto);
+    }
+
+    /**
+     * 新增/修改归档
+     */
+    @ApiOperation(value = "新增/修改归档")
+    @PostMapping(value = "/saveFormArchive")
+    public ResponseEntity saveFormArchive(@RequestBody JyProjectArchiveDTO jyProjectArchiveDTO) throws Exception{
+        String id = jyProjectService.saveFormArchive(jyProjectArchiveDTO);
+        return ResponseUtil.newInstance().add("businessTable", "jy_project_archive").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改归档状态值status
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "根据id修改归档状态值status")
+    @PostMapping(value = "/updateStatusByArchiveId")
+    public ResponseEntity<String> updateStatusByArchiveId(@RequestBody JyProjectArchiveDTO dto) {
+        String s = jyProjectService.updateStatusByArchiveId(dto);
+        return ResponseEntity.ok(s);
+    }
+
+
 
 
 

+ 26 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProject.java

@@ -63,7 +63,7 @@ public class JyProject extends BaseEntity implements Serializable {
     /**
      * 报批签发
      */
-    private String reportSubmit;
+    private String reportsSubmit;
 
     /**
      * 归档状态
@@ -267,15 +267,40 @@ public class JyProject extends BaseEntity implements Serializable {
     /**
      * 用印id
      */
+    @TableField(exist = false)
     private String sealId;
 
     /**
      * 外审信息
      */
+    @TableField(exist = false)
     private String outInstanceId;
+    @TableField(exist = false)
     private String procInsIdOut;
+    @TableField(exist = false)
     private String taskIdOut;
 
+    /**
+     * 报批签发
+     */
+    @TableField(exist = false)
+    private String reportsSubmitId;
+    @TableField(exist = false)
+    private String procInsIdReports;
+    @TableField(exist = false)
+    private String taskIdReports;
+
+    /**
+     * 归档
+     */
+    @TableField(exist = false)
+    private String archiveId;
+    @TableField(exist = false)
+    private String procInsIdArchive;
+    @TableField(exist = false)
+    private String taskIdArchive;
+
+
 
 
 

+ 45 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProjectArchive.java

@@ -0,0 +1,45 @@
+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.List;
+
+@Data
+@TableName("jy_project_archive")
+public class JyProjectArchive extends BaseEntity {
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 登记状态
+     */
+    private String status;
+
+    /*
+    流程id
+     */
+    private String procInsId;
+    private String processDefinitionId;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 附件信息
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentInfo> fileList;
+
+    private static final long serialVersionUID = 1L;
+
+
+}

+ 27 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProjectArchiveFile.java

@@ -0,0 +1,27 @@
+package com.jeeplus.business.project.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 嘉溢-归档-附件
+ * @TableName cw_project_report_archive_file
+ */
+@Data
+@TableName("jy_project_archive_file")
+public class JyProjectArchiveFile extends BaseEntity {
+
+
+    /**
+     * 文件id
+     */
+    private String workAttachmentId;
+
+    /**
+     * 文件类型
+     */
+    private String fileType;
+
+    private static final long serialVersionUID = 1L;
+}

+ 75 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProjectReportsSubmit.java

@@ -0,0 +1,75 @@
+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 lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("jy_project_reports_submit")
+public class JyProjectReportsSubmit extends BaseEntity {
+
+    private String procInsId;
+
+    private String processDefinitionId;
+    /**
+     * 审核状态
+     */
+    private String status;
+
+
+    /**
+     * 类型(大类)
+     */
+    private String firstType;
+
+    /**
+     * 类型(小类)
+     */
+    private String type;
+
+    /**
+     * 份数
+     */
+    private Integer number;
+
+    /**
+     * 关联项目
+     */
+    private String projectId;
+
+
+    /*
+    说明
+     */
+    private String remarks;
+
+    /**
+     * 申请人部门
+     */
+    @TableField(exist = false)
+    private String office;
+
+    /*
+       逾期状态
+    */
+    private String exceedTimeStatus;
+
+    /**
+     * 首次发起时间
+     */
+    private Date firstSubmitTime;
+
+    /**
+     * 项目名称
+     */
+    @TableField(exist = false)
+    private String projectName;
+
+
+
+
+
+}

+ 10 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectArchiveFileMapper.java

@@ -0,0 +1,10 @@
+package com.jeeplus.business.project.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.project.domain.JyProjectArchiveFile;
+import com.jeeplus.business.project.domain.JyProjectOutInstanceFile;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface JyProjectArchiveFileMapper extends BaseMapper<JyProjectArchiveFile> {
+}

+ 19 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectArchiveMapper.java

@@ -0,0 +1,19 @@
+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.JyProjectArchive;
+import com.jeeplus.business.project.domain.JyProjectOutinstance;
+import com.jeeplus.business.project.service.dto.JyProjectArchiveDTO;
+import com.jeeplus.business.project.service.dto.JyProjectOutinstanceDTO;
+import com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface JyProjectArchiveMapper extends BaseMapper<JyProjectArchive> {
+
+    JyProjectArchiveDTO findById(@Param("id")String id);
+
+    List<WorkAttachmentInfoDTO> findDtos(@Param("id")String id);
+}

+ 4 - 2
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectAuditMapper.java

@@ -21,11 +21,13 @@ public interface JyProjectAuditMapper extends BaseMapper<JyProjectAudit> {
 
     List<JyProjectAudit> findFirstLevel();
     @InterceptorIgnore(tenantLine = "true")
-    void updateStatus(@Param("id")String id);
+    void updateStatus(@Param("id")String id,@Param("status")String status,@Param("exceedTimeStatus") String exceedTimeStatus);
     @InterceptorIgnore(tenantLine = "true")
     void updateStatus2(String id);
     @InterceptorIgnore(tenantLine = "true")
-    List<JyProjectAudit> selectAudit();
+    List<JyProjectAudit> selectAudit(@Param("newDate")Date newDate);
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyProjectAudit> selectAuditInTime(@Param("newDate")Date newDate);
 
     List<JyProjectAuditDTO> getByProjectId(@Param("projectId") String projectId);
 }

+ 4 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectMapper.java

@@ -42,4 +42,8 @@ public interface JyProjectMapper extends BaseMapper<JyProject> {
     JyProject getByName(@Param("s")String s);
 
     void updateReportIssuanceById(@Param("id") String s, @Param("projectIssuance") String status);
+
+    IPage<JyProject> getByCreateOut(@Param("id")String id, Page<JyProject> page,  @Param(Constants.WRAPPER)QueryWrapper<JyProject> wrapper);
+
+    void updateReportsSubmit(@Param("id")String s, @Param("status")String status);
 }

+ 5 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectOutinstanceMapper.java

@@ -1,5 +1,6 @@
 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.JyProjectOutinstance;
 import com.jeeplus.business.project.service.dto.JyProjectOutinstanceDTO;
@@ -13,4 +14,8 @@ public interface JyProjectOutinstanceMapper extends BaseMapper<JyProjectOutinsta
     JyProjectOutinstanceDTO findById(@Param("id") String id);
 
     List<WorkAttachmentInfoDTO> findDtos(@Param("id")String id);
+    @InterceptorIgnore(tenantLine = "true")
+    JyProjectOutinstance findByProjectId(@Param("projectId") String s);
+
+    void updateOutInstanceStatus(@Param("id") String id,@Param("status") String status,@Param("exceedTimeStatus") String exceedTimeStatus);
 }

+ 24 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectReportsSubmitMapper.java

@@ -0,0 +1,24 @@
+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.JyProjectReportsSubmit;
+import com.jeeplus.business.project.service.dto.JyProjectReportsSubmitDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+
+public interface JyProjectReportsSubmitMapper extends BaseMapper<JyProjectReportsSubmit> {
+
+    JyProjectReportsSubmitDTO findById(@Param("id")String id);
+
+    void updateReportsSubmitById(@Param("id") String id, @Param("status") String status);
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyProjectReportsSubmit> findReportsSubmitListExccedTime(@Param("newDate") Date newDate);
+    @InterceptorIgnore(tenantLine = "true")
+    void updateExceedTimeStatus(@Param("id")String id, @Param("status")String status, @Param("exceedTimeStatus")String exceedTimeStatus);
+
+    List<JyProjectReportsSubmit> findReportsSubmitListInTime(Date newDate);
+}

+ 7 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectArchiveFileMapper.xml

@@ -0,0 +1,7 @@
+<?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.JyProjectArchiveFileMapper">
+
+</mapper>

+ 33 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectArchiveMapper.xml

@@ -0,0 +1,33 @@
+<?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.JyProjectArchiveMapper">
+    <select id="findById" resultType="com.jeeplus.business.project.service.dto.JyProjectArchiveDTO">
+        select
+            id,
+            project_id,
+            status,
+            remarks,
+            proc_ins_id,
+            process_definition_id
+        from jy_project_archive
+        where id=#{id}
+    </select>
+
+    <select id="findDtos" resultType="com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO">
+        select
+            wa.id,
+			wa.url,
+			wa.attachment_name AS `name`,
+			wa.create_by_id AS `by`,
+			wa.create_time,
+			jy_paf.file_type as jyFileType
+		from
+		    work_attachment wa
+		left join jy_project_archive_file jy_paf on wa.id = jy_paf.work_attachment_id
+		where
+		    wa.del_flag = 0
+			AND wa.attachment_id = #{id}
+    </select>
+</mapper>

+ 21 - 2
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectAuditMapper.xml

@@ -77,7 +77,7 @@
     <update id="updateStatus">
         update
             jy_project_audit
-        set status='6' , exceed_time_status ='1' where id=#{id}
+        set status=#{status} , exceed_time_status =#{exceedTimeStatus} where id=#{id}
     </update>
 
     <update id="updateStatus2">
@@ -100,7 +100,26 @@
         where pa.del_flag = '0'
               and pa.audit_level = '1'
               and pr.status = '5'
-              and pa.status = '0'
+              and (pa.status = '0' or pa.status = null)
+              and pa.project_agree_time &lt; #{newDate}
+    </select>
+
+    <select id="selectAuditInTime" resultType="com.jeeplus.business.project.domain.JyProjectAudit">
+        select
+        <include refid="Audit_Column_List"></include>,
+        pr.name as projectName,
+        art.ID_ as task_id,
+        pr.proc_ins_id as projectProId,
+        pr.process_definition_id as projectDeId
+        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_
+        LEFT JOIN act_ru_task art1 ON pr.proc_ins_id = art1.PROC_INST_ID_
+        where pa.del_flag = '0'
+        and pa.audit_level = '1'
+        and pr.status = '5'
+        and (pa.status = '0' or pa.status = null)
+        and pa.project_agree_time &gt;= #{newDate}
     </select>
 
 

+ 18 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectOutinstanceMapper.xml

@@ -30,6 +30,24 @@
     </select>
 
 
+    <select id="findByProjectId" resultType="com.jeeplus.business.project.domain.JyProjectOutinstance">
+        select
+            id,
+            project_id,
+            status,
+            remarks,
+            proc_ins_id,
+            exceed_time_status,
+            process_definition_id
+        from jy_project_outinstance
+        where project_id=#{projectId}
+    </select>
+
+
+    <update id="updateOutInstanceStatus">
+        update jy_project_outinstance set status=#{status},exceed_time_status=#{exceedTimeStatus} where id=#{id}
+    </update>
+
 
 
 

+ 88 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/JyProjectReportsSubmitMapper.xml

@@ -0,0 +1,88 @@
+<?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.JyProjectReportsSubmitMapper">
+    <select id="findById" resultType="com.jeeplus.business.project.service.dto.JyProjectReportsSubmitDTO">
+        select
+            a.id,
+            a.create_by_id,
+            su.name as createByName,
+            a.create_time as createDate,
+            a.project_id,
+            a.type,
+            a.first_type,
+            a.number,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.first_submit_time,
+            so.name as office,
+            so.id,
+            art.ID_ as task_id
+            from jy_project_reports_submit a
+            left join sys_user su on a.create_by_id = su.id
+            left join sys_office so on su.office_id=so.id
+            left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+            where a.id=#{id}
+    </select>
+
+
+    <update id="updateReportsSubmitById">
+        update jy_project_reports_submit set status = #{status} where id=#{id}
+    </update>
+
+    <select id="findReportsSubmitListExccedTime" resultType="com.jeeplus.business.project.domain.JyProjectReportsSubmit">
+        select
+            a.id,
+            a.create_by_id,
+            su.name as createByName,
+            a.create_time as createDate,
+            a.project_id,
+            a.type,
+            a.first_type,
+            a.number,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.first_submit_time,
+            so.name as office,
+            so.id,
+            art.ID_ as task_id
+            from jy_project_reports_submit a
+            left join sys_user su on a.create_by_id = su.id
+            left join sys_office so on su.office_id=so.id
+            left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+            where a.first_submit_time &lt; #{newDate} and a.status != '5'
+    </select>
+
+    <update id="updateExceedTimeStatus">
+        update jy_project_reports_submit set status = #{status},exceed_time_status=#{exceedTimeStatus} where id=#{id}
+    </update>
+
+    <select id="findReportsSubmitListInTime" resultType="com.jeeplus.business.project.domain.JyProjectReportsSubmit">
+        select
+            a.id,
+            a.create_by_id,
+            su.name as createByName,
+            a.create_time as createDate,
+            a.project_id,
+            a.type,
+            a.first_type,
+            a.number,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.first_submit_time,
+            so.name as office,
+            so.id,
+            art.ID_ as task_id
+            from jy_project_reports_submit a
+            left join sys_user su on a.create_by_id = su.id
+            left join sys_office so on su.office_id=so.id
+            left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+            where a.first_submit_time &gt;= #{newDate} and a.status != '5'
+    </select>
+
+</mapper>

+ 61 - 5
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml

@@ -64,6 +64,11 @@
         UPDATE jy_project_record SET `status` = #{status} WHERE id = #{id}
     </update>
 
+    <update id="updateReportsSubmit">
+        UPDATE jy_project_record SET `reports_submit` = #{status} WHERE id = #{id}
+    </update>
+
+
     <select id="findPageList" resultType="com.jeeplus.business.project.domain.JyProject">
         SELECT
         distinct
@@ -81,8 +86,6 @@
            a.client_name,
            a.status,
            a.report_issuance,
-           a.reports_submit,
-           a.review_status,
            a.contract_status,
            a.project_place,
            a.build_place,
@@ -111,7 +114,11 @@
            po.status as outInstance,
            po.id as outInstanceId,
            po.proc_ins_id as procInsIdOut,
-           art4.ID_ as task_id_out
+           art4.ID_ as task_id_out,
+           par.status as reviewStatus,
+           par.id as archiveId,
+           par.proc_ins_id as procInsIdArchive,
+           art5.ID_ as task_id_archive
         FROM
             jy_project_record a
             LEFT JOIN sys_user b ON a.create_by_id = b.id
@@ -127,6 +134,8 @@
             LEFT JOIN act_ru_task art3 ON pa3.proc_ins_id = art3.PROC_INST_ID_
             left join jy_project_outinstance po on a.id=po.project_id
             LEFT JOIN act_ru_task art4 ON po.proc_ins_id = art4.PROC_INST_ID_
+            left join jy_project_archive par on a.id=par.project_id
+            LEFT JOIN act_ru_task art5 ON par.proc_ins_id = art5.PROC_INST_ID_
             ${ew.customSqlSegment}
             ORDER BY a.create_time DESC
     </select>
@@ -150,14 +159,13 @@
            a.report_issuance,
            a.out_instance,
            a.reports_submit,
-           a.review_status,
            a.contract_status,
            a.project_place,
            a.build_place,
+           a.project_leader,
            a.project_overview,
            a.special,
            a.contract_project_no,
-           a.project_leader,
            a.proc_ins_id,
            a.process_definition_id,
            b.name AS create_by_id,
@@ -193,6 +201,10 @@
            po.id as outInstanceId,
            po.proc_ins_id as procInsIdOut,
            art4.ID_ as task_id_out,
+           par.status as reviewStatus,
+           par.id as archiveId,
+           par.proc_ins_id as procInsIdArchive,
+           art5.ID_ as task_id_archive,
            so.name as auditOffice
         FROM
             jy_project_record a
@@ -210,6 +222,8 @@
             LEFT JOIN act_ru_task art3 ON pa3.proc_ins_id = art3.PROC_INST_ID_
             left join jy_project_outinstance po on a.id=po.project_id
             LEFT JOIN act_ru_task art4 ON po.proc_ins_id = art4.PROC_INST_ID_
+            left join jy_project_archive par on a.id=par.project_id
+            LEFT JOIN act_ru_task art5 ON par.proc_ins_id = art5.PROC_INST_ID_
         where a.id = #{id}
     </select>
 
@@ -686,6 +700,48 @@
              ${ew.customSqlSegment}
             ORDER BY a.update_time DESC
     </select>
+
+    <select id="getByCreateOut" resultType="com.jeeplus.business.project.domain.JyProject">
+        SELECT
+           a.id,
+           a.create_by_id as create_by,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
+           a.del_flag,
+           a.name,
+           a.no,
+           a.contract_id,
+           a.contract_name,
+           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,
+           a.review_status,
+           a.contract_status,
+           a.project_place,
+           a.build_place,
+           a.project_overview,
+           a.special,
+           a.contract_project_no,
+           (SELECT su.name from sys_user su where a.project_leader = su.id) as projectLeader,
+           a.proc_ins_id,
+           a.process_definition_id,
+           b.name AS create_by_id
+        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 jy_project_outinstance po on a.id=po.project_id
+             ${ew.customSqlSegment}
+            ORDER BY a.update_time DESC
+    </select>
+
     <select id="getByName" resultType="com.jeeplus.business.project.domain.JyProject">
         SELECT
            a.id,

+ 609 - 50
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java

@@ -12,14 +12,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.assess.workContract.mapper.WorkContractInfoMapper;
 import com.jeeplus.business.project.domain.*;
 import com.jeeplus.business.project.mapper.*;
-import com.jeeplus.business.project.service.dto.JyProjectAuditDTO;
-import com.jeeplus.business.project.service.dto.JyProjectDTO;
-import com.jeeplus.business.project.service.dto.JyProjectOutinstanceDTO;
+import com.jeeplus.business.project.service.dto.*;
+import com.jeeplus.business.project.service.mapstruct.JyProjectArchiveWrapper;
 import com.jeeplus.business.project.service.mapstruct.JyProjectAuditWrapper;
 import com.jeeplus.business.project.service.mapstruct.JyProjectOutInstanceWrapper;
 import com.jeeplus.business.useSeal.domain.Signet;
 import com.jeeplus.business.useSeal.mapper.SignetMapper;
-import com.jeeplus.business.useSeal.service.SignetService;
+import com.jeeplus.business.workClientInfo.domain.JyWorkClientInfo;
 import com.jeeplus.business.workClientInfo.domain.JyWorkClientLinkman;
 import com.jeeplus.business.workClientInfo.mapper.JyWorkClientInfoMapper;
 import com.jeeplus.business.workClientInfo.mapper.JyWorkClientLinkmanMapper;
@@ -30,6 +29,7 @@ import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
 import com.jeeplus.sys.domain.DictValue;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import com.jeeplus.sys.feign.IUserApi;
@@ -95,6 +95,15 @@ public class JyProjectService {
     @Resource
     private JyProjectOutInstanceFileMapper jyProjectOutInstanceFileMapper;
 
+    @Autowired
+    private JyProjectReportsSubmitMapper jyProjectReportsSubmitMapper;
+
+    @Autowired
+    private JyProjectArchiveMapper jyProjectArchiveMapper;
+
+    @Autowired
+    private JyProjectArchiveFileMapper jyProjectArchiveFileMapper;
+
 
     /**
      * 项目登记列表
@@ -141,8 +150,8 @@ public class JyProjectService {
             wrapper.like("a.contract_name",info.getContractName());
         }
         //委托方
-        if (StringUtils.isNotBlank(info.getClientName())){
-            wrapper.like("a.client_name",info.getClientName());
+        if (StringUtils.isNotBlank(info.getPrimaryLinkman())){
+            wrapper.like("wci.primary_linkman",info.getPrimaryLinkman());
         }
         //登记状态
         if (StringUtils.isNotBlank(info.getStatus())){
@@ -157,12 +166,12 @@ public class JyProjectService {
             wrapper.eq("po.status", info.getOutInstance());
         }
         //报批签发
-        if (StringUtils.isNotBlank(info.getReportSubmit())){
-            wrapper.eq("a.report_submit", info.getReportSubmit());
+        if (StringUtils.isNotBlank(info.getReportsSubmit())){
+            wrapper.eq("a.reports_submit", info.getReportsSubmit());
         }
         //归档状态
         if (StringUtils.isNotBlank(info.getReviewStatus())){
-            wrapper.eq("a.review_status", info.getReviewStatus());
+            wrapper.eq("par.status", info.getReviewStatus());
         }
         IPage<JyProject> pageList = jyProjectMapper.findPageList(page, wrapper);
         pageList.getRecords().stream().forEach(item ->{
@@ -175,7 +184,6 @@ public class JyProjectService {
             //合同名称及委托方联系人
             if (StringUtils.isEmpty(item.getContractName())){
                 item.setContractName("暂无合同");
-                item.setPrimaryLinkman(item.getClientName());
             }
             //获取用印id
             List<Signet> signets = signetMapper.selectList(new QueryWrapper<Signet>());
@@ -191,6 +199,25 @@ public class JyProjectService {
                     }
                 }
             }
+            //获取报批签发信息
+            List<JyProjectReportsSubmit> jyProjectReportsSubmits = jyProjectReportsSubmitMapper.selectList(new QueryWrapper<JyProjectReportsSubmit>());
+            for (JyProjectReportsSubmit jyProjectReportsSubmit : jyProjectReportsSubmits) {
+                if (StringUtils.isNotBlank(jyProjectReportsSubmit.getProjectId())){
+                    String[] split = jyProjectReportsSubmit.getProjectId().split(",");
+                    for (String s : split) {
+                        if (StringUtils.isNotBlank(s)){
+                            if (s.equals(item.getId())){
+                                item.setReportsSubmitId(jyProjectReportsSubmit.getId());
+                                item.setProcInsIdReports(jyProjectReportsSubmit.getProcInsId());
+                                item.setReportsSubmit(jyProjectReportsSubmit.getStatus());
+                            }
+                        }
+                    }
+                }
+
+            }
+
+
         });
         return pageList;
     }
@@ -256,11 +283,11 @@ public class JyProjectService {
         String projectNo = "";
 
         String id = UUID.randomUUID().toString().replace("-", "");
+        JyWorkContractInfo byId = jyWorkContractInfoMapper.findById(dto.getContractId());
         //生成项目编号
         if (dto.getContractStatus().equals("0")){
             projectNo = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyProjectDTO.BIZ_CODE,currentToken);
         }else {
-            JyWorkContractInfo byId = jyWorkContractInfoMapper.findById(dto.getContractId());
             Integer projectNum=jyProjectMapper.getProByContractId(dto.getContractId());
             Integer count=0;
             if (projectNum == 0){
@@ -281,7 +308,7 @@ public class JyProjectService {
         List<JyWorkClientLinkman> clientList = dto.getClientList();
         for (JyWorkClientLinkman jyWorkClientLinkman : clientList) {
             jyProject.setClient(jyWorkClientLinkman.getId());//联系人id
-            jyProject.setClientName(jyWorkClientLinkman.getName());//联系人姓名
+            jyProject.setClientName(jyWorkClientLinkman.getClientName());//联系人姓名
         }
         jyProject.setProjectLeader(dto.getProjectLeader());//项目负责人
         jyProject.setProjectPlace(dto.getProjectPlace());//项目所在地
@@ -333,6 +360,11 @@ public class JyProjectService {
         jyProjectOutinstance.setStatus("0");
         jyProjectOutinstanceMapper.insert(jyProjectOutinstance);
 
+        //归档添加
+        JyProjectArchive jyProjectArchive = new JyProjectArchive();
+        jyProjectArchive.setProjectId(jyProject.getId());
+        jyProjectArchive.setStatus("0");
+        jyProjectArchiveMapper.insert(jyProjectArchive);
 
         // 保存附件信息
         if (CollectionUtils.isNotEmpty(dto.getFiles())) {
@@ -345,9 +377,33 @@ public class JyProjectService {
         String currentToken = TokenProvider.getCurrentToken();
         //获取当前登录人信息
         UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        String projectNo = "";
+        //获取合同编号
+        JyWorkContractInfo contractInfo = jyWorkContractInfoMapper.findById(dto.getContractId());
         // 修改项目管理列表主表信息
+        if (dto.getContractStatus().equals("1")){
+            //获取项目编号
+            JyProject project = jyProjectMapper.getById(dto.getId());
+            Integer projectNum=jyProjectMapper.getProByContractId(dto.getContractId());
+            //生成新的项目编号   合同编号+合同下的项目数量+(项目编号)
+            Integer count=0;
+            //判断当前合同下是否有项目
+            if (projectNum==0){
+                projectNo=contractInfo.getNo()+"-0"+(count+1)+"("+project.getNo()+")";
+            }else {
+                projectNo=contractInfo.getNo()+"-0"+(projectNum+1)+"("+project.getNo()+")";
+            }
+        }else {
+            projectNo = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyProjectDTO.BIZ_CODE,currentToken);
+        }
         JyProject jyProject = new JyProject();
         BeanUtils.copyProperties(dto, jyProject);
+        List<JyWorkClientLinkman> clientList = dto.getClientList();
+        for (JyWorkClientLinkman jyWorkClientLinkman : clientList) {
+            jyProject.setClient(jyWorkClientLinkman.getId());//联系人id
+            jyProject.setClientName(jyWorkClientLinkman.getClientName());//联系人姓名
+        }
+        jyProject.setNo(projectNo);
         jyProject.setUpdateById(userDTO.getId());
         jyProject.setUpdateTime(new Date());
         jyProject.setDelFlag(0);
@@ -576,6 +632,36 @@ public class JyProjectService {
     }
 
     /**
+     * 获取当前登录人外审通过的项目
+     * @param page
+     * @param info
+     * @return
+     */
+    public IPage<JyProject> getByCreateOut(Page<JyProject> page, JyProject info) throws Exception {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        QueryWrapper<JyProject> wrapper = QueryWrapperGenerator.buildQueryCondition(info, JyProject.class);
+        wrapper.eq("a.create_by_id",userDTO.getId());
+        wrapper.eq("po.status","5");
+        //创建时间
+        if (info.getCreateDates() != null && info.getCreateDates().length > 0) {
+            wrapper.between("a.create_time", info.getCreateDates()[0], info.getCreateDates()[1]);
+        }
+        //项目编号
+        if (StringUtils.isNotBlank(info.getNo())){
+            wrapper.like("a.no",info.getNo());
+        }
+        //项目名称
+        if (StringUtils.isNotBlank(info.getName())){
+            wrapper.like("a.name",info.getName());
+        }
+        IPage<JyProject> projectIPage=jyProjectMapper.getByCreateOut(userDTO.getId(),page,wrapper);
+        return projectIPage;
+    }
+
+
+
+    /**
      * 获取三级校审信息
      * @param id
      * @return
@@ -682,6 +768,11 @@ public class JyProjectService {
         jyProjectAudit.setId(dto.getId());
         jyProjectAudit.setStatus(dto.getStatus());
         jyProjectAuditMapper.update(jyProjectAudit,new QueryWrapper<JyProjectAudit>().lambda().eq(JyProjectAudit::getId,jyProjectAudit.getId()));
+        //修改逾期完成的校审状态
+        JyProjectAuditDTO byIdAudit = jyProjectAuditMapper.findByIdAudit(dto.getId());
+        if (byIdAudit.getExceedTimeStatus().equals("1") && dto.getStatus().equals("5")){
+            jyProjectAuditMapper.updateStatus2(byIdAudit.getId());
+        }
         return "操作成功";
     }
 
@@ -690,7 +781,46 @@ public class JyProjectService {
      * @return
      */
     public List<JyProjectAudit> selectAudit() {
-        List<JyProjectAudit> list=jyProjectAuditMapper.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;
+    }
+
+    /**
+     * 查询项目一级校审中逾期未发起的项目
+     * @return
+     */
+    public List<JyProjectAudit> selectAuditInTime() {
+        //获取一个月前的时间
+        //创建时间格式化对象
+        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.selectAuditInTime(newDate);
         return list;
     }
 
@@ -698,22 +828,8 @@ public class JyProjectService {
      * 修改一级校审逾期状态
      * @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());
-                    }
-                }
-            }
+    public void updateStatus(String id,String status,String exceedTimeStatus) {
+        jyProjectAuditMapper.updateStatus(id,status,exceedTimeStatus);
 
     }
 
@@ -768,8 +884,8 @@ public class JyProjectService {
         if(null != jyProjectAuditDTOS){
             if (jyProjectAuditDTOS.size()>=1){
                 //审核意见
+                ArrayList<String> strings = new ArrayList<>();
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getInitialAuditOpinion())){
-                    ArrayList<String> strings = new ArrayList<>();
                     if (jyProjectAuditDTOS.get(0).getInitialAuditOpinion().contains("<br/>")){
                         String[] split = jyProjectAuditDTOS.get(0).getInitialAuditOpinion().split("<br/>");
                         //将审核意见放入集合中
@@ -781,7 +897,8 @@ public class JyProjectService {
                     }
                     data.put("firstAuditList",strings);
                 }else {
-                    data.put("firstAuditList","");
+                   strings.add("");
+                    data.put("firstAuditList",strings);
                 }
                 //审核人
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getAuditPeople())){
@@ -800,19 +917,21 @@ public class JyProjectService {
                     data.put("firstDate",format);
                 }
                 //修改意见
+                ArrayList<String> strings1 = new ArrayList<>();
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getInitialEditOpinion())){
-                    ArrayList<String> strings = new ArrayList<>();
+
                     if (jyProjectAuditDTOS.get(0).getInitialEditOpinion().contains("<br/>")){
                         String[] split = jyProjectAuditDTOS.get(0).getInitialEditOpinion().split("<br/>");
                         for (String s : split) {
-                            strings.add(s);
+                            strings1.add(s);
                         }
                     }else {
-                        strings.add(jyProjectAuditDTOS.get(0).getInitialEditOpinion());
+                        strings1.add(jyProjectAuditDTOS.get(0).getInitialEditOpinion());
                     }
-                    data.put("firstEditList",strings);
+                    data.put("firstEditList",strings1);
                 }else {
-                    data.put("firstEditList","");
+                    strings1.add("");
+                    data.put("firstEditList",strings1);
                 }
                 //签名
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getCreateById())){
@@ -828,8 +947,9 @@ public class JyProjectService {
             }
             if (jyProjectAuditDTOS.size()>=2){
                 //审核意见
+                ArrayList<String> strings = new ArrayList<>();
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getInitialAuditOpinion())){
-                    ArrayList<String> strings = new ArrayList<>();
+
                     if (jyProjectAuditDTOS.get(1).getInitialAuditOpinion().contains("<br/>")){
                         String[] split = jyProjectAuditDTOS.get(1).getInitialAuditOpinion().split("<br/>");
                         //将审核意见放入集合中
@@ -841,7 +961,8 @@ public class JyProjectService {
                     }
                     data.put("secondAuditList",strings);
                 }else {
-                    data.put("secondAuditList","");
+                    strings.add("");
+                    data.put("secondAuditList",strings);
 
                 }
                 //审核人
@@ -860,19 +981,20 @@ public class JyProjectService {
                     data.put("secondDate",format);
                 }
                 //修改意见
+                ArrayList<String> strings1 = new ArrayList<>();
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getInitialEditOpinion())){
-                    ArrayList<String> strings = new ArrayList<>();
                     if (jyProjectAuditDTOS.get(1).getInitialEditOpinion().contains("<br/>")){
                         String[] split = jyProjectAuditDTOS.get(1).getInitialEditOpinion().split("<br/>");
                         for (String s : split) {
-                            strings.add(s);
+                            strings1.add(s);
                         }
                     }else {
-                        strings.add(jyProjectAuditDTOS.get(1).getInitialEditOpinion());
+                        strings1.add(jyProjectAuditDTOS.get(1).getInitialEditOpinion());
                     }
-                    data.put("secondEditList",strings);
+                    data.put("secondEditList",strings1);
                 }else {
-                    data.put("secondEditList","");
+                    strings1.add("");
+                    data.put("secondEditList",strings1);
                 }
                 //签名及日期
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getCreateById())){
@@ -889,8 +1011,8 @@ public class JyProjectService {
             }
             if (jyProjectAuditDTOS.size()>=3){
                 //审核意见
+                ArrayList<String> strings = new ArrayList<>();
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getInitialAuditOpinion())){
-                    ArrayList<String> strings = new ArrayList<>();
                     if (jyProjectAuditDTOS.get(2).getInitialAuditOpinion().contains("<br/>")){
                         String[] split = jyProjectAuditDTOS.get(2).getInitialAuditOpinion().split("<br/>");
                         //将审核意见放入集合中
@@ -902,7 +1024,8 @@ public class JyProjectService {
                     }
                     data.put("thirdAuditList",strings);
                 }else {
-                    data.put("thirdAuditList","");
+                    strings.add("");
+                    data.put("thirdAuditList",strings);
                 }
                 //审核人
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getAuditPeople())){
@@ -919,21 +1042,21 @@ public class JyProjectService {
                 data.put("thirdAuditDate",format);
                 data.put("thirdDate",format);
                 //修改意见
-                ArrayList<String> strings = Lists.newArrayList();
+                ArrayList<String> strings1 = Lists.newArrayList();
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getInitialEditOpinion())){
 //                    ArrayList<String> strings = new ArrayList<>();
                     if (jyProjectAuditDTOS.get(2).getInitialEditOpinion().contains("<br/>")){
                         String[] split = jyProjectAuditDTOS.get(2).getInitialEditOpinion().split("<br/>");
                         for (String s : split) {
-                            strings.add(s);
+                            strings1.add(s);
                         }
                     }else {
-                        strings.add(jyProjectAuditDTOS.get(2).getInitialEditOpinion());
+                        strings1.add(jyProjectAuditDTOS.get(2).getInitialEditOpinion());
                     }
-                    data.put("thirdEditList",strings);
+                    data.put("thirdEditList",strings1);
                 }else {
                     strings.add("");
-                    data.put("thirdEditList",strings);
+                    data.put("thirdEditList",strings1);
                 }
                 //签名
                 if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getCreateById())){
@@ -1067,6 +1190,10 @@ public class JyProjectService {
         }else{
             jyProjectOutinstanceMapper.insert(jyProjectOutinstance);
         }
+        JyProject jyProject = new JyProject();
+        jyProject.setId(jyProjectOutinstance.getProjectId());
+        jyProject.setOutInstance(jyProjectOutinstanceDTO.getStatus());
+        jyProjectMapper.updateById(jyProject);
         //附件
         if (ObjectUtil.isNotEmpty(jyProjectOutinstanceDTO)) {
             SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(jyProjectOutinstance.getId());
@@ -1111,6 +1238,438 @@ public class JyProjectService {
         jyProjectOutinstance.setId(dto.getId());
         jyProjectOutinstance.setStatus(dto.getStatus());
         jyProjectOutinstanceMapper.update(jyProjectOutinstance,new QueryWrapper<JyProjectOutinstance>().lambda().eq(JyProjectOutinstance::getId,jyProjectOutinstance.getId()) );
+        //修改项目外审状态
+        JyProject jyProject = new JyProject();
+        jyProject.setId(jyProjectOutinstance.getProjectId());
+        jyProject.setOutInstance(dto.getStatus());
+        jyProjectMapper.updateById(jyProject);
+        return "操作成功";
+    }
+
+    public JyProjectReportsSubmitDTO queryReportsById(String id) {
+        JyProjectReportsSubmitDTO jyProjectReportsSubmitDTO = new JyProjectReportsSubmitDTO();
+        JyProjectReportsSubmitDTO dto = jyProjectReportsSubmitMapper.findById(id);
+        BeanUtils.copyProperties(dto, jyProjectReportsSubmitDTO);
+        //查询项目信息
+        if (StringUtils.isNotBlank(dto.getProjectId())){
+            String[] split = dto.getProjectId().split(",");
+            ArrayList<JyProject> signetDTOS = new ArrayList<>();
+            for (String s : split) {
+                JyProject jyProject=jyProjectMapper.getById(s);
+                signetDTOS.add(jyProject);
+            }
+            jyProjectReportsSubmitDTO.setProjectList(signetDTOS);
+        }
+        List<String> stringList = new ArrayList<>();
+        if (com.jeeplus.utils.StringUtils.isNotBlank(dto.getType())){
+            stringList.add(dto.getFirstType());
+            stringList.add(dto.getType());
+        }else {
+            stringList.add(dto.getFirstType());
+        }
+        jyProjectReportsSubmitDTO.setTypes(stringList);
+        jyProjectReportsSubmitDTO.setCreateById(dto.getCreateById());
+        // 查询附件信息
+        List<WorkAttachmentInfo> files = jyWorkContractInfoMapper.findDtos(id);
+        if (CollectionUtils.isNotEmpty(files)) {
+            for (WorkAttachmentInfo i : files) {
+                i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+            }
+            jyProjectReportsSubmitDTO.setFiles(files);
+        }
+        return  jyProjectReportsSubmitDTO;
+    }
+
+    /**
+     * 保存或修改报批签发
+     * @param dto
+     * @return
+     */
+    public String saveReportsSubmit(JyProjectReportsSubmitDTO dto) throws Exception {
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken (TokenProvider.getCurrentToken ( ));
+        if (com.jeeplus.utils.StringUtils.isNotEmpty(dto.getId())) {
+            return updateReportsSubmit(dto, userDTO);
+        } else {
+            return addReportsSubmit(dto, userDTO);
+        }
+    }
+
+    public synchronized String addReportsSubmit(JyProjectReportsSubmitDTO dto, UserDTO userDTO) throws Exception{
+        // 生成id
+        String id = UUID.randomUUID().toString().replace("-", "");
+        // 保存基础信息表信息
+        JyProjectReportsSubmit jyProjectReportsSubmit = new JyProjectReportsSubmit();
+        BeanUtils.copyProperties(dto, jyProjectReportsSubmit);
+        jyProjectReportsSubmit.setId(id);
+        jyProjectReportsSubmit.setCreateById(userDTO.getId());
+        jyProjectReportsSubmit.setCreateTime(new Date());
+        jyProjectReportsSubmit.setUpdateById(userDTO.getId());
+        jyProjectReportsSubmit.setUpdateTime(new Date());
+        jyProjectReportsSubmit.setDelFlag(0);
+        //保存关联项目信息
+        String projectId="";
+        if (ObjectUtil.isNotEmpty(dto.getProjectList())){
+            for (JyProject jyProject : dto.getProjectList()) {
+
+                projectId+=jyProject.getProjectId()+",";
+            }
+        }
+        jyProjectReportsSubmit.setProjectId(projectId);
+        //保存用印类型
+        if (null != dto.getTypes()&&dto.getTypes().size()>0){
+            if (dto.getTypes().size()==1){
+                jyProjectReportsSubmit.setFirstType(dto.getTypes().get(0));
+            }else {
+                jyProjectReportsSubmit.setFirstType(dto.getTypes().get(0));
+                jyProjectReportsSubmit.setType(dto.getTypes().get(1));
+            }
+        }
+
+        jyProjectReportsSubmit.setRemarks(dto.getRemarks());//说明
+        jyProjectReportsSubmit.setStatus(dto.getStatus());//状态
+        jyProjectReportsSubmit.setNumber(dto.getNumber()); //份数
+        jyProjectReportsSubmit.setFirstSubmitTime(new Date()); //初次发起时间
+        jyProjectReportsSubmitMapper.insert(jyProjectReportsSubmit);
+        // 保存附件列表信息
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            saveReportsFiles(dto.getFiles(), userDTO, id);
+        }
+        //修改项目中的报批签发状态
+        if (com.jeeplus.utils.StringUtils.isNotBlank(projectId)){
+            String[] split = projectId.split(",");
+            for (String s : split) {
+                if (com.jeeplus.utils.StringUtils.isNotBlank(s)){
+                    jyProjectMapper.updateReportsSubmit(s,jyProjectReportsSubmit.getStatus());
+                }
+            }
+        }
+        return id;
+    }
+
+    public String updateReportsSubmit(JyProjectReportsSubmitDTO dto, UserDTO userDTO) {
+        JyProjectReportsSubmit jyProjectReportsSubmit = new JyProjectReportsSubmit();
+        BeanUtils.copyProperties(dto, jyProjectReportsSubmit);
+        jyProjectReportsSubmit.setUpdateTime(new Date());
+        //保存关联项目信息
+        String projectId="";
+        if (ObjectUtil.isNotEmpty(dto.getProjectList())){
+            for (JyProject jyProject : dto.getProjectList()) {
+                projectId=jyProject.getId()+",";
+            }
+        }
+        jyProjectReportsSubmit.setProjectId(projectId);
+        //保存用印类型
+        if (ObjectUtil.isNotEmpty(dto.getTypes())){
+            if (StringUtils.isNotBlank(dto.getTypes().get(1))){
+                jyProjectReportsSubmit.setType(dto.getTypes().get(1));
+            }
+            if (StringUtils.isNotBlank(dto.getTypes().get(0))){
+                jyProjectReportsSubmit.setFirstType(dto.getTypes().get(0));
+            }
+        }
+        jyProjectReportsSubmit.setRemarks(dto.getRemarks());//说明
+        jyProjectReportsSubmit.setStatus(dto.getStatus());//状态
+        jyProjectReportsSubmit.setNumber(dto.getNumber()); //份数
+        jyProjectReportsSubmitMapper.updateById(jyProjectReportsSubmit);
+        // 修改附件信息
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            updateReportsFiles(dto.getFiles(), userDTO, dto.getId());
+        }
+        //修改项目中的报批签发状态
+        if (com.jeeplus.utils.StringUtils.isNotBlank(projectId)){
+            String[] split = projectId.split(",");
+            for (String s : split) {
+                if (com.jeeplus.utils.StringUtils.isNotBlank(s)){
+                    jyProjectMapper.updateReportsSubmit(s,jyProjectReportsSubmit.getStatus());
+                }
+            }
+        }
+        return dto.getId();
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveReportsFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentInfo dto : list) {
+            WorkAttachment i = new WorkAttachment();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("jyReportsSubmit");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+            Map<String,String> map = new HashMap<>();
+            String workAttachment = JSON.toJSONString((i));
+            String userDTOInfo = JSON.toJSONString((userDTO));
+            map.put("workAttachment",workAttachment);
+            map.put("userDTO",userDTOInfo);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            j++;
+        }
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateReportsFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentInfo dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachmentInfo> infoList = signetMapper.findFileList(id);
+        if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+//                    ossServiceMapper.deleteById(i.getId());
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = signetMapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachment i = new WorkAttachment();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("jyReportsSubmit");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    /**
+     * 根据id修改状态
+     * @param id
+     * @param status
+     */
+    public void updateReportsSubmitById(String id, String status) {
+        JyProjectReportsSubmitDTO byId = jyProjectReportsSubmitMapper.findById(id);
+        String submitStatus="";
+        //判断报批签发是否逾期
+        if (StringUtils.isNotBlank(byId.getExceedTimeStatus())){
+            if (byId.getExceedTimeStatus().equals("1") && status.equals("5")){
+                submitStatus="7";
+            }else {
+                submitStatus = status;
+            }
+        }else {
+            submitStatus = status;
+        }
+        jyProjectReportsSubmitMapper.updateReportsSubmitById(id,submitStatus);
+
+        if (ObjectUtil.isNotEmpty(byId)){
+            String[] split = byId.getProjectId().split(",");
+            for (String s : split) {
+                if (StringUtils.isNotBlank(s)){
+                    jyProjectMapper.updateReportsSubmit(s,status);
+                }
+            }
+        }
+    }
+
+    public List<JyProjectReportsSubmit> findReportsSubmitListExccedTime() {
+        //创建时间格式化对象
+        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,-2);
+        //获取推送后的日期
+        Date newDate = instance.getTime();
+        //找出初次发起报批签发时间超过两个月的数据
+        List<JyProjectReportsSubmit> jyProjectReportsSubmits=jyProjectReportsSubmitMapper.findReportsSubmitListExccedTime(newDate);
+        return jyProjectReportsSubmits;
+    }
+
+
+    public void updateExceedTimeStatus(String id, String status, String exceedTimeStatus) {
+        jyProjectReportsSubmitMapper.updateExceedTimeStatus(id,status,exceedTimeStatus);
+    }
+
+    public List<JyProjectReportsSubmit> findReportsSubmitListInTime() {
+        //创建时间格式化对象
+        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,-2);
+        //获取推送后的日期
+        Date newDate = instance.getTime();
+        List<JyProjectReportsSubmit> jyProjectReportsSubmits=jyProjectReportsSubmitMapper.findReportsSubmitListInTime(newDate);
+        jyProjectReportsSubmits.stream().forEach(item->{
+                String[] split = item.getProjectId().split(",");
+                String pName="";
+                for (String s : split) {
+                    if (StringUtils.isNotBlank(s)){
+                        JyProject byId = jyProjectMapper.getById(s);
+                        pName+=byId.getName();
+                    }
+                }
+                item.setProjectName(pName);
+        });
+        return jyProjectReportsSubmits;
+
+
+    }
+
+    /**
+     * 根据id查询归档信息
+     * @param id
+     * @return
+     */
+    public JyProjectArchiveDTO findByIdArchive(String id) {
+        //根据id获取外审信息
+        JyProjectArchiveDTO jyProjectArchiveDTO=jyProjectArchiveMapper.findById(id);
+
+        if (null != jyProjectArchiveDTO){
+            List<WorkAttachmentInfoDTO> fileList =Lists.newArrayList();
+            // 查询附件信息
+            List<WorkAttachmentInfoDTO> files = jyProjectArchiveMapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(files)) {
+                for (WorkAttachmentInfoDTO i : files) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+            }
+            fileList.addAll(files);
+            jyProjectArchiveDTO.setFileList(fileList);
+            //获取项目信息
+            JyProjectDTO byId = findById(jyProjectArchiveDTO.getProjectId());
+            jyProjectArchiveDTO.setJyProjectList(byId);
+        }
+        return jyProjectArchiveDTO;
+    }
+
+    /**
+     * 新增/修改归档
+     * @param jyProjectArchiveDTO
+     * @return
+     */
+    public String saveFormArchive(JyProjectArchiveDTO jyProjectArchiveDTO) {
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        //代码转化,将dto中的对象赋到实体类中
+        JyProjectArchive jyProjectArchive = JyProjectArchiveWrapper.INSTANCE.toEntity(jyProjectArchiveDTO);
+        //获取审核信息
+        JyProjectOutinstanceDTO byId = jyProjectOutinstanceMapper.findById(jyProjectArchive.getId());
+        if (ObjectUtil.isNotEmpty(byId)){
+            if (StringUtils.isNotBlank(jyProjectArchive.getRemarks())){
+                jyProjectArchive.setRemarks(jyProjectArchiveDTO.getRemarks());
+            }
+        }
+        if (StringUtils.isNotBlank(jyProjectArchive.getId())){
+            jyProjectArchiveMapper.updateById(jyProjectArchive);
+        }else{
+            jyProjectArchiveMapper.insert(jyProjectArchive);
+        }
+        JyProject jyProject = new JyProject();
+        jyProject.setId(jyProjectArchive.getProjectId());
+        jyProject.setOutInstance(jyProjectArchive.getStatus());
+        jyProjectMapper.updateById(jyProject);
+        //附件
+        if (ObjectUtil.isNotEmpty(jyProjectArchiveDTO)) {
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(jyProjectArchiveDTO.getId());
+            AtomicInteger sort = new AtomicInteger(1);
+            jyProjectArchiveDTO.getFileList().stream().forEach(item->{
+                //保存附件信息
+                WorkAttachmentInfo workAttachmentDto = new WorkAttachmentInfo();
+                workAttachmentDto.setName(item.getName());
+                workAttachmentDto.setSize(item.getSize());
+                workAttachmentDto.setUrl(item.getUrl());
+                Map<String,String> map = new HashMap<>();
+                String workAttachmentDtoInfo = JSON.toJSONString(workAttachmentDto);
+                String userDTOInfo = JSON.toJSONString(userDTO);
+                String attachmentId = jyProjectArchiveDTO.getId();
+                String attachmentFlag = "jyProjectArchive";
+                String sortInfo = Integer.toString(sort.get());
+                map.put("workAttachmentDtoInfo",workAttachmentDtoInfo);
+                map.put("userDTOInfo",userDTOInfo);
+                map.put("attachmentId",attachmentId);
+                map.put("attachmentFlag",attachmentFlag);
+                map.put("sortInfo",sortInfo);
+                String fileId = SpringUtil.getBean ( IWorkAttachmentApi.class ).saveFile(map);
+                sort.getAndIncrement();
+
+                //保存附件类型
+                JyProjectArchiveFile jyProjectArchiveFile = new JyProjectArchiveFile();
+                jyProjectArchiveFile.setFileType(item.getJyFileType());
+                jyProjectArchiveFile.setWorkAttachmentId(fileId);
+                jyProjectArchiveFileMapper.insert(jyProjectArchiveFile);
+            });
+        }
+        return jyProjectArchive.getId();
+    }
+
+    /**
+     * 根据id修改归档状态
+     * @param dto
+     * @return
+     */
+    public String updateStatusByArchiveId(JyProjectArchiveDTO dto) {
+        JyProjectArchive jyProjectArchive = new JyProjectArchive();
+        jyProjectArchive.setId(dto.getId());
+        jyProjectArchive.setStatus(dto.getStatus());
+        jyProjectArchiveMapper.update(jyProjectArchive,new QueryWrapper<JyProjectArchive>().lambda().eq(JyProjectArchive::getId,jyProjectArchive.getId()) );
         return "操作成功";
     }
 }

+ 46 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectArchiveDTO.java

@@ -0,0 +1,46 @@
+package com.jeeplus.business.project.service.dto;
+
+import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class JyProjectArchiveDTO extends BaseDTO {
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 登记状态
+     */
+    private String status;
+
+    /*
+    流程id
+     */
+    private String procInsId;
+    private String processDefinitionId;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 附件信息
+     */
+    private List<WorkAttachmentInfoDTO> fileList;
+
+    private JyProjectDTO jyProjectList;
+
+    private JyWorkContractInfoDto jyWorkContractInfoList;
+
+    private static final long serialVersionUID = 1L;
+
+
+}

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

@@ -260,4 +260,14 @@ public class JyProjectDTO extends BaseEntity implements Serializable {
      */
     private String auditOffice;
 
+    /**
+     * 报批签发
+     */
+    @TableField(exist = false)
+    private String reportsSubmitId;
+    @TableField(exist = false)
+    private String procInsIdReports;
+    @TableField(exist = false)
+    private String taskIdReports;
+
 }

+ 106 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectReportsSubmitDTO.java

@@ -0,0 +1,106 @@
+package com.jeeplus.business.project.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class JyProjectReportsSubmitDTO {
+
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    private String taskId;
+    /**
+     * 审核状态
+     */
+    private String status;
+
+    /**
+     * id
+     */
+    private String id;
+
+
+    /**
+     * 类型(大类)
+     */
+    private String firstType;
+
+    /**
+     * 类型(小类)
+     */
+    private String type;
+
+    /**
+     * 份数
+     */
+    private Integer number;
+
+    /**
+     * 关联项目
+     */
+    private String projectId;
+
+
+    /*
+    说明
+     */
+    private String remarks;
+
+    /**
+     * 申请人部门
+     */
+    @TableField(exist = false)
+    private String office;
+
+    /**
+     * 创建人
+     */
+    private String createById;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date createDate;
+    private String createByName;
+
+    /**
+     * 修改人
+     */
+    private String updateById;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date updateTime;
+
+
+    /**
+     *创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String[] createDates;
+
+    /**
+     * 附件
+     */
+    private List<WorkAttachmentInfo> files;
+
+    private List<JyProject> projectList;
+    /**
+     * 用印类型集合
+     */
+    private List<String> types;
+
+    /*
+        逾期状态
+     */
+    private String exceedTimeStatus;
+
+    /**
+     * 首次发起时间
+     */
+    private Date firstSubmitTime;
+
+}

+ 13 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/mapstruct/JyProjectArchiveWrapper.java

@@ -0,0 +1,13 @@
+package com.jeeplus.business.project.service.mapstruct;
+
+import com.jeeplus.business.project.domain.JyProjectArchive;
+import com.jeeplus.business.project.service.dto.JyProjectArchiveDTO;
+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 JyProjectArchiveWrapper extends EntityWrapper<JyProjectArchiveDTO, JyProjectArchive> {
+    JyProjectArchiveWrapper INSTANCE= Mappers.getMapper(JyProjectArchiveWrapper.class);
+}

+ 23 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/controller/SignetController.java

@@ -71,7 +71,7 @@ public class SignetController {
 
 
     /**
-     * 查询用印信息
+     * 查询用印逾期信息
      */
     @ApiOperation(value = "查询用印信息")
     @GetMapping("/findSeal")
@@ -80,6 +80,28 @@ public class SignetController {
         return JSON.toJSONString(signetList);
     }
 
+    /**
+     * 查询用印未逾期信息
+     */
+    @ApiOperation(value = "查询用印未逾期信息")
+    @GetMapping("/findSealInTime")
+    public String findSealInTime(){
+        List<Signet> signetList=signetService.findSealInTime();
+        return JSON.toJSONString(signetList);
+    }
+
+
+    /**
+     * 修改用印逾期状态
+     */
+    @ApiOperation(value = "修改用印逾期状态")
+    @GetMapping(value = "/updateSealStatus")
+    public void updateSealStatus(@RequestParam String id,@RequestParam String status,@RequestParam String exceedTimeStatus) {
+        signetService.updateOutInstanceStatus(id,status,exceedTimeStatus);
+
+    }
+
+
 
 
 

+ 11 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/domain/Signet.java

@@ -60,6 +60,17 @@ public class Signet extends BaseEntity {
     @TableField(exist = false)
     private String office;
 
+    /*
+       逾期状态
+    */
+    private String exceedTimeStatus;
+
+    /**
+     * 外审id
+     */
+    @TableField(exist = false)
+    private String outInstanceId;
+
 
 
 

+ 7 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/mapper/SignetMapper.java

@@ -11,6 +11,7 @@ import com.jeeplus.business.useSeal.service.dto.SignetDTO;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 public interface SignetMapper extends BaseMapper<Signet> {
@@ -28,5 +29,10 @@ public interface SignetMapper extends BaseMapper<Signet> {
     void updateStatusById(@Param("id")String id,@Param("status") String status);
 
     @InterceptorIgnore(tenantLine = "true")
-    List<Signet> findSeal();
+    List<Signet> findSeal(@Param("newDate") Date newDate);
+    @InterceptorIgnore(tenantLine = "true")
+    List<Signet> findSealInTime(@Param("newDate") Date newDate);
+
+    @InterceptorIgnore(tenantLine = "true")
+    void updateStatusBySealId(String id);
 }

+ 35 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/mapper/xml/SignetMapper.xml

@@ -97,6 +97,41 @@
             left join sys_user su on a.create_by_id = su.id
             left join sys_office so on su.office_id=so.id
             left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+            where a.update_time &lt; #{newDate} and a.status = '5'
     </select>
 
+    <select id="findSealInTime" resultType="com.jeeplus.business.useSeal.domain.Signet">
+        select
+            a.id,
+            a.create_by_id,
+            su.name as createByName,
+            a.create_time as createDate,
+            a.update_time,
+            a.project_id,
+            a.project_name,
+            a.no,
+            a.type,
+            a.first_type,
+            a.number,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            so.name as office,
+            so.id,
+            art.ID_ as task_id
+            from  jy_user_signet a
+            left join sys_user su on a.create_by_id = su.id
+            left join sys_office so on su.office_id=so.id
+            left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+            where a.update_time &gt;= #{newDate} and a.status = '5'
+    </select>
+
+    <update id="updateStatusBySealId">
+        update
+            jy_user_signet
+        set status='6' , exceed_time_status ='1' where id=#{id}
+    </update>
+
+
 </mapper>

+ 94 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/service/SignetService.java

@@ -8,7 +8,11 @@ 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.business.project.domain.JyProject;
+import com.jeeplus.business.project.domain.JyProjectOutinstance;
+import com.jeeplus.business.project.domain.JyProjectReportsSubmit;
 import com.jeeplus.business.project.mapper.JyProjectMapper;
+import com.jeeplus.business.project.mapper.JyProjectOutinstanceMapper;
+import com.jeeplus.business.project.mapper.JyProjectReportsSubmitMapper;
 import com.jeeplus.business.project.service.JyProjectService;
 import com.jeeplus.business.project.service.dto.JyProjectDTO;
 import com.jeeplus.business.workContractInfo.mapper.JyWorkContractInfoMapper;
@@ -31,6 +35,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 @Service
@@ -49,6 +54,12 @@ public class SignetService {
     @Autowired
     private JyWorkContractInfoMapper jyWorkContractInfoMapper;
 
+    @Autowired
+    private JyProjectReportsSubmitMapper jyProjectReportsSubmitMapper;
+
+    @Autowired
+    private JyProjectOutinstanceMapper jyProjectOutinstanceMapper;
+
 
 
     /**
@@ -86,6 +97,9 @@ public class SignetService {
             queryWrapper.eq("so.id",dto.getOffice());
         }
         IPage<SignetDTO> signetList=signetMapper.findPageList(signetDTOPage,queryWrapper);
+        //报批签发信息
+        List<JyProjectReportsSubmit> jyProjectReportsSubmits = jyProjectReportsSubmitMapper.selectList(new QueryWrapper<JyProjectReportsSubmit>());
+
         signetList.getRecords().stream().forEach(item->{
             if (StringUtils.isNotBlank(item.getProjectName())){
                 String project=item.getProjectName().substring(0,item.getProjectName().lastIndexOf(","));
@@ -104,6 +118,18 @@ public class SignetService {
                 for (String s : split) {
                     JyProject byId = jyProjectMapper.getById(s);
                     byId.setSealId(item.getId());
+                    //报批签发关联的项目
+                    for (JyProjectReportsSubmit jyProjectReportsSubmit : jyProjectReportsSubmits) {
+                        if (StringUtils.isNotBlank(jyProjectReportsSubmit.getProjectId())){
+                            String[] split1 = jyProjectReportsSubmit.getProjectId().split(",");
+                            //将用印关联的项目和报批签发关联的项目进行比较
+                            for (String s1 : split1) {
+                                if (s1.equals(s)){
+                                    byId.setReportsSubmitId(jyProjectReportsSubmit.getId());
+                                }
+                            }
+                        }
+                    }
                     jyProjects.add(byId);
                 }
                 item.setProjectList(jyProjects);
@@ -403,7 +429,74 @@ public class SignetService {
      * @return
      */
     public List<Signet> findSeal() {
-        List<Signet> seal = signetMapper.findSeal();
+        //获取一个月前的时间
+        //创建时间格式化对象
+        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.DATE,-14);
+        //获取推送后的日期
+        Date newDate = instance.getTime();
+        List<Signet> seal = signetMapper.findSeal(newDate);
+
+        seal.stream().forEach(item->{
+                String outId="";
+                String[] split = item.getProjectId().split(",");
+                for (String s : split) {
+                    if (StringUtils.isNotBlank(s)){
+                        JyProjectOutinstance jyProjectOutinstance=jyProjectOutinstanceMapper.findByProjectId(s);
+                        if (ObjectUtil.isNotEmpty(jyProjectOutinstance)){
+                            outId+=jyProjectOutinstance.getId()+",";
+                        }
+
+                    }
+
+                }
+                item.setOutInstanceId(outId);
+        });
+        return seal;
+    }
+
+    /**
+     * 查询用印信息
+     * @return
+     */
+    public List<Signet> findSealInTime() {
+        //获取一个月前的时间
+        //创建时间格式化对象
+        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.DATE,-14);
+        //获取推送后的日期
+        Date newDate = instance.getTime();
+        List<Signet> seal = signetMapper.findSealInTime(newDate);
         return seal;
     }
+
+    /**
+     * 修改外审逾期状态
+     * @param id
+     */
+    public void updateOutInstanceStatus(String id,String status,String exceedTimeStatus) {
+        jyProjectOutinstanceMapper.updateOutInstanceStatus(id,status,exceedTimeStatus);
+
+
+
+
+    }
 }

+ 5 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/service/dto/SignetDTO.java

@@ -104,4 +104,9 @@ public class SignetDTO  {
      */
     private List<String> types;
 
+    /*
+        逾期状态
+     */
+    private String exceedTimeStatus;
+
 }

+ 4 - 2
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/controller/JyWorkClientController.java

@@ -82,8 +82,10 @@ public class JyWorkClientController {
                 if(!jyWorkClientService.haveWorkClient(workClientInfosDto)){
                     return ResponseEntity.badRequest().body("用户已存在,保存失败");
                 }
-                if(!jyWorkClientService.haveUscCode(workClientInfosDto)){
-                    return ResponseEntity.badRequest().body("统一社会信用代码已存在,保存失败");
+                if (workClientInfosDto.getWorkClientInfo().getHasUscc().equals("1")){
+                    if(!jyWorkClientService.haveUscCode(workClientInfosDto)){
+                        return ResponseEntity.badRequest().body("统一社会信用代码已存在,保存失败");
+                    }
                 }
                 if(StringUtils.isNotBlank(workClientInfosDto.getWorkClientInfo().getId())){
                     return ResponseEntity.ok(jyWorkClientService.update(workClientInfosDto));

+ 6 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/domain/JyWorkClientLinkman.java

@@ -1,5 +1,6 @@
 package com.jeeplus.business.workClientInfo.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jeeplus.core.domain.BaseEntity;
 import lombok.Data;
@@ -53,4 +54,9 @@ public class JyWorkClientLinkman extends BaseEntity {
      */
     private String clientId;
 
+    @TableField(exist = false)
+    private String linkId;
+    @TableField(exist = false)
+    private String clientName;
+
 }

+ 2 - 8
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/mapper/xml/JyWorkClientInfoMapper.xml

@@ -116,21 +116,15 @@
 					c.job_type_id = d.VALUE
 					AND e.id = d.dict_type_id
 					AND e.type = 'representative'
-					AND c.work_client_id = a.id) AS deputy,
-			cl.id as linkId,
-			cl.name as clientName,
-			cl.link_phone as phone,
-			cl.link_mobile as mobile,
-			cl.position as position
+					AND c.work_client_id = a.id) AS deputy
 		FROM
 			jy_work_client_info a
 		LEFT JOIN sys_area b ON a.area_id = b.`code`
 		LEFT JOIN sys_user su ON su.id = a.create_by_id
 		LEFT JOIN work_client_job_type_info f ON a.id = f.work_client_id
-		left join jy_work_client_linkman cl on a.id=cl.client_id
 		${ew.customSqlSegment}
 		ORDER BY
-			a.update_time DESC,cl.update_time DESC
+			a.update_time DESC
 	</select>
 
 	<select id="isExist" resultType="java.lang.Integer">

+ 2 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/mapper/xml/JyWorkClientLinkmanMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.jeeplus.business.workClientInfo.mapper.JyWorkClientLinkmanMapper">
     <select id="selectByClientId" resultType="com.jeeplus.business.workClientInfo.domain.JyWorkClientLinkman">
         select
+            id,
             name,
             office,
             position,
@@ -12,7 +13,7 @@
             email
         from
             jy_work_client_linkman
-        where client_id=#{client}
+        where client_id=#{client} and del_flag=0 LIMIT 1
     </select>
 
 

+ 17 - 2
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workClientInfo/service/JyWorkClientService.java

@@ -79,7 +79,22 @@ public class JyWorkClientService {
                 wrapper.eq(JyWorkClientBank::getClientId, info.getId());
                 List<JyWorkClientBank> banks = jyWorkClientBankMapper.selectList(wrapper);
                 info.setBacks(banks);
+                if (StringUtils.isBlank(info.getMobile())){
+                    info.setMobile("");
+                }
+                //获取客户联系人
+                JyWorkClientLinkman jyWorkClientLinkman = jyWorkClientLinkmanMapper.selectByClientId(info.getId());
+                if (ObjectUtil.isNotEmpty(jyWorkClientLinkman)){
+                    info.setLinkId(jyWorkClientLinkman.getId());
+                    info.setClientName(jyWorkClientLinkman.getName());
+                    info.setMobile(jyWorkClientLinkman.getLinkMobile());
+                    info.setPhone(jyWorkClientLinkman.getLinkPhone());
+                    info.setPosition(jyWorkClientLinkman.getPosition());
+                }
+
             }
+
+
         }
         return pageList;
     }
@@ -299,7 +314,7 @@ public class JyWorkClientService {
                 i.setUpdateById(dto.getId());
                 i.setUpdateTime(new Date());
                 i.setClientId(workClientInfo.getId());
-                jyWorkClientBankMapper.updateById(i);
+                jyWorkClientBankMapper.insert(i);
             });
         }
         //联系人信息处理
@@ -315,7 +330,7 @@ public class JyWorkClientService {
                 i.setUpdateById(dto.getId());
                 i.setUpdateTime(new Date());
                 i.setClientId(workClientInfo.getId());
-                jyWorkClientLinkmanMapper.updateById(i);
+                jyWorkClientLinkmanMapper.insert(i);
             });
         }
         //附件信息处理

+ 7 - 7
jeeplus-modules/jeeplus-business/src/main/resources/freemarker/firstAudit.ftl

@@ -995,7 +995,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>审核人</w:t>
+								<w:t>审核人:</w:t>
 							</w:r>
 							<w:proofErr w:type="gramStart"/>
 							<w:r wsp:rsidRPr="00D86B2B">
@@ -1017,7 +1017,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t> </w:t>
+								<w:t></w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1039,7 +1039,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>日期</w:t>
+								<w:t>日期:</w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1468,7 +1468,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>审核人</w:t>
+								<w:t>审核人:</w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1488,7 +1488,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t> </w:t>
+								<w:t></w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1498,7 +1498,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>   </w:t>
+								<w:t> </w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1510,7 +1510,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>日期</w:t>
+								<w:t>日期:</w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>

+ 7 - 7
jeeplus-modules/jeeplus-business/src/main/resources/freemarker/secondAudit.ftl

@@ -995,7 +995,7 @@
                   <w:sz w:val="23"/>
                   <w:sz-cs w:val="23"/>
                 </w:rPr>
-                <w:t>审核人</w:t>
+                <w:t>审核人:</w:t>
               </w:r>
               <w:proofErr w:type="gramStart"/>
               <w:r wsp:rsidRPr="00D86B2B">
@@ -1017,7 +1017,7 @@
                   <w:sz w:val="23"/>
                   <w:sz-cs w:val="23"/>
                 </w:rPr>
-                <w:t> </w:t>
+                <w:t></w:t>
               </w:r>
               <w:r wsp:rsidRPr="00D86B2B">
                 <w:rPr>
@@ -1039,7 +1039,7 @@
                   <w:sz w:val="23"/>
                   <w:sz-cs w:val="23"/>
                 </w:rPr>
-                <w:t>日期</w:t>
+                <w:t>日期:</w:t>
               </w:r>
               <w:r wsp:rsidRPr="00D86B2B">
                 <w:rPr>
@@ -1468,7 +1468,7 @@
                   <w:sz w:val="23"/>
                   <w:sz-cs w:val="23"/>
                 </w:rPr>
-                <w:t>审核人</w:t>
+                <w:t>审核人:</w:t>
               </w:r>
               <w:r wsp:rsidRPr="00D86B2B">
                 <w:rPr>
@@ -1488,7 +1488,7 @@
                   <w:sz w:val="23"/>
                   <w:sz-cs w:val="23"/>
                 </w:rPr>
-                <w:t> </w:t>
+                <w:t></w:t>
               </w:r>
               <w:r wsp:rsidRPr="00D86B2B">
                 <w:rPr>
@@ -1498,7 +1498,7 @@
                   <w:sz w:val="23"/>
                   <w:sz-cs w:val="23"/>
                 </w:rPr>
-                <w:t>   </w:t>
+                <w:t> </w:t>
               </w:r>
               <w:r wsp:rsidRPr="00D86B2B">
                 <w:rPr>
@@ -1510,7 +1510,7 @@
                   <w:sz w:val="23"/>
                   <w:sz-cs w:val="23"/>
                 </w:rPr>
-                <w:t>日期</w:t>
+                <w:t>日期:</w:t>
               </w:r>
               <w:r wsp:rsidRPr="00D86B2B">
                 <w:rPr>

+ 7 - 7
jeeplus-modules/jeeplus-business/src/main/resources/freemarker/thirdAudit.ftl

@@ -995,7 +995,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>审核人</w:t>
+								<w:t>审核人:</w:t>
 							</w:r>
 							<w:proofErr w:type="gramStart"/>
 							<w:r wsp:rsidRPr="00D86B2B">
@@ -1017,7 +1017,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t> </w:t>
+								<w:t></w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1039,7 +1039,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>日期</w:t>
+								<w:t>日期:</w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1468,7 +1468,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>审核人</w:t>
+								<w:t>审核人:</w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1488,7 +1488,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t> </w:t>
+								<w:t></w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1498,7 +1498,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>   </w:t>
+								<w:t> </w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>
@@ -1510,7 +1510,7 @@
 									<w:sz w:val="23"/>
 									<w:sz-cs w:val="23"/>
 								</w:rPr>
-								<w:t>日期</w:t>
+								<w:t>日期:</w:t>
 							</w:r>
 							<w:r wsp:rsidRPr="00D86B2B">
 								<w:rPr>

+ 94 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/modules/flowable/listener/JyProjectArchiveListener.java

@@ -0,0 +1,94 @@
+package com.jeeplus.modules.flowable.listener;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.jeeplus.extension.domain.FlowCopy;
+import com.jeeplus.extension.service.FlowCopyService;
+import com.jeeplus.flowable.model.ActRuTaskInfo;
+import com.jeeplus.flowable.model.Flow;
+import com.jeeplus.flowable.service.FlowTaskService;
+import com.jeeplus.flowable.service.MyNoticeService;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.SneakyThrows;
+import org.flowable.engine.RuntimeService;
+import org.flowable.engine.delegate.DelegateExecution;
+import org.flowable.engine.delegate.ExecutionListener;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.springframework.stereotype.Component;
+
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+@Component("JyProjectArchiveListener")
+public class JyProjectArchiveListener implements ExecutionListener {
+
+    @SneakyThrows
+    public void notify(DelegateExecution delegateExecution) {
+        String eventName = delegateExecution.getEventName ( );
+        System.out.println("--------- delegateExecution -----------" + delegateExecution);
+
+        if ( "start".equals ( eventName ) ) {
+            System.out.println ( "start=========" );
+        } else if ( "end".equals ( eventName ) ) {
+            //根据这里的 delegateExecution的id去act_ru_task表中查该流程的数据 对应表中的EXECUTION_ID_
+            ActRuTaskInfo task = SpringUtil.getBean(MyNoticeService.class).getTaskInfoByID(delegateExecution.getId());
+
+            if (null != task) {
+                List<Flow> flows = SpringUtil.getBean(FlowTaskService.class).historicTaskList(task.getProcInstId());
+                //根据PROC_DEF_ID_去act_re_deployment中查询流程的名称
+                String substring = task.getProcDefId().substring(0, task.getProcDefId().indexOf(":"));
+                String actName = SpringUtil.getBean(FlowTaskService.class).getActNameByDefId(substring);
+
+                String titleName = "";
+                // 根据流程定义ID查询流程实例
+                ProcessInstance processInstance = SpringUtil.getBean(RuntimeService.class).createProcessInstanceQuery()
+                        .processInstanceId(task.getProcInstId())
+                        .singleResult();
+
+                if (processInstance != null) {
+                    // 获取流程实例标题变量名(假设标题存储在名为"title"的变量中)
+                    String titleVariableName = "title";
+
+                    // 查询流程实例的标题变量
+                    Object title = SpringUtil.getBean(RuntimeService.class).getVariable(processInstance.getId(), titleVariableName);
+
+                    if (title != null) {
+                        titleName = title.toString();
+                    } else {
+                        // 如果标题变量不存在或者没有值,可以返回默认标题
+                        titleName = "";
+                    }
+                }
+                Flow flow = new Flow();
+                for (int i=0;i<flows.size();i++){
+                    if (flows.get(i).getComment().getMessage().equals("发起流程")){
+                        flow = flows.get(i);
+                    }
+                }
+
+                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+                UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(flow.getAssigneeId());
+                //获取到总经办下的人员信息
+                List<UserDTO> listByOfficeId = SpringUtil.getBean(IUserApi.class).findListByOfficeId("1711993014494048258");
+                //获取角色为“总经办”的角色对应人员信息
+                for (UserDTO dto : listByOfficeId) {
+                    FlowCopy flowCopy = new FlowCopy();
+                    flowCopy.setProcDefId(task.getProcDefId());
+                    flowCopy.setProcInsName(titleName);
+                    flowCopy.setProcInsId(task.getProcInstId());
+                    flowCopy.setUserId(dto.getId());
+                    //将项目信息进行抄送
+                    SpringUtil.getBean(FlowCopyService.class).save(flowCopy);
+                }
+
+
+            }
+
+            System.out.println ( "end=========" );
+        } else if ( "take".equals ( eventName ) ) {//连线监听
+            System.out.println ( "take=========" );
+        }
+    }
+}

+ 1 - 1
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/modules/flowable/listener/JyProjectExecutionListener.java

@@ -77,7 +77,7 @@ public class JyProjectExecutionListener implements ExecutionListener {
                     for (UserDTO dto : listByOfficeId) {
                         FlowCopy flowCopy = new FlowCopy();
                         flowCopy.setProcDefId(task.getProcDefId());
-                        flowCopy.setProcDefId(task.getProcDefId());
+//                        flowCopy.setProcDefId(task.getProcDefId());
                         flowCopy.setProcInsName(titleName);
                         flowCopy.setProcInsId(task.getProcInstId());
                         flowCopy.setUserId(dto.getId());

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

@@ -0,0 +1,73 @@
+package com.jeeplus.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class JyProjectReportsSubmitInfo extends BaseEntity {
+
+    private String procInsId;
+
+    private String processDefinitionId;
+    /**
+     * 审核状态
+     */
+    private String status;
+
+
+    /**
+     * 类型(大类)
+     */
+    private String firstType;
+
+    /**
+     * 类型(小类)
+     */
+    private String type;
+
+    /**
+     * 份数
+     */
+    private Integer number;
+
+    /**
+     * 关联项目
+     */
+    private String projectId;
+
+
+    /*
+    说明
+     */
+    private String remarks;
+
+    /**
+     * 申请人部门
+     */
+    @TableField(exist = false)
+    private String office;
+
+    /*
+       逾期状态
+    */
+    private String exceedTimeStatus;
+
+    /**
+     * 首次发起时间
+     */
+    private Date firstSubmitTime;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+
+
+
+
+}

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

@@ -50,7 +50,15 @@ public class JyUserSeal extends BaseEntity {
     说明
      */
     private String remarks;
+    /*
+           逾期状态
+        */
+    private String exceedTimeStatus;
 
+    /**
+     * 外审id
+     */
+    private String outInstanceId;
 
 
 }

+ 9 - 0
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/feign/ReportsSubmitFeignApi.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 = "ReportsSubmitFeignApi", name = AppNameConstants.APP_JYPROJECT_MODULES)
+public interface ReportsSubmitFeignApi extends IJyProjectApi {
+}

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

@@ -4,12 +4,10 @@ import cn.hutool.core.collection.CollectionUtil;
 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.JyUserSeal;
-import com.jeeplus.domain.MyNoticeList;
-import com.jeeplus.domain.ProgramProjectListInfo;
+import com.jeeplus.domain.*;
 import com.jeeplus.flowable.feign.IAssessApi;
 import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.flowable.feign.IJyProjectApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.xxl.job.core.context.XxlJobHelper;
@@ -17,6 +15,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.executor.feign.AssessFeignApi;
 import com.xxl.job.executor.feign.JyProjectAuditFeignApi;
 import com.xxl.job.executor.feign.JyProjectUserSealFeignApi;
+import com.xxl.job.executor.feign.ReportsSubmitFeignApi;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -172,97 +171,105 @@ 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>>() {});
         if (null != projectList){
             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()+"】即将逾期,";
+                String status="";
+                //判定是否已发起
+                if (StringUtils.isNotBlank(jyProjectAudit.getStatus())|| jyProjectAudit.getStatus().equals("0")){
+                    status="6";
+                }else {
+                    status=jyProjectAudit.getStatus();
                 }
+                //对逾期状态及审核状态进行修改
+                SpringUtil.getBean(JyProjectAuditFeignApi.class).updateStatus(jyProjectAudit.getId(),status,"1");
+            }
+        }
+        String json1 = SpringUtil.getBean(JyProjectAuditFeignApi.class).selectAuditInTime();
+        List<JyAudit> jyAudits = JSON.parseObject(json1, new TypeReference<List<JyAudit>>() {});
+        for (JyAudit jyAudit : jyAudits) {
+            //对数据进行发送通知
+            String taskName = null;
+            String titleStr = null;
+            //获取当前时间
+            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(jyAudit.getProjectAgreeTime());
+            //往后推一个月
+            instance.add(Calendar.MONTH,1);
+            //获取推送后的日期
+            Date newDate = instance.getTime();
+            //计算天数之差
+            int interval1 = Integer.parseInt(this.getInterval(currentDate, newDate));
+            //如果当前时间小于项目通过一个月后的时间且距离到期时间在五天之内,则发送通知
+            if(newDate.after(new Date()) && interval1 <= 5 && interval1 >=0){
+                taskName = "嘉溢-项目一级校审";
+                titleStr = "项目【"+ jyAudit.getProjectName()+"】即将逾期,";
+                titleStr = titleStr + "剩余:" + interval1 + "天。请尽快发起!";
+            }
+            Set<String> noticeUserSet = new HashSet<String>();
+            if(StringUtils.isNotBlank(jyAudit.getCreateById())){
 
-                //获取当前时间
-                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 + "天。请尽快发起!";
+                String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(jyAudit.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(jyAudit.getProjectProId());
+                myNotice.setTaskId(currentTask);
+                myNotice.setDefId(jyAudit.getProjectDeId());
+                myNotice.setTitle(titleStr);
+                myNotice.setTaskName(taskName);
+                myNotice.setLink("结束");
+                myNotice.setType("0");
+                myNotice.setCreateUser("管理员");
+                myNotice.setCreateTime(new Date());
 
-                Set<String> noticeUserSet = new HashSet<String>();
-                if(StringUtils.isNotBlank(jyProjectAudit.getCreateById())){
-
-                    String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(jyProjectAudit.getCreateById());
+                for (String noticeUserId : noticeUserList) {
+                    myNotice.setNoticeId(noticeUserId);
+                    String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(jyAudit.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.getProjectProId());
-                    myNotice.setTaskId(currentTask);
-                    myNotice.setDefId(jyProjectAudit.getProjectDeId());
-                    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();
+                    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);
-                        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);
-                        }
+                        SpringUtil.getBean ( IFlowableApi.class ).updateMyNotice(map);
                     }
                 }
             }
@@ -284,91 +291,210 @@ public class SampleXxlJob {
         List<JyUserSeal> projectList = JSON.parseObject(json, new TypeReference<List<JyUserSeal>>() {});
         if (CollectionUtil.isNotEmpty(projectList)){
             for (JyUserSeal jyUserSeal : projectList) {
-                //对数据进行发送通知
-                String taskName = null;
-                String titleStr = null;
-                //如果当前时间小于用印修改时间
-                if(jyUserSeal.getUpdateTime().after(new Date())){
-                    taskName = "嘉溢-项目用印申请";
-                    titleStr = "项目【"+ jyUserSeal.getProjectName().substring(0,jyUserSeal.getProjectName().lastIndexOf(","))+"】即将逾期,";
+                String status="";
+                //判定是否已发起
+                if (StringUtils.isNotBlank(jyUserSeal.getStatus())|| jyUserSeal.getStatus().equals("0")){
+                    status="6";
+                }else {
+                    status=jyUserSeal.getStatus();
                 }
-
-                //获取当前时间
-                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(jyUserSeal.getUpdateTime());
-                //往后推两周
-                instance.add(Calendar.DATE,14);
-                //获取推送后的日期
-                Date newDate = instance.getTime();
-                int interval1 = Integer.parseInt(this.getInterval(currentDate, newDate));
-                //计算天数之差
-                if(interval1 <= 3 && interval1 >=0){
-                    titleStr = titleStr + "剩余:" + interval1 + "天。请尽快发起!";
+                String[] split = jyUserSeal.getOutInstanceId().split(",");
+                for (String s : split) {
+                    //对逾期状态及审核状态进行修改
+                    SpringUtil.getBean(JyProjectUserSealFeignApi.class).updateSealStatus(s,status,"1");
                 }
 
-                Set<String> noticeUserSet = new HashSet<String>();
-                if(StringUtils.isNotBlank(jyUserSeal.getCreateById())){
 
-                    String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(jyUserSeal.getCreateById());
+            }
+        }
+        String json1 = SpringUtil.getBean(JyProjectUserSealFeignApi.class).findSealInTime();
+        List<JyUserSeal> jyUserSeals = JSON.parseObject(json1, new TypeReference<List<JyUserSeal>>() {});
+        for (JyUserSeal outInstance : jyUserSeals) {
+            //对数据进行发送通知
+            String taskName = null;
+            String titleStr = null;
+            //获取当前时间
+            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(outInstance.getUpdateTime());
+            //往后推两周
+            instance.add(Calendar.DATE,14);
+            //获取推送后的日期
+            Date newDate = instance.getTime();
+            //计算天数之差
+            int interval1 = Integer.parseInt(this.getInterval(currentDate, newDate));
+            //如果当前时间小于用印修改两个月后的时间且在期限时间三天之内
+            if(newDate.after(new Date()) && interval1 <= 3 && interval1 >=0){
+                taskName = "嘉溢-项目用印申请";
+                titleStr = "项目【"+ outInstance.getProjectName().substring(0,outInstance.getProjectName().lastIndexOf(","))+"】即将逾期,";
+                titleStr = titleStr + "剩余:" + interval1 + "天。请尽快发起!";
+            }
+
+            Set<String> noticeUserSet = new HashSet<String>();
+            if(StringUtils.isNotBlank(outInstance.getCreateById())){
+
+                String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(outInstance.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(outInstance.getProcInsId());
+                myNotice.setTaskId(currentTask);
+                myNotice.setDefId(outInstance.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(outInstance.getCreateById());
                     UserDTO createUser = JSON.parseObject(byIdForXXL, new TypeReference<UserDTO>() {});
-                    if(null != createUser && StringUtils.isNotBlank(createUser.getId())){
-                        noticeUserSet.add(createUser.getId());
+                    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);
                     }
                 }
-                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(jyUserSeal.getProcInsId());
-                    myNotice.setTaskId(currentTask);
-                    myNotice.setDefId(jyUserSeal.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(jyUserSeal.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();
+            }
+        }
+
+    }
+
+
+    /**
+     * 嘉溢项目-报批签发 发送通知
+     * @param
+     * @return
+     */
+    @XxlJob("reportsSubmitTask")
+    public void reportsSubmitTask(){
+        System.out.println("进来了---");
+        //获取报批签发逾期的数据
+        String json = SpringUtil.getBean ( ReportsSubmitFeignApi.class ).findReportsSubmitListExccedTime();
+        List<JyProjectReportsSubmitInfo> jyProjectReportsSubmitInfos=JSON.parseObject(json,new TypeReference<List<JyProjectReportsSubmitInfo>>(){});
+        for (JyProjectReportsSubmitInfo jyProjectReportsSubmitInfo : jyProjectReportsSubmitInfos) {
+            //修改报批签发状态
+            SpringUtil.getBean( IJyProjectApi.class).updateExceedTimeStatus(jyProjectReportsSubmitInfo.getId(),jyProjectReportsSubmitInfo.getStatus(),"1");
+        }
+        //获取报批签发未逾期的数据
+        String json1 = SpringUtil.getBean ( ReportsSubmitFeignApi.class ).findReportsSubmitListInTime();
+        List<JyProjectReportsSubmitInfo> jyProjectReportsSubmitInfoList=JSON.parseObject(json1,new TypeReference<List<JyProjectReportsSubmitInfo>>(){});
+        for (JyProjectReportsSubmitInfo jyProjectReportsSubmitInfo : jyProjectReportsSubmitInfoList) {
+            //对数据进行发送通知
+            String taskName = null;
+            String titleStr = null;
+            //创建calendar对象
+            Calendar instance = Calendar.getInstance();
+            //将日期设置为用印修改时间
+            instance.setTime(jyProjectReportsSubmitInfo.getFirstSubmitTime());
+            //往后推两周
+            instance.add(Calendar.MONTH,2);
+            //获取推送后的日期
+            Date newDate = instance.getTime();
+            //计算天数之差
+            int interval1 = Integer.parseInt(this.getInterval(new Date(), newDate));
+            //如果当前时间小于首次发起报批签发两个月后的时间且在期限时间七天之内
+            if(newDate.after(new Date()) && interval1 <= 7 && interval1 >=0){
+                taskName = "嘉溢-报批签发";
+                titleStr = "项目【"+ jyProjectReportsSubmitInfo.getProjectName().substring(0,jyProjectReportsSubmitInfo.getProjectName().lastIndexOf(","))+"】还未完成,";
+                titleStr = titleStr + "剩余:" + interval1 + "天。请尽快发起!";
+            }
+
+            Set<String> noticeUserSet = new HashSet<String>();
+            //发送通知
+            if(StringUtils.isNotBlank(jyProjectReportsSubmitInfo.getCreateById())){
+
+                String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(jyProjectReportsSubmitInfo.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(jyProjectReportsSubmitInfo.getProcInsId());
+                myNotice.setTaskId(currentTask);
+                myNotice.setDefId(jyProjectReportsSubmitInfo.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(jyProjectReportsSubmitInfo.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);
-                        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);
-                        }
+                        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);
                     }
                 }
             }
@@ -376,9 +502,12 @@ public class SampleXxlJob {
 
 
 
+
     }
 
 
+
+
     public static String dateToString(Date date) {
         SimpleDateFormat sformat = new SimpleDateFormat("yyyy-MM-dd");//日期格式
         return sformat.format(date);