小程序 页面修改
分享配置 轮播图配置
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.czg.service.market.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.market.entity.MkCarousel;
|
||||
|
||||
/**
|
||||
* 轮播图配置表 映射层。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2026-01-27
|
||||
*/
|
||||
public interface MkCarouselMapper extends BaseMapper<MkCarousel> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.czg.service.market.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.market.entity.MkShareBase;
|
||||
|
||||
/**
|
||||
* 分享奖励基础配置 映射层。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2026-01-27
|
||||
*/
|
||||
public interface MkShareBaseMapper extends BaseMapper<MkShareBase> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.czg.service.market.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.market.dto.MkCarouselDTO;
|
||||
import com.czg.system.entity.MiniAppPages;
|
||||
import com.czg.system.service.MiniAppPageService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.market.entity.MkCarousel;
|
||||
import com.czg.market.service.MkCarouselService;
|
||||
import com.czg.service.market.mapper.MkCarouselMapper;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 轮播图配置表 服务层实现。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2026-01-27
|
||||
*/
|
||||
@Service
|
||||
public class MkCarouselServiceImpl extends ServiceImpl<MkCarouselMapper, MkCarousel> implements MkCarouselService {
|
||||
@DubboReference
|
||||
private MiniAppPageService miniAppPageService;
|
||||
|
||||
@Override
|
||||
public List<MkCarousel> getCarousels(MkCarouselDTO mkCarouselDTO) {
|
||||
QueryWrapper queryWrapper = query().eq(MkCarousel::getShopId, mkCarouselDTO.getShopId())
|
||||
.eq(MkCarousel::getIsEnabled, mkCarouselDTO.getIsEnabled())
|
||||
.eq(MkCarousel::getIsShareable, mkCarouselDTO.getIsShareable())
|
||||
.orderBy(MkCarousel::getSort, false);
|
||||
if (StrUtil.isNotBlank(mkCarouselDTO.getName())) {
|
||||
queryWrapper.like(MkCarousel::getName, mkCarouselDTO.getName());
|
||||
}
|
||||
List<MkCarousel> list = list(queryWrapper);
|
||||
list.forEach(mkCarousel -> {
|
||||
MiniAppPages miniAppPages = miniAppPageService.getById(mkCarousel.getJumpPageId());
|
||||
if (miniAppPages != null) {
|
||||
mkCarousel.setJumpPagePath(miniAppPages.getPath());
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.czg.service.market.service.impl;
|
||||
|
||||
import com.czg.market.dto.ShopCouponDTO;
|
||||
import com.czg.market.service.ShopCouponService;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.market.entity.MkShareBase;
|
||||
import com.czg.market.service.MkShareBaseService;
|
||||
import com.czg.service.market.mapper.MkShareBaseMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 分享奖励基础配置 服务层实现。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2026-01-27
|
||||
*/
|
||||
@Service
|
||||
public class MkShareBaseServiceImpl extends ServiceImpl<MkShareBaseMapper, MkShareBase> implements MkShareBaseService {
|
||||
|
||||
@Resource
|
||||
private ShopCouponService shopCouponService;
|
||||
|
||||
@Override
|
||||
public MkShareBase getShareBase(Long shopId) {
|
||||
MkShareBase shareBase = getById(shopId);
|
||||
if (shareBase != null) {
|
||||
if (shareBase.getSharerCouponId() != null) {
|
||||
ShopCouponDTO sharerCoupon = shopCouponService.getCouponById(shareBase.getSharerCouponId());
|
||||
if (sharerCoupon != null) {
|
||||
shareBase.setSharerCouponName(sharerCoupon.getTitle());
|
||||
}
|
||||
}
|
||||
if (shareBase.getSharedUserCouponId() != null) {
|
||||
ShopCouponDTO shareUserCoupon = shopCouponService.getCouponById(shareBase.getSharedUserCouponId());
|
||||
if (shareUserCoupon != null) {
|
||||
shareBase.setSharedUserCouponName(shareUserCoupon.getTitle());
|
||||
}
|
||||
}
|
||||
}
|
||||
return shareBase;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="com.czg.service.market.mapper.MkCarouselMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="com.czg.service.market.mapper.MkShareBaseMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -12,7 +12,7 @@ import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.service.system.mapper.MiniAppPagesMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
|
||||
/**
|
||||
* 小程序页面路径 服务层实现。
|
||||
@@ -20,7 +20,7 @@ import org.springframework.stereotype.Service;
|
||||
* @author mac
|
||||
* @since 2025-02-12
|
||||
*/
|
||||
@Service
|
||||
@DubboService
|
||||
public class MiniAppPagesServiceImpl extends ServiceImpl<MiniAppPagesMapper, MiniAppPages> implements MiniAppPageService {
|
||||
|
||||
@Override
|
||||
@@ -46,6 +46,7 @@ public class MiniAppPagesServiceImpl extends ServiceImpl<MiniAppPagesMapper, Min
|
||||
|
||||
pages.setIcon(pagesDTO.getIcon());
|
||||
pages.setName(pagesDTO.getName());
|
||||
pages.setPath(pagesDTO.getPath());
|
||||
pages.setStatus(pagesDTO.getStatus());
|
||||
pages.setDescription(pagesDTO.getDescription());
|
||||
pages.setStatus(pagesDTO.getStatus());
|
||||
|
||||
Reference in New Issue
Block a user