浏览代码

离职签章代码

user5 1 年之前
父节点
当前提交
f6de12b0aa
共有 21 个文件被更改,包括 2457 次插入20 次删除
  1. 2 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/domain/Handover.java
  2. 13 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/mapper/HandoverMapper.java
  3. 12 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/mapper/xml/HandoverMapper.xml
  4. 173 8
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverService.java
  5. 13 7
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/service/EnrollmentRegistrationService.java
  6. 1 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/logwrite/controller/RegistrationWorkLogController.java
  7. 9 3
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/register/service/RegistrationService.java
  8. 1 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/reimburseRegister/controller/ReimburseRegisterController.java
  9. 206 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/controller/HumanSignatureCallBackController.java
  10. 82 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/Action.java
  11. 27 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/ActionOperatorInfo.java
  12. 164 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/Location.java
  13. 126 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/PresignCallBack.java
  14. 47 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/SignatorieInfo.java
  15. 74 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/SignatureContract.java
  16. 500 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/utils/Global.java
  17. 154 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/utils/PropertiesLoader.java
  18. 765 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/utils/SignaturePostUtil.java
  19. 47 0
      jeeplus-modules/jeeplus-human/src/main/resources/application-human-development.yml
  20. 39 0
      jeeplus-modules/jeeplus-human/src/main/resources/application-human-production.yml
  21. 2 0
      jeeplus-modules/jeeplus-human/src/main/resources/application-human.yml

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

@@ -57,6 +57,8 @@ public class Handover extends BaseEntity {
     private String xmlFilePath;         //生成的xml文件的地址
     private String pdfFilePath;         //生成的xml文件的地址
     private String wordFilePath;         //生成的word文件的地址
+    private String signatureContractId; //签章流程contractId
+    private String signatureUrl;    //签章服务器签章文件存储路径
 
     @TableField(exist = false)
     private String arrivalDate;             //到岗日期

+ 13 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/mapper/HandoverMapper.java

@@ -22,4 +22,17 @@ public interface HandoverMapper extends BaseMapper<Handover> {
 
     Handover getUserInfoById(@Param("handoverId") String handoverId);
 
+    /**
+     * 根据签章id查询具体信息
+     * @param signatureContractId
+     * @return
+     */
+    Handover queryByContractId(@Param("signatureContractId") String signatureContractId);
+
+    /**
+     * 修改签章附件在签章服务器中的文件保存路径
+     * @param handover
+     */
+    void updateSignatureUrl(Handover handover);
+
 }

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

@@ -38,4 +38,16 @@
         LEFT JOIN human_resources_depart_handover b on a.id = b.registration_id
         WHERE b.id = #{handoverId}
     </select>
+
+    <select id="queryByContractId" resultType="com.jeeplus.human.depart.handover.domain.Handover">
+        select
+        <include refid="Base_Column_List"></include>
+        from human_resources_depart_handover a
+        where a.signature_contract_id = #{id} and a.del_flag = '0'
+    </select>
+
+    <update id="updateSignatureUrl">
+        UPDATE human_resources_depart_handover SET signature_url = #{signatureUrl}
+		WHERE id = #{id}
+    </update>
 </mapper>

+ 173 - 8
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverService.java

@@ -1,18 +1,20 @@
 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.*;
 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.feign.IPostApi;
-import com.jeeplus.sys.feign.IRoleApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.service.dto.PostDTO;
-import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import freemarker.template.Configuration;
 import freemarker.template.Template;
@@ -25,8 +27,6 @@ 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.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -38,11 +38,8 @@ import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
 import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
 import java.io.*;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
@@ -61,6 +58,18 @@ import java.util.*;
 @Transactional
 public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
 
+    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 HandoverMapper mapper;
 
@@ -331,12 +340,158 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
         String wordPath = convertToWord(report);
 //        report.setPdfFilePath(pdfFilePath);
         report.setWordFilePath(wordPath);
-        mapper.updateById(report);
+        //对离职证明进行盖章操作
+        Map<String, Object> signatureContractIdMap = createSignatureContractId(wordPath);
+        boolean success = (boolean) signatureContractIdMap.get("success");
+        if(success){
+            report.setSignatureContractId(signatureContractIdMap.get("contractId").toString());
+        }
 
+        mapper.updateById(report);
         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;
+    }
+
+
+    /**
      * 根据id获取离职用户信息
      * @param handoverId
      * @return
@@ -909,4 +1064,14 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
             e.printStackTrace();
         }
     }
+
+
+    public Handover queryByContractId(String contractId){
+        Handover reportData = mapper.queryByContractId(contractId);
+        return reportData;
+    }
+
+    public void updateSignatureUrl(Handover handover){
+        mapper.updateSignatureUrl(handover);
+    }
 }

+ 13 - 7
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/service/EnrollmentRegistrationService.java

@@ -90,18 +90,18 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
         String id = UUID.randomUUID().toString().replace("-", "");
         BeanUtils.copyProperties(reportData, report);
         report.setId(id);
-        report.setCreateById(userDTO.getId());
+        report.setCreateById("1");
         report.setCreateTime(new Date());
-        report.setUpdateById(userDTO.getId());
+        report.setUpdateById("1");
         report.setUpdateTime(new Date());
 
         if (StringUtils.isNotBlank(report.getSocialSecurityNumber())){
             EnrollmentSocialSecurityCard securityCard = new EnrollmentSocialSecurityCard();
             String amountId = UUID.randomUUID().toString().replace("-", "");
             securityCard.setId(amountId);
-            securityCard.setCreateById(userDTO.getId());
+            securityCard.setCreateById("1");
             securityCard.setCreateTime(new Date());
-            securityCard.setUpdateById(userDTO.getId());
+            securityCard.setUpdateById("1");
             securityCard.setUpdateTime(new Date());
             securityCard.setSocialSecurityNumber(report.getSocialSecurityNumber());
             securityCard.setSocialSecurityBankNumber(report.getSocialSecurityBankNumber());
@@ -161,14 +161,20 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
                 dto.setOfficeDTO(officeDTO);
 
                 String officeName = "";
+                String networkAddress = "";
                 if (null != office) {
                     TenantDTO tenantDTO = new TenantDTO();
                     tenantDTO.setId(office.getTenantId());
                     dto.setTenantDTO(tenantDTO);
                     if (office.getTenantId().equals("10003")){
-                        officeName = "兴光会计";
+                        officeName = "会计业务管理公司";
+                        networkAddress = "cpapmis.xgccpm.com";
                     }else if (office.getTenantId().equals("10004")) {
-                        officeName = "中审";
+                        officeName = "中审管理公司";
+                        networkAddress = "zs.xgccpm.com";
+                    }else if (office.getTenantId().equals("10001")) {
+                        officeName = "评估管理公司";
+                        networkAddress = "http://amc.xgccpm.com";
                     }
                 } else {
                     TenantDTO tenantDTO = new TenantDTO();
@@ -186,7 +192,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
                 PostDTO postDTO = SpringUtil.getBean(IPostApi.class).getPostDTOByName("门卡管理员");
                 List<UserDTO> listByPostId = SpringUtil.getBean(IUserApi.class).findListFlowAbleByPostId(postDTO.getId());
 
-                String randomCode = report.getName() + "你好!欢迎入职" + officeName + ",请尽快登录公司系统:" + "www.baidu.com"
+                String randomCode = report.getName() + "你好!欢迎入职" + officeName + ",请尽快登录公司系统:" + networkAddress
                         + "完善个人信息(包括社保卡号与工资卡号)并修改初始密码,系统初始账号密码为:" + report.getName() +
                         "/123456,人事部门已在为你办理门禁卡,办理成功后将由系统告知,在收到系统通知后,请及时到办公室"+ listByPostId.get(0).getName() +"处领取门禁卡!"+
                         "注:工资卡需同时提供中信银行、招商银行卡号";

+ 1 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/logwrite/controller/RegistrationWorkLogController.java

@@ -75,7 +75,7 @@ public class RegistrationWorkLogController {
      * @return
      */
     @ApiLog(value = "保存实习人员登记信息", type = LogTypeEnum.SAVE)
