工单车辆列表更新
This commit is contained in:
parent
831b4f1963
commit
3560e5ca81
@ -135,4 +135,17 @@ public class EbikeBikeInfoController {
|
||||
EbikeUserBikeInfo info = ebikeBikeInfoService.bikeInfo(bikeCode);
|
||||
return JsonResult.success(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 中控换绑
|
||||
*
|
||||
* @param bikeCode 车辆编号
|
||||
* @param ecuSn 中控编号
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("/changeEcu")
|
||||
public JsonResult<?> changeEcu(@RequestParam("bikeCode") String bikeCode, @RequestParam("ecuSn") String ecuSn) {
|
||||
ebikeBikeInfoService.changeEcu(bikeCode, ecuSn);
|
||||
return JsonResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,4 +87,21 @@ public class EbikeOrderBikeListDto implements Serializable {
|
||||
* 是否在线
|
||||
*/
|
||||
private Boolean online;
|
||||
|
||||
|
||||
/**
|
||||
* 是否24小时无单
|
||||
*/
|
||||
private Boolean over24Hours;
|
||||
|
||||
|
||||
/**
|
||||
* 是否24小时无单
|
||||
*/
|
||||
private Boolean isInParkingArea;
|
||||
|
||||
/**
|
||||
* 无单时长
|
||||
*/
|
||||
private Integer hoursSinceLastCycling;
|
||||
}
|
||||
|
||||
@ -88,4 +88,12 @@ public interface EbikeBikeInfoService extends IService<EbikeBikeInfo> {
|
||||
* @param bikeCode 车辆编号
|
||||
*/
|
||||
EbikeUserLockDto lock(String bikeCode);
|
||||
|
||||
/**
|
||||
* 中控换绑
|
||||
*
|
||||
* @param bikeCode 车辆编号
|
||||
* @param ecuSn 中控编号
|
||||
*/
|
||||
void changeEcu(String bikeCode, String ecuSn);
|
||||
}
|
||||
|
||||
@ -482,6 +482,11 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeEcu(String bikeCode, String ecuSn) {
|
||||
|
||||
}
|
||||
|
||||
static EbikeSpecialDay getEbikeSpecialDay(List<EbikeSpecialDay> ebikeSpecialDays) {
|
||||
LocalDate today = LocalDate.now();
|
||||
DayOfWeek dayOfWeek = today.getDayOfWeek();
|
||||
|
||||
@ -40,6 +40,7 @@ import static com.cdzy.operations.model.entity.table.EbikeBikeInfoTableDef.EBIKE
|
||||
import static com.cdzy.operations.model.entity.table.EbikeBikeOrderTableDef.EBIKE_BIKE_ORDER;
|
||||
import static com.cdzy.operations.model.entity.table.EbikeBorrowBatteryRecordTableDef.EBIKE_BORROW_BATTERY_RECORD;
|
||||
import static com.cdzy.operations.model.entity.table.EbikeEcuInfoTableDef.EBIKE_ECU_INFO;
|
||||
import static com.cdzy.operations.model.entity.table.EbikeSiteTableDef.EBIKE_SITE;
|
||||
|
||||
/**
|
||||
* 工单信息 服务层实现。
|
||||
@ -447,6 +448,7 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
|
||||
|
||||
@Override
|
||||
public List<EbikeOrderBikeListDto> bikeList(Long regionId) throws IOException {
|
||||
|
||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||
.select(
|
||||
EBIKE_BIKE_INFO.BIKE_CODE,
|
||||
@ -496,8 +498,33 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
|
||||
))
|
||||
.then(true)
|
||||
.else_(false)
|
||||
.end().as(EbikeOrderBikeListDto::getHasRepairOrder)
|
||||
.end().as(EbikeOrderBikeListDto::getHasRepairOrder),
|
||||
//判断是否24h无单
|
||||
QueryMethods.case_()
|
||||
.when(QueryMethods.raw("EXTRACT(EPOCH FROM (NOW() - ebike_bike_info.latest_cycling_time)) / 3600 > 24"))
|
||||
.then(true)
|
||||
.else_(false)
|
||||
.end().as(EbikeOrderBikeListDto::getOver24Hours),
|
||||
QueryMethods.case_()
|
||||
.when(QueryMethods.exists(
|
||||
QueryWrapper.create()
|
||||
.from(EBIKE_SITE)
|
||||
.where(EBIKE_SITE.REGION_ID.eq(regionId)) // 同一运营区
|
||||
.and(EBIKE_SITE.SITE_TYPE.eq(1)) // 站点类型为1(普通停车站点)
|
||||
.and(EBIKE_SITE.IS_DELETED.eq(false))
|
||||
.and(
|
||||
// 使用 ST_Contains 或 ST_Within 判断点是否在多边形内
|
||||
// 假设 EBIKE_BIKE_INFO 有经纬度字段 latitude 和 longitude
|
||||
QueryMethods.raw(
|
||||
"ST_Contains(EBIKE_SITE.SITE_POLYGON::geometry,EBIKE_BIKE_INFO.LOCATION::geometry)"
|
||||
)
|
||||
)
|
||||
))
|
||||
.then(true)
|
||||
.else_(false)
|
||||
.end().as("is_in_parking_area")
|
||||
)
|
||||
.select("EXTRACT(EPOCH FROM (NOW() - ebike_bike_info.latest_cycling_time)) / 3600 AS hours_since_last_cycling")
|
||||
.where(EBIKE_BIKE_INFO.REGION_ID.eq(regionId))
|
||||
.where(EBIKE_BIKE_INFO.STATUS.eq(BikeStatus.LAUNCH))
|
||||
.where(EBIKE_BIKE_INFO.USAGE_STATUS.ne(BikeUsageStatus.BIND))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user