浏览代码

离职证明盖章功能处理

user5 1 年之前
父节点
当前提交
7ead28caed
共有 13 个文件被更改,包括 406 次插入18 次删除
  1. 1 0
      jeeplus-common/jeeplus-common-mybatis-plus/src/main/java/com/jeeplus/config/TenantLineHandlerImpl.java
  2. 1 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/domain/Handover.java
  3. 1 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/mapper/xml/HandoverMapper.xml
  4. 194 2
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverRecoveryService.java
  5. 105 9
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverService.java
  6. 12 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/controller/DepartRegistrationController.java
  7. 3 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/domain/DepartRegistration.java
  8. 2 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/mapper/DepartMapper.java
  9. 59 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/mapper/xml/DepartMapper.xml
  10. 13 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/service/DepartService.java
  11. 11 4
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/controller/HumanSignatureCallBackController.java
  12. 3 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/AreaController.java
  13. 1 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/AreaMapper.xml

+ 1 - 0
jeeplus-common/jeeplus-common-mybatis-plus/src/main/java/com/jeeplus/config/TenantLineHandlerImpl.java

@@ -78,6 +78,7 @@ public class TenantLineHandlerImpl implements TenantLineHandler {
                 || (tableName.startsWith ( "sys_user_" ))
                 || (tableName.startsWith ( "work_" ))
                 || (tableName.startsWith ( "zs_reimbursement_" ))
+                || (tableName.startsWith ( "human_" ))
                 || (tableName.startsWith ( "program_" ))) {
             return true;
         }

+ 1 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/domain/Handover.java

