Pu Zhibing
2025-06-12 82118a47410c89e1d9751b3fa7814cc97c3b16da
更新司机端中台接口
18个文件已修改
12个文件已添加
849 ■■■■■ 已修改文件
DriverQYTTravel/guns-admin/lib/cas-client-oncon-3.0.5.jar 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/lib/cas-client-oncon-core-1.2.2.jar 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/lib/javabase64-1.3.1.jar 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/lib/openApiClient-1.0.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/pom.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/web/WebConfig.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDFalconUtil.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EmployeeUtil.java 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EnterpriseUtil.java 158 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/SMSUtil.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/UserUtil.java 166 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/CheckEnterExist.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/CreateEnterprise.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/DeleteStafNodeRequest.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/EditStaffNodeRequest.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/EnterpriseInfo.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/GetStaffNodeRequest.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/ModifyEnterpriseInfoRequest.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/ModifyPwdRequest.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/RegisterViaMobile.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/RegisterViaMobileRequest.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/ResetPwdRequest.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/SaveStaffNodeRequest.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/resources/lib/cas-client-oncon-3.0.5.jar 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/resources/lib/cas-client-oncon-core-1.2.2.jar 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/resources/lib/javabase64-1.3.1.jar 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/main/resources/lib/openApiClient-1.0.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverQYTTravel/guns-admin/lib/cas-client-oncon-3.0.5.jar
Binary files differ
DriverQYTTravel/guns-admin/lib/cas-client-oncon-core-1.2.2.jar
Binary files differ
DriverQYTTravel/guns-admin/lib/javabase64-1.3.1.jar
Binary files differ
DriverQYTTravel/guns-admin/lib/openApiClient-1.0.0.jar
Binary files differ
DriverQYTTravel/guns-admin/pom.xml
@@ -213,6 +213,7 @@
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
        </dependency>
        <!--中台sdk-->
        <dependency>
            <groupId>com.zhongtai</groupId>
@@ -224,14 +225,14 @@
        <!--单点登录sdk-->
        <dependency>
            <groupId>com.cas</groupId>
            <artifactId>cas-sdk</artifactId>
            <artifactId>cas-client-oncon</artifactId>
            <version>3.0.5</version>
            <scope>system</scope>
            <systemPath>${pom.basedir}/lib/cas-client-oncon-3.0.5.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.cas</groupId>
            <artifactId>cas-sdk</artifactId>
            <artifactId>cas-client-oncon-core</artifactId>
            <version>1.2.2</version>
            <scope>system</scope>
            <systemPath>${pom.basedir}/lib/cas-client-oncon-core-1.2.2.jar</systemPath>
@@ -259,6 +260,7 @@
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
@@ -295,7 +297,7 @@
        
        <resources>
            <resource>
                <directory>lib</directory>
                <directory>${project.basedir}/lib</directory>
                <targetPath>/BOOT-INF/lib/</targetPath>
                <includes>
                    <include>**/*.jar</include>
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/web/WebConfig.java
@@ -8,11 +8,9 @@
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import com.stylefeng.guns.config.properties.GunsProperties;
import com.stylefeng.guns.core.intercept.RestApiInteceptor;
import com.stylefeng.guns.core.listener.ConfigListener;
import com.stylefeng.guns.core.xss.XssFilter;
import edu.yale.its.tp.cas.client.filter.OnconMDWebCasFilter;
import org.jasig.cas.client.session.SingleSignOutFilter;
import org.jasig.cas.client.session.SingleSignOutHttpSessionListener;
import org.springframework.aop.Advisor;
import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.aop.support.JdkRegexpMethodPointcut;
@@ -23,12 +21,11 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
/**
@@ -57,11 +54,10 @@
    /**
     * 增加对rest api鉴权的spring mvc拦截器
     */
    //舍弃原有的权限校验功能
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new RestApiInteceptor()).addPathPatterns("/api/**");
//    }
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new RestApiInteceptor()).addPathPatterns("/api/**");
    }
    
    /**
     * druidServlet注册
@@ -175,63 +171,4 @@
        defaultKaptcha.setConfig(config);
        return defaultKaptcha;
    }
    /********************黔云通单点登录拦截器**********************/
