1、原SsoAop进行登录验证有鉴权,现改为只验证登录,不做鉴权,相应SsoCtrl中增加只鉴权的方法
2、优化通信中间件代码、common模块中协议代码、
26个文件已修改
3个文件已添加
528 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoAop.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoAspect.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoPowerAop.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoPowerAspect.java 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoVo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CodeV1_0_1.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd83OpenVo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/HttpUtils.java 141 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpSessionCache.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuUpTask.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/web/com/CommandCtrl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockCtrl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/client/ClientCtrl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/clientType/ClientTypeCtrl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictCtrl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/divide/DivideCtrl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/paymentMethod/PaymentMethodCtrl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletCtrl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoAop.java
@@ -6,11 +6,4 @@
@Target(ElementType.METHOD)
@Inherited
public @interface SsoAop {
    String value() default "" ;
    //优先级1(最高),如果其有值,则不在判断以下变量取值
    String power() default "" ;
    //优先级2,拥有全部权限才可 , 如果其有值,则不在判断以下变量取值
    String[] ifAllPower() default{""} ;
    //优先级3 , 如果有一个权限即可 , 如果其有值,则不在判断以下变量取值
    String[] ifAnyPower() default{""} ;
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoAspect.java
@@ -35,7 +35,7 @@
    public String isDevStage ;//是否为开发阶段
    @Value("${pipIrr.sso.checkUrl}")
    public String SsoCheckUrl ;
    public String ssoCheckUrl;
    private RestTemplate restTemplate;
@@ -45,10 +45,10 @@
    }
    @Pointcut("@annotation(com.dy.common.aop.SsoAop)")
    public void dyPointCut() {
    public void ssoPointCut() {
    }
    @Around("dyPointCut()")
    @Around("ssoPointCut()")
    public Object execute(ProceedingJoinPoint point) throws Throwable {
        if(isDevStage != null && !isDevStage.trim().equals("") && isDevStage.trim().equalsIgnoreCase("true")){
            return point.proceed();
@@ -57,18 +57,8 @@
            Method method = signature.getMethod();
            SsoAop aop = method.getAnnotation(SsoAop.class) ;
            if (Objects.nonNull(aop)){
                String power = aop.value() ;
                if(power.trim().equals("")){
                    power = aop.power() ;
                }
                if(power.trim().equals("-1")){
                    //不进行登录及权限验证
                    return point.proceed();
                }else{
                    String[] allPower = aop.ifAllPower() ;
                    String[] anyPower = aop.ifAnyPower() ;
                    String token = UserTokenContext.get() ;
                    Object rObj = this.check(token, power, allPower, anyPower);
                Object rObj = this.check(token);
                    if(rObj != null){
                        if(rObj instanceof SsoVo ssoVo){
                            if(ssoVo.logined){
@@ -96,7 +86,6 @@
                    }else{
                        return BaseResponseUtils.buildError("后端系统出错,check方法返回null") ;
                    }
                }
            }else{
                //已经进入注解处理了,还得不到注解,这种情况是不可能的。
                return BaseResponseUtils.buildError("后端系统出错,DyAop注解为null") ;
@@ -107,18 +96,12 @@
    /**
     * 调用SSO系统进行验证
     * @param token Header中的用户token
     * @param power 一个权限
     * @param allPower 多个权限
     * @param anyPower 多个权限
     * @return 返回对象
     */
    private Object check(String token, String power, String[] allPower, String[] anyPower){
        if(!StringUtils.isNullOrEmpty(SsoCheckUrl)){
            String url = UriComponentsBuilder.fromUriString(SsoCheckUrl)
    private Object check(String token){
        if(!StringUtils.isNullOrEmpty(ssoCheckUrl)){
            String url = UriComponentsBuilder.fromUriString(ssoCheckUrl)
                    .queryParam("token", token)
                    .queryParam("power", power)
                    .queryParam("allPower", (Object) allPower)
                    .queryParam("anyPower", (Object) anyPower)
                    .build()
                    .toUriString();
            // 由于获取student接口咱们设置了basicauth,所以需要在请求时配置
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoPowerAop.java
New file
@@ -0,0 +1,16 @@
package com.dy.common.aop;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Inherited
public @interface SsoPowerAop {
    String value() default "" ;
    //优先级1(最高),如果其有值,则不在判断以下变量取值
    String power() default "" ;
    //优先级2,拥有全部权限才可 , 如果其有值,则不在判断以下变量取值
    String[] ifAllPower() default{""} ;
    //优先级3 , 如果有一个权限即可 , 如果其有值,则不在判断以下变量取值
    String[] ifAnyPower() default{""} ;
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoPowerAspect.java
New file
@@ -0,0 +1,141 @@
package com.dy.common.aop;
import com.dy.common.contant.Constant;
import com.dy.common.multiDataSource.DataSourceContext;
import com.dy.common.webFilter.UserTokenContext;
import com.dy.common.webUtil.BaseResponseUtils;
import com.mysql.cj.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import java.lang.reflect.Method;
import java.util.Objects;
@Slf4j
@Aspect
@Order(Constant.AspectOrderSsoAutho)
@Component
public class SsoPowerAspect {
    @Value("${pipIrr.global.dev}")
    public String isDevStage ;//是否为开发阶段
    @Value("${pipIrr.sso.checkUrl}")
    public String SsoCheckUrl ;
    private RestTemplate restTemplate;
    @Autowired
    public void setRestTemplate(RestTemplate restTemplate){
        this.restTemplate = restTemplate ;
    }
    @Pointcut("@annotation(com.dy.common.aop.SsoPowerAop)")
    public void ssoPowerPointCut() {
    }
    @Around("ssoPowerPointCut()")
    public Object execute(ProceedingJoinPoint point) throws Throwable {
        if(isDevStage != null && !isDevStage.trim().equals("") && isDevStage.trim().equalsIgnoreCase("true")){
            return point.proceed();
        }else{
            MethodSignature signature = (MethodSignature) point.getSignature();
            Method method = signature.getMethod();
            SsoPowerAop aop = method.getAnnotation(SsoPowerAop.class) ;
            if (Objects.nonNull(aop)){
                String power = aop.value() ;
                if(power.trim().equals("")){
                    power = aop.power() ;
                }
                if(power.trim().equals("-1")){
                    //不进行登录及权限验证
                    return point.proceed();
                }else{
                    String[] allPower = aop.ifAllPower() ;
                    String[] anyPower = aop.ifAnyPower() ;
                    String token = UserTokenContext.get() ;
                    Object rObj = this.check(token, power, allPower, anyPower);
                    if(rObj != null){
                        if(rObj instanceof SsoVo ssoVo){
                            if(ssoVo.logined){
                                if(ssoVo.hasPower){
                                    if(!StringUtils.isNullOrEmpty(ssoVo.dataSourceName)){
                                        DataSourceContext.set(ssoVo.dataSourceName);
                                        Object obj = point.proceed();
                                        DataSourceContext.remove();
                                        return obj ;
                                    }else{
                                        //无数据源
                                        return BaseResponseUtils.buildError("后端系统出错,未得到当前登录用户所属机构标签(数据源名)") ;
                                    }
                                }else{
                                    //无权限
                                    return BaseResponseUtils.buildNoPower() ;
                                }
                            }else{
                                //未登录
                                return BaseResponseUtils.buildToLogin() ;
                            }
                        }else{
                            return rObj ;
                        }
                    }else{
                        return BaseResponseUtils.buildError("后端系统出错,check方法返回null") ;
                    }
                }
            }else{
                //已经进入注解处理了,还得不到注解,这种情况是不可能的。
                return BaseResponseUtils.buildError("后端系统出错,DyAop注解为null") ;
            }
        }
    }
    /**
     * 调用SSO系统进行验证
     * @param token Header中的用户token
     * @param power 一个权限
     * @param allPower 多个权限
     * @param anyPower 多个权限
     * @return 返回对象
     */
    private Object check(String token, String power, String[] allPower, String[] anyPower){
        if(!StringUtils.isNullOrEmpty(SsoCheckUrl)){
            String url = UriComponentsBuilder.fromUriString(SsoCheckUrl)
                    .queryParam("token", token)
                    .queryParam("power", power)
                    .queryParam("allPower", (Object) allPower)
                    .queryParam("anyPower", (Object) anyPower)
                    .build()
                    .toUriString();
            // 由于获取student接口咱们设置了basicauth,所以需要在请求时配置
            HttpHeaders headers = new HttpHeaders();
            HttpEntity<?> httpEntity = new HttpEntity<>(headers);
            ResponseEntity<SsoVo> response = null;
            try {
                // 通过Get方式调用接口
                response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, SsoVo.class);
            } catch (Exception e) {
                e.printStackTrace();
            }
            assert response != null;
            return response.getBody();
        }else {
            return BaseResponseUtils.buildError("后端系统出错,未得到SsoCheckUrl");
        }
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/aop/SsoVo.java
@@ -9,6 +9,6 @@
@Builder
public class SsoVo {
    public boolean logined ;
    public boolean hasPower ;
    public boolean hasPower ;//2023-12-21 经商议,由前端鉴权,所以此属性不再应用
    public String dataSourceName ;
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java
@@ -24,7 +24,7 @@
    public String id; 
    
    /**
     * 水表协议名称,这个可以为空,因为水表上行数据解析出协议名称,然后系统把协议名称保存在水表数据记录中,从此协议名称就不再空了
     * RTU协议名称,这个可以为空,因为RTU上行数据解析出协议名称,然后系统把协议名称保存在RTU数据记录中,从此协议名称就不再空了
     */
    public String protocol;
    
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CodeV1_0_1.java
@@ -3,17 +3,17 @@
public class CodeV1_0_1 {
    //功能码为字符串,十六进制数据
    public static final String cd_02 = "02" ;//遥测站链路检测
    public static final String cd_C0 = "C0" ;//遥测站自报实时数据
    public static final String cd_71 = "71" ;//查询阀门状态(李天赐制定的协议,当前未实现)
    public static final String cd_83 = "83" ;//遥测站开关阀自报
    public static final String cd_84 = "84" ;//开阀工作报
    public static final String cd_71 = "71" ;//查询阀门状态
    public static final String cd_C0 = "C0" ;//遥测站自报实时数据
    public static String getCodeName(String code) {
        String name = (code.equals(cd_02) ? "链路检测" :
            (code.equals(cd_C0) ? "自报实时数据" :
            (code.equals(cd_71) ? "查询阀门状态" :
            (code.equals(cd_83) ? "开关阀自报" :
            (code.equals(cd_84) ? "开阀工作报" :
            (code.equals(cd_71) ? "查询阀门状态" :
            (code.equals(cd_C0) ? "自报实时数据" :
            ""))))) ;
        return name ;
    }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
@@ -145,6 +145,7 @@
            case 7 -> "紧急关阀";
            case 8 -> "用户远程开阀";
            case 9 -> "用户远程关阀";
            case 16 -> "管道无水自动关阀";
            default -> "未知";
        };
    }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd83OpenVo.java
@@ -8,6 +8,7 @@
    // 开关阀类型:
    // 1、刷卡开阀;2刷卡关阀;3、中心站开阀;4、中心站关阀;5、欠费关阀;
    // 6、流量计故障关阀;7、紧急关阀;8、用户远程开阀;9、用户远程关阀;
    // 16,用户开阀后管道内没有水,自动关阀。管道不出水自动关阀
    public Byte type ;
    public Double totalAmount; //累计流量:5字节BCD码,取值范围0~9999999999,单位为m3。
    public String clientNum ;//农户编号
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/HttpUtils.java
@@ -1,7 +1,7 @@
package com.dy.common.util;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
@@ -36,18 +36,18 @@
    /**
     * get
     * 
     * @param host
     * @param path
     * @param headers
     * @param querys
     * @return
     * @throws Exception
     * @param host 服务端URI
     * @param path 请求路径
     * @param headers 请求头
     * @param params 请求参数
     * @return HttpResponse响应
     * @throws Exception 异常
     */
    public static HttpResponse doGet(String host, String path, Map<String, String> headers,
            Map<String, String> querys) throws Exception {
            Map<String, String> params) throws Exception{
        HttpClient httpClient = wrapClient(host);
        HttpGet request = new HttpGet(buildUrl(host, path, querys));
        HttpGet request = new HttpGet(buildUrl(host, path, params));
        if(headers != null){
            for (Map.Entry<String, String> e : headers.entrySet()) {
                request.addHeader(e.getKey(), e.getValue());
@@ -60,28 +60,28 @@
    /**
     * post form
     * 
     * @param host
     * @param path
     * @param headers
     * @param querys
     * @param bodys
     * @return
     * @throws Exception
     * @param host 服务端URI
     * @param path 请求路径
     * @param headers 请求头
     * @param params 请求参数
     * @param bodies 请求体
     * @return HttpResponse响应
     * @throws Exception 异常
     */
    public static HttpResponse doPost(String host, String path, Map<String, String> headers,
            Map<String, String> querys, Map<String, String> bodys) throws Exception {
            Map<String, String> params, Map<String, String> bodies) throws Exception {
        HttpClient httpClient = wrapClient(host);
        HttpPost request = new HttpPost(buildUrl(host, path, querys));
        HttpPost request = new HttpPost(buildUrl(host, path, params));
        for (Map.Entry<String, String> e : headers.entrySet()) {
            request.addHeader(e.getKey(), e.getValue());
        }
        if (bodys != null) {
            List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
        if (bodies != null) {
            List<NameValuePair> nameValuePairList = new ArrayList<>();
            for (String key : bodys.keySet()) {
                nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
            for (String key : bodies.keySet()) {
                nameValuePairList.add(new BasicNameValuePair(key, bodies.get(key)));
            }
            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
            formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
@@ -94,19 +94,19 @@
    /**
     * Post String
     * 
     * @param host
     * @param path
     * @param headers
     * @param querys
     * @param body
     * @return
     * @throws Exception
     * @param host 服务端URI
     * @param path 请求路径
     * @param headers 请求头
     * @param params 请求参数
     * @param body 请求体
     * @return HttpResponse响应
     * @throws Exception 异常
     */
    public static HttpResponse doPost(String host, String path, Map<String, String> headers,
            Map<String, String> querys, String body) throws Exception {
            Map<String, String> params, String body) throws Exception {
        HttpClient httpClient = wrapClient(host);
        HttpPost request = new HttpPost(buildUrl(host, path, querys));
        HttpPost request = new HttpPost(buildUrl(host, path, params));
        for (Map.Entry<String, String> e : headers.entrySet()) {
            request.addHeader(e.getKey(), e.getValue());
        }
@@ -121,19 +121,19 @@
    /**
     * Post stream
     * 
     * @param host
     * @param path
     * @param headers
     * @param querys
     * @param body
     * @return
     * @throws Exception
     * @param host 服务端URI
     * @param path 请求路径
     * @param headers 请求头
     * @param params 请求参数
     * @param body 请求体
     * @return HttpResponse响应
     * @throws Exception 异常
     */
    public static HttpResponse doPost(String host, String path, Map<String, String> headers,
            Map<String, String> querys, byte[] body) throws Exception {
            Map<String, String> params, byte[] body) throws Exception {
        HttpClient httpClient = wrapClient(host);
        HttpPost request = new HttpPost(buildUrl(host, path, querys));
        HttpPost request = new HttpPost(buildUrl(host, path, params));
        if(headers != null){
            for (Map.Entry<String, String> e : headers.entrySet()) {
                request.addHeader(e.getKey(), e.getValue());
@@ -150,19 +150,19 @@
    /**
     * Put String
     * 
     * @param host
     * @param path
     * @param headers
     * @param querys
     * @param body
     * @return
     * @throws Exception
     * @param host 服务端URI
     * @param path 请求路径
     * @param headers 请求头
     * @param params 请求参数
     * @param body 请求体
     * @return HttpResponse响应
     * @throws Exception 异常
     */
    public static HttpResponse doPut(String host, String path, Map<String, String> headers,
            Map<String, String> querys, String body) throws Exception {
            Map<String, String> params, String body) throws Exception {
        HttpClient httpClient = wrapClient(host);
        HttpPut request = new HttpPut(buildUrl(host, path, querys));
        HttpPut request = new HttpPut(buildUrl(host, path, params));
        for (Map.Entry<String, String> e : headers.entrySet()) {
            request.addHeader(e.getKey(), e.getValue());
        }
@@ -177,19 +177,19 @@
    /**
     * Put stream
     * 
     * @param host
     * @param path
     * @param headers
     * @param querys
     * @param body
     * @return
     * @throws Exception
     * @param host 服务端URI
     * @param path 请求路径
     * @param headers 请求头
     * @param params 请求参数
     * @param body 请求体
     * @return HttpResponse响应
     * @throws Exception 异常
     */
    public static HttpResponse doPut(String host, String path, Map<String, String> headers,
            Map<String, String> querys, byte[] body) throws Exception {
            Map<String, String> params, byte[] body) throws Exception {
        HttpClient httpClient = wrapClient(host);
        HttpPut request = new HttpPut(buildUrl(host, path, querys));
        HttpPut request = new HttpPut(buildUrl(host, path, params));
        for (Map.Entry<String, String> e : headers.entrySet()) {
            request.addHeader(e.getKey(), e.getValue());
        }
@@ -204,18 +204,18 @@
    /**
     * Delete
     * 
     * @param host
     * @param path
     * @param headers
     * @param querys
     * @return
     * @throws Exception
     * @param host 服务端URI
     * @param path 请求路径
     * @param headers 请求头
     * @param params 请求参数
     * @return HttpResponse响应
     * @throws Exception 异常
     */
    public static HttpResponse doDelete(String host, String path, Map<String, String> headers,
            Map<String, String> querys) throws Exception {
            Map<String, String> params) throws Exception {
        HttpClient httpClient = wrapClient(host);
        HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
        HttpDelete request = new HttpDelete(buildUrl(host, path, params));
        for (Map.Entry<String, String> e : headers.entrySet()) {
            request.addHeader(e.getKey(), e.getValue());
        }
@@ -223,16 +223,15 @@
        return httpClient.execute(request);
    }
    private static String buildUrl(String host, String path, Map<String, String> querys)
            throws UnsupportedEncodingException {
    private static String buildUrl(String host, String path, Map<String, String> params) {
        StringBuilder sbUrl = new StringBuilder();
        sbUrl.append(host);
        if (!StringUtils.isBlank(path)) {
            sbUrl.append(path);
        }
        if (null != querys) {
        if (null != params) {
            StringBuilder sbQuery = new StringBuilder();
            for (Map.Entry<String, String> query : querys.entrySet()) {
            for (Map.Entry<String, String> query : params.entrySet()) {
                if (0 < sbQuery.length()) {
                    sbQuery.append("&");
                }
@@ -243,7 +242,7 @@
                    sbQuery.append(query.getKey());
                    if (!StringUtils.isBlank(query.getValue())) {
                        sbQuery.append("=");
                        sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8"));
                        sbQuery.append(URLEncoder.encode(query.getValue(), StandardCharsets.UTF_8));
                    }
                }
            }
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpSessionCache.java
@@ -4,7 +4,6 @@
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuUpTask.java
@@ -74,7 +74,7 @@
                    //缓存session
                    TcpSessionCache.putNewTcpSession(rtuAddr, protocolName, session);
                    
                    log.info("RTU(地址:" + rtuAddr + ")上线了。") ;
                    log.info("RTU(地址:" + rtuAddr + ",协议:" + protocolName + ")上线了。") ;
                }
            }
        }
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/web/com/CommandCtrl.java
New file
@@ -0,0 +1,30 @@
package com.dy.aceMw.web.com;
import com.dy.common.mw.protocol.Command;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
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;
/**
 * @Author liurunyu
 * @Date 2023/12/21 13:58
 * @LastEditTime 2023/12/21 13:58
 * @Description
 */
@Slf4j
@RestController
@RequestMapping(path="com")
@SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked")
public class CommandCtrl {
    @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE)
    public BaseResponse<Command> send(@RequestBody Command com) {
        return BaseResponseUtils.buildSuccess(com);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockCtrl.java
@@ -51,7 +51,7 @@
            )
    })
    @GetMapping(path = "all")
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaBlock>>> all(){
        try {
            QueryResultVo<List<BaBlock>> res = this.sv.selectAll() ;
@@ -76,7 +76,7 @@
            )
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaBlock>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
        try {
            QueryResultVo<List<BaBlock>> res = this.sv.selectSome(vo) ;
@@ -101,7 +101,7 @@
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<BaBlock> one(@Parameter(description = "实体id", required = true) Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -121,7 +121,7 @@
            )
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaBlock po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -156,7 +156,7 @@
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaBlock po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -194,7 +194,7 @@
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/client/ClientCtrl.java
@@ -52,7 +52,7 @@
            )
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaClient>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
        try {
            QueryResultVo<List<BaClient>> res = this.sv.selectSome(vo) ;
@@ -77,7 +77,7 @@
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<BaClient> one(@Parameter(description = "实体id", required = true) Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -97,7 +97,7 @@
            )
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaClient po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -132,7 +132,7 @@
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaClient po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -170,7 +170,7 @@
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/clientType/ClientTypeCtrl.java
@@ -53,7 +53,7 @@
            )
    })
    @GetMapping(path = "all")
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaClientType>>> all(){
        try {
            QueryResultVo<List<BaClientType>> res = this.sv.selectAll() ;
@@ -78,7 +78,7 @@
            )
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaClientType>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) @Valid QueryVo vo){
        try {
            QueryResultVo<List<BaClientType>> res = this.sv.selectSome(vo) ;
@@ -103,7 +103,7 @@
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<BaClientType> one(@Parameter(description = "实体id", required = true) Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -123,7 +123,7 @@
            )
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaClientType po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -158,7 +158,7 @@
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaClientType po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -196,7 +196,7 @@
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictCtrl.java
@@ -21,7 +21,6 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
@@ -72,7 +71,7 @@
            )
    })
    @GetMapping(path = "all")
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<List<BaDistrict>> all(){
        List<BaDistrict> list = this.sv.selectAllByLevel(DistrictLevel.City.code) ;
        return BaseResponseUtils.buildSuccess(list);
@@ -92,7 +91,7 @@
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<BaDistrict> one(@Parameter(description = "实体id", required = true) Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -112,7 +111,7 @@
            )
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DistrictVo vo, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -154,7 +153,7 @@
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DistrictVo vo, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -190,7 +189,7 @@
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/divide/DivideCtrl.java
@@ -50,7 +50,7 @@
            )
    })
    @GetMapping(path = "all")
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaDivide>>> all(){
        try {
            QueryResultVo<List<BaDivide>> res = this.sv.selectAll() ;
@@ -75,7 +75,7 @@
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<BaDivide> one(@Parameter(description = "实体id", required = true) Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -93,7 +93,7 @@
            )
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaDivide>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) DivideVo vo){
        try {
            QueryResultVo<List<BaDivide>> res = this.sv.selectSome(vo) ;
@@ -119,7 +119,7 @@
            )
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaDivide po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -153,7 +153,7 @@
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaDivide po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -191,7 +191,7 @@
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
@@ -53,7 +53,7 @@
            )
    })
    @GetMapping(path = "all")
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaRole>>> all(){
        try {
            QueryResultVo<List<BaRole>> res = this.sv.selectAll() ;
@@ -78,7 +78,7 @@
            )
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaRole>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) @Valid QueryVo vo){
        try {
            QueryResultVo<List<BaRole>> res = this.sv.selectSome(vo) ;
@@ -103,7 +103,7 @@
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<BaRole> one(@Parameter(description = "实体id", required = true) Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -123,7 +123,7 @@
            )
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaRole po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -159,7 +159,7 @@
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaRole po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -199,7 +199,7 @@
            )
    })
    @GetMapping(path = "setPrivs", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> setPrivileges(@Parameter(description = "实体id", required = true) Long id,
                                          @Parameter(description = "权限id数组") Long[] privIds){
        Long[] privIds_lg = null ;
@@ -233,7 +233,7 @@
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
@@ -89,7 +89,7 @@
            )
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) @Valid QueryVo vo) {
        try {
            QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo);
@@ -115,7 +115,7 @@
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<BaUser> one(@Parameter(description = "实体id", required = true) String id) {
        return BaseResponseUtils.buildSuccess(this.sv.selectById(Long.parseLong(id)));
    }
@@ -136,7 +136,7 @@
            )
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult) {
        if (bindingResult != null && bindingResult.hasErrors()) {
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -186,7 +186,7 @@
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult) {
        if (bindingResult != null && bindingResult.hasErrors()) {
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -229,7 +229,7 @@
            )
    })
    @GetMapping(path = "changePassword", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> changePassword(@Parameter(description = "实体id", required = true) String id,
                                                @Parameter(description = "旧密码", required = true) String oldPassword,
                                                @Parameter(description = "新密码", required = true) String newPassword) throws Exception {
@@ -289,7 +289,7 @@
            )
    })
    @PostMapping(path = "resetPassword", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> resetPassword(@RequestBody @Parameter(description = "form表单json数据", required = true) ResetPasswordVo vo) throws Exception {
        if (vo.id == null) {
            return BaseResponseUtils.buildFail("id不能为空");
@@ -331,7 +331,7 @@
            )
    })
    @GetMapping(path = "resetPasswordByDefault", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> resetPasswordByDefault(@Parameter(description = "实体id", required = true) String id) throws Exception {
        if (id == null) {
            return BaseResponseUtils.buildFail("id不能为空");
@@ -374,7 +374,7 @@
            )
    })
    @GetMapping(path = "resetPasswordByRandom", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<String> resetPasswordByRandom(@Parameter(description = "实体id", required = true) String id) throws Exception {
        if (id == null) {
            return BaseResponseUtils.buildFail("id不能为空");
@@ -419,7 +419,7 @@
            )
    })
    @GetMapping(path = "setRoles", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> setRoles(@Parameter(description = "实体id", required = true) String id,
                                          @Parameter(description = "角色id数组") String[] roleIds) {
        Long[] roleId_lg = null;
@@ -456,7 +456,7 @@
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) String id) {
        if (id == null) {
            return BaseResponseUtils.buildFail("id不能为空");
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java
@@ -59,7 +59,7 @@
            )
    })
    @GetMapping(path = "/getActiveCards", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoActiveCard>>> getActiveCards(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
        try {
            QueryResultVo<List<VoActiveCard>> res = activeCardSv.getActiveCards(vo);
@@ -81,7 +81,7 @@
    })
    @PostMapping(path = "add_active", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> add_active(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoActiveCard po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -214,7 +214,7 @@
    })
    @PostMapping(path = "add_reissue", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> add_reissue(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoActiveCard po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java
@@ -57,7 +57,7 @@
            )
    })
    @GetMapping(path = "/getCancels", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoCancel>>> getCancels(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
        try {
            QueryResultVo<List<VoCancel>> res = cancelSv.getCancels(vo);
@@ -79,7 +79,7 @@
    })
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoCancel po, @Parameter(hidden = true) BindingResult bindingResult){
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        if(bindingResult != null && bindingResult.hasErrors()){
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java
@@ -57,7 +57,7 @@
            )
    })
    @GetMapping(path = "/getLosses", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoLoss>>> getLosses(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
        try {
            QueryResultVo<List<VoLoss>> res = lossSv.getLosses(vo);
@@ -79,7 +79,7 @@
    })
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoLoss po, @Parameter(hidden = true) BindingResult bindingResult){
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        if(bindingResult != null && bindingResult.hasErrors()){
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/paymentMethod/PaymentMethodCtrl.java
@@ -46,7 +46,7 @@
            )
    })
    @GetMapping(path = "/get")
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<SePaymentMethod>>> getPaymentMethods(){
        try {
            QueryResultVo<List<SePaymentMethod>> res = paymentMethodSv.getPaymentMethods();
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java
@@ -47,7 +47,7 @@
            )
    })
    @GetMapping(path = "/getRecharges", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoRecharge>>> get(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
        try {
            QueryResultVo<List<VoRecharge>> res = rechargeSv.getRecharges(vo);
@@ -69,7 +69,7 @@
    })
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoRecharge po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java
@@ -57,7 +57,7 @@
            )
    })
    @GetMapping(path = "/getReversals", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoReversal>>> getReversals(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
        try {
            QueryResultVo<List<VoReversal>> res = reversalSv.getReversals(vo);
@@ -79,7 +79,7 @@
    })
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoReversal po, @Parameter(hidden = true) BindingResult bindingResult){
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        if(bindingResult != null && bindingResult.hasErrors()){
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java
@@ -57,7 +57,7 @@
            )
    })
    @GetMapping(path = "/getUnlocks", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop("-1")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoUnlock>>> getUnlocks(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
        try {
            QueryResultVo<List<VoUnlock>> res = unlockSv.getUnlocks(vo);
@@ -79,7 +79,7 @@
    })
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoUnlock po, @Parameter(hidden = true) BindingResult bindingResult){
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        if(bindingResult != null && bindingResult.hasErrors()){
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletCtrl.java
@@ -52,7 +52,7 @@
    })
    @PostMapping(path = "add")
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    @SsoAop()
    //public BaseResponse<Boolean> add(@RequestBody Long clientId){
    public BaseResponse<Boolean> add(@RequestParam("clientId") @NotNull(message = "农户编号不能为空") Long clientId){
        if(clientId == null || clientId < 0) {
@@ -82,7 +82,7 @@
    //})
    //@PostMapping(path = "addRecharge")
    //@Transactional(rollbackFor = Exception.class)
    //@SsoAop("-1")//@SsoAop(power = "-1")
    //@SsoAop()
    //public BaseResponse<Boolean> addRecharge(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoWalletRecharge po, @Parameter(hidden = true) BindingResult bindingResult){
    //    DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    //    if(bindingResult != null && bindingResult.hasErrors()){
pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java
@@ -232,7 +232,27 @@
        BaUser userPo = this.sv.getByUuid(token) ;
        return userPo == null ? null : userPo.id ;
    }
    /**
     * 此方法供子模块系统调用,所以不公开在API接口中
     * 方法功能:验证是否已经登录,如果登录了,再验证权限
     * @param token 登录用户token
     * @return SsoVo
     */
    @Hidden
    @GetMapping(path = "ssoCheck")
    public SsoVo ssoCheck(String token){
        BaUser userPo = this.sv.getByUuid(token) ;
        SsoVo vo = new SsoVo();
        if(userPo != null){
            vo.dataSourceName = userPo.orgTag ;
            vo.logined = true ;
            vo.hasPower = true ;//默认有权限
        }else{
            vo.logined = false ;
            vo.hasPower = true ;//默认有权限
        }
        return vo ;
    }
    /**
     * 此方法供子模块系统调用,所以不公开在API接口中
     * 方法功能:验证是否已经登录,如果登录了,再验证权限