From aa621ecbbc0147cabdb9d1853a304ac57328fd20 Mon Sep 17 00:00:00 2001 From: Joshi <3040996759@qq.com> Date: Wed, 13 Aug 2025 17:24:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(service):=20=E4=B8=BA=20insertByBoDetail?= =?UTF-8?q?=20=E6=96=B9=E6=B3=95=E6=B7=BB=E5=8A=A0=E4=BA=8B=E5=8A=A1?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 WmsFinancialDocumentServiceImpl 类中的 insertByBoDetail 方法上添加了 @Transactional 注解 - 这个修改确保了在插入财务文档时,操作会在一个数据库事务中执行,提高了数据的一致性和可靠性 --- .../mapper/WmsFinancialDocumentMapper.java | 3 +- .../impl/WmsFinancialDocumentServiceImpl.java | 30 ++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/klp-wms/src/main/java/com/klp/mapper/WmsFinancialDocumentMapper.java b/klp-wms/src/main/java/com/klp/mapper/WmsFinancialDocumentMapper.java index 8cc55e4a..a9531d44 100644 --- a/klp-wms/src/main/java/com/klp/mapper/WmsFinancialDocumentMapper.java +++ b/klp-wms/src/main/java/com/klp/mapper/WmsFinancialDocumentMapper.java @@ -1,6 +1,7 @@ package com.klp.mapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.klp.domain.WmsFinancialDocument; import com.klp.domain.vo.WmsFinancialDocumentVo; @@ -15,5 +16,5 @@ import org.apache.ibatis.annotations.Param; */ public interface WmsFinancialDocumentMapper extends BaseMapperPlus { - Page selectVoPageDetail(Page build,@Param("ew") LambdaQueryWrapper lqw); + Page selectVoPageDetail(Page build,@Param("ew") QueryWrapper lqw); } diff --git a/klp-wms/src/main/java/com/klp/service/impl/WmsFinancialDocumentServiceImpl.java b/klp-wms/src/main/java/com/klp/service/impl/WmsFinancialDocumentServiceImpl.java index b7a824eb..ebf5d32d 100644 --- a/klp-wms/src/main/java/com/klp/service/impl/WmsFinancialDocumentServiceImpl.java +++ b/klp-wms/src/main/java/com/klp/service/impl/WmsFinancialDocumentServiceImpl.java @@ -1,6 +1,7 @@ package com.klp.service.impl; import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.klp.common.core.page.TableDataInfo; import com.klp.common.core.domain.PageQuery; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -59,11 +60,38 @@ public class WmsFinancialDocumentServiceImpl implements IWmsFinancialDocumentSer */ @Override public TableDataInfo queryPageListDetail(WmsFinancialDocumentBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); + QueryWrapper lqw = buildQueryWrapperDetail(bo); Page result = baseMapper.selectVoPageDetail(pageQuery.build(), lqw); return TableDataInfo.build(result); } + private QueryWrapper buildQueryWrapperDetail(WmsFinancialDocumentBo bo) { + Map params = bo.getParams(); + QueryWrapper qw = Wrappers.query(); + // 添加逻辑删除条件 + qw.eq("wfd.del_flag", 0); + // 添加查询条件 + if (StringUtils.isNotBlank(bo.getDocNo())) { + qw.eq("wfd.doc_no", bo.getDocNo()); + } + if (StringUtils.isNotBlank(bo.getDocType())) { + qw.eq("wfd.doc_type", bo.getDocType()); + } + if (bo.getDocDate() != null) { + qw.eq("wfd.doc_date", bo.getDocDate()); + } + if (bo.getAmount() != null) { + qw.eq("wfd.amount", bo.getAmount()); + } + if (bo.getRelatedOrderId() != null) { + qw.eq("wfd.related_order_id", bo.getRelatedOrderId()); + } + if (StringUtils.isNotBlank(bo.getStatus())) { + qw.eq("wfd.status", bo.getStatus()); + } + return qw; + } + /**