//    @Override
//    public void addViewControllers(ViewControllerRegistry registry) {
//        registry.addViewController("/index").setViewName("index");
//    }
    @Bean
    public FilterRegistrationBean getOnconMDWebCasFilter() {
        OnconMDWebCasFilter onconMDWebCasFilter = new OnconMDWebCasFilter();
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(onconMDWebCasFilter);
        List<String> urlPatterns = new ArrayList<String>();
        urlPatterns.add("/*");//拦截路径,可以添加多个
        registrationBean.setUrlPatterns(urlPatterns);
        registrationBean.setOrder(2);
        registrationBean.addInitParameter("oncon.com.security.urls", "/api/**");
        registrationBean.addInitParameter("erp.si-tech.com.cn.noCheckUrl", "/index,/ajaxgetticket.jsp,/ssoAutologin.jsp,/login.jsp,/nologingetuserinfo.jsp,/toautologin.jsp,/autologin.jsp,/remotelogin.jsp,/toremotelogin.jsp,/js/**,/remoteloginajax.jsp");
        registrationBean.addInitParameter("erp.si-tech.com.cn.nologinstatus", "/*");
        registrationBean.addInitParameter("erp.si-tech.com.cn.loginstatus", "/login.jsp,/nologingetuserinfo.jsp");
        registrationBean.addInitParameter("com.oncon.sso.urlparams.nologin", "code,code2");
        registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.loginUrl", "https://testsso1.teamshub.com/login");
        registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.validateUrl", "https://testsso1.teamshub.com/serviceValidate");
        registrationBean.addInitParameter("com.oncon.md.loginUrl", "https://testsso1.teamshub.com/sso-session/login");
        registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.serverName", "172.26.200.34:9180");
        registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.casServiceUrlForStatic", "http://172.26.200.34:9180/sso-springboot-client/getUserInfo");
        registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.loginatUrlForStatic", "");
        registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.loginFailedUrlForStatic", "http://172.26.200.34:9180/error.html");
        return registrationBean;
    }
    @Bean
    public FilterRegistrationBean getSingleSignOutFilter() {
        SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter();
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(singleSignOutFilter);
        List<String> urlPatterns = new ArrayList<String>();
        urlPatterns.add("/api/**");//拦截路径,可以添加多个
        registrationBean.setUrlPatterns(urlPatterns);
        registrationBean.setOrder(1);
        registrationBean.addInitParameter("wmall.flag", "false");
        return registrationBean;
    }
    @Bean
    public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> getSingleSignOutHttpSessionListener() {
        ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> servletListenerRegistrationBean
                = new ServletListenerRegistrationBean<>();
        servletListenerRegistrationBean.setListener(new SingleSignOutHttpSessionListener());
        return servletListenerRegistrationBean;
    }
}
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -24,6 +24,7 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
@@ -1451,7 +1452,7 @@
    public ResultUtil cancellation(HttpServletRequest request){
        try {
            Integer driverId = driverService.getUserIdFormRedis(request);
            if(null == driverId){
            if (null == driverId) {
                return ResultUtil.tokenErr();
            }
            Driver driver = driverService.selectById(driverId);
@@ -1459,7 +1460,7 @@
            driverService.updateById(driver);
            //开始验证当前账号是否在别处登录
            String value = redisUtil.getValue("DRIVER_" + driverId);
            if(ToolUtil.isNotEmpty(value)){//将另外设备上的强迫下线
            if (ToolUtil.isNotEmpty(value)) {//将另外设备上的强迫下线
                //开始清除redis中无效的数据
                String key = redisUtil.getValue("DRIVER_" + driver.getPhone());
                redisUtil.remove(key);//删除个人信息数据
@@ -1467,9 +1468,22 @@
                redisUtil.remove("DRIVER_" + driverId);//清除存储的token
            }
            return ResultUtil.success();
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @GetMapping("/base/driver/getDriverInfo")
    public void getDriverInfo(String lsu, String ssologinid, String ticket, HttpSession session) {
        try {
            String onconParam = edu.yale.its.tp.cas.client.Util.getOnconParam(session);
            onconParam = new String(Base64.getDecoder().decode(onconParam), "UTF-8");
            System.err.println("lsu: " + lsu + ",ticket: " + ticket + ",ssologinid: " + ssologinid);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDFalconUtil.java
@@ -14,8 +14,6 @@
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.Map;
/**
 * 高德猎鹰服务
@@ -42,7 +40,7 @@
     */
    @Override
    public void run(ApplicationArguments args) throws Exception {
        this.init();
//        this.init();
    }
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EmployeeUtil.java
@@ -34,27 +34,34 @@
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content="";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> contentMap = new HashMap<String, Object>();
        Date nowdate = new Date();
        SimpleDateFormat date=new SimpleDateFormat("yyyyMMddHHmmss");
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-","");
        request.put(SystemParameterNames.getAppKey(), appKey);
        request.put(SystemParameterNames.getMessage_id(), messageId);
        request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        request.put("content", content);
        log.info("【企业增加员工】请求参数:" + JSON.toJSONString(request));
        String result = OpenApiClient.sendCommonHttpRequst(url,headers,"POST",skprivateKeyFile,timeStamp,request);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        contentMap.put(SystemParameterNames.getAppKey(), appKey);
        contentMap.put(SystemParameterNames.getMessage_id(), messageId);
        contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        contentMap.put("content", JSON.toJSONString(request));
        log.info("【企业增加员工】请求地址:" + url);
        log.info("【企业增加员工】请求参数:" + JSON.toJSONString(contentMap));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap);
        log.info("【企业增加员工】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
        if(!"0".equals(status)){
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【企业增加员工】请求失败:" + result);
            return false;
            throw new RuntimeException("【企业增加员工】请求失败:" + result);
        }
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【企业增加员工】失败:" + object.toJSONString());
            throw new RuntimeException("【企业增加员工】失败:" + object.toJSONString());
        }
        return true;
    }
@@ -72,27 +79,34 @@
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content="";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> contentMap = new HashMap<String, Object>();
        Date nowdate = new Date();
        SimpleDateFormat date=new SimpleDateFormat("yyyyMMddHHmmss");
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-","");
        request.put(SystemParameterNames.getAppKey(), appKey);
        request.put(SystemParameterNames.getMessage_id(), messageId);
        request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        request.put("content", content);
        log.info("【企业修改员工信息】请求参数:" + JSON.toJSONString(request));
        String result = OpenApiClient.sendCommonHttpRequst(url,headers,"POST",skprivateKeyFile,timeStamp,request);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        contentMap.put(SystemParameterNames.getAppKey(), appKey);
        contentMap.put(SystemParameterNames.getMessage_id(), messageId);
        contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        contentMap.put("content", JSON.toJSONString(request));
        log.info("【企业修改员工信息】请求地址:" + url);
        log.info("【企业修改员工信息】请求参数:" + JSON.toJSONString(contentMap));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap);
        log.info("【企业修改员工信息】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
        if(!"0".equals(status)){
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【企业修改员工信息】请求失败:" + result);
            return false;
            throw new RuntimeException("【企业修改员工信息】请求失败:" + result);
        }
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【企业修改员工信息】失败:" + object.toJSONString());
            throw new RuntimeException("【企业修改员工信息】失败:" + object.toJSONString());
        }
        return true;
    }
@@ -110,27 +124,35 @@
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content="";//业务参数
        String content = "";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> contentMap = new HashMap<String, Object>();
        Date nowdate = new Date();
        SimpleDateFormat date=new SimpleDateFormat("yyyyMMddHHmmss");
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-","");
        request.put(SystemParameterNames.getAppKey(), appKey);
        request.put(SystemParameterNames.getMessage_id(), messageId);
        request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        request.put("content", content);
        log.info("【企业删除人员】请求参数:" + JSON.toJSONString(request));
        String result = OpenApiClient.sendCommonHttpRequst(url,headers,"POST",skprivateKeyFile,timeStamp,request);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        contentMap.put(SystemParameterNames.getAppKey(), appKey);
        contentMap.put(SystemParameterNames.getMessage_id(), messageId);
        contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        contentMap.put("content", JSON.toJSONString(request));
        log.info("【企业删除人员】请求地址:" + url);
        log.info("【企业删除人员】请求参数:" + JSON.toJSONString(contentMap));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap);
        log.info("【企业删除人员】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
        if(!"0".equals(status)){
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【企业删除人员】请求失败:" + result);
            return false;
            throw new RuntimeException("【企业删除人员】请求失败:" + result);
        }
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【企业删除人员】失败:" + object.toJSONString());
            throw new RuntimeException("【企业删除人员】失败:" + object.toJSONString());
        }
        return true;
    }
