Browse Source

月报申请

sangwenwei 1 year ago
parent
commit
a0745eda66
35 changed files with 1352 additions and 17 deletions
  1. 7 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/FlowableApiFallbackFactory.java
  2. 23 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/MonthlyFallbackFactory.java
  3. 10 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IFlowableApi.java
  4. 22 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/MonthlyApi.java
  5. 2 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/factory/PostApiFallbackFactory.java
  6. 5 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/factory/UserApiFallbackFactory.java
  7. 7 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/feign/IUserApi.java
  8. 53 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/service/dto/FlowCopy.java
  9. 107 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/controller/MonthlyController.java
  10. 52 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/domain/JyProcess.java
  11. 41 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/domain/Monthly.java
  12. 15 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/mapper/JyProcessMapper.java
  13. 24 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/mapper/MonthlyMapper.java
  14. 21 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/mapper/xml/JyProcessMapper.xml
  15. 66 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/mapper/xml/MonthlyMapper.xml
  16. 403 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/service/MonthlyService.java
  17. 85 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/service/dto/MonthlyDTO.java
  18. 3 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectMapper.java
  19. 57 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml
  20. 38 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java
  21. 45 3
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectDTO.java
  22. 8 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/controller/FlowCopyController.java
  23. 3 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/mapper/FlowCopyMapper.java
  24. 5 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/mapper/xml/FlowCopyMapper.xml
  25. 3 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/service/FlowCopyService.java
  26. 12 14
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/modules/flowable/listener/JyProjectExecutionListener.java
  27. 11 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java
  28. 2 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/feign/PostApiImpl.java
  29. 5 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/feign/UserApiImpl.java
  30. 2 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/UserMapper.java
  31. 16 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml
  32. 8 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/UserService.java
  33. 77 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/MonthlyDTO.java
  34. 10 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/feign/MonthlyFeignApi.java
  35. 104 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

+ 7 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/FlowableApiFallbackFactory.java

@@ -2,6 +2,7 @@ package com.jeeplus.flowable.factory;
 
 import com.jeeplus.flowable.feign.IFlowableApi;
 import com.jeeplus.mail.feign.IMailApi;
+import com.jeeplus.sys.service.dto.FlowCopy;
 import com.jeeplus.sys.service.dto.UserDTO;
 import lombok.extern.slf4j.Slf4j;
 import org.flowable.bpmn.model.FlowNode;
@@ -91,6 +92,12 @@ public class FlowableApiFallbackFactory implements FallbackFactory <IFlowableApi
             public boolean checkIsLastTask(String procInsId) {
                 return false;
             }
+
+            @Override
+            public void add(FlowCopy flowCopy) {
+
+            }
+
         };
     }
 }

+ 23 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/MonthlyFallbackFactory.java

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

+ 10 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IFlowableApi.java

@@ -2,11 +2,14 @@ package com.jeeplus.flowable.feign;
 
 import com.jeeplus.common.constant.AppNameConstants;
 import com.jeeplus.flowable.factory.FlowableApiFallbackFactory;
+import com.jeeplus.sys.service.dto.FlowCopy;
+import jdk.nashorn.internal.ir.RuntimeNode;
 import org.flowable.bpmn.model.FlowNode;
 //import org.flowable.task.api.Task;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.SpringQueryMap;
 import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 //import org.flowable.task.api.Task;
 
@@ -105,4 +108,11 @@ public interface IFlowableApi {
      */
     @GetMapping(value = "/flowable/task/checkIsLastTask")
     boolean checkIsLastTask(@RequestParam(value = "procInsId")String procInsId);
+
+    /**
+     * 抄送
+     */
+    @RequestMapping(value ="/extension/flowCopy/add",method = RequestMethod.POST )
+    void add(@RequestBody FlowCopy flowCopy);
+
 }

+ 22 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/MonthlyApi.java

@@ -0,0 +1,22 @@
+package com.jeeplus.flowable.feign;
+
+import com.jeeplus.common.constant.AppNameConstants;
+import com.jeeplus.flowable.factory.JyProjectApiFallbackFactory;
+import com.jeeplus.flowable.factory.MonthlyFallbackFactory;
+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.RequestParam;
+
+import java.util.List;
+
+@Primary
+@FeignClient(contextId = "MonthlyApi", name = AppNameConstants.APP_JYPROJECT_MODULES, fallbackFactory = MonthlyFallbackFactory.class)
+public interface MonthlyApi {
+
+    @GetMapping(value = "/monthly/getList")
+    String getList();
+
+
+}

+ 2 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/factory/PostApiFallbackFactory.java

@@ -5,6 +5,7 @@ import com.jeeplus.sys.service.dto.PostDTO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.cloud.openfeign.FallbackFactory;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.GetMapping;
 
 /**
  * 岗位服务降级处理
@@ -21,6 +22,7 @@ public class PostApiFallbackFactory implements FallbackFactory <IPostApi> {
         throwable.printStackTrace ( );
         return new IPostApi ( ) {
 
+            @GetMapping("/feign/sys/dict/getPostDTOByName")
             @Override
             public PostDTO getPostDTOByName(String name) {
                 return null;

+ 5 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/factory/UserApiFallbackFactory.java

@@ -178,6 +178,11 @@ public class UserApiFallbackFactory implements FallbackFactory <IUserApi> {
                 return null;
             }
 
+            @Override
+            public String getJyUserList() {
+                return null;
+            }
+
         };
     }
 }

+ 7 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/feign/IUserApi.java

@@ -261,6 +261,13 @@ public interface IUserApi {
      */
     @GetMapping(value = BASE_URL + "/getUserIdByName")
     String getUserIdByName(@RequestParam(value = "name")String name);
