From 362d433bb359a4940a2f066070354a6890317816 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Fri, 8 Sep 2023 13:54:53 +0800 Subject: [PATCH 001/123] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application-druid.yml | 6 +++--- ruoyi-admin/src/main/resources/application.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 06872aa..763fe7e 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -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=GMT%2B8&useSSL=false + username: root + password: root123456 # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index cfe0d50..c041599 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -18,7 +18,7 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8080 + port: 9001 servlet: # 应用的访问路径 context-path: / @@ -70,9 +70,9 @@ spring: # redis 配置 redis: # 地址 - host: localhost + host: 121.40.189.20 # 端口,默认为6379 - port: 6379 + port: 6389 # 数据库索引 database: 0 # 密码 From 4d2d8b09761c9d048a103b3aa6dabf662ff82cf0 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Sat, 9 Sep 2023 16:50:34 +0800 Subject: [PATCH 002/123] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pay/pom.xml | 59 +++ .../main/java/com/ruoyi/CallBackService.java | 32 ++ pay/src/main/java/com/ruoyi/ElegentPay.java | 66 +++ .../main/java/com/ruoyi/ali/AlipayConfig.java | 40 ++ .../java/com/ruoyi/ali/AlipayConstant.java | 30 ++ .../com/ruoyi/ali/AlipayElegentTrade.java | 461 ++++++++++++++++++ .../com/ruoyi/ali/AlipayElegentValid.java | 124 +++++ .../com/ruoyi/annotation/TradePlatform.java | 20 + .../java/com/ruoyi/config/CallbackConfig.java | 23 + .../java/com/ruoyi/constant/PayConstant.java | 11 + .../java/com/ruoyi/constant/Platform.java | 16 + .../java/com/ruoyi/constant/TradeType.java | 33 ++ .../com/ruoyi/core/CallBackServiceImpl.java | 35 ++ .../com/ruoyi/core/CallbackController.java | 90 ++++ .../java/com/ruoyi/core/CallbackWatch.java | 73 +++ .../java/com/ruoyi/core/ElegentConfig.java | 27 + .../java/com/ruoyi/core/ElegentLoader.java | 82 ++++ .../java/com/ruoyi/core/ElegentPayImpl.java | 136 ++++++ .../java/com/ruoyi/core/ElegentTrade.java | 54 ++ .../java/com/ruoyi/core/ElegentValid.java | 48 ++ .../main/java/com/ruoyi/core/WatchList.java | 20 + .../main/java/com/ruoyi/dto/PayRequest.java | 20 + .../main/java/com/ruoyi/dto/PayResponse.java | 29 ++ .../com/ruoyi/dto/QueryRefundResponse.java | 24 + .../java/com/ruoyi/dto/QueryResponse.java | 25 + .../java/com/ruoyi/dto/RefundRequest.java | 16 + .../java/com/ruoyi/dto/ValidResponse.java | 15 + pay/src/main/java/com/ruoyi/dto/WatchDTO.java | 12 + .../com/ruoyi/exceptions/TradeException.java | 24 + .../main/java/com/ruoyi/key/KeyManager.java | 16 + .../com/ruoyi/key/impl/DefaultKeyManager.java | 19 + .../main/java/com/ruoyi/util/FileUtil.java | 37 ++ .../java/com/ruoyi/wx/WxPayElegentTrade.java | 459 +++++++++++++++++ .../java/com/ruoyi/wx/WxPayElegentValid.java | 153 ++++++ .../main/java/com/ruoyi/wx/WxpayConfig.java | 20 + .../main/java/com/ruoyi/wx/WxpayConstant.java | 48 ++ .../main/resources/META-INF/spring.factories | 14 + pom.xml | 1 + ruoyi-admin/pom.xml | 6 +- .../payment/CasePaymentController.java | 29 ++ .../src/main/resources/alipay_private.key | 1 + .../src/main/resources/alipay_public.key | 1 + .../src/main/resources/application.yml | 15 + .../src/main/resources/wxpay_private.key | 1 + ruoyi-system/pom.xml | 6 +- .../system/service/ICasePaymentService.java | 7 + .../service/impl/CasePaymentServiceImpl.java | 27 + 47 files changed, 2503 insertions(+), 2 deletions(-) create mode 100644 pay/pom.xml create mode 100644 pay/src/main/java/com/ruoyi/CallBackService.java create mode 100644 pay/src/main/java/com/ruoyi/ElegentPay.java create mode 100644 pay/src/main/java/com/ruoyi/ali/AlipayConfig.java create mode 100644 pay/src/main/java/com/ruoyi/ali/AlipayConstant.java create mode 100644 pay/src/main/java/com/ruoyi/ali/AlipayElegentTrade.java create mode 100644 pay/src/main/java/com/ruoyi/ali/AlipayElegentValid.java create mode 100644 pay/src/main/java/com/ruoyi/annotation/TradePlatform.java create mode 100644 pay/src/main/java/com/ruoyi/config/CallbackConfig.java create mode 100644 pay/src/main/java/com/ruoyi/constant/PayConstant.java create mode 100644 pay/src/main/java/com/ruoyi/constant/Platform.java create mode 100644 pay/src/main/java/com/ruoyi/constant/TradeType.java create mode 100644 pay/src/main/java/com/ruoyi/core/CallBackServiceImpl.java create mode 100644 pay/src/main/java/com/ruoyi/core/CallbackController.java create mode 100644 pay/src/main/java/com/ruoyi/core/CallbackWatch.java create mode 100644 pay/src/main/java/com/ruoyi/core/ElegentConfig.java create mode 100644 pay/src/main/java/com/ruoyi/core/ElegentLoader.java create mode 100644 pay/src/main/java/com/ruoyi/core/ElegentPayImpl.java create mode 100644 pay/src/main/java/com/ruoyi/core/ElegentTrade.java create mode 100644 pay/src/main/java/com/ruoyi/core/ElegentValid.java create mode 100644 pay/src/main/java/com/ruoyi/core/WatchList.java create mode 100644 pay/src/main/java/com/ruoyi/dto/PayRequest.java create mode 100644 pay/src/main/java/com/ruoyi/dto/PayResponse.java create mode 100644 pay/src/main/java/com/ruoyi/dto/QueryRefundResponse.java create mode 100644 pay/src/main/java/com/ruoyi/dto/QueryResponse.java create mode 100644 pay/src/main/java/com/ruoyi/dto/RefundRequest.java create mode 100644 pay/src/main/java/com/ruoyi/dto/ValidResponse.java create mode 100644 pay/src/main/java/com/ruoyi/dto/WatchDTO.java create mode 100644 pay/src/main/java/com/ruoyi/exceptions/TradeException.java create mode 100644 pay/src/main/java/com/ruoyi/key/KeyManager.java create mode 100644 pay/src/main/java/com/ruoyi/key/impl/DefaultKeyManager.java create mode 100644 pay/src/main/java/com/ruoyi/util/FileUtil.java create mode 100644 pay/src/main/java/com/ruoyi/wx/WxPayElegentTrade.java create mode 100644 pay/src/main/java/com/ruoyi/wx/WxPayElegentValid.java create mode 100644 pay/src/main/java/com/ruoyi/wx/WxpayConfig.java create mode 100644 pay/src/main/java/com/ruoyi/wx/WxpayConstant.java create mode 100644 pay/src/main/resources/META-INF/spring.factories create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java create mode 100644 ruoyi-admin/src/main/resources/alipay_private.key create mode 100644 ruoyi-admin/src/main/resources/alipay_public.key create mode 100644 ruoyi-admin/src/main/resources/wxpay_private.key create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java diff --git a/pay/pom.xml b/pay/pom.xml new file mode 100644 index 0000000..0558d6f --- /dev/null +++ b/pay/pom.xml @@ -0,0 +1,59 @@ + + + + ruoyi + com.ruoyi + 3.8.6 + + 4.0.0 + pay + 1.0.0-SNAPSHOT + + + 8 + 8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-autoconfigure + 2.7.10 + true + + + + org.projectlombok + lombok + 1.18.22 + + + com.alibaba + fastjson + 1.2.72 + + + cn.hutool + hutool-all + 5.7.12 + + + com.github.wechatpay-apiv3 + wechatpay-apache-httpclient + 0.4.7 + + + com.alipay.sdk + alipay-sdk-java + 4.34.8.ALL + + + + + \ No newline at end of file diff --git a/pay/src/main/java/com/ruoyi/CallBackService.java b/pay/src/main/java/com/ruoyi/CallBackService.java new file mode 100644 index 0000000..29fb770 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/CallBackService.java @@ -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); + +} diff --git a/pay/src/main/java/com/ruoyi/ElegentPay.java b/pay/src/main/java/com/ruoyi/ElegentPay.java new file mode 100644 index 0000000..e79ae0e --- /dev/null +++ b/pay/src/main/java/com/ruoyi/ElegentPay.java @@ -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); + +} diff --git a/pay/src/main/java/com/ruoyi/ali/AlipayConfig.java b/pay/src/main/java/com/ruoyi/ali/AlipayConfig.java new file mode 100644 index 0000000..1648dde --- /dev/null +++ b/pay/src/main/java/com/ruoyi/ali/AlipayConfig.java @@ -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"); + } + + +} \ No newline at end of file diff --git a/pay/src/main/java/com/ruoyi/ali/AlipayConstant.java b/pay/src/main/java/com/ruoyi/ali/AlipayConstant.java new file mode 100644 index 0000000..db7417d --- /dev/null +++ b/pay/src/main/java/com/ruoyi/ali/AlipayConstant.java @@ -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 TRADE_STATE = new HashMap(){ + { + 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"; + +} diff --git a/pay/src/main/java/com/ruoyi/ali/AlipayElegentTrade.java b/pay/src/main/java/com/ruoyi/ali/AlipayElegentTrade.java new file mode 100644 index 0000000..aefd560 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/ali/AlipayElegentTrade.java @@ -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(); + } + + +} \ No newline at end of file diff --git a/pay/src/main/java/com/ruoyi/ali/AlipayElegentValid.java b/pay/src/main/java/com/ruoyi/ali/AlipayElegentValid.java new file mode 100644 index 0000000..0052a4f --- /dev/null +++ b/pay/src/main/java/com/ruoyi/ali/AlipayElegentValid.java @@ -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 httpEntity, HttpServletRequest httpRequest) throws TradeException { + ValidResponse validResponse=new ValidResponse(); + try { + Map 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 httpEntity, HttpServletRequest httpRequest) throws TradeException { + ValidResponse validResponse=new ValidResponse(); + + try { + //获取支付宝POST过来反馈信息,将异步通知中收到的待验证所有参数都存放到map中 + Map 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 getParams(HttpServletRequest httpServletRequest){ + Map 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; + } +} diff --git a/pay/src/main/java/com/ruoyi/annotation/TradePlatform.java b/pay/src/main/java/com/ruoyi/annotation/TradePlatform.java new file mode 100644 index 0000000..3cb71be --- /dev/null +++ b/pay/src/main/java/com/ruoyi/annotation/TradePlatform.java @@ -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(); +} diff --git a/pay/src/main/java/com/ruoyi/config/CallbackConfig.java b/pay/src/main/java/com/ruoyi/config/CallbackConfig.java new file mode 100644 index 0000000..2c656ee --- /dev/null +++ b/pay/src/main/java/com/ruoyi/config/CallbackConfig.java @@ -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;//检查周期 + +} \ No newline at end of file diff --git a/pay/src/main/java/com/ruoyi/constant/PayConstant.java b/pay/src/main/java/com/ruoyi/constant/PayConstant.java new file mode 100644 index 0000000..77695ce --- /dev/null +++ b/pay/src/main/java/com/ruoyi/constant/PayConstant.java @@ -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"; + +} diff --git a/pay/src/main/java/com/ruoyi/constant/Platform.java b/pay/src/main/java/com/ruoyi/constant/Platform.java new file mode 100644 index 0000000..fd9a8d9 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/constant/Platform.java @@ -0,0 +1,16 @@ +package com.ruoyi.constant; + +/** + * Platform + * 支付方式 +*/ +public class Platform { + /** + * 微信 + */ + public final static String WX = "wxpay"; + /** + * 支付宝 + */ + public final static String ALI = "alipay"; +} diff --git a/pay/src/main/java/com/ruoyi/constant/TradeType.java b/pay/src/main/java/com/ruoyi/constant/TradeType.java new file mode 100644 index 0000000..c0a7ace --- /dev/null +++ b/pay/src/main/java/com/ruoyi/constant/TradeType.java @@ -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"; + +} diff --git a/pay/src/main/java/com/ruoyi/core/CallBackServiceImpl.java b/pay/src/main/java/com/ruoyi/core/CallBackServiceImpl.java new file mode 100644 index 0000000..ea0148d --- /dev/null +++ b/pay/src/main/java/com/ruoyi/core/CallBackServiceImpl.java @@ -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); + } + + +} diff --git a/pay/src/main/java/com/ruoyi/core/CallbackController.java b/pay/src/main/java/com/ruoyi/core/CallbackController.java new file mode 100644 index 0000000..8b7170f --- /dev/null +++ b/pay/src/main/java/com/ruoyi/core/CallbackController.java @@ -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 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 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(); + } + + } + + +} diff --git a/pay/src/main/java/com/ruoyi/core/CallbackWatch.java b/pay/src/main/java/com/ruoyi/core/CallbackWatch.java new file mode 100644 index 0000000..5bfe85e --- /dev/null +++ b/pay/src/main/java/com/ruoyi/core/CallbackWatch.java @@ -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); + } + +} diff --git a/pay/src/main/java/com/ruoyi/core/ElegentConfig.java b/pay/src/main/java/com/ruoyi/core/ElegentConfig.java new file mode 100644 index 0000000..34cde57 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/core/ElegentConfig.java @@ -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(); + } + +} diff --git a/pay/src/main/java/com/ruoyi/core/ElegentLoader.java b/pay/src/main/java/com/ruoyi/core/ElegentLoader.java new file mode 100644 index 0000000..36dcb8b --- /dev/null +++ b/pay/src/main/java/com/ruoyi/core/ElegentLoader.java @@ -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 elegentTradeMap = new HashMap<>(); + + private static Map elegentValidMap = new HashMap<>(); + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + + //加载所有的交易实现类 + Collection 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 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); + } + } + +} diff --git a/pay/src/main/java/com/ruoyi/core/ElegentPayImpl.java b/pay/src/main/java/com/ruoyi/core/ElegentPayImpl.java new file mode 100644 index 0000000..97f84d2 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/core/ElegentPayImpl.java @@ -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); + } + +} diff --git a/pay/src/main/java/com/ruoyi/core/ElegentTrade.java b/pay/src/main/java/com/ruoyi/core/ElegentTrade.java new file mode 100644 index 0000000..4474da3 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/core/ElegentTrade.java @@ -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); + +} diff --git a/pay/src/main/java/com/ruoyi/core/ElegentValid.java b/pay/src/main/java/com/ruoyi/core/ElegentValid.java new file mode 100644 index 0000000..fdb7cd5 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/core/ElegentValid.java @@ -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 httpEntity, HttpServletRequest request) throws TradeException; + + + + /** + * 退款结果通知校验 + * 该接口基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk + * 业务编写人员在接收到微信或支付宝回调的时候可以使用该方法验证回调是否成功,是否是伪回调 + */ + ValidResponse validRefund(HttpEntity httpEntity, HttpServletRequest request) throws TradeException; + + + /** + * 成功返回结构 + * @return + */ + String successResult(); + + + /** + * 失败返回内容 + * @return + */ + String failResult(); + +} diff --git a/pay/src/main/java/com/ruoyi/core/WatchList.java b/pay/src/main/java/com/ruoyi/core/WatchList.java new file mode 100644 index 0000000..a610939 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/core/WatchList.java @@ -0,0 +1,20 @@ +package com.ruoyi.core; + + + +import com.ruoyi.dto.WatchDTO; + +import java.util.concurrent.CopyOnWriteArraySet; + +/** + * 监听列表 + */ +public class WatchList { + + + + public static CopyOnWriteArraySet payList=new CopyOnWriteArraySet<>(); //支付中列表 + + public static CopyOnWriteArraySet refundList=new CopyOnWriteArraySet<>(); //退款中列表 + +} diff --git a/pay/src/main/java/com/ruoyi/dto/PayRequest.java b/pay/src/main/java/com/ruoyi/dto/PayRequest.java new file mode 100644 index 0000000..5d747da --- /dev/null +++ b/pay/src/main/java/com/ruoyi/dto/PayRequest.java @@ -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 +} diff --git a/pay/src/main/java/com/ruoyi/dto/PayResponse.java b/pay/src/main/java/com/ruoyi/dto/PayResponse.java new file mode 100644 index 0000000..db4aafb --- /dev/null +++ b/pay/src/main/java/com/ruoyi/dto/PayResponse.java @@ -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 expand;//扩展属性 + + private String code_url;//二维码连接(native返回) + + private String prepay_id;//预支付Id(小程序返回) + + private String h5_url;//支付跳转链接 + + private Map jsapiData;//小程序返回 + +} diff --git a/pay/src/main/java/com/ruoyi/dto/QueryRefundResponse.java b/pay/src/main/java/com/ruoyi/dto/QueryRefundResponse.java new file mode 100644 index 0000000..d938f63 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/dto/QueryRefundResponse.java @@ -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;//退款金额 + + +} diff --git a/pay/src/main/java/com/ruoyi/dto/QueryResponse.java b/pay/src/main/java/com/ruoyi/dto/QueryResponse.java new file mode 100644 index 0000000..04ddb70 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/dto/QueryResponse.java @@ -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;//扩展(全部的返回数据) + +} diff --git a/pay/src/main/java/com/ruoyi/dto/RefundRequest.java b/pay/src/main/java/com/ruoyi/dto/RefundRequest.java new file mode 100644 index 0000000..3f17046 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/dto/RefundRequest.java @@ -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; //退款请求号,做退款幂等性校验,当部分退款时必须给出 + +} diff --git a/pay/src/main/java/com/ruoyi/dto/ValidResponse.java b/pay/src/main/java/com/ruoyi/dto/ValidResponse.java new file mode 100644 index 0000000..f8e3973 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/dto/ValidResponse.java @@ -0,0 +1,15 @@ +package com.ruoyi.dto; + +import lombok.Data; + +/** + * 验证签名 + */ +@Data +public class ValidResponse { + + private boolean isValid;// 是否通过验签 + + private String orderSn;// 订单号 + +} diff --git a/pay/src/main/java/com/ruoyi/dto/WatchDTO.java b/pay/src/main/java/com/ruoyi/dto/WatchDTO.java new file mode 100644 index 0000000..7411b91 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/dto/WatchDTO.java @@ -0,0 +1,12 @@ +package com.ruoyi.dto; + +import lombok.Data; + +@Data +public class WatchDTO { + + private String orderSn; //订单号 + + private String platform;//平台 + +} diff --git a/pay/src/main/java/com/ruoyi/exceptions/TradeException.java b/pay/src/main/java/com/ruoyi/exceptions/TradeException.java new file mode 100644 index 0000000..3a82860 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/exceptions/TradeException.java @@ -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); + } +} diff --git a/pay/src/main/java/com/ruoyi/key/KeyManager.java b/pay/src/main/java/com/ruoyi/key/KeyManager.java new file mode 100644 index 0000000..aacfee5 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/key/KeyManager.java @@ -0,0 +1,16 @@ +package com.ruoyi.key; + +/** + * 密钥管理器接口 + */ +public interface KeyManager { + + + /** + * 根据名字获取key字符串 + * @param name + * @return + */ + String getKey(String name); + +} diff --git a/pay/src/main/java/com/ruoyi/key/impl/DefaultKeyManager.java b/pay/src/main/java/com/ruoyi/key/impl/DefaultKeyManager.java new file mode 100644 index 0000000..0d48c66 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/key/impl/DefaultKeyManager.java @@ -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); + } + + +} diff --git a/pay/src/main/java/com/ruoyi/util/FileUtil.java b/pay/src/main/java/com/ruoyi/util/FileUtil.java new file mode 100644 index 0000000..13d0e9f --- /dev/null +++ b/pay/src/main/java/com/ruoyi/util/FileUtil.java @@ -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; + } + +} diff --git a/pay/src/main/java/com/ruoyi/wx/WxPayElegentTrade.java b/pay/src/main/java/com/ruoyi/wx/WxPayElegentTrade.java new file mode 100644 index 0000000..d1dfc8c --- /dev/null +++ b/pay/src/main/java/com/ruoyi/wx/WxPayElegentTrade.java @@ -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 params = new HashMap() { + { + 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() { + { + put("total", payRequest.getTotalFee());//金额,单位:分 + put("currency", "CNY");//人民币 + } + }); + put("description", payRequest.getBody()); + } + }; + + if("h5".equals(tradeType)){ //h5 + params.put("scene_info", new HashMap() { + { + put("payer_client_ip", "127.0.0.1"); + put("h5_info", new HashMap() { + { + put("type", "Wap"); + } + }); + } + }); + } + if ("jsapi".equals(tradeType)) { //如果是小程序支付 + params.put("payer", new HashMap() { + { + put("openid", payRequest.getOpenid()); + } + }); + } + + + String url = WxpayConstant.createOrder + tradeType; //创建订单 + log.info("elegent-pay 请求参数{}",params); + Map 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 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 params = new HashMap(); + 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 params = new HashMap(); + 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() { + { + 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 params = new HashMap(); + 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 params = new HashMap(); + 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 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 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() { + { + 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 map = JSON.parseObject(returnBody, Map.class); + result = new HashMap() { + { + put("code", "FAIL"); + put("message", map.get("message")); + } + }; + } + } catch (Exception e) { + result = new HashMap() { + { + put("code", "FAIL"); + put("message", e.getMessage()); + } + }; + } finally { + closeConnect(response); + return result; + } + } + + private Map postApiTemplate(String url, Map 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()); + } + + +} diff --git a/pay/src/main/java/com/ruoyi/wx/WxPayElegentValid.java b/pay/src/main/java/com/ruoyi/wx/WxPayElegentValid.java new file mode 100644 index 0000000..c570b6f --- /dev/null +++ b/pay/src/main/java/com/ruoyi/wx/WxPayElegentValid.java @@ -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 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 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); + } +} diff --git a/pay/src/main/java/com/ruoyi/wx/WxpayConfig.java b/pay/src/main/java/com/ruoyi/wx/WxpayConfig.java new file mode 100644 index 0000000..c5f139c --- /dev/null +++ b/pay/src/main/java/com/ruoyi/wx/WxpayConfig.java @@ -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密钥 + +} \ No newline at end of file diff --git a/pay/src/main/java/com/ruoyi/wx/WxpayConstant.java b/pay/src/main/java/com/ruoyi/wx/WxpayConstant.java new file mode 100644 index 0000000..01d3415 --- /dev/null +++ b/pay/src/main/java/com/ruoyi/wx/WxpayConstant.java @@ -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(){ + { + put("code", "SUCCESS"); + } + }; + + public static final Map FAIL = new HashMap(){ + { + 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"; +} diff --git a/pay/src/main/resources/META-INF/spring.factories b/pay/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..da04c71 --- /dev/null +++ b/pay/src/main/resources/META-INF/spring.factories @@ -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 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 9d5389d..9c62fbb 100644 --- a/pom.xml +++ b/pom.xml @@ -180,6 +180,7 @@ ruoyi-quartz ruoyi-generator ruoyi-common + pay pom diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 1436d6d..2186d33 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -60,7 +60,11 @@ com.ruoyi ruoyi-generator - + + com.ruoyi + pay + 1.0.0-SNAPSHOT + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java new file mode 100644 index 0000000..41d1e06 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java @@ -0,0 +1,29 @@ +package com.ruoyi.web.controller.payment; + +import com.ruoyi.ElegentPay; +import com.ruoyi.constant.Platform; +import com.ruoyi.constant.TradeType; +import com.ruoyi.dto.PayRequest; +import com.ruoyi.dto.PayResponse; +import com.ruoyi.system.service.ICasePaymentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 缴费支付 + */ +@RestController +@RequestMapping("/pay") +public class CasePaymentController { + private final ICasePaymentService paymentService; + @Autowired + public CasePaymentController(ICasePaymentService paymentService){ + this.paymentService=paymentService; + } + @PostMapping("/casePay") + public String casePay(PayRequest request) { + return paymentService.casePay(request); + } +} diff --git a/ruoyi-admin/src/main/resources/alipay_private.key b/ruoyi-admin/src/main/resources/alipay_private.key new file mode 100644 index 0000000..6a4759b --- /dev/null +++ b/ruoyi-admin/src/main/resources/alipay_private.key @@ -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 \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/alipay_public.key b/ruoyi-admin/src/main/resources/alipay_public.key new file mode 100644 index 0000000..21236fb --- /dev/null +++ b/ruoyi-admin/src/main/resources/alipay_public.key @@ -0,0 +1 @@ +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhUnjdAKwZApwZEcfq+5L0pa77Vg3mqcoXv+th8RR0SYotkPsH1f2JkbS48ySaSCM6YNWSMNfqp5qdOla2zUJOBnJ/yaBg7s7fVD6V3M2mEog8kCDYGKt/3P4VII3xYl8lFYMQ3IcFRELkxCBBCA8JDKmf5z2R4F/Z/jFFEuOwxaJvp+7Ke9OzZHYdWGNnU6QP8YYLYUeX7VNZLHEuly34ExAw6A+yJkNDsYEho2Lu31QjT2pLh9g+88MlRfiI92iN25O9NVdeM4f5RcpvBPrBQZQs9tlFmALYSFS3prIf3FAobWM+W7iwxT6J25nFIhst1DdJQfIBpaeRUJVTkn99QIDAQAB \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index c041599..4ee8d89 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -129,3 +129,18 @@ 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: https://2d3ac179.r5.cpolar.top + watch: true + cycle: 10 \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/wxpay_private.key b/ruoyi-admin/src/main/resources/wxpay_private.key new file mode 100644 index 0000000..d4be12f --- /dev/null +++ b/ruoyi-admin/src/main/resources/wxpay_private.key @@ -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= \ No newline at end of file diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index 85d4f3c..435e8f1 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -22,7 +22,11 @@ com.ruoyi ruoyi-common - + + com.ruoyi + pay + 1.0.0-SNAPSHOT + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java new file mode 100644 index 0000000..c28efab --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java @@ -0,0 +1,7 @@ +package com.ruoyi.system.service; + +import com.ruoyi.dto.PayRequest; + +public interface ICasePaymentService { + String casePay(PayRequest request); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java new file mode 100644 index 0000000..9d8c339 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java @@ -0,0 +1,27 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.ElegentPay; +import com.ruoyi.constant.Platform; +import com.ruoyi.constant.TradeType; +import com.ruoyi.dto.PayRequest; +import com.ruoyi.dto.PayResponse; +import com.ruoyi.system.service.ICasePaymentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class CasePaymentServiceImpl implements ICasePaymentService { + private final ElegentPay elegentPay; + @Autowired + public CasePaymentServiceImpl(ElegentPay elegentPay){ + this.elegentPay=elegentPay; + } + @Override + public String casePay(PayRequest request) { + PayResponse payResponse = elegentPay.requestPay(request, TradeType.NATIVE, Platform.WX); + if (payResponse!=null){ + return payResponse.getCode_url(); + } + return null; + } +} From 5662d2f2f5f5d8e36b52ac139effa9cf5bf92bc8 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Mon, 11 Sep 2023 14:29:15 +0800 Subject: [PATCH 003/123] =?UTF-8?q?=E7=AB=8B=E6=A1=88=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 108 +++++++++ .../constant/CaseApplicationConstants.java | 23 ++ .../wisdomarbitrate/domain/CaseAffiliate.java | 150 ++++++++++++ .../domain/CaseApplication.java | 218 ++++++++++++++++++ .../mapper/CaseAffiliateMapper.java | 20 ++ .../mapper/CaseApplicationMapper.java | 23 ++ .../service/ICaseApplicationService.java | 22 ++ .../impl/CaseApplicationServiceImpl.java | 98 ++++++++ .../wisdomarbitrate/CaseAffiliateMapper.xml | 78 +++++++ .../wisdomarbitrate/CaseApplicationMapper.xml | 164 +++++++++++++ 10 files changed, 904 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java new file mode 100644 index 0000000..1ccaea8 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -0,0 +1,108 @@ +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.domain.entity.SysUser; +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 java.util.List; + +import static com.ruoyi.common.core.domain.AjaxResult.error; + + +@RestController +@RequestMapping("/caseApplication") +public class CaseApplicationController extends BaseController { + @Autowired + private ICaseApplicationService caseApplicationService; + + /** + * 查询立案数据 + */ + @PreAuthorize("@ss.hasPermi('caseApplication:list')") + @PostMapping("/list") + public TableDataInfo list(@Validated @RequestBody CaseApplication caseApplication) + { + startPage(); + List 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); + } + + + + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java new file mode 100644 index 0000000..8f338f3 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java @@ -0,0 +1,23 @@ +package com.ruoyi.common.constant; +/** + * 立案申请案件状态 + * + */ +public class CaseApplicationConstants { + /** 立案申请 */ + public static final int CASE_APPLICATION = 0; + /** 待缴费 */ + public static final int PENDING_PAYMENT = 1; + /** 待缴费确认 */ + public static final int PENDING_PAYMENT_CONFIRM = 2; + /** 待确认证据 */ + public static final int EVIDENCE_CONFREMED = 3; + /** 待组庭 */ + public static final int PENDING_TRIAL = 4; + + + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java new file mode 100644 index 0000000..719b699 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java @@ -0,0 +1,150 @@ +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; + + 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; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java new file mode 100644 index 0000000..91976d3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -0,0 +1,218 @@ +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 */ + @Excel(name = "ID", cellType = Excel.ColumnType.NUMERIC, prompt = "ID") + private Long id; + /** 案件编号 */ + @Excel(name = "案件编号") + private String caseNum; + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractNumber; + /** 案件标的 */ + @Excel(name = "案件标的") + private BigDecimal caseSubjectAmount; + /** 立案日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date registerDate; + /** 仲裁方式 */ + private String arbitratMethod; + /** 案件状态 */ + private int caseStatus; + /** 开庭日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date hearDate; + /** 申请人仲裁诉求 */ + private String arbitratClaims; + /** 借款开始日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date loanStartDate; + /** 借款结束日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date loanEndDate; + /** 申请人主张欠本金 */ + @Excel(name = "申请人主张欠本金") + private BigDecimal claimPrinciOwed; + /** 申请人主张欠利息 */ + @Excel(name = "申请人主张欠利息") + private BigDecimal claimInterestOwed; + /** 申请人主张违约金 */ + @Excel(name = "申请人主张违约金") + private BigDecimal claimLiquidDamag; + /** 仲裁应缴费用 */ + private BigDecimal feePayable; + /** 仲裁实缴费用 */ + private BigDecimal paidExpenses; + /** 开始在线视频时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date beginVideoDate; + /** 在线视频人员 */ + private String onlineVideoPerson; + + /** 案件关联人信息 */ + private List caseAffiliates; + + + + 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 String getArbitratMethod() { + return arbitratMethod; + } + + public void setArbitratMethod(String arbitratMethod) { + this.arbitratMethod = arbitratMethod; + } + + public int getCaseStatus() { + return caseStatus; + } + + public void setCaseStatus(int caseStatus) { + this.caseStatus = caseStatus; + } + + 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 BigDecimal getPaidExpenses() { + return paidExpenses; + } + + public void setPaidExpenses(BigDecimal paidExpenses) { + this.paidExpenses = paidExpenses; + } + + 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 getCaseAffiliates() { + return caseAffiliates; + } + + public void setCaseAffiliates(List caseAffiliates) { + this.caseAffiliates = caseAffiliates; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java new file mode 100644 index 0000000..52e0057 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java @@ -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 caseAffiliates); + + + void deletecaseAffiliate(CaseApplication caseApplication); + + + List selectCaseAffiliate(CaseAffiliate caseAffiliate); + + int updataCaseAffiliate(CaseAffiliate caseAffiliate); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java new file mode 100644 index 0000000..f4c7bba --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -0,0 +1,23 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; + +import java.util.List; + +public interface CaseApplicationMapper { + List 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java new file mode 100644 index 0000000..97dfe2f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -0,0 +1,22 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; + +import java.util.List; + +public interface ICaseApplicationService { + List selectCaseApplicationList(CaseApplication caseApplication); + + + int insertcaseApplication(CaseApplication caseApplication); + + int selectCaseApplicationCount(CaseApplication caseApplication); + + int editCaseApplication(CaseApplication caseApplication); + + int submitCaseApplication(CaseApplication caseApplication); + + int deletecaseApplicationByIds(CaseApplication caseApplication); + + CaseApplication selectCaseApplication(CaseApplication caseApplication); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java new file mode 100644 index 0000000..75980b1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -0,0 +1,98 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.lang.reflect.Field; +import java.util.List; + +import static com.ruoyi.common.core.domain.AjaxResult.error; + +@Service +public class CaseApplicationServiceImpl implements ICaseApplicationService { + @Autowired + private CaseApplicationMapper caseApplicationMapper; + + @Autowired + private CaseAffiliateMapper caseAffiliateMapper; + + + @Override + public List selectCaseApplicationList(CaseApplication caseApplication) { + return caseApplicationMapper.selectCaseApplicationList(caseApplication); + + } + + @Override + @Transactional + public int insertcaseApplication(CaseApplication caseApplication) { + // 新增立案信息 + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + int rows = caseApplicationMapper.insertCaseApplication(caseApplication); + List caseAffiliates = caseApplication.getCaseAffiliates(); + if(caseAffiliates!=null&&caseAffiliates.size()>0){ + for (CaseAffiliate caseAffiliate : caseAffiliates){ + caseAffiliate.setCaseAppliId(caseApplication.getId()); + } + caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); + } + + return rows; + } + + @Override + public int selectCaseApplicationCount(CaseApplication caseApplication) { + return caseApplicationMapper.selectCaseApplicationCount(caseApplication); + } + + @Override + @Transactional + public int editCaseApplication(CaseApplication caseApplication) { + int rows = caseApplicationMapper.updataCaseApplication(caseApplication); + List caseAffiliates = caseApplication.getCaseAffiliates(); + if(caseAffiliates!=null&&caseAffiliates.size()>0){ + for (CaseAffiliate caseAffiliate : caseAffiliates){ + caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); + } + } + + return rows; + } + + @Override + @Transactional + public int submitCaseApplication(CaseApplication caseApplication) { + //提交立案申请 + caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); + int rows = caseApplicationMapper.submitCaseApplication(caseApplication); + return rows; + } + + @Override + @Transactional + public int deletecaseApplicationByIds(CaseApplication caseApplication) { + + caseAffiliateMapper.deletecaseAffiliate(caseApplication); + return caseApplicationMapper.deletecaseApplication(caseApplication); + } + + @Override + public CaseApplication selectCaseApplication(CaseApplication caseApplication) { + CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseApplication.getId()); + List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); + + return caseApplicationselect; + } + + +} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml new file mode 100644 index 0000000..c1a9fd0 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + insert into case_affiliate(case_appli_id, identity_type,name,identity_num,contact_telphone, + contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent, + contact_address_agent ) values + + (#{item.caseAppliId},#{item.identityType},#{item.name},#{item.identityNum},#{item.contactTelphone}, + #{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent}, + #{item.contactTelphoneAgent},#{item.contactAddressAgent}) + + + + + + + update case_affiliate + set + identity_type= #{identityType}, + name = #{name}, + identity_num = #{identityNum}, + contact_telphone = #{contactTelphone}, + contact_address = #{contactAddress}, + work_address = #{workAddress}, + work_telphone = #{workTelphone}, + + name_agent = #{nameAgent}, + identity_num_agent = #{identityNumAgent}, + contact_telphone_agent = #{contactTelphoneAgent}, + contact_address_agent = #{contactAddressAgent} + where id = #{id} + + + + + delete from case_affiliate where case_appli_id = #{id} + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml new file mode 100644 index 0000000..c2f7aba --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into case_application( + + case_num, + case_subject_amount, + register_date, + arbitrat_method, + case_status, + hear_date, + arbitrat_claims, + loan_start_date, + loan_end_date, + claim_princi_owed, + + claim_interest_owed, + claim_liquid_damag, + fee_payable, + paid_expenses, + begin_video_date, + online_video_person, + + contract_number, + create_by, + create_time + )values( + #{caseNum}, + #{caseSubjectAmount}, + #{registerDate}, + #{arbitratMethod}, + #{caseStatus}, + #{hearDate}, + #{arbitratClaims}, + #{loanStartDate}, + #{loanEndDate}, + #{claimPrinciOwed}, + + #{claimInterestOwed}, + #{claimLiquidDamag}, + #{feePayable}, + #{paidExpenses}, + #{beginVideoDate}, + #{onlineVideoPerson}, + + #{contractNumber}, + #{createBy}, + sysdate() + ) + + + + update case_application + + case_subject_amount = #{caseSubjectAmount}, + register_date = #{registerDate}, + arbitrat_method = #{arbitratMethod}, + hear_date = #{hearDate}, + arbitrat_claims = #{arbitratClaims}, + loan_start_date = #{loanStartDate}, + loan_end_date = #{loanEndDate}, + claim_princi_owed = #{claimPrinciOwed}, + claim_interest_owed = #{claimInterestOwed}, + claim_liquid_damag = #{claimLiquidDamag}, + fee_payable = #{feePayable}, + paid_expenses = #{paidExpenses}, + begin_video_date = #{beginVideoDate}, + online_video_person = #{onlineVideoPerson}, + + contract_number = #{contractNumber}, + update_by = #{updateBy}, + update_time = sysdate() + + where id = #{id} + + + + update case_application + + case_status = #{caseStatus} + + where id = #{id} + + + + delete from case_application where id = #{id} + + + + + + + + + \ No newline at end of file From b4fb054a7f0c4aff60a863f2324a7c3f2bc08583 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Mon, 11 Sep 2023 14:45:44 +0800 Subject: [PATCH 004/123] 111 --- .../payment/CasePaymentController.java | 35 +++++++++++++++---- .../src/main/resources/application.yml | 2 +- .../system/mapper/CasePaymentMapper.java | 8 +++++ .../system/service/ICasePaymentService.java | 14 ++++++++ .../service/impl/CasePaymentServiceImpl.java | 21 ++++++++++- .../mapper/system/CasePaymentMapper.xml | 9 +++++ 6 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/CasePaymentMapper.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/CasePaymentMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java index 41d1e06..f8c256b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java @@ -1,15 +1,10 @@ package com.ruoyi.web.controller.payment; -import com.ruoyi.ElegentPay; -import com.ruoyi.constant.Platform; -import com.ruoyi.constant.TradeType; + import com.ruoyi.dto.PayRequest; -import com.ruoyi.dto.PayResponse; import com.ruoyi.system.service.ICasePaymentService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 缴费支付 @@ -22,8 +17,34 @@ public class CasePaymentController { public CasePaymentController(ICasePaymentService paymentService){ this.paymentService=paymentService; } + + /** + * 查询缴费列表 + */ + @GetMapping + public String queryPayList(){ + return paymentService.queryPayList(); + } + + /** + * 根据案件id查询缴费清单 + * @return + */ + @GetMapping + public String getPaymentListByCaseId(){ + return paymentService.getPaymentListByCaseId(); + } + /** + * 案件缴费 + * @param request + * @return + */ @PostMapping("/casePay") public String casePay(PayRequest request) { return paymentService.casePay(request); } + @PutMapping + public String payConfirm(){ + return paymentService.payConfirm(); + } } diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 4ee8d89..e032281 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -141,6 +141,6 @@ elegent: alipay: appId: 2021003141676135 callback: - domain: https://2d3ac179.r5.cpolar.top + domain: http://121.40.189.20:9000/ watch: true cycle: 10 \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CasePaymentMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CasePaymentMapper.java new file mode 100644 index 0000000..b7d80fc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CasePaymentMapper.java @@ -0,0 +1,8 @@ +package com.ruoyi.system.mapper; + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface CasePaymentMapper { + void queryPayList(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java index c28efab..ffc81c8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java @@ -3,5 +3,19 @@ package com.ruoyi.system.service; import com.ruoyi.dto.PayRequest; public interface ICasePaymentService { + /** + * 案件缴费 + * @param request + * @return + */ String casePay(PayRequest request); + /** + * 查询缴费列表 + */ + String queryPayList(); + + String getPaymentListByCaseId(); + + String payConfirm(); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java index 9d8c339..0a5c454 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java @@ -5,6 +5,7 @@ import com.ruoyi.constant.Platform; import com.ruoyi.constant.TradeType; import com.ruoyi.dto.PayRequest; import com.ruoyi.dto.PayResponse; +import com.ruoyi.system.mapper.CasePaymentMapper; import com.ruoyi.system.service.ICasePaymentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -12,9 +13,11 @@ import org.springframework.stereotype.Service; @Service public class CasePaymentServiceImpl implements ICasePaymentService { private final ElegentPay elegentPay; + private final CasePaymentMapper paymentMapper; @Autowired - public CasePaymentServiceImpl(ElegentPay elegentPay){ + public CasePaymentServiceImpl(ElegentPay elegentPay,CasePaymentMapper paymentMapper ){ this.elegentPay=elegentPay; + this.paymentMapper=paymentMapper; } @Override public String casePay(PayRequest request) { @@ -24,4 +27,20 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } return null; } + + @Override + public String queryPayList() { + paymentMapper.queryPayList(); + return null; + } + + @Override + public String getPaymentListByCaseId() { + return null; + } + + @Override + public String payConfirm() { + return null; + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/CasePaymentMapper.xml b/ruoyi-system/src/main/resources/mapper/system/CasePaymentMapper.xml new file mode 100644 index 0000000..6a77419 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/CasePaymentMapper.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file From aa351abd15dd17503669a32e0198c210a2091e6c Mon Sep 17 00:00:00 2001 From: hejinbo Date: Mon, 11 Sep 2023 18:17:17 +0800 Subject: [PATCH 005/123] =?UTF-8?q?=E7=BC=B4=E8=B4=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/CasePaymentController.java | 45 +++++++---------- .../system/mapper/CasePaymentMapper.java | 8 ---- .../system/service/ICasePaymentService.java | 21 -------- .../service/impl/CasePaymentServiceImpl.java | 46 ------------------ .../domain/dto/CasePayDTO.java | 20 ++++++++ .../service/ICasePaymentService.java | 15 ++++++ .../service/impl/CasePaymentServiceImpl.java | 48 +++++++++++++++++++ .../mapper/system/CasePaymentMapper.xml | 9 ---- 8 files changed, 101 insertions(+), 111 deletions(-) delete mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/CasePaymentMapper.java delete mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java delete mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java delete mode 100644 ruoyi-system/src/main/resources/mapper/system/CasePaymentMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java index f8c256b..cba05bd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java @@ -1,9 +1,11 @@ package com.ruoyi.web.controller.payment; - -import com.ruoyi.dto.PayRequest; -import com.ruoyi.system.service.ICasePaymentService; +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.*; /** @@ -17,34 +19,23 @@ public class CasePaymentController { public CasePaymentController(ICasePaymentService paymentService){ this.paymentService=paymentService; } - - /** - * 查询缴费列表 - */ - @GetMapping - public String queryPayList(){ - return paymentService.queryPayList(); - } - - /** - * 根据案件id查询缴费清单 - * @return - */ - @GetMapping - public String getPaymentListByCaseId(){ - return paymentService.getPaymentListByCaseId(); - } /** * 案件缴费 - * @param request - * @return + * @param casePayDTO 缴费传入参数 + * @return 统一响应结果 */ @PostMapping("/casePay") - public String casePay(PayRequest request) { - return paymentService.casePay(request); + public AjaxResult casePay(@Validated @RequestBody CasePayDTO casePayDTO) { + return paymentService.casePay(casePayDTO); } - @PutMapping - public String payConfirm(){ - return paymentService.payConfirm(); + + /** + * 缴费确认 + * @param caseApplication + * @return + */ + @PutMapping("/confirm") + public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) { + return paymentService.confirmPayment(caseApplication); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CasePaymentMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CasePaymentMapper.java deleted file mode 100644 index b7d80fc..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CasePaymentMapper.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.ruoyi.system.mapper; - -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface CasePaymentMapper { - void queryPayList(); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java deleted file mode 100644 index ffc81c8..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICasePaymentService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.ruoyi.system.service; - -import com.ruoyi.dto.PayRequest; - -public interface ICasePaymentService { - /** - * 案件缴费 - * @param request - * @return - */ - String casePay(PayRequest request); - /** - * 查询缴费列表 - */ - String queryPayList(); - - String getPaymentListByCaseId(); - - String payConfirm(); - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java deleted file mode 100644 index 0a5c454..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CasePaymentServiceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.service.impl; - -import com.ruoyi.ElegentPay; -import com.ruoyi.constant.Platform; -import com.ruoyi.constant.TradeType; -import com.ruoyi.dto.PayRequest; -import com.ruoyi.dto.PayResponse; -import com.ruoyi.system.mapper.CasePaymentMapper; -import com.ruoyi.system.service.ICasePaymentService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class CasePaymentServiceImpl implements ICasePaymentService { - private final ElegentPay elegentPay; - private final CasePaymentMapper paymentMapper; - @Autowired - public CasePaymentServiceImpl(ElegentPay elegentPay,CasePaymentMapper paymentMapper ){ - this.elegentPay=elegentPay; - this.paymentMapper=paymentMapper; - } - @Override - public String casePay(PayRequest request) { - PayResponse payResponse = elegentPay.requestPay(request, TradeType.NATIVE, Platform.WX); - if (payResponse!=null){ - return payResponse.getCode_url(); - } - return null; - } - - @Override - public String queryPayList() { - paymentMapper.queryPayList(); - return null; - } - - @Override - public String getPaymentListByCaseId() { - return null; - } - - @Override - public String payConfirm() { - return null; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java new file mode 100644 index 0000000..8f2f20d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java @@ -0,0 +1,20 @@ +package com.ruoyi.wisdomarbitrate.domain.dto; + +import lombok.Data; + +/** + * 案件缴费传入参数 + */ +@Data +public class CasePayDTO { + private int totalFee; //订单金额 单位:分 + private String body;//商品描述 + /** + * 交易类型 native(扫码) / jsapi(小程序) / app / h5 + */ + private String tradeType; + /** + * 支付方式 wxpay(微信) alipay(支付宝) + */ + private String platform; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java new file mode 100644 index 0000000..fc2e24a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java @@ -0,0 +1,15 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.dto.PayRequest; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; + +public interface ICasePaymentService { + /** + * 案件缴费 + */ + AjaxResult casePay(CasePayDTO casePayDTO); + + AjaxResult confirmPayment(CaseApplication caseApplication); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java new file mode 100644 index 0000000..598e979 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -0,0 +1,48 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.ruoyi.CallBackService; +import com.ruoyi.ElegentPay; +import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.core.domain.AjaxResult; + +import com.ruoyi.dto.PayRequest; +import com.ruoyi.dto.PayResponse; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; +import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class CasePaymentServiceImpl implements ICasePaymentService { + private final ElegentPay elegentPay; + private final CaseApplicationMapper caseApplicationMapper; + + @Autowired + public CasePaymentServiceImpl(ElegentPay elegentPay + , CaseApplicationMapper caseApplicationMapper) { + this.elegentPay = elegentPay; + this.caseApplicationMapper = caseApplicationMapper; + } + + @Override + public AjaxResult casePay(CasePayDTO casePayDTO) { + PayRequest payRequest = new PayRequest(); + payRequest.setBody(casePayDTO.getBody()); + payRequest.setOrderSn(System.currentTimeMillis() + ""); + payRequest.setTotalFee(casePayDTO.getTotalFee()); + PayResponse response = elegentPay.requestPay(payRequest, casePayDTO.getTradeType(), casePayDTO.getPlatform()); + return AjaxResult.success(response); + } + + @Override + public AjaxResult confirmPayment(CaseApplication caseApplication) { + caseApplication.setCaseStatus(CaseApplicationConstants.EVIDENCE_CONFREMED); + int i = caseApplicationMapper.updataCaseApplication(caseApplication); + if (i > 0) { + return AjaxResult.success(); + } + return AjaxResult.error("暂无需要确认的缴费清单"); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/CasePaymentMapper.xml b/ruoyi-system/src/main/resources/mapper/system/CasePaymentMapper.xml deleted file mode 100644 index 6a77419..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/CasePaymentMapper.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - \ No newline at end of file From 60d2b490c2e66cd905212303f77714d7fe747012 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Tue, 12 Sep 2023 18:38:39 +0800 Subject: [PATCH 006/123] =?UTF-8?q?=E7=BC=B4=E8=B4=B9=E5=8F=8A=E7=BC=B4?= =?UTF-8?q?=E8=B4=B9=E7=A1=AE=E8=AE=A4=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 2 - ruoyi-common/pom.xml | 13 ++++ .../java/com/ruoyi/common/utils/SmsUtils.java | 66 ++++++++++++++++ .../domain/CasePaymentRecord.java | 33 ++++++++ .../domain/dto/CasePayDTO.java | 19 ++++- .../mapper/CasePaymentRecordMapper.java | 11 +++ .../impl/CallBackHandleServiceImpl.java | 35 +++++++++ .../service/impl/CasePaymentServiceImpl.java | 76 +++++++++++++++++-- .../CasePaymentRecordMapper.xml | 29 +++++++ 9 files changed, 272 insertions(+), 12 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 1ccaea8..d120476 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -3,7 +3,6 @@ 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.domain.entity.SysUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.SecurityUtils; @@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.*; import java.util.List; -import static com.ruoyi.common.core.domain.AjaxResult.error; @RestController diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 71fea1e..00240c2 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -126,6 +126,19 @@ javax.servlet-api + + org.projectlombok + lombok + 1.18.22 + + + + + com.tencentcloudapi + tencentcloud-sdk-java + 3.1.270 + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java new file mode 100644 index 0000000..d84faab --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java @@ -0,0 +1,66 @@ +package com.ruoyi.common.utils; + +import com.tencentcloudapi.common.Credential; +import com.tencentcloudapi.common.exception.TencentCloudSDKException; +import com.tencentcloudapi.sms.v20210111.SmsClient; +import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import lombok.var; + +import java.util.Objects; + +@Slf4j +public class SmsUtils { + private static final String SDK_APP_ID = "应用id"; + private static final String SECRET_ID = "API的SecretId"; + private static final String SECRET_KEY = "API的SecretKey"; + 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; + } + log.error("发送短信结果:", SendSmsResponse.toJsonString(res)); + + 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; + + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java new file mode 100644 index 0000000..f35b9ed --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java @@ -0,0 +1,33 @@ +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 extends BaseEntity { + 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; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java index 8f2f20d..a58518b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java @@ -1,14 +1,25 @@ package com.ruoyi.wisdomarbitrate.domain.dto; import lombok.Data; - /** * 案件缴费传入参数 */ @Data public class CasePayDTO { - private int totalFee; //订单金额 单位:分 - private String body;//商品描述 + /** + * 案件id + */ + private Long caseId; + + /** + * 订单金额 单位:分 + */ + private int totalFee; + + /** + * 描述 + */ + private String body; /** * 交易类型 native(扫码) / jsapi(小程序) / app / h5 */ @@ -17,4 +28,4 @@ public class CasePayDTO { * 支付方式 wxpay(微信) alipay(支付宝) */ private String platform; -} +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java new file mode 100644 index 0000000..0aa384a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java @@ -0,0 +1,11 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord; + +public interface CasePaymentRecordMapper { + int saveRecord(CasePaymentRecord casePaymentRecord); + + CasePaymentRecord queryRecord(String orderSn); + + void update(CasePaymentRecord casePaymentRecord); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java new file mode 100644 index 0000000..4812468 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java @@ -0,0 +1,35 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.ruoyi.CallBackService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 业务回调处理 + */ +@Component +@Slf4j +public class CallBackHandleServiceImpl implements CallBackService { + @Autowired + private CasePaymentServiceImpl casePaymentService; + @Override + public void successPay(String orderSn) { + casePaymentService.callback(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); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 598e979..dd02df0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -1,29 +1,41 @@ package com.ruoyi.wisdomarbitrate.service.impl; -import com.ruoyi.CallBackService; + + import com.ruoyi.ElegentPay; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; - +import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.dto.PayRequest; import com.ruoyi.dto.PayResponse; +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; -import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; +import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.mapper.CasePaymentRecordMapper; +import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + @Service public class CasePaymentServiceImpl implements ICasePaymentService { private final ElegentPay elegentPay; private final CaseApplicationMapper caseApplicationMapper; + private final CasePaymentRecordMapper casePaymentRecordMapper; + @Autowired public CasePaymentServiceImpl(ElegentPay elegentPay - , CaseApplicationMapper caseApplicationMapper) { + , CaseApplicationMapper caseApplicationMapper + , CasePaymentRecordMapper casePaymentRecordMapper) { this.elegentPay = elegentPay; this.caseApplicationMapper = caseApplicationMapper; + this.casePaymentRecordMapper = casePaymentRecordMapper; } @Override @@ -33,13 +45,65 @@ public class CasePaymentServiceImpl implements ICasePaymentService { payRequest.setOrderSn(System.currentTimeMillis() + ""); payRequest.setTotalFee(casePayDTO.getTotalFee()); PayResponse response = elegentPay.requestPay(payRequest, casePayDTO.getTradeType(), casePayDTO.getPlatform()); + if (response.getCode_url() == null) { + return AjaxResult.error(); + } + //缴费记录表里新增数据 + CasePaymentRecord casePaymentRecord = new CasePaymentRecord(); + casePaymentRecord.setCaseId(casePayDTO.getCaseId()); + casePaymentRecord.setOrderNumber(payRequest.getOrderSn()); + casePaymentRecord.setPaymentStatus(0); + int count = casePaymentRecordMapper.saveRecord(casePaymentRecord); + if (count < 1) { + return AjaxResult.error("请检查参数是否有误"); + } return AjaxResult.success(response); } + + public AjaxResult callback(String orderSn) { + //查询记录 + CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.queryRecord(orderSn); + if (casePaymentRecord == null) { + return AjaxResult.error("未查询到相关记录"); + } + Long caseId = casePaymentRecord.getCaseId(); + //更改记录表里的支付状态和支付时间 + casePaymentRecord.setPaymentStatus(1); + casePaymentRecord.setPaymentTime(new Date()); + casePaymentRecordMapper.update(casePaymentRecord); + //根据案件id查询案件信息 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(caseId); + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); + //修改案件状态 + caseApplicationMapper.submitCaseApplication(caseApplication); + //发送短信通知 + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + List caseAffiliates = caseApplication1.getCaseAffiliates();//获取案件关联人信息 + if (caseAffiliates!=null&&caseAffiliates.size()>0){ + for (CaseAffiliate caseAffiliate : caseAffiliates) { + request.setPhone(caseAffiliate.getContactTelphone()); + //获取身份类型 + int identityType = caseAffiliate.getIdentityType(); + if (identityType==1){ //申请人 + request.setTemplateId("申请人模板id"); //传入申请人模板id + // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 + request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"}); + } else { //被申请人 + request.setTemplateId("被申请人模板id"); + request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"}); + } + } + } + SmsUtils.sendSms(request); + return AjaxResult.success(); + } @Override public AjaxResult confirmPayment(CaseApplication caseApplication) { caseApplication.setCaseStatus(CaseApplicationConstants.EVIDENCE_CONFREMED); - int i = caseApplicationMapper.updataCaseApplication(caseApplication); + int i = caseApplicationMapper.submitCaseApplication(caseApplication); if (i > 0) { return AjaxResult.success(); } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml new file mode 100644 index 0000000..07c1f62 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml @@ -0,0 +1,29 @@ + + + + + INSERT INTO case_payment_record (case_id, order_number, payment_status) + VALUES (#{caseId}, #{orderNumber}, #{paymentStatus}) + + + update case_payment_record + + case_id= #{caseId}, + order_number = #{orderNumber}, + payment_time = #{paymentTime}, + payment_status = #{paymentStatus}, + + where id = #{id} + + + \ No newline at end of file From 30d6828707e66dc469022ad5c08591191e60d316 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Wed, 13 Sep 2023 19:08:38 +0800 Subject: [PATCH 007/123] =?UTF-8?q?=E8=AF=81=E6=8D=AE=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseEvidenceController.java | 58 ++++++++++ .../CasePaymentController.java | 2 +- .../wisdomarbitrate/domain/CaseAttach.java | 38 +++++++ .../domain/CasePaymentRecord.java | 10 +- .../domain/dto/CasePayDTO.java | 5 - .../domain/vo/CaseDetailVO.java | 56 ++++++++++ .../domain/vo/CaseEvidenceVO.java | 28 +++++ .../mapper/CaseAttachMapper.java | 7 ++ .../mapper/CaseEvidenceMapper.java | 15 +++ .../mapper/CasePaymentRecordMapper.java | 2 +- .../service/ICaseEvidenceService.java | 16 +++ .../service/impl/CaseEvidenceServiceImpl.java | 101 ++++++++++++++++++ .../service/impl/CasePaymentServiceImpl.java | 59 +++++----- .../wisdomarbitrate/CaseAttachMapper.xml | 10 ++ .../wisdomarbitrate/CaseEvidenceMapper.xml | 12 +++ .../CasePaymentRecordMapper.xml | 20 +++- 16 files changed, 400 insertions(+), 39 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java rename ruoyi-admin/src/main/java/com/ruoyi/web/controller/{payment => wisdomarbitrate}/CasePaymentController.java (96%) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseDetailVO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java new file mode 100644 index 0000000..8bf330d --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -0,0 +1,58 @@ +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.vo.CaseEvidenceVO; +import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * 案件证据上传 + */ +@RestController +@RequestMapping("/evidence") +public class CaseEvidenceController extends BaseController { + private final ICaseEvidenceService caseEvidenceService; + @Autowired + public CaseEvidenceController(ICaseEvidenceService caseEvidenceService) { + this.caseEvidenceService = caseEvidenceService; + } + /** + * 查询被申请人案件列表 + * @param identityNum 身份证号 + * @return + */ + @GetMapping("/respondent") + public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum + ,Integer pageNum,Integer pageSize){ + startPage(); + List list = caseEvidenceService.getCaseListByRespondent(identityNum); + return getDataTable(list); + } + /** + * 根据案件id查询案件详情 + * @param id + * @return + */ + @GetMapping("/{id}") + public AjaxResult getCaseDetailsById(@PathVariable Long id ){ + return caseEvidenceService.getCaseDetailsById(id); + } + /** + * 案件证据上传 + * @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){ + return caseEvidenceService.uploadEvidence(file,annexType,id); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java similarity index 96% rename from ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java index cba05bd..712ac1f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/payment/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java @@ -1,4 +1,4 @@ -package com.ruoyi.web.controller.payment; +package com.ruoyi.web.controller.wisdomarbitrate; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java new file mode 100644 index 0000000..23dc67c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -0,0 +1,38 @@ +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; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java index f35b9ed..4bae1db 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java @@ -7,7 +7,7 @@ import lombok.Data; import java.util.Date; @Data -public class CasePaymentRecord extends BaseEntity { +public class CasePaymentRecord { private static final long serialVersionUID = 1L; /** * 主键 @@ -30,4 +30,12 @@ public class CasePaymentRecord extends BaseEntity { */ @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; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java index a58518b..933f300 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java @@ -15,11 +15,6 @@ public class CasePayDTO { * 订单金额 单位:分 */ private int totalFee; - - /** - * 描述 - */ - private String body; /** * 交易类型 native(扫码) / jsapi(小程序) / app / h5 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseDetailVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseDetailVO.java new file mode 100644 index 0000000..7a3420d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseDetailVO.java @@ -0,0 +1,56 @@ +package com.ruoyi.wisdomarbitrate.domain.vo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.Date; + +@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; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java new file mode 100644 index 0000000..7dca799 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java @@ -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; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java new file mode 100644 index 0000000..5958b42 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -0,0 +1,7 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; + +public interface CaseAttachMapper { + int save(CaseAttach caseAttach); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java new file mode 100644 index 0000000..0c8b339 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java @@ -0,0 +1,15 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface CaseEvidenceMapper { + List getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum + , @Param(value = "caseStatus" ) Integer caseStatus + , @Param(value = "identityType" ) Integer identityType); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java index 0aa384a..596abf5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java @@ -5,7 +5,7 @@ import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord; public interface CasePaymentRecordMapper { int saveRecord(CasePaymentRecord casePaymentRecord); - CasePaymentRecord queryRecord(String orderSn); + CasePaymentRecord queryRecord(String orderNumber); void update(CasePaymentRecord casePaymentRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java new file mode 100644 index 0000000..be6acb2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java @@ -0,0 +1,16 @@ +package com.ruoyi.wisdomarbitrate.service; + + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +public interface ICaseEvidenceService { + List getCaseListByRespondent(String identityNum); + + AjaxResult getCaseDetailsById(Long id); + + AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java new file mode 100644 index 0000000..ee9b698 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseDetailVO; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; +import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseEvidenceMapper; +import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +@Service +public class CaseEvidenceServiceImpl implements ICaseEvidenceService { + @Autowired + private CaseEvidenceMapper caseEvidenceMapper; + @Autowired + private CaseAffiliateMapper caseAffiliateMapper; + @Autowired + private CaseApplicationMapper caseApplicationMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; + @Override + public List getCaseListByRespondent(String identityNum) { + int caseStatus = 3; + int identityType = 2; + List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatus,identityType); + if (caseListByRespondent!= null && caseListByRespondent.size()>0){ + for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { + //根据案件id查询申请人姓名 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); + caseAffiliate.setIdentityType(1); + String name = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate).get(0).getName(); + caseEvidenceVO.setApplicantName(name); + } + return caseListByRespondent; + } + return null; + } + + @Override + public AjaxResult getCaseDetailsById(Long id) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplication1!=null){ + CaseDetailVO caseDetailVO = new CaseDetailVO(); + BeanUtils.copyProperties(caseApplication1,caseDetailVO); + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(id); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + for (CaseAffiliate affiliate : caseAffiliates) { + if (affiliate.getIdentityType() == 1){ //申请人 + caseDetailVO.setApplicantName(affiliate.getName()); + }else { + caseDetailVO.setRespondentName(affiliate.getName()); + } + } + return AjaxResult.success(caseDetailVO); + } + + return null; + } + + @Override + public AjaxResult uploadEvidence(MultipartFile file , Integer annexType, Long id) { + if (file.isEmpty()) { + return AjaxResult.error("请选择要上传的文件"); + } + try { + String filePath = RuoYiConfig.getUploadPath(); + // 上传并返回新文件名称 + String fileNewName = FileUploadUtils.upload(filePath, file); + CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) + .annexName(fileNewName) + .annexPath(filePath) + .annexType(annexType) + .build(); + int count = caseAttachMapper.save(caseAttach); + if (count>0){ + return AjaxResult.success("上传成功"); + } + } catch (IOException e) { + e.printStackTrace(); + } + + return AjaxResult.error("上传失败"); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index dd02df0..2f491dc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -12,6 +12,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; +import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; import com.ruoyi.wisdomarbitrate.mapper.CasePaymentRecordMapper; import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; @@ -27,21 +28,23 @@ public class CasePaymentServiceImpl implements ICasePaymentService { private final ElegentPay elegentPay; private final CaseApplicationMapper caseApplicationMapper; private final CasePaymentRecordMapper casePaymentRecordMapper; - + private final CaseAffiliateMapper caseAffiliateMapper; @Autowired public CasePaymentServiceImpl(ElegentPay elegentPay , CaseApplicationMapper caseApplicationMapper - , CasePaymentRecordMapper casePaymentRecordMapper) { + , CasePaymentRecordMapper casePaymentRecordMapper + , CaseAffiliateMapper caseAffiliateMapper) { this.elegentPay = elegentPay; this.caseApplicationMapper = caseApplicationMapper; this.casePaymentRecordMapper = casePaymentRecordMapper; + this.caseAffiliateMapper = caseAffiliateMapper; } @Override public AjaxResult casePay(CasePayDTO casePayDTO) { PayRequest payRequest = new PayRequest(); - payRequest.setBody(casePayDTO.getBody()); + payRequest.setBody("案件缴费"); payRequest.setOrderSn(System.currentTimeMillis() + ""); payRequest.setTotalFee(casePayDTO.getTotalFee()); PayResponse response = elegentPay.requestPay(payRequest, casePayDTO.getTradeType(), casePayDTO.getPlatform()); @@ -53,6 +56,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecord.setCaseId(casePayDTO.getCaseId()); casePaymentRecord.setOrderNumber(payRequest.getOrderSn()); casePaymentRecord.setPaymentStatus(0); + casePaymentRecord.setCreateTime(new Date()); int count = casePaymentRecordMapper.saveRecord(casePaymentRecord); if (count < 1) { return AjaxResult.error("请检查参数是否有误"); @@ -61,9 +65,9 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } - public AjaxResult callback(String orderSn) { + public AjaxResult callback(String orderNumber) { //查询记录 - CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.queryRecord(orderSn); + CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.queryRecord(orderNumber); if (casePaymentRecord == null) { return AjaxResult.error("未查询到相关记录"); } @@ -71,6 +75,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { //更改记录表里的支付状态和支付时间 casePaymentRecord.setPaymentStatus(1); casePaymentRecord.setPaymentTime(new Date()); + casePaymentRecord.setUpdateTime(new Date()); casePaymentRecordMapper.update(casePaymentRecord); //根据案件id查询案件信息 CaseApplication caseApplication = new CaseApplication(); @@ -78,26 +83,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); //修改案件状态 - caseApplicationMapper.submitCaseApplication(caseApplication); - //发送短信通知 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - List caseAffiliates = caseApplication1.getCaseAffiliates();//获取案件关联人信息 - if (caseAffiliates!=null&&caseAffiliates.size()>0){ - for (CaseAffiliate caseAffiliate : caseAffiliates) { - request.setPhone(caseAffiliate.getContactTelphone()); - //获取身份类型 - int identityType = caseAffiliate.getIdentityType(); - if (identityType==1){ //申请人 - request.setTemplateId("申请人模板id"); //传入申请人模板id - // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 - request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"}); - } else { //被申请人 - request.setTemplateId("被申请人模板id"); - request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"}); - } - } - } - SmsUtils.sendSms(request); + caseApplicationMapper.submitCaseApplication(caseApplication1); return AjaxResult.success(); } @Override @@ -105,7 +91,28 @@ public class CasePaymentServiceImpl implements ICasePaymentService { caseApplication.setCaseStatus(CaseApplicationConstants.EVIDENCE_CONFREMED); int i = caseApplicationMapper.submitCaseApplication(caseApplication); if (i > 0) { - return AjaxResult.success(); + //发送短信通知 + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseApplication.getId()); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 + if (caseAffiliates != null && caseAffiliates.size() > 0) { + for (CaseAffiliate affiliate : caseAffiliates) { + request.setPhone(affiliate.getContactTelphone()); + //获取身份类型 + int identityType = affiliate.getIdentityType(); + if (identityType == 1) { //申请人 + request.setTemplateId("申请人模板id"); //传入申请人模板id + // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 + request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"}); + } else { //被申请人 + request.setTemplateId("被申请人模板id"); + request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"}); + } + } + //SmsUtils.sendSms(request); + return AjaxResult.success(); + } } return AjaxResult.error("暂无需要确认的缴费清单"); } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml new file mode 100644 index 0000000..e60f8be --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -0,0 +1,10 @@ + + + + + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note) + VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note}) + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml new file mode 100644 index 0000000..525820f --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml index 07c1f62..a50bb99 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml @@ -3,9 +3,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + + + + + + + + - INSERT INTO case_payment_record (case_id, order_number, payment_status) - VALUES (#{caseId}, #{orderNumber}, #{paymentStatus}) + INSERT INTO case_payment_record (case_id, order_number, payment_status , create_time) + VALUES (#{caseId}, #{orderNumber}, #{paymentStatus},#{createTime}) update case_payment_record @@ -14,15 +23,16 @@ order_number = #{orderNumber}, payment_time = #{paymentTime}, payment_status = #{paymentStatus}, + update_time = #{updateTime}, where id = #{id} - select c.id ,c.case_id ,c.order_number ,c.payment_time ,c.create_time ,c.update_time ,c.payment_status from case_payment_record c - - AND c.order_number = #{orderSn} + + AND c.order_number = #{orderNumber} From 891c67f39ff4950bb7895f6fb8d9d66ed1c8e44f Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Thu, 14 Sep 2023 18:40:44 +0800 Subject: [PATCH 008/123] =?UTF-8?q?=E7=AB=8B=E6=A1=88=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E7=BB=84=E5=BA=AD=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/ArbitratorController.java | 42 ++++ .../CaseApplicationController.java | 52 ++++- .../IdentityAuthenticationController.java | 37 ++++ ruoyi-common/pom.xml | 7 + .../constant/CaseApplicationConstants.java | 29 ++- .../wisdomarbitrate/domain/Arbitrator.java | 111 ++++++++++ .../domain/CaseApplication.java | 189 +++++++++++++++++- .../domain/IdentityAuthentication.java | 63 ++++++ .../mapper/ArbitratorMapper.java | 10 + .../mapper/IdentityAuthenticationMapper.java | 4 + .../service/IArbitratorService.java | 12 ++ .../service/ICaseApplicationService.java | 6 + .../IdentityAuthenticationService.java | 9 + .../service/impl/ArbitratorServiceImpl.java | 28 +++ .../impl/CaseApplicationServiceImpl.java | 166 ++++++++++++++- .../IdentityAuthenticationServiceImpl.java | 98 +++++++++ .../wisdomarbitrate/ArbitratorMapper.xml | 49 +++++ .../wisdomarbitrate/CaseApplicationMapper.xml | 5 +- .../IdentityAuthenticationMapper.xml | 15 ++ 19 files changed, 921 insertions(+), 11 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java new file mode 100644 index 0000000..183f294 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java @@ -0,0 +1,42 @@ +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.domain.CaseApplication; +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 list = arbitratorService.selectArbitratorList(arbitrator); + return getDataTable(list); + } + + + + + + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 1ccaea8..4c0ef36 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -15,7 +15,11 @@ 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; import static com.ruoyi.common.core.domain.AjaxResult.error; @@ -27,12 +31,13 @@ public class CaseApplicationController extends BaseController { @Autowired private ICaseApplicationService caseApplicationService; + /** * 查询立案数据 */ @PreAuthorize("@ss.hasPermi('caseApplication:list')") - @PostMapping("/list") - public TableDataInfo list(@Validated @RequestBody CaseApplication caseApplication) + @GetMapping("/list") + public TableDataInfo list(CaseApplication caseApplication) { startPage(); List list = caseApplicationService.selectCaseApplicationList(caseApplication); @@ -102,6 +107,49 @@ public class CaseApplicationController extends BaseController { return success(caseApplicationselect); } + /** + * 立案申请导入模板下载 + */ + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) + { + ExcelUtil util = new ExcelUtil(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 util = new ExcelUtil(CaseApplication.class); + List 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:pendingAppointArbotrar')") + @Log(title = "是否指派仲裁员", businessType = BusinessType.UPDATE) + @PostMapping("/pendingAppointArbotrar") + public AjaxResult pendingAppointArbotrar(@Validated @RequestBody CaseApplication caseApplication) + { + return toAjax(caseApplicationService.pendingAppointArbotrar(caseApplication)); + } + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java new file mode 100644 index 0000000..b5a9f49 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java @@ -0,0 +1,37 @@ +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; + + /** + * 查询身份证信息 + */ + @PostMapping("/selectIdentityInformation") + public AjaxResult selectIdentityInformation() + { + IdentityAuthentication identityAuthentication = identityAuthenticationService.selectIdentityInformation(); + return success(identityAuthentication); + } + + + + + + + +} diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 71fea1e..c427ae5 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -126,6 +126,13 @@ javax.servlet-api + + com.tencentcloudapi + tencentcloud-sdk-java-ocr + 3.1.701 + + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java index 8f338f3..23f4e7c 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java @@ -10,10 +10,35 @@ public class CaseApplicationConstants { public static final int PENDING_PAYMENT = 1; /** 待缴费确认 */ public static final int PENDING_PAYMENT_CONFIRM = 2; + /** 待确认是否应诉 */ + public static final int CONFIRMDED_RESPOND = 3; /** 待确认证据 */ - public static final int EVIDENCE_CONFREMED = 3; + public static final int CONFIRMDED_EVIDENCE = 4; + /** 待确定是否指派仲裁员 */ + public static final int PENDING_APPOINT_ARBOTRATAR = 5; /** 待组庭 */ - public static final int PENDING_TRIAL = 4; + public static final int PENDING_TRIAL = 6; + /** 待组庭确定 */ + public static final int CONFIRMDED_PENDING_TRIAL = 7; + /** 待组庭审核 */ + public static final int CONFIRMDED_PENDING_TRIAL_SUBMMIT = 8; + /** 待选择仲裁方式 */ + public static final int SELECTED_ARBITRATION_METHOD = 9; + /** 待开庭 */ + public static final int PENDING_OPENCOURT = 10; + /** 待生成仲裁文书 */ + public static final int GENERATED_ARBITRATION = 11; + /** 待确认仲裁文书 */ + public static final int CONFIRMED_ARBITRATION = 12; + /** 待仲裁文书用印 */ + public static final int ARBITRATED_SEAL = 13; + /** 待仲裁文书用印审核 */ + public static final int ARBITRATED_SEAL_REVIEW = 14; + /** 待仲裁文书送达 */ + public static final int ARBITRATION_DELIVERY = 15; + /** 待案件归档*/ + public static final int CASE_FILING = 16; + diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java new file mode 100644 index 0000000..b35d5aa --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java @@ -0,0 +1,111 @@ +package com.ruoyi.wisdomarbitrate.domain; + +import com.ruoyi.common.core.domain.BaseEntity; + +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; + + 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; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 91976d3..a26f262 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excels; import com.ruoyi.common.core.domain.BaseEntity; import java.math.BigDecimal; import java.util.Date; @@ -11,17 +12,15 @@ public class CaseApplication extends BaseEntity { private static final long serialVersionUID = 1L; /** ID */ - @Excel(name = "ID", cellType = Excel.ColumnType.NUMERIC, prompt = "ID") private Long id; /** 案件编号 */ @Excel(name = "案件编号") private String caseNum; - /** 合同编号 */ - @Excel(name = "合同编号") - private String contractNumber; /** 案件标的 */ @Excel(name = "案件标的") private BigDecimal caseSubjectAmount; + + /** 立案日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date registerDate; @@ -36,10 +35,15 @@ public class CaseApplication extends BaseEntity { private String arbitratClaims; /** 借款开始日期 */ @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; @@ -59,9 +63,179 @@ public class CaseApplication extends BaseEntity { /** 在线视频人员 */ private String onlineVideoPerson; + /** 仲裁员id */ + private String arbitratorId; + /** 仲裁员名称 */ + private String arbitratorName; + + 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 caseAffiliates; + /** 案件仲裁员 */ + private List arbitrators; + + public List getArbitrators() { + return arbitrators; + } + + public void setArbitrators(List arbitrators) { + this.arbitrators = arbitrators; + } + + /** 身份类型 */ + @Excel(name = "身份类型") + 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; + + 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; + } + + /** 联系地址 */ + @Excel(name = "代理人联系地址") + private String contactAddressAgent; + + public Long getId() { @@ -215,4 +389,11 @@ public class CaseApplication extends BaseEntity { public void setCaseAffiliates(List caseAffiliates) { this.caseAffiliates = caseAffiliates; } + + + + + + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java new file mode 100644 index 0000000..f279419 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java @@ -0,0 +1,63 @@ +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 int certificationStatus; + + 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; + } + + public int getCertificationStatus() { + return certificationStatus; + } + + public void setCertificationStatus(int certificationStatus) { + this.certificationStatus = certificationStatus; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java new file mode 100644 index 0000000..b3bcbaf --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java @@ -0,0 +1,10 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; + +import java.util.List; + +public interface ArbitratorMapper { + List selectArbitratorList(Arbitrator arbitrator); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java new file mode 100644 index 0000000..20e5f6f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java @@ -0,0 +1,4 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +public interface IdentityAuthenticationMapper { +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java new file mode 100644 index 0000000..ee7a8ab --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java @@ -0,0 +1,12 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; + +import java.util.List; + +public interface IArbitratorService { + List selectArbitratorList(Arbitrator arbitrator); + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 97dfe2f..2ccdf87 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -19,4 +19,10 @@ public interface ICaseApplicationService { int deletecaseApplicationByIds(CaseApplication caseApplication); CaseApplication selectCaseApplication(CaseApplication caseApplication); + + String importCaseApplication(List caseApplicationList, String operName); + + int pendTral(CaseApplication caseApplication); + + int pendingAppointArbotrar(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java new file mode 100644 index 0000000..fdab196 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java @@ -0,0 +1,9 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; + +public interface IdentityAuthenticationService { + + + IdentityAuthentication selectIdentityInformation(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java new file mode 100644 index 0000000..78f9e4b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java @@ -0,0 +1,28 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; +import com.ruoyi.wisdomarbitrate.mapper.ArbitratorMapper; +import com.ruoyi.wisdomarbitrate.service.IArbitratorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ArbitratorServiceImpl implements IArbitratorService { + @Autowired + private ArbitratorMapper arbitratorMapper; + + + @Override + public List selectArbitratorList(Arbitrator arbitrator) { + return arbitratorMapper.selectArbitratorList(arbitrator); + + } + + + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 75980b1..b37aefd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1,6 +1,10 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.bean.BeanUtils; +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; @@ -11,9 +15,15 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Comparator; import java.util.List; +import java.util.TreeSet; +import java.util.stream.Collectors; import static com.ruoyi.common.core.domain.AjaxResult.error; +import static java.util.stream.Collectors.collectingAndThen; +import static java.util.stream.Collectors.toCollection; @Service public class CaseApplicationServiceImpl implements ICaseApplicationService { @@ -89,10 +99,162 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); - + if(caseApplicationselect!=null){ + caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); + } return caseApplicationselect; } + @Override + @Transactional + public String importCaseApplication(List caseApplicationList, String operName) { + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + int successNum = 0; + int failureNum = 0; + if(caseApplicationList!=null&&caseApplicationList.size()>0){ + List caseApplicationListinsert = new ArrayList<>(); + for (int i = 0; i < caseApplicationList.size(); i++){ + CaseApplication caseApplication = caseApplicationList.get(i); + //赋值CaseApplication的案件关联人信息 + List caseAffiliatesnew = new ArrayList<>(); + assignmentCaseAffiliates(caseApplication,caseAffiliatesnew); + + int caseApplicationCount = selectCaseApplicationCount(caseApplication); + if(caseApplicationCount>0){ + failureNum++; + failureMsg.append("
" + failureNum + "、立案编号 " + caseApplication.getCaseNum() + " 已存在"); + }else { + caseApplicationListinsert.add(caseApplication); + } + } + if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ + List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( + collectingAndThen( + toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))), + ArrayList::new)); + + + //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 + if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ + List caseApplicationNewList = new ArrayList<>(); + for (int i = 0; i < caseApplicationListinsertDiffer.size(); i++){ + CaseApplication caseApplicationinsertDiffer = caseApplicationListinsertDiffer.get(i); + List caseAffiliatesnew = new ArrayList<>(); + CaseApplication caseApplicationNew = new CaseApplication(); + copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew); + if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ + for (int j = 0; j < caseApplicationListinsert.size(); j++){ + CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); + + if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&& + caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){ + + caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); + } + } + caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); + caseApplicationNewList.add(caseApplicationNew); + } + + for (int k = 0; k < caseApplicationNewList.size(); k++){ + CaseApplication caseApplicationItera = caseApplicationNewList.get(k); + // 新增立案信息 + caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); + List caseAffiliates = caseApplicationItera.getCaseAffiliates(); + if(caseAffiliates!=null&&caseAffiliates.size()>0){ + for (CaseAffiliate caseAffiliate : caseAffiliates){ + caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); + } + caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); + } + successNum++; + successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); + } + + } + + } + + } + + }else { + throw new ServiceException("导入立案申请数据不能为空!"); + } + + return successMsg.toString(); + } + + @Override + @Transactional + public int pendTral(CaseApplication caseApplication) { + List arbitrators = caseApplication.getArbitrators(); + int rows = 0; + if(arbitrators!=null&&arbitrators.size()>0){ + List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); + List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); + String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); + String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); + caseApplication.setArbitratorId(idstr); + caseApplication.setArbitratorName(arbitratorNamestr); + caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + } + + + return rows; + } + + @Override + @Transactional + public int pendingAppointArbotrar(CaseApplication caseApplication) { + int pendingAppointArbotrar = caseApplication.getPendingAppointArbotrar(); + List arbitrators = caseApplication.getArbitrators(); + int rows = 0; + if(pendingAppointArbotrar==1){ + if(arbitrators!=null&&arbitrators.size()>0){ + List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); + List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); + String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); + String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); + caseApplication.setArbitratorId(idstr); + caseApplication.setArbitratorName(arbitratorNamestr); + caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + caseApplication.setPendingAppointArbotrar(1); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + } + + }else { + caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); + caseApplication.setPendingAppointArbotrar(2); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + + } + + return rows; + + } + + private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew) { + CaseAffiliate caseAffiliate = new CaseAffiliate(); +// BeanUtils.copyBeanProp(caseApplication,caseAffiliate); + BeanUtils.copyBeanProp(caseAffiliate,caseApplication); + caseAffiliatesnew.add(caseAffiliate); + caseApplication.setCaseAffiliates(caseAffiliatesnew); + } + + private void copyCaseApplication(CaseApplication caseApplicationinsertDiffer, CaseApplication caseApplicationNew) { + caseApplicationNew.setArbitratClaims(caseApplicationinsertDiffer.getArbitratClaims()); + caseApplicationNew.setCaseNum(caseApplicationinsertDiffer.getCaseNum()); + caseApplicationNew.setCaseSubjectAmount(caseApplicationinsertDiffer.getCaseSubjectAmount()); + caseApplicationNew.setLoanStartDate(caseApplicationinsertDiffer.getLoanStartDate()); + caseApplicationNew.setLoanEndDate(caseApplicationinsertDiffer.getLoanEndDate()); + caseApplicationNew.setContractNumber(caseApplicationinsertDiffer.getContractNumber()); + caseApplicationNew.setClaimInterestOwed(caseApplicationinsertDiffer.getClaimInterestOwed()); + caseApplicationNew.setClaimPrinciOwed(caseApplicationinsertDiffer.getClaimPrinciOwed()); + caseApplicationNew.setClaimLiquidDamag(caseApplicationinsertDiffer.getClaimLiquidDamag()); + } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java new file mode 100644 index 0000000..c01a3e1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -0,0 +1,98 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; +import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; +import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService; +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.ocr.v20181119.OcrClient; +import com.tencentcloudapi.ocr.v20181119.models.RecognizeTableAccurateOCRRequest; +import com.tencentcloudapi.ocr.v20181119.models.RecognizeTableAccurateOCRResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Base64; + +@Service +public class IdentityAuthenticationServiceImpl implements IdentityAuthenticationService { + + @Value("${identityAuthentication.credentialSecretId}") + private String credentialSecretId; + @Value("${identityAuthentication.credentialSecretKey}") + private String credentialSecretKey; + + @Autowired + private IdentityAuthenticationMapper identityAuthenticationMapper; + + private static final Logger log = LoggerFactory.getLogger(IdentityAuthenticationServiceImpl.class); + + @Override + public IdentityAuthentication selectIdentityInformation() { + IdentityAuthentication identityAuthentication = new IdentityAuthentication(); + try{ + Credential credIdentityAuthentication = new Credential(credentialSecretId, credentialSecretKey); + HttpProfile httpProfileIdentityAuthentication = new HttpProfile(); + httpProfileIdentityAuthentication.setEndpoint("ocr.tencentcloudapi.com"); + String imagePathIdentityAuthentication = "本地png/jpg文件的绝对地址"; + InputStream inputStreamIdentityAuthentication = null; + byte[] buffer = null; + //读取图片字节数组 + try { + inputStreamIdentityAuthentication = new FileInputStream(imagePathIdentityAuthentication); + int count = 0; + while (count == 0) { + count = inputStreamIdentityAuthentication.available(); + } + buffer = new byte[count]; + inputStreamIdentityAuthentication.read(buffer); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (inputStreamIdentityAuthentication != null) { + try { + // 关闭inputStream流 + inputStreamIdentityAuthentication.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + String imageBase64IdentityAuthentication = Base64.getEncoder().encodeToString(buffer); + + ClientProfile clientProfileIdentityAuthentication = new ClientProfile(); + clientProfileIdentityAuthentication.setHttpProfile(httpProfileIdentityAuthentication); + OcrClient clientIdentityAuthentication = new OcrClient(credIdentityAuthentication, "ap-shanghai", clientProfileIdentityAuthentication); + RecognizeTableAccurateOCRRequest reqIdentityAuthentication = new RecognizeTableAccurateOCRRequest(); + reqIdentityAuthentication.setImageBase64(imageBase64IdentityAuthentication); + RecognizeTableAccurateOCRResponse respIdentityAuthentication = clientIdentityAuthentication.RecognizeTableAccurateOCR(reqIdentityAuthentication); + String stringRes = RecognizeTableAccurateOCRResponse.toJsonString(respIdentityAuthentication); + JSONObject stringObjectRes = (JSONObject) JSON.parse(stringRes); + JSONObject stringres = (JSONObject) stringObjectRes.get("Response"); + + + identityAuthentication.setName(stringres.get("name").toString()); + identityAuthentication.setIdentityNo(stringres.get("IdNum").toString()); + +// System.out.println(RecognizeTableAccurateOCRResponse.toJsonString(respIdentityAuthentication); + + } catch (TencentCloudSDKException e) { + log.error("身份认证失败", e); + } + + return identityAuthentication; + + } +} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml new file mode 100644 index 0000000..d184338 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index c2f7aba..a2d082c 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -135,7 +135,10 @@ update case_application - case_status = #{caseStatus} + case_status = #{caseStatus}, + arbitrator_id = #{arbitratorId}, + arbitrator_name = #{arbitratorName}, + pending_appoint_arbotrar = #{pendingAppointArbotrar}, where id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml new file mode 100644 index 0000000..12c23e6 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file From 3028291cce98e9ef55a86c7d69c66f292e7c4dd4 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Thu, 14 Sep 2023 18:42:55 +0800 Subject: [PATCH 009/123] =?UTF-8?q?=E6=88=AA=E6=AD=A29.14=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseEvidenceController.java | 61 +++++++++++++---- .../src/main/resources/application.yml | 4 +- .../java/com/ruoyi/common/utils/SmsUtils.java | 37 +++++++--- .../domain/vo/CaseDetailVO.java | 11 +++ .../mapper/CaseAttachMapper.java | 4 ++ .../mapper/CaseEvidenceMapper.java | 2 +- .../service/ICaseEvidenceService.java | 7 +- .../service/impl/CaseEvidenceServiceImpl.java | 67 +++++++++++++------ .../service/impl/CasePaymentServiceImpl.java | 2 +- .../wisdomarbitrate/CaseAttachMapper.xml | 13 ++++ .../wisdomarbitrate/CaseEvidenceMapper.xml | 24 +++++-- 11 files changed, 183 insertions(+), 49 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index 8bf330d..aae23cb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import java.util.ArrayList; import java.util.List; /** @@ -19,40 +20,76 @@ import java.util.List; @RequestMapping("/evidence") public class CaseEvidenceController extends BaseController { private final ICaseEvidenceService caseEvidenceService; + @Autowired public CaseEvidenceController(ICaseEvidenceService caseEvidenceService) { this.caseEvidenceService = caseEvidenceService; } - /** + + /* *//** * 查询被申请人案件列表 + * * @param identityNum 身份证号 * @return - */ + *//* @GetMapping("/respondent") - public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum - ,Integer pageNum,Integer pageSize){ + public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum) { startPage(); List list = caseEvidenceService.getCaseListByRespondent(identityNum); - return getDataTable(list); - } + if (list != null) { + return getDataTable(list); + } + return getDataTable(new ArrayList<>()); + }*/ + /** - * 根据案件id查询案件详情 + * 被申请人根据案件id查询案件详情 + * * @param id * @return */ @GetMapping("/{id}") - public AjaxResult getCaseDetailsById(@PathVariable Long id ){ + public AjaxResult getCaseDetailsById(@PathVariable Long id) { return caseEvidenceService.getCaseDetailsById(id); } + /** * 案件证据上传 - * @param file 附件 + * + * @param file 附件 * @param annexType 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5) - * @param id 案件申请id + * @param id 案件申请id * @return */ @PostMapping("/upload") - public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file , Integer annexType , Long id){ - return caseEvidenceService.uploadEvidence(file,annexType,id); + public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) { + return caseEvidenceService.uploadEvidence(file, annexType, id); } + + /* @GetMapping("/applicant") + public TableDataInfo getCaseListByApplicant(@RequestParam String identityNum) { + startPage(); + List list = caseEvidenceService.getCaseListByApplicant(identityNum); + if (list != null) { + return getDataTable(list); + } + return getDataTable(new ArrayList<>()); + }*/ + + /** + * 查询当前用户案件列表 + * @param identityNum + * @return + */ + @GetMapping("/all") + public TableDataInfo getCaseListAll(@RequestParam String identityNum) { + startPage(); + List list = caseEvidenceService.getCaseListAll(identityNum); + if (list != null) { + return getDataTable(list); + } + return getDataTable(new ArrayList<>()); + } + + } diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index e032281..598f780 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -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 字符验证 @@ -142,5 +142,5 @@ elegent: appId: 2021003141676135 callback: domain: http://121.40.189.20:9000/ - watch: true + watch: false cycle: 10 \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java index d84faab..55b9c63 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java @@ -2,8 +2,14 @@ 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; @@ -12,21 +18,26 @@ import java.util.Objects; @Slf4j public class SmsUtils { - private static final String SDK_APP_ID = "应用id"; - private static final String SECRET_ID = "API的SecretId"; - private static final String SECRET_KEY = "API的SecretKey"; - private static final String SIGN_NAME = "签名内容"; + //应用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); + 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.setSmsSdkAppId(SDK_APP_ID ); req.setSignName(SIGN_NAME); req.setTemplateId(request.getTemplateId()); req.setTemplateParamSet(request.getTemplateParamSet()); - SendSmsResponse res = null; try { res = client.SendSms(req); @@ -34,14 +45,14 @@ public class SmsUtils { log.error("发送短信出错:", e); return Boolean.FALSE; } - log.error("发送短信结果:", SendSmsResponse.toJsonString(res)); + 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; } - /** * 参数对象 */ @@ -63,4 +74,12 @@ public class SmsUtils { private String[] templateParamSet; } + + public static void main(String[] args) { + SendSmsRequest sendSmsRequest = new SendSmsRequest(); + sendSmsRequest.setPhone("15029925289"); + sendSmsRequest.setTemplateId("1927509"); + sendSmsRequest.setTemplateParamSet(new String[]{"用户"}); + SmsUtils.sendSms(sendSmsRequest); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseDetailVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseDetailVO.java index 7a3420d..b67c73f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseDetailVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseDetailVO.java @@ -1,5 +1,6 @@ package com.ruoyi.wisdomarbitrate.domain.vo; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -7,6 +8,7 @@ import lombok.NoArgsConstructor; import java.math.BigDecimal; import java.util.Date; +import java.util.List; @Data @Builder @@ -53,4 +55,13 @@ public class CaseDetailVO { * 申请人主张违约金 */ private BigDecimal claimLiquidDamag; + + /** + * 证据材料 + */ + private List evidenceMaterialList; + /** + * 当前登录人身份类型 + */ + private Integer identityType; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 5958b42..03ea3b2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -2,6 +2,10 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import java.util.List; + public interface CaseAttachMapper { int save(CaseAttach caseAttach); + + List queryAnnexPathByCaseId(Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java index 0c8b339..12a0459 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java @@ -10,6 +10,6 @@ import java.util.List; @Mapper public interface CaseEvidenceMapper { List getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum - , @Param(value = "caseStatus" ) Integer caseStatus + , @Param(value = "caseStatusList") List caseStatusList , @Param(value = "identityType" ) Integer identityType); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java index be6acb2..66882a6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java @@ -8,9 +8,14 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; public interface ICaseEvidenceService { - List getCaseListByRespondent(String identityNum); + // List getCaseListByRespondent(String identityNum); AjaxResult getCaseDetailsById(Long id); AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id); + + //List getCaseListByApplicant(String identityNum); + + List getCaseListAll(String identityNum); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index ee9b698..2212413 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -19,6 +19,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.util.Arrays; import java.util.List; @Service @@ -31,24 +32,10 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { private CaseApplicationMapper caseApplicationMapper; @Autowired private CaseAttachMapper caseAttachMapper; - @Override + /* @Override public List getCaseListByRespondent(String identityNum) { - int caseStatus = 3; - int identityType = 2; - List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatus,identityType); - if (caseListByRespondent!= null && caseListByRespondent.size()>0){ - for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { - //根据案件id查询申请人姓名 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); - caseAffiliate.setIdentityType(1); - String name = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate).get(0).getName(); - caseEvidenceVO.setApplicantName(name); - } - return caseListByRespondent; - } - return null; - } + return getCaseEvidenceVOList(identityNum,3, 2); + }*/ @Override public AjaxResult getCaseDetailsById(Long id) { @@ -58,6 +45,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { if (caseApplication1!=null){ CaseDetailVO caseDetailVO = new CaseDetailVO(); BeanUtils.copyProperties(caseApplication1,caseDetailVO); + //查询案件证据材料 + // List evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id); CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(id); List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); @@ -81,15 +70,23 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } try { String filePath = RuoYiConfig.getUploadPath(); + // 获取文件原始名称 + String fileName = file.getOriginalFilename(); + String fileSavePath = filePath + "/" + fileName; // 上传并返回新文件名称 - String fileNewName = FileUploadUtils.upload(filePath, file); + String fileNewName = FileUploadUtils.upload(filePath,file); CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) .annexName(fileNewName) - .annexPath(filePath) + .annexPath(fileSavePath) .annexType(annexType) .build(); int count = caseAttachMapper.save(caseAttach); if (count>0){ + //修改案件状态 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + caseApplication.setCaseStatus(4); + caseApplicationMapper.submitCaseApplication(caseApplication); return AjaxResult.success("上传成功"); } } catch (IOException e) { @@ -98,4 +95,36 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { return AjaxResult.error("上传失败"); } + +/* @Override + public List getCaseListByApplicant(String identityNum) { + return getCaseEvidenceVOList(identityNum,4, 1); + }*/ + + @Override + public List getCaseListAll(String identityNum) { + List caseStatusList = Arrays.asList(3, 4, 5, 9); + return getCaseEvidenceVOList(identityNum,caseStatusList,null); + } + + private List getCaseEvidenceVOList(String identityNum ,List caseStatusList, Integer identityType){ + List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList,identityType); + if (caseListByRespondent!= null && caseListByRespondent.size()>0){ + for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { + //根据案件id查询姓名 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + for (CaseAffiliate affiliate : caseAffiliates) { + if (affiliate.getIdentityType() == 1){ //申请人 + caseEvidenceVO.setApplicantName(affiliate.getName()); + }else { + caseEvidenceVO.setRespondentName(affiliate.getName()); + } + } + } + return caseListByRespondent; + } + return null; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 2f491dc..2161e97 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -110,7 +110,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"}); } } - //SmsUtils.sendSms(request); + SmsUtils.sendSms(request); return AjaxResult.success(); } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index e60f8be..992c185 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -3,8 +3,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + + + + + + + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note) VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note}) + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml index 525820f..3d925a6 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml @@ -3,10 +3,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + select c.id, c.case_num,c.case_status from case_application as c ,case_affiliate as d - where c.id = d.case_appli_id and d.identity_num = #{identityNum} and identity_type = #{identityType} - and c.case_status = #{caseStatus} + where c.id = d.case_appli_id + + and d.identity_num = #{identityNum} + + + and identity_type = #{identityType} + + + and c.case_status in + + #{caseStatus} + + \ No newline at end of file From 04d9172cceb4e1610e5b367602dab5cfa8e4ade8 Mon Sep 17 00:00:00 2001 From: gy b Date: Fri, 15 Sep 2023 20:06:01 +0800 Subject: [PATCH 010/123] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=9D=99=E6=80=81?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/enums/HttpMethod.java | 16 ++++++---------- .../ruoyi/framework/config/SecurityConfig.java | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java index be6f739..a0cf8e5 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java @@ -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 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)); } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 2125853..dca1d39 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 过滤请求 .authorizeRequests() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/register", "/captchaImage").permitAll() + .antMatchers("/login", "/register", "/captchaImage","/home/**").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() From 8c4094706dbc180ede444c451f01a00cc16a8267 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Sat, 16 Sep 2023 18:20:19 +0800 Subject: [PATCH 011/123] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseLogRecordController.java | 13 ++++ .../wisdomarbitrate/domain/CaseLogRecord.java | 76 +++++++++++++++++++ .../mapper/CaseLogRecordMapper.java | 6 ++ .../service/ICaseLogRecordService.java | 6 ++ .../impl/CaseLogRecordServiceImpl.java | 12 +++ .../wisdomarbitrate/CaseLogRecordMapper.xml | 51 +++++++++++++ 6 files changed, 164 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseLogRecordService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java new file mode 100644 index 0000000..a2c8365 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java @@ -0,0 +1,13 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import com.ruoyi.common.core.controller.BaseController; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/caseLogRecord") +public class CaseLogRecordController extends BaseController { + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java new file mode 100644 index 0000000..7de2670 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java @@ -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 String 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 String getCaseNode() { + return caseNode; + } + + public void setCaseNode(String 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; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java new file mode 100644 index 0000000..12c94a9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java @@ -0,0 +1,6 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +public interface CaseLogRecordMapper { + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseLogRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseLogRecordService.java new file mode 100644 index 0000000..ad37b16 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseLogRecordService.java @@ -0,0 +1,6 @@ +package com.ruoyi.wisdomarbitrate.service; + +public interface ICaseLogRecordService { + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java new file mode 100644 index 0000000..1018926 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -0,0 +1,12 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; +import org.springframework.stereotype.Service; + +@Service +public class CaseLogRecordServiceImpl implements ICaseLogRecordService { + + + + +} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml new file mode 100644 index 0000000..c8d2869 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + insert into case_log_record(case_appli_id, case_node,case_node_time,notes,create_by,create_time ) values( + #{caseAppliId},#{caseNode},sysdate(),#{notes},#{createBy},sysdate() + ) + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 1e362973a503c5a7a166bc02637fee18b5728692 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Mon, 18 Sep 2023 09:04:50 +0800 Subject: [PATCH 012/123] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E8=AF=81=E6=8D=AE,?= =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseEvidenceController.java | 46 +++++-------- .../java/com/ruoyi/common/utils/SmsUtils.java | 6 +- .../wisdomarbitrate/domain/CaseAttach.java | 8 +++ .../service/ICaseEvidenceService.java | 10 +-- .../service/impl/CaseEvidenceServiceImpl.java | 67 ++++++++++++------- .../service/impl/CasePaymentServiceImpl.java | 22 ++++-- .../wisdomarbitrate/CaseAttachMapper.xml | 12 ++-- 7 files changed, 99 insertions(+), 72 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index aae23cb..1b7ff7c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -7,6 +7,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication; 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; @@ -26,31 +27,16 @@ public class CaseEvidenceController extends BaseController { this.caseEvidenceService = caseEvidenceService; } - /* *//** - * 查询被申请人案件列表 - * - * @param identityNum 身份证号 - * @return - *//* - @GetMapping("/respondent") - public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum) { - startPage(); - List list = caseEvidenceService.getCaseListByRespondent(identityNum); - if (list != null) { - return getDataTable(list); - } - return getDataTable(new ArrayList<>()); - }*/ - /** - * 被申请人根据案件id查询案件详情 + * 根据案件id查询案件详情 * * @param id * @return */ @GetMapping("/{id}") public AjaxResult getCaseDetailsById(@PathVariable Long id) { - return caseEvidenceService.getCaseDetailsById(id); + String username = this.getUsername(); + return caseEvidenceService.getCaseDetailsById(id,username); } /** @@ -63,19 +49,11 @@ public class CaseEvidenceController extends BaseController { */ @PostMapping("/upload") public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) { - return caseEvidenceService.uploadEvidence(file, annexType, id); + String username = this.getUsername(); + Long userId = this.getUserId(); + return caseEvidenceService.uploadEvidence(file, annexType, id,username,userId); } - /* @GetMapping("/applicant") - public TableDataInfo getCaseListByApplicant(@RequestParam String identityNum) { - startPage(); - List list = caseEvidenceService.getCaseListByApplicant(identityNum); - if (list != null) { - return getDataTable(list); - } - return getDataTable(new ArrayList<>()); - }*/ - /** * 查询当前用户案件列表 * @param identityNum @@ -91,5 +69,13 @@ public class CaseEvidenceController extends BaseController { return getDataTable(new ArrayList<>()); } - + /** + * 证据确认 + * @param caseApplication 案件对象 + * @return 统一返回结果 + */ + @PutMapping("/confirm") + public AjaxResult evidenceConfirmation(@Validated @RequestBody CaseApplication caseApplication){ + return caseEvidenceService.evidenceConfirmation(caseApplication); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java index 55b9c63..cfc9e84 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java @@ -77,9 +77,9 @@ public class SmsUtils { public static void main(String[] args) { SendSmsRequest sendSmsRequest = new SendSmsRequest(); - sendSmsRequest.setPhone("15029925289"); - sendSmsRequest.setTemplateId("1927509"); - sendSmsRequest.setTemplateParamSet(new String[]{"用户"}); + sendSmsRequest.setPhone("18792613219"); + sendSmsRequest.setTemplateId("1928003"); + sendSmsRequest.setTemplateParamSet(new String[]{"xxx","仲裁","编号"}); SmsUtils.sendSms(sendSmsRequest); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index 23dc67c..bce1776 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -34,5 +34,13 @@ public class CaseAttach { * 备注 */ private String note; + /** + * 用户id + */ + private Long userId; + /** + * 用户账户 + */ + private String userName; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java index 66882a6..5e801ea 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java @@ -2,20 +2,20 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; import org.springframework.web.multipart.MultipartFile; import java.util.List; public interface ICaseEvidenceService { - // List getCaseListByRespondent(String identityNum); - AjaxResult getCaseDetailsById(Long id); + AjaxResult getCaseDetailsById(Long id,String userName); - AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id); - - //List getCaseListByApplicant(String identityNum); + AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id,String userName,Long userId); List getCaseListAll(String identityNum); + AjaxResult evidenceConfirmation(CaseApplication caseApplication); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 2212413..9dbb2e1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; @@ -19,6 +20,9 @@ import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.List; @@ -38,50 +42,55 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { }*/ @Override - public AjaxResult getCaseDetailsById(Long id) { + public AjaxResult getCaseDetailsById(Long id,String userName) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1!=null){ + if (caseApplication1 != null) { CaseDetailVO caseDetailVO = new CaseDetailVO(); - BeanUtils.copyProperties(caseApplication1,caseDetailVO); - //查询案件证据材料 - // List evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id); + BeanUtils.copyProperties(caseApplication1, caseDetailVO); CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(id); List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1){ //申请人 + String name = affiliate.getName(); + //判断当前登录人和案件关联人姓名是否一致 + if (name.equals(userName)) { //一致,将案件关联人的身份类型赋给当前登录人 + caseDetailVO.setIdentityType(affiliate.getIdentityType()); + } + if (affiliate.getIdentityType() == 1) { //申请人 caseDetailVO.setApplicantName(affiliate.getName()); - }else { + } else { caseDetailVO.setRespondentName(affiliate.getName()); } + //根据案件id查询案件证据材料 + List evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id); + caseDetailVO.setEvidenceMaterialList(evidenceMaterialList); } return AjaxResult.success(caseDetailVO); } - return null; } @Override - public AjaxResult uploadEvidence(MultipartFile file , Integer annexType, Long id) { + public AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id, String userName, Long userId) { + if (file.isEmpty()) { return AjaxResult.error("请选择要上传的文件"); } try { - String filePath = RuoYiConfig.getUploadPath(); - // 获取文件原始名称 - String fileName = file.getOriginalFilename(); - String fileSavePath = filePath + "/" + fileName; - // 上传并返回新文件名称 - String fileNewName = FileUploadUtils.upload(filePath,file); + String filePath = RuoYiConfig.getUploadPath(); + // 上传 + String fileName = FileUploadUtils.upload(filePath, file); CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) - .annexName(fileNewName) - .annexPath(fileSavePath) + .annexName(fileName) + .annexPath(filePath) .annexType(annexType) + .userId(userId) + .userName(userName) .build(); int count = caseAttachMapper.save(caseAttach); - if (count>0){ + if (count > 0) { //修改案件状态 CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); @@ -104,21 +113,31 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { @Override public List getCaseListAll(String identityNum) { List caseStatusList = Arrays.asList(3, 4, 5, 9); - return getCaseEvidenceVOList(identityNum,caseStatusList,null); + return getCaseEvidenceVOList(identityNum, caseStatusList, null); } - private List getCaseEvidenceVOList(String identityNum ,List caseStatusList, Integer identityType){ - List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList,identityType); - if (caseListByRespondent!= null && caseListByRespondent.size()>0){ + @Override + public AjaxResult evidenceConfirmation(CaseApplication caseApplication) { + caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_APPOINT_ARBOTRATAR); + int i = caseApplicationMapper.submitCaseApplication(caseApplication); + if (i>0){ + return AjaxResult.success("证据确认成功"); + } + return AjaxResult.error("暂无需要确认的证据"); + } + + private List getCaseEvidenceVOList(String identityNum, List caseStatusList, Integer identityType) { + List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType); + if (caseListByRespondent != null && caseListByRespondent.size() > 0) { for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { //根据案件id查询姓名 CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1){ //申请人 + if (affiliate.getIdentityType() == 1) { //申请人 caseEvidenceVO.setApplicantName(affiliate.getName()); - }else { + } else { caseEvidenceVO.setRespondentName(affiliate.getName()); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index e183f34..33195ef 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -98,16 +98,28 @@ public class CasePaymentServiceImpl implements ICasePaymentService { List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 if (caseAffiliates != null && caseAffiliates.size() > 0) { for (CaseAffiliate affiliate : caseAffiliates) { - request.setPhone(affiliate.getContactTelphone()); //获取身份类型 int identityType = affiliate.getIdentityType(); + //查询案件详细信息 + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplication1 == null){ + return AjaxResult.error(); + } + String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死 + String caseNum = caseApplication1.getCaseNum(); if (identityType == 1) { //申请人 - request.setTemplateId("申请人模板id"); //传入申请人模板id + request.setPhone(affiliate.getContactTelphone()); + request.setTemplateId("1928003"); //传入申请人模板id // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 - request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"}); + // 模板id:1928003 普通短信 案件受理通知 尊敬的{1}用户,您的{2}案件{3}已成功受理。 + String name = affiliate.getName(); + request.setTemplateParamSet(new String[]{name,caseName,caseNum}); } else { //被申请人 - request.setTemplateId("被申请人模板id"); - request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"}); + request.setPhone(affiliate.getContactTelphone()); + request.setTemplateId("1928006"); + // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。 + String name = affiliate.getName(); + request.setTemplateParamSet(new String[]{name,caseName,caseNum}); } } SmsUtils.sendSms(request); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index 992c185..5d7714d 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -8,16 +8,18 @@ - + + + - INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note) - VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note}) + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account) + VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName})
\ No newline at end of file From 5311b1dc3d6a73486f56715354f3364d10cd2699 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Mon, 18 Sep 2023 15:33:40 +0800 Subject: [PATCH 013/123] =?UTF-8?q?9.18=E5=BC=80=E5=8F=91=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseArbitrateController.java | 31 +++++++ .../CaseEvidenceController.java | 2 +- .../domain/CaseApplication.java | 6 +- .../service/ICaseArbitrateService.java | 10 +++ .../impl/CaseArbitrateServiceImpl.java | 85 +++++++++++++++++++ .../service/impl/CaseEvidenceServiceImpl.java | 12 +-- .../service/impl/CasePaymentServiceImpl.java | 16 ++-- .../wisdomarbitrate/CaseApplicationMapper.xml | 1 + 8 files changed, 145 insertions(+), 18 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java new file mode 100644 index 0000000..b5bfea4 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java @@ -0,0 +1,31 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import com.ruoyi.common.core.domain.AjaxResult; +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 { + @Autowired + private ICaseArbitrateService caseArbitrateService; + + /** + * 确定仲裁方式 + * @param caseApplication + * @param arbitratMethod + * @return + */ + @PutMapping("/method") + public AjaxResult chooseArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication,Integer arbitratMethod){ + return caseArbitrateService.chooseArbitrateMethod(caseApplication,arbitratMethod); + } + + @PostMapping("/writtenHear") + public AjaxResult writtenHear(@Validated @RequestBody CaseApplication caseApplication,String accidentDescription , String arbitrationResult){ + return caseArbitrateService.writtenHear(caseApplication,accidentDescription,arbitrationResult); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index 1b7ff7c..037456b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -15,7 +15,7 @@ import java.util.ArrayList; import java.util.List; /** - * 案件证据上传 + * 案件证据 */ @RestController @RequestMapping("/evidence") diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index a26f262..3ffa1c6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -25,7 +25,7 @@ public class CaseApplication extends BaseEntity { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date registerDate; /** 仲裁方式 */ - private String arbitratMethod; + private int arbitratMethod; /** 案件状态 */ private int caseStatus; /** 开庭日期 */ @@ -278,11 +278,11 @@ public class CaseApplication extends BaseEntity { this.registerDate = registerDate; } - public String getArbitratMethod() { + public int getArbitratMethod() { return arbitratMethod; } - public void setArbitratMethod(String arbitratMethod) { + public void setArbitratMethod(int arbitratMethod) { this.arbitratMethod = arbitratMethod; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java new file mode 100644 index 0000000..231ae50 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java @@ -0,0 +1,10 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; + +public interface ICaseArbitrateService { + AjaxResult chooseArbitrateMethod(CaseApplication caseApplication,Integer arbitratMethod); + + AjaxResult writtenHear(CaseApplication caseApplication, String accidentDescription, String arbitrationResult); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java new file mode 100644 index 0000000..4d670a0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -0,0 +1,85 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.SmsUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service +public class CaseArbitrateServiceImpl implements ICaseArbitrateService { + @Autowired + private CaseApplicationMapper caseApplicationMapper; + @Autowired + private CaseAffiliateMapper caseAffiliateMapper; + + @Override + @Transactional + public AjaxResult chooseArbitrateMethod(CaseApplication caseApplication, Integer arbitratMethod) { + if (arbitratMethod != null) { + String arbitratMethodStr = arbitratMethod == 1 ? "开庭审理" : "书面审理"; + //查询案件详细信息 + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplication1 == null) { + return AjaxResult.error(); + } + String caseNum = caseApplication1.getCaseNum(); + //选择仲裁方式 + caseApplication.setArbitratMethod(arbitratMethod); + //修改案件状态为待开庭 + caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT); + int i = caseApplicationMapper.submitCaseApplication(caseApplication); + if (i > 0) { + //发送短信通知 + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + request.setTemplateId("1931000"); + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseApplication1.getId()); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 + if (caseAffiliates != null && caseAffiliates.size() > 0) { + for (CaseAffiliate affiliate : caseAffiliates) { + //获取身份类型 + int identityType = affiliate.getIdentityType(); + if (identityType == 1) { //申请人 + request.setPhone(affiliate.getContactTelphone()); + // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 + // 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。 + String name = affiliate.getName(); + request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr}); + SmsUtils.sendSms(request); + } else { //被申请人 + request.setPhone(affiliate.getContactTelphone()); + // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。 + String name = affiliate.getName(); + request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr}); + SmsUtils.sendSms(request); + } + } + } + return AjaxResult.success("选择成功"); + } + + } + return AjaxResult.error("请选择开庭方式"); + } + + @Override + public AjaxResult writtenHear(CaseApplication caseApplication, String accidentDescription, String arbitrationResult) { + //提交仲裁结果 + // caseApplication.set(accidentDescription); //案情描述 + // caseApplication.set(arbitrationResult); //仲裁结果 + int i = caseApplicationMapper.updataCaseApplication(caseApplication); + if (i>0){ + return AjaxResult.success("提交成功"); + } + return AjaxResult.error("暂无需要提交仲裁结果的案件"); + } +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 9dbb2e1..40df38d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -17,6 +17,7 @@ import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; @@ -36,12 +37,9 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { private CaseApplicationMapper caseApplicationMapper; @Autowired private CaseAttachMapper caseAttachMapper; - /* @Override - public List getCaseListByRespondent(String identityNum) { - return getCaseEvidenceVOList(identityNum,3, 2); - }*/ @Override + @Transactional public AjaxResult getCaseDetailsById(Long id,String userName) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); @@ -73,6 +71,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } @Override + @Transactional public AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id, String userName, Long userId) { if (file.isEmpty()) { @@ -105,10 +104,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { return AjaxResult.error("上传失败"); } -/* @Override - public List getCaseListByApplicant(String identityNum) { - return getCaseEvidenceVOList(identityNum,4, 1); - }*/ + @Override public List getCaseListAll(String identityNum) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 33195ef..d375246 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -1,7 +1,6 @@ package com.ruoyi.wisdomarbitrate.service.impl; - import com.ruoyi.ElegentPay; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; @@ -18,6 +17,7 @@ import com.ruoyi.wisdomarbitrate.mapper.CasePaymentRecordMapper; import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; import java.util.Date; @@ -42,6 +42,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } @Override + @Transactional public AjaxResult casePay(CasePayDTO casePayDTO) { PayRequest payRequest = new PayRequest(); payRequest.setBody("案件缴费"); @@ -64,7 +65,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { return AjaxResult.success(response); } - + @Transactional public AjaxResult callback(String orderNumber) { //查询记录 CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.queryRecord(orderNumber); @@ -86,7 +87,9 @@ public class CasePaymentServiceImpl implements ICasePaymentService { caseApplicationMapper.submitCaseApplication(caseApplication1); return AjaxResult.success(); } + @Override + @Transactional public AjaxResult confirmPayment(CaseApplication caseApplication) { caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_RESPOND); int i = caseApplicationMapper.submitCaseApplication(caseApplication); @@ -102,7 +105,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { int identityType = affiliate.getIdentityType(); //查询案件详细信息 CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 == null){ + if (caseApplication1 == null) { return AjaxResult.error(); } String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死 @@ -113,16 +116,17 @@ public class CasePaymentServiceImpl implements ICasePaymentService { // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 // 模板id:1928003 普通短信 案件受理通知 尊敬的{1}用户,您的{2}案件{3}已成功受理。 String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name,caseName,caseNum}); + request.setTemplateParamSet(new String[]{name, caseName, caseNum}); + SmsUtils.sendSms(request); } else { //被申请人 request.setPhone(affiliate.getContactTelphone()); request.setTemplateId("1928006"); // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。 String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name,caseName,caseNum}); + request.setTemplateParamSet(new String[]{name, caseName, caseNum}); + SmsUtils.sendSms(request); } } - SmsUtils.sendSms(request); return AjaxResult.success(); } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index a2d082c..58230e8 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -139,6 +139,7 @@ arbitrator_id = #{arbitratorId}, arbitrator_name = #{arbitratorName}, pending_appoint_arbotrar = #{pendingAppointArbotrar}, + arbitrat_method = #{arbitratMethod}, where id = #{id} From 49d611b9717a315e46f37592347faac1a1c14c99 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Mon, 18 Sep 2023 18:15:34 +0800 Subject: [PATCH 014/123] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseLogRecordController.java | 27 ++++++++++++++ .../domain/CaseApplication.java | 35 +++++++++++++++++++ .../mapper/CaseLogRecordMapper.java | 8 +++++ .../service/ICaseLogRecordService.java | 11 ++++++ .../impl/CaseLogRecordServiceImpl.java | 15 ++++++++ .../wisdomarbitrate/CaseApplicationMapper.xml | 9 +++++ .../wisdomarbitrate/CaseLogRecordMapper.xml | 3 +- 7 files changed, 107 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java index a2c8365..dc733c1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java @@ -1,12 +1,39 @@ 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 list = caseLogRecordService.selectCaseLogRecordList(caseLogRecord); + return getDataTable(list); + } + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index a26f262..7fa1206 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -68,6 +68,41 @@ public class CaseApplication extends BaseEntity { /** 仲裁员名称 */ private String arbitratorName; + /** 案件名称 */ + private String caseName; + + /** 案件描述 */ + private String caseDescribe; + + 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; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java index 12c94a9..9dd368e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java @@ -1,6 +1,14 @@ package com.ruoyi.wisdomarbitrate.mapper; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; + +import java.util.List; + public interface CaseLogRecordMapper { + List selectCaseLogRecordList(CaseLogRecord caseLogRecord); + + int insertCaseLogRecord(CaseLogRecord caseLogRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseLogRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseLogRecordService.java index ad37b16..f4fcf77 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseLogRecordService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseLogRecordService.java @@ -1,6 +1,17 @@ package com.ruoyi.wisdomarbitrate.service; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; + +import java.util.List; + public interface ICaseLogRecordService { + List selectCaseLogRecordList(CaseLogRecord caseLogRecord); + + + + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index 1018926..6d07ec5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -1,10 +1,25 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class CaseLogRecordServiceImpl implements ICaseLogRecordService { + @Autowired + private CaseLogRecordMapper caseLogRecordMapper; + + + @Override + public List selectCaseLogRecordList(CaseLogRecord caseLogRecord) { + return caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); + + } + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index a2d082c..e215199 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -126,6 +126,12 @@ online_video_person = #{onlineVideoPerson}, contract_number = #{contractNumber}, + + case_name = #{caseName}, + case_describe = #{caseDescribe}, + case_result = #{caseResult}, + case_status = #{caseStatus}, + update_by = #{updateBy}, update_time = sysdate() @@ -139,6 +145,9 @@ arbitrator_id = #{arbitratorId}, arbitrator_name = #{arbitratorName}, pending_appoint_arbotrar = #{pendingAppointArbotrar}, + case_name = #{caseName}, + case_describe = #{caseDescribe}, + case_result = #{caseResult}, where id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index c8d2869..88d4288 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -9,6 +9,7 @@ + @@ -19,7 +20,7 @@ diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 4ba5adb..ec844ec 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -24,7 +24,7 @@ - + @@ -34,7 +34,16 @@ + SELECT a.id ,a.case_appli_id ,a.eviden_determi ,a.fact_determi ,a.case_sketch ,a.arbitrate_think ,a.ruling_follows , + a.verifica_opinion ,a.check_opinion + from arbitrate_record a + + + AND a.case_appli_id = #{caseAppliId} + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index ec844ec..cd64524 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -20,7 +20,6 @@ - @@ -45,7 +44,7 @@ END caseStatusName, c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , - c.paid_expenses ,c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , + c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , c.update_by ,c.update_time from case_application c @@ -84,7 +83,6 @@ claim_interest_owed, claim_liquid_damag, fee_payable, - paid_expenses, begin_video_date, online_video_person, @@ -130,7 +128,6 @@ claim_interest_owed = #{claimInterestOwed}, claim_liquid_damag = #{claimLiquidDamag}, fee_payable = #{feePayable}, - paid_expenses = #{paidExpenses}, begin_video_date = #{beginVideoDate}, online_video_person = #{onlineVideoPerson}, @@ -173,7 +170,7 @@ From 5e9a002cd15344ca7d72ab301df24eaaac62c6de Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 20 Sep 2023 17:56:53 +0800 Subject: [PATCH 028/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E4=BB=B2=E8=A3=81=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/CaseApplicationController.java | 11 +++++++++++ .../service/ICaseApplicationService.java | 2 ++ .../service/impl/CaseApplicationServiceImpl.java | 13 +++++++++++++ .../wisdomarbitrate/ArbitrateRecordMapper.xml | 4 ++-- .../wisdomarbitrate/CaseApplicationMapper.xml | 2 +- 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index e302f4f..2f2d81f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -159,6 +159,17 @@ public class CaseApplicationController extends BaseController { 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)); + } + /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index c6e6795..f063c91 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -29,4 +29,6 @@ public interface ICaseApplicationService { int pendTralCheck(CaseApplication caseApplication); int pendTralSure(CaseApplication caseApplication); + + int verificationArbitrateRecord(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 7e3c554..9f04cb9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -258,6 +258,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return rows; } + @Override + @Transactional + public int verificationArbitrateRecord(CaseApplication caseApplication) { + caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); + int rows = caseApplicationMapper.submitCaseApplication(caseApplication); + ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); + arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); + return rows; + + } + @Override @Transactional public int pendTralSure(CaseApplication caseApplication) { @@ -318,6 +329,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } + + @Override @Transactional public int pendingAppointArbotrar(CaseApplication caseApplication) { diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml index 976c551..6015690 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml @@ -33,8 +33,8 @@ #{factDetermi}, #{caseSketch}, #{rulingFollows}, - #{verifica_opinion}, - #{check_opinion}, + #{verifica_opinion}, + #{check_opinion}, #{createBy}, sysdate() ) diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 1b75ec0..7c9cfbd 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -48,7 +48,7 @@ c.update_by ,c.update_time from case_application c - + AND c.case_status = #{caseStatus} From cc0004bab9de79c958da3b45712403a737881df3 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 20 Sep 2023 18:28:00 +0800 Subject: [PATCH 029/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=B2=E8=A3=81?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=BF=9D=E5=AD=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/wisdomarbitrate/ArbitrateRecordMapper.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml index 6015690..c0079c7 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml @@ -24,6 +24,8 @@ case_sketch, ruling_follows, verifica_opinion, + arbitrate_think, + check_opinion, create_by, create_time @@ -33,8 +35,9 @@ #{factDetermi}, #{caseSketch}, #{rulingFollows}, - #{verifica_opinion}, - #{check_opinion}, + #{verificaOpinion}, + #{arbitrateThink}, + #{checkOpinion}, #{createBy}, sysdate() ) From c8d10546408458b1c6a436f72b7f5cf35afcf7ec Mon Sep 17 00:00:00 2001 From: hejinbo Date: Wed, 20 Sep 2023 19:22:14 +0800 Subject: [PATCH 030/123] =?UTF-8?q?9.20=E6=97=A5=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseArbitrateController.java | 6 +++--- .../service/ICaseArbitrateService.java | 3 ++- .../impl/CaseArbitrateServiceImpl.java | 20 +++++++++++++------ .../service/impl/CaseEvidenceServiceImpl.java | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java index 069c72e..aed5bb0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java @@ -2,6 +2,7 @@ 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; @@ -34,8 +35,7 @@ public class CaseArbitrateController extends BaseController { * @return */ @PostMapping("/writtenHear") - public AjaxResult writtenHear(@Validated @RequestBody CaseApplication caseApplication - ,String accidentDescription , String arbitrationResult){ - return caseArbitrateService.writtenHear(caseApplication,accidentDescription,arbitrationResult); + public AjaxResult writtenHear(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ + return caseArbitrateService.writtenHear(arbitrateRecord); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java index 231ae50..1f02239 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java @@ -1,10 +1,11 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; public interface ICaseArbitrateService { AjaxResult chooseArbitrateMethod(CaseApplication caseApplication,Integer arbitratMethod); - AjaxResult writtenHear(CaseApplication caseApplication, String accidentDescription, String arbitrationResult); + AjaxResult writtenHear(ArbitrateRecord arbitrateRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index dcfedd8..49bdea6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -3,9 +3,11 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.SmsUtils; +import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; @@ -24,6 +26,8 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { private CaseAffiliateMapper caseAffiliateMapper; @Autowired private CaseLogRecordMapper caseLogRecordMapper; + @Autowired + private ArbitrateRecordMapper arbitrateRecordMapper; @Override @Transactional @@ -76,18 +80,22 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { } @Override - public AjaxResult writtenHear(CaseApplication caseApplication, String accidentDescription, String arbitrationResult) { - //提交仲裁结果 + public AjaxResult writtenHear(ArbitrateRecord arbitrateRecord) { + //查询案件详情 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(arbitrateRecord.getCaseAppliId()); CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - caseApplication1.setCaseDescribe(accidentDescription); //案情描述 - caseApplication1.setCaseResult(arbitrationResult); //仲裁结果 - int i = caseApplicationMapper.updataCaseApplication(caseApplication1); + String createBy = caseApplication1.getCreateBy(); + if (createBy!=null){ + arbitrateRecord.setCreateBy(createBy); + } + //提交仲裁结果 + int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord); if (i>0){ //案件日志表里添加数据 CaseLogRecord caseLogRecord = new CaseLogRecord(); caseLogRecord.setCaseAppliId(caseApplication1.getId()); caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); - String createBy = caseApplication1.getCreateBy(); if (createBy!=null){ caseLogRecord.setCreateBy(createBy); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index e220bcc..0a37156 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -115,7 +115,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { @Override public List getCaseListAll(String identityNum) { - List caseStatusList = Arrays.asList(3, 4, 5, 9); + List caseStatusList = Arrays.asList(CaseApplicationConstants.CASE_CROSSEXAMI); return getCaseEvidenceVOList(identityNum, caseStatusList, null); } From ada0e3740aef57125d25646332fac605377067bc Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 20 Sep 2023 19:49:51 +0800 Subject: [PATCH 031/123] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E8=A3=81=E5=86=B3?= =?UTF-8?q?=E4=B9=A6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 11 ++++++++ .../domain/CaseApplication.java | 27 ++++++++++++++----- .../service/ICaseApplicationService.java | 2 ++ .../impl/CaseApplicationServiceImpl.java | 18 +++++++++++++ 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 2f2d81f..7eae2a7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -170,6 +170,17 @@ public class CaseApplicationController extends BaseController { 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)); + } + /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index b0d72e1..01ad79a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -26,7 +26,16 @@ public class CaseApplication extends BaseEntity { /** 仲裁方式 */ private int arbitratMethod; /** 案件状态 */ - private int caseStatus; + 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; @@ -81,6 +90,16 @@ public class CaseApplication extends BaseEntity { private int 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; @@ -403,13 +422,7 @@ public class CaseApplication extends BaseEntity { this.arbitratMethod = arbitratMethod; } - public int getCaseStatus() { - return caseStatus; - } - public void setCaseStatus(int caseStatus) { - this.caseStatus = caseStatus; - } public Date getHearDate() { return hearDate; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index f063c91..25065ed 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -31,4 +31,6 @@ public interface ICaseApplicationService { int pendTralSure(CaseApplication caseApplication); int verificationArbitrateRecord(CaseApplication caseApplication); + + int checkArbitrateRecord(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 9f04cb9..912c8a8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -269,6 +269,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } + @Override + @Transactional + public int checkArbitrateRecord(CaseApplication caseApplication) { + int rows = 0; + ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); + arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); + Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); + if(agreeOrNotCheck.intValue()==1){//同意审核 + caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + }else if(agreeOrNotCheck.intValue()==2){//拒绝审核 + caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + } + + return rows; + } + @Override @Transactional public int pendTralSure(CaseApplication caseApplication) { From 361f283a15adc231e696fa7b5617a9aefdaebdb1 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Thu, 21 Sep 2023 11:18:15 +0800 Subject: [PATCH 032/123] =?UTF-8?q?=E7=AB=8B=E6=A1=88=E5=AE=A1=E6=9F=A5?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 16 ++++++++++++++-- .../service/ICaseApplicationService.java | 2 ++ .../impl/CaseApplicationServiceImpl.java | 18 +++++++++++++++++- .../wisdomarbitrate/CaseApplicationMapper.xml | 1 - 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 7eae2a7..d7f04d9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -72,10 +72,10 @@ public class CaseApplicationController extends BaseController { } /** - * 提交立案数据 + * 提交立案申请 */ @PreAuthorize("@ss.hasPermi('caseApplication:submit')") - @Log(title = "提交立案数据", businessType = BusinessType.UPDATE) + @Log(title = "提交立案申请", businessType = BusinessType.UPDATE) @PostMapping("/submitCaseApplication") public AjaxResult submitCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { @@ -194,6 +194,18 @@ public class CaseApplicationController extends BaseController { 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)); + } + diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 25065ed..4d58d60 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -33,4 +33,6 @@ public interface ICaseApplicationService { int verificationArbitrateRecord(CaseApplication caseApplication); int checkArbitrateRecord(CaseApplication caseApplication); + + int submitCaseApplicationCheck(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 912c8a8..973cf69 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -88,7 +88,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public int submitCaseApplication(CaseApplication caseApplication) { //提交立案申请 - caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CHECK); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); return rows; } @@ -287,6 +287,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return rows; } + @Override + @Transactional + public int submitCaseApplicationCheck(CaseApplication caseApplication) { + //提交立案审查 + int rows = 0; + Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); + if(agreeOrNotCheck.intValue()==1){//同意审核 + caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + }else if(agreeOrNotCheck.intValue()==2){//拒绝审核 + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + } + return rows; + } + @Override @Transactional public int pendTralSure(CaseApplication caseApplication) { diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 7c9cfbd..8f09ff5 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -110,7 +110,6 @@ #{claimInterestOwed}, #{claimLiquidDamag}, #{feePayable}, - #{paidExpenses}, #{beginVideoDate}, #{onlineVideoPerson}, From a23b662332c05a32404eb551900733334fba41dc Mon Sep 17 00:00:00 2001 From: hejinbo Date: Thu, 21 Sep 2023 19:16:12 +0800 Subject: [PATCH 033/123] =?UTF-8?q?9.21=E6=97=A5=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 23 +++ .../CaseArbitrateController.java | 14 +- .../CaseEvidenceController.java | 6 +- ruoyi-common/pom.xml | 6 + .../java/com/ruoyi/common/utils/WordUtil.java | 157 +++++++++++++++++ .../wisdomarbitrate/domain/Adjudication.java | 165 ++++++++++++++++++ .../service/IAdjudicationService.java | 8 + .../service/ICaseArbitrateService.java | 4 +- .../service/impl/AdjudicationServiceImpl.java | 46 +++++ .../impl/CaseArbitrateServiceImpl.java | 90 +++++----- .../service/impl/CaseEvidenceServiceImpl.java | 6 + 11 files changed, 474 insertions(+), 51 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Adjudication.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java new file mode 100644 index 0000000..9d2ce64 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -0,0 +1,23 @@ +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.service.IAdjudicationService; +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("/adjudication") +public class AdjudicationController extends BaseController { + @Autowired + private IAdjudicationService adjudicationService; + @PostMapping("/document") + public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){ + return adjudicationService.createDocument(caseApplication); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java index aed5bb0..b44cead 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java @@ -16,22 +16,20 @@ public class CaseArbitrateController extends BaseController { private ICaseArbitrateService caseArbitrateService; /** - * 确定仲裁方式 + * 审核仲裁方式 * @param caseApplication - * @param arbitratMethod + * @param opinion 1同意,0拒绝 * @return */ @PutMapping("/method") - public AjaxResult chooseArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication - ,Integer arbitratMethod){ - return caseArbitrateService.chooseArbitrateMethod(caseApplication,arbitratMethod); + public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication + ,Integer opinion){ + return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion); } /** * 书面审理 - * @param caseApplication - * @param accidentDescription - * @param arbitrationResult + * @param arbitrateRecord * @return */ @PostMapping("/writtenHear") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index ad90377..536228c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -80,7 +80,11 @@ public class CaseEvidenceController extends BaseController { return caseEvidenceService.evidenceConfirmation(caseApplication); } - + /** + * 案件质证 + * @param caseEvidenceDTO + * @return + */ @PostMapping("/crossexami") public AjaxResult caseCrossexamination(@Validated @RequestBody CaseEvidenceDTO caseEvidenceDTO){ return caseEvidenceService.caseCrossexamination(caseEvidenceDTO); diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 35fdb8c..5307193 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -145,6 +145,12 @@ 3.1.701 + + + com.deepoove + poi-tl + 1.9.1 + diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java new file mode 100644 index 0000000..cef0386 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java @@ -0,0 +1,157 @@ +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; + +/** + * @Author: ymbgy + * @Date: 2022-09-21 13:26 + */ +public class WordUtil { + + private CellRenderData cell; + + /** + * 查询生成的word文件流 + * + * @param response + * @param datas + * @param modalFilePath + * @param resultFilePath + * @throws IOException + */ + public static void getDocStreamFile(HttpServletResponse response, Map 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 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 headerList, String headerBackgroundColor, String textColor, List> tableContentList) { + RowRenderData header = rebuildWordTableHead(headerList, headerBackgroundColor, textColor); + List 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 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 rebuildWordTableContent(List> tableContentList) { + List rowContentList = new ArrayList<>(); + for (int i = 0; tableContentList != null && i < tableContentList.size(); i++) { + List 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 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; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Adjudication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Adjudication.java new file mode 100644 index 0000000..0041958 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Adjudication.java @@ -0,0 +1,165 @@ +package com.ruoyi.wisdomarbitrate.domain; + +import lombok.Data; + +@Data +public class Adjudication { + /** + * 申请人姓名 + */ + private String applicantName; + /** + * 申请人性别 + */ + private String applicantSex; + /** + * 申请人身份证号码 + */ + private String applicantIDNo; + /** + * 申请人住所 + */ + private String appAddress; + /** + * 申请人邮编 + */ + private String appZipCode; + /** + * 申请人组织名称 + */ + private String appOrgName; + /** + * 申请人组织地址 + */ + private String appOrgAddress; + /** + * 申请人法人姓名 + */ + private String appLegalPerName; + /** + * 申请人法人职务 + */ + private String appLegalPerJob; + /** + * 申请人代理人姓名 + */ + private String appAgentName; + /** + * 申请人代理人性别 + */ + private String appAgentSex; + /** + * 被申请人姓名 + */ + private String resName; + /** + * 被申请人性别 + */ + private String resSex; + /** + * 被申请人身份证号码 + */ + private String resIDNo; + /** + * 被申请人住所 + */ + private String resAddress; + /** + * 被申请人邮编 + */ + private String resZipCode; + /** + * 被申请人组织名称 + */ + private String resOrgName; + /** + * 被申请人组织地址 + */ + private String resOrgAddress; + /** + * 被申请人法人姓名 + */ + private String resLegalPerName; + /** + * 被申请人法人职务 + */ + private String resLegalPerJob; + /** + * 被申请人代理人姓名 + */ + private String resAgentName; + /** + * 被申请人代理人性别 + */ + private String resAgentSex; + /** + * 第三人姓名 + */ + private String thirdName; + /** + * 第三人性别 + */ + private String thirdSex; + + /** + * 第三人身份证 + */ + private String thirdDNo; + /** + * 第三人住所 + */ + private String thirdAddress; + /** + * 第三人邮编 + */ + private String thirdZipCode; + /** + * 第三人组织名称 + */ + private String thirdOrgName; + /** + * 第三人组织地址 + */ + private String thirdOrgAddress; + /** + * 第三人法人姓名 + */ + private String thirdLegalPerName; + /** + * 第三人法人职务 + */ + private String thirdLegalPerJob; + /** + * 第三人代理人姓名 + */ + private String thirdAgentName; + /** + * 第三人代理人性别 + */ + private String thirdAgentSex; + /** + * 案件描述 + */ + private String caseDescribe; + + /** + * 仲裁员名称 + */ + private String arbitratorName; + /** + * 开庭年 + */ + private String hearYear; + /** + * 开庭月 + */ + private String hearMonths; + /** + * 开庭日 + */ + private String hearDay; + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java new file mode 100644 index 0000000..c17ed82 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java @@ -0,0 +1,8 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; + +public interface IAdjudicationService { + AjaxResult createDocument(CaseApplication caseApplication); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java index 1f02239..0e66a10 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java @@ -5,7 +5,9 @@ import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; public interface ICaseArbitrateService { - AjaxResult chooseArbitrateMethod(CaseApplication caseApplication,Integer arbitratMethod); + AjaxResult writtenHear(ArbitrateRecord arbitrateRecord); + + AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java new file mode 100644 index 0000000..1ad7347 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -0,0 +1,46 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.deepoove.poi.config.Configure; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.WordUtil; +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; +import org.apache.poi.xwpf.usermodel.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +@Service +public class AdjudicationServiceImpl implements IAdjudicationService { + @Autowired + private CaseApplicationMapper caseApplicationMapper; + @Autowired + private CaseAffiliateMapper caseAffiliateMapper; + @Override + public AjaxResult createDocument(CaseApplication caseApplication) { + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + + try { + Map datas = new HashMap<>(); + datas.put("1", "张三"); + String modalFilePath = "D:/develop/ceshi.docx"; + String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; + String resultFilePath = "D:/data/" + fileName; + String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); + return AjaxResult.success("裁决书保存路径为"+docFilePath); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index 49bdea6..6735fc3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -31,52 +31,60 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { @Override @Transactional - public AjaxResult chooseArbitrateMethod(CaseApplication caseApplication, Integer arbitratMethod) { - if (arbitratMethod != null) { - String arbitratMethodStr = arbitratMethod == 1 ? "开庭审理" : "书面审理"; - //查询案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 == null) { - return AjaxResult.error(); + public AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion) { + //查询案件详细信息 + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplication1 == null) { + return AjaxResult.error(); + } + int arbitratMethod = caseApplication1.getArbitratMethod(); + String caseNum = caseApplication1.getCaseNum(); + if (opinion==0){ //拒绝 + switch (arbitratMethod) { + case 1: + caseApplication1.setArbitratMethod(2); // 更改仲裁方式 + break; + case 2: + caseApplication1.setArbitratMethod(1); + break; + default: + return AjaxResult.error(); } - String caseNum = caseApplication1.getCaseNum(); - //选择仲裁方式 - caseApplication.setArbitratMethod(arbitratMethod); - //修改案件状态为待开庭 - caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); - int i = caseApplicationMapper.submitCaseApplication(caseApplication); - if (i > 0) { - //发送短信通知 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1931000"); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication1.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - if (identityType == 1) { //申请人 - request.setPhone(affiliate.getContactTelphone()); - // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 - // 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr}); - SmsUtils.sendSms(request); - } else { //被申请人 - request.setPhone(affiliate.getContactTelphone()); - // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。 - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr}); - SmsUtils.sendSms(request); - } + } + //修改案件状态为待开庭 + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); + int i = caseApplicationMapper.submitCaseApplication(caseApplication1); + if (i > 0) { + String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理"; + //发送短信通知 + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + request.setTemplateId("1931000"); + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseApplication1.getId()); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 + if (caseAffiliates != null && caseAffiliates.size() > 0) { + for (CaseAffiliate affiliate : caseAffiliates) { + //获取身份类型 + int identityType = affiliate.getIdentityType(); + if (identityType == 1) { //申请人 + request.setPhone(affiliate.getContactTelphone()); + // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 + // 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。 + String name = affiliate.getName(); + request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr}); + SmsUtils.sendSms(request); + } else { //被申请人 + request.setPhone(affiliate.getContactTelphone()); + // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。 + String name = affiliate.getName(); + request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr}); + SmsUtils.sendSms(request); } } - return AjaxResult.success("选择成功"); } - + return AjaxResult.success("审核成功"); } - return AjaxResult.error("请选择开庭方式"); + return AjaxResult.error(); } @Override diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 0a37156..e51b8c7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -151,6 +151,12 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } //修改案件状态 caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT); + //选择仲裁方式 + if (caseEvidenceDTO.getOpenCourtHear()==1){ //开庭审理 + caseApplication1.setArbitratMethod(1); + }else { + caseApplication1.setArbitratMethod(2); //书面审理 + } int i = caseApplicationMapper.submitCaseApplication(caseApplication1); if (i > 0) { //案件日志表里添加数据 From 411d0e9ad93c9ff019bc39b09bc6f47f4bd59844 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Thu, 21 Sep 2023 19:25:50 +0800 Subject: [PATCH 034/123] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysLoginController.java | 12 ++++ .../IdentityAuthenticationController.java | 10 +-- .../domain/ArbitrateRecord.java | 2 + .../domain/IdentityAuthentication.java | 48 ++++++++++++-- .../mapper/IdentityAuthenticationMapper.java | 9 +++ .../IdentityAuthenticationService.java | 4 +- .../IdentityAuthenticationServiceImpl.java | 65 ++++--------------- .../wisdomarbitrate/ArbitrateRecordMapper.xml | 4 +- .../IdentityAuthenticationMapper.xml | 56 ++++++++++++++++ 9 files changed, 139 insertions(+), 71 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index d959a17..deef3b5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -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; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java index b5a9f49..51fafe0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java @@ -18,15 +18,7 @@ public class IdentityAuthenticationController extends BaseController { @Autowired private IdentityAuthenticationService identityAuthenticationService; - /** - * 查询身份证信息 - */ - @PostMapping("/selectIdentityInformation") - public AjaxResult selectIdentityInformation() - { - IdentityAuthentication identityAuthentication = identityAuthenticationService.selectIdentityInformation(); - return success(identityAuthentication); - } + diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java index d5779b8..74c5595 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java @@ -25,6 +25,8 @@ public class ArbitrateRecord extends BaseEntity { private String verificaOpinion; /** 审核裁决书意见 */ private String checkOpinion; + /** 裁决书附件id */ + private Long annexId; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java index f279419..12a3f85 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java @@ -19,7 +19,47 @@ public class IdentityAuthentication extends BaseEntity { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date certificationTime; /** 认证状态 */ - private int certificationStatus; + 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; + + 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; @@ -53,11 +93,5 @@ public class IdentityAuthentication extends BaseEntity { this.certificationTime = certificationTime; } - public int getCertificationStatus() { - return certificationStatus; - } - public void setCertificationStatus(int certificationStatus) { - this.certificationStatus = certificationStatus; - } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java index 20e5f6f..4800038 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java @@ -1,4 +1,13 @@ package com.ruoyi.wisdomarbitrate.mapper; +import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; +import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; + public interface IdentityAuthenticationMapper { + int insertIdentityAuthentication(IdentityAuthentication identityAuthentication); + IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication); + + + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java index fdab196..06d9b57 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java @@ -5,5 +5,7 @@ import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; public interface IdentityAuthenticationService { - IdentityAuthentication selectIdentityInformation(); + IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication); + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index 3940c49..18c508a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -38,62 +38,21 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio private static final Logger log = LoggerFactory.getLogger(IdentityAuthenticationServiceImpl.class); + @Override - public IdentityAuthentication selectIdentityInformation() { - /* IdentityAuthentication identityAuthentication = new IdentityAuthentication(); - try{ - Credential credIdentityAuthentication = new Credential(credentialSecretId, credentialSecretKey); - HttpProfile httpProfileIdentityAuthentication = new HttpProfile(); - httpProfileIdentityAuthentication.setEndpoint("ocr.tencentcloudapi.com"); - String imagePathIdentityAuthentication = "本地png/jpg文件的绝对地址"; - InputStream inputStreamIdentityAuthentication = null; - byte[] buffer = null; - //读取图片字节数组 - try { - inputStreamIdentityAuthentication = new FileInputStream(imagePathIdentityAuthentication); - int count = 0; - while (count == 0) { - count = inputStreamIdentityAuthentication.available(); - } - buffer = new byte[count]; - inputStreamIdentityAuthentication.read(buffer); - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (inputStreamIdentityAuthentication != null) { - try { - // 关闭inputStream流 - inputStreamIdentityAuthentication.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - String imageBase64IdentityAuthentication = Base64.getEncoder().encodeToString(buffer); - - ClientProfile clientProfileIdentityAuthentication = new ClientProfile(); - clientProfileIdentityAuthentication.setHttpProfile(httpProfileIdentityAuthentication); - OcrClient clientIdentityAuthentication = new OcrClient(credIdentityAuthentication, "ap-shanghai", clientProfileIdentityAuthentication); - RecognizeTableAccurateOCRRequest reqIdentityAuthentication = new RecognizeTableAccurateOCRRequest(); - reqIdentityAuthentication.setImageBase64(imageBase64IdentityAuthentication); - RecognizeTableAccurateOCRResponse respIdentityAuthentication = clientIdentityAuthentication.RecognizeTableAccurateOCR(reqIdentityAuthentication); - String stringRes = RecognizeTableAccurateOCRResponse.toJsonString(respIdentityAuthentication); - JSONObject stringObjectRes = (JSONObject) JSON.parse(stringRes); - JSONObject stringres = (JSONObject) stringObjectRes.get("Response"); - - - identityAuthentication.setName(stringres.get("name").toString()); - identityAuthentication.setIdentityNo(stringres.get("IdNum").toString()); - -// System.out.println(RecognizeTableAccurateOCRResponse.toJsonString(respIdentityAuthentication); - - } catch (TencentCloudSDKException e) { - log.error("身份认证失败", e); + public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) { + IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication); + if(identityAuthenticationselect!=null){ + identityAuthenticationselect.setCertificationStatusName("已身份注册"); + }else { + IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication(); + identityAuthenticationselectnew.setCertificationStatusName("未身份注册"); + return identityAuthenticationselectnew; } + return identityAuthenticationselect; - return identityAuthentication;*/ - return null; } + + } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml index c0079c7..795e630 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml @@ -13,6 +13,7 @@ + @@ -54,6 +55,7 @@ ruling_follows = #{rulingFollows}, verifica_opinion = #{verificaOpinion}, check_opinion = #{checkOpinion}, + annex_id = #{annexId}, update_by = #{updateBy}, update_time = sysdate() @@ -63,7 +65,7 @@ + SELECT i.id ,i.name ,i.identity_no ,i.certification_time ,i.certificationStatus ,i.user_id ,i.user_name + from identi_authenti i + + + AND i.user_name = #{userName} + + + AND i.user_id = #{userId} + + + + + From 76847fafb10d65dd4615d6a94f760ea61d4c4a3f Mon Sep 17 00:00:00 2001 From: hejinbo Date: Fri, 22 Sep 2023 14:43:39 +0800 Subject: [PATCH 035/123] =?UTF-8?q?=E6=9A=82=E6=97=B6=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 4 +- .../wisdomarbitrate/domain/Adjudication.java | 209 ++++++++++-------- .../service/impl/AdjudicationServiceImpl.java | 97 +++++++- .../impl/CallBackHandleServiceImpl.java | 1 + 4 files changed, 208 insertions(+), 103 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index e11b3d0..06fa6f1 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -143,8 +143,8 @@ elegent: alipay: appId: 2021003141676135 callback: - domain: http://121.40.189.20:9000/ - watch: false + domain: http://121.40.189.20:9001/ + watch: true cycle: 10 identityAuthentication: credentialSecretId: 123 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Adjudication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Adjudication.java index 0041958..75eb96e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Adjudication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Adjudication.java @@ -7,47 +7,28 @@ public class Adjudication { /** * 申请人姓名 */ - private String applicantName; + private String appName; /** * 申请人性别 */ - private String applicantSex; + private String appSex; /** * 申请人身份证号码 */ - private String applicantIDNo; + private String appIDNo; /** * 申请人住所 */ private String appAddress; - /** - * 申请人邮编 - */ - private String appZipCode; - /** - * 申请人组织名称 - */ - private String appOrgName; - /** - * 申请人组织地址 - */ - private String appOrgAddress; - /** - * 申请人法人姓名 - */ - private String appLegalPerName; - /** - * 申请人法人职务 - */ - private String appLegalPerJob; + /** * 申请人代理人姓名 */ private String appAgentName; /** - * 申请人代理人性别 + * 申请人代理人身份证 */ - private String appAgentSex; + private String appAgentIDNo; /** * 被申请人姓名 */ @@ -64,83 +45,20 @@ public class Adjudication { * 被申请人住所 */ private String resAddress; - /** - * 被申请人邮编 - */ - private String resZipCode; - /** - * 被申请人组织名称 - */ - private String resOrgName; - /** - * 被申请人组织地址 - */ - private String resOrgAddress; - /** - * 被申请人法人姓名 - */ - private String resLegalPerName; - /** - * 被申请人法人职务 - */ - private String resLegalPerJob; + /** * 被申请人代理人姓名 */ private String resAgentName; /** - * 被申请人代理人性别 + * 被申请人代理人身份证 */ - private String resAgentSex; - /** - * 第三人姓名 - */ - private String thirdName; - /** - * 第三人性别 - */ - private String thirdSex; + private String resAgentIDNo; /** - * 第三人身份证 + * 案件名称 */ - private String thirdDNo; - /** - * 第三人住所 - */ - private String thirdAddress; - /** - * 第三人邮编 - */ - private String thirdZipCode; - /** - * 第三人组织名称 - */ - private String thirdOrgName; - /** - * 第三人组织地址 - */ - private String thirdOrgAddress; - /** - * 第三人法人姓名 - */ - private String thirdLegalPerName; - /** - * 第三人法人职务 - */ - private String thirdLegalPerJob; - /** - * 第三人代理人姓名 - */ - private String thirdAgentName; - /** - * 第三人代理人性别 - */ - private String thirdAgentSex; - /** - * 案件描述 - */ - private String caseDescribe; + private String caseName; /** * 仲裁员名称 @@ -159,7 +77,112 @@ public class Adjudication { */ 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; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 1ad7347..a49ddad 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -3,8 +3,11 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.deepoove.poi.config.Configure; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.WordUtil; +import com.ruoyi.wisdomarbitrate.domain.Adjudication; +import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; @@ -16,9 +19,9 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.*; @Service public class AdjudicationServiceImpl implements IAdjudicationService { @@ -26,18 +29,96 @@ public class AdjudicationServiceImpl implements IAdjudicationService { private CaseApplicationMapper caseApplicationMapper; @Autowired private CaseAffiliateMapper caseAffiliateMapper; + @Autowired + private ArbitrateRecordMapper arbitrateRecordMapper; + @Override public AjaxResult createDocument(CaseApplication caseApplication) { - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - try { Map datas = new HashMap<>(); - datas.put("1", "张三"); - String modalFilePath = "D:/develop/ceshi.docx"; + Adjudication adjudication = new Adjudication(); + Long id = caseApplication.getId(); + if (id == null){ + return null; + } + //获取案件详细信息 + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + //获取仲裁记录表里的相关信息 + ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); + arbitrateRecord.setCaseAppliId(id); + ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); + + //获取案件关联人信息 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(id); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + if (caseAffiliates != null && caseAffiliates.size() > 0){ + for (CaseAffiliate affiliate : caseAffiliates){ + //获取身份类型 + int identityType = affiliate.getIdentityType(); + if (identityType == 1) { //申请人 + datas.put(adjudication.getAppName(), affiliate.getName()); + datas.put(adjudication.getAppSex(), null); + datas.put(adjudication.getAppIDNo(), affiliate.getIdentityNum()); + datas.put(adjudication.getAppAddress(), affiliate.getContactAddress()); + datas.put(adjudication.getAppAgentName(), affiliate.getNameAgent()); + datas.put(adjudication.getAppAgentIDNo(),affiliate.getIdentityNumAgent()); + }else if (identityType == 2){ //被申请人 + datas.put(adjudication.getResName(), affiliate.getName()); + datas.put(adjudication.getResSex(), null); + datas.put(adjudication.getResIDNo(), affiliate.getIdentityNum()); + datas.put(adjudication.getResAddress(), affiliate.getContactAddress()); + datas.put(adjudication.getResAgentName(), affiliate.getNameAgent()); + datas.put(adjudication.getResAgentName(),affiliate.getIdentityNumAgent()); + } + } + } + String arbitratorName = caseApplication1.getArbitratorName(); + datas.put(adjudication.getCaseName(),caseApplication1.getCaseName()); + datas.put(adjudication.getArbitratorName(),arbitratorName); + LocalDate localDate = caseApplication1.getHearDate() + .toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDate(); + datas.put(adjudication.getHearYear(), localDate.getYear()); + datas.put(adjudication.getHearMonths(), localDate.getMonthValue()); + datas.put(adjudication.getHearDay(), localDate.getDayOfMonth()); + datas.put(adjudication.getAppArbitrationClaims(), null); + datas.put(adjudication.getAppEvidenceName(), null); + datas.put(adjudication.getAppProveFacts(), null); + datas.put(adjudication.getResDefenseContentToApp(), null); + datas.put(adjudication.getResArbitrationClaims(), null); + datas.put(adjudication.getResEvidenceName(), null); + datas.put(adjudication.getResProveFacts(), null); + datas.put(adjudication.getAppDefenseContentToRes(), null); + datas.put(adjudication.getEvidenDetermi(), arbitrateRecord1.getEvidenDetermi()); + datas.put(adjudication.getFactDetermi(), arbitrateRecord1.getFactDetermi()); + datas.put(adjudication.getCaseSketch(), arbitrateRecord1.getCaseSketch()); + datas.put(adjudication.getArbitrateThink(), arbitrateRecord1.getArbitrateThink()); + datas.put(adjudication.getLegalProvisions(), null); + datas.put(adjudication.getRulingFollows(), arbitrateRecord1.getRulingFollows()); + datas.put(adjudication.getUmpire(), null); + if (arbitratorName.contains(",")){ + String[] nameArray = arbitratorName.split(","); + String firstName = nameArray[0]; + String secondName = nameArray[1]; + datas.put(adjudication.getArbitratorName1(), firstName); + datas.put(adjudication.getArbitratorName2(), secondName); + }else { + String secondName = ""; + datas.put(adjudication.getArbitratorName1(), arbitratorName); + datas.put(adjudication.getArbitratorName2(), secondName); + } + LocalDate now = LocalDate.now(); + datas.put(adjudication.getYear(), now.getYear()); + datas.put(adjudication.getMonths(), now.getMonthValue()); + datas.put(adjudication.getDay(), now.getDayOfMonth()); + datas.put(adjudication.getClerk(), null); + String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; String resultFilePath = "D:/data/" + fileName; String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); - return AjaxResult.success("裁决书保存路径为"+docFilePath); + return AjaxResult.success("裁决书保存路径为" + docFilePath); } catch (IOException e) { e.printStackTrace(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java index 4812468..dfa8aca 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Component; public class CallBackHandleServiceImpl implements CallBackService { @Autowired private CasePaymentServiceImpl casePaymentService; + @Override public void successPay(String orderSn) { casePaymentService.callback(orderSn); From 441dc6f8db7f78d624a2b42d0fdd2e4dfb551814 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 22 Sep 2023 14:59:02 +0800 Subject: [PATCH 036/123] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A1=88=E4=BB=B6?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/CaseApplication.java | 81 +++++++++++-------- .../impl/CaseApplicationServiceImpl.java | 7 ++ .../wisdomarbitrate/CaseApplicationMapper.xml | 28 ++++++- 3 files changed, 80 insertions(+), 36 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 01ad79a..cd65ab5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -24,7 +24,26 @@ public class CaseApplication extends BaseEntity { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date registerDate; /** 仲裁方式 */ - private int arbitratMethod; + 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; @@ -82,12 +101,37 @@ public class CaseApplication extends BaseEntity { private String caseDescribe; /** 是否同意组庭 */ - private int isAgreePendTral; + private Integer isAgreePendTral; /** 是否有异议需要举证 */ - private int objectionAddEviden; + private Integer objectionAddEviden; /** 是否需要开庭审理 */ - private int openCourtHear; + private Integer openCourtHear; + + 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; /** 是否同意审核 */ @@ -130,29 +174,7 @@ public class CaseApplication extends BaseEntity { this.respondentName = respondentName; } - public int getObjectionAddEviden() { - return objectionAddEviden; - } - public void setObjectionAddEviden(int objectionAddEviden) { - this.objectionAddEviden = objectionAddEviden; - } - - public int getOpenCourtHear() { - return openCourtHear; - } - - public void setOpenCourtHear(int openCourtHear) { - this.openCourtHear = openCourtHear; - } - - public int getIsAgreePendTral() { - return isAgreePendTral; - } - - public void setIsAgreePendTral(int isAgreePendTral) { - this.isAgreePendTral = isAgreePendTral; - } public String getCaseName() { return caseName; @@ -414,13 +436,6 @@ public class CaseApplication extends BaseEntity { this.registerDate = registerDate; } - public int getArbitratMethod() { - return arbitratMethod; - } - - public void setArbitratMethod(int arbitratMethod) { - this.arbitratMethod = arbitratMethod; - } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 973cf69..81e7b5d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -20,6 +20,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.lang.reflect.Field; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -53,6 +54,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public int insertcaseApplication(CaseApplication caseApplication) { // 新增立案信息 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + //根据仲裁费用计费规则计算应缴费用 + //暂时设置计费比率为0.01 + BigDecimal feeRate = new BigDecimal(0.01); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); + caseApplication.setFeePayable(feePayable); + int rows = caseApplicationMapper.insertCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); if(caseAffiliates!=null&&caseAffiliates.size()>0){ diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 8f09ff5..2c795cf 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -28,12 +28,20 @@ + + + + - select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,c.case_status ,c.hear_date ,c.arbitrat_claims , + select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , + CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' + ELSE '无审理方式' + END arbitratMethodName, + c.case_status , + CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' + when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' + when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' + when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' + when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' + when 15 then '待仲裁文书送达' when 16 then '待案件归档' + ELSE '无案件状态' + END caseStatusName, + c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , - c.update_by ,c.update_time + c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name from case_application c From 1f6c743356423730f53056716134496661ddaf6e Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 22 Sep 2023 17:03:26 +0800 Subject: [PATCH 037/123] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=8B=E6=A1=88?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=B5=81=E7=A8=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 10 ++++++ .../domain/CaseApplication.java | 21 +++++++++++++ .../mapper/CaseApplicationMapper.java | 2 ++ .../service/ICaseApplicationService.java | 2 ++ .../impl/CaseApplicationServiceImpl.java | 7 +++++ .../wisdomarbitrate/CaseApplicationMapper.xml | 31 +++++++++++++++++++ 6 files changed, 73 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index d7f04d9..14df926 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -206,6 +206,16 @@ public class CaseApplicationController extends BaseController { return toAjax(caseApplicationService.submitCaseApplicationCheck(caseApplication)); } + /** + * 确认缴费查询立案信息 + */ + @PostMapping("/selectCaseApplicationConfirm") + public AjaxResult selectCaseApplicationConfirm(@Validated @RequestBody CaseApplication caseApplication) + { + CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplicationConfirm(caseApplication); + return success(caseApplicationselect); + } + diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index cd65ab5..1965552 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -108,6 +108,27 @@ public class CaseApplication extends BaseEntity { /** 是否需要开庭审理 */ 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; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index f4c7bba..6b22045 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -20,4 +20,6 @@ public interface CaseApplicationMapper { int deletecaseApplication(CaseApplication caseApplication); CaseApplication selectCaseApplication(CaseApplication caseApplication); + + CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 4d58d60..d5d3708 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -35,4 +35,6 @@ public interface ICaseApplicationService { int checkArbitrateRecord(CaseApplication caseApplication); int submitCaseApplicationCheck(CaseApplication caseApplication); + + CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 81e7b5d..a381578 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -310,6 +310,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return rows; } + @Override + public CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication) { + CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplicationConfirm(caseApplication); + + return caseApplicationselect; + } + @Override @Transactional public int pendTralSure(CaseApplication caseApplication) { diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 2c795cf..f847b20 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -32,6 +32,8 @@ + + @@ -153,6 +155,7 @@ case_status = #{caseStatus}, update_by = #{updateBy}, + case_num = #{caseNum}, update_time = sysdate() where id = #{id} @@ -207,6 +210,34 @@ + + From b4549fa2cc48bde6d894d4610f53df5321906cb6 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Sat, 23 Sep 2023 10:51:08 +0800 Subject: [PATCH 038/123] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/ArbitrateRecord.java | 2 +- .../wisdomarbitrate/domain/CaseAttach.java | 2 +- .../service/impl/AdjudicationServiceImpl.java | 123 +++++++++++------- .../impl/CaseArbitrateServiceImpl.java | 13 +- .../wisdomarbitrate/CaseAttachMapper.xml | 2 +- 5 files changed, 80 insertions(+), 62 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java index 74c5595..967f9b4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java @@ -26,7 +26,7 @@ public class ArbitrateRecord extends BaseEntity { /** 审核裁决书意见 */ private String checkOpinion; /** 裁决书附件id */ - private Long annexId; + private Integer annexId; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index bce1776..9827fc7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -9,7 +9,7 @@ import lombok.NoArgsConstructor; @Builder @AllArgsConstructor @NoArgsConstructor -public class CaseAttach { +public class CaseAttach { /** * 附件id */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index a49ddad..332fbde 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -3,24 +3,23 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.deepoove.poi.config.Configure; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.WordUtil; -import com.ruoyi.wisdomarbitrate.domain.Adjudication; -import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; -import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import org.apache.poi.xwpf.usermodel.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; import java.time.LocalDate; import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.*; @Service @@ -31,6 +30,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { private CaseAffiliateMapper caseAffiliateMapper; @Autowired private ArbitrateRecordMapper arbitrateRecordMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; @Override public AjaxResult createDocument(CaseApplication caseApplication) { @@ -57,67 +58,89 @@ public class AdjudicationServiceImpl implements IAdjudicationService { //获取身份类型 int identityType = affiliate.getIdentityType(); if (identityType == 1) { //申请人 - datas.put(adjudication.getAppName(), affiliate.getName()); - datas.put(adjudication.getAppSex(), null); - datas.put(adjudication.getAppIDNo(), affiliate.getIdentityNum()); - datas.put(adjudication.getAppAddress(), affiliate.getContactAddress()); - datas.put(adjudication.getAppAgentName(), affiliate.getNameAgent()); - datas.put(adjudication.getAppAgentIDNo(),affiliate.getIdentityNumAgent()); + datas.put("appName", affiliate.getName()); + datas.put("appSex", null); + datas.put("appIDNo", affiliate.getIdentityNum()); + datas.put("appAddress", affiliate.getContactAddress()); + datas.put("appAgentName", affiliate.getNameAgent()); + datas.put("appAgentIDNo",affiliate.getIdentityNumAgent()); }else if (identityType == 2){ //被申请人 - datas.put(adjudication.getResName(), affiliate.getName()); - datas.put(adjudication.getResSex(), null); - datas.put(adjudication.getResIDNo(), affiliate.getIdentityNum()); - datas.put(adjudication.getResAddress(), affiliate.getContactAddress()); - datas.put(adjudication.getResAgentName(), affiliate.getNameAgent()); - datas.put(adjudication.getResAgentName(),affiliate.getIdentityNumAgent()); + datas.put("resName", affiliate.getName()); + datas.put("resSex", null); + datas.put("resIDNo", affiliate.getIdentityNum()); + datas.put("resAddress", affiliate.getContactAddress()); + datas.put("resAgentName", affiliate.getNameAgent()); + datas.put("resAgentIDNo",affiliate.getIdentityNumAgent()); } } } String arbitratorName = caseApplication1.getArbitratorName(); - datas.put(adjudication.getCaseName(),caseApplication1.getCaseName()); - datas.put(adjudication.getArbitratorName(),arbitratorName); + datas.put("caseName",caseApplication1.getCaseName()); + datas.put("arbitratorName",arbitratorName); LocalDate localDate = caseApplication1.getHearDate() .toInstant() .atZone(ZoneId.systemDefault()) .toLocalDate(); - datas.put(adjudication.getHearYear(), localDate.getYear()); - datas.put(adjudication.getHearMonths(), localDate.getMonthValue()); - datas.put(adjudication.getHearDay(), localDate.getDayOfMonth()); - datas.put(adjudication.getAppArbitrationClaims(), null); - datas.put(adjudication.getAppEvidenceName(), null); - datas.put(adjudication.getAppProveFacts(), null); - datas.put(adjudication.getResDefenseContentToApp(), null); - datas.put(adjudication.getResArbitrationClaims(), null); - datas.put(adjudication.getResEvidenceName(), null); - datas.put(adjudication.getResProveFacts(), null); - datas.put(adjudication.getAppDefenseContentToRes(), null); - datas.put(adjudication.getEvidenDetermi(), arbitrateRecord1.getEvidenDetermi()); - datas.put(adjudication.getFactDetermi(), arbitrateRecord1.getFactDetermi()); - datas.put(adjudication.getCaseSketch(), arbitrateRecord1.getCaseSketch()); - datas.put(adjudication.getArbitrateThink(), arbitrateRecord1.getArbitrateThink()); - datas.put(adjudication.getLegalProvisions(), null); - datas.put(adjudication.getRulingFollows(), arbitrateRecord1.getRulingFollows()); - datas.put(adjudication.getUmpire(), null); + datas.put("hearYear", localDate.getYear()); + datas.put("hearMonths", localDate.getMonthValue()); + datas.put("hearDay", localDate.getDayOfMonth()); + datas.put("appArbitrationClaims", null); + datas.put("appEvidenceName", null); + datas.put("appProveFacts", null); + datas.put("resDefenseContentToApp", null); + datas.put("resArbitrationClaims", null); + datas.put("resEvidenceName", null); + datas.put("resProveFacts", null); + datas.put("appDefenseContentToRes", null); + datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi()); + datas.put("factDetermi", arbitrateRecord1.getFactDetermi()); + datas.put("caseSketch", arbitrateRecord1.getCaseSketch()); + datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink()); + datas.put("legalProvisions", null); + datas.put("rulingFollows", arbitrateRecord1.getRulingFollows()); + datas.put("umpire", null); if (arbitratorName.contains(",")){ String[] nameArray = arbitratorName.split(","); String firstName = nameArray[0]; String secondName = nameArray[1]; - datas.put(adjudication.getArbitratorName1(), firstName); - datas.put(adjudication.getArbitratorName2(), secondName); + datas.put("arbitratorName1", firstName); + datas.put("arbitratorName2", secondName); }else { String secondName = ""; - datas.put(adjudication.getArbitratorName1(), arbitratorName); - datas.put(adjudication.getArbitratorName2(), secondName); + datas.put("arbitratorName1", arbitratorName); + datas.put("arbitratorName2", secondName); } LocalDate now = LocalDate.now(); - datas.put(adjudication.getYear(), now.getYear()); - datas.put(adjudication.getMonths(), now.getMonthValue()); - datas.put(adjudication.getDay(), now.getDayOfMonth()); - datas.put(adjudication.getClerk(), null); - String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; + datas.put("year", now.getYear()); + datas.put("months", now.getMonthValue()); + datas.put("day", now.getDayOfMonth()); + datas.put("clerk", null); + String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; + + String currentDateStr = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + String saveFolderPath = "/data/arbitrate-document/formal/" + currentDateStr; + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; - String resultFilePath = "D:/data/" + fileName; + String resultFilePath = saveFolderPath+ fileName; String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); + //将裁决书保存到附件表里 + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(id) + .annexName(fileName) + .annexPath(docFilePath) + .annexType(3) + .build(); + int i = caseAttachMapper.save(caseAttach); + if (i>0){ + Integer annexId = caseAttach.getAnnexId(); + //将附件id保存到仲裁记录表里面 + arbitrateRecord1.setAnnexId(annexId); + arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); + } return AjaxResult.success("裁决书保存路径为" + docFilePath); } catch (IOException e) { e.printStackTrace(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index 6735fc3..a1c589e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -40,15 +40,10 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { int arbitratMethod = caseApplication1.getArbitratMethod(); String caseNum = caseApplication1.getCaseNum(); if (opinion==0){ //拒绝 - switch (arbitratMethod) { - case 1: - caseApplication1.setArbitratMethod(2); // 更改仲裁方式 - break; - case 2: - caseApplication1.setArbitratMethod(1); - break; - default: - return AjaxResult.error(); + if (arbitratMethod == 2){ + caseApplication1.setArbitratMethod(1); // 更改仲裁方式 + }else { + caseApplication1.setArbitratMethod(2); } } //修改案件状态为待开庭 diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index 5d7714d..d3dc194 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -13,7 +13,7 @@ - + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account) VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName}) From 3be770a718e3d82db47de969a3cc37d642b54726 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Mon, 25 Sep 2023 17:21:18 +0800 Subject: [PATCH 039/123] =?UTF-8?q?9.25=E4=BF=AE=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=94=B9=E5=8A=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AdjudicationServiceImpl.java | 86 ++++++++++--------- .../impl/CaseArbitrateServiceImpl.java | 63 ++++++++++---- .../service/impl/CasePaymentServiceImpl.java | 2 +- 3 files changed, 95 insertions(+), 56 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 332fbde..74e5b92 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.deepoove.poi.config.Configure; +import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.WordUtil; import com.ruoyi.wisdomarbitrate.domain.*; @@ -37,7 +38,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService { public AjaxResult createDocument(CaseApplication caseApplication) { try { Map datas = new HashMap<>(); - Adjudication adjudication = new Adjudication(); Long id = caseApplication.getId(); if (id == null){ return null; @@ -59,14 +59,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService { int identityType = affiliate.getIdentityType(); if (identityType == 1) { //申请人 datas.put("appName", affiliate.getName()); - datas.put("appSex", null); datas.put("appIDNo", affiliate.getIdentityNum()); datas.put("appAddress", affiliate.getContactAddress()); datas.put("appAgentName", affiliate.getNameAgent()); datas.put("appAgentIDNo",affiliate.getIdentityNumAgent()); }else if (identityType == 2){ //被申请人 datas.put("resName", affiliate.getName()); - datas.put("resSex", null); datas.put("resIDNo", affiliate.getIdentityNum()); datas.put("resAddress", affiliate.getContactAddress()); datas.put("resAgentName", affiliate.getNameAgent()); @@ -77,35 +75,38 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String arbitratorName = caseApplication1.getArbitratorName(); datas.put("caseName",caseApplication1.getCaseName()); datas.put("arbitratorName",arbitratorName); - LocalDate localDate = caseApplication1.getHearDate() - .toInstant() - .atZone(ZoneId.systemDefault()) - .toLocalDate(); - datas.put("hearYear", localDate.getYear()); - datas.put("hearMonths", localDate.getMonthValue()); - datas.put("hearDay", localDate.getDayOfMonth()); - datas.put("appArbitrationClaims", null); - datas.put("appEvidenceName", null); - datas.put("appProveFacts", null); - datas.put("resDefenseContentToApp", null); - datas.put("resArbitrationClaims", null); - datas.put("resEvidenceName", null); - datas.put("resProveFacts", null); - datas.put("appDefenseContentToRes", null); - datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi()); - datas.put("factDetermi", arbitrateRecord1.getFactDetermi()); - datas.put("caseSketch", arbitrateRecord1.getCaseSketch()); - datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink()); - datas.put("legalProvisions", null); - datas.put("rulingFollows", arbitrateRecord1.getRulingFollows()); - datas.put("umpire", null); - if (arbitratorName.contains(",")){ + Date hearDate = caseApplication1.getHearDate(); + if (hearDate != null) { + LocalDate localDate = hearDate.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDate(); + datas.put("hearYear", localDate.getYear()); + datas.put("hearMonths", localDate.getMonthValue()); + datas.put("hearDay", localDate.getDayOfMonth()); + }else { + datas.put("hearYear", null); + datas.put("hearMonths", null); + datas.put("hearDay", null); + } + datas.put("appArbitrationClaims", caseApplication1.getArbitratClaims()); + if (arbitrateRecord1!=null){ + datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi()); + datas.put("factDetermi", arbitrateRecord1.getFactDetermi()); + datas.put("caseSketch", arbitrateRecord1.getCaseSketch()); + datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink()); + datas.put("rulingFollows", arbitrateRecord1.getRulingFollows()); + } + datas.put("legalProvisions", "仲裁法"); + if (arbitratorName==null){ + datas.put("arbitratorName1", null); + datas.put("arbitratorName2", null); + }else if (arbitratorName.contains(",")){ String[] nameArray = arbitratorName.split(","); String firstName = nameArray[0]; String secondName = nameArray[1]; datas.put("arbitratorName1", firstName); datas.put("arbitratorName2", secondName); - }else { + } else { String secondName = ""; datas.put("arbitratorName1", arbitratorName); datas.put("arbitratorName2", secondName); @@ -114,19 +115,24 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("year", now.getYear()); datas.put("months", now.getMonthValue()); datas.put("day", now.getDayOfMonth()); - datas.put("clerk", null); String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; - - String currentDateStr = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); - String saveFolderPath = "/data/arbitrate-document/formal/" + currentDateStr; + //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; + String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); + //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); + String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; + String resultFilePath = saveFolderPath + "/" + fileName; // 创建日期目录 File saveFolder = new File(saveFolderPath); if (!saveFolder.exists()) { saveFolder.mkdirs(); } - String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; - String resultFilePath = saveFolderPath+ fileName; - String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); + Path sourcePath = new File(modalFilePath).toPath(); + Path destinationPath = new File(resultFilePath).toPath(); + Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); + String docFilePath = WordUtil.getDocFilePath(datas,modalFilePath,resultFilePath); + //修改案件状态 + caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + caseApplicationMapper.submitCaseApplication(caseApplication1); //将裁决书保存到附件表里 CaseAttach caseAttach = CaseAttach.builder() .caseAppliId(id) @@ -136,12 +142,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService { .build(); int i = caseAttachMapper.save(caseAttach); if (i>0){ - Integer annexId = caseAttach.getAnnexId(); - //将附件id保存到仲裁记录表里面 - arbitrateRecord1.setAnnexId(annexId); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); + if (arbitrateRecord1!=null){ + Integer annexId = caseAttach.getAnnexId(); + //将附件id保存到仲裁记录表里面 + arbitrateRecord1.setAnnexId(annexId); + arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); + } } - return AjaxResult.success("裁决书保存路径为" + docFilePath); + return AjaxResult.success("裁决书已生成"); } catch (IOException e) { e.printStackTrace(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index a1c589e..f480e65 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -42,12 +42,22 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { if (opinion==0){ //拒绝 if (arbitratMethod == 2){ caseApplication1.setArbitratMethod(1); // 更改仲裁方式 + //修改案件状态为待开庭审理 + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); }else { caseApplication1.setArbitratMethod(2); + //修改案件状态为待书面审理 + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); + } + }else { + if (arbitratMethod == 2){ + //修改案件状态为待书面审理 + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); + }else { + //修改案件状态为待开庭审理 + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); } } - //修改案件状态为待开庭 - caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); int i = caseApplicationMapper.submitCaseApplication(caseApplication1); if (i > 0) { String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理"; @@ -92,21 +102,42 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { if (createBy!=null){ arbitrateRecord.setCreateBy(createBy); } - //提交仲裁结果 - int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord); - if (i>0){ - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication1.getId()); - caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); - if (createBy!=null){ - caseLogRecord.setCreateBy(createBy); + //先判断案件是否已经提交过仲裁结果 + ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); + if (arbitrateRecord1!=null){ + int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); + if (i>0){ + //案件日志表里添加数据 + CaseLogRecord caseLogRecord = new CaseLogRecord(); + caseLogRecord.setCaseAppliId(caseApplication1.getId()); + caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); + if (createBy!=null){ + caseLogRecord.setCreateBy(createBy); + } + caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); + //修改案件状态 + caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION); + caseApplicationMapper.submitCaseApplication(caseApplication); + return AjaxResult.success("提交成功"); + } + }else { + //提交仲裁结果 + int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord); + + if (i>0){ + //案件日志表里添加数据 + CaseLogRecord caseLogRecord = new CaseLogRecord(); + caseLogRecord.setCaseAppliId(caseApplication1.getId()); + caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); + if (createBy!=null){ + caseLogRecord.setCreateBy(createBy); + } + caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); + //修改案件状态 + caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION); + caseApplicationMapper.submitCaseApplication(caseApplication); + return AjaxResult.success("提交成功"); } - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - //修改案件状态 - caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION); - caseApplicationMapper.submitCaseApplication(caseApplication); - return AjaxResult.success("提交成功"); } return AjaxResult.error("暂无需要提交仲裁结果的案件"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 6a8c746..95a7d7c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -85,7 +85,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); //修改案件状态 caseApplicationMapper.submitCaseApplication(caseApplication1); - return AjaxResult.success(); + return AjaxResult.success("支付成功"); } @Override From e97418f979b09eecb97a6a69948bafc19d1f01df Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Tue, 26 Sep 2023 14:52:17 +0800 Subject: [PATCH 040/123] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=AB=8B=E6=A1=88?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/CaseApplication.java | 33 +++++++++++++ .../mapper/CaseAttachMapper.java | 6 +++ .../impl/CaseApplicationServiceImpl.java | 48 +++++++++++++++---- .../service/impl/CaseEvidenceServiceImpl.java | 12 +++-- .../wisdomarbitrate/CaseAttachMapper.xml | 29 +++++++++++ 5 files changed, 115 insertions(+), 13 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 1965552..673a8ff 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -263,6 +263,39 @@ public class CaseApplication extends BaseEntity { private List caseStatusList; + private List annexTypeList; + + private Integer annexType; + + public Integer getAnnexType() { + return annexType; + } + + public void setAnnexType(Integer annexType) { + this.annexType = annexType; + } + + public List getAnnexTypeList() { + return annexTypeList; + } + + public void setAnnexTypeList(List annexTypeList) { + this.annexTypeList = annexTypeList; + } + + /** + * 案件附件列表 + */ + private List caseAttachList; + + public List getCaseAttachList() { + return caseAttachList; + } + + public void setCaseAttachList(List caseAttachList) { + this.caseAttachList = caseAttachList; + } + public List getCaseStatusList() { return caseStatusList; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 03ea3b2..0be609e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -1,5 +1,6 @@ package com.ruoyi.wisdomarbitrate.mapper; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import java.util.List; @@ -8,4 +9,9 @@ public interface CaseAttachMapper { int save(CaseAttach caseAttach); List queryAnnexPathByCaseId(Long id); + + List queryCaseAttachList(CaseApplication caseApplication); + + + int updateCaseAttach(CaseAttach caseAttach); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index a381578..a1400ab 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -6,14 +6,8 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.bean.BeanUtils; -import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; -import com.ruoyi.wisdomarbitrate.domain.Arbitrator; -import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper; -import com.ruoyi.wisdomarbitrate.mapper.ArbitratorMapper; -import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; -import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -42,6 +36,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Autowired private ArbitrateRecordMapper arbitrateRecordMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; + + + @Override public List selectCaseApplicationList(CaseApplication caseApplication) { @@ -69,6 +68,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); } + List caseAttachList = caseApplication.getCaseAttachList(); + if(caseAttachList!=null&&caseAttachList.size()>0){ + for (CaseAttach caseAttach : caseAttachList){ + caseAttach.setCaseAppliId(caseApplication.getId()); + caseAttachMapper.updateCaseAttach(caseAttach); + } + + } + return rows; } @@ -118,6 +126,30 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { arbitrateRecord.setCaseAppliId(caseApplication.getId()); ArbitrateRecord arbitrateRecordselect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); +// CaseAttach caseAttachSelect = new CaseAttach(); +// caseAttachSelect.setCaseAppliId(caseApplication.getId()); +// caseAttachSelect.setAnnexType(2); + + List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); + if (caseAttachList != null && caseAttachList.size() > 0) { + for (CaseAttach caseAttach : caseAttachList) { + String annexName = caseAttach.getAnnexName(); + String prefix = "/profile"; + int startIndex = annexName.indexOf(prefix); + startIndex += prefix.length(); + String annexPath = "/uploadPath" + annexName.substring(startIndex); + caseAttach.setAnnexPath(annexPath); + int startIndexnew = annexName.lastIndexOf("/"); + if(startIndexnew!=-1){ + String annexNamenew = annexName.substring(startIndexnew+1); + caseAttach.setAnnexName(annexNamenew); + } + + + } + } + caseApplicationselect.setCaseAttachList(caseAttachList); + List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if(caseAffiliatListeselect!=null){ StringBuffer applicantName = new StringBuffer(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index e51b8c7..218fbab 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -98,11 +98,13 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { .build(); int count = caseAttachMapper.save(caseAttach); if (count > 0) { - //修改案件状态 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - caseApplication.setCaseStatus(4); - caseApplicationMapper.submitCaseApplication(caseApplication); + if(id!=null){ + //修改案件状态 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + caseApplication.setCaseStatus(4); + caseApplicationMapper.submitCaseApplication(caseApplication); + } return AjaxResult.success("上传成功"); } } catch (IOException e) { diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index d3dc194..b3e38a0 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -22,4 +22,33 @@ from case_attach where case_appli_id =#{id} + + + + + update case_attach + set + case_appli_id= #{caseAppliId} + where annexId = #{annex_id} + + + + \ No newline at end of file From 3fc79deee0ca7c14ca1e623c0b6963ce3791dc96 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Tue, 26 Sep 2023 15:07:15 +0800 Subject: [PATCH 041/123] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 10 +++++ .../com/ruoyi/common/utils/SendMailUtils.java | 41 +++++++++++++++++++ .../java/com/ruoyi/common/utils/WordUtil.java | 3 +- .../service/IAdjudicationService.java | 3 ++ .../service/impl/AdjudicationServiceImpl.java | 5 +++ 5 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 9d2ce64..8b861b6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -16,8 +16,18 @@ import org.springframework.web.bind.annotation.RestController; 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); } + @PostMapping("/") + public AjaxResult sendDocumentByEmail(){ + return adjudicationService.sendDocumentByEmail(); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java new file mode 100644 index 0000000..216e77a --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java @@ -0,0 +1,41 @@ +package com.ruoyi.common.utils; + +import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.mail.javamail.MimeMessageHelper; +// +//import java.io.File; +//import java.util.List; +// +//public class SendMailUtils { +// /** +// * 发送带附件的邮件 +// * +// * @param to 收件人 +// * @param subject 主题 +// * @param content 内容 +// * @param fileList 附件 +// */ +// public void sendFileMail(String to, String subject, String content, List fileList) { +// MimeMessage message = mailSender.createMimeMessage(); +// try { +// //true表示需要创建一个multipart message +// MimeMessageHelper helper = new MimeMessageHelper(message, true); +// helper.setFrom(SENDER); +// helper.setTo(to); +// helper.setSubject(subject); +// helper.setText(content, true); +// +// if (fileList != null && fileList.size() > 0) { +// for (File file : fileList) { +// FileSystemResource fileSystemResource = new FileSystemResource(file); +// String fileName = fileSystemResource.getFilename(); +// helper.addAttachment(fileName, fileSystemResource); +// } +// } +// mailSender.send(message); +// } catch (MessagingException e) { +// System.out.println("发送带附件的邮件时发生异常!" + e); +// } +// } +//} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java index cef0386..af78611 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java @@ -19,8 +19,7 @@ import java.util.List; import java.util.Map; /** - * @Author: ymbgy - * @Date: 2022-09-21 13:26 + * 文档生成工具类 */ public class WordUtil { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java index c17ed82..9d9c4bb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java @@ -5,4 +5,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication; public interface IAdjudicationService { AjaxResult createDocument(CaseApplication caseApplication); + + AjaxResult sendDocumentByEmail(); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 74e5b92..d621364 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -155,4 +155,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } return null; } + + @Override + public AjaxResult sendDocumentByEmail() { + return null; + } } \ No newline at end of file From 9622060ac69ade2e00aa689f9d60baf8a44a18a7 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Tue, 26 Sep 2023 15:27:31 +0800 Subject: [PATCH 042/123] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=AB=8B=E6=A1=88=E7=94=B3=E8=AF=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CaseEvidenceServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 218fbab..d9e07a3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -105,7 +105,11 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { caseApplication.setCaseStatus(4); caseApplicationMapper.submitCaseApplication(caseApplication); } - return AjaxResult.success("上传成功"); + CaseAttach caseAttachselect = new CaseAttach(); + caseAttachselect.setAnnexId(caseAttach.getAnnexId()); + caseAttachselect.setAnnexName(caseAttach.getAnnexName()); + caseAttachselect.setAnnexType(caseAttach.getAnnexType()); + return AjaxResult.success("上传成功",caseAttach); } } catch (IOException e) { e.printStackTrace(); From c60ad9f3fc5b2e1ed22b0af35ffc6f88851f2806 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Tue, 26 Sep 2023 15:40:00 +0800 Subject: [PATCH 043/123] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 25 +++++++++++++++++++ ruoyi-common/pom.xml | 7 ++++++ .../com/ruoyi/common/utils/SendMailUtils.java | 18 +++++++++---- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 06fa6f1..17c2d28 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -91,6 +91,31 @@ spring: web: resources: static-locations: file:/home/ruoyi/ + mail: + # 邮件服务地址 + host: smtp.163.com + # 默认端口25,可不写 + port: 25 + # 编码格式 + default-encoding: utf-8 + # 发送者用户名 + username: xxx@163.com + # 授权码,刚才获取的代码 + password: xxx + # 其它参数 + # properties: + # mail: + # smtp: + # # 如果是用 SSL 方式,需要配置如下属性 + # ssl: + # enable: true + # required: true + # # 邮件接收时间的限制,单位毫秒 + # timeout: 10000 + # # 连接时间的限制,单位毫秒 + # connectiontimeout: 10000 + # # 邮件发送时间的限制,单位毫秒 + # writetimeout: 10000 # token配置 token: diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 5307193..7f49eaa 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -152,6 +152,13 @@ 1.9.1 + + + org.springframework.boot + spring-boot-starter-mail + 3.1.4 + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java index 216e77a..71cba3e 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java @@ -1,13 +1,21 @@ -package com.ruoyi.common.utils; - -import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException; -import org.springframework.core.io.FileSystemResource; -import org.springframework.mail.javamail.MimeMessageHelper; +//package com.ruoyi.common.utils; +// +// +//import jakarta.mail.internet.MimeMessage; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.core.io.FileSystemResource; +//import org.springframework.mail.javamail.JavaMailSender; +//import org.springframework.mail.javamail.MimeMessageHelper; +//import org.springframework.stereotype.Component; // //import java.io.File; //import java.util.List; // +//@Component //public class SendMailUtils { +// private static final String SENDER = "xxx@163.com"; +// @Autowired +// private JavaMailSender mailSender; // /** // * 发送带附件的邮件 // * From 626ec17b45a246e30f0ab945b5b4a0af54f9ee97 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 27 Sep 2023 13:28:32 +0800 Subject: [PATCH 044/123] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IdentityAuthenticationController.java | 10 ++++ .../src/main/resources/application.yml | 3 +- ruoyi-common/pom.xml | 4 +- .../wisdomarbitrate/domain/CaseAffiliate.java | 21 +++++++++ .../domain/IdentityAuthentication.java | 32 +++++++++++++ .../IdentityAuthenticationService.java | 2 + .../service/impl/CaseEvidenceServiceImpl.java | 2 +- .../IdentityAuthenticationServiceImpl.java | 46 +++++++++++++++++-- 8 files changed, 111 insertions(+), 9 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java index 51fafe0..1824d89 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java @@ -18,6 +18,16 @@ public class IdentityAuthenticationController extends BaseController { @Autowired private IdentityAuthenticationService identityAuthenticationService; + /** + * 查询身份认证EIDtoken + */ + @PostMapping("/selectIdentityAuthenticaEIDtoken") + public AjaxResult selectIdentityAuthenticaEIDtoken() + { + IdentityAuthentication ientityAuthentication = identityAuthenticationService.selectIdentityAuthenticaEIDtoken(); + return success(ientityAuthentication); + } + diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 06fa6f1..f6f6226 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -148,4 +148,5 @@ elegent: cycle: 10 identityAuthentication: credentialSecretId: 123 - credentialSecretKey: 367 \ No newline at end of file + credentialSecretKey: 367 + merchantId: 356 \ No newline at end of file diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 5307193..6d9d0a9 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -141,8 +141,8 @@ com.tencentcloudapi - tencentcloud-sdk-java-ocr - 3.1.701 + tencentcloud-sdk-java-faceid + 3.1.871 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java index 719b699..e7721e9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java @@ -44,6 +44,27 @@ public class CaseAffiliate extends BaseEntity { @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; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java index 12a3f85..ce47855 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java @@ -45,6 +45,38 @@ public class IdentityAuthentication extends BaseEntity { /** 用户账号 */ 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; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java index 06d9b57..9b362a2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; +import com.tencentcloudapi.common.exception.TencentCloudSDKException; public interface IdentityAuthenticationService { @@ -8,4 +9,5 @@ public interface IdentityAuthenticationService { IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication); + IdentityAuthentication selectIdentityAuthenticaEIDtoken(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index d9e07a3..546993c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -109,7 +109,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { caseAttachselect.setAnnexId(caseAttach.getAnnexId()); caseAttachselect.setAnnexName(caseAttach.getAnnexName()); caseAttachselect.setAnnexType(caseAttach.getAnnexType()); - return AjaxResult.success("上传成功",caseAttach); + return AjaxResult.success("上传成功",caseAttachselect); } } catch (IOException e) { e.printStackTrace(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index 18c508a..5a594e9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -1,7 +1,9 @@ package com.ruoyi.wisdomarbitrate.service.impl; -import com.alibaba.fastjson2.JSON; -import com.alibaba.fastjson2.JSONObject; + + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper; @@ -11,9 +13,9 @@ 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.ocr.v20181119.OcrClient; -import com.tencentcloudapi.ocr.v20181119.models.RecognizeTableAccurateOCRRequest; -import com.tencentcloudapi.ocr.v20181119.models.RecognizeTableAccurateOCRResponse; +import com.tencentcloudapi.faceid.v20180301.FaceidClient; +import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenRequest; +import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -32,6 +34,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio private String credentialSecretId; @Value("${identityAuthentication.credentialSecretKey}") private String credentialSecretKey; + @Value("${identityAuthentication.merchantId}") + private String merchantId; + +// private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp"; +// private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V"; @Autowired private IdentityAuthenticationMapper identityAuthenticationMapper; @@ -53,6 +60,35 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio } + @Override + public IdentityAuthentication selectIdentityAuthenticaEIDtoken() { + IdentityAuthentication identityAuthentication = new IdentityAuthentication(); + try{ + // Credential credIdenAuth = new Credential(SECRET_ID, SECRET_KEY); + Credential credIdenAuth = new Credential(credentialSecretId, credentialSecretKey); + HttpProfile httpProfileIdenAuth = new HttpProfile(); + httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com"); + ClientProfile clientProfileIdenAuth = new ClientProfile(); + clientProfileIdenAuth.setHttpProfile(httpProfileIdenAuth); + FaceidClient clientIdenAuth = new FaceidClient(credIdenAuth, "", clientProfileIdenAuth); + // 实例化一个请求对象 + GetEidTokenRequest reqIdenAuth = new GetEidTokenRequest(); + //设置请求参数 + reqIdenAuth.setMerchantId(merchantId); + GetEidTokenResponse respIdenAuth = clientIdenAuth.GetEidToken(reqIdenAuth); + String respJSON = GetEidTokenResponse.toJsonString(respIdenAuth); + JSONObject objJSON = JSON.parseObject(respJSON); + JSONObject objJSONRes = (JSONObject) objJSON.get("Response"); + String eidToken = objJSONRes.getString("EidToken"); + String requestId = objJSONRes.getString("RequestId"); + identityAuthentication.setEidToken(eidToken); + }catch (TencentCloudSDKException e) { + System.out.println(e.toString()); + } + + return identityAuthentication; + + } } From c484a45822ac1e4f0780b1957339e8c09672f1ba Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 27 Sep 2023 15:17:28 +0800 Subject: [PATCH 045/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AB=8B=E6=A1=88?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IdentityAuthenticationServiceImpl.java | 14 +++++++------- .../mapper/wisdomarbitrate/CaseAttachMapper.xml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index 5a594e9..08ca024 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -65,17 +65,17 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio IdentityAuthentication identityAuthentication = new IdentityAuthentication(); try{ // Credential credIdenAuth = new Credential(SECRET_ID, SECRET_KEY); - Credential credIdenAuth = new Credential(credentialSecretId, credentialSecretKey); + Credential authenti = new Credential(credentialSecretId, credentialSecretKey); HttpProfile httpProfileIdenAuth = new HttpProfile(); httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com"); - ClientProfile clientProfileIdenAuth = new ClientProfile(); - clientProfileIdenAuth.setHttpProfile(httpProfileIdenAuth); - FaceidClient clientIdenAuth = new FaceidClient(credIdenAuth, "", clientProfileIdenAuth); + ClientProfile clientInv= new ClientProfile(); + clientInv.setHttpProfile(httpProfileIdenAuth); + FaceidClient clientIdenAuth = new FaceidClient(authenti, "", clientInv); // 实例化一个请求对象 - GetEidTokenRequest reqIdenAuth = new GetEidTokenRequest(); + GetEidTokenRequest reqest = new GetEidTokenRequest(); //设置请求参数 - reqIdenAuth.setMerchantId(merchantId); - GetEidTokenResponse respIdenAuth = clientIdenAuth.GetEidToken(reqIdenAuth); + reqest.setMerchantId(merchantId); + GetEidTokenResponse respIdenAuth = clientIdenAuth.GetEidToken(reqest); String respJSON = GetEidTokenResponse.toJsonString(respIdenAuth); JSONObject objJSON = JSON.parseObject(respJSON); JSONObject objJSONRes = (JSONObject) objJSON.get("Response"); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index b3e38a0..5b9b821 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -46,7 +46,7 @@ update case_attach set case_appli_id= #{caseAppliId} - where annexId = #{annex_id} + where annex_id = #{annexId} From 2a147f119ec620d0e2793b6513b540d913834d25 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Wed, 27 Sep 2023 15:33:53 +0800 Subject: [PATCH 046/123] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 30 ++- .../src/main/resources/application.yml | 30 +-- ruoyi-common/pom.xml | 15 ++ .../com/ruoyi/common/utils/EmailOutUtil.java | 187 ++++++++++++++++++ .../com/ruoyi/common/utils/SendMailUtils.java | 49 ----- .../service/IAdjudicationService.java | 3 +- .../service/impl/AdjudicationServiceImpl.java | 138 ++++++++++--- 7 files changed, 346 insertions(+), 106 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java delete mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 8b861b6..024a64e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -6,10 +6,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication; 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.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/adjudication") @@ -26,8 +23,27 @@ public class AdjudicationController extends BaseController { public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.createDocument(caseApplication); } - @PostMapping("/") - public AjaxResult sendDocumentByEmail(){ - return adjudicationService.sendDocumentByEmail(); + + /** + * 裁决书送达(电子邮件) + * @param id 案件id + * @param appEmail 申请人邮箱 + * @param resEmail 被申请人邮箱 + * @return + */ + @PostMapping("/delivery") + public AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail){ + return adjudicationService.sendDocumentByEmail(id,appEmail,resEmail); + } + + /** + * 根据快递单号查询物流信息 + * @param trackingNum 单号 + * @param phoneLastFour 收/寄件人手机号后四位,顺丰快递需填写本字段。 + * @return + */ + @GetMapping("/logistics") + public AjaxResult getLogisticsInfo(String trackingNum,Integer phoneLastFour){ + return adjudicationService.getLogisticsInfo(trackingNum,phoneLastFour); } } diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 17c2d28..b82b349 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -92,30 +92,16 @@ spring: resources: static-locations: file:/home/ruoyi/ mail: - # 邮件服务地址 host: smtp.163.com - # 默认端口25,可不写 port: 25 - # 编码格式 - default-encoding: utf-8 - # 发送者用户名 - username: xxx@163.com - # 授权码,刚才获取的代码 - password: xxx - # 其它参数 - # properties: - # mail: - # smtp: - # # 如果是用 SSL 方式,需要配置如下属性 - # ssl: - # enable: true - # required: true - # # 邮件接收时间的限制,单位毫秒 - # timeout: 10000 - # # 连接时间的限制,单位毫秒 - # connectiontimeout: 10000 - # # 邮件发送时间的限制,单位毫秒 - # writetimeout: 10000 + username: hjbjava@163.com + password: BSRSSEPJWGNNVYYL + default-encoding: UTF-8 + properties: + mail: + smtp: + socketFactoryClass: javax.net.ssl.SSLSocketFactory + debug: false # token配置 token: diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 7f49eaa..4efdee7 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -159,6 +159,21 @@ 3.1.4 + + javax.activation + activation + 1.1.1 + + + + + javax.mail + mail + 1.4.7 + + + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java new file mode 100644 index 0000000..f796034 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java @@ -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 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; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java deleted file mode 100644 index 71cba3e..0000000 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java +++ /dev/null @@ -1,49 +0,0 @@ -//package com.ruoyi.common.utils; -// -// -//import jakarta.mail.internet.MimeMessage; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.core.io.FileSystemResource; -//import org.springframework.mail.javamail.JavaMailSender; -//import org.springframework.mail.javamail.MimeMessageHelper; -//import org.springframework.stereotype.Component; -// -//import java.io.File; -//import java.util.List; -// -//@Component -//public class SendMailUtils { -// private static final String SENDER = "xxx@163.com"; -// @Autowired -// private JavaMailSender mailSender; -// /** -// * 发送带附件的邮件 -// * -// * @param to 收件人 -// * @param subject 主题 -// * @param content 内容 -// * @param fileList 附件 -// */ -// public void sendFileMail(String to, String subject, String content, List fileList) { -// MimeMessage message = mailSender.createMimeMessage(); -// try { -// //true表示需要创建一个multipart message -// MimeMessageHelper helper = new MimeMessageHelper(message, true); -// helper.setFrom(SENDER); -// helper.setTo(to); -// helper.setSubject(subject); -// helper.setText(content, true); -// -// if (fileList != null && fileList.size() > 0) { -// for (File file : fileList) { -// FileSystemResource fileSystemResource = new FileSystemResource(file); -// String fileName = fileSystemResource.getFilename(); -// helper.addAttachment(fileName, fileSystemResource); -// } -// } -// mailSender.send(message); -// } catch (MessagingException e) { -// System.out.println("发送带附件的邮件时发生异常!" + e); -// } -// } -//} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java index 9d9c4bb..675cc72 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java @@ -6,6 +6,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication; public interface IAdjudicationService { AjaxResult createDocument(CaseApplication caseApplication); - AjaxResult sendDocumentByEmail(); + AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail); + AjaxResult getLogisticsInfo(String trackingNum,Integer phoneLastFour); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index d621364..87072c8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.deepoove.poi.config.Configure; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.EmailOutUtil; import com.ruoyi.common.utils.WordUtil; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper; @@ -12,9 +13,14 @@ import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import org.apache.poi.xwpf.usermodel.*; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mail.MailSendException; +import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service; import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; @@ -25,6 +31,8 @@ import java.util.*; @Service public class AdjudicationServiceImpl implements IAdjudicationService { + private final String apiUrl = "http://api.cainiaoapi.com/api/exp/v1/index"; + @Autowired private CaseApplicationMapper caseApplicationMapper; @Autowired @@ -33,13 +41,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService { private ArbitrateRecordMapper arbitrateRecordMapper; @Autowired private CaseAttachMapper caseAttachMapper; + @Autowired + private EmailOutUtil emailOutUtil; @Override public AjaxResult createDocument(CaseApplication caseApplication) { try { Map datas = new HashMap<>(); Long id = caseApplication.getId(); - if (id == null){ + if (id == null) { return null; } //获取案件详细信息 @@ -53,8 +63,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(id); List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0){ - for (CaseAffiliate affiliate : caseAffiliates){ + if (caseAffiliates != null && caseAffiliates.size() > 0) { + for (CaseAffiliate affiliate : caseAffiliates) { //获取身份类型 int identityType = affiliate.getIdentityType(); if (identityType == 1) { //申请人 @@ -62,34 +72,34 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("appIDNo", affiliate.getIdentityNum()); datas.put("appAddress", affiliate.getContactAddress()); datas.put("appAgentName", affiliate.getNameAgent()); - datas.put("appAgentIDNo",affiliate.getIdentityNumAgent()); - }else if (identityType == 2){ //被申请人 + datas.put("appAgentIDNo", affiliate.getIdentityNumAgent()); + } else if (identityType == 2) { //被申请人 datas.put("resName", affiliate.getName()); datas.put("resIDNo", affiliate.getIdentityNum()); datas.put("resAddress", affiliate.getContactAddress()); datas.put("resAgentName", affiliate.getNameAgent()); - datas.put("resAgentIDNo",affiliate.getIdentityNumAgent()); + datas.put("resAgentIDNo", affiliate.getIdentityNumAgent()); } } } String arbitratorName = caseApplication1.getArbitratorName(); - datas.put("caseName",caseApplication1.getCaseName()); - datas.put("arbitratorName",arbitratorName); + datas.put("caseName", caseApplication1.getCaseName()); + datas.put("arbitratorName", arbitratorName); Date hearDate = caseApplication1.getHearDate(); if (hearDate != null) { LocalDate localDate = hearDate.toInstant() .atZone(ZoneId.systemDefault()) .toLocalDate(); - datas.put("hearYear", localDate.getYear()); - datas.put("hearMonths", localDate.getMonthValue()); - datas.put("hearDay", localDate.getDayOfMonth()); - }else { - datas.put("hearYear", null); - datas.put("hearMonths", null); - datas.put("hearDay", null); + datas.put("hearYear", localDate.getYear()); + datas.put("hearMonths", localDate.getMonthValue()); + datas.put("hearDay", localDate.getDayOfMonth()); + } else { + datas.put("hearYear", null); + datas.put("hearMonths", null); + datas.put("hearDay", null); } - datas.put("appArbitrationClaims", caseApplication1.getArbitratClaims()); - if (arbitrateRecord1!=null){ + datas.put("appArbitrationClaims", caseApplication1.getArbitratClaims()); + if (arbitrateRecord1 != null) { datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi()); datas.put("factDetermi", arbitrateRecord1.getFactDetermi()); datas.put("caseSketch", arbitrateRecord1.getCaseSketch()); @@ -97,10 +107,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("rulingFollows", arbitrateRecord1.getRulingFollows()); } datas.put("legalProvisions", "仲裁法"); - if (arbitratorName==null){ + if (arbitratorName == null) { datas.put("arbitratorName1", null); datas.put("arbitratorName2", null); - }else if (arbitratorName.contains(",")){ + } else if (arbitratorName.contains(",")) { String[] nameArray = arbitratorName.split(","); String firstName = nameArray[0]; String secondName = nameArray[1]; @@ -115,10 +125,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("year", now.getYear()); datas.put("months", now.getMonthValue()); datas.put("day", now.getDayOfMonth()); - String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; - //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; - String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); - //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); + //String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; + String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; + //String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); + String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; String resultFilePath = saveFolderPath + "/" + fileName; // 创建日期目录 @@ -129,7 +139,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { Path sourcePath = new File(modalFilePath).toPath(); Path destinationPath = new File(resultFilePath).toPath(); Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); - String docFilePath = WordUtil.getDocFilePath(datas,modalFilePath,resultFilePath); + String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); //修改案件状态 caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); caseApplicationMapper.submitCaseApplication(caseApplication1); @@ -141,8 +151,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { .annexType(3) .build(); int i = caseAttachMapper.save(caseAttach); - if (i>0){ - if (arbitrateRecord1!=null){ + if (i > 0) { + if (arbitrateRecord1 != null) { Integer annexId = caseAttach.getAnnexId(); //将附件id保存到仲裁记录表里面 arbitrateRecord1.setAnnexId(annexId); @@ -157,7 +167,81 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } @Override - public AjaxResult sendDocumentByEmail() { + public AjaxResult sendDocumentByEmail(Long id, String appEmail, String resEmail) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplication1 == null) { + return AjaxResult.error("未查询到相关案件"); + } + + //根据案件id查询裁决书 + try { + List fileList = new ArrayList<>(); + List caseAttachList = caseAttachMapper.queryAnnexPathByCaseId(id); + if (caseAttachList != null && caseAttachList.size() > 0) { + for (CaseAttach caseAttach : caseAttachList) { + if (caseAttach.getAnnexType() == 3) { + String annexPath = caseAttach.getAnnexPath(); + fileList.add(new File(annexPath)); + } + } + } + //电子邮件送达 + JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); + if (appEmail != null) { + emailOutUtil.sendMessageCarryFiles(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", fileList + , "hjbjava@163.com", javaMailSender); + } + if (resEmail != null) { + emailOutUtil.sendMessageCarryFiles(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", fileList + , "hjbjava@163.com", javaMailSender); + } + //修改案件状态 + caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); + caseApplicationMapper.submitCaseApplication(caseApplication1); + return AjaxResult.success("仲裁文书送达成功"); + } catch (MailSendException e) { + return AjaxResult.error("发送失败,请检查文件路径"); + } + } + + @Override + public AjaxResult getLogisticsInfo(String trackingNum, Integer phoneLastFour) { + try { + //快递单号查询 + String key = "70ba5c7b327f71fccd5924f70e3e7b7f"; + String com = "auto"; + // 构造查询字符串参数 + String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d", + URLEncoder.encode(key, "UTF-8"), + URLEncoder.encode(com, "UTF-8"), + URLEncoder.encode(trackingNum, "UTF-8"), + phoneLastFour); + // 拼接到API URL中 + String fullUrl = apiUrl + "?" + queryParameters; + URL url = new URL(fullUrl); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + int responseCode = connection.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + String line; + StringBuilder response = new StringBuilder(); + while ((line = reader.readLine()) != null) { + response.append(line); + } + reader.close(); + // 处理返回的响应数据 + return AjaxResult.success(response); + } else { + // 请求失败 + return AjaxResult.error("请求失败,错误码:" + responseCode); + } + } catch (IOException e) { + e.printStackTrace(); + + } return null; } } \ No newline at end of file From 1e5dc3670f37981457a877c777bd9a86f6efbf3e Mon Sep 17 00:00:00 2001 From: hejinbo Date: Wed, 27 Sep 2023 15:38:24 +0800 Subject: [PATCH 047/123] =?UTF-8?q?9.27=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/service/impl/AdjudicationServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 87072c8..4b4b4c0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -240,7 +240,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } catch (IOException e) { e.printStackTrace(); - } return null; } From 3ac814358901df1bc7af07028b353cea4918ec24 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Sat, 30 Sep 2023 14:00:07 +0800 Subject: [PATCH 048/123] =?UTF-8?q?9.30=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 7 +++- .../service/IAdjudicationService.java | 2 +- .../service/impl/AdjudicationServiceImpl.java | 37 +++++++++++++++---- .../wisdomarbitrate/CaseAffiliateMapper.xml | 5 ++- .../wisdomarbitrate/CaseApplicationMapper.xml | 2 +- 5 files changed, 41 insertions(+), 12 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 024a64e..0c3b451 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -29,11 +29,14 @@ public class AdjudicationController extends BaseController { * @param id 案件id * @param appEmail 申请人邮箱 * @param resEmail 被申请人邮箱 + * @param apptrackingNum 申请人快递单号 + * @param restrackingNum 被申请人快递单号 * @return */ @PostMapping("/delivery") - public AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail){ - return adjudicationService.sendDocumentByEmail(id,appEmail,resEmail); + public AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail + ,String apptrackingNum,String restrackingNum){ + return adjudicationService.sendDocumentByEmail(id,appEmail,resEmail,apptrackingNum,restrackingNum); } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java index 675cc72..416e92c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java @@ -6,7 +6,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication; public interface IAdjudicationService { AjaxResult createDocument(CaseApplication caseApplication); - AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail); + AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum); AjaxResult getLogisticsInfo(String trackingNum,Integer phoneLastFour); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 4b4b4c0..9fff3eb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.MailSendException; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.io.*; import java.net.HttpURLConnection; @@ -125,10 +126,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("year", now.getYear()); datas.put("months", now.getMonthValue()); datas.put("day", now.getDayOfMonth()); - //String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; - String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; - //String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); - String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); + String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; + //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; + String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); + //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; String resultFilePath = saveFolderPath + "/" + fileName; // 创建日期目录 @@ -167,7 +168,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } @Override - public AjaxResult sendDocumentByEmail(Long id, String appEmail, String resEmail) { + @Transactional + public AjaxResult sendDocumentByEmail(Long id, String appEmail, String resEmail ,String apptrackingNum,String restrackingNum) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); @@ -187,19 +189,40 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } } + if (fileList.size()<1){ + return AjaxResult.error("未查询到裁决书"); + } + File file = fileList.get(0); //电子邮件送达 JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); if (appEmail != null) { - emailOutUtil.sendMessageCarryFiles(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", fileList + emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file , "hjbjava@163.com", javaMailSender); } if (resEmail != null) { - emailOutUtil.sendMessageCarryFiles(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", fileList + emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file , "hjbjava@163.com", javaMailSender); } //修改案件状态 caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); caseApplicationMapper.submitCaseApplication(caseApplication1); + //保存邮箱信息和快递单号到关联人表 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(id); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + if (caseAffiliates!=null&&caseAffiliates.size()>0){ + for (CaseAffiliate affiliate : caseAffiliates) { + if (affiliate.getIdentityType() == 1){ //申请人 + affiliate.setSendEmail(appEmail); + affiliate.setTrackNum(apptrackingNum); + caseAffiliateMapper.updataCaseAffiliate(affiliate); + }else { + affiliate.setSendEmail(resEmail); + affiliate.setTrackNum(restrackingNum); + caseAffiliateMapper.updataCaseAffiliate(affiliate); + } + } + } return AjaxResult.success("仲裁文书送达成功"); } catch (MailSendException e) { return AjaxResult.error("发送失败,请检查文件路径"); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index c1a9fd0..974b9f6 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -60,7 +60,10 @@ name_agent = #{nameAgent}, identity_num_agent = #{identityNumAgent}, contact_telphone_agent = #{contactTelphoneAgent}, - contact_address_agent = #{contactAddressAgent} + contact_address_agent = #{contactAddressAgent}, + send_email = #{sendEmail}, + track_num = #{trackNum} + where id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index f847b20..3875dca 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -55,7 +55,7 @@ c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , - c.update_by ,c.update_time + c.update_by ,c.update_time , c.arbitrator_name from case_application c From 3a8b23f4823f0ebe6882737d02fc3b6fcc3f7d77 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Tue, 3 Oct 2023 13:40:56 +0800 Subject: [PATCH 049/123] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IdentityAuthenticationController.java | 14 +++ .../src/main/resources/application.yml | 7 +- ruoyi-common/pom.xml | 12 +++ .../IdentityAuthenticationService.java | 2 + .../IdentityAuthenticationServiceImpl.java | 97 +++++++++++++++++-- .../IdentityAuthenticationMapper.xml | 6 +- 6 files changed, 125 insertions(+), 13 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java index 1824d89..f097a64 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java @@ -28,6 +28,20 @@ public class IdentityAuthenticationController extends BaseController { 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); + } + diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 56c9e74..822641d 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -158,6 +158,7 @@ elegent: watch: true cycle: 10 identityAuthentication: - credentialSecretId: 123 - credentialSecretKey: 367 - merchantId: 356 \ No newline at end of file + credentialSecretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv + credentialSecretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7 + merchantId: 0NSJ2309281116194321 + privateKeyHexDecodeinfo: MHcCAQEEIEw7MRv3uYlpmU6Fko4GlXSh6Vd38k0cUQZ5zDwvRg+voAoGCCqBHM9VAYItoUQDQgAEUdxIAWhGg4LUXf1GoPdb8XMbGudpexPQCuaaRi9BCnNbpaF1kcwRhhsBKvop9ZmW/nOz4wQ1r/iIEOrc9qCXgQ== \ No newline at end of file diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index c327de4..3b55c2b 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -145,6 +145,18 @@ 3.1.871 + + cn.hutool + hutool-all + 5.7.15 + + + + org.bouncycastle + bcprov-jdk15to18 + 1.69 + + com.deepoove diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java index 9b362a2..3748942 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java @@ -10,4 +10,6 @@ public interface IdentityAuthenticationService { IdentityAuthentication selectIdentityAuthenticaEIDtoken(); + + IdentityAuthentication selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index 08ca024..b76fcda 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -2,9 +2,14 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.crypto.SmUtil; +import cn.hutool.crypto.asymmetric.SM2; +import cn.hutool.crypto.symmetric.SymmetricCrypto; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.exceptions.TradeException; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; @@ -14,6 +19,8 @@ import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.common.profile.ClientProfile; import com.tencentcloudapi.common.profile.HttpProfile; import com.tencentcloudapi.faceid.v20180301.FaceidClient; +import com.tencentcloudapi.faceid.v20180301.models.GetEidResultRequest; +import com.tencentcloudapi.faceid.v20180301.models.GetEidResultResponse; import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenRequest; import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenResponse; import org.slf4j.Logger; @@ -21,11 +28,14 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Base64; +import java.util.HashMap; +import java.util.Map; @Service public class IdentityAuthenticationServiceImpl implements IdentityAuthenticationService { @@ -36,9 +46,9 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio private String credentialSecretKey; @Value("${identityAuthentication.merchantId}") private String merchantId; + @Value("${identityAuthentication.privateKeyHexDecodeinfo}") + private String privateKeyHexDecodeinfo; -// private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp"; -// private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V"; @Autowired private IdentityAuthenticationMapper identityAuthenticationMapper; @@ -64,7 +74,6 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio public IdentityAuthentication selectIdentityAuthenticaEIDtoken() { IdentityAuthentication identityAuthentication = new IdentityAuthentication(); try{ - // Credential credIdenAuth = new Credential(SECRET_ID, SECRET_KEY); Credential authenti = new Credential(credentialSecretId, credentialSecretKey); HttpProfile httpProfileIdenAuth = new HttpProfile(); httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com"); @@ -78,17 +87,91 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio GetEidTokenResponse respIdenAuth = clientIdenAuth.GetEidToken(reqest); String respJSON = GetEidTokenResponse.toJsonString(respIdenAuth); JSONObject objJSON = JSON.parseObject(respJSON); - JSONObject objJSONRes = (JSONObject) objJSON.get("Response"); - String eidToken = objJSONRes.getString("EidToken"); - String requestId = objJSONRes.getString("RequestId"); + String eidToken = objJSON.getString("EidToken"); + String requestId = objJSON.getString("RequestId"); identityAuthentication.setEidToken(eidToken); }catch (TencentCloudSDKException e) { - System.out.println(e.toString()); + log.error("获取Eidtoke异常:", e); + throw new RuntimeException("获取Eidtoke异常"); } return identityAuthentication; } + @Override + @Transactional + public IdentityAuthentication selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication) { + String eidToken = ientityAuthentication.getEidToken(); + Long userId = ientityAuthentication.getUserId(); + String userName = ientityAuthentication.getUserName(); + IdentityAuthentication IdentityAuthenticationRespon = new IdentityAuthentication(); + IdentityAuthentication IdentityAuthenticationResult = new IdentityAuthentication(); + if(StringUtils.isNotEmpty(eidToken)){ + try{ + Credential authenti = new Credential(credentialSecretId, credentialSecretKey); + HttpProfile httpProfileIdenAuth = new HttpProfile(); + httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com"); + ClientProfile clientInv= new ClientProfile(); + clientInv.setHttpProfile(httpProfileIdenAuth); + FaceidClient clientIdenAuth = new FaceidClient(authenti, "", clientInv); + // 实例化一个请求对象 + GetEidResultRequest reqest = new GetEidResultRequest(); + //设置请求参数 + reqest.setEidToken(eidToken); + //获得身份认证结果 + GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest); + String respJSON = GetEidResultResponse.toJsonString(respIdenAuth); + JSONObject objJSON = JSON.parseObject(respJSON); + JSONObject objText = JSON.parseObject(objJSON.getString("Text")); + String name = objText.getString("OcrName"); +// IdentityAuthenticationRespon.setName(name); + String identityNo = objText.getString("OcrIdCard"); +// IdentityAuthenticationRespon.setIdentityNo(identityNo); + IdentityAuthenticationRespon.setCertificationStatus(1); + IdentityAuthenticationRespon.setUserName(userName); + IdentityAuthenticationRespon.setUserId(userId); + + JSONObject objEidInfo = JSON.parseObject(objJSON.getString("EidInfo")); + String desKey = objEidInfo.getString("DesKey"); + String uerInfo = objEidInfo.getString("UserInfo"); + Map mapEidInfo = decodeEidInfo(desKey,uerInfo); + IdentityAuthenticationRespon.setName(mapEidInfo.get("name")); + IdentityAuthenticationRespon.setIdentityNo(mapEidInfo.get("identityNo")); + + identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon); +// IdentityAuthenticationResult.setUserName(userName); + IdentityAuthenticationResult.setCertificationStatus(1); + IdentityAuthenticationResult.setCertificationStatusName("认证成功"); +// IdentityAuthenticationResult.setName(name); +// IdentityAuthenticationResult.setIdentityNo(identityNo); + System.out.println(GetEidResultResponse.toJsonString(respIdenAuth)); + } catch (TencentCloudSDKException e) { + log.error("认证失败:", e); + throw new RuntimeException("认证失败"); + } + + } + return IdentityAuthenticationResult; + } + + private Map decodeEidInfo(String desKey, String uerInfo) { + Map mapEidInfo = new HashMap<>(); + byte[] deskeybyts = Base64.getDecoder().decode(desKey); + final SM2 sm2crypt = new SM2(privateKeyHexDecodeinfo, null, null); + sm2crypt.usePlainEncoding(); + byte[] sm4keybys = sm2crypt.decrypt(deskeybyts); + SymmetricCrypto sm4dcrypt = SmUtil.sm4(sm4keybys); + byte[] uerInfobytes = sm4dcrypt.decrypt(Base64.getDecoder().decode(uerInfo)); + JSONObject objuerInfo = JSON.parseObject(new String(uerInfobytes)); + String name = objuerInfo.getString("name"); + mapEidInfo.put("name",name); + String idtype = objuerInfo.getString("idtype"); + mapEidInfo.put("identitytype",idtype); + String idnum = objuerInfo.getString("idnum"); + mapEidInfo.put("identityNo",idnum); + return mapEidInfo; + } + } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml index 55cb676..946acea 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml @@ -19,7 +19,7 @@ user_id, name, identity_no, - certification_time, + certification_time, certification_status, user_name, create_by, @@ -28,8 +28,8 @@ #{userId}, #{name}, #{identityNo}, - #{certificationTime}, - #{certificationStatus}, + sysdate(), + #{certificationStatus}, #{userName}, #{createBy}, sysdate() From 7afc0248197030dc85c0133561829c1a246c6ae1 Mon Sep 17 00:00:00 2001 From: gy b Date: Thu, 5 Oct 2023 12:25:52 +0800 Subject: [PATCH 050/123] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=8A=E4=B8=8A?= =?UTF-8?q?=E7=AD=BE=E4=B8=AA=E4=BA=BA=E7=94=A8=E6=88=B7=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bestsign/RegisterController.java | 30 ++ .../src/main/resources/application.yml | 5 + .../ruoyi/bestsign/domain/CredentialVO.java | 22 + .../bestsign/domain/PersonRegisterVO.java | 29 ++ .../bestsign/service/SignRegisterService.java | 14 + .../service/impl/RegisterServiceImpl.java | 39 ++ .../bestsign/utils/BestsignOpenApiClient.java | 148 +++++++ .../bestsign/utils/HttpClientSender.java | 390 ++++++++++++++++++ .../com/ruoyi/bestsign/utils/RSAUtils.java | 281 +++++++++++++ 9 files changed, 958 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/CredentialVO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/PersonRegisterVO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/service/SignRegisterService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/RegisterServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/HttpClientSender.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/RSAUtils.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java new file mode 100644 index 0000000..eef7abd --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java @@ -0,0 +1,30 @@ +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 com.ruoyi.wisdomarbitrate.domain.CaseApplication; +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); + } +} diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 822641d..cbbed36 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -102,6 +102,11 @@ spring: 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: http://openapi.bestsign.info/openapi/v2/ # token配置 token: diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/CredentialVO.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/CredentialVO.java new file mode 100644 index 0000000..c9fba91 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/CredentialVO.java @@ -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; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/PersonRegisterVO.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/PersonRegisterVO.java new file mode 100644 index 0000000..159bcd4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/PersonRegisterVO.java @@ -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; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/SignRegisterService.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/SignRegisterService.java new file mode 100644 index 0000000..e0eb419 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/SignRegisterService.java @@ -0,0 +1,14 @@ +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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/RegisterServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/RegisterServiceImpl.java new file mode 100644 index 0000000..d00cdf9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/RegisterServiceImpl.java @@ -0,0 +1,39 @@ +package com.ruoyi.bestsign.service.impl; + + +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 { + String s = bestsignOpenApiClient.userPersonalReg(personRegisterVO.getAccount(), + personRegisterVO.getName(), + personRegisterVO.getMail(), + personRegisterVO.getMobile(), + personRegisterVO.getCredential().getIdentity(), + personRegisterVO.getCredential().getIdentityType(), + null, null, null, null, null); + AjaxResult.success(s); + } catch (Exception e) { + e.printStackTrace(); + return AjaxResult.error(e.getMessage()); + } + return AjaxResult.success(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java new file mode 100644 index 0000000..7c09e67 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java @@ -0,0 +1,148 @@ +package com.ruoyi.bestsign.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +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 地址 + * @return 异步申请任务单号 + * @throws IOException + */ + public String userPersonalReg(String account, String name, String mail, + String mobile, String identity, String identityType, + String contactMail, String contactMobile, String province, + String city, String address) throws Exception { + String host = this.serverHost; + String method = "/user/reg/"; + + // 组装请求参数,作为requestbody + 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); + credential.put("contactMail", contactMail); + credential.put("contactMobile", contactMobile); + credential.put("province", province); + credential.put("city", city); + credential.put("address", address); + requestBody.put("credential", credential); + //是否申请证书 + requestBody.put("applyCert", "2"); + // 生成一个时间戳参数 + 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); + // 返回errno为0,表示成功,其他表示失败 + if (userObj.getIntValue("errno") == 0) { + JSONObject data = userObj.getJSONObject("data"); + if (data != null) { + //对返回data进行处理 + String taskId = data.getString("taskId"); + return taskId; + } + } else { + //接口返回异常 + System.out.println(userObj.getIntValue("errno")); + System.out.println(userObj.getString("errmsg")); + } + return userObj.toJSONString(); + } + + /** + * 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; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/HttpClientSender.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/HttpClientSender.java new file mode 100644 index 0000000..3a1af73 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/HttpClientSender.java @@ -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 httpClients = new HashMap(); + + 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 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 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 request(String method, String url, Object sendData, Map 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 response = null; + if ("POST".equals(method)) { + response = sendPost(httpClient, url, headers, sendData); + } else { + response = sendGet(httpClient, url, headers); + } + return response; + } + + private static Map sendPost(CloseableHttpClient httpClient, String url, Map 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 response = new HashMap(); + response.put("responseCode", responseCode); + response.put("responseData", responseBytes); + String loggerResponseString = getLoggerString(responseBytes, 256); + return response; + } + + private static Map sendGet(CloseableHttpClient httpClient, String url, Map 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 response = new HashMap(); + 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 socketFactoryRegistry = RegistryBuilder.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; + } + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/RSAUtils.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/RSAUtils.java new file mode 100644 index 0000000..957e1fb --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/RSAUtils.java @@ -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 mySignedURLParams = new TreeMap(); + 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); + } + } +} From ba49e0e01825a592e91c26049fb7a003726875db Mon Sep 17 00:00:00 2001 From: gy b Date: Thu, 5 Oct 2023 20:03:21 +0800 Subject: [PATCH 051/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E4=B8=8A?= =?UTF-8?q?=E7=AD=BE=E4=B8=AA=E4=BA=BA=E7=94=A8=E6=88=B7=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=8A=B6=E6=80=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bestsign/RegisterController.java | 1 - .../src/main/resources/application.yml | 2 +- .../bestsign/service/SignRegisterService.java | 4 + .../service/impl/RegisterServiceImpl.java | 30 +++++++- .../bestsign/utils/BestsignOpenApiClient.java | 74 +++++++++++-------- 5 files changed, 74 insertions(+), 37 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java index eef7abd..6e349cb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java @@ -3,7 +3,6 @@ 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 com.ruoyi.wisdomarbitrate.domain.CaseApplication; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index cbbed36..9e15e95 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -106,7 +106,7 @@ spring: 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: http://openapi.bestsign.info/openapi/v2/ + serverHost: https://openapi.bestsign.info/openapi/v2/ # token配置 token: diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/SignRegisterService.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/SignRegisterService.java index e0eb419..e72b247 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/SignRegisterService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/SignRegisterService.java @@ -11,4 +11,8 @@ public interface SignRegisterService { * @return */ AjaxResult registerPerson(PersonRegisterVO personRegisterVO); + /** + * 查询用户认证状态/user/async/applyCert/status/ + */ + AjaxResult queryRegisterStatus(PersonRegisterVO personRegisterVO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/RegisterServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/RegisterServiceImpl.java index d00cdf9..3a731fa 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/RegisterServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/RegisterServiceImpl.java @@ -1,6 +1,7 @@ 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; @@ -22,14 +23,37 @@ public class RegisterServiceImpl implements SignRegisterService { @Override public AjaxResult registerPerson(PersonRegisterVO personRegisterVO) { try { - String s = bestsignOpenApiClient.userPersonalReg(personRegisterVO.getAccount(), + JSONObject jsonObject = bestsignOpenApiClient.userPersonalReg(personRegisterVO.getAccount(), personRegisterVO.getName(), personRegisterVO.getMail(), personRegisterVO.getMobile(), personRegisterVO.getCredential().getIdentity(), personRegisterVO.getCredential().getIdentityType(), - null, null, null, null, null); - AjaxResult.success(s); + 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()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java index 7c09e67..708a40b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java @@ -7,6 +7,7 @@ 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; /** @@ -24,13 +25,16 @@ public class BestsignOpenApiClient { /** * 开发者私钥 */ - @Value("${ssq.privateKey}") - private String privateKey; +// @Value("${ssq.privateKey}") + private String 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"; /** * 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, @@ -55,35 +59,37 @@ public class BestsignOpenApiClient { * @param province 省份 * @param city 城市 * @param address 地址 + * @param method 地址 * @return 异步申请任务单号 * @throws IOException */ - public String userPersonalReg(String account, String name, String mail, + 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) throws Exception { - String host = this.serverHost; - String method = "/user/reg/"; - - // 组装请求参数,作为requestbody + 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); + //用户帐号 + 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); - credential.put("contactMail", contactMail); - credential.put("contactMobile", contactMobile); - credential.put("province", province); - credential.put("city", city); - credential.put("address", address); requestBody.put("credential", credential); + //是否申请证书 - requestBody.put("applyCert", "2"); + requestBody.put("applyCert", "1"); // 生成一个时间戳参数 String rtick = RSAUtils.getRtick(); // 计算参数签名 @@ -100,20 +106,24 @@ public class BestsignOpenApiClient { 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; - } - } else { - //接口返回异常 - System.out.println(userObj.getIntValue("errno")); - System.out.println(userObj.getString("errmsg")); - } - return userObj.toJSONString(); +// 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")); +// } } /** From 69ffd18af6a2c2d8ff936a7860ebe2ff25199996 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Thu, 5 Oct 2023 20:19:57 +0800 Subject: [PATCH 052/123] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=8A=B6=E6=80=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bestsign/ArbitrSignatuController.java | 33 +++++++++++++++ .../bestsign/domain/ArbitrSignatuVO.java | 24 +++++++++++ .../service/ArbitrSignatuService.java | 12 ++++++ .../impl/ArbitrSignatuServiceImpl.java | 29 ++++++++++++++ .../bestsign/utils/BestsignOpenApiClient.java | 40 +++++++++++++++++++ .../IdentityAuthenticationServiceImpl.java | 20 +++++----- .../IdentityAuthenticationMapper.xml | 2 +- 7 files changed, 148 insertions(+), 12 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/ArbitrSignatuController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/ArbitrSignatuVO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/service/ArbitrSignatuService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/ArbitrSignatuServiceImpl.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/ArbitrSignatuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/ArbitrSignatuController.java new file mode 100644 index 0000000..def71be --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/ArbitrSignatuController.java @@ -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); + } + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/ArbitrSignatuVO.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/ArbitrSignatuVO.java new file mode 100644 index 0000000..1edcaec --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/ArbitrSignatuVO.java @@ -0,0 +1,24 @@ +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 + */ + private String account; + private String taskId; + + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/ArbitrSignatuService.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/ArbitrSignatuService.java new file mode 100644 index 0000000..d15b083 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/ArbitrSignatuService.java @@ -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); + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/ArbitrSignatuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/ArbitrSignatuServiceImpl.java new file mode 100644 index 0000000..998de51 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/ArbitrSignatuServiceImpl.java @@ -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); + + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java index 7c09e67..f99ce68 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java @@ -116,6 +116,9 @@ public class BestsignOpenApiClient { return userObj.toJSONString(); } + + + /** * GET方法示例 * 下载合同PDF文件 @@ -145,4 +148,41 @@ public class BestsignOpenApiClient { // 返回结果解析 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(this.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(); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index b76fcda..bc1a677 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -60,10 +60,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) { IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication); if(identityAuthenticationselect!=null){ - identityAuthenticationselect.setCertificationStatusName("已身份注册"); + identityAuthenticationselect.setCertificationStatusName("已身份认证"); }else { IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication(); - identityAuthenticationselectnew.setCertificationStatusName("未身份注册"); + identityAuthenticationselectnew.setCertificationStatusName("未身份认证"); + identityAuthenticationselectnew.setCertificationStatus(0); return identityAuthenticationselectnew; } return identityAuthenticationselect; @@ -119,15 +120,15 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio GetEidResultRequest reqest = new GetEidResultRequest(); //设置请求参数 reqest.setEidToken(eidToken); + +// reqest.setInfoType("1"); +// reqest.setInfoType("13"); + reqest.setInfoType("2"); + //获得身份认证结果 GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest); String respJSON = GetEidResultResponse.toJsonString(respIdenAuth); JSONObject objJSON = JSON.parseObject(respJSON); - JSONObject objText = JSON.parseObject(objJSON.getString("Text")); - String name = objText.getString("OcrName"); -// IdentityAuthenticationRespon.setName(name); - String identityNo = objText.getString("OcrIdCard"); -// IdentityAuthenticationRespon.setIdentityNo(identityNo); IdentityAuthenticationRespon.setCertificationStatus(1); IdentityAuthenticationRespon.setUserName(userName); IdentityAuthenticationRespon.setUserId(userId); @@ -138,14 +139,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio Map mapEidInfo = decodeEidInfo(desKey,uerInfo); IdentityAuthenticationRespon.setName(mapEidInfo.get("name")); IdentityAuthenticationRespon.setIdentityNo(mapEidInfo.get("identityNo")); + IdentityAuthenticationRespon.setCertificationStatus(1); identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon); -// IdentityAuthenticationResult.setUserName(userName); IdentityAuthenticationResult.setCertificationStatus(1); IdentityAuthenticationResult.setCertificationStatusName("认证成功"); -// IdentityAuthenticationResult.setName(name); -// IdentityAuthenticationResult.setIdentityNo(identityNo); - System.out.println(GetEidResultResponse.toJsonString(respIdenAuth)); } catch (TencentCloudSDKException e) { log.error("认证失败:", e); throw new RuntimeException("认证失败"); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml index 946acea..9132c83 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml @@ -37,7 +37,7 @@ select c.id ,c.case_appli_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address , - c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent + c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent, + c.track_num from case_affiliate c From 7eb500d071395944e6c47eb456c88e66905bda1f Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 9 Oct 2023 09:05:51 +0800 Subject: [PATCH 058/123] =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A1=88=E4=BB=B6?= =?UTF-8?q?=E8=B5=84=E6=96=99=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=BA=BA=E6=A1=88=E4=BB=B6=E8=AF=81=E6=8D=AEbug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5=E6=A1=88?= =?UTF-8?q?=E4=BB=B6=E6=A8=A1=E6=9D=BF=E5=A2=9E=E5=8A=A0=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=BA=BA=E4=BB=B2=E8=A3=81=E8=AF=89=E6=B1=82=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=20=E7=BC=B4=E8=B4=B9=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=BF=94=E5=9B=9E=E7=94=B3=E8=AF=B7=E4=BA=BA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/CaseApplication.java | 1 + .../impl/CaseApplicationServiceImpl.java | 31 ++++++++++++++++++- .../wisdomarbitrate/CaseAffiliateMapper.xml | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 673a8ff..9b6a830 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -59,6 +59,7 @@ public class CaseApplication extends BaseEntity { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date hearDate; /** 申请人仲裁诉求 */ + @Excel(name = "申请人仲裁诉求") private String arbitratClaims; /** 借款开始日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index a1400ab..5df14c2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -92,9 +92,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseAffiliates = caseApplication.getCaseAffiliates(); if(caseAffiliates!=null&&caseAffiliates.size()>0){ for (CaseAffiliate caseAffiliate : caseAffiliates){ + caseAffiliate.setCaseAppliId(caseApplication.getId()); caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); } } + List caseAttachList = caseApplication.getCaseAttachList(); + if(caseAttachList!=null&&caseAttachList.size()>0){ + for (CaseAttach caseAttach : caseAttachList){ + caseAttach.setCaseAppliId(caseApplication.getId()); + caseAttachMapper.updateCaseAttach(caseAttach); + } + + } return rows; } @@ -194,6 +203,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationListinsert.add(caseApplication); } } + // 编号存在不导入 + if(StringUtils.isNotEmpty(failureMsg)){ + return failureMsg.toString(); + } if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( collectingAndThen( @@ -203,8 +216,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ - List caseApplicationNewList = new ArrayList<>(); + List caseApplicationNewList = null; for (int i = 0; i < caseApplicationListinsertDiffer.size(); i++){ + caseApplicationNewList = new ArrayList<>(); CaseApplication caseApplicationinsertDiffer = caseApplicationListinsertDiffer.get(i); List caseAffiliatesnew = new ArrayList<>(); CaseApplication caseApplicationNew = new CaseApplication(); @@ -345,7 +359,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplicationConfirm(caseApplication); + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseApplication.getId()); + List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + if(caseAffiliatListeselect!=null){ + StringBuffer applicantName = new StringBuffer(); + for (int i = 0; i < caseAffiliatListeselect.size(); i++){ + CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); + int identityType = caseAffiliateselect.getIdentityType(); + if(identityType==1){ + applicantName.append(caseAffiliateselect.getName()).append(",");; + } + } + caseApplicationselect.setApplicantName(applicantName.toString()); + + } return caseApplicationselect; } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index 974b9f6..4c7762b 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -49,6 +49,7 @@ update case_affiliate set + case_appli_id=#{caseAppliId}, identity_type= #{identityType}, name = #{name}, identity_num = #{identityNum}, From 9644ae737df97e35e6324000ffb4abdbc5e9d119 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 9 Oct 2023 13:54:57 +0800 Subject: [PATCH 059/123] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A1=88=E4=BB=B6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=88=96=E8=80=85=E6=89=B9=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=97=B6=E8=87=AA=E5=8A=A8=E8=AE=A1=E7=AE=97=E5=BA=94?= =?UTF-8?q?=E7=BC=B4=E8=B4=B9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/CaseApplication.java | 7 ++-- .../impl/CaseApplicationServiceImpl.java | 33 ++++++++++++++----- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 9b6a830..b6af0ff 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -58,9 +58,7 @@ public class CaseApplication extends BaseEntity { /** 开庭日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date hearDate; - /** 申请人仲裁诉求 */ - @Excel(name = "申请人仲裁诉求") - private String arbitratClaims; + /** 借款开始日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "借款开始日期") @@ -81,6 +79,9 @@ public class CaseApplication extends BaseEntity { /** 申请人主张违约金 */ @Excel(name = "申请人主张违约金") private BigDecimal claimLiquidDamag; + /** 申请人仲裁诉求 */ + @Excel(name = "申请人仲裁诉求") + private String arbitratClaims; /** 仲裁应缴费用 */ private BigDecimal feePayable; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 5df14c2..d28702f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -88,6 +88,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int editCaseApplication(CaseApplication caseApplication) { + //根据仲裁费用计费规则计算应缴费用 + //暂时设置计费比率为0.01 + BigDecimal feeRate = new BigDecimal(0.01); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); + caseApplication.setFeePayable(feePayable); + int rows = caseApplicationMapper.updataCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); if(caseAffiliates!=null&&caseAffiliates.size()>0){ @@ -183,14 +189,20 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public String importCaseApplication(List caseApplicationList, String operName) { - StringBuilder successMsg = new StringBuilder(); StringBuilder failureMsg = new StringBuilder(); + StringBuilder successMsg = new StringBuilder(); int successNum = 0; int failureNum = 0; if(caseApplicationList!=null&&caseApplicationList.size()>0){ List caseApplicationListinsert = new ArrayList<>(); for (int i = 0; i < caseApplicationList.size(); i++){ CaseApplication caseApplication = caseApplicationList.get(i); + //根据仲裁费用计费规则计算应缴费用 + //暂时设置计费比率为0.01 + BigDecimal feeRate = new BigDecimal(0.01); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); + caseApplication.setFeePayable(feePayable); + //赋值CaseApplication的案件关联人信息 List caseAffiliatesnew = new ArrayList<>(); assignmentCaseAffiliates(caseApplication,caseAffiliatesnew); @@ -203,10 +215,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationListinsert.add(caseApplication); } } - // 编号存在不导入 - if(StringUtils.isNotEmpty(failureMsg)){ - return failureMsg.toString(); - } + if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( collectingAndThen( @@ -262,8 +271,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { }else { throw new ServiceException("导入立案申请数据不能为空!"); } + // 编号存在不导入 + if(StringUtils.isNotEmpty(failureMsg)){ + return failureMsg.append(successMsg).toString(); + }else { - return successMsg.toString(); + return successMsg.toString(); + } } @Override @@ -386,7 +400,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1931000"); + request.setTemplateId("1947342"); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); String caseNum = caseApplicationselect.getCaseNum(); @@ -410,7 +424,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Arbitrator arbitratorselect = arbitratorList.get(i); //给仲裁员发送短信通知 request.setPhone(arbitratorselect.getTelephone()); - // 1931000 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 + // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 String name = arbitratorselect.getArbitratorName(); request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); SmsUtils.sendSms(request); @@ -427,7 +441,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int identityType = caseAffiliateselect.getIdentityType(); //给申请人、被申请人发送短信通知 request.setPhone(caseAffiliateselect.getContactTelphone()); - // 1931000 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 + // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 String name = caseAffiliateselect.getName(); request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); SmsUtils.sendSms(request); @@ -490,6 +504,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationNew.setClaimInterestOwed(caseApplicationinsertDiffer.getClaimInterestOwed()); caseApplicationNew.setClaimPrinciOwed(caseApplicationinsertDiffer.getClaimPrinciOwed()); caseApplicationNew.setClaimLiquidDamag(caseApplicationinsertDiffer.getClaimLiquidDamag()); + caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable()); } From 3dc4ad7433c8408e85d8c6ea4b761437f3205271 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Mon, 9 Oct 2023 13:55:34 +0800 Subject: [PATCH 060/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=AB=8B=E6=A1=88=E7=94=B3=E8=AF=B7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseApplicationServiceImpl.java | 17 +++++++++++++++++ .../impl/IdentityAuthenticationServiceImpl.java | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index a1400ab..c456c0c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -59,6 +59,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); caseApplication.setFeePayable(feePayable); + String caseNum = generateCaseNum(); + caseApplication.setCaseNum(caseNum); + int rows = caseApplicationMapper.insertCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); if(caseAffiliates!=null&&caseAffiliates.size()>0){ @@ -80,6 +83,20 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return rows; } + private String generateCaseNum() { + String currentday = DateUtils.dateTime(); + String caseNum = "zc"+ currentday; + //查询出当天的案件编号的最大值 ,如等于1 + Integer caseNumMax = 1; + if(caseNumMax!=null){ + //根据查询到的caseNumMax拼接一个案件编号 + }else { + caseNum += "001"; + } + return caseNum; + + } + @Override public int selectCaseApplicationCount(CaseApplication caseApplication) { return caseApplicationMapper.selectCaseApplicationCount(caseApplication); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index bc1a677..434ef6a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -123,7 +123,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio // reqest.setInfoType("1"); // reqest.setInfoType("13"); - reqest.setInfoType("2"); +// reqest.setInfoType("2"); //获得身份认证结果 GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest); From 62878cb969eb0df163944b2fe227dc43efae7ef3 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 9 Oct 2023 14:38:30 +0800 Subject: [PATCH 061/123] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A1=88=E4=BB=B6?= =?UTF-8?q?=E6=88=96=E8=80=85=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E6=A1=88=E4=BB=B6=E7=BC=96?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/CaseApplication.java | 2 +- .../mapper/CaseApplicationMapper.java | 9 +++ .../impl/CaseApplicationServiceImpl.java | 61 ++++++++++--------- .../wisdomarbitrate/CaseApplicationMapper.xml | 7 ++- 4 files changed, 47 insertions(+), 32 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index b6af0ff..e54db68 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -13,7 +13,7 @@ public class CaseApplication extends BaseEntity { /** ID */ private Long id; /** 案件编号 */ - @Excel(name = "案件编号") +// @Excel(name = "案件编号") private String caseNum; /** 案件标的 */ @Excel(name = "案件标的") diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 6b22045..7e9e4e1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -2,6 +2,7 @@ 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; @@ -22,4 +23,12 @@ public interface CaseApplicationMapper { CaseApplication selectCaseApplication(CaseApplication caseApplication); CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication); + + /** + * 查询最大编号 + * @param caseNum + * @param length + * @return + */ + Integer selectCaseNumLike(@Param("caseNum") String caseNum, @Param("length") int length); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 39b0328..dbac33a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.wisdomarbitrate.service.impl; + import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.DateUtils; @@ -12,16 +13,11 @@ import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - -import java.lang.reflect.Field; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; -import static com.ruoyi.common.core.domain.AjaxResult.error; -import static java.util.stream.Collectors.collectingAndThen; -import static java.util.stream.Collectors.toCollection; @Service public class CaseApplicationServiceImpl implements ICaseApplicationService { @@ -58,7 +54,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { BigDecimal feeRate = new BigDecimal(0.01); BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); caseApplication.setFeePayable(feePayable); - + // 获取自动编码 String caseNum = generateCaseNum(); caseApplication.setCaseNum(caseNum); @@ -83,15 +79,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return rows; } + /** + * 获取自动编码 + * @return + */ + private String generateCaseNum() { - String currentday = DateUtils.dateTime(); - String caseNum = "zc"+ currentday; - //查询出当天的案件编号的最大值 ,如等于1 - Integer caseNumMax = 1; - if(caseNumMax!=null){ - //根据查询到的caseNumMax拼接一个案件编号 + // 自动编码格式 zc+yyyyMMdd+001 + String currentDay = DateUtils.dateTime(); + String caseNum = "zc"+ currentDay; + //查询出当天的案件编号的最大值 + Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length()); + if(null == maxCaseNum){ + caseNum = caseNum + "001"; }else { - caseNum += "001"; + caseNum = caseNum + String.format("%03d", maxCaseNum); } return caseNum; @@ -224,28 +226,29 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseAffiliatesnew = new ArrayList<>(); assignmentCaseAffiliates(caseApplication,caseAffiliatesnew); - int caseApplicationCount = selectCaseApplicationCount(caseApplication); - if(caseApplicationCount>0){ - failureNum++; - failureMsg.append("
" + failureNum + "、立案编号 " + caseApplication.getCaseNum() + " 已存在"); - }else { - caseApplicationListinsert.add(caseApplication); - } +// int caseApplicationCount = selectCaseApplicationCount(caseApplication); +// if(caseApplicationCount>0){ +// failureNum++; +// failureMsg.append("
" + failureNum + "、立案编号 " + caseApplication.getCaseNum() + " 已存在"); +// }else { +// caseApplicationListinsert.add(caseApplication); +// } + caseApplicationListinsert.add(caseApplication); } if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ - List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( - collectingAndThen( - toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))), - ArrayList::new)); +// List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( +// collectingAndThen( +// toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))), +// ArrayList::new)); //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 - if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ +// if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ List caseApplicationNewList = null; - for (int i = 0; i < caseApplicationListinsertDiffer.size(); i++){ + for (int i = 0; i < caseApplicationListinsert.size(); i++){ caseApplicationNewList = new ArrayList<>(); - CaseApplication caseApplicationinsertDiffer = caseApplicationListinsertDiffer.get(i); + CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); List caseAffiliatesnew = new ArrayList<>(); CaseApplication caseApplicationNew = new CaseApplication(); copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew); @@ -267,6 +270,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseApplication caseApplicationItera = caseApplicationNewList.get(k); // 新增立案信息 caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + // 设置自动编码 + caseApplicationItera.setCaseNum(generateCaseNum()); int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); List caseAffiliates = caseApplicationItera.getCaseAffiliates(); if(caseAffiliates!=null&&caseAffiliates.size()>0){ @@ -279,7 +284,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); } - } +// } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 3875dca..9e8a59b 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -237,9 +237,10 @@ AND c.id = #{id} - - - + \ No newline at end of file From 464bf5c428997033f530e782481d6f1b121443c2 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 9 Oct 2023 15:00:08 +0800 Subject: [PATCH 062/123] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=A1=88=E4=BB=B6?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=97=B6=E6=94=B9=E4=B8=BA=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=92=8C=E6=A1=88=E4=BB=B6=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E5=80=92=E5=BA=8F=EF=BC=8C=E9=98=B2=E6=AD=A2=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=97=B6=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 9e8a59b..9fb0e6e 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -71,7 +71,7 @@
- order by c.create_time desc + order by c.create_time desc,c.case_num desc - + insert into sys_dept( dept_id, parent_id, @@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{status}, #{createBy}, sysdate() - ) + ); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml index d88164e..1c1845b 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml @@ -36,22 +36,21 @@
+ \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 9fb0e6e..0e8219b 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -55,8 +55,10 @@ c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , - c.update_by ,c.update_time , c.arbitrator_name + c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as name from case_application c + LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 + LEFT JOIN sys_dept d ON ca.NAME = d.dept_id AND c.case_status = #{caseStatus} @@ -64,6 +66,9 @@ AND c.case_num = #{caseNum} + + AND d.dept_name like CONCAT( '%',#{name},'%') AND ca.identity_type=1 and ca.name=d.dept_id + and c.case_status in From 4d4ab28c40e2d8699c800f6895b67bac5060059d Mon Sep 17 00:00:00 2001 From: hejinbo Date: Tue, 10 Oct 2023 16:22:24 +0800 Subject: [PATCH 070/123] =?UTF-8?q?=20=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 11 +- ruoyi-common/pom.xml | 5 +- .../ruoyi/common/config/EsignDemoConfig.java | 13 + .../common/constant/EsignEncryption.java | 371 +++++++++++++ .../common/constant/EsignHeaderConstant.java | 26 + .../common/constant/EsignHttpCfgHelper.java | 486 ++++++++++++++++++ .../common/constant/FileTransformation.java | 284 ++++++++++ .../core/domain/entity/EsignCoreSdkInfo.java | 24 + .../core/domain/entity/EsignHttpResponse.java | 24 + .../ruoyi/common/enums/EsignRequestType.java | 39 ++ .../common/exception/EsignDemoException.java | 36 ++ .../ruoyi/common/utils/EsignHttpHelper.java | 178 +++++++ .../common/utils/bean/EsignFileBean.java | 57 ++ .../common/utils/file/SaaSAPIFileUtils.java | 43 ++ 14 files changed, 1588 insertions(+), 9 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/config/EsignDemoConfig.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignEncryption.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignHeaderConstant.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignHttpCfgHelper.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/constant/FileTransformation.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/EsignCoreSdkInfo.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/EsignHttpResponse.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/enums/EsignRequestType.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/exception/EsignDemoException.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/EsignHttpHelper.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/EsignFileBean.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index d934d51..cbc0f7b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -27,17 +27,12 @@ public class AdjudicationController extends BaseController { /** * 裁决书送达(电子邮件) - * @param id 案件id - * @param appEmail 申请人邮箱 - * @param resEmail 被申请人邮箱 - * @param apptrackingNum 申请人快递单号 - * @param restrackingNum 被申请人快递单号 + * @param bookSendVO * @return */ @PostMapping("/delivery") - public AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail - ,String apptrackingNum,String restrackingNum){ - return adjudicationService.sendDocumentByEmail(id,appEmail,resEmail,apptrackingNum,restrackingNum); + public AjaxResult sendDocumentByEmail(@RequestBody BookSendVO bookSendVO){ + return adjudicationService.sendDocumentByEmail(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum()); } /** diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 3b55c2b..77e53b1 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -183,7 +183,10 @@ mail 1.4.7 - + + org.apache.httpcomponents + httpclient + diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/EsignDemoConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/EsignDemoConfig.java new file mode 100644 index 0000000..f9888e2 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/EsignDemoConfig.java @@ -0,0 +1,13 @@ +package com.ruoyi.common.config; + +public class EsignDemoConfig { + + // 应用ID + public static final String EsignAppId = "7438987614"; + // 应用密钥 + public static final String EsignAppSecret = "9d7844f13830931037772b9d20cf1529"; + // e签宝接口调用域名(模拟环境) + public static final String EsignHost = "https://smlopenapi.esign.cn"; + // e签宝接口调用域名(正式环境) + // public static final String EsignHost = "https://openapi.esign.cn"; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignEncryption.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignEncryption.java new file mode 100644 index 0000000..ade398b --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignEncryption.java @@ -0,0 +1,371 @@ +/* + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ruoyi.common.constant; +import com.ruoyi.common.exception.EsignDemoException; +import org.apache.commons.codec.binary.Base64; +import org.apache.http.message.BasicNameValuePair; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.UnsupportedEncodingException; +import java.security.InvalidKeyException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.text.Collator; +import java.text.MessageFormat; +import java.util.*; + +/** + * @description 请求数据通用处理类 + * @author 澄泓 + * @date 2020年10月22日 下午14:25:31 + * @since JDK1.7 + */ +public class EsignEncryption { + + /** + * 不允许外部创建实例 + */ + private EsignEncryption(){} + + /** + * 拼接待签名字符串 + * @param httpMethod + * @param url + * @return + */ + public static String appendSignDataString(String httpMethod, String contentMd5,String accept,String contentType,String headers,String date, String url) throws EsignDemoException { + StringBuffer sb = new StringBuffer(); + sb.append(httpMethod).append("\n").append(accept).append("\n").append(contentMd5).append("\n") + .append(contentType).append("\n"); + + if ("".equals(date) || date == null) { + sb.append("\n"); + } else { + sb.append(date).append("\n"); + } + if ("".equals(headers) || headers == null) { + sb.append(url); + } else { + sb.append(headers).append("\n").append(url); + } + return new String(sb); + } + + /*** + * Content-MD5的计算方法 + * @param str 待计算的消息 + * @return MD5计算后摘要值的Base64编码(ContentMD5) + * @throws EsignDemoException 加密过程中的异常信息 + */ + public static String doContentMD5(String str) throws EsignDemoException { + byte[] md5Bytes = null; + MessageDigest md5 = null; + String contentMD5 = null; + try { + md5 = MessageDigest.getInstance("MD5"); + // 计算md5函数 + md5.update(str.getBytes("UTF-8")); + // 获取文件MD5的二进制数组(128位) + md5Bytes = md5.digest(); + // 把MD5摘要后的二进制数组md5Bytes使用Base64进行编码(而不是对32位的16进制字符串进行编码) + contentMD5 = Base64.encodeBase64String(md5Bytes); + + } catch (NoSuchAlgorithmException e) { + EsignDemoException ex = new EsignDemoException("不支持此算法",e); + ex.initCause(e); + throw ex; + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return contentMD5; + } + + /*** + * 计算请求签名值-HmacSHA256摘要 + * @param message 待签名字符串 + * @param secret 密钥APP KEY + * @return reqSignature HmacSHA256计算后摘要值的Base64编码 + * @throws EsignDemoException 加密过程中的异常信息 + */ + public static String doSignatureBase64(String message, String secret) throws EsignDemoException { + String algorithm = "HmacSHA256"; + Mac hmacSha256; + String digestBase64 = null; + try { + hmacSha256 = Mac.getInstance(algorithm); + byte[] keyBytes = secret.getBytes("UTF-8"); + byte[] messageBytes = message.getBytes("UTF-8"); + hmacSha256.init(new SecretKeySpec(keyBytes, 0, keyBytes.length, algorithm)); + // 使用HmacSHA256对二进制数据消息Bytes计算摘要 + byte[] digestBytes = hmacSha256.doFinal(messageBytes); + // 把摘要后的结果digestBytes使用Base64进行编码 + digestBase64 = Base64.encodeBase64String(digestBytes); + } catch (NoSuchAlgorithmException e) { + EsignDemoException ex = new EsignDemoException("不支持此算法",e); + ex.initCause(e); + throw ex; + } catch (InvalidKeyException e) { + EsignDemoException ex = new EsignDemoException("无效的密钥规范",e); + ex.initCause(e); + throw ex; + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return digestBase64; + } + + /** + * 获取时间戳 + * @return + */ + public static String timeStamp() { + long timeStamp = System.currentTimeMillis(); + return String.valueOf(timeStamp); + } + + /** + * byte字节数组转换成字符串 + * @param b + * @return + */ + public static String byteArrayToHexString(byte[] b) { + StringBuilder hs = new StringBuilder(); + String stmp; + for (int n = 0; b != null && n < b.length; n++) { + stmp = Integer.toHexString(b[n] & 0XFF); + if (stmp.length() == 1) + hs.append('0'); + hs.append(stmp); + } + return hs.toString().toLowerCase(); + } + + /** + * hash散列加密算法 + * @return + */ + public static String Hmac_SHA256(String message,String key) throws EsignDemoException { + byte[] rawHmac=null; + try { + SecretKeySpec sk = new SecretKeySpec(key.getBytes(), "HmacSHA256"); + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(sk); + rawHmac = mac.doFinal(message.getBytes()); + }catch (InvalidKeyException e){ + EsignDemoException ex = new EsignDemoException("无效的密钥规范",e); + ex.initCause(e); + throw ex; + } catch (NoSuchAlgorithmException e) { + EsignDemoException ex = new EsignDemoException("不支持此算法",e); + ex.initCause(e); + throw ex; + }catch (Exception e){ + EsignDemoException ex = new EsignDemoException("hash散列加密算法报错",e); + ex.initCause(e); + throw ex; + }finally { + return byteArrayToHexString(rawHmac); + } + + } + + /** + * MD5加密32位 + */ + public static String MD5Digest(String text) throws EsignDemoException { + byte[] digest=null; + try { + MessageDigest md5 = MessageDigest.getInstance("MD5"); + md5.update(text.getBytes()); + digest = md5.digest(); + }catch (NoSuchAlgorithmException e){ + EsignDemoException ex = new EsignDemoException("不支持此算法",e); + ex.initCause(e); + throw ex; + }finally { + return byteArrayToHexString(digest); + } + + } + + public static void formDataSort(List param) { + Collections.sort(param, new Comparator() { + @Override + public int compare(BasicNameValuePair o1, BasicNameValuePair o2) { + Comparator com = Collator.getInstance(Locale.CHINA); + return com.compare(o1.getName(), o2.getName()); + } + }); + } + + /*** + * 字符串是否为空(含空格校验) + * @param str + * @return + */ + public static boolean isBlank(String str) { + if (null == str || 0 == str.length()) { + return true; + } + + int strLen = str.length(); + + for (int i = 0; i < strLen; i++) { + if (!Character.isWhitespace(str.charAt(i))) { + return false; + } + } + return true; + } + + + /*** + * 对请求URL中的Query参数按照字段名的 ASCII 码从小到大排序(字典排序) + * + * @param apiUrl + * @return 排序后的API接口地址 + * @throws Exception + */ + public static String sortApiUrl(String apiUrl) throws EsignDemoException { + + if (!apiUrl.contains("?")) { + return apiUrl; + } + + int queryIndex = apiUrl.indexOf("?"); + String apiUrlPath =apiUrl.substring(0,queryIndex+1); + String apiUrlQuery = apiUrl.substring(queryIndex+1); + //apiUrlQuery为空时返回 + if(isBlank(apiUrlQuery)){ + return apiUrl.substring(0,apiUrl.length()-1); + } + // 请求URL中Query参数转成Map + Map queryParamsMap = new HashMap(); + String[] params = apiUrlQuery.split("&"); + for (String str : params) { + int index = str.indexOf("="); + String key = str.substring(0, index); + String value = str.substring(index + 1); + if (queryParamsMap.containsKey(key)) { + String msg = MessageFormat.format("请求URL中的Query参数的{0}重复", key); + throw new EsignDemoException(msg); + } + queryParamsMap.put(key, value); + } + + ArrayList queryMapKeys = new ArrayList(); + for (Map.Entry entry : queryParamsMap.entrySet()) { + queryMapKeys.add((String) entry.getKey()); + } + // 按照字段名的 ASCII 码从小到大排序(字典排序) + Collections.sort(queryMapKeys, new Comparator() { + @Override + public int compare(String o1, String o2) { + return (o1.compareToIgnoreCase(o2) == 0 ? -o1.compareTo(o2) : o1.compareToIgnoreCase(o2)); + } + }); + + StringBuffer queryString = new StringBuffer(); + // 构造Query参数键值对值对的格式 + for (int i = 0; i < queryMapKeys.size(); i++) { + String key = queryMapKeys.get(i); + String value = (String) queryParamsMap.get(key); + queryString.append(key); + queryString.append("="); + queryString.append(value); + queryString.append("&"); + } + if (queryString.length() > 0) { + queryString = queryString.deleteCharAt(queryString.length() - 1); + } + + // Query参数排序后的接口请求地址 + StringBuffer sortApiUrl = new StringBuffer(); + sortApiUrl.append(apiUrlPath); + sortApiUrl.append(queryString.toString()); + return sortApiUrl.toString(); + } + + /** + *获取query + * @param apiUrl + * @return + * @throws EsignDemoException + */ + public static ArrayList getQuery(String apiUrl) throws EsignDemoException { + ArrayList BasicNameValuePairList = new ArrayList<>(); + + if (!apiUrl.contains("?")) { + return BasicNameValuePairList; + } + + int queryIndex = apiUrl.indexOf("\\?"); + String apiUrlQuery = apiUrl.substring(queryIndex,apiUrl.length()); + + // 请求URL中Query参数转成Map + Map queryParamsMap = new HashMap(); + String[] params = apiUrlQuery.split("&"); + for (String str : params) { + int index = str.indexOf("="); + String key = str.substring(0, index); + String value = str.substring(index + 1); + if (queryParamsMap.containsKey(key)) { + String msg = MessageFormat.format("请求URL中的Query参数的{0}重复", key); + throw new EsignDemoException(msg); + } + BasicNameValuePairList.add(new BasicNameValuePair(key,value)); + queryParamsMap.put(key, value); + } + return BasicNameValuePairList; + } + /** + * + */ + public static boolean callBackCheck(String timestamp,String requestQuery,String body,String key,String signature){ + String algorithm="HmacSHA256"; + String encoding="UTF-8"; + Mac mac = null; + try { + String data = timestamp + requestQuery + body; + mac = Mac.getInstance(algorithm); + SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(encoding), algorithm); + mac.init(secretKey); + mac.update(data.getBytes(encoding)); + } catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) { + e.printStackTrace(); + System.out.println("获取Signature签名信息异常:" + e.getMessage()); + return false; + } + return byte2hex(mac.doFinal()).equalsIgnoreCase(signature); + } + + /*** + * 将byte[]转成16进制字符串 + * + * @param data + * + * @return 16进制字符串 + */ + public static String byte2hex(byte[] data) { + StringBuilder hash = new StringBuilder(); + String stmp; + for (int n = 0; data != null && n < data.length; n++) { + stmp = Integer.toHexString(data[n] & 0XFF); + if (stmp.length() == 1) + hash.append('0'); + hash.append(stmp); + } + return hash.toString(); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignHeaderConstant.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignHeaderConstant.java new file mode 100644 index 0000000..ae1e035 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignHeaderConstant.java @@ -0,0 +1,26 @@ +package com.ruoyi.common.constant; +/** + * @description 头部信息常量 + * @author 澄泓 + * @date 2020/10/22 15:05 + * @version JDK1.7 + */ +public enum EsignHeaderConstant { + ACCEPT("*/*"), + DATE(""), + HEADERS( ""), + CONTENTTYPE_FORMDATA("application/x-www-form-urlencoded"), + CONTENTTYPE_JSON("application/json; charset=UTF-8"), + CONTENTTYPE_PDF("application/pdf"), + CONTENTTYPE_STREAM("application/octet-stream"), + AUTHMODE("Signature"); + + private String value; + private EsignHeaderConstant(String value) { + this.value=value; + } + + public String VALUE(){ + return this.value; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignHttpCfgHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignHttpCfgHelper.java new file mode 100644 index 0000000..78162ed --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/EsignHttpCfgHelper.java @@ -0,0 +1,486 @@ +/* + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ruoyi.common.constant; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.enums.EsignRequestType; +import com.ruoyi.common.exception.EsignDemoException; +import org.apache.http.*; +import org.apache.http.auth.AuthScope; +import org.apache.http.auth.UsernamePasswordCredentials; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.CredentialsProvider; +import org.apache.http.client.HttpRequestRetryHandler; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.ConnectTimeoutException; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.LayeredConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.BasicCredentialsProvider; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.protocol.HttpContext; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.net.ssl.*; +import java.io.IOException; +import java.io.InterruptedIOException; +import java.net.UnknownHostException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @description Http请求 辅助类 + * @author 澄泓 + * @since JDK1.7 + */ +public class EsignHttpCfgHelper { + + private static Logger LOGGER = LoggerFactory.getLogger(EsignHttpCfgHelper.class); + /** + * 超时时间,默认15000毫秒 + */ + private static int MAX_TIMEOUT = 15000; + /** + * 请求池最大连接数,默认100个 + */ + private static int MAX_TOTAL=100; + /** + * 单域名最大的连接数,默认50个 + */ + private static int ROUTE_MAX_TOTAL=50; + /** + * 请求失败重试次数,默认3次 + */ + private static int MAX_RETRY = 3; + /** + * 是否需要域名校验,默认不需要校验 + */ + private static boolean SSL_VERIFY=false; + + /** + * 正向代理IP + */ + private static String PROXY_IP; + /** + * 正向代理端口,默认8888 + */ + private static int PROXY_PORT=8888; + /** + * 代理协议,默认http + */ + private static String PROXY_AGREEMENT="http"; + + /** + * 是否开启代理,默认false + */ + private static boolean OPEN_PROXY=false; + + /** + * 代理服务器用户名 + */ + private static String PROXY_USERNAME=""; + + /** + * 代理服务器密码 + */ + private static String PROXY_PASSWORD=""; + + + private static PoolingHttpClientConnectionManager connMgr; //连接池 + private static HttpRequestRetryHandler retryHandler; //重试机制 + + private static CloseableHttpClient httpClient=null; + + public static int getMaxTimeout() { + return MAX_TIMEOUT; + } + + public static void setMaxTimeout(int maxTimeout) { + MAX_TIMEOUT = maxTimeout; + } + + public static int getMaxTotal() { + return MAX_TOTAL; + } + + public static void setMaxTotal(int maxTotal) { + MAX_TOTAL = maxTotal; + } + + public static int getRouteMaxTotal() { + return ROUTE_MAX_TOTAL; + } + + public static void setRouteMaxTotal(int routeMaxTotal) { + ROUTE_MAX_TOTAL = routeMaxTotal; + } + + public static int getMaxRetry() { + return MAX_RETRY; + } + + public static void setMaxRetry(int maxRetry) { + MAX_RETRY = maxRetry; + } + + public static boolean isSslVerify() { + return SSL_VERIFY; + } + + public static void setSslVerify(boolean sslVerify) { + SSL_VERIFY = sslVerify; + } + + public static String getProxyIp() { + return PROXY_IP; + } + + public static void setProxyIp(String proxyIp) { + PROXY_IP = proxyIp; + } + + public static int getProxyPort() { + return PROXY_PORT; + } + + public static void setProxyPort(int proxyPort) { + PROXY_PORT = proxyPort; + } + + public static String getProxyAgreement() { + return PROXY_AGREEMENT; + } + + public static void setProxyAgreement(String proxyAgreement) { + PROXY_AGREEMENT = proxyAgreement; + } + + public static boolean getOpenProxy() { + return OPEN_PROXY; + } + + public static void setOpenProxy(boolean openProxy) { + OPEN_PROXY = openProxy; + } + + public static String getProxyUsername() { + return PROXY_USERNAME; + } + + public static void setProxyUserame(String proxyUsername) { + PROXY_USERNAME = proxyUsername; + } + + public static String getProxyPassword() { + return PROXY_PASSWORD; + } + + public static void setProxyPassword(String proxyPassword) { + PROXY_PASSWORD = proxyPassword; + } + + + + + /** + * 不允许外部创建实例 + */ + private EsignHttpCfgHelper() { + } + + //------------------------------公有方法start-------------------------------------------- + + + /** + * @description 发起HTTP / HTTPS 请求 + * + * @param reqType + * {@link EsignRequestType} 请求类型 GET、 POST 、 DELETE 、 PUT + * @param httpUrl + * {@link String} 请求目标地址 + * @param headers + * {@link Map} 请求头 + * @param param + * {@link Object} 参数 + * @return + * @throws EsignDemoException + * @author 澄泓 + */ + public static EsignHttpResponse sendHttp(EsignRequestType reqType, String httpUrl, Map headers, Object param, boolean debug) + throws EsignDemoException { + HttpRequestBase reqBase=null; + if(httpUrl.startsWith("http")){ + reqBase=reqType.getHttpType(httpUrl); + }else{ + throw new EsignDemoException("请求url地址格式错误"); + } + if(debug){ + LOGGER.info("请求头:{}",headers+"\n"); + LOGGER.info("请求参数\n{}", param+"\n"); + LOGGER.info("请求地址\n:{}\n请求方式\n:{}",reqBase.getURI(),reqType+"\n"); + } + //请求方法不是GET或者DELETE时传入body体,否则不传入。 + String[] methods = {"DELETE", "GET"}; + if(param instanceof String&&Arrays.binarySearch(methods, reqType.name())<0){//POST或者PUT请求 + ((HttpEntityEnclosingRequest) reqBase).setEntity( + new StringEntity(String.valueOf(param), ContentType.create("application/json", "UTF-8"))); + } + //参数时字节流数组 + else if(param instanceof byte[]) { + reqBase=reqType.getHttpType(httpUrl); + byte[] paramBytes = (byte[])param; + ((HttpEntityEnclosingRequest) reqBase).setEntity(new ByteArrayEntity(paramBytes)); + } + //参数是form表单时 + else if(param instanceof List){ + ((HttpEntityEnclosingRequest) reqBase).setEntity(new UrlEncodedFormEntity((Iterable) param)); + } + httpClient = getHttpClient(); + config(reqBase); + + //设置请求头 + if(headers != null &&headers.size()>0) { + for(Map.Entry entry :headers.entrySet()) { + reqBase.setHeader(entry.getKey(), entry.getValue()); + } + } + //响应对象 + CloseableHttpResponse res = null; + //响应内容 + String resCtx = null; + int status; + EsignHttpResponse esignHttpResponse = new EsignHttpResponse(); + try { + //执行请求 + res = httpClient.execute(reqBase); + status=res.getStatusLine().getStatusCode(); + + //获取请求响应对象和响应entity + HttpEntity httpEntity = res.getEntity(); + if(httpEntity != null) { + resCtx = EntityUtils.toString(httpEntity,"utf-8"); + } + if(debug) { + LOGGER.info("响应\n{}", resCtx + "\n"); + LOGGER.info("----------------------------end------------------------"); + } + } catch (NoHttpResponseException e) { + throw new EsignDemoException("服务器丢失了",e); + } catch (SSLHandshakeException e){ + String msg = MessageFormat.format("SSL握手异常", e); + EsignDemoException ex = new EsignDemoException(msg, e); + throw ex; + } catch (UnknownHostException e){ + EsignDemoException ex = new EsignDemoException("服务器找不到", e); + ex.initCause(e); + throw ex; + } catch(ConnectTimeoutException e){ + EsignDemoException ex = new EsignDemoException("连接超时", e); + ex.initCause(e); + throw ex; + } catch(SSLException e){ + EsignDemoException ex = new EsignDemoException("SSL异常",e); + ex.initCause(e); + throw ex; + } catch (ClientProtocolException e) { + EsignDemoException ex = new EsignDemoException("请求头异常",e); + ex.initCause(e); + throw ex; + } catch (IOException e) { + EsignDemoException ex = new EsignDemoException("网络请求失败",e); + ex.initCause(e); + throw ex; + } finally { + if(res != null) { + try { + res.close(); + } catch (IOException e) { + EsignDemoException ex = new EsignDemoException("--->>关闭请求响应失败",e); + ex.initCause(e); + throw ex; + } + } + } + esignHttpResponse.setStatus(status); + esignHttpResponse.setBody(resCtx); + return esignHttpResponse; + } + //------------------------------公有方法end---------------------------------------------- + + //------------------------------私有方法start-------------------------------------------- + + /** + * @description 请求头和超时时间配置 + * + * @param httpReqBase + * @author 澄泓 + */ + private static void config(HttpRequestBase httpReqBase) { + // 配置请求的超时设置 + RequestConfig.Builder builder = RequestConfig.custom() + .setConnectionRequestTimeout(MAX_TIMEOUT) + .setConnectTimeout(MAX_TIMEOUT) + .setSocketTimeout(MAX_TIMEOUT); + if(OPEN_PROXY){ + HttpHost proxy=new HttpHost(PROXY_IP,PROXY_PORT,PROXY_AGREEMENT); + builder.setProxy(proxy); + } + RequestConfig requestConfig = builder.build(); + httpReqBase.setConfig(requestConfig); + } + + /** + * @description 连接池配置 + * + * @return + * @author 澄泓 + */ + private static void cfgPoolMgr() throws EsignDemoException { + ConnectionSocketFactory plainsf = PlainConnectionSocketFactory.getSocketFactory(); + LayeredConnectionSocketFactory sslsf = SSLConnectionSocketFactory.getSocketFactory(); + if(!SSL_VERIFY){ + sslsf=sslConnectionSocketFactory(); + } + + Registry registry = RegistryBuilder.create() + .register("http", plainsf) + .register("https", sslsf) + .build(); + + //连接池管理器 + connMgr = new PoolingHttpClientConnectionManager(registry); + //请求池最大连接数 + connMgr.setMaxTotal(MAX_TOTAL); + //但域名最大的连接数 + connMgr.setDefaultMaxPerRoute(ROUTE_MAX_TOTAL); + } + + + + + /** + * @description 设置重试机制 + * + * @author 澄泓 + */ + private static void cfgRetryHandler() { + retryHandler = new HttpRequestRetryHandler() { + + @Override + public boolean retryRequest(IOException e, int excCount, HttpContext ctx) { + //超过最大重试次数,就放弃 + if(excCount > MAX_RETRY) { + return false; + } + //服务器丢掉了链接,就重试 + if(e instanceof NoHttpResponseException) { + return true; + } + //不重试SSL握手异常 + if(e instanceof SSLHandshakeException) { + return false; + } + //中断 + if(e instanceof InterruptedIOException) { + return false; + } + //目标服务器不可达 + if(e instanceof UnknownHostException) { + return false; + } + //连接超时 + //SSL异常 + if(e instanceof SSLException) { + return false; + } + + HttpClientContext clientCtx = HttpClientContext.adapt(ctx); + HttpRequest req = clientCtx.getRequest(); + //如果是幂等请求,就再次尝试 + if(!(req instanceof HttpEntityEnclosingRequest)) { + return true; + } + return false; + } + }; + } + + /** + * 忽略域名校验 + */ + private static SSLConnectionSocketFactory sslConnectionSocketFactory() throws EsignDemoException { + try { + SSLContext ctx = SSLContext.getInstance("TLS"); // 创建一个上下文(此处指定的协议类型似乎不是重点) + X509TrustManager tm = new X509TrustManager() { // 创建一个跳过SSL证书的策略 + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { + } + + public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { + } + }; + ctx.init(null, new TrustManager[] { tm }, null); // 使用上面的策略初始化上下文 + return new SSLConnectionSocketFactory(ctx, new String[] { "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2" }, null, NoopHostnameVerifier.INSTANCE); + }catch (Exception e){ + EsignDemoException ex = new EsignDemoException("忽略域名校验失败",e); + ex.initCause(e); + throw ex; + } + + } + + /** + * @description 获取单例HttpClient + * + * @return + * @author 澄泓 + */ + private static synchronized CloseableHttpClient getHttpClient() throws EsignDemoException { + if(httpClient==null) { + CredentialsProvider credsProvider = new BasicCredentialsProvider(); + credsProvider.setCredentials(new AuthScope(PROXY_IP,PROXY_PORT),new UsernamePasswordCredentials(PROXY_USERNAME, PROXY_PASSWORD)); + cfgPoolMgr(); + cfgRetryHandler(); + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + httpClient = httpClientBuilder.setDefaultCredentialsProvider(credsProvider).setConnectionManager(connMgr).setRetryHandler(retryHandler).build(); + } + return httpClient; + + } + //------------------------------私有方法end---------------------------------------------- + + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/FileTransformation.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/FileTransformation.java new file mode 100644 index 0000000..f63a3d9 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/FileTransformation.java @@ -0,0 +1,284 @@ +/* + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ruoyi.common.constant; + +import com.ruoyi.common.exception.EsignDemoException; +import org.apache.commons.codec.binary.Base64; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.HashMap; +import java.util.Map; + +/** + * @author 澄泓 + * @version JDK1.7 + * @description 文件转换类 + * @date 2020/10/26 10:47 + */ +public class FileTransformation { + + /** + * 传入本地文件路径转二进制byte + * + * @param srcFilePath 本地文件路径 + * @return + * @throws EsignDemoException + */ + public static byte[] fileToBytes(String srcFilePath) throws EsignDemoException { + return getBytes(srcFilePath); + } + + /** + * 图片转base64 + * + * @param filePath 本地文件路径 + * @return + * @throws EsignDemoException + */ + public static String fileToBase64(String filePath) throws EsignDemoException { + byte[] bytes; + String base64 = null; + bytes = fileToBytes(filePath); + base64 = Base64.encodeBase64String(bytes); + base64 = base64.replaceAll("\r\n", ""); + return base64; + } + + public static void main(String[] args) throws EsignDemoException { + System.out.println(getFileContentMD5("D:\\文档\\PLT2022-02124CT.pdf")); + } + + /*** + * 计算文件内容的Content-MD5 + * @param filePath 文件路径 + * @return + */ + public static String getFileContentMD5(String filePath) throws EsignDemoException { + // 获取文件MD5的二进制数组(128位) + byte[] bytes = getFileMD5Bytes128(filePath); + // 对文件MD5的二进制数组进行base64编码 + return new String(Base64.encodeBase64String(bytes)); + } + + /** + * 下载文件 + * + * @param httpUrl 网络文件地址url + * @return + */ + public static boolean downLoadFileByUrl(String httpUrl, String dir) throws EsignDemoException { + InputStream fis = null; + FileOutputStream fileOutputStream = null; + try { + URL url = new URL(httpUrl); + HttpURLConnection httpConn = (HttpURLConnection) url.openConnection(); + httpConn.connect(); + fis = httpConn.getInputStream(); + fileOutputStream = new FileOutputStream(new File(dir)); + byte[] md5Bytes = null; + + byte[] buffer = new byte[1024]; + int length = -1; + while ((length = fis.read(buffer, 0, 1024)) != -1) { + fileOutputStream.write(buffer, 0, length); + } + } catch (IOException e) { + EsignDemoException ex = new EsignDemoException("获取文件流异常", e); + ex.initCause(e); + throw ex; + } finally { + try { + if (fis != null) { + fis.close(); + } + if (fileOutputStream != null) { + fileOutputStream.close(); + } + } catch (IOException e) { + EsignDemoException ex = new EsignDemoException("关闭文件流异常", e); + ex.initCause(e); + throw ex; + } + } + return true; + } + + + /** + * 网络文件转二进制MD5数组并获取文件大小 + * + * @param fileUrl 网络文件地址url + * @return + */ + public static Map fileUrlToBytes(String fileUrl) throws EsignDemoException { + HashMap map = new HashMap(); + try { + URL url = new URL(fileUrl); + HttpURLConnection httpConn = (HttpURLConnection) url.openConnection(); + httpConn.connect(); + InputStream fis = httpConn.getInputStream(); + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + outStream.close(); + map.put("fileSize", fis.available()); + byte[] md5Bytes = null; + MessageDigest md5 = MessageDigest.getInstance("MD5"); + byte[] buffer = new byte[1024]; + int length = -1; + while ((length = fis.read(buffer, 0, 1024)) != -1) { + md5.update(buffer, 0, length); + outStream.write(buffer, 0, length); + } + md5Bytes = md5.digest(); + byte[] fileData = outStream.toByteArray(); + map.put("fileData", fileData); + outStream.close(); + fis.close(); + map.put("md5Bytes", md5Bytes); + } catch (IOException e) { + EsignDemoException ex = new EsignDemoException("获取文件流异常", e); + ex.initCause(e); + throw ex; + } catch (NoSuchAlgorithmException e) { + EsignDemoException ex = new EsignDemoException("文件计算异常", e); + ex.initCause(e); + throw ex; + } + return map; + } + + /*** + * 获取文件MD5的二进制数组(128位) + * @param filePath + * @return + * @throws EsignDemoException + */ + public static byte[] getFileMD5Bytes128(String filePath) throws EsignDemoException { + FileInputStream fis = null; + byte[] md5Bytes = null; + try { + File file = new File(filePath); + fis = new FileInputStream(file); + MessageDigest md5 = MessageDigest.getInstance("MD5"); + byte[] buffer = new byte[1024]; + int length = -1; + while ((length = fis.read(buffer, 0, 1024)) != -1) { + md5.update(buffer, 0, length); + } + md5Bytes = md5.digest(); + fis.close(); + } catch (FileNotFoundException e) { + EsignDemoException ex = new EsignDemoException("文件找不到", e); + ex.initCause(e); + throw ex; + } catch (NoSuchAlgorithmException e) { + EsignDemoException ex = new EsignDemoException("不支持此算法", e); + ex.initCause(e); + throw ex; + } catch (IOException e) { + EsignDemoException ex = new EsignDemoException("输入流或输出流异常", e); + ex.initCause(e); + throw ex; + } finally { + if (fis != null) { + try { + fis.close(); + } catch (IOException e) { + EsignDemoException ex = new EsignDemoException("关闭文件输入流失败", e); + ex.initCause(e); + throw ex; + } + } + } + return md5Bytes; + } + + /** + * @param path + * @return + * @throws EsignDemoException + * @description 根据文件路径,获取文件base64 + * @author 宫清 + * @date 2019年7月21日 下午4:22:08 + */ + public static String getBase64Str(String path) throws EsignDemoException { + InputStream is = null; + try { + is = new FileInputStream(new File(path)); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + return Base64.encodeBase64String(bytes); + } catch (Exception e) { + EsignDemoException ex = new EsignDemoException("获取文件输入流失败", e); + ex.initCause(e); + throw ex; + } finally { + if (is != null) { + try { + is.close(); + } catch (IOException e) { + EsignDemoException ex = new EsignDemoException("关闭文件输入流失败", e); + ex.initCause(e); + throw ex; + } + } + } + } + + /** + * @param path 文件路径 + * @return + * @description 获取文件名称 + * @author 宫清 + * @date 2019年7月21日 下午8:21:16 + */ + public static String getFileName(String path) { + return new File(path).getName(); + } + + /** + * @param filePath {@link String} 文件地址 + * @return + * @throws EsignDemoException + * @description 获取文件字节流 + * @date 2019年7月10日 上午9:17:00 + * @author 宫清 + */ + public static byte[] getBytes(String filePath) throws EsignDemoException { + File file = new File(filePath); + FileInputStream fis = null; + byte[] buffer = null; + try { + fis = new FileInputStream(file); + buffer = new byte[(int) file.length()]; + fis.read(buffer); + } catch (Exception e) { + EsignDemoException ex = new EsignDemoException("获取文件字节流失败", e); + ex.initCause(e); + throw ex; + } finally { + if (fis != null) { + try { + fis.close(); + } catch (IOException e) { + EsignDemoException ex = new EsignDemoException("关闭文件字节流失败", e); + ex.initCause(e); + throw ex; + } + } + } + return buffer; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/EsignCoreSdkInfo.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/EsignCoreSdkInfo.java new file mode 100644 index 0000000..d97603d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/EsignCoreSdkInfo.java @@ -0,0 +1,24 @@ +package com.ruoyi.common.core.domain.entity; +/** + * esignSDK-core信息类 + * @author 澄泓 + * @date 2022/2/22 13:59 + * @version + */ +public class EsignCoreSdkInfo { + private static final String SdkVersion="Esign-Sdk-Core1.0"; + private static final String SupportedVersion="JDK1.7 MORE THAN"; + + private static final String Info="sdk-esign-api核心工具包,主要处理e签宝公有云产品接口调用时的签名计算以及网络请求,通过EsignHttpHelper.signAndBuildSignAndJsonHeader构造签名鉴权+json数据格式的请求头,通过HttpHelper.doCommHttp方法入参发起网络请求。让开发者无需关注具体的请求签名算法,专注于接口业务的json参数构造"; + public static String getSdkVersion() { + return SdkVersion; + } + + public static String getInfo() { + return Info; + } + + public static String getSupportedVersion() { + return SupportedVersion; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/EsignHttpResponse.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/EsignHttpResponse.java new file mode 100644 index 0000000..26375c0 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/EsignHttpResponse.java @@ -0,0 +1,24 @@ +package com.ruoyi.common.core.domain.entity; +/** + * 网络请求的response类 + */ +public class EsignHttpResponse { + private int status; + private String body; + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/EsignRequestType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/EsignRequestType.java new file mode 100644 index 0000000..8b87de6 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/EsignRequestType.java @@ -0,0 +1,39 @@ +package com.ruoyi.common.enums; + +import org.apache.http.client.methods.*; + +/** + * @description 请求类型 + * @author 澄泓 + * @since JDK1.7 + */ +public enum EsignRequestType { + + POST{ + @Override + public HttpRequestBase getHttpType(String url) { + return new HttpPost(url); + } + }, + GET{ + @Override + public HttpRequestBase getHttpType(String url) { + return new HttpGet(url); + } + }, + DELETE{ + @Override + public HttpRequestBase getHttpType(String url) { + return new HttpDelete(url); + } + }, + PUT{ + @Override + public HttpRequestBase getHttpType(String url) { + return new HttpPut(url); + } + }, + ; + + public abstract HttpRequestBase getHttpType(String url); +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/EsignDemoException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/EsignDemoException.java new file mode 100644 index 0000000..7be2957 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/EsignDemoException.java @@ -0,0 +1,36 @@ +package com.ruoyi.common.exception; + +/** + * description 自定义全局异常 + * @author 澄泓 + * datetime 2019年7月1日上午10:43:24 + */ +public class EsignDemoException extends Exception { + + private static final long serialVersionUID = 4359180081622082792L; + private Exception e; + + public EsignDemoException(String msg) { + super(msg); + } + + public EsignDemoException(String msg, Throwable cause) { + super(msg,cause); + } + + public EsignDemoException(){ + + } + + public Exception getE() { + return e; + } + + public void setE(Exception e) { + this.e = e; + } + + + + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/EsignHttpHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EsignHttpHelper.java new file mode 100644 index 0000000..ed255e5 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EsignHttpHelper.java @@ -0,0 +1,178 @@ +package com.ruoyi.common.utils; + + +import com.ruoyi.common.constant.EsignEncryption; +import com.ruoyi.common.constant.EsignHeaderConstant; +import com.ruoyi.common.constant.EsignHttpCfgHelper; +import com.ruoyi.common.core.domain.entity.EsignCoreSdkInfo; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.enums.EsignRequestType; +import com.ruoyi.common.exception.EsignDemoException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; + +/** + * @description Http 请求 辅助类 + * @author 澄泓 + * @since JDK1.7 + */ +public class EsignHttpHelper { + private static final Logger LOGGER = LoggerFactory.getLogger(EsignHttpHelper.class); + + /** + * 不允许外部创建实例 + */ + private EsignHttpHelper() { + + } + + /** + * @description 发送常规HTTP 请求 + * + * @param reqType 请求方式 + * @param url 请求路径 + * @param paramStr 请求参数 + * @return + * @throws EsignDemoException + * @author 澄泓 + */ + public static EsignHttpResponse doCommHttp(String host, String url, EsignRequestType reqType, Object paramStr , Map httpHeader, boolean debug) throws EsignDemoException { + + return EsignHttpCfgHelper.sendHttp(reqType, host+url,httpHeader, paramStr, debug); + + } + + + /** + * @description 发送文件流上传 HTTP 请求 + * + * @param reqType 请求方式 + * @param uploadUrl 请求路径 + * @param param 请求参数 + * @param fileContentMd5 文件fileContentMd5 + * @param contentType 文件MIME类型 + * @return + * @throws EsignDemoException + * @author 澄泓 + */ + public static EsignHttpResponse doUploadHttp( String uploadUrl,EsignRequestType reqType,byte[] param, String fileContentMd5, + String contentType, boolean debug) throws EsignDemoException { + Map uploadHeader = buildUploadHeader(fileContentMd5, contentType); + if(debug){ + LOGGER.info("----------------------------start------------------------"); + LOGGER.info("fileContentMd5:{}",fileContentMd5); + LOGGER.info("contentType:{}",contentType); + } + return EsignHttpCfgHelper.sendHttp(reqType,uploadUrl, uploadHeader, param,debug); + } + + + + /** + * @description 构建一个签名鉴权+json数据的esign请求头 + * @return + * @author 澄泓 + */ + public static Map buildSignAndJsonHeader(String projectId,String contentMD5,String accept,String contentType,String authMode) { + + Map header = new HashMap<>(); + header.put("X-Tsign-Open-App-Id", projectId); + header.put("X-Tsign-Open-Version-Sdk",EsignCoreSdkInfo.getSdkVersion()); + header.put("X-Tsign-Open-Ca-Timestamp", EsignEncryption.timeStamp()); + header.put("Accept",accept); + header.put("Content-MD5",contentMD5); + header.put("Content-Type", contentType); + header.put("X-Tsign-Open-Auth-Mode", authMode); + return header; + } + + /** + * 签名计算并且构建一个签名鉴权+json数据的esign请求头 + * @param httpMethod + * * The name of a supported {@linkplain java.nio.charset.Charset + * * charset} + * @return + */ + public static Map signAndBuildSignAndJsonHeader(String projectId, String secret,String paramStr,String httpMethod,String url,boolean debug) throws EsignDemoException { + String contentMD5=""; + //统一转大写处理 + httpMethod = httpMethod.toUpperCase(); + if("GET".equals(httpMethod)||"DELETE".equals(httpMethod)){ + paramStr=null; + contentMD5=""; + } else if("PUT".equals(httpMethod)||"POST".equals(httpMethod)){ + //对body体做md5摘要 + contentMD5= EsignEncryption.doContentMD5(paramStr); + }else{ + throw new EsignDemoException(String.format("不支持的请求方法%s",httpMethod)); + } + //构造一个初步的请求头 + Map esignHeaderMap = buildSignAndJsonHeader(projectId, contentMD5, EsignHeaderConstant.ACCEPT.VALUE(), EsignHeaderConstant.CONTENTTYPE_JSON.VALUE(), EsignHeaderConstant.AUTHMODE.VALUE()); + //排序 + url=EsignEncryption.sortApiUrl(url); + //传入生成的bodyMd5,加上其他请求头部信息拼接成字符串 + String message = EsignEncryption.appendSignDataString(httpMethod, esignHeaderMap.get("Content-MD5"),esignHeaderMap.get("Accept"),esignHeaderMap.get("Content-Type"),esignHeaderMap.get("Headers"),esignHeaderMap.get("Date"), url); + //整体做sha256签名 + String reqSignature = EsignEncryption.doSignatureBase64(message, secret); + //请求头添加签名值 + esignHeaderMap.put("X-Tsign-Open-Ca-Signature",reqSignature); + if(debug){ + LOGGER.info("----------------------------start------------------------"); + LOGGER.info("待计算body值:{}", paramStr+"\n"); + LOGGER.info("MD5值:{}",contentMD5+"\n"); + LOGGER.info("待签名字符串:{}",message+"\n"); + LOGGER.info("签名值:{}",reqSignature+"\n"); + } + return esignHeaderMap; + } + + + /** + * @description 构建一个Token鉴权+jsons数据的esign请求头 + * @return + * @author 澄泓 + */ + public static Map buildTokenAndJsonHeader(String appid,String token) { + Map esignHeader = new HashMap<>(); + esignHeader.put("X-Tsign-Open-Version-Sdk", EsignCoreSdkInfo.getSdkVersion()); + esignHeader.put("Content-Type", EsignHeaderConstant.CONTENTTYPE_JSON.VALUE()); + esignHeader.put("X-Tsign-Open-App-Id", appid); + esignHeader.put("X-Tsign-Open-Token", token); + return esignHeader; + } + + /** + * @description 构建一个form表单数据的esign请求头 + * @return + * @author 澄泓 + */ + public static Map buildFormDataHeader(String appid) { + Map esignHeader = new HashMap<>(); + esignHeader.put("X-Tsign-Open-Version-Sdk",EsignCoreSdkInfo.getSdkVersion()); + esignHeader.put("X-Tsign-Open-Authorization-Version","v2"); + esignHeader.put("Content-Type", EsignHeaderConstant.CONTENTTYPE_FORMDATA.VALUE()); + esignHeader.put("X-Tsign-Open-App-Id", appid); + return esignHeader; + } + + /** + * @description 创建文件流上传 请求头 + * + * @param fileContentMd5 + * @param contentType + * @return + * @author 澄泓 + */ + public static Map buildUploadHeader(String fileContentMd5, String contentType) { + Map header = new HashMap<>(); + header.put("Content-MD5", fileContentMd5); + header.put("Content-Type", contentType); + + return header; + } + + // ------------------------------私有方法end---------------------------------------------- +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/EsignFileBean.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/EsignFileBean.java new file mode 100644 index 0000000..5f46713 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/EsignFileBean.java @@ -0,0 +1,57 @@ +package com.ruoyi.common.utils.bean; + + +import com.ruoyi.common.constant.FileTransformation; +import com.ruoyi.common.exception.EsignDemoException; + +import java.io.File; + +/** + * @description 文件基础信息封装类 + * @author 澄泓 + * @date 2020/10/26 14:54 + * @version JDK1.7 + */ +public class EsignFileBean { + //文件名称 + private String fileName; + //文件大小 + private int fileSize; + //文件内容MD5 + private String fileContentMD5; + //文件地址 + private String filePath; + + + public EsignFileBean(String filePath) throws EsignDemoException { + this.filePath=filePath; + this.fileContentMD5 = FileTransformation.getFileContentMD5(filePath); + File file = new File(filePath); + if (!file.exists()) { + throw new EsignDemoException("文件不存在"); + } + this.fileName = file.getName(); + this.fileSize = (int) file.length(); + } + + public String getFileName() { + return fileName; + } + + public int getFileSize() { + return fileSize; + } + + public String getFileContentMD5() { + return fileContentMD5; + } + + /** + * 传入本地文件地址获取二进制数据 + * @return + * @throws EsignDemoException + */ + public byte[] getFileBytes() throws EsignDemoException { + return FileTransformation.fileToBytes(filePath); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java new file mode 100644 index 0000000..5ea9410 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java @@ -0,0 +1,43 @@ +package com.ruoyi.common.utils.file; + +import com.ruoyi.common.config.EsignDemoConfig; +import com.ruoyi.common.constant.EsignHeaderConstant; +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.EsignHttpHelper; +import com.ruoyi.common.utils.bean.EsignFileBean; + +import java.util.Map; + +public class SaaSAPIFileUtils { + private static String eSignHost= EsignDemoConfig.EsignHost; + private static String eSignAppId= EsignDemoConfig.EsignAppId; + private static String eSignAppSecret=EsignDemoConfig.EsignAppSecret; + /** + * 获取文件上传地址 + * + * @return + */ + public static EsignHttpResponse getUploadUrl(String filePath) throws EsignDemoException { + //自定义的文件封装类,传入文件地址可以获取文件的名称大小,文件流等数据 + EsignFileBean esignFileBean = new EsignFileBean(filePath); + String apiaddr = "/v3/files/file-upload-url"; + //请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null + String jsonParm = "{\n" + + " \"contentMd5\": \"" + esignFileBean.getFileContentMD5() + "\",\n" + + " \"fileName\":\"" + esignFileBean.getFileName() + "\"," + + " \"fileSize\": " + esignFileBean.getFileSize() + ",\n" + + " \"convertToPDF\":" +true+ ",\n" + + " \"contentType\": \"" + EsignHeaderConstant.CONTENTTYPE_STREAM.VALUE() + "\"\n" + + "}"; + //请求方法 + EsignRequestType requestType = EsignRequestType.POST; + //生成签名鉴权方式的的header + Map header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); + //发起接口请求 + return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); + } + + +} From a43ded3a85e3354ec52af9010d179f2b342c3191 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 10 Oct 2023 16:54:51 +0800 Subject: [PATCH 071/123] =?UTF-8?q?=E8=B7=B3=E8=BF=87token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/wisdomarbitrate/CaseApplicationController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 27287d5..7222568 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -1,5 +1,6 @@ package com.ruoyi.web.controller.wisdomarbitrate; +import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -220,8 +221,9 @@ public class CaseApplicationController extends BaseController { /** - * 确认缴费查询立案信息 + * 发送房间号短信 */ + @Anonymous @PostMapping("/sendRoomNoMessage") public AjaxResult sendRoomNoMessage(@Validated @RequestBody SendRoomNoMessageVO messageVO) { From f0f65d0cf0950b50e67c55226fb6b667e59c3c4b Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 10 Oct 2023 17:47:12 +0800 Subject: [PATCH 072/123] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=88=BF=E9=97=B4?= =?UTF-8?q?=E5=8F=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 1 + .../domain/vo/SendRoomNoMessageVO.java | 3 ++- .../wisdomarbitrate/mapper/ArbitratorMapper.java | 8 -------- .../mapper/CaseAffiliateMapper.java | 2 ++ .../service/impl/CaseApplicationServiceImpl.java | 10 +++++----- .../mapper/wisdomarbitrate/ArbitratorMapper.xml | 16 ---------------- .../wisdomarbitrate/CaseAffiliateMapper.xml | 14 ++++++++++++++ 7 files changed, 24 insertions(+), 30 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 7222568..01d6354 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; import com.ruoyi.common.utils.poi.ExcelUtil; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/SendRoomNoMessageVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/SendRoomNoMessageVO.java index d20d4f3..0ba7248 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/SendRoomNoMessageVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/SendRoomNoMessageVO.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.domain.vo; import lombok.Data; import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -13,7 +14,7 @@ import java.io.Serializable; @Data public class SendRoomNoMessageVO implements Serializable { private static final long serialVersionUID = 1L; - @NotEmpty(message = "案件id不能为空") + @NotNull(message = "案件id不能为空") private Long id; @NotEmpty(message = "房间号不能为空") private String roomNo; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java index e7d6e2b..04bda03 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java @@ -8,12 +8,4 @@ import java.util.List; public interface ArbitratorMapper { List selectArbitratorList(Arbitrator arbitrator); - /** - * 根据案件id和身份类型查询案件关联人 - * @param caseAppliId - * @param identityType - * @return - */ - Arbitrator selectArbitratorById(@Param("caseAppliId") Long caseAppliId,@Param("identityType") Integer identityType); - } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java index 52e0057..9c0ce9d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java @@ -2,6 +2,7 @@ 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; @@ -15,6 +16,7 @@ public interface CaseAffiliateMapper { List selectCaseAffiliate(CaseAffiliate caseAffiliate); + CaseAffiliate selectCaseAffiliateByIdentityType(@Param("caseAppliId") Long caseAppliId, @Param("identityType")int identityType); int updataCaseAffiliate(CaseAffiliate caseAffiliate); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index da34b56..6ce19d3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -461,8 +461,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { */ @Override public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) { - Arbitrator arbitrator = arbitratorMapper.selectArbitratorById(messageVO.getId(), 2); - if(null==arbitrator){ + CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(messageVO.getId(), 2); + if(null==caseAffiliate){ return "被申请人不存在"; } CaseApplication caseApplication = new CaseApplication(); @@ -473,9 +473,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); request.setTemplateId("1948332"); // 1948332 普通短信 开庭审理房间号通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请知晓,如非本人操作,请忽略本短信。 - request.setPhone(arbitrator.getTelephone()); - request.setTemplateParamSet(new String[]{arbitrator.getArbitratorName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()}); - + request.setPhone(caseAffiliate.getContactTelphone()); + request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()}); + SmsUtils.sendSms(request); return "短信发送成功"; } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml index 1c1845b..e394d00 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml @@ -36,21 +36,5 @@ - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index 7a10075..90258bb 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -33,6 +33,20 @@ + From db5a2e44e64b8875cd935ac115a179756754bb09 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Tue, 10 Oct 2023 18:23:45 +0800 Subject: [PATCH 073/123] =?UTF-8?q?1=E3=80=81=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=9C=B0=E5=9D=80=20?= =?UTF-8?q?=EF=BC=8C2=E3=80=81=20=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B5=81=20=EF=BC=8C3=E3=80=81=20=E6=9F=A5=E8=AF=A2=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/utils/file/SaaSAPIFileUtils.java | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java index 5ea9410..fa6389b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java @@ -1,5 +1,6 @@ package com.ruoyi.common.utils.file; +import cn.hutool.json.JSONObject; import com.ruoyi.common.config.EsignDemoConfig; import com.ruoyi.common.constant.EsignHeaderConstant; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; @@ -16,8 +17,6 @@ public class SaaSAPIFileUtils { private static String eSignAppSecret=EsignDemoConfig.EsignAppSecret; /** * 获取文件上传地址 - * - * @return */ public static EsignHttpResponse getUploadUrl(String filePath) throws EsignDemoException { //自定义的文件封装类,传入文件地址可以获取文件的名称大小,文件流等数据 @@ -38,6 +37,47 @@ public class SaaSAPIFileUtils { //发起接口请求 return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); } + /** + * 上传文件流 + */ + public static EsignHttpResponse uploadFile(String uploadUrl,String filePath) throws EsignDemoException { + //根据文件地址获取文件contentMd5 + EsignFileBean esignFileBean = new EsignFileBean(filePath); + //请求方法 + EsignRequestType requestType= EsignRequestType.PUT; + return EsignHttpHelper.doUploadHttp(uploadUrl,requestType,esignFileBean.getFileBytes(),esignFileBean.getFileContentMD5(), EsignHeaderConstant.CONTENTTYPE_STREAM.VALUE(),true); + } + /** + * 获取文件上传状态 + */ + public static EsignHttpResponse getFileStatus(String fileId) throws EsignDemoException { + String apiaddr="/v3/files/"+fileId; + //请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null + String jsonParm=null; + //请求方法 + EsignRequestType requestType= EsignRequestType.GET; + //生成签名鉴权方式的的header + Map header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true); + //发起接口请求 + return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true); + } + +/* public static void main(String[] args) throws EsignDemoException { + String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\07\\6babb8e261454fffbacf6d9fd1589b9b.docx"; + EsignHttpResponse uploadUrl = getUploadUrl(filePath); + String body = uploadUrl.getBody(); + JSONObject jsonObject = new JSONObject(body); + JSONObject dataObj = jsonObject.getJSONObject("data"); + String fileUploadUrl = dataObj.get("fileUploadUrl").toString(); + System.out.println("这是fileUploadUrl:"+fileUploadUrl); + String fileId = dataObj.get("fileId").toString(); + System.out.println("这是fileId:"+fileId); + EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath); + System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody()); + EsignHttpResponse fileStatus = getFileStatus(fileId); + System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody()); + getFileStatus("95d0c307d91e4985bdb8874f6f84daa5"); + }*/ } From af901190b9eab9cfa476280b998befa370b76eed Mon Sep 17 00:00:00 2001 From: gy b Date: Tue, 10 Oct 2023 18:25:15 +0800 Subject: [PATCH 074/123] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=92=8C=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 7 +++++++ .../CaseApplicationController.java | 19 ++++++++++--------- .../CaseArbitrateController.java | 3 +++ .../CaseEvidenceController.java | 3 +++ .../CaseLogRecordController.java | 2 +- .../CasePaymentController.java | 3 +++ 6 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index cbc0f7b..af62cdf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -6,6 +6,7 @@ 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.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -21,6 +22,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/document") + @PreAuthorize("@ss.hasPermi('caseManagement:createaward')") public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.createDocument(caseApplication); } @@ -41,6 +43,7 @@ public class AdjudicationController extends BaseController { * @return */ @GetMapping("/logistics") + @PreAuthorize("@ss.hasPermi('delivery:detail')") public AjaxResult getLogisticsInfo(CaseApplication caseApplication){ return adjudicationService.getLogisticsInfo(caseApplication); } @@ -51,6 +54,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/signature") + @PreAuthorize("@ss.hasPermi('awardManagement:sign')") public AjaxResult signature(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.signature(caseApplication); } @@ -61,6 +65,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/caseFile") + @PreAuthorize("@ss.hasPermi('awardManagement:file')") public AjaxResult caseFile(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.caseFile(caseApplication); } @@ -71,6 +76,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/service") + @PreAuthorize("@ss.hasPermi('awardManagement:sendaward')") public AjaxResult service(@RequestBody BookSendVO bookSendVO){ return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum()); } @@ -80,6 +86,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/stamp") + @PreAuthorize("@ss.hasPermi('awardManagement:signprint')") public AjaxResult stamp(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.stamp(caseApplication); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 27287d5..8225542 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -34,7 +34,7 @@ public class CaseApplicationController extends BaseController { /** * 查询立案数据 */ - @PreAuthorize("@ss.hasPermi('caseApplication:list')") + @PreAuthorize("@ss.hasPermi('caseManagement:list')") @GetMapping("/list") public TableDataInfo list(CaseApplication caseApplication) { @@ -46,7 +46,7 @@ public class CaseApplicationController extends BaseController { /** * 新增立案数据 */ - @PreAuthorize("@ss.hasPermi('caseApplication:add')") + @PreAuthorize("@ss.hasPermi('caseManagement:add')") @Log(title = "新增立案数据", businessType = BusinessType.INSERT) @PostMapping("/addCaseApplication") public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication) @@ -62,7 +62,7 @@ public class CaseApplicationController extends BaseController { /** * 修改立案数据 */ - @PreAuthorize("@ss.hasPermi('caseApplication:edit')") + @PreAuthorize("@ss.hasPermi('caseManagement:update')") @Log(title = "修改立案数据", businessType = BusinessType.UPDATE) @PostMapping("/editCaseApplication") public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplication caseApplication) @@ -75,7 +75,7 @@ public class CaseApplicationController extends BaseController { /** * 提交立案申请 */ - @PreAuthorize("@ss.hasPermi('caseApplication:submit')") + @PreAuthorize("@ss.hasPermi('caseManagement:submit')") @Log(title = "提交立案申请", businessType = BusinessType.UPDATE) @PostMapping("/submitCaseApplication") public AjaxResult submitCaseApplication(@Validated @RequestBody CaseApplication caseApplication) @@ -87,7 +87,7 @@ public class CaseApplicationController extends BaseController { /** * 删除立案数据 */ - @PreAuthorize("@ss.hasPermi('caseApplication:remove')") + @PreAuthorize("@ss.hasPermi('caseManagement:delete')") @Log(title = "删除立案数据", businessType = BusinessType.DELETE) @PostMapping("/removeCaseApplication") public AjaxResult removeCaseApplication(@Validated @RequestBody CaseApplication caseApplication) @@ -99,6 +99,7 @@ public class CaseApplicationController extends BaseController { /** * 查询立案信息 */ + @PreAuthorize("@ss.hasPermi('caseManagement:detail')") @PostMapping("/selectCaseApplication") public AjaxResult selectCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { @@ -117,7 +118,7 @@ public class CaseApplicationController extends BaseController { } @Log(title = "立案信息导入", businessType = BusinessType.IMPORT) - @PreAuthorize("@ss.hasPermi('caseApplication:import')") + @PreAuthorize("@ss.hasPermi('caseManagement:import')") @PostMapping("/importData") public AjaxResult importData(MultipartFile file) throws Exception { ExcelUtil util = new ExcelUtil(CaseApplication.class); @@ -141,7 +142,7 @@ public class CaseApplicationController extends BaseController { /** * 组庭审核 */ - @PreAuthorize("@ss.hasPermi('caseApplication:pendTralCheck')") + @PreAuthorize("@ss.hasPermi('caseManagement:checkgroup')") @Log(title = "组庭审核", businessType = BusinessType.UPDATE) @PostMapping("/pendTralCheck") public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) @@ -152,7 +153,7 @@ public class CaseApplicationController extends BaseController { /** * 组庭确认 */ - @PreAuthorize("@ss.hasPermi('caseApplication:pendTralSure')") + @PreAuthorize("@ss.hasPermi('caseManagement:confirmgroup')") @Log(title = "组庭确认", businessType = BusinessType.UPDATE) @PostMapping("/pendTralSure") public AjaxResult pendTralSure(@Validated @RequestBody CaseApplication caseApplication) @@ -198,7 +199,7 @@ public class CaseApplicationController extends BaseController { /** * 提交立案审查 */ - @PreAuthorize("@ss.hasPermi('caseApplication:submitCaseApplicationCheck')") + @PreAuthorize("@ss.hasPermi('caseManagement:check')") @Log(title = "提交立案审查", businessType = BusinessType.UPDATE) @PostMapping("/submitCaseApplicationCheck") public AjaxResult submitCaseApplicationCheck(@Validated @RequestBody CaseApplication caseApplication) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java index b44cead..440bdad 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java @@ -6,6 +6,7 @@ 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.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -22,6 +23,7 @@ public class CaseArbitrateController extends BaseController { * @return */ @PutMapping("/method") + @PreAuthorize("@ss.hasPermi('caseManagement:checkarbitrationway')") public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication ,Integer opinion){ return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion); @@ -33,6 +35,7 @@ public class CaseArbitrateController extends BaseController { * @return */ @PostMapping("/writtenHear") + @PreAuthorize("@ss.hasPermi('caseManagement:offlinehear')") public AjaxResult writtenHear(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ return caseArbitrateService.writtenHear(arbitrateRecord); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index 536228c..49f30ee 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -8,6 +8,7 @@ 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.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -35,6 +36,7 @@ public class CaseEvidenceController extends BaseController { * @return */ @GetMapping("/{id}") + @PreAuthorize("@ss.hasPermi('caseManagement:detail')") public AjaxResult getCaseDetailsById(@PathVariable Long id) { String username = this.getUsername(); return caseEvidenceService.getCaseDetailsById(id,username); @@ -61,6 +63,7 @@ public class CaseEvidenceController extends BaseController { * @return */ @GetMapping("/all") + @PreAuthorize("@ss.hasPermi('caseManagement:list')") public TableDataInfo getCaseListAll(@RequestParam String identityNum) { startPage(); List list = caseEvidenceService.getCaseListAll(identityNum); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java index dc733c1..8fd1ee0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java @@ -22,7 +22,7 @@ public class CaseLogRecordController extends BaseController { /** * 查询案件日志列表 */ - @PreAuthorize("@ss.hasPermi('caseLogRecord:list')") + @PreAuthorize("@ss.hasPermi('caseLog:list')") @GetMapping("/list") public TableDataInfo list(CaseLogRecord caseLogRecord) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java index 712ac1f..9bd76f7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java @@ -5,6 +5,7 @@ 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.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -24,6 +25,7 @@ public class CasePaymentController { * @param casePayDTO 缴费传入参数 * @return 统一响应结果 */ + @PreAuthorize("@ss.hasPermi('caseManagement:pay')") @PostMapping("/casePay") public AjaxResult casePay(@Validated @RequestBody CasePayDTO casePayDTO) { return paymentService.casePay(casePayDTO); @@ -34,6 +36,7 @@ public class CasePaymentController { * @param caseApplication * @return */ + @PreAuthorize("@ss.hasPermi('paymentManagement:payconfirm')") @PutMapping("/confirm") public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) { return paymentService.confirmPayment(caseApplication); From e1422ce1c8d103ddcf98a7d5010333d7269e7415 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 10 Oct 2023 19:23:27 +0800 Subject: [PATCH 075/123] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E7=AB=8B=E6=A1=88=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 6 -- .../wisdomarbitrate/domain/CaseLogRecord.java | 29 ++++++++++ .../impl/CaseApplicationServiceImpl.java | 56 +++++++++++-------- .../impl/CaseLogRecordServiceImpl.java | 40 ++++++++++++- .../wisdomarbitrate/CaseLogRecordMapper.xml | 9 ++- 5 files changed, 108 insertions(+), 32 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 01d6354..e3941a8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -6,22 +6,16 @@ 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.domain.vo.SendRoomNoMessageVO; 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.annotation.security.PermitAll; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java index 4a47bd4..bd5f9ca 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java @@ -25,6 +25,15 @@ public class CaseLogRecord extends BaseEntity { /** 案件编号 */ private String caseNum; + /** + * 展示的内容 + */ + private String content; + /** + * 用户昵称 + */ + private String nickName; + public String getCaseNum() { return caseNum; @@ -73,4 +82,24 @@ public class CaseLogRecord extends BaseEntity { public void setNotes(String notes) { this.notes = notes; } + + public void setCaseNode(Integer caseNode) { + this.caseNode = caseNode; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 6ce19d3..a8bfabb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.entity.SysDept; @@ -69,34 +70,38 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = caseApplicationMapper.insertCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); - + Map deptMap =new HashMap<>(); if (caseAffiliates != null && caseAffiliates.size() > 0) { - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - if (CollectionUtil.isEmpty(deptList)) { - deptList = new ArrayList<>(); + if(StrUtil.isNotEmpty(caseApplication.getName())) { + // 查询所有的组织机构,组装成map + List deptList = sysDeptMapper.selectDeptList(new SysDept()); + if (CollectionUtil.isEmpty(deptList)) { + deptList = new ArrayList<>(); + } + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId)); } - Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId)); - for (CaseAffiliate caseAffiliate : caseAffiliates) { caseAffiliate.setCaseAppliId(caseApplication.getId()); - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseApplication.getName())) { - caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseApplication.getName()); - dept.setAncestors("0"); - dept.setOrderNum(1); - dept.setStatus("0"); - dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); - sysDeptMapper.insertDept(dept); - caseAffiliate.setName(String.valueOf(dept.getDeptId())); + if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseApplication.getName())) { + // 将组织机构id设为申请人名称 + if (deptMap.containsKey(caseApplication.getName())) { + caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); + } else { + // 如果不存在则新增 + SysDept dept = new SysDept(); + dept.setParentId(0L); + dept.setDeptName(caseApplication.getName()); + dept.setAncestors("0"); + dept.setOrderNum(1); + dept.setStatus("0"); + dept.setDelFlag("0"); + dept.setCreateBy(getUsername()); + dept.setUpdateBy(getUsername()); + sysDeptMapper.insertDept(dept); + deptMap.put(dept.getDeptName(), dept.getDeptId()); + caseAffiliate.setName(String.valueOf(dept.getDeptId())); + } } } @@ -582,7 +587,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { BeanUtils.copyBeanProp(caseAffiliate,caseApplication); caseAffiliate.setIdentityType(1); // 申请人(机构),需要判断部门中是否存在,不存在则新增,当身份类型为1的时候,查询时需要根据名称查询组织机构 - setApplicantOrganization(caseAffiliate,caseApplication,deptList); + if(StrUtil.isNotEmpty(caseApplication.getName())){ + setApplicantOrganization(caseAffiliate, caseApplication, deptList); + } caseAffiliatesnew.add(caseAffiliate); // 组装被申请人信息 @@ -615,6 +622,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { dept.setCreateBy(getUsername()); dept.setUpdateBy(getUsername()); sysDeptMapper.insertDept(dept); + deptMap.put(dept.getDeptName(),dept.getDeptId()); caseAffiliate.setName(String.valueOf(dept.getDeptId())); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index de484db..1236934 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -1,5 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; @@ -16,7 +18,43 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService { @Override public List selectCaseLogRecordList(CaseLogRecord caseLogRecord) { - return caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); + List records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); + if(CollectionUtil.isNotEmpty(records)){ + records.forEach(record->{ + StringBuilder contentBuilder = new StringBuilder(); + if(StrUtil.isNotEmpty(record.getNickName())) { + contentBuilder.append(record.getNickName()); + } + contentBuilder.append("于").append(record.getCaseNodeTime()); + switch(record.getCaseNode()){ + case 0: + contentBuilder.append("创建立案申请"); + break; + case 1: + contentBuilder.append("提交立案申请"); + break; + case 2: + contentBuilder.append("提交立案审查"); + break; + case 3: + contentBuilder.append("创建立案申请"); + break; + case 4: + contentBuilder.append("缴费成功"); + case 5: + contentBuilder.append("缴费成功"); + case 6: + contentBuilder.append("缴费成功"); + case 7: + contentBuilder.append("缴费成功"); + case 8: + contentBuilder.append("缴费成功"); + break; + } + + }); + } + return records; } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 88d4288..8ec69d1 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -10,6 +10,8 @@ + + @@ -20,12 +22,17 @@ From 373486d54a9bce6d159052d3ffebd5f6092a7a05 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 10 Oct 2023 19:37:55 +0800 Subject: [PATCH 076/123] =?UTF-8?q?=E5=85=B3=E8=81=94=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseApplicationServiceImpl.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index a8bfabb..4866118 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -256,6 +256,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(caseApplicationList!=null&&caseApplicationList.size()>0){ // 1,查询所有的组织机构,组装成map List deptList = sysDeptMapper.selectDeptList(new SysDept()); + Map deptMap =new HashMap<>(); + if(CollectionUtil.isNotEmpty(deptList)) { + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId)); + } List caseApplicationListinsert = new ArrayList<>(); for (int i = 0; i < caseApplicationList.size(); i++){ CaseApplication caseApplication = caseApplicationList.get(i); @@ -268,7 +272,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //赋值CaseApplication的案件关联人信息 List caseAffiliatesnew = new ArrayList<>(); // 组装案件关联人信息 - assignmentCaseAffiliates(caseApplication,caseAffiliatesnew,deptList); + assignmentCaseAffiliates(caseApplication,caseAffiliatesnew,deptMap); // int caseApplicationCount = selectCaseApplicationCount(caseApplication); // if(caseApplicationCount>0){ @@ -579,7 +583,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { - private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew,List deptList) { + private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew, Map deptMap) { // 申请人信息 CaseAffiliate caseAffiliate = new CaseAffiliate(); @@ -588,7 +592,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setIdentityType(1); // 申请人(机构),需要判断部门中是否存在,不存在则新增,当身份类型为1的时候,查询时需要根据名称查询组织机构 if(StrUtil.isNotEmpty(caseApplication.getName())){ - setApplicantOrganization(caseAffiliate, caseApplication, deptList); + setApplicantOrganization(caseAffiliate, caseApplication, deptMap); } caseAffiliatesnew.add(caseAffiliate); @@ -603,10 +607,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * @param caseApplication */ @DataScope(deptAlias = "d") - private void setApplicantOrganization(CaseAffiliate caseAffiliate, CaseApplication caseApplication, List deptList ) { + private void setApplicantOrganization(CaseAffiliate caseAffiliate, CaseApplication caseApplication, Map deptMap ) { + + - if(CollectionUtil.isNotEmpty(deptList)){ - Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId)); // 将组织机构id设为申请人名称 if(deptMap.containsKey(caseApplication.getName())){ caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); @@ -626,9 +630,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setName(String.valueOf(dept.getDeptId())); } - } - - } From 01fd6157e1bd3d3777c4ebdf66b6bf9de59ed91d Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 10 Oct 2023 20:53:40 +0800 Subject: [PATCH 077/123] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 6 ++--- .../impl/CaseApplicationServiceImpl.java | 24 +++++++++++++------ .../wisdomarbitrate/CaseApplicationMapper.xml | 12 ++++++---- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 543c4f9..33cd573 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -1,5 +1,6 @@ package com.ruoyi.web.controller.wisdomarbitrate; +import cn.hutool.core.util.StrUtil; import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -47,10 +48,7 @@ public class CaseApplicationController extends BaseController { @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)); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 4866118..27b9298 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -72,25 +72,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseAffiliates = caseApplication.getCaseAffiliates(); Map deptMap =new HashMap<>(); if (caseAffiliates != null && caseAffiliates.size() > 0) { - if(StrUtil.isNotEmpty(caseApplication.getName())) { // 查询所有的组织机构,组装成map List deptList = sysDeptMapper.selectDeptList(new SysDept()); if (CollectionUtil.isEmpty(deptList)) { deptList = new ArrayList<>(); } - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId)); - } + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); + for (CaseAffiliate caseAffiliate : caseAffiliates) { caseAffiliate.setCaseAppliId(caseApplication.getId()); - if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseApplication.getName())) { + if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseApplication.getName())) { - caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); + caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); } else { // 如果不存在则新增 SysDept dept = new SysDept(); dept.setParentId(0L); - dept.setDeptName(caseApplication.getName()); + dept.setDeptName(caseAffiliate.getName()); dept.setAncestors("0"); dept.setOrderNum(1); dept.setStatus("0"); @@ -227,12 +226,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if(caseAffiliatListeselect!=null){ + // 查询组织机构 + List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); + Map deptMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(sysDepts)){ + for (SysDept sysDept : sysDepts) { + deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); + } + } StringBuffer applicantName = new StringBuffer(); StringBuffer respondentName = new StringBuffer(); for (int i = 0; i < caseAffiliatListeselect.size(); i++){ CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); if(identityType==1){ + if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ + caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); + } applicantName.append(caseAffiliateselect.getName()).append(",");; }else if(identityType==2){ respondentName.append(caseAffiliateselect.getName()).append(",");; @@ -258,7 +268,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List deptList = sysDeptMapper.selectDeptList(new SysDept()); Map deptMap =new HashMap<>(); if(CollectionUtil.isNotEmpty(deptList)) { - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId)); + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); } List caseApplicationListinsert = new ArrayList<>(); for (int i = 0; i < caseApplicationList.size(); i++){ diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 0e8219b..6048e88 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -55,10 +55,10 @@ c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , - c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as name + c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName from case_application c LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 - LEFT JOIN sys_dept d ON ca.NAME = d.dept_id + LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id AND c.case_status = #{caseStatus} @@ -206,8 +206,10 @@ c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , - c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name + c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,d.dept_name as applicantName from case_application c + LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 + LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id AND c.id = #{id} @@ -236,8 +238,10 @@ p.payment_status , CASE p.payment_status when 1 then '已支付' when 0 then '未支付' ELSE '无支付状态' - END paymentStatusName + END paymentStatusName,d.dept_name as applicantName from case_application c left join case_payment_record p on c.id = p.case_id + LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 + LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id where c.case_status = 3 and p.payment_status = 1 AND c.id = #{id} From a7b7ea826fcfd937467bf24b2ee8d097201308d1 Mon Sep 17 00:00:00 2001 From: gy b Date: Tue, 10 Oct 2023 21:25:29 +0800 Subject: [PATCH 078/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 10 +-- .../wisdomarbitrate/ArbitratorController.java | 2 +- .../CaseApplicationController.java | 73 ++++++++----------- .../CaseArbitrateController.java | 4 +- .../CaseEvidenceController.java | 2 +- .../CasePaymentController.java | 4 +- 6 files changed, 40 insertions(+), 55 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index af62cdf..3096efe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -22,7 +22,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/document") - @PreAuthorize("@ss.hasPermi('caseManagement:createaward')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:createaward')") public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.createDocument(caseApplication); } @@ -54,7 +54,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/signature") - @PreAuthorize("@ss.hasPermi('awardManagement:sign')") + @PreAuthorize("@ss.hasPermi('awardManagement:list:sign')") public AjaxResult signature(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.signature(caseApplication); } @@ -65,7 +65,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/caseFile") - @PreAuthorize("@ss.hasPermi('awardManagement:file')") + @PreAuthorize("@ss.hasPermi('awardManagement:list:file')") public AjaxResult caseFile(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.caseFile(caseApplication); } @@ -76,7 +76,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/service") - @PreAuthorize("@ss.hasPermi('awardManagement:sendaward')") + @PreAuthorize("@ss.hasPermi('awardManagement:list:sendaward')") public AjaxResult service(@RequestBody BookSendVO bookSendVO){ return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum()); } @@ -86,7 +86,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/stamp") - @PreAuthorize("@ss.hasPermi('awardManagement:signprint')") + @PreAuthorize("@ss.hasPermi('awardManagement:list:signprint')") public AjaxResult stamp(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.stamp(caseApplication); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java index 8b9f249..b87089a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java @@ -21,7 +21,7 @@ public class ArbitratorController extends BaseController { /** * 查询仲裁员信息 */ - @PreAuthorize("@ss.hasPermi('arbitrator:list')") +// @PreAuthorize("@ss.hasPermi('arbitrator:list')") @GetMapping("/list") public TableDataInfo list(Arbitrator arbitrator) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 543c4f9..e3e0c4c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -6,6 +6,7 @@ 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.StringUtils; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; @@ -15,14 +16,14 @@ 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.util.List; - @RestController @RequestMapping("/caseApplication") -public class CaseApplicationController extends BaseController { +public class CaseApplicationController extends BaseController { @Autowired private ICaseApplicationService caseApplicationService; @@ -32,8 +33,7 @@ public class CaseApplicationController extends BaseController { */ @PreAuthorize("@ss.hasPermi('caseManagement:list')") @GetMapping("/list") - public TableDataInfo list(CaseApplication caseApplication) - { + public TableDataInfo list(CaseApplication caseApplication) { startPage(); List list = caseApplicationService.selectCaseApplicationList(caseApplication); return getDataTable(list); @@ -42,7 +42,7 @@ public class CaseApplicationController extends BaseController { /** * 新增立案数据 */ - @PreAuthorize("@ss.hasPermi('caseManagement:add')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:add')") @Log(title = "新增立案数据", businessType = BusinessType.INSERT) @PostMapping("/addCaseApplication") public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication) @@ -58,11 +58,10 @@ public class CaseApplicationController extends BaseController { /** * 修改立案数据 */ - @PreAuthorize("@ss.hasPermi('caseManagement:update')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:update')") @Log(title = "修改立案数据", businessType = BusinessType.UPDATE) @PostMapping("/editCaseApplication") - public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { caseApplication.setUpdateBy(getUsername()); return toAjax(caseApplicationService.editCaseApplication(caseApplication)); @@ -71,11 +70,10 @@ public class CaseApplicationController extends BaseController { /** * 提交立案申请 */ - @PreAuthorize("@ss.hasPermi('caseManagement:submit')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:submit')") @Log(title = "提交立案申请", businessType = BusinessType.UPDATE) @PostMapping("/submitCaseApplication") - public AjaxResult submitCaseApplication(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult submitCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { return toAjax(caseApplicationService.submitCaseApplication(caseApplication)); } @@ -83,11 +81,10 @@ public class CaseApplicationController extends BaseController { /** * 删除立案数据 */ - @PreAuthorize("@ss.hasPermi('caseManagement:delete')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:delete')") @Log(title = "删除立案数据", businessType = BusinessType.DELETE) @PostMapping("/removeCaseApplication") - public AjaxResult removeCaseApplication(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult removeCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { return toAjax(caseApplicationService.deletecaseApplicationByIds(caseApplication)); } @@ -95,10 +92,9 @@ public class CaseApplicationController extends BaseController { /** * 查询立案信息 */ - @PreAuthorize("@ss.hasPermi('caseManagement:detail')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") @PostMapping("/selectCaseApplication") - public AjaxResult selectCaseApplication(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult selectCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication); return success(caseApplicationselect); } @@ -107,20 +103,19 @@ public class CaseApplicationController extends BaseController { * 立案申请导入模板下载 */ @PostMapping("/importTemplate") - public void importTemplate(HttpServletResponse response) - { + public void importTemplate(HttpServletResponse response) { ExcelUtil util = new ExcelUtil(CaseApplication.class); util.importTemplateExcel(response, "立案申请数据"); } @Log(title = "立案信息导入", businessType = BusinessType.IMPORT) - @PreAuthorize("@ss.hasPermi('caseManagement:import')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:import')") @PostMapping("/importData") public AjaxResult importData(MultipartFile file) throws Exception { ExcelUtil util = new ExcelUtil(CaseApplication.class); List caseApplicationList = util.importExcel(file.getInputStream()); String operName = getUsername(); - String message = caseApplicationService.importCaseApplication(caseApplicationList,operName); + String message = caseApplicationService.importCaseApplication(caseApplicationList, operName); return success(message); } @@ -130,30 +125,27 @@ public class CaseApplicationController extends BaseController { @PreAuthorize("@ss.hasPermi('caseApplication:pendTral')") @Log(title = "组庭", businessType = BusinessType.UPDATE) @PostMapping("/pendTral") - public AjaxResult pendTral(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult pendTral(@Validated @RequestBody CaseApplication caseApplication) { return toAjax(caseApplicationService.pendTral(caseApplication)); } /** * 组庭审核 */ - @PreAuthorize("@ss.hasPermi('caseManagement:checkgroup')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')") @Log(title = "组庭审核", businessType = BusinessType.UPDATE) @PostMapping("/pendTralCheck") - public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) { return toAjax(caseApplicationService.pendTralCheck(caseApplication)); } /** * 组庭确认 */ - @PreAuthorize("@ss.hasPermi('caseManagement:confirmgroup')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:confirmgroup')") @Log(title = "组庭确认", businessType = BusinessType.UPDATE) @PostMapping("/pendTralSure") - public AjaxResult pendTralSure(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult pendTralSure(@Validated @RequestBody CaseApplication caseApplication) { return toAjax(caseApplicationService.pendTralSure(caseApplication)); } @@ -163,8 +155,7 @@ public class CaseApplicationController extends BaseController { @PreAuthorize("@ss.hasPermi('caseApplication:verificationArbitrateRecord')") @Log(title = "核验裁决书", businessType = BusinessType.UPDATE) @PostMapping("/verificationArbitrateRecord") - public AjaxResult verificationArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult verificationArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) { return toAjax(caseApplicationService.verificationArbitrateRecord(caseApplication)); } @@ -174,32 +165,28 @@ public class CaseApplicationController extends BaseController { @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')") @Log(title = "审核裁决书", businessType = BusinessType.UPDATE) @PostMapping("/checkArbitrateRecord") - public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) - { + 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) - { + public AjaxResult pendingAppointArbotrar(@Validated @RequestBody CaseApplication caseApplication) { return toAjax(caseApplicationService.pendingAppointArbotrar(caseApplication)); } /** * 提交立案审查 */ - @PreAuthorize("@ss.hasPermi('caseManagement:check')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:check')") @Log(title = "提交立案审查", businessType = BusinessType.UPDATE) @PostMapping("/submitCaseApplicationCheck") - public AjaxResult submitCaseApplicationCheck(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult submitCaseApplicationCheck(@Validated @RequestBody CaseApplication caseApplication) { return toAjax(caseApplicationService.submitCaseApplicationCheck(caseApplication)); } @@ -207,22 +194,20 @@ public class CaseApplicationController extends BaseController { /** * 确认缴费查询立案信息 */ + @PreAuthorize("@ss.hasPermi('paymentManagement:list:detail')") @PostMapping("/selectCaseApplicationConfirm") - public AjaxResult selectCaseApplicationConfirm(@Validated @RequestBody CaseApplication caseApplication) - { + public AjaxResult selectCaseApplicationConfirm(@Validated @RequestBody CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplicationConfirm(caseApplication); return success(caseApplicationselect); } - /** * 发送房间号短信 */ @Anonymous @PostMapping("/sendRoomNoMessage") - public AjaxResult sendRoomNoMessage(@Validated @RequestBody SendRoomNoMessageVO messageVO) - { + public AjaxResult sendRoomNoMessage(@Validated @RequestBody SendRoomNoMessageVO messageVO) { String result = caseApplicationService.sendRoomNoMessage(messageVO); return success(result); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java index 440bdad..20c5b17 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java @@ -23,7 +23,7 @@ public class CaseArbitrateController extends BaseController { * @return */ @PutMapping("/method") - @PreAuthorize("@ss.hasPermi('caseManagement:checkarbitrationway')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:checkarbitrationway')") public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication ,Integer opinion){ return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion); @@ -35,7 +35,7 @@ public class CaseArbitrateController extends BaseController { * @return */ @PostMapping("/writtenHear") - @PreAuthorize("@ss.hasPermi('caseManagement:offlinehear')") + @PreAuthorize("@ss.hasPermi('caseManagement:hear')") public AjaxResult writtenHear(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ return caseArbitrateService.writtenHear(arbitrateRecord); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index 49f30ee..50527dc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -36,7 +36,7 @@ public class CaseEvidenceController extends BaseController { * @return */ @GetMapping("/{id}") - @PreAuthorize("@ss.hasPermi('caseManagement:detail')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") public AjaxResult getCaseDetailsById(@PathVariable Long id) { String username = this.getUsername(); return caseEvidenceService.getCaseDetailsById(id,username); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java index 9bd76f7..5f13ee7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java @@ -25,7 +25,7 @@ public class CasePaymentController { * @param casePayDTO 缴费传入参数 * @return 统一响应结果 */ - @PreAuthorize("@ss.hasPermi('caseManagement:pay')") + @PreAuthorize("@ss.hasPermi('caseManagement:list:pay')") @PostMapping("/casePay") public AjaxResult casePay(@Validated @RequestBody CasePayDTO casePayDTO) { return paymentService.casePay(casePayDTO); @@ -36,7 +36,7 @@ public class CasePaymentController { * @param caseApplication * @return */ - @PreAuthorize("@ss.hasPermi('paymentManagement:payconfirm')") + @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')") @PutMapping("/confirm") public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) { return paymentService.confirmPayment(caseApplication); From fd4a156e25382c1cdd9045d3ab633e1c7bda0c12 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 10 Oct 2023 22:41:40 +0800 Subject: [PATCH 079/123] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=E7=AE=80=E5=8D=95=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 1 + .../com/ruoyi/common/annotation/CaseLog.java | 34 ++++++++ .../framework/aspectj/CaseLogAspect.java | 87 +++++++++++++++++++ .../impl/CaseApplicationServiceImpl.java | 56 +++++++++++- .../impl/CaseLogRecordServiceImpl.java | 43 +++++++-- .../wisdomarbitrate/CaseApplicationMapper.xml | 4 +- 6 files changed, 213 insertions(+), 12 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/annotation/CaseLog.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/CaseLogAspect.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 33cd573..7412d73 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -2,6 +2,7 @@ package com.ruoyi.web.controller.wisdomarbitrate; import cn.hutool.core.util.StrUtil; import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.annotation.CaseLog; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/CaseLog.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/CaseLog.java new file mode 100644 index 0000000..4c26db1 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/CaseLog.java @@ -0,0 +1,34 @@ +package com.ruoyi.common.annotation; + + +import java.lang.annotation.*; + +/** + * 案件操作日志记录注解 + * + * @author wangqiong + * + */ +@Target({ ElementType.PARAMETER, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface CaseLog +{ + /** + * 案件申请人id + */ + public long caseAppliId() default 0L; + + /** + * 案件节点 + */ + public String caseNode() default ""; + + + /** + * 备注 + */ + public String notes() default ""; + + +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/CaseLogAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/CaseLogAspect.java new file mode 100644 index 0000000..40d724b --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/CaseLogAspect.java @@ -0,0 +1,87 @@ +package com.ruoyi.framework.aspectj; + + +import com.ruoyi.common.annotation.CaseLog; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 案件操作日志记录处理 + * + * @author wangqiong + */ +@Aspect +@Component +public class CaseLogAspect { + @Autowired + private CaseLogRecordMapper logRecordMapper; + private static final Logger log = LoggerFactory.getLogger(CaseLogAspect.class); + + + /** + * 处理请求前执行 + */ + @Before(value = "@annotation(controllerLog)") + public void boBefore(JoinPoint joinPoint, CaseLog controllerLog) { + } + + /** + * 处理完请求后执行 + * + * @param joinPoint 切点 + */ + @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult") + public void doAfterReturning(JoinPoint joinPoint, CaseLog controllerLog, Object jsonResult) { + handleLog(joinPoint, controllerLog, null, jsonResult); + } + + protected void handleLog(final JoinPoint joinPoint, CaseLog controllerLog, final Exception e, Object jsonResult) { + try { + // 获取当前的用户 + LoginUser loginUser = SecurityUtils.getLoginUser(); + String nickName = loginUser.getUser().getNickName(); + + // *========数据库日志=========*// + CaseLogRecord operLog = new CaseLogRecord(); + operLog.setCreateBy(nickName); + operLog.setUpdateBy(nickName); + // 处理设置注解上的参数 + getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); + + // 保存数据库 + logRecordMapper.insertCaseLogRecord(operLog); + } catch (Exception exp) { + // 记录本地异常日志 + log.error("异常信息:{}", exp.getMessage()); + exp.printStackTrace(); + } + } + + /** + * 获取注解中对方法的描述信息 用于Controller层注解 + * + * @param log 日志 + * @param operLog 操作日志 + * @throws Exception + */ + public void getControllerMethodDescription(JoinPoint joinPoint, CaseLog log, CaseLogRecord operLog, Object jsonResult) throws Exception { + // 设置案件id + operLog.setCaseAppliId(log.caseAppliId()); + // 设置案件节点 + operLog.setNotes(log.caseNode()); + // 设置备注 + operLog.setNotes(log.notes()); + + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 27b9298..9211603 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.ruoyi.common.annotation.CaseLog; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.entity.SysDept; @@ -113,9 +114,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttach.setCaseAppliId(caseApplication.getId()); caseAttachMapper.updateCaseAttach(caseAttach); } - } - return rows; } @@ -156,10 +155,38 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = caseApplicationMapper.updataCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); if(caseAffiliates!=null&&caseAffiliates.size()>0){ + // 查询所有的组织机构,组装成map + List deptList = sysDeptMapper.selectDeptList(new SysDept()); + if (CollectionUtil.isEmpty(deptList)) { + deptList = new ArrayList<>(); + } + Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); for (CaseAffiliate caseAffiliate : caseAffiliates){ caseAffiliate.setCaseAppliId(caseApplication.getId()); + if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { + // 将组织机构id设为申请人名称 + if (deptMap.containsKey(caseApplication.getName())) { + caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); + } else { + // 如果不存在则新增 + SysDept dept = new SysDept(); + dept.setParentId(0L); + dept.setDeptName(caseAffiliate.getName()); + dept.setAncestors("0"); + dept.setOrderNum(1); + dept.setStatus("0"); + dept.setDelFlag("0"); + dept.setCreateBy(getUsername()); + dept.setUpdateBy(getUsername()); + sysDeptMapper.insertDept(dept); + deptMap.put(dept.getDeptName(), dept.getDeptId()); + caseAffiliate.setName(String.valueOf(dept.getDeptId())); + + } + } caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); } + } List caseAttachList = caseApplication.getCaseAttachList(); if(caseAttachList!=null&&caseAttachList.size()>0){ @@ -458,11 +485,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if(caseAffiliatListeselect!=null){ + // 查询组织机构 + List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); + Map deptMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(sysDepts)){ + for (SysDept sysDept : sysDepts) { + deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); + } + } StringBuffer applicantName = new StringBuffer(); for (int i = 0; i < caseAffiliatListeselect.size(); i++){ CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); if(identityType==1){ + if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ + caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); + } applicantName.append(caseAffiliateselect.getName()).append(",");; } } @@ -543,9 +581,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if(caseAffiliatListeselect!=null) { + // 查询组织机构 + List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); + Map deptMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(sysDepts)){ + for (SysDept sysDept : sysDepts) { + deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); + } + } for (int j = 0; j < caseAffiliatListeselect.size(); j++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); int identityType = caseAffiliateselect.getIdentityType(); + if(identityType==1){ + if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ + caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); + } + caseAffiliateselect.setName(caseAffiliateselect.getName());; + } //给申请人、被申请人发送短信通知 request.setPhone(caseAffiliateselect.getContactTelphone()); // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index 1236934..c8c685c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -34,21 +34,50 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService { contentBuilder.append("提交立案申请"); break; case 2: - contentBuilder.append("提交立案审查"); + contentBuilder.append("同意立案申请"); break; case 3: - contentBuilder.append("创建立案申请"); + contentBuilder.append("缴费成功"); break; case 4: - contentBuilder.append("缴费成功"); + contentBuilder.append("已确认缴费"); case 5: - contentBuilder.append("缴费成功"); + contentBuilder.append("进行案件质证"); case 6: - contentBuilder.append("缴费成功"); + contentBuilder.append("同意组庭审核"); case 7: - contentBuilder.append("缴费成功"); + contentBuilder.append("组庭确认成功"); case 8: - contentBuilder.append("缴费成功"); + contentBuilder.append("同意待开庭审理"); + case 9: + contentBuilder.append("同意书面审理"); + break; + case 10: + contentBuilder.append("已完成书面审理"); + break; + case 11: + contentBuilder.append("已生成仲裁文书"); + break; + case 12: + contentBuilder.append("已核查仲裁文书"); + break; + case 13: + contentBuilder.append("已同意仲裁文书"); + break; + case 14: + contentBuilder.append("已完成仲裁文书签名"); + break; + case 15: + contentBuilder.append("已完成仲裁文书用印"); + break; + case 16: + contentBuilder.append("已送达仲裁文书"); + break; + case 17: + contentBuilder.append("已完成案件归档"); + break; + case 26: + contentBuilder.append("已完成证据确认"); break; } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 6048e88..fcc83e4 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -238,10 +238,8 @@ p.payment_status , CASE p.payment_status when 1 then '已支付' when 0 then '未支付' ELSE '无支付状态' - END paymentStatusName,d.dept_name as applicantName + END paymentStatusName from case_application c left join case_payment_record p on c.id = p.case_id - LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 - LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id where c.case_status = 3 and p.payment_status = 1 AND c.id = #{id} From e09da313e024eb962d4da8c78a389b490746aa8f Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 11 Oct 2023 11:31:35 +0800 Subject: [PATCH 080/123] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 3 - .../com/ruoyi/common/annotation/CaseLog.java | 34 -------- .../framework/aspectj/CaseLogAspect.java | 87 ------------------- .../domain/CaseApplication.java | 12 +++ .../wisdomarbitrate/domain/CaseLogRecord.java | 12 +-- .../service/impl/AdjudicationServiceImpl.java | 16 +++- .../impl/CaseApplicationServiceImpl.java | 20 ++++- .../impl/CaseArbitrateServiceImpl.java | 22 +++++ .../service/impl/CaseEvidenceServiceImpl.java | 16 ++-- .../impl/CaseLogRecordServiceImpl.java | 52 ++++++----- .../service/impl/CasePaymentServiceImpl.java | 5 +- .../wisdomarbitrate/utils/CaseLogUtils.java | 42 +++++++++ .../wisdomarbitrate/CaseApplicationMapper.xml | 2 +- .../wisdomarbitrate/CaseLogRecordMapper.xml | 52 ++++------- 14 files changed, 173 insertions(+), 202 deletions(-) delete mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/annotation/CaseLog.java delete mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/CaseLogAspect.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index e932361..fa501cb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -1,14 +1,11 @@ package com.ruoyi.web.controller.wisdomarbitrate; -import cn.hutool.core.util.StrUtil; import com.ruoyi.common.annotation.Anonymous; -import com.ruoyi.common.annotation.CaseLog; 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.StringUtils; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/CaseLog.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/CaseLog.java deleted file mode 100644 index 4c26db1..0000000 --- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/CaseLog.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.ruoyi.common.annotation; - - -import java.lang.annotation.*; - -/** - * 案件操作日志记录注解 - * - * @author wangqiong - * - */ -@Target({ ElementType.PARAMETER, ElementType.METHOD }) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface CaseLog -{ - /** - * 案件申请人id - */ - public long caseAppliId() default 0L; - - /** - * 案件节点 - */ - public String caseNode() default ""; - - - /** - * 备注 - */ - public String notes() default ""; - - -} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/CaseLogAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/CaseLogAspect.java deleted file mode 100644 index 40d724b..0000000 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/CaseLogAspect.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.ruoyi.framework.aspectj; - - -import com.ruoyi.common.annotation.CaseLog; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; -import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.annotation.AfterReturning; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 案件操作日志记录处理 - * - * @author wangqiong - */ -@Aspect -@Component -public class CaseLogAspect { - @Autowired - private CaseLogRecordMapper logRecordMapper; - private static final Logger log = LoggerFactory.getLogger(CaseLogAspect.class); - - - /** - * 处理请求前执行 - */ - @Before(value = "@annotation(controllerLog)") - public void boBefore(JoinPoint joinPoint, CaseLog controllerLog) { - } - - /** - * 处理完请求后执行 - * - * @param joinPoint 切点 - */ - @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult") - public void doAfterReturning(JoinPoint joinPoint, CaseLog controllerLog, Object jsonResult) { - handleLog(joinPoint, controllerLog, null, jsonResult); - } - - protected void handleLog(final JoinPoint joinPoint, CaseLog controllerLog, final Exception e, Object jsonResult) { - try { - // 获取当前的用户 - LoginUser loginUser = SecurityUtils.getLoginUser(); - String nickName = loginUser.getUser().getNickName(); - - // *========数据库日志=========*// - CaseLogRecord operLog = new CaseLogRecord(); - operLog.setCreateBy(nickName); - operLog.setUpdateBy(nickName); - // 处理设置注解上的参数 - getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); - - // 保存数据库 - logRecordMapper.insertCaseLogRecord(operLog); - } catch (Exception exp) { - // 记录本地异常日志 - log.error("异常信息:{}", exp.getMessage()); - exp.printStackTrace(); - } - } - - /** - * 获取注解中对方法的描述信息 用于Controller层注解 - * - * @param log 日志 - * @param operLog 操作日志 - * @throws Exception - */ - public void getControllerMethodDescription(JoinPoint joinPoint, CaseLog log, CaseLogRecord operLog, Object jsonResult) throws Exception { - // 设置案件id - operLog.setCaseAppliId(log.caseAppliId()); - // 设置案件节点 - operLog.setNotes(log.caseNode()); - // 设置备注 - operLog.setNotes(log.notes()); - - } - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 2703ad5..2a5dbc5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -334,6 +334,10 @@ public class CaseApplication extends BaseEntity { /** 姓名 */ @Excel(name = "申请人主体信息-申请人(机构)",width = 26) private String name; + /** + * 申请人主体信息-申请人(机构)id + */ + private String nameId; /** 身份证号 */ @Excel(name = "申请人主体信息-代码",width = 26) private String identityNum; @@ -415,6 +419,14 @@ public class CaseApplication extends BaseEntity { this.name = name; } + public String getNameId() { + return nameId; + } + + public void setNameId(String nameId) { + this.nameId = nameId; + } + public String getIdentityNum() { return identityNum; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java index bd5f9ca..7a2c680 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java @@ -32,7 +32,7 @@ public class CaseLogRecord extends BaseEntity { /** * 用户昵称 */ - private String nickName; + private String createNickName; public String getCaseNum() { @@ -59,7 +59,7 @@ public class CaseLogRecord extends BaseEntity { this.caseAppliId = caseAppliId; } - public int getCaseNode() { + public Integer getCaseNode() { return caseNode; } @@ -95,11 +95,11 @@ public class CaseLogRecord extends BaseEntity { this.content = content; } - public String getNickName() { - return nickName; + public String getCreateNickName() { + return createNickName; } - public void setNickName(String nickName) { - this.nickName = nickName; + public void setCreateNickName(String nickName) { + this.createNickName = nickName; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index e4e8fff..691cdaf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -2,9 +2,9 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.deepoove.poi.config.Configure; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.EmailOutUtil; import com.ruoyi.common.utils.WordUtil; import com.ruoyi.wisdomarbitrate.domain.*; @@ -16,7 +16,6 @@ import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import lombok.extern.slf4j.Slf4j; -import org.apache.poi.xwpf.usermodel.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.MailSendException; import org.springframework.mail.javamail.JavaMailSender; @@ -32,7 +31,6 @@ import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.time.LocalDate; import java.time.ZoneId; -import java.time.format.DateTimeFormatter; import java.util.*; @Service @@ -310,6 +308,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.ARBITRATED_SEAL,""); + return AjaxResult.success("签名成功,案件状态已改为待仲裁文书用印"); } @@ -318,6 +319,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_ARCHIVED,""); + return AjaxResult.success("归档成功,案件状态已改为已归档"); } @@ -349,6 +353,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_FILING,""); + return AjaxResult.success("仲裁文书送达成功"); } @@ -357,6 +364,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.ARBITRATION_DELIVERY,""); + return AjaxResult.success("用印成功,案件状态已改为待仲裁文书送达"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 9211603..b4e0882 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -3,11 +3,12 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; -import com.ruoyi.common.annotation.CaseLog; + import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.common.utils.StringUtils; @@ -115,6 +116,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttachMapper.updateCaseAttach(caseAttach); } } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_APPLICATION,""); return rows; } @@ -206,6 +209,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //提交立案申请 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CHECK); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_CHECK,""); return rows; } @@ -429,7 +434,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); } } - + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL,""); return rows; } @@ -440,6 +446,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = caseApplicationMapper.submitCaseApplication(caseApplication); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION,""); return rows; } @@ -453,9 +461,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); if(agreeOrNotCheck.intValue()==1){//同意审核 caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,""); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); }else if(agreeOrNotCheck.intValue()==2){//拒绝审核 caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.VERPRIF_ARBITRATION,""); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); } @@ -606,6 +620,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { SmsUtils.sendSms(request); } } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION_METHOD,""); return rows; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index f480e65..ee57a80 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; @@ -44,18 +45,30 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { caseApplication1.setArbitratMethod(1); // 更改仲裁方式 //修改案件状态为待开庭审理 caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_OPENCOURT_HEAR,""); + }else { caseApplication1.setArbitratMethod(2); //修改案件状态为待书面审理 caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_WRIITEN_HEAR,""); + } }else { if (arbitratMethod == 2){ //修改案件状态为待书面审理 caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_WRIITEN_HEAR,""); + }else { //修改案件状态为待开庭审理 caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_OPENCOURT_HEAR,""); + } } int i = caseApplicationMapper.submitCaseApplication(caseApplication1); @@ -87,6 +100,9 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { } } } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_OPENCOURT_HEAR,""); + return AjaxResult.success("审核成功"); } return AjaxResult.error(); @@ -118,6 +134,9 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { //修改案件状态 caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION); caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,""); + return AjaxResult.success("提交成功"); } }else { @@ -136,6 +155,9 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { //修改案件状态 caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION); caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,""); + return AjaxResult.success("提交成功"); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 546993c..70f462b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO; @@ -130,6 +131,9 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); int i = caseApplicationMapper.submitCaseApplication(caseApplication); if (i > 0) { + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_TRIAL,""); + return AjaxResult.success("证据确认成功"); } return AjaxResult.error("暂无需要确认的证据"); @@ -165,15 +169,9 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } int i = caseApplicationMapper.submitCaseApplication(caseApplication1); if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication1.getId()); - caseLogRecord.setCaseNode(caseStatus); - String createBy = caseApplication1.getCreateBy(); - if (createBy != null) { - caseLogRecord.setCreateBy(createBy); - } - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT,""); + return AjaxResult.success("提交成功"); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index c8c685c..c2848d9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -1,6 +1,8 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; @@ -22,10 +24,12 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService { if(CollectionUtil.isNotEmpty(records)){ records.forEach(record->{ StringBuilder contentBuilder = new StringBuilder(); - if(StrUtil.isNotEmpty(record.getNickName())) { - contentBuilder.append(record.getNickName()); + String caseNodeTime=""; + if(record.getCaseNodeTime()!=null){ + caseNodeTime= DateUtil.format(record.getCaseNodeTime(), DatePattern.NORM_DATETIME_FORMATTER); } - contentBuilder.append("于").append(record.getCaseNodeTime()); + + contentBuilder.append(record.getCreateNickName()).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime); switch(record.getCaseNode()){ case 0: contentBuilder.append("创建立案申请"); @@ -34,53 +38,61 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService { contentBuilder.append("提交立案申请"); break; case 2: - contentBuilder.append("同意立案申请"); + contentBuilder.append("提交立案审查"); break; case 3: - contentBuilder.append("缴费成功"); + contentBuilder.append("支付成功"); break; case 4: - contentBuilder.append("已确认缴费"); + contentBuilder.append("缴费确认"); + break; case 5: - contentBuilder.append("进行案件质证"); + contentBuilder.append("案件质证"); + break; case 6: - contentBuilder.append("同意组庭审核"); + contentBuilder.append("组庭审核"); + break; case 7: - contentBuilder.append("组庭确认成功"); + contentBuilder.append("组庭确认"); + break; case 8: - contentBuilder.append("同意待开庭审理"); + contentBuilder.append("待开庭审理"); + break; case 9: - contentBuilder.append("同意书面审理"); + contentBuilder.append("待书面审理"); break; case 10: - contentBuilder.append("已完成书面审理"); + contentBuilder.append("书面审理"); break; case 11: - contentBuilder.append("已生成仲裁文书"); + contentBuilder.append("审核裁决书,拒绝"); break; case 12: - contentBuilder.append("已核查仲裁文书"); + contentBuilder.append("核验裁决书"); break; case 13: - contentBuilder.append("已同意仲裁文书"); + contentBuilder.append("审核裁决书,同意"); break; case 14: - contentBuilder.append("已完成仲裁文书签名"); + contentBuilder.append("签名成功"); break; case 15: - contentBuilder.append("已完成仲裁文书用印"); + contentBuilder.append("用印成功"); break; case 16: - contentBuilder.append("已送达仲裁文书"); + contentBuilder.append("送达仲裁文书"); break; case 17: - contentBuilder.append("已完成案件归档"); + contentBuilder.append("案件归档"); break; case 26: - contentBuilder.append("已完成证据确认"); + contentBuilder.append("证据确认成功"); break; + default:break; } + record.setContent(contentBuilder.toString()); + }); } return records; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 95a7d7c..3841ec8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -4,6 +4,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.ElegentPay; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.dto.PayRequest; import com.ruoyi.dto.PayResponse; @@ -19,7 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.time.LocalDateTime; import java.util.Date; import java.util.List; @@ -127,6 +127,9 @@ public class CasePaymentServiceImpl implements ICasePaymentService { SmsUtils.sendSms(request); } } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_CROSSEXAMI,""); + return AjaxResult.success(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java new file mode 100644 index 0000000..7781461 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java @@ -0,0 +1,42 @@ +package com.ruoyi.wisdomarbitrate.utils; + +import cn.hutool.extra.spring.SpringUtil; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * 案件记录日志文件 + * + * @author wangqiong + */ +public class CaseLogUtils +{ + private static CaseLogRecordMapper caseLogRecordMapper= SpringUtil.getBean(CaseLogRecordMapper.class); + + /** + * 新增案件日志 + * @param caseAppliId 案件id,不能为空 + * @param caseNode 案件节点,不能为空 + * @param notes 备注 + */ + public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode, String notes ){ + // 获取当前的用户 + LoginUser loginUser = SecurityUtils.getLoginUser(); + String nickName = loginUser.getUser().getNickName(); + CaseLogRecord operLog = new CaseLogRecord(); + operLog.setCreateBy(loginUser.getUsername()); + operLog.setCreateNickName(nickName); + operLog.setUpdateBy(loginUser.getUsername()); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(caseNode); + operLog.setNotes(notes); + caseLogRecordMapper.insertCaseLogRecord(operLog); + } + + +} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index fcc83e4..7ab517b 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -67,7 +67,7 @@ AND c.case_num = #{caseNum} - AND d.dept_name like CONCAT( '%',#{name},'%') AND ca.identity_type=1 and ca.name=d.dept_id + AND ca.NAME=#{nameId} AND ca.identity_type=1 and ca.name=d.dept_id and c.case_status in diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 8ec69d1..254e8e2 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -10,50 +10,30 @@ - - + + - insert into case_log_record(case_appli_id, case_node,case_node_time,notes,create_by,create_time ) values( - #{caseAppliId},#{caseNode},sysdate(),#{notes},#{createBy},sysdate() + insert into case_log_record(case_appli_id, case_node,case_node_time,notes,create_by,create_nick_name,create_time,update_by,update_time ) values( + #{caseAppliId},#{caseNode},sysdate(),#{notes},#{createBy},#{createNickName},sysdate(),#{updateBy},sysdate() ) + - select cl.case_node ,cl.case_node_time ,cl.notes ,c.case_num ,cl.id ,cl.case_appli_id, - u.nick_name - from case_log_record cl left join case_application c on cl.case_appli_id = c.id - join sys_user u on cl.create_by=u.user_id - - - AND c.case_num = #{caseNum} - - - AND c.case_appli_id = #{caseAppliId} - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From adf87c8ec285f1c86df984e3931faf73670d9ff2 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Wed, 11 Oct 2023 11:47:26 +0800 Subject: [PATCH 081/123] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 16 +++++++- .../common/utils/file/SaaSAPIFileUtils.java | 32 +++++++-------- .../domain/vo/ArchivesDetailVO.java | 24 +++++++++++ .../service/IAdjudicationService.java | 6 ++- .../service/impl/AdjudicationServiceImpl.java | 40 ++++++++++++++++--- 5 files changed, 95 insertions(+), 23 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ArchivesDetailVO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index cbc0f7b..da014b6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -4,11 +4,14 @@ 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.domain.vo.LogisticsInfoVO; 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.*; +import java.util.List; + @RestController @RequestMapping("/adjudication") public class AdjudicationController extends BaseController { @@ -42,7 +45,8 @@ public class AdjudicationController extends BaseController { */ @GetMapping("/logistics") public AjaxResult getLogisticsInfo(CaseApplication caseApplication){ - return adjudicationService.getLogisticsInfo(caseApplication); + List logisticsInfo = adjudicationService.getLogisticsInfo(caseApplication); + return AjaxResult.success(logisticsInfo); } /** @@ -83,4 +87,14 @@ public class AdjudicationController extends BaseController { public AjaxResult stamp(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.stamp(caseApplication); } + + /** + * 档案详情查询 + * @param id + * @return + */ + @GetMapping("/archives") + public AjaxResult getArchivesDetail(Long id){ + return adjudicationService.getArchivesDetail(id); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java index fa6389b..6033c25 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java @@ -64,20 +64,20 @@ public class SaaSAPIFileUtils { return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true); } -/* public static void main(String[] args) throws EsignDemoException { - String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\07\\6babb8e261454fffbacf6d9fd1589b9b.docx"; - EsignHttpResponse uploadUrl = getUploadUrl(filePath); - String body = uploadUrl.getBody(); - JSONObject jsonObject = new JSONObject(body); - JSONObject dataObj = jsonObject.getJSONObject("data"); - String fileUploadUrl = dataObj.get("fileUploadUrl").toString(); - System.out.println("这是fileUploadUrl:"+fileUploadUrl); - String fileId = dataObj.get("fileId").toString(); - System.out.println("这是fileId:"+fileId); - EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath); - System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody()); - EsignHttpResponse fileStatus = getFileStatus(fileId); - System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody()); - getFileStatus("95d0c307d91e4985bdb8874f6f84daa5"); - }*/ +// public static void main(String[] args) throws EsignDemoException { + // String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx"; +// EsignHttpResponse uploadUrl = getUploadUrl(filePath); +// String body = uploadUrl.getBody(); +// JSONObject jsonObject = new JSONObject(body); +// JSONObject dataObj = jsonObject.getJSONObject("data"); +// String fileUploadUrl = dataObj.get("fileUploadUrl").toString(); +// System.out.println("这是fileUploadUrl:"+fileUploadUrl); +// String fileId = dataObj.get("fileId").toString(); +// System.out.println("这是fileId:"+fileId); +// EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath); +// System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody()); +// EsignHttpResponse fileStatus = getFileStatus(fileId); +// System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody()); +// getFileStatus("a0c2ad21065f48ff8b872412c39d5d3a"); +// } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ArchivesDetailVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ArchivesDetailVO.java new file mode 100644 index 0000000..dfe4abc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ArchivesDetailVO.java @@ -0,0 +1,24 @@ +package com.ruoyi.wisdomarbitrate.domain.vo; + +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; +import lombok.Data; + +import java.util.List; + +@Data +public class ArchivesDetailVO { + /** + * 案件信息 + */ + private CaseApplication caseApplication; + /** + * 案件日志信息 + */ + private List caseLogRecordList; + /** + * 快递信息 + */ + private List logisticsInfoVOList; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java index 773fc61..6d7f6a1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java @@ -2,13 +2,16 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; + +import java.util.List; public interface IAdjudicationService { AjaxResult createDocument(CaseApplication caseApplication); AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum); - AjaxResult getLogisticsInfo(CaseApplication caseApplication); + List getLogisticsInfo(CaseApplication caseApplication); AjaxResult signature(CaseApplication caseApplication); @@ -18,4 +21,5 @@ public interface IAdjudicationService { AjaxResult stamp(CaseApplication caseApplication); + AjaxResult getArchivesDetail(Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index e4e8fff..4e665aa 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.EmailOutUtil; import com.ruoyi.common.utils.WordUtil; import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO; import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; @@ -15,6 +16,7 @@ import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; +import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xwpf.usermodel.*; import org.springframework.beans.factory.annotation.Autowired; @@ -52,6 +54,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { private EmailOutUtil emailOutUtil; @Autowired private ICaseApplicationService caseApplicationService; + @Autowired + private ICaseLogRecordService caseLogRecordService; @Override public AjaxResult createDocument(CaseApplication caseApplication) { @@ -248,7 +252,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } @Override - public AjaxResult getLogisticsInfo(CaseApplication caseApplication) { + public List getLogisticsInfo(CaseApplication caseApplication) { try { //快递单号查询 String key = "729437f92468910aee6c12dbfeaee3c1"; @@ -293,11 +297,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } else { // 请求失败 - return AjaxResult.error("请求失败,错误码:" + responseCode); + return null; } } } - return AjaxResult.success(logisticsInfoVOList); + return logisticsInfoVOList; } } catch (IOException e) { e.printStackTrace(); @@ -360,7 +364,32 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.success("用印成功,案件状态已改为待仲裁文书送达"); } - public static void main(String[] args) { + @Override + public AjaxResult getArchivesDetail(Long id) { + ArchivesDetailVO archivesDetailVO = new ArchivesDetailVO(); + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + //查询案件信息 + CaseApplication caseApplication1 = caseApplicationService.selectCaseApplication(caseApplication); + if (caseApplication1 != null) { + archivesDetailVO.setCaseApplication(caseApplication1); + } + //查询案件日志信息 + CaseLogRecord caseLogRecord = new CaseLogRecord(); + caseLogRecord.setCaseAppliId(id); + List caseLogRecords = caseLogRecordService.selectCaseLogRecordList(caseLogRecord); + if (caseLogRecords != null && caseLogRecords.size() > 0) { + archivesDetailVO.setCaseLogRecordList(caseLogRecords); + } + //查询快递信息 + List logisticsInfo = this.getLogisticsInfo(caseApplication); + if (logisticsInfo != null && logisticsInfo.size() > 0) { + archivesDetailVO.setLogisticsInfoVOList(logisticsInfo); + } + return AjaxResult.success(archivesDetailVO); + } + + /*public static void main(String[] args) { try { List fileList = new ArrayList<>(); fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx")); @@ -375,5 +404,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } catch (MailSendException e) { e.printStackTrace(); } - } + }*/ + } \ No newline at end of file From ec864b2b8e92f1c036935ccdd6253c6421962e95 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 11 Oct 2023 11:48:33 +0800 Subject: [PATCH 082/123] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=A1=88=E4=BB=B6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CaseApplicationServiceImpl.java | 3 +++ .../service/impl/CaseLogRecordServiceImpl.java | 2 +- .../resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index b4e0882..7c8301f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -489,6 +489,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_PAYMENT,""); + return rows; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index c2848d9..57b28ae 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -38,7 +38,7 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService { contentBuilder.append("提交立案申请"); break; case 2: - contentBuilder.append("提交立案审查"); + contentBuilder.append("立案审查"); break; case 3: contentBuilder.append("支付成功"); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 254e8e2..857117b 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -22,7 +22,7 @@ From 4c93945eaf0ea8823612b414500212a49177fd68 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 11 Oct 2023 11:54:57 +0800 Subject: [PATCH 083/123] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=9C=BA=E6=9E=84id?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=A1=88=E4=BB=B6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 7ab517b..ffaaa73 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -66,7 +66,7 @@ AND c.case_num = #{caseNum} - + AND ca.NAME=#{nameId} AND ca.identity_type=1 and ca.name=d.dept_id From 9aa2ff00eb1697e943d1d0cadc812d4a23a60627 Mon Sep 17 00:00:00 2001 From: gy b Date: Wed, 11 Oct 2023 12:21:09 +0800 Subject: [PATCH 084/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=85=BE=E8=AE=AF?= =?UTF-8?q?=E4=BA=BA=E8=84=B8=E6=A0=B8=E8=BA=AB=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IdentityAuthenticationController.java | 21 +-- ruoyi-common/pom.xml | 4 +- .../IdentityAuthenticationService.java | 20 ++- .../IdentityAuthenticationServiceImpl.java | 147 +++++++----------- 4 files changed, 85 insertions(+), 107 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java index f097a64..66fedb3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java @@ -1,5 +1,6 @@ package com.ruoyi.web.controller.wisdomarbitrate; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; @@ -19,27 +20,27 @@ public class IdentityAuthenticationController extends BaseController { private IdentityAuthenticationService identityAuthenticationService; /** - * 查询身份认证EIDtoken + * 获取EIDtoken */ @PostMapping("/selectIdentityAuthenticaEIDtoken") public AjaxResult selectIdentityAuthenticaEIDtoken() { - IdentityAuthentication ientityAuthentication = identityAuthenticationService.selectIdentityAuthenticaEIDtoken(); - return success(ientityAuthentication); + JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken(); + return success(tokenResult); } /** - * 查询身份认证结果 + * 小程序人脸核身后查询身份认证结果 */ @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); +// String username = this.getUsername(); +// Long userId = this.getUserId(); +// ientityAuthentication.setUserId(userId); +// ientityAuthentication.setUserName(username); + JSONObject checkResult = identityAuthenticationService.selectIdentityAuthenticaRespon( ientityAuthentication); + return success(checkResult); } diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 77e53b1..206e38a 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -136,13 +136,13 @@ com.tencentcloudapi tencentcloud-sdk-java - 3.1.270 + 3.1.876 com.tencentcloudapi tencentcloud-sdk-java-faceid - 3.1.871 + 3.1.875 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java index 3748942..b98d66b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java @@ -1,15 +1,25 @@ package com.ruoyi.wisdomarbitrate.service; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; -import com.tencentcloudapi.common.exception.TencentCloudSDKException; public interface IdentityAuthenticationService { - IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication); + IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication); + /** + * 获取Eidtoken + * + * @return + */ + JSONObject selectIdentityAuthenticaEIDtoken(); - IdentityAuthentication selectIdentityAuthenticaEIDtoken(); - - IdentityAuthentication selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication); + /** + * 小程序人脸核身后查询身份认证结果 + * + * @param ientityAuthentication + * @return + */ + JSONObject selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index 5d56387..f8686ed 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -1,27 +1,22 @@ package com.ruoyi.wisdomarbitrate.service.impl; - -import cn.hutool.crypto.SmUtil; -import cn.hutool.crypto.asymmetric.SM2; -import cn.hutool.crypto.symmetric.SymmetricCrypto; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.exceptions.TradeException; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper; -import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService; - 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.common.exception.TencentCloudSDKException; import com.tencentcloudapi.faceid.v20180301.FaceidClient; -import com.tencentcloudapi.faceid.v20180301.models.*; - +import com.tencentcloudapi.faceid.v20180301.models.GetEidResultRequest; +import com.tencentcloudapi.faceid.v20180301.models.GetEidResultResponse; +import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenRequest; +import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -29,15 +24,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Base64; -import java.util.HashMap; -import java.util.Map; - @Service -public class IdentityAuthenticationServiceImpl implements IdentityAuthenticationService { +public class IdentityAuthenticationServiceImpl implements IdentityAuthenticationService { @Value("${identityAuthentication.credentialSecretId}") private String credentialSecretId; @@ -58,9 +46,9 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio @Override public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) { IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication); - if(identityAuthenticationselect!=null){ + if (identityAuthenticationselect != null) { identityAuthenticationselect.setCertificationStatusName("已身份认证"); - }else { + } else { IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication(); identityAuthenticationselectnew.setCertificationStatusName("未身份认证"); identityAuthenticationselectnew.setCertificationStatus(0); @@ -71,85 +59,64 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio } @Override - public IdentityAuthentication selectIdentityAuthenticaEIDtoken() { - IdentityAuthentication identityAuthentication = new IdentityAuthentication(); - try{ - Credential authenti = new Credential(credentialSecretId, credentialSecretKey); - HttpProfile httpProfileIdenAuth = new HttpProfile(); - httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com"); - ClientProfile clientInv= new ClientProfile(); - clientInv.setHttpProfile(httpProfileIdenAuth); - FaceidClient clientIdenAuth = new FaceidClient(authenti, "", clientInv); - // 实例化一个请求对象 - GetEidTokenRequest reqest = new GetEidTokenRequest(); - //设置请求参数 - reqest.setMerchantId(merchantId); - GetEidTokenResponse respIdenAuth = clientIdenAuth.GetEidToken(reqest); - String respJSON = GetEidTokenResponse.toJsonString(respIdenAuth); - JSONObject objJSON = JSON.parseObject(respJSON); - String eidToken = objJSON.getString("EidToken"); - String requestId = objJSON.getString("RequestId"); - identityAuthentication.setEidToken(eidToken); - }catch (TencentCloudSDKException e) { - log.error("获取Eidtoke异常:", e); - throw new RuntimeException("获取Eidtoke异常"); + public JSONObject selectIdentityAuthenticaEIDtoken() { + JSONObject objJSON = new JSONObject(); + objJSON.put("EidToken", ""); + try { + Credential cred = new Credential(credentialSecretId, credentialSecretKey); + // 实例化一个http选项,可选的,没有特殊需求可以跳过 + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("faceid.tencentcloudapi.com"); + // 实例化一个client选项,可选的,没有特殊需求可以跳过 + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + // 实例化要请求产品的client对象,clientProfile是可选的 + FaceidClient client = new FaceidClient(cred, "", clientProfile); + // 实例化一个请求对象,每个接口都会对应一个request对象 + GetEidTokenRequest req = new GetEidTokenRequest(); + // 返回的resp是一个GetEidTokenResponse的实例,与请求对象对应 + GetEidTokenResponse resp = client.GetEidToken(req); + // 输出json格式的字符串回包 + System.out.println(GetEidTokenResponse.toJsonString(resp)); + String respJSON = GetEidTokenResponse.toJsonString(resp); + objJSON = JSON.parseObject(respJSON); + } catch (TencentCloudSDKException e) { + System.out.println(e.toString()); + System.out.println("获取Eidtoken失败"); } - - return identityAuthentication; - + return objJSON; } @Override @Transactional - public IdentityAuthentication selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication) { + public JSONObject selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication) { String eidToken = ientityAuthentication.getEidToken(); - Long userId = ientityAuthentication.getUserId(); - String userName = ientityAuthentication.getUserName(); - IdentityAuthentication IdentityAuthenticationRespon = new IdentityAuthentication(); - IdentityAuthentication IdentityAuthenticationResult = new IdentityAuthentication(); - if(StringUtils.isNotEmpty(eidToken)){ - try{ - Credential authenti = new Credential(credentialSecretId, credentialSecretKey); - HttpProfile httpProfileIdenAuth = new HttpProfile(); - httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com"); - ClientProfile clientInv= new ClientProfile(); - clientInv.setHttpProfile(httpProfileIdenAuth); - FaceidClient clientIdenAuth = new FaceidClient(authenti, "", clientInv); - // 实例化一个请求对象 - GetEidResultRequest reqest = new GetEidResultRequest(); - //设置请求参数 - reqest.setEidToken(eidToken); - -// reqest.setInfoType("1"); -// reqest.setInfoType("13"); -// reqest.setInfoType("2"); - - //获得身份认证结果 - GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest); - String respJSON = GetEidResultResponse.toJsonString(respIdenAuth); - JSONObject objJSON = JSON.parseObject(respJSON); - IdentityAuthenticationRespon.setCertificationStatus(1); - IdentityAuthenticationRespon.setUserName(userName); - IdentityAuthenticationRespon.setUserId(userId); - - JSONObject objEidInfo = JSON.parseObject(objJSON.getString("EidInfo")); -// identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon); - IdentityAuthenticationResult.setCertificationStatus(1); - IdentityAuthenticationResult.setCertificationStatusName("认证成功"); - } catch (TencentCloudSDKException e) { - log.error("认证失败:", e); - throw new RuntimeException("认证失败"); - } + try { + Credential cred = new Credential(credentialSecretId, credentialSecretKey); + // 实例化一个http选项,可选的,没有特殊需求可以跳过 + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("faceid.tencentcloudapi.com"); + // 实例化一个client选项,可选的,没有特殊需求可以跳过 + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + // 实例化要请求产品的client对象,clientProfile是可选的 + FaceidClient client = new FaceidClient(cred, "", clientProfile); + // 实例化一个请求对象,每个接口都会对应一个request对象 + GetEidResultRequest req = new GetEidResultRequest(); + req.setEidToken(eidToken); + // 返回的resp是一个GetEidResultResponse的实例,与请求对象对应 + GetEidResultResponse resp = client.GetEidResult(req); + // 输出json格式的字符串回包 + System.out.println(GetEidResultResponse.toJsonString(resp)); + String s = GetEidResultResponse.toJsonString(resp); + JSONObject object = JSON.parseObject(s); + return object; + } catch (TencentCloudSDKException e) { + System.out.println(e.toString()); } - return IdentityAuthenticationResult; + return null; } - - - - - - } From 3994ca3e7778e75ed4fb08862f944f6304a016c5 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Wed, 11 Oct 2023 14:25:15 +0800 Subject: [PATCH 085/123] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/wisdomarbitrate/AdjudicationController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 2bcc3d9..ea6ce32 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -97,7 +97,7 @@ public class AdjudicationController extends BaseController { /** * 档案详情查询 - * @param id + * @param id 案件id * @return */ @GetMapping("/archives") From 24f15d82369e692915802e2402eeee6a526c7657 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 11 Oct 2023 16:40:40 +0800 Subject: [PATCH 086/123] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 3 + .../domain/CaseApplication.java | 10 + .../impl/CaseApplicationServiceImpl.java | 265 ++++++++++++++++-- 3 files changed, 260 insertions(+), 18 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index fa501cb..de992f1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -108,6 +108,9 @@ public class CaseApplicationController extends BaseController { @PreAuthorize("@ss.hasPermi('caseManagement:list:import')") @PostMapping("/importData") public AjaxResult importData(MultipartFile file) throws Exception { + if(file==null){ + return warn("请上传文件"); + } ExcelUtil util = new ExcelUtil(CaseApplication.class); List caseApplicationList = util.importExcel(file.getInputStream()); String operName = getUsername(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 2a5dbc5..ac77efe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -114,6 +114,16 @@ public class CaseApplication extends BaseEntity { private Integer paymentStatus; /** 支付状态描述 */ private String paymentStatusName; + // 导入校验失败信息 + private StringBuilder errorMsg; + + public StringBuilder getErrorMsg() { + return errorMsg; + } + + public void setErrorMsg(StringBuilder errorMsg) { + this.errorMsg = errorMsg; + } public Integer getPaymentStatus() { return paymentStatus; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 7c8301f..adf49a0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; +import java.util.regex.Pattern; import java.util.stream.Collectors; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -46,7 +47,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private CaseAttachMapper caseAttachMapper; @Autowired private SysDeptMapper sysDeptMapper; - + // 手机号正则 + private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); @@ -305,16 +307,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplicationListinsert = new ArrayList<>(); for (int i = 0; i < caseApplicationList.size(); i++){ CaseApplication caseApplication = caseApplicationList.get(i); - //根据仲裁费用计费规则计算应缴费用 - //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); - caseApplication.setFeePayable(feePayable); - //赋值CaseApplication的案件关联人信息 - List caseAffiliatesnew = new ArrayList<>(); - // 组装案件关联人信息 - assignmentCaseAffiliates(caseApplication,caseAffiliatesnew,deptMap); + // 导入校验 + importValid(caseApplication); + // 校验成功的数据 + if(StrUtil.isEmpty(caseApplication.getErrorMsg())) { + //根据仲裁费用计费规则计算应缴费用 + //暂时设置计费比率为0.01 + BigDecimal feeRate = new BigDecimal(0.01); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); + caseApplication.setFeePayable(feePayable); + + //赋值CaseApplication的案件关联人信息 + List caseAffiliatesnew = new ArrayList<>(); + // 组装案件关联人信息 + assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap); // int caseApplicationCount = selectCaseApplicationCount(caseApplication); // if(caseApplicationCount>0){ @@ -323,9 +330,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // }else { // caseApplicationListinsert.add(caseApplication); // } - caseApplicationListinsert.add(caseApplication); + caseApplicationListinsert.add(caseApplication); + }else { + // 拼接错误信息 + failureMsg.append("
").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString()); + } } - if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ // List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( // collectingAndThen( @@ -384,15 +394,235 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { }else { throw new ServiceException("导入立案申请数据不能为空!"); } - // 编号存在不导入 - if(StringUtils.isNotEmpty(failureMsg)){ - return failureMsg.append(successMsg).toString(); - }else { + return successMsg.append(failureMsg.toString()).toString(); - return successMsg.toString(); + } + + /** + * 导入校验 + * @param caseApplication + * @param + */ + private void importValid(CaseApplication caseApplication) { + StringBuilder failureMsg=new StringBuilder(); + caseApplication.setErrorMsg(failureMsg); + // 校验基本字段 + validBaseColumn(caseApplication,failureMsg); + // 校验申请人信息 + validApplicationColumn(caseApplication,failureMsg); + // 校验申请人代理信息 + validApplicationAgentColumn(caseApplication,failureMsg); + // 校验被申请人信息 + validDebtorApplicationColumn(caseApplication,failureMsg); + // 校验被申请人代理信息 + validDebtorApplicationAgentColumn(caseApplication,failureMsg); + } + + /** + * 校验被申请人代理信息 + * @param caseApplication + * @param failureMsg + */ + private void validDebtorApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { + if( StrUtil.isEmpty(caseApplication.getDebtorNameAgent())){ + failureMsg.append("【被申请人主体信息-代理人姓名】字段不能为空;"); + }else if(caseApplication.getDebtorNameAgent().length()>50){ + failureMsg.append("【被申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); + } + if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())){ + failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;"); + }else if(caseApplication.getDebtorIdentityNumAgent().length()>50){ + failureMsg.append("【被申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;"); + } + String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent(); + if( StrUtil.isEmpty(debtorContactTelphoneAgent)){ + failureMsg.append("【被申请人主体信息-代理人联系电话】字段不能为空;"); + }else if(!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()){ + failureMsg.append("【被申请人主体信息-代理人联系电话】字段不合法;"); + } + if( StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())){ + failureMsg.append("【被申请人主体信息-代理人联系地址】字段不能为空;"); + }else if(caseApplication.getDebtorContactAddressAgent().length()>50){ + failureMsg.append("【被申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); } } + /** + * 校验被申请人信息 + * @param caseApplication + * @param failureMsg + */ + private void validDebtorApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { + if( StrUtil.isEmpty(caseApplication.getDebtorName())){ + failureMsg.append("【被申请人主体信息-申请人姓名】字段不能为空;"); + }else if(caseApplication.getDebtorName().length()>50){ + failureMsg.append("【被申请人主体信息-申请人姓名】字段超出指定长度,最大长度为50;"); + } + if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())){ + failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;"); + }else if(caseApplication.getDebtorIdentityNum().length()>50){ + failureMsg.append("【被申请人主体信息-身份证号】字段超出指定长度,最大长度为50;"); + } + String debtorContactTelphone = caseApplication.getDebtorContactTelphone(); + if( StrUtil.isEmpty(debtorContactTelphone)){ + failureMsg.append("【被申请人主体信息-联系电话】字段不能为空;"); + }else if(!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()){ + failureMsg.append("【被申请人主体信息-联系电话】字段不合法;"); + } + if( StrUtil.isEmpty(caseApplication.getDebtorContactAddress())){ + failureMsg.append("【被申请人主体信息-联系地址】字段不能为空;"); + }else if(caseApplication.getDebtorContactAddress().length()>50){ + failureMsg.append("【被申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); + } + String debtorWorkTelphone = caseApplication.getDebtorWorkTelphone(); + if( StrUtil.isEmpty(debtorWorkTelphone)){ + failureMsg.append("【被申请人主体信息-单位电话】字段不能为空;"); + }else if(!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()){ + failureMsg.append("【被申请人主体信息-单位电话】字段不合法;"); + } + if( StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())){ + failureMsg.append("【被申请人主体信息-单位地址】字段不能为空;"); + }else if(caseApplication.getDebtorWorkAddress().length()>50){ + failureMsg.append("【被申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); + } + } + + /** + * 校验申请人代理信息 + * @param caseApplication + * @param failureMsg + */ + private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { + if( StrUtil.isEmpty(caseApplication.getNameAgent())){ + failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;"); + }else if(caseApplication.getNameAgent().length()>50){ + failureMsg.append("【申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); + } + if( StrUtil.isEmpty(caseApplication.getIdentityNumAgent())){ + failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;"); + }else if(caseApplication.getIdentityNumAgent().length()>50){ + failureMsg.append("【申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;"); + } + String contactTelphoneAgent = caseApplication.getContactTelphoneAgent(); + if( StrUtil.isEmpty(contactTelphoneAgent)){ + failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;"); + }else if(!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()){ + failureMsg.append("【申请人主体信息-代理人联系电话】字段不合法;"); + } + if( StrUtil.isEmpty(caseApplication.getContactAddressAgent())){ + failureMsg.append("【申请人主体信息-代理人联系地址】字段不能为空;"); + }else if(caseApplication.getContactAddressAgent().length()>50){ + failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); + } + } + + /** + * 校验申请人主题信息 + * @param caseApplication + * @param failureMsg + */ + private void validApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { + if( StrUtil.isEmpty(caseApplication.getName())){ + failureMsg.append("【申请人主体信息-申请人(机构)】字段不能为空;"); + }else if(caseApplication.getName().length()>20){ + failureMsg.append("【申请人主体信息-申请人(机构)】字段超出指定长度,最大长度为20;"); + } + if( StrUtil.isNotEmpty(caseApplication.getIdentityNum())&&caseApplication.getIdentityNum().length()>50){ + failureMsg.append("【申请人主体信息-代码】字段超出指定长度,最大长度为50;"); + } + String contactTelphone = caseApplication.getContactTelphone(); + if( StrUtil.isEmpty(contactTelphone)){ + failureMsg.append("【申请人主体信息-联系电话】字段不能为空;"); + }else if(!TELEPHONE_REGX.matcher(contactTelphone).matches()){ + failureMsg.append("【申请人主体信息-联系电话】字段不合法;"); + } + if( StrUtil.isEmpty(caseApplication.getContactAddress())){ + failureMsg.append("【申请人主体信息-联系地址】字段不能为空;"); + }else if(caseApplication.getName().length()>50){ + failureMsg.append("【申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); + } + String workTelphone = caseApplication.getWorkTelphone(); + if( StrUtil.isEmpty(workTelphone)){ + failureMsg.append("【申请人主体信息-单位电话】字段不能为空;"); + }else if(!TELEPHONE_REGX.matcher(workTelphone).matches()){ + failureMsg.append("【申请人主体信息-单位电话】字段不合法;"); + } + if( StrUtil.isEmpty(caseApplication.getWorkAddress())){ + failureMsg.append("【申请人主体信息-单位地址】字段不能为空;"); + }else if(caseApplication.getWorkAddress().length()>50){ + failureMsg.append("【申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); + } + } + + /** + * 校验基本字段 + * @param caseApplication + * @param failureMsg + */ + private void validBaseColumn(CaseApplication caseApplication, StringBuilder failureMsg) { + BigDecimal caseSubjectAmount = caseApplication.getCaseSubjectAmount(); + if(null== caseSubjectAmount){ + failureMsg.append("【案件标的】字段不合法;"); + }else { + if(caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 ||caseSubjectAmount.compareTo(new BigDecimal("99999999.99"))>0){ + failureMsg.append("【案件标的】字段超出范围,范围为[0,100000000);"); + } + if(caseSubjectAmount.scale()>2){ + failureMsg.append("【案件标的】字段超出指定精度(10^-2);"); + } + } + if( caseApplication.getLoanStartDate()== null){ + failureMsg.append("【借款开始日期】字段不合法;"); + } + if( caseApplication.getLoanEndDate()== null){ + failureMsg.append("【借款结束日期】字段不合法;"); + } + if( StrUtil.isEmpty(caseApplication.getContractNumber())){ + failureMsg.append("【合同编号】字段不能为空;"); + }else if(caseApplication.getContractNumber().length()>50){ + failureMsg.append("【合同编号】字段超出指定长度,最大长度为50;"); + } + BigDecimal claimPrinciOwed = caseApplication.getClaimPrinciOwed(); + if(null== claimPrinciOwed){ + failureMsg.append("【申请人主张欠本金】字段不合法;"); + }else { + if(claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 ||claimPrinciOwed.compareTo(new BigDecimal("99999999.99"))>0){ + failureMsg.append("【申请人主张欠本金】字段超出范围,范围为[0,100000000);"); + } + if(claimPrinciOwed.scale()>2){ + failureMsg.append("【申请人主张欠本金】字段超出指定精度(10^-2);"); + } + } + BigDecimal claimInterestOwed = caseApplication.getClaimInterestOwed(); + if(null== claimInterestOwed){ + failureMsg.append("【申请人主张欠利息】字段不合法;"); + }else { + if(claimInterestOwed.compareTo(new BigDecimal("0")) < 0 ||claimInterestOwed.compareTo(new BigDecimal("99999999.99"))>0){ + failureMsg.append("【申请人主张欠利息】字段超出范围,范围为[0,100000000);"); + } + if(claimInterestOwed.scale()>2){ + failureMsg.append("【申请人主张欠利息】字段超出指定精度(10^-2);"); + } + } + BigDecimal claimLiquidDamag = caseApplication.getClaimLiquidDamag(); + if(null== claimLiquidDamag){ + failureMsg.append("【申请人主张违约金】字段不合法;"); + }else { + if(claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 ||claimLiquidDamag.compareTo(new BigDecimal("99999999.99"))>0){ + failureMsg.append("【申请人主张违约金】字段超出范围,范围为[0,100000000);"); + } + if(claimLiquidDamag.scale()>2){ + failureMsg.append("【申请人主张违约金】字段超出指定精度(10^-2);"); + } + } + if( StrUtil.isEmpty(caseApplication.getArbitratClaims())){ + failureMsg.append("【申请人仲裁诉求】字段不能为空;"); + }else if(caseApplication.getArbitratClaims().length()>10000){ + failureMsg.append("【申请人仲裁诉求】字段超出指定长度,最大长度为10000;"); + } + } + + @Override @Transactional public int pendTral(CaseApplication caseApplication) { @@ -751,5 +981,4 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable()); } - } From 382615570f7a61c4d41453e258826c18afbee51b Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 11 Oct 2023 17:33:23 +0800 Subject: [PATCH 087/123] =?UTF-8?q?=E7=BC=B4=E8=B4=B9=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CaseApplicationServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index adf49a0..e008e0b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -728,6 +728,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplicationConfirm(caseApplication); + if(caseApplicationselect==null){ + return caseApplicationselect; + } CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); From d40fbccf2442f3dd46219b1e6d98ffef2291ffb3 Mon Sep 17 00:00:00 2001 From: gy b Date: Wed, 11 Oct 2023 18:11:32 +0800 Subject: [PATCH 088/123] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=BA=E8=84=B8?= =?UTF-8?q?=E6=A0=B8=E8=BA=AB=E8=A7=A3=E5=AF=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysLoginController.java | 34 +++--- .../IdentityAuthenticationController.java | 24 +--- .../src/main/resources/application.yml | 2 +- ruoyi-common/pom.xml | 16 +-- .../IdentityAuthenticationService.java | 11 +- .../IdentityAuthenticationServiceImpl.java | 111 +++++++++++++++++- 6 files changed, 143 insertions(+), 55 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index deef3b5..60633c7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -22,12 +22,11 @@ import com.ruoyi.system.service.ISysMenuService; /** * 登录验证 - * + * * @author ruoyi */ @RestController -public class SysLoginController -{ +public class SysLoginController { @Autowired private SysLoginService loginService; @@ -37,40 +36,36 @@ public class SysLoginController @Autowired private SysPermissionService permissionService; @Autowired - private IdentityAuthenticationService identityAuthenticationService; + IdentityAuthenticationService identityAuthenticationService; /** * 登录方法 - * + * * @param loginBody 登录信息 * @return 结果 */ @PostMapping("/login") - public AjaxResult login(@RequestBody LoginBody loginBody) - { + public AjaxResult login(@RequestBody LoginBody loginBody) { AjaxResult ajax = AjaxResult.success(); // 生成令牌 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()); - + //判断该用户是否已经实名认证(certificationStatus1已认证0未认证) + IdentityAuthentication identityAuthentication=new IdentityAuthentication(); + identityAuthentication.setUserName(loginBody.getUsername()); + String status = identityAuthenticationService.checkIsAuthentication(identityAuthentication); + ajax.put("certificationStatus", status); return ajax; } /** * 获取用户信息 - * + * * @return 用户信息 */ @GetMapping("getInfo") - public AjaxResult getInfo() - { + public AjaxResult getInfo() { SysUser user = SecurityUtils.getLoginUser().getUser(); // 角色集合 Set roles = permissionService.getRolePermission(user); @@ -85,12 +80,11 @@ public class SysLoginController /** * 获取路由信息 - * + * * @return 路由信息 */ @GetMapping("getRouters") - public AjaxResult getRouters() - { + public AjaxResult getRouters() { Long userId = SecurityUtils.getUserId(); List menus = menuService.selectMenuTreeByUserId(userId); return AjaxResult.success(menuService.buildMenus(menus)); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java index 66fedb3..7260847 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java @@ -3,7 +3,6 @@ package com.ruoyi.web.controller.wisdomarbitrate; import com.alibaba.fastjson.JSONObject; 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; @@ -15,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/identityAuthentication") -public class IdentityAuthenticationController extends BaseController { +public class IdentityAuthenticationController extends BaseController { @Autowired private IdentityAuthenticationService identityAuthenticationService; @@ -23,8 +22,7 @@ public class IdentityAuthenticationController extends BaseController { * 获取EIDtoken */ @PostMapping("/selectIdentityAuthenticaEIDtoken") - public AjaxResult selectIdentityAuthenticaEIDtoken() - { + public AjaxResult selectIdentityAuthenticaEIDtoken() { JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken(); return success(tokenResult); } @@ -33,22 +31,10 @@ public class IdentityAuthenticationController extends BaseController { * 小程序人脸核身后查询身份认证结果 */ @PostMapping("/selectIdentityAuthenticaRespon") - public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication) - { -// String username = this.getUsername(); -// Long userId = this.getUserId(); -// ientityAuthentication.setUserId(userId); -// ientityAuthentication.setUserName(username); - JSONObject checkResult = identityAuthenticationService.selectIdentityAuthenticaRespon( ientityAuthentication); - return success(checkResult); + public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication) { + AjaxResult checkResult = identityAuthenticationService.selectIdentityAuthenticaRespon(ientityAuthentication); + return checkResult; } - - - - - - - } diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 9e15e95..3e9f5c0 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -166,4 +166,4 @@ identityAuthentication: credentialSecretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv credentialSecretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7 merchantId: 0NSJ2309281116194321 - privateKeyHexDecodeinfo: MHcCAQEEIEw7MRv3uYlpmU6Fko4GlXSh6Vd38k0cUQZ5zDwvRg+voAoGCCqBHM9VAYItoUQDQgAEUdxIAWhGg4LUXf1GoPdb8XMbGudpexPQCuaaRi9BCnNbpaF1kcwRhhsBKvop9ZmW/nOz4wQ1r/iIEOrc9qCXgQ== \ No newline at end of file + privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf \ No newline at end of file diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 206e38a..b0c399b 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -52,19 +52,19 @@ org.apache.commons commons-lang3
- + com.fasterxml.jackson.core jackson-databind - + - - com.baomidou - dynamic-datasource-spring-boot-starter - 3.5.2 - + + com.baomidou + dynamic-datasource-spring-boot-starter + 3.5.2 + @@ -144,7 +144,7 @@ tencentcloud-sdk-java-faceid 3.1.875 - + cn.hutool hutool-all diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java index b98d66b..1ae0f29 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service; import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; public interface IdentityAuthenticationService { @@ -8,6 +9,14 @@ public interface IdentityAuthenticationService { IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication); + /** + * 检查是否已经认证的用户 + * + * @param identityAuthentication + * @return + */ + String checkIsAuthentication(IdentityAuthentication identityAuthentication); + /** * 获取Eidtoken * @@ -21,5 +30,5 @@ public interface IdentityAuthenticationService { * @param ientityAuthentication * @return */ - JSONObject selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication); + AjaxResult selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index f8686ed..b842f92 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -1,10 +1,15 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.core.codec.Base64; +import cn.hutool.crypto.SmUtil; +import cn.hutool.crypto.asymmetric.SM2; +import cn.hutool.crypto.symmetric.SymmetricCrypto; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper; import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService; @@ -24,6 +29,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Date; + @Service public class IdentityAuthenticationServiceImpl implements IdentityAuthenticationService { @@ -58,6 +65,27 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication } + /** + * 检查是否已经认证的用户 + * + * @param identityAuthentication + * @return + */ + @Override + public String checkIsAuthentication(IdentityAuthentication identityAuthentication) { + IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication); + if (identityAuthenticationselect != null) { + return "1"; + } else { + return "0"; + } + } + + /** + * 获取EIDtoken + * + * @return + */ @Override public JSONObject selectIdentityAuthenticaEIDtoken() { JSONObject objJSON = new JSONObject(); @@ -74,10 +102,10 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication FaceidClient client = new FaceidClient(cred, "", clientProfile); // 实例化一个请求对象,每个接口都会对应一个request对象 GetEidTokenRequest req = new GetEidTokenRequest(); + req.setMerchantId(merchantId); // 返回的resp是一个GetEidTokenResponse的实例,与请求对象对应 GetEidTokenResponse resp = client.GetEidToken(req); // 输出json格式的字符串回包 - System.out.println(GetEidTokenResponse.toJsonString(resp)); String respJSON = GetEidTokenResponse.toJsonString(resp); objJSON = JSON.parseObject(respJSON); } catch (TencentCloudSDKException e) { @@ -87,9 +115,37 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication return objJSON; } + /** + * 解密用户信息 + */ + public JSONObject DecodeUserInfo(String deskey, String userInfo) { + JSONObject parse = null; + try { + byte[] desKeyBytes = Base64.decode(deskey); + final SM2 sm2 = new SM2(privateKeyHexDecodeinfo, null, null); + sm2.usePlainEncoding(); + byte[] sm4KeyBytes = sm2.decrypt(desKeyBytes); + SymmetricCrypto sm4 = SmUtil.sm4(sm4KeyBytes); + byte[] plaintext = sm4.decrypt(Base64.decode(userInfo)); + if (plaintext != null && plaintext.length > 0) { + String s = new String(plaintext); + parse = JSON.parseObject(s); + } + } catch (Exception e) { + System.out.println(e.toString()); + } + return parse; + } + + /** + * 小程序人脸核身后查询身份认证结果 + * + * @param ientityAuthentication + * @return + */ @Override @Transactional - public JSONObject selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication) { + public AjaxResult selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication) { String eidToken = ientityAuthentication.getEidToken(); try { @@ -108,10 +164,53 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication // 返回的resp是一个GetEidResultResponse的实例,与请求对象对应 GetEidResultResponse resp = client.GetEidResult(req); // 输出json格式的字符串回包 - System.out.println(GetEidResultResponse.toJsonString(resp)); String s = GetEidResultResponse.toJsonString(resp); - JSONObject object = JSON.parseObject(s); - return object; + JSONObject objJSON = JSON.parseObject(s); + //查看是否核验成功 + JSONObject text = objJSON.getJSONObject("Text"); + if (text != null) { + Integer comparestatus = text.getInteger("Comparestatus"); + if (comparestatus != null && comparestatus == 0) { + JSONObject eidInfo = objJSON.getJSONObject("EidInfo"); + if (eidInfo != null) { + String desKey = eidInfo.getString("DesKey"); + String userInfo = eidInfo.getString("UserInfo"); + //1.解密用户的信息 + JSONObject info = DecodeUserInfo(desKey, userInfo); + if (info != null) { + String idcardno = info.getString("idnum"); + String name = info.getString("name"); + //2.在用户认证表中插入用户认证记录 + LoginUser loginUser = SecurityUtils.getLoginUser(); + IdentityAuthentication authentication = new IdentityAuthentication(); + /** + * 用户名 + * 用户名id + * 姓名 + * 身份证号 + * 认证时间 + * 认证状态0表示成功 + * 请求id + */ + authentication.setUserName(loginUser.getUsername()); + authentication.setUserId(loginUser.getUserId()); + authentication.setName(name); + authentication.setIdentityNo(idcardno); + authentication.setCertificationTime(new Date()); + authentication.setCertificationStatus(0); + authentication.setRequestId(objJSON.getString("RequestId")); + try { + identityAuthenticationMapper.insertIdentityAuthentication(authentication); + } catch (Exception e) { + System.out.println("认证记录新增失败"); + } + + } + + } + } + } + return AjaxResult.success(); } catch (TencentCloudSDKException e) { System.out.println(e.toString()); } From 5e0a84ae10c590626907b3cca5108977c9ab4d86 Mon Sep 17 00:00:00 2001 From: gy b Date: Wed, 11 Oct 2023 19:14:55 +0800 Subject: [PATCH 089/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E8=AE=B0=E5=BD=95=E5=AD=98=E5=82=A8SQL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/wisdomarbitrate/CaseEvidenceController.java | 2 -- .../service/impl/IdentityAuthenticationServiceImpl.java | 2 +- .../mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index 50527dc..d60267e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -36,7 +36,6 @@ public class CaseEvidenceController extends BaseController { * @return */ @GetMapping("/{id}") - @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") public AjaxResult getCaseDetailsById(@PathVariable Long id) { String username = this.getUsername(); return caseEvidenceService.getCaseDetailsById(id,username); @@ -63,7 +62,6 @@ public class CaseEvidenceController extends BaseController { * @return */ @GetMapping("/all") - @PreAuthorize("@ss.hasPermi('caseManagement:list')") public TableDataInfo getCaseListAll(@RequestParam String identityNum) { startPage(); List list = caseEvidenceService.getCaseListAll(identityNum); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index b842f92..168a223 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -198,7 +198,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication authentication.setIdentityNo(idcardno); authentication.setCertificationTime(new Date()); authentication.setCertificationStatus(0); - authentication.setRequestId(objJSON.getString("RequestId")); + authentication.setCreateBy(loginUser.getUsername()); try { identityAuthenticationMapper.insertIdentityAuthentication(authentication); } catch (Exception e) { diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml index 9132c83..ebd2422 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml @@ -20,7 +20,7 @@ name, identity_no, certification_time, - certification_status, + certification_status, user_name, create_by, create_time From 8ceaf7478c76109b18a99b15efb6fe3a2ed3b5f4 Mon Sep 17 00:00:00 2001 From: gy b Date: Wed, 11 Oct 2023 19:54:13 +0800 Subject: [PATCH 090/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E6=9F=A5=E8=AF=A2=E6=A1=88=E4=BB=B6=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/CaseEvidenceController.java | 13 ++++++++----- .../service/impl/CaseEvidenceServiceImpl.java | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index d60267e..3a408ca 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -38,7 +38,7 @@ public class CaseEvidenceController extends BaseController { @GetMapping("/{id}") public AjaxResult getCaseDetailsById(@PathVariable Long id) { String username = this.getUsername(); - return caseEvidenceService.getCaseDetailsById(id,username); + return caseEvidenceService.getCaseDetailsById(id, username); } /** @@ -53,16 +53,17 @@ public class CaseEvidenceController extends BaseController { 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); + return caseEvidenceService.uploadEvidence(file, annexType, id, username, userId); } /** * 查询当前用户案件列表 + * * @param identityNum * @return */ @GetMapping("/all") - public TableDataInfo getCaseListAll(@RequestParam String identityNum) { + public TableDataInfo getCaseListAll(@RequestParam(required = false) String identityNum) { startPage(); List list = caseEvidenceService.getCaseListAll(identityNum); if (list != null) { @@ -73,21 +74,23 @@ public class CaseEvidenceController extends BaseController { /** * 证据确认 + * * @param caseApplication 案件对象 * @return 统一返回结果 */ @PutMapping("/confirm") - public AjaxResult evidenceConfirmation(@Validated @RequestBody CaseApplication caseApplication){ + public AjaxResult evidenceConfirmation(@Validated @RequestBody CaseApplication caseApplication) { return caseEvidenceService.evidenceConfirmation(caseApplication); } /** * 案件质证 + * * @param caseEvidenceDTO * @return */ @PostMapping("/crossexami") - public AjaxResult caseCrossexamination(@Validated @RequestBody CaseEvidenceDTO caseEvidenceDTO){ + public AjaxResult caseCrossexamination(@Validated @RequestBody CaseEvidenceDTO caseEvidenceDTO) { return caseEvidenceService.caseCrossexamination(caseEvidenceDTO); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 70f462b..5a31a39 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -3,6 +3,9 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.wisdomarbitrate.domain.*; @@ -118,10 +121,21 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { return AjaxResult.error("上传失败"); } - +@Autowired +IdentityAuthenticationMapper identityAuthenticationMapper; @Override public List getCaseListAll(String identityNum) { + if(StringUtils.isBlank(identityNum)){ + LoginUser loginUser = SecurityUtils.getLoginUser(); + String username = loginUser.getUsername(); + IdentityAuthentication authentication=new IdentityAuthentication(); + authentication.setUserName(username); + IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication); + if(authentication1!=null){ + identityNum = authentication1.getIdentityNo(); + } + } List caseStatusList = Arrays.asList(CaseApplicationConstants.CASE_CROSSEXAMI); return getCaseEvidenceVOList(identityNum, caseStatusList, null); } From 26bdf8f577ad9ce157ec8b2303dcb4b3033f9d63 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Thu, 12 Oct 2023 09:25:46 +0800 Subject: [PATCH 091/123] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseLogRecordServiceImpl.java | 62 +------------------ .../wisdomarbitrate/CaseLogRecordMapper.xml | 11 +++- 2 files changed, 12 insertions(+), 61 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index 57b28ae..30356f2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -30,67 +30,9 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService { } contentBuilder.append(record.getCreateNickName()).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime); - switch(record.getCaseNode()){ - case 0: - contentBuilder.append("创建立案申请"); - break; - case 1: - contentBuilder.append("提交立案申请"); - break; - case 2: - contentBuilder.append("立案审查"); - break; - case 3: - contentBuilder.append("支付成功"); - break; - case 4: - contentBuilder.append("缴费确认"); - break; - case 5: - contentBuilder.append("案件质证"); - break; - case 6: - contentBuilder.append("组庭审核"); - break; - case 7: - contentBuilder.append("组庭确认"); - break; - case 8: - contentBuilder.append("待开庭审理"); - break; - case 9: - contentBuilder.append("待书面审理"); - break; - case 10: - contentBuilder.append("书面审理"); - break; - case 11: - contentBuilder.append("审核裁决书,拒绝"); - break; - case 12: - contentBuilder.append("核验裁决书"); - break; - case 13: - contentBuilder.append("审核裁决书,同意"); - break; - case 14: - contentBuilder.append("签名成功"); - break; - case 15: - contentBuilder.append("用印成功"); - break; - case 16: - contentBuilder.append("送达仲裁文书"); - break; - case 17: - contentBuilder.append("案件归档"); - break; - case 26: - contentBuilder.append("证据确认成功"); - break; - default:break; + if(StrUtil.isNotEmpty(record.getContent())){ + contentBuilder.append(record.getContent()); } - record.setContent(contentBuilder.toString()); }); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 857117b..ae6f859 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -22,7 +22,16 @@ select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 - + + insert into sys_user( user_id, From bcc07b181df3220685d88e142b3a39e61a45a1b5 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Thu, 12 Oct 2023 17:20:40 +0800 Subject: [PATCH 098/123] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=B5=81=E7=A8=8B=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/SignAward.java | 42 +++++++++-- .../common/utils/bean/SealSignRecord.java | 20 +++++ .../mapper/SealSignRecordMapper.java | 6 ++ .../impl/CaseApplicationServiceImpl.java | 69 +++++++++++++++++ .../utils/FixSelectFlowDetailUtils.java | 75 +++++++++++++++++++ .../wisdomarbitrate/SealSignRecordMapper.xml | 17 +++++ 6 files changed, 221 insertions(+), 8 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SignAward.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SignAward.java index 5301908..0d1b51b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SignAward.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SignAward.java @@ -8,6 +8,7 @@ import com.ruoyi.common.enums.EsignRequestType; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.utils.bean.SealSignRecord; +import java.util.HashMap; import java.util.Map; public class SignAward { @@ -56,11 +57,11 @@ public class SignAward { // 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()); +// 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"; //获取合同文件签名链接 @@ -82,13 +83,38 @@ public class SignAward { // System.out.println("签署短链接:"+sealUrl); //查询签署流程详情 -// EsignHttpResponse signFlowDetail = signFlowDetail(sealSignRecord); -// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); -// System.out.println(signFlowDetailJsonObject); + EsignHttpResponse signFlowDetail = signFlowDetail(sealSignRecord); + JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); + JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); + JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); + for (int i = 0; i < signersArray.size(); i++) { + JsonObject signerObject = (JsonObject)signersArray.get(i); + Integer psnsignStatus ; + Integer orgsignStatus ; + if(!(signerObject.get("psnSigner").toString()).equals("null")){ + JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); + if(psnSignerData!=null){ + psnsignStatus = signerObject.get("signStatus").getAsInt(); + sealSignRecord.setPsnsignStatus(psnsignStatus); + } + } + if(!(signerObject.get("orgSigner").toString()).equals("null")){ + JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); + if(orgSignerData!=null){ + orgsignStatus = signerObject.get("signStatus").getAsInt(); + sealSignRecord.setOrgsignStatus(orgsignStatus); + } + + } + + } + System.out.println(signFlowDetailJsonObject); } + + /** * 查询签署流程详情 * @return diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java index e0bffa9..1a25561 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java @@ -25,6 +25,26 @@ public class SealSignRecord extends BaseEntity { private String orgnizeNamepsnName; /** 流程状态 */ private Integer signFlowStatus; + /** 签名状态 */ + private Integer psnsignStatus; + /** 用印状态 */ + private Integer orgsignStatus; + + public Integer getPsnsignStatus() { + return psnsignStatus; + } + + public void setPsnsignStatus(Integer psnsignStatus) { + this.psnsignStatus = psnsignStatus; + } + + public Integer getOrgsignStatus() { + return orgsignStatus; + } + + public void setOrgsignStatus(Integer orgsignStatus) { + this.orgsignStatus = orgsignStatus; + } public Integer getSignFlowStatus() { return signFlowStatus; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java new file mode 100644 index 0000000..98be91c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java @@ -0,0 +1,6 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +public interface SealSignRecordMapper { + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 6e14b34..e8aed6c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -4,10 +4,17 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.SignAward; +import com.ruoyi.common.utils.bean.SealSignRecord; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SmsUtils; @@ -984,4 +991,66 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable()); } + @Transactional + public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { + + Gson gson = new Gson(); + + + + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d"); + EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); + JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); + JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); + JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); + for (int i = 0; i < signersArray.size(); i++) { + JsonObject signerObject = (JsonObject)signersArray.get(i); + Integer psnsignStatus ; + Integer orgsignStatus ; + if(!(signerObject.get("psnSigner").toString()).equals("null")){ + JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); + if(psnSignerData!=null){ + psnsignStatus = signerObject.get("signStatus").getAsInt(); + sealSignRecord.setPsnsignStatus(psnsignStatus); + + if(psnsignStatus.intValue()==2){ + //更新立案申请状态为待用印 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); + caseApplicationMapper.submitCaseApplication(caseApplication); + + //修改"签署用印记录表"的状态为待用印 + + } + } + } + if(!(signerObject.get("orgSigner").toString()).equals("null")){ + JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); + if(orgSignerData!=null){ + orgsignStatus = signerObject.get("signStatus").getAsInt(); + sealSignRecord.setOrgsignStatus(orgsignStatus); + //更新立案申请状态为待送达 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); + caseApplicationMapper.submitCaseApplication(caseApplication); + + //修改"签署用印记录表"的状态为签署完成 + + //下载审核完成的裁决书, +// SaaSAPIFileUtils.fileDownloadUrl(); + + } + + } + + } + + } + + + + + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java new file mode 100644 index 0000000..37c64d0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -0,0 +1,75 @@ +package com.ruoyi.wisdomarbitrate.utils; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.utils.SignAward; +import com.ruoyi.common.utils.bean.SealSignRecord; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import org.springframework.beans.factory.annotation.Autowired; + +public class FixSelectFlowDetailUtils { + + @Autowired + private CaseApplicationMapper caseApplicationMapper; + + + public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { + + Gson gson = new Gson(); + + + + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d"); + EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); + JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); + JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); + JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); + for (int i = 0; i < signersArray.size(); i++) { + JsonObject signerObject = (JsonObject)signersArray.get(i); + Integer psnsignStatus ; + Integer orgsignStatus ; + if(!(signerObject.get("psnSigner").toString()).equals("null")){ + JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); + if(psnSignerData!=null){ + psnsignStatus = signerObject.get("signStatus").getAsInt(); + sealSignRecord.setPsnsignStatus(psnsignStatus); + + if(psnsignStatus.intValue()==2){ + //更新立案申请状态为待用印 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); + caseApplicationMapper.submitCaseApplication(caseApplication); + + + + } + + + + } + } + if(!(signerObject.get("orgSigner").toString()).equals("null")){ + JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); + if(orgSignerData!=null){ + orgsignStatus = signerObject.get("signStatus").getAsInt(); + sealSignRecord.setOrgsignStatus(orgsignStatus); + } + + } + + } + + } + + + + + + +} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml new file mode 100644 index 0000000..43b0ac9 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file From 72d02890b0c0aa8c56a76a10daadeaea6f8fbf0f Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Thu, 12 Oct 2023 17:23:15 +0800 Subject: [PATCH 099/123] =?UTF-8?q?=E7=BB=99=E4=BB=B2=E8=A3=81=E5=91=98?= =?UTF-8?q?=E5=8F=91=E7=9F=AD=E4=BF=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/system/mapper/SysUserMapper.java | 2 ++ .../mapper/ArbitratorMapper.java | 1 + .../mapper/CaseApplicationMapper.java | 8 +++++ .../impl/CaseApplicationServiceImpl.java | 34 +++++++++++-------- .../resources/mapper/system/SysUserMapper.xml | 14 ++++++++ .../wisdomarbitrate/CaseApplicationMapper.xml | 3 ++ 6 files changed, 47 insertions(+), 15 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index 63a8468..2b1f1d4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -132,4 +132,6 @@ public interface SysUserMapper * @return 结果 */ public SysUser checkEmailUnique(String email); + + List selectUserListByIds(@Param("idList") List idList); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java index 04bda03..3cfece2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java @@ -8,4 +8,5 @@ import java.util.List; public interface ArbitratorMapper { List selectArbitratorList(Arbitrator arbitrator); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 7e9e4e1..200c92d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -1,5 +1,6 @@ package com.ruoyi.wisdomarbitrate.mapper; +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import org.apache.ibatis.annotations.Param; @@ -31,4 +32,11 @@ public interface CaseApplicationMapper { * @return */ Integer selectCaseNumLike(@Param("caseNum") String caseNum, @Param("length") int length); + + /** + * 查询仲裁员根据案件id + * @param arbitrator + * @return + */ + String selectArbitratorList(@Param("id") String id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 3d2ba37..f588102 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -814,21 +814,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for(int i = 0;i < idStrList.length;i ++ ){ idList.add(Long.parseLong(idStrList[i])); } -// Arbitrator arbitrator = new Arbitrator(); -// arbitrator.setIdList(idList); - // 查询仲裁员 - List arbitratorList = sysUserMapper.selectUserListByAdRole(new Arbitrator()); - if(arbitratorList!=null) { - for (int i = 0; i < arbitratorList.size(); i++) { - SysUser arbitratorselect = arbitratorList.get(i); - //给仲裁员发送短信通知 - request.setPhone(arbitratorselect.getPhonenumber()); - // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = arbitratorselect.getNickName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - SmsUtils.sendSms(request); - } - } +// + + // 查询仲裁员电话号 + List userList= sysUserMapper.selectUserListByIds(idList); + if(CollectionUtil.isNotEmpty(userList)) { + for (SysUser user : userList) { + + + //给仲裁员发送短信通知 + request.setPhone(user.getPhonenumber()); + // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 + String name = user.getNickName(); + request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + SmsUtils.sendSms(request); + + } + } + + } CaseAffiliate caseAffiliate = new CaseAffiliate(); diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 0d290b2..83487c2 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -159,6 +159,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 884805e..cc51f2d 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -248,6 +248,9 @@ select max(substring(case_num, #{length}+1,12)+1) as maxCaseNum from case_application where case_num like CONCAT(#{caseNum},'%') ; + \ No newline at end of file From be6ec797c7f996485749d8334ca1dd1e289c678e Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Thu, 12 Oct 2023 17:32:43 +0800 Subject: [PATCH 100/123] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E4=BA=BA=E5=8F=91?= =?UTF-8?q?=E9=80=81=E7=9F=AD=E4=BF=A1=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CaseApplicationServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index f588102..344fc9d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -854,8 +854,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - caseAffiliateselect.setName(caseAffiliateselect.getName());; + } + caseAffiliateselect.setName(caseAffiliateselect.getName());; //给申请人、被申请人发送短信通知 request.setPhone(caseAffiliateselect.getContactTelphone()); // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 From 0ee4c53252c706bc53256098978e2c9a4ff42990 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Thu, 12 Oct 2023 18:12:12 +0800 Subject: [PATCH 101/123] =?UTF-8?q?10.12=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/utils/bean/SealSignRecord.java | 10 ++ .../common/utils/file/SaaSAPIFileUtils.java | 1 - .../mapper/SealSignRecordMapper.java | 10 ++ .../impl/CaseApplicationServiceImpl.java | 95 ++++++++++++++++++- .../wisdomarbitrate/SealSignRecordMapper.xml | 15 +++ 5 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java index e0bffa9..e3c1757 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java @@ -158,6 +158,16 @@ public class SealSignRecord extends BaseEntity { private double positionXorg; /** 印章位置y坐标 */ private double positionYorg; + /** 案件申请id */ + private Long caseAppliId; + + public Long getCaseAppliId() { + return caseAppliId; + } + + public void setCaseAppliId(Long caseAppliId) { + this.caseAppliId = caseAppliId; + } public Long getId() { return id; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java index 1f9d2b6..40b2d28 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java @@ -67,7 +67,6 @@ public class SaaSAPIFileUtils { /** * 下载已签署文件及附属材料 */ - public static EsignHttpResponse fileDownloadUrl(String signFlowId) throws EsignDemoException { String apiaddr = "/v3/sign-flow/"+ signFlowId +"/file-download-url"; //请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java new file mode 100644 index 0000000..3683ba4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java @@ -0,0 +1,10 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.common.utils.bean.SealSignRecord; +import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SealSignRecordMapper { + int insertSealSignRecord(SealSignRecord SealSignRecord); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index e4af31b..fc5eb4a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -4,14 +4,22 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.SignAward; +import com.ruoyi.common.utils.bean.SealSignRecord; import com.ruoyi.common.utils.file.SaaSAPIFileUtils; +import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SmsUtils; @@ -55,6 +63,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private SysDeptMapper sysDeptMapper; @Autowired private ICaseApplicationService caseApplicationService; + @Autowired + private SysUserMapper sysUserMapper; + @Autowired + private SealSignRecordMapper sealSignRecordMapper; // 手机号正则 private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); @@ -707,7 +719,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (CaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { String annexPath = caseAttach.getAnnexPath(); - String path = "/home/ruoyi/" + annexPath; + //String path = "/home/ruoyi/" + annexPath; + String path ="D:\\home\\仲裁裁决书模板.docx"; //获取文件上传地址 EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); String body = response.getBody(); @@ -723,13 +736,87 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Thread.sleep(5000); EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId); JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody()); - int fileStatus = jsonObject2.getJSONObject("data").getIntValue("fileStatus"); + JSONObject data = jsonObject2.getJSONObject("data"); + int fileStatus =data.getIntValue("fileStatus"); if (fileStatus == 2 || fileStatus == 5){ - //上传成功,发起签署流程 - //保存案件id,文件id,文件名称.流程id到签署用印记录表里 + String fileName = data.getString("fileName"); + //上传成功,获取文件签名印章位置 + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setFileid(fileId); + EsignHttpResponse positions = SignAward.getPositions(sealSignRecord); + Gson gson = new Gson(); + JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class); + JsonObject positionsData = positionsJsonObject.getAsJsonObject("data"); + String keywordPositions = positionsData.get("keywordPositions").getAsString(); + //发起签署 + sealSignRecord.setFilename(fileName); + String arbitratorId = caseApplication2.getArbitratorId(); + if (arbitratorId!=null){ + SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); + if (sysUser == null){ + return rows; + } + sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); + sealSignRecord.setPensonName(sysUser.getNickName()); + } + sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); + sealSignRecord.setOrgnizeNamePsnAccount("秦桃则"); + sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); + sealSignRecord.setOrgnizeNamePsnAccount("17691338406"); + sealSignRecord.setOrgnizeNamepsnName("韩超勃"); + //解析文件签名印章位置 + JSONArray jsonArray = JSONArray.parseArray(keywordPositions); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject3 = jsonArray.getJSONObject(i); + String keyword = jsonObject3.getString("keyword"); + if (keyword.equals("仲裁员")){ + //签名 + JSONArray positionsArray = jsonObject3.getJSONArray("positions"); + // 遍历 positionsArray 中的每个元素 + for (int j = 0; j < positionsArray.size(); j++){ + JSONObject positionObj = positionsArray.getJSONObject(j); + int pageNum = positionObj.getIntValue("pageNum"); + sealSignRecord.setPositionPagepsn(String.valueOf(pageNum)); + JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); + JSONObject coordinateObj = coordinatesArray.getJSONObject(0); + double positionX = coordinateObj.getDoubleValue("positionX"); + double positionY = coordinateObj.getDoubleValue("positionY"); + sealSignRecord.setPositionXpsn(positionX); + sealSignRecord.setPositionYpsn(positionY); + } + }else { + //用印 + JSONArray positionsArray = jsonObject3.getJSONArray("positions"); + // 遍历 positionsArray 中的每个元素 + for (int j = 0; j < positionsArray.size(); j++) { + JSONObject positionObj = positionsArray.getJSONObject(j); + int pageNum = positionObj.getIntValue("pageNum"); + sealSignRecord.setPositionPageorg(String.valueOf(pageNum)); + JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); + JSONObject coordinateObj = coordinatesArray.getJSONObject(0); + double positionX = coordinateObj.getDoubleValue("positionX"); + double positionY = coordinateObj.getDoubleValue("positionY"); + sealSignRecord.setPositionXorg(positionX); + sealSignRecord.setPositionYorg(positionY); + } + } + } + EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord); + JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); + if (jsonObject1.getIntValue("code")==0){ + //获取签署流程ID + JSONObject data1 = jsonObject3.getJSONObject("data"); + String signFlowId = data1.getString("signFlowId"); + //保存案件id,文件id,文件名称.流程id到签署用印记录表里 + sealSignRecord.setCaseAppliId(caseApplication.getId()); + sealSignRecord.setSignFlowid(signFlowId); + sealSignRecord.setSignFlowStatus(1);//待签名 + sealSignRecordMapper.insertSealSignRecord(sealSignRecord); + } } } } + break; } } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml new file mode 100644 index 0000000..7a6c49e --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml @@ -0,0 +1,15 @@ + + + + + INSERT INTO seal_sign_record (file_id, file_name, sign_flow_id , penson_account + ,penson_name,orgnize_name,org_name_psn_acc,org_name_psn_name,position_page_psn + ,position_xpsn,position_ypsn,position_pageorg,position_xorg,position_yorg,case_appli_id + ,sign_flow_status) + VALUES (#{fileid}, #{filename}, #{signFlowid},#{pensonAccount},#{pensonName},#{orgnizeName} + ,#{orgnizeNamePsnAccount},#{orgnizeNamepsnName},#{positionPagepsn},#{positionXpsn},#{positionYpsn} + ,#{positionPageorg},#{positionXorg},#{positionYorg},#{caseAppliId},#{signFlowStatus}) + + \ No newline at end of file From dcb1139a6a843266acef7594b8fb58f9de1bfc03 Mon Sep 17 00:00:00 2001 From: gy b Date: Thu, 12 Oct 2023 20:11:09 +0800 Subject: [PATCH 102/123] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/wisdomarbitrate/AdjudicationController.java | 2 +- .../controller/wisdomarbitrate/CaseApplicationController.java | 2 +- ruoyi-admin/src/main/resources/application-druid.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index ea6ce32..1057b3f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -46,7 +46,7 @@ public class AdjudicationController extends BaseController { * @return */ @GetMapping("/logistics") - @PreAuthorize("@ss.hasPermi('delivery:detail')") +// @PreAuthorize("@ss.hasPermi('delivery:detail')") public AjaxResult getLogisticsInfo(CaseApplication caseApplication){ List logisticsInfo = adjudicationService.getLogisticsInfo(caseApplication); return AjaxResult.success(logisticsInfo); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index de992f1..2f90649 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -30,7 +30,7 @@ public class CaseApplicationController extends BaseController { /** * 查询立案数据 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list')") @GetMapping("/list") public TableDataInfo list(CaseApplication caseApplication) { startPage(); diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 65f5d96..4da42d5 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,9 +6,9 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://121.40.189.20:3306/arbitrate?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false + url: jdbc:mysql://121.40.189.20:3306/smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false username: root - password: root123456 + password: YMzc157# # 从库数据源 slave: # 从数据源开关/默认关闭 From b28a16dcea4fd61c0bed4fed5bf43f1e27ab8179 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 13 Oct 2023 09:04:29 +0800 Subject: [PATCH 103/123] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseApplicationServiceImpl.java | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 2a37485..3d63ec4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -112,7 +112,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseApplication.getName())) { + if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); } else { // 如果不存在则新增 @@ -195,7 +195,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseApplication.getName())) { + if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); } else { // 如果不存在则新增 @@ -679,6 +679,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); }else { List arbitrators = caseApplication.getArbitrators(); + // 仲裁员信息 if(arbitrators!=null&&arbitrators.size()>0){ List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); @@ -942,27 +943,32 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String hearDatestr = dateFormat.format(hearDate); String arbitratorId = caseApplicationselect.getArbitratorId(); - List arbitratorList = new ArrayList<>(); +// List arbitratorList = new ArrayList<>(); if(StringUtils.isNotEmpty(arbitratorId)){ String[] idStrList = arbitratorId.split(","); List idList = new ArrayList<>(); for(int i = 0;i < idStrList.length;i ++ ){ idList.add(Long.parseLong(idStrList[i])); } - Arbitrator arbitrator = new Arbitrator(); - arbitrator.setIdList(idList); - arbitratorList = arbitratorMapper.selectArbitratorList(arbitrator); - if(arbitratorList!=null) { - for (int i = 0; i < arbitratorList.size(); i++) { - Arbitrator arbitratorselect = arbitratorList.get(i); - //给仲裁员发送短信通知 - request.setPhone(arbitratorselect.getTelephone()); - // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = arbitratorselect.getArbitratorName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - SmsUtils.sendSms(request); - } - } +// + + // 查询仲裁员电话号 + List userList= sysUserMapper.selectUserListByIds(idList); + if(CollectionUtil.isNotEmpty(userList)) { + for (SysUser user : userList) { + + + //给仲裁员发送短信通知 + request.setPhone(user.getPhonenumber()); + // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 + String name = user.getNickName(); + request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + SmsUtils.sendSms(request); + + } + } + + } CaseAffiliate caseAffiliate = new CaseAffiliate(); @@ -984,7 +990,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - caseAffiliateselect.setName(caseAffiliateselect.getName());; + } //给申请人、被申请人发送短信通知 request.setPhone(caseAffiliateselect.getContactTelphone()); From c7fad71ae24b596996b46917f4c38c6967a6a7ed Mon Sep 17 00:00:00 2001 From: hejinbo Date: Fri, 13 Oct 2023 10:38:42 +0800 Subject: [PATCH 104/123] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/SealSignRecordMapper.java | 1 - .../service/impl/CaseApplicationServiceImpl.java | 16 +++++++++------- .../wisdomarbitrate/SealSignRecordMapper.xml | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java index 3683ba4..082d930 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java @@ -1,7 +1,6 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.common.utils.bean.SealSignRecord; -import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; import org.apache.ibatis.annotations.Mapper; @Mapper diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 2a37485..8b9698b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -12,6 +12,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDept; @@ -723,8 +724,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (CaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { String annexPath = caseAttach.getAnnexPath(); - //String path = "/home/ruoyi/" + annexPath; - String path ="D:\\home\\仲裁裁决书模板.docx"; + String path = "/home/ruoyi/" + annexPath; + System.out.println("这是查询到的裁决书路径"+path); + //String path ="D:\\home\\仲裁裁决书模板.docx"; //获取文件上传地址 EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); String body = response.getBody(); @@ -751,7 +753,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Gson gson = new Gson(); JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class); JsonObject positionsData = positionsJsonObject.getAsJsonObject("data"); - String keywordPositions = positionsData.get("keywordPositions").getAsString(); + String keywordPositions = positionsData.get("keywordPositions").toString(); //发起签署 sealSignRecord.setFilename(fileName); String arbitratorId = caseApplication2.getArbitratorId(); @@ -764,8 +766,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sealSignRecord.setPensonName(sysUser.getNickName()); } sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); - sealSignRecord.setOrgnizeNamePsnAccount("秦桃则"); - sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); sealSignRecord.setOrgnizeNamePsnAccount("17691338406"); sealSignRecord.setOrgnizeNamepsnName("韩超勃"); //解析文件签名印章位置 @@ -773,7 +773,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject3 = jsonArray.getJSONObject(i); String keyword = jsonObject3.getString("keyword"); - if (keyword.equals("仲裁员")){ + if (keyword.equals("仲裁员:")){ //签名 JSONArray positionsArray = jsonObject3.getJSONArray("positions"); // 遍历 positionsArray 中的每个元素 @@ -807,7 +807,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord); JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); - if (jsonObject1.getIntValue("code")==0){ + if (jsonObject3.getIntValue("code")==0){ //获取签署流程ID JSONObject data1 = jsonObject3.getJSONObject("data"); String signFlowId = data1.getString("signFlowId"); @@ -816,6 +816,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sealSignRecord.setSignFlowid(signFlowId); sealSignRecord.setSignFlowStatus(1);//待签名 sealSignRecordMapper.insertSealSignRecord(sealSignRecord); + }else { + throw new ServiceException("发起签署流程失败,请检查参数是否有误"); } } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml index bb0690e..8c48be5 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml @@ -5,7 +5,7 @@ INSERT INTO seal_sign_record (file_id, file_name, sign_flow_id , penson_account - ,penson_name,orgnize_name,org_name_psn_acc,org_name_psn_name,position_page_psn + ,penson_name,orgnize_name,orgn_name_psn_acc,orgn_name_psn_name,position_pagepsn ,position_xpsn,position_ypsn,position_pageorg,position_xorg,position_yorg,case_appli_id ,sign_flow_status) VALUES (#{fileid}, #{filename}, #{signFlowid},#{pensonAccount},#{pensonName},#{orgnizeName} From 3dcf07881abf02c0497e1621cceda944b3ccd312 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 13 Oct 2023 10:57:45 +0800 Subject: [PATCH 105/123] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/RuoYiApplication.java | 2 + .../CaseApplicationController.java | 22 +++ .../domain}/SealSignRecord.java | 34 +++- .../mapper/SealSignRecordMapper.java | 10 ++ .../service/ICaseApplicationService.java | 6 + .../impl/CaseApplicationServiceImpl.java | 163 ++++++++++++------ .../utils/FixSelectFlowDetailUtils.java | 146 ++++++++++++---- .../wisdomarbitrate}/utils/SignAward.java | 9 +- .../wisdomarbitrate/SealSignRecordMapper.xml | 37 ++++ 9 files changed, 333 insertions(+), 96 deletions(-) rename {ruoyi-common/src/main/java/com/ruoyi/common/utils/bean => ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain}/SealSignRecord.java (87%) rename {ruoyi-common/src/main/java/com/ruoyi/common => ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate}/utils/SignAward.java (98%) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 32eb6f1..775f772 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -3,6 +3,7 @@ package com.ruoyi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.scheduling.annotation.EnableScheduling; /** * 启动程序 @@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; * @author ruoyi */ @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) +@EnableScheduling public class RuoYiApplication { public static void main(String[] args) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index de992f1..7e310ae 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -6,7 +6,9 @@ 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.exception.EsignDemoException; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import org.springframework.beans.factory.annotation.Autowired; @@ -95,6 +97,26 @@ public class CaseApplicationController extends BaseController { return success(caseApplicationselect); } + /** + * 查询签名链接 + */ + @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") + @PostMapping("/selectSignUrl") + public AjaxResult selectSignUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException { + SealSignRecord sealSignRecordselect = caseApplicationService.selectSignUrl(caseApplication); + return success(sealSignRecordselect); + } + + /** + * 查询用印链接 + */ + @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSealUrl')") + @PostMapping("/selectSealUrl") + public AjaxResult selectSealUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException { + SealSignRecord sealUrlRecordselect = caseApplicationService.selectSealUrl(caseApplication); + return success(sealUrlRecordselect); + } + /** * 立案申请导入模板下载 */ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java similarity index 87% rename from ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java rename to ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java index 1a25561..baf67ab 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/SealSignRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java @@ -1,4 +1,4 @@ -package com.ruoyi.common.utils.bean; +package com.ruoyi.wisdomarbitrate.domain; import com.ruoyi.common.core.domain.BaseEntity; @@ -30,6 +30,38 @@ public class SealSignRecord extends BaseEntity { /** 用印状态 */ private Integer orgsignStatus; + /** 签名链接 */ + private String signUrl; + + public String getSignUrl() { + return signUrl; + } + + public void setSignUrl(String signUrl) { + this.signUrl = signUrl; + } + + public String getSealUrl() { + return sealUrl; + } + + public void setSealUrl(String sealUrl) { + this.sealUrl = sealUrl; + } + + /** 用印链接 */ + private String sealUrl; + + private Long caseAppliId; + + public Long getCaseAppliId() { + return caseAppliId; + } + + public void setCaseAppliId(Long caseAppliId) { + this.caseAppliId = caseAppliId; + } + public Integer getPsnsignStatus() { return psnsignStatus; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java index 98be91c..157010f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java @@ -1,6 +1,16 @@ package com.ruoyi.wisdomarbitrate.mapper; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; + +import java.util.List; + public interface SealSignRecordMapper { + List selectSealSignRecord(SealSignRecord sealSignRecord); + + List selectSealSignRecordbyStat(SealSignRecord sealSignRecord); + + int updataSealSignRecord(SealSignRecord sealSignRecord); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 2bcd9a5..0a733e8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -1,6 +1,8 @@ package com.ruoyi.wisdomarbitrate.service; +import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import java.util.List; @@ -40,4 +42,8 @@ public interface ICaseApplicationService { CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication); String sendRoomNoMessage(SendRoomNoMessageVO messageVO); + + SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException; + + SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index e8aed6c..b6d27f6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; @@ -13,8 +12,6 @@ import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.SignAward; -import com.ruoyi.common.utils.bean.SealSignRecord; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SmsUtils; @@ -25,6 +22,7 @@ import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; +import com.ruoyi.wisdomarbitrate.utils.SignAward; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -54,6 +52,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private CaseAttachMapper caseAttachMapper; @Autowired private SysDeptMapper sysDeptMapper; + + @Autowired + private SealSignRecordMapper sealSignRecordMapper; // 手机号正则 private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); @@ -794,6 +795,43 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return "短信发送成功"; } + @Override + public SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException { + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setCaseAppliId(caseApplication.getId()); + Gson gson = new Gson(); + List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); + SealSignRecord sealSignRecordReslt = new SealSignRecord(); + if(sealSignRecords!=null&&sealSignRecords.size()>0){ + SealSignRecord sealSignRecordselect = sealSignRecords.get(0); + EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecordselect); + JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + String url = signUrlData.get("url").getAsString(); + sealSignRecordReslt.setSignUrl(url); + } + + return sealSignRecordReslt; + } + + @Override + public SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException { + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setCaseAppliId(caseApplication.getId()); + Gson gson = new Gson(); + List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); + SealSignRecord sealSignRecordReslt = new SealSignRecord(); + if(sealSignRecords!=null&&sealSignRecords.size()>0){ + SealSignRecord sealSignRecordselect = sealSignRecords.get(0); + EsignHttpResponse signUrl = SignAward.usesealUrl(sealSignRecordselect); + JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + String url = signUrlData.get("url").getAsString(); + sealSignRecordReslt.setSealUrl(url); + } + return sealSignRecordReslt; + } + @Override @Transactional public int pendTralSure(CaseApplication caseApplication) { @@ -991,62 +1029,75 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable()); } - @Transactional - public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { - - Gson gson = new Gson(); +// @Transactional +// public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { +// +// Gson gson = new Gson(); +// +// SealSignRecord sealSignRecordselect = new SealSignRecord(); +// sealSignRecordselect.setSignFlowStatus(1); +// +// List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecordselect); +// if(sealSignRecords!=null&&sealSignRecords.size()>0){ +// for (int i = 0; i < sealSignRecords.size(); i++) { +// SealSignRecord sealSignRecord = sealSignRecords.get(i); +// EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); +// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); +// JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); +// JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); +// for (int j = 0; j < signersArray.size(); j++) { +// JsonObject signerObject = (JsonObject)signersArray.get(j); +// Integer psnsignStatus ; +// Integer orgsignStatus ; +// if(!(signerObject.get("psnSigner").toString()).equals("null")){ +// JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); +// if(psnSignerData!=null){ +// psnsignStatus = signerObject.get("signStatus").getAsInt(); +// sealSignRecord.setPsnsignStatus(psnsignStatus); +// +// if(psnsignStatus.intValue()==2){ +// //更新立案申请状态为待用印 +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); +// caseApplicationMapper.submitCaseApplication(caseApplication); +// +// //修改"签署用印记录表"的状态为待用印 +// sealSignRecord.setSignFlowStatus(2); +// sealSignRecordMapper.updataSealSignRecord(sealSignRecord); +// +// } +// } +// } +// if(!(signerObject.get("orgSigner").toString()).equals("null")){ +// JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); +// if(orgSignerData!=null){ +// orgsignStatus = signerObject.get("signStatus").getAsInt(); +// sealSignRecord.setOrgsignStatus(orgsignStatus); +// //更新立案申请状态为待送达 +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); +// caseApplicationMapper.submitCaseApplication(caseApplication); +// +// //修改"签署用印记录表"的状态为签署完成 +// sealSignRecord.setSignFlowStatus(3); +// sealSignRecordMapper.updataSealSignRecord(sealSignRecord); +// +// //下载审核完成的裁决书, +//// SaaSAPIFileUtils.fileDownloadUrl(); +// +// } +// +// } +// +// } +// +// } +// +// } - SealSignRecord sealSignRecord = new SealSignRecord(); - sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d"); - EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); - JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); - JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); - JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); - for (int i = 0; i < signersArray.size(); i++) { - JsonObject signerObject = (JsonObject)signersArray.get(i); - Integer psnsignStatus ; - Integer orgsignStatus ; - if(!(signerObject.get("psnSigner").toString()).equals("null")){ - JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); - if(psnSignerData!=null){ - psnsignStatus = signerObject.get("signStatus").getAsInt(); - sealSignRecord.setPsnsignStatus(psnsignStatus); - - if(psnsignStatus.intValue()==2){ - //更新立案申请状态为待用印 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplicationMapper.submitCaseApplication(caseApplication); - - //修改"签署用印记录表"的状态为待用印 - - } - } - } - if(!(signerObject.get("orgSigner").toString()).equals("null")){ - JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); - if(orgSignerData!=null){ - orgsignStatus = signerObject.get("signStatus").getAsInt(); - sealSignRecord.setOrgsignStatus(orgsignStatus); - //更新立案申请状态为待送达 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); - caseApplicationMapper.submitCaseApplication(caseApplication); - - //修改"签署用印记录表"的状态为签署完成 - - //下载审核完成的裁决书, -// SaaSAPIFileUtils.fileDownloadUrl(); - - } - - } - - } - - } +// } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index 37c64d0..0e6c9a7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -6,65 +6,141 @@ import com.google.gson.JsonObject; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.exception.EsignDemoException; -import com.ruoyi.common.utils.SignAward; -import com.ruoyi.common.utils.bean.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import java.util.List; + +@Component public class FixSelectFlowDetailUtils { @Autowired private CaseApplicationMapper caseApplicationMapper; + @Autowired + private SealSignRecordMapper sealSignRecordMapper; - + @Scheduled(cron = "0/3 * * * * ?") public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { - Gson gson = new Gson(); + SealSignRecord sealSignRecordselect = new SealSignRecord(); + sealSignRecordselect.setSignFlowStatus(1); + List sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect); + if(sealSignRecords!=null&&sealSignRecords.size()>0){ + for (int i = 0; i < sealSignRecords.size(); i++) { + SealSignRecord sealSignRecord = sealSignRecords.get(i); + EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); + JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); + JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); + JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); - SealSignRecord sealSignRecord = new SealSignRecord(); - sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d"); - EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); - JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); - JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); - JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); - for (int i = 0; i < signersArray.size(); i++) { - JsonObject signerObject = (JsonObject)signersArray.get(i); - Integer psnsignStatus ; - Integer orgsignStatus ; - if(!(signerObject.get("psnSigner").toString()).equals("null")){ - JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); - if(psnSignerData!=null){ - psnsignStatus = signerObject.get("signStatus").getAsInt(); - sealSignRecord.setPsnsignStatus(psnsignStatus); - - if(psnsignStatus.intValue()==2){ - //更新立案申请状态为待用印 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplicationMapper.submitCaseApplication(caseApplication); - + System.out.println("signFlowDetailJsonObject-----------"+signFlowDetailJsonObject.toString()); + Integer psnsignStatus = null; + Integer orgsignStatus = null; + for (int j = 0; j < signersArray.size(); j++) { + JsonObject signerObject = (JsonObject)signersArray.get(j); + if(!(signerObject.get("psnSigner").toString()).equals("null")){ + JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); + if(psnSignerData!=null){ + psnsignStatus = signerObject.get("signStatus").getAsInt(); + } + } + if(!(signerObject.get("orgSigner").toString()).equals("null")){ + JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); + if(orgSignerData!=null){ + orgsignStatus = signerObject.get("signStatus").getAsInt(); + } } - - - } - } - if(!(signerObject.get("orgSigner").toString()).equals("null")){ - JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); - if(orgSignerData!=null){ - orgsignStatus = signerObject.get("signStatus").getAsInt(); - sealSignRecord.setOrgsignStatus(orgsignStatus); } + System.out.println("psnsignStatus-----------"+psnsignStatus); + System.out.println("orgsignStatus-----------"+orgsignStatus); + + if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==1)){ + //更新立案申请状态为待用印 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(sealSignRecord.getCaseAppliId()); + caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); + caseApplicationMapper.submitCaseApplication(caseApplication); + + //修改"签署用印记录表"的状态为待用印 + sealSignRecord.setSignFlowStatus(2); + sealSignRecordMapper.updataSealSignRecord(sealSignRecord); + } + if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){ + //更新立案申请状态为待送达 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(sealSignRecord.getCaseAppliId()); + caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); + caseApplicationMapper.submitCaseApplication(caseApplication); + + //修改"签署用印记录表"的状态为签署完成 + sealSignRecord.setSignFlowStatus(3); + sealSignRecordMapper.updataSealSignRecord(sealSignRecord); + + //下载审核完成的裁决书, +// SaaSAPIFileUtils.fileDownloadUrl(); + + + + } } } +// Gson gson = new Gson(); +// +// SealSignRecord sealSignRecord = new SealSignRecord(); +// sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d"); +// EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); +// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); +// JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); +// JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); +// for (int i = 0; i < signersArray.size(); i++) { +// JsonObject signerObject = (JsonObject)signersArray.get(i); +// Integer psnsignStatus ; +// Integer orgsignStatus ; +// if(!(signerObject.get("psnSigner").toString()).equals("null")){ +// JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); +// if(psnSignerData!=null){ +// psnsignStatus = signerObject.get("signStatus").getAsInt(); +// sealSignRecord.setPsnsignStatus(psnsignStatus); +// +// if(psnsignStatus.intValue()==2){ +// //更新立案申请状态为待用印 +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); +// caseApplicationMapper.submitCaseApplication(caseApplication); +// +// +// +// } +// +// +// +// } +// } +// if(!(signerObject.get("orgSigner").toString()).equals("null")){ +// JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); +// if(orgSignerData!=null){ +// orgsignStatus = signerObject.get("signStatus").getAsInt(); +// sealSignRecord.setOrgsignStatus(orgsignStatus); +// } +// +// } +// +// } + + } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SignAward.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java similarity index 98% rename from ruoyi-common/src/main/java/com/ruoyi/common/utils/SignAward.java rename to ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java index 0d1b51b..2480693 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SignAward.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java @@ -1,4 +1,4 @@ -package com.ruoyi.common.utils; +package com.ruoyi.wisdomarbitrate.utils; import com.google.gson.Gson; import com.google.gson.JsonArray; @@ -6,9 +6,10 @@ 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 com.ruoyi.common.utils.EsignApplicaConfig; +import com.ruoyi.common.utils.EsignHttpHelper; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; -import java.util.HashMap; import java.util.Map; public class SignAward { @@ -106,8 +107,8 @@ public class SignAward { } } - } + System.out.println(signFlowDetailJsonObject); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml index 43b0ac9..a406ec2 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml @@ -4,8 +4,45 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + + + + + + + + + + + + + + + + update seal_sign_record + + sign_flow_status = #{signFlowStatus} + + where id = #{id} + From 8306ae0f39c0c637a5398626220244971053a39e Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 13 Oct 2023 11:16:55 +0800 Subject: [PATCH 106/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AD=BE=E5=90=8D?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java index 5eff41d..bc6a2f2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java @@ -210,16 +210,7 @@ public class SealSignRecord extends BaseEntity { private double positionXorg; /** 印章位置y坐标 */ private double positionYorg; - /** 案件申请id */ - private Long caseAppliId; - public Long getCaseAppliId() { - return caseAppliId; - } - - public void setCaseAppliId(Long caseAppliId) { - this.caseAppliId = caseAppliId; - } public Long getId() { return id; From 7a2a662c5f1edabe7e3abe0fb4112cf59a19f695 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Fri, 13 Oct 2023 13:27:14 +0800 Subject: [PATCH 107/123] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E8=A3=81=E5=86=B3?= =?UTF-8?q?=E4=B9=A6=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AdjudicationServiceImpl.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 929d348..248a06c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -188,9 +188,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (caseAttach.getAnnexType() == 3) { String annexPath = caseAttach.getAnnexPath(); //File file = new File("/home/ruoyi/" + annexPath); - String path = "/home/ruoyi/" + annexPath; - File file = new File(path); - System.out.println("文件是:" + file); + String path = "/home/ruoyi" + annexPath; + System.out.println("原文件路径是:" + path); + String newpath = path.replace("/", "\\"); + System.out.println("新文件路径是:" + newpath); + File file = new File(newpath); + System.out.println("新文件是:" + file); fileList.add(file); } } @@ -385,21 +388,21 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.success(archivesDetailVO); } - /*public static void main(String[] args) { + public static void main(String[] args) { try { - List fileList = new ArrayList<>(); - fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx")); - File file = fileList.get(0); +// List fileList = new ArrayList<>(); +// fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx")); + // File file = fileList.get(0);//System.out.println("这是文件"+file); //电子邮件送达 - EmailOutUtil emailOutUtil = new EmailOutUtil(); - JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); - if (javaMailSender != null) { - emailOutUtil.sendMessageCarryFile("1154956315@qq.com", "案件裁决书", "您的裁决书已送达,详情请查阅附件", file - , "hjbjava@163.com", javaMailSender); - } +// EmailOutUtil emailOutUtil = new EmailOutUtil(); +// JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); +// if (javaMailSender != null) { +// emailOutUtil.sendMessageCarryFile("1154956315@qq.com", "案件裁决书", "您的裁决书已送达,详情请查阅附件", file +// , "hjbjava@163.com", javaMailSender); +// } } catch (MailSendException e) { e.printStackTrace(); } - }*/ + } } \ No newline at end of file From bf92e05cbe41a42a16a64de04ac2da2310ef94c4 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 13 Oct 2023 13:32:48 +0800 Subject: [PATCH 108/123] =?UTF-8?q?=E6=88=BF=E9=97=B4=E5=8F=B7=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1id=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CaseApplicationServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index b6d27f6..9723a15 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -786,7 +786,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1948332"); + request.setTemplateId("1952136"); // 1948332 普通短信 开庭审理房间号通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请知晓,如非本人操作,请忽略本短信。 request.setPhone(caseAffiliate.getContactTelphone()); request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()}); From 3c22cec221a5aceb050a7aac3add18f019c5f471 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 13 Oct 2023 14:05:12 +0800 Subject: [PATCH 109/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/SealSignRecord.java | 11 +++ .../utils/FixSelectFlowDetailUtils.java | 97 ++++++------------- .../wisdomarbitrate/utils/SignAward.java | 61 ------------ .../wisdomarbitrate/SealSignRecordMapper.xml | 3 +- 4 files changed, 45 insertions(+), 127 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java index bc6a2f2..7365e10 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java @@ -23,6 +23,17 @@ public class SealSignRecord extends BaseEntity { private String orgnizeNamePsnAccount; /** 机构经办人名称 */ private String orgnizeNamepsnName; + + String fileDownloadUrl; + + public String getFileDownloadUrl() { + return fileDownloadUrl; + } + + public void setFileDownloadUrl(String fileDownloadUrl) { + this.fileDownloadUrl = fileDownloadUrl; + } + /** 流程状态 */ private Integer signFlowStatus; /** 签名状态 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index 0e6c9a7..e061f5c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -6,6 +6,7 @@ import com.google.gson.JsonObject; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; @@ -29,8 +30,7 @@ public class FixSelectFlowDetailUtils { Gson gson = new Gson(); SealSignRecord sealSignRecordselect = new SealSignRecord(); - sealSignRecordselect.setSignFlowStatus(1); - +// sealSignRecordselect.setSignFlowStatus(1); List sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect); if(sealSignRecords!=null&&sealSignRecords.size()>0){ for (int i = 0; i < sealSignRecords.size(); i++) { @@ -39,9 +39,6 @@ public class FixSelectFlowDetailUtils { JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); - - System.out.println("signFlowDetailJsonObject-----------"+signFlowDetailJsonObject.toString()); - Integer psnsignStatus = null; Integer orgsignStatus = null; for (int j = 0; j < signersArray.size(); j++) { @@ -61,84 +58,54 @@ public class FixSelectFlowDetailUtils { } } - - System.out.println("psnsignStatus-----------"+psnsignStatus); - System.out.println("orgsignStatus-----------"+orgsignStatus); - if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==1)){ //更新立案申请状态为待用印 CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(sealSignRecord.getCaseAppliId()); - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplicationMapper.submitCaseApplication(caseApplication); - //修改"签署用印记录表"的状态为待用印 - sealSignRecord.setSignFlowStatus(2); - sealSignRecordMapper.updataSealSignRecord(sealSignRecord); + CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION){ + caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); + caseApplicationMapper.submitCaseApplication(caseApplication); + + //修改"签署用印记录表"的状态为待用印 + sealSignRecord.setSignFlowStatus(2); + sealSignRecordMapper.updataSealSignRecord(sealSignRecord); + } + + } if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){ //更新立案申请状态为待送达 CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(sealSignRecord.getCaseAppliId()); - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); - caseApplicationMapper.submitCaseApplication(caseApplication); - //修改"签署用印记录表"的状态为签署完成 - sealSignRecord.setSignFlowStatus(3); - sealSignRecordMapper.updataSealSignRecord(sealSignRecord); + CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL){ + caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); + caseApplicationMapper.submitCaseApplication(caseApplication); - //下载审核完成的裁决书, -// SaaSAPIFileUtils.fileDownloadUrl(); + //下载审核完成的裁决书, + String signFlowId = sealSignRecord.getSignFlowid(); + EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); + JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class); + JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); + JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); + if(filesArray!=null&&filesArray.size()>0){ + JsonObject fileObject = (JsonObject)filesArray.get(0); + String fileDownloadUrl = fileObject.get("downloadUrl").toString(); + //修改"签署用印记录表"的状态为签署完成 + sealSignRecord.setSignFlowStatus(3); + sealSignRecord.setFileDownloadUrl(fileDownloadUrl); + sealSignRecordMapper.updataSealSignRecord(sealSignRecord); - - + } + } } } } -// Gson gson = new Gson(); -// -// SealSignRecord sealSignRecord = new SealSignRecord(); -// sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d"); -// EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); -// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); -// JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); -// JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); -// for (int i = 0; i < signersArray.size(); i++) { -// JsonObject signerObject = (JsonObject)signersArray.get(i); -// Integer psnsignStatus ; -// Integer orgsignStatus ; -// if(!(signerObject.get("psnSigner").toString()).equals("null")){ -// JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); -// if(psnSignerData!=null){ -// psnsignStatus = signerObject.get("signStatus").getAsInt(); -// sealSignRecord.setPsnsignStatus(psnsignStatus); -// -// if(psnsignStatus.intValue()==2){ -// //更新立案申请状态为待用印 -// CaseApplication caseApplication = new CaseApplication(); -// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); -// caseApplicationMapper.submitCaseApplication(caseApplication); -// -// -// -// } -// -// -// -// } -// } -// if(!(signerObject.get("orgSigner").toString()).equals("null")){ -// JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); -// if(orgSignerData!=null){ -// orgsignStatus = signerObject.get("signStatus").getAsInt(); -// sealSignRecord.setOrgsignStatus(orgsignStatus); -// } -// -// } -// -// } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java index 2480693..ab82797 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java @@ -27,28 +27,6 @@ public class SignAward { 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); @@ -159,15 +137,10 @@ public class SignAward { 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" + @@ -194,24 +167,16 @@ public class SignAward { " {\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" + @@ -219,16 +184,9 @@ public class SignAward { " \"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" + @@ -241,19 +199,12 @@ public class SignAward { " {\n" + " \"orgSignerInfo\": {\n" + - -// " \"orgName\": \"西安云美电子科技有限公司\",\n" + " \"orgName\": \"" + orgName + "\",\n" + - " \"transactorInfo\": {\n" + - - -// " \"psnAccount\": \"17691338406\",\n" + " \"psnAccount\": \"" + orgNamePsnAccount + "\",\n" + " \"psnInfo\": {\n" + -// " \"psnName\": \"韩超勃\"\n" + " \"psnName\": \"" + orgNamepsnName + "\"\n" + " }\n" + @@ -262,8 +213,6 @@ public class SignAward { " \"signFields\": [\n" + " {\n" + - -// " \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" + " \"fileId\": \"" + fileId + "\",\n" + " \"normalSignFieldConfig\": {\n" + @@ -272,13 +221,8 @@ public class SignAward { " \"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" + @@ -313,7 +257,6 @@ public class SignAward { String apiaddr = "/v3/sign-flow/" + signFlowId + "/sign-url"; String jsonParm = "{\n" + " \"operator\": {\n" + -// " \"psnAccount\":\"18209231185\"\n" + " \"psnAccount\": \"" + psnAccount + "\"\n" + " }\n" + "}"; @@ -338,15 +281,11 @@ public class SignAward { 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" + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml index a406ec2..76c8242 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml @@ -39,7 +39,8 @@ update seal_sign_record - sign_flow_status = #{signFlowStatus} + sign_flow_status = #{signFlowStatus}, + file_download_url = #{fileDownloadUrl} where id = #{id} From f20736282b29912b46cca4fd32be35099645b683 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 13 Oct 2023 14:35:24 +0800 Subject: [PATCH 110/123] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=8F=8A=E8=B7=B3=E8=BD=AC=E5=B0=8F=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 10 +++ .../common/utils/WxAppletNotifyUtils.java | 72 +++++++++++++++++++ .../impl/CaseApplicationServiceImpl.java | 52 +++++++++----- 3 files changed, 115 insertions(+), 19 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index f121306..5bc1f92 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.utils.WxAppletNotifyUtils; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; @@ -232,5 +233,14 @@ public class CaseApplicationController extends BaseController { String result = caseApplicationService.sendRoomNoMessage(messageVO); return success(result); } + /** + * 获取UrlScheme + */ + @Anonymous + @PostMapping("/getUrlScheme") + public AjaxResult getUrlScheme() { + String schemeUrl = WxAppletNotifyUtils.jumpAppletSchemeUrl(); + return success(schemeUrl); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java new file mode 100644 index 0000000..9e906c6 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java @@ -0,0 +1,72 @@ +package com.ruoyi.common.utils; + +/** + * @author wangqiong + * @description + * @date 2023-10-13 10:16 + */ +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + + +/** + * @Author: Tenk + */ +@RequiredArgsConstructor +@Component +public class WxAppletNotifyUtils { + + /** + * scheme 跳转微信小程序,需中转H5 + + */ + public static String jumpAppletSchemeUrl(){ + + String token= getAccessToken(); + + //接口地址 + String url = "https://api.weixin.qq.com/wxa/generatescheme?access_token="+token; + JSONObject body = JSONUtil.createObj(); + JSONObject jumpWxa = JSONUtil.createObj(); + jumpWxa.putOpt("path","pages/login"); + jumpWxa.putOpt("query",""); + jumpWxa.putOpt("env_version","release"); + body.putOpt("jump_wxa",jumpWxa); + //链接过期类型:0时间戳 1间隔天数 + body.putOpt("expire_type",1); + body.putOpt("is_expire",true); + //指定失效天数,最多30 + body.putOpt("expire_interval",30); + String post = HttpUtil.post(url,body.toJSONString(2)); + JSONObject result = JSONUtil.parseObj(post); + if(result!=null){ + result.getStr("openlink"); + } + return null; + } + + + //凭证调用 + public static String getAccessToken(){ + String token; + //小程序APPID + String appid="wx91cb8459dca561b4";//自行获取 + //小程序secret + String secret="190aaa3bda96a65d25318fbb0e133fc6";//自己去公众号后台获取 + String httpUrl="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential"; + + httpUrl= httpUrl+"&appid="+appid+"&secret="+secret; + //get请求 + String result = HttpUtil.get(httpUrl); + //解析结果 + JSONObject jsonObject = JSONUtil.parseObj(result); + //get AccessToken + token=jsonObject.get("access_token",String.class,false); + return token; + } + +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 9723a15..82555fe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -4,14 +4,22 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; +import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDept; + + +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SmsUtils; @@ -26,6 +34,8 @@ import com.ruoyi.wisdomarbitrate.utils.SignAward; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; + +import java.io.File; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; @@ -52,7 +62,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private CaseAttachMapper caseAttachMapper; @Autowired private SysDeptMapper sysDeptMapper; - + @Autowired + private ICaseApplicationService caseApplicationService; + @Autowired + private SysUserMapper sysUserMapper; @Autowired private SealSignRecordMapper sealSignRecordMapper; // 手机号正则 @@ -95,7 +108,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseApplication.getName())) { + if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); } else { // 如果不存在则新增 @@ -178,7 +191,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseApplication.getName())) { + if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); } else { // 如果不存在则新增 @@ -662,6 +675,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); }else { List arbitrators = caseApplication.getArbitrators(); + // 仲裁员信息 if(arbitrators!=null&&arbitrators.size()>0){ List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); @@ -849,27 +863,27 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String hearDatestr = dateFormat.format(hearDate); String arbitratorId = caseApplicationselect.getArbitratorId(); - List arbitratorList = new ArrayList<>(); +// List arbitratorList = new ArrayList<>(); if(StringUtils.isNotEmpty(arbitratorId)){ String[] idStrList = arbitratorId.split(","); List idList = new ArrayList<>(); for(int i = 0;i < idStrList.length;i ++ ){ idList.add(Long.parseLong(idStrList[i])); } - Arbitrator arbitrator = new Arbitrator(); - arbitrator.setIdList(idList); - arbitratorList = arbitratorMapper.selectArbitratorList(arbitrator); - if(arbitratorList!=null) { - for (int i = 0; i < arbitratorList.size(); i++) { - Arbitrator arbitratorselect = arbitratorList.get(i); - //给仲裁员发送短信通知 - request.setPhone(arbitratorselect.getTelephone()); - // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = arbitratorselect.getArbitratorName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - SmsUtils.sendSms(request); - } - } + // 查询仲裁员电话号 + List userList= sysUserMapper.selectUserListByIds(idList); + if(CollectionUtil.isNotEmpty(userList)) { + for (SysUser user : userList) { + //给仲裁员发送短信通知 + request.setPhone(user.getPhonenumber()); + // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 + String name = user.getNickName(); + request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + SmsUtils.sendSms(request); + + } + } + } CaseAffiliate caseAffiliate = new CaseAffiliate(); @@ -891,7 +905,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - caseAffiliateselect.setName(caseAffiliateselect.getName());; + } //给申请人、被申请人发送短信通知 request.setPhone(caseAffiliateselect.getContactTelphone()); From b7b46f1350de43f1c47aaae857572df1ae1f3fe0 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 13 Oct 2023 15:13:32 +0800 Subject: [PATCH 111/123] =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/wisdomarbitrate/CaseApplicationController.java | 2 +- .../main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 5bc1f92..876f9ca 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -237,7 +237,7 @@ public class CaseApplicationController extends BaseController { * 获取UrlScheme */ @Anonymous - @PostMapping("/getUrlScheme") + @GetMapping("/getUrlScheme") public AjaxResult getUrlScheme() { String schemeUrl = WxAppletNotifyUtils.jumpAppletSchemeUrl(); return success(schemeUrl); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java index 9e906c6..d8b07fc 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java @@ -43,8 +43,8 @@ public class WxAppletNotifyUtils { body.putOpt("expire_interval",30); String post = HttpUtil.post(url,body.toJSONString(2)); JSONObject result = JSONUtil.parseObj(post); - if(result!=null){ - result.getStr("openlink"); + if(result!=null && result.containsKey("openlink")){ + return result.getStr("openlink"); } return null; } From ce01c9366a5ce0b86d155d841c36285e47f4c65f Mon Sep 17 00:00:00 2001 From: gy b Date: Fri, 13 Oct 2023 15:20:50 +0800 Subject: [PATCH 112/123] =?UTF-8?q?=E5=8F=96=E6=B6=88=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 9 +- .../CaseApplicationController.java | 28 +-- .../CaseArbitrateController.java | 1 - .../CasePaymentController.java | 4 +- .../src/main/resources/application.yml | 10 +- .../service/impl/AdjudicationServiceImpl.java | 47 +++- .../impl/CaseApplicationServiceImpl.java | 229 +++++++++--------- 7 files changed, 186 insertions(+), 142 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 1057b3f..04a7419 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -25,7 +25,6 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/document") - @PreAuthorize("@ss.hasPermi('caseManagement:list:createaward')") public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.createDocument(caseApplication); } @@ -58,7 +57,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/signature") - @PreAuthorize("@ss.hasPermi('awardManagement:list:sign')") +// @PreAuthorize("@ss.hasPermi('awardManagement:list:sign')") public AjaxResult signature(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.signature(caseApplication); } @@ -69,7 +68,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/caseFile") - @PreAuthorize("@ss.hasPermi('awardManagement:list:file')") +// @PreAuthorize("@ss.hasPermi('awardManagement:list:file')") public AjaxResult caseFile(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.caseFile(caseApplication); } @@ -80,7 +79,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/service") - @PreAuthorize("@ss.hasPermi('awardManagement:list:sendaward')") +// @PreAuthorize("@ss.hasPermi('awardManagement:list:sendaward')") public AjaxResult service(@RequestBody BookSendVO bookSendVO){ return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum()); } @@ -90,7 +89,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/stamp") - @PreAuthorize("@ss.hasPermi('awardManagement:list:signprint')") +// @PreAuthorize("@ss.hasPermi('awardManagement:list:signprint')") public AjaxResult stamp(@Validated @RequestBody CaseApplication caseApplication){ return adjudicationService.stamp(caseApplication); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 2f90649..5363a95 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -41,7 +41,7 @@ public class CaseApplicationController extends BaseController { /** * 新增立案数据 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:add')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:add')") @Log(title = "新增立案数据", businessType = BusinessType.INSERT) @PostMapping("/addCaseApplication") public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication) @@ -54,7 +54,7 @@ public class CaseApplicationController extends BaseController { /** * 修改立案数据 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:update')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:update')") @Log(title = "修改立案数据", businessType = BusinessType.UPDATE) @PostMapping("/editCaseApplication") public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { @@ -66,7 +66,7 @@ public class CaseApplicationController extends BaseController { /** * 提交立案申请 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:submit')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:submit')") @Log(title = "提交立案申请", businessType = BusinessType.UPDATE) @PostMapping("/submitCaseApplication") public AjaxResult submitCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { @@ -77,7 +77,7 @@ public class CaseApplicationController extends BaseController { /** * 删除立案数据 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:delete')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:delete')") @Log(title = "删除立案数据", businessType = BusinessType.DELETE) @PostMapping("/removeCaseApplication") public AjaxResult removeCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { @@ -88,7 +88,7 @@ public class CaseApplicationController extends BaseController { /** * 查询立案信息 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") @PostMapping("/selectCaseApplication") public AjaxResult selectCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication); @@ -105,7 +105,7 @@ public class CaseApplicationController extends BaseController { } @Log(title = "立案信息导入", businessType = BusinessType.IMPORT) - @PreAuthorize("@ss.hasPermi('caseManagement:list:import')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:import')") @PostMapping("/importData") public AjaxResult importData(MultipartFile file) throws Exception { if(file==null){ @@ -121,7 +121,7 @@ public class CaseApplicationController extends BaseController { /** * 组庭 */ - @PreAuthorize("@ss.hasPermi('caseApplication:pendTral')") +// @PreAuthorize("@ss.hasPermi('caseApplication:pendTral')") @Log(title = "组庭", businessType = BusinessType.UPDATE) @PostMapping("/pendTral") public AjaxResult pendTral(@Validated @RequestBody CaseApplication caseApplication) { @@ -131,7 +131,7 @@ public class CaseApplicationController extends BaseController { /** * 组庭审核 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')") @Log(title = "组庭审核", businessType = BusinessType.UPDATE) @PostMapping("/pendTralCheck") public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) { @@ -141,7 +141,7 @@ public class CaseApplicationController extends BaseController { /** * 组庭确认 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:confirmgroup')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:confirmgroup')") @Log(title = "组庭确认", businessType = BusinessType.UPDATE) @PostMapping("/pendTralSure") public AjaxResult pendTralSure(@Validated @RequestBody CaseApplication caseApplication) { @@ -151,7 +151,7 @@ public class CaseApplicationController extends BaseController { /** * 核验裁决书 */ - @PreAuthorize("@ss.hasPermi('caseApplication:verificationArbitrateRecord')") +// @PreAuthorize("@ss.hasPermi('caseApplication:verificationArbitrateRecord')") @Log(title = "核验裁决书", businessType = BusinessType.UPDATE) @PostMapping("/verificationArbitrateRecord") public AjaxResult verificationArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) { @@ -161,7 +161,7 @@ public class CaseApplicationController extends BaseController { /** * 审核裁决书 */ - @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')") +// @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')") @Log(title = "审核裁决书", businessType = BusinessType.UPDATE) @PostMapping("/checkArbitrateRecord") public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) { @@ -172,7 +172,7 @@ public class CaseApplicationController extends BaseController { /** * 是否指派仲裁员 */ - @PreAuthorize("@ss.hasPermi('caseApplication:pendingAppointArbotrar')") +// @PreAuthorize("@ss.hasPermi('caseApplication:pendingAppointArbotrar')") @Log(title = "是否指派仲裁员", businessType = BusinessType.UPDATE) @PostMapping("/pendingAppointArbotrar") public AjaxResult pendingAppointArbotrar(@Validated @RequestBody CaseApplication caseApplication) { @@ -182,7 +182,7 @@ public class CaseApplicationController extends BaseController { /** * 提交立案审查 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:check')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:check')") @Log(title = "提交立案审查", businessType = BusinessType.UPDATE) @PostMapping("/submitCaseApplicationCheck") public AjaxResult submitCaseApplicationCheck(@Validated @RequestBody CaseApplication caseApplication) { @@ -193,7 +193,7 @@ public class CaseApplicationController extends BaseController { /** * 确认缴费查询立案信息 */ - @PreAuthorize("@ss.hasPermi('paymentManagement:list:detail')") +// @PreAuthorize("@ss.hasPermi('paymentManagement:list:detail')") @PostMapping("/selectCaseApplicationConfirm") public AjaxResult selectCaseApplicationConfirm(@Validated @RequestBody CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplicationConfirm(caseApplication); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java index 20c5b17..dda5a73 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java @@ -35,7 +35,6 @@ public class CaseArbitrateController extends BaseController { * @return */ @PostMapping("/writtenHear") - @PreAuthorize("@ss.hasPermi('caseManagement:hear')") public AjaxResult writtenHear(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ return caseArbitrateService.writtenHear(arbitrateRecord); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java index 5f13ee7..4c73eed 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java @@ -25,7 +25,7 @@ public class CasePaymentController { * @param casePayDTO 缴费传入参数 * @return 统一响应结果 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:pay')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:pay')") @PostMapping("/casePay") public AjaxResult casePay(@Validated @RequestBody CasePayDTO casePayDTO) { return paymentService.casePay(casePayDTO); @@ -36,7 +36,7 @@ public class CasePaymentController { * @param caseApplication * @return */ - @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')") +// @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')") @PutMapping("/confirm") public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) { return paymentService.confirmPayment(caseApplication); diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 3e9f5c0..54afe82 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -94,14 +94,20 @@ spring: mail: host: smtp.163.com port: 25 - username: hjbjava@163.com - password: BSRSSEPJWGNNVYYL + username: lmj1549843951@163.com + password: JGIOQVFCLAZKXRKO default-encoding: UTF-8 properties: mail: smtp: + connectiontimeout: 5000 + timeout: 5000 + writetimeout: 5000 socketFactoryClass: javax.net.ssl.SSLSocketFactory + socketFactoryFallback: false + socketFactoryPort: 465 debug: false + protocol: smtp #上上签配置参数 ssq: developerId: 1695872832013855470 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 929d348..04b87a1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -299,7 +299,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.ARBITRATED_SEAL,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATED_SEAL, ""); return AjaxResult.success("签名成功,案件状态已改为待仲裁文书用印"); } @@ -310,7 +310,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_ARCHIVED,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, ""); return AjaxResult.success("归档成功,案件状态已改为已归档"); } @@ -343,19 +343,58 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } } + //发送邮件 + sendCaseEmail(caseApplication1, appEmail, resEmail); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_FILING,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); return AjaxResult.success("仲裁文书送达成功"); } + /** + * 通过邮件发送裁决书文件 + * + * @param caseApplication1 + * @param appEmail + * @param resEmail + */ + private void sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail) { + List fileList = new ArrayList<>(); + File file = null; +// List caseAttachList = caseApplication1.getCaseAttachList(); +// if (caseAttachList != null && caseAttachList.size() > 0) { +// for (CaseAttach caseAttach : caseAttachList) { +// if (caseAttach.getAnnexType() == 3) { +// String annexPath = caseAttach.getAnnexPath(); +// String path = "/home/ruoyi/" + annexPath; +// String path = "/home/ruoyi/uploadPath/upload/2023/10/12/裁决书测试20231012test.docx"; + String path = "E:/WorkDoc/SH/裁决书测试20231012test.docx"; + file = new File(path); + fileList.add(file); + System.out.println("文件长度:" + file.length()); +// } +// } +// } + if (file != null) { + JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); + try { +// emailOutUtil.sendMessageCarryFile(appEmail, "裁决书", "您好,审核后的裁决书在附件中请查阅", file, "hjbjava@163.com", javaMailSender); + emailOutUtil.sendMessageCarryFiles(appEmail, "裁决书", "您好,审核后的裁决书在附件中请查阅", fileList, "lmj1549843951@163.com", javaMailSender); + } catch (Exception e) { + System.out.println("邮件发送失败++++++++++++++++++++++++++++++++"); + System.out.println(e.toString()); + } + } + + } + @Override public AjaxResult stamp(CaseApplication caseApplication) { //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.ARBITRATION_DELIVERY,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATION_DELIVERY, ""); return AjaxResult.success("用印成功,案件状态已改为待仲裁文书送达"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 3d63ec4..f34ac02 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -716,120 +716,121 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); if(agreeOrNotCheck.intValue()==1){//同意审核 - try { - //获取当前案件的裁决书 - CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); - List caseAttachList = caseApplication2.getCaseAttachList(); - if (caseAttachList != null && caseAttachList.size() > 0) { - for (CaseAttach caseAttach : caseAttachList) { - if (caseAttach.getAnnexType() == 3) { - String annexPath = caseAttach.getAnnexPath(); - //String path = "/home/ruoyi/" + annexPath; - String path ="D:\\home\\仲裁裁决书模板.docx"; - //获取文件上传地址 - EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); - String body = response.getBody(); - if (body != null){ - JSONObject jsonObject = JSONObject.parseObject(body); - String fileId = jsonObject.getJSONObject("data").getString("fileId"); - String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl"); - //上传文件流 - EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path); - JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody()); - if (jsonObject1.getIntValue("errCode")==0){ - //查看文件上传状态 - Thread.sleep(5000); - EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId); - JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody()); - JSONObject data = jsonObject2.getJSONObject("data"); - int fileStatus =data.getIntValue("fileStatus"); - if (fileStatus == 2 || fileStatus == 5){ - String fileName = data.getString("fileName"); - //上传成功,获取文件签名印章位置 - SealSignRecord sealSignRecord = new SealSignRecord(); - sealSignRecord.setFileid(fileId); - EsignHttpResponse positions = SignAward.getPositions(sealSignRecord); - Gson gson = new Gson(); - JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class); - JsonObject positionsData = positionsJsonObject.getAsJsonObject("data"); - String keywordPositions = positionsData.get("keywordPositions").getAsString(); - //发起签署 - sealSignRecord.setFilename(fileName); - String arbitratorId = caseApplication2.getArbitratorId(); - if (arbitratorId!=null){ - SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); - if (sysUser == null){ - return rows; - } - sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); - sealSignRecord.setPensonName(sysUser.getNickName()); - } - sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); - sealSignRecord.setOrgnizeNamePsnAccount("秦桃则"); - sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); - sealSignRecord.setOrgnizeNamePsnAccount("17691338406"); - sealSignRecord.setOrgnizeNamepsnName("韩超勃"); - //解析文件签名印章位置 - JSONArray jsonArray = JSONArray.parseArray(keywordPositions); - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject3 = jsonArray.getJSONObject(i); - String keyword = jsonObject3.getString("keyword"); - if (keyword.equals("仲裁员")){ - //签名 - JSONArray positionsArray = jsonObject3.getJSONArray("positions"); - // 遍历 positionsArray 中的每个元素 - for (int j = 0; j < positionsArray.size(); j++){ - JSONObject positionObj = positionsArray.getJSONObject(j); - int pageNum = positionObj.getIntValue("pageNum"); - sealSignRecord.setPositionPagepsn(String.valueOf(pageNum)); - JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); - JSONObject coordinateObj = coordinatesArray.getJSONObject(0); - double positionX = coordinateObj.getDoubleValue("positionX"); - double positionY = coordinateObj.getDoubleValue("positionY"); - sealSignRecord.setPositionXpsn(positionX); - sealSignRecord.setPositionYpsn(positionY); - } - }else { - //用印 - JSONArray positionsArray = jsonObject3.getJSONArray("positions"); - // 遍历 positionsArray 中的每个元素 - for (int j = 0; j < positionsArray.size(); j++) { - JSONObject positionObj = positionsArray.getJSONObject(j); - int pageNum = positionObj.getIntValue("pageNum"); - sealSignRecord.setPositionPageorg(String.valueOf(pageNum)); - JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); - JSONObject coordinateObj = coordinatesArray.getJSONObject(0); - double positionX = coordinateObj.getDoubleValue("positionX"); - double positionY = coordinateObj.getDoubleValue("positionY"); - sealSignRecord.setPositionXorg(positionX); - sealSignRecord.setPositionYorg(positionY); - } - } - } - EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord); - JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); - if (jsonObject1.getIntValue("code")==0){ - //获取签署流程ID - JSONObject data1 = jsonObject3.getJSONObject("data"); - String signFlowId = data1.getString("signFlowId"); - //保存案件id,文件id,文件名称.流程id到签署用印记录表里 - sealSignRecord.setCaseAppliId(caseApplication.getId()); - sealSignRecord.setSignFlowid(signFlowId); - sealSignRecord.setSignFlowStatus(1);//待签名 - sealSignRecordMapper.insertSealSignRecord(sealSignRecord); - } - } - } - } - break; - } - } - } - } catch (EsignDemoException e) { - e.printStackTrace(); - } catch (InterruptedException e) { - e.printStackTrace(); - } + //TODO 取消一下注释 +// try { +// //获取当前案件的裁决书 +// CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); +// List caseAttachList = caseApplication2.getCaseAttachList(); +// if (caseAttachList != null && caseAttachList.size() > 0) { +// for (CaseAttach caseAttach : caseAttachList) { +// if (caseAttach.getAnnexType() == 3) { +// String annexPath = caseAttach.getAnnexPath(); +// String path = "/home/ruoyi/" + annexPath; +//// String path ="D:\\home\\仲裁裁决书模板.docx"; +// //获取文件上传地址 +// EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); +// String body = response.getBody(); +// if (body != null){ +// JSONObject jsonObject = JSONObject.parseObject(body); +// String fileId = jsonObject.getJSONObject("data").getString("fileId"); +// String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl"); +// //上传文件流 +// EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path); +// JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody()); +// if (jsonObject1.getIntValue("errCode")==0){ +// //查看文件上传状态 +// Thread.sleep(5000); +// EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId); +// JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody()); +// JSONObject data = jsonObject2.getJSONObject("data"); +// int fileStatus =data.getIntValue("fileStatus"); +// if (fileStatus == 2 || fileStatus == 5){ +// String fileName = data.getString("fileName"); +// //上传成功,获取文件签名印章位置 +// SealSignRecord sealSignRecord = new SealSignRecord(); +// sealSignRecord.setFileid(fileId); +// EsignHttpResponse positions = SignAward.getPositions(sealSignRecord); +// Gson gson = new Gson(); +// JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class); +// JsonObject positionsData = positionsJsonObject.getAsJsonObject("data"); +// String keywordPositions = positionsData.get("keywordPositions").getAsString(); +// //发起签署 +// sealSignRecord.setFilename(fileName); +// String arbitratorId = caseApplication2.getArbitratorId(); +// if (arbitratorId!=null){ +// SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); +// if (sysUser == null){ +// return rows; +// } +// sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); +// sealSignRecord.setPensonName(sysUser.getNickName()); +// } +// sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); +// sealSignRecord.setOrgnizeNamePsnAccount("秦桃则"); +// sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); +// sealSignRecord.setOrgnizeNamePsnAccount("17691338406"); +// sealSignRecord.setOrgnizeNamepsnName("韩超勃"); +// //解析文件签名印章位置 +// JSONArray jsonArray = JSONArray.parseArray(keywordPositions); +// for (int i = 0; i < jsonArray.size(); i++) { +// JSONObject jsonObject3 = jsonArray.getJSONObject(i); +// String keyword = jsonObject3.getString("keyword"); +// if (keyword.equals("仲裁员")){ +// //签名 +// JSONArray positionsArray = jsonObject3.getJSONArray("positions"); +// // 遍历 positionsArray 中的每个元素 +// for (int j = 0; j < positionsArray.size(); j++){ +// JSONObject positionObj = positionsArray.getJSONObject(j); +// int pageNum = positionObj.getIntValue("pageNum"); +// sealSignRecord.setPositionPagepsn(String.valueOf(pageNum)); +// JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); +// JSONObject coordinateObj = coordinatesArray.getJSONObject(0); +// double positionX = coordinateObj.getDoubleValue("positionX"); +// double positionY = coordinateObj.getDoubleValue("positionY"); +// sealSignRecord.setPositionXpsn(positionX); +// sealSignRecord.setPositionYpsn(positionY); +// } +// }else { +// //用印 +// JSONArray positionsArray = jsonObject3.getJSONArray("positions"); +// // 遍历 positionsArray 中的每个元素 +// for (int j = 0; j < positionsArray.size(); j++) { +// JSONObject positionObj = positionsArray.getJSONObject(j); +// int pageNum = positionObj.getIntValue("pageNum"); +// sealSignRecord.setPositionPageorg(String.valueOf(pageNum)); +// JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); +// JSONObject coordinateObj = coordinatesArray.getJSONObject(0); +// double positionX = coordinateObj.getDoubleValue("positionX"); +// double positionY = coordinateObj.getDoubleValue("positionY"); +// sealSignRecord.setPositionXorg(positionX); +// sealSignRecord.setPositionYorg(positionY); +// } +// } +// } +// EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord); +// JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); +// if (jsonObject1.getIntValue("code")==0){ +// //获取签署流程ID +// JSONObject data1 = jsonObject3.getJSONObject("data"); +// String signFlowId = data1.getString("signFlowId"); +// //保存案件id,文件id,文件名称.流程id到签署用印记录表里 +// sealSignRecord.setCaseAppliId(caseApplication.getId()); +// sealSignRecord.setSignFlowid(signFlowId); +// sealSignRecord.setSignFlowStatus(1);//待签名 +// sealSignRecordMapper.insertSealSignRecord(sealSignRecord); +// } +// } +// } +// } +// break; +// } +// } +// } +// } catch (EsignDemoException e) { +// e.printStackTrace(); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,""); From edfd847318cdbd3c8ccfa6ae34835611a8613b02 Mon Sep 17 00:00:00 2001 From: gy b Date: Fri, 13 Oct 2023 18:25:51 +0800 Subject: [PATCH 113/123] =?UTF-8?q?=E6=95=B4=E5=90=88=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 4 +- .../CaseArbitrateController.java | 2 +- .../CaseLogRecordController.java | 2 +- .../service/impl/AdjudicationServiceImpl.java | 28 +- .../impl/CaseApplicationServiceImpl.java | 540 ++++++++++-------- 5 files changed, 304 insertions(+), 272 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index a973250..003c1f9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -101,7 +101,7 @@ public class CaseApplicationController extends BaseController { /** * 查询签名链接 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") @PostMapping("/selectSignUrl") public AjaxResult selectSignUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException { SealSignRecord sealSignRecordselect = caseApplicationService.selectSignUrl(caseApplication); @@ -111,7 +111,7 @@ public class CaseApplicationController extends BaseController { /** * 查询用印链接 */ - @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSealUrl')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSealUrl')") @PostMapping("/selectSealUrl") public AjaxResult selectSealUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException { SealSignRecord sealUrlRecordselect = caseApplicationService.selectSealUrl(caseApplication); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java index dda5a73..4978baa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java @@ -23,7 +23,7 @@ public class CaseArbitrateController extends BaseController { * @return */ @PutMapping("/method") - @PreAuthorize("@ss.hasPermi('caseManagement:list:checkarbitrationway')") +// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkarbitrationway')") public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication ,Integer opinion){ return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java index 8fd1ee0..6cc330d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java @@ -22,7 +22,7 @@ public class CaseLogRecordController extends BaseController { /** * 查询案件日志列表 */ - @PreAuthorize("@ss.hasPermi('caseLog:list')") +// @PreAuthorize("@ss.hasPermi('caseLog:list')") @GetMapping("/list") public TableDataInfo list(CaseLogRecord caseLogRecord) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 9967dc3..d66eed1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -364,20 +364,20 @@ public class AdjudicationServiceImpl implements IAdjudicationService { private void sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail) { List fileList = new ArrayList<>(); File file = null; -// List caseAttachList = caseApplication1.getCaseAttachList(); -// if (caseAttachList != null && caseAttachList.size() > 0) { -// for (CaseAttach caseAttach : caseAttachList) { -// if (caseAttach.getAnnexType() == 3) { -// String annexPath = caseAttach.getAnnexPath(); -// String path = "/home/ruoyi/" + annexPath; + List caseAttachList = caseApplication1.getCaseAttachList(); + if (caseAttachList != null && caseAttachList.size() > 0) { + for (CaseAttach caseAttach : caseAttachList) { + if (caseAttach.getAnnexType() == 3) { + String annexPath = caseAttach.getAnnexPath(); + String path = "/home/ruoyi/" + annexPath; // String path = "/home/ruoyi/uploadPath/upload/2023/10/12/裁决书测试20231012test.docx"; - String path = "E:/WorkDoc/SH/裁决书测试20231012test.docx"; - file = new File(path); - fileList.add(file); - System.out.println("文件长度:" + file.length()); -// } -// } -// } +// String path = "E:/WorkDoc/SH/裁决书测试20231012test.docx"; + file = new File(path); + fileList.add(file); + System.out.println("文件长度:" + file.length()); + } + } + } if (file != null) { JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); try { @@ -431,7 +431,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { try { // List fileList = new ArrayList<>(); // fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx")); - // File file = fileList.get(0);//System.out.println("这是文件"+file); + // File file = fileList.get(0);//System.out.println("这是文件"+file); //电子邮件送达 // EmailOutUtil emailOutUtil = new EmailOutUtil(); // JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 44204d2..f71b323 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -3,8 +3,6 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; - - import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; @@ -14,31 +12,26 @@ import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDept; - import com.ruoyi.common.core.domain.entity.SysUser; - import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.SignAward; -import com.ruoyi.common.utils.bean.SealSignRecord; - -import com.ruoyi.common.utils.file.SaaSAPIFileUtils; -import com.ruoyi.system.mapper.SysUserMapper; -import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.bean.BeanUtils; +import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.system.mapper.SysDeptMapper; +import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; +import com.ruoyi.wisdomarbitrate.utils.SignAward; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.io.File; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; @@ -73,8 +66,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private SealSignRecordMapper sealSignRecordMapper; // 手机号正则 - private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); - + private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); @Override @@ -99,18 +91,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = caseApplicationMapper.insertCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); - Map deptMap =new HashMap<>(); + Map deptMap = new HashMap<>(); if (caseAffiliates != null && caseAffiliates.size() > 0) { - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - if (CollectionUtil.isEmpty(deptList)) { - deptList = new ArrayList<>(); - } - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); + // 查询所有的组织机构,组装成map + List deptList = sysDeptMapper.selectDeptList(new SysDept()); + if (CollectionUtil.isEmpty(deptList)) { + deptList = new ArrayList<>(); + } + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); for (CaseAffiliate caseAffiliate : caseAffiliates) { caseAffiliate.setCaseAppliId(caseApplication.getId()); - if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { + if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); @@ -144,24 +136,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_APPLICATION,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); return rows; } /** * 获取自动编码 + * * @return */ private String generateCaseNum() { // 自动编码格式 zc+yyyyMMdd+001 String currentDay = DateUtils.dateTime(); - String caseNum = "zc"+ currentDay; + String caseNum = "zc" + currentDay; //查询出当天的案件编号的最大值 - Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length()); - if(null == maxCaseNum){ + Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length()); + if (null == maxCaseNum) { caseNum = caseNum + "001"; - }else { + } else { caseNum = caseNum + String.format("%03d", maxCaseNum); } return caseNum; @@ -179,21 +172,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); caseApplication.setFeePayable(feePayable); int rows = caseApplicationMapper.updataCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); - if(caseAffiliates!=null&&caseAffiliates.size()>0){ + if (caseAffiliates != null && caseAffiliates.size() > 0) { // 查询所有的组织机构,组装成map List deptList = sysDeptMapper.selectDeptList(new SysDept()); if (CollectionUtil.isEmpty(deptList)) { deptList = new ArrayList<>(); } - Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); - for (CaseAffiliate caseAffiliate : caseAffiliates){ + Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); + for (CaseAffiliate caseAffiliate : caseAffiliates) { caseAffiliate.setCaseAppliId(caseApplication.getId()); - if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { + if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); @@ -219,8 +212,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } List caseAttachList = caseApplication.getCaseAttachList(); - if(caseAttachList!=null&&caseAttachList.size()>0){ - for (CaseAttach caseAttach : caseAttachList){ + if (caseAttachList != null && caseAttachList.size() > 0) { + for (CaseAttach caseAttach : caseAttachList) { caseAttach.setCaseAppliId(caseApplication.getId()); caseAttachMapper.updateCaseAttach(caseAttach); } @@ -237,7 +230,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CHECK); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_CHECK,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CHECK, ""); return rows; } @@ -273,8 +266,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String annexPath = "/uploadPath" + annexName.substring(startIndex); caseAttach.setAnnexPath(annexPath); int startIndexnew = annexName.lastIndexOf("/"); - if(startIndexnew!=-1){ - String annexNamenew = annexName.substring(startIndexnew+1); + if (startIndexnew != -1) { + String annexNamenew = annexName.substring(startIndexnew + 1); caseAttach.setAnnexName(annexNamenew); } @@ -284,27 +277,27 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationselect.setCaseAttachList(caseAttachList); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if(caseAffiliatListeselect!=null){ + if (caseAffiliatListeselect != null) { // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap=new HashMap<>(); - if(CollectionUtil.isNotEmpty(sysDepts)){ + Map deptMap = new HashMap<>(); + if (CollectionUtil.isNotEmpty(sysDepts)) { for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); + deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); } } StringBuffer applicantName = new StringBuffer(); StringBuffer respondentName = new StringBuffer(); - for (int i = 0; i < caseAffiliatListeselect.size(); i++){ + for (int i = 0; i < caseAffiliatListeselect.size(); i++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); - if(identityType==1){ - if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ + if (identityType == 1) { + if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - applicantName.append(caseAffiliateselect.getName()).append(",");; - }else if(identityType==2){ - respondentName.append(caseAffiliateselect.getName()).append(",");; + applicantName.append(caseAffiliateselect.getName()).append(","); + } else if (identityType == 2) { + respondentName.append(caseAffiliateselect.getName()).append(","); } } caseApplicationselect.setApplicantName(applicantName.toString()); @@ -317,26 +310,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional - public String importCaseApplication(List caseApplicationList, String operName) { + public String importCaseApplication(List caseApplicationList, String operName) { StringBuilder failureMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder(); int successNum = 0; int failureNum = 0; - if(caseApplicationList!=null&&caseApplicationList.size()>0){ + if (caseApplicationList != null && caseApplicationList.size() > 0) { // 1,查询所有的组织机构,组装成map List deptList = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap =new HashMap<>(); - if(CollectionUtil.isNotEmpty(deptList)) { - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); + Map deptMap = new HashMap<>(); + if (CollectionUtil.isNotEmpty(deptList)) { + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); } List caseApplicationListinsert = new ArrayList<>(); - for (int i = 0; i < caseApplicationList.size(); i++){ + for (int i = 0; i < caseApplicationList.size(); i++) { CaseApplication caseApplication = caseApplicationList.get(i); // 导入校验 importValid(caseApplication); // 校验成功的数据 - if(StrUtil.isEmpty(caseApplication.getErrorMsg())) { + if (StrUtil.isEmpty(caseApplication.getErrorMsg())) { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal(0.01); @@ -356,12 +349,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // caseApplicationListinsert.add(caseApplication); // } caseApplicationListinsert.add(caseApplication); - }else { + } else { // 拼接错误信息 - failureMsg.append("
").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString()); + failureMsg.append("
").append("第").append(i + 2).append("行:").append(caseApplication.getErrorMsg().toString()); } } - if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ + if (caseApplicationListinsert != null && caseApplicationListinsert.size() > 0) { // List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( // collectingAndThen( // toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))), @@ -370,45 +363,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 // if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ - List caseApplicationNewList = null; - for (int i = 0; i < caseApplicationListinsert.size(); i++){ - caseApplicationNewList = new ArrayList<>(); - CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); - // 设置自动编码 - caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); - List caseAffiliatesnew = new ArrayList<>(); - CaseApplication caseApplicationNew = new CaseApplication(); - copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew); - if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ - for (int j = 0; j < caseApplicationListinsert.size(); j++){ - CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); + List caseApplicationNewList = null; + for (int i = 0; i < caseApplicationListinsert.size(); i++) { + caseApplicationNewList = new ArrayList<>(); + CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); + // 设置自动编码 + caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); + List caseAffiliatesnew = new ArrayList<>(); + CaseApplication caseApplicationNew = new CaseApplication(); + copyCaseApplication(caseApplicationinsertDiffer, caseApplicationNew); + if (caseApplicationListinsert != null && caseApplicationListinsert.size() > 0) { + for (int j = 0; j < caseApplicationListinsert.size(); j++) { + CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); - if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&& - caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){ + if (StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum()) && + caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())) { - caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); - } + caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); } - caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); - caseApplicationNewList.add(caseApplicationNew); } + caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); + caseApplicationNewList.add(caseApplicationNew); + } - for (int k = 0; k < caseApplicationNewList.size(); k++){ - CaseApplication caseApplicationItera = caseApplicationNewList.get(k); - // 新增立案信息 - caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + for (int k = 0; k < caseApplicationNewList.size(); k++) { + CaseApplication caseApplicationItera = caseApplicationNewList.get(k); + // 新增立案信息 + caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); - List caseAffiliates = caseApplicationItera.getCaseAffiliates(); - if(caseAffiliates!=null&&caseAffiliates.size()>0){ - for (CaseAffiliate caseAffiliate : caseAffiliates){ - caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); - } - caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); + int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); + List caseAffiliates = caseApplicationItera.getCaseAffiliates(); + if (caseAffiliates != null && caseAffiliates.size() > 0) { + for (CaseAffiliate caseAffiliate : caseAffiliates) { + caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); } - successNum++; - successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); + caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); } + successNum++; + successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); + } // } @@ -416,233 +409,239 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - }else { + } else { throw new ServiceException("导入立案申请数据不能为空!"); } - return successMsg.append(failureMsg.toString()).toString(); + return successMsg.append(failureMsg.toString()).toString(); } /** * 导入校验 + * * @param caseApplication * @param */ private void importValid(CaseApplication caseApplication) { - StringBuilder failureMsg=new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); caseApplication.setErrorMsg(failureMsg); // 校验基本字段 - validBaseColumn(caseApplication,failureMsg); + validBaseColumn(caseApplication, failureMsg); // 校验申请人信息 - validApplicationColumn(caseApplication,failureMsg); + validApplicationColumn(caseApplication, failureMsg); // 校验申请人代理信息 - validApplicationAgentColumn(caseApplication,failureMsg); + validApplicationAgentColumn(caseApplication, failureMsg); // 校验被申请人信息 - validDebtorApplicationColumn(caseApplication,failureMsg); + validDebtorApplicationColumn(caseApplication, failureMsg); // 校验被申请人代理信息 - validDebtorApplicationAgentColumn(caseApplication,failureMsg); + validDebtorApplicationAgentColumn(caseApplication, failureMsg); } /** * 校验被申请人代理信息 + * * @param caseApplication * @param failureMsg */ private void validDebtorApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if( StrUtil.isEmpty(caseApplication.getDebtorNameAgent())){ + if (StrUtil.isEmpty(caseApplication.getDebtorNameAgent())) { failureMsg.append("【被申请人主体信息-代理人姓名】字段不能为空;"); - }else if(caseApplication.getDebtorNameAgent().length()>50){ + } else if (caseApplication.getDebtorNameAgent().length() > 50) { failureMsg.append("【被申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); } - if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())){ + if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) { failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;"); - }else if(caseApplication.getDebtorIdentityNumAgent().length()>50){ + } else if (caseApplication.getDebtorIdentityNumAgent().length() > 50) { failureMsg.append("【被申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;"); } String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent(); - if( StrUtil.isEmpty(debtorContactTelphoneAgent)){ + if (StrUtil.isEmpty(debtorContactTelphoneAgent)) { failureMsg.append("【被申请人主体信息-代理人联系电话】字段不能为空;"); - }else if(!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()){ + } else if (!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()) { failureMsg.append("【被申请人主体信息-代理人联系电话】字段不合法;"); } - if( StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())){ + if (StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())) { failureMsg.append("【被申请人主体信息-代理人联系地址】字段不能为空;"); - }else if(caseApplication.getDebtorContactAddressAgent().length()>50){ + } else if (caseApplication.getDebtorContactAddressAgent().length() > 50) { failureMsg.append("【被申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); } } /** * 校验被申请人信息 + * * @param caseApplication * @param failureMsg */ private void validDebtorApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if( StrUtil.isEmpty(caseApplication.getDebtorName())){ + if (StrUtil.isEmpty(caseApplication.getDebtorName())) { failureMsg.append("【被申请人主体信息-申请人姓名】字段不能为空;"); - }else if(caseApplication.getDebtorName().length()>50){ + } else if (caseApplication.getDebtorName().length() > 50) { failureMsg.append("【被申请人主体信息-申请人姓名】字段超出指定长度,最大长度为50;"); } - if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())){ + if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) { failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;"); - }else if(caseApplication.getDebtorIdentityNum().length()>50){ + } else if (caseApplication.getDebtorIdentityNum().length() > 50) { failureMsg.append("【被申请人主体信息-身份证号】字段超出指定长度,最大长度为50;"); } String debtorContactTelphone = caseApplication.getDebtorContactTelphone(); - if( StrUtil.isEmpty(debtorContactTelphone)){ + if (StrUtil.isEmpty(debtorContactTelphone)) { failureMsg.append("【被申请人主体信息-联系电话】字段不能为空;"); - }else if(!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()){ + } else if (!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()) { failureMsg.append("【被申请人主体信息-联系电话】字段不合法;"); } - if( StrUtil.isEmpty(caseApplication.getDebtorContactAddress())){ + if (StrUtil.isEmpty(caseApplication.getDebtorContactAddress())) { failureMsg.append("【被申请人主体信息-联系地址】字段不能为空;"); - }else if(caseApplication.getDebtorContactAddress().length()>50){ + } else if (caseApplication.getDebtorContactAddress().length() > 50) { failureMsg.append("【被申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); } String debtorWorkTelphone = caseApplication.getDebtorWorkTelphone(); - if( StrUtil.isEmpty(debtorWorkTelphone)){ + if (StrUtil.isEmpty(debtorWorkTelphone)) { failureMsg.append("【被申请人主体信息-单位电话】字段不能为空;"); - }else if(!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()){ + } else if (!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()) { failureMsg.append("【被申请人主体信息-单位电话】字段不合法;"); } - if( StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())){ + if (StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())) { failureMsg.append("【被申请人主体信息-单位地址】字段不能为空;"); - }else if(caseApplication.getDebtorWorkAddress().length()>50){ + } else if (caseApplication.getDebtorWorkAddress().length() > 50) { failureMsg.append("【被申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); } } /** * 校验申请人代理信息 + * * @param caseApplication * @param failureMsg */ private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if( StrUtil.isEmpty(caseApplication.getNameAgent())){ + if (StrUtil.isEmpty(caseApplication.getNameAgent())) { failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;"); - }else if(caseApplication.getNameAgent().length()>50){ + } else if (caseApplication.getNameAgent().length() > 50) { failureMsg.append("【申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); } - if( StrUtil.isEmpty(caseApplication.getIdentityNumAgent())){ + if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) { failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;"); - }else if(caseApplication.getIdentityNumAgent().length()>50){ + } else if (caseApplication.getIdentityNumAgent().length() > 50) { failureMsg.append("【申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;"); } String contactTelphoneAgent = caseApplication.getContactTelphoneAgent(); - if( StrUtil.isEmpty(contactTelphoneAgent)){ + if (StrUtil.isEmpty(contactTelphoneAgent)) { failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;"); - }else if(!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()){ + } else if (!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()) { failureMsg.append("【申请人主体信息-代理人联系电话】字段不合法;"); } - if( StrUtil.isEmpty(caseApplication.getContactAddressAgent())){ + if (StrUtil.isEmpty(caseApplication.getContactAddressAgent())) { failureMsg.append("【申请人主体信息-代理人联系地址】字段不能为空;"); - }else if(caseApplication.getContactAddressAgent().length()>50){ + } else if (caseApplication.getContactAddressAgent().length() > 50) { failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); } } /** * 校验申请人主题信息 + * * @param caseApplication * @param failureMsg */ private void validApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if( StrUtil.isEmpty(caseApplication.getName())){ + if (StrUtil.isEmpty(caseApplication.getName())) { failureMsg.append("【申请人主体信息-申请人(机构)】字段不能为空;"); - }else if(caseApplication.getName().length()>20){ + } else if (caseApplication.getName().length() > 20) { failureMsg.append("【申请人主体信息-申请人(机构)】字段超出指定长度,最大长度为20;"); } - if( StrUtil.isNotEmpty(caseApplication.getIdentityNum())&&caseApplication.getIdentityNum().length()>50){ + if (StrUtil.isNotEmpty(caseApplication.getIdentityNum()) && caseApplication.getIdentityNum().length() > 50) { failureMsg.append("【申请人主体信息-代码】字段超出指定长度,最大长度为50;"); } String contactTelphone = caseApplication.getContactTelphone(); - if( StrUtil.isEmpty(contactTelphone)){ + if (StrUtil.isEmpty(contactTelphone)) { failureMsg.append("【申请人主体信息-联系电话】字段不能为空;"); - }else if(!TELEPHONE_REGX.matcher(contactTelphone).matches()){ + } else if (!TELEPHONE_REGX.matcher(contactTelphone).matches()) { failureMsg.append("【申请人主体信息-联系电话】字段不合法;"); } - if( StrUtil.isEmpty(caseApplication.getContactAddress())){ + if (StrUtil.isEmpty(caseApplication.getContactAddress())) { failureMsg.append("【申请人主体信息-联系地址】字段不能为空;"); - }else if(caseApplication.getName().length()>50){ + } else if (caseApplication.getName().length() > 50) { failureMsg.append("【申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); } String workTelphone = caseApplication.getWorkTelphone(); - if( StrUtil.isEmpty(workTelphone)){ + if (StrUtil.isEmpty(workTelphone)) { failureMsg.append("【申请人主体信息-单位电话】字段不能为空;"); - }else if(!TELEPHONE_REGX.matcher(workTelphone).matches()){ + } else if (!TELEPHONE_REGX.matcher(workTelphone).matches()) { failureMsg.append("【申请人主体信息-单位电话】字段不合法;"); } - if( StrUtil.isEmpty(caseApplication.getWorkAddress())){ + if (StrUtil.isEmpty(caseApplication.getWorkAddress())) { failureMsg.append("【申请人主体信息-单位地址】字段不能为空;"); - }else if(caseApplication.getWorkAddress().length()>50){ + } else if (caseApplication.getWorkAddress().length() > 50) { failureMsg.append("【申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); } } /** * 校验基本字段 + * * @param caseApplication * @param failureMsg */ private void validBaseColumn(CaseApplication caseApplication, StringBuilder failureMsg) { BigDecimal caseSubjectAmount = caseApplication.getCaseSubjectAmount(); - if(null== caseSubjectAmount){ + if (null == caseSubjectAmount) { failureMsg.append("【案件标的】字段不合法;"); - }else { - if(caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 ||caseSubjectAmount.compareTo(new BigDecimal("99999999.99"))>0){ + } else { + if (caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 || caseSubjectAmount.compareTo(new BigDecimal("99999999.99")) > 0) { failureMsg.append("【案件标的】字段超出范围,范围为[0,100000000);"); } - if(caseSubjectAmount.scale()>2){ + if (caseSubjectAmount.scale() > 2) { failureMsg.append("【案件标的】字段超出指定精度(10^-2);"); } } - if( caseApplication.getLoanStartDate()== null){ + if (caseApplication.getLoanStartDate() == null) { failureMsg.append("【借款开始日期】字段不合法;"); } - if( caseApplication.getLoanEndDate()== null){ + if (caseApplication.getLoanEndDate() == null) { failureMsg.append("【借款结束日期】字段不合法;"); } - if( StrUtil.isEmpty(caseApplication.getContractNumber())){ + if (StrUtil.isEmpty(caseApplication.getContractNumber())) { failureMsg.append("【合同编号】字段不能为空;"); - }else if(caseApplication.getContractNumber().length()>50){ + } else if (caseApplication.getContractNumber().length() > 50) { failureMsg.append("【合同编号】字段超出指定长度,最大长度为50;"); } BigDecimal claimPrinciOwed = caseApplication.getClaimPrinciOwed(); - if(null== claimPrinciOwed){ + if (null == claimPrinciOwed) { failureMsg.append("【申请人主张欠本金】字段不合法;"); - }else { - if(claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 ||claimPrinciOwed.compareTo(new BigDecimal("99999999.99"))>0){ + } else { + if (claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 || claimPrinciOwed.compareTo(new BigDecimal("99999999.99")) > 0) { failureMsg.append("【申请人主张欠本金】字段超出范围,范围为[0,100000000);"); } - if(claimPrinciOwed.scale()>2){ + if (claimPrinciOwed.scale() > 2) { failureMsg.append("【申请人主张欠本金】字段超出指定精度(10^-2);"); } } BigDecimal claimInterestOwed = caseApplication.getClaimInterestOwed(); - if(null== claimInterestOwed){ + if (null == claimInterestOwed) { failureMsg.append("【申请人主张欠利息】字段不合法;"); - }else { - if(claimInterestOwed.compareTo(new BigDecimal("0")) < 0 ||claimInterestOwed.compareTo(new BigDecimal("99999999.99"))>0){ + } else { + if (claimInterestOwed.compareTo(new BigDecimal("0")) < 0 || claimInterestOwed.compareTo(new BigDecimal("99999999.99")) > 0) { failureMsg.append("【申请人主张欠利息】字段超出范围,范围为[0,100000000);"); } - if(claimInterestOwed.scale()>2){ + if (claimInterestOwed.scale() > 2) { failureMsg.append("【申请人主张欠利息】字段超出指定精度(10^-2);"); } } BigDecimal claimLiquidDamag = caseApplication.getClaimLiquidDamag(); - if(null== claimLiquidDamag){ + if (null == claimLiquidDamag) { failureMsg.append("【申请人主张违约金】字段不合法;"); - }else { - if(claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 ||claimLiquidDamag.compareTo(new BigDecimal("99999999.99"))>0){ + } else { + if (claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 || claimLiquidDamag.compareTo(new BigDecimal("99999999.99")) > 0) { failureMsg.append("【申请人主张违约金】字段超出范围,范围为[0,100000000);"); } - if(claimLiquidDamag.scale()>2){ + if (claimLiquidDamag.scale() > 2) { failureMsg.append("【申请人主张违约金】字段超出指定精度(10^-2);"); } } - if( StrUtil.isEmpty(caseApplication.getArbitratClaims())){ + if (StrUtil.isEmpty(caseApplication.getArbitratClaims())) { failureMsg.append("【申请人仲裁诉求】字段不能为空;"); - }else if(caseApplication.getArbitratClaims().length()>10000){ + } else if (caseApplication.getArbitratClaims().length() > 10000) { failureMsg.append("【申请人仲裁诉求】字段超出指定长度,最大长度为10000;"); } } @@ -653,7 +652,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public int pendTral(CaseApplication caseApplication) { List arbitrators = caseApplication.getArbitrators(); int rows = 0; - if(arbitrators!=null&&arbitrators.size()>0){ + if (arbitrators != null && arbitrators.size() > 0) { List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -675,12 +674,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); int rows = 0; //同意组庭 - if(isAgreePendTral!=null&&isAgreePendTral==1){ + if (isAgreePendTral != null && isAgreePendTral == 1) { rows = caseApplicationMapper.submitCaseApplication(caseApplication); - }else { + } else { List arbitrators = caseApplication.getArbitrators(); // 仲裁员信息 - if(arbitrators!=null&&arbitrators.size()>0){ + if (arbitrators != null && arbitrators.size() > 0) { List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -691,7 +690,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); return rows; } @@ -703,7 +702,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); return rows; } @@ -715,7 +714,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if(agreeOrNotCheck.intValue()==1){//同意审核 + if (agreeOrNotCheck.intValue() == 1) {//同意审核 try { //获取当前案件的裁决书 CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); @@ -729,21 +728,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //获取文件上传地址 EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); String body = response.getBody(); - if (body != null){ + if (body != null) { JSONObject jsonObject = JSONObject.parseObject(body); String fileId = jsonObject.getJSONObject("data").getString("fileId"); String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl"); //上传文件流 EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path); JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody()); - if (jsonObject1.getIntValue("errCode")==0){ + if (jsonObject1.getIntValue("errCode") == 0) { //查看文件上传状态 Thread.sleep(5000); EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId); JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody()); JSONObject data = jsonObject2.getJSONObject("data"); - int fileStatus =data.getIntValue("fileStatus"); - if (fileStatus == 2 || fileStatus == 5){ + int fileStatus = data.getIntValue("fileStatus"); + if (fileStatus == 2 || fileStatus == 5) { String fileName = data.getString("fileName"); //上传成功,获取文件签名印章位置 SealSignRecord sealSignRecord = new SealSignRecord(); @@ -756,9 +755,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //发起签署 sealSignRecord.setFilename(fileName); String arbitratorId = caseApplication2.getArbitratorId(); - if (arbitratorId!=null){ + if (arbitratorId != null) { SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); - if (sysUser == null){ + if (sysUser == null) { return rows; } sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); @@ -774,11 +773,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject3 = jsonArray.getJSONObject(i); String keyword = jsonObject3.getString("keyword"); - if (keyword.equals("仲裁员")){ + if (keyword.equals("仲裁员")) { //签名 JSONArray positionsArray = jsonObject3.getJSONArray("positions"); // 遍历 positionsArray 中的每个元素 - for (int j = 0; j < positionsArray.size(); j++){ + for (int j = 0; j < positionsArray.size(); j++) { JSONObject positionObj = positionsArray.getJSONObject(j); int pageNum = positionObj.getIntValue("pageNum"); sealSignRecord.setPositionPagepsn(String.valueOf(pageNum)); @@ -789,7 +788,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sealSignRecord.setPositionXpsn(positionX); sealSignRecord.setPositionYpsn(positionY); } - }else { + } else { //用印 JSONArray positionsArray = jsonObject3.getJSONArray("positions"); // 遍历 positionsArray 中的每个元素 @@ -808,7 +807,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord); JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); - if (jsonObject1.getIntValue("code")==0){ + if (jsonObject1.getIntValue("code") == 0) { //获取签署流程ID JSONObject data1 = jsonObject3.getJSONObject("data"); String signFlowId = data1.getString("signFlowId"); @@ -832,12 +831,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); - }else if(agreeOrNotCheck.intValue()==2){//拒绝审核 + } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.VERPRIF_ARBITRATION,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, ""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } @@ -851,15 +850,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //提交立案审查 int rows = 0; Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if(agreeOrNotCheck.intValue()==1){//同意审核 + if (agreeOrNotCheck.intValue() == 1) {//同意审核 caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); rows = caseApplicationMapper.submitCaseApplication(caseApplication); - }else if(agreeOrNotCheck.intValue()==2){//拒绝审核 + } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_PAYMENT,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, ""); return rows; } @@ -867,30 +866,31 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplicationConfirm(caseApplication); - if(caseApplicationselect==null){ + if (caseApplicationselect == null) { return caseApplicationselect; } CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if(caseAffiliatListeselect!=null){ + if (caseAffiliatListeselect != null) { // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap=new HashMap<>(); - if(CollectionUtil.isNotEmpty(sysDepts)){ + Map deptMap = new HashMap<>(); + if (CollectionUtil.isNotEmpty(sysDepts)) { for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); + deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); } } StringBuffer applicantName = new StringBuffer(); - for (int i = 0; i < caseAffiliatListeselect.size(); i++){ + for (int i = 0; i < caseAffiliatListeselect.size(); i++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); - if(identityType==1){ - if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ + if (identityType == 1) { + if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - applicantName.append(caseAffiliateselect.getName()).append(",");; + applicantName.append(caseAffiliateselect.getName()).append(","); + ; } } caseApplicationselect.setApplicantName(applicantName.toString()); @@ -902,13 +902,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 给被申请人发送房间号短信 + * * @param messageVO * @return */ @Override public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) { CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(messageVO.getId(), 2); - if(null==caseAffiliate){ + if (null == caseAffiliate) { return "被申请人不存在"; } CaseApplication caseApplication = new CaseApplication(); @@ -926,6 +927,43 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return "短信发送成功"; } + @Override + public SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException { + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setCaseAppliId(caseApplication.getId()); + Gson gson = new Gson(); + List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); + SealSignRecord sealSignRecordReslt = new SealSignRecord(); + if (sealSignRecords != null && sealSignRecords.size() > 0) { + SealSignRecord sealSignRecordselect = sealSignRecords.get(0); + EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecordselect); + JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + String url = signUrlData.get("url").getAsString(); + sealSignRecordReslt.setSignUrl(url); + } + + return sealSignRecordReslt; + } + + @Override + public SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException { + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setCaseAppliId(caseApplication.getId()); + Gson gson = new Gson(); + List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); + SealSignRecord sealSignRecordReslt = new SealSignRecord(); + if (sealSignRecords != null && sealSignRecords.size() > 0) { + SealSignRecord sealSignRecordselect = sealSignRecords.get(0); + EsignHttpResponse signUrl = SignAward.usesealUrl(sealSignRecordselect); + JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + String url = signUrlData.get("url").getAsString(); + sealSignRecordReslt.setSealUrl(url); + } + return sealSignRecordReslt; + } + @Override @Transactional public int pendTralSure(CaseApplication caseApplication) { @@ -944,29 +982,29 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String arbitratorId = caseApplicationselect.getArbitratorId(); // List arbitratorList = new ArrayList<>(); - if(StringUtils.isNotEmpty(arbitratorId)){ - String[] idStrList = arbitratorId.split(","); + if (StringUtils.isNotEmpty(arbitratorId)) { + String[] idStrList = arbitratorId.split(","); List idList = new ArrayList<>(); - for(int i = 0;i < idStrList.length;i ++ ){ + for (int i = 0; i < idStrList.length; i++) { idList.add(Long.parseLong(idStrList[i])); } // - // 查询仲裁员电话号 - List userList= sysUserMapper.selectUserListByIds(idList); - if(CollectionUtil.isNotEmpty(userList)) { - for (SysUser user : userList) { + // 查询仲裁员电话号 + List userList = sysUserMapper.selectUserListByIds(idList); + if (CollectionUtil.isNotEmpty(userList)) { + for (SysUser user : userList) { - //给仲裁员发送短信通知 - request.setPhone(user.getPhonenumber()); - // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = user.getNickName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - SmsUtils.sendSms(request); + //给仲裁员发送短信通知 + request.setPhone(user.getPhonenumber()); + // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 + String name = user.getNickName(); + request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + SmsUtils.sendSms(request); - } - } + } + } } @@ -974,20 +1012,20 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if(caseAffiliatListeselect!=null) { + if (caseAffiliatListeselect != null) { // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap=new HashMap<>(); - if(CollectionUtil.isNotEmpty(sysDepts)){ + Map deptMap = new HashMap<>(); + if (CollectionUtil.isNotEmpty(sysDepts)) { for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); + deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); } } for (int j = 0; j < caseAffiliatListeselect.size(); j++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); int identityType = caseAffiliateselect.getIdentityType(); - if(identityType==1){ - if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ + if (identityType == 1) { + if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } @@ -1001,22 +1039,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION_METHOD,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); return rows; } - @Override @Transactional public int pendingAppointArbotrar(CaseApplication caseApplication) { int pendingAppointArbotrar = caseApplication.getPendingAppointArbotrar(); List arbitrators = caseApplication.getArbitrators(); int rows = 0; - if(pendingAppointArbotrar==1){ - if(arbitrators!=null&&arbitrators.size()>0){ + if (pendingAppointArbotrar == 1) { + if (arbitrators != null && arbitrators.size() > 0) { List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -1028,7 +1065,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); } - }else { + } else { caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); caseApplication.setPendingAppointArbotrar(2); rows = caseApplicationMapper.submitCaseApplication(caseApplication); @@ -1040,59 +1077,59 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew, Map deptMap) { - // 申请人信息 + // 申请人信息 CaseAffiliate caseAffiliate = new CaseAffiliate(); // BeanUtils.copyBeanProp(caseApplication,caseAffiliate); - BeanUtils.copyBeanProp(caseAffiliate,caseApplication); + BeanUtils.copyBeanProp(caseAffiliate, caseApplication); caseAffiliate.setIdentityType(1); // 申请人(机构),需要判断部门中是否存在,不存在则新增,当身份类型为1的时候,查询时需要根据名称查询组织机构 - if(StrUtil.isNotEmpty(caseApplication.getName())){ + if (StrUtil.isNotEmpty(caseApplication.getName())) { setApplicantOrganization(caseAffiliate, caseApplication, deptMap); } caseAffiliatesnew.add(caseAffiliate); // 组装被申请人信息 - caseAffiliatesnew.add( buildDebtorInfo(caseApplication)); + caseAffiliatesnew.add(buildDebtorInfo(caseApplication)); caseApplication.setCaseAffiliates(caseAffiliatesnew); } /** * 设置申请人的组织机构 + * * @param caseAffiliate * @param caseApplication */ @DataScope(deptAlias = "d") - private void setApplicantOrganization(CaseAffiliate caseAffiliate, CaseApplication caseApplication, Map deptMap ) { + private void setApplicantOrganization(CaseAffiliate caseAffiliate, CaseApplication caseApplication, Map deptMap) { + // 将组织机构id设为申请人名称 + if (deptMap.containsKey(caseApplication.getName())) { + caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); + } else { + // 如果不存在则新增 + SysDept dept = new SysDept(); + dept.setParentId(0L); + dept.setDeptName(caseApplication.getName()); + dept.setAncestors("0"); + dept.setOrderNum(1); + dept.setStatus("0"); + dept.setDelFlag("0"); + dept.setCreateBy(getUsername()); + dept.setUpdateBy(getUsername()); + sysDeptMapper.insertDept(dept); + deptMap.put(dept.getDeptName(), dept.getDeptId()); + caseAffiliate.setName(String.valueOf(dept.getDeptId())); - // 将组织机构id设为申请人名称 - if(deptMap.containsKey(caseApplication.getName())){ - caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); - }else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseApplication.getName()); - dept.setAncestors("0"); - dept.setOrderNum(1); - dept.setStatus("0"); - dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); - sysDeptMapper.insertDept(dept); - deptMap.put(dept.getDeptName(),dept.getDeptId()); - caseAffiliate.setName(String.valueOf(dept.getDeptId())); - - } + } } /** * 组装被申请人信息 + * * @param caseApplication * @return */ @@ -1134,24 +1171,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Gson gson = new Gson(); - SealSignRecord sealSignRecord = new SealSignRecord(); sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d"); EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); - JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); + JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class); JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); for (int i = 0; i < signersArray.size(); i++) { - JsonObject signerObject = (JsonObject)signersArray.get(i); - Integer psnsignStatus ; - Integer orgsignStatus ; - if(!(signerObject.get("psnSigner").toString()).equals("null")){ + JsonObject signerObject = (JsonObject) signersArray.get(i); + Integer psnsignStatus; + Integer orgsignStatus; + if (!(signerObject.get("psnSigner").toString()).equals("null")) { JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); - if(psnSignerData!=null){ + if (psnSignerData != null) { psnsignStatus = signerObject.get("signStatus").getAsInt(); sealSignRecord.setPsnsignStatus(psnsignStatus); - if(psnsignStatus.intValue()==2){ + if (psnsignStatus.intValue() == 2) { //更新立案申请状态为待用印 CaseApplication caseApplication = new CaseApplication(); caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); @@ -1162,9 +1198,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } } - if(!(signerObject.get("orgSigner").toString()).equals("null")){ + if (!(signerObject.get("orgSigner").toString()).equals("null")) { JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); - if(orgSignerData!=null){ + if (orgSignerData != null) { orgsignStatus = signerObject.get("signStatus").getAsInt(); sealSignRecord.setOrgsignStatus(orgsignStatus); //更新立案申请状态为待送达 @@ -1186,8 +1222,4 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - - - - } From 032c7bfca181726abb314a49058e69ce133dae30 Mon Sep 17 00:00:00 2001 From: gy b Date: Fri, 13 Oct 2023 19:24:52 +0800 Subject: [PATCH 114/123] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseApplicationServiceImpl.java | 624 +++++++++--------- 1 file changed, 321 insertions(+), 303 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index f71b323..189787e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -3,6 +3,9 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; + + + import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; @@ -10,28 +13,37 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDept; + import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.file.SaaSAPIFileUtils; + + + +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.bean.BeanUtils; -import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.system.mapper.SysDeptMapper; -import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; -import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.wisdomarbitrate.utils.SignAward; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.io.File; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; @@ -53,20 +65,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private ArbitratorMapper arbitratorMapper; @Autowired private ArbitrateRecordMapper arbitrateRecordMapper; - + @Autowired + private ICaseApplicationService caseApplicationService; @Autowired private CaseAttachMapper caseAttachMapper; @Autowired private SysDeptMapper sysDeptMapper; @Autowired - private ICaseApplicationService caseApplicationService; - @Autowired private SysUserMapper sysUserMapper; @Autowired private SealSignRecordMapper sealSignRecordMapper; - // 手机号正则 - private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); + private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); + @Override @@ -91,18 +102,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = caseApplicationMapper.insertCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); - Map deptMap = new HashMap<>(); + Map deptMap =new HashMap<>(); if (caseAffiliates != null && caseAffiliates.size() > 0) { - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - if (CollectionUtil.isEmpty(deptList)) { - deptList = new ArrayList<>(); - } - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); + // 查询所有的组织机构,组装成map + List deptList = sysDeptMapper.selectDeptList(new SysDept()); + if (CollectionUtil.isEmpty(deptList)) { + deptList = new ArrayList<>(); + } + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); for (CaseAffiliate caseAffiliate : caseAffiliates) { caseAffiliate.setCaseAppliId(caseApplication.getId()); - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { + if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); @@ -136,25 +147,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_APPLICATION,""); return rows; } /** * 获取自动编码 - * * @return */ private String generateCaseNum() { // 自动编码格式 zc+yyyyMMdd+001 String currentDay = DateUtils.dateTime(); - String caseNum = "zc" + currentDay; + String caseNum = "zc"+ currentDay; //查询出当天的案件编号的最大值 - Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length()); - if (null == maxCaseNum) { + Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length()); + if(null == maxCaseNum){ caseNum = caseNum + "001"; - } else { + }else { caseNum = caseNum + String.format("%03d", maxCaseNum); } return caseNum; @@ -172,21 +182,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); caseApplication.setFeePayable(feePayable); int rows = caseApplicationMapper.updataCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { + if(caseAffiliates!=null&&caseAffiliates.size()>0){ // 查询所有的组织机构,组装成map List deptList = sysDeptMapper.selectDeptList(new SysDept()); if (CollectionUtil.isEmpty(deptList)) { deptList = new ArrayList<>(); } - Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); - for (CaseAffiliate caseAffiliate : caseAffiliates) { + Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); + for (CaseAffiliate caseAffiliate : caseAffiliates){ caseAffiliate.setCaseAppliId(caseApplication.getId()); - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { + if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); @@ -212,8 +222,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } List caseAttachList = caseApplication.getCaseAttachList(); - if (caseAttachList != null && caseAttachList.size() > 0) { - for (CaseAttach caseAttach : caseAttachList) { + if(caseAttachList!=null&&caseAttachList.size()>0){ + for (CaseAttach caseAttach : caseAttachList){ caseAttach.setCaseAppliId(caseApplication.getId()); caseAttachMapper.updateCaseAttach(caseAttach); } @@ -230,7 +240,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CHECK); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CHECK, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_CHECK,""); return rows; } @@ -266,8 +276,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String annexPath = "/uploadPath" + annexName.substring(startIndex); caseAttach.setAnnexPath(annexPath); int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); + if(startIndexnew!=-1){ + String annexNamenew = annexName.substring(startIndexnew+1); caseAttach.setAnnexName(annexNamenew); } @@ -277,27 +287,27 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationselect.setCaseAttachList(caseAttachList); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { + if(caseAffiliatListeselect!=null){ // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(sysDepts)) { + Map deptMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(sysDepts)){ for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); + deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); } } StringBuffer applicantName = new StringBuffer(); StringBuffer respondentName = new StringBuffer(); - for (int i = 0; i < caseAffiliatListeselect.size(); i++) { + for (int i = 0; i < caseAffiliatListeselect.size(); i++){ CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { - if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { + if(identityType==1){ + if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - applicantName.append(caseAffiliateselect.getName()).append(","); - } else if (identityType == 2) { - respondentName.append(caseAffiliateselect.getName()).append(","); + applicantName.append(caseAffiliateselect.getName()).append(",");; + }else if(identityType==2){ + respondentName.append(caseAffiliateselect.getName()).append(",");; } } caseApplicationselect.setApplicantName(applicantName.toString()); @@ -310,26 +320,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional - public String importCaseApplication(List caseApplicationList, String operName) { + public String importCaseApplication(List caseApplicationList, String operName) { StringBuilder failureMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder(); int successNum = 0; int failureNum = 0; - if (caseApplicationList != null && caseApplicationList.size() > 0) { + if(caseApplicationList!=null&&caseApplicationList.size()>0){ // 1,查询所有的组织机构,组装成map List deptList = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(deptList)) { - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); + Map deptMap =new HashMap<>(); + if(CollectionUtil.isNotEmpty(deptList)) { + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); } List caseApplicationListinsert = new ArrayList<>(); - for (int i = 0; i < caseApplicationList.size(); i++) { + for (int i = 0; i < caseApplicationList.size(); i++){ CaseApplication caseApplication = caseApplicationList.get(i); // 导入校验 importValid(caseApplication); // 校验成功的数据 - if (StrUtil.isEmpty(caseApplication.getErrorMsg())) { + if(StrUtil.isEmpty(caseApplication.getErrorMsg())) { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal(0.01); @@ -349,12 +359,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // caseApplicationListinsert.add(caseApplication); // } caseApplicationListinsert.add(caseApplication); - } else { + }else { // 拼接错误信息 - failureMsg.append("
").append("第").append(i + 2).append("行:").append(caseApplication.getErrorMsg().toString()); + failureMsg.append("
").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString()); } } - if (caseApplicationListinsert != null && caseApplicationListinsert.size() > 0) { + if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ // List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( // collectingAndThen( // toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))), @@ -363,45 +373,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 // if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ - List caseApplicationNewList = null; - for (int i = 0; i < caseApplicationListinsert.size(); i++) { - caseApplicationNewList = new ArrayList<>(); - CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); - // 设置自动编码 - caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); - List caseAffiliatesnew = new ArrayList<>(); - CaseApplication caseApplicationNew = new CaseApplication(); - copyCaseApplication(caseApplicationinsertDiffer, caseApplicationNew); - if (caseApplicationListinsert != null && caseApplicationListinsert.size() > 0) { - for (int j = 0; j < caseApplicationListinsert.size(); j++) { - CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); + List caseApplicationNewList = null; + for (int i = 0; i < caseApplicationListinsert.size(); i++){ + caseApplicationNewList = new ArrayList<>(); + CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); + // 设置自动编码 + caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); + List caseAffiliatesnew = new ArrayList<>(); + CaseApplication caseApplicationNew = new CaseApplication(); + copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew); + if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ + for (int j = 0; j < caseApplicationListinsert.size(); j++){ + CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); - if (StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum()) && - caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())) { + if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&& + caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){ - caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); + caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); + } } + caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); + caseApplicationNewList.add(caseApplicationNew); } - caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); - caseApplicationNewList.add(caseApplicationNew); - } - for (int k = 0; k < caseApplicationNewList.size(); k++) { - CaseApplication caseApplicationItera = caseApplicationNewList.get(k); - // 新增立案信息 - caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + for (int k = 0; k < caseApplicationNewList.size(); k++){ + CaseApplication caseApplicationItera = caseApplicationNewList.get(k); + // 新增立案信息 + caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); - List caseAffiliates = caseApplicationItera.getCaseAffiliates(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate caseAffiliate : caseAffiliates) { - caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); + int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); + List caseAffiliates = caseApplicationItera.getCaseAffiliates(); + if(caseAffiliates!=null&&caseAffiliates.size()>0){ + for (CaseAffiliate caseAffiliate : caseAffiliates){ + caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); + } + caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); } - caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); + successNum++; + successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); } - successNum++; - successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); - } // } @@ -409,239 +419,233 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - } else { + }else { throw new ServiceException("导入立案申请数据不能为空!"); } - return successMsg.append(failureMsg.toString()).toString(); + return successMsg.append(failureMsg.toString()).toString(); } /** * 导入校验 - * * @param caseApplication * @param */ private void importValid(CaseApplication caseApplication) { - StringBuilder failureMsg = new StringBuilder(); + StringBuilder failureMsg=new StringBuilder(); caseApplication.setErrorMsg(failureMsg); // 校验基本字段 - validBaseColumn(caseApplication, failureMsg); + validBaseColumn(caseApplication,failureMsg); // 校验申请人信息 - validApplicationColumn(caseApplication, failureMsg); + validApplicationColumn(caseApplication,failureMsg); // 校验申请人代理信息 - validApplicationAgentColumn(caseApplication, failureMsg); + validApplicationAgentColumn(caseApplication,failureMsg); // 校验被申请人信息 - validDebtorApplicationColumn(caseApplication, failureMsg); + validDebtorApplicationColumn(caseApplication,failureMsg); // 校验被申请人代理信息 - validDebtorApplicationAgentColumn(caseApplication, failureMsg); + validDebtorApplicationAgentColumn(caseApplication,failureMsg); } /** * 校验被申请人代理信息 - * * @param caseApplication * @param failureMsg */ private void validDebtorApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getDebtorNameAgent())) { + if( StrUtil.isEmpty(caseApplication.getDebtorNameAgent())){ failureMsg.append("【被申请人主体信息-代理人姓名】字段不能为空;"); - } else if (caseApplication.getDebtorNameAgent().length() > 50) { + }else if(caseApplication.getDebtorNameAgent().length()>50){ failureMsg.append("【被申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) { + if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())){ failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;"); - } else if (caseApplication.getDebtorIdentityNumAgent().length() > 50) { + }else if(caseApplication.getDebtorIdentityNumAgent().length()>50){ failureMsg.append("【被申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;"); } String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent(); - if (StrUtil.isEmpty(debtorContactTelphoneAgent)) { + if( StrUtil.isEmpty(debtorContactTelphoneAgent)){ failureMsg.append("【被申请人主体信息-代理人联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()) { + }else if(!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()){ failureMsg.append("【被申请人主体信息-代理人联系电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())) { + if( StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())){ failureMsg.append("【被申请人主体信息-代理人联系地址】字段不能为空;"); - } else if (caseApplication.getDebtorContactAddressAgent().length() > 50) { + }else if(caseApplication.getDebtorContactAddressAgent().length()>50){ failureMsg.append("【被申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); } } /** * 校验被申请人信息 - * * @param caseApplication * @param failureMsg */ private void validDebtorApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getDebtorName())) { + if( StrUtil.isEmpty(caseApplication.getDebtorName())){ failureMsg.append("【被申请人主体信息-申请人姓名】字段不能为空;"); - } else if (caseApplication.getDebtorName().length() > 50) { + }else if(caseApplication.getDebtorName().length()>50){ failureMsg.append("【被申请人主体信息-申请人姓名】字段超出指定长度,最大长度为50;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) { + if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())){ failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;"); - } else if (caseApplication.getDebtorIdentityNum().length() > 50) { + }else if(caseApplication.getDebtorIdentityNum().length()>50){ failureMsg.append("【被申请人主体信息-身份证号】字段超出指定长度,最大长度为50;"); } String debtorContactTelphone = caseApplication.getDebtorContactTelphone(); - if (StrUtil.isEmpty(debtorContactTelphone)) { + if( StrUtil.isEmpty(debtorContactTelphone)){ failureMsg.append("【被申请人主体信息-联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()) { + }else if(!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()){ failureMsg.append("【被申请人主体信息-联系电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorContactAddress())) { + if( StrUtil.isEmpty(caseApplication.getDebtorContactAddress())){ failureMsg.append("【被申请人主体信息-联系地址】字段不能为空;"); - } else if (caseApplication.getDebtorContactAddress().length() > 50) { + }else if(caseApplication.getDebtorContactAddress().length()>50){ failureMsg.append("【被申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); } String debtorWorkTelphone = caseApplication.getDebtorWorkTelphone(); - if (StrUtil.isEmpty(debtorWorkTelphone)) { + if( StrUtil.isEmpty(debtorWorkTelphone)){ failureMsg.append("【被申请人主体信息-单位电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()) { + }else if(!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()){ failureMsg.append("【被申请人主体信息-单位电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())) { + if( StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())){ failureMsg.append("【被申请人主体信息-单位地址】字段不能为空;"); - } else if (caseApplication.getDebtorWorkAddress().length() > 50) { + }else if(caseApplication.getDebtorWorkAddress().length()>50){ failureMsg.append("【被申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); } } /** * 校验申请人代理信息 - * * @param caseApplication * @param failureMsg */ private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getNameAgent())) { + if( StrUtil.isEmpty(caseApplication.getNameAgent())){ failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;"); - } else if (caseApplication.getNameAgent().length() > 50) { + }else if(caseApplication.getNameAgent().length()>50){ failureMsg.append("【申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); } - if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) { + if( StrUtil.isEmpty(caseApplication.getIdentityNumAgent())){ failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;"); - } else if (caseApplication.getIdentityNumAgent().length() > 50) { + }else if(caseApplication.getIdentityNumAgent().length()>50){ failureMsg.append("【申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;"); } String contactTelphoneAgent = caseApplication.getContactTelphoneAgent(); - if (StrUtil.isEmpty(contactTelphoneAgent)) { + if( StrUtil.isEmpty(contactTelphoneAgent)){ failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()) { + }else if(!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()){ failureMsg.append("【申请人主体信息-代理人联系电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getContactAddressAgent())) { + if( StrUtil.isEmpty(caseApplication.getContactAddressAgent())){ failureMsg.append("【申请人主体信息-代理人联系地址】字段不能为空;"); - } else if (caseApplication.getContactAddressAgent().length() > 50) { + }else if(caseApplication.getContactAddressAgent().length()>50){ failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); } } /** * 校验申请人主题信息 - * * @param caseApplication * @param failureMsg */ private void validApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getName())) { + if( StrUtil.isEmpty(caseApplication.getName())){ failureMsg.append("【申请人主体信息-申请人(机构)】字段不能为空;"); - } else if (caseApplication.getName().length() > 20) { + }else if(caseApplication.getName().length()>20){ failureMsg.append("【申请人主体信息-申请人(机构)】字段超出指定长度,最大长度为20;"); } - if (StrUtil.isNotEmpty(caseApplication.getIdentityNum()) && caseApplication.getIdentityNum().length() > 50) { + if( StrUtil.isNotEmpty(caseApplication.getIdentityNum())&&caseApplication.getIdentityNum().length()>50){ failureMsg.append("【申请人主体信息-代码】字段超出指定长度,最大长度为50;"); } String contactTelphone = caseApplication.getContactTelphone(); - if (StrUtil.isEmpty(contactTelphone)) { + if( StrUtil.isEmpty(contactTelphone)){ failureMsg.append("【申请人主体信息-联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(contactTelphone).matches()) { + }else if(!TELEPHONE_REGX.matcher(contactTelphone).matches()){ failureMsg.append("【申请人主体信息-联系电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getContactAddress())) { + if( StrUtil.isEmpty(caseApplication.getContactAddress())){ failureMsg.append("【申请人主体信息-联系地址】字段不能为空;"); - } else if (caseApplication.getName().length() > 50) { + }else if(caseApplication.getName().length()>50){ failureMsg.append("【申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); } String workTelphone = caseApplication.getWorkTelphone(); - if (StrUtil.isEmpty(workTelphone)) { + if( StrUtil.isEmpty(workTelphone)){ failureMsg.append("【申请人主体信息-单位电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(workTelphone).matches()) { + }else if(!TELEPHONE_REGX.matcher(workTelphone).matches()){ failureMsg.append("【申请人主体信息-单位电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getWorkAddress())) { + if( StrUtil.isEmpty(caseApplication.getWorkAddress())){ failureMsg.append("【申请人主体信息-单位地址】字段不能为空;"); - } else if (caseApplication.getWorkAddress().length() > 50) { + }else if(caseApplication.getWorkAddress().length()>50){ failureMsg.append("【申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); } } /** * 校验基本字段 - * * @param caseApplication * @param failureMsg */ private void validBaseColumn(CaseApplication caseApplication, StringBuilder failureMsg) { BigDecimal caseSubjectAmount = caseApplication.getCaseSubjectAmount(); - if (null == caseSubjectAmount) { + if(null== caseSubjectAmount){ failureMsg.append("【案件标的】字段不合法;"); - } else { - if (caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 || caseSubjectAmount.compareTo(new BigDecimal("99999999.99")) > 0) { + }else { + if(caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 ||caseSubjectAmount.compareTo(new BigDecimal("99999999.99"))>0){ failureMsg.append("【案件标的】字段超出范围,范围为[0,100000000);"); } - if (caseSubjectAmount.scale() > 2) { + if(caseSubjectAmount.scale()>2){ failureMsg.append("【案件标的】字段超出指定精度(10^-2);"); } } - if (caseApplication.getLoanStartDate() == null) { + if( caseApplication.getLoanStartDate()== null){ failureMsg.append("【借款开始日期】字段不合法;"); } - if (caseApplication.getLoanEndDate() == null) { + if( caseApplication.getLoanEndDate()== null){ failureMsg.append("【借款结束日期】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getContractNumber())) { + if( StrUtil.isEmpty(caseApplication.getContractNumber())){ failureMsg.append("【合同编号】字段不能为空;"); - } else if (caseApplication.getContractNumber().length() > 50) { + }else if(caseApplication.getContractNumber().length()>50){ failureMsg.append("【合同编号】字段超出指定长度,最大长度为50;"); } BigDecimal claimPrinciOwed = caseApplication.getClaimPrinciOwed(); - if (null == claimPrinciOwed) { + if(null== claimPrinciOwed){ failureMsg.append("【申请人主张欠本金】字段不合法;"); - } else { - if (claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 || claimPrinciOwed.compareTo(new BigDecimal("99999999.99")) > 0) { + }else { + if(claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 ||claimPrinciOwed.compareTo(new BigDecimal("99999999.99"))>0){ failureMsg.append("【申请人主张欠本金】字段超出范围,范围为[0,100000000);"); } - if (claimPrinciOwed.scale() > 2) { + if(claimPrinciOwed.scale()>2){ failureMsg.append("【申请人主张欠本金】字段超出指定精度(10^-2);"); } } BigDecimal claimInterestOwed = caseApplication.getClaimInterestOwed(); - if (null == claimInterestOwed) { + if(null== claimInterestOwed){ failureMsg.append("【申请人主张欠利息】字段不合法;"); - } else { - if (claimInterestOwed.compareTo(new BigDecimal("0")) < 0 || claimInterestOwed.compareTo(new BigDecimal("99999999.99")) > 0) { + }else { + if(claimInterestOwed.compareTo(new BigDecimal("0")) < 0 ||claimInterestOwed.compareTo(new BigDecimal("99999999.99"))>0){ failureMsg.append("【申请人主张欠利息】字段超出范围,范围为[0,100000000);"); } - if (claimInterestOwed.scale() > 2) { + if(claimInterestOwed.scale()>2){ failureMsg.append("【申请人主张欠利息】字段超出指定精度(10^-2);"); } } BigDecimal claimLiquidDamag = caseApplication.getClaimLiquidDamag(); - if (null == claimLiquidDamag) { + if(null== claimLiquidDamag){ failureMsg.append("【申请人主张违约金】字段不合法;"); - } else { - if (claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 || claimLiquidDamag.compareTo(new BigDecimal("99999999.99")) > 0) { + }else { + if(claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 ||claimLiquidDamag.compareTo(new BigDecimal("99999999.99"))>0){ failureMsg.append("【申请人主张违约金】字段超出范围,范围为[0,100000000);"); } - if (claimLiquidDamag.scale() > 2) { + if(claimLiquidDamag.scale()>2){ failureMsg.append("【申请人主张违约金】字段超出指定精度(10^-2);"); } } - if (StrUtil.isEmpty(caseApplication.getArbitratClaims())) { + if( StrUtil.isEmpty(caseApplication.getArbitratClaims())){ failureMsg.append("【申请人仲裁诉求】字段不能为空;"); - } else if (caseApplication.getArbitratClaims().length() > 10000) { + }else if(caseApplication.getArbitratClaims().length()>10000){ failureMsg.append("【申请人仲裁诉求】字段超出指定长度,最大长度为10000;"); } } @@ -652,7 +656,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public int pendTral(CaseApplication caseApplication) { List arbitrators = caseApplication.getArbitrators(); int rows = 0; - if (arbitrators != null && arbitrators.size() > 0) { + if(arbitrators!=null&&arbitrators.size()>0){ List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -674,12 +678,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); int rows = 0; //同意组庭 - if (isAgreePendTral != null && isAgreePendTral == 1) { + if(isAgreePendTral!=null&&isAgreePendTral==1){ rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } else { + }else { List arbitrators = caseApplication.getArbitrators(); // 仲裁员信息 - if (arbitrators != null && arbitrators.size() > 0) { + if(arbitrators!=null&&arbitrators.size()>0){ List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -690,7 +694,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL,""); return rows; } @@ -702,7 +706,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION,""); return rows; } @@ -714,7 +718,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if (agreeOrNotCheck.intValue() == 1) {//同意审核 + if(agreeOrNotCheck.intValue()==1){//同意审核 try { //获取当前案件的裁决书 CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); @@ -724,25 +728,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (caseAttach.getAnnexType() == 3) { String annexPath = caseAttach.getAnnexPath(); String path = "/home/ruoyi/" + annexPath; -// String path ="D:\\home\\仲裁裁决书模板.docx"; + System.out.println("这是查询到的裁决书路径"+path); + //String path ="D:\\home\\仲裁裁决书模板.docx"; //获取文件上传地址 EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); String body = response.getBody(); - if (body != null) { + if (body != null){ JSONObject jsonObject = JSONObject.parseObject(body); String fileId = jsonObject.getJSONObject("data").getString("fileId"); String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl"); //上传文件流 EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path); JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody()); - if (jsonObject1.getIntValue("errCode") == 0) { + if (jsonObject1.getIntValue("errCode")==0){ //查看文件上传状态 Thread.sleep(5000); EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId); JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody()); JSONObject data = jsonObject2.getJSONObject("data"); - int fileStatus = data.getIntValue("fileStatus"); - if (fileStatus == 2 || fileStatus == 5) { + int fileStatus =data.getIntValue("fileStatus"); + if (fileStatus == 2 || fileStatus == 5){ String fileName = data.getString("fileName"); //上传成功,获取文件签名印章位置 SealSignRecord sealSignRecord = new SealSignRecord(); @@ -751,21 +756,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Gson gson = new Gson(); JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class); JsonObject positionsData = positionsJsonObject.getAsJsonObject("data"); - String keywordPositions = positionsData.get("keywordPositions").getAsString(); + String keywordPositions = positionsData.get("keywordPositions").toString(); //发起签署 sealSignRecord.setFilename(fileName); String arbitratorId = caseApplication2.getArbitratorId(); - if (arbitratorId != null) { + if (arbitratorId!=null){ SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); - if (sysUser == null) { + if (sysUser == null){ return rows; } sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); sealSignRecord.setPensonName(sysUser.getNickName()); } sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); - sealSignRecord.setOrgnizeNamePsnAccount("秦桃则"); - sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); sealSignRecord.setOrgnizeNamePsnAccount("17691338406"); sealSignRecord.setOrgnizeNamepsnName("韩超勃"); //解析文件签名印章位置 @@ -773,11 +776,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject3 = jsonArray.getJSONObject(i); String keyword = jsonObject3.getString("keyword"); - if (keyword.equals("仲裁员")) { + if (keyword.equals("仲裁员:")){ //签名 JSONArray positionsArray = jsonObject3.getJSONArray("positions"); // 遍历 positionsArray 中的每个元素 - for (int j = 0; j < positionsArray.size(); j++) { + for (int j = 0; j < positionsArray.size(); j++){ JSONObject positionObj = positionsArray.getJSONObject(j); int pageNum = positionObj.getIntValue("pageNum"); sealSignRecord.setPositionPagepsn(String.valueOf(pageNum)); @@ -788,7 +791,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sealSignRecord.setPositionXpsn(positionX); sealSignRecord.setPositionYpsn(positionY); } - } else { + }else { //用印 JSONArray positionsArray = jsonObject3.getJSONArray("positions"); // 遍历 positionsArray 中的每个元素 @@ -807,7 +810,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord); JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); - if (jsonObject1.getIntValue("code") == 0) { + if (jsonObject3.getIntValue("code")==0){ //获取签署流程ID JSONObject data1 = jsonObject3.getJSONObject("data"); String signFlowId = data1.getString("signFlowId"); @@ -816,6 +819,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sealSignRecord.setSignFlowid(signFlowId); sealSignRecord.setSignFlowStatus(1);//待签名 sealSignRecordMapper.insertSealSignRecord(sealSignRecord); + }else { + throw new ServiceException("发起签署流程失败,请检查参数是否有误"); } } } @@ -831,12 +836,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,""); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 + }else if(agreeOrNotCheck.intValue()==2){//拒绝审核 caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.VERPRIF_ARBITRATION,""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } @@ -850,15 +856,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //提交立案审查 int rows = 0; Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if (agreeOrNotCheck.intValue() == 1) {//同意审核 + if(agreeOrNotCheck.intValue()==1){//同意审核 caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 + }else if(agreeOrNotCheck.intValue()==2){//拒绝审核 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_PAYMENT,""); return rows; } @@ -866,31 +872,30 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplicationConfirm(caseApplication); - if (caseApplicationselect == null) { + if(caseApplicationselect==null){ return caseApplicationselect; } CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { + if(caseAffiliatListeselect!=null){ // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(sysDepts)) { + Map deptMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(sysDepts)){ for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); + deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); } } StringBuffer applicantName = new StringBuffer(); - for (int i = 0; i < caseAffiliatListeselect.size(); i++) { + for (int i = 0; i < caseAffiliatListeselect.size(); i++){ CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { - if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { + if(identityType==1){ + if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - applicantName.append(caseAffiliateselect.getName()).append(","); - ; + applicantName.append(caseAffiliateselect.getName()).append(",");; } } caseApplicationselect.setApplicantName(applicantName.toString()); @@ -902,14 +907,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 给被申请人发送房间号短信 - * * @param messageVO * @return */ @Override public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) { CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(messageVO.getId(), 2); - if (null == caseAffiliate) { + if(null==caseAffiliate){ return "被申请人不存在"; } CaseApplication caseApplication = new CaseApplication(); @@ -918,7 +922,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1948332"); + request.setTemplateId("1952136"); // 1948332 普通短信 开庭审理房间号通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请知晓,如非本人操作,请忽略本短信。 request.setPhone(caseAffiliate.getContactTelphone()); request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()}); @@ -934,7 +938,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Gson gson = new Gson(); List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); SealSignRecord sealSignRecordReslt = new SealSignRecord(); - if (sealSignRecords != null && sealSignRecords.size() > 0) { + if(sealSignRecords!=null&&sealSignRecords.size()>0){ SealSignRecord sealSignRecordselect = sealSignRecords.get(0); EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecordselect); JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); @@ -953,7 +957,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Gson gson = new Gson(); List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); SealSignRecord sealSignRecordReslt = new SealSignRecord(); - if (sealSignRecords != null && sealSignRecords.size() > 0) { + if(sealSignRecords!=null&&sealSignRecords.size()>0){ SealSignRecord sealSignRecordselect = sealSignRecords.get(0); EsignHttpResponse signUrl = SignAward.usesealUrl(sealSignRecordselect); JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); @@ -982,50 +986,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String arbitratorId = caseApplicationselect.getArbitratorId(); // List arbitratorList = new ArrayList<>(); - if (StringUtils.isNotEmpty(arbitratorId)) { - String[] idStrList = arbitratorId.split(","); + if(StringUtils.isNotEmpty(arbitratorId)){ + String[] idStrList = arbitratorId.split(","); List idList = new ArrayList<>(); - for (int i = 0; i < idStrList.length; i++) { + for(int i = 0;i < idStrList.length;i ++ ){ idList.add(Long.parseLong(idStrList[i])); } -// - - // 查询仲裁员电话号 - List userList = sysUserMapper.selectUserListByIds(idList); - if (CollectionUtil.isNotEmpty(userList)) { - for (SysUser user : userList) { - - - //给仲裁员发送短信通知 - request.setPhone(user.getPhonenumber()); - // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = user.getNickName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - SmsUtils.sendSms(request); - - } - } + // 查询仲裁员电话号 + List userList= sysUserMapper.selectUserListByIds(idList); + if(CollectionUtil.isNotEmpty(userList)) { + for (SysUser user : userList) { + //给仲裁员发送短信通知 + request.setPhone(user.getPhonenumber()); + // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 + String name = user.getNickName(); + request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + SmsUtils.sendSms(request); + } + } } CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { + if(caseAffiliatListeselect!=null) { // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(sysDepts)) { + Map deptMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(sysDepts)){ for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); + deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); } } for (int j = 0; j < caseAffiliatListeselect.size(); j++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { - if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { + if(identityType==1){ + if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } @@ -1039,21 +1038,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION_METHOD,""); return rows; } + @Override @Transactional public int pendingAppointArbotrar(CaseApplication caseApplication) { int pendingAppointArbotrar = caseApplication.getPendingAppointArbotrar(); List arbitrators = caseApplication.getArbitrators(); int rows = 0; - if (pendingAppointArbotrar == 1) { - if (arbitrators != null && arbitrators.size() > 0) { + if(pendingAppointArbotrar==1){ + if(arbitrators!=null&&arbitrators.size()>0){ List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -1065,7 +1065,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); } - } else { + }else { caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); caseApplication.setPendingAppointArbotrar(2); rows = caseApplicationMapper.submitCaseApplication(caseApplication); @@ -1077,59 +1077,59 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } + private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew, Map deptMap) { - // 申请人信息 + // 申请人信息 CaseAffiliate caseAffiliate = new CaseAffiliate(); // BeanUtils.copyBeanProp(caseApplication,caseAffiliate); - BeanUtils.copyBeanProp(caseAffiliate, caseApplication); + BeanUtils.copyBeanProp(caseAffiliate,caseApplication); caseAffiliate.setIdentityType(1); // 申请人(机构),需要判断部门中是否存在,不存在则新增,当身份类型为1的时候,查询时需要根据名称查询组织机构 - if (StrUtil.isNotEmpty(caseApplication.getName())) { + if(StrUtil.isNotEmpty(caseApplication.getName())){ setApplicantOrganization(caseAffiliate, caseApplication, deptMap); } caseAffiliatesnew.add(caseAffiliate); // 组装被申请人信息 - caseAffiliatesnew.add(buildDebtorInfo(caseApplication)); + caseAffiliatesnew.add( buildDebtorInfo(caseApplication)); caseApplication.setCaseAffiliates(caseAffiliatesnew); } /** * 设置申请人的组织机构 - * * @param caseAffiliate * @param caseApplication */ @DataScope(deptAlias = "d") - private void setApplicantOrganization(CaseAffiliate caseAffiliate, CaseApplication caseApplication, Map deptMap) { + private void setApplicantOrganization(CaseAffiliate caseAffiliate, CaseApplication caseApplication, Map deptMap ) { - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseApplication.getName())) { - caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseApplication.getName()); - dept.setAncestors("0"); - dept.setOrderNum(1); - dept.setStatus("0"); - dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); - sysDeptMapper.insertDept(dept); - deptMap.put(dept.getDeptName(), dept.getDeptId()); - caseAffiliate.setName(String.valueOf(dept.getDeptId())); - } + // 将组织机构id设为申请人名称 + if(deptMap.containsKey(caseApplication.getName())){ + caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); + }else { + // 如果不存在则新增 + SysDept dept = new SysDept(); + dept.setParentId(0L); + dept.setDeptName(caseApplication.getName()); + dept.setAncestors("0"); + dept.setOrderNum(1); + dept.setStatus("0"); + dept.setDelFlag("0"); + dept.setCreateBy(getUsername()); + dept.setUpdateBy(getUsername()); + sysDeptMapper.insertDept(dept); + deptMap.put(dept.getDeptName(),dept.getDeptId()); + caseAffiliate.setName(String.valueOf(dept.getDeptId())); + + } } /** * 组装被申请人信息 - * * @param caseApplication * @return */ @@ -1165,61 +1165,79 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable()); } - @Transactional - public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { - - Gson gson = new Gson(); +// @Transactional +// public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { +// +// Gson gson = new Gson(); +// +// SealSignRecord sealSignRecordselect = new SealSignRecord(); +// sealSignRecordselect.setSignFlowStatus(1); +// +// List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecordselect); +// if(sealSignRecords!=null&&sealSignRecords.size()>0){ +// for (int i = 0; i < sealSignRecords.size(); i++) { +// SealSignRecord sealSignRecord = sealSignRecords.get(i); +// EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); +// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); +// JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); +// JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); +// for (int j = 0; j < signersArray.size(); j++) { +// JsonObject signerObject = (JsonObject)signersArray.get(j); +// Integer psnsignStatus ; +// Integer orgsignStatus ; +// if(!(signerObject.get("psnSigner").toString()).equals("null")){ +// JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); +// if(psnSignerData!=null){ +// psnsignStatus = signerObject.get("signStatus").getAsInt(); +// sealSignRecord.setPsnsignStatus(psnsignStatus); +// +// if(psnsignStatus.intValue()==2){ +// //更新立案申请状态为待用印 +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); +// caseApplicationMapper.submitCaseApplication(caseApplication); +// +// //修改"签署用印记录表"的状态为待用印 +// sealSignRecord.setSignFlowStatus(2); +// sealSignRecordMapper.updataSealSignRecord(sealSignRecord); +// +// } +// } +// } +// if(!(signerObject.get("orgSigner").toString()).equals("null")){ +// JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); +// if(orgSignerData!=null){ +// orgsignStatus = signerObject.get("signStatus").getAsInt(); +// sealSignRecord.setOrgsignStatus(orgsignStatus); +// //更新立案申请状态为待送达 +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); +// caseApplicationMapper.submitCaseApplication(caseApplication); +// +// //修改"签署用印记录表"的状态为签署完成 +// sealSignRecord.setSignFlowStatus(3); +// sealSignRecordMapper.updataSealSignRecord(sealSignRecord); +// +// //下载审核完成的裁决书, +//// SaaSAPIFileUtils.fileDownloadUrl(); +// +// } +// +// } +// +// } +// +// } +// +// } - SealSignRecord sealSignRecord = new SealSignRecord(); - sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d"); - EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); - JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class); - JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); - JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); - for (int i = 0; i < signersArray.size(); i++) { - JsonObject signerObject = (JsonObject) signersArray.get(i); - Integer psnsignStatus; - Integer orgsignStatus; - if (!(signerObject.get("psnSigner").toString()).equals("null")) { - JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); - if (psnSignerData != null) { - psnsignStatus = signerObject.get("signStatus").getAsInt(); - sealSignRecord.setPsnsignStatus(psnsignStatus); - if (psnsignStatus.intValue() == 2) { - //更新立案申请状态为待用印 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplicationMapper.submitCaseApplication(caseApplication); +// } - //修改"签署用印记录表"的状态为待用印 - } - } - } - if (!(signerObject.get("orgSigner").toString()).equals("null")) { - JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); - if (orgSignerData != null) { - orgsignStatus = signerObject.get("signStatus").getAsInt(); - sealSignRecord.setOrgsignStatus(orgsignStatus); - //更新立案申请状态为待送达 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); - caseApplicationMapper.submitCaseApplication(caseApplication); - //修改"签署用印记录表"的状态为签署完成 - //下载审核完成的裁决书, -// SaaSAPIFileUtils.fileDownloadUrl(); - - } - - } - - } - - } } From 6b56829d92c520a04aedd9f29efc733d043a04cf Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Sun, 15 Oct 2023 10:16:48 +0800 Subject: [PATCH 115/123] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=BA=AD=E5=AE=A1=E7=AC=94=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 12 ++ .../common/utils/file/SaaSAPIFileUtils.java | 37 +++- .../domain/CaseApplication.java | 10 + .../mapper/CaseAttachMapper.java | 4 + .../service/ICaseApplicationService.java | 4 + .../service/impl/AdjudicationServiceImpl.java | 9 +- .../impl/CaseApplicationServiceImpl.java | 174 ++++++++++++++++++ .../utils/FixSelectFlowDetailUtils.java | 16 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 4 +- .../wisdomarbitrate/CaseAttachMapper.xml | 16 ++ 10 files changed, 276 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 5bc1f92..986a35b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -8,6 +8,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.utils.WxAppletNotifyUtils; +import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; @@ -243,4 +244,15 @@ public class CaseApplicationController extends BaseController { return success(schemeUrl); } + /** + * 生成庭审笔录 + * @param arbitrateRecord + * @return + */ + @PostMapping("/creatTrialRecord") + @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')") + public AjaxResult creatTrialRecord(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ + return caseApplicationService.creatTrialRecord(arbitrateRecord); + } + } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java index 40b2d28..155aad4 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java @@ -1,14 +1,20 @@ package com.ruoyi.common.utils.file; import cn.hutool.json.JSONObject; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; import com.ruoyi.common.config.EsignDemoConfig; import com.ruoyi.common.constant.EsignHeaderConstant; +import com.ruoyi.common.constant.FileTransformation; 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.EsignHttpHelper; import com.ruoyi.common.utils.bean.EsignFileBean; +import com.ruoyi.common.utils.uuid.IdUtils; +import java.time.LocalDate; import java.util.Map; public class SaaSAPIFileUtils { @@ -79,7 +85,7 @@ public class SaaSAPIFileUtils { return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true); } - public static void main(String[] args) throws EsignDemoException { + public static void main1(String[] args) throws EsignDemoException { String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx"; EsignHttpResponse uploadUrl = getUploadUrl(filePath); String body = uploadUrl.getBody(); @@ -96,5 +102,34 @@ public class SaaSAPIFileUtils { // System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody()); // getFileStatus("a808f1f39a744357a2f018e4ab34c55d"); // fileDownloadUrl(""); + } + public static void main(String[] args) throws EsignDemoException { + String signFlowId = "41e6732b48c54c63a91b2379c352212d"; + Gson gson = new Gson(); + EsignHttpResponse fileDownload = fileDownloadUrl(signFlowId); + JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class); + JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); + JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); + if(filesArray!=null&&filesArray.size()>0){ + JsonObject fileObject = (JsonObject)filesArray.get(0); + String fileDownloadUrl = fileObject.get("downloadUrl").toString(); + String fileName = java.util.UUID.randomUUID().toString().replace("-", "") + ".pdf"; + String savePath = "/home/ruoyi/uploadPath/upload"; + LocalDate now = LocalDate.now(); + String year = Integer.toString(now.getYear()); + String month = String.format("%02d", now.getMonthValue()); + String day = String.format("%02d", now.getDayOfMonth()); + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + String dir = "F:\\ymkf\\shanghaixm\\testCaijueshu\\" + fileName; + String fileDownloadUrlnew = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1); + FileTransformation.downLoadFileByUrl(fileDownloadUrlnew,dir); + + + } + + + + + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index ac77efe..b06aa28 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -101,6 +101,16 @@ public class CaseApplication extends BaseEntity { /** 案件描述 */ private String caseDescribe; + /** 裁决书URL */ + private String filearbitraUrl; + + public String getFilearbitraUrl() { + return filearbitraUrl; + } + + public void setFilearbitraUrl(String filearbitraUrl) { + this.filearbitraUrl = filearbitraUrl; + } /** 是否同意组庭 */ private Integer isAgreePendTral; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 0be609e..95498cd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import java.util.List; @@ -14,4 +15,7 @@ public interface CaseAttachMapper { int updateCaseAttach(CaseAttach caseAttach); + + int updateCaseAttachBycaseid(CaseAttach caseAttach); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 0a733e8..06094c9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -1,6 +1,8 @@ package com.ruoyi.wisdomarbitrate.service; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; @@ -46,4 +48,6 @@ public interface ICaseApplicationService { SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException; SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException; + + AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 248a06c..717a2e3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -56,6 +56,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { private ICaseLogRecordService caseLogRecordService; @Override + @Transactional public AjaxResult createDocument(CaseApplication caseApplication) { try { Map datas = new HashMap<>(); @@ -125,10 +126,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("year", year); datas.put("months", month); datas.put("day", day); - String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; - //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; - //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); +// String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; + String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; +// String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; + String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; String resultFilePath = saveFolderPath + "/" + fileName; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 189787e..b5bf0be 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -20,6 +20,7 @@ import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.WordUtil; import com.ruoyi.common.utils.file.SaaSAPIFileUtils; @@ -44,8 +45,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.io.File; +import java.io.IOException; import java.math.BigDecimal; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.ZoneId; import java.util.*; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -75,6 +82,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private SysUserMapper sysUserMapper; @Autowired private SealSignRecordMapper sealSignRecordMapper; + @Autowired + private CaseLogRecordMapper caseLogRecordMapper; // 手机号正则 private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); @@ -968,6 +977,171 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return sealSignRecordReslt; } + @Override + @Transactional + public AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecordselect) { + //生成仲裁结果 + CaseApplication caseApplicationselect = new CaseApplication(); + caseApplicationselect.setId(arbitrateRecordselect.getCaseAppliId()); + CaseApplication caseApplication = caseApplicationMapper.selectCaseApplication(caseApplicationselect); + String createBy = caseApplication.getCreateBy(); + if (createBy!=null){ + arbitrateRecordselect.setCreateBy(createBy); + } + //先判断案件是否已经提交过仲裁结果 + ArbitrateRecord arbitrateRecordsele = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordselect); + if (arbitrateRecordsele!=null){ + int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordselect); + if (i>0){ + //案件日志表里添加数据 + CaseLogRecord caseLogRecord = new CaseLogRecord(); + caseLogRecord.setCaseAppliId(caseApplication.getId()); + caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); + if (createBy!=null){ + caseLogRecord.setCreateBy(createBy); + } + caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); + + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,""); + + + } + }else { + //提交仲裁结果 + int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); + + if (i>0){ + //案件日志表里添加数据 + CaseLogRecord caseLogRecord = new CaseLogRecord(); + caseLogRecord.setCaseAppliId(caseApplication.getId()); + caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); + if (createBy!=null){ + caseLogRecord.setCreateBy(createBy); + } + caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); + + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,""); + + } + } + + //生成庭审笔录 + try { + Map datas = new HashMap<>(); + Long id = caseApplication.getId(); + if (id == null) { + return null; + } + + //获取仲裁记录表里的相关信息 + ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); + arbitrateRecord.setCaseAppliId(id); + ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); + + //获取案件关联人信息 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(id); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + if (caseAffiliates != null && caseAffiliates.size() > 0) { + for (CaseAffiliate affiliate : caseAffiliates) { + //获取身份类型 + int identityType = affiliate.getIdentityType(); + if (identityType == 1) { //申请人 + datas.put("appName", affiliate.getName()); + datas.put("appIDNo", affiliate.getIdentityNum()); + datas.put("appAddress", affiliate.getContactAddress()); + datas.put("appAgentName", affiliate.getNameAgent()); + datas.put("appAgentIDNo", affiliate.getIdentityNumAgent()); + } else if (identityType == 2) { //被申请人 + datas.put("resName", affiliate.getName()); + datas.put("resIDNo", affiliate.getIdentityNum()); + datas.put("resAddress", affiliate.getContactAddress()); + datas.put("resAgentName", affiliate.getNameAgent()); + datas.put("resAgentIDNo", affiliate.getIdentityNumAgent()); + } + } + } + String arbitratorName = caseApplication.getArbitratorName(); + datas.put("caseName", caseApplication.getCaseName()); + datas.put("arbitratorName", arbitratorName); + Date hearDate = caseApplication.getHearDate(); + if (hearDate != null) { + LocalDate localDate = hearDate.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDate(); + datas.put("hearYear", localDate.getYear()); + datas.put("hearMonths", localDate.getMonthValue()); + datas.put("hearDay", localDate.getDayOfMonth()); + } else { + datas.put("hearYear", null); + datas.put("hearMonths", null); + datas.put("hearDay", null); + } + datas.put("appArbitrationClaims", caseApplication.getArbitratClaims()); + if (arbitrateRecord1 != null) { + datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi()); + datas.put("factDetermi", arbitrateRecord1.getFactDetermi()); + datas.put("caseSketch", arbitrateRecord1.getCaseSketch()); + datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink()); + datas.put("rulingFollows", arbitrateRecord1.getRulingFollows()); + } + datas.put("legalProvisions", "仲裁法"); + LocalDate now = LocalDate.now(); + String year = Integer.toString(now.getYear()); + String month = String.format("%02d", now.getMonthValue()); + String day = String.format("%02d", now.getDayOfMonth()); + datas.put("year", year); + datas.put("months", month); + datas.put("day", day); + String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; +// String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; + String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; +// String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); + String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + String resultFilePath = saveFolderPath + "/" + fileName; + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } + Path sourcePath = new File(modalFilePath).toPath(); + Path destinationPath = new File(resultFilePath).toPath(); + Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); + String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); + String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); + +// String savePath = saveFolderPath; +// saveName = fileName; + + //将庭审笔录保存到附件表里 + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(id) + .annexName(saveName) + .annexPath(savePath) + .annexType(7) + .build(); + int i = caseAttachMapper.save(caseAttach); + if (i > 0) { + if (arbitrateRecord1 != null) { + Integer annexId = caseAttach.getAnnexId(); + //将附件id保存到仲裁记录表里面 + arbitrateRecord1.setAnnexId(annexId); + arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); + } + } + //获取案件详细信息 + CaseApplication caseApplicationSelct = caseApplicationMapper.selectCaseApplication(caseApplication); + return AjaxResult.success(caseApplicationSelct); + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("生成庭审笔录异常"); + } + + } + @Override @Transactional public int pendTralSure(CaseApplication caseApplication) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index e061f5c..8c1cef1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -4,18 +4,23 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.constant.FileTransformation; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.time.LocalDate; import java.util.List; +import java.util.UUID; @Component public class FixSelectFlowDetailUtils { @@ -24,8 +29,10 @@ public class FixSelectFlowDetailUtils { private CaseApplicationMapper caseApplicationMapper; @Autowired private SealSignRecordMapper sealSignRecordMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; - @Scheduled(cron = "0/3 * * * * ?") +// @Scheduled(cron = "0/3 * * * * ?") public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { Gson gson = new Gson(); @@ -83,8 +90,6 @@ public class FixSelectFlowDetailUtils { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL){ caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); - caseApplicationMapper.submitCaseApplication(caseApplication); - //下载审核完成的裁决书, String signFlowId = sealSignRecord.getSignFlowid(); EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); @@ -96,8 +101,11 @@ public class FixSelectFlowDetailUtils { String fileDownloadUrl = fileObject.get("downloadUrl").toString(); //修改"签署用印记录表"的状态为签署完成 sealSignRecord.setSignFlowStatus(3); - sealSignRecord.setFileDownloadUrl(fileDownloadUrl); + sealSignRecord.setFileDownloadUrl(fileDownloadUrl.substring(1,fileDownloadUrl.length()-1)); sealSignRecordMapper.updataSealSignRecord(sealSignRecord); + String filearbitraUrl = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1); + caseApplication.setFilearbitraUrl(filearbitraUrl); + caseApplicationMapper.submitCaseApplication(caseApplication); } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index cc51f2d..2c77c8a 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -34,6 +34,7 @@ + @@ -55,7 +56,7 @@ c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , - c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName,c.register_date + c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName,c.register_date,c.filearbitra_url from case_application c LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id @@ -181,6 +182,7 @@ objection_add_eviden = #{objectionAddEviden}, open_court_hear = #{openCourtHear}, hear_date = #{hearDate}, + filearbitra_url = #{filearbitraUrl}, where id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index 5b9b821..750c14d 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -49,6 +49,22 @@ where annex_id = #{annexId} + + update case_attach + + annex_name = #{annexName}, + annex_path = #{annexPath} + + + + AND case_appli_id = #{caseAppliId} + + + AND annex_type = #{annexType} + + + +
\ No newline at end of file From 2300df715cc1db68a9ae11532b692ef127fd4aa5 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Sun, 15 Oct 2023 15:51:41 +0800 Subject: [PATCH 116/123] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=BC=B4=E8=B4=B9=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CasePaymentController.java | 11 ++ .../common/core/domain/entity/SysUser.java | 14 +++ .../common/utils/WxAppletNotifyUtils.java | 12 +- .../ruoyi/system/mapper/SysDeptMapper.java | 2 + .../wisdomarbitrate/domain/CaseAffiliate.java | 24 ++++ .../domain/CaseApplication.java | 69 ++++++++++++ .../wisdomarbitrate/domain/CaseAttach.java | 2 +- .../domain/CasePaymentRecord.java | 4 + .../domain/dto/CaseConfirmPayDTO.java | 28 +++++ .../domain/dto/CasePayDTO.java | 12 ++ .../mapper/CaseApplicationMapper.java | 14 +++ .../mapper/CaseAttachMapper.java | 4 +- .../mapper/CasePaymentRecordMapper.java | 2 + .../service/ICasePaymentService.java | 8 ++ .../impl/CaseApplicationServiceImpl.java | 105 +++++++++++------- .../service/impl/CasePaymentServiceImpl.java | 40 +++++-- .../resources/mapper/system/SysDeptMapper.xml | 8 +- .../resources/mapper/system/SysUserMapper.xml | 17 ++- .../wisdomarbitrate/CaseAffiliateMapper.xml | 12 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 99 ++++++++++++++--- .../wisdomarbitrate/CaseAttachMapper.xml | 1 + .../CasePaymentRecordMapper.xml | 2 + 22 files changed, 403 insertions(+), 87 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java index 4c73eed..92d1abf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java @@ -2,6 +2,7 @@ package com.ruoyi.web.controller.wisdomarbitrate; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +31,16 @@ public class CasePaymentController { public AjaxResult casePay(@Validated @RequestBody CasePayDTO casePayDTO) { return paymentService.casePay(casePayDTO); } + /** + * 确认缴费 + * @param payDTO 缴费传入参数 + * @return 统一响应结果 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:pay')") + @PostMapping("/confirmPay") + public AjaxResult confirmPay(@Validated @RequestBody CaseConfirmPayDTO payDTO) { + return paymentService.confirmPay(payDTO); + } /** * 缴费确认 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 53ad695..fd3106c 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -33,9 +33,14 @@ public class SysUser extends BaseEntity @Excel(name = "登录名称") private String userName; + + /** 用户昵称 */ @Excel(name = "用户名称") private String nickName; + /** 用户身份证号 */ + @Excel(name = "身份证号") + private String idCard; /** 用户邮箱 */ @Excel(name = "用户邮箱") @@ -297,12 +302,21 @@ public class SysUser extends BaseEntity this.roleId = roleId; } + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("userId", getUserId()) .append("deptId", getDeptId()) .append("userName", getUserName()) + .append("idCard", getIdCard()) .append("nickName", getNickName()) .append("email", getEmail()) .append("phonenumber", getPhonenumber()) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java index d8b07fc..f7a0fc7 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java @@ -2,22 +2,14 @@ package com.ruoyi.common.utils; /** * @author wangqiong - * @description + * @description 获取微信小程序url scheme * @date 2023-10-13 10:16 */ -import cn.hutool.core.util.StrUtil; + import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Component; - -/** - * @Author: Tenk - */ -@RequiredArgsConstructor -@Component public class WxAppletNotifyUtils { /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java index 384a9b6..6ca6af8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -115,4 +115,6 @@ public interface SysDeptMapper * @return 结果 */ public int deleteDeptById(Long deptId); + + List selectUserDeptListByRoleId(@Param("roleId")Long roleId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java index e7721e9..d93e8cf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java @@ -15,6 +15,14 @@ public class CaseAffiliate extends BaseEntity { /** 姓名 */ @Excel(name = "姓名") private String name; + /** + * 申请机构id + */ + private String applicationOrganId; + /** + * 申请机构名称 + */ + private String applicationOrganName; /** 身份证号 */ @Excel(name = "身份证号") private String identityNum; @@ -49,6 +57,22 @@ public class CaseAffiliate extends BaseEntity { /** 快递单号 */ private String trackNum; + public String getApplicationOrganId() { + return applicationOrganId; + } + + public void setApplicationOrganId(String applicationOrganId) { + this.applicationOrganId = applicationOrganId; + } + + public String getApplicationOrganName() { + return applicationOrganName; + } + + public void setApplicationOrganName(String applicationOrganName) { + this.applicationOrganName = applicationOrganName; + } + public String getSendEmail() { return sendEmail; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index ac77efe..07a34f7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -114,9 +114,45 @@ public class CaseApplication extends BaseEntity { private Integer paymentStatus; /** 支付状态描述 */ private String paymentStatusName; + /** + * 支付方式code,0线上支付,1线下支付 + */ + private Integer payTypeCode; + /** + * 支付方式name,0线上支付,1线下支付 + */ + private String payTypeName; + /** + * 缴费凭证 + */ + private List payOrderList; // 导入校验失败信息 private StringBuilder errorMsg; + public Integer getPayTypeCode() { + return payTypeCode; + } + + public void setPayTypeCode(Integer payTypeCode) { + this.payTypeCode = payTypeCode; + } + + public String getPayTypeName() { + return payTypeName; + } + + public void setPayTypeName(String payTypeName) { + this.payTypeName = payTypeName; + } + + public List getPayOrderList() { + return payOrderList; + } + + public void setPayOrderList(List payOrderList) { + this.payOrderList = payOrderList; + } + public StringBuilder getErrorMsg() { return errorMsg; } @@ -190,6 +226,39 @@ public class CaseApplication extends BaseEntity { private String applicantName; /** 被申请人名称 */ private String respondentName; + /** + * 用户身份证号 + */ + private String idCard; + /** + * 用户id + */ + private String userId; + private List deptIds; + + public List getDeptIds() { + return deptIds; + } + + public void setDeptIds(List deptIds) { + this.deptIds = deptIds; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } public String getApplicantName() { return applicantName; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index 9827fc7..235d502 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -27,7 +27,7 @@ public class CaseAttach { */ private String annexPath; /** - * 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5) + * 附件类型,立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)' */ private Integer annexType; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java index 4bae1db..74f1f77 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java @@ -38,4 +38,8 @@ public class CasePaymentRecord { /** 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; + /** + * 支付方式 0线上支付,1线下支付 + */ + private Integer payType; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java new file mode 100644 index 0000000..146f2f2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java @@ -0,0 +1,28 @@ +package com.ruoyi.wisdomarbitrate.domain.dto; + +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 案件确认缴费传入对象 + */ +@Data +public class CaseConfirmPayDTO { + /** + * 案件id + */ + @NotNull(message = "案件id不能为空") + private Long caseId; + + /** + * 支付方式 0线上支付,1线下支付 + */ + private Integer payType; + /** + * 缴费凭证 + */ + private List payOrderList; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java index b440235..40007f0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java @@ -1,6 +1,10 @@ package com.ruoyi.wisdomarbitrate.domain.dto; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import lombok.Data; + +import java.util.List; + /** * 案件缴费传入对象 */ @@ -23,4 +27,12 @@ public class CasePayDTO { * 支付方式 wxpay(微信) alipay(支付宝) */ private String platform; + /** + * 支付方式 0线上支付,1线下支付 + */ + private Integer payType; + /** + * 缴费凭证 + */ + private List payOrderList; } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 200c92d..e24d2a5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.Arbitrator; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -12,6 +13,13 @@ public interface CaseApplicationMapper { int selectCaseApplicationCount(CaseApplication caseApplication); + /** + * 查询超级管理员案件 + * @param caseApplication + * @return + */ + List selectAdminCaseApplicationList(CaseApplication caseApplication); + int insertCaseApplication(CaseApplication caseApplication); @@ -39,4 +47,10 @@ public interface CaseApplicationMapper { * @return */ String selectArbitratorList(@Param("id") String id); + + /** + * 修改支付方式 + * @param payDTO + */ + void updatePayType(CaseConfirmPayDTO payDTO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 0be609e..28e9a26 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -14,4 +15,5 @@ public interface CaseAttachMapper { int updateCaseAttach(CaseAttach caseAttach); -} + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java index 596abf5..d5d4616 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java @@ -8,4 +8,6 @@ public interface CasePaymentRecordMapper { CasePaymentRecord queryRecord(String orderNumber); void update(CasePaymentRecord casePaymentRecord); + + CasePaymentRecord selectRecordByCaseId(Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java index fc2e24a..1731259 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.dto.PayRequest; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; public interface ICasePaymentService { @@ -12,4 +13,11 @@ public interface ICasePaymentService { AjaxResult casePay(CasePayDTO casePayDTO); AjaxResult confirmPayment(CaseApplication caseApplication); + + /** + * 确认缴费 + * @param payDTO + * @return + */ + AjaxResult confirmPay(CaseConfirmPayDTO payDTO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 189787e..c3cec8f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -14,10 +14,9 @@ import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.EsignHttpResponse; -import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.core.domain.entity.*; -import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.file.SaaSAPIFileUtils; @@ -50,6 +49,7 @@ import java.util.*; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.ruoyi.common.utils.SecurityUtils.getLoginUser; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -62,7 +62,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private CaseAffiliateMapper caseAffiliateMapper; @Autowired - private ArbitratorMapper arbitratorMapper; + private CasePaymentRecordMapper casePaymentRecordMapper; @Autowired private ArbitrateRecordMapper arbitrateRecordMapper; @Autowired @@ -79,9 +79,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); - + /** + * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态 + * 2.申请人:金融机构下,可以看到改机构的所有的案件 + * 3.被申请人:可以看到自己相关的案件(案件有被申请人相关的信息) + * 4.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件 + * 5.仲裁委(部门长):可以查看所有的案件 + * 6.法律顾问秘书:可以属于多个机构,可以查看相关机构的所有案件 + * 7.超级管理员:可以查看所有的信息和数据 + * @param caseApplication + * @return + */ @Override public List selectCaseApplicationList(CaseApplication caseApplication) { + // 获取登录用户 + LoginUser loginUser = getLoginUser(); + SysUser user = loginUser.getUser(); + Long userId = user.getUserId(); + Long deptId = user.getDeptId(); + List roles = user.getRoles(); + // 查询登录人身份证号 + SysUser sysUser = sysUserMapper.selectUserById(userId); + caseApplication.setIdCard(sysUser.getIdCard()); + caseApplication.setUserId(String.valueOf(userId)); + for (SysRole role : roles) { + // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ + if(role.getRoleName().equals("超级管理员") + ||role.getRoleName().equals("仲裁委") + ||role.getRoleName().equals("部门长")){ + return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); + } + if(role.getRoleName().equals("法律顾问")){ + // 查询角色有关的用户部门 + List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); + caseApplication.setDeptIds(deptIds); + } + } + + + // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 return caseApplicationMapper.selectCaseApplicationList(caseApplication); } @@ -99,6 +135,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 获取自动编码 String caseNum = generateCaseNum(); caseApplication.setCaseNum(caseNum); + caseApplication.setCreateBy(getUsername()); int rows = caseApplicationMapper.insertCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); @@ -116,7 +153,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { - caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); + caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); } else { // 如果不存在则新增 SysDept dept = new SysDept(); @@ -130,7 +168,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { dept.setUpdateBy(getUsername()); sysDeptMapper.insertDept(dept); deptMap.put(dept.getDeptName(), dept.getDeptId()); - caseAffiliate.setName(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); } } @@ -184,6 +223,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { BigDecimal feeRate = new BigDecimal(0.01); BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); caseApplication.setFeePayable(feePayable); + caseApplication.setUpdateBy(getUsername()); int rows = caseApplicationMapper.updataCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); @@ -199,7 +239,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { - caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); + caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); } else { // 如果不存在则新增 SysDept dept = new SysDept(); @@ -213,7 +254,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { dept.setUpdateBy(getUsername()); sysDeptMapper.insertDept(dept); deptMap.put(dept.getDeptName(), dept.getDeptId()); - caseAffiliate.setName(String.valueOf(dept.getDeptId())); + + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); + caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); } } @@ -400,7 +443,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseApplication caseApplicationItera = caseApplicationNewList.get(k); // 新增立案信息 caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - + caseApplicationItera.setCreateBy(getUsername()); int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); List caseAffiliates = caseApplicationItera.getCaseAffiliates(); if(caseAffiliates!=null&&caseAffiliates.size()>0){ @@ -879,29 +922,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if(caseAffiliatListeselect!=null){ - // 查询组织机构 - List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap=new HashMap<>(); - if(CollectionUtil.isNotEmpty(sysDepts)){ - for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); - } - } - StringBuffer applicantName = new StringBuffer(); + for (int i = 0; i < caseAffiliatListeselect.size(); i++){ CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); if(identityType==1){ - if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ - caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); - } - applicantName.append(caseAffiliateselect.getName()).append(",");; + + caseApplicationselect.setApplicantName(caseAffiliateselect.getApplicationOrganName()); } } - caseApplicationselect.setApplicantName(applicantName.toString()); - } + caseApplication.setAnnexType(8); + // 查询缴费凭证 + List payOrderList = caseAttachMapper.queryCaseAttachList(caseApplication); + caseApplicationselect.setPayOrderList(payOrderList); + return caseApplicationselect; } @@ -1012,21 +1048,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if(caseAffiliatListeselect!=null) { - // 查询组织机构 - List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap=new HashMap<>(); - if(CollectionUtil.isNotEmpty(sysDepts)){ - for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); - } - } + for (int j = 0; j < caseAffiliatListeselect.size(); j++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); int identityType = caseAffiliateselect.getIdentityType(); if(identityType==1){ - if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ - caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); - } + caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName()); } //给申请人、被申请人发送短信通知 @@ -1108,7 +1135,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 将组织机构id设为申请人名称 if(deptMap.containsKey(caseApplication.getName())){ - caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); + caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName()))); + caseAffiliate.setApplicationOrganName(caseApplication.getName()); }else { // 如果不存在则新增 SysDept dept = new SysDept(); @@ -1122,7 +1150,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { dept.setUpdateBy(getUsername()); sysDeptMapper.insertDept(dept); deptMap.put(dept.getDeptName(),dept.getDeptId()); - caseAffiliate.setName(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganName(caseApplication.getName()); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 3841ec8..b1e465a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -1,9 +1,15 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.ruoyi.ElegentPay; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.dto.PayRequest; @@ -29,6 +35,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { private final CaseApplicationMapper caseApplicationMapper; private final CasePaymentRecordMapper casePaymentRecordMapper; private final CaseAffiliateMapper caseAffiliateMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; @Autowired public CasePaymentServiceImpl(ElegentPay elegentPay @@ -78,13 +86,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecord.setPaymentTime(new Date()); casePaymentRecord.setUpdateTime(new Date()); casePaymentRecordMapper.update(casePaymentRecord); - //根据案件id查询案件信息 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseId); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); - //修改案件状态 - caseApplicationMapper.submitCaseApplication(caseApplication1); + return AjaxResult.success("支付成功"); } @@ -135,4 +137,28 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } return AjaxResult.error("暂无需要确认的缴费清单"); } + @Transactional + @Override + public AjaxResult confirmPay(CaseConfirmPayDTO payDTO) { + if(payDTO.getCaseId()!=null&&payDTO.getPayType()!=null){ + // 修改支付方式 + + caseApplicationMapper.updatePayType(payDTO); + } + if(CollectionUtil.isNotEmpty(payDTO.getPayOrderList())){ + for (CaseAttach caseAttach : payDTO.getPayOrderList()) { + caseAttach.setCaseAppliId(payDTO.getCaseId()); + caseAttachMapper.updateCaseAttach(caseAttach); + } + } + // 修改节点状态 + //根据案件id查询案件信息 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(payDTO.getCaseId()); + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); + //修改案件状态 + caseApplicationMapper.submitCaseApplication(caseApplication1); + return AjaxResult.success("确认缴费成功"); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 3e0f228..2fafdc1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -86,8 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 - - + + + insert into sys_dept( dept_id, parent_id, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 83487c2..c0c16a8 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -49,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, - r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status + r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card from sys_user u left join sys_dept d on u.dept_id = d.dept_id left join sys_user_role ur on u.user_id = ur.user_id @@ -57,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select c.id ,c.case_appli_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address , c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent, - c.track_num + c.track_num,c.application_organ_id,c.application_organ_name from case_affiliate c @@ -36,7 +38,7 @@ + select t.* from( + select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' - ELSE '无审理方式' - END arbitratMethodName, + ELSE '无审理方式' + END arbitratMethodName, c.case_status , CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' - when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' - when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - ELSE '无案件状态' - END caseStatusName, + when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' + when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' + when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' + when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' + when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' + ELSE '无案件状态' + END caseStatusName, c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , - c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName,c.register_date + c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.arbitrator_id,ca.identity_num , ca.identity_type from case_application c - LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 - LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id + LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id + + + AND c.case_status = #{caseStatus} + + + AND c.case_num = #{caseNum} + + + and c.case_status in + + #{caseStatus} + + + + ) t + + + or ( t.application_organ_id = #{nameId} AND t.identity_type=1 ) + + + + or (t.identity_num=#{idCard} AND t.identity_type=2) + + + + or instr (t.arbitrator_id,#{userId})>0 + + + + or t.name + in + + #{item} + + + + order by t.create_time desc,t.case_num desc + + + select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account from case_attach diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml index a50bb99..fab2bd0 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml @@ -11,6 +11,7 @@ + INSERT INTO case_payment_record (case_id, order_number, payment_status , create_time) @@ -24,6 +25,7 @@ payment_time = #{paymentTime}, payment_status = #{paymentStatus}, update_time = #{updateTime}, + pay_type = #{payType}, where id = #{id} From 870c514a15958468de93b0ec7a1e643cc7a7aac2 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Sun, 15 Oct 2023 15:53:37 +0800 Subject: [PATCH 117/123] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=BA=AD=E5=AE=A1=E7=AC=94=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 9 +++ .../service/ICaseApplicationService.java | 2 + .../service/impl/AdjudicationServiceImpl.java | 8 +-- .../impl/CaseApplicationServiceImpl.java | 62 ++++++++++++++----- .../utils/FixSelectFlowDetailUtils.java | 4 +- 5 files changed, 64 insertions(+), 21 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 98c12c8..a94aa3c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -99,6 +99,15 @@ public class CaseApplicationController extends BaseController { return success(caseApplicationselect); } + /** + * 查询已签署裁决书URL + */ + @PostMapping("/selectSignSealUrl") + public AjaxResult selectSignSealUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException { + CaseApplication caseApplicationselect = caseApplicationService.selectSignSealUrl(caseApplication); + return success(caseApplicationselect); + } + /** * 查询签名链接 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 06094c9..cb18d94 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -50,4 +50,6 @@ public interface ICaseApplicationService { SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException; AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord); + + CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 9677dd9..a0224e8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -126,10 +126,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("year", year); datas.put("months", month); datas.put("day", day); -// String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; - String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; -// String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; - String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); + String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; +// String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; + String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; +// String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; String resultFilePath = saveFolderPath + "/" + fileName; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index b5bf0be..3b79b45 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1116,24 +1116,31 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // String savePath = saveFolderPath; // saveName = fileName; - //将庭审笔录保存到附件表里 - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(7) - .build(); - int i = caseAttachMapper.save(caseAttach); - if (i > 0) { - if (arbitrateRecord1 != null) { - Integer annexId = caseAttach.getAnnexId(); - //将附件id保存到仲裁记录表里面 - arbitrateRecord1.setAnnexId(annexId); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); - } + caseApplication.setAnnexType(7); + List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplication); + if(caseAttachs!=null&&caseAttachs.size()>0){ + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(id) + .annexName(saveName) + .annexPath(savePath) + .annexType(7) + .build(); + int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); + + }else { + //将庭审笔录保存到附件表里 + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(id) + .annexName(saveName) + .annexPath(savePath) + .annexType(7) + .build(); + int i = caseAttachMapper.save(caseAttach); + } + //获取案件详细信息 - CaseApplication caseApplicationSelct = caseApplicationMapper.selectCaseApplication(caseApplication); + CaseApplication caseApplicationSelct = selectCaseApplication(caseApplication); return AjaxResult.success(caseApplicationSelct); } catch (IOException e) { e.printStackTrace(); @@ -1142,6 +1149,29 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } + @Override + public CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException { + Gson gson = new Gson(); + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setCaseAppliId(caseApplication.getId()); + List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); + if(sealSignRecords!=null&&sealSignRecords.size()>0){ + String signFlowid = sealSignRecords.get(0).getSignFlowid(); + EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowid); + JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class); + JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); + JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); + if(filesArray!=null&&filesArray.size()>0){ + JsonObject fileObject = (JsonObject)filesArray.get(0); + String fileDownloadUrl = fileObject.get("downloadUrl").toString(); + String filearbitraUrl = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1); + caseApplication.setFilearbitraUrl(filearbitraUrl); + } + } + + return caseApplication; + } + @Override @Transactional public int pendTralSure(CaseApplication caseApplication) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index 8c1cef1..0d7bc68 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -17,6 +17,7 @@ import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; import java.time.LocalDate; import java.util.List; @@ -32,7 +33,8 @@ public class FixSelectFlowDetailUtils { @Autowired private CaseAttachMapper caseAttachMapper; -// @Scheduled(cron = "0/3 * * * * ?") + @Scheduled(cron = "0/3 * * * * ?") + @Transactional public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { Gson gson = new Gson(); From 3def3b69dcccd3b2534985557db36e7dbbd61ffa Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Sun, 15 Oct 2023 17:54:46 +0800 Subject: [PATCH 118/123] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BB=B2=E8=A3=81=E7=BB=93=E6=9E=9C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseArbitrateController.java | 1 + .../impl/CaseArbitrateServiceImpl.java | 144 +++++++++++++++--- 2 files changed, 123 insertions(+), 22 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java index 4978baa..9517870 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java @@ -36,6 +36,7 @@ public class CaseArbitrateController extends BaseController { */ @PostMapping("/writtenHear") public AjaxResult writtenHear(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ + arbitrateRecord.setCreateBy(getUsername()); return caseArbitrateService.writtenHear(arbitrateRecord); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index ee57a80..b6d5d36 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -2,22 +2,24 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.WordUtil; +import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.SmsUtils; -import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; -import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; -import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper; -import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; -import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; -import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.List; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.*; @Service public class CaseArbitrateServiceImpl implements ICaseArbitrateService { @@ -29,6 +31,8 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { private CaseLogRecordMapper caseLogRecordMapper; @Autowired private ArbitrateRecordMapper arbitrateRecordMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; @Override @Transactional @@ -109,15 +113,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { } @Override + @Transactional public AjaxResult writtenHear(ArbitrateRecord arbitrateRecord) { //查询案件详情 CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(arbitrateRecord.getCaseAppliId()); CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - String createBy = caseApplication1.getCreateBy(); - if (createBy!=null){ - arbitrateRecord.setCreateBy(createBy); - } + String createBy = arbitrateRecord.getCreateBy(); + //先判断案件是否已经提交过仲裁结果 ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); if (arbitrateRecord1!=null){ @@ -131,13 +134,9 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { caseLogRecord.setCreateBy(createBy); } caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - //修改案件状态 - caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION); - caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,""); - return AjaxResult.success("提交成功"); } }else { //提交仲裁结果 @@ -152,15 +151,116 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { caseLogRecord.setCreateBy(createBy); } caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - //修改案件状态 - caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION); - caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,""); - return AjaxResult.success("提交成功"); } } - return AjaxResult.error("暂无需要提交仲裁结果的案件"); + + //生成庭审笔录 + try { + Map datas = new HashMap<>(); + Long id = caseApplication.getId(); + + + //获取案件关联人信息 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(id); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + if (caseAffiliates != null && caseAffiliates.size() > 0) { + for (CaseAffiliate affiliate : caseAffiliates) { + //获取身份类型 + int identityType = affiliate.getIdentityType(); + if (identityType == 1) { //申请人 + datas.put("appName", affiliate.getName()); + datas.put("appIDNo", affiliate.getIdentityNum()); + datas.put("appAddress", affiliate.getContactAddress()); + datas.put("appAgentName", affiliate.getNameAgent()); + datas.put("appAgentIDNo", affiliate.getIdentityNumAgent()); + } else if (identityType == 2) { //被申请人 + datas.put("resName", affiliate.getName()); + datas.put("resIDNo", affiliate.getIdentityNum()); + datas.put("resAddress", affiliate.getContactAddress()); + datas.put("resAgentName", affiliate.getNameAgent()); + datas.put("resAgentIDNo", affiliate.getIdentityNumAgent()); + } + } + } + String arbitratorName = caseApplication.getArbitratorName(); + datas.put("caseName", caseApplication.getCaseName()); + datas.put("arbitratorName", arbitratorName); + Date hearDate = caseApplication.getHearDate(); + if (hearDate != null) { + LocalDate localDate = hearDate.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDate(); + datas.put("hearYear", localDate.getYear()); + datas.put("hearMonths", localDate.getMonthValue()); + datas.put("hearDay", localDate.getDayOfMonth()); + } else { + datas.put("hearYear", null); + datas.put("hearMonths", null); + datas.put("hearDay", null); + } + datas.put("appArbitrationClaims", caseApplication.getArbitratClaims()); + datas.put("evidenDetermi", arbitrateRecord.getEvidenDetermi()); + datas.put("factDetermi", arbitrateRecord.getFactDetermi()); + datas.put("caseSketch", arbitrateRecord.getCaseSketch()); + datas.put("arbitrateThink", arbitrateRecord.getArbitrateThink()); + datas.put("rulingFollows", arbitrateRecord.getRulingFollows()); + datas.put("legalProvisions", "仲裁法"); + LocalDate now = LocalDate.now(); + String year = Integer.toString(now.getYear()); + String month = String.format("%02d", now.getMonthValue()); + String day = String.format("%02d", now.getDayOfMonth()); + datas.put("year", year); + datas.put("months", month); + datas.put("day", day); + String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; +// String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; + String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; +// String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); + String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + String resultFilePath = saveFolderPath + "/" + fileName; + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } + Path sourcePath = new File(modalFilePath).toPath(); + Path destinationPath = new File(resultFilePath).toPath(); + Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); + String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); + String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); + + //修改案件状态 + caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + caseApplicationMapper.submitCaseApplication(caseApplication1); + + //将裁决书保存到附件表里 + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(id) + .annexName(saveName) + .annexPath(savePath) + .annexType(3) + .build(); + int i = caseAttachMapper.save(caseAttach); + if (i > 0) { + if (arbitrateRecord1 != null) { + Integer annexId = caseAttach.getAnnexId(); + //将附件id保存到仲裁记录表里面 + arbitrateRecord1.setAnnexId(annexId); + arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); + } + } + return AjaxResult.success("裁决书已生成"); + + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("裁决书生成异常"); + } + + } } \ No newline at end of file From 913ca3547a117f3b0a591c59ca96207110b908ab Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Sun, 15 Oct 2023 18:38:28 +0800 Subject: [PATCH 119/123] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/CaseApplicationMapper.xml | 69 ++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 2c77c8a..c26c59d 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -59,7 +59,72 @@ c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName,c.register_date,c.filearbitra_url from case_application c LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 - LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id + + + AND c.case_status = #{caseStatus} + + + AND c.case_num = #{caseNum} + + + and c.case_status in + + #{caseStatus} + + + + ) t + + + or ( t.application_organ_id = #{nameId} AND t.identity_type=1 ) + + + + or (t.identity_num=#{idCard} AND t.identity_type=2) + + + + or instr (t.arbitrator_id,#{userId})>0 + + + + or t.name + in + + #{item} + + + + + ) t1 + + + + and ( t1.applicationOrganId = #{nameId} AND t1.identity_type=1 ) + + + order by t1.create_time desc,t1.case_num desc + + +select t1.* from( + select t.* from( select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式' @@ -56,7 +56,8 @@ c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , - c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName,c.register_date,c.filearbitra_url + c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as applicantName, + c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url from case_application c LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 @@ -73,11 +74,9 @@
- ) t - - - or ( t.application_organ_id = #{nameId} AND t.identity_type=1 ) - + ) t + + or (t.identity_num=#{idCard} AND t.identity_type=2) @@ -100,7 +99,7 @@ - and ( t1.applicationOrganId = #{nameId} AND t1.identity_type=1 ) + and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1 ) order by t1.create_time desc,t1.case_num desc