1 文件已重命名
2个文件已删除
16个文件已修改
55个文件已添加
| | |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.fasterxml.jackson.core</groupId> |
| | | <artifactId>jackson-core</artifactId> |
| | | <version>2.11.3</version> |
| | | </dependency> |
| | | |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.springframework.boot</groupId>--> |
| | | <!--<artifactId>spring-boot-starter-tomcat</artifactId>--> |
| | | <!--<scope>provided</scope>--> |
| | | <!--</dependency>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>javax.servlet</groupId>--> |
| | | <!--<artifactId>javax.servlet-api</artifactId>--> |
| | | <!--<version>3.1.0</version>--> |
| | | <!--<scope>provided</scope>--> |
| | | <!--</dependency>--> |
| | | |
| | | |
| | | <!--shiro依赖--> |
| | |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>redis.clients</groupId> |
| | | <artifactId>jedis</artifactId> |
| | | <version>2.9.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | <groupId>org.slf4j</groupId> |
| | | <artifactId>slf4j-api</artifactId> |
| | | </dependency> |
| | | |
| | | <!--中台sdk--> |
| | | <dependency> |
| | | <groupId>com.zhongtai</groupId> |
| | | <artifactId>zhongtai-sdk</artifactId> |
| | | <version>1.0.0</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/openApiClient-1.0.0.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-httpclient</groupId> |
| | | <artifactId>commons-httpclient</artifactId> |
| | | <version>3.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>it.sauronsoftware</groupId> |
| | | <artifactId>base64</artifactId> |
| | | <version>1.3.1</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/javabase64-1.3.1.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ncoss</groupId> |
| | | <artifactId>ncoss-java-sdk</artifactId> |
| | | <version>1.0.5</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/ncoss-java-sdk-1.0.5.jar</systemPath> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("超省新代驾") |
| | | .title("黔云通代驾") |
| | | .description("所有接口前需要加 /driver 前缀,例如:/driver/base/agreement/queryByType <br>" + |
| | | "所有以 /api/*** 路径的接口需要上传签名参数sign") |
| | | // .termsOfServiceUrl("http://git.oschina.net/naan1993/guns") |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.heredata.hos.model.bucket.Bucket; |
| | | import com.supersavedriving.driver.modular.system.dao.MonthOrderMapper; |
| | | import com.supersavedriving.driver.modular.system.model.*; |
| | | import com.supersavedriving.driver.modular.system.service.*; |
| | | import com.supersavedriving.driver.modular.system.util.ALiSendSms; |
| | | import com.supersavedriving.driver.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.supersavedriving.driver.modular.system.util.MallBook.util.RSASignature; |
| | | import com.supersavedriving.driver.modular.system.util.MiniPay.MiniAppPay; |
| | | import com.supersavedriving.driver.modular.system.util.huawei.OBSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.huawei.SMSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.juhe.OCRUtil; |
| | | import com.supersavedriving.driver.modular.system.util.qianyuntong.NCOSSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.qianyuntong.QianYunTongConfig; |
| | | import com.supersavedriving.driver.modular.system.util.qianyuntong.SMSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.qianyuntong.model.SendSmsRequest; |
| | | import com.supersavedriving.driver.modular.system.util.separateAccounts.StrUtil; |
| | | import com.supersavedriving.driver.modular.system.util.separateAccounts.TransferUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | |
| | | |
| | | @Autowired |
| | | private TCheckFacilitatorService checkFacilitatorService; |
| | | |
| | | @Resource |
| | | private QianYunTongConfig qianYunTongConfig; |
| | | |
| | | |
| | | |
| | |
| | | return ResponseWarpper.success(ResultUtil.error("账号已冻结")); |
| | | } |
| | | } |
| | | String numberRandom = UUIDUtil.getNumberRandom(5); |
| | | // SMSUtil.send(phone, "1d0f0cbe5b214b0d8efa891730eb532a", "[\"" + numberRandom + "\"]"); |
| | | String sData = aLiSendSms.sendSms(phone,"SMS_154775435", "{\"code\":\"" + numberRandom + "\"}"); |
| | | |
| | | String numberRandom = UUIDUtil.getNumberRandom(4); |
| | | SendSmsRequest request = new SendSmsRequest(); |
| | | request.setDestAddress(phone); |
| | | request.setTemplateId("TPL202410290001"); |
| | | Map<String, String> templateParams = new HashMap<>(); |
| | | templateParams.put("code", numberRandom); |
| | | request.setTemplateParams(templateParams); |
| | | request.setCode("code"); |
| | | request.setSpId("T8d5hdfg"); |
| | | SMSUtil.sendSms(request); |
| | | redisUtil.setStrValue(receiver + phone, numberRandom, 300);//5分钟有效期 |
| | | return ResponseWarpper.success(ResultUtil.success()); |
| | | }catch (Exception e){ |
| | |
| | | InputStream inputStream = file.getInputStream(); |
| | | String name = file.getOriginalFilename(); |
| | | name = UUIDUtil.getRandomCode() + name.substring(name.lastIndexOf(".")); |
| | | String s = OBSUtil.putObjectToBucket(inputStream, name); |
| | | return ResponseWarpper.success(s); |
| | | QianYunTongConfig qianYunTongConfig1 = qianYunTongConfig.getQianYunTongConfig(); |
| | | String bucketName = qianYunTongConfig1.getBucketName(); |
| | | Bucket grjyTest = NCOSSUtil.getBucketInfo(bucketName); |
| | | if (null == grjyTest) { |
| | | //创建桶 |
| | | Boolean bucket = NCOSSUtil.createBucket(bucketName); |
| | | if (!bucket) { |
| | | throw new RuntimeException("创建存储桶失败"); |
| | | } |
| | | //设置桶策略 |
| | | String policyText = "{\"Version\":\"2025-06-23\",\"Statement\":[{\"Sid\":\"Stmt20250623\",\"Action\":[\"GetObject\"],\"Effect\":\"Allow\",\"Resource\":\"" + bucketName + "/*\",\"Principal\":\"*\"}]}"; |
| | | Boolean bucketPolicy = NCOSSUtil.setBucketPolicy(bucketName, policyText); |
| | | if (!bucketPolicy) { |
| | | throw new RuntimeException("设置桶策略失败"); |
| | | } |
| | | } |
| | | //上传对象 |
| | | String key = "imgs/daijia/user/" + name; |
| | | String object = NCOSSUtil.putObject(bucketName, key, inputStream); |
| | | if (null == object) { |
| | | throw new RuntimeException("上传图片失败"); |
| | | } |
| | | return ResponseWarpper.success("https://traffic.qytzt.cn/v1/AUTH_" + qianYunTongConfig1.getAccount() + "/" + bucketName + "/" + key); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | |
| | | <select id="queryDriverOrderList" resultType="com.supersavedriving.driver.modular.system.warpper.DriverOrderListWarpper"> |
| | | select |
| | | id, |
| | | '超省新代驾订单' as title, |
| | | '黔云通代驾订单' as title, |
| | | UNIX_TIMESTAMP(createTime) * 1000 as createTime, |
| | | startAddress, |
| | | endAddress, |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.heredata.hos.model.bucket.Bucket; |
| | | import com.supersavedriving.driver.core.common.constant.JwtConstants; |
| | | import com.supersavedriving.driver.core.shiro.ShiroKit; |
| | | import com.supersavedriving.driver.core.shiro.ShiroUser; |
| | |
| | | import com.supersavedriving.driver.modular.system.util.MiniPay.MiniAppPay; |
| | | import com.supersavedriving.driver.modular.system.util.huawei.OBSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.mongodb.model.Location; |
| | | import com.supersavedriving.driver.modular.system.util.qianyuntong.NCOSSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.qianyuntong.QianYunTongConfig; |
| | | import com.supersavedriving.driver.modular.system.util.rongyun.RongYunUtil; |
| | | import com.supersavedriving.driver.modular.system.util.weChat.WeChatUtil; |
| | | import com.supersavedriving.driver.modular.system.util.weChat.model.Code2Session; |
| | |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | @Autowired |
| | | private WeChatUtil weChatUtil; |
| | | |
| | | @Resource |
| | | private QianYunTongConfig qianYunTongConfig; |
| | | |
| | | @Autowired |
| | | private IDriverOnlineTimeService driverOnlineTimeService; |
| | |
| | | //生成小程序二维码 |
| | | public String wechatMiniProgramORCode(Integer driverId) throws Exception{ |
| | | InputStream release = weChatUtil.getwxacodeunlimit("pages/index/index", "driverId=" + driverId, "release"); |
| | | String s = OssUploadUtil.ossUpload(release, "driver_" + driverId + "_" + UUIDUtil.getNumberRandom(5) + ".jpg"); |
| | | return s; |
| | | String pictureName = "driver_" + driverId + ".png"; |
| | | QianYunTongConfig qianYunTongConfig1 = qianYunTongConfig.getQianYunTongConfig(); |
| | | String bucketName = qianYunTongConfig1.getBucketName(); |
| | | Bucket grjyTest = NCOSSUtil.getBucketInfo(bucketName); |
| | | if (null == grjyTest) { |
| | | //创建桶 |
| | | Boolean bucket = NCOSSUtil.createBucket(bucketName); |
| | | if (!bucket) { |
| | | throw new RuntimeException("创建存储桶失败"); |
| | | } |
| | | //设置桶策略 |
| | | String policyText = "{\"Version\":\"2025-06-23\",\"Statement\":[{\"Sid\":\"Stmt20250623\",\"Action\":[\"GetObject\"],\"Effect\":\"Allow\",\"Resource\":\"" + bucketName + "/*\",\"Principal\":\"*\"}]}"; |
| | | Boolean bucketPolicy = NCOSSUtil.setBucketPolicy(bucketName, policyText); |
| | | if (!bucketPolicy) { |
| | | throw new RuntimeException("设置桶策略失败"); |
| | | } |
| | | } |
| | | //上传对象 |
| | | String key = "imgs/daijia/driver/" + pictureName; |
| | | String object = NCOSSUtil.putObject(bucketName, key, release); |
| | | if (null == object) { |
| | | throw new RuntimeException("上传图片失败"); |
| | | } |
| | | |
| | | return "https://traffic.qytzt.cn/v1/AUTH_" + qianYunTongConfig1.getAccount() + "/" + bucketName + "/" + key; |
| | | } |
| | | //司机下单二维码 |
| | | public String wechatMiniOrderQRCode(Integer driverId) throws Exception{ |
| | | InputStream release = weChatUtil.getwxacodeunlimitOrder("pages/index/index", "driverIds=" + driverId, "release"); |
| | | String s = OssUploadUtil.ossUpload(release, "driverOrder_" + driverId + "_" + UUIDUtil.getNumberRandom(5) + ".jpg"); |
| | | return s; |
| | | String pictureName = "driver_" + driverId + ".png"; |
| | | QianYunTongConfig qianYunTongConfig1 = qianYunTongConfig.getQianYunTongConfig(); |
| | | String bucketName = qianYunTongConfig1.getBucketName(); |
| | | Bucket grjyTest = NCOSSUtil.getBucketInfo(bucketName); |
| | | if (null == grjyTest) { |
| | | //创建桶 |
| | | Boolean bucket = NCOSSUtil.createBucket(bucketName); |
| | | if (!bucket) { |
| | | throw new RuntimeException("创建存储桶失败"); |
| | | } |
| | | //设置桶策略 |
| | | String policyText = "{\"Version\":\"2025-06-23\",\"Statement\":[{\"Sid\":\"Stmt20250623\",\"Action\":[\"GetObject\"],\"Effect\":\"Allow\",\"Resource\":\"" + bucketName + "/*\",\"Principal\":\"*\"}]}"; |
| | | Boolean bucketPolicy = NCOSSUtil.setBucketPolicy(bucketName, policyText); |
| | | if (!bucketPolicy) { |
| | | throw new RuntimeException("设置桶策略失败"); |
| | | } |
| | | } |
| | | //上传对象 |
| | | String key = "imgs/daijia/driver/" + pictureName; |
| | | String object = NCOSSUtil.putObject(bucketName, key, release); |
| | | if (null == object) { |
| | | throw new RuntimeException("上传图片失败"); |
| | | } |
| | | |
| | | return "https://traffic.qytzt.cn/v1/AUTH_" + qianYunTongConfig1.getAccount() + "/" + bucketName + "/" + key; |
| | | } |
| | | |
| | | |
| | |
| | | public boolean authentication(String name, String code){ |
| | | String url = "https://safrvcert.market.alicloudapi.com/safrv_2meta_id_name/"; |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Authorization", "APPCODE b7d32437d08149099457dcb50fb57df2"); |
| | | header.put("Authorization", "APPCODE 111"); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("__userId", "1732960796168165"); |
| | | param.put("verifyKey", "IVO4js5kValcdt"); |
| | | param.put("__userId", "111"); |
| | | param.put("verifyKey", "111"); |
| | | param.put("userName", name); |
| | | param.put("identifyNum", code); |
| | | String get = null; |
| | |
| | | @Component |
| | | public class ChinaMobileUtil { |
| | | |
| | | private String APIKey = "zj42494b1bdd416b9762229af6b5cbbd"; |
| | | private String APIKey = "111"; |
| | | |
| | | private String SecretKey = "30323561316534653735613230316339"; |
| | | private String SecretKey = "111"; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 高德key |
| | | */ |
| | | String key = "5053ca611c0106e01a665ce7ab84ff26"; |
| | | String key = "ea7326a77175aba0e9435859b17bca36"; |
| | | } |
| | |
| | | public class OssUploadUtil { |
| | | //OSS图片访问域名 |
| | | public static String oss_domain = "https://newok.oss-cn-shenzhen.aliyuncs.com/"; |
| | | public static String accessKeyId = "LTAI5tLPQCnW4CWk9hd1uxSM"; |
| | | public static String accessKeySecret = "Efm7ZgHQ0136Dyf8a7KxnmfQtchEt7"; |
| | | public static String bucketName="newok"; |
| | | public static String accessKeyId = "111"; |
| | | public static String accessKeySecret = "111"; |
| | | public static String bucketName="11"; |
| | | public static String endpoint = "oss-cn-shenzhen.aliyuncs.com"; |
| | | |
| | | public static OSSClient ossClient = new OSSClient(endpoint, accessKeyId,accessKeySecret); |
| | |
| | | package com.supersavedriving.driver.modular.system.util; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.supersavedriving.driver.modular.system.warpper.PushCheckOrderInfoWarpper; |
| | |
| | | |
| | | Logger logger = LoggerFactory.getLogger("ServiceLog"); |
| | | |
| | | @Autowired |
| | | private RestTemplate internalRestTemplate; |
| | | private final String socket_uri = "http://192.168.110.85:6000"; |
| | | |
| | | |
| | | |
| | |
| | | msg.put("data", new Object()); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | return jsonObject1.getIntValue("code"); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | return 200; |
| | | } |
| | | |
| | | |
| | |
| | | msg.put("data", new Object()); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | msg.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | msg.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | msg.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | msg.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | msg.put("data", pushOrderInfoWarpper); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | msg.put("data", pushCheckOrderInfoWarpper); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | msg.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | msg.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | msg.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", msg.toJSONString()); |
| | | params.put("id", id.toString()); |
| | | params.put("type", type.toString()); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | }else{ |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.supersavedriving.driver.modular.system.util; |
| | | |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | | import redis.clients.jedis.Jedis; |
| | | import redis.clients.jedis.JedisPool; |
| | | import redis.clients.jedis.Pipeline; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import javax.annotation.Resource; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | import java.util.UUID; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | |
| | | /** |
| | |
| | | @Component |
| | | public class RedisUtil { |
| | | |
| | | @Autowired |
| | | private JedisPool jedisPool; |
| | | |
| | | private Timer timer; |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | |
| | | /** |
| | |
| | | * @param value |
| | | */ |
| | | public void setStrValue(String key, String value){ |
| | | if(ToolUtil.isNotEmpty(key) && ToolUtil.isNotEmpty(value)){ |
| | | Jedis resource = jedisPool.getResource(); |
| | | String set = resource.set(key, value); |
| | | closeJedis(resource); |
| | | } |
| | | redisTemplate.opsForValue().set(key, value); |
| | | } |
| | | |
| | | |
| | |
| | | * @param time 秒 |
| | | */ |
| | | public void setStrValue(String key, String value, int time){ |
| | | if(ToolUtil.isNotEmpty(key) && ToolUtil.isNotEmpty(value)){ |
| | | Jedis resource = jedisPool.getResource(); |
| | | String setex = resource.setex(key, time, value); |
| | | closeJedis(resource); |
| | | } |
| | | redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public String getValue(String key){ |
| | | if(ToolUtil.isNotEmpty(key)){ |
| | | Jedis resource = jedisPool.getResource(); |
| | | String data = resource.get(key); |
| | | closeJedis(resource); |
| | | return data; |
| | | } |
| | | return null; |
| | | return (String) redisTemplate.opsForValue().get(key); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 批量获取 |
| | | * @param kes |
| | | * @return |
| | | */ |
| | | public List<Object> getValues(List<String> kes){ |
| | | if(null != kes){ |
| | | Jedis resource = jedisPool.getResource(); |
| | | Pipeline pipelined = resource.pipelined(); |
| | | for(String key : kes){ |
| | | pipelined.get(key); |
| | | } |
| | | List<Object> list = pipelined.syncAndReturnAll(); |
| | | |
| | | closeJedis(resource); |
| | | pipelined.clear(); |
| | | try { |
| | | pipelined.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | List<Object> data = new ArrayList<>(); |
| | | for(Object o : list){ |
| | | if(null != o){ |
| | | data.add(o); |
| | | } |
| | | } |
| | | return data; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | * @param key |
| | | */ |
| | | public void remove(String key){ |
| | | if(ToolUtil.isNotEmpty(key)){ |
| | | Jedis resource = jedisPool.getResource(); |
| | | Long del = resource.del(key); |
| | | closeJedis(resource); |
| | | } |
| | | redisTemplate.delete(key); |
| | | } |
| | | |
| | | |
| | |
| | | * @param members |
| | | */ |
| | | public void addSetValue(String key, String...members){ |
| | | if(ToolUtil.isNotEmpty(key) && ToolUtil.isNotEmpty(members)){ |
| | | Jedis resource = jedisPool.getResource(); |
| | | Long sadd = resource.sadd(key, members); |
| | | resource.close(); |
| | | } |
| | | redisTemplate.opsForSet().add(key, members); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public Set<String> getSetAllValue(String key){ |
| | | Set<String> smembers = new HashSet<>(); |
| | | if(ToolUtil.isNotEmpty(key)){ |
| | | Jedis resource = jedisPool.getResource(); |
| | | smembers = resource.smembers(key); |
| | | resource.close(); |
| | | } |
| | | redisTemplate.opsForSet().members(key).forEach(member -> { |
| | | smembers.add(member.toString()); |
| | | }); |
| | | return smembers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void delSetValue(String key, String...members){ |
| | | if(ToolUtil.isNotEmpty(key) && ToolUtil.isNotEmpty(members)){ |
| | | Jedis resource = jedisPool.getResource(); |
| | | Long sadd = resource.srem(key, members); |
| | | resource.close(); |
| | | redisTemplate.opsForSet().remove(key, members); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除资源 |
| | | * @param jedis |
| | | */ |
| | | public void closeJedis(Jedis jedis){ |
| | | if(null != jedis){ |
| | | jedis.close(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public boolean lock(String key, String value, int time){ |
| | | if(!StringUtils.isEmpty(key)){ |
| | | key += "_lock"; |
| | | Jedis resource = jedisPool.getResource(); |
| | | String set = resource.set(key, value, "nx", "ex", time); |
| | | if("OK".equals(set)){ |
| | | String finalKey = key; |
| | | timer = new Timer(); |
| | | timer.schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | Jedis resource = jedisPool.getResource(); |
| | | resource.setex(finalKey, time, value); |
| | | resource.close(); |
| | | } |
| | | }, 1000, 500); |
| | | } |
| | | resource.close(); |
| | | return "OK".equals(set) ? true : false; |
| | | } |
| | | return false; |
| | | return redisTemplate.opsForValue().setIfAbsent(key, value); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public boolean unlock(String key){ |
| | | if(!StringUtils.isEmpty(key)){ |
| | | key += "_lock"; |
| | | Jedis resource = jedisPool.getResource(); |
| | | timer.cancel();//取消定时任务 |
| | | Long del = resource.del(key); |
| | | resource.close(); |
| | | return del != 0 ? true : false; |
| | | } |
| | | return false; |
| | | return redisTemplate.delete(key); |
| | | } |
| | | |
| | | /** |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util; |
| | | |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class SpringContextsUtil implements ApplicationContextAware{ |
| | | |
| | | private static ApplicationContext applicationContext; |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| | | if (SpringContextsUtil.applicationContext == null) { |
| | | SpringContextsUtil.applicationContext = applicationContext; |
| | | } |
| | | } |
| | | // 获取applicationContext |
| | | public static ApplicationContext getApplicationContext() { |
| | | return applicationContext; |
| | | } |
| | | // 通过name获取 Bean. |
| | | public static Object getBean(String name) { |
| | | return getApplicationContext().getBean(name); |
| | | } |
| | | // 通过class获取Bean. |
| | | public static <T> T getBean(Class<T> clazz) { |
| | | return getApplicationContext().getBean(clazz); |
| | | } |
| | | // 通过name,以及Clazz返回指定的Bean |
| | | public static <T> T getBean(String name, Class<T> clazz) { |
| | | System.out.println(getApplicationContext().getBean(name, clazz)); |
| | | return getApplicationContext().getBean(name, clazz); |
| | | } |
| | | |
| | | } |
File was renamed from driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/util/huawei/SMSUtil.java |
| | |
| | | * @author zhibing.pu |
| | | * @date 2023/3/15 11:23 |
| | | */ |
| | | public class SMSUtil { |
| | | public class HWSMSUtil { |
| | | //无需修改,用于格式化鉴权头域,给"X-WSSE"参数赋值 |
| | | private static final String WSSE_HEADER_FORMAT = "UsernameToken Username=\"%s\",PasswordDigest=\"%s\",Nonce=\"%s\",Created=\"%s\""; |
| | | //无需修改,用于格式化鉴权头域,给"Authorization"参数赋值 |
| | |
| | | public static void send(String phones, String templateId, String templateParas) throws Exception { |
| | | //必填,请参考"开发准备"获取如下数据,替换为实际值 |
| | | String url = "https://smsapi.cn-south-1.myhuaweicloud.com:443/sms/batchSendSms/v1"; //APP接入地址(在控制台"应用管理"页面获取)+接口访问URI |
| | | String appKey = "9I0xrhdGXthf1fv9nn8G3glZ6Zng"; //APP_Key |
| | | String appSecret = "U7WxwX2LVk2YD6KAHxjc9tdnXoM9"; //APP_Secret |
| | | String sender = "8823031523874"; //国内短信签名通道号或国际/港澳台短信通道号 |
| | | String appKey = "111"; //APP_Key |
| | | String appSecret = "111"; //APP_Secret |
| | | String sender = "111"; //国内短信签名通道号或国际/港澳台短信通道号 |
| | | // String templateId = "8ff55eac1d0b478ab3c06c3c6a492300"; //模板ID |
| | | |
| | | //条件必填,国内短信关注,当templateId指定的模板类型为通用模板时生效且必填,必须是已审核通过的,与模板类型一致的签名名称 |
| | | //国际/港澳台短信不用关注该参数 |
| | | String signature = "超省新代驾"; //签名名称 |
| | | String signature = "111"; //签名名称 |
| | | |
| | | //必填,全局号码格式(包含国家码),示例:+8615123456789,多个号码之间用英文逗号分隔 |
| | | // String receiver = "+86151****6789,+86152****7890"; //短信接收人号码 |
| | |
| | | public class OBSUtil { |
| | | |
| | | public static String endPoint = "https://obs.cn-south-1.myhuaweicloud.com"; |
| | | public static String ak = "N52IGR6DHOC3JAZFHZIW"; |
| | | public static String sk = "jq7Q7jnFS4Gxamwh3naN2sbNKwQQ7cZISPVumGBS"; |
| | | public static String bucketname = "csxdj"; |
| | | public static String ak = "111"; |
| | | public static String sk = "111"; |
| | | public static String bucketname = "11"; |
| | | |
| | | /** |
| | | * 上传文件 |
| | |
| | | |
| | | static Logger logger = LoggerFactory.getLogger("ServiceLog"); |
| | | |
| | | private final static String key = "105ce593e7a01deaa457c3c69b26fe08"; |
| | | private final static String key = "111"; |
| | | |
| | | private static HttpClientUtil httpClientUtil = new HttpClientUtil(); |
| | | |
| | |
| | | |
| | | private final static String bad_weather = "[{\"wid\":\"03\",\"weather\":\"阵雨\"},{\"wid\":\"04\",\"weather\":\"雷阵雨\"},{\"wid\":\"05\",\"weather\":\"雷阵雨伴有冰雹\"},{\"wid\":\"06\",\"weather\":\"雨夹雪\"},{\"wid\":\"07\",\"weather\":\"小雨\"},{\"wid\":\"08\",\"weather\":\"中雨\"},{\"wid\":\"09\",\"weather\":\"大雨\"},{\"wid\":\"10\",\"weather\":\"暴雨\"},{\"wid\":\"11\",\"weather\":\"大暴雨\"},{\"wid\":\"12\",\"weather\":\"特大暴雨\"},{\"wid\":\"13\",\"weather\":\"阵雪\"},{\"wid\":\"14\",\"weather\":\"小雪\"},{\"wid\":\"15\",\"weather\":\"中雪\"},{\"wid\":\"16\",\"weather\":\"大雪\"},{\"wid\":\"17\",\"weather\":\"暴雪\"},{\"wid\":\"19\",\"weather\":\"冻雨\"},{\"wid\":\"20\",\"weather\":\"沙尘暴\"},{\"wid\":\"21\",\"weather\":\"小到中雨\"},{\"wid\":\"22\",\"weather\":\"中到大雨\"},{\"wid\":\"23\",\"weather\":\"大到暴雨\"},{\"wid\":\"24\",\"weather\":\"暴雨到大暴雨\"},{\"wid\":\"25\",\"weather\":\"大暴雨到特大暴雨\"},{\"wid\":\"26\",\"weather\":\"小到中雪\"},{\"wid\":\"27\",\"weather\":\"中到大雪\"},{\"wid\":\"28\",\"weather\":\"大到暴雪\"},{\"wid\":\"30\",\"weather\":\"扬沙\"},{\"wid\":\"31\",\"weather\":\"强沙尘暴\"},{\"wid\":\"53\",\"weather\":\"霾\"}]"; |
| | | |
| | | private final static String key = "aaebb3e5c18fd371257a2ab6b5670efe"; |
| | | private final static String key = "111"; |
| | | |
| | | private static HttpClientUtil httpClientUtil = new HttpClientUtil(); |
| | | |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong; |
| | | |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | |
| | | public class AESUtils { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(AESUtils.class); |
| | | private static String ALG = "AES"; |
| | | private static String CHARSET = "UTF-8"; |
| | | private static String KEY1 = "lur8apa4zu484pvj"; |
| | | |
| | | public AESUtils() { |
| | | } |
| | | |
| | | private static byte[] encrypt(byte[] content, String password, String iv) { |
| | | try { |
| | | SecretKeySpec key = new SecretKeySpec(password.getBytes(CHARSET), ALG); |
| | | Cipher cipher = Cipher.getInstance(ALG); |
| | | cipher.init(1, key); |
| | | return cipher.doFinal(content); |
| | | } catch (NoSuchAlgorithmException var5) { |
| | | var5.printStackTrace(); |
| | | } catch (NoSuchPaddingException var6) { |
| | | var6.printStackTrace(); |
| | | } catch (InvalidKeyException var7) { |
| | | var7.printStackTrace(); |
| | | } catch (UnsupportedEncodingException var8) { |
| | | var8.printStackTrace(); |
| | | } catch (IllegalBlockSizeException var9) { |
| | | var9.printStackTrace(); |
| | | } catch (BadPaddingException var10) { |
| | | var10.printStackTrace(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private static byte[] decrypt(byte[] content, String password, String iv) { |
| | | try { |
| | | SecretKeySpec key = new SecretKeySpec(password.getBytes(CHARSET), ALG); |
| | | Cipher cipher = Cipher.getInstance(ALG); |
| | | cipher.init(2, key); |
| | | return cipher.doFinal(content); |
| | | } catch (NoSuchAlgorithmException var5) { |
| | | var5.printStackTrace(); |
| | | } catch (NoSuchPaddingException var6) { |
| | | var6.printStackTrace(); |
| | | } catch (InvalidKeyException var7) { |
| | | var7.printStackTrace(); |
| | | } catch (IllegalBlockSizeException var8) { |
| | | var8.printStackTrace(); |
| | | } catch (BadPaddingException var9) { |
| | | var9.printStackTrace(); |
| | | } catch (UnsupportedEncodingException var10) { |
| | | var10.printStackTrace(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private static String parseByte2HexStr(byte[] buf) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | |
| | | for(int i = 0; i < buf.length; ++i) { |
| | | String hex = Integer.toHexString(buf[i] & 255); |
| | | if (hex.length() == 1) { |
| | | hex = '0' + hex; |
| | | } |
| | | |
| | | sb.append(hex.toUpperCase()); |
| | | } |
| | | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | private static byte[] parseHexStr2Byte(String hexStr) { |
| | | if (hexStr.length() < 1) { |
| | | return null; |
| | | } else { |
| | | byte[] result = new byte[hexStr.length() / 2]; |
| | | |
| | | for(int i = 0; i < hexStr.length() / 2; ++i) { |
| | | int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16); |
| | | int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), 16); |
| | | result[i] = (byte)(high * 16 + low); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | public static String decryptHex(String content) { |
| | | return decryptHex(content, KEY1); |
| | | } |
| | | |
| | | public static String decryptHex(String content, String password) { |
| | | try { |
| | | return new String(decrypt(parseHexStr2Byte(content), password, ""), CHARSET); |
| | | } catch (Exception var3) { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String decryptBase64(String content) { |
| | | try { |
| | | return decryptBase64(content, KEY1); |
| | | } catch (Exception var2) { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String decryptBase64(String content, String password) { |
| | | try { |
| | | return new String(decrypt(Base64.decodeBase64(content), password, ""), CHARSET); |
| | | } catch (Exception var3) { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String encryptHex(String content) { |
| | | return encryptHex(content, KEY1); |
| | | } |
| | | |
| | | public static String encryptHex(String content, String password) { |
| | | try { |
| | | return parseByte2HexStr(encrypt(content.getBytes(CHARSET), password, "")); |
| | | } catch (Exception var3) { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String encryptBase64(String content) { |
| | | return encryptBase64(content, KEY1); |
| | | } |
| | | |
| | | public static String encryptBase64(String content, String password) { |
| | | try { |
| | | return Base64.encodeBase64String(encrypt(content.getBytes(CHARSET), password, "")); |
| | | } catch (Exception var3) { |
| | | logger.error("", var3); |
| | | return ""; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.Gson; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.supersavedriving.user.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.user.modular.system.util.SpringContextsUtil; |
| | | import com.supersavedriving.user.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; |
| | | |
| | | /** |
| | | * 企业员工工具类 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:17 |
| | | */ |
| | | @Slf4j |
| | | public class EmployeeUtil { |
| | | |
| | | private static QianYunTongConfig qianYunTongConfig = SpringContextsUtil.getBean(QianYunTongConfig.class).getQianYunTongConfig(); |
| | | |
| | | public static void main(String[] args) { |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile("15828353127"); |
| | | request.setEntercode("981100006005951"); |
| | | request.setEmpName("蒲"); |
| | | request.setEmpNickname("蒲"); |
| | | request.setLoginNo("15828353125"); |
| | | request.setEmpSex("男"); |
| | | request.setMphone("15828353125"); |
| | | request.setEmail("15828353125@qyt.com"); |
| | | request.setDeptId(0); |
| | | request.setPositionId(1); |
| | | request.setSuperLevel(0); |
| | | request.setHideMobile(0); |
| | | ResultUtil<SaveStaffNode> resultUtil = EmployeeUtil.saveStaffNode(request); |
| | | System.out.println(resultUtil.getData()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 企业增加员工 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static ResultUtil<SaveStaffNode> saveStaffNode(SaveStaffNodeRequest request) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/saveStaffNode"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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); |
| | | String retMsg = jsonObject.getString("retMsg"); |
| | | retMsg = retMsg.substring(retMsg.indexOf("{")); |
| | | jsonObject = JSON.parseObject(retMsg); |
| | | return ResultUtil.error("【企业增加员工】请求失败:" + jsonObject.getString("msg")); |
| | | } |
| | | JSONObject object = jsonObject.getJSONObject("object"); |
| | | String status = object.getString("status"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【企业增加员工】失败:" + object.toJSONString()); |
| | | return ResultUtil.error("【企业增加员工】失败:" + object.getString("desc")); |
| | | } |
| | | SaveStaffNode saveStaffNode = object.getObject("data", SaveStaffNode.class); |
| | | return ResultUtil.success(saveStaffNode); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 企业修改员工信息 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean editStaffNode(EditStaffNodeRequest request){ |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/editStaffNode"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 ecrmDeleteStafNode(DeleteStafNodeRequest request){ |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/ecrmDeleteStafNode"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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("-", ""); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据员工ID获取人员信息 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static StaffNodeInfo getStaffNode(GetStaffNodeRequest request){ |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/getStaffNode"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 retCode = jsonObject.getString("retCode"); |
| | | if (!"0".equals(retCode)) { |
| | | log.error("【根据员工ID获取人员信息】请求失败:" + result); |
| | | return null; |
| | | } |
| | | JSONObject object = jsonObject.getJSONObject("object"); |
| | | String status = object.getString("status"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【根据员工ID获取人员信息】失败:" + object.toJSONString()); |
| | | return null; |
| | | } |
| | | StaffNodeInfo staffNodeInfo = object.getObject("data", StaffNodeInfo.class); |
| | | return staffNodeInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.Gson; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.supersavedriving.user.modular.system.util.SpringContextsUtil; |
| | | import com.supersavedriving.user.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; |
| | | |
| | | /** |
| | | * 企业工具类 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 17:06 |
| | | */ |
| | | @Slf4j |
| | | public class EnterpriseUtil { |
| | | |
| | | private static QianYunTongConfig qianYunTongConfig = SpringContextsUtil.getBean(QianYunTongConfig.class).getQianYunTongConfig(); |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // CheckEnterExist checkEnterNameExist = checkEnterNameExist("黔南云码通数字产业运营有限公司"); |
| | | // System.err.println(checkEnterNameExist); |
| | | |
| | | CreateEnterpriseRequest request = new CreateEnterpriseRequest(); |
| | | request.setName("成都喜望科技有限公司"); |
| | | request.setNickName("成都喜望"); |
| | | request.setIndustry_code("123456"); |
| | | request.setMobile("15828353127"); |
| | | CreateEnterprise enterprise = EnterpriseUtil.createEnterprise(request); |
| | | System.out.println(enterprise); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据社会信用代码判断企业是否已存在 |
| | | * |
| | | * @param uscc |
| | | * @return |
| | | */ |
| | | public static CheckEnterExist checkEnterExistByEnterIdCardNo(String uscc) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/check_enter_exist_by_enterIdCardNo"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | 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("-", ""); |
| | | map.put(SystemParameterNames.getAppKey(), appKey); |
| | | map.put(SystemParameterNames.getMessage_id(), messageId); |
| | | map.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | map.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | 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 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("【根据社会信用代码判断企业是否已存在】失败:" + object.toJSONString()); |
| | | return null; |
| | | } |
| | | return jsonObject.getObject("object", CheckEnterExist.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据企业名称判断企业是否已存在 |
| | | * |
| | | * @param enterName |
| | | * @return |
| | | */ |
| | | public static CheckEnterExist checkEnterNameExist(String enterName) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/checkEnterNameExist"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | 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("-", ""); |
| | | map.put(SystemParameterNames.getAppKey(), appKey); |
| | | map.put(SystemParameterNames.getMessage_id(), messageId); |
| | | map.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | map.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | 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 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("【根据企业名称判断企业是否已存在】失败:" + object.toJSONString()); |
| | | return null; |
| | | } |
| | | return jsonObject.getObject("object", CheckEnterExist.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询企业详情 |
| | | * |
| | | * @param enter_code 企业编号 |
| | | * @return |
| | | */ |
| | | public static EnterpriseInfo getEnterpriseDetail(String enter_code) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/getEnterpriseDetail"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | 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("-", ""); |
| | | map.put(SystemParameterNames.getAppKey(), appKey); |
| | | map.put(SystemParameterNames.getMessage_id(), messageId); |
| | | map.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | map.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | 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 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("【查询企业详情】失败:" + object.toJSONString()); |
| | | return null; |
| | | } |
| | | EnterpriseInfo enterpriseInfo = jsonObject.getObject("object", EnterpriseInfo.class); |
| | | return enterpriseInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改企业基本信息 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean modifyEnterpriseInfo(ModifyEnterpriseInfoRequest request) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/modifyEnterpriseInfo"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | 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("-", ""); |
| | | map.put(SystemParameterNames.getAppKey(), appKey); |
| | | map.put(SystemParameterNames.getMessage_id(), messageId); |
| | | map.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | map.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | map.put("content", new Gson().toJson(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"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【修改企业基本信息】请求失败:" + result); |
| | | throw new RuntimeException("【修改企业基本信息】请求失败:" + result); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 创建企业 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static CreateEnterprise createEnterprise(CreateEnterpriseRequest request) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/createEnterprise"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | map.put(SystemParameterNames.getAppKey(), appKey); |
| | | map.put(SystemParameterNames.getMessage_id(), messageId); |
| | | map.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | map.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | map.put("content", new Gson().toJson(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 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.getObject("data", CreateEnterprise.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除企业信息 |
| | | * |
| | | * @param enterNum 企业编号 |
| | | * @param operator 管理员手机号码 |
| | | * @return |
| | | */ |
| | | public static boolean delEnterprise(String enterNum, String operator) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/delCompany"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | map.put(SystemParameterNames.getAppKey(), appKey); |
| | | map.put(SystemParameterNames.getMessage_id(), messageId); |
| | | map.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | map.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | map.put("content", "{\"enterNum\":\"" + enterNum + "\",\"operator\":\"" + operator + "\"}"); |
| | | |
| | | 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 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; |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong; |
| | | |
| | | import com.heredata.hos.HOS; |
| | | import com.heredata.hos.HOSClientBuilder; |
| | | import com.heredata.hos.model.CreateBucketRequest; |
| | | import com.heredata.hos.model.HOSObject; |
| | | import com.heredata.hos.model.PutObjectRequest; |
| | | import com.heredata.hos.model.PutObjectResult; |
| | | import com.heredata.hos.model.bucket.Bucket; |
| | | import com.heredata.model.VoidResult; |
| | | import com.supersavedriving.user.modular.system.util.SpringContextsUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.io.InputStream; |
| | | |
| | | /** |
| | | * OSS 工具类 |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/23 17:50 |
| | | */ |
| | | @Slf4j |
| | | public class NCOSSUtil { |
| | | |
| | | private static QianYunTongConfig qianYunTongConfig = SpringContextsUtil.getBean(QianYunTongConfig.class).getQianYunTongConfig(); |
| | | |
| | | /** |
| | | * 创建桶 |
| | | * @param bucketName |
| | | * @return |
| | | */ |
| | | public static Boolean createBucket(String bucketName) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | // 创建请求对象,并且设置创建桶名为"example"的桶 |
| | | CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName); |
| | | VoidResult result = hos.createBucket(createBucketRequest); |
| | | if (result.getResponse().isSuccessful()) { |
| | | log.info("创建桶成功:" + bucketName); |
| | | return true; |
| | | } |
| | | } catch (Exception e){ |
| | | log.info("创建桶失败:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询桶详情 |
| | | * @param bucketName |
| | | * @return |
| | | */ |
| | | public static Bucket getBucketInfo(String bucketName) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | // 查询桶名为"example"的详情 |
| | | Bucket bucket = hos.getBucketInfo(bucketName); |
| | | return bucket; |
| | | } catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除桶 |
| | | * @param bucketName |
| | | * @return |
| | | */ |
| | | public static Boolean deleteBucket(String bucketName) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | VoidResult result = hos.deleteBucket(bucketName); |
| | | if (result.getResponse().isSuccessful()) { |
| | | log.info("删除桶成功:" + bucketName); |
| | | return true; |
| | | } |
| | | } catch (Exception e){ |
| | | log.info("删除桶成功:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置桶策略 |
| | | * @param bucketName 桶名 |
| | | * @param policyText 策略规则字符串 |
| | | * { |
| | | * // 策略配置的版本号,由用户定义 |
| | | * "Version": "2012-10-17", |
| | | * // 策略规则配置,可指定多条策略规则 |
| | | * "Statement": [{ |
| | | * // 策略规则ID,可用户指定,如不指定则服务自动生成一条 |
| | | * "Sid": "sid", |
| | | * // 策略规则指定的HOS API接口标识,可参照下表填写 |
| | | * "Action": [ |
| | | * "action" |
| | | * ], |
| | | * // 策略规则效果,具体表现为允许或拒绝,有效值为Allow(允许),Deny(拒绝); |
| | | * "Effect": "Allow", |
| | | * // 策略规则指定的资源参照下面resource配置 |
| | | * "Resource": "resource", |
| | | * // 策略规则指定的授权人 参照下面Principal配置 |
| | | * "Principal": { |
| | | * "HWS": [ |
| | | * "account_id:root" |
| | | * ] |
| | | * } |
| | | * } |
| | | * ] |
| | | * } |
| | | * @return |
| | | */ |
| | | public static Boolean setBucketPolicy(String bucketName, String policyText) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | // 桶策略字符串 |
| | | try { |
| | | VoidResult result = hos.setBucketPolicy(bucketName, policyText); |
| | | if (result.getResponse().isSuccessful()) { |
| | | log.info("设置桶策略成功:" + bucketName); |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("设置桶策略失败:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上传对象 |
| | | * @param bucketName 桶名称 |
| | | * @param key 存储文件名 |
| | | * @param inputStream 上传文件流 |
| | | * @return 对象唯一标识 |
| | | */ |
| | | public static String putObject(String bucketName, String key, InputStream inputStream) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, key , inputStream); |
| | | PutObjectResult example = hos.putObject(putObjectRequest); |
| | | if (example.getResponse().isSuccessful()) { |
| | | log.info("上传对象成功:" + bucketName + "--->" + key); |
| | | return example.getETag(); |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("上传对象成功:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询对象 |
| | | * @param bucketName 桶名称 |
| | | * @param key 存储文件名 |
| | | * @return |
| | | */ |
| | | public static HOSObject getObject(String bucketName, String key) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | HOSObject example = hos.getObject(bucketName, key); |
| | | if (example.getResponse().isSuccessful()) { |
| | | log.info("查询对象成功:" + bucketName + "--->" + key); |
| | | return example; |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("查询对象失败:" + bucketName); |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除对象 |
| | | * @param bucketName 桶名称 |
| | | * @param key 存储文件名 |
| | | * @return |
| | | */ |
| | | public static Boolean deleteObject(String bucketName, String key) { |
| | | /** |
| | | * endPoint:HOS的基础路径(公共前缀) |
| | | * account:账户的ID |
| | | * accessKey:向UAAS服务请求到的access_key |
| | | * secretKey:向UAAS服务请求到的secret_key |
| | | */ |
| | | HOS hos = new HOSClientBuilder().build(qianYunTongConfig.getEndPoint(), qianYunTongConfig.getAccount(), qianYunTongConfig.getAccessKey(), qianYunTongConfig.getSecretKey()); |
| | | try { |
| | | VoidResult example = hos.deleteObject(bucketName, key); |
| | | if (example.getResponse().isSuccessful()) { |
| | | log.info("删除对象成功:" + bucketName + "--->" + key); |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("删除对象失败:" + bucketName + "--->" + key); |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.Gson; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.supersavedriving.user.modular.system.util.SpringContextsUtil; |
| | | import com.supersavedriving.user.modular.system.util.UUIDUtil; |
| | | import com.supersavedriving.user.modular.system.util.qianyuntong.model.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.net.InetAddress; |
| | | import java.net.UnknownHostException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 9:34 |
| | | */ |
| | | @Slf4j |
| | | public class OrderUtil { |
| | | |
| | | private static QianYunTongConfig qianYunTongConfig = SpringContextsUtil.getBean(QianYunTongConfig.class).getQianYunTongConfig(); |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | //创建行程 |
| | | // CreateTravelItineraryRequest request = new CreateTravelItineraryRequest(); |
| | | // request.setScene("TRAFFIC"); |
| | | // request.setPartnerId("522700"); |
| | | // request.setOrderNo("3456789012345678"); |
| | | // request.setCustomerId("11448156"); |
| | | // request.setDriverId("11448158"); |
| | | // request.setSupplierShopId("981100006005951"); |
| | | // request.setServiceType(1); |
| | | // String travelItinerary = createTravelItinerary(request); |
| | | // System.err.println(travelItinerary);//1951088602595872768 |
| | | |
| | | //修改行程状态 |
| | | // ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | // request.setScene("TRAFFIC"); |
| | | // request.setPartnerId("522700"); |
| | | // request.setOrderId("1951088602595872768"); |
| | | // request.setStatus(7); |
| | | // request.setDriverId("11448158"); |
| | | // request.setSupplierShopId("981100006005951"); |
| | | // Boolean aBoolean = modifyTravelItinerary(request); |
| | | |
| | | //订单创建及拉起支付 |
| | | // TradeOrderCreateData tradeOrderCreateData = new TradeOrderCreateData(); |
| | | // tradeOrderCreateData.setScene("TRAFFIC"); |
| | | // tradeOrderCreateData.setPartnerId("522700"); |
| | | // tradeOrderCreateData.setTreatShopId("11448158"); |
| | | // tradeOrderCreateData.setOrderAppId("52270015"); |
| | | // tradeOrderCreateData.setField1("{\"profitSharing\":\"1\",\"isPromote\":\"0\"}"); |
| | | // tradeOrderCreateData.setCharge(new BigDecimal("0.01")); |
| | | // tradeOrderCreateData.setChannelSource("GRJYCXWXXCX"); |
| | | // tradeOrderCreateData.setOrderId("1951088602595872768"); |
| | | // tradeOrderCreateData.setOrderNo("3456789012345678"); |
| | | // tradeOrderCreateData.setCustomerId("11448156"); |
| | | // tradeOrderCreateData.setPayPartnerId("5400004"); |
| | | // tradeOrderCreateData.setPartnerPayId("1951088602595872768"); |
| | | // tradeOrderCreateData.setCurrency("RMB"); |
| | | // tradeOrderCreateData.setTotalFee("1"); |
| | | // tradeOrderCreateData.setRetUrl("pages/advoad-city-search/advoad-message/electronic-wait-pay/electronic-wait-pay"); |
| | | // tradeOrderCreateData.setClientIp("127.0.0.1"); |
| | | // tradeOrderCreateData.setNeedLoginFlag("N"); |
| | | // tradeOrderCreateData.setOrderDesc("出行订单支付"); |
| | | // tradeOrderCreateData.setAccessMode("APP"); |
| | | // |
| | | // List<GoodsInfoRequest> goodsInfo = new ArrayList<>(); |
| | | // GoodsInfoRequest goodsInfoRequest = new GoodsInfoRequest(); |
| | | // goodsInfoRequest.setId("981100006005901"); |
| | | // goodsInfoRequest.setSubAppId("wxcc3c9058e2b294db"); |
| | | // goodsInfoRequest.setSubOpenId("oVLur61wBKJEO7QPR1dsmzS5TSfs"); |
| | | // goodsInfoRequest.setProfitSharing("1"); |
| | | // goodsInfoRequest.setAreaInfo("520100"); |
| | | // goodsInfoRequest.setPayType("0"); |
| | | // goodsInfoRequest.setBusinessType("10408"); |
| | | // goodsInfo.add(goodsInfoRequest); |
| | | // tradeOrderCreateData.setGoodsInfo(goodsInfo); |
| | | // TradeOrderCreate tradeOrderCreate = tradeOrderCreate1(tradeOrderCreateData); |
| | | // System.err.println(tradeOrderCreate); |
| | | //TradeOrderCreate(orderInfo=OrderInfo(orderId=1950072223939842048, status=null), payInfo=PayInfo(retCode=000000, retMsg=success, success=true, data=PayInfoData(redirectUrl=https://qhsctest.qytzt.cn/gray/mobile/index.html?f=allCashDesk&accessToken=It5FPM1DUjzwIAin7zwiHvUANWKC6I5USCLE8EKoRkg%3D, payId=540000420250729000135600, status=null, payTime=null, payFee=null, paymentInfos=null), sign=525cb843b1eeb5a0451eeb5fbbe02f0f)) |
| | | |
| | | //查询支付单信息 |
| | | // GetPaymentInfoDataRequest getPaymentInfoDataRequest = new GetPaymentInfoDataRequest(); |
| | | // getPaymentInfoDataRequest.setPartnerId("5400004"); |
| | | // getPaymentInfoDataRequest.setPartnerPayId("1948685426689200128"); |
| | | // GetPaymentInfo getPaymentInfo = paymentInfo(getPaymentInfoDataRequest); |
| | | // System.err.println(getPaymentInfo); |
| | | |
| | | //拉起支付 |
| | | // TradePayOff1Data tradePayOff1Data = new TradePayOff1Data(); |
| | | // tradePayOff1Data.setPartnerId("5400004"); |
| | | // tradePayOff1Data.setScene("TRAFFIC"); |
| | | // tradePayOff1Data.setPartnerPayId("1951088602595872768"); |
| | | // tradePayOff1Data.setCurrency("RMB"); |
| | | // tradePayOff1Data.setTotalFee("1"); |
| | | // tradePayOff1Data.setRetUrl("pages/advoad-city-search/advoad-message/electronic-wait-pay/electronic-wait-pay"); |
| | | // tradePayOff1Data.setClientIp("127.0.0.1"); |
| | | // tradePayOff1Data.setNeedLoginFlag("N"); |
| | | // tradePayOff1Data.setOrderDesc("出行订单支付"); |
| | | // tradePayOff1Data.setAccessMode("APP"); |
| | | // List<GoodsInfoRequest> goodsInfo = new ArrayList<>(); |
| | | // GoodsInfoRequest goodsInfoRequest = new GoodsInfoRequest(); |
| | | // goodsInfoRequest.setId("981100006005901"); |
| | | // goodsInfoRequest.setSubAppId("wxcc3c9058e2b294db"); |
| | | // goodsInfoRequest.setSubOpenId("oVLur61wBKJEO7QPR1dsmzS5TSfs"); |
| | | // goodsInfoRequest.setProfitSharing("1"); |
| | | // goodsInfoRequest.setAreaInfo("520100"); |
| | | // goodsInfoRequest.setPayType("0"); |
| | | // goodsInfoRequest.setBusinessType("10408"); |
| | | // goodsInfo.add(goodsInfoRequest); |
| | | // tradePayOff1Data.setGoodsInfo(goodsInfo); |
| | | // PayInfo payInfo = tradePayOff1(tradePayOff1Data); |
| | | // System.err.println(payInfo); |
| | | //PayInfo(retCode=000000, retMsg=success, success=true, data=PayInfoData(redirectUrl=https://qhsctest.qytzt.cn/gray/mobile/index.html?f=allCashDesk&accessToken=5nUBXayFpfZz%2FXUZiMu9LzeRXmqmlqaCS%2BHfu5udIt4%3D, payId=540000420250725000135549, status=null, payTime=null, payFee=null, paymentInfos=null), sign=8154ba2728280900b122c56352c1c7fe) |
| | | |
| | | |
| | | // (补偿单)拉起支付 |
| | | // TradePayOffData tradePayOffData = new TradePayOffData(); |
| | | // tradePayOffData.setPartnerId("5400004"); |
| | | // tradePayOffData.setScene("TRAFFIC"); |
| | | // tradePayOffData.setPartnerPayId("1948685426689200128"); |
| | | // tradePayOffData.setCurrency("RMB"); |
| | | // tradePayOffData.setTotalFee("1"); |
| | | // tradePayOffData.setRetUrl("/home/"); |
| | | // tradePayOffData.setClientIp("127.0.0.1"); |
| | | // tradePayOffData.setNeedLoginFlag("N"); |
| | | // tradePayOffData.setOrderDesc("出行订单支付"); |
| | | // tradePayOffData.setAccessMode("APP"); |
| | | // List<PaymentInfoRequest> paymentInfoRequests = new ArrayList<>(); |
| | | // PaymentInfoRequest paymentInfoRequest = new PaymentInfoRequest(); |
| | | // paymentInfoRequest.setPayModeId("501212"); |
| | | // paymentInfoRequests.add(paymentInfoRequest); |
| | | // tradePayOffData.setPaymentInfos(paymentInfoRequests); |
| | | // List<GoodsInfo> goodsInfo = new ArrayList<>(); |
| | | // GoodsInfo goodsInfo1 = new GoodsInfo(); |
| | | // goodsInfo1.setMerchantCode(""); |
| | | // goodsInfo1.setCustId(""); |
| | | // goodsInfo1.setCustName(""); |
| | | // goodsInfo1.setProfitSharing("1"); |
| | | // goodsInfo.add(goodsInfo1); |
| | | // tradePayOffData.setGoodsInfo(goodsInfo); |
| | | // PayInfo payInfo1 = tradePayOff(tradePayOffData); |
| | | // System.err.println(payInfo1); |
| | | |
| | | //订单创建 |
| | | // CreateOrderRequest createOrderRequest = new CreateOrderRequest(); |
| | | // createOrderRequest.setTreatShopId("11448158"); |
| | | // createOrderRequest.setOrderAppId("52270015"); |
| | | // createOrderRequest.setScene("TRAFFIC"); |
| | | // createOrderRequest.setPartnerId("522700"); |
| | | // createOrderRequest.setField1("{\"profitSharing\":\"1\",\"isPromote\":\"0\"}"); |
| | | // createOrderRequest.setCharge(new BigDecimal("0.01")); |
| | | // createOrderRequest.setChannelSource("GRJYCXWXXCX"); |
| | | // createOrderRequest.setOrderId("1948685426689200128"); |
| | | // createOrderRequest.setOrderNo("0123456"); |
| | | // createOrderRequest.setCustomerId("11448156"); |
| | | // OrderInfo orderInfo = tradeOrderCreate(createOrderRequest); |
| | | // System.err.println(orderInfo); |
| | | |
| | | //行程单列表查询 |
| | | // GetTravelItineraryListRequest request = new GetTravelItineraryListRequest(); |
| | | // request.setScene("TRAFFIC"); |
| | | // request.setPartnerId("522700"); |
| | | // request.setCustomerId("11448156"); |
| | | // request.setOrderNo("0123456"); |
| | | // request.setDriverId("11448158"); |
| | | // ListPage<TravelItinerary> travelItineraryList = getTravelItineraryList(request); |
| | | // System.err.println(travelItineraryList); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 拉起支付 |
| | | * |
| | | * @param tradePayOff1Data |
| | | * @return |
| | | */ |
| | | public static PayInfo tradePayOff1(TradePayOff1Data tradePayOff1Data) { |
| | | tradePayOff1Data.setPartnerId("5400004"); |
| | | tradePayOff1Data.setTimeout("72H"); |
| | | tradePayOff1Data.setScene("TRAFFIC"); |
| | | tradePayOff1Data.setCurrency("RMB"); |
| | | tradePayOff1Data.setNeedLoginFlag("N"); |
| | | tradePayOff1Data.setAccessMode("APP"); |
| | | tradePayOff1Data.getGoodsInfo().forEach(goodsInfoRequest -> { |
| | | goodsInfoRequest.setId("981100006005901"); |
| | | goodsInfoRequest.setSubAppId("wxcc3c9058e2b294db"); |
| | | |
| | | goodsInfoRequest.setAreaInfo("520100"); |
| | | goodsInfoRequest.setPayType("0"); |
| | | goodsInfoRequest.setBusinessType("10408"); |
| | | }); |
| | | |
| | | |
| | | TradeRequest request = new TradeRequest<TradePayOff1Data>(); |
| | | request.setSceneId("1911676727023968256"); |
| | | request.setAppId(qianYunTongConfig.getAppkey()); |
| | | request.setConfigVersion(1); |
| | | request.setRequestId(UUIDUtil.getRandomCode()); |
| | | request.setData(tradePayOff1Data); |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/tradePayOff"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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 = UUIDUtil.getRandomCode(); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 resCode = jsonObject.getString("resCode"); |
| | | if (!"000000".equals(resCode)) { |
| | | log.error("【拉起支付】失败:" + jsonObject.getString("resMsg")); |
| | | throw new RuntimeException("【拉起支付】失败:" + jsonObject.getString("resMsg")); |
| | | } |
| | | JSONObject busiResp = jsonObject.getJSONObject("busiResp"); |
| | | PayInfo payInfo = busiResp.getObject("payInfo", PayInfo.class); |
| | | return payInfo; |
| | | } |
| | | |
| | | /** |
| | | * 创建行程单 |
| | | * |
| | | * @param request |
| | | * @return 行程单ID |
| | | */ |
| | | public static String createTravelItinerary(CreateTravelItineraryRequest request) { |
| | | request.setScene("TRAFFIC"); |
| | | request.setPartnerId("522700"); |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/createTravelItinerary"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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 = UUIDUtil.getRandomCode(); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 resCode = jsonObject.getString("resCode"); |
| | | if (!"000000".equals(resCode)) { |
| | | log.error("【创建行程单】失败:" + jsonObject.getString("resMsg")); |
| | | throw new RuntimeException("【创建行程单】失败:" + jsonObject.getString("resMsg")); |
| | | } |
| | | return jsonObject.getString("busiResp"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改行程单 |
| | | * |
| | | * @param request |
| | | */ |
| | | public static Boolean modifyTravelItinerary(ModifyTravelItineraryRequest request) { |
| | | request.setScene("TRAFFIC"); |
| | | request.setPartnerId("522700"); |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/modifyTravelItinerary"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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 = UUIDUtil.getRandomCode(); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 resCode = jsonObject.getString("resCode"); |
| | | if (!"000000".equals(resCode)) { |
| | | log.error("【修改行程单】失败:" + jsonObject.getString("resMsg")); |
| | | throw new RuntimeException("【修改行程单】失败:" + jsonObject.getString("resMsg")); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 行程单列表查询 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static ListPage<List<TravelItinerary>> getTravelItineraryList(GetTravelItineraryListRequest request) { |
| | | request.setScene("TRAFFIC"); |
| | | request.setPartnerId("522700"); |
| | | |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/getTravelItineraryList"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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 = UUIDUtil.getRandomCode(); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 resCode = jsonObject.getString("resCode"); |
| | | if (!"000000".equals(resCode)) { |
| | | log.error("【行程单列表查询】失败:" + jsonObject.getString("resMsg")); |
| | | throw new RuntimeException("【行程单列表查询】失败:" + jsonObject.getString("resMsg")); |
| | | } |
| | | JSONObject busiResp = jsonObject.getJSONObject("busiResp"); |
| | | Integer total = busiResp.getInteger("total"); |
| | | Integer pageNum = busiResp.getInteger("pageNum"); |
| | | Integer pageSize = busiResp.getInteger("pageSize"); |
| | | JSONArray list = busiResp.getJSONArray("list"); |
| | | List<TravelItinerary> travelItineraryList = new ArrayList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | TravelItinerary object = list.getObject(i, TravelItinerary.class); |
| | | travelItineraryList.add(object); |
| | | } |
| | | ListPage listPage = new ListPage<List<TravelItinerary>>(); |
| | | listPage.setTotal(total); |
| | | listPage.setPageNum(pageNum); |
| | | listPage.setPageSize(pageSize); |
| | | listPage.setList(travelItineraryList); |
| | | return listPage; |
| | | } |
| | | |
| | | /** |
| | | * 订单创建及拉起支付 |
| | | * |
| | | * @param tradeOrderCreateData |
| | | * @return |
| | | */ |
| | | public static TradeOrderCreate tradeOrderCreate1(TradeOrderCreateData tradeOrderCreateData) { |
| | | tradeOrderCreateData.setScene("TRAFFIC"); |
| | | tradeOrderCreateData.setPartnerId("522700"); |
| | | tradeOrderCreateData.setTimeout("72H"); |
| | | tradeOrderCreateData.setOrderAppId("52270015"); |
| | | tradeOrderCreateData.setChannelSource("GRJYCXWXXCX"); |
| | | tradeOrderCreateData.setPayPartnerId("5400004"); |
| | | tradeOrderCreateData.setCurrency("RMB"); |
| | | tradeOrderCreateData.setNeedLoginFlag("N"); |
| | | tradeOrderCreateData.setAccessMode("APP"); |
| | | tradeOrderCreateData.getGoodsInfo().forEach(goodsInfoRequest -> { |
| | | goodsInfoRequest.setId("981100006005901"); |
| | | goodsInfoRequest.setSubAppId("wxcc3c9058e2b294db"); |
| | | goodsInfoRequest.setAreaInfo("520100"); |
| | | goodsInfoRequest.setPayType("0"); |
| | | goodsInfoRequest.setBusinessType("10408"); |
| | | }); |
| | | |
| | | |
| | | TradeRequest request = new TradeRequest<TradeOrderCreateData>(); |
| | | request.setSceneId("1945688132719169536"); |
| | | request.setAppId(qianYunTongConfig.getAppkey()); |
| | | request.setConfigVersion(1); |
| | | request.setRequestId(UUIDUtil.getRandomCode()); |
| | | request.setData(tradeOrderCreateData); |
| | | |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/tradeOrderCreate"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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 = UUIDUtil.getRandomCode(); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 resCode = jsonObject.getString("resCode"); |
| | | if (!"000000".equals(resCode)) { |
| | | log.error("【订单创建及拉起支付】失败:" + jsonObject.getString("resMsg")); |
| | | throw new RuntimeException("【订单创建及拉起支付】失败:" + jsonObject.getString("resMsg")); |
| | | } |
| | | TradeOrderCreate busiResp = jsonObject.getObject("busiResp", TradeOrderCreate.class); |
| | | return busiResp; |
| | | } |
| | | |
| | | /** |
| | | * 订单创建 |
| | | * |
| | | * @param createOrderRequest |
| | | * @return |
| | | */ |
| | | public static OrderInfo tradeOrderCreate(CreateOrderRequest createOrderRequest) { |
| | | createOrderRequest.setOrderAppId("52270015"); |
| | | createOrderRequest.setScene("TRAFFIC"); |
| | | createOrderRequest.setPartnerId("522700"); |
| | | createOrderRequest.setChannelSource("GRJYCXWXXCX"); |
| | | |
| | | TradeRequest request = new TradeRequest<CreateOrderRequest>(); |
| | | request.setSceneId("1948289607125864448"); |
| | | request.setAppId(qianYunTongConfig.getAppkey()); |
| | | request.setConfigVersion(1); |
| | | request.setRequestId(UUIDUtil.getRandomCode()); |
| | | request.setData(createOrderRequest); |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/tradeOrderCreate"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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 = UUIDUtil.getRandomCode(); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 resCode = jsonObject.getString("resCode"); |
| | | if (!"000000".equals(resCode)) { |
| | | log.error("【订单创建】失败:" + jsonObject.getString("resMsg")); |
| | | throw new RuntimeException("【订单创建】失败:" + jsonObject.getString("resMsg")); |
| | | } |
| | | JSONObject busiResp = jsonObject.getJSONObject("busiResp"); |
| | | OrderInfo orderInfo = busiResp.getObject("orderInfo", OrderInfo.class); |
| | | return orderInfo; |
| | | } |
| | | |
| | | /** |
| | | * (补偿单)拉起支付 |
| | | * |
| | | * @param tradePayOffData |
| | | * @return |
| | | */ |
| | | public static PayInfo tradePayOff(TradePayOffData tradePayOffData) { |
| | | tradePayOffData.setPartnerId("5400005"); |
| | | tradePayOffData.setTimeout("72H"); |
| | | tradePayOffData.setScene("TRAFFIC"); |
| | | tradePayOffData.setCurrency("RMB"); |
| | | tradePayOffData.setRetUrl(""); |
| | | InetAddress inetAddress = null; |
| | | try { |
| | | inetAddress = InetAddress.getLocalHost(); |
| | | } catch (UnknownHostException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | String ip = inetAddress.getHostAddress(); |
| | | tradePayOffData.setClientIp(ip); |
| | | tradePayOffData.setNeedLoginFlag("N"); |
| | | tradePayOffData.setAccessMode("APP"); |
| | | List<PaymentInfoRequest> paymentInfoRequests = new ArrayList<>(); |
| | | PaymentInfoRequest paymentInfoRequest = new PaymentInfoRequest(); |
| | | paymentInfoRequest.setPayModeId("501212"); |
| | | paymentInfoRequest.setRealFee(tradePayOffData.getTotalFee().toString()); |
| | | paymentInfoRequest.setTradeFee(tradePayOffData.getTotalFee().toString()); |
| | | paymentInfoRequest.setAccountTyp("501"); |
| | | paymentInfoRequests.add(paymentInfoRequest); |
| | | tradePayOffData.setPaymentInfos(paymentInfoRequests); |
| | | List<GoodsInfo> goodsInfo = new ArrayList<>(); |
| | | GoodsInfo goodsInfo1 = new GoodsInfo(); |
| | | goodsInfo1.setMerchantCode("B00000905"); |
| | | goodsInfo1.setCustId("CB0000004686"); |
| | | goodsInfo1.setCustName("证联消费平台交易客户"); |
| | | goodsInfo1.setBusinessType("10408"); |
| | | goodsInfo1.setAgreementNo("00000000468618354161754464398681"); |
| | | goodsInfo1.setProfitSharing("1"); |
| | | goodsInfo.add(goodsInfo1); |
| | | tradePayOffData.setGoodsInfo(goodsInfo); |
| | | |
| | | |
| | | TradeRequest request = new TradeRequest<TradePayOffData>(); |
| | | request.setSceneId("1774717104844095488"); |
| | | request.setAppId(qianYunTongConfig.getAppkey()); |
| | | request.setConfigVersion(2); |
| | | request.setRequestId(UUIDUtil.getRandomCode()); |
| | | request.setData(tradePayOffData); |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/tradePayOff"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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 = UUIDUtil.getRandomCode(); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 resCode = jsonObject.getString("resCode"); |
| | | if (!"000000".equals(resCode)) { |
| | | log.error("【(补偿单)拉起支付】失败:" + jsonObject.getString("resMsg")); |
| | | throw new RuntimeException("【(补偿单)拉起支付】失败:" + jsonObject.getString("resMsg")); |
| | | } |
| | | JSONObject busiResp = jsonObject.getJSONObject("busiResp"); |
| | | PayInfo payInfo = busiResp.getObject("payInfo", PayInfo.class); |
| | | return payInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询支付单信息 |
| | | * |
| | | * @param getPaymentInfoDataRequest |
| | | * @return |
| | | */ |
| | | public static GetPaymentInfo paymentInfo(GetPaymentInfoDataRequest getPaymentInfoDataRequest) { |
| | | getPaymentInfoDataRequest.setPartnerId("5400004"); |
| | | |
| | | GetPaymentInfoRequest request = new GetPaymentInfoRequest(); |
| | | request.setRequstType("POST"); |
| | | request.setBusType(1); |
| | | request.setData(getPaymentInfoDataRequest); |
| | | |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/paymentInfo"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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 = UUIDUtil.getRandomCode(); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 resCode = jsonObject.getString("retCode"); |
| | | if (!"0".equals(resCode)) { |
| | | log.error("【查询支付单信息】失败:" + jsonObject.getString("retMsg")); |
| | | throw new RuntimeException("【查询支付单信息】失败:" + jsonObject.getString("retMsg")); |
| | | } |
| | | JSONObject object = jsonObject.getJSONObject("object"); |
| | | String retCode = object.getString("retCode"); |
| | | if (!"000000".equals(retCode)) { |
| | | log.error("【查询支付单信息】失败:" + jsonObject.getString("retMsg")); |
| | | throw new RuntimeException("【查询支付单信息】失败:" + jsonObject.getString("retMsg")); |
| | | } |
| | | GetPaymentInfo payInfo = object.getObject("data", GetPaymentInfo.class); |
| | | return payInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * (补偿单)支付成功通知 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static OrderInfo paymentOrder(PaymentOrderRequest request) { |
| | | request.setScene("TRAFFIC"); |
| | | request.setMhltiCenterAppId("52270015"); |
| | | request.setPayType(4); |
| | | request.setPayChannel(6); |
| | | request.setIsCompensate(1); |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/paymentOrder"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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 = UUIDUtil.getRandomCode(); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 resCode = jsonObject.getString("resCode"); |
| | | if (!"000000".equals(resCode)) { |
| | | log.error("【(补偿单)支付成功通知】失败:" + jsonObject.getString("resMsg")); |
| | | throw new RuntimeException("【(补偿单)支付成功通知】失败:" + jsonObject.getString("resMsg")); |
| | | } |
| | | OrderInfo orderInfo = jsonObject.getObject("busiResp", OrderInfo.class); |
| | | return orderInfo; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/8 11:31 |
| | | */ |
| | | @Component |
| | | public class QianYunTongConfig { |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String activeProfile; |
| | | |
| | | |
| | | /** |
| | | * appkey |
| | | */ |
| | | private String appkey; |
| | | /** |
| | | * 私钥地址 |
| | | */ |
| | | private String privateKeyPath; |
| | | /** |
| | | * 消费者账号 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 状态 |
| | | * 1:生产环境 |
| | | * 2:测试环境 |
| | | */ |
| | | private String status; |
| | | /** |
| | | * API地址 |
| | | */ |
| | | private String apiUrl; |
| | | /** |
| | | * 桶名 |
| | | */ |
| | | private String bucketName; |
| | | /** |
| | | * 小程序appId |
| | | */ |
| | | private String appId; |
| | | /** |
| | | * HOS的基础路径(公共前缀) |
| | | */ |
| | | private String endPoint; |
| | | /** |
| | | * 账户的ID |
| | | */ |
| | | private String account; |
| | | /** |
| | | * 向UAAS服务请求到的access_key |
| | | */ |
| | | private String accessKey; |
| | | /** |
| | | * 向UAAS服务请求到的secret_key |
| | | */ |
| | | private String secretKey; |
| | | |
| | | public String getActiveProfile() { |
| | | return activeProfile; |
| | | } |
| | | |
| | | public void setActiveProfile(String activeProfile) { |
| | | this.activeProfile = activeProfile; |
| | | } |
| | | |
| | | public String getAppkey() { |
| | | return appkey; |
| | | } |
| | | |
| | | public void setAppkey(String appkey) { |
| | | this.appkey = appkey; |
| | | } |
| | | |
| | | public String getPrivateKeyPath() { |
| | | return privateKeyPath; |
| | | } |
| | | |
| | | public void setPrivateKeyPath(String privateKeyPath) { |
| | | this.privateKeyPath = privateKeyPath; |
| | | } |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getApiUrl() { |
| | | return apiUrl; |
| | | } |
| | | |
| | | public void setApiUrl(String apiUrl) { |
| | | this.apiUrl = apiUrl; |
| | | } |
| | | |
| | | public String getBucketName() { |
| | | return bucketName; |
| | | } |
| | | |
| | | public void setBucketName(String bucketName) { |
| | | this.bucketName = bucketName; |
| | | } |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getEndPoint() { |
| | | return endPoint; |
| | | } |
| | | |
| | | public void setEndPoint(String endPoint) { |
| | | this.endPoint = endPoint; |
| | | } |
| | | |
| | | public String getAccount() { |
| | | return account; |
| | | } |
| | | |
| | | public void setAccount(String account) { |
| | | this.account = account; |
| | | } |
| | | |
| | | public String getAccessKey() { |
| | | return accessKey; |
| | | } |
| | | |
| | | public void setAccessKey(String accessKey) { |
| | | this.accessKey = accessKey; |
| | | } |
| | | |
| | | public String getSecretKey() { |
| | | return secretKey; |
| | | } |
| | | |
| | | public void setSecretKey(String secretKey) { |
| | | this.secretKey = secretKey; |
| | | } |
| | | |
| | | public QianYunTongConfig getQianYunTongConfig() { |
| | | if("dev".equals(activeProfile)){ |
| | | this.appkey = "10001104"; |
| | | this.privateKeyPath = "C:\\Users\\Admin\\Desktop\\qyt\\private_key_test.pem"; |
| | | this.userName = "xiaofei"; |
| | | this.status = "1"; |
| | | this.setApiUrl("https://test-zhongtai.stqcloud.com:10070"); |
| | | this.setBucketName("bucuTest0625"); |
| | | this.setAppId("wxcc3c9058e2b294db"); |
| | | this.setEndPoint("http://119.4.112.68:27741/v1"); |
| | | this.setAccount("d8bef0a04db511f0b79d01a3e2b7587e"); |
| | | this.setAccessKey("TYMFTFD5SIIT15DCCUD7"); |
| | | this.setSecretKey("AoI1dkH3yoAvXoaQlREO3ed9mwQJFluLTliS9T1z"); |
| | | } |
| | | if("test".equals(activeProfile)){ |
| | | this.setAppkey("10001104"); |
| | | this.setPrivateKeyPath("/etraffic/server/private_key_test.pem"); |
| | | this.setUserName("xiaofei"); |
| | | this.setStatus("1"); |
| | | this.setApiUrl("https://test-zhongtai.stqcloud.com:10070"); |
| | | this.setBucketName("bucuTest0625"); |
| | | this.setAppId("wxcc3c9058e2b294db"); |
| | | this.setEndPoint("http://119.4.112.68:27741/v1"); |
| | | this.setAccount("d8bef0a04db511f0b79d01a3e2b7587e"); |
| | | this.setAccessKey("TYMFTFD5SIIT15DCCUD7"); |
| | | this.setSecretKey("AoI1dkH3yoAvXoaQlREO3ed9mwQJFluLTliS9T1z"); |
| | | } |
| | | if("prod".equals(activeProfile)){ |
| | | this.setAppkey("10001104"); |
| | | this.setPrivateKeyPath("/root/server/app/key/private_key.pem"); |
| | | this.setUserName("xiwang"); |
| | | this.setStatus("1"); |
| | | this.setApiUrl("http://jjzhongtai.stqcloud.com:10010"); |
| | | this.setBucketName("qyt20250702"); |
| | | this.setAppId("wxcc3c9058e2b294db"); |
| | | this.setEndPoint("http://119.4.112.68:27741/v1"); |
| | | this.setAccount("d8bef0a04db511f0b79d01a3e2b7587e"); |
| | | this.setAccessKey("TYMFTFD5SIIT15DCCUD7"); |
| | | this.setSecretKey("AoI1dkH3yoAvXoaQlREO3ed9mwQJFluLTliS9T1z"); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.Gson; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.supersavedriving.driver.modular.system.util.SpringContextsUtil; |
| | | import com.supersavedriving.driver.modular.system.util.qianyuntong.model.SendSmsRequest; |
| | | 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 { |
| | | |
| | | private static QianYunTongConfig qianYunTongConfig = SpringContextsUtil.getBean(QianYunTongConfig.class).getQianYunTongConfig(); |
| | | |
| | | |
| | | /** |
| | | * 获取易信验证码 |
| | | * @param mobile |
| | | * @return |
| | | */ |
| | | public static String sendVerifyCode(String mobile) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/sendVerifyCode"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | 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"); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | SendSmsRequest request = new SendSmsRequest(); |
| | | request.setDestAddress("15828353127"); |
| | | request.setTemplateId("TPL202507300002"); |
| | | Map<String, String> templateParams = new HashMap<>(); |
| | | // templateParams.put("code", "1234"); |
| | | request.setTemplateParams(templateParams); |
| | | // request.setCode("code"); |
| | | request.setSpId("Y86asr7J"); |
| | | SMSUtil.sendSms(request); |
| | | } |
| | | |
| | | /** |
| | | * 根据模板发送短信 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean sendSms(SendSmsRequest request) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/sendSmsByTpl"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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; |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.Gson; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.supersavedriving.user.modular.system.util.SpringContextsUtil; |
| | | import com.supersavedriving.user.modular.system.util.qianyuntong.model.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 用户工具类 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 14:47 |
| | | */ |
| | | @Slf4j |
| | | public class UserUtil { |
| | | |
| | | private static QianYunTongConfig qianYunTongConfig = SpringContextsUtil.getBean(QianYunTongConfig.class).getQianYunTongConfig(); |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // List<QYTUserInfo> userInfoByPhone = getUserInfoByPhone("15828353127"); |
| | | // System.out.println(userInfoByPhone); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据手机号码获取人员信息 |
| | | * |
| | | * @param mobile 手机号码 |
| | | */ |
| | | public static List<QYTUserInfo> getUserInfoByPhone(String mobile) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/2.0/queryUserinfoByMobilev2"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", "{\"list\":[{\"mobile\":\"" + mobile + "\"}]}"); |
| | | 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 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("【根据手机号码获取人员信息】失败:" + object.toJSONString()); |
| | | return null; |
| | | } |
| | | JSONArray data = object.getJSONObject("data").getJSONArray("list"); |
| | | List<QYTUserInfo> list = new ArrayList<>(); |
| | | for (int i = 0; i < data.size(); i++) { |
| | | QYTUserInfo userInfo = data.getObject(i, QYTUserInfo.class); |
| | | list.add(userInfo); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 根据手机号码获取人员信息 |
| | | * |
| | | * @param mobile 手机号码 |
| | | * @param enterNum 企业编号 |
| | | */ |
| | | public static List<QYTUserInfo> getUserInfoByPhone(String mobile, String enterNum) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/getUserInfoByPhone"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("mobile", mobile); |
| | | if (null != enterNum) { |
| | | map.put("enterNum", enterNum); |
| | | } |
| | | contentMap.put("content", JSON.toJSONString(map)); |
| | | 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 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("【根据手机号码获取人员信息】失败:" + object.toJSONString()); |
| | | return null; |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据手机号注册用户 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static RegisterViaMobile registerViaMobile(RegisterViaMobileRequest request) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/m1_register_via_mobile"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 jsonObject.getObject("object", RegisterViaMobile.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 易信用户修改密码 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean modifyPwd(ModifyPwdRequest request) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/modifyPwd"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/resetPwd"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(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 realName |
| | | * @param cardNo |
| | | * @return |
| | | */ |
| | | public static Boolean idCardAuth(String realName, String cardNo) { |
| | | //请求路径 |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/idCardAuth"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = qianYunTongConfig.getAppkey();//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(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("realName", realName); |
| | | map.put("cardNo", cardNo); |
| | | contentMap.put("content", JSON.toJSONString(map)); |
| | | 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"); |
| | | return object.getBoolean("isok"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 18:12 |
| | | */ |
| | | @Data |
| | | public class CheckEnterExist { |
| | | /** |
| | | * 企业ID |
| | | */ |
| | | private String id; |
| | | /** |
| | | * 是否在公有云注册,1:已注册;0:未注册 |
| | | */ |
| | | private String isReg; |
| | | /** |
| | | * 创建者手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private String createTime; |
| | | /** |
| | | * 法人姓名 |
| | | */ |
| | | private String larName; |
| | | /** |
| | | * 企业编码 |
| | | */ |
| | | private String enterCode; |
| | | /** |
| | | * 认证状态 |
| | | * 0:已认证;1:未认证,初始状态;2:认证不通过;3:认证中 |
| | | */ |
| | | private Integer auth; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/9 19:43 |
| | | */ |
| | | @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; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/9 18:20 |
| | | */ |
| | | @Data |
| | | public class CreateEnterpriseRequest { |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 企业简称/昵称 |
| | | */ |
| | | private String nickName; |
| | | /** |
| | | * 行业编码 |
| | | */ |
| | | private String industry_code; |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | private String area; |
| | | /** |
| | | * 企业地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 二级域名 |
| | | */ |
| | | private String secondRealmName; |
| | | /** |
| | | * 企业密码 |
| | | */ |
| | | private String password; |
| | | /** |
| | | * 一级行业分类描述 |
| | | */ |
| | | private String industry_level1; |
| | | /** |
| | | * 二级行业分类描述 |
| | | */ |
| | | private String industry_level2; |
| | | /** |
| | | * 企业来源编码 |
| | | */ |
| | | private String sourceCode; |
| | | /** |
| | | * 企业分类编码 |
| | | */ |
| | | private String typeCode; |
| | | /** |
| | | * 代理商id |
| | | */ |
| | | private String elecsId; |
| | | /** |
| | | * 是否发送短信 |
| | | * 0:不发送,1:发送 |
| | | */ |
| | | private String smsFlag; |
| | | /** |
| | | * 是否激活 |
| | | * 1:激活;0:未激活 |
| | | */ |
| | | private String mobileFlag; |
| | | /** |
| | | * 邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 邮箱是否激活 |
| | | * 1:激活;0:未激活 |
| | | */ |
| | | private String emailFlag; |
| | | /** |
| | | * 是否同步通讯录 |
| | | */ |
| | | private String contact_source; |
| | | /** |
| | | * 所属行业通用编码 |
| | | */ |
| | | private String trade_code; |
| | | /** |
| | | * 营业执照扫描件url |
| | | */ |
| | | private String operScanPic; |
| | | /** |
| | | * 运营人员姓名 |
| | | */ |
| | | private String idcardName; |
| | | /** |
| | | * 运营者身份证号码 |
| | | */ |
| | | private String idcardNum; |
| | | /** |
| | | * 运营者身份证照片url |
| | | */ |
| | | private String idcardPic; |
| | | /** |
| | | * 企业工号 |
| | | */ |
| | | private String enterID; |
| | | /** |
| | | * 推荐人 |
| | | */ |
| | | private String recommender; |
| | | /** |
| | | * 创建者姓名 |
| | | */ |
| | | private String creatorName; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 9:35 |
| | | */ |
| | | @Data |
| | | public class CreateOrderRequest { |
| | | /** |
| | | * 司机id |
| | | */ |
| | | private String treatShopId; |
| | | /** |
| | | * 应用场景标识 |
| | | */ |
| | | private String orderAppId; |
| | | /** |
| | | * 场景标识 |
| | | */ |
| | | private String scene; |
| | | /** |
| | | * 租户ID。地区行政编码。黔南州传522700 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 结算信息json串。其中结算分账标识(profitSharing:0:不分账,1:分账)、是否推广单标识(isPromote:1、是、0、否)必传。例:{"profitSharing":"0",”isPromote”:”0”} |
| | | */ |
| | | private String field1; |
| | | /** |
| | | * 订单总金额,单位元 |
| | | */ |
| | | private BigDecimal charge; |
| | | /** |
| | | * 订单渠道。小程序传GRJYCXWXXCX,贵人家园传GRJY |
| | | */ |
| | | private String channelSource; |
| | | /** |
| | | * 行程单ID |
| | | */ |
| | | private String orderId; |
| | | /** |
| | | * 业务侧订单号 |
| | | */ |
| | | private String orderNo; |
| | | /** |
| | | * 下单人ID |
| | | */ |
| | | private String customerId; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 16:31 |
| | | */ |
| | | @Data |
| | | public class CreateTravelItineraryRequest { |
| | | /** |
| | | * 场景标识。交通场景传”TRAFFIC” |
| | | */ |
| | | private String scene; |
| | | /** |
| | | * 租户ID。地区行政编码。黔南州传522700 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 业务侧订单号 |
| | | */ |
| | | private String orderNo; |
| | | /** |
| | | * 乘客ID |
| | | */ |
| | | private String customerId; |
| | | /** |
| | | * 司机ID |
| | | */ |
| | | private String driverId; |
| | | /** |
| | | * 推广员ID |
| | | */ |
| | | private String promoterId; |
| | | /** |
| | | * 服务商商户ID |
| | | */ |
| | | private String supplierShopId; |
| | | /** |
| | | * 场景服务类型。1、出租;2、网约车;3、城际;4、顺风车 |
| | | */ |
| | | private Integer serviceType; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:39 |
| | | */ |
| | | @Data |
| | | public class DeleteStafNodeRequest { |
| | | /** |
| | | * 人员ID |
| | | */ |
| | | private Long empId; |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 企业编号 |
| | | */ |
| | | private String entercode; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:32 |
| | | */ |
| | | @Data |
| | | public class EditStaffNodeRequest { |
| | | /** |
| | | * 人员ID |
| | | */ |
| | | private Integer empId; |
| | | /** |
| | | * 操作人手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 操作人企业ID |
| | | */ |
| | | private String entercode; |
| | | /** |
| | | * 企业ID |
| | | */ |
| | | private Long enterId; |
| | | /** |
| | | * 人员显示名 |
| | | */ |
| | | private String empName; |
| | | /** |
| | | * 人员显示名 |
| | | */ |
| | | private String empNickname; |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | private String mphone; |
| | | /** |
| | | * 登录账号 |
| | | */ |
| | | private String loginNo; |
| | | /** |
| | | * 人员性别(男\女) |
| | | */ |
| | | private String empSex; |
| | | /** |
| | | * 人员邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 员工所属部门ID多个部门英文; 分割 |
| | | */ |
| | | private Integer deptId; |
| | | /** |
| | | * 员工职务ID |
| | | */ |
| | | private Integer positionId; |
| | | /** |
| | | * 员工职务名称,如不知道ID可以直接传入名称 |
| | | */ |
| | | private String positionName; |
| | | /** |
| | | * 高管模式 1 是 0 不是 |
| | | */ |
| | | private Integer superLevel; |
| | | /** |
| | | * 隐藏号码 1 是 0 不是 |
| | | */ |
| | | private Integer hideMobile; |
| | | |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 17:14 |
| | | */ |
| | | @Data |
| | | public class EnterpriseInfo { |
| | | /** |
| | | * 企业ID |
| | | */ |
| | | private String id; |
| | | /** |
| | | * 企业编号 |
| | | */ |
| | | private String enter_code; |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | private String enter_name; |
| | | /** |
| | | * 是否是全员号码可见,0:是,1:否 |
| | | */ |
| | | private String visible; |
| | | /** |
| | | * 认证状态,0:已认证;1:未认证,初始状态;2:认证不通过;3:认证中 |
| | | */ |
| | | private String auth; |
| | | /** |
| | | * 认证时间 |
| | | */ |
| | | private String auth_time; |
| | | /** |
| | | * 认证注释 |
| | | */ |
| | | private String authRemark; |
| | | /** |
| | | * 运营者姓名(委托人) |
| | | */ |
| | | private String idcard_name; |
| | | /** |
| | | * 运营者证件号 |
| | | */ |
| | | private String idcard_num; |
| | | /** |
| | | * 运营者证件扫描件URL |
| | | */ |
| | | private String idcard_pic; |
| | | /** |
| | | * 统一社会信用代码 |
| | | */ |
| | | private String uscc; |
| | | /** |
| | | * 法人姓名 |
| | | */ |
| | | private String larName; |
| | | /** |
| | | * 法人电话 |
| | | */ |
| | | private String larPhone; |
| | | /** |
| | | * 法人身份证 |
| | | */ |
| | | private String larIdCard; |
| | | /** |
| | | * 法人身份证扫描件URL |
| | | */ |
| | | private String larIdCardPic; |
| | | /** |
| | | * 发票名称 |
| | | */ |
| | | private String invoiceName; |
| | | /** |
| | | * 纳税人识别号(发票) |
| | | */ |
| | | private String invoiceTIN; |
| | | /** |
| | | * 开户行名称(发票) |
| | | */ |
| | | private String invoiceBankersName; |
| | | /** |
| | | * 开户行账号(发票) |
| | | */ |
| | | private String invoiceBankersAccount; |
| | | /** |
| | | * 资质机构名称 |
| | | */ |
| | | private String qualificationOrgName; |
| | | /** |
| | | * 资质注册号/登记号 |
| | | */ |
| | | private String qualificationRegNum; |
| | | /** |
| | | * 资质有效开始时间 |
| | | */ |
| | | private String qualificationStartTime; |
| | | /** |
| | | * 资质有效结束时间 |
| | | */ |
| | | private String qualificationEndTime; |
| | | /** |
| | | * 资格证书扫描件URL |
| | | */ |
| | | private String qualificationCertUrl; |
| | | /** |
| | | * 省份编码 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 地市编码 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 区县编码 |
| | | */ |
| | | private String areaCode; |
| | | /** |
| | | * 乡镇编码 |
| | | */ |
| | | private String townshipCode; |
| | | /** |
| | | * 企业创建时间 |
| | | */ |
| | | private String enter_createdate; |
| | | /** |
| | | * 地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 营业期开始时间,格式:yyyy-MM-dd HH:mm:ss |
| | | */ |
| | | private String businessTermStartTime; |
| | | /** |
| | | * 营业期结束时间,格式:yyyy-MM-dd HH:mm:ss |
| | | */ |
| | | private String businessTermEndTime; |
| | | /** |
| | | * 企业规模 |
| | | */ |
| | | private String enterScale; |
| | | /** |
| | | * 创建者职位 |
| | | */ |
| | | private String creatorPosition; |
| | | /** |
| | | * 企业备注/介绍 |
| | | */ |
| | | private String enterRemark; |
| | | /** |
| | | * 企业logo |
| | | */ |
| | | private String enterLogo; |
| | | /** |
| | | * 企业邮箱 |
| | | */ |
| | | private String enterEmail; |
| | | /** |
| | | * 企业联系电话rg_company_info.enter_tel |
| | | */ |
| | | private String enterTel; |
| | | /** |
| | | * 一级行业分类编码 |
| | | */ |
| | | private String industryStr; |
| | | /** |
| | | * 二级行业分类编码 |
| | | */ |
| | | private String industryStr2; |
| | | /** |
| | | * 企业联系人姓名 |
| | | */ |
| | | private String enterLinkman; |
| | | /** |
| | | * 营业执照扫描件ur |
| | | */ |
| | | private String operScanPic; |
| | | /** |
| | | * 身份证有效期 |
| | | */ |
| | | private String larIdCardValidity; |
| | | /** |
| | | * 经营地址 |
| | | */ |
| | | private String operationAddress; |
| | | /** |
| | | * 法人身份证背面照片 |
| | | */ |
| | | private String larIdCardPicBack; |
| | | /** |
| | | * 法人身份证手持 |
| | | */ |
| | | private String larIdCardPicHold; |
| | | /** |
| | | * 开户许可证 |
| | | */ |
| | | private String accountOpeningPermit; |
| | | /** |
| | | * 自定义的,例如:企业类型 |
| | | */ |
| | | private String tag1; |
| | | /** |
| | | * 自定义的,例如:行业类型 |
| | | */ |
| | | private String tag2; |
| | | /** |
| | | * 企业扩展信息 |
| | | */ |
| | | private String iformContentId; |
| | | /** |
| | | * 国家统计局网站提供的行政地区编码 |
| | | */ |
| | | private String area; |
| | | /** |
| | | * 行业编码 |
| | | */ |
| | | private String industryCode; |
| | | /** |
| | | * 企业创建人姓名 |
| | | */ |
| | | private String creatorName; |
| | | /** |
| | | * 企业创建人手机号 |
| | | */ |
| | | private String creatorMobile; |
| | | /** |
| | | * 管理员邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 企业简称 |
| | | */ |
| | | private String enterAbbreviation; |
| | | /** |
| | | * 营业期限 |
| | | */ |
| | | private String businessTermLong; |
| | | /** |
| | | * 一级行业名称 |
| | | */ |
| | | private String industryL1Name; |
| | | /** |
| | | * 二级行业名称 |
| | | */ |
| | | private String industryL2Name; |
| | | /** |
| | | * 企业介绍(全文本) |
| | | */ |
| | | private String enterIntro; |
| | | /** |
| | | * 法人身份证正面照片 |
| | | */ |
| | | private String larIdCardPicFront; |
| | | /** |
| | | * 企业主税机关 |
| | | */ |
| | | private String enterTaxAuthority; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 18:24 |
| | | */ |
| | | @Data |
| | | public class GetPaymentInfo { |
| | | /** |
| | | * 支付流水号 |
| | | */ |
| | | private String payId; |
| | | /** |
| | | * 订单中心行程单ID |
| | | */ |
| | | private String partnerPayId; |
| | | /** |
| | | * 接入模式:PC H5 APP |
| | | */ |
| | | private String accessMode; |
| | | /** |
| | | * 用户标识 |
| | | */ |
| | | private String customerId; |
| | | /** |
| | | * 商户标识 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 币种 |
| | | */ |
| | | private String currency; |
| | | /** |
| | | * 支付总金额 |
| | | */ |
| | | private String totalFee; |
| | | /** |
| | | * 支付工单状态 |
| | | * 0 待支付 |
| | | * 1 部分支付成功 |
| | | * 2 支付成功 |
| | | * 3 支付失败 |
| | | */ |
| | | private String status; |
| | | /** |
| | | * 商品信息 |
| | | */ |
| | | private List<GoodsInfoRequest> goodsInfo; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 17:08 |
| | | */ |
| | | @Data |
| | | public class GetPaymentInfoDataRequest { |
| | | /** |
| | | * 支付单标识。传行程单ID |
| | | */ |
| | | private String partnerPayId; |
| | | /** |
| | | * 商户号,由支付中心分配 |
| | | */ |
| | | private String partnerId; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 17:03 |
| | | */ |
| | | @Data |
| | | public class GetPaymentInfoRequest { |
| | | /** |
| | | * 默认传POST |
| | | */ |
| | | private String requstType; |
| | | /** |
| | | * 默认传1 |
| | | */ |
| | | private Integer busType; |
| | | /** |
| | | * 业务参数 |
| | | */ |
| | | private GetPaymentInfoDataRequest data; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:42 |
| | | */ |
| | | @Data |
| | | public class GetStaffNodeRequest { |
| | | /** |
| | | * 人员ID |
| | | */ |
| | | private Long empId; |
| | | /** |
| | | * 操作人手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 操作人企业ID |
| | | */ |
| | | private String entercode; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 16:31 |
| | | */ |
| | | @Data |
| | | public class GetTravelItineraryListRequest { |
| | | /** |
| | | * 场景标识。交通场景传”TRAFFIC” |
| | | */ |
| | | private String scene; |
| | | /** |
| | | * 租户ID。地区行政编码。黔南州传522700 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 业务侧订单号 |
| | | */ |
| | | private String orderNo; |
| | | /** |
| | | * 乘客ID |
| | | */ |
| | | private String customerId; |
| | | /** |
| | | * 司机ID |
| | | */ |
| | | private String driverId; |
| | | /** |
| | | * 推广员ID |
| | | */ |
| | | private String promoterId; |
| | | /** |
| | | * 服务商商户ID |
| | | */ |
| | | private String supplierShopId; |
| | | /** |
| | | * 每页条数 |
| | | */ |
| | | private Integer pageSize; |
| | | /** |
| | | * 当前页码 |
| | | */ |
| | | private Integer pageNum; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:35 |
| | | */ |
| | | @Data |
| | | public class GoodsInfo { |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | private String merchantCode; |
| | | /** |
| | | * 付款商户号 |
| | | */ |
| | | private String custId; |
| | | /** |
| | | * 付款方名称 |
| | | */ |
| | | private String custName; |
| | | /** |
| | | *交通场景固定值 |
| | | */ |
| | | private String businessType; |
| | | /** |
| | | * 免密支付协议号 |
| | | */ |
| | | private String agreementNo; |
| | | /** |
| | | * 分账标识。0:不分账,1:分账 |
| | | */ |
| | | private String profitSharing; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:13 |
| | | */ |
| | | @Data |
| | | public class GoodsInfoRequest { |
| | | /** |
| | | * 企业ID(补偿场景新创建的订单支付传备用金企业ID) |
| | | */ |
| | | private String id; |
| | | /** |
| | | * 子商户微信appId(证联预下单支付必填) |
| | | */ |
| | | private String subAppId; |
| | | /** |
| | | * 付款人的openId(证联预下单支付必填) |
| | | */ |
| | | private String subOpenId; |
| | | /** |
| | | * 分账标识。0:不分账,1:分账 |
| | | */ |
| | | private String profitSharing; |
| | | /** |
| | | * 地区标识,默认传520100 |
| | | */ |
| | | private String areaInfo; |
| | | /** |
| | | * 是否匿名。默认传0 |
| | | */ |
| | | private String payType; |
| | | /** |
| | | * 业务类型,默认传10408 |
| | | */ |
| | | private String businessType; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 16:45 |
| | | */ |
| | | @Data |
| | | public class ListPage<T> { |
| | | /** |
| | | * 总条数 |
| | | */ |
| | | private Integer total; |
| | | /** |
| | | * 当前页码 |
| | | */ |
| | | private Integer pageNum; |
| | | /** |
| | | * 每页条数 |
| | | */ |
| | | private Integer pageSize; |
| | | /** |
| | | * 数据列表 |
| | | */ |
| | | private T list; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/16 23:50 |
| | | */ |
| | | @Data |
| | | public class LoginWeChatXiao { |
| | | /** |
| | | * token |
| | | */ |
| | | private String token; |
| | | /** |
| | | * 用户UUID |
| | | */ |
| | | private String userUUID; |
| | | /** |
| | | * 用户手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 企业名称,无企业时为空 |
| | | */ |
| | | private String enterName; |
| | | /** |
| | | * 企业编码 |
| | | */ |
| | | private String enterCode; |
| | | /** |
| | | * 企业认证状态 |
| | | */ |
| | | private String enterAuth; |
| | | /** |
| | | * 是否是管理员,是:1;否:0 |
| | | */ |
| | | private String isAdmin; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/9 18:13 |
| | | */ |
| | | @Data |
| | | public class ModifyEnterpriseInfoRequest { |
| | | /** |
| | | * 企业编码 |
| | | */ |
| | | private String enter_code; |
| | | /** |
| | | * 操作人员手机号 |
| | | */ |
| | | private String operator; |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | private String enter_name; |
| | | /** |
| | | * 企业简称 |
| | | */ |
| | | private String enter_nickname; |
| | | /** |
| | | * 企业地址 |
| | | */ |
| | | private String enter_address; |
| | | /** |
| | | * 企业邮箱 |
| | | */ |
| | | private String enter_email; |
| | | /** |
| | | * 联系人姓名 |
| | | */ |
| | | private String contact_name; |
| | | /** |
| | | * 联系人手机号 |
| | | */ |
| | | private String contact_mobile; |
| | | /** |
| | | * 营业执照扫描件URL |
| | | */ |
| | | private String operscanpic; |
| | | /** |
| | | * 营业期开始时间 |
| | | */ |
| | | private String businessTermStartTime; |
| | | /** |
| | | * 营业期结束时间 |
| | | */ |
| | | private String businessTermEndTime; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | private String area; |
| | | /** |
| | | * 二级域名 |
| | | */ |
| | | private String second_realms; |
| | | /** |
| | | * 企业来源编码 |
| | | */ |
| | | private String source_code; |
| | | /** |
| | | * 店铺所属行业编码 |
| | | */ |
| | | private String trade_code; |
| | | /** |
| | | * 企业分类编码 |
| | | */ |
| | | private String type_code; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.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; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 16:31 |
| | | */ |
| | | @Data |
| | | public class ModifyTravelItineraryRequest { |
| | | /** |
| | | * 场景标识。交通场景传”TRAFFIC” |
| | | */ |
| | | private String scene; |
| | | /** |
| | | * 租户ID。地区行政编码。黔南州传522700 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 行程单ID |
| | | */ |
| | | private String orderId; |
| | | /** |
| | | * 行程单状态。2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,9=已完成,10=已取消,11=改派中 |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 司机ID |
| | | */ |
| | | private String driverId; |
| | | /** |
| | | * 推广员ID |
| | | */ |
| | | private String promoterId; |
| | | /** |
| | | * 服务商商户ID |
| | | */ |
| | | private String supplierShopId; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 9:44 |
| | | */ |
| | | @Data |
| | | public class OrderInfo { |
| | | /** |
| | | * 订单id |
| | | */ |
| | | private String orderId; |
| | | /** |
| | | * 订单状态 |
| | | */ |
| | | private String status; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:18 |
| | | */ |
| | | @Data |
| | | public class PayInfo { |
| | | /** |
| | | * 证联返回码000000:请求成功 |
| | | */ |
| | | private String retCode; |
| | | /** |
| | | * 证联返回信息 |
| | | */ |
| | | private String retMsg; |
| | | /** |
| | | * true、false |
| | | */ |
| | | private String success; |
| | | /** |
| | | * 证联返回数据 |
| | | */ |
| | | private PayInfoData data; |
| | | /** |
| | | * 签名 |
| | | */ |
| | | private String sign; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:18 |
| | | */ |
| | | @Data |
| | | public class PayInfoData { |
| | | /** |
| | | * 收银台链接 |
| | | */ |
| | | private String redirectUrl; |
| | | /** |
| | | * 支付流水号 |
| | | */ |
| | | private String payId; |
| | | /** |
| | | * 支付工单状态 |
| | | * 0 待支付 |
| | | * 1 部分支付成功 |
| | | * 2 支付成功 |
| | | * 3 支付失败 |
| | | */ |
| | | private String status; |
| | | /** |
| | | * 支付时间,格式:yyyy-MM-dd HH:mm:ss |
| | | */ |
| | | private String payTime; |
| | | /** |
| | | * 扣款金额 单位分 |
| | | */ |
| | | private String payFee; |
| | | /** |
| | | * 支付信息 |
| | | */ |
| | | private List<PaymentInfo> paymentInfos; |
| | | |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:32 |
| | | */ |
| | | @Data |
| | | public class PaymentInfo { |
| | | /** |
| | | * 支付模式。此场景下默认传501212(测试和生产一致) |
| | | */ |
| | | private String payModeId; |
| | | /** |
| | | * 支付交易明细标识 |
| | | */ |
| | | private String payItemId; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | private String payFee; |
| | | /** |
| | | * 支付状态 |
| | | */ |
| | | private String status; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | private String payTime; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:32 |
| | | */ |
| | | @Data |
| | | public class PaymentInfoRequest { |
| | | /** |
| | | * 支付模式。此场景下默认传501212(测试和生产一致) |
| | | */ |
| | | private String payModeId; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | private String realFee; |
| | | /** |
| | | * |
| | | */ |
| | | private String tradeFee; |
| | | /** |
| | | * 账户类型 501 |
| | | */ |
| | | private String accountTyp; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 18:29 |
| | | */ |
| | | @Data |
| | | public class PaymentOrderRequest { |
| | | /** |
| | | * 场景标识。交通场景传”TRAFFIC” |
| | | */ |
| | | private String scene; |
| | | /** |
| | | * 场景应用标识。默认52270015 |
| | | */ |
| | | private String mhltiCenterAppId; |
| | | /** |
| | | * 支付流水明细 |
| | | */ |
| | | private String payItemId; |
| | | /** |
| | | * 支付明细json串 |
| | | */ |
| | | private String paymentInfo; |
| | | /** |
| | | * 订单ID |
| | | */ |
| | | private String orderId; |
| | | /** |
| | | * 支付金额,单位元 |
| | | */ |
| | | private BigDecimal charge; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | private String payTime; |
| | | /** |
| | | * 支付流水号 |
| | | */ |
| | | private String paymentSerialNumber; |
| | | /** |
| | | * 付款类型,4、线上支付 |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 付款方式,6:微信 7:支付宝 8:银行卡 9:银联二维码 10银联购物车收银台 |
| | | */ |
| | | private Integer payChannel; |
| | | /** |
| | | * 是否补偿单。1、是,0、否 |
| | | */ |
| | | private Integer isCompensate; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 19:31 |
| | | */ |
| | | @Data |
| | | public class QYTPaymentCallback { |
| | | /** |
| | | * 加密字符串 |
| | | */ |
| | | private String sign; |
| | | /** |
| | | * 时间戳 |
| | | */ |
| | | private String timeStamp; |
| | | /** |
| | | * 请求调用唯一标识 |
| | | */ |
| | | private String messageId; |
| | | /** |
| | | * 支付结果信息 |
| | | */ |
| | | private QYTPaymentCallbackData data; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 19:34 |
| | | */ |
| | | @Data |
| | | public class QYTPaymentCallbackData { |
| | | /** |
| | | * 业务侧行程编号 |
| | | */ |
| | | private String orderNo; |
| | | /** |
| | | * 商户单标识。行程单ID |
| | | */ |
| | | private String partnerPayId; |
| | | /** |
| | | * 支付中心商户号 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 支付工单标识 |
| | | */ |
| | | private String payId; |
| | | /** |
| | | * 支付状态。1.未支付 2已支付 |
| | | */ |
| | | private String status; |
| | | /** |
| | | * 支付时间,格式:YYYY-MM-DD HH:mm:ss |
| | | */ |
| | | private String payTime; |
| | | /** |
| | | * 扣款总金额 单位分 |
| | | */ |
| | | private String payFee; |
| | | /** |
| | | * 支付详细信息 |
| | | */ |
| | | private List<QYTPaymentInfoCallback> paymentInfos; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 19:37 |
| | | */ |
| | | @Data |
| | | public class QYTPaymentInfoCallback { |
| | | /** |
| | | * 支付交易明细标识 |
| | | */ |
| | | private String payItemId; |
| | | /** |
| | | * 支付模式 |
| | | */ |
| | | private String payModeId; |
| | | /** |
| | | * 支付金额,单位分 |
| | | */ |
| | | private String payFee; |
| | | /** |
| | | * 实付金额,单位分 |
| | | */ |
| | | private String realFee; |
| | | /** |
| | | * 支付状态。1.未支付 2已支付 |
| | | */ |
| | | private String status; |
| | | /** |
| | | * 支付时间,格式:YYYY-MM-DD HH:mm:ss |
| | | */ |
| | | private String payTime; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 用户信息 |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 15:11 |
| | | */ |
| | | @Data |
| | | public class QYTUserInfo { |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | private String nickname; |
| | | /** |
| | | * 小头像url |
| | | */ |
| | | private String photoUrl; |
| | | /** |
| | | * 大头像url |
| | | */ |
| | | private String photoUrlBig; |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | private String enterName; |
| | | |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.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; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:59 |
| | | */ |
| | | @Data |
| | | public class RegisterViaMobileRequest { |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 客户端appid |
| | | */ |
| | | private String appId; |
| | | /** |
| | | * 用户密码 |
| | | */ |
| | | private String password; |
| | | /** |
| | | * 短信验证码 |
| | | */ |
| | | private String verify_code; |
| | | /** |
| | | * 验证码类型 |
| | | * 0:短信发送的验证码;1:一键获取手机号返回注册验证码;2、验证码验证成功后生成的Ticket |
| | | */ |
| | | private String verify_code_type; |
| | | /** |
| | | * 加密类型 |
| | | * 第三方系统可以填写空 |
| | | */ |
| | | private String encryptType; |
| | | /** |
| | | * 用户类型 |
| | | * 0:普通用户 |
| | | */ |
| | | private String user_type; |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | private String nickname; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.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; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2025/6/14 14:10 |
| | | */ |
| | | @Data |
| | | public class SaveStaffNode { |
| | | /** |
| | | * 人员ID |
| | | */ |
| | | private Long empId; |
| | | /** |
| | | * 员工名称 |
| | | */ |
| | | private String empName; |
| | | /** |
| | | * 员工昵称 |
| | | */ |
| | | private String empNickname; |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | private String mphone; |
| | | /** |
| | | * 登录账号 |
| | | */ |
| | | private String loginNo; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:22 |
| | | */ |
| | | @Data |
| | | public class SaveStaffNodeRequest { |
| | | /** |
| | | * 操作人手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 操作人企业ID |
| | | */ |
| | | private String entercode; |
| | | /** |
| | | * 人员名称 |
| | | */ |
| | | private String empName; |
| | | /** |
| | | * 人员显示名 |
| | | */ |
| | | private String empNickname; |
| | | /** |
| | | * 人员账号 |
| | | */ |
| | | private String loginNo; |
| | | /** |
| | | * 人员性别 |
| | | */ |
| | | private String empSex; |
| | | /** |
| | | * 人员手机号 |
| | | */ |
| | | private String mphone; |
| | | /** |
| | | * 人员邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 员工所属部分ID |
| | | */ |
| | | private Integer deptId; |
| | | /** |
| | | * 员工职务ID |
| | | */ |
| | | private Integer positionId; |
| | | /** |
| | | * 员工职务名称 |
| | | */ |
| | | private String positionName; |
| | | /** |
| | | * 高管模式 1 是 0 不是 |
| | | */ |
| | | private Integer superLevel; |
| | | /** |
| | | * 隐藏号码 1 是 0 不是 |
| | | */ |
| | | private Integer hideMobile; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/2 15:41 |
| | | */ |
| | | @Data |
| | | public class SendSmsRequest { |
| | | /** |
| | | * 目标地址 |
| | | */ |
| | | private String destAddress; |
| | | /** |
| | | * 模板id |
| | | */ |
| | | private String templateId; |
| | | /** |
| | | * 参数集合 |
| | | */ |
| | | private Map<String, String> templateParams; |
| | | /** |
| | | * 模板中占位符key |
| | | */ |
| | | private String code; |
| | | /** |
| | | * 签名SPID |
| | | */ |
| | | private String spId; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:44 |
| | | */ |
| | | @Data |
| | | public class StaffNodeInfo { |
| | | /** |
| | | * 人员ID |
| | | */ |
| | | private Integer empId; |
| | | /** |
| | | * 主要号码 |
| | | */ |
| | | private String mainMphone; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | /** |
| | | * 企业ID |
| | | */ |
| | | private String enterNum; |
| | | /** |
| | | * 加密企业名称 |
| | | */ |
| | | private String empNameEncode; |
| | | /** |
| | | * 人员名称 |
| | | */ |
| | | private String empName; |
| | | /** |
| | | * 人员显示名 |
| | | */ |
| | | private String empNickname; |
| | | /** |
| | | * 人员账号 |
| | | */ |
| | | private String loginNo; |
| | | /** |
| | | * 人员性别(男\女) |
| | | */ |
| | | private String empSex; |
| | | /** |
| | | * 人员手机号 |
| | | */ |
| | | private String mphone; |
| | | /** |
| | | * 人员邮箱加密 |
| | | */ |
| | | private String mainEmailEncode; |
| | | /** |
| | | * 所属企业id |
| | | */ |
| | | private Long enterId; |
| | | /** |
| | | * 唯一编号 |
| | | */ |
| | | private String onconuuid; |
| | | /** |
| | | * 邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 员工所属部门ID多个部门英文; 分割 |
| | | */ |
| | | private Integer deptId; |
| | | /** |
| | | * 员工职位ID |
| | | */ |
| | | private Long positionId; |
| | | /** |
| | | * 员工职位名称 |
| | | */ |
| | | private String positionName; |
| | | /** |
| | | * 高管模式 1 是 0 不是 |
| | | */ |
| | | private Integer superLevel; |
| | | /** |
| | | * 隐藏手机号 1 是 0 否 |
| | | */ |
| | | private Integer hideMobile; |
| | | /** |
| | | * 有效状态(0=否,1=是) |
| | | */ |
| | | private String isValid; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:17 |
| | | */ |
| | | @Data |
| | | public class TradeOrderCreate { |
| | | /** |
| | | * 订单信息 |
| | | */ |
| | | private OrderInfo orderInfo; |
| | | /** |
| | | * 支付接口调用信息 |
| | | */ |
| | | private PayInfo payInfo; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:03 |
| | | */ |
| | | @Data |
| | | public class TradeOrderCreateData { |
| | | /** |
| | | * 司机id |
| | | */ |
| | | private String treatShopId; |
| | | /** |
| | | * 应用场景标识 |
| | | */ |
| | | private String orderAppId; |
| | | /** |
| | | * 场景标识 |
| | | */ |
| | | private String scene; |
| | | /** |
| | | * 租户ID。地区行政编码。黔南州传522700 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 超时时间 |
| | | */ |
| | | private String timeout; |
| | | /** |
| | | * 结算信息json串。其中结算分账标识(profitSharing:0:不分账,1:分账)、是否推广单标识(isPromote:1、是、0、否)必传。例:{"profitSharing":"0",”isPromote”:”0”} |
| | | */ |
| | | private String field1; |
| | | /** |
| | | * 订单总金额,单位元 |
| | | */ |
| | | private BigDecimal charge; |
| | | /** |
| | | * 订单渠道。小程序传GRJYCXWXXCX,贵人家园传GRJY |
| | | */ |
| | | private String channelSource; |
| | | /** |
| | | * 行程单ID |
| | | */ |
| | | private String orderId; |
| | | /** |
| | | * 业务侧订单号 |
| | | */ |
| | | private String orderNo; |
| | | /** |
| | | * 下单人ID |
| | | */ |
| | | private String customerId; |
| | | /** |
| | | * 商户号,由支付中心分配。测试环境5400004 |
| | | */ |
| | | private String payPartnerId; |
| | | /** |
| | | * 商户单标识。订单中心行程单号,每次请求请保持唯一性。 |
| | | */ |
| | | private String partnerPayId; |
| | | /** |
| | | * 币种。RMB(人民币);USD(美元) |
| | | */ |
| | | private String currency; |
| | | /** |
| | | * 交易总金额,单位分。 |
| | | */ |
| | | private String totalFee; |
| | | /** |
| | | * 前台通知URL地址。 |
| | | */ |
| | | private String retUrl; |
| | | /** |
| | | * 用户IP |
| | | */ |
| | | private String clientIp; |
| | | /** |
| | | * Y代表要登录,跳到标准收银台 |
| | | * N代表不需要登录,跳到无支付帐号收银台 |
| | | */ |
| | | private String needLoginFlag; |
| | | /** |
| | | * 支付单描述 |
| | | */ |
| | | private String orderDesc; |
| | | /** |
| | | * 接入模式:PC、H5、APP |
| | | */ |
| | | private String accessMode; |
| | | /** |
| | | * 支付信息 |
| | | */ |
| | | private List<GoodsInfoRequest> goodsInfo; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:23 |
| | | */ |
| | | @Data |
| | | public class TradePayOff1Data { |
| | | /** |
| | | * 商户号,由支付中心分配。测试环境5400004 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 超时时间 |
| | | */ |
| | | private String timeout; |
| | | /** |
| | | * 场景标识。交通场景传”TRAFFIC” |
| | | */ |
| | | private String scene; |
| | | /** |
| | | * 商户单标识。订单中心订单号,每次请求请保持唯一性。 |
| | | */ |
| | | private String partnerPayId; |
| | | /** |
| | | * 币种。RMB(人民币);USD(美元) |
| | | */ |
| | | private String currency; |
| | | /** |
| | | * 交易总金额,单位分。 |
| | | */ |
| | | private String totalFee; |
| | | /** |
| | | * 前台通知URL地址。 |
| | | */ |
| | | private String retUrl; |
| | | /** |
| | | * 用户IP |
| | | */ |
| | | private String clientIp; |
| | | /** |
| | | * Y代表要登录,跳到标准收银台 |
| | | * N代表不需要登录,跳到无支付帐号收银台 |
| | | */ |
| | | private String needLoginFlag; |
| | | /** |
| | | * 支付单描述 |
| | | */ |
| | | private String orderDesc; |
| | | /** |
| | | * 接入模式:PC、H5、APP |
| | | */ |
| | | private String accessMode; |
| | | /** |
| | | * 商品描述信息。Json数组 |
| | | */ |
| | | private List<GoodsInfoRequest> goodsInfo; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:23 |
| | | */ |
| | | @Data |
| | | public class TradePayOffData { |
| | | /** |
| | | * 商户号,由支付中心分配。测试环境5400004 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 超时时间 |
| | | */ |
| | | private String timeout; |
| | | /** |
| | | * 场景标识。交通场景传”TRAFFIC” |
| | | */ |
| | | private String scene; |
| | | /** |
| | | * 商户单标识。订单中心订单号,每次请求请保持唯一性。 |
| | | */ |
| | | private String partnerPayId; |
| | | /** |
| | | * 币种。RMB(人民币);USD(美元) |
| | | */ |
| | | private String currency; |
| | | /** |
| | | * 交易总金额,单位分。 |
| | | */ |
| | | private String totalFee; |
| | | /** |
| | | * 前台通知URL地址。 |
| | | */ |
| | | private String retUrl; |
| | | /** |
| | | * 用户IP |
| | | */ |
| | | private String clientIp; |
| | | /** |
| | | * Y代表要登录,跳到标准收银台 |
| | | * N代表不需要登录,跳到无支付帐号收银台 |
| | | */ |
| | | private String needLoginFlag; |
| | | /** |
| | | * 支付单描述 |
| | | */ |
| | | private String orderDesc; |
| | | /** |
| | | * 接入模式:PC、H5、APP |
| | | */ |
| | | private String accessMode; |
| | | /** |
| | | * 支付信息 |
| | | */ |
| | | private List<PaymentInfoRequest> paymentInfos; |
| | | /** |
| | | * 商品描述信息。Json数组 |
| | | */ |
| | | private List<GoodsInfo> goodsInfo; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 10:22 |
| | | */ |
| | | @Data |
| | | public class TradeRequest<T> { |
| | | /** |
| | | * 场景编号.交易中心提供。测试环境:1948289607125864448 |
| | | */ |
| | | private String sceneId; |
| | | /** |
| | | * 应用编号。中台应用appKey |
| | | */ |
| | | private String appId; |
| | | /** |
| | | * 场景版本。交易中心提供。测试环境1 |
| | | */ |
| | | private Integer configVersion; |
| | | /** |
| | | * 请求ID。每次调用唯一标识 |
| | | */ |
| | | private String requestId; |
| | | /** |
| | | * 业务数据 |
| | | */ |
| | | private T data; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/24 16:48 |
| | | */ |
| | | @Data |
| | | public class TravelItinerary { |
| | | /** |
| | | * 场景标识。交通场景传”TRAFFIC” |
| | | */ |
| | | private String scene; |
| | | /** |
| | | * 租户ID。地区行政编码。黔南州传522700 |
| | | */ |
| | | private String partnerId; |
| | | /** |
| | | * 业务侧订单号 |
| | | */ |
| | | private String orderNo; |
| | | /** |
| | | * 乘客ID |
| | | */ |
| | | private String customerId; |
| | | /** |
| | | * 司机ID |
| | | */ |
| | | private String driverId; |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | private String orderId; |
| | | /** |
| | | * 推广员ID |
| | | */ |
| | | private String promoterId; |
| | | /** |
| | | * 服务商商户ID |
| | | */ |
| | | private String supplierShopId; |
| | | /** |
| | | * 场景服务类型。1、出租;2、网约车;3、城际;4、顺风车 |
| | | */ |
| | | private Integer serviceType; |
| | | /** |
| | | * 订单状态。1、待支付,11、已完结(可结算) |
| | | */ |
| | | private Integer orderStatus; |
| | | /** |
| | | * 行程单状态。2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,9=已完成,10=已取消,11=改派中 |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private String createTime; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private String updateTime; |
| | | |
| | | } |
New file |
| | |
| | | server: |
| | | port: 8007 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | | session-invalidate-time: 1800 #session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒 |
| | | session-validation-interval: 900 #多久检测一次失效的session(只在单机环境下生效) 单位:秒 |
| | | |
| | | spring: |
| | | application: |
| | | name: driver-server |
| | | profiles: |
| | | active: dev |
| | | # active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | | prefix: /WEB-INF/view |
| | | devtools: |
| | | restart: |
| | | enabled: false |
| | | additional-paths: src/main/java |
| | | exclude: static/**,WEB-INF/view/** |
| | | servlet: |
| | | multipart: |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | |
| | | mybatis-plus: |
| | | typeAliasesPackage: com.supersavedriving.driver.modular |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl |
| | | mapper-locations: classpath*:com/supersavedriving/driver/modular/system/dao/**/*.xml |
| | | |
| | | |
| | | eureka: |
| | | client: |
| | | service-url: #注册中心地址 |
| | | defaultZone: http://sinata:sinata@127.0.0.1:8000/eureka #启用身份验证的方式连接 |
| | | register-with-eureka: true #在注册中心进行注册 |
| | | fetch-registry: true #从Eureka中获取注册信息。 |
| | | |
| | | --- |
| | | |
| | | |
| | | #配置Swagger接口扫描范围 |
| | | swagger: |
| | | base-package: com.supersavedriving.driver.modular |
| | | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://121.31.232.206:3306/qyt_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | |
| | | |
| | | --- |
| | | |
| | | |
| | | |
| | | wx: |
| | | grantType: authorization_code #填authorization_code |
| | | appid: 1111 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: 111111 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appletsAppid: wx1f52be0fdb1d2875 #小程序APPid |
| | | appletsAppSecret: 8210ae106f3a501d77b410070a0aa2c2 # |
| | | officialAccountAppid: 11111 |
| | | officialAccountAppSecret: 1111 |
| | | webAppId: 111 |
| | | webAppSecret: 11 |
| | | mchId: 111 #微信支付分配的商户号 |
| | | key: 111 #key为商户平台设置的密钥key: |
| | | apiv3: 111 #key为商户平台设置的密钥key: |
| | | |
| | | --- |
| | | |
| | | alipay: |
| | | appid: 111 #应用程序唯一标识 |
| | | appPrivateKey: 111 #开发者应用私钥 |
| | | alipayPublicKey: 111 #应用公钥 |
| | | alipay_public_key: 111 #支付宝公钥 |
| | | |
| | | --- |
| | | |
| | | juhe: #聚合数据 |
| | | appKey: 0d3fd83eddaa33e5563f548257648577 # |
| | | |
| | | |
| | | --- |
| | | |
| | | filePath: /usr/local/server/app/orderPostionFile/ #存储订单轨迹文件路径 |
| | | |
| | | callbackPath: http://121.31.232.206:3002/driver |
| | | |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://192.168.110.80:27017/test |
| | | |
| | | --- |
| | | |
| | | rongyun: |
| | | app_key: vnroth0kvgxso |
| | | app_secret: tZsVNJ4kkBfi |
| | | |
| | | |
| | | # mallbook 调起接口参数配置 |
| | | mallbook: |
| | | # pay_url:mallbook接口地址 测试环境: https://uat.mallbook.cn/api 生产环境:https://cloudpay.mallbook.cn/api |
| | | pay_url: https://cloudpay.mallbook.cn/api |
| | | # merchant_no 业务系统商户平台编号,需替换为mallbook工作人员提供的商户编号 |
| | | merchant_no: MBH23056 |
| | | # version 接口版本号 |
| | | version: 1.0.0 |
| | | # channel_type 渠道类型 HF:汇付 |
| | | channel_type: HF |
| | | # merchant_private_key 商户平台私钥,需要替换成商户平台自己生成的私钥 |
| | | merchant_private_key: MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALHmyTrxPYcAwABnX+3VW9vxUftm57zBpnbfOT4vizMnKdpfCkIgtdbfdnSCtt637yWM2fxnZfItnhTeQA2lL8f4SXgZt/bVXfmAWi4IxQ+HJy0Qs8nNy2nnjICPBPcpWzHwUxQ/THHqU0a7b9B91J5DFcbQb25BHeRpHwkBw6A/AgMBAAECgYAmcWq2s/7Jt53F+JDAQkTRaHqAyyH0phwkv+QMzhVUfngK2lLLK2pf/nYIg16lDjY9dQx+AJIFHVp1w/kveayzOz3BIqPoznyIVYPolRGZCWPo+2vdp0CIdBh7zahST5g5Gem4cU47wO5hPYs1kXKPG4mUPtaIAMHFxhyLvIagAQJBAOS63AIZrRrldeNCVVNXbpAT52JuWLCgravM9coOh6scmG6UQwxxcott8hneHr9fazk2LHbHMxlG8F+dQPA0+D8CQQDHHJN7Dnske8oJ+1sq4uhQP3HMsmNIgth+ZcaZpiPcxnNKYVGhzAwTVV2ruFJle5ajebo6zfWuqJhtZGRNh1gBAkA/lRoXk1+lfGfa9tOVSVa4wm+t0xLgdqoQefdRZdyc2mQdSSWiTd8Tl0qXmkFd3X6G9uJBWnp/6lJjoektXOwtAkBsZTQsw99qJzIAaSRinpDWTxPG2j6OlR0DAqkxsG7JnAfbsEteh9TzGYAbIgdJVBTX/kbSCJn9ca85rnOkeVABAkAUbDfU3Z702z20NtwAxc1IkrtQ1lKuqSpj9/LuR1/6KRkYQsUWnUiOO9hu5YDWIcflFrnCenF8j8OnvGghltxT |
| | | # mall_book_public_key mallbook测试环境公钥 不需要替换 |
| | | mall_book_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq6OLZKgUHH5wOk9xSBgN7yC17r3PQwMlY9/IorqrOlaIqrU0eAVZ5+dWrJD/3bdu7Ctq8n8trTm/IUYs7wtMg5SKwyX4/N+KQc2N7LL4yCq4vNl41q9sYgrtA0QnZoucIZcq1mwyu7RTDC8Wp7LGddnlkJsmL8masgMxA6cc9NwIDAQAB |
| | | |
New file |
| | |
| | | server: |
| | | port: 8007 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | | session-invalidate-time: 1800 #session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒 |
| | | session-validation-interval: 900 #多久检测一次失效的session(只在单机环境下生效) 单位:秒 |
| | | |
| | | spring: |
| | | application: |
| | | name: driver-server |
| | | profiles: |
| | | active: dev |
| | | # active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | | prefix: /WEB-INF/view |
| | | devtools: |
| | | restart: |
| | | enabled: false |
| | | additional-paths: src/main/java |
| | | exclude: static/**,WEB-INF/view/** |
| | | servlet: |
| | | multipart: |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | |
| | | mybatis-plus: |
| | | typeAliasesPackage: com.supersavedriving.driver.modular |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl |
| | | mapper-locations: classpath*:com/supersavedriving/driver/modular/system/dao/**/*.xml |
| | | |
| | | |
| | | eureka: |
| | | client: |
| | | service-url: #注册中心地址 |
| | | defaultZone: http://sinata:sinata@127.0.0.1:8000/eureka #启用身份验证的方式连接 |
| | | register-with-eureka: true #在注册中心进行注册 |
| | | fetch-registry: true #从Eureka中获取注册信息。 |
| | | |
| | | --- |
| | | |
| | | |
| | | #配置Swagger接口扫描范围 |
| | | swagger: |
| | | base-package: com.supersavedriving.driver.modular |
| | | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://121.31.232.206:3306/qyt_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | |
| | | |
| | | --- |
| | | |
| | | |
| | | |
| | | wx: |
| | | grantType: authorization_code #填authorization_code |
| | | appid: 1111 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: 111111 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appletsAppid: wx1f52be0fdb1d2875 #小程序APPid |
| | | appletsAppSecret: 8210ae106f3a501d77b410070a0aa2c2 # |
| | | officialAccountAppid: 11111 |
| | | officialAccountAppSecret: 1111 |
| | | webAppId: 111 |
| | | webAppSecret: 11 |
| | | mchId: 111 #微信支付分配的商户号 |
| | | key: 111 #key为商户平台设置的密钥key: |
| | | apiv3: 111 #key为商户平台设置的密钥key: |
| | | |
| | | --- |
| | | |
| | | alipay: |
| | | appid: 111 #应用程序唯一标识 |
| | | appPrivateKey: 111 #开发者应用私钥 |
| | | alipayPublicKey: 111 #应用公钥 |
| | | alipay_public_key: 111 #支付宝公钥 |
| | | |
| | | --- |
| | | |
| | | juhe: #聚合数据 |
| | | appKey: 0d3fd83eddaa33e5563f548257648577 # |
| | | |
| | | |
| | | --- |
| | | |
| | | filePath: /usr/local/server/app/orderPostionFile/ #存储订单轨迹文件路径 |
| | | |
| | | callbackPath: http://121.31.232.206:3002/driver |
| | | |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://192.168.110.80:27017/test |
| | | |
| | | --- |
| | | |
| | | rongyun: |
| | | app_key: vnroth0kvgxso |
| | | app_secret: tZsVNJ4kkBfi |
| | | |
| | | |
| | | # mallbook 调起接口参数配置 |
| | | mallbook: |
| | | # pay_url:mallbook接口地址 测试环境: https://uat.mallbook.cn/api 生产环境:https://cloudpay.mallbook.cn/api |
| | | pay_url: https://cloudpay.mallbook.cn/api |
| | | # merchant_no 业务系统商户平台编号,需替换为mallbook工作人员提供的商户编号 |
| | | merchant_no: MBH23056 |
| | | # version 接口版本号 |
| | | version: 1.0.0 |
| | | # channel_type 渠道类型 HF:汇付 |
| | | channel_type: HF |
| | | # merchant_private_key 商户平台私钥,需要替换成商户平台自己生成的私钥 |
| | | merchant_private_key: MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALHmyTrxPYcAwABnX+3VW9vxUftm57zBpnbfOT4vizMnKdpfCkIgtdbfdnSCtt637yWM2fxnZfItnhTeQA2lL8f4SXgZt/bVXfmAWi4IxQ+HJy0Qs8nNy2nnjICPBPcpWzHwUxQ/THHqU0a7b9B91J5DFcbQb25BHeRpHwkBw6A/AgMBAAECgYAmcWq2s/7Jt53F+JDAQkTRaHqAyyH0phwkv+QMzhVUfngK2lLLK2pf/nYIg16lDjY9dQx+AJIFHVp1w/kveayzOz3BIqPoznyIVYPolRGZCWPo+2vdp0CIdBh7zahST5g5Gem4cU47wO5hPYs1kXKPG4mUPtaIAMHFxhyLvIagAQJBAOS63AIZrRrldeNCVVNXbpAT52JuWLCgravM9coOh6scmG6UQwxxcott8hneHr9fazk2LHbHMxlG8F+dQPA0+D8CQQDHHJN7Dnske8oJ+1sq4uhQP3HMsmNIgth+ZcaZpiPcxnNKYVGhzAwTVV2ruFJle5ajebo6zfWuqJhtZGRNh1gBAkA/lRoXk1+lfGfa9tOVSVa4wm+t0xLgdqoQefdRZdyc2mQdSSWiTd8Tl0qXmkFd3X6G9uJBWnp/6lJjoektXOwtAkBsZTQsw99qJzIAaSRinpDWTxPG2j6OlR0DAqkxsG7JnAfbsEteh9TzGYAbIgdJVBTX/kbSCJn9ca85rnOkeVABAkAUbDfU3Z702z20NtwAxc1IkrtQ1lKuqSpj9/LuR1/6KRkYQsUWnUiOO9hu5YDWIcflFrnCenF8j8OnvGghltxT |
| | | # mall_book_public_key mallbook测试环境公钥 不需要替换 |
| | | mall_book_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq6OLZKgUHH5wOk9xSBgN7yC17r3PQwMlY9/IorqrOlaIqrU0eAVZ5+dWrJD/3bdu7Ctq8n8trTm/IUYs7wtMg5SKwyX4/N+KQc2N7LL4yCq4vNl41q9sYgrtA0QnZoucIZcq1mwyu7RTDC8Wp7LGddnlkJsmL8masgMxA6cc9NwIDAQAB |
| | | |
New file |
| | |
| | | server: |
| | | port: 8007 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | | session-invalidate-time: 1800 #session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒 |
| | | session-validation-interval: 900 #多久检测一次失效的session(只在单机环境下生效) 单位:秒 |
| | | |
| | | spring: |
| | | application: |
| | | name: driver-server |
| | | profiles: |
| | | active: dev |
| | | # active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | | prefix: /WEB-INF/view |
| | | devtools: |
| | | restart: |
| | | enabled: false |
| | | additional-paths: src/main/java |
| | | exclude: static/**,WEB-INF/view/** |
| | | servlet: |
| | | multipart: |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | |
| | | mybatis-plus: |
| | | typeAliasesPackage: com.supersavedriving.driver.modular |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl |
| | | mapper-locations: classpath*:com/supersavedriving/driver/modular/system/dao/**/*.xml |
| | | |
| | | |
| | | eureka: |
| | | client: |
| | | service-url: #注册中心地址 |
| | | defaultZone: http://sinata:sinata@127.0.0.1:8000/eureka #启用身份验证的方式连接 |
| | | register-with-eureka: true #在注册中心进行注册 |
| | | fetch-registry: true #从Eureka中获取注册信息。 |
| | | |
| | | --- |
| | | |
| | | |
| | | #配置Swagger接口扫描范围 |
| | | swagger: |
| | | base-package: com.supersavedriving.driver.modular |
| | | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://121.31.232.206:3306/qyt_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | |
| | | |
| | | --- |
| | | |
| | | |
| | | |
| | | wx: |
| | | grantType: authorization_code #填authorization_code |
| | | appid: 1111 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: 111111 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appletsAppid: wx1f52be0fdb1d2875 #小程序APPid |
| | | appletsAppSecret: 8210ae106f3a501d77b410070a0aa2c2 # |
| | | officialAccountAppid: 11111 |
| | | officialAccountAppSecret: 1111 |
| | | webAppId: 111 |
| | | webAppSecret: 11 |
| | | mchId: 111 #微信支付分配的商户号 |
| | | key: 111 #key为商户平台设置的密钥key: |
| | | apiv3: 111 #key为商户平台设置的密钥key: |
| | | |
| | | --- |
| | | |
| | | alipay: |
| | | appid: 111 #应用程序唯一标识 |
| | | appPrivateKey: 111 #开发者应用私钥 |
| | | alipayPublicKey: 111 #应用公钥 |
| | | alipay_public_key: 111 #支付宝公钥 |
| | | |
| | | --- |
| | | |
| | | juhe: #聚合数据 |
| | | appKey: 0d3fd83eddaa33e5563f548257648577 # |
| | | |
| | | |
| | | --- |
| | | |
| | | filePath: /usr/local/server/app/orderPostionFile/ #存储订单轨迹文件路径 |
| | | |
| | | callbackPath: http://121.31.232.206:3002/driver |
| | | |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://192.168.110.80:27017/test |
| | | |
| | | --- |
| | | |
| | | rongyun: |
| | | app_key: vnroth0kvgxso |
| | | app_secret: tZsVNJ4kkBfi |
| | | |
| | | |
| | | # mallbook 调起接口参数配置 |
| | | mallbook: |
| | | # pay_url:mallbook接口地址 测试环境: https://uat.mallbook.cn/api 生产环境:https://cloudpay.mallbook.cn/api |
| | | pay_url: https://cloudpay.mallbook.cn/api |
| | | # merchant_no 业务系统商户平台编号,需替换为mallbook工作人员提供的商户编号 |
| | | merchant_no: MBH23056 |
| | | # version 接口版本号 |
| | | version: 1.0.0 |
| | | # channel_type 渠道类型 HF:汇付 |
| | | channel_type: HF |
| | | # merchant_private_key 商户平台私钥,需要替换成商户平台自己生成的私钥 |
| | | merchant_private_key: MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALHmyTrxPYcAwABnX+3VW9vxUftm57zBpnbfOT4vizMnKdpfCkIgtdbfdnSCtt637yWM2fxnZfItnhTeQA2lL8f4SXgZt/bVXfmAWi4IxQ+HJy0Qs8nNy2nnjICPBPcpWzHwUxQ/THHqU0a7b9B91J5DFcbQb25BHeRpHwkBw6A/AgMBAAECgYAmcWq2s/7Jt53F+JDAQkTRaHqAyyH0phwkv+QMzhVUfngK2lLLK2pf/nYIg16lDjY9dQx+AJIFHVp1w/kveayzOz3BIqPoznyIVYPolRGZCWPo+2vdp0CIdBh7zahST5g5Gem4cU47wO5hPYs1kXKPG4mUPtaIAMHFxhyLvIagAQJBAOS63AIZrRrldeNCVVNXbpAT52JuWLCgravM9coOh6scmG6UQwxxcott8hneHr9fazk2LHbHMxlG8F+dQPA0+D8CQQDHHJN7Dnske8oJ+1sq4uhQP3HMsmNIgth+ZcaZpiPcxnNKYVGhzAwTVV2ruFJle5ajebo6zfWuqJhtZGRNh1gBAkA/lRoXk1+lfGfa9tOVSVa4wm+t0xLgdqoQefdRZdyc2mQdSSWiTd8Tl0qXmkFd3X6G9uJBWnp/6lJjoektXOwtAkBsZTQsw99qJzIAaSRinpDWTxPG2j6OlR0DAqkxsG7JnAfbsEteh9TzGYAbIgdJVBTX/kbSCJn9ca85rnOkeVABAkAUbDfU3Z702z20NtwAxc1IkrtQ1lKuqSpj9/LuR1/6KRkYQsUWnUiOO9hu5YDWIcflFrnCenF8j8OnvGghltxT |
| | | # mall_book_public_key mallbook测试环境公钥 不需要替换 |
| | | mall_book_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq6OLZKgUHH5wOk9xSBgN7yC17r3PQwMlY9/IorqrOlaIqrU0eAVZ5+dWrJD/3bdu7Ctq8n8trTm/IUYs7wtMg5SKwyX4/N+KQc2N7LL4yCq4vNl41q9sYgrtA0QnZoucIZcq1mwyu7RTDC8Wp7LGddnlkJsmL8masgMxA6cc9NwIDAQAB |
| | | |
| | |
| | | server: |
| | | port: 8007 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | | session-invalidate-time: 1800 #session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒 |
| | | session-validation-interval: 900 #多久检测一次失效的session(只在单机环境下生效) 单位:秒 |
| | | |
| | | spring: |
| | | application: |
| | | name: driver-server |
| | | profiles: |
| | | active: dev |
| | | # active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | | prefix: /WEB-INF/view |
| | | devtools: |
| | | restart: |
| | | enabled: false |
| | | additional-paths: src/main/java |
| | | exclude: static/**,WEB-INF/view/** |
| | | servlet: |
| | | multipart: |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | |
| | | mybatis-plus: |
| | | typeAliasesPackage: com.supersavedriving.driver.modular |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl |
| | | mapper-locations: classpath*:com/supersavedriving/driver/modular/system/dao/**/*.xml |
| | | |
| | | |
| | | eureka: |
| | | client: |
| | | service-url: #注册中心地址 |
| | | defaultZone: http://sinata:sinata@127.0.0.1:8000/eureka #启用身份验证的方式连接 |
| | | register-with-eureka: true #在注册中心进行注册 |
| | | fetch-registry: true #从Eureka中获取注册信息。 |
| | | |
| | | --- |
| | | |
| | | |
| | | #配置Swagger接口扫描范围 |
| | | swagger: |
| | | base-package: com.supersavedriving.driver.modular |
| | | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://121.31.232.206:3306/ok_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | # password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj |
| | | password: Xiwang2024! |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | # datasource: |
| | | # url: jdbc:mysql://192.168.110.80:3306/super_save_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: root |
| | | # password: 123456 |
| | | # db-name: guns #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | |
| | | #多数据源情况的配置 |
| | | guns: |
| | | muti-datasource: |
| | | open: false |
| | | url: jdbc:mysql://127.0.0.1:3306/guns_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | dataSourceNames: |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | |
| | | --- |
| | | |
| | | |
| | | |
| | | wx: |
| | | grantType: authorization_code #填authorization_code |
| | | appid: wx8a9af3889395d0e1 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: 95a34f114973298cce4297a20bb59bc3 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appletsAppid: wxda355f1377409600 #小程序APPid |
| | | appletsAppSecret: 58121b67f2ba25c17998fa26dc77e008 # |
| | | officialAccountAppid: 11111 |
| | | officialAccountAppSecret: 1111 |
| | | webAppId: 111 |
| | | webAppSecret: 11 |
| | | mchId: 1636941942 #微信支付分配的商户号 |
| | | key: Eri2GR2SB3b6iIhaoD7k3KQ8X0wf1Ybh #key为商户平台设置的密钥key: |
| | | apiv3: AKJ51Z4nhSqYBxmOXgUyCKA1vLP0J5Aj #key为商户平台设置的密钥key: |
| | | |
| | | --- |
| | | |
| | | alipay: |
| | | appid: 111 #应用程序唯一标识 |
| | | appPrivateKey: 111 #开发者应用私钥 |
| | | alipayPublicKey: 111 #应用公钥 |
| | | alipay_public_key: 111 #支付宝公钥 |
| | | |
| | | --- |
| | | |
| | | juhe: #聚合数据 |
| | | appKey: 0d3fd83eddaa33e5563f548257648577 # |
| | | |
| | | |
| | | --- |
| | | |
| | | filePath: /usr/local/server/app/orderPostionFile/ #存储订单轨迹文件路径 |
| | | #filePath: C:/orderPostionFile/ #存储订单轨迹文件路径 |
| | | |
| | | #支付回调地址 |
| | | #正式环境 |
| | | #callbackPath: https://chaoshengdaijia.com:443/driver |
| | | #测试环境 |
| | | callbackPath: http://121.31.232.206:3002/driver |
| | | #callbackPath: http://221.182.45.100:3002/driver |
| | | |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | # uri: mongodb://192.168.110.188:27017/admin |
| | | uri: mongodb://121.31.232.206:27017/test |
| | | |
| | | --- |
| | | |
| | | rongyun: |
| | | app_key: vnroth0kvgxso |
| | | app_secret: tZsVNJ4kkBfi |
| | | |
| | | |
| | | # mallbook 调起接口参数配置 |
| | | mallbook: |
| | | # pay_url:mallbook接口地址 测试环境: https://uat.mallbook.cn/api 生产环境:https://cloudpay.mallbook.cn/api |
| | | pay_url: https://cloudpay.mallbook.cn/api |
| | | # merchant_no 业务系统商户平台编号,需替换为mallbook工作人员提供的商户编号 |
| | | merchant_no: MBH23056 |
| | | # version 接口版本号 |
| | | version: 1.0.0 |
| | | # channel_type 渠道类型 HF:汇付 |
| | | channel_type: HF |
| | | # merchant_private_key 商户平台私钥,需要替换成商户平台自己生成的私钥 |
| | | merchant_private_key: MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALHmyTrxPYcAwABnX+3VW9vxUftm57zBpnbfOT4vizMnKdpfCkIgtdbfdnSCtt637yWM2fxnZfItnhTeQA2lL8f4SXgZt/bVXfmAWi4IxQ+HJy0Qs8nNy2nnjICPBPcpWzHwUxQ/THHqU0a7b9B91J5DFcbQb25BHeRpHwkBw6A/AgMBAAECgYAmcWq2s/7Jt53F+JDAQkTRaHqAyyH0phwkv+QMzhVUfngK2lLLK2pf/nYIg16lDjY9dQx+AJIFHVp1w/kveayzOz3BIqPoznyIVYPolRGZCWPo+2vdp0CIdBh7zahST5g5Gem4cU47wO5hPYs1kXKPG4mUPtaIAMHFxhyLvIagAQJBAOS63AIZrRrldeNCVVNXbpAT52JuWLCgravM9coOh6scmG6UQwxxcott8hneHr9fazk2LHbHMxlG8F+dQPA0+D8CQQDHHJN7Dnske8oJ+1sq4uhQP3HMsmNIgth+ZcaZpiPcxnNKYVGhzAwTVV2ruFJle5ajebo6zfWuqJhtZGRNh1gBAkA/lRoXk1+lfGfa9tOVSVa4wm+t0xLgdqoQefdRZdyc2mQdSSWiTd8Tl0qXmkFd3X6G9uJBWnp/6lJjoektXOwtAkBsZTQsw99qJzIAaSRinpDWTxPG2j6OlR0DAqkxsG7JnAfbsEteh9TzGYAbIgdJVBTX/kbSCJn9ca85rnOkeVABAkAUbDfU3Z702z20NtwAxc1IkrtQ1lKuqSpj9/LuR1/6KRkYQsUWnUiOO9hu5YDWIcflFrnCenF8j8OnvGghltxT |
| | | # mall_book_public_key mallbook测试环境公钥 不需要替换 |
| | | mall_book_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq6OLZKgUHH5wOk9xSBgN7yC17r3PQwMlY9/IorqrOlaIqrU0eAVZ5+dWrJD/3bdu7Ctq8n8trTm/IUYs7wtMg5SKwyX4/N+KQc2N7LL4yCq4vNl41q9sYgrtA0QnZoucIZcq1mwyu7RTDC8Wp7LGddnlkJsmL8masgMxA6cc9NwIDAQAB |
| | | |
| | | active: '@spring.active@' |
| | |
| | | |
| | | <profiles> |
| | | <profile> |
| | | <id>local</id> |
| | | <properties> |
| | | <spring.active>local</spring.active> |
| | | </properties> |
| | | <activation> |
| | | <activeByDefault>true</activeByDefault> |
| | | </activation> |
| | | </profile> |
| | | <profile> |
| | | <id>dev</id> |
| | | <properties> |
| | | <spring.active>dev</spring.active> |
| | | </properties> |
| | | <activation> |
| | | <activeByDefault>true</activeByDefault> |
| | | </activation> |
| | | </profile> |
| | | <profile> |
| | | <id>test</id> |