+
+    /**
+     * 获取嘉溢所有员工
+     * @return
+     */
+    @GetMapping("getJyUserList")
+    String getJyUserList();
 }
 
 

+ 53 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/service/dto/FlowCopy.java

@@ -0,0 +1,53 @@
+/**
+ * Copyright © 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.sys.service.dto;
+
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 流程抄送Entity
+ *
+ * @author 刘高峰
+ * @version 2021-10-10
+ */
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class FlowCopy extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 抄送用户id
+     */
+    private String userId;
+    /**
+     * 流程定义id
+     */
+    private String procDefId;
+    /**
+     * 流程实例id
+     */
+    private String procInsId;
+    /**
+     * 流程标题
+     */
+    private String procDefName;
+    /**
+     * 实例标题
+     */
+    private String procInsName;
+    /**
+     * 流程节点
+     */
+    private String taskName;
+
+    public FlowCopy() {
+        super ( );
+    }
+}

+ 107 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/controller/MonthlyController.java

@@ -0,0 +1,107 @@
+package com.jeeplus.business.monthly.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.assess.projectRecords.Utils.EasyPoiUtil;
+import com.jeeplus.business.inscription.service.dto.InscriptionDTO;
+import com.jeeplus.business.monthly.service.MonthlyService;
+import com.jeeplus.business.monthly.service.dto.MonthlyDTO;
+import com.jeeplus.common.excel.ExcelOptions;
+import com.jeeplus.common.excel.annotation.ExportMode;
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Api(tags ="月报管理")
+@RestController
+@RequestMapping(value = "/monthly")
+public class MonthlyController {
+
+    @Resource
+    private MonthlyService monthlyService;
+
+
+    /**
+     * 列表
+     */
+    @ApiOperation(value = "文印申请列表")
+    @GetMapping(value = "/findList")
+    public ResponseEntity<IPage<MonthlyDTO>> applyList(MonthlyDTO monthlyDTO, Page<MonthlyDTO> page) throws Exception {
+        IPage<MonthlyDTO> pageList=monthlyService.findPageList(monthlyDTO,page);
+        return ResponseEntity.ok(pageList);
+    }
+
+    /**
+     * 用于feigh调用的列表
+     */
+    @GetMapping(value = "/getList")
+    public String getList() throws Exception {
+        List<MonthlyDTO> pageList=monthlyService.getList();
+        return JSON.toJSONString(pageList);
+    }
+
+    /**
+     * 根据id查找信息
+     */
+    @ApiOperation(value = "根据id查找根据id查找信息文印信息")
+    @GetMapping(value = "findById")
+    public ResponseEntity<MonthlyDTO> findById(@RequestParam String id){
+        MonthlyDTO monthlyDTO=monthlyService.findById(id);
+        return ResponseEntity.ok(monthlyDTO);
+    }
+
+    /**
+     * 根据id进行删除
+     */
+    @ApiOperation(value = "根据id进行删除")
+    @DeleteMapping(value = "delete")
+    public String delete(@RequestParam String id){
+        monthlyService.delete(id);
+        return "操作成功";
+    }
+
+
+    /**
+     * 修改或保存
+     */
+    @ApiOperation(value = "修改或保存")
+    @PostMapping(value = "saveForm")
+    public void saveForm(@RequestBody MonthlyDTO monthlyDTO){
+        monthlyService.saveForm(monthlyDTO);
+    }
+
+    @ApiLog(value = "导出月报数据", type = LogTypeEnum.EXPORT)
+    @GetMapping("export")
+    @ApiOperation(value = "导出月报数据")
+    public void exportFile(MonthlyDTO monthlyDTO, Page <MonthlyDTO> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename();
+        String sheetName = options.getSheetName();
+        List<MonthlyDTO> result = new ArrayList<>();
+        if ( ExportMode.current.equals ( options.getMode() ) ) {
+            result = monthlyService.findPageList (monthlyDTO,page).getRecords();
+        } else if (ExportMode.selected.equals ( options.getMode() )) {
+            result = monthlyService.findPageList (monthlyDTO,page).getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = monthlyService.findPageList (monthlyDTO,page).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, MonthlyDTO.class, fileName, response );
+
+    }
+
+}

+ 52 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/domain/JyProcess.java

@@ -0,0 +1,52 @@
+package com.jeeplus.business.monthly.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+@TableName("jy_process")
+public class JyProcess extends BaseEntity {
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告号
+     */
+    private String no;
+
+    /**
+     * 项目负责人
+     */
+    private String projectLeader;
+
+    /**
+     * 项目进度
+     */
+    private String process;
+
+    /**
+     * 进度完成时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date processTime;
+
+    /**
+     * 月报表id
+     */
+    private String monthlyId;
+
+    /**
+     * 部门
+     */
+    private String officeName;
+
+}

+ 41 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/domain/Monthly.java

@@ -0,0 +1,41 @@
+package com.jeeplus.business.monthly.domain;
+
+import cn.hutool.bloomfilter.filter.SDBMFilter;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("jy_monthly")
+public class Monthly extends BaseEntity {
+
+    /**
+     * 月报名称
+     */
+    private String name;
+
+    /**
+     * 年
+     */
+    private String year;
+
+    /**
+     * 月
+     */
+    private String month;
+
+    /**
+     * 是否提交 0:未提交  1:已提交
+     */
+    private String ifsubmit;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 项目情况
+     */
+    private String projectStatus;
+}

+ 15 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/mapper/JyProcessMapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.business.monthly.mapper;
+
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.monthly.domain.JyProcess;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface JyProcessMapper extends BaseMapper<JyProcess> {
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyProcess> findByMonthId(@Param("id") String id);
+}

+ 24 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/mapper/MonthlyMapper.java

