Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
752fc00837 | ||
|
|
b78065223b | ||
|
|
e8785fd5b2 | ||
|
|
d5fed7fdce | ||
|
|
8ceaf7478c | ||
|
|
80b4d6c91b | ||
|
|
b741879d5a | ||
|
|
5e0a84ae10 | ||
|
|
b89a6ea218 | ||
|
|
69e6b062d7 | ||
|
|
d40fbccf24 | ||
|
|
5cddef6000 | ||
|
|
382615570f | ||
|
|
324c7234f8 | ||
|
|
24f15d8236 | ||
|
|
13ac2ef8ba | ||
|
|
3994ca3e77 | ||
|
|
87eb8c6cdf | ||
|
|
9aa2ff00eb | ||
|
|
fdc27a38e2 | ||
|
|
f745fdd0aa | ||
|
|
4c93945eaf | ||
|
|
ec864b2b8e | ||
|
|
f7fcfb3193 | ||
|
|
adf87c8ec2 | ||
|
|
aa2e6af52c | ||
|
|
e09da313e0 | ||
|
|
4b8a127cd2 | ||
|
|
90578ca29e | ||
|
|
f7fe71a2d5 | ||
|
|
fd4a156e25 | ||
|
|
5bacc37dd7 | ||
|
|
a7b7ea826f | ||
|
|
0c6b0a2bae | ||
|
|
01fd6157e1 | ||
|
|
e382c59b6b | ||
|
|
373486d54a | ||
|
|
d802c83135 | ||
|
|
b0d77ea3e4 | ||
|
|
e1422ce1c8 | ||
|
|
e296be59b9 | ||
|
|
d1093d9717 | ||
|
|
2b3a0d30c7 | ||
|
|
f7b599e200 | ||
|
|
af901190b9 | ||
|
|
db5a2e44e6 | ||
|
|
9d166377cb | ||
|
|
f0f65d0cf0 | ||
|
|
2eed2bd0a9 | ||
|
|
a43ded3a85 | ||
|
|
0fe872e42f | ||
|
|
4d4ab28c40 | ||
|
|
35ca824390 | ||
|
|
62f1e3111d | ||
|
|
7b6bca31ba | ||
|
|
07704327ab | ||
|
|
db885dfcc8 | ||
|
|
2d86bbb5e8 | ||
|
|
6db0bbc341 | ||
|
|
5ec64621fe | ||
|
|
8b60af90ab | ||
|
|
a4c1cad581 | ||
|
|
d323fa69af | ||
|
|
56b4d3fcfc | ||
|
|
a9af3ebdbb | ||
|
|
4618bfbc4e | ||
|
|
4c190bd9a7 | ||
|
|
7bc9b1d4cb | ||
|
|
df98af33ba | ||
|
|
464bf5c428 | ||
|
|
62878cb969 | ||
|
|
0f7b9842bb | ||
|
|
1cce787e62 | ||
|
|
3dc4ad7433 | ||
|
|
9644ae737d | ||
|
|
7eb500d071 | ||
|
|
848581e155 | ||
|
|
80e9814cd6 | ||
|
|
2374e69b06 | ||
|
|
6f892e90b9 | ||
|
|
fb4fefb697 | ||
|
|
056d3e103d | ||
|
|
ef6973ff50 | ||
|
|
bb1f5f61ab | ||
|
|
f291935cc3 | ||
|
|
05ece42912 | ||
|
|
8e18e5d16c | ||
|
|
69ffd18af6 | ||
|
|
ba49e0e018 | ||
|
|
061afe4cf4 | ||
|
|
7afc024819 | ||
|
|
66ac29f692 | ||
|
|
f5d460eb80 | ||
|
|
3a8b23f482 | ||
|
|
9b78889f25 | ||
|
|
3ac8143589 | ||
|
|
7e8d1f3d06 | ||
|
|
1e5dc3670f | ||
|
|
42d28ea80f | ||
|
|
2a147f119e | ||
|
|
5e07c8010f | ||
|
|
c484a45822 | ||
|
|
724d723cdc | ||
|
|
626ec17b45 | ||
|
|
c60ad9f3fc | ||
|
|
9367e66432 | ||
|
|
657ddb761a | ||
|
|
9622060ac6 | ||
|
|
f0bab6a368 | ||
|
|
3fc79deee0 | ||
|
|
32a0937e84 | ||
|
|
e97418f979 | ||
|
|
3be770a718 | ||
|
|
d52ecca5dc | ||
|
|
3132a52f2a | ||
|
|
b4549fa2cc | ||
|
|
672e85fe22 | ||
|
|
da742f7dc7 | ||
|
|
1f6c743356 | ||
|
|
5a0d1dbe0b | ||
|
|
12a40e76d9 | ||
|
|
b4e37d6c8b | ||
|
|
441dc6f8db | ||
|
|
76847fafb1 | ||
|
|
be7004adc8 | ||
|
|
538d8eaede | ||
|
|
cf93e86a0c | ||
|
|
411d0e9ad9 | ||
|
|
a23b662332 | ||
|
|
b8290279fc | ||
|
|
23b9caa8f2 | ||
|
|
361f283a15 | ||
|
|
34867898b9 | ||
|
|
42459eca60 | ||
|
|
66d4c9ef0e | ||
|
|
ada0e3740a | ||
|
|
c8d1054640 | ||
|
|
0d6a9dd348 | ||
|
|
17e58da34d | ||
|
|
f515f18ac5 | ||
|
|
cc0004bab9 | ||
|
|
347ab0cb5d | ||
|
|
8004470a07 | ||
|
|
b36eec08aa | ||
|
|
5e9a002cd1 | ||
|
|
bee394b8c2 | ||
|
|
dbd0715c69 | ||
|
|
f5d55707a9 | ||
|
|
a5fd491e6c | ||
|
|
8766ec4639 | ||
|
|
273f40bb86 | ||
|
|
71a6f04ce0 | ||
|
|
b6663dc604 | ||
|
|
35991eed9f | ||
|
|
4431065e8f | ||
|
|
e33e3c5569 | ||
|
|
9eae44bc89 | ||
|
|
6485807346 | ||
|
|
236358c237 | ||
|
|
704a35f473 | ||
|
|
b47e4899a1 | ||
|
|
dd48e1f458 | ||
|
|
3fb9bf8f90 | ||
|
|
88696a2d0e | ||
|
|
0611cac92f | ||
|
|
4135d1096c | ||
|
|
6945dfd7b1 | ||
|
|
c74f16a418 | ||
|
|
6917827348 | ||
|
|
cf251ebd28 | ||
|
|
c5054948f1 | ||
|
|
32856e223a | ||
|
|
9c95738251 | ||
|
|
08b6413634 | ||
|
|
f62373675d | ||
|
|
695aff6bce | ||
|
|
1a4ffa5bee | ||
|
|
14075b3f3f | ||
|
|
49d611b971 | ||
|
|
5311b1dc3d | ||
|
|
6548f00ab0 | ||
|
|
1e362973a5 | ||
|
|
7959deea83 | ||
|
|
8c4094706d | ||
|
|
25c201b472 | ||
|
|
04d9172cce | ||
|
|
113d5b99bb | ||
|
|
857ae6a0a1 | ||
|
|
3028291cce | ||
|
|
891c67f39f | ||
|
|
30d6828707 | ||
|
|
60d2b490c2 | ||
|
|
aa351abd15 | ||
|
|
67ccbbd4f7 | ||
|
|
b4fb054a7f | ||
|
|
d38737f642 | ||
|
|
b43f38c9dd | ||
|
|
5662d2f2f5 | ||
|
|
4d2d8b0976 | ||
|
|
362d433bb3 |
+59
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>pay</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
<version>2.7.10</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.22</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.72</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.4.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.34.8.ALL</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.ruoyi;
|
||||
|
||||
/**
|
||||
* 业务回调处理接口
|
||||
*/
|
||||
public interface CallBackService {
|
||||
|
||||
/**
|
||||
* 成功支付--处理业务逻辑
|
||||
* @param orderSn 订单号
|
||||
*/
|
||||
void successPay(String orderSn);
|
||||
|
||||
/**
|
||||
* 失败支付-处理业务逻辑
|
||||
* @param orderSn 订单号
|
||||
*/
|
||||
void failPay(String orderSn);
|
||||
|
||||
/**
|
||||
* 退款成功-处理业务逻辑
|
||||
* @param orderSn 订单号
|
||||
*/
|
||||
void successRefund(String orderSn);
|
||||
|
||||
/**
|
||||
* 退款失败-处理业务逻辑
|
||||
* @param orderSn 订单号
|
||||
*/
|
||||
void failRefund(String orderSn);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.ruoyi;
|
||||
|
||||
|
||||
import com.ruoyi.dto.*;
|
||||
import com.ruoyi.exceptions.TradeException;
|
||||
|
||||
public interface ElegentPay {
|
||||
|
||||
|
||||
/**
|
||||
* 统一下单接口
|
||||
* @param payRequest 支付请求
|
||||
* @param tradeType 交易类型
|
||||
* @param platform 平台
|
||||
* @return 支付响应
|
||||
* @throws TradeException
|
||||
*/
|
||||
PayResponse requestPay(PayRequest payRequest, String tradeType, String platform) throws TradeException;
|
||||
|
||||
|
||||
/**
|
||||
* 关闭订单
|
||||
* @param orderSn 订单号
|
||||
* @param platform 平台
|
||||
* @return 是否成功关闭订单
|
||||
* @throws TradeException
|
||||
*/
|
||||
Boolean closePay(String orderSn, String platform) throws TradeException;
|
||||
|
||||
/**
|
||||
* 退款
|
||||
* @param refundRequest 退款请求封装对象
|
||||
* @param platform 平台
|
||||
* @return 是否成功退款
|
||||
* @throws TradeException
|
||||
*/
|
||||
Boolean refund(RefundRequest refundRequest, String platform) throws TradeException;
|
||||
|
||||
/**
|
||||
* 根据订单号查询订单
|
||||
* @param orderSn 订单号
|
||||
* @param platform 平台
|
||||
* @return 查询响应对象
|
||||
* @throws TradeException
|
||||
*/
|
||||
QueryResponse queryTradingOrderNo(String orderSn , String platform) throws TradeException;
|
||||
|
||||
|
||||
/**
|
||||
* 查询单笔退款API
|
||||
* @param orderSn 订单号
|
||||
* @param platform 平台
|
||||
* @return 查询退款响应对象
|
||||
* @throws TradeException
|
||||
*/
|
||||
QueryRefundResponse queryRefundTrading(String orderSn , String platform) throws TradeException;
|
||||
|
||||
|
||||
/**
|
||||
* 获得openID
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public String getOpenid(String code, String platform);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.ruoyi.ali;
|
||||
|
||||
import com.ruoyi.key.KeyManager;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 支付宝权限对接类
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties("elegent.pay.alipay")
|
||||
@Data
|
||||
public class AlipayConfig {
|
||||
/**
|
||||
* 应用识别码
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 密钥加密方式 RSA2
|
||||
*/
|
||||
@Value("${elegent.pay.alipay.charset:RSA2}")
|
||||
private String signType;
|
||||
|
||||
@Autowired
|
||||
private KeyManager keyManager;
|
||||
|
||||
public String getPrivateKey(){
|
||||
return keyManager.getKey("alipay_private.key");
|
||||
}
|
||||
|
||||
public String getPublicKey(){
|
||||
return keyManager.getKey("alipay_public.key");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ruoyi.ali;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ZFBConstant
|
||||
* @description 支付宝相关的常量
|
||||
*/
|
||||
public class AlipayConstant {
|
||||
|
||||
public static final String SUCCESS = "SUCCESS";
|
||||
|
||||
public static final String FAIL = "FAIL";
|
||||
|
||||
/**
|
||||
* 交易状态(用于转换)
|
||||
*/
|
||||
public static final Map<String,String> TRADE_STATE = new HashMap<String,String>(){
|
||||
{
|
||||
put("TRADE_SUCCESS", "SUCCESS");
|
||||
put("WAIT_BUYER_PAY", "NOTPAY");
|
||||
put("TRADE_CLOSED", "CLOSED");
|
||||
put("TRADE_FINISHED", "FINISHED");
|
||||
}
|
||||
};
|
||||
|
||||
public static final String domain="https://openapi.alipay.com/gateway.do";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,461 @@
|
||||
package com.ruoyi.ali;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.request.*;
|
||||
import com.alipay.api.response.*;
|
||||
import com.ruoyi.CallBackService;
|
||||
import com.ruoyi.annotation.TradePlatform;
|
||||
import com.ruoyi.config.CallbackConfig;
|
||||
import com.ruoyi.constant.PayConstant;
|
||||
import com.ruoyi.constant.Platform;
|
||||
import com.ruoyi.constant.TradeType;
|
||||
import com.ruoyi.core.ElegentTrade;
|
||||
import com.ruoyi.dto.*;
|
||||
import com.ruoyi.exceptions.TradeException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 支付宝支付的策略类
|
||||
* @author wgl
|
||||
*/
|
||||
@Service
|
||||
@TradePlatform(Platform.ALI)
|
||||
@Slf4j
|
||||
public class AlipayElegentTrade implements ElegentTrade {
|
||||
|
||||
@Autowired
|
||||
private AlipayConfig alipayConfig;
|
||||
|
||||
@Autowired
|
||||
private CallbackConfig callbackConfig;
|
||||
|
||||
@Autowired
|
||||
private CallBackService callBackService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取回调地址
|
||||
* @return
|
||||
*/
|
||||
private String getPayNotifyUrl(){
|
||||
return callbackConfig.getDomain()+ PayConstant.CALLBACK_PATH+ PayConstant.NOTIFY +"/"+ Platform.ALI;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退款回调
|
||||
* @return
|
||||
*/
|
||||
private String getRefundNotifyUrl(){
|
||||
return callbackConfig.getDomain()+ PayConstant.CALLBACK_PATH+ PayConstant.REFUND_NOTIFY +"/"+ Platform.ALI;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 创建支付订单
|
||||
* @param payRequest
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
@Override
|
||||
public PayResponse requestPay(PayRequest payRequest, String tradeType) throws TradeException {
|
||||
if(TradeType.NATIVE.equals( tradeType )){
|
||||
return createNativeOrder(payRequest);
|
||||
}
|
||||
if(TradeType.JSAPI.equals( tradeType )){
|
||||
return createJsApiOrder(payRequest);
|
||||
}
|
||||
if(TradeType.H5.equals( tradeType )){
|
||||
return createH5Order(payRequest);
|
||||
}
|
||||
if(TradeType.APP.equals( tradeType )){
|
||||
return createAPPOrder(payRequest);
|
||||
}
|
||||
return createNativeOrder(payRequest);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 本地支付(扫码)
|
||||
* https://opendocs.alipay.com/open/194/106078?ref=api#预下单
|
||||
* @param payRequest
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
private PayResponse createNativeOrder(PayRequest payRequest) throws TradeException {
|
||||
try {
|
||||
AlipayClient alipayClient = getAliHttpClient();
|
||||
AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
|
||||
|
||||
request.setNotifyUrl(getPayNotifyUrl());
|
||||
|
||||
JSONObject bizContent = new JSONObject();
|
||||
bizContent.put("out_trade_no", payRequest.getOrderSn());
|
||||
//转换
|
||||
//String totalFee= BigDecimal.valueOf(payRequest.getTotalFee()).divide(new BigDecimal(100) ).toString();
|
||||
bizContent.put("total_amount", fenToYuan(payRequest.getTotalFee()));
|
||||
bizContent.put("subject", payRequest.getBody());
|
||||
request.setBizContent(bizContent.toString());
|
||||
AlipayTradePrecreateResponse response = alipayClient.execute(request);
|
||||
|
||||
if (response.isSuccess()) {
|
||||
PayResponse payResponse =new PayResponse();
|
||||
payResponse.setSuccess(true);
|
||||
payResponse.setCode_url(response.getQrCode()); //本地支付二维码
|
||||
payResponse.setOrder_sn(payRequest.getOrderSn());
|
||||
return payResponse;
|
||||
} else {
|
||||
log.error("调用失败");
|
||||
return null;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new TradeException("订单创建失败,订单号:"+ payRequest.getOrderSn());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 小程序
|
||||
* https://opendocs.alipay.com/mini/03l5wn
|
||||
* @param payRequest
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
private PayResponse createJsApiOrder(PayRequest payRequest) throws TradeException {
|
||||
AlipayClient alipayClient = getAliHttpClient();
|
||||
try {
|
||||
AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();
|
||||
request.setNotifyUrl(getPayNotifyUrl());
|
||||
JSONObject bizContent = new JSONObject();
|
||||
bizContent.put("out_trade_no", payRequest.getOrderSn());
|
||||
bizContent.put("total_amount", fenToYuan( payRequest.getTotalFee() ));
|
||||
bizContent.put("subject", payRequest.getBody());
|
||||
bizContent.put("buyer_id", payRequest.getOpenid());
|
||||
bizContent.put("timeout_express", "10m");
|
||||
request.setBizContent(bizContent.toString());
|
||||
AlipayTradeCreateResponse response = alipayClient.sdkExecute(request);
|
||||
if (response.isSuccess()) {
|
||||
PayResponse payResponse =new PayResponse();
|
||||
payResponse.setSuccess(true);
|
||||
payResponse.setPrepay_id(response.getTradeNo());
|
||||
payResponse.setOrder_sn(response.getOutTradeNo());
|
||||
return payResponse;
|
||||
} else {
|
||||
log.error("调用失败");
|
||||
return null;
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new TradeException("订单创建失败,订单号:"+ payRequest.getOrderSn());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* H5
|
||||
* https://opendocs.alipay.com/mini/03l5wn
|
||||
* @param payRequest
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
private PayResponse createH5Order(PayRequest payRequest) throws TradeException {
|
||||
AlipayClient alipayClient = getAliHttpClient();
|
||||
try {
|
||||
AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
|
||||
request.setNotifyUrl(getPayNotifyUrl());
|
||||
request.setReturnUrl("");
|
||||
JSONObject bizContent = new JSONObject();
|
||||
bizContent.put("out_trade_no", payRequest.getOrderSn());
|
||||
bizContent.put("total_amount", fenToYuan( payRequest.getTotalFee() ));
|
||||
bizContent.put("subject", payRequest.getBody());
|
||||
bizContent.put("product_code", "QUICK_WAP_WAY");
|
||||
|
||||
request.setBizContent(bizContent.toString());
|
||||
AlipayTradeWapPayResponse response = alipayClient.pageExecute(request);
|
||||
if (response.isSuccess()) {
|
||||
PayResponse payResponse =new PayResponse();
|
||||
payResponse.setSuccess(true);
|
||||
payResponse.setPrepay_id(response.getTradeNo());
|
||||
payResponse.setOrder_sn(response.getOutTradeNo());
|
||||
return payResponse;
|
||||
} else {
|
||||
log.error("调用失败");
|
||||
return null;
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new TradeException("订单创建失败,订单号:"+ payRequest.getOrderSn());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* APP
|
||||
* https://opendocs.alipay.com/open/02e7gq?ref=api&scene=20
|
||||
* @param payRequest
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
private PayResponse createAPPOrder(PayRequest payRequest) throws TradeException {
|
||||
AlipayClient alipayClient = getAliHttpClient();
|
||||
try {
|
||||
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
|
||||
request.setNotifyUrl(getPayNotifyUrl());
|
||||
JSONObject bizContent = new JSONObject();
|
||||
bizContent.put("out_trade_no", payRequest.getOrderSn());
|
||||
bizContent.put("total_amount", fenToYuan( payRequest.getTotalFee() ));
|
||||
bizContent.put("subject", payRequest.getBody());
|
||||
bizContent.put("product_code", "QUICK_MSECURITY_PAY");
|
||||
|
||||
request.setBizContent(bizContent.toString());
|
||||
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
|
||||
if (response.isSuccess()) {
|
||||
PayResponse payResponse =new PayResponse();
|
||||
payResponse.setSuccess(true);
|
||||
payResponse.setPrepay_id(response.getTradeNo());
|
||||
payResponse.setOrder_sn(response.getOutTradeNo());
|
||||
return payResponse;
|
||||
} else {
|
||||
log.error("调用失败");
|
||||
return null;
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new TradeException("订单创建失败,订单号:"+ payRequest.getOrderSn());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 关闭订单
|
||||
* @param orderSn
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
@Override
|
||||
public Boolean closePay(String orderSn) throws TradeException {
|
||||
try {
|
||||
AlipayClient alipayClient = getAliHttpClient();
|
||||
AlipayTradeCloseRequest request = new AlipayTradeCloseRequest();
|
||||
JSONObject bizContent = new JSONObject();
|
||||
bizContent.put("trade_no", orderSn);
|
||||
request.setBizContent(bizContent.toString());
|
||||
AlipayTradeCloseResponse response = alipayClient.execute(request);
|
||||
if (response.isSuccess()) {
|
||||
log.info("调用成功");
|
||||
return true;
|
||||
} else {
|
||||
log.error("调用失败");
|
||||
return false;
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new TradeException("订单关闭失败,订单号:"+orderSn);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款接口
|
||||
* alipay.trade.refund(统一收单交易退款接口)
|
||||
* https://opendocs.alipay.com/open/02ekfk
|
||||
* @param refundRequest
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
@Override
|
||||
public Boolean refund(RefundRequest refundRequest) throws TradeException {
|
||||
try {
|
||||
AlipayClient alipayClient = getAliHttpClient();
|
||||
AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
|
||||
request.setNotifyUrl(getRefundNotifyUrl()); //退款回调
|
||||
JSONObject bizContent = new JSONObject();
|
||||
bizContent.put("refund_amount", fenToYuan(refundRequest.getRefundAmount() ));
|
||||
bizContent.put("out_trade_no", refundRequest.getOrderSn());
|
||||
//退款请求号,做幂等性校验
|
||||
if(refundRequest.getRequestNo()!=null){
|
||||
bizContent.put("out_request_no", refundRequest.getRequestNo());
|
||||
}else{
|
||||
bizContent.put("out_request_no", refundRequest.getOrderSn());
|
||||
}
|
||||
request.setBizContent(bizContent.toString());
|
||||
AlipayTradeRefundResponse response = alipayClient.execute(request);
|
||||
if (response.isSuccess()) {
|
||||
if("Y".equals(response.getFundChange())) {
|
||||
log.info("退款成功{}",refundRequest.getOrderSn());
|
||||
callBackService.successRefund(refundRequest.getOrderSn());
|
||||
return true;
|
||||
}else{
|
||||
//退款失败
|
||||
log.error("退款失败{}",refundRequest.getOrderSn());
|
||||
callBackService.failRefund(refundRequest.getOrderSn());
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
log.error("退款调用失败{}",refundRequest.getOrderSn());
|
||||
return false;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new TradeException("订单退款失败,订单号:"+ refundRequest.getOrderSn());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单笔交易订单
|
||||
* 参考官网: https://opendocs.alipay.com/open/02e7gm?ref=api#请求示例
|
||||
*
|
||||
* @param orderSn
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
@Override
|
||||
public QueryResponse queryTradingOrderNo(String orderSn) throws TradeException {
|
||||
AlipayClient alipayClient = getAliHttpClient();
|
||||
try {
|
||||
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
|
||||
JSONObject bizContent = new JSONObject();
|
||||
bizContent.put("out_trade_no", orderSn);
|
||||
request.setBizContent(bizContent.toString());
|
||||
AlipayTradeQueryResponse response = alipayClient.execute(request);
|
||||
QueryResponse queryResponse=new QueryResponse();
|
||||
queryResponse.setOrder_sn(orderSn );
|
||||
if (response.isSuccess()) {
|
||||
queryResponse.setTransaction_id( response.getTradeNo() );
|
||||
queryResponse.setTrade_state(AlipayConstant.TRADE_STATE.get( response.getTradeStatus()) );//交易状态
|
||||
|
||||
//int total = BigDecimal.valueOf(Double.valueOf(response.getTotalAmount())).multiply(new BigDecimal(100)).intValue();
|
||||
queryResponse.setTotal( yuanToFen(response.getTotalAmount()) ); //总金额
|
||||
|
||||
//int buyer_pay_amount = BigDecimal.valueOf(Double.valueOf(response.getBuyerPayAmount())).multiply(new BigDecimal(100)).intValue();
|
||||
//queryResponse.setPayer_total( yuanToFen(response.getBuyerPayAmount()) );//支付金额
|
||||
|
||||
queryResponse.setOpenid( response.getBuyerUserId());
|
||||
Map map = JSON.parseObject(response.getBody(), Map.class ) ;
|
||||
queryResponse.setExpand(map);//全部数据
|
||||
return queryResponse;
|
||||
} else {
|
||||
queryResponse.setTrade_state("NOTPAY");
|
||||
return queryResponse;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
//throw new TradeException("订单查询失败,订单号:"+orderSn);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款订单
|
||||
* @param orderSn
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
@Override
|
||||
public QueryRefundResponse queryRefundTrading(String orderSn) throws TradeException {
|
||||
try {
|
||||
AlipayClient alipayClient = getAliHttpClient();
|
||||
AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
|
||||
JSONObject bizContent = new JSONObject();
|
||||
bizContent.put("out_request_no", orderSn);
|
||||
request.setBizContent(bizContent.toString());
|
||||
AlipayTradeFastpayRefundQueryResponse response = alipayClient.execute(request);
|
||||
if (response.isSuccess()) {
|
||||
log.info("调用成功");
|
||||
Map map = JSON.parseObject(response.getBody(), Map.class );
|
||||
|
||||
QueryRefundResponse queryRefundResponse=new QueryRefundResponse();
|
||||
|
||||
queryRefundResponse.setOrder_sn( (String) map.get("out_trade_no") );
|
||||
queryRefundResponse.setTransaction_id( (String) map.get("trade_no") );
|
||||
queryRefundResponse.setTotal( (Integer) map.get("total_amount") ); //总金额
|
||||
//queryRefundResponse.setPayer_total( (Integer) map.get("total_amount") );//支付金额
|
||||
queryRefundResponse.setRefund((Integer) map.get("refund_amount") ); //退款金额
|
||||
queryRefundResponse.setRefund_id((String) map.get("trade_no") ); //退款单号
|
||||
queryRefundResponse.setOut_refund_no( (String) map.get("out_request_no") );//退款订单号
|
||||
//queryRefundResponse.setChannel( (String) map.get("channel") ); //通道
|
||||
//queryRefundResponse.setUser_received_account( (String) map.get("user_received_account") ); //账号
|
||||
queryRefundResponse.setStatus( (String) map.get("refund_status") ); //状态
|
||||
queryRefundResponse.setSuccess_time( (String) map.get("gmt_refund_pay") );
|
||||
//queryRefundResponse.setCreate_time( (String) map.get("gmt_refund_pay") );
|
||||
|
||||
queryRefundResponse.setExpand(map);
|
||||
return queryRefundResponse;
|
||||
|
||||
} else {
|
||||
log.error("调用失败");
|
||||
return null;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
//throw new TradeException("退款订单查询失败,订单号:"+ orderSn);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOpenid(String code) {
|
||||
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",
|
||||
alipayConfig.getAppId(), alipayConfig.getPrivateKey(), "json", "utf-8", alipayConfig.getPublicKey(), alipayConfig.getSignType());
|
||||
AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
|
||||
request.setCode(code);
|
||||
request.setGrantType("authorization_code");
|
||||
try {
|
||||
AlipaySystemOauthTokenResponse oauthTokenResponse = alipayClient.execute(request);
|
||||
return oauthTokenResponse.getUserId();
|
||||
} catch (AlipayApiException e) {
|
||||
//处理异常
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取支付宝连接
|
||||
* 参考官网:https://opendocs.alipay.com/open/01csp3?ref=api#公钥模式加签
|
||||
* 公钥模式加签
|
||||
* @return
|
||||
*/
|
||||
private AlipayClient getAliHttpClient(){
|
||||
try {
|
||||
com.alipay.api.AlipayConfig alipayConfig = new com.alipay.api.AlipayConfig();
|
||||
alipayConfig.setServerUrl(AlipayConstant.domain);
|
||||
alipayConfig.setAppId(this.alipayConfig.getAppId());
|
||||
alipayConfig.setPrivateKey(this.alipayConfig.getPrivateKey());
|
||||
alipayConfig.setFormat("json");
|
||||
alipayConfig.setCharset("utf-8");
|
||||
alipayConfig.setAlipayPublicKey(this.alipayConfig.getPublicKey());
|
||||
alipayConfig.setSignType(this.alipayConfig.getSignType());
|
||||
//构造client
|
||||
AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig);
|
||||
return alipayClient;
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new TradeException("支付宝支付--初始化,校验系统参数失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分转换为元
|
||||
* @param fen
|
||||
* @return
|
||||
*/
|
||||
private String fenToYuan(int fen){
|
||||
//转换为元
|
||||
return BigDecimal.valueOf(fen).divide(new BigDecimal(100) ).toString();
|
||||
}
|
||||
|
||||
private int yuanToFen(String yuan){
|
||||
return BigDecimal.valueOf(Double.valueOf(yuan)).multiply(new BigDecimal(100)).intValue();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.ruoyi.ali;
|
||||
|
||||
|
||||
import com.alipay.api.internal.util.AlipaySignature;
|
||||
import com.ruoyi.annotation.TradePlatform;
|
||||
import com.ruoyi.constant.Platform;
|
||||
import com.ruoyi.core.ElegentValid;
|
||||
import com.ruoyi.dto.ValidResponse;
|
||||
import com.ruoyi.exceptions.TradeException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@TradePlatform(Platform.ALI)
|
||||
@Slf4j
|
||||
public class AlipayElegentValid implements ElegentValid {
|
||||
|
||||
|
||||
@Autowired
|
||||
private AlipayConfig alipayConfig;
|
||||
|
||||
|
||||
/**
|
||||
* 订单回调结果通知验签
|
||||
* 参考代码: https://opendocs.alipay.com/open/194/103296?ref=api 异步返回结果的验签
|
||||
* @param httpEntity
|
||||
* @param httpRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ValidResponse validPay(HttpEntity<String> httpEntity, HttpServletRequest httpRequest) throws TradeException {
|
||||
ValidResponse validResponse=new ValidResponse();
|
||||
try {
|
||||
Map<String, String> params = getParams(httpRequest);
|
||||
//获取支付宝POST过来反馈信息,将异步通知中收到的待验证所有参数都存放到map中
|
||||
//String body = httpEntity.getBody();
|
||||
//调用SDK验证签名
|
||||
//公钥验签示例代码
|
||||
boolean signVerified = AlipaySignature.rsaCheckV1(params, alipayConfig.getPublicKey(), "utf-8", alipayConfig.getSignType());
|
||||
if (signVerified) {
|
||||
validResponse.setValid(true);
|
||||
validResponse.setOrderSn((String) params.get("out_trade_no"));
|
||||
return validResponse;
|
||||
} else {
|
||||
validResponse.setValid(false);
|
||||
validResponse.setOrderSn( (String) params.get("out_trade_no") );
|
||||
return validResponse;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new TradeException("验签异常");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款结果通知验签
|
||||
* 参考官网 https://opendocs.alipay.com/support/01ravh
|
||||
* @param httpEntity
|
||||
* @param httpRequest
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
@Override
|
||||
public ValidResponse validRefund(HttpEntity<String> httpEntity, HttpServletRequest httpRequest) throws TradeException {
|
||||
ValidResponse validResponse=new ValidResponse();
|
||||
|
||||
try {
|
||||
//获取支付宝POST过来反馈信息,将异步通知中收到的待验证所有参数都存放到map中
|
||||
Map<String, String> params = getParams(httpRequest);
|
||||
//调用SDK验证签名
|
||||
//公钥验签示例代码
|
||||
boolean signVerified = AlipaySignature.rsaCheckV1(params, alipayConfig.getPublicKey(), "utf-8", alipayConfig.getSignType());
|
||||
if (signVerified) {
|
||||
validResponse.setValid(true);
|
||||
validResponse.setOrderSn( (String) params.get("out_trade_no") );
|
||||
return validResponse;
|
||||
} else {
|
||||
validResponse.setValid(false);
|
||||
validResponse.setOrderSn( (String) params.get("out_trade_no") );
|
||||
return validResponse;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
validResponse.setValid(false);
|
||||
return validResponse;
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String,String> getParams(HttpServletRequest httpServletRequest){
|
||||
Map<String,String> params = new HashMap< String , String >();
|
||||
Map requestParams = httpServletRequest.getParameterMap();
|
||||
|
||||
for(Iterator iter = requestParams.keySet().iterator(); iter.hasNext();){
|
||||
String name = (String)iter.next();
|
||||
String[] values = (String [])requestParams.get(name);
|
||||
String valueStr = "";
|
||||
for(int i = 0;i < values.length;i ++ ){
|
||||
valueStr = (i==values.length-1)?valueStr + values [i]:valueStr + values[i] + ",";
|
||||
}
|
||||
//乱码解决,这段代码在出现乱码时使用。
|
||||
//valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
|
||||
params.put (name,valueStr);
|
||||
}
|
||||
log.info("params:{}",params);
|
||||
return params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String successResult() {
|
||||
return AlipayConstant.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String failResult() {
|
||||
return AlipayConstant.FAIL;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* create by: wgl
|
||||
* desc: 自定义支付平台注解,支付平台 微信:wx 支付宝:zfb
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
public @interface TradePlatform {
|
||||
|
||||
/**
|
||||
* 平台的id
|
||||
* Platform.WX
|
||||
* @return
|
||||
*/
|
||||
String value();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.config;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 微信权限对接类
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties("elegent.pay.callback")
|
||||
@Data
|
||||
public class CallbackConfig {
|
||||
|
||||
private String domain; //回调域名
|
||||
|
||||
@Value("${elegent.pay.callback.watch:false}")
|
||||
private boolean watch; //是否开启监听
|
||||
|
||||
@Value("${elegent.pay.callback.cycle:10}")
|
||||
private int cycle;//检查周期
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.ruoyi.constant;
|
||||
|
||||
public class PayConstant {
|
||||
|
||||
public final static String CALLBACK_PATH = "/payCallBack";
|
||||
|
||||
public final static String NOTIFY = "/notify";
|
||||
|
||||
public final static String REFUND_NOTIFY = "/refund_notify";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ruoyi.constant;
|
||||
|
||||
/**
|
||||
* Platform
|
||||
* 支付方式
|
||||
*/
|
||||
public class Platform {
|
||||
/**
|
||||
* 微信
|
||||
*/
|
||||
public final static String WX = "wxpay";
|
||||
/**
|
||||
* 支付宝
|
||||
*/
|
||||
public final static String ALI = "alipay";
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.constant;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 交易类型
|
||||
*/
|
||||
@Data
|
||||
public class TradeType {
|
||||
|
||||
/**
|
||||
* native(扫码)
|
||||
*/
|
||||
public final static String NATIVE = "native";
|
||||
|
||||
/**
|
||||
* jsapi(小程序)
|
||||
*/
|
||||
public final static String JSAPI = "jsapi";
|
||||
|
||||
|
||||
/**
|
||||
* app
|
||||
*/
|
||||
public final static String APP = "app";
|
||||
|
||||
|
||||
/**
|
||||
* h5
|
||||
*/
|
||||
public final static String H5 = "h5";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.ruoyi.core;
|
||||
|
||||
import com.ruoyi.CallBackService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 回调类
|
||||
*/
|
||||
@Slf4j
|
||||
public class CallBackServiceImpl implements CallBackService {
|
||||
|
||||
|
||||
@Override
|
||||
public void successPay(String orderSn) {
|
||||
log.info("支付成功回调!"+orderSn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failPay(String orderSn) {
|
||||
log.info("支付失败回调!"+orderSn);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void successRefund(String orderSn) {
|
||||
log.info("退款成功回调!"+orderSn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failRefund(String orderSn) {
|
||||
log.info("退款失败回调!"+orderSn);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.ruoyi.core;
|
||||
|
||||
import com.ruoyi.CallBackService;
|
||||
import com.ruoyi.constant.PayConstant;
|
||||
import com.ruoyi.dto.ValidResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* CallbackController
|
||||
* @description 系统默认提供的微信回调的Controller
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping(PayConstant.CALLBACK_PATH)
|
||||
public class CallbackController {
|
||||
|
||||
@Autowired
|
||||
private CallBackService callBackService;
|
||||
|
||||
/**
|
||||
* 系统提供的默认的微信回调的接口(支付回调)
|
||||
* @param httpEntity
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping( PayConstant.NOTIFY + "/{platform}")
|
||||
public String notify(HttpEntity<String> httpEntity, HttpServletRequest request, HttpServletResponse response, @PathVariable("platform") String platform){
|
||||
|
||||
ElegentValid elegentValid = ElegentLoader.getElegentValid(platform); //获取验证器
|
||||
try {
|
||||
ValidResponse validResponse = elegentValid.validPay(httpEntity, request);//验证支付通知
|
||||
String orderSn =validResponse.getOrderSn(); //订单号
|
||||
if(validResponse.isValid()){ //返回码成功
|
||||
callBackService.successPay(orderSn);
|
||||
//返回成功消费
|
||||
return elegentValid.successResult();
|
||||
}else{
|
||||
callBackService.failPay(orderSn);
|
||||
return elegentValid.failResult();
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("支付回调处理失败",e);
|
||||
//微信返回的状态非正常
|
||||
return elegentValid.failResult();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 系统提供的默认的微信回调的接口(退款通知)
|
||||
*
|
||||
* @param httpEntity
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping( PayConstant.REFUND_NOTIFY + "/{platform}")
|
||||
public String refundNotify(HttpEntity<String> httpEntity, HttpServletRequest request, HttpServletResponse response,@PathVariable("platform") String platform) {
|
||||
|
||||
ElegentValid elegentValid = ElegentLoader.getElegentValid(platform); //获取验证器
|
||||
|
||||
try {
|
||||
ValidResponse validResponse = elegentValid.validRefund(httpEntity, request);
|
||||
String orderSn = validResponse.getOrderSn();
|
||||
//订单号
|
||||
if (validResponse.isValid()) { //返回码成功
|
||||
callBackService.successRefund(orderSn);
|
||||
//返回成功消费
|
||||
return elegentValid.successResult();
|
||||
} else {
|
||||
callBackService.failRefund(orderSn);
|
||||
return elegentValid.failResult();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("退款回调处理失败", e);
|
||||
//微信返回的状态非正常
|
||||
return elegentValid.failResult();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.ruoyi.core;
|
||||
|
||||
|
||||
|
||||
import com.ruoyi.CallBackService;
|
||||
import com.ruoyi.ElegentPay;
|
||||
import com.ruoyi.config.CallbackConfig;
|
||||
import com.ruoyi.dto.QueryRefundResponse;
|
||||
import com.ruoyi.dto.QueryResponse;
|
||||
import com.ruoyi.dto.WatchDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
@Component
|
||||
@ConditionalOnProperty(prefix = "elegent.pay.callback",name = "watch",havingValue = "true")
|
||||
@Slf4j
|
||||
public class CallbackWatch {
|
||||
|
||||
@Autowired
|
||||
private CallBackService callBackService;
|
||||
|
||||
@Autowired
|
||||
private CallbackConfig callbackConfig;
|
||||
|
||||
@Autowired
|
||||
private ElegentPay elegentPay;
|
||||
|
||||
@PostConstruct
|
||||
public void queryWatch(){
|
||||
if(callbackConfig.getCycle()<=0){
|
||||
return;
|
||||
}
|
||||
//log.info("开启支付结果定期巡检");
|
||||
Timer timer = new Timer();
|
||||
// 2、创建 TimerTask 任务线程
|
||||
TimerTask task=new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
//查询支付状态
|
||||
//log.info("支付状态定期巡检,{}",WatchList.payList);
|
||||
for( WatchDTO watchDTO: WatchList.payList ){
|
||||
//查询订单是否支付成功
|
||||
QueryResponse queryResponse = elegentPay.queryTradingOrderNo(watchDTO.getOrderSn(),watchDTO.getPlatform());
|
||||
if("SUCCESS".equals(queryResponse.getTrade_state())){
|
||||
callBackService.successPay(queryResponse.getOrder_sn());
|
||||
WatchList.payList.remove(watchDTO );
|
||||
}
|
||||
}
|
||||
//log.info("退款状态定期巡检,{}",WatchList.refundList);
|
||||
//查询退款状态
|
||||
for( WatchDTO watchDTO: WatchList.refundList ){
|
||||
//查询退款中订单
|
||||
QueryRefundResponse queryResponse = elegentPay.queryRefundTrading( watchDTO.getOrderSn(),watchDTO.getPlatform());
|
||||
if("SUCCESS".equals(queryResponse.getStatus())){
|
||||
callBackService.successRefund(queryResponse.getOrder_sn());
|
||||
WatchList.refundList.remove(watchDTO);
|
||||
}
|
||||
}
|
||||
}catch (Exception ex){
|
||||
}
|
||||
}
|
||||
};
|
||||
// 4、启动定时任务
|
||||
timer.schedule(task, callbackConfig.getCycle()*1000, callbackConfig.getCycle()*1000);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.core;
|
||||
|
||||
|
||||
import com.ruoyi.CallBackService;
|
||||
import com.ruoyi.key.KeyManager;
|
||||
import com.ruoyi.key.impl.DefaultKeyManager;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class ElegentConfig {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public CallBackService callBackService(){
|
||||
return new CallBackServiceImpl();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public KeyManager keyManager(){
|
||||
return new DefaultKeyManager();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.ruoyi.core;
|
||||
|
||||
import com.ruoyi.annotation.TradePlatform;
|
||||
import com.ruoyi.exceptions.TradeException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* PlatformLoader
|
||||
* @description 第三方支付平台类加载器
|
||||
* 服务启动的时候自动加载第三方支付组件
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ElegentLoader implements ApplicationContextAware {
|
||||
|
||||
private static Map<String, ElegentTrade> elegentTradeMap = new HashMap<>();
|
||||
|
||||
private static Map<String, ElegentValid> elegentValidMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
|
||||
//加载所有的交易实现类
|
||||
Collection<ElegentTrade> elegentTrades = applicationContext.getBeansOfType(ElegentTrade.class).values();
|
||||
elegentTrades.stream().forEach(e->{
|
||||
//通过反射拿到类上的平台注解
|
||||
TradePlatform annotation = e.getClass().getAnnotation(TradePlatform.class);
|
||||
if (annotation != null) {
|
||||
elegentTradeMap.put(annotation.value(), e);
|
||||
}
|
||||
});
|
||||
|
||||
//加载所有的验证实现类
|
||||
Collection<ElegentValid> elegentValids = applicationContext.getBeansOfType(ElegentValid.class).values();
|
||||
elegentValids.stream().forEach(e->{
|
||||
//通过反射拿到类上的平台注解
|
||||
TradePlatform annotation = e.getClass().getAnnotation(TradePlatform.class);
|
||||
if (annotation != null) {
|
||||
elegentValidMap.put(annotation.value(), e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据平台id获取具体的第三方平台
|
||||
* @param platform 平台id
|
||||
* @return
|
||||
*/
|
||||
public static ElegentTrade getElegentTrade(String platform){
|
||||
ElegentTrade elegentPayTemplate = elegentTradeMap.get(platform);
|
||||
if(elegentPayTemplate!=null){
|
||||
return elegentPayTemplate;
|
||||
}else{
|
||||
throw new TradeException("未找到适配的交易类型,交易平台id:"+platform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据平台id获取具体的验证类
|
||||
* @param platform 平台id
|
||||
* @return
|
||||
*/
|
||||
public static ElegentValid getElegentValid(String platform){
|
||||
ElegentValid elegentValidTemplate = elegentValidMap.get(platform);
|
||||
if(elegentValidTemplate!=null){
|
||||
return elegentValidTemplate;
|
||||
}else{
|
||||
throw new TradeException("未找到适配的交易类型,交易平台id:"+platform);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.ruoyi.core;
|
||||
import com.ruoyi.ElegentPay;
|
||||
import com.ruoyi.config.CallbackConfig;
|
||||
import com.ruoyi.dto.*;
|
||||
import com.ruoyi.exceptions.TradeException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* ElegentPayTemplate
|
||||
* @description 统一模板 在模板层进行第三方平台的选择
|
||||
*/
|
||||
@Component
|
||||
public class ElegentPayImpl implements ElegentPay {
|
||||
|
||||
@Autowired
|
||||
private CallbackConfig callbackConfig;
|
||||
|
||||
/**
|
||||
* 统一下单接口
|
||||
* @param payRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PayResponse requestPay(PayRequest payRequest, String tradeType, String platform) throws TradeException {
|
||||
//获取交易策略
|
||||
PayResponse payResponse = getPlatFormService(platform).requestPay(payRequest, tradeType);
|
||||
|
||||
//加入监听列表
|
||||
if(callbackConfig.isWatch()){
|
||||
WatchDTO watchDTO=new WatchDTO();
|
||||
watchDTO.setOrderSn(payRequest.getOrderSn());
|
||||
watchDTO.setPlatform(platform);
|
||||
WatchList.payList.add( watchDTO );
|
||||
}
|
||||
return payResponse;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 关闭订单
|
||||
* @param orderSn
|
||||
* @param platform
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public Boolean closePay(String orderSn, String platform) throws TradeException {
|
||||
//调用对应第三方的创建订单接口
|
||||
Boolean aBoolean = getPlatFormService(platform).closePay(orderSn);
|
||||
//加入监听列表
|
||||
if(callbackConfig.isWatch()){
|
||||
WatchDTO watchDTO=new WatchDTO();
|
||||
watchDTO.setOrderSn(orderSn);
|
||||
watchDTO.setPlatform(platform);
|
||||
WatchList.payList.remove( watchDTO );
|
||||
}
|
||||
|
||||
return aBoolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款方法
|
||||
* @param refundRequest
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public Boolean refund(RefundRequest refundRequest, String platform) throws TradeException {
|
||||
Boolean refund = getPlatFormService(platform).refund(refundRequest);
|
||||
//加入监听列表
|
||||
if(callbackConfig.isWatch() && refund){
|
||||
WatchDTO watchDTO=new WatchDTO();
|
||||
watchDTO.setOrderSn(refundRequest.getRequestNo());
|
||||
watchDTO.setPlatform(platform);
|
||||
WatchList.refundList.add( watchDTO );
|
||||
}
|
||||
return refund;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手动查询订单的方法
|
||||
* 商户订单号查询 根据订单号查询订单
|
||||
* 该接口基于生成的订单号来进行订单的查询
|
||||
* 可以基于查询的结果判断用户订单是否支付成功
|
||||
* @param orderSn
|
||||
* @param Platform
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public QueryResponse queryTradingOrderNo(String orderSn , String Platform) throws TradeException {
|
||||
//调用具体第三方的退款接口
|
||||
return getPlatFormService(Platform).queryTradingOrderNo(orderSn);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询退款单号
|
||||
*
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public QueryRefundResponse queryRefundTrading(String orderSn , String platform) throws TradeException {
|
||||
//获取请求参数
|
||||
return getPlatFormService(platform).queryRefundTrading(orderSn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得openId
|
||||
* @param code
|
||||
* @param platform
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getOpenid(String code, String platform) {
|
||||
return getPlatFormService(platform).getOpenid(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* ====================================提供的模板类需要使用的方法=====================================
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 跟进具体内容获取实现类的方法
|
||||
* @param platForm
|
||||
* @return
|
||||
*/
|
||||
private ElegentTrade getPlatFormService(String platForm) {
|
||||
return ElegentLoader.getElegentTrade(platForm);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.ruoyi.core;
|
||||
|
||||
|
||||
import com.ruoyi.dto.*;
|
||||
import com.ruoyi.exceptions.TradeException;
|
||||
|
||||
public interface ElegentTrade {
|
||||
|
||||
|
||||
/**
|
||||
* 单独的创建本地支付订单接口
|
||||
* 该接口基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||
* 业务编写人员仅仅只需要准备好请求参数调用该方法即可完成下单请求
|
||||
* @return 交易数据对象 包含有native支付的二维码+jsApi支付的支付组件
|
||||
*/
|
||||
PayResponse requestPay(PayRequest payRequest, String tradeType) throws TradeException;
|
||||
|
||||
/**
|
||||
* 关闭订单
|
||||
* 该结构基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||
* 业务编写人员在处理超时订单的时候需要 通知微信 由于是超时订单需要进行远程关闭
|
||||
*/
|
||||
Boolean closePay(String orderSn) throws TradeException;
|
||||
|
||||
/**
|
||||
* 退款s申请
|
||||
* 该接口基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||
* 业务编写人员在处理业务执行失败时需要进行退款
|
||||
*/
|
||||
Boolean refund(RefundRequest refundRequest) throws TradeException;
|
||||
|
||||
/**
|
||||
* 商户订单号查询 根据订单号查询订单
|
||||
* 该接口基于生成的订单号来进行订单的查询
|
||||
* 可以基于查询的结果判断用户订单是否支付成功
|
||||
*/
|
||||
QueryResponse queryTradingOrderNo(String orderSn) throws TradeException;
|
||||
|
||||
|
||||
/**
|
||||
* 查询单笔退款API
|
||||
*
|
||||
*/
|
||||
QueryRefundResponse queryRefundTrading(String orderSn) throws TradeException;
|
||||
|
||||
|
||||
/**
|
||||
* 获得openId
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
String getOpenid(String code);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.ruoyi.core;
|
||||
|
||||
|
||||
import com.ruoyi.dto.ValidResponse;
|
||||
import com.ruoyi.exceptions.TradeException;
|
||||
import org.springframework.http.HttpEntity;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 验证器接口
|
||||
*
|
||||
*/
|
||||
public interface ElegentValid {
|
||||
|
||||
|
||||
/**
|
||||
* 支付结果通知校验
|
||||
* 该接口基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||
* 业务编写人员在接收到微信或支付宝回调的时候可以使用该方法验证回调是否成功,是否是伪回调
|
||||
* @return 交易数据对象
|
||||
*/
|
||||
ValidResponse validPay(HttpEntity<String> httpEntity, HttpServletRequest request) throws TradeException;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 退款结果通知校验
|
||||
* 该接口基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||
* 业务编写人员在接收到微信或支付宝回调的时候可以使用该方法验证回调是否成功,是否是伪回调
|
||||
*/
|
||||
ValidResponse validRefund(HttpEntity<String> httpEntity, HttpServletRequest request) throws TradeException;
|
||||
|
||||
|
||||
/**
|
||||
* 成功返回结构
|
||||
* @return
|
||||
*/
|
||||
String successResult();
|
||||
|
||||
|
||||
/**
|
||||
* 失败返回内容
|
||||
* @return
|
||||
*/
|
||||
String failResult();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.core;
|
||||
|
||||
|
||||
|
||||
import com.ruoyi.dto.WatchDTO;
|
||||
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
/**
|
||||
* 监听列表
|
||||
*/
|
||||
public class WatchList {
|
||||
|
||||
|
||||
|
||||
public static CopyOnWriteArraySet<WatchDTO> payList=new CopyOnWriteArraySet<>(); //支付中列表
|
||||
|
||||
public static CopyOnWriteArraySet<WatchDTO> refundList=new CopyOnWriteArraySet<>(); //退款中列表
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* PayRequest
|
||||
* 支付请求外观类
|
||||
*/
|
||||
@Data
|
||||
public class PayRequest {
|
||||
|
||||
private String body;//商品描述
|
||||
|
||||
private String orderSn; //订单号
|
||||
|
||||
private int totalFee; //订单金额
|
||||
|
||||
private String openid;//openId
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 结果统一封装类
|
||||
*/
|
||||
@Data
|
||||
public class PayResponse {
|
||||
|
||||
private boolean success; //是否成功
|
||||
|
||||
private String message;//信息
|
||||
|
||||
private String order_sn;//订单编号
|
||||
|
||||
private Map<String,String> expand;//扩展属性
|
||||
|
||||
private String code_url;//二维码连接(native返回)
|
||||
|
||||
private String prepay_id;//预支付Id(小程序返回)
|
||||
|
||||
private String h5_url;//支付跳转链接
|
||||
|
||||
private Map<String,String> jsapiData;//小程序返回
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class QueryRefundResponse extends QueryResponse{
|
||||
|
||||
|
||||
private String refund_id; //微信支付退款单号
|
||||
|
||||
private String out_refund_no;//商户退款单号
|
||||
|
||||
private String channel;//退款渠道
|
||||
|
||||
private String user_received_account;//退款账号
|
||||
|
||||
private String success_time;//退款成功时间
|
||||
|
||||
private String status;//退款状态
|
||||
|
||||
private int refund;//退款金额
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ruoyi.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 查询响应对象
|
||||
*/
|
||||
@Data
|
||||
public class QueryResponse {
|
||||
|
||||
private String openid;//用户id
|
||||
|
||||
private String trade_state;//交易状态
|
||||
|
||||
private String order_sn;//订单号
|
||||
|
||||
private String transaction_id;//交易单号
|
||||
|
||||
private int total;//金额
|
||||
|
||||
private Map expand;//扩展(全部的返回数据)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ruoyi.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RefundRequest {
|
||||
|
||||
private int totalFee; //订单金额
|
||||
|
||||
private int refundAmount; //退款金额
|
||||
|
||||
private String orderSn; //订单号
|
||||
|
||||
private String requestNo; //退款请求号,做退款幂等性校验,当部分退款时必须给出
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 验证签名
|
||||
*/
|
||||
@Data
|
||||
public class ValidResponse {
|
||||
|
||||
private boolean isValid;// 是否通过验签
|
||||
|
||||
private String orderSn;// 订单号
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ruoyi.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WatchDTO {
|
||||
|
||||
private String orderSn; //订单号
|
||||
|
||||
private String platform;//平台
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.exceptions;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 交易SDK提供的总的异常
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class TradeException extends RuntimeException{
|
||||
private String code;
|
||||
private String msg;
|
||||
|
||||
public TradeException(String code, String msg) {
|
||||
super(msg);
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public TradeException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ruoyi.key;
|
||||
|
||||
/**
|
||||
* 密钥管理器接口
|
||||
*/
|
||||
public interface KeyManager {
|
||||
|
||||
|
||||
/**
|
||||
* 根据名字获取key字符串
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
String getKey(String name);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.key.impl;
|
||||
|
||||
|
||||
import com.ruoyi.key.KeyManager;
|
||||
import com.ruoyi.util.FileUtil;
|
||||
|
||||
/**
|
||||
* 默认的key管理器-文件管理器
|
||||
*/
|
||||
public class DefaultKeyManager implements KeyManager {
|
||||
|
||||
|
||||
@Override
|
||||
public String getKey(String name) {
|
||||
return FileUtil.readToStr(name);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.ruoyi.util;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* 文件读取类
|
||||
*/
|
||||
public class FileUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 获取文件内容
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public static String readToStr(String fileName){
|
||||
InputStream is = FileUtil.class.getClassLoader().getResourceAsStream(fileName);
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream(2048);
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
String str;
|
||||
try {
|
||||
int length;
|
||||
while((length = is.read(buffer)) != -1) {
|
||||
os.write(buffer, 0, length);
|
||||
}
|
||||
|
||||
str = os.toString("UTF-8");
|
||||
} catch (IOException var5) {
|
||||
throw new IllegalArgumentException("无效的密钥", var5);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,459 @@
|
||||
package com.ruoyi.wx;
|
||||
|
||||
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ruoyi.annotation.TradePlatform;
|
||||
import com.ruoyi.config.CallbackConfig;
|
||||
import com.ruoyi.constant.PayConstant;
|
||||
import com.ruoyi.constant.Platform;
|
||||
import com.ruoyi.core.ElegentTrade;
|
||||
import com.ruoyi.dto.*;
|
||||
import com.ruoyi.exceptions.TradeException;
|
||||
import com.ruoyi.util.FileUtil;
|
||||
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
|
||||
import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner;
|
||||
import com.wechat.pay.contrib.apache.httpclient.auth.WechatPay2Credentials;
|
||||
import com.wechat.pay.contrib.apache.httpclient.auth.WechatPay2Validator;
|
||||
import com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager;
|
||||
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.URIBuilder;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.Signature;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@TradePlatform(Platform.WX)
|
||||
public class WxPayElegentTrade implements ElegentTrade {
|
||||
|
||||
@Autowired
|
||||
private WxpayConfig wxpayConfig;
|
||||
|
||||
@Autowired
|
||||
private CallbackConfig callbackConfig;
|
||||
|
||||
/**
|
||||
* 创建微信支付订单方法
|
||||
* 这里参考官网代码:
|
||||
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_4_1.shtml Native下单
|
||||
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_1.shtml JSAPI 下单
|
||||
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_1.shtml H5下单
|
||||
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_2_1.shtml APP下单
|
||||
* @param payRequest 支付请求
|
||||
* @return 支付响应
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public PayResponse requestPay(PayRequest payRequest, String tradeType)throws TradeException {
|
||||
PayResponse payResponse = new PayResponse(); //返回结果
|
||||
try {
|
||||
// 请求body参数构建
|
||||
Map<String, Object> params = new HashMap<String, Object>() {
|
||||
{
|
||||
put("mchid", wxpayConfig.getMchId());
|
||||
put("appid", wxpayConfig.getAppId());
|
||||
put("notify_url", callbackConfig.getDomain()+ PayConstant.CALLBACK_PATH + PayConstant.NOTIFY +"/"+ Platform.WX );
|
||||
put("out_trade_no", payRequest.getOrderSn());
|
||||
put("amount", new HashMap<String, Object>() {
|
||||
{
|
||||
put("total", payRequest.getTotalFee());//金额,单位:分
|
||||
put("currency", "CNY");//人民币
|
||||
}
|
||||
});
|
||||
put("description", payRequest.getBody());
|
||||
}
|
||||
};
|
||||
|
||||
if("h5".equals(tradeType)){ //h5
|
||||
params.put("scene_info", new HashMap<String, Object>() {
|
||||
{
|
||||
put("payer_client_ip", "127.0.0.1");
|
||||
put("h5_info", new HashMap<String, Object>() {
|
||||
{
|
||||
put("type", "Wap");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if ("jsapi".equals(tradeType)) { //如果是小程序支付
|
||||
params.put("payer", new HashMap<String, Object>() {
|
||||
{
|
||||
put("openid", payRequest.getOpenid());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
String url = WxpayConstant.createOrder + tradeType; //创建订单
|
||||
log.info("elegent-pay 请求参数{}",params);
|
||||
Map<String, String> map = postApiTemplate(url, params);
|
||||
|
||||
if("SUCCESS".equals( map.get("code") )){
|
||||
payResponse.setOrder_sn(payRequest.getOrderSn());
|
||||
payResponse.setSuccess(true);
|
||||
payResponse.setCode_url(map.get("code_url"));
|
||||
payResponse.setMessage(map.get("message"));
|
||||
|
||||
payResponse.setPrepay_id(map.get("prepay_id"));
|
||||
payResponse.setH5_url( map.get("h5_url") );
|
||||
|
||||
payResponse.setExpand(map); //全部数据
|
||||
|
||||
if("jsapi".equals(tradeType)){//如果是小程序,需要封装到Expand
|
||||
Map<String, String> data=new HashMap<>();
|
||||
String timeStamp = String.valueOf(System.currentTimeMillis() / 1000);
|
||||
String nonceStr = IdUtil.simpleUUID();
|
||||
String packages = "prepay_id=" + payResponse.getPrepay_id();
|
||||
String privateKey = FileUtil.readToStr("wxpay_private.key");
|
||||
String paySign = this.createPaySign(wxpayConfig.getAppId(), timeStamp, nonceStr, packages, privateKey);
|
||||
data.put("appId", wxpayConfig.getAppId());// appid
|
||||
data.put("timeStamp", timeStamp);// 时间戳
|
||||
data.put("nonceStr", nonceStr);// 随机字符串
|
||||
data.put("package","prepay_id="+payResponse.getPrepay_id());
|
||||
data.put("signType", "RSA");// 签名类型,默认为RSA,仅支持RSA
|
||||
data.put("paySign", paySign);// 签名
|
||||
data.put("orderNo",payRequest.getOrderSn());
|
||||
payResponse.setJsapiData(data);
|
||||
}
|
||||
|
||||
|
||||
log.info("createOrder: {}", payResponse);
|
||||
|
||||
}else{
|
||||
payResponse.setSuccess(false);
|
||||
payResponse.setMessage( map.get("message") );
|
||||
}
|
||||
return payResponse;
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
payResponse.setSuccess(false);
|
||||
}
|
||||
return payResponse;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 关闭订单
|
||||
* 参考官网代码
|
||||
* https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_7_2.shtml 3.2.5. 【服务端】关闭订单
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean closePay(String orderSn) throws TradeException {
|
||||
// 请求body参数构建
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("mchid", wxpayConfig.getMchId());
|
||||
String url = WxpayConstant.closeOrder.replaceAll("\\{out_trade_no\\}",orderSn);
|
||||
Map map = postApiTemplate(url, params);
|
||||
if("SUCCESS".equals( map.get("code"))){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退款
|
||||
* 参考官网代码 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_9.shtml
|
||||
* @param refundRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean refund(RefundRequest refundRequest) {
|
||||
// 请求body参数构建
|
||||
// 请求body参数构建
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("notify_url", callbackConfig.getDomain()+ PayConstant.CALLBACK_PATH +PayConstant.REFUND_NOTIFY +"/"+ Platform.WX ); //回调地址
|
||||
params.put("out_trade_no", refundRequest.getOrderSn());//订单编号
|
||||
//out_refund_no
|
||||
params.put("out_refund_no", refundRequest.getRequestNo());//退款申请单编号 (多次退款需要不一样才行)
|
||||
params.put("amount", new HashMap<String, Object>() {
|
||||
{
|
||||
put("refund",refundRequest.getRefundAmount());//退款金额
|
||||
put("total", refundRequest.getTotalFee());//原金额,单位:分
|
||||
put("currency", "CNY");//人民币
|
||||
}
|
||||
});
|
||||
String url = WxpayConstant.refund; //创建订单
|
||||
Map map = postApiTemplate(url, params);
|
||||
if("SUCCESS".equals( map.get("code"))){
|
||||
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 手动查询订单
|
||||
* 参考官网代码: https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_6_2.shtml 3.2.4. 【服务端】查询订单
|
||||
* @param orderSn
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public QueryResponse queryTradingOrderNo(String orderSn) throws TradeException {
|
||||
// 请求body参数构建
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("mchid", wxpayConfig.getMchId());
|
||||
String url = WxpayConstant.queryOrderNo+orderSn;;
|
||||
try {
|
||||
Map map = getApiTemplate(url, params);
|
||||
QueryResponse queryResponse=new QueryResponse();
|
||||
queryResponse.setOrder_sn((String)map.get("out_trade_no") ); //订单号
|
||||
queryResponse.setTransaction_id((String)map.get("transaction_id") ); //交易单类型
|
||||
queryResponse.setTrade_state( (String) map.get("trade_state") );//交易状态
|
||||
Map amount = (Map)map.get("amount");
|
||||
if(amount!=null){
|
||||
queryResponse.setTotal( (Integer) amount.get("total") ); //总金额
|
||||
}
|
||||
Map payer= (Map)map.get("payer");
|
||||
if(payer!=null){
|
||||
queryResponse.setOpenid( (String)payer.get("openid") );
|
||||
}
|
||||
queryResponse.setExpand(map);//全部数据
|
||||
return queryResponse;
|
||||
|
||||
} catch (URISyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询退款订单
|
||||
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_4_10.shtml
|
||||
* @param out_refund_no
|
||||
* @return
|
||||
* @throws TradeException
|
||||
*/
|
||||
@Override
|
||||
public QueryRefundResponse queryRefundTrading(String out_refund_no) throws TradeException {
|
||||
|
||||
// 请求body参数构建
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
String url = WxpayConstant.queryRufundOrderNo + out_refund_no;
|
||||
try {
|
||||
Map map = getApiTemplate(url, params);
|
||||
QueryRefundResponse queryRefundResponse=new QueryRefundResponse();
|
||||
queryRefundResponse.setOrder_sn( (String) map.get("out_trade_no") );
|
||||
queryRefundResponse.setTransaction_id( (String) map.get("transaction_id") );
|
||||
Map amount = (Map)map.get("amount");
|
||||
queryRefundResponse.setTotal( (Integer) amount.get("total") ); //总金额
|
||||
queryRefundResponse.setRefund((Integer) amount.get("payer_refund") ); //退款金额
|
||||
queryRefundResponse.setRefund_id((String) map.get("refund_id") ); //退款单号
|
||||
queryRefundResponse.setOut_refund_no( (String) map.get("out_refund_no") );//退款订单号
|
||||
|
||||
queryRefundResponse.setChannel( (String) map.get("channel") ); //通道
|
||||
queryRefundResponse.setUser_received_account( (String) map.get("user_received_account") ); //账号
|
||||
queryRefundResponse.setStatus( (String) map.get("status") ); //状态
|
||||
queryRefundResponse.setSuccess_time( (String) map.get("success_time") );
|
||||
queryRefundResponse.setExpand(map);
|
||||
return queryRefundResponse;
|
||||
} catch (URISyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOpenid(String code) {
|
||||
String getOpenIdUrl = "https://api.weixin.qq.com/sns/jscode2session?" +
|
||||
"appid="+wxpayConfig.getAppId()
|
||||
+"&secret="+wxpayConfig.getAppSecret()
|
||||
+"&js_code="+code+"&grant_type=authorization_code";
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String respResult = restTemplate.getForObject(getOpenIdUrl,String.class);
|
||||
log.info("获取openid的url:{},respResult:{}",getOpenIdUrl,respResult);
|
||||
if( respResult==null || "".equals(respResult) ) return "";
|
||||
try{
|
||||
|
||||
Map<String,String> map = JSON.parseObject(respResult, Map.class);
|
||||
String errorCode = map.get("errcode") ;
|
||||
if(errorCode!=null && !"".equals(errorCode)){
|
||||
int errorCodeInt = Integer.valueOf(errorCode).intValue();
|
||||
|
||||
log.info("获取openid的errorCode,{}",errorCodeInt);
|
||||
if(errorCodeInt != 0) return "";
|
||||
}
|
||||
return map.get("openid");
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Map getApiTemplate(String url, Map<String, String> params) throws URISyntaxException, IOException {
|
||||
URIBuilder uriBuilder = new URIBuilder(url);
|
||||
//添加参数
|
||||
for (String key : params.keySet()) {
|
||||
uriBuilder.addParameter(key, params.get(key));
|
||||
}
|
||||
//完成签名并执行请求
|
||||
HttpGet httpGet = new HttpGet(uriBuilder.build());
|
||||
httpGet.addHeader("Accept", "application/json");
|
||||
CloseableHttpClient httpClient = getWxHttpClient();
|
||||
CloseableHttpResponse response = httpClient.execute(httpGet);
|
||||
return responseTemplate(response);
|
||||
}
|
||||
|
||||
|
||||
private Map responseTemplate(CloseableHttpResponse response) {
|
||||
Map result = null;
|
||||
try {
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode == 200) { //处理成功
|
||||
// log.info("success,return body = " + EntityUtils.toString(response.getEntity()));
|
||||
result = JSON.parseObject(EntityUtils.toString(response.getEntity()), Map.class);
|
||||
result.put("code", "SUCCESS");
|
||||
} else if (statusCode == 204) { //处理成功,无返回Body
|
||||
log.info("success");
|
||||
result = new HashMap<String, Object>() {
|
||||
{
|
||||
put("code", "SUCCESS");
|
||||
}
|
||||
};
|
||||
} else {
|
||||
String returnBody = EntityUtils.toString(response.getEntity());
|
||||
log.error("failed,resp code = " + statusCode + ",return body = " + returnBody);
|
||||
//throw new TradeException("创建本地支付订单失败!"+payDTO.getOrderSn());
|
||||
Map<String, String> map = JSON.parseObject(returnBody, Map.class);
|
||||
result = new HashMap<String, Object>() {
|
||||
{
|
||||
put("code", "FAIL");
|
||||
put("message", map.get("message"));
|
||||
}
|
||||
};
|
||||
}
|
||||
} catch (Exception e) {
|
||||
result = new HashMap<String, Object>() {
|
||||
{
|
||||
put("code", "FAIL");
|
||||
put("message", e.getMessage());
|
||||
}
|
||||
};
|
||||
} finally {
|
||||
closeConnect(response);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private Map postApiTemplate(String url, Map<String, Object> params) {
|
||||
try {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
StringEntity entity = new StringEntity(JSON.toJSONString(params));
|
||||
entity.setContentType("application/json");
|
||||
httpPost.setEntity(entity);
|
||||
httpPost.setHeader("Accept", "application/json");
|
||||
//完成签名并执行请求
|
||||
CloseableHttpClient httpClient = getWxHttpClient();
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
return responseTemplate( response );
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取微信HTTP连接
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private CloseableHttpClient getWxHttpClient() {
|
||||
try {
|
||||
//这里对秘钥进行加密使用的完全是官网上的代码
|
||||
//TODO 参考官网代码 https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_6_2.shtml
|
||||
// 加载商户私钥(privateKey:私钥字符串)
|
||||
String key = FileUtil.readToStr("wxpay_private.key");
|
||||
|
||||
PrivateKey merchantPrivateKey = PemUtil
|
||||
.loadPrivateKey(new ByteArrayInputStream(key.getBytes("utf-8")));
|
||||
// 加载平台证书(mchId:商户号,mchSerialNo:商户证书序列号,apiV3Key:V3密钥)
|
||||
//PrivateKey merchantPrivateKey = keyManager.getPrivateKey("wxpay_private.key");//读取私钥
|
||||
PrivateKeySigner privateKeySigner = new PrivateKeySigner(wxpayConfig.getMchSerialNo(), merchantPrivateKey);
|
||||
WechatPay2Credentials wechatPay2Credentials = new WechatPay2Credentials(
|
||||
wxpayConfig.getMchId(), privateKeySigner);
|
||||
// 向证书管理器增加需要自动更新平台证书的商户信息
|
||||
CertificatesManager certificatesManager = CertificatesManager.getInstance();
|
||||
certificatesManager.putMerchant(wxpayConfig.getMchId(), wechatPay2Credentials, wxpayConfig.getApiV3Key().getBytes("utf-8"));
|
||||
// 初始化httpClient
|
||||
return WechatPayHttpClientBuilder.create()
|
||||
.withMerchant(wxpayConfig.getMchId(), wxpayConfig.getMchSerialNo(), merchantPrivateKey)
|
||||
.withValidator(new WechatPay2Validator(certificatesManager.getVerifier(wxpayConfig.getMchId()))).build();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("微信支付--初始化,校验系统参数失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 关闭资源
|
||||
*/
|
||||
private void closeConnect(CloseableHttpResponse response) {
|
||||
try {
|
||||
response.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("资源回收出错");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建支付签名
|
||||
* @param appid
|
||||
* @param timeStamp
|
||||
* @param nonceStr
|
||||
* @param packages
|
||||
* @param privateKey
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private String createPaySign(String appid, String timeStamp, String nonceStr, String packages,String privateKey) throws Exception {
|
||||
Signature sign = Signature.getInstance("SHA256withRSA");
|
||||
// 加载商户私钥
|
||||
PrivateKey key = PemUtil
|
||||
.loadPrivateKey(new ByteArrayInputStream(privateKey.getBytes(CharsetUtil.CHARSET_UTF_8)));
|
||||
sign.initSign(key);
|
||||
String message = StrUtil.format("{}\n{}\n{}\n{}\n",
|
||||
appid,
|
||||
timeStamp,
|
||||
nonceStr,
|
||||
packages);
|
||||
sign.update(message.getBytes());
|
||||
return Base64.getEncoder().encodeToString(sign.sign());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.ruoyi.wx;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ruoyi.annotation.TradePlatform;
|
||||
import com.ruoyi.constant.Platform;
|
||||
import com.ruoyi.core.ElegentValid;
|
||||
import com.ruoyi.dto.ValidResponse;
|
||||
import com.ruoyi.exceptions.TradeException;
|
||||
import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
|
||||
import com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager;
|
||||
import com.wechat.pay.contrib.apache.httpclient.notification.Notification;
|
||||
import com.wechat.pay.contrib.apache.httpclient.notification.NotificationHandler;
|
||||
import com.wechat.pay.contrib.apache.httpclient.notification.NotificationRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@TradePlatform(Platform.WX)
|
||||
public class WxPayElegentValid implements ElegentValid {
|
||||
|
||||
|
||||
@Autowired
|
||||
private WxpayConfig wxpayConfig;
|
||||
|
||||
@Override
|
||||
public ValidResponse validPay(HttpEntity<String> httpEntity, HttpServletRequest httpServletRequest) throws TradeException {
|
||||
ValidResponse validResponse=new ValidResponse();
|
||||
|
||||
try {
|
||||
//获取请求头
|
||||
HttpHeaders headers = httpEntity.getHeaders();
|
||||
//构建微信请求数据对象
|
||||
NotificationRequest request = new NotificationRequest.Builder()
|
||||
.withSerialNumber(headers.getFirst("Wechatpay-Serial")) //证书序列号(微信平台)
|
||||
.withNonce(headers.getFirst("Wechatpay-Nonce")) //随机串
|
||||
.withTimestamp(headers.getFirst("Wechatpay-Timestamp")) //时间戳
|
||||
.withSignature(headers.getFirst("Wechatpay-Signature")) //签名字符串
|
||||
.withBody(httpEntity.getBody())
|
||||
.build();
|
||||
|
||||
|
||||
//微信通知的业务处理
|
||||
//验证签名,确保请求来自微信
|
||||
Map jsonData = null;
|
||||
try {
|
||||
//确保在管理器中存在自动更新的商户证书
|
||||
CertificatesManager certificatesManager = CertificatesManager.getInstance();
|
||||
Verifier verifier = certificatesManager.getVerifier(wxpayConfig.getMchId());
|
||||
|
||||
//验签和解析请求数据
|
||||
NotificationHandler notificationHandler = new NotificationHandler(verifier, wxpayConfig.getApiV3Key().getBytes(StandardCharsets.UTF_8));
|
||||
Notification notification = notificationHandler.parse(request);
|
||||
|
||||
if (!"TRANSACTION.SUCCESS".equals(notification.getEventType())) {
|
||||
validResponse.setValid(false);
|
||||
return validResponse;
|
||||
}
|
||||
//获取解密后的数据
|
||||
jsonData = JSON.parseObject(notification.getDecryptData(),Map.class );
|
||||
log.info("解密后的数据为:"+jsonData);
|
||||
} catch (Exception e) {
|
||||
throw new TradeException("验签失败");
|
||||
}
|
||||
if (!"SUCCESS".equals(jsonData.get("trade_state"))) {
|
||||
validResponse.setValid(false);
|
||||
return validResponse;
|
||||
}
|
||||
validResponse.setValid(true);
|
||||
validResponse.setOrderSn( (String) jsonData.get("out_trade_no") ); //订单号
|
||||
return validResponse;
|
||||
} catch (Exception e) {
|
||||
validResponse.setValid(false);
|
||||
return validResponse;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidResponse validRefund(HttpEntity<String> httpEntity, HttpServletRequest httpServletRequest) throws TradeException {
|
||||
|
||||
ValidResponse validResponse=new ValidResponse();
|
||||
try {
|
||||
//获取请求头
|
||||
HttpHeaders headers = httpEntity.getHeaders();
|
||||
|
||||
//构建微信请求数据对象
|
||||
NotificationRequest request = new NotificationRequest.Builder()
|
||||
.withSerialNumber(headers.getFirst("Wechatpay-Serial")) //证书序列号(微信平台)
|
||||
.withNonce(headers.getFirst("Wechatpay-Nonce")) //随机串
|
||||
.withTimestamp(headers.getFirst("Wechatpay-Timestamp")) //时间戳
|
||||
.withSignature(headers.getFirst("Wechatpay-Signature")) //签名字符串
|
||||
.withBody(httpEntity.getBody())
|
||||
.build();
|
||||
|
||||
//微信通知的业务处理
|
||||
Map jsonData = null;
|
||||
//验证签名,确保请求来自微信
|
||||
try {
|
||||
//确保在管理器中存在自动更新的商户证书
|
||||
CertificatesManager certificatesManager = CertificatesManager.getInstance();
|
||||
Verifier verifier = certificatesManager.getVerifier(wxpayConfig.getMchId());
|
||||
|
||||
//验签和解析请求数据
|
||||
NotificationHandler notificationHandler = new NotificationHandler(verifier, wxpayConfig.getApiV3Key().getBytes(StandardCharsets.UTF_8));
|
||||
Notification notification = notificationHandler.parse(request);
|
||||
|
||||
if (!"REFUND.SUCCESS".equals(notification.getEventType())) {
|
||||
//非成功请求直接返回,理论上都是成功的请求
|
||||
validResponse.setValid(false);
|
||||
return validResponse;
|
||||
}
|
||||
//获取解密后的数据
|
||||
jsonData = JSON.parseObject( notification.getDecryptData(),Map.class );
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new TradeException("验签失败");
|
||||
}
|
||||
if (!"SUCCESS".equals(jsonData.get("refund_status"))) {
|
||||
//非成功请求直接返回,理论上都是成功的请求
|
||||
validResponse.setValid(false);
|
||||
return validResponse;
|
||||
}
|
||||
|
||||
//交易单号
|
||||
validResponse.setValid(true);
|
||||
validResponse.setOrderSn( (String) jsonData.get("out_trade_no") ); //订单号
|
||||
return validResponse;
|
||||
} catch (Exception e) {
|
||||
//非成功请求直接返回,理论上都是成功的请求
|
||||
validResponse.setValid(false);
|
||||
return validResponse;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String successResult() {
|
||||
return JSON.toJSONString(WxpayConstant.SUCCESS ) ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String failResult() {
|
||||
return JSON.toJSONString( WxpayConstant.FAIL);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.wx;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 微信权限对接类
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties("elegent.pay.wxpay")
|
||||
@Data
|
||||
public class WxpayConfig {
|
||||
|
||||
private String mchId; //商户号
|
||||
private String appId; //APPID
|
||||
private String appSecret;//app密钥
|
||||
private String mchSerialNo; //商户证书序列号
|
||||
private String apiV3Key; //V3密钥
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.ruoyi.wx;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class WxpayConstant {
|
||||
|
||||
public static final Map SUCCESS = new HashMap<String,Object>(){
|
||||
{
|
||||
put("code", "SUCCESS");
|
||||
}
|
||||
};
|
||||
|
||||
public static final Map FAIL = new HashMap<String,Object>(){
|
||||
{
|
||||
put("code", "FAIL");
|
||||
put("message","微信回调错误结果");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public final static String domain ="https://api.mch.weixin.qq.com/v3";
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
*/
|
||||
public final static String createOrder = domain +"/pay/transactions/";
|
||||
|
||||
/**
|
||||
* 关闭订单
|
||||
*/
|
||||
public final static String closeOrder = domain+"/pay/transactions/out-trade-no/{out_trade_no}/close";
|
||||
|
||||
/**
|
||||
* 查询订单编号
|
||||
*/
|
||||
public static String queryOrderNo = domain+"/pay/transactions/out-trade-no/";
|
||||
|
||||
/**
|
||||
* 查询退款订单
|
||||
*/
|
||||
public static String queryRufundOrderNo =domain+ "/refund/domestic/refunds/";
|
||||
|
||||
/**
|
||||
* 退款接口
|
||||
*/
|
||||
public static String refund = domain+"/refund/domestic/refunds";
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.ruoyi.config.CallbackConfig,\
|
||||
com.ruoyi.core.CallbackWatch,\
|
||||
com.ruoyi.core.ElegentPayImpl,\
|
||||
com.ruoyi.core.ElegentLoader,\
|
||||
com.ruoyi.core.ElegentConfig,\
|
||||
com.ruoyi.key.impl.DefaultKeyManager,\
|
||||
com.ruoyi.core.CallbackController,\
|
||||
com.ruoyi.wx.WxpayConfig,\
|
||||
com.ruoyi.wx.WxPayElegentTrade,\
|
||||
com.ruoyi.wx.WxPayElegentValid,\
|
||||
com.ruoyi.ali.AlipayConfig,\
|
||||
com.ruoyi.ali.AlipayElegentTrade,\
|
||||
com.ruoyi.ali.AlipayElegentValid
|
||||
@@ -180,6 +180,7 @@
|
||||
<module>ruoyi-quartz</module>
|
||||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-common</module>
|
||||
<module>pay</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
+5
-1
@@ -60,7 +60,11 @@
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-generator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>pay</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.web.controller.bestsign;
|
||||
|
||||
import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
|
||||
import com.ruoyi.bestsign.domain.PersonRegisterVO;
|
||||
import com.ruoyi.bestsign.service.ArbitrSignatuService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/arbitrSignatu")
|
||||
public class ArbitrSignatuController {
|
||||
@Autowired
|
||||
ArbitrSignatuService arbitrSignatuService;
|
||||
|
||||
/**
|
||||
* 申请状态查询
|
||||
*
|
||||
* @param arbitrSignatuVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/selectApplyStatus")
|
||||
public AjaxResult selectApplyStatus (@Validated @RequestBody ArbitrSignatuVO arbitrSignatuVO) {
|
||||
return arbitrSignatuService.selectApplyStatus(arbitrSignatuVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.web.controller.bestsign;
|
||||
|
||||
import com.ruoyi.bestsign.domain.PersonRegisterVO;
|
||||
import com.ruoyi.bestsign.service.SignRegisterService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/register")
|
||||
public class RegisterController {
|
||||
@Autowired
|
||||
SignRegisterService signRegisterService;
|
||||
|
||||
/**
|
||||
* 注册上上签个人用户
|
||||
*
|
||||
* @param personRegisterVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/registerPerson")
|
||||
public AjaxResult createDocument(@Validated @RequestBody PersonRegisterVO personRegisterVO) {
|
||||
return signRegisterService.registerPerson(personRegisterVO);
|
||||
}
|
||||
// @PostMapping("/registerEnterprise")
|
||||
// public AjaxResult
|
||||
}
|
||||
@@ -2,6 +2,9 @@ package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||
import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -33,6 +36,8 @@ public class SysLoginController
|
||||
|
||||
@Autowired
|
||||
private SysPermissionService permissionService;
|
||||
@Autowired
|
||||
private IdentityAuthenticationService identityAuthenticationService;
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
@@ -48,6 +53,13 @@ public class SysLoginController
|
||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
|
||||
// IdentityAuthentication identityAuthentication = new IdentityAuthentication();
|
||||
// identityAuthentication.setUserName(loginBody.getUsername());
|
||||
// IdentityAuthentication identityAuthenticationselect = identityAuthenticationService.selectIdentityAuthentication(identityAuthentication);
|
||||
// ajax.put("certificationStatusName", identityAuthenticationselect.getCertificationStatusName());
|
||||
// ajax.put("certificationStatus", identityAuthenticationselect.getCertificationStatus());
|
||||
|
||||
return ajax;
|
||||
}
|
||||
|
||||
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
|
||||
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/adjudication")
|
||||
public class AdjudicationController extends BaseController {
|
||||
@Autowired
|
||||
private IAdjudicationService adjudicationService;
|
||||
|
||||
/**
|
||||
* 生成裁决书
|
||||
* @param caseApplication
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/document")
|
||||
public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){
|
||||
return adjudicationService.createDocument(caseApplication);
|
||||
}
|
||||
|
||||
/**
|
||||
* 裁决书送达(电子邮件)
|
||||
* @param id 案件id
|
||||
* @param appEmail 申请人邮箱
|
||||
* @param resEmail 被申请人邮箱
|
||||
* @param apptrackingNum 申请人快递单号
|
||||
* @param restrackingNum 被申请人快递单号
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/delivery")
|
||||
public AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail
|
||||
,String apptrackingNum,String restrackingNum){
|
||||
return adjudicationService.sendDocumentByEmail(id,appEmail,resEmail,apptrackingNum,restrackingNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据快递单号查询物流信息
|
||||
* @param caseApplication
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/logistics")
|
||||
public AjaxResult getLogisticsInfo(CaseApplication caseApplication){
|
||||
return adjudicationService.getLogisticsInfo(caseApplication);
|
||||
}
|
||||
|
||||
/**
|
||||
* 签名(暂时只改案件状态)
|
||||
* @param caseApplication
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/signature")
|
||||
public AjaxResult signature(@Validated @RequestBody CaseApplication caseApplication){
|
||||
return adjudicationService.signature(caseApplication);
|
||||
}
|
||||
|
||||
/**
|
||||
* 归档(暂时只改案件状态)
|
||||
* @param caseApplication
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/caseFile")
|
||||
public AjaxResult caseFile(@Validated @RequestBody CaseApplication caseApplication){
|
||||
return adjudicationService.caseFile(caseApplication);
|
||||
}
|
||||
|
||||
/**
|
||||
* 送达(不包含发送电子邮件)
|
||||
* @param bookSendVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/service")
|
||||
public AjaxResult service(@RequestBody BookSendVO bookSendVO){
|
||||
return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum());
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
|
||||
import com.ruoyi.wisdomarbitrate.service.IArbitratorService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/arbitrator")
|
||||
public class ArbitratorController extends BaseController {
|
||||
@Autowired
|
||||
private IArbitratorService arbitratorService;
|
||||
|
||||
/**
|
||||
* 查询仲裁员信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('arbitrator:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Arbitrator arbitrator)
|
||||
{
|
||||
startPage();
|
||||
List<Arbitrator> list = arbitratorService.selectArbitratorList(arbitrator);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/caseApplication")
|
||||
public class CaseApplicationController extends BaseController {
|
||||
@Autowired
|
||||
private ICaseApplicationService caseApplicationService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询立案数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CaseApplication caseApplication)
|
||||
{
|
||||
startPage();
|
||||
List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增立案数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:add')")
|
||||
@Log(title = "新增立案数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addCaseApplication")
|
||||
public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
int caseApplicationCount = caseApplicationService.selectCaseApplicationCount(caseApplication);
|
||||
if(caseApplicationCount>0){
|
||||
return error("新增立案申请'" + caseApplication.getCaseNum() + "'案件编号已存在");
|
||||
}
|
||||
caseApplication.setCreateBy(getUsername());
|
||||
return toAjax(caseApplicationService.insertcaseApplication(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改立案数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:edit')")
|
||||
@Log(title = "修改立案数据", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/editCaseApplication")
|
||||
public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
|
||||
caseApplication.setUpdateBy(getUsername());
|
||||
return toAjax(caseApplicationService.editCaseApplication(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交立案申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:submit')")
|
||||
@Log(title = "提交立案申请", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/submitCaseApplication")
|
||||
public AjaxResult submitCaseApplication(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
|
||||
return toAjax(caseApplicationService.submitCaseApplication(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除立案数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:remove')")
|
||||
@Log(title = "删除立案数据", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/removeCaseApplication")
|
||||
public AjaxResult removeCaseApplication(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
|
||||
return toAjax(caseApplicationService.deletecaseApplicationByIds(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询立案信息
|
||||
*/
|
||||
@PostMapping("/selectCaseApplication")
|
||||
public AjaxResult selectCaseApplication(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication);
|
||||
return success(caseApplicationselect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 立案申请导入模板下载
|
||||
*/
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response)
|
||||
{
|
||||
ExcelUtil<CaseApplication> util = new ExcelUtil<CaseApplication>(CaseApplication.class);
|
||||
util.importTemplateExcel(response, "立案申请数据");
|
||||
}
|
||||
|
||||
@Log(title = "立案信息导入", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||
ExcelUtil<CaseApplication> util = new ExcelUtil<CaseApplication>(CaseApplication.class);
|
||||
List<CaseApplication> caseApplicationList = util.importExcel(file.getInputStream());
|
||||
String operName = getUsername();
|
||||
String message = caseApplicationService.importCaseApplication(caseApplicationList,operName);
|
||||
return success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组庭
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:pendTral')")
|
||||
@Log(title = "组庭", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/pendTral")
|
||||
public AjaxResult pendTral(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
return toAjax(caseApplicationService.pendTral(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 组庭审核
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:pendTralCheck')")
|
||||
@Log(title = "组庭审核", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/pendTralCheck")
|
||||
public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
return toAjax(caseApplicationService.pendTralCheck(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 组庭确认
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:pendTralSure')")
|
||||
@Log(title = "组庭确认", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/pendTralSure")
|
||||
public AjaxResult pendTralSure(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
return toAjax(caseApplicationService.pendTralSure(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 核验裁决书
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:verificationArbitrateRecord')")
|
||||
@Log(title = "核验裁决书", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/verificationArbitrateRecord")
|
||||
public AjaxResult verificationArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
return toAjax(caseApplicationService.verificationArbitrateRecord(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核裁决书
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')")
|
||||
@Log(title = "审核裁决书", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/checkArbitrateRecord")
|
||||
public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
return toAjax(caseApplicationService.checkArbitrateRecord(caseApplication));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 是否指派仲裁员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:pendingAppointArbotrar')")
|
||||
@Log(title = "是否指派仲裁员", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/pendingAppointArbotrar")
|
||||
public AjaxResult pendingAppointArbotrar(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
return toAjax(caseApplicationService.pendingAppointArbotrar(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交立案审查
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseApplication:submitCaseApplicationCheck')")
|
||||
@Log(title = "提交立案审查", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/submitCaseApplicationCheck")
|
||||
public AjaxResult submitCaseApplicationCheck(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
|
||||
return toAjax(caseApplicationService.submitCaseApplicationCheck(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认缴费查询立案信息
|
||||
*/
|
||||
@PostMapping("/selectCaseApplicationConfirm")
|
||||
public AjaxResult selectCaseApplicationConfirm(@Validated @RequestBody CaseApplication caseApplication)
|
||||
{
|
||||
CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplicationConfirm(caseApplication);
|
||||
return success(caseApplicationselect);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/arbitrate")
|
||||
public class CaseArbitrateController extends BaseController {
|
||||
@Autowired
|
||||
private ICaseArbitrateService caseArbitrateService;
|
||||
|
||||
/**
|
||||
* 审核仲裁方式
|
||||
* @param caseApplication
|
||||
* @param opinion 1同意,0拒绝
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/method")
|
||||
public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication
|
||||
,Integer opinion){
|
||||
return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 书面审理
|
||||
* @param arbitrateRecord
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/writtenHear")
|
||||
public AjaxResult writtenHear(@Validated @RequestBody ArbitrateRecord arbitrateRecord){
|
||||
return caseArbitrateService.writtenHear(arbitrateRecord);
|
||||
}
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 案件证据
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/evidence")
|
||||
public class CaseEvidenceController extends BaseController {
|
||||
private final ICaseEvidenceService caseEvidenceService;
|
||||
|
||||
@Autowired
|
||||
public CaseEvidenceController(ICaseEvidenceService caseEvidenceService) {
|
||||
this.caseEvidenceService = caseEvidenceService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据案件id查询案件详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getCaseDetailsById(@PathVariable Long id) {
|
||||
String username = this.getUsername();
|
||||
return caseEvidenceService.getCaseDetailsById(id,username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件证据上传
|
||||
*
|
||||
* @param file 附件
|
||||
* @param annexType 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)
|
||||
* @param id 案件申请id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) {
|
||||
String username = this.getUsername();
|
||||
Long userId = this.getUserId();
|
||||
return caseEvidenceService.uploadEvidence(file, annexType, id,username,userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户案件列表
|
||||
* @param identityNum
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/all")
|
||||
public TableDataInfo getCaseListAll(@RequestParam String identityNum) {
|
||||
startPage();
|
||||
List<CaseEvidenceVO> list = caseEvidenceService.getCaseListAll(identityNum);
|
||||
if (list != null) {
|
||||
return getDataTable(list);
|
||||
}
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 证据确认
|
||||
* @param caseApplication 案件对象
|
||||
* @return 统一返回结果
|
||||
*/
|
||||
@PutMapping("/confirm")
|
||||
public AjaxResult evidenceConfirmation(@Validated @RequestBody CaseApplication caseApplication){
|
||||
return caseEvidenceService.evidenceConfirmation(caseApplication);
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件质证
|
||||
* @param caseEvidenceDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/crossexami")
|
||||
public AjaxResult caseCrossexamination(@Validated @RequestBody CaseEvidenceDTO caseEvidenceDTO){
|
||||
return caseEvidenceService.caseCrossexamination(caseEvidenceDTO);
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/caseLogRecord")
|
||||
public class CaseLogRecordController extends BaseController {
|
||||
@Autowired
|
||||
private ICaseLogRecordService caseLogRecordService;
|
||||
|
||||
/**
|
||||
* 查询案件日志列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('caseLogRecord:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CaseLogRecord caseLogRecord)
|
||||
{
|
||||
startPage();
|
||||
List<CaseLogRecord> list = caseLogRecordService.selectCaseLogRecordList(caseLogRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 缴费支付
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pay")
|
||||
public class CasePaymentController {
|
||||
private final ICasePaymentService paymentService;
|
||||
@Autowired
|
||||
public CasePaymentController(ICasePaymentService paymentService){
|
||||
this.paymentService=paymentService;
|
||||
}
|
||||
/**
|
||||
* 案件缴费
|
||||
* @param casePayDTO 缴费传入参数
|
||||
* @return 统一响应结果
|
||||
*/
|
||||
@PostMapping("/casePay")
|
||||
public AjaxResult casePay(@Validated @RequestBody CasePayDTO casePayDTO) {
|
||||
return paymentService.casePay(casePayDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 缴费确认
|
||||
* @param caseApplication
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/confirm")
|
||||
public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) {
|
||||
return paymentService.confirmPayment(caseApplication);
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||
import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/identityAuthentication")
|
||||
public class IdentityAuthenticationController extends BaseController {
|
||||
@Autowired
|
||||
private IdentityAuthenticationService identityAuthenticationService;
|
||||
|
||||
/**
|
||||
* 查询身份认证EIDtoken
|
||||
*/
|
||||
@PostMapping("/selectIdentityAuthenticaEIDtoken")
|
||||
public AjaxResult selectIdentityAuthenticaEIDtoken()
|
||||
{
|
||||
IdentityAuthentication ientityAuthentication = identityAuthenticationService.selectIdentityAuthenticaEIDtoken();
|
||||
return success(ientityAuthentication);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询身份认证结果
|
||||
*/
|
||||
@PostMapping("/selectIdentityAuthenticaRespon")
|
||||
public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication)
|
||||
{
|
||||
String username = this.getUsername();
|
||||
Long userId = this.getUserId();
|
||||
ientityAuthentication.setUserId(userId);
|
||||
ientityAuthentication.setUserName(username);
|
||||
IdentityAuthentication ientityAuthenticationRes = identityAuthenticationService.selectIdentityAuthenticaRespon( ientityAuthentication);
|
||||
return success(ientityAuthenticationRes);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
MIIEuwIBADANBgkqhkiG9w0BAQEFAASCBKUwggShAgEAAoIBAQC12YM9mR+HFQYTx/fHKHZbgszVtDHDB0B/ysWl3MbcPpGtjcZlDr5aynRMRLaoduRHT++A98IaNVIVGj9RHdXrX2j9I/Uz6fYDH63cdu6FZ6Pk82yPwNZW7pebprbVHInR/7gzsKQWSWEST70BgjCRqlbfAE6xzUZFTeYxciCjptm0rUQ2MC24xRdkvZByIDIYFnQ/AdmSFqNtKDR2WpEV/M8aBjyuPPomRJZ1X8oudWuJIU4ySdas04fCbDxD10TY/wyQcDHXuG1IrQpXme4DOGQeJZ0/aOFphBkDFUyPGfYMmLshOPNdBKi2IqWHPPs4XsV4Rv6+tvTSnMF2uGqHAgMBAAECggEAPa1sifPpcZN74DGupGng2uDeQI1BY3iOM8m+h6b9+61tE4RGifgaMAkCsOuNWE4a1uURwphFyUXUdTvVxdlsuMw/e7w6akUsH5sbCO99rtmcCQdXBtrM1+dMnIpK8LUhOYyWGVIMFVMGDYPmAyD5AC7aEAC2sC+DafYl4RdoYpidq1YxeE7DVw1aQHCI2mKhYjZG+3RDDGDfNFvdyH61MgdYjoGkeXNvARzEXgfWvfiTrHZ3H1SYgvOEHofzKDTrWsQL2dvaEsc55Jiw0AgNUVcgby7al8PUekTJoK3ZvrE3pSWaUirBcqsqWISHjeR7Xx501CHIha8EnZwlnDoM4QKBgQDtnYzwQ5mHg7cRHD8Z6QdTpvBvYSEPesiUT/HeI+AKQKDCVJxKiLvJagc6zZkOzV9bZDS/WLgzXWMyxUb+OTjht0jLWAMcf7NfFp3tPKq9wkmQQ/vQSBQ1lFmO6A4Zq1eoGKeUCB4pKBG6cSM+t8+ruhm7s1ZUt+6EBwCVN/izrQKBgQDD62jIm+6NFErdidUaIrGiFUrzqdR13w6JOexfk+O6Aau3wRqsr7Wz4nqQvVVxGMRpXbOH06zpeiS+vMmjwgO973VoLAmH+hJ0GZz8qj3zA2GEOFWjD2V7tqeRvGkQvz0v46pl+8sBJkrRHLN7DWNYY5NDI+b7exwqcTc/LL19gwJ/a6r4MeZvqvgD+7zQ2uy8ZSs/xzg7wsfgG1QeRIn8+qhOL8AnEZ7jeGCS5hJDSHHGw6KkRA/vZ1bpnBfIE2naXGywj3NR9Zfnry6QYO8cbt+adcRYVghTH/QYoKiFuxvonEKPrIQBJqUBY3ngforLjwTEpEie1cSCT1Dc8sBp8QKBgQCaz8fqzRyBKknGKQXVMxj+JKknRUl3IpzP3o9jLu9BqdRQzSwQzH9d91Y2TQXY6mM5hys35xG5JCUo+vCyj7p5OWCiwjl90yMFzr93/+YXwtIpsoIo6R+d1EUxKZoz+4mT7+hT0dUlwWZZOr6wO3IHBBf3c8UvbqZg+zlWmDnblQKBgEs6jwMkb5zaG2fyBJ7PJUN/8nIz8V+X0SxQfcEqIX0J+EC+7MAgFjcdZFp+lca3Vd9z+8Ksd4rMzMa5y856ositL2NZ+K0fs8i8EBaQPny61OgCFUuXEuv5keB2YuGMSns5FYRWuByrtDXl4PxzKXvq05iKWLKCaCq9v4momvKZ
|
||||
@@ -0,0 +1 @@
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhUnjdAKwZApwZEcfq+5L0pa77Vg3mqcoXv+th8RR0SYotkPsH1f2JkbS48ySaSCM6YNWSMNfqp5qdOla2zUJOBnJ/yaBg7s7fVD6V3M2mEog8kCDYGKt/3P4VII3xYl8lFYMQ3IcFRELkxCBBCA8JDKmf5z2R4F/Z/jFFEuOwxaJvp+7Ke9OzZHYdWGNnU6QP8YYLYUeX7VNZLHEuly34ExAw6A+yJkNDsYEho2Lu31QjT2pLh9g+88MlRfiI92iN25O9NVdeM4f5RcpvBPrBQZQs9tlFmALYSFS3prIf3FAobWM+W7iwxT6J25nFIhst1DdJQfIBpaeRUJVTkn99QIDAQAB
|
||||
@@ -6,9 +6,9 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ruyivue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: ruyivue
|
||||
password: rybackproje13689
|
||||
url: jdbc:mysql://121.40.189.20:3306/arbitrate?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
username: root
|
||||
password: root123456
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
||||
@@ -9,7 +9,7 @@ ruoyi:
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/ruoyi/uploadPath
|
||||
profile: /home/ruoyi/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数字计算 char 字符验证
|
||||
@@ -18,7 +18,7 @@ ruoyi:
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8080
|
||||
port: 9001
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@@ -32,7 +32,6 @@ server:
|
||||
max: 800
|
||||
# Tomcat启动初始化的线程数,默认值10
|
||||
min-spare: 100
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
@@ -70,9 +69,9 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: localhost
|
||||
host: 121.40.189.20
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
port: 6389
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
@@ -89,6 +88,25 @@ spring:
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
web:
|
||||
resources:
|
||||
static-locations: file:/home/ruoyi/
|
||||
mail:
|
||||
host: smtp.163.com
|
||||
port: 25
|
||||
username: hjbjava@163.com
|
||||
password: BSRSSEPJWGNNVYYL
|
||||
default-encoding: UTF-8
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
socketFactoryClass: javax.net.ssl.SSLSocketFactory
|
||||
debug: false
|
||||
#上上签配置参数
|
||||
ssq:
|
||||
developerId: 1695872832013855470
|
||||
privateKey: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCiDRuz+dxqkWqHdov0hK+KEWLw/e8MQSqkZZ4c01Yr6cSmQiWyV8Xin0u5S/EA02FWxpjLi1nLriVtOBhZGsoryFmcJrwzSnQ5PORP/HhfcAWFE/Y+3qSQS1OiU7e5wbReCgEUvx4GHZuhdu8cOvq5DG9l33YFZrIEMBTmnf8eKT54STx0tjcKl7U6B6nsiThy3zVtpWXVv6H1HGmxC0KT4EQ388s/PFjrwmk+GFb3EpKCns/GQHf7QrtNz1ZOgCXfgQiQ+91/tcngzUH+zMCIxn5lS+ENAxVI6Ev3W9Y0QHtKwmO4ORVuAskJYzBB2xKI/gw8+PUXNziMAKXuoUAjAgMBAAECggEAd7yHw6vTGUrpE76cGsgPjEzcdoSqpLth7qbG9TWSblAEZXRqtiP0q0ZYhUl/gcSuH5gOPhdw+fZq4RCZrP0GdONMkvxsAtn4lnJPoGpD5wC2k2X0hO+tWJDP8xk4n6BozTNHKTUt0gb+f4eJlapep2xwwy0h30vKLR3504zafEV9j/2D8l5TFSv6rd3UVxUvrDKQ9mhfATEUlrTpjs0SfWupMkr4j7TuJJ8qSUSiEADe4hyUB6+LouDZCt8jV4aLojQBJKrQ6VPVdDFkHGsePu4tHtvcKsaOZJ0pjpJ7MT6D5ElD/sJjo0g/3qK5/FToVFVbrxtykVreK6mE5oSTQQKBgQDpEFSgH1d4N7NsZhviaCIUkB97hO0jpRbD7UZirzZ9ok96Fk+SmfhdmypDMoiaRHCNhQuu5dI9mg5RbUhz9mCZnAhzJRL+DmE4bhNvQmbtJA7KT6n/AdH2zy0mYulrcG17dQspvTr/5421PTEE2+FRoCbG6hBsSSUit9HLvAU13QKBgQCx/7ql+hbx+t0Yb02XckBHiA+MWrFLO4dMX9cKf3LldC0nhn0K9HOSoZmM0KcmXRnMo+/4t89xOJRl7JRXwcLoy/64OaUBVv+8FFV1yY4THka3nEnQE40vVWy+vuNJtt+eKlEhJ35N1GIHXo7/4j0POtEuNU7KSqMnLUD+Oy/t/wKBgEiajcJUASuyLnLWXFlrlzJQs34HKtiv1Se0Avk7G/6HUbr2uFMzI+wFKmVEmMl2CJoNmFYjwhruowc6xBdb6TvxH7C/G+uJD0BFCkjeprG5SeI8bvjB2GbKo4YRyiVuIK0VCSU3jemqeLq9FUguN0L2YR4WTIdvQeJO4UxWhkkBAoGBAJk7TxDHZK1XirIYTzGK928c4FWxVWMwkd7buqGc6epBwwV9r3OY0U1vtGIW1W4fQ7B5iIISqpALZyT/Lw0FDqedxWAOr8+hd3IQBynpI1et/q7d6mUoD6ip332tkrjIp2TfhQwHlaGmreUuL+h0eJ/9wEoJNhTLf/yf5o11omM9AoGBAOLVlXR9FbU2Ubpp3HwTumSzKDWzq3T5eQcqC1zE3BPOo29uAf9BQTumPxe51U64egttW/nif5FH4v4Gentmxb2B2ckdOs/u9zIWz3JPfHU7RqMyMokuWrQ6lMoiSYpH3MSHoavLyAEhAnpceX3oktXgpYHO9d8MfON3XKJl23ip
|
||||
serverHost: https://openapi.bestsign.info/openapi/v2/
|
||||
|
||||
# token配置
|
||||
token:
|
||||
@@ -129,3 +147,23 @@ xss:
|
||||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
#支付相关配置
|
||||
elegent:
|
||||
pay:
|
||||
wxpay:
|
||||
mchId: 1561414331
|
||||
appId: wx6592a2db3f85ed25
|
||||
appSecret: d9a9ff00a633cd7353a8925119063b01
|
||||
mchSerialNo: 25FBDE3EFD31B03A4377EB9A4A47C517969E6620
|
||||
apiV3Key: CZBK51236435wxpay435434323FFDuv3
|
||||
alipay:
|
||||
appId: 2021003141676135
|
||||
callback:
|
||||
domain: http://121.40.189.20:9001/
|
||||
watch: true
|
||||
cycle: 10
|
||||
identityAuthentication:
|
||||
credentialSecretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
|
||||
credentialSecretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
|
||||
merchantId: 0NSJ2309281116194321
|
||||
privateKeyHexDecodeinfo: MHcCAQEEIEw7MRv3uYlpmU6Fko4GlXSh6Vd38k0cUQZ5zDwvRg+voAoGCCqBHM9VAYItoUQDQgAEUdxIAWhGg4LUXf1GoPdb8XMbGudpexPQCuaaRi9BCnNbpaF1kcwRhhsBKvop9ZmW/nOz4wQ1r/iIEOrc9qCXgQ==
|
||||
@@ -0,0 +1 @@
|
||||
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDBHGgIh80193GhdpD1LtMZfTRpcWI0fImyuBCyrd3gYb3rrsARebGcHdJsQA3mVjVqVp5ybhEZDPa4ecoK4Ye1hTppNpI/lmLt4/uUV/zhF5ahli7hi+116Ty6svHSbuMQBuUZeTFOwGrxjvofU/4pGIwh8ZvkcSnyOp9uX2177UVxDBkhgbZbJp9XF2b83vUa5eHo93CziPzn3hFdAlBCdTXB7DH+m0nN3Jou0szGukvq7cIgGpHku4ycKSTkIhhl9WRhN6OoSEJxq88MXzjkzTruc85PHN52aUTUifwg3T8Y4XqFQ61dTnEmgxeD2O6/pLdB9gLsp6yCGqN5Lqk7AgMBAAECggEBAL4X+WzUSbSjFS9NKNrCMjm4H1zgqTxjj6TnPkC1mGEltjAHwLgzJBw62wWGdGhWWpSIGccpBBm1wjTMZpAZfF66fEpP1t1Ta6UjtGZNyvfFIZmE3jdWZ/WXGBnsxtFQKKKBNwrBW0Fbdqq9BQjLxLitmlxbmwrgPttcy855j6vZqq4MBT1v8CtUT/gz4UWW2xWovVnmWOrRSScv7Nh0pMbRpPLkNHXrBwSSNz/keORzXB9JSm85wlkafa7n5/IJbdTml3A/uAgW3q3JZZQotHxQsYvD4Zb5Cnc9CPAXE5L2Yk877kVXZMGt5QPIVcPMj/72AMtaJT67Y0fN0RYHEGkCgYEA38BIGDY6pePgPbxB7N/l6Df0/OKPP0u8mqR4Q0aQD3VxeGiZUN1uWXEFKsKwlOxLfIFIFk1/6zQeC0xetNTKk0gTL8hpMUTNkE7vI9gFWws2LY6DE86Lm0bdFEIwh6d7Fr7zZtyQKPzMsesC3XV9sdSUExEi5o/VwAyf+xZlOXcCgYEA3PGZYlILjg3esPNkhDz2wxFw432i8l/BCPD8ZtqIV9eguu4fVtFYcUVfawBb0T11RamJkc4eiSOqayC+2ehgb+GyRLJNK4FqbFcsIT+CK0HlscZw51jrMR0MxTc4RzuOIMoYDeZqeGB6/YnNyG4pw2sD8bIwHm8406gtJsX/v10CgYAo8g3/aEUZQHcztPS3fU2cTkkl0ev24Ew2XGypmwsX2R0XtMSBuNPNyFHyvkgEKK2zrhDcC/ihuRraZHJcUyhzBViFgP5HBtk7VEaM36YzP/z9Hzw7bqu7kZ85atdoq6xpwC3Yn/o9le17jY8rqamD1mv2hUdGvAGYsHbCQxnpBwKBgHTkeaMUBzr7yZLS4p435tHje1dQVBJpaKaDYPZFrhbTZR0g+IGlNmaPLmFdCjbUjiPyA2+Znnwt227cHz0IfWUUAo3ny3419QkmwZlBkWuzbIO2mms7lwsf9G6uvV6qepKMeVd5TWEsokVbT/03k27pQmfwPxcK/wS0GFdIL/udAoGAOYdDqY5/aadWCyhzTGI6qXPLvC+fsJBPhK2RXyc+jYV0KmrEv4ewxlK5NksuFsNkyB7wlI1oMCa/xB3T/2vTBALgGFPi8BJqceUjtnTYtI4R2JIVEl08RtEJwyU5JZ2rvWcilsotVZYwfuLZ9KfdhkTrgNxlp/KKkr+UuKce4Vs=
|
||||
@@ -126,6 +126,78 @@
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.22</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 腾讯短信sdk -->
|
||||
<dependency>
|
||||
<groupId>com.tencentcloudapi</groupId>
|
||||
<artifactId>tencentcloud-sdk-java</artifactId>
|
||||
<version>3.1.270</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>com.tencentcloudapi</groupId>
|
||||
<artifactId>tencentcloud-sdk-java-faceid</artifactId>
|
||||
<version>3.1.871</version>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>com.tencentcloudapi</groupId>
|
||||
<artifactId>tencentcloud-sdk-java-faceid</artifactId>
|
||||
<version>LATEST</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tencentcloudapi</groupId>
|
||||
<artifactId>tencentcloud-sdk-java-common</artifactId>
|
||||
<version>LATEST</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.15</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15to18</artifactId>
|
||||
<version>1.69</version>
|
||||
</dependency>
|
||||
|
||||
<!-- poi-tl-->
|
||||
<dependency>
|
||||
<groupId>com.deepoove</groupId>
|
||||
<artifactId>poi-tl</artifactId>
|
||||
<version>1.9.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 发送邮件-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
<version>3.1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.activation</groupId>
|
||||
<artifactId>activation</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/javax.mail/mail -->
|
||||
<dependency>
|
||||
<groupId>javax.mail</groupId>
|
||||
<artifactId>mail</artifactId>
|
||||
<version>1.4.7</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.ruoyi.common.constant;
|
||||
/**
|
||||
* 立案申请案件状态
|
||||
*
|
||||
*/
|
||||
public class CaseApplicationConstants {
|
||||
/** 立案申请 */
|
||||
public static final int CASE_APPLICATION = 0;
|
||||
/** 待立案审查 */
|
||||
public static final int CASE_CHECK = 1;
|
||||
/** 待缴费 */
|
||||
public static final int PENDING_PAYMENT = 2;
|
||||
/** 待缴费确认 */
|
||||
public static final int PENDING_PAYMENT_CONFIRM = 3;
|
||||
/** 待案件质证 */
|
||||
public static final int CASE_CROSSEXAMI = 4;
|
||||
|
||||
/** 待组庭 */
|
||||
public static final int PENDING_TRIAL = 26;
|
||||
/** 待组庭审核 */
|
||||
public static final int CONFIRMDED_PENDING_TRIAL_SUBMMIT = 5;
|
||||
/** 待组庭确定 */
|
||||
public static final int CONFIRMDED_PENDING_TRIAL = 6;
|
||||
|
||||
/** 待审核仲裁方式 */
|
||||
public static final int CHECK_ARBITRATION_METHOD = 7;
|
||||
/** 待开庭审理 */
|
||||
public static final int PENDING_OPENCOURT_HEAR = 8;
|
||||
/** 待书面审理 */
|
||||
public static final int PENDING_WRIITEN_HEAR = 9;
|
||||
/** 待生成仲裁文书 */
|
||||
public static final int GENERATED_ARBITRATION = 10;
|
||||
/**待核验仲裁文书*/
|
||||
public static final int VERPRIF_ARBITRATION = 11;
|
||||
/**待审核仲裁文书*/
|
||||
public static final int CHECK_ARBITRATION = 12;
|
||||
/**待仲裁文书签名*/
|
||||
public static final int SIGN_ARBITRATION = 13;
|
||||
/** 待仲裁文书用印 */
|
||||
public static final int ARBITRATED_SEAL = 14;
|
||||
/** 待仲裁文书送达 */
|
||||
public static final int ARBITRATION_DELIVERY = 15;
|
||||
/** 待案件归档*/
|
||||
public static final int CASE_FILING = 16;
|
||||
/** 已归档*/
|
||||
public static final int CASE_ARCHIVED = 17;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,118 +1,117 @@
|
||||
package com.ruoyi.common.core.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
/**
|
||||
* Entity基类
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class BaseEntity implements Serializable
|
||||
{
|
||||
public class BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 搜索值 */
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/** 请求参数 */
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private Map<String, Object> params;
|
||||
|
||||
public String getSearchValue()
|
||||
{
|
||||
public String getSearchValue() {
|
||||
return searchValue;
|
||||
}
|
||||
|
||||
public void setSearchValue(String searchValue)
|
||||
{
|
||||
public void setSearchValue(String searchValue) {
|
||||
this.searchValue = searchValue;
|
||||
}
|
||||
|
||||
public String getCreateBy()
|
||||
{
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy)
|
||||
{
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime()
|
||||
{
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime)
|
||||
{
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy()
|
||||
{
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy)
|
||||
{
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime()
|
||||
{
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime)
|
||||
{
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Map<String, Object> getParams()
|
||||
{
|
||||
if (params == null)
|
||||
{
|
||||
public Map<String, Object> getParams() {
|
||||
if (params == null) {
|
||||
params = new HashMap<>();
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, Object> params)
|
||||
{
|
||||
public void setParams(Map<String, Object> params) {
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.common.enums;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
@@ -9,28 +10,23 @@ import org.springframework.lang.Nullable;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public enum HttpMethod
|
||||
{
|
||||
public enum HttpMethod {
|
||||
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
|
||||
|
||||
private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
|
||||
|
||||
static
|
||||
{
|
||||
for (HttpMethod httpMethod : values())
|
||||
{
|
||||
static {
|
||||
for (HttpMethod httpMethod : values()) {
|
||||
mappings.put(httpMethod.name(), httpMethod);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static HttpMethod resolve(@Nullable String method)
|
||||
{
|
||||
public static HttpMethod resolve(@Nullable String method) {
|
||||
return (method != null ? mappings.get(method) : null);
|
||||
}
|
||||
|
||||
public boolean matches(String method)
|
||||
{
|
||||
public boolean matches(String method) {
|
||||
return (this == resolve(method));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.mail.SimpleMailMessage;
|
||||
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @ClassName EmailInUtil
|
||||
* @Description 邮件发送工具
|
||||
*/
|
||||
@Component
|
||||
@Data
|
||||
@Slf4j
|
||||
public class EmailOutUtil {
|
||||
private static Pattern emailPattern = Pattern.compile("^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$");
|
||||
// private static Pattern phonePattern = Pattern.compile("0?(13|14|15|18)[0-9]{9}");
|
||||
private static Pattern phonePattern = Pattern.compile("^1\\d{10}$");
|
||||
|
||||
|
||||
// @Autowired
|
||||
// private JavaMailSender mailSender;
|
||||
|
||||
// 发送发邮箱地址(外网地址)
|
||||
// @Value("${spring.mail-out-network.from}")
|
||||
// private static String fromOut;
|
||||
@Value("${spring.mail.host}")
|
||||
private String hostOut;
|
||||
@Value("${spring.mail.username}")
|
||||
private String usernameOut;
|
||||
@Value("${spring.mail.password}")
|
||||
private String passwordOut;
|
||||
@Value("${spring.mail.port}")
|
||||
private Integer portOut;
|
||||
|
||||
public JavaMailSender rebuildMailSender() {
|
||||
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
||||
mailSender.setHost(hostOut);
|
||||
mailSender.setUsername(usernameOut);
|
||||
mailSender.setPassword(passwordOut);
|
||||
mailSender.setPort(portOut);
|
||||
mailSender.setProtocol("smtp");
|
||||
mailSender.setDefaultEncoding("UTF-8");
|
||||
return mailSender;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送纯文本邮件信息
|
||||
*
|
||||
* @param to 接收方
|
||||
* @param subject 邮件主题
|
||||
* @param content 邮件内容(发送内容)
|
||||
*/
|
||||
public void sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
|
||||
// 创建一个邮件对象
|
||||
SimpleMailMessage msg = new SimpleMailMessage();
|
||||
msg.setFrom(from);
|
||||
msg.setTo(to);
|
||||
// 设置邮件主题
|
||||
msg.setSubject(subject);
|
||||
// 设置邮件内容
|
||||
msg.setText(content);
|
||||
// 发送邮件
|
||||
mailSender.send(msg);
|
||||
////System.out.println("发送成功:" + from + ":to:" + to);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送带附件的邮件信息
|
||||
*
|
||||
* @param to 接收方
|
||||
* @param subject 邮件主题
|
||||
* @param content 邮件内容(发送内容)
|
||||
* @param fileList 文件集合 // 可发送多个附件
|
||||
*/
|
||||
public void sendMessageCarryFiles(String to, String subject, String content, List<File> fileList, String from, @NotNull JavaMailSender mailSender) {
|
||||
MimeMessage mimeMessage = mailSender.createMimeMessage();
|
||||
try {
|
||||
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
|
||||
helper.setFrom(from);
|
||||
helper.setTo(to);
|
||||
// 设置邮件主题
|
||||
helper.setSubject(subject);
|
||||
// 设置邮件内容
|
||||
helper.setText(content);
|
||||
// 添加附件(多个)
|
||||
if (fileList != null && fileList.size() > 0) {
|
||||
for (File file : fileList) {
|
||||
helper.addAttachment(file.getName(), file);
|
||||
}
|
||||
}
|
||||
} catch (MessagingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 发送邮件
|
||||
mailSender.send(mimeMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送带附件的邮件信息
|
||||
*
|
||||
* @param to 接收方
|
||||
* @param subject 邮件主题
|
||||
* @param content 邮件内容(发送内容)
|
||||
* @param file 单个文件
|
||||
*/
|
||||
public void sendMessageCarryFile(String to, String subject, String content, File file, String from, JavaMailSender mailSender) {
|
||||
MimeMessage mimeMessage = mailSender.createMimeMessage();
|
||||
try {
|
||||
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
|
||||
helper.setFrom(from);
|
||||
helper.setTo(to);
|
||||
// 设置邮件主题
|
||||
helper.setSubject(subject);
|
||||
// 设置邮件内容
|
||||
helper.setText(content);
|
||||
// 单个附件
|
||||
helper.addAttachment(file.getName(), file);
|
||||
} catch (MessagingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 发送邮件
|
||||
mailSender.send(mimeMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化内外网邮件发送对象
|
||||
*
|
||||
* @param num
|
||||
*/
|
||||
// public static JavaMailSender initJavaMailSender(Integer num) {
|
||||
// if (num != null && num == 1) {
|
||||
// //内网
|
||||
// return rebuildMailSender(hostIn, usernameIn, passwordIn, Integer.parseInt(portIn), "smtps");
|
||||
// } else {
|
||||
// //外网
|
||||
// return rebuildMailSender(hostOut, usernameOut, passwordOut, Integer.parseInt(portOut), "smtps");
|
||||
// }
|
||||
// }
|
||||
|
||||
// public static String getInnerFrom() {
|
||||
// return EmailInUtil;
|
||||
// }
|
||||
//
|
||||
// public static String getOutterFrom() {
|
||||
// return fromOut;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 验证邮箱格式
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static boolean isEmail(String str) {
|
||||
boolean flag = false;
|
||||
Matcher matcher = emailPattern.matcher(str);
|
||||
if (matcher.matches()) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public static boolean isPhoneNumber(String str) {
|
||||
boolean flag = false;
|
||||
Matcher matcher = phonePattern.matcher(str);
|
||||
if (matcher.matches()) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
public class EsignApplicaConfig {
|
||||
|
||||
// 应用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";
|
||||
}
|
||||
@@ -0,0 +1,360 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
import com.ruoyi.common.enums.EsignRequestType;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.utils.bean.SealSignRecord;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class SignAward {
|
||||
|
||||
private static String eSignHost= EsignApplicaConfig.EsignHost;
|
||||
private static String eSignAppId=EsignApplicaConfig.EsignAppId;
|
||||
private static String eSignAppSecret=EsignApplicaConfig.EsignAppSecret;
|
||||
// public static String fileId = "95d0c307d91e4985bdb8874f6f84daa5";
|
||||
public static String fileId = "a0c2ad21065f48ff8b872412c39d5d3a";
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) throws EsignDemoException {
|
||||
Gson gson = new Gson();
|
||||
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
|
||||
sealSignRecord.setFileid("a808f1f39a744357a2f018e4ab34c55d");
|
||||
sealSignRecord.setFilename("23893bfd3f2249ffa5c82850c11c482e.pdf");
|
||||
sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d");
|
||||
|
||||
|
||||
sealSignRecord.setPensonAccount("18209231185");
|
||||
sealSignRecord.setPensonName("秦桃则");
|
||||
sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
|
||||
sealSignRecord.setOrgnizeNamePsnAccount("17691338406");
|
||||
sealSignRecord.setOrgnizeNamepsnName("韩超勃");
|
||||
sealSignRecord.setPositionPagepsn("2");
|
||||
|
||||
sealSignRecord.setPositionXpsn(279+20);
|
||||
sealSignRecord.setPositionYpsn(216.336-20);
|
||||
|
||||
sealSignRecord.setPositionPageorg("2");
|
||||
|
||||
sealSignRecord.setPositionXorg(342+30);
|
||||
sealSignRecord.setPositionYorg(185.136);
|
||||
|
||||
|
||||
|
||||
|
||||
/* 发起签署*/
|
||||
// EsignHttpResponse createByFile = createByFile(sealSignRecord);
|
||||
// JsonObject createByFileJsonObject = gson.fromJson(createByFile.getBody(), JsonObject.class);
|
||||
// JsonObject createByFileData = createByFileJsonObject.getAsJsonObject("data");
|
||||
// String signFlowId = createByFileData.get("signFlowId").getAsString();
|
||||
// System.err.println("流程id:"+signFlowId);
|
||||
|
||||
/* 获取文件签名印章位置*/
|
||||
EsignHttpResponse positions = getPositions(sealSignRecord);
|
||||
JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
||||
JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
||||
JsonArray keywordPositions = positionsData.get("keywordPositions").getAsJsonArray();
|
||||
System.out.println("获取文件签名印章位置:" +keywordPositions.toString());
|
||||
|
||||
// String signFlowId = "c9955453716344f9971d308abdc13464";
|
||||
//获取合同文件签名链接
|
||||
// EsignHttpResponse signUrl = signUrl(sealSignRecord);
|
||||
// JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
||||
// JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
||||
// String shortUrl = signUrlData.get("shortUrl").getAsString();
|
||||
// String url = signUrlData.get("url").getAsString();
|
||||
// System.out.println("签署短链接:" +shortUrl);
|
||||
// System.out.println("签署长链接:"+url);
|
||||
|
||||
//获取合同文件用印链接
|
||||
// EsignHttpResponse usesealUrl = usesealUrl(sealSignRecord);
|
||||
// JsonObject usesealUrlJsonObject = gson.fromJson(usesealUrl.getBody(), JsonObject.class);
|
||||
// JsonObject usesealUrlData = usesealUrlJsonObject.getAsJsonObject("data");
|
||||
// String shortusesealUrl = usesealUrlData.get("shortUrl").getAsString();
|
||||
// String sealUrl = usesealUrlData.get("url").getAsString();
|
||||
// System.out.println("签署长链接:" +shortusesealUrl);
|
||||
// System.out.println("签署短链接:"+sealUrl);
|
||||
|
||||
//查询签署流程详情
|
||||
// EsignHttpResponse signFlowDetail = signFlowDetail(sealSignRecord);
|
||||
// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
||||
// System.out.println(signFlowDetailJsonObject);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询签署流程详情
|
||||
* @return
|
||||
*/
|
||||
public static EsignHttpResponse signFlowDetail(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
String signFlowId = sealSignRecord.getSignFlowid();
|
||||
String apiaddr= "/v3/sign-flow/"+ signFlowId + "/detail";
|
||||
String jsonParm = null;
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.GET;
|
||||
//生成签名鉴权方式的的header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发起签署
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
String apiaddr = "/v3/sign-flow/create-by-file";
|
||||
|
||||
String fileId = sealSignRecord.getFileid();
|
||||
String fileName = sealSignRecord.getFilename();
|
||||
|
||||
String psnAccount = sealSignRecord.getPensonAccount();
|
||||
String psnName = sealSignRecord.getPensonName();
|
||||
|
||||
String orgName = sealSignRecord.getOrgnizeName();
|
||||
String orgNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount();
|
||||
String orgNamepsnName = sealSignRecord.getOrgnizeNamepsnName();
|
||||
|
||||
String positionPagepsn = sealSignRecord.getPositionPagepsn();
|
||||
double positionXpsn = sealSignRecord.getPositionXpsn();
|
||||
double positionYpsn = sealSignRecord.getPositionYpsn();
|
||||
|
||||
String positionPageorg = sealSignRecord.getPositionPageorg();
|
||||
double positionXorg = sealSignRecord.getPositionXorg();
|
||||
double positionYorg = sealSignRecord.getPositionYorg();
|
||||
|
||||
|
||||
String jsonParm = "{\n" +
|
||||
" \"docs\": [\n" +
|
||||
" {\n" +
|
||||
|
||||
// " \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" +
|
||||
" \"fileId\": \"" + fileId + "\",\n" +
|
||||
|
||||
// " \"fileName\": \"477470a7741b4536a200c792b6ddf966.pdf\"\n" +
|
||||
" \"fileName\": \"" + fileName + "\"\n" +
|
||||
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"signFlowConfig\": {\n" +
|
||||
" \"signFlowTitle\": \"测试合同\",\n" +
|
||||
" \"autoStart\": true,\n" +
|
||||
" \"authConfig\": {\n" +
|
||||
" \"willingnessAuthModes\": [\n" +
|
||||
" \"CODE_SMS\"\n" +
|
||||
" ],\n" +
|
||||
" \"psnAvailableAuthModes\": [\n" +
|
||||
" \"PSN_MOBILE3\"\n" +
|
||||
" ],\n" +
|
||||
" \"orgAvailableAuthModes\": [\n" +
|
||||
" \"ORG_LEGALREP\"\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" \"autoFinish\": true\n" +
|
||||
" },\n" +
|
||||
|
||||
" \"signers\": [\n" +
|
||||
|
||||
" {\n" +
|
||||
|
||||
" \"psnSignerInfo\": {\n" +
|
||||
|
||||
// " \"psnAccount\": \"18209231185\",\n" +
|
||||
" \"psnAccount\": \"" + psnAccount + "\",\n" +
|
||||
|
||||
" \"psnInfo\": {\n" +
|
||||
|
||||
// " \"psnName\": \"秦桃则\"\n" +
|
||||
" \"psnName\": \"" + psnName + "\"\n" +
|
||||
" }\n" +
|
||||
|
||||
|
||||
" },\n" +
|
||||
|
||||
|
||||
" \"signFields\": [\n" +
|
||||
" {\n" +
|
||||
|
||||
// " \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" +
|
||||
" \"fileId\": \"" + fileId + "\",\n" +
|
||||
|
||||
" \"normalSignFieldConfig\": {\n" +
|
||||
" \"autoSign\": false,\n" +
|
||||
" \"freeMode\": false,\n" +
|
||||
" \"movableSignField\": false,\n" +
|
||||
" \"signFieldPosition\": {\n" +
|
||||
|
||||
// " \"positionPage\": \"2\",\n" +
|
||||
" \"positionPage\": \"" + positionPagepsn + "\",\n" +
|
||||
|
||||
// " \"positionX\": 310.0,\n" +
|
||||
" \"positionX\": " + positionXpsn + ",\n" +
|
||||
|
||||
// " \"positionY\": 247.536\n" +
|
||||
" \"positionY\": " + positionYpsn + "\n" +
|
||||
|
||||
" },\n" +
|
||||
" \"signFieldStyle\": 1\n" +
|
||||
" },\n" +
|
||||
" \"signFieldType\": 0\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"signerType\": 0\n" +
|
||||
" },\n" +
|
||||
|
||||
|
||||
" {\n" +
|
||||
" \"orgSignerInfo\": {\n" +
|
||||
|
||||
// " \"orgName\": \"西安云美电子科技有限公司\",\n" +
|
||||
" \"orgName\": \"" + orgName + "\",\n" +
|
||||
|
||||
" \"transactorInfo\": {\n" +
|
||||
|
||||
|
||||
// " \"psnAccount\": \"17691338406\",\n" +
|
||||
" \"psnAccount\": \"" + orgNamePsnAccount + "\",\n" +
|
||||
|
||||
" \"psnInfo\": {\n" +
|
||||
|
||||
// " \"psnName\": \"韩超勃\"\n" +
|
||||
" \"psnName\": \"" + orgNamepsnName + "\"\n" +
|
||||
" }\n" +
|
||||
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
|
||||
" \"signFields\": [\n" +
|
||||
" {\n" +
|
||||
|
||||
// " \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" +
|
||||
" \"fileId\": \"" + fileId + "\",\n" +
|
||||
|
||||
" \"normalSignFieldConfig\": {\n" +
|
||||
" \"autoSign\": false,\n" +
|
||||
" \"freeMode\": false,\n" +
|
||||
|
||||
" \"signFieldPosition\": {\n" +
|
||||
|
||||
// " \"positionPage\": \"2\",\n" +
|
||||
" \"positionPage\": \"" + positionPageorg + "\",\n" +
|
||||
|
||||
// " \"positionX\": 340.0,\n" +
|
||||
" \"positionX\": " + positionXorg + ",\n" +
|
||||
|
||||
// " \"positionY\": 340.736\n" +
|
||||
" \"positionY\": " + positionYorg + "\n" +
|
||||
" },\n" +
|
||||
" \"signFieldStyle\": 1\n" +
|
||||
" },\n" +
|
||||
" \"signFieldType\": 0\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"signerType\": 1\n" +
|
||||
" }\n" +
|
||||
|
||||
" ]\n" +
|
||||
"}";
|
||||
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
//生成请求签名鉴权方式的Header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同文件签名链接
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse signUrl(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
|
||||
String signFlowId = sealSignRecord.getSignFlowid();
|
||||
String psnAccount = sealSignRecord.getPensonAccount();
|
||||
|
||||
String apiaddr = "/v3/sign-flow/" + signFlowId + "/sign-url";
|
||||
String jsonParm = "{\n" +
|
||||
" \"operator\": {\n" +
|
||||
// " \"psnAccount\":\"18209231185\"\n" +
|
||||
" \"psnAccount\": \"" + psnAccount + "\"\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
//生成请求签名鉴权方式的Header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同文件用印链接
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse usesealUrl(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
String signFlowId = sealSignRecord.getSignFlowid();
|
||||
String apiaddr = "/v3/sign-flow/" + signFlowId + "/sign-url";
|
||||
|
||||
String psnAccount = sealSignRecord.getOrgnizeNamePsnAccount();
|
||||
String orgName = sealSignRecord.getOrgnizeName();
|
||||
|
||||
String jsonParm = "{\n" +
|
||||
// " \"needLogin\": true,\n" +
|
||||
" \"operator\": {\n" +
|
||||
|
||||
// " \"psnAccount\":\"17691338406\"\n" +
|
||||
" \"psnAccount\": \"" + psnAccount + "\"\n" +
|
||||
" },\n" +
|
||||
" \"organization\": {\n" +
|
||||
|
||||
// " \"orgName\": \"西安云美电子科技有限公司\"\n" +
|
||||
" \"orgName\": \"" + orgName + "\"\n" +
|
||||
|
||||
" }\n" +
|
||||
"}";
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
//生成请求签名鉴权方式的Header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件签名印章位置
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse getPositions(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
String fileId = sealSignRecord.getFileid();
|
||||
String apiaddr = "/v3/files/" + fileId + "/keyword-positions";
|
||||
String jsonParm = "{\n" +
|
||||
" \"keywords\": [\n" +
|
||||
" \"仲裁员:\",\n" +
|
||||
" \"(仲裁委员会盖章)\"\n" +
|
||||
" ]\n" +
|
||||
"}";
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
//生成请求签名鉴权方式的Header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
import com.tencentcloudapi.common.profile.ClientProfile;
|
||||
import com.tencentcloudapi.common.profile.HttpProfile;
|
||||
import com.tencentcloudapi.cvm.v20170312.CvmClient;
|
||||
import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsRequest;
|
||||
import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsResponse;
|
||||
import com.tencentcloudapi.sms.v20210111.SmsClient;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendStatus;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.var;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
public class SmsUtils {
|
||||
//应用id
|
||||
private static final String SDK_APP_ID = "1400854852";
|
||||
//API的SecretId
|
||||
private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
|
||||
//API的SecretKey
|
||||
private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
|
||||
//签名内容
|
||||
private static final String SIGN_NAME = "西安云美电子科技有限公司";
|
||||
|
||||
public static Boolean sendSms(SendSmsRequest request) {
|
||||
Credential cred = new Credential(SECRET_ID, SECRET_KEY );
|
||||
|
||||
SmsClient client = new SmsClient(cred, "ap-guangzhou");
|
||||
|
||||
final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
|
||||
req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
|
||||
req.setSmsSdkAppId(SDK_APP_ID );
|
||||
req.setSignName(SIGN_NAME);
|
||||
req.setTemplateId(request.getTemplateId());
|
||||
req.setTemplateParamSet(request.getTemplateParamSet());
|
||||
SendSmsResponse res = null;
|
||||
try {
|
||||
res = client.SendSms(req);
|
||||
} catch (TencentCloudSDKException e) {
|
||||
log.error("发送短信出错:", e);
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
SendStatus sendStatus = res.getSendStatusSet()[0];
|
||||
log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
|
||||
|
||||
if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
/**
|
||||
* 参数对象
|
||||
*/
|
||||
@Data
|
||||
public static class SendSmsRequest {
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 模板 ID: 必须填写已审核通过的模板 ID
|
||||
*/
|
||||
private String templateId;
|
||||
|
||||
/**
|
||||
* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空
|
||||
*/
|
||||
private String[] templateParamSet;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.data.*;
|
||||
import com.deepoove.poi.data.style.ParagraphStyle;
|
||||
import com.deepoove.poi.data.style.Style;
|
||||
import com.deepoove.poi.util.PoitlIOUtils;
|
||||
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 文档生成工具类
|
||||
*/
|
||||
public class WordUtil {
|
||||
|
||||
private CellRenderData cell;
|
||||
|
||||
/**
|
||||
* 查询生成的word文件流
|
||||
*
|
||||
* @param response
|
||||
* @param datas
|
||||
* @param modalFilePath
|
||||
* @param resultFilePath
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void getDocStreamFile(HttpServletResponse response, Map<String, Object> datas, String modalFilePath, String resultFilePath, String fileName) throws IOException {
|
||||
//获取word模板和填充数据
|
||||
XWPFTemplate template = XWPFTemplate.compile(modalFilePath).render(datas);
|
||||
//设置返回类型及文件名
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-disposition", "attachment;filename=\"" + fileName + "\"");
|
||||
//获取返回输出流
|
||||
OutputStream out = response.getOutputStream();
|
||||
BufferedOutputStream bos = new BufferedOutputStream(out);
|
||||
template.write(bos);
|
||||
bos.flush();
|
||||
out.flush();
|
||||
PoitlIOUtils.closeQuietlyMulti(template, bos, out);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生成的word文件路径
|
||||
*
|
||||
* @param datas
|
||||
* @param modalFilePath
|
||||
* @param resultFilePath
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public static String getDocFilePath(Map<String, Object> datas, String modalFilePath, String resultFilePath) throws IOException {
|
||||
//获取word模板和填充数据
|
||||
XWPFTemplate template = XWPFTemplate.compile(modalFilePath).render(datas);
|
||||
template.writeAndClose(new FileOutputStream(resultFilePath));
|
||||
return resultFilePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造绘制表格的方法
|
||||
*/
|
||||
public static TableRenderData rebuildWordTableData(List<String> headerList, String headerBackgroundColor, String textColor, List<List<String>> tableContentList) {
|
||||
RowRenderData header = rebuildWordTableHead(headerList, headerBackgroundColor, textColor);
|
||||
List<RowRenderData> content = rebuildWordTableContent(tableContentList);
|
||||
TableRenderData tableRenderData = Tables.create().addRow(header);
|
||||
for (int i = 0; content != null && i < content.size(); i++) {
|
||||
tableRenderData.addRow(content.get(i));
|
||||
}
|
||||
return tableRenderData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造表格表头
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static RowRenderData rebuildWordTableHead(List<String> headerList, String headerBackgroundColor, String textColor) {
|
||||
RowRenderData header = new RowRenderData();
|
||||
for (int i = 0; headerList != null && i < headerList.size(); i++) {
|
||||
CellRenderData cellRenderData = new CellRenderData();
|
||||
ParagraphRenderData paragraphRenderData = new ParagraphRenderData();
|
||||
Style style = new Style();
|
||||
style.setColor(textColor);
|
||||
style.setFontSize(12.0);
|
||||
ParagraphStyle paragraphStyle = ParagraphStyle.builder()
|
||||
.withAlign(ParagraphAlignment.CENTER)
|
||||
// .withBackgroundColor(headerBackgroundColor)
|
||||
.withDefaultTextStyle(style)
|
||||
.build();
|
||||
paragraphRenderData.addText(headerList.get(i));
|
||||
paragraphRenderData.setParagraphStyle(paragraphStyle);
|
||||
cellRenderData.addParagraph(paragraphRenderData);
|
||||
header.addCell(cellRenderData);
|
||||
}
|
||||
return header;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造表格内容
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static List<RowRenderData> rebuildWordTableContent(List<List<String>> tableContentList) {
|
||||
List<RowRenderData> rowContentList = new ArrayList<>();
|
||||
for (int i = 0; tableContentList != null && i < tableContentList.size(); i++) {
|
||||
List<String> rowdataList = tableContentList.get(i);
|
||||
RowRenderData rowcontent = new RowRenderData();
|
||||
for (int j = 0; rowdataList != null && j < rowdataList.size(); j++) {
|
||||
CellRenderData cellRenderData = new CellRenderData();
|
||||
ParagraphRenderData paragraphRenderData = new ParagraphRenderData();
|
||||
Style style = new Style();
|
||||
style.setFontSize(12.0);
|
||||
ParagraphStyle paragraphStyle = ParagraphStyle.builder()
|
||||
.withAlign(ParagraphAlignment.CENTER)
|
||||
.withDefaultTextStyle(style)
|
||||
.build();
|
||||
paragraphRenderData.addText(rowdataList.get(j));
|
||||
paragraphRenderData.setParagraphStyle(paragraphStyle);
|
||||
cellRenderData.addParagraph(paragraphRenderData);
|
||||
rowcontent.addCell(cellRenderData);
|
||||
}
|
||||
rowContentList.add(rowcontent);
|
||||
}
|
||||
return rowContentList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建图片内容
|
||||
*/
|
||||
public static PictureRenderData rebuildImageContent(Integer with, Integer height, String imageUrl, String relatedPath, Byte[] imageBytes) {
|
||||
PictureRenderData pictureRenderData = null;
|
||||
if (!StringUtils.isBlank(imageUrl)) {
|
||||
// pictureRenderData = Pictures.of(imageUrl).size(with, height).create();
|
||||
//Pictures.PictureBuilder pictureBuilder = Pictures.of("https://res.wx.qq.com/a/wx_fed/weixin_portal/res/static/img/1EtCRvm.png");
|
||||
}else if (!StringUtils.isBlank(relatedPath)) {
|
||||
pictureRenderData = Pictures.ofLocal(relatedPath).size(with,height).create();
|
||||
// Pictures.PictureBuilder pictureBuilder = Pictures.of("https://res.wx.qq.com/a/wx_fed/weixin_portal/res/static/img/1EtCRvm.png");
|
||||
}
|
||||
return pictureRenderData;
|
||||
}
|
||||
public static String getResultFilePath(Map<String, Object> datas, Configure config, String modalFilePath, String resultFilePath) throws IOException {
|
||||
//获取word模板和填充数据
|
||||
XWPFTemplate template = XWPFTemplate.compile(modalFilePath,config).render(datas);
|
||||
template.writeAndClose(new FileOutputStream(resultFilePath));
|
||||
return resultFilePath;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.ruoyi.common.utils.bean;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
public class SealSignRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** 文件id */
|
||||
private String fileid;
|
||||
/** 文件名称 */
|
||||
private String filename;
|
||||
/** 流程id */
|
||||
private String signFlowid;
|
||||
/** 签名人账户 */
|
||||
private String pensonAccount;
|
||||
/** 签名人姓名 */
|
||||
private String pensonName;
|
||||
/** 机构名称 */
|
||||
private String orgnizeName;
|
||||
/** 机构经办人 */
|
||||
private String orgnizeNamePsnAccount;
|
||||
/** 机构经办人名称 */
|
||||
private String orgnizeNamepsnName;
|
||||
|
||||
public String getFileid() {
|
||||
return fileid;
|
||||
}
|
||||
|
||||
public void setFileid(String fileid) {
|
||||
this.fileid = fileid;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
public String getSignFlowid() {
|
||||
return signFlowid;
|
||||
}
|
||||
|
||||
public void setSignFlowid(String signFlowid) {
|
||||
this.signFlowid = signFlowid;
|
||||
}
|
||||
|
||||
public String getPensonAccount() {
|
||||
return pensonAccount;
|
||||
}
|
||||
|
||||
public void setPensonAccount(String pensonAccount) {
|
||||
this.pensonAccount = pensonAccount;
|
||||
}
|
||||
|
||||
public String getPensonName() {
|
||||
return pensonName;
|
||||
}
|
||||
|
||||
public void setPensonName(String pensonName) {
|
||||
this.pensonName = pensonName;
|
||||
}
|
||||
|
||||
public String getOrgnizeName() {
|
||||
return orgnizeName;
|
||||
}
|
||||
|
||||
public void setOrgnizeName(String orgnizeName) {
|
||||
this.orgnizeName = orgnizeName;
|
||||
}
|
||||
|
||||
public String getOrgnizeNamePsnAccount() {
|
||||
return orgnizeNamePsnAccount;
|
||||
}
|
||||
|
||||
public void setOrgnizeNamePsnAccount(String orgnizeNamePsnAccount) {
|
||||
this.orgnizeNamePsnAccount = orgnizeNamePsnAccount;
|
||||
}
|
||||
|
||||
public String getOrgnizeNamepsnName() {
|
||||
return orgnizeNamepsnName;
|
||||
}
|
||||
|
||||
public void setOrgnizeNamepsnName(String orgnizeNamepsnName) {
|
||||
this.orgnizeNamepsnName = orgnizeNamepsnName;
|
||||
}
|
||||
|
||||
public String getPositionPagepsn() {
|
||||
return positionPagepsn;
|
||||
}
|
||||
|
||||
public void setPositionPagepsn(String positionPagepsn) {
|
||||
this.positionPagepsn = positionPagepsn;
|
||||
}
|
||||
|
||||
public double getPositionXpsn() {
|
||||
return positionXpsn;
|
||||
}
|
||||
|
||||
public void setPositionXpsn(double positionXpsn) {
|
||||
this.positionXpsn = positionXpsn;
|
||||
}
|
||||
|
||||
public double getPositionYpsn() {
|
||||
return positionYpsn;
|
||||
}
|
||||
|
||||
public void setPositionYpsn(double positionYpsn) {
|
||||
this.positionYpsn = positionYpsn;
|
||||
}
|
||||
|
||||
public String getPositionPageorg() {
|
||||
return positionPageorg;
|
||||
}
|
||||
|
||||
public void setPositionPageorg(String positionPageorg) {
|
||||
this.positionPageorg = positionPageorg;
|
||||
}
|
||||
|
||||
public double getPositionXorg() {
|
||||
return positionXorg;
|
||||
}
|
||||
|
||||
public void setPositionXorg(double positionXorg) {
|
||||
this.positionXorg = positionXorg;
|
||||
}
|
||||
|
||||
public double getPositionYorg() {
|
||||
return positionYorg;
|
||||
}
|
||||
|
||||
public void setPositionYorg(double positionYorg) {
|
||||
this.positionYorg = positionYorg;
|
||||
}
|
||||
|
||||
/** 签名位置页数 */
|
||||
private String positionPagepsn;
|
||||
/** 签名位置x坐标 */
|
||||
private double positionXpsn;
|
||||
/** 签名位置y坐标 */
|
||||
private double positionYpsn;
|
||||
/** 印章位置页数 */
|
||||
private String positionPageorg;
|
||||
/** 印章位置x坐标 */
|
||||
private double positionXorg;
|
||||
/** 印章位置y坐标 */
|
||||
private double positionYorg;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -25,6 +25,7 @@ public class ApplicationConfig
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization()
|
||||
{
|
||||
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
|
||||
// return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
|
||||
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone("Asia/Shanghai");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
// 过滤请求
|
||||
.authorizeRequests()
|
||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||
.antMatchers("/login", "/register", "/captchaImage").permitAll()
|
||||
.antMatchers("/login", "/register", "/captchaImage","/uploadPath/**").permitAll()
|
||||
// 静态资源,可匿名访问
|
||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
|
||||
@@ -22,7 +22,11 @@
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>pay</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.ruoyi.bestsign.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ArbitrSignatuVO {
|
||||
/**
|
||||
* 用户帐号
|
||||
* 任务id
|
||||
* 文件MD5
|
||||
* 文件内容
|
||||
* 文件总页数
|
||||
* 文件名称
|
||||
* 文件类型
|
||||
* 合同标题
|
||||
* 有效期
|
||||
* 合同编号
|
||||
* 签署者账号
|
||||
* 签名位置页码
|
||||
* x坐标
|
||||
* y坐标
|
||||
*/
|
||||
private String account;
|
||||
private String taskId;
|
||||
|
||||
private String fileMd5;
|
||||
private String fileData;
|
||||
private String filePages;
|
||||
private String fileName;
|
||||
private String fileType;
|
||||
private String contractTitle;
|
||||
private String periodValidity;
|
||||
|
||||
private String contractNum;
|
||||
private String signerAccout;
|
||||
private String pageNumSigner;
|
||||
private String pageNumSignerX;
|
||||
private String pageNumSignerY;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.bestsign.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class CredentialVO {
|
||||
/**
|
||||
* 用户证件号
|
||||
*/
|
||||
private String identity;
|
||||
/**
|
||||
* 用户证件类型
|
||||
* 默认用“0”, "0"表示身份证,会校验18位身份证号格式。0-居民身份证; 1-护照;6-社会保障卡; B-港澳居民往来内地通行证; C-台湾居民来往大陆通行证; E-户口簿; F-临时居民身份证;P-外国人永久居留证;Z-其他证件
|
||||
*/
|
||||
private String identityType;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.bestsign.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class PersonRegisterVO {
|
||||
/**
|
||||
* 用户帐号
|
||||
* 用户名称
|
||||
* 用户类型
|
||||
* 用户邮箱
|
||||
* 用户手机号
|
||||
* 用户证件信息对象
|
||||
* 是否申请证书
|
||||
*/
|
||||
private String account;
|
||||
private String name;
|
||||
private String userType;
|
||||
private String mail;
|
||||
private String mobile;
|
||||
private CredentialVO credential;
|
||||
private String applyCert;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ruoyi.bestsign.service;
|
||||
|
||||
import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
public interface ArbitrSignatuService {
|
||||
|
||||
|
||||
AjaxResult selectApplyStatus(ArbitrSignatuVO arbitrSignatuVO);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.bestsign.service;
|
||||
|
||||
import com.ruoyi.bestsign.domain.PersonRegisterVO;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
public interface SignRegisterService {
|
||||
/**
|
||||
* 注册上上签个人用户
|
||||
*
|
||||
* @param personRegisterVO
|
||||
* @return
|
||||
*/
|
||||
AjaxResult registerPerson(PersonRegisterVO personRegisterVO);
|
||||
/**
|
||||
* 查询用户认证状态/user/async/applyCert/status/
|
||||
*/
|
||||
AjaxResult queryRegisterStatus(PersonRegisterVO personRegisterVO);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.bestsign.service.impl;
|
||||
|
||||
import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
|
||||
import com.ruoyi.bestsign.service.ArbitrSignatuService;
|
||||
import com.ruoyi.bestsign.utils.BestsignOpenApiClient;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ArbitrSignatuServiceImpl implements ArbitrSignatuService {
|
||||
@Autowired
|
||||
BestsignOpenApiClient bestsignOpenApiClient;
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult selectApplyStatus(ArbitrSignatuVO arbitrSignatuVO) {
|
||||
String strRespon = "";
|
||||
try {
|
||||
strRespon = bestsignOpenApiClient.selectApplyStatus(arbitrSignatuVO.getAccount(),
|
||||
arbitrSignatuVO.getTaskId());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
return AjaxResult.success(strRespon);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.bestsign.service.impl;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.bestsign.domain.PersonRegisterVO;
|
||||
import com.ruoyi.bestsign.service.SignRegisterService;
|
||||
import com.ruoyi.bestsign.utils.BestsignOpenApiClient;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class RegisterServiceImpl implements SignRegisterService {
|
||||
@Autowired
|
||||
BestsignOpenApiClient bestsignOpenApiClient;
|
||||
|
||||
/**
|
||||
* 注册上上签个人用户
|
||||
*
|
||||
* @param personRegisterVO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult registerPerson(PersonRegisterVO personRegisterVO) {
|
||||
try {
|
||||
JSONObject jsonObject = bestsignOpenApiClient.userPersonalReg(personRegisterVO.getAccount(),
|
||||
personRegisterVO.getName(),
|
||||
personRegisterVO.getMail(),
|
||||
personRegisterVO.getMobile(),
|
||||
personRegisterVO.getCredential().getIdentity(),
|
||||
personRegisterVO.getCredential().getIdentityType(),
|
||||
null, null, null, null, null, "/user/reg/");
|
||||
AjaxResult.success(jsonObject);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户认证状态/user/async/applyCert/status/
|
||||
*
|
||||
* @param personRegisterVO
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult queryRegisterStatus(PersonRegisterVO personRegisterVO) {
|
||||
try {
|
||||
JSONObject jsonObject = bestsignOpenApiClient.userPersonalReg(personRegisterVO.getAccount(),
|
||||
personRegisterVO.getName(),
|
||||
personRegisterVO.getMail(),
|
||||
personRegisterVO.getMobile(),
|
||||
personRegisterVO.getCredential().getIdentity(),
|
||||
personRegisterVO.getCredential().getIdentityType(),
|
||||
null, null, null, null, null, "/user/async/applyCert/status/");
|
||||
AjaxResult.success(jsonObject);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
package com.ruoyi.bestsign.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 上上签混合云SDK客户端
|
||||
*/
|
||||
@Component
|
||||
@Data
|
||||
@Slf4j
|
||||
public class BestsignOpenApiClient {
|
||||
/**
|
||||
* 开发者id
|
||||
*/
|
||||
@Value("${ssq.developerId}")
|
||||
private String developerId;
|
||||
/**
|
||||
* 开发者私钥
|
||||
*/
|
||||
@Value("${ssq.privateKey}")
|
||||
private String privateKey;
|
||||
/**
|
||||
* Host地址
|
||||
*/
|
||||
@Value("${ssq.serverHost}")
|
||||
private String serverHost;
|
||||
/**
|
||||
* 签名参数
|
||||
*/
|
||||
private static String urlSignParams = "?developerId=%s&rtick=%s&signType=rsa&sign=%s";
|
||||
|
||||
// public BestsignOpenApiClient(String developerId, String privateKey,
|
||||
// String serverHost) {
|
||||
// this.developerId = developerIds;
|
||||
// this.privateKey = privateKey;
|
||||
// this.serverHost = serverHost;
|
||||
// }
|
||||
|
||||
/**
|
||||
* POST方法示例
|
||||
* 个人用户注册
|
||||
*
|
||||
* @param account 用户账号
|
||||
* @param name 姓名
|
||||
* @param mail 用来接收通知邮件的电子邮箱
|
||||
* @param mobile 用来接收通知短信的手机号码
|
||||
* @param identity 证件号码
|
||||
* @param identityType 枚举值:0-身份证,目前仅支持身份证
|
||||
* @param contactMail 电子邮箱
|
||||
* @param contactMobile 手机号码
|
||||
* @param province 省份
|
||||
* @param city 城市
|
||||
* @param address 地址
|
||||
* @param method 地址
|
||||
* @return 异步申请任务单号
|
||||
* @throws IOException
|
||||
*/
|
||||
public JSONObject userPersonalReg(String account, String name, String mail,
|
||||
String mobile, String identity, String identityType,
|
||||
String contactMail, String contactMobile, String province,
|
||||
String city, String address, @NotNull String method) throws Exception {
|
||||
//body参数
|
||||
JSONObject requestBody = new JSONObject();
|
||||
|
||||
//用户帐号
|
||||
requestBody.put("account", account);
|
||||
//用户名称
|
||||
requestBody.put("name", name);
|
||||
//用户类型
|
||||
requestBody.put("userType", "1");
|
||||
//用户邮箱
|
||||
requestBody.put("mail", mail);
|
||||
//用户手机号
|
||||
requestBody.put("mobile", mobile);
|
||||
//用户证件信息对象
|
||||
JSONObject credential = new JSONObject();
|
||||
//用户证件号
|
||||
credential.put("identity", identity);
|
||||
//用户证件类型
|
||||
credential.put("identityType", identityType);
|
||||
requestBody.put("credential", credential);
|
||||
|
||||
//是否申请证书
|
||||
requestBody.put("applyCert", "1");
|
||||
// 生成一个时间戳参数
|
||||
String rtick = RSAUtils.getRtick();
|
||||
// 计算参数签名
|
||||
String paramsSign = RSAUtils.calcRsaSign(this.developerId,
|
||||
this.privateKey, this.serverHost, method, rtick, null,
|
||||
requestBody.toJSONString());
|
||||
// 签名参数追加为url参数
|
||||
String fullUrlParams = String.format(urlSignParams, this.developerId,
|
||||
rtick, paramsSign);
|
||||
|
||||
// 发送POST请求
|
||||
String responseBody = HttpClientSender.sendHttpPost(this.serverHost, method,
|
||||
fullUrlParams, requestBody.toJSONString());
|
||||
System.out.println(responseBody);
|
||||
// 返回结果解析
|
||||
JSONObject userObj = JSON.parseObject(responseBody);
|
||||
System.out.println(JSON.toJSONString(userObj));
|
||||
return userObj;
|
||||
// 返回errno为0,表示成功,其他表示失败
|
||||
// if (userObj.getIntValue("errno") == 0) {
|
||||
// JSONObject data = userObj.getJSONObject("data");
|
||||
// if (data != null) {
|
||||
// //对返回data进行处理
|
||||
// String taskId = data.getString("taskId");
|
||||
// return taskId;
|
||||
// }
|
||||
// return null;
|
||||
// } else {
|
||||
// //接口返回异常
|
||||
// System.out.println(userObj.getIntValue("errno"));
|
||||
// System.out.println(userObj.getString("errmsg"));
|
||||
// throw new Exception(userObj.getIntValue("errno") + ":"
|
||||
// + userObj.getString("errmsg"));
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GET方法示例
|
||||
* 下载合同PDF文件
|
||||
*
|
||||
* @param contractId 合同编号
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public byte[] contractDownload(String contractId) throws Exception {
|
||||
String host = this.serverHost;
|
||||
String method = "/storage/contract/download/";
|
||||
|
||||
// 组装url参数
|
||||
String urlParams = "contractId=" + contractId;
|
||||
|
||||
// 生成一个时间戳参数
|
||||
String rtick = RSAUtils.getRtick();
|
||||
// 计算参数签名
|
||||
String paramsSign = RSAUtils.calcRsaSign(this.developerId,
|
||||
this.privateKey, host, method, rtick, urlParams, null);
|
||||
// 签名参数追加为url参数
|
||||
urlParams = String.format(urlSignParams, this.developerId, rtick,
|
||||
paramsSign) + "&" + urlParams;
|
||||
// 发送请求
|
||||
byte[] responseBody = HttpClientSender.sendHttpGet(host, method,
|
||||
urlParams);
|
||||
// 返回结果解析
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
public String selectApplyStatus(String account, String taskId) throws Exception {
|
||||
String methodInvoke = "/user/async/applyCert/status/";
|
||||
JSONObject requestParam = new JSONObject();
|
||||
|
||||
//用户账号
|
||||
requestParam.put("account", account);
|
||||
//任务单号
|
||||
requestParam.put("taskId", taskId);
|
||||
String timestamsParam = RSAUtils.getRtick();
|
||||
// 计算参数签名
|
||||
String paramsSign = RSAUtils.calcRsaSign(this.developerId,
|
||||
this.privateKey, this.serverHost, methodInvoke, timestamsParam, null,
|
||||
requestParam.toJSONString());
|
||||
// 签名参数追加为url参数
|
||||
String fullUrlParams = String.format(urlSignParams, this.developerId,
|
||||
timestamsParam, paramsSign);
|
||||
String responseResult = HttpClientSender.sendHttpPost(this.serverHost, methodInvoke,
|
||||
fullUrlParams, requestParam.toJSONString());
|
||||
JSONObject responseObj = JSON.parseObject(responseResult);
|
||||
// 返回errno为0,表示成功,其他表示失败
|
||||
if (responseObj.getIntValue("errno") == 0) {
|
||||
JSONObject data = responseObj.getJSONObject("data");
|
||||
if (data != null) {
|
||||
String message = data.getString("message");
|
||||
String status = data.getString("status");
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
|
||||
log.error("查询申请状态异常:" + responseObj.toJSONString());
|
||||
}
|
||||
return responseObj.toJSONString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取签署链接
|
||||
*
|
||||
* @param arbitrSignatuVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String getSignLink(ArbitrSignatuVO arbitrSignatuVO) throws Exception {
|
||||
String methodInvoke = "/contract/send/";
|
||||
JSONObject requestParam = new JSONObject();
|
||||
|
||||
requestParam.put("contractId", arbitrSignatuVO.getContractNum());
|
||||
requestParam.put("signer", arbitrSignatuVO.getSignerAccout());
|
||||
|
||||
JSONArray signatureArray = new JSONArray();
|
||||
|
||||
JSONObject signatuItem = new JSONObject();
|
||||
signatuItem.put("pageNum", arbitrSignatuVO.getPageNumSigner());
|
||||
//x坐标
|
||||
signatuItem.put("x", arbitrSignatuVO.getPageNumSignerX());
|
||||
//y坐标
|
||||
signatuItem.put("y", arbitrSignatuVO.getPageNumSignerY());
|
||||
signatureArray.add(signatuItem);
|
||||
|
||||
requestParam.put("signaturePositions", signatureArray);
|
||||
|
||||
|
||||
String timestamsParam = RSAUtils.getRtick();
|
||||
// 计算参数签名
|
||||
String paramsSign = RSAUtils.calcRsaSign(this.developerId,
|
||||
this.privateKey, this.serverHost, methodInvoke, timestamsParam, null,
|
||||
requestParam.toJSONString());
|
||||
// 签名参数追加为url参数
|
||||
String fullUrlParams = String.format(urlSignParams, this.developerId,
|
||||
timestamsParam, paramsSign);
|
||||
String responseResult = HttpClientSender.sendHttpPost(this.serverHost, methodInvoke,
|
||||
fullUrlParams, requestParam.toJSONString());
|
||||
JSONObject responseObj = JSON.parseObject(responseResult);
|
||||
// 返回errno为0,表示成功,其他表示失败
|
||||
if (responseObj.getIntValue("errno") == 0) {
|
||||
JSONObject data = responseObj.getJSONObject("data");
|
||||
if (data != null) {
|
||||
String signLink = data.getString("url");
|
||||
return signLink;
|
||||
}
|
||||
} else {
|
||||
|
||||
log.error("获取签署链接异常:" + responseObj.toJSONString());
|
||||
}
|
||||
return responseObj.toJSONString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成签署
|
||||
*
|
||||
* @param arbitrSignatuVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String finishSign(ArbitrSignatuVO arbitrSignatuVO) throws Exception {
|
||||
String methodInvoke = "/storage/contract/lock/";
|
||||
JSONObject requestParam = new JSONObject();
|
||||
requestParam.put("contractId", arbitrSignatuVO.getContractNum());
|
||||
String timestamsParam = RSAUtils.getRtick();
|
||||
// 计算参数签名
|
||||
String paramsSign = RSAUtils.calcRsaSign(this.developerId,
|
||||
this.privateKey, this.serverHost, methodInvoke, timestamsParam, null,
|
||||
requestParam.toJSONString());
|
||||
// 签名参数追加为url参数
|
||||
String fullUrlParams = String.format(urlSignParams, this.developerId,
|
||||
timestamsParam, paramsSign);
|
||||
String responseResult = HttpClientSender.sendHttpPost(this.serverHost, methodInvoke,
|
||||
fullUrlParams, requestParam.toJSONString());
|
||||
JSONObject responseObj = JSON.parseObject(responseResult);
|
||||
// 返回errno为0,表示成功,其他表示失败
|
||||
if (responseObj.getIntValue("errno") == 0) {
|
||||
return "完成签名";
|
||||
} else {
|
||||
|
||||
log.error("完成签署异常:" + responseObj.toJSONString());
|
||||
}
|
||||
return responseObj.toJSONString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,390 @@
|
||||
package com.ruoyi.bestsign.utils;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
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.config.Registry;
|
||||
import org.apache.http.config.RegistryBuilder;
|
||||
import org.apache.http.conn.socket.ConnectionSocketFactory;
|
||||
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
|
||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class HttpClientSender {
|
||||
|
||||
private static PoolingHttpClientConnectionManager poolingHttpClientConnectionManager = null;
|
||||
private static Map<String, CloseableHttpClient> httpClients = new HashMap<String, CloseableHttpClient>();
|
||||
|
||||
private static Object o = new Object();
|
||||
|
||||
public static String sendHttpPost(String host, String method, String urlParams, String sendData) throws IOException {
|
||||
|
||||
String requestUrl = host + method + urlParams;
|
||||
|
||||
Map<String, Object> response = request("POST", requestUrl, sendData, null);
|
||||
int responseCode = Integer.parseInt(response.get("responseCode").toString());
|
||||
byte[] responseBytes = (byte[]) response.get("responseData");
|
||||
String responseString;
|
||||
try {
|
||||
responseString = new String(responseBytes, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
responseString = new String(responseBytes);
|
||||
}
|
||||
//请求返回结果无论成功失败,http-status均为200
|
||||
if (responseCode == 200) {
|
||||
//返回结果
|
||||
return responseString;
|
||||
} else {
|
||||
throw new IOException(responseCode + ":" + responseString);
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] sendHttpGet(String host, String method, String urlParams) throws IOException {
|
||||
String requestUrl = host + method + urlParams;
|
||||
Map<String, Object> response = request("GET", requestUrl, null, null);
|
||||
int responseCode = Integer.parseInt(response.get("responseCode").toString());
|
||||
byte[] responseBytes = (byte[]) response.get("responseData");
|
||||
//请求返回结果无论成功失败,http-status均为200
|
||||
if (responseCode == 200) {
|
||||
//返回结果
|
||||
return responseBytes;
|
||||
} else {
|
||||
throw new IOException(responseCode + "");
|
||||
}
|
||||
}
|
||||
|
||||
public static String urlencode(String data) {
|
||||
return urlencode(data, "UTF-8");
|
||||
}
|
||||
|
||||
public static String urlencode(String data, String charset) {
|
||||
try {
|
||||
return URLEncoder.encode(data, charset);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<String, Object> request(String method, String url, Object sendData, Map<String, String> headers) throws IOException {
|
||||
|
||||
|
||||
String requestPath;
|
||||
try {
|
||||
requestPath = new URL(url).getPath();
|
||||
} catch (MalformedURLException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
CloseableHttpClient httpClient = getHttpClient(requestPath);
|
||||
|
||||
Map<String, Object> response = null;
|
||||
if ("POST".equals(method)) {
|
||||
response = sendPost(httpClient, url, headers, sendData);
|
||||
} else {
|
||||
response = sendGet(httpClient, url, headers);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
private static Map<String, Object> sendPost(CloseableHttpClient httpClient, String url, Map<String, String> headers, Object sendData) throws IOException {
|
||||
String tag = "[HttpRequester] [POST " + url + "]";
|
||||
int responseCode = -1;
|
||||
byte[] responseBytes = null;
|
||||
|
||||
HttpPost request = new HttpPost(url);
|
||||
if (headers != null && headers.size() > 0) {
|
||||
for (String name : headers.keySet()) {
|
||||
String value = headers.get(name);
|
||||
request.setHeader(name, value);
|
||||
}
|
||||
}
|
||||
if (sendData != null) {
|
||||
StringEntity stringEntity = new StringEntity((String) sendData, "UTF-8");
|
||||
stringEntity.setContentType("application/json");
|
||||
request.setEntity(stringEntity);
|
||||
|
||||
HttpEntity httpEntity = null;
|
||||
IOException exception = null;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(request);
|
||||
responseCode = response.getStatusLine().getStatusCode();
|
||||
httpEntity = response.getEntity();
|
||||
|
||||
String responseBody = EntityUtils.toString(httpEntity, "utf-8");
|
||||
if (responseBody != null) {
|
||||
responseBytes = responseBody.getBytes();
|
||||
} else {
|
||||
InputStream respStream = null;
|
||||
try {
|
||||
respStream = httpEntity.getContent();
|
||||
int respBodySize = respStream.available();
|
||||
if (respBodySize <= 0)
|
||||
throw new IOException("Invalid respBodySize: " + respBodySize);
|
||||
responseBytes = new byte[respBodySize];
|
||||
if (respStream.read(responseBytes) != respBodySize)
|
||||
throw new IOException("Read respBody Error");
|
||||
} catch (Exception e) {
|
||||
} finally {
|
||||
if (respStream != null) {
|
||||
respStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exception = null;
|
||||
break;
|
||||
} catch (UnsupportedOperationException e) {
|
||||
try {
|
||||
EntityUtils.consume(httpEntity);
|
||||
} catch (IOException e2) {
|
||||
|
||||
}
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
exception = e;
|
||||
try {
|
||||
EntityUtils.consume(httpEntity);
|
||||
} catch (IOException e2) {
|
||||
|
||||
}
|
||||
if (i < 2) {
|
||||
try {
|
||||
Thread.sleep(5);
|
||||
} catch (InterruptedException e2) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (exception != null) {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
}
|
||||
Map<String, Object> response = new HashMap<String, Object>();
|
||||
response.put("responseCode", responseCode);
|
||||
response.put("responseData", responseBytes);
|
||||
String loggerResponseString = getLoggerString(responseBytes, 256);
|
||||
return response;
|
||||
}
|
||||
|
||||
private static Map<String, Object> sendGet(CloseableHttpClient httpClient, String url, Map<String, String> headers) throws IOException {
|
||||
String tag = "[HttpRequester] [GET " + url + "]";
|
||||
int responseCode = -1;
|
||||
byte[] responseBytes = null;
|
||||
|
||||
HttpGet request = new HttpGet(url);
|
||||
if (headers != null && headers.size() > 0) {
|
||||
for (String name : headers.keySet()) {
|
||||
String value = headers.get(name);
|
||||
request.setHeader(name, value);
|
||||
}
|
||||
}
|
||||
HttpEntity httpEntity = null;
|
||||
IOException exception = null;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(request);
|
||||
responseCode = response.getStatusLine().getStatusCode();
|
||||
httpEntity = response.getEntity();
|
||||
|
||||
byte[] responseBody = EntityUtils.toByteArray(httpEntity);
|
||||
if (responseBody != null) {
|
||||
responseBytes = responseBody;
|
||||
} else {
|
||||
InputStream respStream = null;
|
||||
try {
|
||||
respStream = httpEntity.getContent();
|
||||
int respBodySize = respStream.available();
|
||||
if (respBodySize <= 0)
|
||||
throw new IOException("Invalid respBodySize: " + respBodySize);
|
||||
responseBytes = new byte[respBodySize];
|
||||
if (respStream.read(responseBytes) != respBodySize)
|
||||
throw new IOException("Read respBody Error");
|
||||
} catch (Exception e) {
|
||||
} finally {
|
||||
if (respStream != null) {
|
||||
respStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exception = null;
|
||||
break;
|
||||
} catch (UnsupportedOperationException e) {
|
||||
try {
|
||||
EntityUtils.consume(httpEntity);
|
||||
} catch (IOException e2) {
|
||||
|
||||
}
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
exception = e;
|
||||
try {
|
||||
EntityUtils.consume(httpEntity);
|
||||
} catch (IOException e2) {
|
||||
|
||||
}
|
||||
if (i < 2) {
|
||||
try {
|
||||
Thread.sleep(5);
|
||||
} catch (InterruptedException e2) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (exception != null) {
|
||||
throw exception;
|
||||
}
|
||||
Map<String, Object> response = new HashMap<String, Object>();
|
||||
response.put("responseCode", responseCode);
|
||||
response.put("responseData", responseBytes);
|
||||
String loggerResponseString = getLoggerString(responseBytes, 256);
|
||||
System.out.println(tag + " response " + responseCode + " " + loggerResponseString);
|
||||
return response;
|
||||
}
|
||||
|
||||
private static String getLoggerString(final byte[] data, int maxLength) {
|
||||
String loggerString;
|
||||
if (data.length > maxLength) {
|
||||
byte[] shortData = new byte[maxLength];
|
||||
System.arraycopy(data, 0, shortData, 0, shortData.length);
|
||||
try {
|
||||
loggerString = new String(shortData, "UTF-8") + "...";
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
loggerString = new String(shortData) + "...";
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
loggerString = new String(data, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
loggerString = new String(data);
|
||||
}
|
||||
}
|
||||
|
||||
char[] chars = new char[loggerString.length()];
|
||||
loggerString.getChars(0, loggerString.length(), chars, 0);
|
||||
for (int i = 0; i < chars.length; i++) {
|
||||
char c = chars[i];
|
||||
if (c == '\n' || c == '\r') {
|
||||
chars[i] = ' ';
|
||||
}
|
||||
}
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
private static CloseableHttpClient getHttpClient(String requestPath) {
|
||||
if (httpClients.containsKey(requestPath)) {
|
||||
return httpClients.get(requestPath);
|
||||
}
|
||||
if (poolingHttpClientConnectionManager == null) {
|
||||
synchronized (o) {
|
||||
if (poolingHttpClientConnectionManager == null) {
|
||||
poolingHttpClientConnectionManager = HttpClientUtils.createHttpClientConnectionManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
synchronized (httpClients) {
|
||||
if (httpClients.containsKey(requestPath)) {
|
||||
return httpClients.get(requestPath);
|
||||
}
|
||||
CloseableHttpClient httpClient = HttpClientUtils.createHttpClient(poolingHttpClientConnectionManager);
|
||||
httpClients.put(requestPath, httpClient);
|
||||
return httpClient;
|
||||
}
|
||||
}
|
||||
|
||||
private static class HttpClientUtils {
|
||||
|
||||
// 默认连接超时
|
||||
private static int defaultConnectTimeout = 6000;
|
||||
// 默认读取超时
|
||||
private static int defaultReadTimeout = 30000;
|
||||
|
||||
public static CloseableHttpClient createHttpClient(PoolingHttpClientConnectionManager connManager) {
|
||||
//HttpHost httpHost = new HttpHost("10.211.55.4", 8888);
|
||||
CloseableHttpClient httpClient = HttpClients.custom()
|
||||
//.setProxy(httpHost)
|
||||
.setConnectionManager(connManager)
|
||||
.disableContentCompression()
|
||||
.setSSLContext(getSslcontext())
|
||||
.setDefaultRequestConfig(getRequestConfig())
|
||||
.build();
|
||||
return httpClient;
|
||||
}
|
||||
|
||||
public static PoolingHttpClientConnectionManager createHttpClientConnectionManager() {
|
||||
SSLConnectionSocketFactory sslConnectionSocketFactory = null;
|
||||
try {
|
||||
sslConnectionSocketFactory = new SSLConnectionSocketFactory(getSslcontext(), SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
|
||||
.register("https", sslConnectionSocketFactory)
|
||||
.register("http", new PlainConnectionSocketFactory())
|
||||
.build();
|
||||
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
|
||||
cm.setMaxTotal(500);
|
||||
cm.setDefaultMaxPerRoute(500);
|
||||
return cm;
|
||||
}
|
||||
|
||||
private static RequestConfig getRequestConfig() {
|
||||
RequestConfig defaultRequestConfig = RequestConfig.custom()
|
||||
.setConnectionRequestTimeout(defaultConnectTimeout)
|
||||
.setSocketTimeout(defaultReadTimeout)
|
||||
.build();
|
||||
return defaultRequestConfig;
|
||||
}
|
||||
|
||||
private static SSLContext getSslcontext() {
|
||||
SSLContext sslContext = null;
|
||||
try {
|
||||
sslContext = SSLContext.getInstance("TLS");
|
||||
TrustManager tm = new X509TrustManager() {
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
sslContext.init(null, new TrustManager[]{tm}, null);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sslContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
package com.ruoyi.bestsign.utils;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.*;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* 参数签名算法工具类
|
||||
*/
|
||||
public class RSAUtils {
|
||||
|
||||
/**
|
||||
* 获取当前的时间戳参数
|
||||
* @return
|
||||
*/
|
||||
public static String getRtick(){
|
||||
long timestamp = System.currentTimeMillis();
|
||||
int rnd = (int)Math.random() * 1000;
|
||||
String rtick = timestamp + "" + rnd;
|
||||
return rtick;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算参数签名
|
||||
* @param developerId 开发者ID
|
||||
* @param privateKey 用户私钥
|
||||
* @param host 请求的HOST地址(http://ip:port/context)
|
||||
* @param methodName 请求的接口方法名
|
||||
* @param rtick 时间戳参数
|
||||
* @param urlParams url参数(param1=value1¶m2=value2¶m3=value3)
|
||||
* @param requestBody request body 参数(JSON字符串)
|
||||
* @return
|
||||
*/
|
||||
public static String calcRsaSign(String developerId, String privateKey, String host, String methodName, String rtick, String urlParams, String requestBody) {
|
||||
String url = host+methodName;
|
||||
|
||||
Map<String, String> mySignedURLParams = new TreeMap<String, String>();
|
||||
mySignedURLParams.put("developerId", developerId);
|
||||
mySignedURLParams.put("rtick", rtick);
|
||||
mySignedURLParams.put("signType", "rsa");
|
||||
|
||||
if(urlParams != null && !"".equals(urlParams)){
|
||||
String[] params = urlParams.split("&");
|
||||
for(String p1 : params){
|
||||
String[] p2 = p1.split("=");
|
||||
String key = p2[0];
|
||||
String value = "";
|
||||
if(p2.length == 2){
|
||||
value = p2[1];
|
||||
}
|
||||
mySignedURLParams.put(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
String requestPath;
|
||||
try {
|
||||
requestPath = new URL(url).getPath();
|
||||
}
|
||||
catch (MalformedURLException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
StringBuilder signStringBuilder = new StringBuilder();
|
||||
for (String name : mySignedURLParams.keySet()) {
|
||||
String value = mySignedURLParams.get(name);
|
||||
signStringBuilder.append(name);
|
||||
signStringBuilder.append("=");
|
||||
signStringBuilder.append(value);
|
||||
}
|
||||
signStringBuilder.append(requestPath);
|
||||
|
||||
if (requestBody != null && !"".equals(requestBody) ) {
|
||||
String requestMd5 = getRequestMd5(requestBody);
|
||||
signStringBuilder.append(requestMd5);
|
||||
}
|
||||
|
||||
String signString = signStringBuilder.toString();
|
||||
String rsaSign = calcRsaSign(privateKey, signString);
|
||||
//rsa算出来的sign,需要urlencode
|
||||
try {
|
||||
rsaSign = URLEncoder.encode(rsaSign,"UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
rsaSign = null;
|
||||
}
|
||||
return rsaSign;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取request body 的MD5
|
||||
* @param requestBody
|
||||
* @return
|
||||
*/
|
||||
private static String getRequestMd5(final String requestBody) {
|
||||
byte[] data;
|
||||
|
||||
String newRequestBody = convertToUtf8(requestBody);
|
||||
try {
|
||||
data = newRequestBody.getBytes("UTF-8");
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
return md5(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算参数RSA签名
|
||||
* @param privateKey
|
||||
* @param signData
|
||||
* @return
|
||||
*/
|
||||
private static String calcRsaSign(String privateKey, final String signData) {
|
||||
byte[] data;
|
||||
try {
|
||||
data = signData.getBytes("UTF-8");
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
byte[] sign = null;
|
||||
// 解密由base64编码的私钥
|
||||
byte[] privateKeyBytes = base64decode(privateKey.getBytes());
|
||||
|
||||
// 构造PKCS8EncodedKeySpec对象
|
||||
PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(privateKeyBytes);
|
||||
|
||||
// KEY_ALGORITHM 指定的加密算法
|
||||
KeyFactory keyFactory;
|
||||
try {
|
||||
keyFactory = KeyFactory.getInstance("RSA");
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
// 取私钥匙对象
|
||||
PrivateKey priKey;
|
||||
try {
|
||||
priKey = keyFactory.generatePrivate(pkcs8KeySpec);
|
||||
}
|
||||
catch (InvalidKeySpecException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
// 用私钥对信息生成数字签名
|
||||
Signature signature;
|
||||
try {
|
||||
signature = Signature.getInstance("SHA1withRSA");
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
try {
|
||||
signature.initSign(priKey);
|
||||
}
|
||||
catch (InvalidKeyException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
try {
|
||||
signature.update(data);
|
||||
sign = signature.sign();
|
||||
}
|
||||
catch (SignatureException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
return new String(base64encode(sign));
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换字符集到utf8
|
||||
*
|
||||
* @param src
|
||||
* @return
|
||||
*/
|
||||
private static String convertToUtf8(String src) {
|
||||
if (src == null || src.length() == 0) {
|
||||
return src;
|
||||
}
|
||||
if ("UTF-8".equalsIgnoreCase(Charset.defaultCharset().name())) {
|
||||
return src;
|
||||
}
|
||||
|
||||
byte[] srcData = src.getBytes();
|
||||
try {
|
||||
return new String(srcData, "UTF-8");
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* md5
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static String md5(byte[] data) {
|
||||
char hexDigits[]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
|
||||
byte[] btInput = data;
|
||||
// 获得MD5摘要算法的 MessageDigest 对象
|
||||
MessageDigest mdInst;
|
||||
try {
|
||||
mdInst = MessageDigest.getInstance("MD5");
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
// 使用指定的字节更新摘要
|
||||
mdInst.update(btInput);
|
||||
// 获得密文
|
||||
byte[] md = mdInst.digest();
|
||||
// 把密文转换成十六进制的字符串形式
|
||||
int j = md.length;
|
||||
char str[] = new char[j * 2];
|
||||
int k = 0;
|
||||
for (int i = 0; i < j; i++) {
|
||||
byte byte0 = md[i];
|
||||
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
|
||||
str[k++] = hexDigits[byte0 & 0xf];
|
||||
}
|
||||
return new String(str);
|
||||
}
|
||||
|
||||
/**
|
||||
* base64编码
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static byte[] base64encode(byte[] data) {
|
||||
return Base64.encodeBase64(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* base64编码字符串
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static String base64encodeString(byte[] data) {
|
||||
return Base64.encodeBase64String(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static byte[] base64decode(byte[] data) {
|
||||
try {
|
||||
return Base64.decodeBase64(data);
|
||||
} catch (Exception e) {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
byte c = data[i];
|
||||
if (c == 13 || c == 10) {
|
||||
continue;
|
||||
}
|
||||
outputStream.write(c);
|
||||
}
|
||||
try {
|
||||
outputStream.close();
|
||||
} catch (IOException e2) {
|
||||
|
||||
}
|
||||
data = outputStream.toByteArray();
|
||||
return Base64.decodeBase64(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Adjudication {
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
private String appName;
|
||||
/**
|
||||
* 申请人性别
|
||||
*/
|
||||
private String appSex;
|
||||
/**
|
||||
* 申请人身份证号码
|
||||
*/
|
||||
private String appIDNo;
|
||||
/**
|
||||
* 申请人住所
|
||||
*/
|
||||
private String appAddress;
|
||||
|
||||
/**
|
||||
* 申请人代理人姓名
|
||||
*/
|
||||
private String appAgentName;
|
||||
/**
|
||||
* 申请人代理人身份证
|
||||
*/
|
||||
private String appAgentIDNo;
|
||||
/**
|
||||
* 被申请人姓名
|
||||
*/
|
||||
private String resName;
|
||||
/**
|
||||
* 被申请人性别
|
||||
*/
|
||||
private String resSex;
|
||||
/**
|
||||
* 被申请人身份证号码
|
||||
*/
|
||||
private String resIDNo;
|
||||
/**
|
||||
* 被申请人住所
|
||||
*/
|
||||
private String resAddress;
|
||||
|
||||
/**
|
||||
* 被申请人代理人姓名
|
||||
*/
|
||||
private String resAgentName;
|
||||
/**
|
||||
* 被申请人代理人身份证
|
||||
*/
|
||||
private String resAgentIDNo;
|
||||
|
||||
/**
|
||||
* 案件名称
|
||||
*/
|
||||
private String caseName;
|
||||
|
||||
/**
|
||||
* 仲裁员名称
|
||||
*/
|
||||
private String arbitratorName;
|
||||
/**
|
||||
* 开庭年
|
||||
*/
|
||||
private String hearYear;
|
||||
/**
|
||||
* 开庭月
|
||||
*/
|
||||
private String hearMonths;
|
||||
/**
|
||||
* 开庭日
|
||||
*/
|
||||
private String hearDay;
|
||||
|
||||
/**
|
||||
* 申请人具体仲裁请求
|
||||
*/
|
||||
private String appArbitrationClaims;
|
||||
|
||||
/**
|
||||
* 申请人证据名称
|
||||
*/
|
||||
private String appEvidenceName;
|
||||
|
||||
/**
|
||||
* 申请人拟证事实
|
||||
*/
|
||||
private String appProveFacts;
|
||||
/**
|
||||
* 被申请人对申请人答辩内容
|
||||
*/
|
||||
private String resDefenseContentToApp;
|
||||
|
||||
/**
|
||||
* 被申请人具体仲裁请求
|
||||
*/
|
||||
private String resArbitrationClaims;
|
||||
/**
|
||||
* 被申请人证据名称
|
||||
*/
|
||||
private String resEvidenceName;
|
||||
/**
|
||||
* 被申请人拟证事实
|
||||
*/
|
||||
private String resProveFacts;
|
||||
/**
|
||||
* 申请人对被申请人答辩内容
|
||||
*/
|
||||
private String appDefenseContentToRes;
|
||||
/**
|
||||
* 第三人答辩内容
|
||||
*/
|
||||
private String thirdDefenseContent;
|
||||
/**
|
||||
* 第三人证据名称
|
||||
*/
|
||||
private String thirdEvidenceName;
|
||||
/**
|
||||
* 第三人拟证事实
|
||||
*/
|
||||
private String thirdProveFacts;
|
||||
/**
|
||||
* 申请人对第三人答辩内容
|
||||
*/
|
||||
private String appDefenseContentToThird;
|
||||
/**
|
||||
* 被申请人对第三人答辩内容
|
||||
*/
|
||||
private String resDefenseContentToThird;
|
||||
/**
|
||||
* 证据认定
|
||||
*/
|
||||
private String evidenDetermi;
|
||||
/**
|
||||
* 认定事实
|
||||
*/
|
||||
private String factDetermi;
|
||||
/**
|
||||
* 综上所述
|
||||
*/
|
||||
private String caseSketch;
|
||||
/**
|
||||
* 本庭认为
|
||||
*/
|
||||
private String arbitrateThink;
|
||||
/**
|
||||
* 裁决如下
|
||||
*/
|
||||
private String rulingFollows;
|
||||
/**
|
||||
* 法律条款
|
||||
*/
|
||||
private String legalProvisions;
|
||||
/**
|
||||
* 首席仲裁
|
||||
*/
|
||||
private String umpire;
|
||||
/**
|
||||
* 仲裁员1
|
||||
*/
|
||||
private String arbitratorName1;
|
||||
/**
|
||||
* 仲裁员2
|
||||
*/
|
||||
private String arbitratorName2;
|
||||
/**
|
||||
* 年
|
||||
*/
|
||||
private String year;
|
||||
/**
|
||||
* 月
|
||||
*/
|
||||
private String months;
|
||||
/**
|
||||
* 日
|
||||
*/
|
||||
private String day;
|
||||
/**
|
||||
* 书记员
|
||||
*/
|
||||
private String clerk;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ArbitrateRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** 案件申请id */
|
||||
private Long caseAppliId;
|
||||
/** 证据认定 */
|
||||
private String evidenDetermi;
|
||||
/** 认定事实 */
|
||||
private String factDetermi;
|
||||
/** 综上所述 */
|
||||
private String caseSketch;
|
||||
/** 本庭认为 */
|
||||
private String arbitrateThink;
|
||||
/** 裁决如下 */
|
||||
private String rulingFollows;
|
||||
/** 核验裁决书意见 */
|
||||
private String verificaOpinion;
|
||||
/** 审核裁决书意见 */
|
||||
private String checkOpinion;
|
||||
/** 裁决书附件id */
|
||||
private Integer annexId;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Arbitrator extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** 仲裁员姓名 */
|
||||
private String arbitratorName;
|
||||
/** 职称 */
|
||||
private String title;
|
||||
/** 职业 */
|
||||
private String career;
|
||||
/** 专业分类 */
|
||||
private String professiClassifi;
|
||||
/** 学历 */
|
||||
private String education;
|
||||
/** 所在地区 */
|
||||
private String area;
|
||||
/** 联系电话 */
|
||||
private String telephone;
|
||||
|
||||
List<Long> idList;
|
||||
|
||||
public List<Long> getIdList() {
|
||||
return idList;
|
||||
}
|
||||
|
||||
public void setIdList(List<Long> idList) {
|
||||
this.idList = idList;
|
||||
}
|
||||
|
||||
public String getArbitratorName() {
|
||||
return arbitratorName;
|
||||
}
|
||||
|
||||
public void setArbitratorName(String arbitratorName) {
|
||||
this.arbitratorName = arbitratorName;
|
||||
}
|
||||
|
||||
/** 当前案件数量 */
|
||||
private int currentCaseNum;
|
||||
/** 已结案数量 */
|
||||
private int closedCaseNum;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getCareer() {
|
||||
return career;
|
||||
}
|
||||
|
||||
public void setCareer(String career) {
|
||||
this.career = career;
|
||||
}
|
||||
|
||||
public String getProfessiClassifi() {
|
||||
return professiClassifi;
|
||||
}
|
||||
|
||||
public void setProfessiClassifi(String professiClassifi) {
|
||||
this.professiClassifi = professiClassifi;
|
||||
}
|
||||
|
||||
public String getEducation() {
|
||||
return education;
|
||||
}
|
||||
|
||||
public void setEducation(String education) {
|
||||
this.education = education;
|
||||
}
|
||||
|
||||
public String getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(String area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public String getTelephone() {
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public void setTelephone(String telephone) {
|
||||
this.telephone = telephone;
|
||||
}
|
||||
|
||||
public int getCurrentCaseNum() {
|
||||
return currentCaseNum;
|
||||
}
|
||||
|
||||
public void setCurrentCaseNum(int currentCaseNum) {
|
||||
this.currentCaseNum = currentCaseNum;
|
||||
}
|
||||
|
||||
public int getClosedCaseNum() {
|
||||
return closedCaseNum;
|
||||
}
|
||||
|
||||
public void setClosedCaseNum(int closedCaseNum) {
|
||||
this.closedCaseNum = closedCaseNum;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
public class CaseAffiliate extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** ID */
|
||||
@Excel(name = "ID", cellType = Excel.ColumnType.NUMERIC, prompt = "ID")
|
||||
private Long id;
|
||||
/** 案件申请id */
|
||||
private Long caseAppliId;
|
||||
/** 身份类型 */
|
||||
private int identityType;
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
/** 身份证号 */
|
||||
@Excel(name = "身份证号")
|
||||
private String identityNum;
|
||||
/** 单位电话 */
|
||||
@Excel(name = "单位电话")
|
||||
private String workTelphone;
|
||||
/** 联系电话 */
|
||||
@Excel(name = "联系电话")
|
||||
private String contactTelphone;
|
||||
/** 联系地址 */
|
||||
@Excel(name = "联系地址")
|
||||
private String contactAddress;
|
||||
/** 单位地址 */
|
||||
@Excel(name = "单位地址")
|
||||
private String workAddress;
|
||||
|
||||
/** 代理人姓名 */
|
||||
@Excel(name = "代理人姓名")
|
||||
private String nameAgent;
|
||||
/** 身份证号 */
|
||||
@Excel(name = "代理人身份证号")
|
||||
private String identityNumAgent;
|
||||
/** 联系电话 */
|
||||
@Excel(name = "代理人联系电话")
|
||||
private String contactTelphoneAgent;
|
||||
/** 联系地址 */
|
||||
@Excel(name = "代理人联系地址")
|
||||
private String contactAddressAgent;
|
||||
|
||||
/** 送达电子邮件 */
|
||||
private String sendEmail;
|
||||
/** 快递单号 */
|
||||
private String trackNum;
|
||||
|
||||
public String getSendEmail() {
|
||||
return sendEmail;
|
||||
}
|
||||
|
||||
public void setSendEmail(String sendEmail) {
|
||||
this.sendEmail = sendEmail;
|
||||
}
|
||||
|
||||
public String getTrackNum() {
|
||||
return trackNum;
|
||||
}
|
||||
|
||||
public void setTrackNum(String trackNum) {
|
||||
this.trackNum = trackNum;
|
||||
}
|
||||
|
||||
public String getNameAgent() {
|
||||
return nameAgent;
|
||||
}
|
||||
|
||||
public void setNameAgent(String nameAgent) {
|
||||
this.nameAgent = nameAgent;
|
||||
}
|
||||
|
||||
public String getIdentityNumAgent() {
|
||||
return identityNumAgent;
|
||||
}
|
||||
|
||||
public void setIdentityNumAgent(String identityNumAgent) {
|
||||
this.identityNumAgent = identityNumAgent;
|
||||
}
|
||||
|
||||
public String getContactTelphoneAgent() {
|
||||
return contactTelphoneAgent;
|
||||
}
|
||||
|
||||
public void setContactTelphoneAgent(String contactTelphoneAgent) {
|
||||
this.contactTelphoneAgent = contactTelphoneAgent;
|
||||
}
|
||||
|
||||
public String getContactAddressAgent() {
|
||||
return contactAddressAgent;
|
||||
}
|
||||
|
||||
public void setContactAddressAgent(String contactAddressAgent) {
|
||||
this.contactAddressAgent = contactAddressAgent;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getCaseAppliId() {
|
||||
return caseAppliId;
|
||||
}
|
||||
|
||||
public void setCaseAppliId(Long caseAppliId) {
|
||||
this.caseAppliId = caseAppliId;
|
||||
}
|
||||
|
||||
public int getIdentityType() {
|
||||
return identityType;
|
||||
}
|
||||
|
||||
public void setIdentityType(int identityType) {
|
||||
this.identityType = identityType;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIdentityNum() {
|
||||
return identityNum;
|
||||
}
|
||||
|
||||
public void setIdentityNum(String identityNum) {
|
||||
this.identityNum = identityNum;
|
||||
}
|
||||
|
||||
public String getWorkTelphone() {
|
||||
return workTelphone;
|
||||
}
|
||||
|
||||
public void setWorkTelphone(String workTelphone) {
|
||||
this.workTelphone = workTelphone;
|
||||
}
|
||||
|
||||
public String getContactTelphone() {
|
||||
return contactTelphone;
|
||||
}
|
||||
|
||||
public void setContactTelphone(String contactTelphone) {
|
||||
this.contactTelphone = contactTelphone;
|
||||
}
|
||||
|
||||
public String getContactAddress() {
|
||||
return contactAddress;
|
||||
}
|
||||
|
||||
public void setContactAddress(String contactAddress) {
|
||||
this.contactAddress = contactAddress;
|
||||
}
|
||||
|
||||
public String getWorkAddress() {
|
||||
return workAddress;
|
||||
}
|
||||
|
||||
public void setWorkAddress(String workAddress) {
|
||||
this.workAddress = workAddress;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,710 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class CaseApplication extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** 案件编号 */
|
||||
// @Excel(name = "案件编号")
|
||||
private String caseNum;
|
||||
/** 案件标的 */
|
||||
@Excel(name = "案件标的")
|
||||
private BigDecimal caseSubjectAmount;
|
||||
|
||||
|
||||
/** 立案日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date registerDate;
|
||||
/** 仲裁方式 */
|
||||
private Integer arbitratMethod;
|
||||
|
||||
public Integer getArbitratMethod() {
|
||||
return arbitratMethod;
|
||||
}
|
||||
|
||||
public void setArbitratMethod(Integer arbitratMethod) {
|
||||
this.arbitratMethod = arbitratMethod;
|
||||
}
|
||||
/** 仲裁方式名称 */
|
||||
private String arbitratMethodName;
|
||||
|
||||
public String getArbitratMethodName() {
|
||||
return arbitratMethodName;
|
||||
}
|
||||
|
||||
public void setArbitratMethodName(String arbitratMethodName) {
|
||||
this.arbitratMethodName = arbitratMethodName;
|
||||
}
|
||||
|
||||
/** 案件状态 */
|
||||
private Integer caseStatus;
|
||||
|
||||
public Integer getCaseStatus() {
|
||||
return caseStatus;
|
||||
}
|
||||
|
||||
public void setCaseStatus(Integer caseStatus) {
|
||||
this.caseStatus = caseStatus;
|
||||
}
|
||||
|
||||
/** 开庭日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date hearDate;
|
||||
|
||||
/** 借款开始日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "借款开始日期")
|
||||
private Date loanStartDate;
|
||||
/** 借款结束日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "借款结束日期")
|
||||
private Date loanEndDate;
|
||||
/** 合同编号 */
|
||||
@Excel(name = "合同编号")
|
||||
private String contractNumber;
|
||||
/** 申请人主张欠本金 */
|
||||
@Excel(name = "申请人主张欠本金")
|
||||
private BigDecimal claimPrinciOwed;
|
||||
/** 申请人主张欠利息 */
|
||||
@Excel(name = "申请人主张欠利息")
|
||||
private BigDecimal claimInterestOwed;
|
||||
/** 申请人主张违约金 */
|
||||
@Excel(name = "申请人主张违约金")
|
||||
private BigDecimal claimLiquidDamag;
|
||||
/** 申请人仲裁诉求 */
|
||||
@Excel(name = "申请人仲裁诉求")
|
||||
private String arbitratClaims;
|
||||
/** 仲裁应缴费用 */
|
||||
private BigDecimal feePayable;
|
||||
|
||||
/** 开始在线视频时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date beginVideoDate;
|
||||
/** 在线视频人员 */
|
||||
private String onlineVideoPerson;
|
||||
|
||||
/** 仲裁员id */
|
||||
private String arbitratorId;
|
||||
/** 仲裁员名称 */
|
||||
private String arbitratorName;
|
||||
|
||||
/** 案件名称 */
|
||||
private String caseName;
|
||||
|
||||
/** 案件描述 */
|
||||
private String caseDescribe;
|
||||
|
||||
/** 是否同意组庭 */
|
||||
private Integer isAgreePendTral;
|
||||
|
||||
/** 是否有异议需要举证 */
|
||||
private Integer objectionAddEviden;
|
||||
/** 是否需要开庭审理 */
|
||||
private Integer openCourtHear;
|
||||
|
||||
/** 支付状态 */
|
||||
private Integer paymentStatus;
|
||||
/** 支付状态描述 */
|
||||
private String paymentStatusName;
|
||||
|
||||
public Integer getPaymentStatus() {
|
||||
return paymentStatus;
|
||||
}
|
||||
|
||||
public void setPaymentStatus(Integer paymentStatus) {
|
||||
this.paymentStatus = paymentStatus;
|
||||
}
|
||||
|
||||
public String getPaymentStatusName() {
|
||||
return paymentStatusName;
|
||||
}
|
||||
|
||||
public void setPaymentStatusName(String paymentStatusName) {
|
||||
this.paymentStatusName = paymentStatusName;
|
||||
}
|
||||
|
||||
public Integer getIsAgreePendTral() {
|
||||
return isAgreePendTral;
|
||||
}
|
||||
|
||||
public void setIsAgreePendTral(Integer isAgreePendTral) {
|
||||
this.isAgreePendTral = isAgreePendTral;
|
||||
}
|
||||
|
||||
public Integer getObjectionAddEviden() {
|
||||
return objectionAddEviden;
|
||||
}
|
||||
|
||||
public void setObjectionAddEviden(Integer objectionAddEviden) {
|
||||
this.objectionAddEviden = objectionAddEviden;
|
||||
}
|
||||
|
||||
public Integer getOpenCourtHear() {
|
||||
return openCourtHear;
|
||||
}
|
||||
|
||||
public void setOpenCourtHear(Integer openCourtHear) {
|
||||
this.openCourtHear = openCourtHear;
|
||||
}
|
||||
|
||||
/** 案件状态名称 */
|
||||
private String caseStatusName;
|
||||
/** 是否同意审核 */
|
||||
private Integer agreeOrNotCheck;
|
||||
|
||||
public Integer getAgreeOrNotCheck() {
|
||||
return agreeOrNotCheck;
|
||||
}
|
||||
|
||||
public void setAgreeOrNotCheck(Integer agreeOrNotCheck) {
|
||||
this.agreeOrNotCheck = agreeOrNotCheck;
|
||||
}
|
||||
|
||||
public String getCaseStatusName() {
|
||||
return caseStatusName;
|
||||
}
|
||||
|
||||
public void setCaseStatusName(String caseStatusName) {
|
||||
this.caseStatusName = caseStatusName;
|
||||
}
|
||||
|
||||
/** 申请人名称 */
|
||||
private String applicantName;
|
||||
/** 被申请人名称 */
|
||||
private String respondentName;
|
||||
|
||||
public String getApplicantName() {
|
||||
return applicantName;
|
||||
}
|
||||
|
||||
public void setApplicantName(String applicantName) {
|
||||
this.applicantName = applicantName;
|
||||
}
|
||||
|
||||
public String getRespondentName() {
|
||||
return respondentName;
|
||||
}
|
||||
|
||||
public void setRespondentName(String respondentName) {
|
||||
this.respondentName = respondentName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getCaseName() {
|
||||
return caseName;
|
||||
}
|
||||
|
||||
public void setCaseName(String caseName) {
|
||||
this.caseName = caseName;
|
||||
}
|
||||
|
||||
public String getCaseDescribe() {
|
||||
return caseDescribe;
|
||||
}
|
||||
|
||||
public void setCaseDescribe(String caseDescribe) {
|
||||
this.caseDescribe = caseDescribe;
|
||||
}
|
||||
|
||||
public String getCaseResult() {
|
||||
return caseResult;
|
||||
}
|
||||
|
||||
public void setCaseResult(String caseResult) {
|
||||
this.caseResult = caseResult;
|
||||
}
|
||||
|
||||
/** 仲裁结果 */
|
||||
private String caseResult;
|
||||
|
||||
|
||||
|
||||
public String getArbitratorName() {
|
||||
return arbitratorName;
|
||||
}
|
||||
|
||||
public void setArbitratorName(String arbitratorName) {
|
||||
this.arbitratorName = arbitratorName;
|
||||
}
|
||||
|
||||
/** 是否指派仲裁员 */
|
||||
private int pendingAppointArbotrar;
|
||||
|
||||
public int getPendingAppointArbotrar() {
|
||||
return pendingAppointArbotrar;
|
||||
}
|
||||
|
||||
public void setPendingAppointArbotrar(int pendingAppointArbotrar) {
|
||||
this.pendingAppointArbotrar = pendingAppointArbotrar;
|
||||
}
|
||||
|
||||
public String getArbitratorId() {
|
||||
return arbitratorId;
|
||||
}
|
||||
|
||||
public void setArbitratorId(String arbitratorId) {
|
||||
this.arbitratorId = arbitratorId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 案件关联人信息 */
|
||||
private List<CaseAffiliate> caseAffiliates;
|
||||
|
||||
/** 案件仲裁员 */
|
||||
private List<Arbitrator> arbitrators;
|
||||
|
||||
private List<Integer> caseStatusList;
|
||||
|
||||
private List<Integer> annexTypeList;
|
||||
|
||||
private Integer annexType;
|
||||
|
||||
public Integer getAnnexType() {
|
||||
return annexType;
|
||||
}
|
||||
|
||||
public void setAnnexType(Integer annexType) {
|
||||
this.annexType = annexType;
|
||||
}
|
||||
|
||||
public List<Integer> getAnnexTypeList() {
|
||||
return annexTypeList;
|
||||
}
|
||||
|
||||
public void setAnnexTypeList(List<Integer> annexTypeList) {
|
||||
this.annexTypeList = annexTypeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件附件列表
|
||||
*/
|
||||
private List<CaseAttach> caseAttachList;
|
||||
|
||||
public List<CaseAttach> getCaseAttachList() {
|
||||
return caseAttachList;
|
||||
}
|
||||
|
||||
public void setCaseAttachList(List<CaseAttach> caseAttachList) {
|
||||
this.caseAttachList = caseAttachList;
|
||||
}
|
||||
|
||||
public List<Integer> getCaseStatusList() {
|
||||
return caseStatusList;
|
||||
}
|
||||
|
||||
public void setCaseStatusList(List<Integer> caseStatusList) {
|
||||
this.caseStatusList = caseStatusList;
|
||||
}
|
||||
|
||||
/** 仲裁记录 */
|
||||
private ArbitrateRecord arbitrateRecord;
|
||||
|
||||
public ArbitrateRecord getArbitrateRecord() {
|
||||
return arbitrateRecord;
|
||||
}
|
||||
|
||||
public void setArbitrateRecord(ArbitrateRecord arbitrateRecord) {
|
||||
this.arbitrateRecord = arbitrateRecord;
|
||||
}
|
||||
|
||||
public List<Arbitrator> getArbitrators() {
|
||||
return arbitrators;
|
||||
}
|
||||
|
||||
public void setArbitrators(List<Arbitrator> arbitrators) {
|
||||
this.arbitrators = arbitrators;
|
||||
}
|
||||
|
||||
/** 身份类型 */
|
||||
// @Excel(name = "身份类型")
|
||||
private int identityType;
|
||||
/**
|
||||
* 申请人主体信息
|
||||
*/
|
||||
/** 姓名 */
|
||||
@Excel(name = "申请人主体信息-申请人姓名",width = 26)
|
||||
private String name;
|
||||
/** 身份证号 */
|
||||
@Excel(name = "申请人主体信息-身份证号",width = 26)
|
||||
private String identityNum;
|
||||
|
||||
/** 联系电话 */
|
||||
@Excel(name = "申请人主体信息-联系电话",width = 26)
|
||||
private String contactTelphone;
|
||||
/** 联系地址 */
|
||||
@Excel(name = "申请人主体信息-联系地址",width = 26)
|
||||
private String contactAddress;
|
||||
/** 单位电话 */
|
||||
@Excel(name = "申请人主体信息-单位电话",width = 26)
|
||||
private String workTelphone;
|
||||
/** 单位地址 */
|
||||
@Excel(name = "申请人主体信息-单位地址",width = 26)
|
||||
private String workAddress;
|
||||
|
||||
/** 代理人姓名 */
|
||||
@Excel(name = "申请人主体信息-代理人姓名",width = 26)
|
||||
private String nameAgent;
|
||||
/** 身份证号 */
|
||||
@Excel(name = "申请人主体信息-代理人身份证号",width = 26)
|
||||
private String identityNumAgent;
|
||||
/** 联系电话 */
|
||||
@Excel(name = "申请人主体信息-代理人联系电话",width = 26)
|
||||
private String contactTelphoneAgent;
|
||||
/** 联系地址 */
|
||||
@Excel(name = "申请人主体信息-代理人联系地址",width = 26)
|
||||
private String contactAddressAgent;
|
||||
/**
|
||||
* 被申请人主体信息
|
||||
*/
|
||||
/** 姓名 */
|
||||
@Excel(name = "被申请人主体信息-申请人姓名",width = 26)
|
||||
private String debtorName;
|
||||
/** 身份证号 */
|
||||
@Excel(name = "被申请人主体信息-身份证号",width = 26)
|
||||
private String debtorIdentityNum;
|
||||
|
||||
/** 联系电话 */
|
||||
@Excel(name = "被申请人主体信息-联系电话",width = 26)
|
||||
private String debtorContactTelphone;
|
||||
/** 联系地址 */
|
||||
@Excel(name = "被申请人主体信息-联系地址",width = 26)
|
||||
private String debtorContactAddress;
|
||||
/** 单位电话 */
|
||||
@Excel(name = "被申请人主体信息-单位电话",width = 26)
|
||||
private String debtorWorkTelphone;
|
||||
/** 单位地址 */
|
||||
@Excel(name = "被申请人主体信息-单位地址",width = 26)
|
||||
private String debtorWorkAddress;
|
||||
|
||||
/** 代理人姓名 */
|
||||
@Excel(name = "被申请人主体信息-代理人姓名",width = 26)
|
||||
private String debtorNameAgent;
|
||||
/** 身份证号 */
|
||||
@Excel(name = "被申请人主体信息-代理人身份证号",width = 26)
|
||||
private String debtorIdentityNumAgent;
|
||||
/** 联系电话 */
|
||||
@Excel(name = "被申请人主体信息-代理人联系电话",width = 26)
|
||||
private String debtorContactTelphoneAgent;
|
||||
/** 联系地址 */
|
||||
@Excel(name = "被申请人主体信息-代理人联系地址",width = 26)
|
||||
private String debtorContactAddressAgent;
|
||||
|
||||
public int getIdentityType() {
|
||||
return identityType;
|
||||
}
|
||||
|
||||
public void setIdentityType(int identityType) {
|
||||
this.identityType = identityType;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIdentityNum() {
|
||||
return identityNum;
|
||||
}
|
||||
|
||||
public void setIdentityNum(String identityNum) {
|
||||
this.identityNum = identityNum;
|
||||
}
|
||||
|
||||
public String getWorkTelphone() {
|
||||
return workTelphone;
|
||||
}
|
||||
|
||||
public void setWorkTelphone(String workTelphone) {
|
||||
this.workTelphone = workTelphone;
|
||||
}
|
||||
|
||||
public String getContactTelphone() {
|
||||
return contactTelphone;
|
||||
}
|
||||
|
||||
public void setContactTelphone(String contactTelphone) {
|
||||
this.contactTelphone = contactTelphone;
|
||||
}
|
||||
|
||||
public String getContactAddress() {
|
||||
return contactAddress;
|
||||
}
|
||||
|
||||
public void setContactAddress(String contactAddress) {
|
||||
this.contactAddress = contactAddress;
|
||||
}
|
||||
|
||||
public String getWorkAddress() {
|
||||
return workAddress;
|
||||
}
|
||||
|
||||
public void setWorkAddress(String workAddress) {
|
||||
this.workAddress = workAddress;
|
||||
}
|
||||
|
||||
public String getNameAgent() {
|
||||
return nameAgent;
|
||||
}
|
||||
|
||||
public void setNameAgent(String nameAgent) {
|
||||
this.nameAgent = nameAgent;
|
||||
}
|
||||
|
||||
public String getIdentityNumAgent() {
|
||||
return identityNumAgent;
|
||||
}
|
||||
|
||||
public void setIdentityNumAgent(String identityNumAgent) {
|
||||
this.identityNumAgent = identityNumAgent;
|
||||
}
|
||||
|
||||
public String getContactTelphoneAgent() {
|
||||
return contactTelphoneAgent;
|
||||
}
|
||||
|
||||
public void setContactTelphoneAgent(String contactTelphoneAgent) {
|
||||
this.contactTelphoneAgent = contactTelphoneAgent;
|
||||
}
|
||||
|
||||
public String getContactAddressAgent() {
|
||||
return contactAddressAgent;
|
||||
}
|
||||
|
||||
public void setContactAddressAgent(String contactAddressAgent) {
|
||||
this.contactAddressAgent = contactAddressAgent;
|
||||
}
|
||||
|
||||
|
||||
public String getDebtorName() {
|
||||
return debtorName;
|
||||
}
|
||||
|
||||
public void setDebtorName(String debtorName) {
|
||||
this.debtorName = debtorName;
|
||||
}
|
||||
|
||||
public String getDebtorIdentityNum() {
|
||||
return debtorIdentityNum;
|
||||
}
|
||||
|
||||
public void setDebtorIdentityNum(String debtorIdentityNum) {
|
||||
this.debtorIdentityNum = debtorIdentityNum;
|
||||
}
|
||||
|
||||
public String getDebtorContactTelphone() {
|
||||
return debtorContactTelphone;
|
||||
}
|
||||
|
||||
public void setDebtorContactTelphone(String debtorContactTelphone) {
|
||||
this.debtorContactTelphone = debtorContactTelphone;
|
||||
}
|
||||
|
||||
public String getDebtorContactAddress() {
|
||||
return debtorContactAddress;
|
||||
}
|
||||
|
||||
public void setDebtorContactAddress(String debtorContactAddress) {
|
||||
this.debtorContactAddress = debtorContactAddress;
|
||||
}
|
||||
|
||||
public String getDebtorWorkTelphone() {
|
||||
return debtorWorkTelphone;
|
||||
}
|
||||
|
||||
public void setDebtorWorkTelphone(String debtorWorkTelphone) {
|
||||
this.debtorWorkTelphone = debtorWorkTelphone;
|
||||
}
|
||||
|
||||
public String getDebtorWorkAddress() {
|
||||
return debtorWorkAddress;
|
||||
}
|
||||
|
||||
public void setDebtorWorkAddress(String debtorWorkAddress) {
|
||||
this.debtorWorkAddress = debtorWorkAddress;
|
||||
}
|
||||
|
||||
public String getDebtorNameAgent() {
|
||||
return debtorNameAgent;
|
||||
}
|
||||
|
||||
public void setDebtorNameAgent(String debtorNameAgent) {
|
||||
this.debtorNameAgent = debtorNameAgent;
|
||||
}
|
||||
|
||||
public String getDebtorIdentityNumAgent() {
|
||||
return debtorIdentityNumAgent;
|
||||
}
|
||||
|
||||
public void setDebtorIdentityNumAgent(String debtorIdentityNumAgent) {
|
||||
this.debtorIdentityNumAgent = debtorIdentityNumAgent;
|
||||
}
|
||||
|
||||
public String getDebtorContactTelphoneAgent() {
|
||||
return debtorContactTelphoneAgent;
|
||||
}
|
||||
|
||||
public void setDebtorContactTelphoneAgent(String debtorContactTelphoneAgent) {
|
||||
this.debtorContactTelphoneAgent = debtorContactTelphoneAgent;
|
||||
}
|
||||
|
||||
public String getDebtorContactAddressAgent() {
|
||||
return debtorContactAddressAgent;
|
||||
}
|
||||
|
||||
public void setDebtorContactAddressAgent(String debtorContactAddressAgent) {
|
||||
this.debtorContactAddressAgent = debtorContactAddressAgent;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCaseNum() {
|
||||
return caseNum;
|
||||
}
|
||||
|
||||
public void setCaseNum(String caseNum) {
|
||||
this.caseNum = caseNum;
|
||||
}
|
||||
|
||||
public String getContractNumber() {
|
||||
return contractNumber;
|
||||
}
|
||||
|
||||
public void setContractNumber(String contractNumber) {
|
||||
this.contractNumber = contractNumber;
|
||||
}
|
||||
|
||||
public BigDecimal getCaseSubjectAmount() {
|
||||
return caseSubjectAmount;
|
||||
}
|
||||
|
||||
public void setCaseSubjectAmount(BigDecimal caseSubjectAmount) {
|
||||
this.caseSubjectAmount = caseSubjectAmount;
|
||||
}
|
||||
|
||||
public Date getRegisterDate() {
|
||||
return registerDate;
|
||||
}
|
||||
|
||||
public void setRegisterDate(Date registerDate) {
|
||||
this.registerDate = registerDate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public Date getHearDate() {
|
||||
return hearDate;
|
||||
}
|
||||
|
||||
public void setHearDate(Date hearDate) {
|
||||
this.hearDate = hearDate;
|
||||
}
|
||||
|
||||
public String getArbitratClaims() {
|
||||
return arbitratClaims;
|
||||
}
|
||||
|
||||
public void setArbitratClaims(String arbitratClaims) {
|
||||
this.arbitratClaims = arbitratClaims;
|
||||
}
|
||||
|
||||
public Date getLoanStartDate() {
|
||||
return loanStartDate;
|
||||
}
|
||||
|
||||
public void setLoanStartDate(Date loanStartDate) {
|
||||
this.loanStartDate = loanStartDate;
|
||||
}
|
||||
|
||||
public Date getLoanEndDate() {
|
||||
return loanEndDate;
|
||||
}
|
||||
|
||||
public void setLoanEndDate(Date loanEndDate) {
|
||||
this.loanEndDate = loanEndDate;
|
||||
}
|
||||
|
||||
public BigDecimal getClaimPrinciOwed() {
|
||||
return claimPrinciOwed;
|
||||
}
|
||||
|
||||
public void setClaimPrinciOwed(BigDecimal claimPrinciOwed) {
|
||||
this.claimPrinciOwed = claimPrinciOwed;
|
||||
}
|
||||
|
||||
public BigDecimal getClaimInterestOwed() {
|
||||
return claimInterestOwed;
|
||||
}
|
||||
|
||||
public void setClaimInterestOwed(BigDecimal claimInterestOwed) {
|
||||
this.claimInterestOwed = claimInterestOwed;
|
||||
}
|
||||
|
||||
public BigDecimal getClaimLiquidDamag() {
|
||||
return claimLiquidDamag;
|
||||
}
|
||||
|
||||
public void setClaimLiquidDamag(BigDecimal claimLiquidDamag) {
|
||||
this.claimLiquidDamag = claimLiquidDamag;
|
||||
}
|
||||
|
||||
public BigDecimal getFeePayable() {
|
||||
return feePayable;
|
||||
}
|
||||
|
||||
public void setFeePayable(BigDecimal feePayable) {
|
||||
this.feePayable = feePayable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Date getBeginVideoDate() {
|
||||
return beginVideoDate;
|
||||
}
|
||||
|
||||
public void setBeginVideoDate(Date beginVideoDate) {
|
||||
this.beginVideoDate = beginVideoDate;
|
||||
}
|
||||
|
||||
public String getOnlineVideoPerson() {
|
||||
return onlineVideoPerson;
|
||||
}
|
||||
|
||||
public void setOnlineVideoPerson(String onlineVideoPerson) {
|
||||
this.onlineVideoPerson = onlineVideoPerson;
|
||||
}
|
||||
|
||||
public List<CaseAffiliate> getCaseAffiliates() {
|
||||
return caseAffiliates;
|
||||
}
|
||||
|
||||
public void setCaseAffiliates(List<CaseAffiliate> caseAffiliates) {
|
||||
this.caseAffiliates = caseAffiliates;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CaseAttach {
|
||||
/**
|
||||
* 附件id
|
||||
*/
|
||||
private Integer annexId;
|
||||
/**
|
||||
* 案件申请id
|
||||
*/
|
||||
private Long caseAppliId;
|
||||
/**
|
||||
* 附件名称
|
||||
*/
|
||||
private String annexName;
|
||||
/**
|
||||
* 附件路径
|
||||
*/
|
||||
private String annexPath;
|
||||
/**
|
||||
* 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)
|
||||
*/
|
||||
private Integer annexType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String note;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户账户
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class CaseLogRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** 案件申请id */
|
||||
private Long caseAppliId;
|
||||
/** 案件节点 */
|
||||
private Integer caseNode;
|
||||
|
||||
/** 案件节点时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date caseNodeTime;
|
||||
|
||||
/** 备注 */
|
||||
private String notes;
|
||||
|
||||
/** 案件编号 */
|
||||
private String caseNum;
|
||||
|
||||
public String getCaseNum() {
|
||||
return caseNum;
|
||||
}
|
||||
|
||||
public void setCaseNum(String caseNum) {
|
||||
this.caseNum = caseNum;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getCaseAppliId() {
|
||||
return caseAppliId;
|
||||
}
|
||||
|
||||
public void setCaseAppliId(Long caseAppliId) {
|
||||
this.caseAppliId = caseAppliId;
|
||||
}
|
||||
|
||||
public int getCaseNode() {
|
||||
return caseNode;
|
||||
}
|
||||
|
||||
public void setCaseNode(int caseNode) {
|
||||
this.caseNode = caseNode;
|
||||
}
|
||||
|
||||
public Date getCaseNodeTime() {
|
||||
return caseNodeTime;
|
||||
}
|
||||
|
||||
public void setCaseNodeTime(Date caseNodeTime) {
|
||||
this.caseNodeTime = caseNodeTime;
|
||||
}
|
||||
|
||||
public String getNotes() {
|
||||
return notes;
|
||||
}
|
||||
|
||||
public void setNotes(String notes) {
|
||||
this.notes = notes;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CasePaymentRecord {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private Long caseId;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNumber;
|
||||
/**
|
||||
* 支付状态(0未支付,1已支付)
|
||||
*/
|
||||
private Integer paymentStatus;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date paymentTime;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class IdentityAuthentication extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** 姓名 */
|
||||
private String name;
|
||||
/** 身份证号 */
|
||||
private String identityNo;
|
||||
/** 认证时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date certificationTime;
|
||||
/** 认证状态 */
|
||||
private Integer certificationStatus;
|
||||
|
||||
public Integer getCertificationStatus() {
|
||||
return certificationStatus;
|
||||
}
|
||||
|
||||
public void setCertificationStatus(Integer certificationStatus) {
|
||||
this.certificationStatus = certificationStatus;
|
||||
}
|
||||
|
||||
/** 认证状态名称 */
|
||||
private String certificationStatusName;
|
||||
|
||||
public String getCertificationStatusName() {
|
||||
return certificationStatusName;
|
||||
}
|
||||
|
||||
public void setCertificationStatusName(String certificationStatusName) {
|
||||
this.certificationStatusName = certificationStatusName;
|
||||
}
|
||||
|
||||
/** 用户ID */
|
||||
private Long userId;
|
||||
/** 用户账号 */
|
||||
private String userName;
|
||||
|
||||
/** EID商户id */
|
||||
private String merchantId;
|
||||
|
||||
/** EidToken */
|
||||
private String eidToken;
|
||||
/** 请求 ID */
|
||||
private String requestId;
|
||||
|
||||
public String getMerchantId() {
|
||||
return merchantId;
|
||||
}
|
||||
|
||||
public void setMerchantId(String merchantId) {
|
||||
this.merchantId = merchantId;
|
||||
}
|
||||
|
||||
public String getEidToken() {
|
||||
return eidToken;
|
||||
}
|
||||
|
||||
public void setEidToken(String eidToken) {
|
||||
this.eidToken = eidToken;
|
||||
}
|
||||
|
||||
public String getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
|
||||
public void setRequestId(String requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIdentityNo() {
|
||||
return identityNo;
|
||||
}
|
||||
|
||||
public void setIdentityNo(String identityNo) {
|
||||
this.identityNo = identityNo;
|
||||
}
|
||||
|
||||
public Date getCertificationTime() {
|
||||
return certificationTime;
|
||||
}
|
||||
|
||||
public void setCertificationTime(Date certificationTime) {
|
||||
this.certificationTime = certificationTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
public class SealSignRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** 文件id */
|
||||
private String fileid;
|
||||
/** 文件名称 */
|
||||
private String filename;
|
||||
/** 流程id */
|
||||
private String signFlowid;
|
||||
/** 签名人账户 */
|
||||
private String pensonAccount;
|
||||
/** 签名人姓名 */
|
||||
private String pensonName;
|
||||
/** 机构名称 */
|
||||
private String orgnizeName;
|
||||
/** 机构经办人 */
|
||||
private String orgnizeNamePsnAccount;
|
||||
/** 机构经办人名称 */
|
||||
private String orgnizeNamepsnName;
|
||||
|
||||
public String getFileid() {
|
||||
return fileid;
|
||||
}
|
||||
|
||||
public void setFileid(String fileid) {
|
||||
this.fileid = fileid;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
public String getSignFlowid() {
|
||||
return signFlowid;
|
||||
}
|
||||
|
||||
public void setSignFlowid(String signFlowid) {
|
||||
this.signFlowid = signFlowid;
|
||||
}
|
||||
|
||||
public String getPensonAccount() {
|
||||
return pensonAccount;
|
||||
}
|
||||
|
||||
public void setPensonAccount(String pensonAccount) {
|
||||
this.pensonAccount = pensonAccount;
|
||||
}
|
||||
|
||||
public String getPensonName() {
|
||||
return pensonName;
|
||||
}
|
||||
|
||||
public void setPensonName(String pensonName) {
|
||||
this.pensonName = pensonName;
|
||||
}
|
||||
|
||||
public String getOrgnizeName() {
|
||||
return orgnizeName;
|
||||
}
|
||||
|
||||
public void setOrgnizeName(String orgnizeName) {
|
||||
this.orgnizeName = orgnizeName;
|
||||
}
|
||||
|
||||
public String getOrgnizeNamePsnAccount() {
|
||||
return orgnizeNamePsnAccount;
|
||||
}
|
||||
|
||||
public void setOrgnizeNamePsnAccount(String orgnizeNamePsnAccount) {
|
||||
this.orgnizeNamePsnAccount = orgnizeNamePsnAccount;
|
||||
}
|
||||
|
||||
public String getOrgnizeNamepsnName() {
|
||||
return orgnizeNamepsnName;
|
||||
}
|
||||
|
||||
public void setOrgnizeNamepsnName(String orgnizeNamepsnName) {
|
||||
this.orgnizeNamepsnName = orgnizeNamepsnName;
|
||||
}
|
||||
|
||||
public String getPositionPagepsn() {
|
||||
return positionPagepsn;
|
||||
}
|
||||
|
||||
public void setPositionPagepsn(String positionPagepsn) {
|
||||
this.positionPagepsn = positionPagepsn;
|
||||
}
|
||||
|
||||
public double getPositionXpsn() {
|
||||
return positionXpsn;
|
||||
}
|
||||
|
||||
public void setPositionXpsn(double positionXpsn) {
|
||||
this.positionXpsn = positionXpsn;
|
||||
}
|
||||
|
||||
public double getPositionYpsn() {
|
||||
return positionYpsn;
|
||||
}
|
||||
|
||||
public void setPositionYpsn(double positionYpsn) {
|
||||
this.positionYpsn = positionYpsn;
|
||||
}
|
||||
|
||||
public String getPositionPageorg() {
|
||||
return positionPageorg;
|
||||
}
|
||||
|
||||
public void setPositionPageorg(String positionPageorg) {
|
||||
this.positionPageorg = positionPageorg;
|
||||
}
|
||||
|
||||
public double getPositionXorg() {
|
||||
return positionXorg;
|
||||
}
|
||||
|
||||
public void setPositionXorg(double positionXorg) {
|
||||
this.positionXorg = positionXorg;
|
||||
}
|
||||
|
||||
public double getPositionYorg() {
|
||||
return positionYorg;
|
||||
}
|
||||
|
||||
public void setPositionYorg(double positionYorg) {
|
||||
this.positionYorg = positionYorg;
|
||||
}
|
||||
|
||||
/** 签名位置页数 */
|
||||
private String positionPagepsn;
|
||||
/** 签名位置x坐标 */
|
||||
private double positionXpsn;
|
||||
/** 签名位置y坐标 */
|
||||
private double positionYpsn;
|
||||
/** 印章位置页数 */
|
||||
private String positionPageorg;
|
||||
/** 印章位置x坐标 */
|
||||
private double positionXorg;
|
||||
/** 印章位置y坐标 */
|
||||
private double positionYorg;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.dto;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 案件质证传入对象
|
||||
*/
|
||||
@Data
|
||||
public class CaseEvidenceDTO {
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 是否有异议需要举证,1是,0否
|
||||
*/
|
||||
private Integer objectionAddEviden;
|
||||
|
||||
/**
|
||||
* 是否需要开庭审理,1是,0否
|
||||
*/
|
||||
private Integer openCourtHear;
|
||||
|
||||
/**
|
||||
* 是否指派仲裁员,1是,2否
|
||||
*/
|
||||
private Integer pendingAppointArbotrar;
|
||||
|
||||
/**
|
||||
* 案件仲裁员
|
||||
*/
|
||||
private List<Arbitrator> arbitrators;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 案件缴费传入对象
|
||||
*/
|
||||
@Data
|
||||
public class CasePayDTO {
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 订单金额 单位:分
|
||||
*/
|
||||
private int totalFee;
|
||||
/**
|
||||
* 交易类型 native(扫码) / jsapi(小程序) / app / h5
|
||||
*/
|
||||
private String tradeType;
|
||||
/**
|
||||
* 支付方式 wxpay(微信) alipay(支付宝)
|
||||
*/
|
||||
private String platform;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BookSendVO {
|
||||
/**
|
||||
* 案件id
|
||||
* 申请人邮箱
|
||||
* 被申请人邮箱
|
||||
* 申请人快递编号
|
||||
* 被申请人快递编号
|
||||
*/
|
||||
private Long id;
|
||||
private String appEmail;
|
||||
private String resEmail;
|
||||
private String apptrackingNum;
|
||||
private String restrackingNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CaseDetailVO {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
private String caseNum;
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
private String applicantName;
|
||||
/**
|
||||
* 被申请人姓名
|
||||
*/
|
||||
private String respondentName;
|
||||
/**
|
||||
* 借款开始日期
|
||||
*/
|
||||
private Date loanStartDate;
|
||||
/**
|
||||
* 借款结束日期
|
||||
*/
|
||||
private Date loanEndDate;
|
||||
/**
|
||||
* 案件标的
|
||||
*/
|
||||
private BigDecimal caseSubjectAmount;
|
||||
/**
|
||||
* 申请人主张欠本金
|
||||
*/
|
||||
private BigDecimal claimPrinciOwed;
|
||||
/**
|
||||
* 申请人主张欠利息
|
||||
*/
|
||||
private BigDecimal claimInterestOwed;
|
||||
/**
|
||||
* 申请人主张违约金
|
||||
*/
|
||||
private BigDecimal claimLiquidDamag;
|
||||
|
||||
/**
|
||||
* 证据材料
|
||||
*/
|
||||
private List<CaseAttach> evidenceMaterialList;
|
||||
/**
|
||||
* 当前登录人身份类型
|
||||
*/
|
||||
private Integer identityType;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CaseEvidenceVO {
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
private String caseNum;
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
private String applicantName;
|
||||
/**
|
||||
* 被申请人姓名
|
||||
*/
|
||||
private String respondentName;
|
||||
/**
|
||||
* 案件状态
|
||||
*/
|
||||
private Integer caseStatus;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description 案件操作日志实体
|
||||
* @Author wangqiong
|
||||
* @Date 2023/10/09 15:18
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
public class CaseLogVO {
|
||||
/**日志id*/
|
||||
private String logId;
|
||||
/**操作人id*/
|
||||
private String operatorId;
|
||||
/**操作人名称*/
|
||||
private String operatorName;
|
||||
/**操作人ip*/
|
||||
private String ip;
|
||||
/**操作时间*/
|
||||
private Date operateTime;
|
||||
/**操作明细*/
|
||||
private String operateDetail;
|
||||
/**操作类型*/
|
||||
private String operateType;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LogisticsInfoVO {
|
||||
/**
|
||||
* 案件关联人身份类型
|
||||
*/
|
||||
private Integer identityType;
|
||||
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private String logisticsInfo;
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ArbitrateRecordMapper {
|
||||
int insertArbitrateRecord(ArbitrateRecord arbitrateRecord);
|
||||
|
||||
int updataArbitrateRecord(ArbitrateRecord arbitrateRecord);
|
||||
|
||||
ArbitrateRecord selectArbitrateRecord(ArbitrateRecord arbitrateRecord);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ArbitratorMapper {
|
||||
List<Arbitrator> selectArbitratorList(Arbitrator arbitrator);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CaseAffiliateMapper {
|
||||
|
||||
|
||||
int batchCaseAffiliate(List<CaseAffiliate> caseAffiliates);
|
||||
|
||||
|
||||
void deletecaseAffiliate(CaseApplication caseApplication);
|
||||
|
||||
|
||||
List<CaseAffiliate> selectCaseAffiliate(CaseAffiliate caseAffiliate);
|
||||
|
||||
int updataCaseAffiliate(CaseAffiliate caseAffiliate);
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CaseApplicationMapper {
|
||||
List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication);
|
||||
|
||||
int selectCaseApplicationCount(CaseApplication caseApplication);
|
||||
|
||||
int insertCaseApplication(CaseApplication caseApplication);
|
||||
|
||||
|
||||
int updataCaseApplication(CaseApplication caseApplication);
|
||||
|
||||
int submitCaseApplication(CaseApplication caseApplication);
|
||||
|
||||
int deletecaseApplication(CaseApplication caseApplication);
|
||||
|
||||
CaseApplication selectCaseApplication(CaseApplication caseApplication);
|
||||
|
||||
CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication);
|
||||
|
||||
/**
|
||||
* 查询最大编号
|
||||
* @param caseNum
|
||||
* @param length
|
||||
* @return
|
||||
*/
|
||||
Integer selectCaseNumLike(@Param("caseNum") String caseNum, @Param("length") int length);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CaseAttachMapper {
|
||||
int save(CaseAttach caseAttach);
|
||||
|
||||
List<CaseAttach> queryAnnexPathByCaseId(Long id);
|
||||
|
||||
List<CaseAttach> queryCaseAttachList(CaseApplication caseApplication);
|
||||
|
||||
|
||||
int updateCaseAttach(CaseAttach caseAttach);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user