gps刷新时间戳
This commit is contained in:
parent
c407dec992
commit
909d003bf9
@ -142,7 +142,7 @@ public interface MaintenanceFeignClient {
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("ebikeBikeInfo/riding")
|
||||
JsonResult<?> riding(String bikeId);
|
||||
JsonResult<?> riding(@RequestParam(name = "bikeId") String bikeId);
|
||||
|
||||
/**
|
||||
* 根据车辆id将车辆设置为待使用状态
|
||||
@ -150,5 +150,5 @@ public interface MaintenanceFeignClient {
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("ebikeBikeInfo/used")
|
||||
JsonResult<?> used(String bikeId);
|
||||
JsonResult<?> used(@RequestParam(name = "bikeId") String bikeId);
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@ public class SaTokenConfigure {
|
||||
.addInclude("/**") /* 拦截全部path */
|
||||
// 开放地址
|
||||
.addExclude("/order/**")
|
||||
.addExclude("/payment/**")
|
||||
// 鉴权方法:每次访问进入
|
||||
.setAuth(obj -> {
|
||||
if (isCheck) {
|
||||
|
||||
@ -43,22 +43,28 @@ import static com.cdzy.ebikemaintenance.model.pojo.table.EbikeHelmetInfoTableDef
|
||||
@RequestMapping("/ebikeBikeInfo")
|
||||
public class EbikeBikeInfoController {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private EbikeBikeInfoService ebikeBikeInfoService;
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private EbikeEcuInfoService ebikeEcuInfoService;
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private EbikeBatteryInfoService ebikeBatteryInfoService;
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private EbikeHelmetInfoService ebikeHelmetInfoService;
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private EbikeBikeCheckinService ebikeBikeCheckinService;
|
||||
|
||||
@Resource
|
||||
private EbikeSystemInfoService ebikeSystemInfoService;
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private MinioUtil minioUtil;
|
||||
|
||||
|
||||
@ -562,13 +568,12 @@ public class EbikeBikeInfoController {
|
||||
* 取消工单
|
||||
*
|
||||
* @param orderId 工单ID orderType 1 维修工单 2 换电工单 3 调度工单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@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) {
|
||||
return JsonResult.success(true);
|
||||
}
|
||||
@ -758,6 +763,7 @@ public class EbikeBikeInfoController {
|
||||
return JsonResult.failed("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量投放,创建车辆调度工单
|
||||
*
|
||||
@ -773,22 +779,25 @@ public class EbikeBikeInfoController {
|
||||
}
|
||||
return JsonResult.failed("创建调度工单失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工单id 获取调度车辆数据接口
|
||||
* 根据工单id 获取调度车辆数据接口
|
||||
*
|
||||
* @param orderId 工单Id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getDispatchVehicleByOrderId")
|
||||
public JsonResult<?> getDispatchVehicleByOrderId(@RequestParam(name = "orderId") String orderId) {
|
||||
public JsonResult<?> getDispatchVehicleByOrderId(@RequestParam(name = "orderId") String orderId) {
|
||||
ResDispatchVehicleDto resDispatchVehicleDto = ebikeBikeInfoService.getDispatchVehicleByOrderId(orderId);
|
||||
if (!StringUtils.isEmpty(resDispatchVehicleDto)) {
|
||||
return JsonResult.success("", resDispatchVehicleDto);
|
||||
}
|
||||
return JsonResult.failed("获取调度车辆数据失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 有工单-根据工单ID 车辆编号 新增调度车车辆
|
||||
*
|
||||
* @param ebikeDispatchRecordDto
|
||||
*/
|
||||
|
||||
@ -797,13 +806,14 @@ public class EbikeBikeInfoController {
|
||||
EbikeDispatchRecords dispatchRecord = ebikeBikeInfoService.createDispatchRecord(ebikeDispatchRecordDto);
|
||||
if (!StringUtils.isEmpty(dispatchRecord)) {
|
||||
return JsonResult.success("", dispatchRecord);
|
||||
}else{
|
||||
} else {
|
||||
return JsonResult.failed("车辆已经在调度列表中!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除调度记录接口
|
||||
*
|
||||
* @param recordId
|
||||
* @return
|
||||
*/
|
||||
@ -830,6 +840,7 @@ public class EbikeBikeInfoController {
|
||||
|
||||
return JsonResult.success(inventoryBikeListDtoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆状态
|
||||
*
|
||||
@ -841,6 +852,7 @@ public class EbikeBikeInfoController {
|
||||
// 调用服务层方法,执行车辆状态修改操作
|
||||
return ebikeBikeInfoService.updateVehicleStatus(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成投放
|
||||
*
|
||||
@ -848,10 +860,11 @@ public class EbikeBikeInfoController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("completeDeployment")
|
||||
public JsonResult<?> completeDeployment(@RequestBody Map<String,Object> request) {
|
||||
public JsonResult<?> completeDeployment(@RequestBody Map<String, Object> request) {
|
||||
// 调用服务层方法,执行完成投放操作
|
||||
return ebikeBikeInfoService.completeDeployment(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工单列表
|
||||
*
|
||||
@ -865,7 +878,8 @@ public class EbikeBikeInfoController {
|
||||
}
|
||||
|
||||
/**
|
||||
*根据regin_id 获取车辆详情和EcuId
|
||||
* 根据regin_id 获取车辆详情和EcuId
|
||||
*
|
||||
* @param regionId
|
||||
* @return
|
||||
*/
|
||||
@ -876,36 +890,44 @@ public class EbikeBikeInfoController {
|
||||
}
|
||||
|
||||
@PostMapping("checkEcuSn")
|
||||
JsonResult<?> checkEcuSnWithBikeInOperate(@RequestBody EcuSnDto ecuSnDto){
|
||||
JsonResult<?> checkEcuSnWithBikeInOperate(@RequestBody EcuSnDto ecuSnDto) {
|
||||
List<String> list = ebikeBikeInfoService.checkEcuSn(ecuSnDto);
|
||||
return JsonResult.success(list);
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 根据车辆id将车辆设置为骑行中状态
|
||||
*
|
||||
* @param bikeId 车辆id
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("riding")
|
||||
JsonResult<?> riding(@RequestParam("bikeId")String bikeId){
|
||||
JsonResult<?> riding(@RequestParam("bikeId") String bikeId) {
|
||||
UpdateChain.of(EbikeBikeInfo.class)
|
||||
.set(EbikeBikeInfo::getState, "3")
|
||||
.where(EbikeBikeInfo::getBikeId).eq(bikeId)
|
||||
.update();
|
||||
return JsonResult.success();
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 根据车辆id将车辆设置为待使用状态
|
||||
*
|
||||
* @param bikeId 车辆id
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("used")
|
||||
JsonResult<?> used(@RequestParam("bikeId")String bikeId){
|
||||
JsonResult<?> used(@RequestParam("bikeId") String bikeId) {
|
||||
UpdateChain.of(EbikeBikeInfo.class)
|
||||
.set(EbikeBikeInfo::getState, "2")
|
||||
.where(EbikeBikeInfo::getBikeId).eq(bikeId)
|
||||
.update();
|
||||
return JsonResult.success();
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ import static com.cdzy.ebikemaintenance.model.pojo.table.EbikeEcuInfoTableDef.EB
|
||||
* @since 2025-03-26
|
||||
*/
|
||||
@Service
|
||||
public class EbikeBatteryApplyServiceImpl extends ServiceImpl<EbikeBatteryApplyMapper, EbikeBatteryApply> implements EbikeBatteryApplyService {
|
||||
public class EbikeBatteryApplyServiceImpl extends ServiceImpl<EbikeBatteryApplyMapper, EbikeBatteryApply> implements EbikeBatteryApplyService {
|
||||
|
||||
@Resource
|
||||
EbikeBatteryApplyMapper applyMapper;
|
||||
|
||||
@ -8,7 +8,17 @@ import org.springframework.stereotype.Component;
|
||||
public class CustomHealthIndicator implements HealthIndicator {
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user