@@ -0,0 +1,24 @@
+package com.jeeplus.business.monthly.mapper;
+
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.monthly.domain.Monthly;
+import com.jeeplus.business.monthly.service.dto.MonthlyDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface MonthlyMapper extends BaseMapper<Monthly> {
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<MonthlyDTO> findPageList(@Param(Constants.WRAPPER) QueryWrapper<MonthlyDTO> queryWrapper, Page<MonthlyDTO> page);
+    @InterceptorIgnore(tenantLine = "true")
+    MonthlyDTO findById(@Param("id") String id);
+    @InterceptorIgnore(tenantLine = "true")
+    List<MonthlyDTO> getList();
+}

+ 21 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/mapper/xml/JyProcessMapper.xml

@@ -0,0 +1,21 @@
+<?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.monthly.mapper.JyProcessMapper">
+
+    <select id="findByMonthId" resultType="com.jeeplus.business.monthly.domain.JyProcess">
+        select
+            project_name,
+            no,
+            project_leader,
+            process,
+            process_time,
+            monthly_id,
+            office_name
+        from
+            jy_process
+        where monthly_id = #{id}
+    </select>
+
+</mapper>

+ 66 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/mapper/xml/MonthlyMapper.xml

@@ -0,0 +1,66 @@
+<?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.monthly.mapper.MonthlyMapper">
+
+    <select id="findPageList" resultType="com.jeeplus.business.monthly.service.dto.MonthlyDTO">
+        select distinct
+            a.id,
+            a.create_time,
+            a.create_by_id,
+            so.name as officeName,
+            su.name as createName,
+            a.name,
+            a.year,
+            a.month,
+            a.ifsubmit,
+            a.project_status
+        from
+            jy_monthly a
+        left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        ${ew.customSqlSegment}
+        ORDER BY a.update_time DESC
+    </select>
+
+    <select id="findById" resultType="com.jeeplus.business.monthly.service.dto.MonthlyDTO">
+        select
+            a.id,
+            a.create_time,
+            a.create_by_id,
+            so.name as officeName,
+            su.name as createName,
+            a.name,
+            a.year,
+            a.month,
+            a.ifsubmit,
+            a.remarks,
+            a.project_status
+        from
+            jy_monthly a
+        left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        where a.id=#{id}
+    </select>
+
+    <select id="getList" resultType="com.jeeplus.business.monthly.service.dto.MonthlyDTO">
+        SELECT a.id,
+            a.create_time,
+            a.create_by_id,
+            a.name,
+            a.year,
+            a.month,
+            a.ifsubmit,
+            a.remarks,
+            a.project_status
+        FROM
+            jy_monthly a
+        WHERE
+            YEAR(a.create_time) = YEAR(CURDATE()) AND MONTH(a.create_time) = MONTH(CURDATE())
+            and a.del_flag = 0
+            GROUP BY a.create_by_id
+    </select>
+
+
+</mapper>

+ 403 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/service/MonthlyService.java

