From 722fa40345f1fc650eaeae4a721c3ae4106d92a8 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期三, 18 九月 2024 19:03:56 +0800 Subject: [PATCH] 代码提交 --- smartor/src/main/java/com/smartor/service/impl/HeLibraryServiceImpl.java | 80 ++++++++++++++++++--------------------- 1 files changed, 37 insertions(+), 43 deletions(-) diff --git a/smartor/src/main/java/com/smartor/service/impl/HeLibraryServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/HeLibraryServiceImpl.java index b04ad51..41500c4 100644 --- a/smartor/src/main/java/com/smartor/service/impl/HeLibraryServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/HeLibraryServiceImpl.java @@ -1,22 +1,20 @@ package com.smartor.service.impl; -import java.util.List; - import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DtoConversionUtils; import com.smartor.domain.HeLibrary; import com.smartor.domain.HeLibraryTag; import com.smartor.domain.HeLibraryVO; -import com.smartor.domain.TempDetpRelevance; import com.smartor.mapper.HeLibraryMapper; import com.smartor.mapper.HeLibraryTagMapper; -import com.smartor.mapper.TempDetpRelevanceMapper; import com.smartor.service.IHeLibraryService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + +import java.util.List; /** * 瀹f暀璧勬枡搴揝ervice涓氬姟灞傚鐞� @@ -32,9 +30,6 @@ @Autowired private HeLibraryTagMapper heLibraryTagMapper; - - @Autowired - private TempDetpRelevanceMapper tempDetpRelevanceMapper; /** * 鏌ヨ瀹f暀璧勬枡搴� @@ -103,50 +98,49 @@ */ @Override public Integer saveOrUpdateScript(HeLibraryVO heLibraryVO) { - Integer i = null; HeLibrary heLibrary = DtoConversionUtils.sourceToTarget(heLibraryVO, HeLibrary.class); if (heLibraryVO.getIsoperation() != null && heLibraryVO.getIsoperation() == 1) { //鏂板 - i = heLibraryMapper.insertHeLibrary(heLibrary); + heLibraryMapper.insertHeLibrary(heLibrary); } else if (heLibraryVO.getIsoperation() != null && heLibraryVO.getIsoperation() == 2) { //淇敼 - i = heLibraryMapper.updateHeLibrary(heLibrary); + heLibraryMapper.updateHeLibrary(heLibrary); } log.info("鏂板鎴栦慨鏀瑰鏁欒鎯呯殑id涓猴細{}", heLibrary.getId()); +// +// //瀵规爣绛捐繘琛屽鐞� +// for (HeLibraryTag heLibraryTag : heLibraryVO.getHeLibraryTagList()) { +// if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 1) { +// //鏂板 +// heLibraryTag.setHeid(heLibrary.getId()); +// heLibraryTagMapper.insertHeLibraryTag(heLibraryTag); +// } else if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 2) { +// //淇敼 +// heLibraryTag.setHeid(heLibrary.getId()); +// heLibraryTagMapper.updateHeLibraryTag(heLibraryTag); +// } else if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 3) { +// //鍒犻櫎 +// if (heLibraryTag.getId() == null) { +// log.info("鍒犻櫎澶辫触,妯℃澘鎸囨爣id涓虹┖"); +// } else { +// heLibraryTagMapper.deleteHeLibraryTagById(heLibraryTag.getId()); +// } +// } +// } +// +// //瀵圭瀹よ繘琛屽鐞� +// for (TempDetpRelevance tempDetpRelevance : heLibraryVO.getTempDetpRelevances()) { +// if (tempDetpRelevance.getId() == null) { +// //鏂板 +// tempDetpRelevance.setTempid(heLibrary.getId()); +// tempDetpRelevance.setType(3L); +// tempDetpRelevanceMapper.insertTempDetpRelevance(tempDetpRelevance); +// } else { +// tempDetpRelevanceMapper.updateTempDetpRelevance(tempDetpRelevance); +// } +// } - //瀵规爣绛捐繘琛屽鐞� - for (HeLibraryTag heLibraryTag : heLibraryVO.getHeLibraryTagList()) { - if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 1) { - //鏂板 - heLibraryTag.setHeid(heLibrary.getId()); - heLibraryTagMapper.insertHeLibraryTag(heLibraryTag); - } else if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 2) { - //淇敼 - heLibraryTag.setHeid(heLibrary.getId()); - heLibraryTagMapper.updateHeLibraryTag(heLibraryTag); - } else if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 3) { - //鍒犻櫎 - if (heLibraryTag.getId() == null) { - log.info("鍒犻櫎澶辫触,妯℃澘鎸囨爣id涓虹┖"); - } else { - heLibraryTagMapper.deleteHeLibraryTagById(heLibraryTag.getId()); - } - } - } - - //瀵圭瀹よ繘琛屽鐞� - for (TempDetpRelevance tempDetpRelevance : heLibraryVO.getTempDetpRelevances()) { - if (tempDetpRelevance.getId() == null) { - //鏂板 - tempDetpRelevance.setTempid(heLibrary.getId()); - tempDetpRelevance.setType(3L); - tempDetpRelevanceMapper.insertTempDetpRelevance(tempDetpRelevance); - } else { - tempDetpRelevanceMapper.updateTempDetpRelevance(tempDetpRelevance); - } - } - - return i; + return heLibrary.getId().intValue(); } @Override -- Gitblit v1.9.3