From af90980f33ef5bc3b390b64cf47097b2731c01fb Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 10 十月 2025 09:09:55 +0800
Subject: [PATCH] 商店标签
---
framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreTagQuery.java | 18 +
framework/src/main/java/cn/lili/modules/lmk/service/StoreTagService.java | 4
framework/src/main/java/cn/lili/modules/lmk/domain/entity/StoreTag.java | 27 +
framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreTagRefVO.java | 31 ++
framework/src/main/resources/mapper/lmk/StoreTagRefMapper.xml | 19 +
framework/src/main/java/cn/lili/modules/lmk/mapper/StoreTagMapper.java | 34 ++
framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreTagServiceImpl.java | 129 +++++++++
framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreTagRefQuery.java | 17 +
framework/src/main/resources/mapper/lmk/StoreTagMapper.xml | 55 +++
framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreTagForm.java | 40 ++
framework/src/main/java/cn/lili/modules/lmk/service/StoreTagRefService.java | 64 ++++
framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreTagRefServiceImpl.java | 129 +++++++++
framework/src/main/java/cn/lili/modules/lmk/domain/entity/StoreTagRef.java | 28 ++
framework/src/main/java/cn/lili/modules/lmk/mapper/StoreTagRefMapper.java | 39 ++
framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreTagRefForm.java | 43 +++
framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreTagVO.java | 39 ++
manager-api/src/main/java/cn/lili/controller/lmk/StoreTagController.java | 95 ++++++
17 files changed, 809 insertions(+), 2 deletions(-)
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/entity/StoreTag.java b/framework/src/main/java/cn/lili/modules/lmk/domain/entity/StoreTag.java
new file mode 100644
index 0000000..fe30d34
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/entity/StoreTag.java
@@ -0,0 +1,27 @@
+package cn.lili.modules.lmk.domain.entity;
+
+import cn.lili.mybatis.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import lombok.Data;
+
+/**
+ *
+ *
+ * @author zxl
+ * @since 2025-10-09
+ */
+@Data
+@TableName("lmk_store_tag")
+public class StoreTag extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableField("tag_name")
+ /** 鏍囩鍚嶇О */
+ private String tagName;
+
+
+
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/entity/StoreTagRef.java b/framework/src/main/java/cn/lili/modules/lmk/domain/entity/StoreTagRef.java
new file mode 100644
index 0000000..afea834
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/entity/StoreTagRef.java
@@ -0,0 +1,28 @@
+package cn.lili.modules.lmk.domain.entity;
+
+import cn.lili.mybatis.BaseEntity;
+import cn.lili.mybatis.BaseIdEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * 瑙嗛鏍囩涓棿琛�
+ *
+ * @author xp
+ * @since 2025-05-19
+ */
+@Data
+@TableName("lmk_store_tag_ref")
+public class StoreTagRef extends BaseEntity {
+
+ @TableField("store_id")
+ /** 瑙嗛id */
+ private String storeId;
+
+ @TableField("store_tag_id")
+ /** 瑙嗛鏍囩id */
+ private String storeTagId;
+
+
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreTagForm.java b/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreTagForm.java
new file mode 100644
index 0000000..710f7db
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreTagForm.java
@@ -0,0 +1,40 @@
+package cn.lili.modules.lmk.domain.form;
+
+import cn.lili.base.AbsForm;
+import cn.lili.group.Add;
+import cn.lili.group.Update;
+import cn.lili.modules.lmk.domain.entity.StoreTag;
+import org.springframework.beans.BeanUtils;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import org.springframework.lang.NonNull;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+/**
+ * 琛ㄥ崟
+ *
+ * @author zxl
+ * @since 2025-10-09
+ */
+@Data
+@ApiModel(value = "StoreTag琛ㄥ崟", description = "琛ㄥ崟")
+public class StoreTagForm extends AbsForm {
+
+
+ @NotBlank(message = "鏍囩鍚嶄笉鑳戒负绌�", groups = {Add.class, Update.class})
+ @ApiModelProperty("鏍囩鍚�")
+ private String tagName;
+
+
+ public static StoreTag getEntityByForm(@NonNull StoreTagForm form, StoreTag entity) {
+ if(entity == null) {
+ entity = new StoreTag();
+ }
+ BeanUtils.copyProperties(form, entity);
+ return entity;
+ }
+
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreTagRefForm.java b/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreTagRefForm.java
new file mode 100644
index 0000000..d082e95
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreTagRefForm.java
@@ -0,0 +1,43 @@
+package cn.lili.modules.lmk.domain.form;
+
+import cn.lili.base.AbsForm;
+import cn.lili.group.Add;
+import cn.lili.group.Update;
+import cn.lili.modules.lmk.domain.entity.StoreTagRef;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.beans.BeanUtils;
+import org.springframework.lang.NonNull;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * 瀹㈡埛鏍囩涓棿琛ㄨ〃鍗�
+ *
+ * @author zxl
+ * @since 2025-05-14
+ */
+@Data
+@ApiModel(value = "LmkStoreTagRef琛ㄥ崟", description = "瀹㈡埛鏍囩涓棿琛ㄨ〃鍗�")
+public class StoreTagRefForm extends AbsForm {
+
+
+ @NotNull(message = "涓嶈兘涓虹┖", groups = {Add.class, Update.class})
+ @ApiModelProperty("瀹㈡埛id")
+ private String storeId;
+
+ @NotBlank(message = "涓嶈兘涓虹┖", groups = {Add.class, Update.class})
+ @ApiModelProperty("鏍囩id")
+ private String storeTagId;
+
+ public static StoreTagRef getEntityByForm(@NonNull StoreTagRefForm form, StoreTagRef entity) {
+ if(entity == null) {
+ entity = new StoreTagRef();
+ }
+ BeanUtils.copyProperties(form, entity);
+ return entity;
+ }
+
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreTagQuery.java b/framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreTagQuery.java
new file mode 100644
index 0000000..798c15d
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreTagQuery.java
@@ -0,0 +1,18 @@
+package cn.lili.modules.lmk.domain.query;
+
+import cn.lili.base.AbsQuery;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+ * 鏌ヨ
+ *
+ * @author zxl
+ * @since 2025-05-14
+ */
+@Data
+@ApiModel(value = "StoreTagQuery鍙傛暟", description = "鏌ヨ鍙傛暟")
+public class StoreTagQuery extends AbsQuery {
+ private String tagName;
+}
+
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreTagRefQuery.java b/framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreTagRefQuery.java
new file mode 100644
index 0000000..a09ba5b
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreTagRefQuery.java
@@ -0,0 +1,17 @@
+package cn.lili.modules.lmk.domain.query;
+
+import cn.lili.base.AbsQuery;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+ * 鏌ヨ
+ *
+ * @author zxl
+ * @since 2025-05-14
+ */
+@Data
+@ApiModel(value = "StoreTagQuery鍙傛暟", description = "鏌ヨ鍙傛暟")
+public class StoreTagRefQuery extends AbsQuery {
+}
+
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreTagRefVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreTagRefVO.java
new file mode 100644
index 0000000..e68d165
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreTagRefVO.java
@@ -0,0 +1,31 @@
+package cn.lili.modules.lmk.domain.vo;
+
+import cn.lili.base.AbsVo;
+import cn.lili.modules.lmk.domain.entity.StoreTagRef;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.beans.BeanUtils;
+import org.springframework.lang.NonNull;
+
+@Data
+@ApiModel(value = "瀹㈡埛鏍囩涓棿琛ㄥ搷搴旀暟鎹�", description = "瀹㈡埛鏍囩涓棿琛ㄥ搷搴旀暟鎹�")
+public class StoreTagRefVO extends AbsVo {
+ /** */
+ @ApiModelProperty("")
+ private String storeId;
+
+ /** */
+ @ApiModelProperty("")
+ private String storeTagId;
+
+ private String tagName;
+
+ public static StoreTagRefVO getVoByEntity(@NonNull StoreTagRef entity, StoreTagRefVO vo) {
+ if(vo == null) {
+ vo = new StoreTagRefVO();
+ }
+ BeanUtils.copyProperties(entity, vo);
+ return vo;
+ }
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreTagVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreTagVO.java
new file mode 100644
index 0000000..6f0b298
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreTagVO.java
@@ -0,0 +1,39 @@
+package cn.lili.modules.lmk.domain.vo;
+
+
+import java.util.List;
+
+import cn.lili.base.AbsVo;
+import cn.lili.modules.lmk.domain.entity.StoreTag;
+import org.springframework.lang.NonNull;
+import org.springframework.beans.BeanUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+/**
+ * 灞曠ず
+ *
+ * @author zxl
+ * @since 2025-10-09
+ */
+@Data
+@ApiModel(value = "鍝嶅簲鏁版嵁", description = "鍝嶅簲鏁版嵁")
+public class StoreTagVO extends AbsVo {
+
+ /** 鏍囩鍚� */
+ @ApiModelProperty("鏍囩鍚�")
+ private String tagName;
+
+ private Boolean deleteFlag;
+
+ public static StoreTagVO getVoByEntity(@NonNull StoreTag entity, StoreTagVO vo) {
+ if(vo == null) {
+ vo = new StoreTagVO();
+ }
+ BeanUtils.copyProperties(entity, vo);
+ return vo;
+ }
+
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/mapper/StoreTagMapper.java b/framework/src/main/java/cn/lili/modules/lmk/mapper/StoreTagMapper.java
new file mode 100644
index 0000000..e4c6703
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/mapper/StoreTagMapper.java
@@ -0,0 +1,34 @@
+package cn.lili.modules.lmk.mapper;
+
+
+import cn.lili.modules.lmk.domain.entity.StoreTag;
+import cn.lili.modules.lmk.domain.query.StoreTagQuery;
+import cn.lili.modules.lmk.domain.vo.StoreTagVO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import java.util.List;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * Mapper 鎺ュ彛
+ *
+ * @author zxl
+ * @since 2025-10-09
+ */
+@Mapper
+public interface StoreTagMapper extends BaseMapper<StoreTag> {
+
+ /**
+ * id鏌ユ壘
+ * @param id
+ * @return
+ */
+ StoreTagVO getById(String id);
+
+ /**
+ * 鍒嗛〉
+ */
+ IPage getPage(IPage page, @Param("query") StoreTagQuery query);
+
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/mapper/StoreTagRefMapper.java b/framework/src/main/java/cn/lili/modules/lmk/mapper/StoreTagRefMapper.java
new file mode 100644
index 0000000..1ef7387
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/mapper/StoreTagRefMapper.java
@@ -0,0 +1,39 @@
+package cn.lili.modules.lmk.mapper;
+
+import cn.lili.modules.lmk.domain.entity.StoreTag;
+import cn.lili.modules.lmk.domain.entity.StoreTagRef;
+import cn.lili.modules.lmk.domain.query.StoreTagRefQuery;
+import cn.lili.modules.lmk.domain.vo.StoreTagRefVO;
+import cn.lili.modules.lmk.domain.vo.StoreTagVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Mapper 鎺ュ彛
+ *
+ * @author zxl
+ * @since 2025-05-14
+ */
+@Mapper
+public interface StoreTagRefMapper extends BaseMapper<StoreTagRef> {
+
+ /**
+ * id鏌ユ壘
+ * @param id
+ * @return
+ */
+ StoreTagRefVO getById(Integer id);
+
+ /**
+ * 鍒嗛〉
+ */
+ IPage getPage(IPage page, @Param("query") StoreTagRefQuery query);
+
+
+ List<StoreTagVO> getStoreTagVOList(String storeId);
+
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/StoreTagRefService.java b/framework/src/main/java/cn/lili/modules/lmk/service/StoreTagRefService.java
new file mode 100644
index 0000000..112efc9
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/StoreTagRefService.java
@@ -0,0 +1,64 @@
+package cn.lili.modules.lmk.service;
+
+
+import cn.lili.base.Result;
+import cn.lili.modules.lmk.domain.entity.StoreTagRef;
+import cn.lili.modules.lmk.domain.form.StoreTagRefForm;
+import cn.lili.modules.lmk.domain.query.CustomerTagRefQuery;
+import cn.lili.modules.lmk.domain.query.StoreTagRefQuery;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+public interface StoreTagRefService extends IService<StoreTagRef> {
+
+ /**
+ * 娣诲姞
+ * @param form
+ * @return
+ */
+ Result add(StoreTagRefForm form);
+
+ /**
+ * 淇敼
+ * @param form
+ * @return
+ */
+ Result update(StoreTagRefForm form);
+
+ /**
+ * 鎵归噺鍒犻櫎
+ * @param ids
+ * @return
+ */
+ Result remove(List<String> ids);
+
+ /**
+ * id鍒犻櫎
+ * @param id
+ * @return
+ */
+ Result removeById(String id);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param query
+ * @return
+ */
+ Result page(StoreTagRefQuery query);
+
+ /**
+ * 鏍规嵁id鏌ユ壘
+ * @param id
+ * @return
+ */
+ Result detail(Integer id);
+
+ /**
+ * 鍒楄〃
+ * @return
+ */
+ Result all();
+
+ Result getStoreTagsById(String storeId);
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/StoreTagService.java b/framework/src/main/java/cn/lili/modules/lmk/service/StoreTagService.java
index 4dbae87..2dffb79 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/StoreTagService.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/StoreTagService.java
@@ -56,11 +56,11 @@
* @param id
* @return
*/
- Result detail(Integer id);
+ Result detail(String id);
/**
* 鍒楄〃
* @return
*/
- Result all();
+ Result all(StoreTagQuery query);
}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreTagRefServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreTagRefServiceImpl.java
new file mode 100644
index 0000000..be2b494
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreTagRefServiceImpl.java
@@ -0,0 +1,129 @@
+package cn.lili.modules.lmk.service.impl;
+
+
+import cn.lili.base.Result;
+import cn.lili.modules.lmk.domain.entity.CustomerTagRef;
+import cn.lili.modules.lmk.domain.entity.StoreTagRef;
+import cn.lili.modules.lmk.domain.form.CustomerTagRefForm;
+import cn.lili.modules.lmk.domain.form.StoreTagRefForm;
+import cn.lili.modules.lmk.domain.query.CustomerTagRefQuery;
+import cn.lili.modules.lmk.domain.query.StoreTagRefQuery;
+import cn.lili.modules.lmk.domain.vo.CustomerTagRefVO;
+import cn.lili.modules.lmk.domain.vo.StoreTagRefVO;
+import cn.lili.modules.lmk.mapper.CustomerTagRefMapper;
+import cn.lili.modules.lmk.mapper.StoreTagRefMapper;
+import cn.lili.modules.lmk.service.StoreTagRefService;
+import cn.lili.utils.PageUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.util.Assert;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+@Service
+@RequiredArgsConstructor
+public class StoreTagRefServiceImpl extends ServiceImpl<StoreTagRefMapper, StoreTagRef> implements StoreTagRefService {
+
+ private final StoreTagRefMapper storeTagRefMapper;
+
+ /**
+ * 娣诲姞
+ * @param form
+ * @return
+ */
+ @Override
+ public Result add(StoreTagRefForm form) {
+ System.out.println(form);
+ StoreTagRef entity = StoreTagRefForm.getEntityByForm(form, null);
+ System.out.println(entity);
+ baseMapper.insert(entity);
+ return Result.ok("娣诲姞鎴愬姛");
+ }
+
+ /**
+ * 淇敼
+ * @param form
+ * @return
+ */
+ @Override
+ public Result update(StoreTagRefForm form) {
+ StoreTagRef entity = baseMapper.selectById(form.getId());
+
+ // 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊
+ Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
+ BeanUtils.copyProperties(form, entity);
+ baseMapper.updateById(entity);
+ return Result.ok("淇敼鎴愬姛");
+ }
+
+ /**
+ * 鎵归噺鍒犻櫎
+ * @param ids
+ * @return
+ */
+ @Override
+ public Result remove(List<String> ids) {
+ baseMapper.deleteBatchIds(ids);
+ return Result.ok("鍒犻櫎鎴愬姛");
+ }
+
+ /**
+ * id鍒犻櫎
+ * @param id
+ * @return
+ */
+ @Override
+ public Result removeById(String id) {
+ baseMapper.deleteById(id);
+ return Result.ok("鍒犻櫎鎴愬姛");
+ }
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param query
+ * @return
+ */
+ @Override
+ public Result page(StoreTagRefQuery query) {
+ IPage<StoreTagRefVO> page = PageUtil.getPage(query, StoreTagRefVO.class);
+ baseMapper.getPage(page, query);
+ return Result.ok().data(page.getRecords()).total(page.getTotal());
+ }
+
+ /**
+ * 鏍规嵁id鏌ユ壘
+ * @param id
+ * @return
+ */
+ @Override
+ public Result detail(Integer id) {
+ StoreTagRefVO vo = baseMapper.getById(id);
+ Assert.notNull(vo, "璁板綍涓嶅瓨鍦�");
+ return Result.ok().data(vo);
+ }
+
+ /**
+ * 鍒楄〃
+ * @return
+ */
+ @Override
+ public Result all() {
+ List<StoreTagRef> entities = baseMapper.selectList(null);
+ List<StoreTagRefVO> vos = entities.stream()
+ .map(entity -> StoreTagRefVO.getVoByEntity(entity, null))
+ .collect(Collectors.toList());
+ return Result.ok().data(vos);
+ }
+
+ @Override
+ public Result getStoreTagsById(String storeId) {
+ return Result.ok().data(baseMapper.getStoreTagVOList(storeId));
+ }
+
+
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreTagServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreTagServiceImpl.java
new file mode 100644
index 0000000..b5709aa
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreTagServiceImpl.java
@@ -0,0 +1,129 @@
+package cn.lili.modules.lmk.service.impl;
+
+import cn.lili.base.Result;
+import cn.lili.modules.lmk.domain.entity.StoreTag;
+import cn.lili.modules.lmk.domain.form.StoreTagForm;
+import cn.lili.modules.lmk.domain.query.StoreTagQuery;
+import cn.lili.modules.lmk.domain.vo.StoreTagVO;
+import cn.lili.modules.lmk.mapper.StoreTagMapper;
+import cn.lili.modules.lmk.service.StoreTagService;
+import cn.lili.utils.PageUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import org.apache.commons.collections.list.LazyList;
+import org.springframework.stereotype.Service;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.BeanUtils;
+import org.springframework.util.Assert;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 鏈嶅姟瀹炵幇绫�
+ *
+ * @author zxl
+ * @since 2025-10-09
+ */
+@Service
+@RequiredArgsConstructor
+public class StoreTagServiceImpl extends ServiceImpl<StoreTagMapper, StoreTag> implements StoreTagService {
+
+ private final StoreTagMapper storeTagMapper;
+
+ /**
+ * 娣诲姞
+ * @param form
+ * @return
+ */
+ @Override
+ public Result add(StoreTagForm form) {
+ StoreTag entity = StoreTagForm.getEntityByForm(form, null);
+ baseMapper.insert(entity);
+ return Result.ok("娣诲姞鎴愬姛");
+ }
+
+ /**
+ * 淇敼
+ * @param form
+ * @return
+ */
+ @Override
+ public Result update(StoreTagForm form) {
+ StoreTag entity = baseMapper.selectById(form.getId());
+
+ // 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊
+ Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
+ BeanUtils.copyProperties(form, entity);
+ baseMapper.updateById(entity);
+ return Result.ok("淇敼鎴愬姛");
+ }
+
+ /**
+ * 鎵归噺鍒犻櫎
+ * @param ids
+ * @return
+ */
+ @Override
+ public Result remove(List<String> ids) {
+ baseMapper.deleteBatchIds(ids);
+ return Result.ok("鍒犻櫎鎴愬姛");
+ }
+
+ /**
+ * id鍒犻櫎
+ * @param id
+ * @return
+ */
+ @Override
+ public Result removeById(String id) {
+ baseMapper.deleteById(id);
+ //鍒ゆ柇鏍囩鏄惁琚娇鐢�
+
+
+ return Result.ok("鍒犻櫎鎴愬姛");
+ }
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param query
+ * @return
+ */
+ @Override
+ public Result page(StoreTagQuery query) {
+ IPage<StoreTagVO> page = PageUtil.getPage(query, StoreTagVO.class);
+ baseMapper.getPage(page, query);
+ return Result.ok().data(page.getRecords()).total(page.getTotal());
+ }
+
+ /**
+ * 鏍规嵁id鏌ユ壘
+ * @param id
+ * @return
+ */
+ @Override
+ public Result detail(String id) {
+ StoreTagVO vo = baseMapper.getById(id);
+ Assert.notNull(vo, "璁板綍涓嶅瓨鍦�");
+ return Result.ok().data(vo);
+ }
+
+ /**
+ * 鍒楄〃
+ * @return
+ */
+ @Override
+ public Result all(StoreTagQuery query) {
+
+ List<StoreTag> entities = new LambdaQueryChainWrapper<>(baseMapper)
+ .like(StoreTag::getTagName,query.getTagName())
+ .list();
+ List<StoreTagVO> vos = entities.stream()
+ .map(entity -> StoreTagVO.getVoByEntity(entity, null))
+ .collect(Collectors.toList());
+ return Result.ok().data(vos);
+ }
+}
diff --git a/framework/src/main/resources/mapper/lmk/StoreTagMapper.xml b/framework/src/main/resources/mapper/lmk/StoreTagMapper.xml
new file mode 100644
index 0000000..ad00896
--- /dev/null
+++ b/framework/src/main/resources/mapper/lmk/StoreTagMapper.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.lili.modules.lmk.mapper.StoreTagMapper">
+
+ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+ <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.StoreTagVO">
+ <result column="tag_name" property="tagName" />
+ <result column="delete_flag" property="deleteFlag" />
+ <result column="update_time" property="updateTime" />
+ <result column="update_by" property="updateBy" />
+ <result column="create_time" property="createTime" />
+ <result column="create_by" property="createBy" />
+ </resultMap>
+
+
+
+
+
+
+
+ <select id="getById" resultMap="BaseResultMap">
+ SELECT
+ LST.tag_name,
+ LST.delete_flag,
+ LST.update_time,
+ LST.update_by,
+ LST.create_time,
+ LST.create_by,
+ LST.id
+ FROM
+ lmk_store_tag LST
+ WHERE
+ LST.id = #{id} AND LST.delete_flag = 0
+ </select>
+
+
+ <select id="getPage" resultMap="BaseResultMap">
+ SELECT
+ LST.tag_name,
+ LST.delete_flag,
+ LST.update_time,
+ LST.update_by,
+ LST.create_time,
+ LST.create_by,
+ LST.id
+ FROM
+ lmk_store_tag LST
+ WHERE
+ LST.delete_flag = 0
+ <if test="query.tagName != null and query.tagName !=''">
+ AND LST.tag_name LIKE CONCAT('%',#{query.tagName},'%')
+ </if>
+ </select>
+
+</mapper>
diff --git a/framework/src/main/resources/mapper/lmk/StoreTagRefMapper.xml b/framework/src/main/resources/mapper/lmk/StoreTagRefMapper.xml
new file mode 100644
index 0000000..f3885ea
--- /dev/null
+++ b/framework/src/main/resources/mapper/lmk/StoreTagRefMapper.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.lili.modules.lmk.mapper.StoreTagRefMapper">
+
+ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+ <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.StoreTagRefVO">
+ <id column="id" property="id"/>
+ <result column="tag_name" property="tagName" />
+ </resultMap>
+
+
+ <select id="getStoreTagVOList" resultMap="BaseResultMap">
+ select DISTINCT LSTR.id,LST.tag_name from lmk_store_tag_ref LSTR
+ INNER JOIN lmk_store_tag LST on LST.id = LSTR.store_tag_id
+ WHERE LSTR.store_id = #{storeId} AND LSTR.delete_flag = 0 AND LST.delete_flag = 0
+ </select>
+
+
+</mapper>
diff --git a/manager-api/src/main/java/cn/lili/controller/lmk/StoreTagController.java b/manager-api/src/main/java/cn/lili/controller/lmk/StoreTagController.java
new file mode 100644
index 0000000..996cfdc
--- /dev/null
+++ b/manager-api/src/main/java/cn/lili/controller/lmk/StoreTagController.java
@@ -0,0 +1,95 @@
+package cn.lili.controller.lmk;
+
+import cn.lili.base.Result;
+import cn.lili.group.Add;
+import cn.lili.group.Update;
+import cn.lili.modules.lmk.domain.form.StoreTagForm;
+import cn.lili.modules.lmk.domain.form.StoreTagRefForm;
+import cn.lili.modules.lmk.domain.query.StoreTagQuery;
+import cn.lili.modules.lmk.service.StoreTagRefService;
+import cn.lili.modules.lmk.service.StoreTagService;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import lombok.RequiredArgsConstructor;
+import java.util.List;
+import org.springframework.validation.annotation.Validated;
+import javax.validation.constraints.NotEmpty;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 鍓嶇鎺у埗鍣�
+ *
+ * @author zxl
+ * @since 2025-10-09
+ */
+@Validated
+@RequiredArgsConstructor
+@Api(value = "", tags = "绠$悊")
+@RestController
+@RequestMapping("/manager/lmk/store-tag")
+public class StoreTagController {
+
+ private final StoreTagService storeTagService;
+
+ private final StoreTagRefService storeTagRefService;
+
+ @PostMapping
+ @ApiOperation(value = "娣诲姞", notes = "娣诲姞")
+ public Result add(@RequestBody @Validated(Add.class) StoreTagForm form) {
+ return storeTagService.add(form);
+ }
+
+ @PutMapping
+ @ApiOperation(value = "淇敼", notes = "淇敼")
+ public Result update(@RequestBody @Validated(Update.class) StoreTagForm form) {
+ return storeTagService.update(form);
+ }
+
+ @DeleteMapping("/{id}")
+ @ApiOperation(value = "ID鍒犻櫎", notes = "ID鍒犻櫎")
+ public Result removeById(@PathVariable("id") String id) {
+ return storeTagService.removeById(id);
+ }
+
+ @DeleteMapping("/batch")
+ @ApiOperation(value = "鎵归噺鍒犻櫎", notes = "鎵归噺鍒犻櫎")
+ public Result remove(@RequestBody @NotEmpty(message = "璇烽�夋嫨鏁版嵁") List<String> ids) {
+ return storeTagService.remove(ids);
+ }
+
+ @GetMapping("/page")
+ @ApiOperation(value = "鍒嗛〉", notes = "鍒嗛〉")
+ public Result page(StoreTagQuery query) {
+ return storeTagService.page(query);
+ }
+
+ @GetMapping("/{id}")
+ @ApiOperation(value = "璇︽儏", notes = "璇︽儏")
+ public Result detail(@PathVariable("id") String id) {
+ return storeTagService.detail(id);
+ }
+
+ @GetMapping("/list")
+ @ApiOperation(value = "鍒楄〃", notes = "鍒楄〃")
+ public Result list(StoreTagQuery query) {
+ return storeTagService.all(query);
+ }
+
+ @PostMapping("/bind")
+ public Result bindTagByStore(@RequestBody StoreTagRefForm form) {
+ return storeTagRefService.add(form);
+ }
+
+ @GetMapping("/storeTags/{storeId}")
+ public Result getStoreTagsById(@PathVariable String storeId){
+ return storeTagRefService.getStoreTagsById(storeId);
+ }
+ @DeleteMapping("/delTagByStoreTagRefId/{id}")
+ public Result delTagByStoreTagRefId(@PathVariable String id) {
+ return storeTagRefService.removeById(id);
+
+ }
+}
\ No newline at end of file
--
Gitblit v1.8.0