Merge remote-tracking branch 'origin/main'

This commit is contained in:
jkcdev 2025-05-20 16:41:52 +08:00
commit a3dd7ea473
3 changed files with 39 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import com.cdzy.common.model.JsonResult;
import com.cdzy.ebikeoperate.model.dto.request.ReqEbikeBikeQrcodeBatchDto;
import com.cdzy.ebikeoperate.model.dto.request.ReqEbikeBikeQrcodeDto;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.cdzy.ebikeoperate.model.pojo.EbikeBikeQrcode;
@ -104,5 +105,22 @@ public class EbikeBikeQrcodeController {
Page<EbikeBikeQrcode> pageRecords = ebikeBikeQrcodeService.getPageRecords(reqEbikeBikeQrcodeDto);
return JsonResult.success(pageRecords);
}
/**
* 根据车辆二维码的车辆编号判断车辆二维码是否存在
*
* @param bikeCode 车辆二维码
* @return JsonResult 包含查询结果的响应
*/
@GetMapping("/checkBikeCodeExistence")
public JsonResult<?> checkBikeCodeExistence(@RequestParam(name = "bikeCode") String bikeCode) {
try {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("bike_code", bikeCode);
long count = ebikeBikeQrcodeService.count(queryWrapper);
return JsonResult.success(count);
} catch (Exception e) {
// 记录异常信息
return JsonResult.failed("查询失败,请稍后再试");
}
}
}

View File

@ -4,6 +4,7 @@ import com.cdzy.common.model.JsonResult;
import com.cdzy.ebikeoperate.model.dto.request.ReqEbikeHelmetQrcodeBatchDto;
import com.cdzy.ebikeoperate.model.dto.request.ReqEbikeHelmetQrcodeDto;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.cdzy.ebikeoperate.model.pojo.EbikeHelmetQrcode;
@ -101,5 +102,22 @@ public class EbikeHelmetQrcodeController {
Page<EbikeHelmetQrcode> pageRecords = ebikeHelmetQrcodeService.getPageRecords(reqEbikeHelmetQrcodeDto);
return JsonResult.success(pageRecords);
}
/**
* 根据头盔编号判断头盔二维码是否存在
*
* @param helmetCode 头盔二维码
* @return JsonResult 包含查询结果的响应
*/
@GetMapping("/checkhelmetCodeExistence")
public JsonResult<?> checkhelmetCodeExistence(@RequestParam(name = "helmetCode") String helmetCode) {
try {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("helmet_code", helmetCode);
long count = ebikeHelmetQrcodeService.count(queryWrapper);
return JsonResult.success(count);
} catch (Exception e) {
// 记录异常信息
return JsonResult.failed("查询失败,请稍后再试");
}
}
}

View File

@ -54,7 +54,7 @@ public class EbikeComponentEnterRecords implements Serializable {
/**
* 部件单价
*/
private BigDecimal componentPrice;
private Double componentPrice;
/**
* 创建人