Merge remote-tracking branch 'origin/master'
# Conflicts:
# ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberService.java
# ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberServiceImpl.java
1个文件已删除
12个文件已添加
28个文件已修改
| | |
| | | @ApiModelProperty(value = "拍卖场编码") |
| | | private String auctionSalesroomNo; |
| | | |
| | | @ApiModelProperty(value = "拍卖场二维码") |
| | | private String qrCode; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField(value = "create_by", fill = FieldFill.INSERT) |
| | | private String createBy; |
| | |
| | | return fileName; |
| | | } |
| | | |
| | | public static String obsUploadStream(String code, InputStream content) throws IOException { |
| | | String fileName = ""; |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | fileName = UUID.randomUUID().toString().replaceAll("-", "") + "-id" + code + ".png"; |
| | | obsClient.putObject(bucketName, "qrCode/" + fileName, content, meta);// 上传Object. |
| | | if (fileName != null && !"".equals(fileName)) { |
| | | System.out.println(fileName); |
| | | fileName = oss_domain + "qrCode/" + fileName; |
| | | } |
| | | return fileName; |
| | | } |
| | | /** |
| | | * 删除某个Object |
| | | * |
| | |
| | | @ApiOperation(value = "获取拍卖商品列表的分页数据", notes = "获取拍卖商品列表的分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MgtAuctionGoodsVO>> getAuctionGoodsPage( |
| | | MgtAuctionGoodsQuery query) { |
| | | @Validated @RequestBody MgtAuctionGoodsQuery query) { |
| | | return R.ok(auctionGoodsService.getAuctionGoodsPage(query)); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.auction.controller.management; |
| | | |
| | | |
| | | import com.google.zxing.WriterException; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSaleroomBidRecordQuery; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomDTO; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomQuery; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import java.io.IOException; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "获取拍卖场列表的分页数据", notes = "获取拍卖场列表的分页数据") |
| | | public R<PageDTO<MgtAuctionSalesroomVO>> getAuctionSalesroomPage( |
| | | MgtAuctionSalesroomQuery query) { |
| | | @Validated @RequestBody MgtAuctionSalesroomQuery query) { |
| | | return R.ok(auctionSalesroomService.getAuctionSalesroomPage(query)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "添加/编辑 拍卖场", notes = "添加/编辑 拍卖场") |
| | | public R<?> saveAuctionSalesroom( |
| | | @Validated @RequestBody MgtAuctionSalesroomDTO dto) { |
| | | try { |
| | | auctionSalesroomService.saveAuctionSalesroom(dto); |
| | | } catch (IOException | WriterException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("/bid-record") |
| | | @ApiOperation(value = "查看详情-出价记录", notes = "查看详情-出价记录") |
| | | public R<PageDTO<MgtAuctionBidRecordVO>> getAuctionSalesroomBidRecordList( |
| | | @RequestBody MgtAuctionSaleroomBidRecordQuery query) { |
| | | @Validated @RequestBody MgtAuctionSaleroomBidRecordQuery query) { |
| | | return R.ok(auctionSalesroomService.getAuctionSalesroomBidRecordList(query)); |
| | | } |
| | | } |
| | |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "获取拍卖场列表的分页数据", notes = "获取拍卖场列表的分页数据") |
| | | public R<PageDTO<MgtAuctionSalesroomVO>> getAuctionSalesroom4ScreenPage( |
| | | MgtAuctionSalesroomQuery query) { |
| | | @Validated @RequestBody MgtAuctionSalesroomQuery query) { |
| | | return R.ok(auctionSalesroomService.getAuctionSalesroom4ScreenPage(query)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/add-goods") |
| | | @ApiOperation(value = "添加商品", notes = "添加商品") |
| | | public R<?> addGoods(@RequestBody MgtScreenSalesroomGoodsDTO dto) { |
| | | public R<?> addGoods(@Validated @RequestBody MgtScreenSalesroomGoodsDTO dto) { |
| | | auctionSalesroomService.addGoods(dto); |
| | | return R.ok(); |
| | | } |
| | |
| | | @PostMapping("/backup-goods") |
| | | @ApiOperation(value = "获取备选拍品列表的分页数据", notes = "获取备选拍品列表的分页数据") |
| | | public R<PageDTO<MgtAuctionSalesroomGoodsVO>> backupGoods( |
| | | @RequestBody MgtAuctionSalesroomGoodsQuery query) { |
| | | @Validated @RequestBody MgtAuctionSalesroomGoodsQuery query) { |
| | | return R.ok(auctionSalesroomService.backupGoods(query)); |
| | | } |
| | | |
| | |
| | | * @param dto 大屏播放视频对象 |
| | | */ |
| | | @PostMapping("/play") |
| | | @ApiOperation("播放视频") |
| | | public R<?> play(@RequestBody MgtScreenVideoDTO dto) { |
| | | @ApiOperation("播放视频-确认") |
| | | public R<?> play(@Validated @RequestBody MgtScreenVideoDTO dto) { |
| | | auctionSalesroomService.play(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/stop-play/{auctionSalesroomId}") |
| | | @ApiOperation("播放视频") |
| | | @ApiOperation("结束播放") |
| | | public R<?> stopPlay( |
| | | @ApiParam(name = "auctionSalesroomId", value = "拍卖场id", required = true) |
| | | @PathVariable("auctionSalesroomId") Long auctionSalesroomId) { |
| | |
| | | @ApiModelProperty(value = "拍品说明") |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "分享标题") |
| | | private String shareTitle; |
| | | |
| | | @ApiModelProperty(value = "分享图片") |
| | | private String sharePic; |
| | | |
| | | @ApiModelProperty(value = "上架状态 0=上架中 1=已下架") |
| | | private ListingStatusEnum listingStatus; |
| | | |
| | |
| | | @ApiModelProperty(value = "已拍人数") |
| | | private Integer bidPersonCount = 0; |
| | | |
| | | @ApiModelProperty(value = "起拍价格") |
| | | private BigDecimal startingPrice; |
| | | |
| | | @ApiModelProperty(value = "排序") |
| | | private Integer sortNum; |
| | | |
| | | } |
| | |
| | | private AuctionTypeEnum type; |
| | | |
| | | @ApiModelProperty(value = "保证金") |
| | | private BigDecimal bound; |
| | | private BigDecimal bond; |
| | | |
| | | @ApiModelProperty(value = "实名认证 0=不需认证 1=需要实名") |
| | | private AuthenticationEnum authentication; |
| | |
| | | @ApiModelProperty(value = "拍卖场编码") |
| | | private String auctionSalesroomNo; |
| | | |
| | | @ApiModelProperty(value = "拍卖场二维码") |
| | | private String qrCode; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | |
| | | package com.ruoyi.auction.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.domain.dto.AuctionSalesroomGoodsDTO; |
| | | import com.ruoyi.system.api.domain.dto.ForepartAuctionBidRecordDTO; |
| | | import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomVO; |
| | | import com.google.zxing.WriterException; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSaleroomBidRecordQuery; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomDTO; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomGoodsQuery; |
| | |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.system.api.domain.dto.AppMiniLoginDTO; |
| | | import com.ruoyi.system.api.domain.dto.AuctionSalesroomGoodsDTO; |
| | | import com.ruoyi.system.api.domain.dto.BidDTO; |
| | | import com.ruoyi.system.api.domain.dto.ForepartAuctionBidRecordDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomDTO; |
| | | import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomVO; |
| | | import com.ruoyi.system.api.domain.vo.PayInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.WdMemberAuctionSalesroomVO; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | |
| | | void SaveBid(@RequestBody BidDTO BidVO); |
| | | |
| | | |
| | | void saveAuctionSalesroom(MgtAuctionSalesroomDTO dto); |
| | | void saveAuctionSalesroom(MgtAuctionSalesroomDTO dto) throws IOException, WriterException; |
| | | |
| | | PageDTO<WdMemberAuctionSalesroomVO> getWdAuctionSalesroomList(@RequestBody MemberAuctionSalesroomDTO MemberAuctionSalesroomDTO); |
| | | |
| | |
| | | import java.util.concurrent.TimeUnit; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private final RedisService redisService; |
| | | private final SysUserClient sysUserClient; |
| | | |
| | | @Async |
| | | // @Async |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void auctionGoodsScheduleTask(List<AuctionGoods> auctionGoodsList) { |
| | | for (AuctionGoods auctionGoods : auctionGoodsList) { |
| | |
| | | .select(AuctionGoods::getId, AuctionGoods::getGoodsSkuId, |
| | | AuctionGoods::getListingStatus, AuctionGoods::getStartStatus, |
| | | AuctionGoods::getStartTime, AuctionGoods::getEndTime, |
| | | AuctionGoods::getAuctionStock, AuctionGoods::getMinimumMarkupAmount).in( |
| | | AuctionGoods::getAuctionStock, AuctionGoods::getMinimumMarkupAmount, |
| | | AuctionGoods::getAuthentication, AuctionGoods::getStartingPrice).in( |
| | | StringUtils.isNotEmpty(goodsSkuIdList), AuctionGoods::getGoodsSkuId, |
| | | goodsSkuIdList).eq(StringUtils.isNotNull(query.getAuthentication()), |
| | | AuctionGoods::getAuthentication, query.getAuthentication()) |
| | |
| | | } |
| | | MgtAuctionGoodsVO auctionGoodsVO = BeanUtils.copyBean(auctionGoods, |
| | | MgtAuctionGoodsVO.class); |
| | | // 远程调用商品服务,获取商品信息 |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(auctionGoods.getGoodsSkuId(), |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isNotNull(goodsSku)) { |
| | | auctionGoodsVO.setGoodsSkuName(goodsSku.getSkuName()); |
| | | } |
| | | if (!auctionGoods.getStartStatus().equals(AuctionStartStatusEnum.IN_PREVIEW)) { |
| | | List<AuctionBidRecord> list = auctionBidRecordService.lambdaQuery() |
| | | .eq(AuctionBidRecord::getTargetId, auctionGoodsVO.getId()) |
| | |
| | | package com.ruoyi.auction.service.impl; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.DefaultAlipayClient; |
| | | import com.alipay.api.internal.util.AlipayEncrypt; |
| | | import com.alipay.api.internal.util.AlipaySignature; |
| | | import com.alipay.api.request.AlipaySystemOauthTokenRequest; |
| | | import com.alipay.api.request.AlipayUserInfoShareRequest; |
| | | import com.alipay.api.response.AlipaySystemOauthTokenResponse; |
| | | import com.alipay.api.response.AlipayUserInfoShareResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.google.zxing.WriterException; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSaleroomBidRecordQuery; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomDTO; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomGoodsDTO; |
| | |
| | | import com.ruoyi.system.api.feignClient.PromotionClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | |
| | | @Override |
| | | @Transactional |
| | | @GlobalTransactional(rollbackFor = Exception.class) |
| | | public void saveAuctionSalesroom(MgtAuctionSalesroomDTO dto) { |
| | | public void saveAuctionSalesroom(MgtAuctionSalesroomDTO dto) |
| | | throws IOException, WriterException { |
| | | Long id = dto.getId(); |
| | | AuctionSalesroom auctionSalesroom = BeanUtils.copyBean(dto, AuctionSalesroom.class); |
| | | List<MgtAuctionSalesroomGoodsDTO> auctionSalesroomGoodsDTOS = dto.getAuctionSalesroomGoodsDTOS(); |
| | |
| | | // 生成唯一编号 |
| | | Long nextId = IDhelper.getNextId(); |
| | | auctionSalesroom.setAuctionSalesroomNo(nextId.toString()); |
| | | String qrCodeToObs = CreateQrCode.createQRCodeToObs(nextId.toString()); |
| | | auctionSalesroom.setQrCode(qrCodeToObs); |
| | | // 添加 |
| | | this.save(auctionSalesroom); |
| | | List<GoodsStockUpdDTO> goodsStockUpdDTOS = auctionSalesroomGoods.stream().map(item -> { |
| | |
| | | .eq(AuctionSalesroomGoods::getAuctionSalesroomId, id)); |
| | | } |
| | | for (AuctionSalesroomGoods auctionSalesroomGood : auctionSalesroomGoods) { |
| | | auctionSalesroomGood.setAuctionSalesroomId(id); |
| | | auctionSalesroomGood.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | } |
| | | // 添加拍卖商品 |
| | | for (AuctionSalesroomGoods auctionSalesroomGoodss:auctionSalesroomGoods){ |
| | |
| | | import com.google.zxing.WriterException; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.qrcode.QRCodeWriter; |
| | | import com.ruoyi.system.api.util.HuaWeiOBSUtil; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.Base64; |
| | | import java.util.HashMap; |
| | | |
| | |
| | | String text = encoder.encodeToString(outputStream.toByteArray()); |
| | | return base64Url + text; |
| | | } |
| | | |
| | | /** |
| | | * 创建二维码 |
| | | * |
| | | * @param |
| | | * @param |
| | | * @return |
| | | * @throws IOException |
| | | * @throws WriterException |
| | | */ |
| | | public static String createQRCodeToObs(String json) throws IOException, WriterException { |
| | | QRCodeWriter qrCodeWriter = new QRCodeWriter(); |
| | | |
| | | HashMap<EncodeHintType, Object> hints = new HashMap<>(); |
| | | hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); |
| | | BitMatrix bitMatrix = qrCodeWriter.encode(json, BarcodeFormat.QR_CODE, 600, 600, hints); |
| | | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
| | | MatrixToImageWriter.writeToStream(bitMatrix, "PNG", outputStream); |
| | | InputStream is = new ByteArrayInputStream( |
| | | outputStream.toByteArray()); |
| | | return HuaWeiOBSUtil.obsUploadStream(json, is); |
| | | } |
| | | |
| | | public static void main(String[] args) throws IOException, WriterException { |
| | | String qrCodeToObs = createQRCodeToObs("123456"); |
| | | System.out.println(qrCodeToObs); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.file.FileUtils; |
| | | import com.ruoyi.file.service.ISysFileService; |
| | | import com.ruoyi.file.utils.HuaWeiOBSUtil; |
| | | import com.ruoyi.system.api.domain.SysFile; |
| | | import com.ruoyi.system.api.util.HuaWeiOBSUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | |
| | | /** |
| | | * 系统模块 |
| | |
| | | @EnableCustomSwagger2 |
| | | @EnableRyFeignClients |
| | | @SpringBootApplication |
| | | @EnableAsync |
| | | public class RuoYiMemberApplication |
| | | { |
| | | public static void main(String[] args) |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberPointsQuery; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberQuery; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberPointsVO; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberVO; |
| | | import com.ruoyi.member.service.IMemberService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | return R.ok(memberService.getMemberPage(query)); |
| | | } |
| | | |
| | | @ApiOperation("查看详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<MgtMemberVO> getMemberById(@PathVariable("id") Long id) { |
| | | return R.ok(memberService.getMemberById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 获取积分明细分页列表 |
| | | * |
| | | * @param query 会员积分明细查询对象 |
| | | * @return PageDTO<MgtMemberPointsVO> |
| | | */ |
| | | @ApiOperation("查看详情-积分明细") |
| | | @PostMapping("/points/detail") |
| | | public R<PageDTO<MgtMemberPointsVO>> getMemberPoints( |
| | | @Validated @RequestBody MgtMemberPointsQuery query) { |
| | | return R.ok(memberService.getMemberPoints(query)); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberLevelDTO; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberLevelVO; |
| | | import com.ruoyi.member.service.IMemberLevelService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping("/mgt/member-level") |
| | | @RequiredArgsConstructor |
| | |
| | | public R<List<MgtMemberLevelVO>> getMemberLevelList() { |
| | | return R.ok(memberLevelService.getMemberLevelList()); |
| | | } |
| | | |
| | | /** |
| | | * 保存会员等级配置 |
| | | * |
| | | * @param memberLevelDTOList 会员等级配置列表 |
| | | */ |
| | | @ApiOperation("保存会员等级配置") |
| | | @PostMapping("/save") |
| | | public R<?> saveOrUpdateMemberLevel( |
| | | @RequestBody @NotEmpty(message = "会员等级不能为空") List<MgtMemberLevelDTO> memberLevelDTOList) { |
| | | memberLevelService.saveOrUpdateMemberLevel(memberLevelDTOList); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.member.controller.management.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("会员等级数据传输对象对象") |
| | | public class MgtMemberLevelDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 841295965476674650L; |
| | | |
| | | @ApiModelProperty(value = "会员等级") |
| | | @NotNull(message = "会员等级不能为空") |
| | | private Integer level; |
| | | |
| | | @ApiModelProperty(value = "累计消费") |
| | | @NotNull(message = "累计消费不能为空") |
| | | private BigDecimal cumulativeConsumption; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.member.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/5 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "会员积分明细查询对象", description = "会员积分明细查询对象") |
| | | public class MgtMemberPointsQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = -5584030212572003337L; |
| | | |
| | | @ApiModelProperty(value = "积分id") |
| | | private Long id; |
| | | } |
| | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import lombok.Data; |
| | | |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("会员等级视图对象") |
| | | public class MgtMemberLevelVO { |
| | | public class MgtMemberLevelVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -1084266587029415541L; |
| | | |
| | | @ApiModelProperty(value = "会员等级id") |
| | | private Long id; |
New file |
| | |
| | | package com.ruoyi.member.controller.management.vo; |
| | | |
| | | import com.ruoyi.common.core.enums.PointStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/6 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "MemberPoints对象", description = "会员积分表") |
| | | public class MgtMemberPointsVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -6160012928127594726L; |
| | | |
| | | @ApiModelProperty(value = "积分id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | private Integer points; |
| | | |
| | | @ApiModelProperty(value = "积分类型 1支付订单") |
| | | private Integer pointsType; |
| | | |
| | | @ApiModelProperty(value = "积分状态 1增加,2 减少") |
| | | private PointStatusEnum pointsStatus; |
| | | |
| | | @ApiModelProperty(value = "时间") |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | package com.ruoyi.member.controller.management.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.ruoyi.common.core.enums.GenderEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | private static final long serialVersionUID = 4977665063990741285L; |
| | | |
| | | @ApiModelProperty(value = "1未认证,2已认证") |
| | | private Integer isAuthentication; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | private Long memberid; |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "会员昵称") |
| | | private String nickname; |
| | |
| | | |
| | | @ApiModelProperty(value = "已用积分") |
| | | private Integer usedPoints; |
| | | |
| | | @ApiModelProperty(value = "1未认证,2已认证") |
| | | private Integer isAuthentication; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.member.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberLevelDTO; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberLevelVO; |
| | | import com.ruoyi.member.domain.MemberLevel; |
| | | import java.util.List; |
| | |
| | | * @return List<MgtMemberLevelVO> |
| | | */ |
| | | List<MgtMemberLevelVO> getMemberLevelList(); |
| | | |
| | | /** |
| | | * 保存会员等级配置 |
| | | * |
| | | * @param memberLevelDTOList 会员等级配置列表 |
| | | */ |
| | | void saveOrUpdateMemberLevel(List<MgtMemberLevelDTO> memberLevelDTOList); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberPointsQuery; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberQuery; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberPointsVO; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberVO; |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.dto.AppMiniLoginDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | import com.ruoyi.system.api.domain.dto.MobileDTO; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | PageDTO<MgtMemberVO> getMemberPage(MgtMemberQuery query); |
| | | |
| | | /** |
| | | * 获取用户详情 |
| | | * |
| | | * @param id 会员id |
| | | * @return MgtMemberVO |
| | | */ |
| | | MgtMemberVO getMemberById(Long id); |
| | | |
| | | /** |
| | | * 获取积分明细分页列表 |
| | | * |
| | | * @param query 会员积分明细查询对象 |
| | | * @return PageDTO<MgtMemberPointsVO> |
| | | */ |
| | | PageDTO<MgtMemberPointsVO> getMemberPoints(MgtMemberPointsQuery query); |
| | | |
| | | void updMembeOne(@RequestBody updMembeOneDTO dMembeOneDTO); |
| | | } |
New file |
| | |
| | | package com.ruoyi.member.service.async; |
| | | |
| | | import com.ruoyi.member.domain.MemberLevel; |
| | | import com.ruoyi.member.service.IMemberService; |
| | | import java.util.List; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/6 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class AsyncMethodService { |
| | | |
| | | private final IMemberService memberService; |
| | | |
| | | /** |
| | | * 处理修改等级条件金额后,同步调整用户等级 |
| | | * |
| | | * @param memberLevels 会员等级条件列表 |
| | | */ |
| | | @Async |
| | | public void handleMemberLevel(List<MemberLevel> memberLevels) { |
| | | memberService.list(); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberLevelDTO; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberLevelVO; |
| | | import com.ruoyi.member.domain.MemberLevel; |
| | | import com.ruoyi.member.mapper.MemberLevelMapper; |
| | | import com.ruoyi.member.service.IMemberLevelService; |
| | | import com.ruoyi.member.service.IMemberService; |
| | | import com.ruoyi.member.service.async.AsyncMethodService; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import java.util.List; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class MemberLevelServiceImpl extends ServiceImpl<MemberLevelMapper, MemberLevel> implements IMemberLevelService { |
| | | |
| | | private final IMemberService memberService; |
| | | |
| | | private final AsyncMethodService asyncMethodService; |
| | | /** |
| | | * 获取会员等级管理列表 |
| | | * |
| | |
| | | } |
| | | return mgtMemberLevelVOS; |
| | | } |
| | | |
| | | /** |
| | | * 保存会员等级配置 |
| | | * |
| | | * @param memberLevelDTOList 会员等级配置列表 |
| | | */ |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public void saveOrUpdateMemberLevel(List<MgtMemberLevelDTO> memberLevelDTOList) { |
| | | List<MemberLevel> memberLevels = BeanUtils.copyList(memberLevelDTOList, MemberLevel.class); |
| | | this.saveOrUpdateBatch(memberLevels); |
| | | asyncMethodService.handleMemberLevel(memberLevels); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.enums.GenderEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberPointsQuery; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberQuery; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberPointsVO; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberVO; |
| | | import com.ruoyi.member.domain.MemberLevel; |
| | | import com.ruoyi.member.mapper.MemberMapper; |
| | | import com.ruoyi.member.service.IMemberPointsService; |
| | | import com.ruoyi.member.service.IMemberLevelService; |
| | | import com.ruoyi.member.service.IMemberService; |
| | | import com.ruoyi.member.util.HttpUtils; |
| | |
| | | import com.ruoyi.system.api.constants.SecurityConstant; |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.MemberPoints; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.AppMiniLoginDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | import com.ruoyi.system.api.domain.dto.MobileDTO; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | |
| | | private IMemberLevelService iMemberLevelService; |
| | | |
| | | |
| | | @Resource |
| | | private IMemberPointsService memberPointsService; |
| | | @Override |
| | | public AppMiniLoginVO loginThird(AppMiniLoginDTO appMiniLoginDto) throws Exception { |
| | | AppMiniLoginVO appMiniLoginVo = new AppMiniLoginVO(); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户详情 |
| | | * |
| | | * @param id 会员id |
| | | * @return MgtMemberVO |
| | | */ |
| | | @Override |
| | | public MgtMemberVO getMemberById(Long id) { |
| | | Member member = this.getById(id); |
| | | if (StringUtils.isNull(member)) { |
| | | throw new ServiceException("会员不存在"); |
| | | } |
| | | return BeanUtils.copyBean(member, MgtMemberVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取积分明细分页列表 |
| | | * |
| | | * @param query 会员积分明细查询对象 |
| | | * @return PageDTO<MgtMemberPointsVO> |
| | | */ |
| | | @Override |
| | | public PageDTO<MgtMemberPointsVO> getMemberPoints(MgtMemberPointsQuery query) { |
| | | Page<MemberPoints> page = memberPointsService.lambdaQuery() |
| | | .eq(MemberPoints::getMemberId, query.getId()) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | return PageDTO.of(page, MgtMemberPointsVO.class); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.promotion.controller.management; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/mgt/coupon") |
| | | public class MgtCouponController { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.promotion.controller.management; |
| | | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券领取表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/mgt/coupon-member") |
| | | @Api(value = "用户端-获取用户优惠卷", tags = "用户端-获取用户优惠卷") |
| | | public class MgtCouponMemberController { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.promotion.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtPromotionBannerDTO; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtPromotionBannerQuery; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtPromotionBannerUpdDTO; |
| | | import com.ruoyi.promotion.controller.management.vo.MgtPromotionBannerVO; |
| | | import com.ruoyi.promotion.service.IPromotionBannerService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 轮播图表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/mgt/promotion-banner") |
| | | @RequiredArgsConstructor |
| | | @Api(value = "管理后台-轮播图管理相关接口", tags = "管理后台-轮播图管理相关接口") |
| | | public class MgtPromotionBannerController { |
| | | |
| | | private final IPromotionBannerService promotionBannerService; |
| | | |
| | | /** |
| | | * 获取banner列表分页数据 |
| | | * |
| | | * @param query 轮播图列表查询对象 |
| | | * @return PageDTO<MgtPromotionBannerVO> |
| | | */ |
| | | @ApiOperation("获取轮播图列表分页数据 ") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MgtPromotionBannerVO>> getBannerPage( |
| | | @Validated @RequestBody MgtPromotionBannerQuery query) { |
| | | return R.ok(promotionBannerService.getBannerPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加/编辑轮播图 |
| | | * |
| | | * @param dto 轮播图数据传输对象 |
| | | */ |
| | | @ApiOperation("添加/编辑轮播图") |
| | | @PostMapping("/save") |
| | | public R<?> savePromotionBanner(@Validated @RequestBody MgtPromotionBannerDTO dto) { |
| | | promotionBannerService.savePromotionBanner(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除轮播图 |
| | | * |
| | | * @param id 轮播图id |
| | | */ |
| | | @ApiOperation("删除轮播图") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delPromotionBanner( |
| | | @ApiParam(name = "id", value = "轮播图id", required = true) @PathVariable("id") Long id) { |
| | | promotionBannerService.delPromotionBanner(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 查看轮播图详情 |
| | | * |
| | | * @param id 轮播图id |
| | | * @return MgtPromotionBannerVO |
| | | */ |
| | | @ApiOperation("查看轮播图详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<MgtPromotionBannerVO> getPromotionBanner( |
| | | @ApiParam(name = "id", value = "轮播图id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(promotionBannerService.getPromotionBanner(id)); |
| | | } |
| | | |
| | | /** |
| | | * 轮播图 上架/下架 |
| | | * |
| | | * @param dto 轮播图状态数据传输对象 |
| | | */ |
| | | @ApiOperation("轮播图 上架/下架") |
| | | @PostMapping("/upd-status") |
| | | public R<?> updStatus(MgtPromotionBannerUpdDTO dto) { |
| | | promotionBannerService.updStatus(dto); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.promotion.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.promotion.domain.PromotionWishList; |
| | | import com.ruoyi.promotion.service.IPromotionWishListService; |
| | | import com.ruoyi.system.api.domain.dto.PromotionWishListDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import javax.annotation.Resource; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 心愿求购表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/mgt/promotion-wish-list") |
| | | @Api(value = "用户端-心愿单相关接口", tags = "用户端-心愿单相关接口", description = "用户端-心愿单相关接口") |
| | | public class MgtPromotionWishListController { |
| | | |
| | | @Resource |
| | | private IPromotionWishListService iPromotionWishListService; |
| | | |
| | | @PostMapping("/getPromotionWishList") |
| | | @ApiOperation(value = "用户端-获取心愿单列表") |
| | | public R<PageDTO<PromotionWishList>> getPromotionWishList( |
| | | @RequestBody PromotionWishListDTO promotionWishListDTO) { |
| | | return R.ok(iPromotionWishListService.getPromotionWishList(promotionWishListDTO)); |
| | | } |
| | | |
| | | @PostMapping("/savePromotionWishList") |
| | | @ApiOperation(value = "用户端-添加心愿单列表") |
| | | public R<T> savePromotionWishList(@RequestBody PromotionWishListDTO promotionWishListDTO) { |
| | | iPromotionWishListService.savePromotionWishList(promotionWishListDTO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/getPromotionWishOne") |
| | | @ApiOperation(value = "用户端-获取心愿单个") |
| | | public R<PromotionWishList> getPromotionWishOne( |
| | | @RequestBody PromotionWishListDTO promotionWishListDTO) { |
| | | return R.ok(iPromotionWishListService.getPromotionWishOne(promotionWishListDTO)); |
| | | } |
| | | |
| | | @PostMapping("/delPromotionWishOne") |
| | | @ApiOperation(value = "用户端-删除心愿单个") |
| | | public R<T> delPromotionWishOne(@RequestBody PromotionWishListDTO promotionWishListDTO) { |
| | | iPromotionWishListService.delPromotionWishOne(promotionWishListDTO); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.promotion.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.BannerTypeEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/6 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "轮播图数据传输对象", description = "轮播图数据传输对象") |
| | | public class MgtPromotionBannerDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -4704935971439543965L; |
| | | |
| | | @ApiModelProperty(value = "轮播图id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "轮播图名称") |
| | | @NotBlank(message = "轮播图不能为空") |
| | | private String bannerName; |
| | | |
| | | @ApiModelProperty(value = "轮播图类型 1=商城首页 2=资讯首页", notes = "添加必传") |
| | | private BannerTypeEnum bannerType; |
| | | |
| | | @ApiModelProperty(value = "图片") |
| | | @NotBlank(message = "图片不能为空") |
| | | private String picUrl; |
| | | |
| | | @ApiModelProperty(value = "排序 数字越大,权重越大") |
| | | @NotNull(message = "排序不能为空") |
| | | private Integer sortNum; |
| | | } |
New file |
| | |
| | | package com.ruoyi.promotion.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/6 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "轮播图列表查询对象", description = "轮播图列表查询对象") |
| | | public class MgtPromotionBannerQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = -7522813593652423582L; |
| | | |
| | | @ApiModelProperty(value = "轮播图名称") |
| | | private String bannerName; |
| | | |
| | | @ApiModelProperty("上架状态 上架中 已下架") |
| | | private ListingStatusEnum listingStatus; |
| | | } |
New file |
| | |
| | | package com.ruoyi.promotion.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/6 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "轮播图状态数据传输对象", description = "轮播图状态数据传输对象") |
| | | public class MgtPromotionBannerUpdDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 6029452666679276625L; |
| | | |
| | | @ApiModelProperty(value = "轮播图id") |
| | | @NotNull(message = "轮播图id不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("上架状态 上架中 已下架") |
| | | @NotNull(message = "上架状态不能为空") |
| | | private ListingStatusEnum listingStatus; |
| | | } |
New file |
| | |
| | | package com.ruoyi.promotion.controller.management.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.enums.BannerTypeEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/6 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "轮播图视图对象", description = "轮播图视图对象") |
| | | public class MgtPromotionBannerVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -6660029413001641863L; |
| | | |
| | | @ApiModelProperty(value = "轮播图id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "轮播图名称") |
| | | private String bannerName; |
| | | |
| | | @ApiModelProperty(value = "轮播图类型 1=商城首页 2=资讯首页") |
| | | private BannerTypeEnum bannerType; |
| | | |
| | | @ApiModelProperty(value = "图片") |
| | | private String picUrl; |
| | | |
| | | @ApiModelProperty(value = "排序 数字越大,权重越大") |
| | | private Integer sortNum; |
| | | |
| | | @ApiModelProperty("上架状态 上架中 已下架") |
| | | private ListingStatusEnum listingStatus; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.enums.BannerTypeEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | |
| | | @ApiModelProperty(value = "排序 数字越大,权重越大") |
| | | private Integer sortNum; |
| | | |
| | | @ApiModelProperty("上架状态 上架中 已下架") |
| | | private ListingStatusEnum listingStatus; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField(value = "create_by", fill = FieldFill.INSERT) |
| | | private String createBy; |
| | |
| | | package com.ruoyi.promotion.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtPromotionBannerDTO; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtPromotionBannerQuery; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtPromotionBannerUpdDTO; |
| | | import com.ruoyi.promotion.controller.management.vo.MgtPromotionBannerVO; |
| | | import com.ruoyi.promotion.domain.PromotionBanner; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | List<PromotionBanner> getBaanerList(Integer bannerType); |
| | | |
| | | /** |
| | | * 获取banner列表分页数据 |
| | | * |
| | | * @param query 轮播图列表查询对象 |
| | | * @return PageDTO<MgtPromotionBannerVO> |
| | | */ |
| | | PageDTO<MgtPromotionBannerVO> getBannerPage(MgtPromotionBannerQuery query); |
| | | |
| | | /** |
| | | * 添加/编辑轮播图 |
| | | * |
| | | * @param dto 轮播图数据传输对象 |
| | | */ |
| | | void savePromotionBanner(MgtPromotionBannerDTO dto); |
| | | |
| | | /** |
| | | * 删除轮播图 |
| | | * |
| | | * @param id 轮播图id |
| | | */ |
| | | void delPromotionBanner(Long id); |
| | | |
| | | /** |
| | | * 查看轮播图详情 |
| | | * |
| | | * @param id 轮播图id |
| | | * @return MgtPromotionBannerVO |
| | | */ |
| | | MgtPromotionBannerVO getPromotionBanner(Long id); |
| | | |
| | | /** |
| | | * 轮播图 上架/下架 |
| | | * |
| | | * @param dto 轮播图状态数据传输对象 |
| | | */ |
| | | void updStatus(MgtPromotionBannerUpdDTO dto); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtPromotionBannerDTO; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtPromotionBannerQuery; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtPromotionBannerUpdDTO; |
| | | import com.ruoyi.promotion.controller.management.vo.MgtPromotionBannerVO; |
| | | import com.ruoyi.promotion.domain.PromotionBanner; |
| | | import com.ruoyi.promotion.mapper.PromotionBannerMapper; |
| | | import com.ruoyi.promotion.service.IPromotionBannerService; |
| | |
| | | LambdaQueryWrapper<PromotionBanner> wrapper= Wrappers.lambdaQuery(); |
| | | wrapper.eq(PromotionBanner::getBannerType,bannerType); |
| | | wrapper.eq(PromotionBanner::getDelFlag,0); |
| | | wrapper.eq(PromotionBanner::getListingStatus, ListingStatusEnum.ON_SHELVES); |
| | | wrapper.orderByDesc(PromotionBanner::getSortNum); |
| | | return this.list(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageDTO<MgtPromotionBannerVO> getBannerPage(MgtPromotionBannerQuery query) { |
| | | Page<PromotionBanner> page = this.lambdaQuery() |
| | | .eq(StringUtils.isNotNull(query.getListingStatus()), |
| | | PromotionBanner::getListingStatus, query.getListingStatus()) |
| | | .like(StringUtils.isNotBlank(query.getBannerName()), PromotionBanner::getBannerName, |
| | | query.getBannerName()) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | return PageDTO.of(page, MgtPromotionBannerVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 添加/编辑轮播图 |
| | | * |
| | | * @param dto 轮播图数据传输对象 |
| | | */ |
| | | @Override |
| | | public void savePromotionBanner(MgtPromotionBannerDTO dto) { |
| | | PromotionBanner promotionBanner = BeanUtils.copyBean(dto, PromotionBanner.class); |
| | | // 添加 |
| | | if (StringUtils.isNull(promotionBanner.getId())) { |
| | | if (StringUtils.isNull(promotionBanner.getBannerType())) { |
| | | throw new ServiceException("轮播图类型不能为空"); |
| | | } |
| | | this.save(promotionBanner); |
| | | } else { |
| | | // 更新 |
| | | this.updateById(promotionBanner); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除轮播图 |
| | | * |
| | | * @param id 轮播图id |
| | | */ |
| | | @Override |
| | | public void delPromotionBanner(Long id) { |
| | | this.removeById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查看轮播图详情 |
| | | * |
| | | * @param id 轮播图id |
| | | * @return MgtPromotionBannerVO |
| | | */ |
| | | @Override |
| | | public MgtPromotionBannerVO getPromotionBanner(Long id) { |
| | | PromotionBanner promotionBanner = this.getById(id); |
| | | if (StringUtils.isNull(promotionBanner)) { |
| | | throw new ServiceException("轮播图不存在"); |
| | | } |
| | | return BeanUtils.copyBean(promotionBanner, MgtPromotionBannerVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 轮播图 上架/下架 |
| | | * |
| | | * @param dto 轮播图状态数据传输对象 |
| | | */ |
| | | @Override |
| | | public void updStatus(MgtPromotionBannerUpdDTO dto) { |
| | | this.lambdaUpdate().set(PromotionBanner::getListingStatus, dto.getListingStatus()) |
| | | .eq(PromotionBanner::getId, dto.getId()).update(); |
| | | } |
| | | } |
| | |
| | | private String phonenumber; |
| | | |
| | | @ApiModelProperty("登录密码") |
| | | @NotBlank(message = "登录密码不能为空") |
| | | private String password; |
| | | } |
| | |
| | | |
| | | @Async |
| | | public void autoEndAuctionGoods(Long id) { |
| | | log.info("autoEndAuctionGoods scheduler task is running :{}", id); |
| | | auctionClient.endAuctionGoods(id, SecurityConstants.INNER); |
| | | } |
| | | |
| | | @Async |
| | | public void autoStartAuctionGoods(Long id) { |
| | | log.info("autoStartAuctionGoods scheduler task is running :{}", id); |
| | | auctionClient.startAuctionGoods(id, SecurityConstants.INNER); |
| | | } |
| | | |