轮播图和用户消息

This commit is contained in:
2026-02-03 18:09:03 +08:00
parent 8efaf2e92f
commit 849cf4c03e
58 changed files with 2474 additions and 55 deletions

View File

@@ -15,6 +15,7 @@ import org.springblade.modules.appFormal.manager.FormalAppBaseManager;
import org.springblade.modules.appFormal.manager.FormalAppCustomerManager;
import org.springblade.modules.appFormal.manager.FormalAppMallManager;
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
import org.springblade.modules.appFormal.vo.AppFormalBannerVO;
import org.springblade.modules.appFormal.vo.AppFormalMallSpuVO;
import org.springblade.modules.appFormal.vo.MallCategoryVO;
import org.springblade.modules.mall.pojo.vo.MallSpuVO;
@@ -39,7 +40,13 @@ public class FormalBaseController {
return R.data(appBaseManager.formalAppPrivacy());
}
@RateLimiter(value = "yichayilu:sms:send", param = "#request.getPhone()", max = 10, ttl = 12, timeUnit = TimeUnit.HOURS)
@Operation(summary = "用户协议")
@GetMapping("/formal-app-agreement")
public R<String> formalAppAgreement() {
return R.data(appBaseManager.formalAppAgreement());
}
@RateLimiter(value = "yichayilu:sms:send", param = "#request.getPhone()", max =3, ttl = 12, timeUnit = TimeUnit.HOURS)
@Operation(summary = "发送验证码")
@PostMapping("/send-sms-code")
public R<Boolean> sendSmsCode(@RequestBody CustomerSmsRequest request) {
@@ -66,5 +73,20 @@ public class FormalBaseController {
@Operation(summary = "获得主banner")
@GetMapping("/find-main-banner")
public R<List<AppFormalBannerVO>> findMainBanner() {
return R.data(appBaseManager.findMainBanner());
}
@Operation(summary = "获得商城banner")
@GetMapping("/find-mall-banner")
public R<List<AppFormalBannerVO>> findMallBanner() {
return R.data(appBaseManager.findMallBanner());
}
}

View File

@@ -15,6 +15,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.modules.appFormal.manager.FormalAppCustomerManager;
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
import org.springblade.modules.appFormal.request.UpdatePasswordRequest;
import org.springblade.modules.appFormal.vo.AppUserNoticeVO;
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
import org.springblade.modules.appFormal.vo.MallIntegralVO;
import org.springblade.modules.appFormal.vo.UserInfoVO;
@@ -81,4 +82,18 @@ public class FormalCustomerController {
return R.data(formalAppCustomerManager.findMallIntegralFlow(Condition.getPage(query), logVO, AuthUtil.getUserId()));
}
@Operation(summary = "查询用户通知")
@GetMapping("/find-user-notice-page")
public R<IPage<AppUserNoticeVO>> findUserNoticePage(Query query , AppUserNoticeVO userNotice) {
return R.data(formalAppCustomerManager.findUserNoticePage(Condition.getPage(query), userNotice, AuthUtil.getUserId()));
}
@Operation(summary = "查询用户通知")
@PostMapping("/read-user-notice")
public R<Boolean> readUserNotice(AppUserNoticeVO userNotice) {
return R.status(formalAppCustomerManager.readUserNotice(userNotice.getId()));
}
}

View File

