This commit is contained in:
Lemon
2023-05-24 08:47:01 +08:00
parent 50c26169e9
commit d288551317
2 changed files with 23 additions and 21 deletions

View File

@@ -160,20 +160,20 @@ public class SpringBootTestController {
@Test
public void testLianLian(){
// // 获取令牌
// 获取令牌
// LianLianGetTokenDTO dto = new LianLianGetTokenDTO();
// dto.setOperatorId("987654321");
// dto.setOperatorSecret("1234567890abcdef");
// String token = lianLianService.getToken(dto);
// System.out.println("token:" + token);
//
//
// dto.setOperatorId("MA1JLFUU8");
// dto.setOperatorSecret("Nh62XxlIR5OjAzFj");
String token = lianLianService.getToken("MA1JLFUU8", "fGwLsxW1HdzLw7jp");
System.out.println("token:" + token);
// LianLianPushStationInfoDTO dto1 = LianLianPushStationInfoDTO.builder()
// .OperatorID("987654321")
// .DataSecret("1234567890abcdef")
// .DataSecretIV("1234567890abcdef")
// .SigSecret("1234567890abcdef")
// .token(token)
// .OperatorID("MA1JLFUU8")
// .DataSecret("HVicnbRZbhPdIdpF")
// .DataSecretIV("JNvcjSOn1vhrE11M")
// .SigSecret("53TtFpc4gdVZbF3x")
// // .token(token)
// .stationId(2L)
//
// .build();
@@ -204,7 +204,7 @@ public class SpringBootTestController {
// lianLianService.queryOrderSettlementInfo("C27680791529");
// 推送订单对账结果信息
lianLianService.pushOrderReconciliationInfo("C27680791529");
// lianLianService.pushOrderReconciliationInfo("C27680791529");
}

View File

@@ -41,12 +41,12 @@ import java.util.stream.Collectors;
@Service
public class LianLianServiceImpl implements LianLianService {
private static final String TEST_URL = "http://testdataexchange.evchargeonline.com:82/shevcs/v1/";
private static final String OPERATOR_ID = "987654321";
private static final String OPERATOR_SECRET = "1234567890abcdef";
private static final String SIG_SECRET = "1234567890abcdef"; // 签名秘钥
private static final String DATA_SECRET = "1234567890abcdef"; // 消息密钥
private static final String DATA_SECRETIV = "1234567890abcdef"; // 消息密钥初始化向量
private static final String TEST_URL = "http://dataexchange.evchargeonline.com:81/shevcs/v1/"; // http://testdataexchange.evchargeonline.com:82/shevcs/v1/
private static final String OPERATOR_ID = "MA1JLFUU8"; // MA1JLFUU8 987654321
private static final String OPERATOR_SECRET = "fGwLsxW1HdzLw7jp"; // fGwLsxW1HdzLw7jp 1234567890abcdef
private static final String SIG_SECRET = "TmsdVaFVTtjzZbLi"; // 签名秘钥 TmsdVaFVTtjzZbLi 1234567890abcdef
private static final String DATA_SECRET = "R1Hdq80mSWswwCzt"; // 消息密钥 R1Hdq80mSWswwCzt 1234567890abcdef
private static final String DATA_SECRETIV = "LVpz3qHD8sM2PYjl"; // 消息密钥初始化向量 LVpz3qHD8sM2PYjl 1234567890abcdef
@Autowired
private IPileMerchantInfoService pileMerchantInfoService;
@@ -156,7 +156,9 @@ public class LianLianServiceImpl implements LianLianService {
String jsonString = JSONObject.toJSONString(data);
System.out.println("jsonString : " + jsonString);
String result = HttpRequestUtil.sendPost(dto.getToken(), jsonString, url, dto.getDataSecret()
// 获取令牌
String token = getToken(dto.getOperatorID(), OPERATOR_SECRET);
String result = HttpRequestUtil.sendPost(token, jsonString, url, dto.getDataSecret()
, dto.getDataSecretIV(), dto.getOperatorID(), dto.getSigSecret());
System.out.println(result);
@@ -596,7 +598,7 @@ public class LianLianServiceImpl implements LianLianService {
Map<String, String> request = new LinkedHashMap<>();
request.put("OperatorID", operatorId);
request.put("Data", strData);
request.put("TimeStamp", System.currentTimeMillis() + "");
request.put("TimeStamp", DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date()));
request.put("Seq", "0001");
//生成签名