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