Merge remote-tracking branch 'origin/main'

This commit is contained in:
PC 2026-03-03 17:37:07 +08:00
commit 643ea38553
5 changed files with 52 additions and 0 deletions

View File

@ -186,4 +186,13 @@ public interface OperationsFeignClient {
*/
@GetMapping("/ebikeBikeInfo/api/tempLockResume")
JsonResult<?> tempLockResume(@RequestParam("bikeCode") String bikeCode);
/**
* 根据车辆编号查询电话
*
* @param bikeCode 车辆编码
* @return 运营商电话
*/
@GetMapping("/ebikeCarrierConfiguration/api/getPhoneByBikeCode")
JsonResult<?> getPhoneByBikeCode(@RequestParam("bikeCode") String bikeCode);
}

View File

@ -106,4 +106,16 @@ public class EbikeCarrierConfigurationController {
String operatorPhone = carrierConfigurationService.getPhoneByOperatorId(operatorId);
return JsonResult.success(operatorPhone);
}
/**
* 根据运营商id查询电话
*
* @param bikeCode 车辆编码
* @return 运营商电话
*/
@GetMapping("/api/getPhoneByBikeCode")
public JsonResult<?> getPhoneByBikeCode(@RequestParam("bikeCode") String bikeCode) {
String operatorPhone = carrierConfigurationService.getPhoneByBikeCode(bikeCode);
return JsonResult.success((Object) operatorPhone);
}
}

View File

@ -41,4 +41,11 @@ public interface EbikeCarrierConfigurationService extends IService<EbikeCarrierC
* @return 运营商电话
*/
String getPhoneByOperatorId(Long operatorId);
/**
* 根据车辆编码查询运营商电话
* @param bikeCode 车辆编码
* @return 运营商电话
*/
String getPhoneByBikeCode(String bikeCode);
}

View File

@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Objects;
import static com.cdzy.operations.model.entity.table.EbikeBikeInfoTableDef.EBIKE_BIKE_INFO;
import static com.cdzy.operations.model.entity.table.EbikeCarrierConfigurationTableDef.EBIKE_CARRIER_CONFIGURATION;
@ -75,4 +76,13 @@ public class EbikeCarrierConfigurationServiceImpl extends ServiceImpl<EbikeCarri
.where(EBIKE_CARRIER_CONFIGURATION.OPERATOR_ID.eq(operatorId, Objects.nonNull(operatorId)));
return this.mapper.selectOneByQueryAs(queryWrapper, String.class);
}
@Override
public String getPhoneByBikeCode(String bikeCode) {
QueryWrapper queryWrapper = QueryWrapper.create()
.select(EBIKE_CARRIER_CONFIGURATION.OPERATOR_PHONE)
.leftJoin(EBIKE_BIKE_INFO).on(EBIKE_BIKE_INFO.OPERATOR_ID.eq(EBIKE_CARRIER_CONFIGURATION.OPERATOR_ID))
.where(EBIKE_BIKE_INFO.BIKE_CODE.eq(bikeCode));
return this.mapper.selectOneByQueryAs(queryWrapper, String.class);
}
}

View File

@ -51,4 +51,18 @@ public class EbikeBikeInfoController {
}
return JsonResult.success(jsonResult.getData());
}
/**
* 根据车辆编号所属运营商手机号
* @param bikeCode 车辆编号
* @return 运营商手机号
*/
@GetMapping("/getPhoneByBikeCode")
public JsonResult<?> getPhoneByBikeCode(@RequestParam("bikeCode") String bikeCode) {
JsonResult<?> jsonResult = operationsFeignClient.getPhoneByBikeCode(bikeCode);
if (jsonResult.getCode() != Code.SUCCESS) {
throw new EbikeException(jsonResult.getMessage());
}
return JsonResult.success(jsonResult.getData());
}
}