@@ -59,6 +59,7 @@ public class Handover extends BaseEntity {
     private String wordFilePath;         //生成的word文件的地址
     private String signatureContractId; //签章流程contractId
     private String signatureUrl;    //签章服务器签章文件存储路径
+    private String signatureFlag;    //离职证明是否签章(1:已签章,2:未签章(需线下盖章))
 
     @TableField(exist = false)
     private String arrivalDate;             //到岗日期

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

@@ -43,7 +43,7 @@
         select
         <include refid="Base_Column_List"></include>
         from human_resources_depart_handover a
-        where a.signature_contract_id = #{id} and a.del_flag = '0'
+        where a.signature_contract_id = #{signatureContractId} and a.del_flag = '0'
     </select>
 
     <update id="updateSignatureUrl">

+ 194 - 2
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverRecoveryService.java

@@ -1,8 +1,10 @@
 package com.jeeplus.human.depart.handover.service;
 
 import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.flowable.feign.IFlowableApi;
 import com.jeeplus.human.depart.handover.domain.Handover;
@@ -10,9 +12,17 @@ import com.jeeplus.human.depart.handover.domain.HandoverRecovery;
 import com.jeeplus.human.depart.handover.mapper.HandoverMapper;
 import com.jeeplus.human.depart.handover.mapper.HandoverRecoveryMapper;
 import com.jeeplus.human.enrollment.enrollmentRegistration.mapper.EnrollmentRegistrationMapper;
+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.IRoleApi;
 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.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
@@ -22,6 +32,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.io.File;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -34,6 +45,18 @@ import java.util.*;
 @Transactional
 public class HandoverRecoveryService extends ServiceImpl<HandoverRecoveryMapper, HandoverRecovery> {
 
+    private static final String HTTPTOP = Global.getConfig("signature_http_top");
+
+    /**
+     * 离职盖章流程id
+     */
+    private static String DIMISSIONID  = Global.getConfig("dimission_id");
+
+    /**
+     * 会计公司印章
+     */
+    private static String COMPANYROUNDSEALFINANCEID  = Global.getConfig("company_round_seal_finance_id");
+
     @Resource
     private HandoverRecoveryMapper recoveryMapper;
 
@@ -107,6 +130,11 @@ public class HandoverRecoveryService extends ServiceImpl<HandoverRecoveryMapper,
         if (report.getType().equals("5")){
             //根据用户id将在职状态改为离职
             Handover handover = handoverMapper.getById(report.getHandoverId());
+            //获取当前登录人信息
+            UserDTO createUserDTO = SpringUtil.getBean ( IUserApi.class ).getById(handover.getCreateById());
+
+            List<WorkAttachmentInfo> attachmentInfoList = SpringUtil.getBean ( IWorkAttachmentApi.class ).selectListByAttachmentId(handover.getId());
+
             registrationMapper.updateByUserId(handover.getCreateById());
             //发送通知给岗位【考勤统计人】
             PostDTO postInfo = SpringUtil.getBean(IPostApi.class).getPostDTOByName("考勤统计人");
@@ -131,20 +159,184 @@ public class HandoverRecoveryService extends ServiceImpl<HandoverRecoveryMapper,
             //发送通知给员工,可下载盖电子章的离职证明
             Map<String ,String > map2 = new HashMap<>();
 
+            if("1".equals(handover.getSignatureFlag())){
+                map2.put("title","离职交接审批完成,请点击下载离职证明");
+                map2.put("taskName","离职交接审批完成,请点击下载离职证明");
+            }else{
+                map2.put("title","离职交接审批完成,请点击下载离职证明,并到办公室进行盖章");
+                map2.put("taskName","离职交接审批完成,请点击下载离职证明,并到办公室进行盖章");
+                map2.put("dimissionProveUrl","离职交接审批完成,请点击下载离职证明");
+            }
+
+            if(attachmentInfoList.size()>0){
+                map2.put("dimissionProveUrl",attachmentInfoList.get(0).getUrl());
+            }else{
+                map2.put("dimissionProveUrl","");
+            }
             map2.put("taskId",uuid);
-            map2.put("title","离职交接审批完成,请点击下载离职证明");
+            map2.put("fileName",createUserDTO.getName() + "离职证明");
             map2.put("defId",report.getHandoverId());
-            map2.put("taskName","离职交接审批完成,请点击下载离职证明");
             map2.put("createUser",userDTO.getLoginName());
             map2.put("createTime",day);
             map2.put("noticeName",userName);
             map2.put("noticeId",handover.getCreateById());
             map2.put("createById",userDTO.getId());
             SpringUtil.getBean(IFlowableApi.class).add(map2);
+
+            //离职证明电子章处理
+            //对离职证明进行盖章操作
+            Map<String, Object> signatureContractIdMap = createSignatureContractId(handover.getWordFilePath());
+            boolean success = (boolean) signatureContractIdMap.get("success");
+            if(success){
+                handover.setSignatureContractId(signatureContractIdMap.get("contractId").toString());
+                handoverMapper.updateById(handover);
+            }else{
+                System.out.println(signatureContractIdMap);
+            }
         }
 
         return report;
     }
+    /**
+     * 生成并保存签章contractId 信息
+     * @param filePath 临时文件路径(需盖章文件)
+     * @return
+     */
+    public Map<String,Object> createSignatureContractId(String filePath){
+        Map<String,Object> map = new HashMap<String,Object>();
+
+        //获取文件生成的documentId
+        List<String> documentList = Lists.newArrayList();
+
+        try{
+            //将下载下来的文件转换为file文件
+            File srcFile = new File(filePath);
+            //截取文件后缀名
+            String substring = srcFile.getName().substring(srcFile.getName().lastIndexOf(".")+1, srcFile.getName().length());
+            if(!"doc".equals(substring.toLowerCase()) && !"docx".equals(substring.toLowerCase()) && !"pdf".equals(substring.toLowerCase())){
+                map.put("success",false);
+                map.put("message","请上传doc、docx或者pdf的文件进行签章操作");
+                return map;
+            }
+            //获取真签单的documentId
+            HashMap hashMap = new SignaturePostUtil().getDocument(srcFile);
+            String code = hashMap.get("code").toString();
+            String documentId = "";
+            if("0".equals(code)){
+                String result = hashMap.get("result").toString();
+                HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
+                documentId =  documentIdMap.get("documentId").toString();
+                if("".equals(documentId)){
+                    map.put("success",false);
+                    map.put("message","离职证明文件创建失败");
+                    return map;
+                }
+            }else{
+                String message = hashMap.get("message").toString();
+                map.put("success",false);
+                map.put("message",message);
+                return map;
+            }
+
+            documentList.add(documentId);
+
+        }catch (Exception e){
+
+        }finally {
+            if(StringUtils.isNotBlank(filePath)){
+                //根据路径创建文件对象
+                File file = new File(filePath);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+        }
+
+        //根据项目id 和 documentId生成合同id
+        HashMap contractIdHashMap = this.getSignatureContractIdByPageSign(documentList);
+        String contractIdCode = contractIdHashMap.get("code").toString();
+        String contractId = "";
+        if("0".equals(contractIdCode)){
+            contractId = contractIdHashMap.get("contractId").toString();
+            map.put("contractId",contractId);
+            if("".equals(contractId)){
+                map.put("success",false);
+                map.put("message","签章文件创建失败");
+                return map;
+            }
+
+        }else{
+            map.put("success",false);
+            map.put("message",contractIdHashMap.get("message").toString());
+            return map;
+        }
+
+        map.put("success",true);
+        map.put("message","生成签章contractId成功");
+        return map;
+    }
+
+    /**
+     * 根据项目报告id 和 documentId生成合同id(页面签署生成)
+     * 个人签字章功能
+     * @param documentList
+     * @return
+     */
+    public HashMap getSignatureContractIdByPageSign( List<String> documentList){
+        HashMap hashMap = new HashMap();
+        Set<String> serialIdSet = new HashSet<>();
+        //创建签署方信息
+        List<Action> actions = Lists.newArrayList();
+        Action companyAction = new Action();
+        companyAction.setType("CORPORATE");
+        companyAction.setName("公司印章");
+        companyAction.setSerialNo("1");
+        //添加盖章位置
+        List<Location> locations = Lists.newArrayList();
+        Location location = new Location();
+        location.setDocumentId(documentList.get(0));
+        location.setSealId(COMPANYROUNDSEALFINANCEID);
+        location.setRectType("SEAL_CORPORATE");
+        location.setKeyword("单位盖章");
+        location.setKeywordIndex(1);
+        locations.add(location);
+
+        List<String> serialIdList = new ArrayList<String>(serialIdSet);
+        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
+        //判定该action是否采用自动签署
+        companyAction.setAutoSign("true");
+        companyAction.setLocations(locations);
+        actions.add(companyAction);
+        //创建签署方信息表
+        List<SignatorieInfo> signatories = Lists.newArrayList();
+        SignatorieInfo signatorieInfo1 = new SignatorieInfo();
+        signatorieInfo1.setSerialNo("1");
+        signatorieInfo1.setTenantName("江苏兴光项目管理有限公司");
+        signatorieInfo1.setTenantType("COMPANY");
+        signatorieInfo1.setActions(actions);
+        signatories.add(signatorieInfo1);
+        SignatureContract signatureContract = new SignatureContract();
+        signatureContract.setDocuments(documentList);
+        //离职证明用印流程id
+        signatureContract.setCategoryId(DIMISSIONID);
+        signatureContract.setSend(true);
+        signatureContract.setSignatories(signatories);
+        signatureContract.setSn("");
+        signatureContract.setSubject("" + "离职证明");//添加项目名称
+        net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(signatureContract);
+        System.out.println(json.toString());
+        long s5=System.currentTimeMillis();
+        System.out.println(json.toString());
+        String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
+        long s6=System.currentTimeMillis();
+        System.out.println("获取合同id获取时间:" + (s6 - s5));
+        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
+
+        return hashMap;
+    }
+
+
 
     public String getAssignee(String roleId){
         List<UserDTO> userDTOS = SpringUtil.getBean(IUserApi.class).findListFlowAbleByPostId(roleId);

+ 105 - 9
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverService.java

@@ -12,8 +12,10 @@ import com.jeeplus.human.depart.handover.mapper.HandoverMapper;
 import com.jeeplus.human.enrollment.enrollmentRegistration.utils.HunamFreemarkerUtil;
 import com.jeeplus.human.signature.entity.*;
 import com.jeeplus.human.signature.utils.*;
+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;
@@ -28,8 +30,10 @@ 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 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;
@@ -65,11 +69,19 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
      */
     private static String DIMISSIONID  = Global.getConfig("dimission_id");
 
+
+    private static final String DIRECTORY  = Global.getConfig("directory");
+
     /**
      * 会计公司印章
      */
     private static String COMPANYROUNDSEALFINANCEID  = Global.getConfig("company_round_seal_finance_id");
 
+    /**
+     * 评估公司印章
+     */
+    private static String COMPANYROUNDSEALASSESSID  = Global.getConfig("company_round_seal_assess_id");
+
     @Resource
     private HandoverMapper mapper;
 
@@ -340,23 +352,100 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
         String wordPath = convertToWord(report);
 //        report.setPdfFilePath(pdfFilePath);
         report.setWordFilePath(wordPath);
-        //对离职证明进行盖章操作
-        Map<String, Object> signatureContractIdMap = createSignatureContractId(wordPath);
-        boolean success = (boolean) signatureContractIdMap.get("success");
-        if(success){
-            report.setSignatureContractId(signatureContractIdMap.get("contractId").toString());
+
+        //根据当前登录人隶属公司,判定是否进行签章 目前仅支持:会计公司、评估公司员工进行离职操作
+        if("10003".equals(userDTO.getTenantDTO().getId()) || "10001".equals(userDTO.getTenantDTO().getId())){
+            uploadDimissionProveFile(wordPath,report,userDTO);
+            report.setSignatureFlag("0");
+        } else{
+            //对离职证明进行盖章操作
+            Map<String, Object> signatureContractIdMap = createSignatureContractId(wordPath, userDTO);
+            boolean success = (boolean) signatureContractIdMap.get("success");
+            if(success){
+                report.setSignatureContractId(signatureContractIdMap.get("contractId").toString());
+                report.setSignatureFlag("1");
+            }else{
+                uploadDimissionProveFile(wordPath,report,userDTO);
+                report.setSignatureFlag("0");
+            }
         }
 
+
+
         mapper.updateById(report);
         return report;
     }
 
     /**
+     * 上传离职证明文件
+     * @param wordPath
+     * @param report
+     * @param userDTO
+     * @return
+     * @throws Exception
+     */
+    private void uploadDimissionProveFile(String wordPath,Handover report, UserDTO userDTO) throws Exception{
+        //将未盖章的文件进行上传到oss中,并进行标记()
+        File file = new File(wordPath);
+        String filepath = "";
+        //取得上传文件
+        //将文件上传到oss云盘中
+        MultipartFile cMultiFile = new MockMultipartFile("file", file.getName(), null, new FileInputStream(file));
+        if (!cMultiFile.isEmpty()) {
+            // 文件保存路径
+            String realPath =DIRECTORY.replace("/","")+"/human_dimission_file"+SpringUtil.getBean ( IWorkAttachmentApi.class ).datePath()+"/"+ System.currentTimeMillis();
+            //文件原名称
+            String newName = cMultiFile.getOriginalFilename();
+            if(StringUtils.isNotBlank(newName)){
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).uploadFileSignatureOSS(file.getPath(),realPath,newName);
+                filepath = "/" + realPath + newName;
+            }
+        }
+        //截取文件后缀名
+        String substring = file.getName().substring(file.getName().lastIndexOf(".")+1, file.getName().length());
+
+        String newFileName = file.getName();
+        //将签章完成的附件进行保存到附件表中
+        WorkAttachmentInfo workattachment = new WorkAttachmentInfo();
+        workattachment.setDelFlag(0);
+        workattachment.setUrl(filepath);
+        workattachment.setType(substring);
+        workattachment.setAttachmentName(newFileName);
+        workattachment.setAttachmentFlag("dimission_file_signature");
+        workattachment.setFileSize(String.valueOf(file.length()));
+        workattachment.setAttachmentId(report.getId());
+        workattachment.setAttachmentType("");
+        String id = UUID.randomUUID().toString().replace("-", "");
+        workattachment.setId(id);
+        workattachment.setCreateTime(new Date());
+        workattachment.setUpdateTime(new Date());
+        //先查询数据库中是否已经对数据进行保存
+        //若未保存,则进行保存,否则直接跳过
+        List<WorkAttachmentInfo> byAttachmentIdAndUrl = SpringUtil.getBean ( IWorkAttachmentApi.class ).getByAttachmentIdAndUrlAndAttachmentFlag(workattachment);
+        if(byAttachmentIdAndUrl.size() == 0){
+            Map<String,String> map = new HashMap<>();
+            String workAttachment = JSON.toJSONString((workattachment));
+            String userDTOInfo = JSON.toJSONString((userDTO));
+            map.put("workAttachment",workAttachment);
+            map.put("userDTO",userDTOInfo);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+        }else{
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(report.getId());
+            Map<String,String> map = new HashMap<>();
+            String workAttachment = JSON.toJSONString((workattachment));
+            String userDTOInfo = JSON.toJSONString((userDTO));
+            map.put("workAttachment",workAttachment);
+            map.put("userDTO",userDTOInfo);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+        }
+    }
+
+    /**
      * 生成并保存签章contractId 信息
      * @param filePath 临时文件路径(需盖章文件)
      * @return
      */
-    public Map<String,Object> createSignatureContractId(String filePath){
+    public Map<String,Object> createSignatureContractId(String filePath, UserDTO userDTO){
         Map<String,Object> map = new HashMap<String,Object>();
 
         //获取文件生成的documentId
@@ -408,7 +497,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
         }
 
         //根据项目id 和 documentId生成合同id
-        HashMap contractIdHashMap = this.getSignatureContractIdByPageSign(documentList);
+        HashMap contractIdHashMap = this.getSignatureContractIdByPageSign(documentList, userDTO);
         String contractIdCode = contractIdHashMap.get("code").toString();
         String contractId = "";
         if("0".equals(contractIdCode)){
@@ -437,7 +526,8 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
      * @param documentList
      * @return
      */
-    public HashMap getSignatureContractIdByPageSign( List<String> documentList){
+    public HashMap getSignatureContractIdByPageSign( List<String> documentList, UserDTO userDTO){
+
         HashMap hashMap = new HashMap();
         Set<String> serialIdSet = new HashSet<>();
         //创建签署方信息
@@ -450,7 +540,13 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
         List<Location> locations = Lists.newArrayList();
         Location location = new Location();
         location.setDocumentId(documentList.get(0));
-        location.setSealId(COMPANYROUNDSEALFINANCEID);
+
+        if("10003".equals(userDTO.getTenantDTO().getId())){ //会计公司
+            location.setSealId(COMPANYROUNDSEALFINANCEID);
+        }else if("10001".equals(userDTO.getTenantDTO().getId())) {
+            location.setSealId(COMPANYROUNDSEALASSESSID); //评估公司
+        }
+
         location.setRectType("SEAL_CORPORATE");
         location.setKeyword("单位盖章");
         location.setKeywordIndex(1);

+ 12 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/controller/DepartRegistrationController.java

@@ -69,6 +69,18 @@ public class DepartRegistrationController {
     }
 
     /**
+     * 查询
+     * @param handoverId
+     * @return
+     */
+    @ApiOperation(value = "查询")
+    @GetMapping("/getByHandoverId")
+    public ResponseEntity<DepartRegistration> getByHandoverId(@RequestParam String handoverId) {
+        DepartRegistration dto = departService.getByHandoverId(handoverId);
+        return ResponseEntity.ok(dto);
+    }
+
+    /**
      * 根据id修改状态status
      */
     @ApiOperation(value = "根据id修改状态status")

+ 3 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/domain/DepartRegistration.java

@@ -28,6 +28,9 @@ public class DepartRegistration extends BaseEntity {
     private String processDefinitionId;
 
     @TableField(exist = false)
+    private String dimissionProveUrl; //离职证明路径
+
+    @TableField(exist = false)
     private String taskId;
 
     @TableField(exist = false)

+ 2 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/mapper/DepartMapper.java

@@ -17,7 +17,6 @@ import org.apache.ibatis.annotations.Param;
  * @date 2023-10-25 9:49
  */
 @Mapper
-@InterceptorIgnore(tenantLine = "true")
 public interface DepartMapper extends BaseMapper<DepartRegistration> {
 
     /**
@@ -31,4 +30,6 @@ public interface DepartMapper extends BaseMapper<DepartRegistration> {
     DepartRegistration getById(@Param("id") String id);
 
     void updateStatusById(@Param("id") String id, @Param("type") String type);
+
+    DepartRegistration getByHandoverId(@Param("handoverId") String handoverId);
 }

+ 59 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/mapper/xml/DepartMapper.xml

@@ -35,6 +35,7 @@
         dh.id as handoverId,
         dh.proc_ins_id as handoverProcInsId,
         ifnull(dh.type,"0") as "handoverType",
+        ifnull(wa.url,"") as "dimissionProveUrl",
         im.id as imprestId,
         im.proc_ins_id as imprestProcInsId,
         im.process_definition_id as imprestProcDefId,
@@ -65,6 +66,7 @@
         left join sys_user su2 on a.create_by_id = su2.id
         LEFT JOIN sys_office so on a.department = so.id
         left join human_resources_depart_handover dh on a.id = dh.registration_id
+        left join work_attachment wa on dh.id = wa.attachment_id
         LEFT JOIN act_ru_task e ON dh.proc_ins_id = e.PROC_INST_ID_
         left join human_resources_depart_handover_imprest im on dh.id = im.handover_id
         left join human_resources_depart_handover_computer compu on dh.id = compu.handover_id
@@ -82,4 +84,61 @@
         where a.id = #{id} and a.del_flag = '0'
     </select>
 
+
+    <select id="getByHandoverId" resultType="com.jeeplus.human.depart.registration.domain.DepartRegistration">
+        select
+        <include refid="Base_Column_List"></include>,
+        d.ID_ AS task_id,
+        e.ID_ AS handover_task_id,
+        su.name as projectManagerName,
+        su2.mobile as mobile,
+        so.name as departmentName,
+        dh.id as handoverId,
+        dh.proc_ins_id as handoverProcInsId,
+        ifnull(dh.type,"0") as "handoverType",
+        ifnull(wa.url,"") as "dimissionProveUrl",
+        im.id as imprestId,
+        im.proc_ins_id as imprestProcInsId,
+        im.process_definition_id as imprestProcDefId,
+        ifnull(im.type,"0") as "imprestType",
+        ifnull(compu.type,"0") as "computerType",
+        compu.id as computerId,
+        compu.proc_ins_id as computerProcInsId,
+        compu.process_definition_id as computerProcDefId,
+        ifnull(acco.type,"0") as "accountsType",
+        acco.id as accountsId,
+        acco.proc_ins_id as accountsProcInsId,
+        acco.process_definition_id as accountsProcDefId,
+        ifnull(sse.type,"0") as "securityType",
+        sse.id as securityId,
+        sse.proc_ins_id as securityProcInsId,
+        sse.process_definition_id as securityProcDefId,
+        ifnull(dhd.type,"0") as "draftType",
+        dhd.id as draftId,
+        dhd.proc_ins_id as draftProcInsId,
+        dhd.process_definition_id as draftProcDefId,
+        ifnull(reco.type,"0") as "recoveryType",
+        reco.id as recoveryId,
+        reco.proc_ins_id as recoveryProcInsId,
+        reco.process_definition_id as recoveryProcDefId
+        from human_resources_depart_registration a
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        left join sys_user su on a.project_manager = su.id
+        left join sys_user su2 on a.create_by_id = su2.id
+        LEFT JOIN sys_office so on a.department = so.id
+        left join human_resources_depart_handover dh on a.id = dh.registration_id
+        left join work_attachment wa on dh.id = wa.attachment_id
+        LEFT JOIN act_ru_task e ON dh.proc_ins_id = e.PROC_INST_ID_
+        left join human_resources_depart_handover_imprest im on dh.id = im.handover_id
+        left join human_resources_depart_handover_computer compu on dh.id = compu.handover_id
+        left join human_resources_depart_handover_accounts acco on dh.id = acco.handover_id
+        left join human_resources_depart_handover_social_security sse on dh.id = sse.handover_id
+        left join human_resources_depart_handover_draft dhd on dh.id = dhd.handover_id
+        left join human_resources_depart_handover_recovery reco on dh.id = reco.handover_id
+        <where>
+            dh.id = #{handoverId}
+        </where>
+        ORDER BY a.create_time DESC
+    </select>
+
 </mapper>

+ 13 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/registration/service/DepartService.java

@@ -58,11 +58,17 @@ public class DepartService extends ServiceImpl<DepartMapper, DepartRegistration>
         IPage<DepartRegistration> list = mapper.findList(page, queryWrapper);
         list.getRecords().forEach(item -> {
             // 入库 修改申请
-            if (com.jeeplus.utils.StringUtils.isNotBlank(item.getTaskId()) && com.jeeplus.utils.StringUtils.isNotBlank(item.getType())) {
+            if (StringUtils.isNotBlank(item.getTaskId()) && StringUtils.isNotBlank(item.getType())) {
                 if ("2".equals(item.getType())) { // “审核中”的数据要获取数据审核人
                     item.setAuditUserIds(flowTaskService.getTaskAuditUsers(item.getTaskId()));  // 获取数据审核人
                 }
             }
+            //查询是否已办理完离职,离职证明文件
+            if("5".equals(item.getRecoveryType())){
+                //查询离职文件url
+
+            }
+
         });
         return list;
 
@@ -144,4 +150,10 @@ public class DepartService extends ServiceImpl<DepartMapper, DepartRegistration>
             return true;
         }
     }
+
+    public DepartRegistration getByHandoverId(String handoverId) {
+        // 查询基础信息表
+        DepartRegistration info = mapper.getByHandoverId(handoverId);
+        return info;
+    }
 }

+ 11 - 4
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/controller/HumanSignatureCallBackController.java

@@ -31,7 +31,7 @@ import java.util.*;
  * @version 2021-11-04
  */
 @Controller
-@RequestMapping(value = "/cwProjectReport/signatureCallBack")
+@RequestMapping(value = "/human/signatureCallBack")
 @Transactional(rollbackFor = Exception.class)
 public class HumanSignatureCallBackController {
 
@@ -46,9 +46,9 @@ public class HumanSignatureCallBackController {
 
     @RequestMapping(value = "/getApprovalCallBackAccomplish", method= RequestMethod.POST)
     public String getApprovalCallBackAccomplish(PresignCallBack presignCallBack, HttpServletResponse response) {
-        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken (TokenProvider.getCurrentToken ( ));
         //根据contractId查询对应的报告信息
         Handover handover = handoverService.queryByContractId(presignCallBack.getContractId());
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getById (handover.getCreateById());
         //对文件回调路径进行处理并保存
         String signatureUrl = null;
         if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
@@ -119,7 +119,6 @@ public class HumanSignatureCallBackController {
                         //文件原名称
                         String newName = cMultiFile.getOriginalFilename();
                         if(StringUtils.isNotBlank(newName)){
-                            newName = newName.substring(13, newName.length());
                             SpringUtil.getBean ( IWorkAttachmentApi.class ).uploadFileSignatureOSS(f.getPath(),realPath,newName);
                             filepath = "/" + realPath + newName;
                         }
@@ -129,7 +128,7 @@ public class HumanSignatureCallBackController {
                     //截取文件后缀名
                     String substring = f.getName().substring(f.getName().lastIndexOf(".")+1, f.getName().length());
 
-                    String newFileName = f.getName().substring(13, f.getName().length());
+                    String newFileName = f.getName();
 
                     //将签章完成的附件进行保存到附件表中
                     WorkAttachmentInfo workattachment = new WorkAttachmentInfo();
@@ -155,6 +154,14 @@ public class HumanSignatureCallBackController {
                         map.put("workAttachment",workAttachment);
                         map.put("userDTO",userDTOInfo);
                         SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+                    }else{
+                        SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(handover.getId());
+                        Map<String,String> map = new HashMap<>();
+                        String workAttachment = JSON.toJSONString((workattachment));
+                        String userDTOInfo = JSON.toJSONString((userDTO));
+                        map.put("workAttachment",workAttachment);
+                        map.put("userDTO",userDTOInfo);
+                        SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
                     }
                 }
             }

+ 3 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/AreaController.java

@@ -128,7 +128,10 @@ public class AreaController {
     @ApiLog("获取所有区域数据")
     @GetMapping("getAllArea")
     public ResponseEntity <List <Area>> getAllArea(@RequestParam(required = false) String name) {
+        long l1 = System.currentTimeMillis();
         List <Area> rootTree = areaService.getAllArea ( name );
+        long l2 = System.currentTimeMillis();
+        System.out.println("报告列表查询service方法消耗时间:" + (l2-l1));
         return ResponseEntity.ok ( rootTree );
     }
 

+ 1 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/AreaMapper.xml

@@ -8,5 +8,6 @@
         <if test="name != null and name != ''">
             and name LIKE CONCAT ('%', #{name}, '%')
         </if>
+        order by sort asc,parent_id asc
     </select>
 </mapper>