gps刷新时间戳

This commit is contained in:
attiya 2025-07-07 10:57:43 +08:00
parent c407dec992
commit 909d003bf9
5 changed files with 59 additions and 26 deletions

View File

@ -142,7 +142,7 @@ public interface MaintenanceFeignClient {
* @return 结果 * @return 结果
*/ */
@GetMapping("ebikeBikeInfo/riding") @GetMapping("ebikeBikeInfo/riding")
JsonResult<?> riding(String bikeId); JsonResult<?> riding(@RequestParam(name = "bikeId") String bikeId);
/** /**
* 根据车辆id将车辆设置为待使用状态 * 根据车辆id将车辆设置为待使用状态
@ -150,5 +150,5 @@ public interface MaintenanceFeignClient {
* @return 结果 * @return 结果
*/ */
@GetMapping("ebikeBikeInfo/used") @GetMapping("ebikeBikeInfo/used")
JsonResult<?> used(String bikeId); JsonResult<?> used(@RequestParam(name = "bikeId") String bikeId);
} }

View File

@ -26,6 +26,7 @@ public class SaTokenConfigure {
.addInclude("/**") /* 拦截全部path */ .addInclude("/**") /* 拦截全部path */
// 开放地址 // 开放地址
.addExclude("/order/**") .addExclude("/order/**")
.addExclude("/payment/**")
// 鉴权方法每次访问进入 // 鉴权方法每次访问进入
.setAuth(obj -> { .setAuth(obj -> {
if (isCheck) { if (isCheck) {

View File

@ -43,22 +43,28 @@ import static com.cdzy.ebikemaintenance.model.pojo.table.EbikeHelmetInfoTableDef
@RequestMapping("/ebikeBikeInfo") @RequestMapping("/ebikeBikeInfo")
public class EbikeBikeInfoController { public class EbikeBikeInfoController {
@Autowired @Resource
private EbikeBikeInfoService ebikeBikeInfoService; private EbikeBikeInfoService ebikeBikeInfoService;
@Autowired
@Resource
private EbikeEcuInfoService ebikeEcuInfoService; private EbikeEcuInfoService ebikeEcuInfoService;
@Autowired
@Resource
private EbikeBatteryInfoService ebikeBatteryInfoService; private EbikeBatteryInfoService ebikeBatteryInfoService;
@Autowired
@Resource
private EbikeHelmetInfoService ebikeHelmetInfoService; private EbikeHelmetInfoService ebikeHelmetInfoService;
@Autowired
@Resource
private EbikeBikeCheckinService ebikeBikeCheckinService; private EbikeBikeCheckinService ebikeBikeCheckinService;
@Resource @Resource
private EbikeSystemInfoService ebikeSystemInfoService; private EbikeSystemInfoService ebikeSystemInfoService;
@Autowired
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired
@Resource
private MinioUtil minioUtil; private MinioUtil minioUtil;
@ -562,13 +568,12 @@ public class EbikeBikeInfoController {
* 取消工单 * 取消工单
* *
* @param orderId 工单ID orderType 1 维修工单 2 换电工单 3 调度工单 * @param orderId 工单ID orderType 1 维修工单 2 换电工单 3 调度工单
*
* @return * @return
*/ */
@RequestMapping("canCellWorkOrder") @RequestMapping("canCellWorkOrder")
public JsonResult<?> canCellWorkOrder(@RequestParam(name = "orderId") String orderId,@RequestParam(name = "orderType") String orderType) { public JsonResult<?> canCellWorkOrder(@RequestParam(name = "orderId") String orderId, @RequestParam(name = "orderType") String orderType) {
boolean b = ebikeBikeInfoService.canCellWorkOrder(orderId,orderType); boolean b = ebikeBikeInfoService.canCellWorkOrder(orderId, orderType);
if (b) { if (b) {
return JsonResult.success(true); return JsonResult.success(true);
} }
@ -758,6 +763,7 @@ public class EbikeBikeInfoController {
return JsonResult.failed("删除失败"); return JsonResult.failed("删除失败");
} }
} }
/** /**
* 批量投放创建车辆调度工单 * 批量投放创建车辆调度工单
* *
@ -773,22 +779,25 @@ public class EbikeBikeInfoController {
} }
return JsonResult.failed("创建调度工单失败"); return JsonResult.failed("创建调度工单失败");
} }
/** /**
* 根据工单id 获取调度车辆数据接口 * 根据工单id 获取调度车辆数据接口
* *
* @param orderId 工单Id * @param orderId 工单Id
* @return * @return
*/ */
@GetMapping("getDispatchVehicleByOrderId") @GetMapping("getDispatchVehicleByOrderId")
public JsonResult<?> getDispatchVehicleByOrderId(@RequestParam(name = "orderId") String orderId) { public JsonResult<?> getDispatchVehicleByOrderId(@RequestParam(name = "orderId") String orderId) {
ResDispatchVehicleDto resDispatchVehicleDto = ebikeBikeInfoService.getDispatchVehicleByOrderId(orderId); ResDispatchVehicleDto resDispatchVehicleDto = ebikeBikeInfoService.getDispatchVehicleByOrderId(orderId);
if (!StringUtils.isEmpty(resDispatchVehicleDto)) { if (!StringUtils.isEmpty(resDispatchVehicleDto)) {
return JsonResult.success("", resDispatchVehicleDto); return JsonResult.success("", resDispatchVehicleDto);
} }
return JsonResult.failed("获取调度车辆数据失败!"); return JsonResult.failed("获取调度车辆数据失败!");
} }
/** /**
* 有工单-根据工单ID 车辆编号 新增调度车车辆 * 有工单-根据工单ID 车辆编号 新增调度车车辆
*
* @param ebikeDispatchRecordDto * @param ebikeDispatchRecordDto
*/ */
@ -797,13 +806,14 @@ public class EbikeBikeInfoController {
EbikeDispatchRecords dispatchRecord = ebikeBikeInfoService.createDispatchRecord(ebikeDispatchRecordDto); EbikeDispatchRecords dispatchRecord = ebikeBikeInfoService.createDispatchRecord(ebikeDispatchRecordDto);
if (!StringUtils.isEmpty(dispatchRecord)) { if (!StringUtils.isEmpty(dispatchRecord)) {
return JsonResult.success("", dispatchRecord); return JsonResult.success("", dispatchRecord);
}else{ } else {
return JsonResult.failed("车辆已经在调度列表中!"); return JsonResult.failed("车辆已经在调度列表中!");
} }
} }
/** /**
* 删除调度记录接口 * 删除调度记录接口
*
* @param recordId * @param recordId
* @return * @return
*/ */
@ -830,6 +840,7 @@ public class EbikeBikeInfoController {
return JsonResult.success(inventoryBikeListDtoPage); return JsonResult.success(inventoryBikeListDtoPage);
} }
/** /**
* 修改车辆状态 * 修改车辆状态
* *
@ -841,6 +852,7 @@ public class EbikeBikeInfoController {
// 调用服务层方法执行车辆状态修改操作 // 调用服务层方法执行车辆状态修改操作
return ebikeBikeInfoService.updateVehicleStatus(request); return ebikeBikeInfoService.updateVehicleStatus(request);
} }
/** /**
* 完成投放 * 完成投放
* *
@ -848,10 +860,11 @@ public class EbikeBikeInfoController {
* @return * @return
*/ */
@PostMapping("completeDeployment") @PostMapping("completeDeployment")
public JsonResult<?> completeDeployment(@RequestBody Map<String,Object> request) { public JsonResult<?> completeDeployment(@RequestBody Map<String, Object> request) {
// 调用服务层方法执行完成投放操作 // 调用服务层方法执行完成投放操作
return ebikeBikeInfoService.completeDeployment(request); return ebikeBikeInfoService.completeDeployment(request);
} }
/** /**
* 获取工单列表 * 获取工单列表
* *
@ -865,7 +878,8 @@ public class EbikeBikeInfoController {
} }
/** /**
*根据regin_id 获取车辆详情和EcuId * 根据regin_id 获取车辆详情和EcuId
*
* @param regionId * @param regionId
* @return * @return
*/ */
@ -876,36 +890,44 @@ public class EbikeBikeInfoController {
} }
@PostMapping("checkEcuSn") @PostMapping("checkEcuSn")
JsonResult<?> checkEcuSnWithBikeInOperate(@RequestBody EcuSnDto ecuSnDto){ JsonResult<?> checkEcuSnWithBikeInOperate(@RequestBody EcuSnDto ecuSnDto) {
List<String> list = ebikeBikeInfoService.checkEcuSn(ecuSnDto); List<String> list = ebikeBikeInfoService.checkEcuSn(ecuSnDto);
return JsonResult.success(list); return JsonResult.success(list);
}; }
;
/** /**
* 根据车辆id将车辆设置为骑行中状态 * 根据车辆id将车辆设置为骑行中状态
*
* @param bikeId 车辆id * @param bikeId 车辆id
* @return 结果 * @return 结果
*/ */
@GetMapping("riding") @GetMapping("riding")
JsonResult<?> riding(@RequestParam("bikeId")String bikeId){ JsonResult<?> riding(@RequestParam("bikeId") String bikeId) {
UpdateChain.of(EbikeBikeInfo.class) UpdateChain.of(EbikeBikeInfo.class)
.set(EbikeBikeInfo::getState, "3") .set(EbikeBikeInfo::getState, "3")
.where(EbikeBikeInfo::getBikeId).eq(bikeId) .where(EbikeBikeInfo::getBikeId).eq(bikeId)
.update(); .update();
return JsonResult.success(); return JsonResult.success();
}; }
;
/** /**
* 根据车辆id将车辆设置为待使用状态 * 根据车辆id将车辆设置为待使用状态
*
* @param bikeId 车辆id * @param bikeId 车辆id
* @return 结果 * @return 结果
*/ */
@GetMapping("used") @GetMapping("used")
JsonResult<?> used(@RequestParam("bikeId")String bikeId){ JsonResult<?> used(@RequestParam("bikeId") String bikeId) {
UpdateChain.of(EbikeBikeInfo.class) UpdateChain.of(EbikeBikeInfo.class)
.set(EbikeBikeInfo::getState, "2") .set(EbikeBikeInfo::getState, "2")
.where(EbikeBikeInfo::getBikeId).eq(bikeId) .where(EbikeBikeInfo::getBikeId).eq(bikeId)
.update(); .update();
return JsonResult.success(); return JsonResult.success();
}; }
;
} }

View File

@ -34,7 +34,7 @@ import static com.cdzy.ebikemaintenance.model.pojo.table.EbikeEcuInfoTableDef.EB
* @since 2025-03-26 * @since 2025-03-26
*/ */
@Service @Service
public class EbikeBatteryApplyServiceImpl extends ServiceImpl<EbikeBatteryApplyMapper, EbikeBatteryApply> implements EbikeBatteryApplyService { public class EbikeBatteryApplyServiceImpl extends ServiceImpl<EbikeBatteryApplyMapper, EbikeBatteryApply> implements EbikeBatteryApplyService {
@Resource @Resource
EbikeBatteryApplyMapper applyMapper; EbikeBatteryApplyMapper applyMapper;

View File

@ -8,7 +8,17 @@ import org.springframework.stereotype.Component;
public class CustomHealthIndicator implements HealthIndicator { public class CustomHealthIndicator implements HealthIndicator {
@Override @Override
public Health health() { public Health health() {
// 检查逻辑 // 内存使用情况检查逻辑
return Health.up().withDetail("service", "available").build(); Runtime runtime = Runtime.getRuntime();
double usedMem = (runtime.totalMemory() - runtime.freeMemory()) / 1024.0 / 1024 / 1024;
double maxMem = runtime.maxMemory() / 1024.0 / 1024 / 1024;
double ratio = usedMem / maxMem * 100;
return Health.up()
.withDetail("memoryUsed(GB)", String.format("%.2f", usedMem))
.withDetail("memoryMax(GB)", String.format("%.2f", maxMem))
.withDetail("utilization", String.format("%.2f%%", ratio))
.build();
// return Health.up().withDetail("service", "available").build();
} }
} }