骑行查看运营区
This commit is contained in:
parent
5cf4325dbc
commit
9a1c4a3b1b
@ -1,10 +1,10 @@
|
|||||||
package com.ebike.feign.model.dto;
|
package com.ebike.feign.model.dto;
|
||||||
|
|
||||||
import com.mybatisflex.annotation.Table;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.postgresql.geometric.PGpolygon;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -20,7 +20,6 @@ import java.math.BigDecimal;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Table("ebike_bike_info")
|
|
||||||
public class FeignEbikeUserBikeInfo implements Serializable {
|
public class FeignEbikeUserBikeInfo implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
@ -99,5 +98,9 @@ public class FeignEbikeUserBikeInfo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal helmetManagementFee;
|
private BigDecimal helmetManagementFee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆运营区
|
||||||
|
*/
|
||||||
|
private PGpolygon regionPolygon;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,16 @@
|
|||||||
package com.cdzy.operations.model.dto;
|
package com.cdzy.operations.model.dto;
|
||||||
|
|
||||||
|
import com.cdzy.operations.handler.PGpolygonDeserializer;
|
||||||
|
import com.cdzy.operations.handler.PGpolygonSerializer;
|
||||||
|
import com.cdzy.operations.handler.PGpolygonTypeHandler;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.postgresql.geometric.PGpolygon;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -97,5 +104,13 @@ public class EbikeUserBikeInfo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal helmetManagementFee;
|
private BigDecimal helmetManagementFee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营区域
|
||||||
|
*/
|
||||||
|
@Column(typeHandler = PGpolygonTypeHandler.class)
|
||||||
|
@JsonSerialize(using = PGpolygonSerializer.class)
|
||||||
|
@JsonDeserialize(using = PGpolygonDeserializer.class)
|
||||||
|
private PGpolygon regionPolygon;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,6 +97,9 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
|||||||
@Resource
|
@Resource
|
||||||
private EbikeDispatchConfigurationService dispatchConfigurationService;
|
private EbikeDispatchConfigurationService dispatchConfigurationService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private EbikeRegionMapper ebikeRegionMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void bind(EbikeBikeBindVo bindVo) {
|
public void bind(EbikeBikeBindVo bindVo) {
|
||||||
@ -368,6 +371,9 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
|||||||
QueryWrapper query = QueryWrapper.create()
|
QueryWrapper query = QueryWrapper.create()
|
||||||
.where(EBIKE_BIKE_INFO.BIKE_CODE.eq(bikeCode));
|
.where(EBIKE_BIKE_INFO.BIKE_CODE.eq(bikeCode));
|
||||||
EbikeBikeInfo info = this.mapper.selectOneByQuery(query);
|
EbikeBikeInfo info = this.mapper.selectOneByQuery(query);
|
||||||
|
if (info == null) {
|
||||||
|
throw new EbikeException("车辆编号错误");
|
||||||
|
}
|
||||||
|
|
||||||
query.clear();
|
query.clear();
|
||||||
query.where(EBIKE_DEFAULT_BILLING_CONFIGURATION.REGION_ID.eq(info.getRegionId()));
|
query.where(EBIKE_DEFAULT_BILLING_CONFIGURATION.REGION_ID.eq(info.getRegionId()));
|
||||||
@ -381,6 +387,12 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
|||||||
query.clear();
|
query.clear();
|
||||||
query.where(EBIKE_ECU_INFO.ECU_ID.eq(info.getEcuId()));
|
query.where(EBIKE_ECU_INFO.ECU_ID.eq(info.getEcuId()));
|
||||||
EbikeEcuInfo ecuInfo = ebikeEcuInfoService.getOne(query);
|
EbikeEcuInfo ecuInfo = ebikeEcuInfoService.getOne(query);
|
||||||
|
|
||||||
|
|
||||||
|
query.clear();
|
||||||
|
query.where(EBIKE_REGION.REGION_ID.eq(info.getRegionId()));
|
||||||
|
EbikeRegion region = ebikeRegionMapper.selectOneByQuery(query);
|
||||||
|
|
||||||
int soc = 0;
|
int soc = 0;
|
||||||
if (ecuInfo != null) {
|
if (ecuInfo != null) {
|
||||||
ResGPSDto resGPSDto = (ResGPSDto) redisUtil.getEcu(ecuInfo.getEcuSn());
|
ResGPSDto resGPSDto = (ResGPSDto) redisUtil.getEcu(ecuInfo.getEcuSn());
|
||||||
@ -402,6 +414,7 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
|||||||
.noParkingZoneFee(configurations.getNoParkingZoneFee())
|
.noParkingZoneFee(configurations.getNoParkingZoneFee())
|
||||||
.helmetManagementFee(configurations.getHelmetManagementFee())
|
.helmetManagementFee(configurations.getHelmetManagementFee())
|
||||||
.soc(soc)
|
.soc(soc)
|
||||||
|
.regionPolygon(region.getRegionPolygon())
|
||||||
.build();
|
.build();
|
||||||
} else {
|
} else {
|
||||||
EbikeUserBikeInfo userBikeInfo = EbikeUserBikeInfo.builder()
|
EbikeUserBikeInfo userBikeInfo = EbikeUserBikeInfo.builder()
|
||||||
@ -419,6 +432,7 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
|||||||
.noParkingZoneFee(configurations.getNoParkingZoneFee())
|
.noParkingZoneFee(configurations.getNoParkingZoneFee())
|
||||||
.helmetManagementFee(configurations.getHelmetManagementFee())
|
.helmetManagementFee(configurations.getHelmetManagementFee())
|
||||||
.soc(soc)
|
.soc(soc)
|
||||||
|
.regionPolygon(region.getRegionPolygon())
|
||||||
.build();
|
.build();
|
||||||
if (specialBillingConfiguration.getType() == SpecialBillingConfigurationType.DAY) {
|
if (specialBillingConfiguration.getType() == SpecialBillingConfigurationType.DAY) {
|
||||||
query.clear();
|
query.clear();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user