mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-05 18:39:56 +08:00
Merge remote-tracking branch 'refs/remotes/public/develop' into feature/YunKuaiChongV160
# Conflicts: # jcpp-protocol-yunkuaichong/src/main/java/sanbing/jcpp/protocol/yunkuaichong/YunKuaiChongProtocolMessageProcessor.java
This commit is contained in:
@@ -12,9 +12,9 @@ import sanbing.jcpp.app.dal.config.ibatis.enums.GunOptStatusEnum;
|
||||
import sanbing.jcpp.app.dal.config.ibatis.enums.GunRunStatusEnum;
|
||||
import sanbing.jcpp.app.dal.config.ibatis.enums.OwnerTypeEnum;
|
||||
import sanbing.jcpp.app.dal.entity.Gun;
|
||||
import sanbing.jcpp.app.dal.entity.Pile;
|
||||
import sanbing.jcpp.infrastructure.util.jackson.JacksonUtil;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -42,9 +42,6 @@ class GunMapperIT extends AbstractTestBase {
|
||||
@Resource
|
||||
GunMapper gunMapper;
|
||||
|
||||
@Resource
|
||||
PileMapper pileMapper;
|
||||
|
||||
@Test
|
||||
void curdTest() {
|
||||
gunMapper.delete(Wrappers.lambdaQuery());
|
||||
@@ -53,15 +50,13 @@ class GunMapperIT extends AbstractTestBase {
|
||||
UUID pileId = NORMAL_PILE_ID[i];
|
||||
UUID gunId = NORMAL_GUN_ID[i];
|
||||
|
||||
Pile pile = pileMapper.selectById(pileId);
|
||||
|
||||
Gun gun = Gun.builder()
|
||||
.id(gunId)
|
||||
.createdTime(LocalDateTime.now())
|
||||
.additionalInfo(JacksonUtil.newObjectNode())
|
||||
.gunNo("02")
|
||||
.gunName(pile.getPileName() + "的2号枪")
|
||||
.gunCode(pile.getPileCode() + "-02")
|
||||
.gunName(String.format("三丙家的%d号充电桩", i + 1) + "的2号枪")
|
||||
.gunCode("202312120000" + new DecimalFormat("00").format(i + 1) + "-02")
|
||||
.stationId(NORMAL_STATION_ID)
|
||||
.pileId(pileId)
|
||||
.ownerId(NORMAL_USER_ID)
|
||||
|
||||
@@ -17,7 +17,10 @@ import sanbing.jcpp.infrastructure.util.jackson.JacksonUtil;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static sanbing.jcpp.app.dal.mapper.StationMapperIT.NORMAL_STATION_ID;
|
||||
import static sanbing.jcpp.app.dal.mapper.UserMapperIT.NORMAL_USER_ID;
|
||||
@@ -68,7 +71,36 @@ class PileMapperIT extends AbstractTestBase {
|
||||
pileMapper.insertOrUpdate(pile);
|
||||
|
||||
log.info("{}", pileMapper.selectById(pileId));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void generate100KPiles() {
|
||||
AtomicInteger number = new AtomicInteger(1);
|
||||
for (int i = 0; i < 100; i++) {
|
||||
List<Pile> piles = new ArrayList<>();
|
||||
for (int j = 0; j < 1000; j++, number.incrementAndGet()) {
|
||||
Pile pile = Pile.builder()
|
||||
.id(UUID.randomUUID())
|
||||
.createdTime(LocalDateTime.now())
|
||||
.additionalInfo(JacksonUtil.newObjectNode())
|
||||
.pileName(String.format("三丙家的%d号充电桩", number.get()))
|
||||
.pileCode("20241015" + new DecimalFormat("000000").format(number.get()))
|
||||
.protocol("yunkuaichongV150")
|
||||
.stationId(NORMAL_STATION_ID)
|
||||
.ownerId(NORMAL_USER_ID)
|
||||
.ownerType(OwnerTypeEnum.C)
|
||||
.brand("星星")
|
||||
.model("10A")
|
||||
.manufacturer("星星")
|
||||
.status(PileStatusEnum.IDLE)
|
||||
.type(PileTypeEnum.AC)
|
||||
.build();
|
||||
piles.add(pile);
|
||||
}
|
||||
pileMapper.insert(piles);
|
||||
}
|
||||
|
||||
log.info("{}", pileMapper.selectCount(Wrappers.lambdaQuery()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user