update 交易记录处理平台未找到的订单添加启动方式判断

This commit is contained in:
Lemon
2023-11-04 09:01:29 +08:00
parent c3d3c9eb9b
commit c66e26b5f3
4 changed files with 85 additions and 7 deletions

View File

@@ -0,0 +1,51 @@
package com.jsowell.thirdparty.yongchengboche;
import com.alibaba.fastjson2.JSONObject;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.thirdparty.lianlian.common.CommonResult;
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.UnsupportedEncodingException;
import java.util.Map;
/**
* 甬城泊车controller
*
* @author Lemon
* @Date 2023/11/3 9:39:21
*/
@Anonymous
@RestController
@RequestMapping("/ycbc")
public class YCBCController extends BaseController {
@Autowired
private YCBCService ycbcService;
/**
* 获取token接口
* http://localhost:8080/zdl/v1/query_token
*/
@PostMapping("/v1/query_token")
public CommonResult<?> queryToken(@RequestBody CommonParamsDTO dto) {
logger.info("甬城泊车平台请求令牌 params:{}", JSONObject.toJSONString(dto));
try {
Map<String, String> map = ycbcService.generateToken(dto);
logger.info("甬城泊车平台请求令牌 result:{}", JSONObject.toJSONString(map));
return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig"));
} catch (UnsupportedEncodingException e) {
logger.error("甬城泊车平台 请求令牌接口 异常");
return CommonResult.failed("获取token发生异常");
}
}
}

View File

@@ -1747,14 +1747,21 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
// 启动方式
String transactionIdentifier = data.getTransactionIdentifier();
String startMode = null;
// if (StringUtils.equals(transactionIdentifier, "01")) {
// startMode = StartModeEnum.APP.getValue();
// } else if (StringUtils.equals(transactionIdentifier, "02")) {
// // 卡启动
// startMode = StartModeEnum.CARD.getValue();
// }
if (StringUtils.equals(transactionIdentifier, "01")) {
startMode = StartModeEnum.APP.getValue();
} else if (StringUtils.equals(transactionIdentifier, "02")) {
// 鉴权卡启动
startMode = StartModeEnum.AUTH_CARD.getValue();
} else if (StringUtils.equals(transactionIdentifier, "04")) {
// 离线卡启动
startMode = StartModeEnum.OFFLINE_CARD.getValue();
} else if (StringUtils.equals(transactionIdentifier, "05")) {
// VIN启动
startMode = StartModeEnum.VIN_CODE.getValue();
}
// 卡号
if (StringUtils.isNotBlank(data.getLogicCard())) {
if (StringUtils.isNotBlank(data.getLogicCard()) && !StringUtils.equals(Constants.ZERO, data.getLogicCard())) {
startMode = StartModeEnum.OFFLINE_CARD.getValue();
orderBasicInfo.setLogicCard(data.getLogicCard());
// 订单状态 (2023.4.6 要求改成“订单完成”)

View File

@@ -4,6 +4,7 @@ import com.jsowell.pile.dto.QueryEquipChargeStatusDTO;
import com.jsowell.pile.dto.QueryEquipmentDTO;
import com.jsowell.pile.dto.QueryStartChargeDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
import java.io.UnsupportedEncodingException;
@@ -23,6 +24,13 @@ public interface YCBCService {
*/
public String YCBCGetToken(YCBCGetTokenDTO dto);
/**
* 生成token
* @param dto
* @return
*/
Map<String, String> generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException;
/**
* 查询站点信息
* @param dto

View File

@@ -4,6 +4,7 @@ import com.jsowell.pile.dto.QueryEquipChargeStatusDTO;
import com.jsowell.pile.dto.QueryEquipmentDTO;
import com.jsowell.pile.dto.QueryStartChargeDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
@@ -40,6 +41,17 @@ public class YCBCServiceImpl implements YCBCService {
return zdlService.ZDLGetToken(dto);
}
/**
* 生成令牌
* @param dto
* @return
* @throws UnsupportedEncodingException
*/
@Override
public Map<String, String> generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException {
return zdlService.generateToken(dto);
}
/**
* 获取充电站信息
* @param dto