优化修复:费率下发,卡启动,扫码启动

This commit is contained in:
ZZ 2022-03-03 16:13:39 +08:00
parent 1d6b47cb7e
commit f060712145
3 changed files with 7 additions and 4 deletions

View File

@ -132,7 +132,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
String openId = loginUser.getOpenId();
String tenantId = loginUser.getTenantId();
R user = userTypeService.getUser(null, userid, userType, terminalSerialNumber,loginUser.getTenantId());
if(userId !=userid || user ==null || user.getData() ==null){
if (!userid.equals(userId) || user == null || user.getData() == null) {
return AjaxResult.error(UserTypeUtil.LOGIN_TYPE, "请重新登录");
}
Map<String, Object> userMessage = (Map<String, Object>)user.getData();

View File

@ -80,7 +80,10 @@ public class PileStartChargingDataLogic implements ServiceLogic {
} else {
// 调用订单接口
cardNo = iccardInfo.getCardno();
Integer rateModelId = pileStartChargingData.getRateModelId();
Integer rateModelId = pileStartChargingData.getRateModelId(); // todo not very strict.
if (rateModelId == null)
rateModelId = ((Long) REDIS.getCacheMapValue("pile:".concat(connectorId.substring(0, 14)),
"rateModelId")).intValue();
R r = cardService.cardStartup(cardNo, connectorId, rateModelId.toString());
if (r.getCode() == 200) {
result = ServiceResult.HEX_01;

View File

@ -52,8 +52,8 @@ public class RateModelValidateLogic implements ServiceLogic {
String hexCode = ServiceResult.HEX_00;
Long rateModelId;
String version = (String) cachePile.get("version");
if ("0C".equals(version)) rateModelId = Long.valueOf(HexUtils.reverseHexInt(rateModelIdStr));
else rateModelId = Long.valueOf(rateModelIdStr);
if ("0C".equals(version)) rateModelId = Long.valueOf(rateModelIdStr);
else rateModelId = Long.valueOf(Integer.parseInt(rateModelIdStr, 16));
Long csRateModelId = rateModelId;
if (!charging) {
ChargingStationDto cacheStation = REDIS.getCacheObject("station:".concat(cachePile.get("stationId").toString()));