|
@@ -151,7 +151,7 @@ public class TbAssetBorrowRecordServiceImpl extends ServiceImpl<TbAssetBorrowRec
|
|
|
if (tbAsset == null) {
|
|
|
return AjaxResult.error("资产设备不存在");
|
|
|
}
|
|
|
- TbAssetBorrowRecord borrowRecord = query().eq("asset_bar_code", assetBarCode).orderByDesc("borrow_date").last("limit 1").one();
|
|
|
+ TbAssetBorrowRecord borrowRecord = query().eq("asset_bar_code", assetBarCode).eq("isReturn", 0).one();
|
|
|
if (borrowRecord != null && borrowRecord.getIsreturn() < 1) {
|
|
|
return AjaxResult.error("当前资产设备已借出");
|
|
|
}
|
|
@@ -204,11 +204,8 @@ public class TbAssetBorrowRecordServiceImpl extends ServiceImpl<TbAssetBorrowRec
|
|
|
if (StrUtil.isBlank(barCode)) {
|
|
|
return AjaxResult.error("资产条形码不能为空");
|
|
|
}
|
|
|
- TbAssetBorrowRecord borrowRecord = query().eq("asset_bar_code", barCode).orderByDesc("borrow_date").last("limit 1").one();
|
|
|
+ TbAssetBorrowRecord borrowRecord = query().eq("asset_bar_code", barCode).eq("isReturn", 0).one();
|
|
|
if (borrowRecord == null) {
|
|
|
- return AjaxResult.error("查无借用记录");
|
|
|
- }
|
|
|
- if (borrowRecord.getIsreturn() > 0) {
|
|
|
return AjaxResult.error("资产设备已归还");
|
|
|
}
|
|
|
Long borrowUserId = borrowRecord.getUserId();
|