diff --git a/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeEcuInfoController.java b/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeEcuInfoController.java index d6394d8..23e1837 100644 --- a/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeEcuInfoController.java +++ b/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeEcuInfoController.java @@ -11,6 +11,7 @@ import com.cdzy.operations.model.vo.EbikeEcuInfoVo; import com.cdzy.operations.model.vo.EbikeEcuUpgradeVo; import com.cdzy.operations.service.EbikeEcuInfoService; import com.mybatisflex.core.paginate.Page; +import com.mybatisflex.core.query.QueryWrapper; import jakarta.annotation.Resource; import jakarta.validation.constraints.NotNull; import org.springframework.validation.annotation.Validated; @@ -25,6 +26,8 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.util.List; +import static com.cdzy.operations.model.entity.table.EbikeEcuInfoTableDef.EBIKE_ECU_INFO; + /** * 中控基本信息 控制层。 * @@ -167,7 +170,7 @@ public class EbikeEcuInfoController { */ @GetMapping("executeCommand") public JsonResult executeCommand(String ecuSn, String bikeCode, @NotNull(message = "命令编码不能为空") String commandCode) { - boolean result = ebikeEcuInfoService.executeCommand(ecuSn, bikeCode, commandCode, null,null); + boolean result = ebikeEcuInfoService.executeCommand(ecuSn, bikeCode, commandCode, null, null); return JsonResult.success(result); } @@ -177,11 +180,24 @@ public class EbikeEcuInfoController { * @return 执行结构 */ @GetMapping("playAudio") - public JsonResult playAudio(String ecuSn,Integer idx) { - boolean result = ebikeEcuInfoService.executeCommand(ecuSn, null, CommandType.PLAY_AUDIO, null,idx); + public JsonResult playAudio(String ecuSn, Integer idx) { + boolean result = ebikeEcuInfoService.executeCommand(ecuSn, null, CommandType.PLAY_AUDIO, null, idx); return JsonResult.success(result); } + /** + * 根据中控编号获取详情 + * + * @return 执行结构 + */ + @GetMapping("getEcuInfoByEcuSn") + public JsonResult getEcuInfoByEcuSn(@RequestParam("ecuSn") String ecuSn) { + QueryWrapper queryWrapper = QueryWrapper.create() + .where(EBIKE_ECU_INFO.ECU_SN.eq(ecuSn)); + EbikeEcuInfo info = ebikeEcuInfoService.getOne(queryWrapper); + return JsonResult.success(info); + } + /** * 远程升级 *