From db64926ed340724ecbb0e26212c419a487eede7b Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 03 四月 2025 11:23:19 +0800
Subject: [PATCH] 设备导入优化
---
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java | 39 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java
index 5a53933..bf53b75 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java
@@ -489,6 +489,24 @@
*/
@Override
public boolean updateSection(StandardProductList list) {
+ // 鏍规嵁id 鏌ヨ鍒板師濮嬪��
+ StandardProductList standardProductList = standardProductListMapper.selectById(list.getId());
+ if(ObjectUtils.isEmpty(standardProductList)){
+ throw new RuntimeException("鏇存柊澶辫触,鏈煡鎵惧埌妫�鏌ラ」");
+ }
+ // 鍒ゆ柇褰撳墠鐘舵�� 濡傛灉鏄鏍镐腑
+ if(StandardProductListChcekTypeEnums.CHECK_ING.getCode().equals(list.getCheckStatus())){
+ throw new RuntimeException("瀹℃牳涓笉鏀寔淇敼");
+ }
+ // 鏌ヨ鏈�鏂扮殑涓�娆″叧鑱斿浠� 濡傛灉瀛樺湪璇存槑鏈鏍稿畬缁х画淇敼浜嗐�備笉鍋氭暟鎹鐞嗐��
+ StandardProductListBackupRel standardProductListBackupRel = standardProductListBackupRelMapper.selectById(list.getId());
+ if(ObjectUtils.isEmpty(standardProductListBackupRel)){
+ StandardProductListBackupRel productListBackupRel = new StandardProductListBackupRel();
+ BeanUtils.copyProperties(standardProductList, productListBackupRel);
+ standardProductListBackupRelMapper.insert(productListBackupRel);
+ }
+ // 淇敼鐘舵��
+ list.setCheckStatus(StandardProductListChcekTypeEnums.WAIT_CHECK.getCode());
standardProductListMapper.updateSection(list);
return true;
}
@@ -652,7 +670,9 @@
QueryWrapper<StandardProductList> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("check_status",StandardProductListChcekTypeEnums.WAIT_CHECK.getCode());
List<StandardProductList> unCheckStandardProductListArray = standardProductListMapper.selectList(queryWrapper);
-
+ if(CollectionUtils.isEmpty(unCheckStandardProductListArray)){
+ throw new RuntimeException("鏆傛棤淇敼鏁版嵁");
+ }
List<Long> standardProductListIds = new ArrayList<>();
// 鎻掑叆淇敼璁板綍
standardProductListUpdateRecordMapper.insert(standardProductListUpdateRecord);
@@ -714,6 +734,23 @@
}
standardProductListUpdateRecordMapper.updateById(standardProductListUpdateRecord);
}
+
+ /**
+ * 鏌ヨ鏍囧噯搴撴槸鍚﹀瓨鍦ㄥ鏍镐腑鐘舵��
+ *
+ * @return
+ */
+ @Override
+ public boolean existCheckingRecord() {
+ QueryWrapper<StandardProductListUpdateRecord> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("check_status",StandardProductListChcekTypeEnums.CHECK_ING.getCode());
+ List<StandardProductListUpdateRecord> standardProductListUpdateRecordList = standardProductListUpdateRecordMapper.selectList(queryWrapper);
+ if(CollectionUtils.isEmpty(standardProductListUpdateRecordList)){
+ return false;
+ }else {
+ return true;
+ }
+ }
}
--
Gitblit v1.9.3