@@ -148,29 +170,36 @@
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content="";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> contentMap = new HashMap<String, Object>();
        Date nowdate = new Date();
        SimpleDateFormat date=new SimpleDateFormat("yyyyMMddHHmmss");
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-","");
        request.put(SystemParameterNames.getAppKey(), appKey);
        request.put(SystemParameterNames.getMessage_id(), messageId);
        request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        request.put("content", content);
        log.info("【根据员工ID获取人员信息】请求参数:" + JSON.toJSONString(request));
        String result = OpenApiClient.sendCommonHttpRequst(url,headers,"GET",skprivateKeyFile,timeStamp,request);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        contentMap.put(SystemParameterNames.getAppKey(), appKey);
        contentMap.put(SystemParameterNames.getMessage_id(), messageId);
        contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        contentMap.put("content", JSON.toJSONString(request));
        log.info("【根据员工ID获取人员信息】请求地址:" + url);
        log.info("【根据员工ID获取人员信息】请求参数:" + JSON.toJSONString(contentMap));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "GET", skprivateKeyFile, timeStamp, contentMap);
        log.info("【根据员工ID获取人员信息】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
        if(!"0".equals(status)){
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【根据员工ID获取人员信息】请求失败:" + result);
            return null;
            throw new RuntimeException("【根据员工ID获取人员信息】请求失败:" + result);
        }
        StaffNodeInfo staffNodeInfo = jsonObject.getObject("data", StaffNodeInfo.class);
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【根据员工ID获取人员信息】失败:" + object.toJSONString());
            throw new RuntimeException("【根据员工ID获取人员信息】失败:" + object.toJSONString());
        }
        StaffNodeInfo staffNodeInfo = jsonObject.getObject("object", StaffNodeInfo.class);
        return staffNodeInfo;
    }
}
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EnterpriseUtil.java
@@ -4,14 +4,9 @@
import com.alibaba.fastjson.JSONObject;
import com.open.common.util.OpenApiClient;
import com.open.common.util.SystemParameterNames;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.CheckEnterExist;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.CreateEnterpriseRequest;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.EnterpriseInfo;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.ModifyEnterpriseInfoRequest;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.*;
import lombok.extern.slf4j.Slf4j;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
@@ -41,31 +36,36 @@
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content = "";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> request = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<>();
        Date nowdate = new Date();
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        request.put(SystemParameterNames.getAppKey(), appKey);
        request.put(SystemParameterNames.getMessage_id(), messageId);
        request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        request.put("content", content);
        request.put("uscc", uscc);
        log.info("【根据社会信用代码判断企业是否已存在】请求参数:" + JSON.toJSONString(request));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, request);
        map.put(SystemParameterNames.getAppKey(), appKey);
        map.put(SystemParameterNames.getMessage_id(), messageId);
        map.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        map.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        map.put("content", "{\"uscc\":\"" + uscc + "\"}");
        log.info("【根据社会信用代码判断企业是否已存在】请求地址:" + url);
        log.info("【根据社会信用代码判断企业是否已存在】请求参数:" + JSON.toJSONString(map));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, map);
        log.info("【根据社会信用代码判断企业是否已存在】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
        if (!"0".equals(status)) {
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【根据社会信用代码判断企业是否已存在】请求失败:" + result);
            return null;
            throw new RuntimeException("【根据社会信用代码判断企业是否已存在】请求失败:" + result);
        }
        return jsonObject.getObject("data", CheckEnterExist.class);
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【根据社会信用代码判断企业是否已存在】失败:" + object.toJSONString());
            throw new RuntimeException("【根据社会信用代码判断企业是否已存在】失败:" + object.toJSONString());
        }
        return jsonObject.getObject("object", CheckEnterExist.class);
    }
    
    
