update 移动充电桩到另一个站点 接口

This commit is contained in:
Lemon
2025-10-30 16:10:05 +08:00
parent 5df6dd9d20
commit 49e31d2794
3 changed files with 31 additions and 3 deletions

View File

@@ -177,4 +177,6 @@ public interface PileBasicInfoMapper {
* @return
*/
List<PileDetailInfoVO> getPileDetailInfoList(String stationId);
int movePile2AnotherStation(ReplaceMerchantStationDTO dto);
}

View File

@@ -1324,17 +1324,23 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
String newStationId = dto.getNewStationId();
String stationId = dto.getStationId();
List<String> pileSnList = dto.getPileSnList();
if (StringUtils.isBlank(newStationId) || CollectionUtils.isEmpty(pileSnList)) {
log.error("移动桩到其他站点 参数不能为空");
return 0;
}
// 查询新站点正在使用中的计费模板
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.queryUsedBillingTemplateForEV(newStationId);
// 对比传来的新站点id与现在桩的站点id是否相等
if (StringUtils.equals(newStationId, stationId)) {
// 相等,则不修改
log.info("移动桩到其他站点 新站点id 与旧站点id 相等,不作修改");
return 0;
}
dto.setUpdateBy(SecurityUtils.getUsername());
dto.setUpdateTime(DateUtils.getNowDate());
// 修改数据库中桩信息
int num = pileBasicInfoMapper.replaceMerchantStationByPileIds(dto);
// int num = pileBasicInfoMapper.replaceMerchantStationByPileIds(dto);
int num = pileBasicInfoMapper.movePile2AnotherStation(dto);
// 异步向桩下发新站点的计费模板
for (String pileSn : pileSnList) {
CompletableFuture.runAsync(() -> {