根据头盔编号判断头盔二维码是否存在。
This commit is contained in:
parent
a262061d7b
commit
f71e921037
@ -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.ReqEbikeHelmetQrcodeBatchDto;
|
||||||
import com.cdzy.ebikeoperate.model.dto.request.ReqEbikeHelmetQrcodeDto;
|
import com.cdzy.ebikeoperate.model.dto.request.ReqEbikeHelmetQrcodeDto;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.cdzy.ebikeoperate.model.pojo.EbikeHelmetQrcode;
|
import com.cdzy.ebikeoperate.model.pojo.EbikeHelmetQrcode;
|
||||||
@ -101,5 +102,22 @@ public class EbikeHelmetQrcodeController {
|
|||||||
Page<EbikeHelmetQrcode> pageRecords = ebikeHelmetQrcodeService.getPageRecords(reqEbikeHelmetQrcodeDto);
|
Page<EbikeHelmetQrcode> pageRecords = ebikeHelmetQrcodeService.getPageRecords(reqEbikeHelmetQrcodeDto);
|
||||||
return JsonResult.success(pageRecords);
|
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("查询失败,请稍后再试");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user