@@ -82,31 +82,36 @@
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content = "";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> request = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<>();
        Date nowdate = new Date();
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        request.put(SystemParameterNames.getAppKey(), appKey);
        request.put(SystemParameterNames.getMessage_id(), messageId);
        request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        request.put("content", content);
        request.put("enterName", enterName);
        log.info("【根据企业名称判断企业是否已存在】请求参数:" + JSON.toJSONString(request));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, request);
        map.put(SystemParameterNames.getAppKey(), appKey);
        map.put(SystemParameterNames.getMessage_id(), messageId);
        map.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        map.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        map.put("content", "{\"enterName\":\"" + enterName + "\"}");
        log.info("【根据企业名称判断企业是否已存在】请求地址:" + url);
        log.info("【根据企业名称判断企业是否已存在】请求参数:" + JSON.toJSONString(map));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, map);
        log.info("【根据企业名称判断企业是否已存在】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
        if (!"0".equals(status)) {
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【根据企业名称判断企业是否已存在】请求失败:" + result);
            return null;
            throw new RuntimeException("【根据企业名称判断企业是否已存在】请求失败:" + result);
        }
        return jsonObject.getObject("data", CheckEnterExist.class);
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【根据企业名称判断企业是否已存在】失败:" + object.toJSONString());
            throw new RuntimeException("【根据企业名称判断企业是否已存在】失败:" + object.toJSONString());
        }
        return jsonObject.getObject("object", CheckEnterExist.class);
    }
    
    
@@ -123,31 +128,36 @@
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content = "";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> request = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<>();
        Date nowdate = new Date();
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        request.put(SystemParameterNames.getAppKey(), appKey);
        request.put(SystemParameterNames.getMessage_id(), messageId);
        request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        request.put("content", content);
        request.put("enter_code", enter_code);
        log.info("【查询企业详情】请求参数:" + JSON.toJSONString(request));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "GET", skprivateKeyFile, timeStamp, request);
        map.put(SystemParameterNames.getAppKey(), appKey);
        map.put(SystemParameterNames.getMessage_id(), messageId);
        map.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        map.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        map.put("content", "{\"enter_code\":\"" + enter_code + "\"}");
        log.info("【查询企业详情】请求地址:" + url);
        log.info("【查询企业详情】请求参数:" + JSON.toJSONString(map));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, map);
        log.info("【查询企业详情】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
        if (!"0".equals(status)) {
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【查询企业详情】请求失败:" + result);
            return null;
            throw new RuntimeException("【查询企业详情】请求失败:" + result);
        }
        EnterpriseInfo enterpriseInfo = jsonObject.getObject("data", EnterpriseInfo.class);
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【查询企业详情】失败:" + object.toJSONString());
            throw new RuntimeException("【查询企业详情】失败:" + object.toJSONString());
        }
        EnterpriseInfo enterpriseInfo = jsonObject.getObject("object", EnterpriseInfo.class);
        return enterpriseInfo;
    }
    
