Compare commits
2 Commits
c34d9e69cc
...
4f3c914bea
| Author | SHA256 | Date | |
|---|---|---|---|
| 4f3c914bea | |||
| 26b08cb914 |
@ -59,4 +59,27 @@ public class EbikeOrderBikeListDto implements Serializable {
|
|||||||
* 外接电池电量(该值由控制器提供,若控制器不支持此值为0)
|
* 外接电池电量(该值由控制器提供,若控制器不支持此值为0)
|
||||||
*/
|
*/
|
||||||
private Integer soc;
|
private Integer soc;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有巡检工单
|
||||||
|
*/
|
||||||
|
private Boolean hasInspectionOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有换电工单
|
||||||
|
*/
|
||||||
|
private Boolean hasChangeBatteryOrder;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有调度工单
|
||||||
|
*/
|
||||||
|
private Boolean hasDispatchOrder;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有维修工单
|
||||||
|
*/
|
||||||
|
private Boolean hasRepairOrder;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import com.cdzy.operations.utils.GeoCodingUtil;
|
|||||||
import com.cdzy.operations.utils.MinioUtil;
|
import com.cdzy.operations.utils.MinioUtil;
|
||||||
import com.cdzy.operations.utils.RedisUtil;
|
import com.cdzy.operations.utils.RedisUtil;
|
||||||
import com.mybatisflex.core.keygen.impl.SnowFlakeIDKeyGenerator;
|
import com.mybatisflex.core.keygen.impl.SnowFlakeIDKeyGenerator;
|
||||||
|
import com.mybatisflex.core.query.QueryMethods;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import com.mybatisflex.core.update.UpdateChain;
|
import com.mybatisflex.core.update.UpdateChain;
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
@ -112,6 +113,7 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
|
|||||||
.operatorId(bikeInfo.getOperatorId())
|
.operatorId(bikeInfo.getOperatorId())
|
||||||
.build();
|
.build();
|
||||||
this.mapper.insert(ebikeBikeOrder);
|
this.mapper.insert(ebikeBikeOrder);
|
||||||
|
//TODO:车辆状态
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@ -144,6 +146,7 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
|
|||||||
List<EbikeOrderFile> list = fileUrls.stream().map(e -> EbikeOrderFile.builder().orderId(orderId).fileUrl(e).build()).toList();
|
List<EbikeOrderFile> list = fileUrls.stream().map(e -> EbikeOrderFile.builder().orderId(orderId).fileUrl(e).build()).toList();
|
||||||
orderFileMapper.insertBatch(list);
|
orderFileMapper.insertBatch(list);
|
||||||
}
|
}
|
||||||
|
//TODO:车辆状态
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@ -181,6 +184,7 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
|
|||||||
.operatorId(bikeInfo.getOperatorId())
|
.operatorId(bikeInfo.getOperatorId())
|
||||||
.build();
|
.build();
|
||||||
this.mapper.insert(ebikeBikeOrder);
|
this.mapper.insert(ebikeBikeOrder);
|
||||||
|
//TODO:车辆状态
|
||||||
bikeInfo.setUsageStatus(BikeUsageStatus.DEPLOYED);
|
bikeInfo.setUsageStatus(BikeUsageStatus.DEPLOYED);
|
||||||
bikeInfoMapper.update(bikeInfo);
|
bikeInfoMapper.update(bikeInfo);
|
||||||
}
|
}
|
||||||
@ -241,6 +245,7 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
|
|||||||
List<EbikeOrderFile> list = fileUrls.stream().map(e -> EbikeOrderFile.builder().orderId(orderId).fileUrl(e).build()).toList();
|
List<EbikeOrderFile> list = fileUrls.stream().map(e -> EbikeOrderFile.builder().orderId(orderId).fileUrl(e).build()).toList();
|
||||||
orderFileMapper.insertBatch(list);
|
orderFileMapper.insertBatch(list);
|
||||||
}
|
}
|
||||||
|
//TODO:车辆状态
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@ -413,7 +418,56 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
|
|||||||
@Override
|
@Override
|
||||||
public List<EbikeOrderBikeListDto> bikeList(Long regionId) {
|
public List<EbikeOrderBikeListDto> bikeList(Long regionId) {
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
.select(EBIKE_BIKE_INFO.BIKE_CODE,EBIKE_BIKE_INFO.LOCATION,EBIKE_BIKE_INFO.USAGE_STATUS,EBIKE_ECU_INFO.ECU_SN)
|
.select(
|
||||||
|
EBIKE_BIKE_INFO.BIKE_CODE,
|
||||||
|
EBIKE_BIKE_INFO.LOCATION,
|
||||||
|
EBIKE_BIKE_INFO.USAGE_STATUS,
|
||||||
|
EBIKE_ECU_INFO.ECU_SN,
|
||||||
|
// 判断是否有巡检工单
|
||||||
|
QueryMethods.case_()
|
||||||
|
.when(QueryMethods.exists(
|
||||||
|
QueryWrapper.create()
|
||||||
|
.from(EBIKE_BIKE_ORDER)
|
||||||
|
.where(EBIKE_BIKE_ORDER.BIKE_CODE.eq(EBIKE_BIKE_INFO.BIKE_CODE))
|
||||||
|
.and(EBIKE_BIKE_ORDER.ORDER_TYPE.eq(BikeOrderType.INSPECTION))
|
||||||
|
))
|
||||||
|
.then(true)
|
||||||
|
.else_(false)
|
||||||
|
.end().as(EbikeOrderBikeListDto::getHasInspectionOrder),
|
||||||
|
// 判断是否有换电工单
|
||||||
|
QueryMethods.case_()
|
||||||
|
.when(QueryMethods.exists(
|
||||||
|
QueryWrapper.create()
|
||||||
|
.from(EBIKE_BIKE_ORDER)
|
||||||
|
.where(EBIKE_BIKE_ORDER.BIKE_CODE.eq(EBIKE_BIKE_INFO.BIKE_CODE))
|
||||||
|
.and(EBIKE_BIKE_ORDER.ORDER_TYPE.eq(BikeOrderType.BATTERY_SWAP))
|
||||||
|
))
|
||||||
|
.then(true)
|
||||||
|
.else_(false)
|
||||||
|
.end().as(EbikeOrderBikeListDto::getHasChangeBatteryOrder),
|
||||||
|
// 判断是否有调度工单
|
||||||
|
QueryMethods.case_()
|
||||||
|
.when(QueryMethods.exists(
|
||||||
|
QueryWrapper.create()
|
||||||
|
.from(EBIKE_BIKE_ORDER)
|
||||||
|
.where(EBIKE_BIKE_ORDER.BIKE_CODE.eq(EBIKE_BIKE_INFO.BIKE_CODE))
|
||||||
|
.and(EBIKE_BIKE_ORDER.ORDER_TYPE.eq(BikeOrderType.DISPATCH))
|
||||||
|
))
|
||||||
|
.then(true)
|
||||||
|
.else_(false)
|
||||||
|
.end().as(EbikeOrderBikeListDto::getHasDispatchOrder),
|
||||||
|
// 判断是否有换电工单
|
||||||
|
QueryMethods.case_()
|
||||||
|
.when(QueryMethods.exists(
|
||||||
|
QueryWrapper.create()
|
||||||
|
.from(EBIKE_BIKE_ORDER)
|
||||||
|
.where(EBIKE_BIKE_ORDER.BIKE_CODE.eq(EBIKE_BIKE_INFO.BIKE_CODE))
|
||||||
|
.and(EBIKE_BIKE_ORDER.ORDER_TYPE.eq(BikeOrderType.REPAIR))
|
||||||
|
))
|
||||||
|
.then(true)
|
||||||
|
.else_(false)
|
||||||
|
.end().as(EbikeOrderBikeListDto::getHasRepairOrder)
|
||||||
|
)
|
||||||
.where(EBIKE_BIKE_INFO.REGION_ID.eq(regionId))
|
.where(EBIKE_BIKE_INFO.REGION_ID.eq(regionId))
|
||||||
.where(EBIKE_BIKE_INFO.STATUS.eq(BikeStatus.LAUNCH))
|
.where(EBIKE_BIKE_INFO.STATUS.eq(BikeStatus.LAUNCH))
|
||||||
.leftJoin(EBIKE_ECU_INFO).on(EBIKE_ECU_INFO.ECU_ID.eq(EBIKE_BIKE_INFO.ECU_ID));
|
.leftJoin(EBIKE_ECU_INFO).on(EBIKE_ECU_INFO.ECU_ID.eq(EBIKE_BIKE_INFO.ECU_ID));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user