| | |
| | | /** |
| | | * 发起签约 (君子签后台配置模版ID发起) |
| | | */ |
| | | public void testApplySign(){ |
| | | public String testApplySign(){ |
| | | String url=SERVICE_URL+"/v2/sign/applySign"; |
| | | initParams(); |
| | | Map<String, Object> params=bodyParams; |
| | | params.put("contractName","测试合同发起"); //合同名称 |
| | | params.put("serverCa",1); //使用云证书 |
| | | params.put("file",new File("D://test.pdf")); |
| | | params.put("file",new File("D://test2.pdf")); |
| | | params.put("dealType",5); //指定合同文件签署方式 5 为部分自动签 |
| | | params.put("positionType",0); //指定通过表单域方式设置签字位置 |
| | | params.put("positionType",2); //指定通过表单域方式设置签字位置 |
| | | params.put("fileType",0); |
| | | params.put("needQifengSign",1); |
| | | JSONArray signatories=new JSONArray(); |
| | |
| | | j.put("page","1"); |
| | | j.put("page","1"); |
| | | array.add(j); |
| | | sReq.setChapteJson("[{\"page\":0,\"chaptes\":[{\"offsetX\":0.12,\"offsetY\":0.23}]},{\"page\":1,\"chaptes\":[{\"offsetX\":0.45,\"offsetY\":0.67}]}]"); |
| | | sReq.setSearchKey("投保人签字(盖章):;投保人(签章):"); |
| | | // sReq.setChapteJson("[{\"page\":0,\"chaptes\":[{\"offsetX\":0.12,\"offsetY\":0.23}]},{\"page\":1,\"chaptes\":[{\"offsetX\":0.45,\"offsetY\":0.67}]}]"); |
| | | sReq.setNoNeedVerify(1); |
| | | sReq.setSearchConvertExtend("{\"fixX\":10,\"fixY\":-50}"); |
| | | // sReq.setChapteName("ebq"); //企业盖章位置 |
| | | signatories.add(sReq); |
| | | params.put("signatories",signatories.toJSONString()); |
| | | System.out.println(signatories.toJSONString()); |
| | | String str= HttpClientUtils.init().getPost(url,null,params,true); |
| | | System.out.println(str); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | if(json!=null && json.getBoolean("success")){ |
| | | return json.getString("data"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取签署链接地址 |
| | | */ |
| | | public void testlink() { |
| | | public void testlink(String no) { |
| | | initParams(); |
| | | Map<String, Object> params = bodyParams; |
| | | String url = SERVICE_URL + "/v2/sign/link"; |
| | | params.put("applyNo","APL1747073129375088640"); //发起合同签署接口返回的APL编号 |
| | | params.put("applyNo",no); //发起合同签署接口返回的APL编号 |
| | | params.put("fullName","安徽豆米科技有限公司"); //发起合同签署接口需要手动签署对象的姓名 |
| | | params.put("identityCard","913401000967388938"); //发起合同签署接口中需要手动签署对象的证件号 |
| | | params.put("identityType",11); //证件类型,个人1 ,企业11 |
| | |
| | | |
| | | } |
| | | System.out.println(str); |
| | | } |
| | | |
| | | /** |
| | | * 上传企业自定义印章(返回印章ID) |
| | | * @param signName |
| | | * @param signImgFile |
| | | */ |
| | | public String uploadEntSign(String signName,File signImgFile,String email ) { |
| | | |
| | | try { |
| | | initParams(); |
| | | Map<String, Object> params = bodyParams; |
| | | String url = SERVICE_URL + "/v2/user/uploadEntSign"; |
| | | //构建请求参数 |
| | | params.put("signName",signName); |
| | | params.put("signImgFile",signImgFile); |
| | | params.put("email",email); |
| | | String str= HttpClientUtils.init().getPost(url,null,params,true); |
| | | System.out.println(str); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | if(json!=null && json.getBoolean("success")){ |
| | | return json.getString("data"); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * 获取签署链接地址 |
| | |
| | | public static void main(String[] args) { |
| | | // new JzqHttpApiTest().testOrganizationCreate(); |
| | | // new JzqHttpApiTest().testOrganizationAuditStatus(); |
| | | // new JzqHttpApiTest().testApplySign(); |
| | | // new JzqHttpApiTest().testlink(); |
| | | new JzqHttpApiTest().testlinkFile(); |
| | | new JzqHttpApiTest().uploadEntSign("豆米科技公章新",new File("D://sing.png"),"jp@doumee.com"); |
| | | |
| | | new JzqHttpApiTest().testlink( new JzqHttpApiTest().testApplySign()); |
| | | // new JzqHttpApiTest().testlinkFile(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "版本号") |
| | | @ExcelColumn(name="版本号") |
| | | private String version; |
| | | @ApiModelProperty(value = "签字位置关键字,多个英文逗号隔开") |
| | | @ExcelColumn(name="签字位置关键字,多个英文逗号隔开") |
| | | private String signKeyword; |
| | | |
| | | @ApiModelProperty(value = "记录类型 0基表数据 1历史版本数据", example = "1") |
| | | @ExcelColumn(name="记录类型 0基表数据 1历史版本数据") |
| | |
| | | * @param email |
| | | * @param postionJson |
| | | */ |
| | | public String applySign(String name,File file,String fullname,String creditCoe,String email,String postionJson){ |
| | | public String applySign(String name,File file,String fullname,String creditCoe,String email,String postionJson,String singId){ |
| | | try { |
| | | String url=SERVICE_URL+"/v2/sign/applySign"; |
| | | Map<String, Object> params=bodyParams; |
| | |
| | | params.put("serverCa",1); //使用云证书 |
| | | params.put("file",file); |
| | | params.put("dealType",5); //指定合同文件签署方式 5 为部分自动签 |
| | | params.put("positionType",0); //指定通过表单域方式设置签字位置 |
| | | params.put("positionType",1); //指定通过表单域方式设置签字位置 |
| | | params.put("fileType",0); |
| | | params.put("needQifengSign",1); |
| | | JSONArray signatories=new JSONArray(); |
| | |
| | | sReq.setIdentityCard(creditCoe);//营业执照号 |
| | | sReq.setEmail(email); //在君子签注册认证的邮箱 |
| | | // sReq.setChapteJson("[{\"page\":0,\"chaptes\":[{\"offsetX\":0.12,\"offsetY\":0.23}]},{\"page\":1,\"chaptes\":[{\"offsetX\":0.45,\"offsetY\":0.67}]}]"); |
| | | sReq.setChapteJson(postionJson); |
| | | // sReq.setChapteJson(postionJson); |
| | | sReq.setSearchKey(postionJson); |
| | | sReq.setSignId(singId); |
| | | sReq.setNoNeedVerify(1); |
| | | signatories.add(sReq); |
| | | params.put("signatories",signatories.toJSONString()); |
| | |
| | | * @param signName |
| | | * @param signImgFile |
| | | */ |
| | | public String uploadEntSign(String signName,File signImgFile ) { |
| | | public String uploadEntSign(String signName,File signImgFile,String email ) { |
| | | |
| | | try { |
| | | Map<String, Object> params = bodyParams; |
| | |
| | | //构建请求参数 |
| | | params.put("signName",signName); |
| | | params.put("signImgFile",signImgFile); |
| | | params.put("email",email); |
| | | String str= HttpClientUtils.init().getPost(url,null,params,true); |
| | | System.out.println(str); |
| | | saveInterfaceLog(url,"【电子签】上传企业自定义印章",JSONObject.toJSONString(params),str); |