Explorar o código

月报,公告

sangwenwei hai 1 ano
pai
achega
6c407c2151

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

@@ -98,6 +98,11 @@ public class FlowableApiFallbackFactory implements FallbackFactory <IFlowableApi
 
             }
 
+            @Override
+            public void remove(String procInsId) {
+
+            }
+
         };
     }
 }

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

@@ -115,4 +115,10 @@ public interface IFlowableApi {
     @RequestMapping(value ="/extension/flowCopy/add",method = RequestMethod.POST )
     void add(@RequestBody FlowCopy flowCopy);
 
+    /**
+     * 删除抄送信息
+     */
+    @GetMapping(value ="/extension/flowCopy/remove" )
+    void remove(@RequestParam(value = "procInsId")String procInsId);
+
 }

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

@@ -67,7 +67,7 @@ public class JyProcess extends BaseEntity {
     private String archiveId;
     @TableField(exist = false)
     private String eiaId;
-    @TableField(exist = false)
+    //项目id
     private String projectId;
 
 }

+ 2 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/mapper/xml/JyProcessMapper.xml

@@ -12,7 +12,8 @@
             process,
             process_time,
             monthly_id,
-            office_name
+            office_name,
+            project_id
         from
             jy_process
         where monthly_id = #{id}

+ 77 - 46
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/monthly/service/MonthlyService.java

@@ -109,19 +109,13 @@ public class MonthlyService {
                 }
                 monthlyDTO.setFiles(files);
             }
-        }
-        //根据月报表id查询项目进度
-//        List<JyProcess> processList=jyProcessMapper.findByMonthId(id);
-//        if (ObjectUtils.isNotEmpty(processList)){
-//            monthlyDTO.setProcessList(processList);
-//        }else {
+//            根据月报表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);
             //获取当前登录人信息
             UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
@@ -179,12 +173,21 @@ public class MonthlyService {
                         item.setProcess("报批签发完成");
                         item.setProcessTime(item.getReportsTime());
                     }
+                    if ((StringUtils.isNotBlank(item.getReviewStatus()) && !"5".equals(item.getReviewStatus())) || StringUtils.isBlank(item.getReviewStatus())){
+                        item.setProcess("报批签发完成");
+                        item.setProcessTime(item.getReportsTime());
+                    }else {
+                        item.setProcess("归档完成");
+                        item.setProcessTime(item.getArchiveTime());
+                    }
+
                 };
                 arrayList.addAll(jyProjectDTO);
             }
             List<JyProcess> jyProcessList = saveProcess(arrayList, mid);
             monthlyDTO.setProcessList(jyProcessList);
-//        }
+        }
+
         return monthlyDTO;
     }
 
@@ -270,7 +273,7 @@ public class MonthlyService {
             jyProcess.setArchiveId(item.getArchiveId());
             jyProcess.setEiaId(item.getEiaId());
 
-            jyProcessMapper.insert(jyProcess);
+//            jyProcessMapper.insert(jyProcess);
             jyProcesses.add(jyProcess);
         });
         return jyProcesses;
