sangwenwei 1 year ago
parent
commit
c9a74d9677
18 changed files with 616 additions and 48 deletions
  1. 7 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/BorrowMapper.java
  2. 28 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/xml/BorrowMapper.xml
  3. 129 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/service/BorrowService.java
  4. 4 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/service/dto/BorrowDTO.java
  5. 1 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/DriveMaintainMapper.xml
  6. 13 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/domain/RegularApply.java
  7. 6 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/StaffUserInfoMapper.java
  8. 31 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/xml/StaffUserInfoMapper.xml
  9. 183 43
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/service/StaffUserInfoService.java
  10. 6 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/service/dto/StaffUserInfoDTO.java
  11. 11 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/knowledge/controller/KnowledgeShareInfoController.java
  12. 22 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/knowledge/service/KnowledgeShareInfoService.java
  13. 9 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/mapper/PaymentMapper.java
  14. 28 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/mapper/xml/PaymentMapper.xml
  15. 128 3
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/service/PaymentService.java
  16. 3 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/service/dto/PaymentDTO.java
  17. 4 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/controller/FlowCopyController.java
  18. 3 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/domain/FlowCopy.java

+ 7 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/BorrowMapper.java

@@ -10,6 +10,7 @@ import com.jeeplus.business.borrow.domain.BorrowMoney;
 import com.jeeplus.business.borrow.domain.Refund;
 import com.jeeplus.business.borrow.domain.RefundHis;
 import com.jeeplus.business.borrow.service.dto.BorrowDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -39,4 +40,10 @@ public interface BorrowMapper extends BaseMapper<BorrowMoney> {
     RefundHis getByRefundId(@Param("id")String id);
 
     BorrowDTO getByReId(@Param("id")String id);
+
+    List<WorkAttachmentInfo> findList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
+
+    List<WorkAttachmentInfo> findFiles(@Param("id") String id);
 }

+ 28 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/xml/BorrowMapper.xml

@@ -218,6 +218,34 @@ WHERE
 	 and a.del_flag = '0'
     </select>
 
+    <select id="findList" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+        SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+    </select>
+    <select id="findIsExit" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+    </select>
+
+    <select id="findFiles" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+	</select>
+
 
 
 </mapper>

+ 129 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/service/BorrowService.java

@@ -1,6 +1,7 @@
 package com.jeeplus.business.borrow.service;
 
 import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -19,12 +20,14 @@ import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoBorrow
 import com.jeeplus.business.reimbursement.mapper.JyReimbursementInfoBorrowMapper;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
 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.*;
@@ -145,6 +148,15 @@ public class BorrowService {
      */
     public BorrowDTO findById(String id) {
         BorrowDTO borrowDTO=borrowMapper.findById(id);
+
+        // 查询附件信息
+        List<WorkAttachmentInfo> files = borrowMapper.findFiles(id);
+        if (CollectionUtils.isNotEmpty(files)) {
+            for (WorkAttachmentInfo i : files) {
+                i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+            }
+        }
+        borrowDTO.setFiles(files);
         return borrowDTO;
     }
 
@@ -189,9 +201,54 @@ public class BorrowService {
         refund.setFinalMoney(borrowDTO.getMoneyLower());
         refundMapper.insert(refund);
 
+        // 保存附件列表信息
+        if (CollectionUtils.isNotEmpty(borrowDTO.getFiles())) {
+            saveFiles(borrowDTO.getFiles(), userDTO, id);
+        }
+
         return id;
     }
 
+    /**
+     * 保存附件信息
+     * @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 (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("borrowMoney");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+//            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            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++;
+        }
+    }
+
     private String update(BorrowDTO borrowDTO){
         //获取当前登录人信息
         UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
@@ -203,9 +260,73 @@ public class BorrowService {
         borrowMoney.setFinalMoney(borrowDTO.getMoneyLower());
         borrowMapper.updateById(borrowMoney);
 
+        // 修改附件信息列表
+        if (CollectionUtils.isNotEmpty(borrowDTO.getFiles())) {
+            updateFiles(borrowDTO.getFiles(), userDTO, borrowDTO.getId());
+        }
+
         return borrowDTO.getId();
     }
 
+    /**
+     * 修改附件信息
+     * @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 = borrowMapper.findList(id);
+        if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+//                    ossServiceMapper.deleteById(i.getId());
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = borrowMapper.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 (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("borrowMoney");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
 
     /**
      * 根据id修改状态
@@ -407,6 +528,14 @@ public class BorrowService {
      */
     public BorrowDTO getByReId(String id) {
         BorrowDTO borrowDTO=borrowMapper.getByReId(id);
+        // 查询附件信息
+        List<WorkAttachmentInfo> files = borrowMapper.findFiles(id);
+        if (CollectionUtils.isNotEmpty(files)) {
+            for (WorkAttachmentInfo i : files) {
+                i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+            }
+        }
+        borrowDTO.setFiles(files);
         return borrowDTO;
     }
 }

