From 1492966c8a022c8fececfd363b7f234fe3d795c8 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期六, 30 八月 2025 17:50:26 +0800
Subject: [PATCH] crm设备管理

---
 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