diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java
index 6094355..cbc0f7b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java
@@ -27,17 +27,12 @@ public class AdjudicationController extends BaseController {
/**
* 裁决书送达(电子邮件)
- * @param id 案件id
- * @param appEmail 申请人邮箱
- * @param resEmail 被申请人邮箱
- * @param apptrackingNum 申请人快递单号
- * @param restrackingNum 被申请人快递单号
+ * @param bookSendVO
* @return
*/
@PostMapping("/delivery")
- public AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail
- ,String apptrackingNum,String restrackingNum){
- return adjudicationService.sendDocumentByEmail(id,appEmail,resEmail,apptrackingNum,restrackingNum);
+ public AjaxResult sendDocumentByEmail(@RequestBody BookSendVO bookSendVO){
+ return adjudicationService.sendDocumentByEmail(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum());
}
/**
@@ -79,4 +74,13 @@ public class AdjudicationController extends BaseController {
public AjaxResult service(@RequestBody BookSendVO bookSendVO){
return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum());
}
+ /**
+ * 用印(暂时只改案件状态)
+ * @param caseApplication
+ * @return
+ */
+ @PostMapping("/stamp")
+ public AjaxResult stamp(@Validated @RequestBody CaseApplication caseApplication){
+ return adjudicationService.stamp(caseApplication);
+ }
}
diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml
index 3b55c2b..77e53b1 100644
--- a/ruoyi-common/pom.xml
+++ b/ruoyi-common/pom.xml
@@ -183,7 +183,10 @@
mail
1.4.7
-
+
+ org.apache.httpcomponents
+ httpclient
+
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/EsignDemoConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/EsignDemoConfig.java
new file mode 100644
index 0000000..f9888e2
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/EsignDemoConfig.java
@@ -0,0 +1,13 @@
+package com.ruoyi.common.config;
+
+public class EsignDemoConfig {
+
+ // 应用ID
+ public static final String EsignAppId = "7438987614";
+ // 应用密钥
+ public static final String EsignAppSecret = "9d7844f13830931037772b9d20cf1529";
+ // e签宝接口调用域名(模拟环境)
+ public static final String EsignHost = "https://smlopenapi.esign.cn";
+ // e签宝接口调用域名(正式环境)
+ // public static final String EsignHost = "https://openapi.esign.cn";
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignEncryption.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignEncryption.java
new file mode 100644
index 0000000..ade398b
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignEncryption.java
@@ -0,0 +1,371 @@
+/*
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package com.ruoyi.common.constant;
+import com.ruoyi.common.exception.EsignDemoException;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.http.message.BasicNameValuePair;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
+import java.security.InvalidKeyException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.text.Collator;
+import java.text.MessageFormat;
+import java.util.*;
+
+/**
+ * @description 请求数据通用处理类
+ * @author 澄泓
+ * @date 2020年10月22日 下午14:25:31
+ * @since JDK1.7
+ */
+public class EsignEncryption {
+
+ /**
+ * 不允许外部创建实例
+ */
+ private EsignEncryption(){}
+
+ /**
+ * 拼接待签名字符串
+ * @param httpMethod
+ * @param url
+ * @return
+ */
+ public static String appendSignDataString(String httpMethod, String contentMd5,String accept,String contentType,String headers,String date, String url) throws EsignDemoException {
+ StringBuffer sb = new StringBuffer();
+ sb.append(httpMethod).append("\n").append(accept).append("\n").append(contentMd5).append("\n")
+ .append(contentType).append("\n");
+
+ if ("".equals(date) || date == null) {
+ sb.append("\n");
+ } else {
+ sb.append(date).append("\n");
+ }
+ if ("".equals(headers) || headers == null) {
+ sb.append(url);
+ } else {
+ sb.append(headers).append("\n").append(url);
+ }
+ return new String(sb);
+ }
+
+ /***
+ * Content-MD5的计算方法
+ * @param str 待计算的消息
+ * @return MD5计算后摘要值的Base64编码(ContentMD5)
+ * @throws EsignDemoException 加密过程中的异常信息
+ */
+ public static String doContentMD5(String str) throws EsignDemoException {
+ byte[] md5Bytes = null;
+ MessageDigest md5 = null;
+ String contentMD5 = null;
+ try {
+ md5 = MessageDigest.getInstance("MD5");
+ // 计算md5函数
+ md5.update(str.getBytes("UTF-8"));
+ // 获取文件MD5的二进制数组(128位)
+ md5Bytes = md5.digest();
+ // 把MD5摘要后的二进制数组md5Bytes使用Base64进行编码(而不是对32位的16进制字符串进行编码)
+ contentMD5 = Base64.encodeBase64String(md5Bytes);
+
+ } catch (NoSuchAlgorithmException e) {
+ EsignDemoException ex = new EsignDemoException("不支持此算法",e);
+ ex.initCause(e);
+ throw ex;
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+ return contentMD5;
+ }
+
+ /***
+ * 计算请求签名值-HmacSHA256摘要
+ * @param message 待签名字符串
+ * @param secret 密钥APP KEY
+ * @return reqSignature HmacSHA256计算后摘要值的Base64编码
+ * @throws EsignDemoException 加密过程中的异常信息
+ */
+ public static String doSignatureBase64(String message, String secret) throws EsignDemoException {
+ String algorithm = "HmacSHA256";
+ Mac hmacSha256;
+ String digestBase64 = null;
+ try {
+ hmacSha256 = Mac.getInstance(algorithm);
+ byte[] keyBytes = secret.getBytes("UTF-8");
+ byte[] messageBytes = message.getBytes("UTF-8");
+ hmacSha256.init(new SecretKeySpec(keyBytes, 0, keyBytes.length, algorithm));
+ // 使用HmacSHA256对二进制数据消息Bytes计算摘要
+ byte[] digestBytes = hmacSha256.doFinal(messageBytes);
+ // 把摘要后的结果digestBytes使用Base64进行编码
+ digestBase64 = Base64.encodeBase64String(digestBytes);
+ } catch (NoSuchAlgorithmException e) {
+ EsignDemoException ex = new EsignDemoException("不支持此算法",e);
+ ex.initCause(e);
+ throw ex;
+ } catch (InvalidKeyException e) {
+ EsignDemoException ex = new EsignDemoException("无效的密钥规范",e);
+ ex.initCause(e);
+ throw ex;
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+ return digestBase64;
+ }
+
+ /**
+ * 获取时间戳
+ * @return
+ */
+ public static String timeStamp() {
+ long timeStamp = System.currentTimeMillis();
+ return String.valueOf(timeStamp);
+ }
+
+ /**
+ * byte字节数组转换成字符串
+ * @param b
+ * @return
+ */
+ public static String byteArrayToHexString(byte[] b) {
+ StringBuilder hs = new StringBuilder();
+ String stmp;
+ for (int n = 0; b != null && n < b.length; n++) {
+ stmp = Integer.toHexString(b[n] & 0XFF);
+ if (stmp.length() == 1)
+ hs.append('0');
+ hs.append(stmp);
+ }
+ return hs.toString().toLowerCase();
+ }
+
+ /**
+ * hash散列加密算法
+ * @return
+ */
+ public static String Hmac_SHA256(String message,String key) throws EsignDemoException {
+ byte[] rawHmac=null;
+ try {
+ SecretKeySpec sk = new SecretKeySpec(key.getBytes(), "HmacSHA256");
+ Mac mac = Mac.getInstance("HmacSHA256");
+ mac.init(sk);
+ rawHmac = mac.doFinal(message.getBytes());
+ }catch (InvalidKeyException e){
+ EsignDemoException ex = new EsignDemoException("无效的密钥规范",e);
+ ex.initCause(e);
+ throw ex;
+ } catch (NoSuchAlgorithmException e) {
+ EsignDemoException ex = new EsignDemoException("不支持此算法",e);
+ ex.initCause(e);
+ throw ex;
+ }catch (Exception e){
+ EsignDemoException ex = new EsignDemoException("hash散列加密算法报错",e);
+ ex.initCause(e);
+ throw ex;
+ }finally {
+ return byteArrayToHexString(rawHmac);
+ }
+
+ }
+
+ /**
+ * MD5加密32位
+ */
+ public static String MD5Digest(String text) throws EsignDemoException {
+ byte[] digest=null;
+ try {
+ MessageDigest md5 = MessageDigest.getInstance("MD5");
+ md5.update(text.getBytes());
+ digest = md5.digest();
+ }catch (NoSuchAlgorithmException e){
+ EsignDemoException ex = new EsignDemoException("不支持此算法",e);
+ ex.initCause(e);
+ throw ex;
+ }finally {
+ return byteArrayToHexString(digest);
+ }
+
+ }
+
+ public static void formDataSort(List param) {
+ Collections.sort(param, new Comparator() {
+ @Override
+ public int compare(BasicNameValuePair o1, BasicNameValuePair o2) {
+ Comparator