-    @PreAuthorize("hasAnyAuthority('workLog:add','workLog:edit')")
+    //@PreAuthorize("hasAnyAuthority('workLog:add','workLog:edit')")
     @PostMapping("save")
     public ResponseEntity save(@Valid @RequestBody RegistrationWorkLog workLog) throws Exception {
         RegistrationWorkLog s = workLogService.saveRegistrationWorkLog(workLog);

+ 9 - 3
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/register/service/RegistrationService.java

@@ -172,14 +172,20 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 
                 //发送短信通知
                 String officeName = "";
+                String networkAddress = "";
                 if (null != office) {
                     TenantDTO tenantDTO = new TenantDTO();
                     tenantDTO.setId(office.getTenantId());
                     dto.setTenantDTO(tenantDTO);
                     if (office.getTenantId().equals("10003")){
-                        officeName = "兴光会计";
+                        officeName = "会计业务管理公司";
+                        networkAddress = "cpapmis.xgccpm.com";
                     }else if (office.getTenantId().equals("10004")) {
-                        officeName = "中审";
+                        officeName = "中审管理公司";
+                        networkAddress = "zs.xgccpm.com";
+                    }else if (office.getTenantId().equals("10001")) {
+                        officeName = "评估管理公司";
+                        networkAddress = "http://amc.xgccpm.com";
                     }
                 } else {
                     TenantDTO tenantDTO = new TenantDTO();
@@ -196,7 +202,7 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 //                OfficeDTO office = SpringUtil.getBean(IOfficeApi.class).getOfficeById(report.getPracticeOffice());
 
 
-                String randomCode = report.getName() + "你好!你好!欢迎来" + officeName + "实习,实习期间请及时在公司系统:" + "www.baidu.com"
+                String randomCode = report.getName() + "你好!你好!欢迎来" + officeName + "实习,实习期间请及时在公司系统:" + networkAddress
                         + "中填写实习日志,系统初始账号密码为,系统初始账号密码为:" + report.getName() +
                         "/123456,请尽快登陆系统并修改初始密码!";
                 Map<String, Object> stringObjectMap = SpringUtil.getBean(IUserApi.class).sendRandomCodes(report.getMobilePhone(), randomCode);

+ 1 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/reimburseRegister/controller/ReimburseRegisterController.java

@@ -62,7 +62,7 @@ public class ReimburseRegisterController {
      * @return
      */
     @ApiLog(value = "保存报销登记信息", type = LogTypeEnum.SAVE)
-    @PreAuthorize("hasAnyAuthority('reimburseRegister:add','reimburseRegister:edit')")
+    //@PreAuthorize("hasAnyAuthority('reimburseRegister:add','reimburseRegister:edit')")
     @PostMapping("save")
     public ResponseEntity save(@Valid @RequestBody ReimburseRegister reimburseRegister) throws Exception {
         ReimburseRegister s = registerService.saveReimburseRegister(reimburseRegister);

+ 206 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/controller/HumanSignatureCallBackController.java

@@ -0,0 +1,206 @@
+package com.jeeplus.human.signature.controller;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.human.depart.handover.domain.Handover;
+import com.jeeplus.human.depart.handover.service.HandoverService;
+import com.jeeplus.human.signature.entity.PresignCallBack;
+import com.jeeplus.human.signature.utils.*;
+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 org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.mock.web.MockMultipartFile;
+import org.springframework.stereotype.Controller;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.*;
+
+/**
+ * 项目签章回调接口Controller
+ * @author 徐滕
+ * @version 2021-11-04
+ */
+@Controller
+@RequestMapping(value = "/cwProjectReport/signatureCallBack")
+@Transactional(rollbackFor = Exception.class)
+public class HumanSignatureCallBackController {
+
+
+    private static final String DIRECTORY  = Global.getConfig("directory");
+
+    private static final String ALIYUNURL = Global.getConfig("aliyunUrl");
+
+    @Autowired
+    private HandoverService handoverService;
+
+
+    @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());
+        //对文件回调路径进行处理并保存
+        String signatureUrl = null;
+        if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
+            signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
+            signatureUrl = signatureUrl.replace("/xg-qz","");
+            handover.setSignatureUrl(signatureUrl);
+        }
+
+        //将签章完成地址保存到数据库对应报告信息中
+        handoverService.updateSignatureUrl(handover);
+
+
+        //将文件下载并对原有文件地址进行替换
+        String deleteFile = null;
+        String unzipFileStr = null;
+        try{
+            String path = null;
+            if(System.getProperty("os.name").toLowerCase().contains("win")){
+                path = "D:/attachment-file/";
+            }else{
+                path = "/attachment-file/";
+            }
+            String aliyunUrl = "http://cdn.gangwaninfo.com";
+            String aliDownloadUrl = "http://oss.gangwaninfo.com";
+
+
+            String file = aliyunUrl + signatureUrl;
+            file = file.replace("amp;","");
+            String fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
+            String cons = "";
+            if (file.contains(aliyunUrl)){
+                cons = aliyunUrl;
+            }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
+                cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
+            }else {
+                cons = aliDownloadUrl;
+            }
+            String ossKey = file.split(cons+"/")[1];
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).downQzByStreamSaveLocal(ossKey,fileName,path+fileName);
+//            ossClientService.downQzByStreamSaveLocal(ossKey,fileName,path+fileName);
+            //将下载下来的文件转换为file文件
+            File srcFile = new File(path+fileName);
+            deleteFile = path+fileName;
+
+            //截取文件名称
+            String srcFileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
+
+            //解压后文件地址
+            unzipFileStr = path + srcFileName;
+
+            //将下载后的文件进行解压
+            SignaturePostUtil.unZipFile(srcFile,unzipFileStr);
+
+            //遍历解压后文件夹中的所有文件信息
+            File unZipFile = new File(unzipFileStr);
+
+            File[] unZipFileList = unZipFile.listFiles();
+
+            if(null != unZipFileList && unZipFileList.length>0){
+                for (File f : unZipFileList) {
+                    String filepath = "";
+                    //取得上传文件
+                    //将文件上传到oss云盘中
+                    MultipartFile cMultiFile = new MockMultipartFile("file", f.getName(), null, new FileInputStream(f));
+                    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)){
+                            newName = newName.substring(13, newName.length());
+                            SpringUtil.getBean ( IWorkAttachmentApi.class ).uploadFileSignatureOSS(f.getPath(),realPath,newName);
+                            filepath = "/" + realPath + newName;
+                        }
+                    }
+
+                    System.out.println(f.getName());
+                    //截取文件后缀名
+                    String substring = f.getName().substring(f.getName().lastIndexOf(".")+1, f.getName().length());
+
+                    String newFileName = f.getName().substring(13, f.getName().length());
+
+                    //将签章完成的附件进行保存到附件表中
+                    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(f.length()));
+                    workattachment.setAttachmentId(handover.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);
+                    }
+                }
+            }
+
+        }catch (Exception e){
+            e.printStackTrace();
+        }finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+            File file = new File(unzipFileStr);
+            deleteFile(file);
+        }
+
+        return null;
+    }
+
+    public static Boolean deleteFile(File file) {
+        //判断文件不为null或文件目录存在
+        if (file == null || !file.exists()) {
+            System.out.println("文件删除失败,请检查文件是否存在以及文件路径是否正确");
+            return false;
+        }
+        //获取目录下子文件
+        File[] files = file.listFiles();
+        //遍历该目录下的文件对象
+        for (File f : files) {
+            //判断子目录是否存在子目录,如果是文件则删除
+            if (f.isDirectory()) {
+                //递归删除目录下的文件
+                deleteFile(f);
+            } else {
+                //文件删除
+                f.delete();
+                //打印文件名
+                System.out.println("文件名:" + f.getName());
+            }
+        }
+        //文件夹删除
+        file.delete();
+        System.out.println("目录名:" + file.getName());
+        return true;
+    }
+}

+ 82 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/Action.java

@@ -0,0 +1,82 @@
+package com.jeeplus.human.signature.entity;
+
+import java.util.List;
+
+/**
+ * @author: 大猫
+ * @create: 2021-11-02 18:32
+ **/
+public class Action {
+    private String type;
+    private String name;
+    private String serialNo;
+    private String sealId;
+    private String autoSign;
+    private String sealIds;
+    private List<ActionOperatorInfo> actionOperators; //签署人信息
+    private List<Location> locations; //位置信息
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getSerialNo() {
+        return serialNo;
+    }
+
+    public void setSerialNo(String serialNo) {
+        this.serialNo = serialNo;
+    }
+
+    public String getAutoSign() {
+        return autoSign;
+    }
+
+    public void setAutoSign(String autoSign) {
+        this.autoSign = autoSign;
+    }
+
+    public List<ActionOperatorInfo> getActionOperators() {
+        return actionOperators;
+    }
+
+    public void setActionOperators(List<ActionOperatorInfo> actionOperators) {
+        this.actionOperators = actionOperators;
+    }
+
+    public List<Location> getLocations() {
+        return locations;
+    }
+
+    public void setLocations(List<Location> locations) {
+        this.locations = locations;
+    }
+
+    public String getSealId() {
+        return sealId;
+    }
+
+    public void setSealId(String sealId) {
+        this.sealId = sealId;
+    }
+
+    public String getSealIds() {
+        return sealIds;
+    }
+
+    public void setSealIds(String sealIds) {
+        this.sealIds = sealIds;
+    }
+}

