fix typos
This commit is contained in:
parent
51cba3b7e3
commit
728bc78ede
@ -118,22 +118,22 @@ public class Constants
|
||||
/**
|
||||
* 无效终端
|
||||
*/
|
||||
public static final String LNVALID_TERMINAL = "0C";
|
||||
public static final String INVALID_TERMINAL = "0C";
|
||||
|
||||
/**
|
||||
* 无效运营商(桩的运营商和卡不对应)
|
||||
*/
|
||||
public static final String LNVALID_OPERATOR = "06";
|
||||
public static final String INVALID_OPERATOR = "06";
|
||||
|
||||
/**
|
||||
* 无效卡
|
||||
*/
|
||||
public static final String LNVALID_CARD = "0D";
|
||||
public static final String INVALID_CARD = "0D";
|
||||
|
||||
/**
|
||||
* 无效用户
|
||||
*/
|
||||
public static final String LNVALID_USER = "0E";
|
||||
public static final String INVALID_USER = "0E";
|
||||
|
||||
/**
|
||||
* 离线卡
|
||||
@ -184,7 +184,7 @@ public class Constants
|
||||
//故障终端
|
||||
public static final String FAULT_TERMINAL = "17";
|
||||
|
||||
//充电终端
|
||||
//终端正在充电
|
||||
public static final String CHARGE_TERMINAL = "18";
|
||||
|
||||
//未知的枪
|
||||
@ -194,12 +194,12 @@ public class Constants
|
||||
public static final String INSERT_THE_GUN = "1A";
|
||||
|
||||
/**
|
||||
* 模板id为null
|
||||
* 费率模型id为空
|
||||
*/
|
||||
public static final String LNVALID_RATE_MODE = "1B";
|
||||
public static final String INVALID_RATE_MODE = "1B";
|
||||
|
||||
/**
|
||||
* 数据问题(报错)
|
||||
* 内部错误(数据库操作失败)
|
||||
*/
|
||||
public static final String DATA_EXCEPTION = "1C";
|
||||
public static final String INTERNAL_ERROR = "1C";
|
||||
}
|
||||
|
||||
@ -75,15 +75,15 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
||||
return R.fail(Constants.FOUR_CARD);
|
||||
}
|
||||
}else{
|
||||
return R.fail(Constants.LNVALID_CARD);
|
||||
return R.fail(Constants.INVALID_CARD);
|
||||
}
|
||||
if("".equals(rateModelId) || rateModelId==null){
|
||||
return R.fail(Constants.LNVALID_RATE_MODE);
|
||||
return R.fail(Constants.INVALID_RATE_MODE);
|
||||
}
|
||||
//查询卡号对应的用户
|
||||
XhpcIcCardInfo xhpcIcCardInfo = xhpcCardMapper.getXhpcIcCardInfo(iccardInfo.getId().toString());
|
||||
if(xhpcIcCardInfo ==null){
|
||||
return R.fail(Constants.LNVALID_USER);
|
||||
return R.fail(Constants.INVALID_USER);
|
||||
}
|
||||
Long userId=xhpcIcCardInfo.getUserId();
|
||||
Integer userType=xhpcIcCardInfo.getUserType();
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.xhpc.order.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.xhpc.common.api.PowerPileService;
|
||||
import com.xhpc.common.api.UserTypeService;
|
||||
@ -26,7 +24,6 @@ import com.xhpc.order.mapper.XhpcInternetUserMapper;
|
||||
import com.xhpc.order.service.IXhpcChargeOrderService;
|
||||
import com.xhpc.order.service.IXhpcRealTimeOrderService;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.bouncycastle.jcajce.provider.asymmetric.util.BaseAgreementSpi;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -641,7 +638,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
||||
try{
|
||||
R user = userTypeService.getUser(null, userId, userType, null,tenantId);
|
||||
if(user ==null || user.getData() ==null){
|
||||
return R.fail(Constants.LNVALID_USER);
|
||||
return R.fail(Constants.INVALID_USER);
|
||||
}
|
||||
|
||||
Map<String, Object> userMessage = (Map<String, Object>)user.getData();
|
||||
@ -650,20 +647,20 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
||||
Pattern compile = Pattern.compile(pattern);
|
||||
Matcher m = compile.matcher(serialNumber);
|
||||
if (serialNumber.length() != 16 || !m.matches()) {
|
||||
return R.fail(Constants.LNVALID_TERMINAL);
|
||||
return R.fail(Constants.INVALID_TERMINAL);
|
||||
}
|
||||
|
||||
//终端信息
|
||||
XhpcTerminal xhpcTerminal = xhpcChargeOrderMapper.getXhpcTerminalSerialNumber(serialNumber,tenantId);
|
||||
if (xhpcTerminal == null || xhpcTerminal.getTerminalId() == null || xhpcTerminal.getChargingPileId() == null || xhpcTerminal.getPileSerialNumber() == null) {
|
||||
return R.fail(Constants.LNVALID_TERMINAL);
|
||||
return R.fail(Constants.INVALID_TERMINAL);
|
||||
}
|
||||
|
||||
if(type !=0){
|
||||
//获取桩信息
|
||||
Map<String, Object> xhpcChargingPileById =xhpcChargeOrderMapper.getXhpcChargingPileById(xhpcTerminal.getChargingPileId(),tenantId);
|
||||
if(xhpcChargingPileById ==null || !xhpcChargingPileById.get("operatorId").toString().equals(grantOperator)){
|
||||
return R.fail(Constants.LNVALID_OPERATOR);
|
||||
return R.fail(Constants.INVALID_OPERATOR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -699,10 +696,10 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
||||
if("离线".equals(status)){
|
||||
return R.fail(Constants.OFFLINE_TERMINAL);
|
||||
}
|
||||
if("故障".equals(status)){
|
||||
if ("故障".equals(status)) {
|
||||
return R.fail(Constants.FAULT_TERMINAL);
|
||||
}
|
||||
if("充电".equals(status)){
|
||||
if ("充电".equals(status) || StringUtils.isNumeric(status)) {
|
||||
return R.fail(Constants.CHARGE_TERMINAL);
|
||||
}
|
||||
}
|
||||
@ -779,7 +776,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
||||
//数据回滚
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
}
|
||||
return R.fail(Constants.DATA_EXCEPTION);
|
||||
return R.fail(Constants.INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
public static boolean isValidDate(String str) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user