@@ -165,21 +175,22 @@
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content = "";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> map = new HashMap<>();
        Date nowdate = new Date();
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        request.put(SystemParameterNames.getAppKey(), appKey);
        request.put(SystemParameterNames.getMessage_id(), messageId);
        request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        request.put("content", content);
        log.info("【修改企业基本信息】请求参数:" + JSON.toJSONString(request));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "GET", skprivateKeyFile, timeStamp, request);
        map.put(SystemParameterNames.getAppKey(), appKey);
        map.put(SystemParameterNames.getMessage_id(), messageId);
        map.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        map.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        map.put("content", JSON.toJSONString(request));
        log.info("【修改企业基本信息】请求地址:" + url);
        log.info("【修改企业基本信息】请求参数:" + JSON.toJSONString(map));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "GET", skprivateKeyFile, timeStamp, map);
        log.info("【修改企业基本信息】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
@@ -197,9 +208,9 @@
     * @param request
     * @return
     */
    public static Boolean createEnterprise(CreateEnterpriseRequest request) {
    public static CreateEnterprise createEnterprise(CreateEnterpriseRequest request) {
        //请求路径
        String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.1/createEnterprise";
        String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/createEnterprise";
        //私钥文件
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
@@ -217,35 +228,24 @@
        map.put(SystemParameterNames.getMessage_id(), messageId);
        map.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        map.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        map.put("content", content);
        Class<? extends CreateEnterpriseRequest> clazz = request.getClass();
        Field[] declaredFields = clazz.getDeclaredFields();
        for (Field declaredField : declaredFields) {
            String name = declaredField.getName();
            Object invoke = null;
            try {
                invoke = clazz.getMethod("get" + name.substring(0, 1).toUpperCase() + name.substring(1)).invoke(request);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
            } catch (InvocationTargetException e) {
                throw new RuntimeException(e);
            } catch (NoSuchMethodException e) {
                throw new RuntimeException(e);
            }
            map.put(name, invoke);
        }
        map.put("content", JSON.toJSONString(request));
        
        log.info("【创建企业】请求地址:" + url);
        log.info("【创建企业】请求参数:" + JSON.toJSONString(map));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, map);
        log.info("【创建企业】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String resCode = jsonObject.getString("resCode");
        String status = jsonObject.getString("status");
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【创建企业】请求失败:" + result);
            return null;
        }
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【创建企业】请求失败:" + result);
            return false;
            return null;
        }
        return true;
        return object.getObject("data", CreateEnterprise.class);
    }
}
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java
@@ -23,7 +23,7 @@
     * 1:生产环境
     * 2:测试环境
     */
    String status = "2";
    String status = "1";
    /**
     * API地址
     */
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/SMSUtil.java
New file
@@ -0,0 +1,67 @@
package com.stylefeng.guns.modular.system.util.qianyuntong;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.open.common.util.OpenApiClient;
import com.open.common.util.SystemParameterNames;
import lombok.extern.slf4j.Slf4j;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
 * 短信工具类
 * @author zhibing.pu
 * @Date 2025/6/10 10:48
 */
@Slf4j
public class SMSUtil {
    /**
     * 获取易信验证码
     * @param mobile
     * @return
     */
    public static String sendVerifyCode(String mobile) {
        //请求路径
        String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/sendVerifyCode";
        //私钥文件
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> contentMap = new HashMap<String, Object>();
        Date nowdate = new Date();
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        contentMap.put(SystemParameterNames.getAppKey(), appKey);
        contentMap.put(SystemParameterNames.getMessage_id(), messageId);
        contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        contentMap.put("content", "{\"mobile\":\"" + mobile + "\"}");
        log.info("【获取易信验证码】请求地址:" + url);
        log.info("【获取易信验证码】请求参数:" + JSON.toJSONString(contentMap));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap);
        log.info("【获取易信验证码】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【获取易信验证码】请求失败:" + result);
            throw new RuntimeException("【获取易信验证码】请求失败:" + result);
        }
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【获取易信验证码】失败:" + object.toJSONString());
            throw new RuntimeException("【获取易信验证码】失败:" + object.toJSONString());
        }
        return object.getString("code");
    }
}
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/UserUtil.java
@@ -1,18 +1,15 @@
package com.stylefeng.guns.modular.system.util.qianyuntong;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.open.common.util.OpenApiClient;
import com.open.common.util.SystemParameterNames;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.QYTUserInfo;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.RegisterViaMobileRequest;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.*;
import lombok.extern.slf4j.Slf4j;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.*;
/**
 * 用户工具类
@@ -25,19 +22,18 @@
    
    
    /**
     * 根据手机号和企业编号查询用户信息
     * 根据手机号码获取人员信息
     *
     * @param mobile   手机号码
     * @param enterNum 企业编号
     */
    public static QYTUserInfo getUserInfoByPhone(String mobile, String enterNum) {
    public static List<QYTUserInfo> getUserInfoByPhone(String mobile, String enterNum) {
        //请求路径
        String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/getUserInfoByPhone";
        //私钥文件
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content = "";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> contentMap = new HashMap<String, Object>();
@@ -50,20 +46,31 @@
        contentMap.put(SystemParameterNames.getMessage_id(), messageId);
        contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        contentMap.put("content", content);
        contentMap.put("mobile", mobile);
        contentMap.put("enterNum", enterNum);
        contentMap.put("content", "{\"mobile\":\"" + mobile + "\",\"enterNum\":\"" + enterNum + "\"}");
        log.info("【根据手机号和企业编号查询用户信息】请求地址:" + url);
        log.info("【根据手机号和企业编号查询用户信息】请求参数:" + JSON.toJSONString(contentMap));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "GET", skprivateKeyFile, timeStamp, contentMap);
        log.info("【根据手机号和企业编号查询用户信息】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
        if (!"0".equals(status)) {
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【根据手机号和企业编号查询用户信息】请求失败:" + result);
            return null;
            throw new RuntimeException("【根据手机号和企业编号查询用户信息】请求失败:" + result);
        }
        QYTUserInfo userInfo = jsonObject.getObject("data", QYTUserInfo.class);
        return userInfo;
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【根据手机号和企业编号查询用户信息】失败:" + object.toJSONString());
            throw new RuntimeException("【根据手机号和企业编号查询用户信息】失败:" + object.toJSONString());
        }
        JSONArray data = object.getJSONArray("data");
        List<QYTUserInfo> list = new ArrayList<>();
        for (int i = 0; i < data.size(); i++) {
            data.getJSONObject(i).getString("enter_code");
            QYTUserInfo userInfo = data.getObject(i, QYTUserInfo.class);
            list.add(userInfo);
        }
        return list;
    }
    
    
