update 电单车协议

This commit is contained in:
Guoqs
2024-09-03 09:36:27 +08:00
parent 3cfd0090d4
commit 4a35f0fffb
7 changed files with 91 additions and 29 deletions

View File

@@ -1,11 +1,10 @@
package com.jsowell.pile.util;
package com.jsowell.pile.service;
import com.google.common.collect.Lists;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.service.PileBasicInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -18,9 +17,9 @@ import java.util.List;
* 生成sn号Util
*/
@Component
public class SnUtils {
public class PileSnGenerateService {
private static Logger logger = LoggerFactory.getLogger(SnUtils.class);
private static Logger logger = LoggerFactory.getLogger(PileSnGenerateService.class);
@Autowired
private RedisCache redisCache;
@@ -65,16 +64,6 @@ public class SnUtils {
return increResult;
}
public static void main(String[] args) {
// String pileSn = "88230000002060";
// String substring = StringUtils.substring(pileSn, 4, pileSn.length());
// long l = Long.parseLong(substring);
// System.out.println(substring);
// System.out.println(l);
Long a = 3147483647L;
}
/**
* 生成sn号
*

View File

@@ -2993,7 +2993,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
}
} else {
// 说明pileSn 和 connectorCode前端传了那就校验一下长度
if (dto.getPileSn().length() != Constants.PILE_SN_LENGTH || dto.getConnectorCode().length() != Constants.CONNECTOR_CODE_LENGTH) {
if (dto.getPileSn().length() != Constants.PILE_SN_LENGTH_FOR_EV || dto.getConnectorCode().length() != Constants.CONNECTOR_CODE_LENGTH_FOR_EV
|| dto.getPileSn().length() != Constants.PILE_SN_LENGTH_FOR_EBIKE || dto.getConnectorCode().length() != Constants.CONNECTOR_CODE_LENGTH_FOR_EBIKE) {
throw new BusinessException(ReturnCodeEnum.CODE_DATA_LENGTH_ERROR);
}
}