Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
f237dc0866
@ -6,19 +6,20 @@ import com.ebike.feign.model.res.ReqUserOperateDto;
|
|||||||
import com.ebike.feign.model.res.ResFeignEbikeSysRcostsetDto;
|
import com.ebike.feign.model.res.ResFeignEbikeSysRcostsetDto;
|
||||||
import com.ebike.feign.model.rsp.FeignEbikeRegionDto;
|
import com.ebike.feign.model.rsp.FeignEbikeRegionDto;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运营管理 外部调用。
|
* 运营管理 外部调用。
|
||||||
*
|
*
|
||||||
* @author dingchao
|
* @author dingchao
|
||||||
* @date 2025/3/27
|
* @date 2025/3/27
|
||||||
* @modified by:
|
|
||||||
*/
|
*/
|
||||||
@FeignClient(name = "ebike-operate")
|
@FeignClient(name = "ebike-operate")
|
||||||
public interface OperateFeignClient {
|
public interface OperateFeignClient {
|
||||||
@ -26,7 +27,7 @@ public interface OperateFeignClient {
|
|||||||
* 批量保存电池入库记录。
|
* 批量保存电池入库记录。
|
||||||
*
|
*
|
||||||
* @param ebikeBatteryCodes 电池编码
|
* @param ebikeBatteryCodes 电池编码
|
||||||
* @return
|
* @return 结果数据
|
||||||
*/
|
*/
|
||||||
@PostMapping("ebikeBatteryEnterRecords/batchSave")
|
@PostMapping("ebikeBatteryEnterRecords/batchSave")
|
||||||
JsonResult<?> batchSaveBatteryEnterRecords(@RequestBody List<String> ebikeBatteryCodes);
|
JsonResult<?> batchSaveBatteryEnterRecords(@RequestBody List<String> ebikeBatteryCodes);
|
||||||
@ -35,7 +36,7 @@ public interface OperateFeignClient {
|
|||||||
* 批量保存电池出库记录。
|
* 批量保存电池出库记录。
|
||||||
*
|
*
|
||||||
* @param ebikeBatteryCodes 电池编码
|
* @param ebikeBatteryCodes 电池编码
|
||||||
* @return
|
* @return 结果数据
|
||||||
*/
|
*/
|
||||||
@PostMapping("ebikeBatteryOutRecords/batchSave")
|
@PostMapping("ebikeBatteryOutRecords/batchSave")
|
||||||
JsonResult<?> batchSaveBatteryOutRecords(@RequestBody List<String> ebikeBatteryCodes);
|
JsonResult<?> batchSaveBatteryOutRecords(@RequestBody List<String> ebikeBatteryCodes);
|
||||||
@ -44,7 +45,7 @@ public interface OperateFeignClient {
|
|||||||
* 获取行政区域。
|
* 获取行政区域。
|
||||||
*
|
*
|
||||||
* @param parent_id 父级行政区域ID
|
* @param parent_id 父级行政区域ID
|
||||||
* @return
|
* @return 结果数据
|
||||||
*/
|
*/
|
||||||
@GetMapping("ebikeSystemCodeMapInfo/ebikeAdministrationZone")
|
@GetMapping("ebikeSystemCodeMapInfo/ebikeAdministrationZone")
|
||||||
JsonResult<?> getEbikeAdministrationZone(@RequestParam(name = "parent_id", required = false) String parent_id);
|
JsonResult<?> getEbikeAdministrationZone(@RequestParam(name = "parent_id", required = false) String parent_id);
|
||||||
@ -53,7 +54,7 @@ public interface OperateFeignClient {
|
|||||||
* 根据行政区名称获取运营区域ID列表
|
* 根据行政区名称获取运营区域ID列表
|
||||||
*
|
*
|
||||||
* @param zoneName 区域名称
|
* @param zoneName 区域名称
|
||||||
* @return 详情
|
* @return 结果数据 详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("ebikeRegion/getRegionIdsByZone")
|
@GetMapping("ebikeRegion/getRegionIdsByZone")
|
||||||
JsonResult<?> getRegionIdsByZone(@RequestParam(name = "zoneName") String zoneName);
|
JsonResult<?> getRegionIdsByZone(@RequestParam(name = "zoneName") String zoneName);
|
||||||
@ -62,7 +63,7 @@ public interface OperateFeignClient {
|
|||||||
* 保存车辆轨迹。
|
* 保存车辆轨迹。
|
||||||
*
|
*
|
||||||
* @param ebikeTracking 车辆轨迹
|
* @param ebikeTracking 车辆轨迹
|
||||||
* @return 返回结果
|
* @return 结果数据 返回结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("ebikeTracking/save")
|
@PostMapping("ebikeTracking/save")
|
||||||
JsonResult<?> saveEbikeTracking(@RequestBody EbikeTracking ebikeTracking);
|
JsonResult<?> saveEbikeTracking(@RequestBody EbikeTracking ebikeTracking);
|
||||||
@ -71,7 +72,7 @@ public interface OperateFeignClient {
|
|||||||
* 获取运营区详情。
|
* 获取运营区详情。
|
||||||
*
|
*
|
||||||
* @param regionId 运营区id
|
* @param regionId 运营区id
|
||||||
* @return 返回结果
|
* @return 结果数据 返回结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("ebikeRegion/getOperationById")
|
@GetMapping("ebikeRegion/getOperationById")
|
||||||
JsonResult<FeignEbikeRegionDto> getOperationById(@RequestParam(name = "regionId") Long regionId);
|
JsonResult<FeignEbikeRegionDto> getOperationById(@RequestParam(name = "regionId") Long regionId);
|
||||||
@ -80,7 +81,7 @@ public interface OperateFeignClient {
|
|||||||
* 根据区域id获取计费规则。
|
* 根据区域id获取计费规则。
|
||||||
*
|
*
|
||||||
* @param operationRegionId 运营区id
|
* @param operationRegionId 运营区id
|
||||||
* @return 返回结果
|
* @return 结果数据 返回结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("ebikesysrcostset/getRegionFeeConfigById")
|
@GetMapping("ebikesysrcostset/getRegionFeeConfigById")
|
||||||
JsonResult<ResFeignEbikeSysRcostsetDto> getRegionFeeConfigById(@RequestParam(name = "operationRegionId") Long operationRegionId);
|
JsonResult<ResFeignEbikeSysRcostsetDto> getRegionFeeConfigById(@RequestParam(name = "operationRegionId") Long operationRegionId);
|
||||||
@ -88,8 +89,8 @@ public interface OperateFeignClient {
|
|||||||
/**
|
/**
|
||||||
* 设置用户所属运营区
|
* 设置用户所属运营区
|
||||||
*
|
*
|
||||||
* @param reqUserOperateDto
|
* @param reqUserOperateDto 信息
|
||||||
* @return
|
* @return 结果数据
|
||||||
*/
|
*/
|
||||||
@PostMapping("ebikeRegion/setUserOperate")
|
@PostMapping("ebikeRegion/setUserOperate")
|
||||||
JsonResult<?> setUserOperate(@RequestBody ReqUserOperateDto reqUserOperateDto);
|
JsonResult<?> setUserOperate(@RequestBody ReqUserOperateDto reqUserOperateDto);
|
||||||
@ -97,9 +98,29 @@ public interface OperateFeignClient {
|
|||||||
/**
|
/**
|
||||||
* 删除用户所属运营区
|
* 删除用户所属运营区
|
||||||
*
|
*
|
||||||
* @param staffId
|
* @param staffId 员工id
|
||||||
* @return
|
* @return 结果数据
|
||||||
*/
|
*/
|
||||||
@PostMapping("ebikeRegion/delUserOperate")
|
@PostMapping("ebikeRegion/delUserOperate")
|
||||||
JsonResult<?> delUserOperate(@RequestParam("staffId") Long staffId);
|
JsonResult<?> delUserOperate(@RequestParam("staffId") Long staffId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户所属运营区
|
||||||
|
*
|
||||||
|
* @param siteRegionId 站点id
|
||||||
|
* @return 结果数据
|
||||||
|
*/
|
||||||
|
@Async
|
||||||
|
@GetMapping("ebikeRegion/addBorrowing")
|
||||||
|
CompletableFuture<?> addBorrowing(@RequestParam("siteRegionId") Long siteRegionId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户所属运营区
|
||||||
|
*
|
||||||
|
* @param siteRegionId 站点id
|
||||||
|
* @return 结果数据
|
||||||
|
*/
|
||||||
|
@Async
|
||||||
|
@GetMapping("ebikeRegion/addReturn")
|
||||||
|
CompletableFuture<?> addReturn(@RequestParam("siteRegionId") Long siteRegionId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
package com.ebike.feign.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableAsync
|
||||||
|
public class ExampleFeignConfiguration {
|
||||||
|
@Bean
|
||||||
|
public Executor asyncExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
executor.setCorePoolSize(10);
|
||||||
|
executor.setMaxPoolSize(50);
|
||||||
|
executor.setQueueCapacity(100);
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -237,6 +237,29 @@ public class EbikeRegionController {
|
|||||||
return JsonResult.success();
|
return JsonResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加站点借车单量。
|
||||||
|
*
|
||||||
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
||||||
|
*/
|
||||||
|
@GetMapping("addBorrowing")
|
||||||
|
public JsonResult<?> addBorrowing(@RequestParam("siteRegionId") Long siteRegionId) {
|
||||||
|
siteRegionService.addBorrowing(siteRegionId);
|
||||||
|
return JsonResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加站点还车单量。
|
||||||
|
*
|
||||||
|
* @return {@code 200} 添加成功,{@code 500} 添加失败
|
||||||
|
*/
|
||||||
|
@GetMapping("addReturn")
|
||||||
|
public JsonResult<?> addReturn(@RequestParam("siteRegionId") Long siteRegionId) {
|
||||||
|
siteRegionService.addReturn(siteRegionId);
|
||||||
|
return JsonResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录用户所有行政区。
|
* 获取当前登录用户所有行政区。
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -65,7 +65,19 @@ public interface EbikeSiteRegionService extends IService<EbikeSiteRegion> {
|
|||||||
/**
|
/**
|
||||||
* 站点附件上传
|
* 站点附件上传
|
||||||
* @param file 附件
|
* @param file 附件
|
||||||
* @return
|
* @return 文件id
|
||||||
*/
|
*/
|
||||||
Long saveImages(MultipartFile file) throws Exception;
|
Long saveImages(MultipartFile file) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加站点借车单量
|
||||||
|
* @param siteRegionId 站点ID
|
||||||
|
*/
|
||||||
|
void addBorrowing(Long siteRegionId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加站点还车单量
|
||||||
|
* @param siteRegionId 站点ID
|
||||||
|
*/
|
||||||
|
void addReturn(Long siteRegionId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,6 +122,22 @@ public class EbikeSiteRegionServiceImpl extends ServiceImpl<EbikeSiteRegionMappe
|
|||||||
return image.getImageId();
|
return image.getImageId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addBorrowing(Long siteRegionId) {
|
||||||
|
EbikeSiteRegion ebikeSiteRegion = this.mapper.selectOneById(siteRegionId);
|
||||||
|
int i = ebikeSiteRegion.getBorrowingOrder() + 1;
|
||||||
|
ebikeSiteRegion.setBorrowingOrder(i);
|
||||||
|
this.mapper.update(ebikeSiteRegion);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addReturn(Long siteRegionId) {
|
||||||
|
EbikeSiteRegion ebikeSiteRegion = this.mapper.selectOneById(siteRegionId);
|
||||||
|
int i = ebikeSiteRegion.getReturnOrder() + 1;
|
||||||
|
ebikeSiteRegion.setReturnOrder(i);
|
||||||
|
this.mapper.update(ebikeSiteRegion);
|
||||||
|
}
|
||||||
|
|
||||||
private void delImages(Long siteRegionId) throws Exception {
|
private void delImages(Long siteRegionId) throws Exception {
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
.where(EBIKE_SITE_IMAGES.SITE_REGION_ID.eq(siteRegionId));
|
.where(EBIKE_SITE_IMAGES.SITE_REGION_ID.eq(siteRegionId));
|
||||||
|
|||||||
@ -129,6 +129,10 @@ public class UserOrdersServiceImpl extends ServiceImpl<UserOrdersMapper, EbikeUs
|
|||||||
if (jsonObject.getInteger("code") != 0) {
|
if (jsonObject.getInteger("code") != 0) {
|
||||||
throw new RuntimeException("开锁失败");
|
throw new RuntimeException("开锁失败");
|
||||||
}
|
}
|
||||||
|
//添加借车单量
|
||||||
|
Long siteRegionId = redisUtil.isPointInSiteWithSiteRegionId(resGpsDto.getLongitude(), resGpsDto.getLatitude(),regionDto.getOperationRegionId());
|
||||||
|
operateFeignClient.addBorrowing(siteRegionId);
|
||||||
|
|
||||||
userOrders.setBikeId(bikeInfoDto.getBikeId());
|
userOrders.setBikeId(bikeInfoDto.getBikeId());
|
||||||
String stringBuilder = resGpsDto.getLongitude() + "," + resGpsDto.getLatitude();
|
String stringBuilder = resGpsDto.getLongitude() + "," + resGpsDto.getLatitude();
|
||||||
userOrders.setRidePoint(stringBuilder);
|
userOrders.setRidePoint(stringBuilder);
|
||||||
@ -181,6 +185,10 @@ public class UserOrdersServiceImpl extends ServiceImpl<UserOrdersMapper, EbikeUs
|
|||||||
if (jsonObject.getInteger("code") != 0) {
|
if (jsonObject.getInteger("code") != 0) {
|
||||||
throw new RuntimeException("关锁失败");
|
throw new RuntimeException("关锁失败");
|
||||||
}
|
}
|
||||||
|
//添加还车单量
|
||||||
|
Long siteRegionId = redisUtil.isPointInSiteWithSiteRegionId(resGpsDto.getLongitude(), resGpsDto.getLatitude(),regionDto.getOperationRegionId());
|
||||||
|
operateFeignClient.addReturn(siteRegionId);
|
||||||
|
|
||||||
return userOrders.getOrderId();
|
return userOrders.getOrderId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
package com.cdzy.payment.model.dto;
|
package com.cdzy.payment.model.dto;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author:Ding
|
* @author:Ding
|
||||||
* @ClassName:ReqRefundDto
|
* @ClassName:ReqRefundDto
|
||||||
@ -32,5 +34,5 @@ public class ReqRefundDto {
|
|||||||
/**
|
/**
|
||||||
* 退款时间
|
* 退款时间
|
||||||
*/
|
*/
|
||||||
private JSONArray refundTime;
|
private List<LocalDateTime> refundTime;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user