@@ -73,34 +80,133 @@
     * @param request
     * @return
     */
    public static Boolean registerViaMobile(RegisterViaMobileRequest request) {
    public static RegisterViaMobile registerViaMobile(RegisterViaMobileRequest request) {
        //请求路径
        String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/getUserInfoByPhone";
        String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/m1_register_via_mobile";
        //私钥文件
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        String content = "";//业务参数
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> contentMap = new HashMap<String, Object>();
        Date nowdate = new Date();
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        request.put(SystemParameterNames.getAppKey(), appKey);
        request.put(SystemParameterNames.getMessage_id(), messageId);
        request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        request.put("content", content);
        log.info("【根据手机号注册用户】请求参数:" + JSON.toJSONString(request));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, request);
        contentMap.put(SystemParameterNames.getAppKey(), appKey);
        contentMap.put(SystemParameterNames.getMessage_id(), messageId);
        contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        contentMap.put("content", JSON.toJSONString(request));
        log.info("【根据手机号注册用户】请求地址:" + url);
        log.info("【根据手机号注册用户】请求参数:" + JSON.toJSONString(contentMap));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap);
        log.info("【根据手机号注册用户】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String status = jsonObject.getString("status");
        if (!"0".equals(status)) {
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【根据手机号注册用户】请求失败:" + result);
            return false;
            throw new RuntimeException("【根据手机号注册用户】请求失败:" + result);
        }
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【根据手机号注册用户】失败:" + object.toJSONString());
            throw new RuntimeException("【根据手机号注册用户】失败:" + object.toJSONString());
        }
        return jsonObject.getObject("object", RegisterViaMobile.class);
    }
    /**
     * 易信用户修改密码
     *
     * @param request
     * @return
     */
    public static Boolean modifyPwd(ModifyPwdRequest request) {
        //请求路径
        String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/modifyPwd";
        //私钥文件
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> contentMap = new HashMap<String, Object>();
        Date nowdate = new Date();
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        contentMap.put(SystemParameterNames.getAppKey(), appKey);
        contentMap.put(SystemParameterNames.getMessage_id(), messageId);
        contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        contentMap.put("content", JSON.toJSONString(request));
        log.info("【易信用户修改密码】请求地址:" + url);
        log.info("【易信用户修改密码】请求参数:" + JSON.toJSONString(contentMap));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap);
        log.info("【易信用户修改密码】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【易信用户修改密码】请求失败:" + result);
            throw new RuntimeException("【易信用户修改密码】请求失败:" + result);
        }
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【易信用户修改密码】失败:" + object.toJSONString());
            throw new RuntimeException("【易信用户】失败:" + object.toJSONString());
        }
        return true;
    }
    /**
     * 易信重置密码
     *
     * @param request
     * @return
     */
    public static Boolean resetPwd(ResetPwdRequest request) {
        //请求路径
        String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/resetPwd";
        //私钥文件
        String skprivateKeyFile = QianYunTongProperties.privateKeyPath;
        //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密
        String appKey = QianYunTongProperties.appkey;//appkey
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        Map<String, Object> contentMap = new HashMap<String, Object>();
        Date nowdate = new Date();
        SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss");
        String timeStamp = date.format(nowdate);
        String messageId = UUID.randomUUID().toString().replaceAll("-", "");
        contentMap.put(SystemParameterNames.getAppKey(), appKey);
        contentMap.put(SystemParameterNames.getMessage_id(), messageId);
        contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName);
        contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status);
        contentMap.put("content", JSON.toJSONString(request));
        log.info("【易信重置密码】请求地址:" + url);
        log.info("【易信重置密码】请求参数:" + JSON.toJSONString(contentMap));
        String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap);
        log.info("【易信重置密码】请求结果:" + result);
        JSONObject jsonObject = JSON.parseObject(result);
        String retCode = jsonObject.getString("retCode");
        if (!"0".equals(retCode)) {
            log.error("【易信重置密码】请求失败:" + result);
            throw new RuntimeException("【易信重置密码】请求失败:" + result);
        }
        JSONObject object = jsonObject.getJSONObject("object");
        String status = object.getString("status");
        if (!"0".equals(status)) {
            log.error("【易信重置密码】失败:" + object.toJSONString());
            throw new RuntimeException("【易信重置密码】失败:" + object.toJSONString());
        }
        return true;
    }
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/CheckEnterExist.java
@@ -9,6 +9,10 @@
@Data
public class CheckEnterExist {
    /**
     * 企业ID
     */
    private String id;
    /**
     * 是否在公有云注册,1:已注册;0:未注册
     */
    private String isReg;
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/CreateEnterprise.java
@@ -9,6 +9,38 @@
@Data
public class CreateEnterprise {
    /**
     *
     * 企业ID
     */
    private String id;
    /**
     * 开通易信状态
     * 0:成功 1:失败
     */
    private String callYixinApi;
    /**
     * 开通办公门户状态
     * 0:成功 1:失败
     */
    private String callItdSaveCompany;
    /**
     * 开通企业官网状态
     * 0:成功 1:失败
     */
    private String callItdDredgeWebsite;
    /**
     * 电话号码
     */
    private String phone;
    /**
     * 企业idcode
     */
    private String idCode;
    /**
     * 企业节点ID
     */
    private String noteId;
    /**
     * 是否新注册企业
     */
    private String isNew;
}
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/DeleteStafNodeRequest.java
@@ -2,14 +2,12 @@
import lombok.Data;
import java.util.HashMap;
/**
 * @author zhibing.pu
 * @Date 2025/6/6 16:39
 */
@Data
public class DeleteStafNodeRequest extends HashMap<String, Object> {
public class DeleteStafNodeRequest {
    /**
     * 人员ID
     */
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/EditStaffNodeRequest.java
@@ -2,14 +2,12 @@
import lombok.Data;
import java.util.HashMap;
/**
 * @author zhibing.pu
 * @Date 2025/6/6 16:32
 */
@Data
public class EditStaffNodeRequest extends HashMap<String, Object> {
public class EditStaffNodeRequest {
    /**
     * 人员ID
     */
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/EnterpriseInfo.java
@@ -9,6 +9,10 @@
@Data
public class EnterpriseInfo {
    /**
     * 企业ID
     */
    private String id;
    /**
     * 企业编号
     */
    private String enter_code;
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/GetStaffNodeRequest.java
@@ -2,14 +2,12 @@
import lombok.Data;
import java.util.HashMap;
/**
 * @author zhibing.pu
 * @Date 2025/6/6 16:42
 */
@Data
public class GetStaffNodeRequest extends HashMap<String, Object> {
public class GetStaffNodeRequest {
    /**
     * 人员ID
     */
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/ModifyEnterpriseInfoRequest.java
@@ -2,14 +2,12 @@
import lombok.Data;
import java.util.HashMap;
/**
 * @author zhibing.pu
 * @Date 2025/6/9 18:13
 */
@Data
public class ModifyEnterpriseInfoRequest extends HashMap<String, Object> {
public class ModifyEnterpriseInfoRequest {
    /**
     * 企业编码
     */
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/ModifyPwdRequest.java
New file
@@ -0,0 +1,25 @@
package com.stylefeng.guns.modular.system.util.qianyuntong.model;
import lombok.Data; /**
 * @author zhibing.pu
 * @Date 2025/6/10 10:42
 */
@Data
public class ModifyPwdRequest {
    /**
     * 手机号码
     */
    private String mobile;
    /**
     * 旧密码
     */
    private String oldPwd;
    /**
     * 新密码
     */
    private String newPwd;
    /**
     * 验证码
     */
    private String code;
}
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/RegisterViaMobile.java
New file
@@ -0,0 +1,26 @@
package com.stylefeng.guns.modular.system.util.qianyuntong.model;
import lombok.Data; /**
 * @author zhibing.pu
 * @Date 2025/6/10 11:34
 */
@Data
public class RegisterViaMobile {
    /**
     * 响应码
     * 0:成功;1:失败;2:手机号非法;3:验证码已过期;4:验证码错误;5、用户已存在;9:弱密码
     */
    private String status;
    /**
     * 响应描述
     */
    private String desc;
    /**
     * web登录密码
     */
    private String password;
    /**
     * 用户UUID
     */
    private String onconUUID;
}
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/RegisterViaMobileRequest.java
@@ -2,14 +2,12 @@
import lombok.Data;
import java.util.HashMap;
/**
 * @author zhibing.pu
 * @Date 2025/6/6 16:59
 */
@Data
public class RegisterViaMobileRequest extends HashMap<String, Object> {
public class RegisterViaMobileRequest {
    /**
     * 手机号码
     */
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/ResetPwdRequest.java
New file
@@ -0,0 +1,27 @@
package com.stylefeng.guns.modular.system.util.qianyuntong.model;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2025/6/10 10:42
 */
@Data
public class ResetPwdRequest {
    /**
     * 手机号码
     */
    private String mobile;
    /**
     * 密码
     */
    private String password;
    /**
     * 验证码
     */
    private String code;
    /**
     * 客户端appid
     */
    private String appid;
}
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/SaveStaffNodeRequest.java
@@ -2,14 +2,12 @@
import lombok.Data;
import java.util.HashMap;
/**
 * @author zhibing.pu
 * @Date 2025/6/6 16:22
 */
@Data
public class SaveStaffNodeRequest extends HashMap<String, Object> {
public class SaveStaffNodeRequest {
    /**
     * 操作人手机号
     */
@@ -45,7 +43,7 @@
    /**
     * 员工所属部分ID
     */
    private String deptIds;
    private Long deptIds;
    /**
     * 员工职务ID
     */
DriverQYTTravel/guns-admin/src/main/resources/lib/cas-client-oncon-3.0.5.jar
DriverQYTTravel/guns-admin/src/main/resources/lib/cas-client-oncon-core-1.2.2.jar
DriverQYTTravel/guns-admin/src/main/resources/lib/javabase64-1.3.1.jar
DriverQYTTravel/guns-admin/src/main/resources/lib/openApiClient-1.0.0.jar
DriverQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java
@@ -1,7 +1,7 @@
package com.stylefeng.guns;
import com.stylefeng.guns.modular.system.util.qianyuntong.EnterpriseUtil;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.CreateEnterpriseRequest;
import com.stylefeng.guns.modular.system.util.qianyuntong.EmployeeUtil;
import com.stylefeng.guns.modular.system.util.qianyuntong.model.SaveStaffNodeRequest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
@@ -14,13 +14,65 @@
    