@@ -288,7 +291,9 @@ public class MonthlyService {
         //获取当前登陆人信息
         UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
         Monthly monthly = new Monthly();
-        if (StringUtils.isNotBlank(monthlyDTO.getId())){
+        String monthName = "";
+        MonthlyDTO Dto = monthlyMapper.findById(monthlyDTO.getId());
+        if (ObjectUtil.isNotEmpty(Dto)){
             monthly.setUpdateById(userDTO.getId());
             monthly.setUpdateTime(new Date());
             monthly.setProjectStatus(monthlyDTO.getProjectStatus()); //项目情况
@@ -302,7 +307,22 @@ public class MonthlyService {
             //月报名称
             String name=userDTO.getName()+split[0]+"年"+split[1]+"月月报";
             monthly.setName(name);
-            monthlyMapper.insert(monthly);
+            monthName = name;
+            monthlyMapper.updateById(monthly);
+            //添加项目进度信息
+            //先进行删除
+            List<JyProcess> jyProcesses = jyProcessMapper.findByMonthId(monthlyDTO.getId());
+            if (CollectionUtils.isNotEmpty(jyProcesses)){
+                for (JyProcess jyProcess : jyProcesses) {
+                    jyProcessMapper.deleteById(jyProcess.getId());
+                }
+            }
+            //然后在添加
+            if (CollectionUtils.isNotEmpty(monthlyDTO.getProcessList())){
+                for (JyProcess jyProcess : monthlyDTO.getProcessList()) {
+                    jyProcessMapper.insert(jyProcess);
+                }
+            }
 
             //修改附件
             List<WorkAttachmentInfo> files = monthlyDTO.getFiles();
@@ -313,8 +333,7 @@ public class MonthlyService {
             monthly.setYear(split[0]);
             monthly.setMonth(split[1]);
 
-            String id = UUID.randomUUID().toString().replace("-", "");
-            monthly.setId(id);
+            monthly.setId(monthlyDTO.getId());
             monthly.setCreateById(userDTO.getId());
             monthly.setCreateTime(new Date());
             monthly.setUpdateById(userDTO.getId());
@@ -326,41 +345,48 @@ public class MonthlyService {
             String name=userDTO.getName()+split[0]+"年"+split[1]+"月月报";
             monthly.setName(name);
             monthlyMapper.insert(monthly);
+            monthName = name;
             //保存附件
             List<WorkAttachmentInfo> files = monthlyDTO.getFiles();
             if (CollectionUtil.isNotEmpty(files)) {
-                saveFiles(files, userDTO, id);
+                saveFiles(files, userDTO, monthlyDTO.getId());
             }
-
-            //给办公室和部门主任抄送
-            ArrayList<UserDTO> userDTOS = new ArrayList<>();
-            PostDTO postDTOByName = SpringUtil.getBean(IPostApi.class).getPostDTOByName("办公室(嘉溢)");
-            List<UserDTO> officeId = SpringUtil.getBean(IUserApi.class).findListByOfficeId(userDTO.getOfficeDTO().getId());
-            List<UserDTO> listByPostId = SpringUtil.getBean(IUserApi.class).findListByPostId(postDTOByName.getId());
-            for (UserDTO dto : officeId) {
-                if (StringUtils.isNotBlank(dto.getManageOfficeIds())){
-                    userDTOS.add(dto);
+            //添加项目进度信息
+            if (CollectionUtils.isNotEmpty(monthlyDTO.getProcessList())){
+                for (JyProcess jyProcess : monthlyDTO.getProcessList()) {
+                    jyProcessMapper.insert(jyProcess);
                 }
             }
-            listByPostId.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);
+        }
+        //发送抄送前需先进行删除
+        SpringUtil.getBean(IFlowableApi.class).remove(monthlyDTO.getId());
+        //给办公室和部门主任抄送
+        ArrayList<UserDTO> userDTOS = new ArrayList<>();
+        PostDTO postDTOByName = SpringUtil.getBean(IPostApi.class).getPostDTOByName("办公室(嘉溢)");
+        List<UserDTO> officeId = SpringUtil.getBean(IUserApi.class).findListByOfficeId(userDTO.getOfficeDTO().getId());
+        List<UserDTO> listByPostId = SpringUtil.getBean(IUserApi.class).findListByPostId(postDTOByName.getId());
+        for (UserDTO dto : officeId) {
+            if (StringUtils.isNotBlank(dto.getManageOfficeIds())){
+                userDTOS.add(dto);
             }
-
-
-
+        }
+        listByPostId.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(monthName);
+            flowCopy.setProcInsId(monthly.getId());
+            flowCopy.setProcDefId(monthly.getId());
+            flowCopy.setUserId(dto.getId());
+            flowCopy.setId(id1);
+            flowCopy.setDelFlag(0);
+            SpringUtil.getBean(IFlowableApi.class).add(flowCopy);
         }
     }
     /**
@@ -465,6 +491,11 @@ public class MonthlyService {
      */
     public void delete(String id) {
         monthlyMapper.deleteById(id);
+        //删除项目进度表中的信息
+        jyProcessMapper.delete(new QueryWrapper<JyProcess>().eq("monthly_id",id));
+        //同时删除抄送信息
+        SpringUtil.getBean(IFlowableApi.class).remove(id);
+
     }
 
     /**

+ 11 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/controller/JyNotifyController.java

@@ -133,6 +133,17 @@ public class JyNotifyController {
         return ResponseEntity.ok ( notifyDTO);
     }
 
+    /**
+     * 获取评论列表
+     */
+    @GetMapping("refreshComments")
+    public ResponseEntity refreshComments(String id) {
+        //查询评论信息
+        List<PluginNotifyCommentsDTO> byNotifyId = notifyService.findCommentsByNotifyId(id);
+        //获取评论总数
+        return ResponseEntity.ok ( byNotifyId);
+    }
+
 
 
     @PostMapping("pushNotifyRecord")

+ 15 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/JyNotifyService.java

@@ -489,4 +489,19 @@ public class JyNotifyService extends ServiceImpl <JyNotifyMapper, JyNotify> {
         Integer count=jyNotifyLogMapper.findLogCount(id);
         return count;
     }
+
+    /**
+     * 查询评论信息
+     * @param id
+     * @return
+     */
+    public List<PluginNotifyCommentsDTO> findCommentsByNotifyId(String id) {
+        List<PluginNotifyCommentsDTO> commentsDTOList=commentsMapper.findNotifyAll(id);
+        if (CollectionUtil.isNotEmpty(commentsDTOList)){
+            commentsDTOList.stream().forEach(item -> {
+                item.setDeff(CommonUtils.timeDef(item.getCreateTime()));
+            });
+        }
+        return commentsDTOList;
+    }
 }

+ 1 - 2
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/JyNotifyDTO.java

@@ -42,8 +42,7 @@ public class JyNotifyDTO extends BaseDTO {
     /**
      * 类型
      */
-    @Query(type = QueryType.EQ)
-    @Size(min = 0, max = 1, message = "类型长度必须介于 0 和 1 之间")
+    @Query
     private String type;
     /**
      * 标题

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

@@ -1020,7 +1020,7 @@
 						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' and a.del_flag = '0' order by a.update_time DESC
+            where a.create_by_id=#{id} and (par.status != '5' or (par.status = '5' and par.audit_time >= DATE_SUB(CURDATE(),INTERVAL 2 MONTH))) and a.status = '5' and a.del_flag = '0' order by a.update_time DESC
     </select>
 
 

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

@@ -103,4 +103,13 @@ public class FlowCopyController {
         return ResponseEntity.ok ( "删除流程抄送成功" );
     }
 
+    /**
+     * 删除流程抄送
+     */
+    @GetMapping("remove")
+    public ResponseEntity remove(String procInsId) {
+
+        flowCopyService.remove(new QueryWrapper<FlowCopy>().eq("proc_ins_id",procInsId));
+        return ResponseEntity.ok ( "删除流程抄送成功" );
+    }
 }

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

@@ -21,7 +21,7 @@
     </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 into act_extension_cc(create_by_id,create_time,proc_ins_name,proc_ins_id,proc_def_id,update_by_id,update_time,id,user_id,del_flag) values (#{flow.createById},#{flow.createTime},#{flow.procInsName},#{flow.procInsId},#{flow.procDefId},#{flow.updateById},#{flow.updateTime},#{flow.id},#{flow.userId},#{flow.delFlag})
     </insert>