Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

sangwenwei 3 kuukautta sitten
vanhempi
commit
b823680170
12 muutettua tiedostoa jossa 109 lisäystä ja 149 poistoa
  1. 2 3
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/mapper/CwReimbursementInfoMapper.java
  2. 7 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/mapper/xml/CwReimbursementInfoMapper.xml
  3. 11 55
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/service/CwReimbursementInfoService.java
  4. 2 1
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportCancellApplyArchived/mapper/xml/ReportCancellApplyArchivedMapper.xml
  5. 6 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportCancellApplyArchived/service/dto/ArchivedReportInfoDto.java
  6. 7 4
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/controller/HandoverController.java
  7. 2 3
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/domain/HandoverProject.java
  8. 21 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/domain/dto/HandoverProjectDto.java
  9. 6 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/mapper/HandoverProjectMapper.java
  10. 2 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/mapper/xml/HandoverProjectMapper.xml
  11. 16 58
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverProjectService.java
  12. 27 23
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverService.java

+ 2 - 3
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/mapper/CwReimbursementInfoMapper.java

@@ -30,7 +30,6 @@ public interface CwReimbursementInfoMapper extends BaseMapper<CwReimbursementInf
 
     IPage<RetureListDto> findList (Page<RetureListDto> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("officeIds")String officeIds);
 
-    IPage<RetureListDto> findList2 (Page<RetureListDto> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("officeIds")String officeIds);
 
     List<WorkAttachmentInfo> findFiles(@Param("id") String id);
 
@@ -40,9 +39,9 @@ public interface CwReimbursementInfoMapper extends BaseMapper<CwReimbursementInf
 
     List<TreeUserDto> findUserList(@Param("name") String name);
 
-    List<TreeUserDto> findOfficeListByTenantId(@Param("tenantId") String tenantId);
+    List<TreeUserDto> findOfficeListByTenantId(@Param("tenantId") String tenantId,@Param("companyId") String companyId);
 
