|
|
@@ -6,10 +6,13 @@ import com.tencentcloudapi.common.profile.ClientProfile;
|
|
|
import com.tencentcloudapi.common.profile.HttpProfile;
|
|
|
import com.tencentcloudapi.essbasic.v20210526.EssbasicClient;
|
|
|
import com.tencentcloudapi.essbasic.v20210526.models.*;
|
|
|
+import common.BaseClass;
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Base64;
|
|
|
import java.util.HashMap;
|
|
|
@@ -21,7 +24,7 @@ import static restcontroller.webmanage.sale.contracttask.WeChatConfig.*;
|
|
|
/**
|
|
|
* 微信电子签工具类
|
|
|
*/
|
|
|
-public class WeChatContractUtil {
|
|
|
+public class WeChatContractUtil extends BaseClass {
|
|
|
|
|
|
Credential cred;
|
|
|
HttpProfile httpProfile;
|
|
|
@@ -312,8 +315,8 @@ public class WeChatContractUtil {
|
|
|
BuildFormField("licenseaddress", companyInfo.getLicenseaddress()),
|
|
|
BuildFormField("areaname", companyInfo.getAreaname()),
|
|
|
BuildFormField("taskmoney", companyInfo.getTaskmoney()),
|
|
|
- BuildFormField("begindate", companyInfo.getBegindate()),
|
|
|
- BuildFormField("enddate", companyInfo.getEnddate()),
|
|
|
+ BuildFormField("begindate", getDateTimeStr(companyInfo.getBegindate())),
|
|
|
+ BuildFormField("enddate", getDateTimeStr(companyInfo.getEnddate())),
|
|
|
BuildFormField("securitydeposit", companyInfo.getSecuritydeposit()),
|
|
|
BuildFormField("taxno", companyInfo.getTaxno()),
|
|
|
BuildFormField("legalrep", companyInfo.getLegalrep()),
|
|
|
@@ -415,7 +418,7 @@ public class WeChatContractUtil {
|
|
|
/**
|
|
|
* 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
|
|
|
*
|
|
|
- * @param filePath 文件路径
|
|
|
+ * @param inputStream 文件路径
|
|
|
* @return FlowInfo
|
|
|
*/
|
|
|
public static String convertImageFileToBase64(InputStream inputStream) {
|
|
|
@@ -507,10 +510,28 @@ public class WeChatContractUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static void main(String[] args) throws TencentCloudSDKException {
|
|
|
+ /**
|
|
|
+ * 将日期字符串转换为中文格式
|
|
|
+ *
|
|
|
+ * @param dateStr
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static String getDateTimeStr(String dateStr) {
|
|
|
+ DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ LocalDate date = LocalDate.parse(dateStr, inputFormatter);
|
|
|
+ DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
|
|
|
+ return date.format(outputFormatter);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
String[] flowIds = {"yD3g7UUckpmzhmhtU1UyFt71fypQygwg"};
|
|
|
|
|
|
- DescribeTemplatesResponse res = getTemplateList(SuperProxyOperatorOpenId);
|
|
|
+ DescribeTemplatesResponse res = null;
|
|
|
+ try {
|
|
|
+ res = getTemplateList(SuperProxyOperatorOpenId);
|
|
|
+ } catch (TencentCloudSDKException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
|
|
|
System.err.println(DescribeTemplatesResponse.toJsonString(res));
|
|
|
}
|