Compare commits
No commits in common. "4f3c914bea009551d566730807536fd2be5728e08d40ef7846fa3edbab709d2a" and "c34d9e69cc531b45a1221ec380a3ede923fd6f16fbcb3eb34867d358b66468e2" have entirely different histories.
4f3c914bea
...
c34d9e69cc
@ -59,27 +59,4 @@ 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,7 +19,6 @@ 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;
|
||||||
@ -113,7 +112,6 @@ 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
|
||||||
@ -146,7 +144,6 @@ 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
|
||||||
@ -184,7 +181,6 @@ 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);
|
||||||
}
|
}
|
||||||
@ -245,7 +241,6 @@ 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
|
||||||
@ -418,56 +413,7 @@ 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(
|
.select(EBIKE_BIKE_INFO.BIKE_CODE,EBIKE_BIKE_INFO.LOCATION,EBIKE_BIKE_INFO.USAGE_STATUS,EBIKE_ECU_INFO.ECU_SN)
|
||||||
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