提交 d8bc1387 authored 作者: liuhaiquan's avatar liuhaiquan

Merge remote-tracking branch 'origin/test' into test

...@@ -27,4 +27,5 @@ mvnw.cmd ...@@ -27,4 +27,5 @@ mvnw.cmd
/nbbuild/ /nbbuild/
/dist/ /dist/
/nbdist/ /nbdist/
/.nb-gradle/ /.nb-gradle/
\ No newline at end of file /nbsdk/
...@@ -64,8 +64,8 @@ public class IntegralTruckVO { ...@@ -64,8 +64,8 @@ public class IntegralTruckVO {
return Arrays.asList( return Arrays.asList(
new IntegralItem("运单完成积分", orderChildCompleteIntegral), new IntegralItem("运单完成积分", orderChildCompleteIntegral),
new IntegralItem("平台补偿积分", platformCompensationIntegral), new IntegralItem("平台补偿积分", platformCompensationIntegral),
new IntegralItem("运单取消积分", orderChildCancelIntegral), new IntegralItem("运单取消扣减", orderChildCancelIntegral),
new IntegralItem("运单超时积分", orderChildTimeoutIntegral), new IntegralItem("运单超时扣减", orderChildTimeoutIntegral),
new IntegralItem("信息上报积分", reportIntegral) new IntegralItem("信息上报积分", reportIntegral)
); );
} }
......
...@@ -240,11 +240,31 @@ ...@@ -240,11 +240,31 @@
<artifactId>log-spring-boot-starter</artifactId> <artifactId>log-spring-boot-starter</artifactId>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>com.nbcb.cz</groupId>-->
<!-- <artifactId>openBasicSDK</artifactId>-->
<!-- <version>2.1.230630</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.nbcb.cz</groupId>-->
<!-- <artifactId>openBasicSDK</artifactId>-->
<!-- <version>2.1.230630</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${pom.basedir}/libs/openBasicSDK-2.1.230630.jar</systemPath>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId> <artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.nbopen</groupId>
<artifactId>openBasicSDK</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${pom.basedir}/libs/openBasicSDK-1.7.0.jar</systemPath>
</dependency>
</dependencies> </dependencies>
......
//package com.clx.performance.controller.temp;
//
//import com.alibaba.fastjson.JSON;
//import com.clx.performance.service.TempService;
//import com.clx.performance.vo.pc.child.OrderChildLineStatisticsVO;
//import com.msl.common.result.Result;
//import com.nbcb.bouncycastle.util.encoders.Base64;
//import com.nbcb.sdk.OpenSDK;
//import com.nbcb.sdk.file.FileUploadRequest;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.repository.init.ResourceReader;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.io.FileOutputStream;
//import java.io.IOException;
//import java.io.InputStream;
//import java.math.BigDecimal;
//import java.util.HashMap;
//
//
///**
// * @Author: aiqingguo
// * @Description: 临时接口
// * @Date: 2023-8-21 12:10:16
// * @Version: 1.0
// */
//@Slf4j
//@RestController
//@RequestMapping(value="/temp/bank")
//public class TempBankController {
//
// @Autowired
// private TempService tempService;
//
// @ApiOperation(value = "test", notes = "<br>By:艾庆国")
// @RequestMapping(value = "/test", method = RequestMethod.POST)
// public Result<OrderChildLineStatisticsVO> test() throws Exception {
//
// bankTest();
//
//
// return Result.ok();
// }
//
// static void bankTest() throws Exception {
// String priKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTt6OadouxxxSDg/0SZdOIBqtnFGKrpwmL+quEUf+hfSgCgYIKoEcz1UBgi2hRANCAAQGHNN2NO7btp+w1248yk98E0asGC8sG0bmIzdom4M0xp3vc4IfXjmZ8omUz4oVcjzAuyMSSpJM6uPLcU1SH4HZ";
//
// InputStream inputStream = TempBankController.class.getClassLoader().getResourceAsStream("config.properties");
// if (inputStream != null) {
// log.info("存在");
//
// OpenSDK.init(inputStream, priKey);
//
//// singleTransfer();
////
//// querySingleTransferResult();
//
//
// unionPayDirectOrder();
//
// }
// else{
// log.info("文件不存在");
// }
//
// }
//
// static String singleTransfer() throws Exception {
//
// HashMap<String, Object> map = new HashMap();
// HashMap<String, Object> data = new HashMap();
// map.put("Data", data);
//
// data.put("custId", "0000112058"); //客户号 必填
// data.put("serialNo", "2023112300000002"); //交易流水号 必填
// data.put("corpCode", "1000"); //单位代码 必填
// data.put("payAcc", "40010122000156763"); //付款账号 必填
// data.put("rcvAcc", "6223160014441539"); //收款账号 必填
//// data.put("rcvBankName", ""); //收款方行名
//// data.put("rcvBankNo", ""); //收款方联行号
// data.put("rcvName", "石佛寺"); //收款户名 必填
// data.put("purpose", "001-支付货款"); //用途 必填
//// data.put("remark", ""); //备注
//// data.put("isSubscribe", "0"); //是否预约支付
//// data.put("difBank", "1"); //是否同行转账
//// data.put("areaSign", "1"); //同城异地标识
// data.put("amt", new BigDecimal("100")); //金额 必填
//// data.put("wishPayTime", ""); //预约转账时间
//// data.put("isTellRcv", "0"); //是否短信通知收款人
//// data.put("rcvMobile", ""); //收款方手机号
//// data.put("isForIndividual", "0"); //对公对私标识
//// data.put("subaAccountSerial", ""); //统计编号
//// data.put("itemCode", ""); //预算科目代码
//// data.put("budgetMoney", ""); //预算执行金额
//// data.put("subjectName", ""); //智能财报科目
//// data.put("payType", "0"); //支付方式
//// data.put("remarkAcc", ""); //代理/联动账号
//// data.put("erpRemark1", ""); //ERP 备注 1
//// data.put("erpRemark2", ""); //ERP 备注 1
//// data.put("erpRemark3", ""); //ERP 备注 1
//// data.put("erpRemark4", ""); //ERP 备注 1
//
// String res1 = OpenSDK.send("tmsSettle", "singleTransfer", JSON.toJSONString(map));
// log.info("单笔转账接口:{}" , res1);
//
// return res1;
// }
//
// static String querySingleTransferResult() throws Exception {
// HashMap<String, Object> map = new HashMap();
// HashMap<String, Object> data = new HashMap();
// map.put("Data", data);
//
// data.put("custId", "0000112058"); //客户号 必填
// data.put("serialNo", "2023112300000002"); //交易流水号 必填
//
// String res1 = OpenSDK.send("tmsSettle", "querySingleTransferResult", JSON.toJSONString(map));
// log.info("单笔查证接口:{}" , res1);
//
// return res1;
// }
//
//
// /**
// * 易付通
// */
// static String unionPayDirectOrder() throws Exception {
//
// HashMap<String, Object> map = new HashMap();
// HashMap<String, Object> data = new HashMap();
// map.put("Data", data);
//
// data.put("transId", "IP01"); //交易识别码 必填
// data.put("merId", "2023112300000002"); //商户号 必填
// data.put("merSeqNo", "2023112300000001"); //商户流水 必填
// data.put("merDtTm", "2023-11-24 11:00:00"); //商户时间 必填
// data.put("trxAmt", "1.23"); //订单金额 必填
// data.put("orderDesc", "采购"); //订单详情 必填
// data.put("productNam", "小黄鱼"); //商品名称 必填
// data.put("productId", "001"); //商品编号 必填
// data.put("productNum", "1"); //商品数量 必填
//
// data.put("payAcctNo", "6223161100110442"); //付款账号 必填
// data.put("payAcctNm", "刘晓琴"); //付款户名 必填
// data.put("bankType", "00"); //账户类型 必填
// data.put("payAcctOpenBankId", "313332082914"); //开户行号 必填
//// data.put("mobilePhone", "13000000000"); //手机号
//
// String res1 = OpenSDK.send("YFT", "unionPayDirectOrder", JSON.toJSONString(map));
// log.info("银联订单支付收款模式接口:{}" , res1);
//
// return res1;
// }
//
//
// public static void main(String[] args) throws Exception {
//
// bankTest();
//
//// try {
//// callBySepJson();
//// //demo.callByBean();
//// } catch (Exception e) {
//// e.printStackTrace();
//// }
// }
//
// /**
// * @throws Exception
// */
// public static void callBySepJson() throws Exception {
// String priKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTt6OadouxxxSDg/0SZdOIBqtnFGKrpwmL+quEUf+hfSgCgYIKoEcz1UBgi2hRANCAAQGHNN2NO7btp+w1248yk98E0asGC8sG0bmIzdom4M0xp3vc4IfXjmZ8omUz4oVcjzAuyMSSpJM6uPLcU1SH4HZ";
//
// System.out.println(TempBankController.class.getClassLoader().getResource("").getPath());
//
// OpenSDK.init(TempBankController.class.getClassLoader().getResource("config.properties").getPath(), priKey);
//
//
// /*
// * dataJson 是放置具体交易请求业务报文,dataJson报文结构如下: {"Data":{"app_name":"1"}}
// */
//// String dataJson="";
//// // 发送请求并获取响应(第一个填入productId,第二个填入serviceId)
//// String res = OpenSDK.send("", "", dataJson);
//// if (log.isDebugEnabled()) {
//// log.debug("res: " + res);
//// }
//
// //上传文件
// String res1 = OpenSDK.sendFile("", "open-filegateway",TempBankController.class.getClassLoader().getResource("bank.txt").getPath());
//
// System.out.println(res1);
// //下载文件
//// String res = OpenSDK.sendFileDownload( "productId","fcd47917-bc9c-4c11-b217-f7095f5384fe","D:\\ab\\test");
// }
//
// /**
// * JavaBean方式(通过产品SDK提供的JavaBean)
// *
// * @throws Exception
// */
// public void callByBean() throws Exception {
//
// }
//
//}
package com.clx.performance.controller.thirdparty;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.nbopen.api.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping(value="/nbbank")
@Api(tags = "宁波银行回调")
public class NbBankController {
@ApiOperation(value = "notify", notes = "<br>By:艾庆国")
@RequestMapping(value = "/notify", method = RequestMethod.POST)
public SDKResponse bankNotify(String message) throws Exception {
log.info("宁波银行回调, data:{}", message);
RequestApiData requestApiData = new RequestApiData();
requestApiData.setAppkey("77667c76_3503_4c04_95f7_fc10938c7942");
requestApiData.setData(message);
RequestHead requestHead = new RequestHead();
requestHead.setRqsJrnlNo(NBOpenSDK.getRandom());
SDKRequest request = new SDKRequest();
request.setData(requestApiData);
request.setHead(requestHead);
System.out.println("SDK请求内容: "+ JSON.toJSONString(request));
SDKResponse result = NBOpenSDK.decryptMessage(request);
System.out.println("SDK响应结果: "+JSON.toJSONString(result));
return null;
}
private SDKResponse getResult() throws Exception {
JSONObject jsonObject = new JSONObject();
jsonObject.put("errorCode", "000000");
jsonObject.put("errorMsg", "响应成功");
RequestApiData requestApiData = new RequestApiData();
requestApiData.setAppkey("77667c76_3503_4c04_95f7_fc10938c7942");
requestApiData.setData(jsonObject);
RequestHead requestHead = new RequestHead();
requestHead.setRqsJrnlNo(NBOpenSDK.getRandom());
SDKRequest request = new SDKRequest();
request.setData(requestApiData);
request.setHead(requestHead);
log.info("加密前: "+ JSON.toJSONString(request));
SDKResponse result = NBOpenSDK.encryptMessage(request);
log.info("加密后: "+JSON.toJSONString(result));
return result;
}
}
...@@ -177,9 +177,11 @@ public class IntegralTruckServiceImpl implements IntegralTruckService { ...@@ -177,9 +177,11 @@ public class IntegralTruckServiceImpl implements IntegralTruckService {
if (!truckNoList.isEmpty()) { if (!truckNoList.isEmpty()) {
List<IntegralStatistics> statisticsList = integralStatisticsDao.selectListByStatisticsDateAndTruckNoList(time, truckNoList); List<IntegralStatistics> statisticsList = integralStatisticsDao.selectListByStatisticsDateAndTruckNoList(time, truckNoList);
Map<String, Integer> rankMap = statisticsList.stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item.getRank())); Map<String, Integer> rankMap = statisticsList.stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item.getRank()));
Map<String, Integer> integralMap = statisticsList.stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item.getIntegral()));
for (IntegralTruckVO item : page.getRecords()) { for (IntegralTruckVO item : page.getRecords()) {
item.setRank(rankMap.get(item.getTruckNo())); item.setRank(rankMap.get(item.getTruckNo()));
item.setIntegral(integralMap.get(item.getTruckNo()));
} }
Map<String, IntegralTruckVO> truckMap = page.getRecords().stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item)); Map<String, IntegralTruckVO> truckMap = page.getRecords().stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item));
......
...@@ -381,7 +381,7 @@ public class TruckServiceImpl implements TruckService { ...@@ -381,7 +381,7 @@ public class TruckServiceImpl implements TruckService {
} }
long seconds = Duration.between(beginTime, endTime).getSeconds(); long seconds = Duration.between(beginTime, endTime).getSeconds();
if(seconds > 129600){ if(seconds > 259200){
throw new ServiceSystemException(ResultEnum.PARAM_ERROR,"开始时间和结束时间不能相差超于3天"); throw new ServiceSystemException(ResultEnum.PARAM_ERROR,"开始时间和结束时间不能相差超于3天");
} }
List<TruckTraceDTO> truckTrace = zjxlGpsService.getTruckTrace(param.getTruckNo(), param.getBeginTime(), List<TruckTraceDTO> truckTrace = zjxlGpsService.getTruckTrace(param.getTruckNo(), param.getBeginTime(),
......
{
"api": [
{
"appKey": "77667c76_3503_4c04_95f7_fc10938c7942",
"publicUrl": "https://open-test.nbcb.com.cn/sit/nbcb/api",
"platfromPublicKeyPath": "/app/clx-performance/nbbank/bankPubKey-test.cer",
"merchantPrivateKeyPath":"/app/clx-performance/nbbank/77667c76_3503_4c04_95f7_fc10938c7942.sm2",
"merchantPrivateKeyPwd":"cfca",
"connectTimeout": 10000,
"readTimeout": 30000,
"merchantName":"",
"subMerchantName":"",
"subMerchantId":"",
"isProxy":false,
"proxyIp":"",
"proxyPort":80
}
],
"file": [
{
"uid":"TEST",
"publicFileUrl":"https://file-test.nbcb.com.cn/sit",
"clientIp":"127.0.0.1",
"passwd":"nbcb123456",
"apiVersion":"201809101526",
"isProxy":false,
"proxyIp":"",
"proxyPort":80
}
]
}
\ No newline at end of file
APP_KEY=54b3e05c-7983-4e6c-8920-f9ab8a0004a6
PUBLIC_URL=http://cz-test.nbcb.com.cn:7070/nbcb/api
PUBLIC_KEY=MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEXAt6fxeKlpREIyXoT3jDwGU7L6JkKrzdOKP1cMB14rtNwwlyaUGLrtuHVoArAHP3x7XN2rUw0GxSngYQwOAsjQ==
CONNECT_TIMEOUT=10000
READ_TIMEOUT=20000
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论