+ 4 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/service/dto/BorrowDTO.java

@@ -2,9 +2,11 @@ package com.jeeplus.business.borrow.service.dto;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 @Data
 public class BorrowDTO extends BaseEntity {
@@ -89,4 +91,6 @@ public class BorrowDTO extends BaseEntity {
 
     private String boMoney;
 
+    private List<WorkAttachmentInfo> files;
+
 }

+ 1 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/DriveMaintainMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.jeeplus.business.drive.mapper.DriveMaintainMapper">
 
     <select id="findPageList" resultType="com.jeeplus.business.drive.service.dto.DriveMaintainDTO">
-        select
+        select distinct
             a.id,
             a.create_by_id,
             a.create_time,

+ 13 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/domain/RegularApply.java

@@ -1,9 +1,16 @@
 package com.jeeplus.business.humanResources.domain;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 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
 @TableName("jy_regular_apply")
@@ -24,10 +31,16 @@ public class RegularApply extends BaseEntity {
     private String reason;
     //入职信息id
     private String infoId;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
 
     @TableField(exist = false)
     private String createName;
     @TableField(exist = false)
     private String officeName;
 
+    @TableField(exist = false)
+    private List<WorkAttachmentInfo> files; //附件
+
 }

+ 6 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/StaffUserInfoMapper.java

@@ -31,4 +31,10 @@ public interface StaffUserInfoMapper extends BaseMapper<StaffUserInfo> {
     void updateStatusByApplyId(@Param("id")String id, @Param("status")String status);
     @InterceptorIgnore(tenantLine = "true")
     List<StaffUserInfoDTO> getList();
+
+    List<WorkAttachmentInfo> findList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
+
+    List<WorkAttachmentInfo> findFiles(@Param("id") String id);
 }

+ 31 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/xml/StaffUserInfoMapper.xml

@@ -54,6 +54,9 @@
             ra.proc_ins_id as procInsIdApply,
             ra.process_definition_id as procDefIdApply,
             ra.status as applyStatus,
+            ra.is_pass,
+            ra.is_employ,
+            ra.is_postpone,
             art2.ID_ as task_id_apply
         from staff_user_info a
         left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
@@ -226,6 +229,34 @@
     where a.on_job_status = '1'
     </select>
 
+    <select id="findList" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+        SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+    </select>
+    <select id="findIsExit" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+    </select>
+
+    <select id="findFiles" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+	</select>
+
 
 
 </mapper>

+ 183 - 43
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/service/StaffUserInfoService.java

@@ -29,6 +29,7 @@ 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.*;
@@ -359,6 +360,15 @@ public class StaffUserInfoService {
      */
     public RegularApply findByApplyId(String id) {
         RegularApply regularApply=staffUserInfoMapper.findByApplyId(id);
+        // 查询附件信息
+        List<WorkAttachmentInfo> files = staffUserInfoMapper.findFiles(id);
+        if (CollectionUtils.isNotEmpty(files)) {
+            for (WorkAttachmentInfo i : files) {
+                i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+            }
+            regularApply.setFiles(files);
+        }
+
         return regularApply;
     }
 
@@ -368,6 +378,21 @@ public class StaffUserInfoService {
      * @return
      */
     public RegularApply saveApplyForm(RegularApply regularApply) {
+        RegularApply applyId = findByApplyId(regularApply.getId());
+        if ("2".equals(regularApply.getStatus())){
+            if (ObjectUtil.isNotEmpty(applyId)){
+                //判断此次转正申请是否是第一次发起
+                //不是第一次发起则清空对应的内容并删除附件
+                if ("5".equals(applyId.getStatus()) && "1".equals(applyId.getIsPass()) && "0".equals(applyId.getIsEmploy()) && "0".equals(applyId.getIsPostpone())){
+                    applyId.setIsEmploy("");
+                    applyId.setIsPass("");
+                    applyId.setIsPostpone("");
+                    applyId.setReason("");
+                    regularApplyMapper.updateById(applyId);
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(applyId.getId());
+                }
+            }
+        }
         //获取当前登录人信息
         UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
         RegularApply apply = new RegularApply();
@@ -376,70 +401,185 @@ public class StaffUserInfoService {
         apply.setUpdateById(userDTO.getId());
         if (StringUtils.isNotBlank(regularApply.getId())){
             regularApplyMapper.updateById(apply);
+            // 修改附件信息列表
+            if (CollectionUtils.isNotEmpty(regularApply.getFiles())) {
+                updateFiles(regularApply.getFiles(), userDTO, apply.getId());
+            }
         }else {
+            apply.setId(UUID.randomUUID().toString().replace("-",""));
             regularApplyMapper.insert(apply);
+            // 保存附件列表信息
+            if (CollectionUtils.isNotEmpty(regularApply.getFiles())) {
+                saveFiles(regularApply.getFiles(), userDTO, apply.getId());
+            }
         }
-        RegularApply applyId = findByApplyId(regularApply.getId());
-        //查询入职表中的信息
-        StaffUserInfoDTO infoDTO = findById(applyId.getInfoId());
-        //判断是否通过
-        if (StringUtils.isNotBlank(regularApply.getIsPass()) ){
-            if (regularApply.getIsPass().equals("1")){
-                //不通过则去判断是否留用
-                if (StringUtils.isNotBlank(regularApply.getIsEmploy())){
-                    //不通过也不留用同时状态为5 则将该员工账号冻结
-                    if (regularApply.getIsPass().equals("1")&& regularApply.getIsEmploy().equals("1") && regularApply.getStatus().equals("5")){
-                        UserDTO dto = new UserDTO();
-                        dto.setLoginFlag("0");
-                        dto.setId(infoDTO.getUserId());
-                        SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto);
-                    }
-                    if (regularApply.getIsPass().equals("1") && regularApply.getIsEmploy().equals("0") && regularApply.getStatus().equals("5")){
-                        //不通过  留用  但发起人驳回的情况下获取当前登录人所属岗位是否是人事部  若是人事部则冻结账号
-                        for (PostDTO postDTO : userDTO.getPostDTOList()) {
-                            if ("人事部".equals(postDTO.getId()) && regularApply.getStatus().equals("5")){
+        if(StringUtils.isNotBlank(regularApply.getId())){
+            if (ObjectUtil.isNotEmpty(applyId)){
+                //查询入职表中的信息
+                StaffUserInfoDTO infoDTO = findById(applyId.getInfoId());
+                //判断是否通过
+                if (StringUtils.isNotBlank(regularApply.getIsPass()) ){
+                    if (regularApply.getIsPass().equals("1")){
+                        //不通过则去判断是否留用
+                        if (StringUtils.isNotBlank(regularApply.getIsEmploy())){
+                            //不通过也不留用同时状态为5 则将该员工账号冻结
+                            if (regularApply.getIsPass().equals("1")&& regularApply.getIsEmploy().equals("1") && regularApply.getStatus().equals("5")){
                                 UserDTO dto = new UserDTO();
                                 dto.setLoginFlag("0");
                                 dto.setId(infoDTO.getUserId());
                                 SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto);
-                                break;
-                            }else if ("分管领导".equals(postDTO.getId()) && regularApply.getStatus().equals("5")){
-                                //否则的话则顺延一个月
-                                if (regularApply.getIsPostpone().equals("0")){
-                                    StaffUserInfo staffUserInfo = new StaffUserInfo();
-                                    staffUserInfo.setId(applyId.getInfoId());
-                                    //获取到原本的试用期限
-                                    int parseInt = Integer.parseInt(infoDTO.getTimeLimit());
-                                    //顺延一个月
-                                    int limit = parseInt+1;
-                                    staffUserInfo.setTimeLimit(limit+"");
-                                    //修改员工信息
-                                    staffUserInfoMapper.updateById(staffUserInfo);
+                            }
+                            if (regularApply.getIsPass().equals("1") && regularApply.getIsEmploy().equals("0") && regularApply.getStatus().equals("5")){
+                                //不通过  留用  但发起人驳回的情况下获取当前登录人所属岗位是否是人事部  若是人事部则冻结账号
+                                for (PostDTO postDTO : userDTO.getPostDTOList()) {
+                                    if ("人事部".equals(postDTO.getId()) && regularApply.getStatus().equals("5")){
+                                        UserDTO dto = new UserDTO();
+                                        dto.setLoginFlag("0");
+                                        dto.setId(infoDTO.getUserId());
+                                        SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto);
+                                        break;
+                                    }else if ("分管领导".equals(postDTO.getId()) && regularApply.getStatus().equals("5")){
+                                        //否则的话则顺延一个月
+                                        if (regularApply.getIsPostpone().equals("0")){
+                                            StaffUserInfo staffUserInfo = new StaffUserInfo();
+                                            staffUserInfo.setId(applyId.getInfoId());
+                                            //获取到原本的试用期限
+                                            int parseInt = Integer.parseInt(infoDTO.getTimeLimit());
+                                            //顺延一个月
+                                            int limit = parseInt+1;
+                                            staffUserInfo.setTimeLimit(limit+"");
+                                            //修改员工信息
+                                            staffUserInfoMapper.updateById(staffUserInfo);
+                                        }
+                                    }
                                 }
+
+
                             }
-                        }
 
+                        }
+                    }else {
+                        if (regularApply.getStatus().equals("5")){
+                            //将员工状态改为正式
+                            StaffUserInfo staffUserInfo = new StaffUserInfo();
+                            staffUserInfo.setOnJobStatus("2");
+                            staffUserInfo.setId(applyId.getInfoId());
+                            staffUserInfoMapper.updateById(staffUserInfo);
+                        }
 
                     }
 
                 }
-            }else {
-                if (regularApply.getStatus().equals("5")){
-                    //将员工状态改为正式
-                    StaffUserInfo staffUserInfo = new StaffUserInfo();
-                    staffUserInfo.setOnJobStatus("2");
-                    staffUserInfo.setId(applyId.getInfoId());
-                    staffUserInfoMapper.updateById(staffUserInfo);
-                }
-
             }
-
         }
 
+
+
+
         return apply;
     }
 
     /**
+     * 修改附件信息
+     * @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 = staffUserInfoMapper.findList(id);
+        if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+//                    ossServiceMapper.deleteById(i.getId());
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = staffUserInfoMapper.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 (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("regular");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void 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 (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("regular");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+//            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            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修改转正状态
      * @param regularApply
      */

+ 6 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/service/dto/StaffUserInfoDTO.java

@@ -29,7 +29,6 @@ public class StaffUserInfoDTO extends BaseEntity {
      * 用户id
      */
     @ExcelIgnore
-
     private String userId;
     @Excel(name = "姓名",width = 25)
     private String name;                //姓名
@@ -166,6 +165,12 @@ public class StaffUserInfoDTO extends BaseEntity {
     private String taskIdApply;
     private String applyId;
     private String applyStatus;
+    //是否通过
+    private String isPass;
+    //是否留用
+    private String isEmploy;
+    //是否顺延
+    private String isPostpone;
 
 
 

+ 11 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/knowledge/controller/KnowledgeShareInfoController.java

@@ -13,6 +13,7 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.List;
 
 @RestController
 @Api("/知识分享")
@@ -82,4 +83,14 @@ public class KnowledgeShareInfoController {
         return ResponseEntity.ok(s);
     }
 
+    /**
+     * 查询评论
+     */
+    @GetMapping("/getComments")
+    @ApiOperation(value = "查询评论")
+    public ResponseEntity<KnowledgeShareInfoDto> getComments(String id){
+        KnowledgeShareInfoDto list=service.getComments(id);
+        return ResponseEntity.ok(list);
+    }
+
 }

+ 22 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/knowledge/service/KnowledgeShareInfoService.java

@@ -332,4 +332,26 @@ public class KnowledgeShareInfoService {
         long min = def / (1000 * 60);
         return min + "分钟前";
     }
+
+    /**
+     * 查询评论
+     * @param id
+     * @return
+     */
+    public KnowledgeShareInfoDto getComments(String id) {
+        KnowledgeShareInfoDto knowledgeShareInfoDto = new KnowledgeShareInfoDto();
+        // 查询回复记录
+        LambdaQueryWrapper<KnowledgeShareComment> commentWrapper = new LambdaQueryWrapper<>();
+        commentWrapper.eq(KnowledgeShareComment::getDetailId, id).eq(BaseEntity::getDelFlag, 0).orderByDesc(BaseEntity::getCreateTime);
+        List<KnowledgeShareComment> comments = commentMapper.selectList(commentWrapper);
+        if (CollectionUtils.isNotEmpty(comments)) {
+            comments.stream().forEach(i -> {
+                UserDTO commentUser = SpringUtil.getBean(IUserApi.class).getById(i.getUserId());
+                i.setUserId(commentUser.getName());
+                i.setDeff(timeDef(i.getCreateTime()));
+            });
+        }
+        knowledgeShareInfoDto.setComments(comments);
+        return knowledgeShareInfoDto;
+    }
 }

+ 9 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/mapper/PaymentMapper.java

@@ -9,9 +9,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.business.borrow.service.dto.BorrowDTO;
 import com.jeeplus.business.payment.domain.Payment;
 import com.jeeplus.business.payment.service.dto.PaymentDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 @Mapper
 public interface PaymentMapper extends BaseMapper<Payment> {
 
@@ -24,4 +27,10 @@ public interface PaymentMapper extends BaseMapper<Payment> {
     void updateInfoById(@Param("payment") Payment payment);
     @InterceptorIgnore(tenantLine = "true")
     IPage<Payment> listByUserId(@Param(Constants.WRAPPER)QueryWrapper<Payment> queryWrapper, Page<BorrowDTO> page);
+
+    List<WorkAttachmentInfo> findList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
+
+    List<WorkAttachmentInfo> findFiles(@Param("id") String id);
 }

+ 28 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/mapper/xml/PaymentMapper.xml

@@ -110,4 +110,32 @@
         ${ew.customSqlSegment}
     </select>
 
+    <select id="findList" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+        SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+    </select>
+    <select id="findIsExit" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+    </select>
+
+    <select id="findFiles" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+	</select>
+
 </mapper>

+ 128 - 3
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/service/PaymentService.java

@@ -1,8 +1,10 @@
 package com.jeeplus.business.payment.service;
 
 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.borrow.domain.BorrowMoney;
@@ -20,17 +22,17 @@ import com.jeeplus.business.workClientInfo.mapper.JyWorkClientInfoMapper;
 import com.jeeplus.business.workClientInfo.service.JyWorkClientService;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
 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.ArrayList;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
 
 @Service
 public class PaymentService {
@@ -118,6 +120,15 @@ public class PaymentService {
             }
             paymentDTO.setProjectDTOList(projects);
         }
+        // 查询附件信息
+        List<WorkAttachmentInfo> files = paymentMapper.findFiles(id);
+        if (CollectionUtils.isNotEmpty(files)) {
+            for (WorkAttachmentInfo i : files) {
+                i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+            }
+        }
+        paymentDTO.setFiles(files);
+
         return paymentDTO;
     }
 
@@ -166,9 +177,54 @@ public class PaymentService {
         payment.setStatus(paymentDTO.getStatus());
         payment.setRemarks(paymentDTO.getRemarks());//摘要
         paymentMapper.insert(payment);
+
+        // 保存附件列表信息
+        if (CollectionUtils.isNotEmpty(paymentDTO.getFiles())) {
+            saveFiles(paymentDTO.getFiles(), userDTO, id);
+        }
         return id;
     }
 
+    /**
+     * 保存附件信息
+     * @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 (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("paymentMoney");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+//            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            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++;
+        }
+    }
+
     private String update(PaymentDTO paymentDTO){
         Payment payment = new Payment();
         //获取项目id
@@ -197,10 +253,79 @@ public class PaymentService {
         payment.setRemarks(paymentDTO.getRemarks());//摘要
         paymentMapper.updateById(payment);
 
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+
+        // 修改附件信息列表
+        if (CollectionUtils.isNotEmpty(paymentDTO.getFiles())) {
+            updateFiles(paymentDTO.getFiles(), userDTO, paymentDTO.getId());
+        }
+
         return paymentDTO.getId();
     }
 
     /**
+     * 修改附件信息
+     * @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 = paymentMapper.findList(id);
+        if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+//                    ossServiceMapper.deleteById(i.getId());
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = paymentMapper.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 (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("paymentMoney");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+
+    /**
      * 根据id修改状态
      * @param paymentDTO
      */

+ 3 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/service/dto/PaymentDTO.java

@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.business.project.domain.JyProject;
 import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -115,6 +116,8 @@ public class PaymentDTO extends BaseEntity {
     @Excel(name = "付款状态",width = 25)
     private String paymentStatus;
 
+    private List<WorkAttachmentInfo> files;
+
 
 
 }

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

@@ -11,6 +11,7 @@ import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.extension.domain.FlowCopy;
 import com.jeeplus.extension.service.FlowCopyService;
 import com.jeeplus.extension.service.dto.FlowCopyDTO;
+import com.jeeplus.flowable.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
@@ -38,6 +39,9 @@ public class FlowCopyController {
     @GetMapping("list")
     public ResponseEntity list(FlowCopyDTO flowCopyDTO, Page <FlowCopyDTO> page) throws Exception {
         QueryWrapper <FlowCopyDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( flowCopyDTO, FlowCopyDTO.class );
+        if (StringUtils.isNotBlank(flowCopyDTO.getCreateBy().getName())){
+            queryWrapper.like("createBy.name",flowCopyDTO.getCreateBy().getName());
+        }
         IPage <FlowCopyDTO> result = flowCopyService.findPage ( page, queryWrapper );
         return ResponseEntity.ok ( result );
     }

+ 3 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/extension/domain/FlowCopy.java

@@ -6,6 +6,7 @@ package com.jeeplus.extension.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.service.dto.UserDTO;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -48,6 +49,8 @@ public class FlowCopy extends BaseEntity {
      */
     private String taskName;
 
+    private UserDTO createBy;
+
     public FlowCopy() {
         super ( );
     }