| | |
| | | @ApiModelProperty(value = "可用积分") |
| | | @TableField("available_point") |
| | | private Integer availablePoint; |
| | | |
| | | @ApiModelProperty(value = "可转增积分") |
| | | @TableField("transferable_point") |
| | | private Integer transferablePoint; |
| | | |
| | | @ApiModelProperty(value = "是否可更换推广人(0=否,1=是)") |
| | | @TableField("change_promoter") |
| | |
| | | package com.ruoyi.other.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_goods") |
| | | @ApiModel(value="Goods对象", description="") |
| | | public class Goods implements Serializable { |
| | | public class Goods extends BasePage implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @TableField("sale_num") |
| | | private Integer saleNum; |
| | | |
| | | @ApiModelProperty(value = "商品权限 逗号分隔(0=全部,1=游客,2=普通会员,3=黄金会员,4=钻石会员,5=准代理,6=代理,7=总代,8=合伙人)") |
| | | @ApiModelProperty(value = "商品权限 逗号分隔(-1=全部,0=游客,1=普通会员,2=黄金会员,3=钻石会员,4=准代理,5=代理,6=总代,7=合伙人)") |
| | | @TableField("commodity_authority") |
| | | private String commodityAuthority; |
| | | |
| | |
| | | package com.ruoyi.common.core.web.page; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | * 分页参数,当前页码 |
| | | */ |
| | | @ApiModelProperty(value = "分页参数,当前页码") |
| | | @TableField(exist = false) |
| | | private Integer pageCurr = 1; |
| | | /** |
| | | * 分页参数,每页数量 |
| | | */ |
| | | @ApiModelProperty(value = "分页参数,每页数量,默认为10") |
| | | @TableField(exist = false) |
| | | private Integer pageSize = 10; |
| | | |
| | | public Integer getPageCurr() { |
| | |
| | | user.setShopName(storeById.getData().getName()); |
| | | } |
| | | } |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getTopInviteId, 1).count(); |
| | | Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getInviteUserId, userId).count(); |
| | | user.setCount1(count1); |
| | | user.setCount2(count2); |
| | | user.setCount3(count3); |
| | |
| | | //推广人 |
| | | if (byId.getInviteUserId() != null) { |
| | | AppUser byId1 = appUserService.getById(byId.getInviteUserId()); |
| | | byId.setInviteUserName(byId1.getInviteUserName()); |
| | | byId.setInviteUserName(byId1.getName()); |
| | | } |
| | | //最后下单时间 |
| | | R<Order> lastOrder = remoteOrderGoodsClient.getLastOrder(id); |
| | | if (lastOrder.getData() != null) { |
| | | byId.setLastOrderTime(lastOrder.getData().getCreateTime()); |
| | | } |
| | | List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, id).list(); |
| | | byId.setBottomUsers(list); |
| | | //消费总金额 |
| | | return R.ok(byId); |
| | | } |
| | |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | if(null != pointSetting){ |
| | | Integer everySharePoint = pointSetting.getEverySharePoint(); |
| | | Integer everySharePoint1 = everySharePoint; |
| | | Integer everySharePoint1 = 0; |
| | | if(1 == pointSetting.getWorkPointOpen()){ |
| | | everySharePoint1 = new BigDecimal(everySharePoint1).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | everySharePoint1 = new BigDecimal(everySharePoint).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + everySharePoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + everySharePoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + everySharePoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getWorkPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + everySharePoint1); |
| | | } |
| | | appUser.setTotalSharePoint(appUser.getTotalSharePoint() + everySharePoint); |
| | | appUserService.updateById(appUser); |
| | | //添加积分变动记录 |
| | |
| | | userSignRecord.setPoint(pointSetting.getSignPoint()); |
| | | int signPoint = pointSetting.getSignPoint(); |
| | | if(signPoint > 0){ |
| | | int signPoint1 = signPoint; |
| | | int signPoint1 = 0; |
| | | if(1 == pointSetting.getWorkPointOpen()){ |
| | | signPoint1 = new BigDecimal(signPoint1).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | signPoint1 = new BigDecimal(signPoint).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + signPoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + signPoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + signPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getWorkPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + signPoint1); |
| | | } |
| | | appUser.setTotalSignPoint(appUser.getTotalSignPoint() + signPoint); |
| | | appUserService.updateById(appUser); |
| | | |
| | |
| | | @Data |
| | | public class BalanceQuery { |
| | | @ApiModelProperty("用户名称") |
| | | private String name; |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | private String userPhone; |
| | | @ApiModelProperty("类型:1充值2提现3红包4分佣5商城购物") |
| | | private Integer changeType; |
| | | |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class UserChangeQuery { |
| | | @ApiModelProperty("用户名称") |
| | | private String name; |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty(value = "变更类型 0降级1升级") |
| | | @TableField("change_type") |
| | | private Integer changeType; |
| | | |
| | | private LocalDate localDate1; |
| | | private LocalDate localDate2; |
| | | private LocalDateTime localDate1; |
| | | private LocalDateTime localDate2; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | |
| | |
| | | appUser.setTotalDistributionAmount(BigDecimal.ZERO); |
| | | appUser.setBalance(BigDecimal.ZERO); |
| | | //新用户才能奖励积分,老用户注销重新注册没有 |
| | | AppUser old = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, registerAccount.getPhone()).eq(AppUser::getDelFlag, 0)); |
| | | long old = this.count(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, registerAccount.getPhone()).eq(AppUser::getDelFlag, 0)); |
| | | R<PointSetting> pointSettingR = pointSettingClient.getPointSetting(1); |
| | | if (R.isError(pointSettingR)){ |
| | | throw new RuntimeException("获取积分设置失败"); |
| | |
| | | throw new RuntimeException("积分设置不存在"); |
| | | } |
| | | Integer regisPoint = pointSetting.getRegisPoint(); |
| | | if(null == old){ |
| | | Integer regisPoint1 = regisPoint; |
| | | if(0 == old){ |
| | | Integer regisPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(1 == pointSetting.getGetRegisPointOpen()){ |
| | | regisPoint1 = new BigDecimal(regisPoint1).multiply(pointSetting.getGetRegisPoint().divide(new BigDecimal(100))).intValue(); |
| | | regisPoint1 = new BigDecimal(regisPoint).multiply(pointSetting.getGetRegisPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | appUser.setLavePoint(regisPoint); |
| | | appUser.setAvailablePoint(regisPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getGetRegisPointGift()){ |
| | | appUser.setTransferablePoint(regisPoint1); |
| | | } |
| | | appUser.setTotalRegisterPoint(regisPoint); |
| | | appUser.setTotalPoint(regisPoint); |
| | | } |
| | |
| | | } |
| | | this.save(appUser); |
| | | //增加积分变动记录 |
| | | if(null == old && regisPoint > 0){ |
| | | if(0 == old && regisPoint > 0){ |
| | | //构建积分流水记录 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(7); |
| | |
| | | //拉新分佣 |
| | | if(null != appUser2){ |
| | | Integer newPoint = pointSetting.getNewPoint(); |
| | | Integer newPoint1 = newPoint; |
| | | Integer newPoint1 = 0; |
| | | if(1 == pointSetting.getGetRegisPointOpen()){ |
| | | newPoint1 = new BigDecimal(newPoint1).multiply(pointSetting.getGetRegisPoint().divide(new BigDecimal(100))).intValue(); |
| | | newPoint1 = new BigDecimal(newPoint).multiply(pointSetting.getGetRegisPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | appUser2.setLavePoint(appUser2.getLavePoint() + newPoint); |
| | | appUser2.setAvailablePoint(appUser2.getAvailablePoint() + newPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getGetRegisPointGift()){ |
| | | appUser2.setTransferablePoint(appUser2.getTransferablePoint() + newPoint1); |
| | | } |
| | | appUser2.setTotalInvitePoint(appUser2.getTotalInvitePoint() + newPoint); |
| | | appUser2.setTotalPoint(appUser2.getTotalPoint() + newPoint); |
| | | this.updateById(appUser2); |
| | |
| | | AppUser appUser3 = this.getById(appUser2.getInviteUserId()); |
| | | appUser3.setLavePoint(appUser3.getLavePoint() + newPoint); |
| | | appUser3.setAvailablePoint(appUser3.getAvailablePoint() + newPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getGetRegisPointGift()){ |
| | | appUser3.setTransferablePoint(appUser3.getTransferablePoint() + newPoint1); |
| | | } |
| | | appUser3.setTotalInvitePoint(appUser3.getTotalInvitePoint() + newPoint); |
| | | appUser3.setTotalPoint(appUser3.getTotalPoint() + newPoint); |
| | | this.updateById(appUser3); |
| | |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | if(null != pointSetting){ |
| | | int hourPoint = pointSetting.getHourPoint().intValue(); |
| | | int hourPoint1 = hourPoint; |
| | | int hourPoint1 = 0; |
| | | if(1 == pointSetting.getWorkPointOpen()){ |
| | | hourPoint1 = new BigDecimal(hourPoint1).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | hourPoint1 = new BigDecimal(hourPoint).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + hourPoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + hourPoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + hourPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getWorkPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + hourPoint1); |
| | | } |
| | | appUser.setTotalHourPoint(appUser.getTotalHourPoint() + hourPoint); |
| | | this.updateById(appUser); |
| | | //添加积分变动记录 |
| | |
| | | from t_balance_change_record t1 |
| | | left join t_app_user t2 on t1.app_user_id = t2.id |
| | | <where> |
| | | <if test="agentQuery.name != null and agentQuery.name != ''"> |
| | | and t2.name like concat('%',#{agentQuery.name},'%') |
| | | <if test="agentQuery.userName != null and agentQuery.userName != ''"> |
| | | and t2.name like concat('%',#{agentQuery.userName},'%') |
| | | </if> |
| | | <if test="agentQuery.phone != null and agentQuery.phone != ''"> |
| | | and t2.phone like concat('%',#{agentQuery.phone},'%') |
| | | <if test="agentQuery.userPhone != null and agentQuery.userPhone != ''"> |
| | | and t2.phone like concat('%',#{agentQuery.userPhone},'%') |
| | | </if> |
| | | <if test="agentQuery.changeType != null"> |
| | | and t1.change_type = #{agentQuery.changeType} |
| | |
| | | from t_user_change_log t1 |
| | | LEFT JOIN t_app_user t2 on t1.app_user_id = t2.id |
| | | <where> |
| | | <if test="userChangeLog.name !=null and userChangeLog.name !=''"> |
| | | and t2.name like concat('%',#{userChangeLog.name},'%') |
| | | <if test="userChangeLog.userName !=null and userChangeLog.userName !=''"> |
| | | and t2.name like concat('%',#{userChangeLog.userName},'%') |
| | | </if> |
| | | <if test="userChangeLog.phone !=null and userChangeLog.phone !=''"> |
| | | and t2.phone like concat('%',#{userChangeLog.phone},'%') |
| | | <if test="userChangeLog.userPhone !=null and userChangeLog.userPhone !=''"> |
| | | and t2.phone like concat('%',#{userChangeLog.userPhone},'%') |
| | | </if> |
| | | <if test="userChangeLog.changeType !=null"> |
| | | and t1.change_type = #{userChangeLog.phone.changeType} |
| | | and t1.change_type = #{userChangeLog.changeType} |
| | | </if> |
| | | <if test="userChangeLog.localDate1 !=null"> |
| | | and DATE(t1.create_time) between #{userChangeLog.localDate1} and #{userChangeLog.localDate2} |
| | | and t1.create_time between #{userChangeLog.localDate1} and #{userChangeLog.localDate2} |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | if (CollectionUtil.isNotEmpty(goodsShops)){ |
| | | for (GoodsShop goodsShop : goodsShops) { |
| | | R<Shop> shopR = shopClient.getShopById(goodsShop.getShopId()); |
| | | if (R.isSuccess(shopR)){ |
| | | if (R.isSuccess(shopR) && null != shopR.getData()){ |
| | | VerifiableShopVo verifiableShopVo = new VerifiableShopVo(); |
| | | verifiableShopVo.setId(shopR.getData().getId()); |
| | | verifiableShopVo.setName(shopR.getData().getName()); |
| | |
| | | } |
| | | if(ztsj_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = ztsj_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getSharePointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(ztsj_point).multiply(pointSetting.getSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | inviteUser.setSharePoint(inviteUser.getSharePoint() + ztsj_point); |
| | | inviteUser.setLavePoint(inviteUser.getLavePoint() + ztsj_point); |
| | | inviteUser.setAvailablePoint(inviteUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getSharePointGift()){ |
| | | inviteUser.setTransferablePoint(inviteUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | inviteUser.setTotalPoint(inviteUser.getTotalPoint() + ztsj_point); |
| | | } |
| | | appUserClient.editAppUserById(inviteUser); |
| | |
| | | } |
| | | if(zbsj_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = zbsj_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getSharePointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(zbsj_point).multiply(pointSetting.getSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | superiorLeader.setSharePoint(superiorLeader.getSharePoint() + zbsj_point); |
| | | superiorLeader.setLavePoint(superiorLeader.getLavePoint() + zbsj_point); |
| | | superiorLeader.setAvailablePoint(superiorLeader.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getSharePointGift()){ |
| | | superiorLeader.setTransferablePoint(superiorLeader.getTransferablePoint() + earnPoint1); |
| | | } |
| | | superiorLeader.setTotalPoint(superiorLeader.getTotalPoint() + zbsj_point); |
| | | } |
| | | appUserClient.editAppUserById(superiorLeader); |
| | |
| | | } |
| | | if(hxmd_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = hxmd_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getShopPointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getShopPoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(hxmd_point).multiply(pointSetting.getShopPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | shopAppUser.setLavePoint(shopAppUser.getLavePoint() + hxmd_point); |
| | | shopAppUser.setAvailablePoint(shopAppUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getShopPointGift()){ |
| | | shopAppUser.setTransferablePoint(shopAppUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | shopAppUser.setTotalPoint(shopAppUser.getTotalPoint() + hxmd_point); |
| | | shopAppUser.setShopAchievementPoint(shopAppUser.getShopAchievementPoint() + hxmd_point); |
| | | //门店返佣 |
| | |
| | | Integer lavePoint = technicianAppUser.getLavePoint(); |
| | | if(js_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = js_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getPersonPointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getPersonPoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(js_point).multiply(pointSetting.getPersonPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | technicianAppUser.setLavePoint(technicianAppUser.getLavePoint() + js_point); |
| | | technicianAppUser.setAvailablePoint(technicianAppUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getPersonPointGift()){ |
| | | technicianAppUser.setTransferablePoint(technicianAppUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | technicianAppUser.setTotalPoint(technicianAppUser.getTotalPoint() + js_point); |
| | | technicianAppUser.setTotalPerformancePoint(technicianAppUser.getTotalPerformancePoint() + js_point); |
| | | } |
| | |
| | | } |
| | | if(bdmd_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = bdmd_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getShopSharePointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getShopSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(bdmd_point).multiply(pointSetting.getShopSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | bdShopAppUser.setLavePoint(bdShopAppUser.getLavePoint() + bdmd_point); |
| | | bdShopAppUser.setAvailablePoint(bdShopAppUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getShopSharePointGift()){ |
| | | bdShopAppUser.setTransferablePoint(bdShopAppUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | bdShopAppUser.setTotalPoint(bdShopAppUser.getTotalPoint() + bdmd_point); |
| | | bdShopAppUser.setShopSharePoint(bdShopAppUser.getShopSharePoint() + bdmd_point); |
| | | //门店返佣 |
| | |
| | | } |
| | | if(bdmdsj_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = bdmdsj_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getShopSharePointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getShopSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(bdmdsj_point).multiply(pointSetting.getShopSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | sjShopAppUser.setLavePoint(sjShopAppUser.getLavePoint() + bdmdsj_point); |
| | | sjShopAppUser.setAvailablePoint(sjShopAppUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getShopSharePointGift()){ |
| | | sjShopAppUser.setTransferablePoint(sjShopAppUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | sjShopAppUser.setTotalPoint(sjShopAppUser.getTotalPoint() + bdmdsj_point); |
| | | sjShopAppUser.setLowerLevelSharePoint(sjShopAppUser.getLowerLevelSharePoint() + bdmdsj_point); |
| | | //门店返佣 |
| | |
| | | orderMoney = orderMoney.add(myShoppingCartVo.getCash().multiply(new BigDecimal(myShoppingCartVo.getNumber()))); |
| | | } |
| | | }else{ |
| | | orderPoint = goodsList.stream().mapToInt(MyShoppingCartVo::getPoint).sum(); |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | orderPoint += (myShoppingCartVo.getPoint() * myShoppingCartVo.getNumber()); |
| | | } |
| | |
| | | //构建积分流水记录 |
| | | if(earnPoint > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = earnPoint; |
| | | int earnPoint1 = 0; |
| | | if(null != pointSetting && 1 == pointSetting.getBuyPointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getBuyPoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(earnPoint).multiply(pointSetting.getBuyPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | appUser.setShopPoint(appUser.getShopPoint() + earnPoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + earnPoint); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + earnPoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getBuyPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | |
| | | if(3 == shoppingCartPayment.getPaymentType()){ |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = earnPoint; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getBuyPointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getBuyPoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(earnPoint).multiply(pointSetting.getBuyPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | //扣减订单支付积分 |
| | | appUser.setLavePoint(appUser.getLavePoint() - orderPoint); |
| | |
| | | appUser.setShopPoint(appUser.getShopPoint() + earnPoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + earnPoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getBuyPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + earnPoint); |
| | | appUser.setLastShopTime(LocalDateTime.now()); |
| | | appUserClient.editAppUserById(appUser); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | |
| | | */ |
| | | @GetMapping("/goodsList") |
| | | @ApiOperation(value = "热门商品列表", tags = {"小程序-商城-首页", "小程序-首页"}) |
| | | public R<TableDataInfo> goodsList(Goods goods){ |
| | | startPage(); |
| | | return R.ok(getDataTable(goodsService.goodsList(goods))); |
| | | public R<PageInfo<GoodsVO>> goodsList(Goods goods){ |
| | | return R.ok(goodsService.goodsList(goods)); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @GetMapping("/getGoodsListByShopId") |
| | | @ApiOperation(value = "商品购买列表", tags = {"小程序-首页-门店详情"}) |
| | | public R<TableDataInfo> getGoodsListByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { |
| | | startPage(); |
| | | return R.ok(getDataTable(goodsService.getGoodsListByShopId(shopId))); |
| | | public R<PageInfo<Goods>> getGoodsListByShopId(@ApiParam("门店id") Integer shopId, Integer pageCurr, Integer pageSize) { |
| | | PageInfo<Goods> pageInfo = new PageInfo(pageCurr, pageSize); |
| | | List<Goods> goodsList = goodsService.getGoodsListByShopId(pageInfo, shopId); |
| | | return R.ok(pageInfo.setRecords(goodsList)); |
| | | } |
| | | |
| | | |
| | |
| | | List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).list(); |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId()); |
| | | goodsEvaluate.setUserName(appUserById.getName()); |
| | | goodsEvaluate.setAvatar(appUserById.getAvatar()); |
| | | goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId())); |
| | | if(null != appUserById){ |
| | | goodsEvaluate.setUserName(appUserById.getName()); |
| | | goodsEvaluate.setAvatar(appUserById.getAvatar()); |
| | | goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId())); |
| | | } |
| | | } |
| | | return R.ok(list); |
| | | } |
| | |
| | | |
| | | private void buildDetail(GoodsEvaluate item) { |
| | | AppUser appUser = appUserClient.getAppUserById(item.getAppUserId()); |
| | | if (appUser == null){ |
| | | throw new RuntimeException("获取用户信息失败"); |
| | | if (appUser != null){ |
| | | item.setPhone(appUser.getPhone()); |
| | | item.setUserName(appUser.getName()); |
| | | } |
| | | Goods goods = goodsService.getById(item.getGoodsId()); |
| | | item.setGoodsName(goods.getName()); |
| | | item.setPhone(appUser.getPhone()); |
| | | item.setUserName(appUser.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsShop; |
| | | import com.ruoyi.other.api.vo.GetGoodsShopByGoodsIds; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.service.GoodsShopService; |
| | | import com.ruoyi.other.vo.ShopGoodsList; |
| | | import com.ruoyi.other.vo.ShopGoodsListVo; |
| | |
| | | |
| | | @Resource |
| | | private GoodsShopService goodsShopService; |
| | | |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @since 2024-11-20 |
| | | */ |
| | | public interface GoodsMapper extends BaseMapper<Goods> { |
| | | List<Goods> selectListByShopId(@Param("shopId") Integer shopId,@Param("vip") Integer vip); |
| | | List<Goods> selectListByShopId(PageInfo<Goods> pageInfo, @Param("shopId") Integer shopId,@Param("vip") Integer vip); |
| | | |
| | | IPage<Goods> selectManageGoodsList(@Param("page") IPage<Goods> page, @Param("goods") Goods goods); |
| | | |
| | | |
| | | /** |
| | | * 获取商品列表 |
| | | * @param pageInfo |
| | | * @param goodsCategoryId |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<GoodsVO> goodsList(PageInfo<GoodsVO> pageInfo, @Param("goodsCategoryId") Integer goodsCategoryId, @Param("name") String name); |
| | | } |
| | |
| | | |
| | | IPage<SeckillActivityVO> querySeckillActivity(@Param("page") Page<SeckillActivityVO> page,@Param("goods") Goods goods); |
| | | |
| | | SeckillActivityDetailVO selectDetail(Integer seckillActivityId); |
| | | SeckillActivityDetailVO selectDetail(@Param("seckillActivityId") Integer seckillActivityId, @Param("vip") Integer vip); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | |
| | |
| | | */ |
| | | public interface GoodsService extends IService<Goods> { |
| | | |
| | | List<GoodsVO> goodsList(Goods goods); |
| | | PageInfo<GoodsVO> goodsList(Goods goods); |
| | | |
| | | GoodsVO goodsDetail(Long goodsId); |
| | | |
| | | List<Goods> getGoodsListByShopId(Integer shopId); |
| | | List<Goods> getGoodsListByShopId(PageInfo<Goods> pageInfo, Integer shopId); |
| | | |
| | | void addGoods(Goods goods); |
| | | |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.vo.Price; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | |
| | | private RemoteOrderGoodsClient remoteOrderGoodsClient; |
| | | |
| | | @Override |
| | | public List<GoodsVO> goodsList(Goods search) { |
| | | List<Goods> goodsList = this.list(new LambdaQueryWrapper<Goods>() |
| | | .eq(Goods::getStatus, GoodsStatus.UP.getCode()) |
| | | .eq(Goods::getDelFlag, 0) |
| | | .eq(Objects.nonNull(search.getGoodsCategoryId()), Goods::getGoodsCategoryId, search.getGoodsCategoryId()) |
| | | .like(StringUtils.isNotEmpty(search.getName()), Goods::getName, search.getName())); |
| | | |
| | | List<GoodsVO> result = new ArrayList<>(); |
| | | public PageInfo<GoodsVO> goodsList(Goods search) { |
| | | PageInfo<GoodsVO> pageInfo = new PageInfo(search.getPageCurr(), search.getPageSize()); |
| | | List<GoodsVO> list = this.baseMapper.goodsList(pageInfo, search.getGoodsCategoryId(), search.getName()); |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | for (Goods goods : goodsList) { |
| | | GoodsVO goodsVO = new GoodsVO(); |
| | | BeanUtils.copyBeanProp(goodsVO, goods); |
| | | goodsVO.setGoodsId(goods.getId()); |
| | | goodsVO.setGoodsName(goods.getName()); |
| | | R<Price> r = remoteOrderGoodsClient.getGoodsPrice(loginUserApplet.getUserid(), goods.getId(), null); |
| | | for (GoodsVO goods : list) { |
| | | R<Price> r = remoteOrderGoodsClient.getGoodsPrice(loginUserApplet.getUserid(), goods.getGoodsId(), null); |
| | | if (null != r.getData()){ |
| | | Price price = r.getData(); |
| | | goodsVO.setSellingPrice(price.getCash()); |
| | | goodsVO.setIntegral(price.getPoint()); |
| | | goods.setSellingPrice(price.getCash()); |
| | | goods.setIntegral(price.getPoint()); |
| | | } |
| | | result.add(goodsVO); |
| | | } |
| | | return result; |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | |
| | | @Override |
| | |
| | | goodsVO.setSellingPrice(sellingPrice); |
| | | goodsVO.setIntegral(integral); |
| | | |
| | | if(goods.getAppointStore() == 2){ |
| | | if(goods.getType() == 1){ |
| | | if(goods.getAppointStore() == 2){ |
| | | List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() |
| | | .in(Shop::getDelFlag, 0)); |
| | | goodsVO.setShopList(shopList); |
| | | }else{ |
| | | List<GoodsShop> goodsShopList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() |
| | | .eq(GoodsShop::getGoodsId, goodsId)); |
| | | if (!CollectionUtils.isEmpty(goodsShopList)){ |
| | | List<Integer> shopIds = goodsShopList.stream().map(GoodsShop::getShopId).collect(Collectors.toList()); |
| | | List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() |
| | | .in(Shop::getId, shopIds)); |
| | | goodsVO.setShopList(shopList); |
| | | } |
| | | } |
| | | }else{ |
| | | List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() |
| | | .in(Shop::getDelFlag, 0)); |
| | | goodsVO.setShopList(shopList); |
| | | }else{ |
| | | List<GoodsShop> goodsShopList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() |
| | | .eq(GoodsShop::getGoodsId, goodsId)); |
| | | if (!CollectionUtils.isEmpty(goodsShopList)){ |
| | | List<Integer> shopIds = goodsShopList.stream().map(GoodsShop::getShopId).collect(Collectors.toList()); |
| | | List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() |
| | | .in(Shop::getId, shopIds)); |
| | | goodsVO.setShopList(shopList); |
| | | } |
| | | } |
| | | return goodsVO; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Goods> getGoodsListByShopId(Integer shopId) { |
| | | public List<Goods> getGoodsListByShopId(PageInfo<Goods> pageInfo, Integer shopId) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | VipSetting vipSetting = vipSettingService.getVipSettingByUserId(loginUserApplet.getUserid()); |
| | | return goodsMapper.selectListByShopId(shopId, vipSetting.getId()); |
| | | return goodsMapper.selectListByShopId(pageInfo, shopId, vipSetting.getId()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | |
| | | import com.ruoyi.other.mapper.SeckillActivityInfoMapper; |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | | import com.ruoyi.other.service.GoodsSeckillService; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.service.SeckillActivityInfoService; |
| | | import com.ruoyi.other.vo.SeckillActivityDetailVO; |
| | | import com.ruoyi.other.vo.SeckillActivityVO; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private GoodsSeckillService goodsSeckillService; |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | @Override |
| | | public List<SeckillActivityVO> listSeckillActivity(Goods goods) { |
| | |
| | | |
| | | @Override |
| | | public SeckillActivityDetailVO detail(Integer seckillActivityId) { |
| | | SeckillActivityDetailVO seckillActivityDetailVO = seckillActivityInfoMapper.selectDetail(seckillActivityId); |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser appUser = appUserClient.getAppUserById(userid); |
| | | SeckillActivityDetailVO seckillActivityDetailVO = seckillActivityInfoMapper.selectDetail(seckillActivityId, appUser.getVipId()); |
| | | Integer goodsId = seckillActivityDetailVO.getGoodsId(); |
| | | |
| | | List<Integer> shopIdList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() |
| | | .eq(GoodsShop::getGoodsId, goodsId)).stream().map(GoodsShop::getShopId).collect(Collectors.toList()); |
| | | |
| | | List<String> shopNames = shopMapper.selectObjs(new LambdaQueryWrapper<Shop>() |
| | | .select(Shop::getName) |
| | | .in(Shop::getId, shopIdList)) |
| | | .stream() |
| | | .map(Object::toString) |
| | | .collect(Collectors.toList()); |
| | | seckillActivityDetailVO.setShopList(shopNames); |
| | | Goods goods = goodsService.getById(goodsId); |
| | | List<Shop> shops; |
| | | if(goods.getAppointStore() == 1){ |
| | | List<Integer> shopIdList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() |
| | | .eq(GoodsShop::getGoodsId, goodsId)).stream().map(GoodsShop::getShopId).collect(Collectors.toList()); |
| | | shops = shopMapper.selectObjs(new LambdaQueryWrapper<Shop>() |
| | | .select(Shop::getName) |
| | | .in(shopIdList.size() > 0, Shop::getId, shopIdList)); |
| | | }else{ |
| | | shops = shopMapper.selectList(new LambdaUpdateWrapper<Shop>().eq(Shop::getDelFlag, 0)); |
| | | } |
| | | seckillActivityDetailVO.setShopList(shops); |
| | | return seckillActivityDetailVO; |
| | | } |
| | | |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.api.domain.ShopPoint; |
| | |
| | | import com.ruoyi.other.vo.ShopPointStatistics; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | IPage<ShopPoint> shopPointIPage = this.baseMapper.queryShpointPage(page, shopPoint); |
| | | shopPointStatistics.setShopPointIPage(shopPointIPage); |
| | | |
| | | LocalDateTime startTime = shopPoint.getStartTime(); |
| | | LocalDateTime endTime = shopPoint.getEndTime(); |
| | | if(null != startTime){ |
| | | List<ShopPoint> list = this.list(new LambdaUpdateWrapper<ShopPoint>().eq(ShopPoint::getShopId, shopPoint.getShopId()) |
| | | .last(" and create_time between '" + startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "' and '" + endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "'")); |
| | | List<String> date = new ArrayList<>(); |
| | | List<Map<String, Integer>> data = new ArrayList<>(); |
| | | String format = "MM.dd"; |
| | | while (true){ |
| | | if(startTime.isAfter(endTime)){ |
| | | break; |
| | | } |
| | | date.add(startTime.format(DateTimeFormatter.ofPattern(format))); |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | //返佣积分 |
| | | LocalDateTime finalStartTime = startTime; |
| | | List<ShopPoint> collect = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 2).collect(Collectors.toList()); |
| | | map.put("fyjf", collect.stream().mapToInt(ShopPoint::getVariablePoint).sum()); |
| | | |
| | | //服务积分 |
| | | List<ShopPoint> collect1 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 4).collect(Collectors.toList()); |
| | | map.put("fwjf", collect1.stream().mapToInt(ShopPoint::getVariablePoint).sum()); |
| | | //绑定下级门店返佣积分 |
| | | List<ShopPoint> collect2 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 3).collect(Collectors.toList()); |
| | | map.put("xjmdfyjf", collect2.stream().mapToInt(ShopPoint::getVariablePoint).sum()); |
| | | data.add(map); |
| | | startTime = startTime.plusDays(1); |
| | | } |
| | | Map<String, Object> brokenLine = new HashMap<>(); |
| | | brokenLine.put("date", date); |
| | | brokenLine.put("data", data); |
| | | shopPointStatistics.setBrokenLine(brokenLine); |
| | | } |
| | | return shopPointStatistics; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "可用门店") |
| | | private List<String> shopList; |
| | | private List<Shop> shopList; |
| | | |
| | | @ApiModelProperty(value = "商品详情") |
| | | private String detail; |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | @ApiModel("门店积分统计") |
| | |
| | | private Integer subShopCommissionPoint; |
| | | |
| | | private IPage<ShopPoint> shopPointIPage; |
| | | |
| | | @ApiModelProperty("折线图数据") |
| | | private Map<String, Object> brokenLine; |
| | | } |
| | |
| | | tci.send_type, |
| | | tci.need_point, |
| | | tci.person_type, |
| | | tci.person_ids |
| | | tci.person_ids, |
| | | tci.shelf_status |
| | | FROM |
| | | t_coupon_info tci |
| | | <where> |
| | |
| | | LEFT JOIN t_goods tg ON tg.id = tgs.goods_id |
| | | where ts.id = #{shopId} and ts.del_flag = 0 |
| | | <if test="vip != null"> |
| | | and FIND_IN_SET(#{vip}, commodity_authority) > 0 |
| | | and FIND_IN_SET(#{vip}, tg.commodity_authority) > 0 |
| | | </if> |
| | | ORDER BY tg.sale_num DESC |
| | | </select> |
| | |
| | | </where> |
| | | order by tg.sort desc |
| | | </select> |
| | | |
| | | |
| | | <select id="goodsList" resultType="com.ruoyi.other.vo.GoodsVO"> |
| | | select *, id as goodsId, name as goodsName from t_goods where status = 2 and del_flag = 0 |
| | | <if test="null != goodsCategoryId"> |
| | | and goods_category_id = #{goodsCategoryId} |
| | | </if> |
| | | <if test="null != name and '' != name"> |
| | | and name like CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | FROM |
| | | t_seckill_activity_info tsai |
| | | LEFT JOIN t_goods tg ON tsai.good_id = tg.id |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id |
| | | WHERE tsai.end_time >= NOW() AND tsai.del_flag = 0 |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id and tgs.vip = #{vipId} |
| | | WHERE tsai.is_shelves = 1 AND tsai.del_flag = 0 |
| | | <if test="name != null and name != ''"> |
| | | AND tg.`name` LIKE concat('%',#{goodsName},'%') |
| | | </if> |
| | |
| | | AND tg.goods_category_id = #{goodsCategoryId} |
| | | </if> |
| | | <if test="vipId != null"> |
| | | AND find_in_set(#{vipId},tgs.vip) > 0 |
| | | AND tgs.vip in (0, -1, #{vipId}) |
| | | </if> |
| | | <if test="vipId == null"> |
| | | AND tgs.vip in (0, -1) |
| | | </if> |
| | | </select> |
| | | <select id="selectDetail" resultType="com.ruoyi.other.vo.SeckillActivityDetailVO"> |
| | | SELECT |
| | | tsai.id, |
| | | tsai.good_id as goodsId, |
| | | tg.`name`, |
| | | tg.introduction, |
| | | tg.home_page_picture, |
| | |
| | | tg.sale_num, |
| | | tsai.start_time, |
| | | tg.detail_picture, |
| | | tsal.end_time, |
| | | tsai.end_time, |
| | | tg.detail |
| | | FROM |
| | | t_seckill_activity_info tsai |
| | | LEFT JOIN t_goods tg ON tsai.good_id = tg.id |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id and tgs.vip = #{vip} |
| | | WHERE tsai.id = #{seckillActivityId} AND tsai.del_flag = 0 |
| | | </select> |
| | | <select id="querySeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO"> |