|
@@ -104,12 +104,6 @@ public class TbAssetBorrowRecordServiceImpl implements ITbAssetBorrowRecordServi
|
|
|
{
|
|
|
Long assetId = tbAssetBorrowRecord.getAssetId();
|
|
|
|
|
|
- // 判断是否已借出
|
|
|
- TbAssetBorrowRecord isLentRecord = tbAssetBorrowRecordMapper.selectLentRecordByAssetId(assetId);
|
|
|
- if (isLentRecord != null) {
|
|
|
- throw new RuntimeException("资产已借出");
|
|
|
- }
|
|
|
-
|
|
|
TbAssetInformation tbAssetInformation;
|
|
|
if (assetId != null) {
|
|
|
tbAssetInformation = assetInformationMapper.selectTbAssetInformationById(assetId);
|
|
@@ -125,6 +119,13 @@ public class TbAssetBorrowRecordServiceImpl implements ITbAssetBorrowRecordServi
|
|
|
}
|
|
|
tbAssetBorrowRecord.setAssetId(tbAssetInformation.getId());
|
|
|
}
|
|
|
+
|
|
|
+ // 判断是否已借出
|
|
|
+ TbAssetBorrowRecord isLentRecord = tbAssetBorrowRecordMapper.selectLentRecordByAssetId(tbAssetInformation.getId());
|
|
|
+ if (isLentRecord != null) {
|
|
|
+ throw new RuntimeException("资产已借出");
|
|
|
+ }
|
|
|
+
|
|
|
tbAssetBorrowRecord.setBorrowLocationNumber(tbAssetInformation.getLocationNumber());
|
|
|
|
|
|
tbAssetBorrowRecord.setCreateTime(DateUtils.getNowDate());
|