+ 27 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/ActionOperatorInfo.java

@@ -0,0 +1,27 @@
+package com.jeeplus.human.signature.entity;
+
+/**
+ * 签署人信息
+ * @author: 徐滕
+ * @create: 2021-11-02 18:10
+ **/
+public class ActionOperatorInfo {
+    private String operatorName; //签署人名称
+    private String operatorContact; //签署人手机号
+
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+
+    public String getOperatorContact() {
+        return operatorContact;
+    }
+
+    public void setOperatorContact(String operatorContact) {
+        this.operatorContact = operatorContact;
+    }
+}

+ 164 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/Location.java

@@ -0,0 +1,164 @@
+package com.jeeplus.human.signature.entity;
+
+/**
+ * 签署位置表
+ * @author: 徐滕
+ * @create: 2021-11-03 15:50
+ **/
+public class Location {
+    private String id;
+    private String documentId ; //合同文档ID
+    private String rectType ;   //签章类型
+    private String page ;      //签署页码,坐标指定位置时必须,0:全部页,-1:最后一页,其他:第page页
+    private String keyword ;    //关键字,关键字指定位置时必须
+    private Integer keywordIndex ;  //第几个关键字,0:全部,-1:最后一个,其他:第keyIndex 个,默认为1
+    private String offsetX ;    //X轴坐标,坐标定位时必传,关键字定位时选传
+    private String offsetY ;    //Y轴坐标,坐标定位时必传,关键字定位时选传
+    private String contractId ;
+    private String signatoryId ;
+    private String actionId ;
+    private String width ;
+    private String height ;
+    private String fromTemplate ;
+    private String createTime ;
+    private String samePositionId ;
+    private String sealId ;
+
+
+
+    public String getDocumentId() {
+        return documentId;
+    }
+
+    public void setDocumentId(String documentId) {
+        this.documentId = documentId;
+    }
+
+    public String getRectType() {
+        return rectType;
+    }
+
+    public void setRectType(String rectType) {
+        this.rectType = rectType;
+    }
+
+    public String getPage() {
+        return page;
+    }
+
+    public void setPage(String page) {
+        this.page = page;
+    }
+
+    public String getKeyword() {
+        return keyword;
+    }
+
+    public void setKeyword(String keyword) {
+        this.keyword = keyword;
+    }
+
+    public Integer getKeywordIndex() {
+        return keywordIndex;
+    }
+
+    public void setKeywordIndex(Integer keywordIndex) {
+        this.keywordIndex = keywordIndex;
+    }
+
+    public String getOffsetX() {
+        return offsetX;
+    }
+
+    public void setOffsetX(String offsetX) {
+        this.offsetX = offsetX;
+    }
+
+    public String getOffsetY() {
+        return offsetY;
+    }
+
+    public void setOffsetY(String offsetY) {
+        this.offsetY = offsetY;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getContractId() {
+        return contractId;
+    }
+
+    public void setContractId(String contractId) {
+        this.contractId = contractId;
+    }
+
+    public String getSignatoryId() {
+        return signatoryId;
+    }
+
+    public void setSignatoryId(String signatoryId) {
+        this.signatoryId = signatoryId;
+    }
+
+    public String getActionId() {
+        return actionId;
+    }
+
+    public void setActionId(String actionId) {
+        this.actionId = actionId;
+    }
+
+    public String getWidth() {
+        return width;
+    }
+
+    public void setWidth(String width) {
+        this.width = width;
+    }
+
+    public String getHeight() {
+        return height;
+    }
+
+    public void setHeight(String height) {
+        this.height = height;
+    }
+
+    public String getFromTemplate() {
+        return fromTemplate;
+    }
+
+    public void setFromTemplate(String fromTemplate) {
+        this.fromTemplate = fromTemplate;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getSamePositionId() {
+        return samePositionId;
+    }
+
+    public void setSamePositionId(String samePositionId) {
+        this.samePositionId = samePositionId;
+    }
+
+    public String getSealId() {
+        return sealId;
+    }
+
+    public void setSealId(String sealId) {
+        this.sealId = sealId;
+    }
+}

+ 126 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/PresignCallBack.java

@@ -0,0 +1,126 @@
+package com.jeeplus.human.signature.entity;
+
+/**
+ * 预签署回调参数表
+ * @author: 大猫
+ * @create: 2021-11-04 09:27
+ **/
+public class PresignCallBack {
+    private String contractId;  //文件编号
+    private String documentId;  //文档ID
+    private String tenantId;    //签署方编号
+    private String tenantName;  //签署方名称
+    private String sn;  //文件自定义编号
+    private String status;  //文件状态
+    private String type;    //回调类型
+    private String contact; //联系方式
+    private String operatorName;    //操作人姓名(签章人姓名)
+    private String operatorMobile;  //操作人手机号(签章人手机号)
+    private String operatorNumber;  //操作人员工编号
+    private String receiverNumber;  //经办人员工编号
+    private String storagePath;  //文件归档下载地址
+
+    public String getContractId() {
+        return contractId;
+    }
+
+    public void setContractId(String contractId) {
+        this.contractId = contractId;
+    }
+
+    public String getDocumentId() {
+        return documentId;
+    }
+
+    public void setDocumentId(String documentId) {
+        this.documentId = documentId;
+    }
+
+    public String getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(String tenantId) {
+        this.tenantId = tenantId;
+    }
+
+    public String getTenantName() {
+        return tenantName;
+    }
+
+    public void setTenantName(String tenantName) {
+        this.tenantName = tenantName;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getContact() {
+        return contact;
+    }
+
+    public void setContact(String contact) {
+        this.contact = contact;
+    }
+
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+
+    public String getOperatorMobile() {
+        return operatorMobile;
+    }
+
+    public void setOperatorMobile(String operatorMobile) {
+        this.operatorMobile = operatorMobile;
+    }
+
+    public String getOperatorNumber() {
+        return operatorNumber;
+    }
+
+    public void setOperatorNumber(String operatorNumber) {
+        this.operatorNumber = operatorNumber;
+    }
+
+    public String getReceiverNumber() {
+        return receiverNumber;
+    }
+
+    public void setReceiverNumber(String receiverNumber) {
+        this.receiverNumber = receiverNumber;
+    }
+
+    public String getStoragePath() {
+        return storagePath;
+    }
+
+    public void setStoragePath(String storagePath) {
+        this.storagePath = storagePath;
+    }
+}

+ 47 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/SignatorieInfo.java

@@ -0,0 +1,47 @@
+package com.jeeplus.human.signature.entity;
+
+import java.util.List;
+
+/**
+ * 签署方信息表
+ * @author: 徐滕
+ * @create: 2021-11-02 18:08
+ **/
+public class SignatorieInfo {
+    private String tenantType; //签署方类型
+    private String tenantName; //签署方名称
+    private String serialNo; //签署顺序
+    private List<Action> actions; //签署顺序
+
+    public String getTenantType() {
+        return tenantType;
+    }
+
+    public void setTenantType(String tenantType) {
+        this.tenantType = tenantType;
+    }
+
+    public String getTenantName() {
+        return tenantName;
+    }
+
+    public void setTenantName(String tenantName) {
+        this.tenantName = tenantName;
+    }
+
+    public String getSerialNo() {
+        return serialNo;
+    }
+
+    public void setSerialNo(String serialNo) {
+        this.serialNo = serialNo;
+    }
+
+    public List<Action> getActions() {
+        return actions;
+    }
+
+    public void setActions(List<Action> actions) {
+        this.actions = actions;
+    }
+}

+ 74 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/entity/SignatureContract.java

@@ -0,0 +1,74 @@
+package com.jeeplus.human.signature.entity;
+
+import java.util.List;
+
+/**
+ * 签章合同表
+ * @author: 徐滕
+ * @create: 2021-11-02 18:05
+ **/
+public class SignatureContract {
+    private String subject; //合同名称
+    private String sn; //合同编号 非必填
+    private String categoryId; //用印流程ID 非必填
+    private String tenantName; //用印流程名称 非必填
+    private List<String> documents; //文档ID的集合 非必填
+    private List<SignatorieInfo> signatories; //签署方信息 非必填
+    private Boolean send;   //是否发起(预签署为不发起)
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(String categoryId) {
+        this.categoryId = categoryId;
+    }
+
+    public String getTenantName() {
+        return tenantName;
+    }
+
+    public void setTenantName(String tenantName) {
+        this.tenantName = tenantName;
+    }
+
+    public List<String> getDocuments() {
+        return documents;
+    }
+
+    public void setDocuments(List<String> documents) {
+        this.documents = documents;
+    }
+
+    public List<SignatorieInfo> getSignatories() {
+        return signatories;
+    }
+
+    public void setSignatories(List<SignatorieInfo> signatories) {
+        this.signatories = signatories;
+    }
+
+    public Boolean getSend() {
+        return send;
+    }
+
+    public void setSend(Boolean send) {
+        this.send = send;
+    }
+}

+ 500 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/utils/Global.java

@@ -0,0 +1,500 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.human.signature.utils;
+
+import com.google.common.collect.Maps;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.core.io.DefaultResourceLoader;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * 全局配置类
+ * @author jeeplus
+ * @version 2014-06-25
+ */
+public class Global {
+
+	/**
+	 * 当前对象实例
+	 */
+	private static Global global = new Global();
+
+	/**
+	 * 保存全局属性值
+	 */
+	private static Map<String, String> map = Maps.newHashMap();
+
+	/**
+	 * 属性文件加载对象
+	 */
+	private static PropertiesLoader loader = new PropertiesLoader("application-human.yml");
+
+
+	/**
+	 * 显示/隐藏
+	 */
+	public static final String SHOW = "1";
+	public static final String HIDE = "0";
+
+	/**
+	 * 是/否
+	 */
+	public static final String YES = "1";
+	public static final String NO = "0";
+
+	/**
+	 * 对/错
+	 */
+	public static final String TRUE = "true";
+	public static final String FALSE = "false";
+
+	/**
+	 * 上传文件基础虚拟路径
+	 */
+	public static final String USERFILES_BASE_URL = "/userfiles/";
+
+	/**
+	 * 获取当前对象实例
+	 */
+	public static Global getInstance() {
+		return global;
+	}
+
+	/**
+	 * 获取配置
+	 * @see {fns:getConfig('adminPath')}
+	 */
+	public static String getConfig1(String key) {
+		String value = map.get(key);
+		if (value == null){
+			value = loader.getProperty(key);
+			map.put(key, value != null ? value : StringUtils.EMPTY);
+		}
+		return value;
+	}
+
+	public static String getConfig(String key) {
+		String value = null;
+		try {
+			String property = loader.getProperty("active");
+
+			if (StringUtils.isNotBlank(property)) {
+				switch (property){
+					case "development":
+						PropertiesLoader devLoader = new PropertiesLoader("application-human-development.yml");
+						value = devLoader.getProperty(key);
+						break;
+					case "production":
+						PropertiesLoader proLoader = new PropertiesLoader("application-human-production.yml");
+						value = proLoader.getProperty(key);
+						break;
+				}
+			}
+
+		} catch (Exception e) {
+
+		}
+		return value;
+	}
+
+	/**
+	 * 获取管理端根路径
+	 */
+	public static String getAdminPath() {
+		return getConfig("adminPath");
+	}
+	/**
+	 */
+	public static String getAliyunUrl() {
+		return getConfig("aliyunDownloadUrl");
+	}
+	/**
+	 */
+	public static String getAliDownloadUrl() {
+		return getConfig("aliyunUrl");
+	}
+	/**
+	 */
+	public static String getEndpoint() {
+		return getConfig("endpoint");
+	}
+	/**
+	 */
+	public static String getAccessKeyId() {
+		return getConfig("accessKeyId");
+	}
+	/**
+	 */
+	public static String getAccessKeySecret() {
+		return getConfig("accessKeySecret");
+	}
+	/**
+	 */
+	public static String getBucketName() {
+		return getConfig("bucketName");
+	}
+	/**
+	 */
+	public static String getQzBucketName() {
+		return getConfig("qzBucketName");
+	}
+	/**
+	 */
+	public static String getAvatarDir() {
+		return getConfig("avatarDir");
+	}
+	/**
+	 */
+	public static String getNotifyDir() {
+		return getConfig("notifyDir");
+	}
+	/**
+	 */
+	public static String getReportDir() {
+		return getConfig("reportDir");
+	}
+	/**
+	 */
+	public static String getRqcode() {
+		return getConfig("rqcode");
+	}
+	/**
+	 */
+	public static String getGoout() {
+		return getConfig("goout");
+	}
+	/**
+	 */
+	public static String getLeave() {
+		return getConfig("leave");
+	}
+	/**
+	 */
+	public static String getOvertimeform() {
+		return getConfig("overtimeform");
+	}
+	/**
+	 */
+	public static String getSealform() {
+		return getConfig("sealform");
+	}
+	/**
+	 *
+	 */
+	public static String getWorkReimbur() {return getConfig("workReimbur");}
+	/**
+	 */
+	public static String getEvection() {
+		return getConfig("evection");
+	}
+	/**
+	 */
+	public static String getOaBuy() {
+		return getConfig("oaBuy");
+	}
+	/**
+	 */
+	public static String getOaAll() {
+		return getConfig("oaAll");
+	}
+	/**
+	 */
+	public static String getIm() {
+		return getConfig("im");
+	}/**
+	 */
+	public static String getWorkContractInfo() {
+		return getConfig("workContractInfo");
+	}
+	/**
+	 */
+	public static String getNotifyData() {
+		return getConfig("notifyData");
+	}
+	/**
+	 */
+	public static String getAppData() {
+		return getConfig("appData");
+	}
+	/**
+	 */
+	public static String getLogo() {
+		return getConfig("logo");
+	}
+	/**
+	 */
+	public static String getPhoto() {
+		return getConfig("photo");
+	}
+	/**
+	 *
+	 */
+	public static String getUserEvaluation(){return getConfig("userEvaluation");}
+	/**
+	 */
+	public static String getWorkBidingDocument() {return getConfig("workBidingDocument");}
+	/**
+	 */
+	public static String getWorkEngineeringProject() {return getConfig("workEngineeringProject");}
+
+	/**
+	 */
+	public static String getWorkFullExecute() {return getConfig("workFullExecute");}
+	/**
+	 */
+	public static String getWorkFullMeetingminutes() {return getConfig("workFullMeetingminutes");}
+	/**
+	 */
+	public static String getWorkFullDesignchange(){return getConfig("workFullDesignchange");}
+	/**
+	 */
+	public static String getWorkFullConstructsheet(){return getConfig("workFullConstructsheet");}
+	/**
+	 */
+	public static String getWorkFullProprietorsheet(){return getConfig("workFullProprietorsheet");}
+	/**
+	 */
+	public static String getWorkFullSupervisorsheet(){return getConfig("workFullSupervisorsheet");}
+	/**
+	 */
+	public static String getWorkProjectReport() {return getConfig("workProjectReport");}
+	/**
+	 */
+	public static String getWorkProjectBasis() {return getConfig("workProjectBasis");}
+	/**
+	 */
+	public static String getWorkProjectRemote() {return getConfig("workProjectRemote");}
+	/**
+	 */
+	public static String getWorkProjectSummary() {return getConfig("workProjectSummary");}
+	/**
+	 */
+	public static String getWorkProjectOther() {return getConfig("workProjectOther");}
+	/**
+	 */
+	public static String getWorkVisa() {return getConfig("workVisa");}
+	/**
+	 */
+	public static String getOfficehonor() {return getConfig("Officehonor");}
+	/**
+	 *
+	 */
+	public static String getJobResume() {return getConfig("jobResume");}
+	/**
+	 *
+	 */
+	public static String getSatisfaction() {return getConfig("satisfaction");}
+	/**
+	 *
+	 */
+	public static String getCertificate() {return getConfig("certificate");}
+	/**
+	 *
+	 */
+	public static String getJudgeAttachment() {return getConfig("judgeAttachment");}
+	/**
+	 * 获取前端根路径
+	 */
+	public static String getFrontPath() {
+		return getConfig("frontPath");
+	}
+
+	/**
+	 * 获取URL后缀
+	 */
+	public static String getUrlSuffix() {
+		return getConfig("urlSuffix");
+	}
+
+	/**
+	 * 获取电子签章文件路径
+	 */
+	public static String getISignature() {
+		return getConfig("iSignature");
+	}
+
+	/**
+	 */
+	public static String getOSSUrl() {
+		return getConfig("oSSUrl");
+	}
+	public static String getContractNumPath() {
+		return getConfig("contract_num_path");
+	}
+	/**
+	 * 是否是演示模式,演示模式下不能修改用户、岗位、密码、菜单、授权
+	 */
+	public static Boolean isDemoMode() {
+		String dm = getConfig("demoMode");
+		return "true".equals(dm) || "1".equals(dm);
+	}
+
+	/**
+	 * 在修改系统用户和岗位时是否同步到Activiti
+	 */
+	public static Boolean isSynActivitiIndetity() {
+		String dm = getConfig("activiti.isSynActivitiIndetity");
+		return "true".equals(dm) || "1".equals(dm);
+	}
+
+	/**
+	 * 页面获取常量
+	 * @see {fns:getConst('YES')}
+	 */
+	public static Object getConst(String field) {
+		try {
+			return Global.class.getField(field).get(null);
+		} catch (Exception e) {
+			// 异常代表无配置,这里什么也不做
+		}
+		return null;
+	}
+
+	/**
+	 * 获取工程路径
+	 * @return
+	 */
+	public static String getProjectPath(){
+		// 如果配置了工程路径,则直接返回,否则自动获取。
+		String projectPath = Global.getConfig("projectPath");
+		if (StringUtils.isNotBlank(projectPath)){
+			return projectPath;
+		}
+		try {
+			File file = new DefaultResourceLoader().getResource("").getFile();
+			if (file != null){
+				while(true){
+					File f = new File(file.getPath() + File.separator + "src" + File.separator + "main");
+					if (f == null || f.exists()){
+						break;
+					}
+					if (file.getParentFile() != null){
+						file = file.getParentFile();
+					}else{
+						break;
+					}
+				}
+				projectPath = file.toString();
+			}
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return projectPath;
+	}
+
+	/**
+	 * 获取短信SMS信息
+	 */
+	public static String getSmsUserid() {
+		return getConfig("sms_userid");
+	}
+	public static String getSmsAccount() {
+		return getConfig("sms_account");
+	}
+	public static String getSmsPassword() {
+		return getConfig("sms_password");
+	}
+	public static String getSmsMobile() {
+		return getConfig("sms_mobile");
+	}
+	public static String getSmsContent() {
+		return getConfig("sms_content");
+	}
+	public static String getSmsSendTime() {
+		return getConfig("sms_sendTime");
+	}
+	public static String getSmsAction() {
+		return getConfig("sms_action");
+	}
+	public static String getSmsCheckcontent() {
+		return getConfig("sms_checkcontent");
+	}
+
+	/**
+	 * 获取数据库连接信息
+	 */
+	public static String getJdbcUserName() {
+		return getConfig("jdbc.username");
+	}
+	public static String getJdbcPassword() {
+		return getConfig("jdbc.password");
+	}
+	public static String getJdbcUrl() {
+		return getConfig("jdbc.url");
+	}
+	public static String getJdbcDriver() {
+		return getConfig("jdbc.driver");
+	}
+
+	/**
+	 * 获取容联云账户信息
+	 */
+	public static String getRongUserid() {
+		return getConfig("rong_userid");
+	}
+	public static String getRongToken() {
+		return getConfig("rong_token");
+	}
+	//应用id
+	public static String getAppId() {
+		return getConfig("app_id");
+	}
+	//模板id
+	public static String getTemplateId() {
+		return getConfig("template_id");
+	}
+	//短信发送方式(1:旧的 2:容联云通讯)
+	public static String getCodeType() {
+		return getConfig("code_type");
+	}
+
+	public static String getOpenOfficeAddr() {
+		return getConfig("open_office_addr");
+	}
+
+	public static int getOpenOfficePort() {
+		String openOfficePort = getConfig("open_office_port");
+		return StringUtils.isBlank(openOfficePort)?8100:Integer.valueOf(openOfficePort);
+	}
+	public static String getOpenfireServer() {
+		String openOfficePort = getConfig("openfire.server");
+		return StringUtils.isBlank(openOfficePort)?"oa-pre.ssruihua.com":openOfficePort;
+	}
+	public static String getSysNotify() {
+		String sysNotify = getConfig("sys.notify");
+		return StringUtils.isBlank(sysNotify)?"http://cdn.gangwaninfo.com/jeeplus-resource-data/static/sys/notify.png":sysNotify;
+	}
+
+	public static String getStaffBasicFilePath() {
+		return getConfig("staff_basic_file_path");
+	}
+	public static String getDbName() {
+		return getConfig("db.name");
+	}
+	public static String getVersion() {
+		return getConfig("app_version");
+	}
+	public static String getTestVersion() {
+		return getConfig("app_version_test");
+	}
+
+	public static String getProjectTemplatePath() {
+		return getConfig("project.plan.template.path");
+	}
+
+	public static String getYyApiCode(){
+		return getConfig("yy_apicode");
+	}
+
+	public static String getYyMhUrl(){
+		return getConfig("yy_mhcxurl");
+	}
+
+	public static String getYyShUrl(){
+		return getConfig("yy_shcxurl");
+	}
+}

+ 154 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/utils/PropertiesLoader.java

@@ -0,0 +1,154 @@
+/**
+ * Copyright (c) 2005-2011 springside.org.cn
+ * 
+ * $Id: PropertiesLoader.java 1690 2012-02-22 13:42:00Z calvinxiu $
+ */
+package com.jeeplus.human.signature.utils;
+
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.io.DefaultResourceLoader;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.ResourceLoader;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.NoSuchElementException;
+import java.util.Properties;
+
+/**
+ * Properties文件载入工具类. 可载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的值,但以System的Property优先.
+ * @author calvin
+ * @version 2013-05-15
+ */
+public class PropertiesLoader {
+
+	private static Logger logger = LoggerFactory.getLogger(PropertiesLoader.class);
+
+	private static ResourceLoader resourceLoader = new DefaultResourceLoader();
+
+	private final Properties properties;
+
+	public PropertiesLoader(String... resourcesPaths) {
+		properties = loadProperties(resourcesPaths);
+	}
+
+	public Properties getProperties() {
+		return properties;
+	}
+
+	/**
+	 * 取出Property,但以System的Property优先,取不到返回空字符串.
+	 */
+	private String getValue(String key) {
+		String systemProperty = System.getProperty(key);
+		if (systemProperty != null) {
+			return systemProperty;
+		}
+		if (properties.containsKey(key)) {
+	        return properties.getProperty(key);
+	    }
+	    return "";
+	}
+
+	/**
+	 * 取出String类型的Property,但以System的Property优先,如果都为Null则抛出异常.
+	 */
+	public String getProperty(String key) {
+		String value = getValue(key);
+		if (value == null) {
+			throw new NoSuchElementException();
+		}
+		return value;
+	}
+
+	/**
+	 * 取出String类型的Property,但以System的Property优先.如果都为Null则返回Default值.
+	 */
+	public String getProperty(String key, String defaultValue) {
+		String value = getValue(key);
+		return value != null ? value : defaultValue;
+	}
+
+	/**
+	 * 取出Integer类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
+	 */
+	public Integer getInteger(String key) {
+		String value = getValue(key);
+		if (value == null) {
+			throw new NoSuchElementException();
+		}
+		return Integer.valueOf(value);
+	}
+
+	/**
+	 * 取出Integer类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
+	 */
+	public Integer getInteger(String key, Integer defaultValue) {
+		String value = getValue(key);
+		return value != null ? Integer.valueOf(value) : defaultValue;
+	}
+
+	/**
+	 * 取出Double类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
+	 */
+	public Double getDouble(String key) {
+		String value = getValue(key);
+		if (value == null) {
+			throw new NoSuchElementException();
+		}
+		return Double.valueOf(value);
+	}
+
+	/**
+	 * 取出Double类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
+	 */
+	public Double getDouble(String key, Integer defaultValue) {
+		String value = getValue(key);
+		return value != null ? Double.valueOf(value) : defaultValue;
+	}
+
+	/**
+	 * 取出Boolean类型的Property,但以System的Property优先.如果都为Null抛出异常,如果内容不是true/false则返回false.
+	 */
+	public Boolean getBoolean(String key) {
+		String value = getValue(key);
+		if (value == null) {
+			throw new NoSuchElementException();
+		}
+		return Boolean.valueOf(value);
+	}
+
+	/**
+	 * 取出Boolean类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容不为true/false则返回false.
+	 */
+	public Boolean getBoolean(String key, boolean defaultValue) {
+		String value = getValue(key);
+		return value != null ? Boolean.valueOf(value) : defaultValue;
+	}
+
+	/**
+	 * 载入多个文件, 文件路径使用Spring Resource格式.
+	 */
+	private Properties loadProperties(String... resourcesPaths) {
+		Properties props = new Properties();
+
+		for (String location : resourcesPaths) {
+
+//			logger.debug("Loading properties file from:" + location);
+
+			InputStream is = null;
+			try {
+				Resource resource = resourceLoader.getResource(location);
+				is = resource.getInputStream();
+				props.load(is);
+			} catch (IOException ex) {
+				logger.info("Could not load properties from path:" + location + ", " + ex.getMessage());
+			} finally {
+				IOUtils.closeQuietly(is);
+			}
+		}
+		return props;
+	}
+}

+ 765 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/utils/SignaturePostUtil.java

@@ -0,0 +1,765 @@
+package com.jeeplus.human.signature.utils;
+
+import com.alibaba.fastjson.JSON;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URLEncodedUtils;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLConnection;
+import java.nio.charset.Charset;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+//import com.jeeplus.sys.utils.Global;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-11-02 14:20
+ **/
+public class SignaturePostUtil {
+
+    //竖版模板templateId
+    private static final String VERTICALTEMPLATEID = Global.getConfig("vertical_templateId");
+    //横板模板templateId
+    private static final String ACROSSTEMPLATEID = Global.getConfig("across_templateId");
+    private static final String HTTPTOP = Global.getConfig("signature_http_top");
+
+    private final static String apptoken = Global.getConfig("apptoken");
+//    private final static String appsecret = Global.getConfig("appsecret");
+    private final static String signature = Global.getConfig("signature");
+
+
+    /**
+     * 发送get请求
+     *
+     * @param requestUrl
+     *      请求url
+     * @param requestHeader
+     *      请求头
+     * @param responseEncoding
+     *      响应编码
+     * @return 页面响应html
+     */
+    public static String sendGet(String requestUrl, Map<String, String> requestHeader, String responseEncoding) {
+        String result = "";
+        BufferedReader reader = null;
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                return result;
+            }
+            URL realUrl = new URL(requestUrl);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.connect();
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), responseEncoding));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        result = decodeUnicode(result);
+        return result;
+    }
+
+    /**
+     * 发送下载压缩包get请求
+     * @param requestUrl 请求url
+     * @param requestHeader 请求头
+     * @param fileName 下载文件名称
+     * @param responseEncoding 响应编码
+     * @return 页面响应html
+     */
+    public static String downloadZipGet(String requestUrl, Map<String, String> requestHeader, String fileName, String responseEncoding, HttpServletResponse response) {
+        String result = "";
+        BufferedReader reader = null;
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                return result;
+            }
+            URL realUrl = new URL(requestUrl);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setRequestProperty("Content-Type", "application/zip");
+            connection.connect();
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            InputStream inputStream = connection.getInputStream();
+            //获取自己数组
+            byte[] getData = readInputStream(inputStream);
+
+            //设置HTTP响应头
+            response.reset();//重置 响应头
+            response.setContentType("application/x-download");//告知浏览器下载文件,而不是直接打开,浏览器默认为打开
+            fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1");
+            response.addHeader("Content-Disposition" ,"attachment;filename=" +fileName+ "");//下载文件的名称
+            // 循环取出流中的数据
+            response.getOutputStream().write(getData);
+            response.getOutputStream().close();
+
+            if(inputStream!=null){
+                inputStream.close();
+            }
+
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 下载文件并保存到指定位置
+     * @param requestUrl 请求url
+     * @param requestHeader 请求头
+     * @param fileName 下载文件名称
+     * @param responseEncoding 响应编码
+     * @return 页面响应html
+     */
+    public static Map<String,Object> downloadZipDesignated(String requestUrl, Map<String, String> requestHeader, String fileName, String responseEncoding) {
+        Map<String,Object> map = new HashMap<>();
+        BufferedReader reader = null;
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                map.put("success",false);
+                map.put("message",fileName + " 的请求路径为空");
+                map.put("fileName",fileName);
+                map.put("filePath","");
+                return map;
+            }
+            URL realUrl = new URL(requestUrl);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setRequestProperty("Content-Type", "application/zip");
+            connection.connect();
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            InputStream inputStream = connection.getInputStream();
+
+            BufferedInputStream bis = new BufferedInputStream(inputStream);
+            //判断文件的保存路径后面是否以/结尾
+            String filePath = null;
+            if(System.getProperty("os.name").toLowerCase().contains("win")){
+                filePath = "D:/attachment-file/";
+            }else{
+                filePath = "/attachment-file/";
+            }
+            //写入到文件(注意文件保存路径的后面一定要加上文件的名称)
+            fileName = fileName.replaceAll("\\\\","");
+            fileName = fileName.replaceAll("/","");
+            fileName = fileName.replaceAll("\\*","");
+            fileName = fileName.replaceAll("\\?","");
+            fileName = fileName.replaceAll("\"","");
+            fileName = fileName.replaceAll("<","");
+            fileName = fileName.replaceAll(">","");
+            fileName = fileName.replaceAll("\\|","");
+            fileName = fileName.replaceAll("\\’","'");
+            fileName = fileName.replaceAll("\\”","\"");
+            fileName = fileName.replaceAll("【","(");
+            fileName = fileName.replaceAll("\\{","(");
+            fileName = fileName.replaceAll("】",")");
+            fileName = fileName.replaceAll("}",")");
+            fileName = fileName.replaceAll(",",",");
+            fileName = fileName.replaceAll(":",":");
+            fileName = fileName.replaceAll("—","-");
+            fileName = fileName.replaceAll("……","");
+            fileName = fileName.replaceAll("±","");
+            fileName = fileName.replaceAll("#","");
+            fileName = fileName.replaceAll("%","");
+            fileName = fileName.replaceAll("Π","");
+
+            FileOutputStream fileOut = new FileOutputStream(filePath + fileName);
+            BufferedOutputStream bos = new BufferedOutputStream(fileOut);
+
+            byte[] buf = new byte[4096];
+            int length = bis.read(buf);
+            //保存文件
+            while(length != -1)
+            {
+                bos.write(buf, 0, length);
+                length = bis.read(buf);
+            }
+            //response.getOutputStream().close();
+            bos.close();
+            fileOut.close();
+            bis.close();
+            if(inputStream!=null){
+                inputStream.close();
+            }
+            map.put("success",true);
+            map.put("message","下载成功");
+            map.put("fileName",fileName);
+            map.put("filePath",filePath);
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return map;
+    }
+
+    /**
+     * 从输入流中获取字节数组
+     * @param inputStream
+     * @return
+     * @throws IOException
+     */
+    public static byte[] readInputStream(InputStream inputStream) throws IOException {
+        byte[] buffer = new byte[1024];
+        int len = 0;
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        while((len = inputStream.read(buffer)) != -1) {
+            bos.write(buffer, 0, len);
+        }
+        bos.close();
+        return bos.toByteArray();
+    }
+
+    /**
+     * 发送post请求
+     *
+     * @param requestUrl 请求url
+     * @param requestHeader 请求头
+     * @param formTexts 表单数据
+     * @param files 上传文件
+     * @param requestEncoding 请求编码
+     * @param responseEncoding 响应编码
+     * @return 页面响应html
+     */
+    public static String sendPost(String requestUrl, Map<String, String> requestHeader, Map<String, String> formTexts, File[] files, String requestEncoding, String responseEncoding) {
+        OutputStream out = null;
+        BufferedReader reader = null;
+        String result = "";
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                return result;
+            }
+            URL realUrl = new URL(requestUrl);
+            HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            connection.setRequestMethod("POST");
+            if (requestEncoding == null || requestEncoding.isEmpty()) {
+                requestEncoding = "UTF-8";
+            }
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            if (files == null || files.length == 0) {
+                String boundary = "-----------------------------" + String.valueOf(new Date().getTime());
+                connection.setRequestProperty("content-type", "multipart/form-data; boundary=" + boundary);
+                out = new DataOutputStream(connection.getOutputStream());
+                if (formTexts != null && formTexts.size() > 0) {
+                    StringBuilder sbFormData = new StringBuilder();
+                    for (Entry<String, String> entry : formTexts.entrySet()) {
+                        sbFormData.append("--" + boundary + "\r\n");
+                        sbFormData.append("Content-Disposition: form-data; name=\"" + entry.getKey() + "\"\r\n\r\n");
+                        sbFormData.append(entry.getValue() + "\r\n");
+                    }
+                    out.write(sbFormData.toString().getBytes(requestEncoding));
+                }
+            } else {
+                String boundary = "-----------------------------" + String.valueOf(new Date().getTime());
+                connection.setRequestProperty("content-type", "multipart/form-data; boundary=" + boundary);
+                out = new DataOutputStream(connection.getOutputStream());
+                if (formTexts != null && formTexts.size() > 0) {
+                    StringBuilder sbFormData = new StringBuilder();
+                    for (Entry<String, String> entry : formTexts.entrySet()) {
+                        sbFormData.append("--" + boundary + "\r\n");
+                        sbFormData.append("Content-Disposition: form-data; name=\"" + entry.getKey() + "\"\r\n\r\n");
+                        sbFormData.append(entry.getValue() + "\r\n");
+                    }
+                    out.write(sbFormData.toString().getBytes(requestEncoding));
+                }
+                for (File file : files) {
+                    if (!file.exists()) {
+                        continue;
+                    }
+                    out.write(("--" + boundary + "\r\n").getBytes(requestEncoding));
+                    out.write(("Content-Disposition: form-data; name=\" file \"; filename=\"" + file.getName() + "\"\r\n").getBytes(requestEncoding));
+                    out.write(("Content-Type: application/x-msdownload\r\n\r\n").getBytes(requestEncoding));
+                    DataInputStream in = new DataInputStream(new FileInputStream(file));
+                    int bytes = 0;
+                    byte[] bufferOut = new byte[1024];
+                    while ((bytes = in.read(bufferOut)) != -1) {
+                        out.write(bufferOut, 0, bytes);
+                    }
+                    in.close();
+                    out.write(("\r\n").getBytes(requestEncoding));
+                }
+                out.write(("--" + boundary + "--").getBytes(requestEncoding));
+            }
+            out.flush();
+            out.close();
+            out = null;
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), responseEncoding));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送POST请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        result = decodeUnicode(result);
+        return result;
+    }
+
+    /**
+     * ApplicationJson的post请求
+     * @return
+     */
+    public static String sendPostApplicationJson(String url, String jsonString) {
+        CloseableHttpClient httpClient = null;
+        CloseableHttpResponse httpResponse = null;
+        String result = "";
+        // 创建httpClient实例
+        httpClient = HttpClients.createDefault();
+        // 创建httpPost远程连接实例
+        HttpPost httpPost = new HttpPost(url);
+        // 配置请求参数实例
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 设置连接主机服务超时时间
+                .setConnectionRequestTimeout(35000)// 设置连接请求超时时间
+                .setSocketTimeout(60000)// 设置读取数据连接超时时间
+                .build();
+        // 为httpPost实例设置配置
+        httpPost.setConfig(requestConfig);
+        // 设置请求头鉴权
+        httpPost.setHeader("x-qys-accesstoken", apptoken);
+        httpPost.setHeader("x-qys-signature", signature);
+        httpPost.setHeader("x-qys-timestamp", "0");
+        // 包含内容格式设置
+        httpPost.addHeader("Content-Type", "application/json");
+        // 封装post请求参数
+        if (null != jsonString) {
+            // 为httpPost设置封装好的请求参数
+            System.out.println("添加到实体------");
+            httpPost.setEntity(new StringEntity(jsonString, "UTF-8"));
+        }
+        try {
+            // httpClient对象执行post请求,并返回响应参数对象
+            httpResponse = httpClient.execute(httpPost);
+            // 从响应对象中获取响应内容
+            HttpEntity entity = httpResponse.getEntity();
+            result = EntityUtils.toString(entity);
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != httpResponse) {
+                try {
+                    httpResponse.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != httpClient) {
+                try {
+                    httpClient.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        result = decodeUnicode(result);
+        System.out.println(result);
+        return result;
+    }
+    /**
+     * imagePng的post请求
+     * @return
+     */
+    public static String sendPostImagePng(String url, String jsonString) {
+        CloseableHttpClient httpClient = null;
+        CloseableHttpResponse httpResponse = null;
+        String result = "";
+        // 创建httpClient实例
+        httpClient = HttpClients.createDefault();
+        // 创建httpPost远程连接实例
+        HttpPost httpPost = new HttpPost(url);
+        // 配置请求参数实例
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 设置连接主机服务超时时间
+                .setConnectionRequestTimeout(35000)// 设置连接请求超时时间
+                .setSocketTimeout(60000)// 设置读取数据连接超时时间
+                .build();
+        // 为httpPost实例设置配置
+        httpPost.setConfig(requestConfig);
+        // 设置请求头鉴权
+        httpPost.setHeader("x-qys-accesstoken", apptoken);
+        httpPost.setHeader("x-qys-signature", signature);
+        httpPost.setHeader("x-qys-timestamp", "0");
+        // 包含内容格式设置
+        httpPost.addHeader("Content-Type", "image/png");
+        // 封装post请求参数
+        if (null != jsonString) {
+            // 为httpPost设置封装好的请求参数
+            System.out.println("添加到实体------");
+            httpPost.setEntity(new StringEntity(jsonString, "UTF-8"));
+        }
+        try {
+            // httpClient对象执行post请求,并返回响应参数对象
+            httpResponse = httpClient.execute(httpPost);
+            // 从响应对象中获取响应内容
+            HttpEntity entity = httpResponse.getEntity();
+            result = EntityUtils.toString(entity);
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != httpResponse) {
+                try {
+                    httpResponse.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != httpClient) {
+                try {
+                    httpClient.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        result = decodeUnicode(result);
+        System.out.println(result);
+        return result;
+    }
+
+    public static String decodeUnicode(String asciicode) {
+        String[] asciis = asciicode.split ("\\\\u");
+        String nativeValue = asciis[0];
+        try
+        {
+            for ( int i = 1; i < asciis.length; i++ )
+            {
+                String code = asciis[i];
+                nativeValue += (char) Integer.parseInt (code.substring (0, 4), 16);
+                if (code.length () > 4)
+                {
+                    nativeValue += code.substring (4, code.length ());
+                }
+            }
+        }
+        catch (NumberFormatException e)
+        {
+            return asciicode;
+        }
+        return nativeValue;
+    }
+
+    /**
+     * 根据文件创建合同信息
+     * @param srcFile
+     * @return
+     */
+    public static HashMap getDocument(File srcFile) {
+        //截取文件后缀名
+        String substring = srcFile.getName().substring(srcFile.getName().lastIndexOf(".")+1, srcFile.getName().length());
+        //截取文件名称
+        String fileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        //添加文件参数
+        Map<String,String> formTextsMap = new HashMap<>();
+        formTextsMap.put("title",fileName);
+        formTextsMap.put("fileType",substring);
+        //创建文件数组
+        File[] files = new File[]{srcFile};
+        //访问方法
+        String documentResult = sendPost(HTTPTOP + "/v2/document/createbyfile", requestHeaderMap, formTextsMap, files, "", "");
+        HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
+
+        return hashMap;
+    }
+
+    /**
+     * 运行无效合同信息
+     * @param fileName
+     * @param invalidFile
+     * @return
+     */
+    public static String getVerticalInvalidDocument(String fileName,File invalidFile){
+        File[] files = new File[]{invalidFile};
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        //添加文件参数
+        Map<String,String> formTextsMap = new HashMap<>();
+        formTextsMap.put("title",fileName);
+        formTextsMap.put("templateId",VERTICALTEMPLATEID);
+        //访问方法
+        String documentResult = sendPost(HTTPTOP + "/document/createbytemplate", requestHeaderMap, formTextsMap, files, "", "");
+        HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
+        String code = hashMap.get("code").toString();
+        if("0".equals(code)){
+            String documentId = hashMap.get("documentId").toString();
+            return documentId;
+        }
+        return "";
+    }
+
+    /**
+     * 运行无效合同信息
+     * @param fileName
+     * @param invalidFile
+     * @return
+     */
+    public static String getAcrossVerticalInvalidDocument(String fileName,File invalidFile){
+        File[] files = new File[]{invalidFile};
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        //添加文件参数
+        Map<String,String> formTextsMap = new HashMap<>();
+        formTextsMap.put("title",fileName);
+        formTextsMap.put("templateId",ACROSSTEMPLATEID);
+        //访问方法
+        String documentResult = sendPost(HTTPTOP + "/document/createbytemplate", requestHeaderMap, formTextsMap, files, "", "");
+        HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
+        String code = hashMap.get("code").toString();
+        if("0".equals(code)){
+            String documentId = hashMap.get("documentId").toString();
+            return documentId;
+        }
+        return "";
+    }
+
+
+    public static String doGet(Map<String, String> paramMap, String url){
+        String result = "";
+        HttpGet get = new HttpGet(url);
+        try{
+            // 设置请求头鉴权
+            get.setHeader("x-qys-accesstoken", apptoken);
+            get.setHeader("x-qys-signature", signature);
+            get.setHeader("x-qys-timestamp", "0");
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            List<NameValuePair> params = setHttpParams(paramMap);
+            String param = URLEncodedUtils.format(params, "UTF-8");
+            get.setURI(URI.create(url + "?" + param));
+            HttpResponse response = httpClient.execute(get);
+            result = getHttpEntityContent(response);
+
+            if(response.getStatusLine().getStatusCode()!= HttpStatus.SC_OK){
+                result = "服务器异常";
+            }
+        } catch (Exception e){
+            System.out.println("请求异常");
+            throw new RuntimeException(e);
+        } finally{
+            get.abort();
+        }
+        result = decodeUnicode(result);
+        return result;
+    }
+
+    public static List<NameValuePair> setHttpParams(Map<String, String> paramMap){
+        List<NameValuePair> params = new ArrayList<NameValuePair>();
+        Set<Entry<String, String>> set = paramMap.entrySet();
+        for(Entry<String, String> entry : set){
+            params.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
+        }
+        return params;
+    }
+
+    public static String getHttpEntityContent(HttpResponse response) throws UnsupportedOperationException, IOException{
+        String result = "";
+        HttpEntity entity = response.getEntity();
+        if(entity != null){
+            InputStream in = entity.getContent();
+            BufferedReader br = new BufferedReader(new InputStreamReader(in, "utf-8"));
+            StringBuilder strber= new StringBuilder();
+            String line = null;
+            while((line = br.readLine())!=null){
+                strber.append(line+'\n');
+            }
+            br.close();
+            in.close();
+            result = strber.toString();
+        }
+
+        return result;
+    }
+
+    /**
+     * 根据合同编号查询签章合同对应的url访问界面
+     * @param contractId 签章合同id
+     * @param contact 签章人手机号
+     * @return
+     */
+    public static String getSignatureContractUrl( String contractId,String contact ){
+        Map map = new HashMap();
+        map.put("contractId",contractId);
+        map.put("tenantType","COMPANY");
+        map.put("tenantName","江苏兴光项目管理有限公司");
+        map.put("contact",contact);
+        String jsonString = JSON.toJSONString(map);
+        String contractIdUrl = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/signurl", jsonString);
+        HashMap signUrlHashMap = JSON.parseObject(contractIdUrl, HashMap.class);
+        String code = signUrlHashMap.get("code").toString();
+        if("0".equals(code)){
+            String signUrl = signUrlHashMap.get("signUrl").toString();
+            return signUrl;
+        }
+        return "";
+    }
+
+    /**
+     * zip文件解压
+     * @param file 需解压的文件
+     * @param destDirPath 解压文件地址
+     */
+    public static void unZipFile(File file,String destDirPath){
+        // 开始解压
+        ZipFile zipFile = null;
+        try {
+            //zipFile = new ZipFile(file);
+            //添加解压编码,解决解压报错问题
+            zipFile = new ZipFile(file, Charset.forName("GBK"));
+            Enumeration<?> entries = zipFile.entries();
+            while (entries.hasMoreElements()) {
+                ZipEntry entry = (ZipEntry) entries.nextElement();
+                System.out.println("解压" + entry.getName());
+                // 如果是文件夹,就创建个文件夹
+                if (entry.isDirectory()) {
+                    String dirPath = destDirPath + "/" + entry.getName();
+                    File dir = new File(dirPath);
+                    dir.mkdirs();
+                } else {
+                    // 如果是文件,就先创建一个文件,然后用io流把内容copy过去
+                    File targetFile = new File(destDirPath + "/" + entry.getName());
+                    // 保证这个文件的父文件夹必须要存在
+                    if(!targetFile.getParentFile().exists()){
+                        targetFile.getParentFile().mkdirs();
+                    }
+                    targetFile.createNewFile();
+                    // 将压缩文件内容写入到这个文件中
+                    InputStream is = zipFile.getInputStream(entry);
+                    FileOutputStream fos = new FileOutputStream(targetFile);
+                    int len;
+                    byte[] buf = new byte[1024];
+                    while ((len = is.read(buf)) != -1) {
+                        fos.write(buf, 0, len);
+                    }
+                    // 关流顺序,先打开的后关闭
+                    fos.close();
+                    is.close();
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if(zipFile != null){
+                try {
+                    zipFile.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+}
+

+ 47 - 0
jeeplus-modules/jeeplus-human/src/main/resources/application-human-development.yml

@@ -0,0 +1,47 @@
+# 合同管理-客户信息
+yy_apicode: 35afe9ec3263424f9a18feb837177169
+yy_mhcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseSearchByName
+yy_shcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseTicketInfo
+
+# 公共密码
+publicPassword: jsxgpassword
+#阿里云文件夹路径
+aliyun_directory: attachment-file/assess
+#签章阿里云文件bucketName
+qzBucketName: xg-qz
+#文件存储位置
+directory: /attachment-file
+
+
+
+
+#192.168.2.6签章测试参数
+apptoken: uIJQmTwyGJ
+appsecret: 2NMBqFigKoInmd43Wohxv5aEDKiiHo
+signature: 232a44ee9ebd251d119f0a65628f678e
+
+signature_http_top: http://192.168.2.130:9182
+#signature_http_top: https://3m0m810894.goho.co
+
+#会计公司圆章
+company_round_seal_finance_id: 3050351578005561392
+#离职流程id
+dimission_id: 3167367898359472980
+
+#验证码发送相关参数
+rong_userid: 8a216da86715511501673e331c24171e
+rong_token: 3d7dc58c6a334ad6887317efbf847e41
+app_id: 8a216da86715511501673e331c741725
+template_id: 435329
+code_type: 1
+
+#其他系统的地址
+CCPM_PATH:  http://localhost:8090
+#待办中展示其他系统的流程
+#ccpm =》 13、102 报销申请、39 项目登记
+CCPM_TASK:  13,102,39
+
+#各服务引用状态 =》 (若包含,则进行获取该服务的流程信息)
+INQUIRE_STATUS: ccpm
+
+CAS_PATH: http://www.casserver.com:8443

+ 39 - 0
jeeplus-modules/jeeplus-human/src/main/resources/application-human-production.yml

@@ -0,0 +1,39 @@
+
+#验证码发送相关参数
+rong_userid: 8a216da86715511501673e331c24171e
+rong_token: 3d7dc58c6a334ad6887317efbf847e41
+app_id: 8a216da86715511501673e331c741725
+template_id: 435329
+code_type: 1
+
+
+# 合同管理-客户信息
+yy_apicode: 35afe9ec3263424f9a18feb837177169
+yy_mhcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseSearchByName
+yy_shcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseTicketInfo
+
+# 公共密码
+publicPassword: jsxgpassword
+
+#阿里云文件夹路径
+aliyun_directory: attachment-file/assess
+#签章阿里云文件bucketName
+qzBucketName: xg-qz
+#文件存储位置
+directory: /attachment-file
+
+aliyunUrl: http://oss.gangwaninfo.com
+
+
+apptoken: Mt4een4BN8
+appsecret: qhA4aV2GKE8Oq8k4G3twLiUn4U60cN
+signature: 19ed90930b5b84800ea582e34b71d1dd
+
+signature_http_top: http://121.40.158.10:9182
+
+#会计公司圆章
+company_round_seal_finance_id: 2894161942659543252
+#离职流程id
+dimission_id: 3032265972836684447
+
+

+ 2 - 0
jeeplus-modules/jeeplus-human/src/main/resources/application-human.yml

@@ -0,0 +1,2 @@
+active: development
+#active: production