buyer-api/src/main/java/cn/lili/controller/lmk/MemberCustomerTagController.java
New file @@ -0,0 +1,55 @@ package cn.lili.controller.lmk; import cn.lili.base.Result; import cn.lili.modules.lmk.domain.form.MemberCustomerTagForm; import cn.lili.modules.lmk.domain.query.MemberCustomerTagQuery; import cn.lili.modules.lmk.service.MemberCustomerTagService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; /** * lmk-shop-java * 会员自己设置标签 * * @author : zxl * @date : 2025-07-21 10:51 **/ @RestController @RequiredArgsConstructor @Api(value = "会员自己设置标签", tags = "会员自己设置标签") @RequestMapping("/buyer/lmk/memberTag") public class MemberCustomerTagController { private final MemberCustomerTagService memberCustomerTagService; @PostMapping("/add") public Result add(@RequestBody @Valid MemberCustomerTagForm form){ return memberCustomerTagService.add(form); } @PutMapping("/update") public Result update(MemberCustomerTagForm form){ return memberCustomerTagService.update(form); } @GetMapping("/page") @ApiOperation(value = "分页会员标签详情", notes = "分页会员标签详情") public Result page(MemberCustomerTagQuery query){ return memberCustomerTagService.page(query); } @GetMapping("/detail") @ApiOperation(value = "会员标签详情", notes = "会员标签详情") public Result detail(){ return memberCustomerTagService.detail(); } @DeleteMapping("/remove/{id}") public Result remove(@PathVariable("id") String id){ return memberCustomerTagService.remove(id); } } framework/src/main/java/cn/lili/modules/lmk/domain/entity/MemberCustomerTag.java
New file @@ -0,0 +1,24 @@ 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; /** * lmk-shop-java * 会员自定义标签 * @author : zxl * @date : 2025-07-21 13:40 **/ @Data @TableName("lmk_member_customer_tag") public class MemberCustomerTag extends BaseEntity { @TableField("tag_name") private String tagName; @TableField("member_id") private String memberId; } framework/src/main/java/cn/lili/modules/lmk/domain/form/MemberCustomerTagForm.java
New file @@ -0,0 +1,35 @@ 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.MemberCustomerTag; import lombok.Data; import lombok.NonNull; import org.springframework.beans.BeanUtils; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; /** * lmk-shop-java * 会员自己设置标签表单 * * @author : zxl * @date : 2025-07-21 12:02 **/ @Data public class MemberCustomerTagForm extends AbsForm { @NotBlank(message = "标签名不能为空", groups = {Add.class, Update.class}) @Size(max = 8, message = "标签长度不能超过8个字符") private String tagName; public static MemberCustomerTag getEntity( @NonNull MemberCustomerTagForm form,MemberCustomerTag entity){ if (entity == null){ entity = new MemberCustomerTag(); } BeanUtils.copyProperties(form,entity); return entity; } } framework/src/main/java/cn/lili/modules/lmk/domain/query/MemberCustomerTagQuery.java
New file @@ -0,0 +1,15 @@ package cn.lili.modules.lmk.domain.query; import cn.lili.base.AbsQuery; import lombok.Data; /** * lmk-shop-java * * @author : zxl * @date : 2025-07-21 14:21 **/ @Data public class MemberCustomerTagQuery extends AbsQuery { } framework/src/main/java/cn/lili/modules/lmk/mapper/MemberCustomerTagMapper.java
New file @@ -0,0 +1,17 @@ package cn.lili.modules.lmk.mapper; import cn.lili.modules.lmk.domain.entity.MemberCustomerTag; import cn.lili.modules.lmk.domain.query.MemberCustomerTagQuery; 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; /** * */ @Mapper public interface MemberCustomerTagMapper extends BaseMapper<MemberCustomerTag> { IPage getPage(IPage page,@Param("query") MemberCustomerTagQuery query); } framework/src/main/java/cn/lili/modules/lmk/service/MemberCustomerTagService.java
New file @@ -0,0 +1,50 @@ package cn.lili.modules.lmk.service; import cn.lili.base.Result; import cn.lili.modules.lmk.domain.entity.MemberCustomerTag; import cn.lili.modules.lmk.domain.form.MemberCustomerTagForm; import cn.lili.modules.lmk.domain.query.MemberCustomerTagQuery; import com.baomidou.mybatisplus.extension.service.IService; public interface MemberCustomerTagService extends IService<MemberCustomerTag> { /** * 会员新增自定义标签 * @return */ Result add(MemberCustomerTagForm form); /** * 会员修改自定义标签 * @return */ Result update(MemberCustomerTagForm form); /** * 会员删除自定义标签 * @param id * @return */ Result remove(String id); /** * 分页获得会员自定义标签 * query * @return */ Result page(MemberCustomerTagQuery query); /** * 获得会员自定义标签 * query * @return */ Result detail(); /** * 获得会员自定义标签通过id * @param id 会员id * @return */ Result detailById(String id); } framework/src/main/java/cn/lili/modules/lmk/service/impl/MemberCustomerTagServiceImpl.java
New file @@ -0,0 +1,95 @@ package cn.lili.modules.lmk.service.impl; import cn.hutool.core.lang.Assert; import cn.lili.base.Result; import cn.lili.common.exception.ServiceException; import cn.lili.common.security.context.UserContext; import cn.lili.modules.lmk.domain.entity.MemberCustomerTag; import cn.lili.modules.lmk.domain.form.MemberCustomerTagForm; import cn.lili.modules.lmk.domain.query.MemberCustomerTagQuery; import cn.lili.modules.lmk.mapper.MemberCustomerTagMapper; import cn.lili.modules.lmk.service.MemberCustomerTagService; 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.springframework.stereotype.Service; import java.util.List; /** * lmk-shop-java * 会员自定义标签实现类 * @author : zxl * @date : 2025-07-21 13:58 **/ @Service public class MemberCustomerTagServiceImpl extends ServiceImpl<MemberCustomerTagMapper, MemberCustomerTag> implements MemberCustomerTagService { public static long customerTagCount = 5; @Override public Result add(MemberCustomerTagForm form) { String memberId = UserContext.getCurrentUser().getId(); if (memberId == null) { throw new ServiceException("用户信息异常,请重试"); } //用户最多可设置5个自定义标签 后续若要做成动态,可以做成系统标量 long count = new LambdaQueryChainWrapper<>(baseMapper) .eq(MemberCustomerTag::getMemberId, memberId) .eq(MemberCustomerTag::getDeleteFlag,false) .count(); if (count >= customerTagCount){ return Result.error("已达到自定义标签最大数量"); } System.out.println(form); MemberCustomerTag entity = MemberCustomerTagForm.getEntity(form,null); entity.setMemberId(memberId); baseMapper.insert(entity); return Result.ok("添加成功"); } @Override public Result update(MemberCustomerTagForm form) { MemberCustomerTag entity = baseMapper.selectById(form.getId()); Assert.notNull(entity,"记录不存在"); baseMapper.updateById(entity); return Result.ok("修改成功"); } @Override public Result remove(String id) { baseMapper.deleteById(id); return Result.ok("删除成功"); } @Override public Result page(MemberCustomerTagQuery query) { IPage<MemberCustomerTag> page = PageUtil.getPage(query,MemberCustomerTag.class); baseMapper.getPage(page,query); return Result.ok().data(page.getRecords()).total(page.getTotal()); } @Override public Result detail() { String memberId = UserContext.getCurrentUser().getId(); if (memberId == null) { throw new ServiceException("用户信息异常,请重试"); } List<MemberCustomerTag> list = new LambdaQueryChainWrapper<>(baseMapper) .eq(MemberCustomerTag::getMemberId,memberId) .eq(MemberCustomerTag::getDeleteFlag,false) .list(); return Result.ok().data(list); } @Override public Result detailById(String id) { List<MemberCustomerTag> list = new LambdaQueryChainWrapper<>(baseMapper) .eq(MemberCustomerTag::getMemberId,id) .eq(MemberCustomerTag::getDeleteFlag,false) .list(); return Result.ok().data(list); } } framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java
@@ -51,6 +51,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.rocketmq.spring.core.RocketMQTemplate; @@ -511,7 +512,7 @@ //传递修改会员信息 BeanUtil.copyProperties(managerMemberEditDTO, member); this.updateById(member); if (managerMemberEditDTO.getTags() != null) { if (managerMemberEditDTO.getTags() != null && !CollectionUtils.isEmpty(managerMemberEditDTO.getTags())) { MemberTagForm memberTagForm = new MemberTagForm(); memberTagForm.setMemberId(member.getId()); memberTagForm.setTagIds(managerMemberEditDTO.getTags()); framework/src/main/resources/mapper/lmk/MemberCustomerTag.xml
New file @@ -0,0 +1,22 @@ <?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.MemberCustomerTagMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.entity.MemberCustomerTag"> <id property="id" column="id"/> <result column="tag_name" property="tagName" /> <result column="member_id" property="memberId" /> </resultMap> <select id="getPage" resultMap="BaseResultMap"> SELECT LMCT.id, LMCT.memberId, LMCT.tag_name FROM lmk_member_customer_tag LMCT WHERE LMCT.delete_flag = 0 AND LMCT.member_id = #{query.memberId} </select> </mapper> manager-api/src/main/java/cn/lili/controller/lmk/MemberCustomerTagController.java
New file @@ -0,0 +1,45 @@ package cn.lili.controller.lmk; import cn.lili.base.Result; import cn.lili.modules.lmk.domain.query.MemberCustomerTagQuery; import cn.lili.modules.lmk.service.MemberCustomerTagService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * lmk-shop-java * * @author : zxl * @date : 2025-07-21 15:54 **/ @RestController @RequiredArgsConstructor @Api(value = "会员自定义标签", tags = "会员自定义标签") @RequestMapping("/manager/memberCustomerTag/") public class MemberCustomerTagController { private final MemberCustomerTagService memberCustomerTagService; @GetMapping("/page") @ApiOperation(value = "会员标签详情", notes = "会员标签详情") public Result page(MemberCustomerTagQuery query){ return memberCustomerTagService.page(query); } @GetMapping("/detail") @ApiOperation(value = "会员标签详情", notes = "会员标签详情") public Result detail(){ return memberCustomerTagService.detail(); } @GetMapping("/detail/{id}") @ApiOperation(value = "通过id获取会员标签详情", notes = "通过id获取会员标签详情") public Result detailById(@PathVariable String id){ return memberCustomerTagService.detailById(id); } } seller-api/src/main/java/cn/lili/controller/goods/DraftGoodsStoreController.java
@@ -5,12 +5,15 @@ import cn.lili.common.exception.ServiceException; import cn.lili.common.security.OperationalJudgment; import cn.lili.common.security.context.UserContext; import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.goods.entity.dos.DraftGoods; import cn.lili.modules.goods.entity.dto.DraftGoodsDTO; import cn.lili.modules.goods.entity.dto.DraftGoodsSearchParams; import cn.lili.modules.goods.entity.vos.DraftGoodsVO; import cn.lili.modules.goods.service.DraftGoodsService; import cn.lili.utils.COSUtil; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -31,14 +34,23 @@ public class DraftGoodsStoreController { @Autowired private DraftGoodsService draftGoodsService; @Autowired private COSUtil cosUtil; @ApiOperation(value = "分页获取草稿商品列表") @GetMapping(value = "/page") public ResultMessage<IPage<DraftGoods>> getDraftGoodsByPage(DraftGoodsSearchParams searchParams) { String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); searchParams.setStoreId(storeId); return ResultUtil.data(draftGoodsService.getDraftGoods(searchParams)); IPage<DraftGoods> page = draftGoodsService.getDraftGoods(searchParams); page.getRecords().forEach(item ->{ if (StringUtils.isNotBlank(item.getOriginal())&&!item.getOriginal().contains("http")) { item.setOriginal(cosUtil.getPreviewUrl(item.getOriginal())); } }); return ResultUtil.data(page); } @ApiOperation(value = "获取草稿商品") seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java
@@ -101,7 +101,13 @@ //获取当前登录商家账号 String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); goodsSearchParams.setStoreId(storeId); return ResultUtil.data(goodsSkuService.getGoodsSkuByPage(goodsSearchParams)); IPage<GoodsSku> page = goodsSkuService.getGoodsSkuByPage(goodsSearchParams); page.getRecords().forEach(item ->{ if (StringUtils.isNotBlank(item.getThumbnail())&&!item.getThumbnail().contains("http")) { item.setThumbnail(cosUtil.getPreviewUrl(item.getThumbnail())); } }); return ResultUtil.data(page); } @ApiOperation(value = "分页获取库存告警商品列表") seller-api/src/main/java/cn/lili/controller/order/AfterSaleStoreController.java
@@ -4,6 +4,7 @@ import cn.lili.common.enums.ResultUtil; import cn.lili.common.security.OperationalJudgment; import cn.lili.common.security.context.UserContext; import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.order.aftersale.entity.dos.AfterSale; import cn.lili.modules.order.aftersale.entity.vo.AfterSaleSearchParams; @@ -11,6 +12,7 @@ import cn.lili.modules.order.aftersale.service.AfterSaleService; import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO; import cn.lili.modules.system.entity.vo.Traces; import cn.lili.utils.COSUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -36,6 +38,8 @@ @Autowired private AfterSaleService afterSaleService; @Autowired private COSUtil cosUtil; @ApiOperation(value = "查看售后服务详情") @ApiImplicitParam(name = "sn", value = "售后单号", required = true, paramType = "path") @@ -50,7 +54,16 @@ public ResultMessage<IPage<AfterSaleVO>> getByPage(AfterSaleSearchParams searchParams) { String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); searchParams.setStoreId(storeId); return ResultUtil.data(afterSaleService.getAfterSalePages(searchParams)); IPage<AfterSaleVO> page = afterSaleService.getAfterSalePages(searchParams); page.getRecords().forEach(afterSale -> { String goodsImage = afterSale.getGoodsImage(); if (StringUtils.isNotBlank(goodsImage)&&!goodsImage.contains("http")) { afterSale.setGoodsImage(cosUtil.getPreviewUrl(goodsImage)); } }); return ResultUtil.data(page); } @ApiOperation(value = "获取导出售后服务列表列表")