-    List<TreeUserDto> findUserListByTenantId(@Param("name") String name,@Param("tenantId") String tenantId);
+    List<TreeUserDto> findUserListByTenantId(@Param("name") String name,@Param("tenantId") String tenantId,@Param("companyId") String companyId);
 
     List<RetureListDto> findExportList (@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
 

+ 7 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/mapper/xml/CwReimbursementInfoMapper.xml

@@ -263,6 +263,9 @@
 		<if test="tenantId != null and tenantId != ''">
 			and tenant_id = #{tenantId}
 		</if>
+		<if test="companyId != null and companyId != ''">
+			and (id = #{companyId} or parent_ids like concat ('%',#{companyId},'%'))
+		</if>
 	</select>
 	<select id="findUserListByTenantId"
 			resultType="com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.TreeUserDto">
@@ -280,9 +283,13 @@
 		<if test="tenantId != null and tenantId != ''">
 			and a.tenant_id = #{tenantId}
 		</if>
+		<if test="companyId != null and companyId != ''">
+			and (b.id = #{companyId} or b.parent_ids like concat ('%',#{companyId},'%'))
+		</if>
 		<if test="name != null and name != ''">
 			AND a.name LIKE CONCAT('%', #{name}, '%')
 		</if>
+
 	</select>
 	<select id="findExportList"
 			resultType="com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.RetureListDto">

+ 11 - 55
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/service/CwReimbursementInfoService.java

@@ -1231,12 +1231,12 @@ public class CwReimbursementInfoService {
         List<TreeUserDto> list = new ArrayList<>();
         UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
         // 查询部门
-        List<TreeUserDto> officeList = infoMapper.findOfficeListByTenantId(userDTO.getTenantDTO().getId());
+        List<TreeUserDto> officeList = infoMapper.findOfficeListByTenantId(userDTO.getTenantDTO().getId(),userDTO.getCompanyDTO().getId());
         if (CollectionUtils.isNotEmpty(officeList)) {
             list.addAll(officeList);
         }
         // 查询用户
-        List<TreeUserDto> userList = infoMapper.findUserListByTenantId(name,userDTO.getTenantDTO().getId());
+        List<TreeUserDto> userList = infoMapper.findUserListByTenantId(name,userDTO.getTenantDTO().getId(),userDTO.getCompanyDTO().getId());
         if (CollectionUtils.isNotEmpty(userList)) {
             list.addAll(userList);
         }
@@ -1946,71 +1946,27 @@ public class CwReimbursementInfoService {
          */
         queryWrapper.eq("a.del_flag", 0);
         queryWrapper.notIn("a.business_flag",'0');
-        // 报销人
+// 报销人
         if (StringUtils.isNotEmpty(dto.getReimBy())) {
-            queryWrapper.apply("( b.user_id = {0} OR us.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
-            queryWrapper.or().apply("( b2.user_id = {0} OR us2.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
-            queryWrapper.or().apply("( b3.user_id = {0} OR us3.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
-            queryWrapper.or().apply("( b4.user_id = {0} OR us4.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
-            queryWrapper.or().apply("( b5.user_id = {0} OR us5.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
-
+            queryWrapper.apply("((b.user_id = {0} OR b2.user_id = {0} OR b3.user_id = {0} OR b4.user_id = {0} OR b5.user_id = {0}))", dto.getReimBy());
         }
-        // 报销状态
-        if (StringUtils.isNotEmpty(dto.getType())) {
-            queryWrapper.eq("a.type", dto.getType());
-        }
-        // 报销部门
-        if (StringUtils.isNotEmpty(dto.getDepartment())) {
-            queryWrapper.apply("( b.dept_id = {0} OR so.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
-            queryWrapper.or().apply("( b2.dept_id = {0} OR so2.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
-            queryWrapper.or().apply("( b3.dept_id = {0} OR so3.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
-            queryWrapper.or().apply("( b4.dept_id = {0} OR so4.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
-            queryWrapper.or().apply("( b5.dept_id = {0} OR so5.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
 
-        }
-        // 报销类别
+// 报销类别
         if (StringUtils.isNotEmpty(dto.getRemiType())) {
-            queryWrapper.apply(" (b.type_id = {0} OR t.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.apply(" ((b.type_id = {0} OR t.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
             queryWrapper.or().apply(" (b2.type_id = {0} OR t2.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
             queryWrapper.or().apply(" (b3.type_id = {0} OR t3.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
             queryWrapper.or().apply(" (b4.type_id = {0} OR t4.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
-            queryWrapper.or().apply(" (b5.type_id = {0} OR t5.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b5.type_id = {0} OR t5.name LIKE {1})) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
 
         }
 
-        // 报销项状态
-        if (com.jeeplus.utils.StringUtils.isNotEmpty(dto.getReimbursementType())) {
-            queryWrapper.eq("a.reimbursement_type", dto.getReimbursementType());
-        }
-        // 付款状态
-        if (com.jeeplus.utils.StringUtils.isNotEmpty(dto.getPaymentStatus())) {
-            queryWrapper.like("a.payment_status", dto.getPaymentStatus());
-        }
+
+
         StringBuilder officeIds = new StringBuilder();
         List<String> manageOfficeIdList= Lists.newArrayList();
-        IPage<RetureListDto> list = infoMapper.findList(page, queryWrapper, officeIds.toString());
-        list.getRecords().stream().forEach(item -> {
-            if (StringUtils.isNotBlank(item.getSourceType()) && "1".equals(item.getSourceType())) { //项目报销
-                if (StringUtils.isNotBlank(item.getProjectId())) {
-                    String proName = selectProjectByIds(item.getProjectId());
-                    item.setProjectName(proName);
-                }
-                if (StringUtils.isBlank(item.getDeptName())){
-                    String name = infoMapper.findUserById(item.getProjectUser());
-                    item.setName(name);
-                    String office = infoMapper.findOfficeById(item.getProjectOffice());
-                    item.setDeptName(office);
-                }
-            }
-            if (StringUtils.isNotBlank(item.getSourceType()) && "3".equals(item.getSourceType())){//报告报销
-                if (StringUtils.isBlank(item.getDeptName())){
-                    String name = infoMapper.findUserById(item.getReportUser());
-                    item.setName(name);
-                    String office = infoMapper.findOfficeById(item.getReportOffice());
-                    item.setDeptName(office);
-                }
-            }
-        });
+        IPage<RetureListDto> list = infoMapper.computerList(page, queryWrapper, officeIds.toString());
+//
         return list;
     }
 }

+ 2 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportCancellApplyArchived/mapper/xml/ReportCancellApplyArchivedMapper.xml

@@ -71,7 +71,8 @@
 				c.document_no,
 				c.office_id,
 				d.project_number as projectNumber,
-				d.project_name,
+                d.project_name,
+                d.id as projectId,
 				d.project_master_id,
 				e.name as departmentName,
 				f.name as userName,

+ 6 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportCancellApplyArchived/service/dto/ArchivedReportInfoDto.java

@@ -29,6 +29,12 @@ public class ArchivedReportInfoDto extends BaseDTO {
     private String projectNumber;
 
     /**
+     * 项目编号
+     */
+    @TableField(exist = false)
+    private String projectId;
+
+    /**
      * 创建人
      */
     @Excel(name = "创建人",width = 10,orderNum = "8")

+ 7 - 4
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/controller/HandoverController.java

@@ -1,8 +1,12 @@
 package com.jeeplus.human.depart.handover.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.human.depart.handover.domain.Handover;
 import com.jeeplus.human.depart.handover.domain.HandoverProject;
+import com.jeeplus.human.depart.handover.domain.dto.HandoverProjectDto;
 import com.jeeplus.human.depart.handover.service.HandoverProjectService;
 import com.jeeplus.human.depart.handover.service.HandoverService;
 import com.jeeplus.logging.annotation.ApiLog;
@@ -92,13 +96,12 @@ public class HandoverController {
 
     /**
      * 查询已固定的项目信息
-     * @param id
      * @return
      */
     @ApiOperation(value = "查询已固定的项目信息")
     @GetMapping("/findProjectList")
-    public ResponseEntity<List<HandoverProject>> findProjectList(@RequestParam String id) throws Exception{
-        List<HandoverProject> list = handoverProjectService.findProjectList(id);
-        return ResponseEntity.ok(list);
+    public ResponseEntity<IPage<HandoverProject> > findProjectList(Page<HandoverProject> page, HandoverProjectDto handoverProjectDto) throws Exception{
+        IPage<HandoverProject> projectList = handoverProjectService.findProjectList(page, handoverProjectDto);
+        return ResponseEntity.ok(projectList);
     }
 }

+ 2 - 3
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/domain/HandoverProject.java

@@ -13,7 +13,8 @@ import lombok.Data;
 @Data
 @TableName("human_resources_depart_handover_project")
 public class HandoverProject extends BaseEntity {
-
+    //    项目ID
+    private String projectId;
     //    项目编号
     private String projectNumber;
     //    项目名称
@@ -29,8 +30,6 @@ public class HandoverProject extends BaseEntity {
     //创建人
     private String createProjectUserId;
 
-
-
     @TableField(exist = false)
     private  String createName;
 

+ 21 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/domain/dto/HandoverProjectDto.java

@@ -0,0 +1,21 @@
+package com.jeeplus.human.depart.handover.domain.dto;
+
+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;
+
+/**
+ * 离职DTO
+ * @author 王强
+ * @version 1.0
+ * @date 2023-10-27 9:00
+ */
+@Data
+public class HandoverProjectDto extends BaseEntity {
+    private String id;
+    private String type;
+}

+ 6 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/mapper/HandoverProjectMapper.java

@@ -1,9 +1,14 @@
 package com.jeeplus.human.depart.handover.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.human.depart.handover.domain.Handover;
 import com.jeeplus.human.depart.handover.domain.HandoverProject;
+import com.jeeplus.human.depart.handover.domain.dto.HandoverProjectDto;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -24,7 +29,7 @@ public interface HandoverProjectMapper extends BaseMapper<HandoverProject> {
      * 获取固定项目信息
      * @return
      */
-    List<HandoverProject>  findProjectList(@Param("id") String id);
+    IPage<HandoverProject> findProjectList(Page<HandoverProject> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
 
 }
 

+ 2 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/mapper/xml/HandoverProjectMapper.xml

@@ -29,6 +29,7 @@
             a.id,
             a.create_time as createTime,
             a.create_by_id as createById,
+            a.project_id as projectId,
             a.project_number as projectNumber,
             a.project_name as projectName,
             a.report_code as reportCode,
@@ -38,6 +39,6 @@
             b.name as createName
             FROM human_resources_depart_handover_project a
             LEFT JOIN sys_user b on a.create_project_user_id = b.id
-            where a.handover_id = #{id} and a.del_flag = 0
+                ${ew.customSqlSegment}
     </select>
 </mapper>

+ 16 - 58
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverProjectService.java

@@ -1,68 +1,18 @@
 package com.jeeplus.human.depart.handover.service;
 
-import cn.hutool.core.collection.CollectionUtil;
-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.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.google.common.collect.Lists;
-import com.jeeplus.common.TokenProvider;
-import com.jeeplus.flowable.feign.IAssessApi;
-import com.jeeplus.flowable.feign.IFinanceApi;
-import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.human.depart.handover.domain.*;
-import com.jeeplus.human.depart.handover.mapper.HandoverMapper;
+import com.jeeplus.human.depart.handover.domain.dto.HandoverProjectDto;
 import com.jeeplus.human.depart.handover.mapper.HandoverProjectMapper;
-import com.jeeplus.human.depart.registration.domain.DepartRegistration;
-import com.jeeplus.human.depart.registration.mapper.DepartMapper;
-import com.jeeplus.human.enrollment.enrollmentRegistration.utils.HunamFreemarkerUtil;
-import com.jeeplus.human.signature.entity.Action;
-import com.jeeplus.human.signature.entity.Location;
-import com.jeeplus.human.signature.entity.SignatorieInfo;
-import com.jeeplus.human.signature.entity.SignatureContract;
-import com.jeeplus.human.signature.utils.Global;
-import com.jeeplus.human.signature.utils.SignaturePostUtil;
-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.PostDTO;
-import com.jeeplus.sys.service.dto.UserDTO;
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.pdfbox.pdmodel.PDDocument;
-import org.apache.pdfbox.pdmodel.PDPage;
-import org.apache.pdfbox.pdmodel.PDPageContentStream;
-import org.apache.pdfbox.pdmodel.common.PDRectangle;
-import org.apache.pdfbox.pdmodel.font.PDType0Font;
-import org.apache.pdfbox.pdmodel.graphics.state.RenderingMode;
-import org.apache.pdfbox.util.Matrix;
-import org.apache.poi.xwpf.usermodel.*;
-import org.springframework.beans.BeanUtils;
-import org.springframework.mock.web.MockMultipartFile;
+import com.jeeplus.utils.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
 
-import javax.annotation.Resource;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import java.io.*;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.time.LocalDate;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * @author 王强
@@ -73,10 +23,18 @@ import java.util.stream.Collectors;
 @Transactional
 public class HandoverProjectService extends ServiceImpl<HandoverProjectMapper, HandoverProject> {
 
-    public List<HandoverProject> findProjectList(String id) {
+    public IPage<HandoverProject> findProjectList(Page<HandoverProject> page, HandoverProjectDto handoverProjectDto) throws Exception{
+        QueryWrapper<HandoverProjectDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition(handoverProjectDto, HandoverProjectDto.class);
+        queryWrapper.eq("a.del_flag",0);
+        if(StringUtils.isNotEmpty(handoverProjectDto.getId())){
+            queryWrapper.eq("a.handover_id",handoverProjectDto.getId());
+        }
+        if(StringUtils.isNotEmpty(handoverProjectDto.getType())){
+            queryWrapper.eq("a.type",handoverProjectDto.getType());
+        }
         // 查询基础信息表
-        List<HandoverProject> list = baseMapper.findProjectList(id);
-        return list;
+        IPage<HandoverProject> projectList = baseMapper.findProjectList(page, queryWrapper);
+        return projectList;
     }
 
     public String  saveProject(List<HandoverProject> handoverProject) throws Exception {

+ 27 - 23
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverService.java

@@ -188,27 +188,31 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
         report.setUpdateTime(new Date());
 
         List<WorkAttachmentInfo> workAttachments = reportData.getWorkAttachments();
-        List<String> collect = workAttachments.stream().distinct().filter(item -> {
-            if (StringUtils.isNotBlank(item.getId())) {
-                return true;
-            }
-            return false;
-        }).map(WorkAttachmentInfo::getId).collect(Collectors.toList());
-        if (CollectionUtil.isNotEmpty(workAttachments)) {
-            if(CollectionUtil.isNotEmpty(collect)){
-                SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentIdNotInIds(reportData.getId(),collect);
-            }
-            workAttachments.stream().forEach(i -> i.setAttachmentId(reportData.getId()));
-            Map<String,String> map = new HashMap<>();
-            map.put("workAttachments",JSON.toJSONString(workAttachments));
-            map.put("currentToken", TokenProvider.getCurrentToken());
-            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveMsg2(map);
-        } else{
-            SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(reportData.getId());
+
+        if (!CollectionUtil.isEmpty(workAttachments)) {
+            List<String> collect = workAttachments.stream().distinct().filter(item -> {
+                if (StringUtils.isNotBlank(item.getId())) {
+                    return true;
+                }
+                return false;
+            }).map(WorkAttachmentInfo::getId).collect(Collectors.toList());
+            if (CollectionUtil.isNotEmpty(workAttachments)) {
+                if(CollectionUtil.isNotEmpty(collect)){
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentIdNotInIds(reportData.getId(),collect);
+                }
+                workAttachments.stream().forEach(i -> i.setAttachmentId(reportData.getId()));
+                Map<String,String> map = new HashMap<>();
+                map.put("workAttachments",JSON.toJSONString(workAttachments));
+                map.put("currentToken", TokenProvider.getCurrentToken());
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).saveMsg2(map);
+            } else{
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(reportData.getId());
 //            ossService.remove(new QueryWrapper<WorkAttachmentInfo>().lambda().eq(WorkAttachmentInfo::getAttachmentId,workClientInfo.getId()));
+            }
         }
-        mapper.updateById(report);
 
+        mapper.updateById(report);
+        Handover currentReportData = mapper.getById(report.getId());
         if (report.getType().equals("5")){
             String tenantId = "";
             //根据名称查询隶属公司部门
@@ -233,7 +237,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
             HandoverDraft draft = new HandoverDraft();
             String uid = UUID.randomUUID().toString().replace("-", "");
             draft.setId(uid);
-            draft.setCreateById(report.getCreateById());
+            draft.setCreateById(currentReportData.getCreateById());
             draft.setUpdateById(report.getUpdateById());
             draft.setProcessDefinitionId(procDefId);
             draft.setHandoverId(report.getId());
@@ -260,7 +264,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
             HandoverComputer computer = new HandoverComputer();
             String computerId = UUID.randomUUID().toString().replace("-", "");
             computer.setId(computerId);
-            computer.setCreateById(report.getCreateById());
+            computer.setCreateById(currentReportData.getCreateById());
             computer.setUpdateById(report.getUpdateById());
             computer.setProcessDefinitionId(computerProcDefId);
             computer.setHandoverId(report.getId());
@@ -288,7 +292,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
             HandoverAccounts accounts = new HandoverAccounts();
             String accountsId = UUID.randomUUID().toString().replace("-", "");
             accounts.setId(accountsId);
-            accounts.setCreateById(report.getCreateById());
+            accounts.setCreateById(currentReportData.getCreateById());
             accounts.setUpdateById(report.getUpdateById());
             accounts.setProcessDefinitionId(accountsProcDefId);
             accounts.setHandoverId(report.getId());
@@ -316,7 +320,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
             HandoverSocialSecurity socialSecurity = new HandoverSocialSecurity();
             String socialSecurityId = UUID.randomUUID().toString().replace("-", "");
             socialSecurity.setId(socialSecurityId);
-            socialSecurity.setCreateById(report.getCreateById());
+            socialSecurity.setCreateById(currentReportData.getCreateById());
             socialSecurity.setUpdateById(report.getUpdateById());
             socialSecurity.setProcessDefinitionId(socialSecurityProcDefId);
             socialSecurity.setHandoverId(report.getId());
@@ -345,7 +349,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
             HandoverImprest handoverImprest = new HandoverImprest();
             String handoverImprestId = UUID.randomUUID().toString().replace("-", "");
             handoverImprest.setId(handoverImprestId);
-            handoverImprest.setCreateById(report.getCreateById());
+            handoverImprest.setCreateById(currentReportData.getCreateById());
             handoverImprest.setUpdateById(report.getUpdateById());
             handoverImprest.setProcessDefinitionId(handoverImprestProcDefId);
             handoverImprest.setHandoverId(report.getId());