@@ -0,0 +1,403 @@
+package com.jeeplus.business.monthly.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.goOut.mapper.GoOutMapper;
+import com.jeeplus.business.monthly.domain.JyProcess;
+import com.jeeplus.business.monthly.domain.Monthly;
+import com.jeeplus.business.monthly.mapper.JyProcessMapper;
+import com.jeeplus.business.monthly.mapper.MonthlyMapper;
+import com.jeeplus.business.monthly.service.dto.MonthlyDTO;
+import com.jeeplus.business.project.service.JyProjectService;
+import com.jeeplus.business.project.service.dto.JyProjectDTO;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IPostApi;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.FlowCopy;
+import com.jeeplus.sys.service.dto.PostDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.utils.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@Service
+public class MonthlyService {
+
+    @Resource
+    private MonthlyMapper monthlyMapper;
+
+    @Resource
+    private JyProjectService jyProjectService;
+
+    @Resource
+    private GoOutMapper goOutMapper;
+
+    @Resource
+    private JyProcessMapper jyProcessMapper;
+
+
+    /**
+     * 列表展示
+     * @param monthlyDTO
+     * @param page
+     * @return
+     */
+    public IPage<MonthlyDTO> findPageList(MonthlyDTO monthlyDTO, Page<MonthlyDTO> page) throws Exception {
+        QueryWrapper<MonthlyDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(monthlyDTO, MonthlyDTO.class);
+        queryWrapper.eq("a.del_flag",0);
+        //申请人
+        if (StringUtils.isNotBlank(monthlyDTO.getCreateById())){
+            queryWrapper.eq("a.create_by_id",monthlyDTO.getCreateById());
+        }
+        //申请人部门
+        if (StringUtils.isNotBlank(monthlyDTO.getOfficeId())){
+            queryWrapper.eq("so.id",monthlyDTO.getOfficeId());
+        }
+        //申请时间
+        if (monthlyDTO.getCreateDates() != null && monthlyDTO.getCreateDates().length > 0) {
+            queryWrapper.between("a.create_time", monthlyDTO.getCreateDates()[0], monthlyDTO.getCreateDates()[1]);
+        }
+        IPage<MonthlyDTO> pageList=monthlyMapper.findPageList(queryWrapper,page);
+
+        pageList.getRecords().stream().forEach(item->{
+            //生成月报年月
+            String date=item.getYear()+"年"+item.getMonth()+"月";
+            item.setMonthDate(date);
+        });
+
+        return pageList;
+
+    }
+
+    /**
+     * 根据id查找信息
+     * @param id
+     * @return
+     */
+    public MonthlyDTO findById(String id) {
+        MonthlyDTO monthlyDTO = new MonthlyDTO();
+        if (StringUtils.isNotBlank(id)){
+            MonthlyDTO dto=monthlyMapper.findById(id);
+            BeanUtils.copyProperties(dto,monthlyDTO);
+            // 查询附件信息
+            List<WorkAttachmentInfo> files = goOutMapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(files)) {
+                for (WorkAttachmentInfo i : files) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+                monthlyDTO.setFiles(files);
+            }
+        }
+        //根据月报表id查询项目进度
+        List<JyProcess> processList=jyProcessMapper.findByMonthId(id);
+        if (ObjectUtils.isNotEmpty(processList)){
+            monthlyDTO.setProcessList(processList);
+        }else {
+            String mid = UUID.randomUUID().toString().replace("-", "");
+            //先往月报表中添加一条数据
+            Monthly monthly = new Monthly();
+            monthly.setId(mid);
+            monthly.setIfsubmit("0");
+            monthlyMapper.insert(monthly);
+
+            monthlyDTO.setId(mid);
+
+            //获取当前登陆人未归档的项目信息
+            List<JyProjectDTO> jyProjectDTO=jyProjectService.getByIdNoArchive();
+            List<JyProjectDTO> arrayList = new ArrayList<>();
+            if (ObjectUtils.isNotEmpty(jyProjectDTO)){
+                for (JyProjectDTO item : jyProjectDTO) {
+                    //项目进度信息
+                    if (!item.getFirstInstanceStatus().equals("5") && StringUtils.isNotBlank(item.getFirstInstanceStatus())){
+                        item.setProcess("登记完成");
+                        item.setProcessTime(item.getUpdateTime());
+                        continue;
+                    }else {
+                        item.setProcess("一级校审完成");
+                        item.setProcessTime(item.getAudit1UpdateTime());
+                    }
+                    if (!item.getSecondInstanceStatus().equals("5") && StringUtils.isNotBlank(item.getSecondInstanceStatus())){
+                        item.setProcess("一级校审完成");
+                        item.setProcessTime(item.getAudit1UpdateTime());
+                        continue;
+                    }else {
+                        item.setProcess("二级校审完成");
+                        item.setProcessTime(item.getAudit2UpdateTime());
+                    }
+                    if (!item.getThirdInstanceStatus().equals("5") && StringUtils.isNotBlank(item.getThirdInstanceStatus())){
+                        item.setProcess("二级校审完成");
+                        item.setProcessTime(item.getAudit2UpdateTime());
+                        continue;
+                    }else {
+                        item.setProcess("三级校审完成");
+                        item.setProcessTime(item.getAudit3UpdateTime());
+                    }
+                    if (StringUtils.isNotBlank(item.getReportStatus()) && !item.getReportStatus().equals("5")){
+                        item.setProcess("三级校审完成");
+                        item.setProcessTime(item.getAudit3UpdateTime());
+                        continue;
+                    }else {
+                        item.setProcess("报告签发完成");
+                        item.setProcessTime(item.getReportTime());
+                    }
+                    if (StringUtils.isNotBlank(item.getOutInstance()) && !item.getOutInstance().equals("5")){
+                        item.setProcess("报告签发完成");
+                        item.setProcessTime(item.getReportTime());
+                        continue;
+                    }else {
+                        item.setProcess("外审完成");
+                        item.setProcessTime(item.getOutTime());
+                    }
+                    if (StringUtils.isNotBlank(item.getReportsStatus()) && !item.getReportsStatus().equals("5")){
+                        item.setProcess("外审完成");
+                        item.setProcessTime(item.getOutTime());
+                        continue;
+                    }else {
+                        item.setProcess("报批签发完成");
+                        item.setProcessTime(item.getReportsTime());
+                    }
+                };
+                arrayList.addAll(jyProjectDTO);
+            }
+            List<JyProcess> jyProcessList = saveProcess(arrayList, mid);
+            monthlyDTO.setProcessList(jyProcessList);
+        }
+        return monthlyDTO;
+    }
+
+    /**
+     * 往进度表中添加数据
+     */
+    public List<JyProcess> saveProcess(List<JyProjectDTO> projectDTOS,String monthId){
+        ArrayList<JyProcess> jyProcesses = new ArrayList<>();
+        projectDTOS.stream().forEach(item->{
+            JyProcess jyProcess = new JyProcess();
+            String id = UUID.randomUUID().toString().replace("-", "");
+            jyProcess.setId(id);
+            jyProcess.setOfficeName(item.getOfficeName());//部门
+            jyProcess.setProjectName(item.getName());//项目名称
+            jyProcess.setNo(item.getNo());//报告号
+            jyProcess.setProjectLeader(item.getProjectLeader());//项目负责人
+            jyProcess.setProcessTime(item.getProcessTime());//进度完成时间
+            jyProcess.setProcess(item.getProcess());//进度
+            jyProcess.setMonthlyId(monthId);//月报id
+            jyProcessMapper.insert(jyProcess);
+            jyProcesses.add(jyProcess);
+        });
+        return jyProcesses;
+    }
+
+
+
+
+
+    /**
+     * 修改或保存
+     * @param monthlyDTO
+     */
+    public void saveForm(MonthlyDTO monthlyDTO) {
+        //获取当前登陆人信息
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        Monthly monthly = new Monthly();
+        if (StringUtils.isNotBlank(monthlyDTO.getId())){
+            monthly.setUpdateById(userDTO.getId());
+            monthly.setUpdateTime(new Date());
+            monthly.setProjectStatus(monthlyDTO.getProjectStatus()); //项目情况
+            monthly.setRemarks(monthlyDTO.getRemarks()); //备注
+            monthly.setId(monthlyDTO.getId());
+            monthly.setIfsubmit("1");
+            //切割月报时间
+            String[] split = monthlyDTO.getMonthDate().split("-");
+            monthly.setYear(split[0]);
+            monthly.setMonth(split[1]);
+            //月报名称
+            String name=userDTO.getName()+split[0]+"年"+split[1]+"月月报";
+            monthly.setName(name);
+            monthlyMapper.updateById(monthly);
+            //修改附件
+            List<WorkAttachmentInfo> files = monthlyDTO.getFiles();
+            updateFiles(files, userDTO, monthlyDTO.getId());
+        }else {
+            //切割月报时间
+            String[] split = monthlyDTO.getMonthDate().split("-");
+            monthly.setYear(split[0]);
+            monthly.setMonth(split[1]);
+
+            String id = UUID.randomUUID().toString().replace("-", "");
+            monthly.setId(id);
+            monthly.setCreateById(userDTO.getId());
+            monthly.setCreateTime(new Date());
+            monthly.setUpdateById(userDTO.getId());
+            monthly.setUpdateTime(new Date());
+            monthly.setProjectStatus(monthlyDTO.getProjectStatus()); //项目情况
+            monthly.setIfsubmit("1");
+            monthly.setRemarks(monthlyDTO.getRemarks()); //备注
+            //月报名称
+            String name=userDTO.getName()+split[0]+"年"+split[1]+"月月报";
+            monthly.setName(name);
+            monthlyMapper.insert(monthly);
+            //保存附件
+            List<WorkAttachmentInfo> files = monthlyDTO.getFiles();
+            if (CollectionUtil.isNotEmpty(files)) {
+                saveFiles(files, userDTO, id);
+            }
+
+            //给办公室和部门主任抄送
+            ArrayList<UserDTO> userDTOS = new ArrayList<>();
+            PostDTO postDTOByName = SpringUtil.getBean(IPostApi.class).getPostDTOByName("办公室(嘉溢)");
+            PostDTO postDTOByName1 = SpringUtil.getBean(IPostApi.class).getPostDTOByName("部门主任(嘉溢)");
+            List<UserDTO> listByPostId = SpringUtil.getBean(IUserApi.class).findListByPostId(postDTOByName.getId());
+            List<UserDTO> listByPostId1 = SpringUtil.getBean(IUserApi.class).findListByPostId(postDTOByName1.getId());
+            listByPostId.stream().forEach(item->{
+                userDTOS.add(item);
+            });
+            listByPostId1.stream().forEach(item->{
+                userDTOS.add(item);
+            });
+            for (UserDTO dto : userDTOS) {
+                String id1 = UUID.randomUUID().toString().replace("-", "");
+                FlowCopy flowCopy = new FlowCopy();
+                flowCopy.setCreateById(userDTO.getId());
+                flowCopy.setCreateTime(new Date());
+                flowCopy.setUpdateById(userDTO.getId());
+                flowCopy.setUpdateTime(new Date());
+                flowCopy.setProcInsName(name);
+                flowCopy.setUserId(dto.getId());
+                flowCopy.setId(id1);
+                flowCopy.setDelFlag(0);
+                SpringUtil.getBean(IFlowableApi.class).add(flowCopy);
+            }
+
+
+
+        }
+    }
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentInfo dto : list) {
+            WorkAttachmentInfo i = new WorkAttachmentInfo();
+            //包含了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 (CollectionUtil.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("monthly");
+            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);
+            j++;
+        }
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(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 = goOutMapper.findList(id);
+        if (CollectionUtil.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = goOutMapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
+                //包含了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 (CollectionUtil.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("monthly");
+                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);
+                j++;
+            }
+        }
+    }
+
+    /*
+    根据id进行删除
+     */
+    public void delete(String id) {
+        monthlyMapper.deleteById(id);
+    }
+
+    /**
+     * 列表
+     * @param monthlyDTO
+     * @return
+     */
+    public List<MonthlyDTO> getList() {
+        List<MonthlyDTO> list= monthlyMapper.getList();
+        return list;
+    }
+}

