From a17335c7cddc86ffe70d423e7e6e7456b1d6c93a Mon Sep 17 00:00:00 2001 From: phpcjl <phpcjl@gmail.com> Date: 星期二, 10 十二月 2024 15:15:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/SystemConfigClient.java | 5 + ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java | 26 ++++++++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java | 2 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserSignRecord.java | 4 + ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipGoodClient.java | 4 + ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserSignRecordController.java | 32 +++++++++- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java | 10 +++ ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java | 4 + ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java | 14 ++++ ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipGoodClientFallbackFactory.java | 7 ++ ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/SystemConfigClientFallbackFactory.java | 7 ++ ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/SignBackRDto.java | 12 ++++ 12 files changed, 122 insertions(+), 5 deletions(-) diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java index e69dde2..9d92ba2 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java @@ -234,6 +234,10 @@ @TableField(exist = false) private Long count7; + @ApiModelProperty("是否签到1是0否") + @TableField(exist = false) + private Integer isSign; + diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserSignRecord.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserSignRecord.java index 915f285..a1d6e36 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserSignRecord.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserSignRecord.java @@ -45,6 +45,10 @@ @TableField("red_amount") private BigDecimal redAmount; + @ApiModelProperty(value = "红包金额") + @TableField("point") + private BigDecimal point; + @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/SystemConfigClientFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/SystemConfigClientFallbackFactory.java index 7578e37..a5a2a97 100644 --- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/SystemConfigClientFallbackFactory.java +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/SystemConfigClientFallbackFactory.java @@ -5,6 +5,8 @@ import com.ruoyi.other.api.feignClient.SystemConfigClient; import org.springframework.cloud.openfeign.FallbackFactory; +import java.math.BigDecimal; + /** * @author zhibing.pu * @Date 2024/11/29 15:58 @@ -17,6 +19,11 @@ public R<SystemConfig> getSystemConfig(Integer type) { return R.fail("根据类型获取系统配置失败:" + cause.getMessage()); } + + @Override + public R<BigDecimal> redPackegeSet() { + return R.fail("根据红包配置失败:" + cause.getMessage()); + } }; } } diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipGoodClientFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipGoodClientFallbackFactory.java index 4d6bb47..801d402 100644 --- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipGoodClientFallbackFactory.java +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipGoodClientFallbackFactory.java @@ -2,6 +2,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.VipGood; +import com.ruoyi.other.api.domain.VipSetting; import com.ruoyi.other.api.feignClient.VipGoodClient; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.web.bind.annotation.GetMapping; @@ -17,6 +18,12 @@ public R<List<VipGood>> getVipGoodsByVipId(Integer vipId) { return R.fail("根据会员id获取会员购买商品失败:" + cause.getMessage()); } + + @Override + public R<VipSetting> getVipSettingById(Integer id) { + return R.fail("根据会员id获取会员失败:" + cause.getMessage()); + + } }; } } diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/SystemConfigClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/SystemConfigClient.java index 7224646..f9c1900 100644 --- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/SystemConfigClient.java +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/SystemConfigClient.java @@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.math.BigDecimal; + /** * @author zhibing.pu * @Date 2024/11/29 15:58 @@ -24,4 +26,7 @@ @PostMapping("/system-config/getSystemConfig") R<SystemConfig> getSystemConfig(@RequestParam("type") Integer type); + @PostMapping("/red-packege-set/get") + R<BigDecimal> redPackegeSet(); + } diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipGoodClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipGoodClient.java index 887f3af..3d36170 100644 --- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipGoodClient.java +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipGoodClient.java @@ -3,6 +3,7 @@ import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.VipGood; +import com.ruoyi.other.api.domain.VipSetting; import com.ruoyi.other.api.factory.VipGoodClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; @@ -15,4 +16,7 @@ @GetMapping("/vip-good/getVipGoodsByVipId") public R<List<VipGood>> getVipGoodsByVipId(@RequestParam("subscribeId") Integer vipId); + + @GetMapping("/vip-setting/getVipSettingById") + public R<VipSetting> getVipSettingById(@RequestParam("id") Integer id); } diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java index df6bffd..d344763 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java @@ -4,9 +4,11 @@ import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.api.model.UserCancellationLog; import com.ruoyi.account.api.model.UserCoupon; +import com.ruoyi.account.api.model.UserSignRecord; import com.ruoyi.account.service.AppUserService; import com.ruoyi.account.service.UserCancellationLogService; import com.ruoyi.account.service.UserCouponService; +import com.ruoyi.account.service.UserSignRecordService; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.security.service.TokenService; @@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.time.LocalDate; import java.util.List; import com.ruoyi.account.vo.*; @@ -49,6 +52,9 @@ private StoreClient storeClient; @Resource private UserCouponService userCouponService; + + @Resource + private UserSignRecordService userSignRecordService; @ResponseBody @@ -150,6 +156,14 @@ public R<AppUser> info(){ Long userId = tokenService.getLoginUserApplet().getUserid(); AppUser user = appUserService.getById(userId); + + List<UserSignRecord> list = userSignRecordService.lambdaQuery().eq(UserSignRecord::getSignDay, LocalDate.now()).list(); + if (!list.isEmpty()){ + user.setIsSign(1); + }else { + user.setIsSign(0); + } + return R.ok(user); } @Resource diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserSignRecordController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserSignRecordController.java index cff28d8..69454cb 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserSignRecordController.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserSignRecordController.java @@ -3,9 +3,16 @@ import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.api.model.UserSignRecord; +import com.ruoyi.account.dto.SignBackRDto; +import com.ruoyi.account.service.AppUserService; import com.ruoyi.account.service.UserSignRecordService; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.security.service.TokenService; +import com.ruoyi.other.api.domain.PointSetting; +import com.ruoyi.other.api.domain.VipSetting; +import com.ruoyi.other.api.feignClient.PointSettingClient; +import com.ruoyi.other.api.feignClient.SystemConfigClient; +import com.ruoyi.other.api.feignClient.VipGoodClient; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.GetMapping; @@ -32,18 +39,37 @@ @Resource private UserSignRecordService userSignRecordService; @Resource + private AppUserService appUserService; + @Resource private TokenService tokenService; + @Resource + private PointSettingClient pointSettingClient; + @Resource + private SystemConfigClient systemConfigClient; @ResponseBody @GetMapping("/sign") @ApiOperation(value = "签到", tags = {"小程序-签到"}) - public R<AppUser> change(){ + public R<SignBackRDto> sign(){ Long userId1 = tokenService.getLoginUserApplet().getUserid(); + AppUser byId = appUserService.getById(userId1); + //获取当前用户的会员信息 + R<PointSetting> pointSetting = pointSettingClient.getPointSetting(byId.getVipId()); UserSignRecord userSignRecord = new UserSignRecord(); userSignRecord.setAppUserId(userId1); userSignRecord.setCreateTime(LocalDateTime.now()); - userSignRecord.setRedAmount(new BigDecimal(0)); + if (pointSetting.getData() != null) { + userSignRecord.setPoint(pointSetting.getData().getSignPoint()); + }else { + userSignRecord.setPoint(BigDecimal.ZERO); + } + R<BigDecimal> bigDecimalR = systemConfigClient.redPackegeSet(); + userSignRecord.setRedAmount(bigDecimalR.getData()); userSignRecord.setSignDay(LocalDate.now()); - return R.ok(); + + SignBackRDto signBackRDto = new SignBackRDto(); + signBackRDto.setPoint(userSignRecord.getPoint()); + signBackRDto.setRedAmount(userSignRecord.getRedAmount()); + return R.ok(signBackRDto); } } diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/SignBackRDto.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/SignBackRDto.java new file mode 100644 index 0000000..0f3fb03 --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/SignBackRDto.java @@ -0,0 +1,12 @@ +package com.ruoyi.account.dto; + +import lombok.Data; +import org.apache.poi.hpsf.Decimal; + +import java.math.BigDecimal; + +@Data +public class SignBackRDto { + private BigDecimal point; + private BigDecimal redAmount; +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java index 43cc2f6..7ee1c06 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java @@ -1,9 +1,20 @@ package com.ruoyi.other.controller; +import com.ruoyi.account.api.model.AppUser; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.other.api.domain.RedPackegeSet; +import com.ruoyi.other.service.RedPackegeSetService; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.time.LocalDateTime; /** * <p> @@ -16,6 +27,21 @@ @RestController @RequestMapping("/red-packege-set") public class RedPackegeSetController { + @Resource + private RedPackegeSetService redPackegeSetService; + //获取当前生效的红包设置 + @ResponseBody + @GetMapping("/get") + public R<BigDecimal> get(){ + LocalDateTime now = LocalDateTime.now(); + RedPackegeSet one = redPackegeSetService.lambdaQuery().le(RedPackegeSet::getStartTime, now).ge(RedPackegeSet::getEndTime, now).one(); + if (one!=null){ + return R.ok(one.getPackegeAmount()); + }else { + return R.ok(BigDecimal.ZERO); + + } + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java index 8f00eca..067517f 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java @@ -144,7 +144,7 @@ @ApiOperation(value = "列表", tags = {"后台-分享管理"}) @GetMapping("/manage/list") public R<Page<Share>> managelist(String name,Integer addType,@RequestParam Integer PageNum,Integer pageSize){ - Page<Share> page = shareService.lambdaQuery().like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(PageNum, pageSize)); + Page<Share> page = shareService.lambdaQuery().eq(Share::getAuditStatus,1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageSize, pageSize)); return R.ok(page); } @@ -167,6 +167,14 @@ } + @ApiOperation(value = "列表", tags = {"后台-分享管理-审核"}) + @GetMapping("/manage/auth/list") + public R<Page<Share>> authmanagelist(String name,Integer addType,@RequestParam Integer PageNum,Integer pageSize){ + Page<Share> page = shareService.lambdaQuery().ne(Share::getAuditStatus,1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageSize, pageSize)); + return R.ok(page); + } + + diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java index 4af566f..733f887 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java @@ -92,7 +92,7 @@ @GetMapping("getVipSettingById") @ApiOperation(value = "获取会员设置") - public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") @RequestParam Integer id) { + public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") @RequestParam("id") Integer id) { return R.ok(vipSettingService.getById(id)); } } -- Gitblit v1.7.1