ApplySignHashSample.java
2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.project.demo;
import com.junziqian.api.bean.Signatory;
import com.junziqian.api.common.IdentityType;
import com.junziqian.api.request.ApplySignHashRequest;
import com.junziqian.api.response.ApplySignResponse;
import com.junziqian.api.util.LogUtils;
import java.util.HashSet;
/**
* Created by yfx on 2017-05-24 0024.
*/
public class ApplySignHashSample extends JunziqianClientInit {
public static void main(String[] args) {
ApplySignHashRequest.Builder builder = new ApplySignHashRequest.Builder();
builder.withContractName("只用保全"); //*合同名称
builder.withContractAmount(20000.00); //合同金额
builder.fromFilePath("/test3.pdf");//*使用文件取hash
//builder.fromInputStream(new ByteArrayInputStream("测试语句".getBytes()));//*使用inputstrem取hash
//builder.fromByteArray("测试语句".getBytes());//*使用byte[]取hash
//builder.fromString("测试语句");//*使用string取hash
HashSet<Signatory> signatories =new HashSet<Signatory>();
Signatory signatory = new Signatory();
signatory.setFullName("勰犇顕有限公司"); //*公司名称
signatory.setSignatoryIdentityType(IdentityType.BIZLIC); //*企业类型固定
signatory.setIdentityCard("5002401987041432"); //*营业执照或社会信用号
signatory.setMobile("1532036xxxx");//手机号
signatory.setEmail("3811xxxx@qq.com");//邮箱
signatories.add(signatory);
/*
signatory = new Signatory();
signatory.setFullName("易xx"); //*姓名
signatory.setSignatoryIdentityType(IdentityType.IDCARD); //*个人类型固定
signatory.setIdentityCard("5002401987041432"); //*证件号码
signatory.setMobile("1532036xxxx");//手机号
signatory.setEmail("38119xxx@qq.com");//邮箱
signatories.add(signatory);
*/
builder.withSignatories(signatories);
//builder.withRemark("这里是备注信息,不超过500个字符"); //备注,只查看,hash保全时,此信息不会被保全
//builder.withPreRecored("前执记录,会计录到日志中!");//备注,只查看,hash保全时,此信息不会被保全
ApplySignResponse response = getClient().applySignHash(builder.build());
LogUtils.logResponse(response);
}
}