+ 85 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/service/dto/MonthlyDTO.java

@@ -0,0 +1,85 @@
+package com.jeeplus.business.monthly.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.business.monthly.domain.JyProcess;
+import com.jeeplus.business.project.service.dto.JyProjectDTO;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class MonthlyDTO extends BaseEntity {
+    /**
+     * 月报名称
+     */
+    @Excel(name = "月报名称",width = 25)
+    private String name;
+
+    /**
+     * 年
+     */
+    private String year;
+
+    /**
+     * 月
+     */
+    private String month;
+
+    /**
+     * 是否提交 0:未提交  1:已提交
+     */
+    private String ifsubmit;
+
+
+    /**
+     * 发起人部门
+     */
+    private String officeId;
+
+    /**
+     * 发起时间
+     */
+    private String[] createDates;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 月报时间(年月)
+     */
+    @Excel(name = "月报时间",width = 16)
+    private String monthDate;
+
+    /**
+     * 项目情况
+     */
+    private String projectStatus;
+
+    /**
+     * 项目列表
+     */
+    private List<JyProcess> processList;
+
+    @Excel(name = "申请人",width = 16)
+    private String createName;
+    @Excel(name = "申请部门",width = 16)
+    private String officeName;
+
+    @Excel(name = "申请时间",width = 16,exportFormat = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date createTime;
+
+    /**
+     * 附件
+     */
+    private List<WorkAttachmentInfo> files;
+
+}

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

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.service.dto.JyProjectDTO;
 import com.jeeplus.business.workContractInfo.domain.JyWorkContractInfo;
 import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
@@ -47,4 +48,6 @@ public interface JyProjectMapper extends BaseMapper<JyProject> {
     void updateReportsSubmit(@Param("id")String s, @Param("status")String status);
     @InterceptorIgnore(tenantLine = "true")
     IPage<JyProject> getByCreateOffice(@Param("id")String id, Page<JyProject> page,  @Param(Constants.WRAPPER)QueryWrapper<JyProject> wrapper);
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyProjectDTO> getByIdNoArchive(@Param("id")String id);
 }

+ 57 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml

@@ -846,6 +846,63 @@
             ORDER BY a.update_time DESC
     </select>
 
+    <select id="getByIdNoArchive" resultType="com.jeeplus.business.project.service.dto.JyProjectDTO">
+        SELECT
+        distinct
+           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.report_issuance,
+           a.contract_status,
+           a.project_place,
+           a.build_place,
+           a.project_overview,
+           a.special,
+           a.contract_project_no,
+           (select name from sys_user where id=a.project_leader) as projectLeader,
+           a.proc_ins_id,
+           a.process_definition_id,
+           b.name AS create_by_id,
+           pa1.status as firstInstanceStatus,
+           pa1.id as auditId1,
+           pa1.update_time as audit1UpdateTime,
+           pa2.status as secondInstanceStatus,
+           pa2.id as auditId2,
+           pa2.update_time as audit2UpdateTime,
+           pa3.id as auditId3,
+           pa3.update_time as audit3UpdateTime,
+           pa3.status as thirdInstanceStatus,
+           po.status as outInstance,
+           po.id as outInstanceId,
+           po.update_time as outTime,
+           par.status as reviewStatus,
+           par.id as archiveId,
+           par.update_time as archiveTime,
+           so.name as officeName
+        FROM
+            jy_project_record a
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
+            left join sys_office so on b.office_id = so.id
+            LEFT JOIN sys_user c ON a.project_leader = c.id
+            left join jy_project_members pm on a.id = pm.project_id
+            left join jy_project_outinstance po on a.id=po.project_id
+            left join jy_project_archive par on a.id=par.project_id
+						left join jy_project_audit pa1 on pa1.project_id = a.id and pa1.audit_level = '1' and pa1.del_flag = '0'
+            LEFT JOIN jy_project_audit pa2 ON pa2.project_id = a.id and pa2.audit_level = '2' and pa2.del_flag = '0'
+            LEFT JOIN jy_project_audit pa3 ON pa3.project_id = a.id and pa3.audit_level = '3' and pa3.del_flag = '0'
+            where a.create_by_id=#{id} and par.status != '5' and a.status = '5' order by a.update_time DESC
+    </select>
+
 
 
 </mapper>

+ 38 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java

@@ -1858,4 +1858,42 @@ public class JyProjectService {
         IPage<JyProject> projectIPage=jyProjectMapper.getByCreateOffice(userDTO.getId(),page,wrapper);
         return projectIPage;
     }
+
+    /**
+     * 获取当前登陆人未归档的项目信息
+     * @return
+     */
+    public List<JyProjectDTO> getByIdNoArchive() {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        List<JyProjectDTO> projectDTOList=jyProjectMapper.getByIdNoArchive(userDTO.getId());
+        //获取用印id
+        QueryWrapper<Signet> queryWrapper = new QueryWrapper<>();
+        queryWrapper.orderByDesc("create_time");
+        List<Signet> signets = signetMapper.selectList(queryWrapper);
+        projectDTOList.stream().forEach(item ->{
+            for (Signet signet : signets) {
+                if (StringUtils.isNotBlank(signet.getProjectId())){
+                    String[] split = signet.getProjectId().split(",");
+                    for (String s : split) {
+                        if (StringUtils.isNotBlank(s)){
+                            if (StringUtils.isNotBlank(signet.getTypeStatus())){
+                                //用印类型为报告,则获取报告签发
+                                if ( s.equals(item.getId()) && signet.getTypeStatus().equals("1") ){
+                                    item.setReportStatus(signet.getStatus());
+                                    item.setReportTime(signet.getUpdateTime());
+                                }
+                                if (s.equals(item.getId()) && signet.getTypeStatus().equals("2")){
+                                    //用印类型为报批,则设置报批签发所需信息
+                                    item.setReportsTime(signet.getUpdateTime());
+                                    item.setReportsStatus(signet.getStatus());
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        });
+        return projectDTOList;
+    }
 }

+ 45 - 3
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/dto/JyProjectDTO.java

@@ -1,6 +1,7 @@
 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.JyProjectMembers;
 import com.jeeplus.business.workClientInfo.domain.JyWorkClientLinkman;
 import com.jeeplus.core.domain.BaseEntity;
@@ -8,6 +9,7 @@ import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.Date;
 import java.util.List;
 @Data
 public class JyProjectDTO extends BaseEntity implements Serializable {
@@ -40,17 +42,17 @@ public class JyProjectDTO extends BaseEntity implements Serializable {
     /**
      * 一审状态
      */
-    private String firstInstance;
+    private String firstInstanceStatus;
 
     /**
      * 二审状态
      */
-    private String secondInstance;
+    private String secondInstanceStatus;
 
     /**
      * 三审状态
      */
-    private String thirdInstance;
+    private String thirdInstanceStatus;
 
     /**
      * 报告签发
@@ -191,12 +193,21 @@ public class JyProjectDTO extends BaseEntity implements Serializable {
     @TableField(exist = false)
     private String auditId1;
 
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date  audit1UpdateTime;
+
     /**
      * 二级校审id
      */
     @TableField(exist = false)
     private String auditId2;
 
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date  audit2UpdateTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date  audit3UpdateTime;
+
     /**
      * 三级校审id
      */
@@ -272,9 +283,40 @@ public class JyProjectDTO extends BaseEntity implements Serializable {
     @TableField(exist = false)
     private String taskIdReports;
 
+    private String reportsStatus;
+
+    //报批时间
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date  reportsTime;
+
+    //报告时间
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date  reportTime;
+    //报告状态
+    private String reportStatus;
+
     /**
      * 环评资质状态
      */
     private String eiaStatus;
 
+    /**
+     * 外审时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date outTime;
+    private String outInstance;
+
+
+    /**
+     * 项目进度及完成时间
+     */
+    private String process;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date processTime;
+
+    private String officeName;
+
+
+
 }

+ 8 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/controller/FlowCopyController.java

@@ -67,6 +67,14 @@ public class FlowCopyController {
         return ResponseEntity.ok ( "保存流程抄送成功" );
     }
 
+    @PostMapping("add")
+    public ResponseEntity add(@RequestBody FlowCopy flowCopy) {
+            flowCopyService.add ( flowCopy );//保存
+
+        return ResponseEntity.ok ( "保存流程抄送成功" );
+    }
+
+
 
     /**
      * 批量删除流程抄送

+ 3 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/mapper/FlowCopyMapper.java

@@ -3,6 +3,7 @@
  */
 package com.jeeplus.extension.mapper;
 
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -27,4 +28,6 @@ public interface FlowCopyMapper extends BaseMapper <FlowCopy> {
      * @return
      */
     IPage <FlowCopyDTO> findList(Page <FlowCopyDTO> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+    void add(@Param("flow") FlowCopy flowCopy);
 }

+ 5 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/mapper/xml/FlowCopyMapper.xml

@@ -17,7 +17,12 @@
         FROM act_extension_cc a
                  LEFT JOIN sys_user createBy ON createBy.id = a.create_by_id
             ${ew.customSqlSegment}
+            order by a.update_time DESC
     </select>
 
+    <insert id="add">
+        insert into act_extension_cc(create_by_id,create_time,proc_ins_name,update_by_id,update_time,id,user_id,del_flag) values (#{flow.createById},#{flow.createTime},#{flow.procInsName},#{flow.updateById},#{flow.updateTime},#{flow.id},#{flow.userId},#{flow.delFlag})
+    </insert>
+
 
 </mapper>

+ 3 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/service/FlowCopyService.java

@@ -35,4 +35,7 @@ public class FlowCopyService extends ServiceImpl <FlowCopyMapper, FlowCopy> {
         return baseMapper.findList ( page, queryWrapper );
     }
 
+    public void add(FlowCopy flowCopy) {
+        baseMapper.add(flowCopy);
+    }
 }

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

@@ -10,8 +10,10 @@ import com.jeeplus.flowable.model.Flow;
 import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.flowable.service.MyNoticeService;
 import com.jeeplus.sys.feign.IOfficeApi;
+import com.jeeplus.sys.feign.IPostApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.service.dto.OfficeDTO;
+import com.jeeplus.sys.service.dto.PostDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import lombok.SneakyThrows;
 import org.flowable.engine.RuntimeService;
@@ -74,22 +76,18 @@ public class JyProjectExecutionListener implements ExecutionListener {
 
                 UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(flow.getAssigneeId());
                 //获取到岗位为办公室下的人员信息
-                List<UserDTO> allUserInfo = SpringUtil.getBean(IUserApi.class).getAllUserInfo();
+                PostDTO postDTOByName = SpringUtil.getBean(IPostApi.class).getPostDTOByName("办公室(嘉溢)");
+                List<UserDTO> listByPostId = SpringUtil.getBean(IUserApi.class).findListByPostId(postDTOByName.getId());
                 String finalTitleName = titleName;
-                allUserInfo.stream().forEach(item->{
-                    if (ObjectUtil.isNotEmpty(item.getPostNameList())){
-                        item.getPostNameList().stream().forEach(data->{
-                            if (data.equals("办公室(嘉溢)")){
-                                FlowCopy flowCopy = new FlowCopy();
-                                flowCopy.setProcDefId(task.getProcDefId());
+                listByPostId.stream().forEach(item->{
+                    FlowCopy flowCopy = new FlowCopy();
+                    flowCopy.setProcDefId(task.getProcDefId());
 //                        flowCopy.setProcDefId(task.getProcDefId());
-                                flowCopy.setProcInsName(finalTitleName);
-                                flowCopy.setProcInsId(task.getProcInstId());
-                                flowCopy.setUserId(item.getId());
-                                SpringUtil.getBean(FlowCopyService.class).save(flowCopy);
-                            }
-                        });
-                    }
+                    flowCopy.setProcInsName(finalTitleName);
+                    flowCopy.setProcInsId(task.getProcInstId());
+                    flowCopy.setUserId(item.getId());
+                    SpringUtil.getBean(FlowCopyService.class).save(flowCopy);
+
                 });
 
 

+ 11 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -1000,6 +1000,17 @@ public class UserController {
     }
 
 
+    /**
+     * 获取嘉溢下的所有员工信息
+     */
+    @ApiOperation(value = "获取员工信息")
+    @GetMapping("getJyUserList")
+    public String getJyUserList(){
+        List<UserDTO> list=userService.getJyUserList();
+        return JSON.toJSONString(list);
+    }
+
+
 
 
 

+ 2 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/feign/PostApiImpl.java

@@ -6,6 +6,7 @@ import com.jeeplus.sys.service.dto.PostDTO;
 import com.jeeplus.sys.service.mapstruct.PostWrapper;
 import com.jeeplus.sys.utils.TenantUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 @RestController
@@ -15,6 +16,7 @@ public class PostApiImpl implements IPostApi {
     PostService postService;
 
 
+    @GetMapping("/feign/sys/dict/getPostDTOByName")
     @Override
     public PostDTO getPostDTOByName(String name) {
         return PostWrapper.INSTANCE.toDTO ( postService.lambdaQuery ( ).eq ( Post::getTenantId, TenantUtils.getTenantId ( ) ).eq ( Post::getName, name ).one ( ) );

+ 5 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/feign/UserApiImpl.java

@@ -204,4 +204,9 @@ public class UserApiImpl implements IUserApi {
         return userService.getUserIdByName(name) ;
     }
 
+    @Override
+    public String getJyUserList() {
+        return null;
+    }
+
 }

+ 2 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/UserMapper.java

@@ -241,4 +241,6 @@ public interface UserMapper extends BaseMapper <User> {
 
     @InterceptorIgnore(tenantLine = "true")
     List<String> getHasUserFather();
+    @InterceptorIgnore(tenantLine = "true")
+    List<UserDTO> getJyUserList();
 }

+ 16 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml

@@ -549,4 +549,20 @@ select a.id, a.company_id as "companyDTO.id", a.office_id as "officeDTO.id", a.l
          WHERE (sc.type = '6' AND a.del_flag = 0)
     </select>
 
+    <select id="getJyUserList" resultType="com.jeeplus.sys.service.dto.UserDTO">
+select DISTINCT a.id, a.company_id as "companyDTO.id", a.office_id as "officeDTO.id", a.login_name as "loginName",
+		a.password,
+		a.no,
+		a.name,
+		a.email, a.phone,
+		a.mobile,
+		a.login_ip as "loginIp", a.login_date as "loginDate",
+		a.remarks,
+		a.login_flag, a.photo, a.qr_code, a.sign,
+		a.create_by_id as "createBy.id", a.create_time, a.update_by_id as "updateBy.id",
+		a.update_time
+		from sys_user a
+		where a.tenant_id = "10006" and a.del_flag=0
+    </select>
+
 </mapper>

+ 8 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/UserService.java

@@ -578,4 +578,12 @@ public class UserService extends ServiceImpl <UserMapper, User> {
         hasUser.addAll(hasUserFather);
         return hasUser;
     }
+
+    /*8
+    获取嘉溢下的所有员工信息
+     */
+    public List<UserDTO> getJyUserList() {
+        List<UserDTO> list=userMapper.getJyUserList();
+        return list;
+    }
 }

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

@@ -0,0 +1,77 @@
+package com.jeeplus.domain;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.jeeplus.core.domain.BaseEntity;
+
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class MonthlyDTO extends BaseEntity {
+
+    private String createById;
+    /**
+     * 月报名称
+     */
+
+    private String name;
+
+    /**
+     * 年
+     */
+    private String year;
+
+    /**
+     * 月
+     */
+    private String month;
+
+    /**
+     * 是否提交 0:未提交  1:已提交
+     */
+    private String ifsubmit;
+
+
+    /**
+     * 发起人部门
+     */
+    private String officeId;
+
+    /**
+     * 发起时间
+     */
+    private String[] createDates;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 月报时间(年月)
+     */
+
+    private String monthDate;
+
+    /**
+     * 项目情况
+     */
+    private String projectStatus;
+
+
+
+
+    private String createName;
+
+    private String officeName;
+
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date createTime;
+}

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

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

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

@@ -4,10 +4,13 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 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.flowable.feign.MonthlyApi;
+import com.jeeplus.sys.feign.IOfficeApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.xxl.job.core.context.XxlJobHelper;
@@ -27,6 +30,7 @@ import java.io.DataOutputStream;
 import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
@@ -61,6 +65,106 @@ public class SampleXxlJob {
     }
 
     /**
+     * 嘉溢月报发送通知
+     */
+    @XxlJob("monthly")
+    public void monthly() throws ParseException {
+        System.out.println("进来了---");
+        //获取到嘉溢公司全部员工
+        String jyUserList = SpringUtil.getBean(IUserApi.class).getJyUserList();
+        List<UserDTO> dtoList = JSON.parseObject(jyUserList, new TypeReference<List<UserDTO>>() {});
+        //设置每个月的25号
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH,25);
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH)+1;
+        int day = calendar.get(Calendar.DAY_OF_MONTH);
+        String date=year+"-"+month+"-"+day;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date endDate = simpleDateFormat.parse(date);
+        //获取到当前日期
+        Date beginDate = new Date();
+        //计算时间只差
+        int interval1 = Integer.parseInt(this.getInterval(beginDate, endDate));
+        String taskName = null;
+        String titleStr = null;
+        //如果还剩三天则发送通知
+        if (interval1<=3 && interval1 >=0){
+            taskName="月报还未提交";
+            titleStr="距离月报提交截至日期还剩"+interval1+"天,请尽快提交";
+            //获得月报中的数据
+            String list = SpringUtil.getBean(MonthlyApi.class).getList();
+            List<MonthlyDTO> monthlyDTOS = JSON.parseObject(list, new TypeReference<List<MonthlyDTO>>() {});
+            for (MonthlyDTO monthlyDTO : monthlyDTOS) {
+                //遍历嘉溢公司的所有人员
+                for (UserDTO userDTO : dtoList) {
+                    if (!monthlyDTO.getCreateById().equals(userDTO.getId())){
+                        Set<String> noticeUserSet = new HashSet<String>();
+
+                        String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(userDTO.getId());
+                        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("");
+                            myNotice.setDefId("");
+                            myNotice.setTitle(titleStr);
+                            myNotice.setTaskName(taskName);
+                            myNotice.setLink("结束");
+                            myNotice.setType("0");
+                            myNotice.setCreateUser("管理员");
+                            myNotice.setCreateTime(new Date());
+
+                            for (String noticeUserId : noticeUserList) {
+                                myNotice.setNoticeId(noticeUserId);
+                                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);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+    }
+
+
+    /**
      * 嘉溢项目校审发送通知
      */
     @XxlJob("projectAuditTask")