@@ -40,14 +40,14 @@ public class FormalMallController {
@Operation(summary = "添加购物车")
@PostMapping("/add-cart")
public R<Long> addCart(@RequestBody MallCartRequest request) {
public R<AppFormalMallCartInfoVO> addCart(@RequestBody MallCartRequest request) {
return R.data(mallProductManager.addCart(request.setUserId(AuthUtil.getUserId())));
}
@Operation(summary = "添加购物车(创建订单之前调用)")
@PostMapping("/add-cart-to-order")
public R<Long> addCartToOrder(@RequestBody MallCartRequest request) {
public R<AppFormalMallCartInfoVO> addCartToOrder(@RequestBody MallCartRequest request) {
return R.data(mallProductManager.addCartToOrder(request.setUserId(AuthUtil.getUserId())));
}

View File

@@ -0,0 +1,28 @@
package org.springblade.modules.appFormal.convert;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.springblade.modules.appFormal.vo.AppFormalBannerVO;
import org.springblade.modules.appFormal.vo.AppUserNoticeVO;
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
import java.util.List;
/**
* @author jack
*/
@Mapper
public interface AppBaseConvert {
AppBaseConvert INSTANCE = Mappers.getMapper(AppBaseConvert.class);
List<AppFormalBannerVO> convertBannerListToVO(List<AppBannerEntity> bannerEntityList);
AppUserNoticeVO convertUserNoticePageToVO(UserNoticeEntity userNoticeEntity);
}

View File

@@ -9,14 +9,18 @@ import org.springblade.core.jwt.props.JwtProperties;
import org.springblade.core.oauth2.provider.OAuth2Request;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.appFormal.convert.AppBaseConvert;
import org.springblade.modules.appFormal.convert.AppUserInfoConvert;
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
import org.springblade.modules.appFormal.request.UpdatePasswordRequest;
import org.springblade.modules.appFormal.vo.AppFormalBannerVO;
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
import org.springblade.modules.appFormal.vo.MallIntegralVO;
import org.springblade.modules.appFormal.vo.UserInfoVO;
import org.springblade.modules.appOffline.event.AppUserRevokedEvent;
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
import org.springblade.modules.mall.service.IAppBannerService;
import org.springblade.modules.sms.service.AliYunSmsService;
import org.springblade.modules.system.pojo.entity.User;
import org.springblade.modules.system.service.IParamService;
@@ -38,6 +42,7 @@ import java.util.Objects;
public class FormalAppBaseManager {
private final IParamService paramService;
private final IAppBannerService appBannerService;
public String formalAppPrivacy() {
@@ -51,6 +56,36 @@ public class FormalAppBaseManager {
return paramService.findAppFormalPayType(payModel);
}
public String formalAppAgreement() {
return paramService.formalAppAgreement();
}
public List<AppFormalBannerVO> findMainBanner() {
List<AppBannerEntity> bannerEntityList = appBannerService.list(
Wrappers.<AppBannerEntity>lambdaQuery()
.eq(AppBannerEntity::getBannerType, 1)
.eq(AppBannerEntity::getIsShow, 1)
.orderByDesc(AppBannerEntity::getId)
);
return AppBaseConvert.INSTANCE.convertBannerListToVO(bannerEntityList);
}
public List<AppFormalBannerVO> findMallBanner() {
List<AppBannerEntity> bannerEntityList = appBannerService.list(
Wrappers.<AppBannerEntity>lambdaQuery()
.eq(AppBannerEntity::getBannerType, 2)
.eq(AppBannerEntity::getIsShow, 1)
.orderByDesc(AppBannerEntity::getId)
);
return AppBaseConvert.INSTANCE.convertBannerListToVO(bannerEntityList);
}
}

View File

@@ -15,13 +15,17 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.DigestUtil;
import org.springblade.core.tool.utils.SM2Util;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.modules.appFormal.convert.AppBaseConvert;
import org.springblade.modules.appFormal.convert.AppUserInfoConvert;
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
import org.springblade.modules.appFormal.request.UpdatePasswordRequest;
import org.springblade.modules.appFormal.vo.AppUserNoticeVO;
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
import org.springblade.modules.appFormal.vo.MallIntegralVO;
import org.springblade.modules.appFormal.vo.UserInfoVO;
import org.springblade.modules.appOffline.event.AppUserRevokedEvent;
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
import org.springblade.modules.customer.service.IUserNoticeService;
import org.springblade.modules.mall.pojo.entity.YsCategoryEntity;
import org.springblade.modules.sms.service.AliYunSmsService;
import org.springblade.modules.system.pojo.entity.User;
@@ -47,6 +51,7 @@ public class FormalAppCustomerManager {
private final IUserService userService;
private final IUserMallIntegralService userMallIntegralService;
private final IUserMallIntegralLogService mallIntegralLogService;
private final IUserNoticeService userNoticeService;
private final JwtProperties jwtProperties;
private final ApplicationEventPublisher publisher;
private final OAuth2Properties properties;
@@ -164,6 +169,28 @@ public class FormalAppCustomerManager {
}
public IPage<AppUserNoticeVO> findUserNoticePage(IPage<AppUserNoticeVO> page, AppUserNoticeVO userNotice, Long userId) {
Page<UserNoticeEntity> pageResult = userNoticeService.page(
new Page<>(page.getCurrent(), page.getSize()),
Wrappers.lambdaQuery(UserNoticeEntity.class)
.eq(UserNoticeEntity::getUserId, userId)
.eq(Objects.nonNull(userNotice.getHasRead()), UserNoticeEntity::getHasRead, userNotice.getHasRead())
.eq(Objects.nonNull(userNotice.getNoticeType()), UserNoticeEntity::getNoticeType, userNotice.getNoticeType())
.orderByDesc(UserNoticeEntity::getHasRead , UserNoticeEntity::getId)
);
return pageResult.convert(AppBaseConvert.INSTANCE::convertUserNoticePageToVO);
}
public boolean readUserNotice(Long id) {
UserNoticeEntity userNotice = userNoticeService.getById(id);
Assert.notNull(userNotice, "通知不存在");
userNotice.setHasRead(1);
userNotice.setReleaseTime(new Date());
return userNoticeService.updateById(userNotice);
}
}

View File

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.modules.appFormal.convert.AppFormalMallConvert;
import org.springblade.modules.appFormal.request.AddressSubmitRequest;
import org.springblade.modules.appFormal.request.MallCartRequest;
@@ -26,6 +27,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
@@ -58,8 +60,8 @@ public class FormalAppMallManager {
Page<MallSpuEntity> pageResult = spuService.page(
new Page<>(page.getCurrent(), page.getSize()),
Wrappers.lambdaQuery(MallSpuEntity.class)
.eq(StringUtils.hasText(spuVO.getCateId()), MallSpuEntity::getCateId, spuVO.getCateId())
.like(StringUtils.hasText(spuVO.getSpuName()), MallSpuEntity::getSpuName, spuVO.getSpuName())
.eq(StringUtil.isNotBlank(spuVO.getCateId()), MallSpuEntity::getCateId, spuVO.getCateId())
.like(StringUtil.isNotBlank(spuVO.getSpuName()), MallSpuEntity::getSpuName, spuVO.getSpuName())
.orderByDesc(MallSpuEntity::getId)
);
@@ -72,7 +74,7 @@ public class FormalAppMallManager {
new Page<>(page.getCurrent(), page.getSize()),
Wrappers.lambdaQuery(MallCartEntity.class)
.eq(MallCartEntity::getUserId, userId)
.like(StringUtils.hasText(cartVO.getTitle()), MallCartEntity::getTitle, cartVO.getTitle())
.like(StringUtil.isNotBlank(cartVO.getTitle()), MallCartEntity::getTitle, cartVO.getTitle())
.orderByDesc(MallCartEntity::getId)
);
@@ -80,7 +82,7 @@ public class FormalAppMallManager {
}
public Long addCart(MallCartRequest request) {
public AppFormalMallCartInfoVO addCart(MallCartRequest request) {
MallSpuEntity mallSpu = spuService.getById(request.getSpuId());
Assert.notNull(mallSpu, "商品不存在");
@@ -94,7 +96,10 @@ public class FormalAppMallManager {
if (mallCart != null){
mallCart.setQuantity(mallCart.getQuantity() + request.getQuantity());
return mallCartService.updateById(mallCart) ? mallCart.getId() : null;
if (!mallCartService.updateById(mallCart)){
throw new RuntimeException("更新购物车失败");
}
return new AppFormalMallCartInfoVO().setId( mallCart.getId()).setFreight(BigDecimal.ZERO);
}
MallCartEntity cart = new MallCartEntity();
@@ -106,13 +111,13 @@ public class FormalAppMallManager {
cart.setOriginalPrice(mallSpu.getOriginalPrice());
cart.setRetailPrice(mallSpu.getRetailPrice());
if (mallCartService.save(cart)){
return cart.getId();
return new AppFormalMallCartInfoVO().setFreight(BigDecimal.ZERO).setId(cart.getId());
}
throw new RuntimeException("添加购物车失败");
}
public Long addCartToOrder(MallCartRequest request) {
public AppFormalMallCartInfoVO addCartToOrder(MallCartRequest request) {
MallSpuEntity mallSpu = spuService.getById(request.getSpuId());
Assert.notNull(mallSpu, "商品不存在");
@@ -126,7 +131,7 @@ public class FormalAppMallManager {
cart.setOriginalPrice(mallSpu.getOriginalPrice());
cart.setRetailPrice(mallSpu.getRetailPrice());
if (mallCartService.save(cart)){
return cart.getId();
return new AppFormalMallCartInfoVO().setFreight(BigDecimal.ZERO).setId(cart.getId());
}
throw new RuntimeException("添加购物车失败");
}

View File

@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.appFormal.vo;
import lombok.Data;
/**
* 首页轮播图 实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
public class AppFormalBannerVO {
private String coverUrl;
private String route;
private String outsideUrl;
}

View File

@@ -0,0 +1,14 @@
package org.springblade.modules.appFormal.vo;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
@Data
@Accessors(chain = true)
public class AppFormalMallCartInfoVO {
private Long id;
private BigDecimal freight = BigDecimal.ZERO;
}

View File

@@ -65,4 +65,6 @@ public class AppFormalMallSpuVO implements Serializable {
*/
private String tags;
private BigDecimal freight = BigDecimal.ZERO;
}

View File

@@ -0,0 +1,68 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.appFormal.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
* 用户通知 实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
public class AppUserNoticeVO {
private static final long serialVersionUID = 1L;
/**
* 用户id
*/
@Schema(description = "用户id")
private Long id;
private Integer noticeType;
/**
* 是否已读 0-否 1-是
*/
private Integer hasRead;
private Date releaseTime;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
}

View File

@@ -34,7 +34,7 @@ public class MallIntegralLogVO implements Serializable {
private Integer type;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date statisticalDate;

View File

@@ -9,9 +9,12 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.modules.appFormal.manager.FormalAppCustomerManager;
import org.springblade.modules.appFormal.vo.AppUserNoticeVO;
import org.springblade.modules.appOffline.manager.OfflineAppCustomerManager;
import org.springblade.modules.appOffline.vo.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -21,9 +24,10 @@ import java.util.List;
@AllArgsConstructor
@RequestMapping("offline-app/customer")
@Tag(name = "积分app用户信息", description = "积分app用户信息接口")
public class OfflineBaseController {
public class OfflineCustomerController {
private final OfflineAppCustomerManager offlineAppCustomerManager;;
private final OfflineAppCustomerManager offlineAppCustomerManager;
private final FormalAppCustomerManager formalAppCustomerManager;
@@ -34,6 +38,24 @@ public class OfflineBaseController {
return R.data(offlineAppCustomerManager.findUserInfo(AuthUtil.getUserId()));
}
@Operation(summary = "查询用户直推")
@GetMapping("/find-user-direct-list")
public R<List<AppOfflineUserDirectVO>> findUserDirectList() {
return R.data(offlineAppCustomerManager.findUserDirectList(AuthUtil.getUserId()));
}
@Operation(summary = "查询用户通知")
@GetMapping("/find-user-notice-page")
public R<IPage<AppUserNoticeVO>> findUserNoticePage(Query query , AppUserNoticeVO userNotice) {
return R.data(formalAppCustomerManager.findUserNoticePage(Condition.getPage(query), userNotice, AuthUtil.getUserId()));
}
@Operation(summary = "查询用户通知")
@GetMapping("/read-user-notice")
public R<Boolean> readUserNotice(AppUserNoticeVO userNotice) {
return R.status(formalAppCustomerManager.readUserNotice(userNotice.getId()));
}
@Operation(summary = "查询积分")
@GetMapping("/find-user-integral")
@@ -74,7 +96,7 @@ public class OfflineBaseController {
@Operation(summary = "查询用户兑换福利包的列表")
@GetMapping("/find-user-pack-list")
@PostMapping("/find-user-pack-list")
public R<IPage<AppOffLineUserPackInfoVO>> findUserPackList(Query query , AppOffLineUserPackInfoVO packInfo) {
return R.data(offlineAppCustomerManager.findUserPackList(Condition.getPage(query) , packInfo ,AuthUtil.getUserId()));

View File

@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.springblade.modules.appOffline.vo.*;
import org.springblade.modules.customer.pojo.entity.UserGenealogyEntity;
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
import org.springblade.modules.userPackInfo.pojo.entity.AdsEntity;
import org.springblade.modules.userPackInfo.pojo.entity.PackageInfoEntity;
@@ -39,4 +41,10 @@ public interface AppOfflineUserInfoConvert {
AppOffLineUserPackInfoVO convertUserPackInfoPageToVO(UserPackageInfoCopyEntity entity);
List<AppOffLineAdsVO> convertAdsListToVO(List<AdsEntity> list);
@Mapping(source = "id", target = "userId")
@Mapping(source = "createTime", target = "registerTime")
AppOfflineUserDirectVO convertGenealogyListToVO(UserGenealogyEntity entity);
List<AppOfflineUserDirectVO> convertGenealogyListToListVO(List<UserGenealogyEntity> list);
}

View File

@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Slf4j
@@ -50,6 +51,7 @@ public class AppUserInfoListener {
savaUserTree.setIsSyncGenealogy(0);
savaUserTree.setIsRevoked(0);
savaUserTree.setRegisterDate(DateUtil.getToday());
savaUserTree.setCreateTime(new Date());
if (event.getIsRoot() == 0){
UserTreeEntity parentTree = userTreeService.getById(event.getPid());
@@ -86,6 +88,7 @@ public class AppUserInfoListener {
savaUserGenealogy.setRootId(event.getUserId());
savaUserGenealogy.setGroupId(event.getUserId());
savaUserGenealogy.setGenealogyList(new ArrayList<>());
savaUserGenealogy.setCreateTime(new Date());
if (event.getIsRoot() == 0){
UserGenealogyEntity parentGenealogy = userGenealogyService.getById(event.getPid());
@@ -130,6 +133,7 @@ public class AppUserInfoListener {
savaUserIncreaseDay.setPName("");
savaUserIncreaseDay.setPPhone(null);
savaUserIncreaseDay.setPLevel(0);
savaUserIncreaseDay.setCreateTime(new Date());
if (event.getIsRoot() == 0){
UserIncreaseDayEntity parentIncreaseDay = userIncreaseDayService.getById(event.getPid());

View File

@@ -9,7 +9,9 @@ import jakarta.annotation.PostConstruct;
import lombok.AllArgsConstructor;
import org.springblade.modules.appOffline.convert.AppOfflineUserInfoConvert;
import org.springblade.modules.appOffline.vo.*;
import org.springblade.modules.customer.pojo.entity.UserGenealogyEntity;
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
import org.springblade.modules.customer.service.IUserGenealogyService;
import org.springblade.modules.customer.service.IUserIncreaseDayService;
import org.springblade.modules.system.pojo.entity.User;
import org.springblade.modules.system.service.IUserService;
@@ -32,6 +34,7 @@ public class OfflineAppCustomerManager {
private final IUserService userService;
private final IUserGenealogyService userGenealogyService;
private final IUserIncreaseDayService userIncreaseDayService;
private final IUserBenefitService userBenefitService;
private final IUserCashService userCashService;
@@ -55,7 +58,7 @@ public class OfflineAppCustomerManager {
Wrappers.lambdaQuery(PackageInfoEntity.class)
.orderByAsc(PackageInfoEntity::getId)
);
packageInfoVOList = AppOfflineUserInfoConvert.INSTANCE.convertPackageInfoListToVO(packageInfoList);
packageInfoVOList = AppOfflineUserInfoConvert.INSTANCE.convertPackageInfoListToVO(packageInfoList);
}
@@ -66,13 +69,31 @@ public class OfflineAppCustomerManager {
UserIncreaseDayEntity userIncreaseDayEntity = userIncreaseDayService.getById(userId);
return AppOfflineUserInfoConvert.INSTANCE.convertEntityToVO(userIncreaseDayEntity);
}
public List<AppOfflineUserDirectVO> findUserDirectList(Long userId) {
User user = userService.getById(userId);
Assert.notNull(user, "用户不存在");
List<UserGenealogyEntity> genealogyList = userGenealogyService.list(
Wrappers.lambdaQuery(UserGenealogyEntity.class)
.eq(UserGenealogyEntity::getPid, userId)
.eq(UserGenealogyEntity::getIsRevoked, 0)
.orderByDesc(UserGenealogyEntity::getId)
);
return AppOfflineUserInfoConvert.INSTANCE.convertGenealogyListToListVO(genealogyList);
}
public AppOfflineIntegralVO findUserIntegral(Long userId) {
UserBenefitEntity userBenefit = userBenefitService.getById(userId);
if (userBenefit == null){
if (userBenefit == null) {
userBenefit = new UserBenefitEntity();
userBenefit.setId(userId);
userBenefit.setAmount(BigDecimal.ZERO);
@@ -80,7 +101,7 @@ public class OfflineAppCustomerManager {
}
UserCashEntity userCash = userCashService.getById(userId);
if (userCash == null){
if (userCash == null) {
userCash = new UserCashEntity();
userCash.setId(userId);
userCash.setAmount(BigDecimal.ZERO);
@@ -88,7 +109,7 @@ public class OfflineAppCustomerManager {
}
UserCommissionEntity userCommission = userCommissionService.getById(userId);
if (userCommission == null){
if (userCommission == null) {
userCommission = new UserCommissionEntity();
userCommission.setId(userId);
userCommission.setAmount(BigDecimal.ZERO);
@@ -160,4 +181,5 @@ public class OfflineAppCustomerManager {
}
}

View File

@@ -106,6 +106,18 @@ public class OfflineAppDailySignManager {
if (isLook(binaryLookAtAds , adsIndex)){
throw new RuntimeException("此广告今日已经观看");
}
if(userDailySignService.count(
Wrappers.lambdaQuery(UserDailySignEntity.class)
.eq(UserDailySignEntity::getType, 1)
.eq(UserDailySignEntity::getUserId, request.getUserId())
.eq(UserDailySignEntity::getStatisticsDate, DateUtil.getToday())
.eq(UserDailySignEntity::getIsComplete, 1)
) > 0){
throw new RuntimeException("今日已完成签到");
}
bladeRedis.setEx(outputTimeKey, System.currentTimeMillis(), Duration.ofSeconds(60 * 60 * 24));
return Boolean.TRUE;
@@ -156,6 +168,18 @@ public class OfflineAppDailySignManager {
lookToBinary = setLookToBinary(String.valueOf(objectLookAtAds), adsIndex);
}
bladeRedis.setEx(key, lookToBinary, Duration.ofSeconds(60 * 60 * 24));
if(userDailySignService.count(
Wrappers.lambdaQuery(UserDailySignEntity.class)
.eq(UserDailySignEntity::getType, 1)
.eq(UserDailySignEntity::getUserId, request.getUserId())
.eq(UserDailySignEntity::getStatisticsDate, DateUtil.getToday())
.eq(UserDailySignEntity::getIsComplete, 1)
) > 0){
throw new RuntimeException("今日已完成签到");
}
UserDailySignEntity userDailySign = userDailySignService.getOne(
Wrappers.lambdaQuery(UserDailySignEntity.class)
.eq(UserDailySignEntity::getType, adsType)

View File

@@ -0,0 +1,21 @@
package org.springblade.modules.appOffline.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
@Data
public class AppOfflineUserDirectVO implements Serializable {
private Long userId;
private String name;
private Long phone;
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private Date registerTime;
}

View File

@@ -20,7 +20,6 @@ public interface BladeAuthConstant {
*/
Integer FAIL_COUNT = 5;
String DEFAULT_PASSWORD = "123456";
String INVITATION_CODE = "invitation_code";

View File

@@ -49,6 +49,8 @@ import org.springblade.core.oauth2.service.OAuth2ClientService;
import org.springblade.core.oauth2.service.OAuth2User;
import org.springblade.core.oauth2.service.OAuth2UserService;
import org.springblade.core.oauth2.service.impl.OAuth2UserDetail;
import org.springblade.core.oauth2.utils.OAuth2Util;
import org.springblade.core.secure.TokenInfo;
import org.springblade.core.social.props.SocialProperties;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
@@ -128,11 +130,12 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
// 验证码
String code = request.getCode();
String password = request.getPassword();
String password = SM2Util.decrypt(request.getPassword(), properties.getPrivateKey());
log.info("password:[{}]", password);
if (code != null){
aliYunSmsService.verifySms(request.getPhone(), code);
password = BladeAuthConstant.DEFAULT_PASSWORD;
// 截取手机号后六位
password = createDefaultPassword(request.getPhone());
}else {
Assert.notNull(password, "密码不能为空");
//校验密码长度是6到12位, 可以包含字母、数字
@@ -150,7 +153,7 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
user.setUserType(UserType.of(request.getUserType()).getCategory());
user.setTenantId(request.getTenantId());
user.setAccount(request.getPhone());
user.setPassword(SM2Util.decrypt(request.getPassword(), properties.getPrivateKey()));
user.setPassword(password);
user.setName(request.getName());
user.setRealName(request.getName());
user.setPhone(request.getPhone());
@@ -205,14 +208,11 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
@Override
public OAuth2Token token(OAuth2User user, OAuth2Request request) {
// 移除注册后返回的令牌与刷新令牌,防止外部攻击采用注册接口获取令牌并调用低权接口
// 注意:
// 1. 框架已默认开启严格模式,blade.secure.strict-token=true,不移除令牌则不受影响,注册令牌会被框架校验并拒绝
// 2. 若自行关闭严格模式,blade.secure.strict-token=false,必须将令牌移除,否则注册获取令牌后可调用低权接口
OAuth2Token token = super.token(user, request);
token.getArgs().remove(TokenConstant.ACCESS_TOKEN);
token.getArgs().remove(TokenConstant.REFRESH_TOKEN);
return token;
TokenInfo accessToken = OAuth2Util.createAccessToken(user);
TokenInfo refreshToken = OAuth2Util.createRefreshToken(user);
OAuth2Token token = OAuth2Token.create();
token.getArgs().set("tenant_id", user.getTenantId()).set("user_id", user.getUserId()).set("dept_id", user.getDeptId()).set("post_id", user.getPostId()).set("role_id", user.getRoleId()).set("oauth_id", user.getOauthId()).set("account", user.getAccount()).set("user_name", user.getAccount()).set("nick_name", user.getName()).set("real_name", user.getRealName()).set("role_name", Func.join(user.getAuthorities())).set("avatar", Func.toStr(user.getAvatar(), "https://bladex.cn/images/logo-small.png")).set("access_token", accessToken.getToken()).set("refresh_token", refreshToken.getToken()).set("token_type", "bearer").set("expires_in", accessToken.getExpire()).set("detail", user.getDetail()).set("license", "powered by bladex");
return token.setAccessToken(accessToken.getToken()).setAccessTokenExpire(accessToken.getExpire()).setRefreshToken(refreshToken.getToken()).setRefreshTokenExpire(refreshToken.getExpire());
}
private void validateUser(User user) {
@@ -261,4 +261,9 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
private Long HexToPhone(String invitation_code) {
return RadixUtil.decode(BladeAuthConstant.BINARY_TEMPLATE, invitation_code);
}
private String createDefaultPassword(String phone) {
return phone.substring(phone.length() - 6);
}
}

View File

@@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.customer.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import jakarta.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
import org.springblade.modules.customer.excel.UserNoticeExcel;
import org.springblade.modules.customer.wrapper.UserNoticeWrapper;
import org.springblade.modules.customer.service.IUserNoticeService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import java.util.Map;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
/**
* 用户通知 控制器
*
* @author lzq
* @since 2026-02-03
*/
@RestController
@AllArgsConstructor
@RequestMapping("blade-notice/notice")
@Tag(name = "用户通知", description = "用户通知接口")
public class UserNoticeController extends BladeController {
private final IUserNoticeService noticeService;
/**
* 用户通知 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入notice")
public R<UserNoticeVO> detail(UserNoticeEntity notice) {
UserNoticeEntity detail = noticeService.getOne(Condition.getQueryWrapper(notice));
return R.data(UserNoticeWrapper.build().entityVO(detail));
}
/**
* 用户通知 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入notice")
public R<IPage<UserNoticeVO>> list(UserNoticeEntity notice, Query query) {
IPage<UserNoticeEntity> pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice).orderByDesc("id"));
return R.data(UserNoticeWrapper.build().pageVO(pages));
}
/**
* 用户通知 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入notice")
public R<IPage<UserNoticeVO>> page(UserNoticeVO notice, Query query) {
IPage<UserNoticeVO> pages = noticeService.selectUserNoticePage(Condition.getPage(query), notice);
return R.data(pages);
}
/**
* 用户通知 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入notice")
public R save(@Valid @RequestBody UserNoticeEntity notice) {
return R.status(noticeService.save(notice));
}
/**
* 用户通知 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入notice")
public R update(@Valid @RequestBody UserNoticeEntity notice) {
return R.status(noticeService.updateById(notice));
}
/**
* 用户通知 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入notice")
public R submit(@Valid @RequestBody UserNoticeEntity notice) {
return R.status(noticeService.saveOrUpdate(notice));
}
/**
* 用户通知 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(noticeService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@IsAdmin
@GetMapping("/export-notice")
@ApiOperationSupport(order = 9)
@Operation(summary = "导出数据", description = "传入notice")
public void exportUserNotice(@Parameter(hidden = true) @RequestParam Map<String, Object> notice, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<UserNoticeEntity> queryWrapper = Condition.getQueryWrapper(notice, UserNoticeEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(UserNotice::getTenantId, bladeUser.getTenantId());
//}
//queryWrapper.lambda().eq(UserNoticeEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<UserNoticeExcel> list = noticeService.exportUserNotice(queryWrapper);
ExcelUtil.export(response, "用户通知数据" + DateUtil.time(), "用户通知数据表", list, UserNoticeExcel.class);
}
}

View File

@@ -0,0 +1,110 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.customer.excel;
import lombok.Data;
import java.util.Date;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
import java.io.Serial;
/**
* 用户通知 Excel实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class UserNoticeExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ColumnWidth(20)
@ExcelProperty("主键")
private Long id;
/**
* 用户id
*/
@ColumnWidth(20)
@ExcelProperty("用户id")
private Long userId;
/**
* 通知类型0-系统通知
*/
@ColumnWidth(20)
@ExcelProperty("通知类型0-系统通知")
private Integer noticeType;
/**
* 是否已读 0-否 1-是
*/
@ColumnWidth(20)
@ExcelProperty("是否已读 0-否 1-是")
private Integer hasRead;
/**
* 阅读时间
*/
@ColumnWidth(20)
@ExcelProperty("阅读时间")
private Date releaseTime;
/**
* 标题
*/
@ColumnWidth(20)
@ExcelProperty("标题")
private String title;
/**
* 内容
*/
@ColumnWidth(20)
@ExcelProperty("内容")
private String content;
/**
* 备注
*/
@ColumnWidth(20)
@ExcelProperty("备注")
private String remarks;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.customer.mapper;
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
import org.springblade.modules.customer.excel.UserNoticeExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户通知 Mapper 接口
*
* @author lzq
* @since 2026-02-03
*/
public interface UserNoticeMapper extends BaseMapper<UserNoticeEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param notice 查询参数
* @return List<UserNoticeVO>
*/
List<UserNoticeVO> selectUserNoticePage(IPage page, UserNoticeVO notice);
/**
* 获取导出数据
*
* @param queryWrapper 查询条件
* @return List<UserNoticeExcel>
*/
List<UserNoticeExcel> exportUserNotice(@Param("ew") Wrapper<UserNoticeEntity> queryWrapper);
}

View File

@@ -0,0 +1,34 @@
<?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="org.springblade.modules.customer.mapper.UserNoticeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="noticeResultMap" type="org.springblade.modules.customer.pojo.entity.UserNoticeEntity">
<result column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="notice_type" property="noticeType"/>
<result column="has_read" property="hasRead"/>
<result column="release_time" property="releaseTime"/>
<result column="title" property="title"/>
<result column="content" property="content"/>
<result column="remarks" property="remarks"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<select id="selectUserNoticePage" resultMap="noticeResultMap">
select * from user_notice where is_deleted = 0
</select>
<select id="exportUserNotice" resultType="org.springblade.modules.customer.excel.UserNoticeExcel">
SELECT * FROM user_notice ${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.customer.pojo.dto;
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 用户通知 数据传输对象实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class UserNoticeDTO extends UserNoticeEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,87 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.customer.pojo.entity;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 用户通知 实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
@TableName("user_notice")
@Schema(description = "UserNotice对象")
@EqualsAndHashCode(callSuper = true)
public class UserNoticeEntity extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 用户id
*/
@Schema(description = "用户id")
private Long userId;
/**
* 通知类型0-系统通知
*/
@Schema(description = "通知类型0-系统通知")
private Integer noticeType;
/**
* 是否已读 0-否 1-是
*/
@Schema(description = "是否已读 0-否 1-是")
private Integer hasRead;
/**
* 阅读时间
*/
@Schema(description = "阅读时间")
private Date releaseTime;
/**
* 标题
*/
@Schema(description = "标题")
private String title;
/**
* 内容
*/
@Schema(description = "内容")
private String content;
/**
* 备注
*/
@Schema(description = "备注")
private String remarks;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.customer.pojo.vo;
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 用户通知 视图实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class UserNoticeVO extends UserNoticeEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.customer.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
import org.springblade.modules.customer.excel.UserNoticeExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 用户通知 服务类
*
* @author lzq
* @since 2026-02-03
*/
public interface IUserNoticeService extends BaseService<UserNoticeEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param notice 查询参数
* @return IPage<UserNoticeVO>
*/
IPage<UserNoticeVO> selectUserNoticePage(IPage<UserNoticeVO> page, UserNoticeVO notice);
/**
* 导出数据
*
* @param queryWrapper 查询条件
* @return List<UserNoticeExcel>
*/
List<UserNoticeExcel> exportUserNotice(Wrapper<UserNoticeEntity> queryWrapper);
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.customer.service.impl;
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
import org.springblade.modules.customer.excel.UserNoticeExcel;
import org.springblade.modules.customer.mapper.UserNoticeMapper;
import org.springblade.modules.customer.service.IUserNoticeService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 用户通知 服务实现类
*
* @author lzq
* @since 2026-02-03
*/
@Service
public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, UserNoticeEntity> implements IUserNoticeService {
@Override
public IPage<UserNoticeVO> selectUserNoticePage(IPage<UserNoticeVO> page, UserNoticeVO notice) {
return page.setRecords(baseMapper.selectUserNoticePage(page, notice));
}
@Override
public List<UserNoticeExcel> exportUserNotice(Wrapper<UserNoticeEntity> queryWrapper) {
List<UserNoticeExcel> noticeList = baseMapper.exportUserNotice(queryWrapper);
//noticeList.forEach(notice -> {
// notice.setTypeName(DictCache.getValue(DictEnum.YES_NO, UserNotice.getType()));
//});
return noticeList;
}
}

View File

@@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.customer.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
import java.util.Objects;
/**
* 用户通知 包装类,返回视图层所需的字段
*
* @author lzq
* @since 2026-02-03
*/
public class UserNoticeWrapper extends BaseEntityWrapper<UserNoticeEntity, UserNoticeVO> {
public static UserNoticeWrapper build() {
return new UserNoticeWrapper();
}
@Override
public UserNoticeVO entityVO(UserNoticeEntity notice) {
UserNoticeVO noticeVO = Objects.requireNonNull(BeanUtil.copyProperties(notice, UserNoticeVO.class));
//User createUser = UserCache.getUser(notice.getCreateUser());
//User updateUser = UserCache.getUser(notice.getUpdateUser());
//noticeVO.setCreateUserName(createUser.getName());
//noticeVO.setUpdateUserName(updateUser.getName());
return noticeVO;
}
}

View File

@@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import jakarta.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
import org.springblade.modules.mall.pojo.vo.UserBannerVO;
import org.springblade.modules.mall.excel.AppBannerExcel;
import org.springblade.modules.mall.wrapper.AppBannerWrapper;
import org.springblade.modules.mall.service.IAppBannerService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import java.util.Map;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
/**
* 首页轮播图 控制器
*
* @author lzq
* @since 2026-02-03
*/
@RestController
@AllArgsConstructor
@RequestMapping("blade-banner/banner")
@Tag(name = "首页轮播图", description = "首页轮播图接口")
public class AppBannerController extends BladeController {
private final IAppBannerService bannerService;
/**
* 首页轮播图 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入banner")
public R<UserBannerVO> detail(AppBannerEntity banner) {
AppBannerEntity detail = bannerService.getOne(Condition.getQueryWrapper(banner));
return R.data(AppBannerWrapper.build().entityVO(detail));
}
/**
* 首页轮播图 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入banner")
public R<IPage<UserBannerVO>> list(AppBannerEntity banner, Query query) {
IPage<AppBannerEntity> pages = bannerService.page(Condition.getPage(query), Condition.getQueryWrapper(banner).orderByDesc("id"));
return R.data(AppBannerWrapper.build().pageVO(pages));
}
/**
* 首页轮播图 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入banner")
public R<IPage<UserBannerVO>> page(UserBannerVO banner, Query query) {
IPage<UserBannerVO> pages = bannerService.selectUserBannerPage(Condition.getPage(query), banner);
return R.data(pages);
}
/**
* 首页轮播图 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入banner")
public R save(@Valid @RequestBody AppBannerEntity banner) {
return R.status(bannerService.save(banner));
}
/**
* 首页轮播图 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入banner")
public R update(@Valid @RequestBody AppBannerEntity banner) {
return R.status(bannerService.updateById(banner));
}
/**
* 首页轮播图 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入banner")
public R submit(@Valid @RequestBody AppBannerEntity banner) {
return R.status(bannerService.saveOrUpdate(banner));
}
/**
* 首页轮播图 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(bannerService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@IsAdmin
@GetMapping("/export-banner")
@ApiOperationSupport(order = 9)
@Operation(summary = "导出数据", description = "传入banner")
public void exportUserBanner(@Parameter(hidden = true) @RequestParam Map<String, Object> banner, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<AppBannerEntity> queryWrapper = Condition.getQueryWrapper(banner, AppBannerEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(UserBanner::getTenantId, bladeUser.getTenantId());
//}
//queryWrapper.lambda().eq(UserBannerEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<AppBannerExcel> list = bannerService.exportUserBanner(queryWrapper);
ExcelUtil.export(response, "首页轮播图数据" + DateUtil.time(), "首页轮播图数据表", list, AppBannerExcel.class);
}
}

View File

@@ -0,0 +1,115 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.excel;
import lombok.Data;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
import java.io.Serial;
/**
* 首页轮播图 Excel实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class AppBannerExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ColumnWidth(20)
@ExcelProperty("ID")
private Long id;
/**
* 轮播图地址
*/
@ColumnWidth(20)
@ExcelProperty("轮播图地址")
private String coverUrl;
/**
* 路由
*/
@ColumnWidth(20)
@ExcelProperty("路由")
private String route;
/**
* 外链地址
*/
@ColumnWidth(20)
@ExcelProperty("外链地址")
private String outsideUrl;
/**
* 排序
*/
@ColumnWidth(20)
@ExcelProperty("排序")
private Integer sort;
/**
* 轮播图类型 1-主banner 2-商城banner
*/
@ColumnWidth(20)
@ExcelProperty("轮播图类型 1-主banner 2-商城banner")
private Integer bannerType;
/**
* 备注
*/
@ColumnWidth(20)
@ExcelProperty("备注")
private String remark;
/**
* 是否显示
*/
@ColumnWidth(20)
@ExcelProperty("是否显示")
private Integer isShow;
/**
* 标签名
*/
@ColumnWidth(20)
@ExcelProperty("标签名")
private String tagName;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.mapper;
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
import org.springblade.modules.mall.pojo.vo.UserBannerVO;
import org.springblade.modules.mall.excel.AppBannerExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 首页轮播图 Mapper 接口
*
* @author lzq
* @since 2026-02-03
*/
public interface AppBannerMapper extends BaseMapper<AppBannerEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param banner 查询参数
* @return List<UserBannerVO>
*/
List<UserBannerVO> selectUserBannerPage(IPage page, UserBannerVO banner);
/**
* 获取导出数据
*
* @param queryWrapper 查询条件
* @return List<UserBannerExcel>
*/
List<AppBannerExcel> exportUserBanner(@Param("ew") Wrapper<AppBannerEntity> queryWrapper);
}

View File

@@ -0,0 +1,35 @@
<?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="org.springblade.modules.mall.mapper.AppBannerMapper">
<!-- 通用查询映射结果 -->
<resultMap id="bannerResultMap" type="org.springblade.modules.mall.pojo.entity.AppBannerEntity">
<result column="id" property="id"/>
<result column="cover_url" property="coverUrl"/>
<result column="route" property="route"/>
<result column="outside_url" property="outsideUrl"/>
<result column="sort" property="sort"/>
<result column="banner_type" property="bannerType"/>
<result column="remark" property="remark"/>
<result column="is_show" property="isShow"/>
<result column="tag_name" property="tagName"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<select id="selectUserBannerPage" resultMap="bannerResultMap">
select * from app_banner where is_deleted = 0
</select>
<select id="exportUserBanner" resultType="org.springblade.modules.mall.excel.AppBannerExcel">
SELECT * FROM app_banner ${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.pojo.dto;
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 首页轮播图 数据传输对象实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class AppBannerDTO extends AppBannerEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,91 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.pojo.entity;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 首页轮播图 实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
@TableName("app_banner")
@Schema(description = "UserBanner对象")
@EqualsAndHashCode(callSuper = true)
public class AppBannerEntity extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 轮播图地址
*/
@Schema(description = "轮播图地址")
private String coverUrl;
/**
* 路由
*/
@Schema(description = "路由")
private String route;
/**
* 外链地址
*/
@Schema(description = "外链地址")
private String outsideUrl;
/**
* 排序
*/
@Schema(description = "排序")
private Integer sort;
/**
* 轮播图类型 1-主banner 2-商城banner
*/
@Schema(description = "轮播图类型 1-主banner 2-商城banner")
private Integer bannerType;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 是否显示
*/
@Schema(description = "是否显示")
private Integer isShow;
/**
* 标签名
*/
@Schema(description = "标签名")
private String tagName;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.pojo.vo;
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 首页轮播图 视图实体类
*
* @author lzq
* @since 2026-02-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class UserBannerVO extends AppBannerEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
import org.springblade.modules.mall.pojo.vo.UserBannerVO;
import org.springblade.modules.mall.excel.AppBannerExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 首页轮播图 服务类
*
* @author lzq
* @since 2026-02-03
*/
public interface IAppBannerService extends BaseService<AppBannerEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param banner 查询参数
* @return IPage<UserBannerVO>
*/
IPage<UserBannerVO> selectUserBannerPage(IPage<UserBannerVO> page, UserBannerVO banner);
/**
* 导出数据
*
* @param queryWrapper 查询条件
* @return List<UserBannerExcel>
*/
List<AppBannerExcel> exportUserBanner(Wrapper<AppBannerEntity> queryWrapper);
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.service.impl;
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
import org.springblade.modules.mall.pojo.vo.UserBannerVO;
import org.springblade.modules.mall.excel.AppBannerExcel;
import org.springblade.modules.mall.mapper.AppBannerMapper;
import org.springblade.modules.mall.service.IAppBannerService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 首页轮播图 服务实现类
*
* @author lzq
* @since 2026-02-03
*/
@Service
public class AppBannerServiceImpl extends BaseServiceImpl<AppBannerMapper, AppBannerEntity> implements IAppBannerService {
@Override
public IPage<UserBannerVO> selectUserBannerPage(IPage<UserBannerVO> page, UserBannerVO banner) {
return page.setRecords(baseMapper.selectUserBannerPage(page, banner));
}
@Override
public List<AppBannerExcel> exportUserBanner(Wrapper<AppBannerEntity> queryWrapper) {
List<AppBannerExcel> bannerList = baseMapper.exportUserBanner(queryWrapper);
//bannerList.forEach(banner -> {
// banner.setTypeName(DictCache.getValue(DictEnum.YES_NO, UserBanner.getType()));
//});
return bannerList;
}
}

View File

@@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
import org.springblade.modules.mall.pojo.vo.UserBannerVO;
import java.util.Objects;
/**
* 首页轮播图 包装类,返回视图层所需的字段
*
* @author lzq
* @since 2026-02-03
*/
public class AppBannerWrapper extends BaseEntityWrapper<AppBannerEntity, UserBannerVO> {
public static AppBannerWrapper build() {
return new AppBannerWrapper();
}
@Override
public UserBannerVO entityVO(AppBannerEntity banner) {
UserBannerVO bannerVO = Objects.requireNonNull(BeanUtil.copyProperties(banner, UserBannerVO.class));
//User createUser = UserCache.getUser(banner.getCreateUser());
//User updateUser = UserCache.getUser(banner.getUpdateUser());
//bannerVO.setCreateUserName(createUser.getName());
//bannerVO.setUpdateUserName(updateUser.getName());
return bannerVO;
}
}

View File

@@ -55,6 +55,8 @@ public interface IParamService extends BaseService<Param> {
String getFormalAppPrivacy();
String formalAppAgreement();
List<PayOrderDicDTO> getOrderBizModel();
BigDecimal getMallCashToPointRate();
@@ -67,4 +69,5 @@ public interface IParamService extends BaseService<Param> {
WatchVideoTimeRangeDTO watchVideoTimeRange();
}

View File

@@ -60,6 +60,7 @@ public class ParamServiceImpl extends BaseServiceImpl<ParamMapper, Param> implem
private static final String APP_USER_REGISTER_ROLE = "yichayilu:app:register:role-info";
private static final String APP_FORMAL_USER_PRIVACY = "yichayilu:app:formal:user:privacy";
private static final String APP_FORMAL_USER_AGREEMENT = "yichayilu:app:formal:user:agreement";
private static final String APP_FORMAL_ORDER_MODEL_TYPE = "yichayilu:app:formal:order:model_type";
private static final String APP_FORMAL_MALL_CASH_TO_POINT_RATE = "yichayilu:app:formal:mall.cash.to.point.Rate";
private static final String APP_FORMAL_MALL_CUT_AMOUNT_RANG = "yichayilu:app:formal:mall.cut.amount.rang";
@@ -72,6 +73,10 @@ public class ParamServiceImpl extends BaseServiceImpl<ParamMapper, Param> implem
private Boolean dailySignIsLookAtAds;
private WatchVideoTimeRangeDTO watchVideoTimeRangeDTO;
private String appFormalUserPrivacy;
private String appFormalUserAgreement;
@XxlJob("yichayilu-app-userRegisterInfo")
@PostConstruct
public void initAppUserRegisterInfo() {
@@ -80,6 +85,16 @@ public class ParamServiceImpl extends BaseServiceImpl<ParamMapper, Param> implem
}
@XxlJob("yichayilu-app-privacy-agreement")
@PostConstruct
public void initAppUserPrivacyAgreement() {
Param privacyParam = this.getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, APP_FORMAL_USER_PRIVACY));
Param agreementParam = this.getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, APP_FORMAL_USER_AGREEMENT));
appFormalUserPrivacy = privacyParam.getParamValue();
appFormalUserAgreement = agreementParam.getParamValue();
}
@XxlJob("yichayilu-dailysign-isLookAds")
@PostConstruct
public void initDailySignIsLookAds() {
@@ -107,8 +122,13 @@ public class ParamServiceImpl extends BaseServiceImpl<ParamMapper, Param> implem
@Override
public String getFormalAppPrivacy() {
Param param = this.getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, APP_FORMAL_USER_PRIVACY));
return param.getParamValue();
return appFormalUserPrivacy;
}
@Override
public String formalAppAgreement() {
return appFormalUserAgreement;
}
@Override

View File

@@ -32,6 +32,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -60,4 +62,7 @@ public interface UserMallIntegralMapper extends BaseMapper<UserMallIntegralEntit
*/
List<UserMallIntegralExcel> exportUserMallIntegral(@Param("ew") Wrapper<UserMallIntegralEntity> queryWrapper);
int subtractAmount(Long userId, BigDecimal amount, Integer version);
int addAmount(Long userId, BigDecimal amount, Integer version);
}

View File

@@ -17,6 +17,7 @@
</resultMap>
<select id="selectUserMallIntegralPage" resultMap="mallIntegralResultMap">
select * from user_mall_integral where is_deleted = 0
</select>
@@ -26,4 +27,12 @@
SELECT * FROM user_mall_integral ${ew.customSqlSegment}
</select>
<update id="addAmount">
update user_mall_integral set amount = amount + #{amount} , version = version + 1 where id = #{userId} and version = #{version}
</update>
<update id="subtractAmount">
update user_mall_integral set amount = amount - #{amount} , version = version + 1 where id = #{userId} and version = #{version}
</update>
</mapper>

View File

@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
@@ -45,6 +46,7 @@ import java.io.Serial;
@TableName("user_mall_integral")
@Schema(description = "UserMallIntegral对象")
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class UserMallIntegralEntity extends BaseEntity {
@Serial

View File

@@ -32,6 +32,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springblade.core.mp.base.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
@@ -47,6 +48,7 @@ import java.io.Serial;
@TableName("user_mall_integral_log")
@Schema(description = "UserMallIntegralLog对象")
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class UserMallIntegralLogEntity extends BaseEntity {
@Serial

View File

@@ -26,11 +26,14 @@
package org.springblade.modules.userPoint.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.modules.userPoint.dto.UserAmountDTO;
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralEntity;
import org.springblade.modules.userPoint.pojo.vo.UserMallIntegralVO;
import org.springblade.modules.userPoint.excel.UserMallIntegralExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -58,4 +61,11 @@ public interface IUserMallIntegralService extends BaseService<UserMallIntegralEn
*/
List<UserMallIntegralExcel> exportUserMallIntegral(Wrapper<UserMallIntegralEntity> queryWrapper);
Boolean addAmountNotLog(Long userId, BigDecimal amount , Integer version);
Boolean subtractAmountNotLog(Long userId, BigDecimal amount ,Integer version);
Boolean addAmount(UserAmountDTO dto);
Boolean subtractAmount(UserAmountDTO dto);
}

View File

@@ -25,15 +25,24 @@
*/
package org.springblade.modules.userPoint.service.impl;
import lombok.AllArgsConstructor;
import org.springblade.common.utils.date.DateUtil;
import org.springblade.modules.userPoint.dto.UserAmountDTO;
import org.springblade.modules.userPoint.pojo.entity.UserBenefitLogEntity;
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralEntity;
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
import org.springblade.modules.userPoint.pojo.vo.UserMallIntegralVO;
import org.springblade.modules.userPoint.excel.UserMallIntegralExcel;
import org.springblade.modules.userPoint.mapper.UserMallIntegralMapper;
import org.springblade.modules.userPoint.service.IUserMallIntegralLogService;
import org.springblade.modules.userPoint.service.IUserMallIntegralService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -43,8 +52,11 @@ import java.util.List;
* @since 2026-01-28
*/
@Service
@AllArgsConstructor
public class UserMallIntegralServiceImpl extends BaseServiceImpl<UserMallIntegralMapper, UserMallIntegralEntity> implements IUserMallIntegralService {
private final IUserMallIntegralLogService userMallIntegralLogService;
@Override
public IPage<UserMallIntegralVO> selectUserMallIntegralPage(IPage<UserMallIntegralVO> page, UserMallIntegralVO mallIntegral) {
return page.setRecords(baseMapper.selectUserMallIntegralPage(page, mallIntegral));
@@ -60,4 +72,49 @@ public class UserMallIntegralServiceImpl extends BaseServiceImpl<UserMallIntegra
return mallIntegralList;
}
@Override
public Boolean addAmountNotLog(Long userId, BigDecimal amount, Integer version) {
return baseMapper.addAmount(userId , amount , version) > 0;
}
@Override
public Boolean subtractAmountNotLog(Long userId, BigDecimal amount,Integer version) {
return baseMapper.subtractAmount(userId , amount , version) > 0;
}
@Transactional(rollbackFor = RuntimeException.class)
@Override
public Boolean addAmount(UserAmountDTO dto) {
if (baseMapper.addAmount(dto.getUserId() , dto.getAmount() , dto.getVersion() ) > 0 &&
userMallIntegralLogService.save(createUserBenefitLog(dto , 1))){
return Boolean.TRUE;
}
throw new RuntimeException("添加用户福利值失败");
}
@Transactional(rollbackFor = RuntimeException.class)
@Override
public Boolean subtractAmount(UserAmountDTO dto) {
if (baseMapper.subtractAmount(dto.getUserId() , dto.getAmount() , dto.getVersion() ) > 0 &&
userMallIntegralLogService.save(createUserBenefitLog(dto , 2))){
return Boolean.TRUE;
}
throw new RuntimeException("扣除用户福利值失败");
}
private UserMallIntegralLogEntity createUserBenefitLog(UserAmountDTO dto , Integer type){
return new UserMallIntegralLogEntity()
.setUserId(dto.getUserId())
.setUserPhone(dto.getUserPhone())
.setUserName(dto.getUserName())
.setAmount(dto.getAmount())
.setSourceId(dto.getSourceId())
.setSourceDetail(dto.getSourceDetail())
.setOrderId(0L)
.setType(type)
.setStatisticalDate(DateUtil.getToday())
.setRemark(dto.getRemark());
}
}

View File

@@ -63,8 +63,8 @@ blade:
aliyun:
sms:
# 阿里云账号的AccessKey
accessKeyId: LTAI5t8BeHdexfRG1nJGiKJq
accessKeySecret: fXTJGks85ujS7NfbOvlV8jfDbwnSHx
accessKeyId: LTAI5tPYSrdSipANposndbrt
accessKeySecret: ldVngFWpwPtTQgKzbJK3GrZoRmPIX2
# 区域,默认为杭州
regionId: cn-hangzhou
# 默认短信签名
@@ -87,12 +87,11 @@ xxl:
logpath: /Users/ray/dev/xxl-logs
logretentiondays: 30
oss:
enabled: true
name: alioss
tenant-mode: false
endpoint: https://oss-cn-zhangjiakou.aliyuncs.com
access-key: LTAI5tB6gdjNGfh4ijLhkbTE
secret-key: quGnzXst0GuopQAIIv8bUlYdzbVBhH
bucket-name: letfly
endpoint: https://oss-cn-beijing.aliyuncs.com
access-key: LTAI5tHgTPu3QbQkP3qPH8EM
secret-key: your-secret-key
bucket-name: UG1exiMCt31B6OoeSrw3BrW08izrJl

View File

@@ -241,6 +241,9 @@ blade:
- /blade-test/**
- /formal-app/base/send-sms-code
- /formal-app/base/formal-app-privacy
- /formal-app/base/formal-app-agreement
- /formal-app/base/find-main-banner
- /formal-app/base/find-mall-banner
- /formal-app/base/find-category
- /formal-app/base/spu-list
#授权认证配置
@@ -283,13 +286,13 @@ blade:
path-patterns:
- /blade-saber/**
- client-id: ${appclient.formal.name}
- client-id: appFormal
path-patterns:
- /formal-app/customer/**
- /formal-app/mall/**
- /formal-app/order/**
- client-id: ${appclient.offline.name}
- client-id: appOffline
path-patterns:
- /offline-app/**
@@ -302,7 +305,7 @@ appclient:
#多租户配置
tenant:
#多租户增强
enhance: true
enhance: false
#多租户授权保护
license: false
#动态数据库隔离功能
@@ -319,11 +322,3 @@ appclient:
enabled: false
oss:
enabled: true
name: alioss
tenant-mode: false
endpoint: https://oss-cn-zhangjiakou.aliyuncs.com
access-key: LTAI5tB6gdjNGfh4ijLhkbTE
secret-key: quGnzXst0GuopQAIIv8bUlYdzbVBhH
bucket-name: letfly