diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetServiceImpl.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetServiceImpl.java index 2e42bfa5..2744dda9 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetServiceImpl.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.bs.service.quotationsheet; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapplytrip.ExpenseApplyTripDO; import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetdetail.QuotationSheetDetailDO; import cn.iocoder.yudao.module.bs.service.quotationsheetdetail.QuotationSheetDetailService; import cn.iocoder.yudao.module.bs.service.quotationsheetdetail.QuotationSheetDetailServiceImpl; @@ -41,13 +42,14 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl 0){ //中间表插入数据 - createReqVO.getQuotationDetails().forEach(quotationSheetDetail -> { - quotationSheetDetail.setCompanyId(quotationSheet.getId()); - }); + for (QuotationSheetDetailDO quotationSheetDetailDO : createReqVO.getQuotationDetails()) { + quotationSheetDetailDO.setCompanyId(quotationSheet.getId()); + } + quotationSheetDetailService.saveBatch(createReqVO.getQuotationDetails()); + } return quotationSheet.getId(); } @@ -57,20 +59,17 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl quotationSheetDetailDOList = - quotationSheetDetailService.list(Wrappers. lambdaQuery() - .eq(QuotationSheetDetailDO::getCompanyId,updateReqVO.getId()).eq(BaseDO::getDeleted,0)); - if (quotationSheetDetailDOList.size() > 0){ - quotationSheetDetailService.saveBatch(quotationSheetDetailDOList); - } + quotationSheetDetailService.remove(Wrappers. lambdaQuery() + .eq(QuotationSheetDetailDO::getCompanyId,updateReqVO.getId()).eq(BaseDO::getDeleted,0)); // 更新 QuotationSheetDO updateObj = QuotationSheetConvert.INSTANCE.convert(updateReqVO); - quotationSheetMapper.updateById(updateObj); + saveOrUpdate(updateObj); if (updateReqVO.getQuotationDetails().size() > 0){ //中间表插入数据 updateReqVO.getQuotationDetails().forEach(quotationSheetDetail -> { quotationSheetDetail.setCompanyId(updateObj.getId()); }); + quotationSheetDetailService.saveBatch(updateReqVO.getQuotationDetails()); } }