    @Test
    public void test() throws Exception {
        CreateEnterpriseRequest request = new CreateEnterpriseRequest();
        request.setName("成都喜望科技有限公司");
        request.setNickName("成都喜望");
        request.setIndustry_code("123456789");
//        CreateEnterpriseRequest request = new CreateEnterpriseRequest();
//        request.setName("成都喜望科技有限公司");
//        request.setNickName("成都喜望");
//        request.setIndustry_code("123456789");
//        request.setMobile("15828353127");
//        request.setMobileFlag("1");
//        EnterpriseUtil.createEnterprise(request);
        //短信
//        SMSUtil.sendVerifyCode("15828353127");
//        CheckEnterExist checkEnterNameExist = EnterpriseUtil.checkEnterNameExist("成都喜望科技有限公司");
//        EnterpriseInfo enterpriseDetail = EnterpriseUtil.getEnterpriseDetail(checkEnterNameExist.getEnterCode());
//        System.out.println(enterpriseDetail);
//        List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone("15828353127", "981100006005878");
//        RegisterViaMobileRequest request = new RegisterViaMobileRequest();
//        request.setMobile("15828353126");
//        request.setPassword("123456");
//        request.setNickname("测试");
//        request.setVerify_code("1111");
//        request.setVerify_code_type("1");
//        RegisterViaMobile registerViaMobile = UserUtil.registerViaMobile(request);
//        ModifyPwdRequest request = new ModifyPwdRequest();
//        request.setMobile("15828353126");
//        request.setOldPwd("111111");
//        request.setNewPwd("654321");
//        request.setCode("1111");
//        UserUtil.modifyPwd(request);
//        ResetPwdRequest request = new ResetPwdRequest();
//        request.setMobile("15828353126");
//        request.setPassword("654321");
//        request.setCode("1111");
//        UserUtil.resetPwd(request);
        SaveStaffNodeRequest request = new SaveStaffNodeRequest();
        request.setMobile("15828353127");
        request.setMobileFlag("1");
        Boolean enterprise = EnterpriseUtil.createEnterprise(request);
        request.setEntercode("981100006005878");
        request.setEmpName("超级管理员");
        request.setEmpNickname("超级管理员");
        request.setLoginNo("18200000000");
        request.setEmpSex("男");
        request.setMphone("18200000000");
        request.setEmail("sn93@qq.com");
        request.setDeptIds(0L);
        request.setPositionId(1L);
        request.setSuperLevel(0);
        request.setHideMobile(0);
        EmployeeUtil.saveStaffNode(request);
//        GetStaffNodeRequest request = new GetStaffNodeRequest();
//        request.setEmpId(1L);
//        request.setMobile("15828353127");
//        request.setEntercode("981100006005878");
//        EmployeeUtil.getStaffNode(request);
        
    }
}