From a40429e0df56c94fecd29dbfb4c99cf2d393a1a8 Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期五, 05 九月 2025 11:14:09 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/haizhentong --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsTypeServiceImpl.java | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsTypeServiceImpl.java index 8f48e2c..6ca11a2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsTypeServiceImpl.java @@ -1,10 +1,16 @@ package com.ruoyi.system.service.impl; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.common.basic.PageInfo; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.model.TErpGoodsType; import com.ruoyi.system.mapper.TErpGoodsTypeMapper; +import com.ruoyi.system.query.TErpGoodsTypeQuery; import com.ruoyi.system.service.TErpGoodsTypeService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; + +import java.util.List; /** * <p> @@ -16,5 +22,22 @@ */ @Service public class TErpGoodsTypeServiceImpl extends ServiceImpl<TErpGoodsTypeMapper, TErpGoodsType> implements TErpGoodsTypeService { + @Override + public boolean isExit(TErpGoodsType dto) { + if(StringUtils.isNotEmpty(dto.getId())){ + // 修改 + return this.count(Wrappers.lambdaQuery(TErpGoodsType.class).ne(TErpGoodsType::getId, dto.getId()).eq(TErpGoodsType::getTypeName, dto.getTypeName())) > 0; + }else { + // 新增 + return this.count(Wrappers.lambdaQuery(TErpGoodsType.class).eq(TErpGoodsType::getTypeName, dto.getTypeName())) > 0; + } + } + @Override + public PageInfo<TErpGoodsType> pageList(TErpGoodsTypeQuery query) { + PageInfo<TErpGoodsType> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); + List<TErpGoodsType> list = this.baseMapper.pageList(query,pageInfo); + pageInfo.setRecords(list); + return pageInfo; + } } -- Gitblit v1.7.1