From b7ba43ae6ef3205be7a0697044f1a38ff3c9b952 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期二, 14 十月 2025 18:31:57 +0800
Subject: [PATCH] bug修改
---
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