luodangjia
2024-12-16 f28142767f8823667499e6e94a76789f601f1654
Merge remote-tracking branch 'origin/master'
46个文件已修改
3个文件已添加
1006 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/UserCouponClientFallbackFactory.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/UserCouponClient.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserCoupon.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserPoint.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/MyShoppingCartVo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/CouponInfo.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/OrderActivityInfo.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/SeckillActivityInfo.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipSettingClientFallbackFactory.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/BaseSettingClient.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipSettingClient.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/VipCenterController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/UserPointMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/UserPointService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/VipCenterServiceImpl.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointStatistics.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserPointMapper.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BaseSettingController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java 104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/OrderActivityInfoController.java 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RegionController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopPointController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/CouponInfoMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/CouponInfoService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsSeckillService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/SeckillActivityInfoService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopPointService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/CouponInfoServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityVO.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopPointStatistics.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/CouponInfoMapper.xml 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/UserCouponClientFallbackFactory.java
@@ -27,6 +27,11 @@
            public R<CouponInfoVo> getCouponInfo(Long userCouponId) {
                return R.fail("根据用户优惠券id获取优惠券详情失败:" + cause.getMessage());
            }
            @Override
            public R<Long> getCouponCount(Integer couponId) {
                return R.fail("根据优惠券id获取优惠券数量失败:" + cause.getMessage());
            }
        };
    }
}
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/UserCouponClient.java
@@ -7,6 +7,7 @@
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
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.RequestParam;
@@ -36,4 +37,7 @@
     */
    @PostMapping("/user-coupon/getCouponInfo")
    R<CouponInfoVo> getCouponInfo(@RequestParam("userCouponId") Long userCouponId);
    @GetMapping("/user-coupon/getCouponCount")
    R<Long> getCouponCount(@RequestParam("couponId") Integer couponId);
}
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserCoupon.java
@@ -69,5 +69,14 @@
    private Integer status;
    @ApiModelProperty(value = "领取用户姓名")
    @TableField(exist = false)
    private String userName;
    @ApiModelProperty(value = "领取用户手机号")
    @TableField(exist = false)
    private String phone;
}
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserPoint.java
@@ -11,6 +11,7 @@
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
/**
 * <p>
@@ -60,5 +61,25 @@
    @TableField("object_id")
    private Long objectId;
    @ApiModelProperty(value = "用户名称")
    @TableField(exist = false)
    private String userName;
    @ApiModelProperty(value = "联系电话")
    @TableField(exist = false)
    private String phone;
    @ApiModelProperty(value = "开始时间")
    @TableField(exist = false)
    private LocalDateTime startTime;
    @ApiModelProperty(value = "结束时间")
    @TableField(exist = false)
    private LocalDateTime endTime;
    @TableField(exist = false)
    private List<Long> userIds;
}
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/MyShoppingCartVo.java
@@ -40,7 +40,7 @@
    @ApiModelProperty("积分支付")
    private Boolean pointPayment;
    @ApiModelProperty("配送方式(1=自提,2=快递)")
    private Integer distributionMode;
    private String distributionMode;
    /**
     * 可获得消费积分
     */
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java
@@ -63,7 +63,7 @@
    private BigDecimal paymentAmount;
    @ApiModelProperty(value = "配送方式(1=自提,2=快递)")
    private Integer distributionMode;
    private String distributionMode;
    @ApiModelProperty(value = "门店名称")
    private String shopName;
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/CouponInfo.java
@@ -1,6 +1,7 @@
package com.ruoyi.other.api.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -8,6 +9,7 @@
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
@@ -37,6 +39,7 @@
    @ApiModelProperty(value = "添加时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "优惠券名称")
@@ -81,11 +84,13 @@
    @ApiModelProperty(value = "有效期开始时间")
    @TableField("period_start_time")
    private LocalDateTime periodStartTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate periodStartTime;
    @ApiModelProperty(value = "有效期结束时间")
    @TableField("period_end_time")
    private LocalDateTime periodEndTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate periodEndTime;
    @ApiModelProperty(value = "领取后x天有效")
    @TableField("period_days")
@@ -93,10 +98,12 @@
    @ApiModelProperty(value = "开始发放时间")
    @TableField("send_start_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sendStartTime;
    @ApiModelProperty(value = "结束发放时间")
    @TableField("send_end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sendEndTime;
    @ApiModelProperty(value = "1免费发放2积分兑换")
@@ -115,5 +122,18 @@
    @TableField("person_ids")
    private String personIds;
    @ApiModelProperty(value = "上架状态:0-下架 1-上架")
    @TableField("shelf_status")
    private Integer shelfStatus;
    @ApiModelProperty(value = "已发放数量")
    @TableField(exist = false)
    private Long sendNumNow;
    @ApiModelProperty(value = "指定会员等级,逗号隔开")
    private String vipIds;
    public String getIdStr() {
        return String.valueOf(id);
    }
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java
@@ -47,9 +47,9 @@
    @TableField("purchase_limit")
    private Integer purchaseLimit;
    @ApiModelProperty(value = "配送方式(1=自提,2=快递)")
    @ApiModelProperty(value = "配送方式(1=自提,2=快递,1,2 = 自提+快递)")
    @TableField("distribution_mode")
    private Integer distributionMode;
    private String distributionMode;
    @ApiModelProperty(value = "指定门店(1=指定,2=所有)")
    @TableField("appoint_store")
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/OrderActivityInfo.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -53,10 +54,12 @@
    @ApiModelProperty(value = "活动开始日期")
    @TableField("start_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;
    @ApiModelProperty(value = "活动结束日期")
    @TableField("end_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;
    @ApiModelProperty(value = "满x元")
@@ -75,4 +78,18 @@
    @TableField(exist = false)
    private Integer status;
    @ApiModelProperty(value = "主键字符串")
    @TableField(exist = false)
    private String idStr;
    @ApiModelProperty(value = "会员名称")
    @TableField(exist = false)
    private String vipName;
    public String getIdStr() {
        return String.valueOf(id);
    }
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/SeckillActivityInfo.java
@@ -8,6 +8,7 @@
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
 * <p>
@@ -58,5 +59,13 @@
    @TableField("end_time")
    private LocalDateTime endTime;
    @ApiModelProperty(value = "是否上架:0否 1是")
    @TableField("is_shelves")
    private Integer isShelves;
    @TableField(exist = false)
    private List<GoodsSeckill> goodsSeckills;
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java
@@ -163,9 +163,6 @@
    @TableField("create_time")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "店长姓名")
    @TableField(exist = false)
    private String managerName;
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipSettingClientFallbackFactory.java
@@ -5,6 +5,8 @@
import com.ruoyi.other.api.feignClient.VipSettingClient;
import org.springframework.cloud.openfeign.FallbackFactory;
import java.util.List;
/**
 * @author zhibing.pu
 * @Date 2024/12/10 13:53
@@ -18,6 +20,11 @@
            public R<VipSetting> getVipSetting(Integer id) {
                return R.fail("查询会员配置失败:" + cause.getMessage());
            }
            @Override
            public R<List<VipSetting>> info() {
                return R.fail("获取会员配置失败:" + cause.getMessage());
            }
        };
    }
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/BaseSettingClient.java
@@ -5,6 +5,7 @@
import com.ruoyi.other.api.domain.BaseSetting;
import com.ruoyi.other.api.factory.BaseSettingClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -21,6 +22,6 @@
     * @param id
     * @return
     */
    @PostMapping("/base-setting/getBaseSetting")
    @GetMapping("/base-setting/getBaseSetting")
    R<BaseSetting> getBaseSetting(@RequestParam("id") Integer id);
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipSettingClient.java
@@ -5,8 +5,11 @@
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.api.factory.VipSettingClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
 * @author zhibing.pu
@@ -23,4 +26,7 @@
     */
    @PostMapping("/vip-setting/getVipSetting")
    R<VipSetting> getVipSetting(@RequestParam("id") Integer id);
    @GetMapping("/vip-setting/info")
    R<List<VipSetting>> info();
}
ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml
@@ -24,7 +24,7 @@
        <result property="updateTime"   column="update_time"  />
        <result property="forbiddenRemark"           column="forbidden_remark"/>
        <result property="remark"       column="remark"       />
        <result property="roleType"       column="roleType"       />
        <result property="roleType"       column="role_type"       />
        <result property="objectId"       column="objectId"       />
        <association property="dept"    column="dept_id" javaType="com.ruoyi.system.api.domain.SysDept" resultMap="deptResult" />
        <collection  property="roles"   javaType="java.util.List"           resultMap="RoleResult" />
@@ -49,9 +49,9 @@
    </resultMap>
    
    <sql id="selectUserVo">
        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.role_type, u.create_by, u.create_time, u.remark,
        d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
        r.role_id, r.role_name, r.role_key, r.data_scope, r.status as role_status ,u.roleType as roleType,u.objectId AS objectId
        r.role_id, r.role_name, r.role_key, r.data_scope, r.status as role_status ,u.role_type as roleType,u.objectId AS objectId
        from sys_user u
            left join sys_dept d on u.dept_id = d.dept_id
            left join sys_user_role ur on u.user_id = ur.user_id
@@ -142,11 +142,11 @@
        <if test="null != req.status">
            and status = #{req.status}
        </if>
        and del_flag = '0' and roleType =1
        and del_flag = '0' and role_type =1
        order by create_time desc
    </select>
    <select id="getAllList" resultType="com.ruoyi.system.api.domain.SysUser">
        select *,user_id userId,nick_name userName ,create_time createTime ,login_date loginDate from sys_user where roleType=3 and user_id in
        select *,user_id userId,nick_name userName ,create_time createTime ,login_date loginDate from sys_user where role_type=3 and user_id in
        <foreach collection="ids" separator="," open="(" item="id" index="index" close=")" >
            #{id}
@@ -169,7 +169,7 @@
                AND nick_name LIKE concat('%',#{query.nickName},'%')
            </if>
            AND del_flag = '0'
            AND roleType = 1
            AND role_type = 1
        </where>
        ORDER BY create_time DESC
    </select>
@@ -187,7 +187,7 @@
             <if test="password != null and password != ''">password,</if>
             <if test="status != null and status != ''">status,</if>
             <if test="createBy != null and createBy != ''">create_by,</if>
             <if test="roleType != null and roleType != ''">roleType,</if>
             <if test="roleType != null and roleType != ''">role_type,</if>
             <if test="remark != null and remark != ''">remark,</if>
             <if test="objectId != null and objectId != ''">objectId,</if>
             create_time
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
@@ -59,7 +59,7 @@
    @GetMapping("/mine/list")
    @ApiOperation(value = "已领取列表", tags = {"小程序-个人中心-优惠劵"})
    @ApiOperation(value = "已领取列表", tags = {"小程序-个人中心-优惠劵","后台管理-活动管理-优惠券管理"})
    public R<Page<UserCoupon>> minelist(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @ApiParam("1未使用2已使用3已过期") Integer status) {
        Long userid = tokenService.getLoginUserApplet().getUserid();
        Page<UserCoupon> page = userCouponService.lambdaQuery()
@@ -99,6 +99,11 @@
            }else {
                record.setStatus(2);
            }
            AppUser appUser = appUserService.getById(record.getAppUserId());
            record.setUserName(appUser.getName());
            record.setPhone(appUser.getPhone());
        }
        return R.ok(page);
    }
@@ -183,5 +188,13 @@
        BeanUtils.copyProperties(data, couponInfoVo);
        return R.ok(couponInfoVo);
    }
    /**
     * 获取优惠券发放数量
     */
    @GetMapping("/getCouponCount")
    public R<Long> getCouponCount(@RequestParam Integer couponId){
        return R.ok(userCouponService.lambdaQuery().eq(UserCoupon::getCouponId, couponId).count());
    }
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java
@@ -1,21 +1,31 @@
package com.ruoyi.account.controller;
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.ruoyi.account.api.model.AppUser;
import com.ruoyi.account.api.model.UserPoint;
import com.ruoyi.account.service.AppUserService;
import com.ruoyi.account.service.UserPointService;
import com.ruoyi.account.vo.UserPointDetailVO;
import com.ruoyi.account.vo.UserPointStatistics;
import com.ruoyi.account.vo.UserPointVO;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.common.security.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -37,6 +47,10 @@
public class UserPointController extends BaseController {
    @Resource
    private UserPointService userPointService;
    @Resource
    private AppUserService appUserService;
    @Resource
    private TokenService tokenService;
    /**
@@ -98,5 +112,40 @@
        userPointService.save(userPoint);
        return R.ok();
    }
    /**
     * 积分统计
     */
    @GetMapping("/statistics")
    @ApiOperation(value = "积分统计", tags = "管理后台-财务统计-用户积分统计")
    public R<UserPointStatistics> statistics(UserPoint userPoint) {
        return R.ok(userPointService.getStatistics(userPoint));
    }
    /**
     * 变更记录
     */
    @GetMapping("/list")
    @ApiOperation(value = "积分变更记录", tags = "管理后台-财务统计-用户积分统计")
    public R<IPage<UserPoint>> list(@ApiParam("页码") @RequestParam Integer pageNum, @ApiParam("大小") Integer pageSize, UserPoint userPoint) {
        IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(pageNum, pageSize), userPoint);
        return R.ok(userPointPage);
    }
    /**
     * 导出
     */
    @GetMapping("/export")
    @ApiOperation(value = "积分变更记录导出", tags = "管理后台-财务统计-用户积分统计")
    public void export(HttpServletResponse response, UserPoint userPoint) {
        IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(1, Integer.MAX_VALUE), userPoint);
        List<UserPoint> userPointList = userPointPage.getRecords();
        ExcelUtil<UserPoint> util = new ExcelUtil<>(UserPoint.class);
        util.exportExcel(response, userPointList, "用户积分统计");
    }
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/VipCenterController.java
@@ -10,10 +10,7 @@
import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.api.domain.*;
import com.ruoyi.other.api.feignClient.BaseSettingClient;
import com.ruoyi.other.api.feignClient.GoodsVipClient;
import com.ruoyi.other.api.feignClient.RemoteVipSettingClient;
import com.ruoyi.other.api.feignClient.VipGoodClient;
import com.ruoyi.other.api.feignClient.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -46,6 +43,8 @@
    private VipCenterService vipCenterService;
    @Resource
    private VipGoodClient vipGoodClient;
    @Resource
    private GoodsClient goodsClient;
    @GetMapping("getVipLevelList")
@@ -95,13 +94,13 @@
                if (vipGoodList != null && !vipGoodList.isEmpty()) {
                    List<String> goodsNames = new ArrayList<>();
                    vipGoodList.forEach(vipGood -> {
                        String goodJson = vipGood.getGoodJson();
                        if (isValidJson(goodJson)) {
                            Goods goods = JSONObject.parseObject(goodJson, Goods.class);
                            goodsNames.add(goods.getName());
                        } else {
                            log.warn("JSON无效: " + goodJson);
                        Integer goodId = vipGood.getGoodId();
                        R<Goods> goodsR = goodsClient.getGoodsById(goodId);
                        if (R.isError(goodsR)) {
                         throw new ServiceException("商品信息获取失败");
                        }
                        Goods goods = goodsR.getData();
                        goodsNames.add(goods.getName());
                    });
                    level.setGoodsNames(goodsNames);
                }
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/UserPointMapper.java
@@ -16,4 +16,7 @@
public interface UserPointMapper extends BaseMapper<UserPoint> {
    List<UserPoint> findLatestUserPointByTypeForUser(Long userId);
    List<UserPoint> findLatestChangeByType(UserPoint userPoint);
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/UserPointService.java
@@ -1,9 +1,15 @@
package com.ruoyi.account.service;
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.service.IService;
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.account.api.model.UserPoint;
import com.ruoyi.account.vo.UserPointDetailVO;
import com.ruoyi.account.vo.UserPointStatistics;
import com.ruoyi.account.vo.UserPointVO;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@@ -25,4 +31,9 @@
    List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type);
    void transferPoint(BigDecimal point, String phone);
    UserPointStatistics getStatistics(UserPoint userPoint);
    IPage<UserPoint> getUserPointPage(Page<UserPoint> page, UserPoint userPoint);
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java
@@ -2,6 +2,8 @@
import cn.hutool.core.collection.CollectionUtil;
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.service.impl.ServiceImpl;
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.account.api.model.UserPoint;
@@ -12,9 +14,11 @@
import com.ruoyi.account.service.UserPointService;
import com.ruoyi.account.service.VipSettingService;
import com.ruoyi.account.vo.UserPointDetailVO;
import com.ruoyi.account.vo.UserPointStatistics;
import com.ruoyi.account.vo.UserPointVO;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.PhoneNumberValidator;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.api.domain.PointSetting;
import com.ruoyi.other.api.domain.VipSetting;
@@ -22,14 +26,12 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -51,6 +53,8 @@
    private VipSettingService vipSettingService;
    @Resource
    private PointSettingService pointSettingService;
    @Resource
    private UserPointMapper userPointMapper;
    @Override
    public UserPointVO getUserPoint(Long userId) {
@@ -121,8 +125,9 @@
        }
        Integer buyPointOpen = pointSetting.getBuyPointOpen();
        List<UserPoint> userPointList = list(new LambdaQueryWrapper<UserPoint>()
                .eq(UserPoint::getAppUserId, userid));
        UserPoint userPoint = new UserPoint();
        userPoint.setAppUserId(userid);
        List<UserPoint> userPointList = userPointMapper.findLatestChangeByType(userPoint);
        Map<Integer, Integer> userBalanceMap = userPointList.stream()
                .collect(Collectors.toMap(UserPoint::getType, UserPoint::getBalance));
@@ -155,4 +160,69 @@
    private int getAdjustedPoint(Map<Integer, Integer> userBalanceMap, int pointTypeCode, boolean isOpen) {
        return isOpen ? 0 : Optional.ofNullable(userBalanceMap.get(pointTypeCode)).orElse(0);
    }
    @Override
    public UserPointStatistics getStatistics(UserPoint userPoint) {
        List<Long> userIds = new ArrayList<>();
        if (StringUtils.isNotEmpty(userPoint.getUserName())) {
            userIds = appUserService.listObjs(new LambdaQueryWrapper<AppUser>()
                            .select(AppUser::getId)
                            .like(AppUser::getName, userPoint.getUserName()))
                    .stream()
                    .map(appUserId -> (Long) appUserId)
                    .collect(Collectors.toList());
        }
        List<UserPoint> userPointList = userPointMapper.findLatestChangeByType(userPoint);
        Map<Integer, Integer> userBalanceMap = userPointList.stream()
                .collect(Collectors.toMap(UserPoint::getType, UserPoint::getBalance));
        Integer consumePoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.CONSUME.getCode())).orElse(0);
        Integer sharePoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.COMMISSION_RETURN.getCode())).orElse(0);
        Integer pullNewPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.NEW_USER_REFERRAL.getCode())).orElse(0);
        Integer registerPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.REGISTRATION.getCode())).orElse(0);
        Integer workPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.WORK_PERFORMANCE.getCode())).orElse(0);
        Integer shopAchievementPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.TECHNICIAN_PERFORMANCE.getCode())).orElse(0);
        Integer exchangeGoodsPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.EXCHANGE_GOODS.getCode())).orElse(0);
        Integer storeAchievementPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.STORE_PERFORMANCE.getCode())).orElse(0);
        Integer storeCommissionPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.STORE_COMMISSION_RETURN.getCode())).orElse(0);
        Integer transferPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.TRANSFER_POINTS.getCode())).orElse(0);
        Integer totalPoint = consumePoint + sharePoint + pullNewPoint + registerPoint + workPoint + shopAchievementPoint + exchangeGoodsPoint + storeAchievementPoint + storeCommissionPoint + transferPoint;
        UserPointStatistics userPointStatistics = new UserPointStatistics();
        userPointStatistics.setTotalPoint(totalPoint);
        userPointStatistics.setConsumePoint(consumePoint);
        userPointStatistics.setSharePoint(sharePoint);
        userPointStatistics.setPullNewPoint(pullNewPoint);
        userPointStatistics.setRegisterPoint(registerPoint);
        userPointStatistics.setWorkPoint(workPoint);
        userPointStatistics.setShopAchievementPoint(shopAchievementPoint);
        return userPointStatistics;
    }
    @Override
    public IPage<UserPoint> getUserPointPage(Page<UserPoint> page, UserPoint userPoint) {
        List<AppUser> appUserList = appUserService.list(new LambdaQueryWrapper<AppUser>()
                .eq(AppUser::getPhone, userPoint.getPhone())
                .like(AppUser::getName, userPoint.getUserName()));
        List<Long> userIds = appUserList.stream().map(AppUser::getId).collect(Collectors.toList());
        Page<UserPoint> userPointPage = page(page, new LambdaQueryWrapper<UserPoint>()
                .in(!CollectionUtils.isEmpty(userIds), UserPoint::getAppUserId, userIds)
                .eq(UserPoint::getType, userPoint.getType())
                .between(UserPoint::getCreateTime, userPoint.getStartTime(), userPoint.getEndTime())
                .orderByDesc(UserPoint::getCreateTime));
        userPointPage.getRecords().forEach(userPoint1 -> appUserList.stream()
                .filter(appUser -> appUser.getId().equals(userPoint1.getAppUserId()))
                .findFirst().ifPresent(appUser -> {
                    userPoint1.setUserName(appUser.getName());
                    userPoint1.setPhone(appUser.getPhone());
                }));
        return userPointPage;
    }
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/VipCenterServiceImpl.java
@@ -16,6 +16,7 @@
import com.ruoyi.other.api.domain.Shop;
import com.ruoyi.other.api.domain.VipGood;
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.api.feignClient.GoodsClient;
import com.ruoyi.other.api.feignClient.ShopClient;
import com.ruoyi.other.api.feignClient.VipGoodClient;
import com.ruoyi.system.api.model.LoginUser;
@@ -41,6 +42,8 @@
    private ShopClient shopClient;
    @Resource
    private TokenService tokenService;
    @Resource
    private GoodsClient goodsClient;
    @Override
@@ -84,8 +87,12 @@
            List<VipGood> vipGoods = vipGoodsByVipId.getData();
            if (CollectionUtil.isNotEmpty(vipGoods)){
                for (VipGood vipGood : vipGoods) {
                    String goodJson = vipGood.getGoodJson();
                    Goods goods = JSONObject.parseObject(goodJson, Goods.class);
                    Integer goodId = vipGood.getGoodId();
                    R<Goods> goodsR = goodsClient.getGoodsById(goodId);
                    if (R.isError(goodsR)){
                        throw new ServiceException("商品信息获取失败");
                    }
                    Goods goods = goodsR.getData();
                    R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId());
                    if (R.isSuccess(orderListByUserIdAndGoodsId)){
                        List<Order> orderList = orderListByUserIdAndGoodsId.getData();
@@ -142,8 +149,12 @@
            List<VipGood> vipGoods = vipGoodsByVipId.getData();
            if (CollectionUtil.isNotEmpty(vipGoods)){
                for (VipGood vipGood : vipGoods) {
                    String goodJson = vipGood.getGoodJson();
                    Goods goods = JSONObject.parseObject(goodJson, Goods.class);
                    R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId());
                    if (R.isError(goodsR)){
                        throw new ServiceException("商品信息获取失败");
                    }
                    Goods goods = goodsR.getData();
                    R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId());
                    if (R.isSuccess(orderListByUserIdAndGoodsId)){
                        List<Order> orderList = orderListByUserIdAndGoodsId.getData();
@@ -215,8 +226,11 @@
            List<VipGood> vipGoods = vipGoodsByVipId.getData();
            if (CollectionUtil.isNotEmpty(vipGoods)){
                for (VipGood vipGood : vipGoods) {
                    String goodJson = vipGood.getGoodJson();
                    Goods goods = JSONObject.parseObject(goodJson, Goods.class);
                    R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId());
                    if (R.isError(goodsR)){
                        throw new ServiceException("商品信息获取失败");
                    }
                    Goods goods = goodsR.getData();
                    R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId());
                    if (R.isSuccess(orderListByUserIdAndGoodsId)){
                        List<Order> orderList = orderListByUserIdAndGoodsId.getData();
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointStatistics.java
New file
@@ -0,0 +1,32 @@
package com.ruoyi.account.vo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@Api("积分统计")
public class UserPointStatistics {
    @ApiModelProperty(value = "总积分")
    private Integer totalPoint;
    @ApiModelProperty(value = "消费积分总数")
    private Integer consumePoint;
    @ApiModelProperty(value = "返佣积分总数")
    private Integer sharePoint;
    @ApiModelProperty(value = "拉新人积分总数")
    private Integer pullNewPoint;
    @ApiModelProperty(value = "注册积分总数")
    private Integer registerPoint;
    @ApiModelProperty(value = "做工积分总数")
    private Integer workPoint;
    @ApiModelProperty(value = "技师业绩积分总数")
    private Integer shopAchievementPoint;
}
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserPointMapper.xml
@@ -22,10 +22,43 @@
            t1.*
        FROM
            t_user_point t1
                INNER JOIN ( SELECT type, MAX( create_time ) AS max_create_time FROM t_user_point WHERE app_user_id = 1864118151377129473 GROUP BY type ) t2 ON t1.type = t2.type
                INNER JOIN ( SELECT type, MAX( create_time ) AS max_create_time FROM t_user_point WHERE app_user_id = #{userId} GROUP BY type ) t2 ON t1.type = t2.type
                AND t1.create_time = t2.max_create_time
        WHERE
            t1.app_user_id = #{userId}
    </select>
    <select id="findLatestChangeByType" resultType="com.ruoyi.account.api.model.UserPoint">
        SELECT
            id,
            type,
            historical_point,
            variable_point,
            balance,
            create_time,
            app_user_id,
            object_id
        FROM (
                 SELECT
                     id,
                     type,
                     historical_point,
                     variable_point,
                     balance,
                     create_time,
                     app_user_id,
                     object_id,
                     ROW_NUMBER() OVER (PARTITION BY type ORDER BY create_time DESC) AS rn
                 FROM
                     t_user_point
             ) AS subquery
        WHERE
            rn = 1
        <if test="type != null">
            AND type = #{type}
        </if>
        <if test="appUserId != null">
            AND app_user_id = #{appUserId}
        </if>
    </select>
</mapper>
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -492,7 +492,7 @@
                List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().eq(Order::getAppUserId, appUser.getId()).eq(Order::getDelFlag, 0).in(Order::getOrderStatus, Arrays.asList(4, 8)));
                List<Long> orderIds = orders.stream().map(Order::getId).collect(Collectors.toList());
                int sum = 0;
                if(orderIds.size() > 0){
                if(!orderIds.isEmpty()){
                    List<OrderGood> orderGoodList = orderGoodService.list(new LambdaQueryWrapper<OrderGood>().in(OrderGood::getOrderId, orderIds)
                            .eq(OrderGood::getGoodsId, shoppingCart.getGoodsId()).eq(OrderGood::getDelFlag, 0));
                    sum = orderGoodList.stream().mapToInt(OrderGood::getNum).sum();
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BaseSettingController.java
@@ -6,6 +6,7 @@
import com.ruoyi.other.api.domain.BaseSetting;
import com.ruoyi.other.service.BaseSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -33,7 +34,8 @@
     * @return
     */
    @ResponseBody
    @PostMapping("/getBaseSetting")
    @GetMapping("/getBaseSetting")
    @ApiOperation(value = "获取基础配置", tags = {"管理后台-基础配置"})
    public R<BaseSetting> getBaseSetting(@RequestParam("id") Integer id){
        BaseSetting baseSetting = baseSettingService.getById(id);
        return R.ok(baseSetting);
@@ -42,6 +44,7 @@
    /**
     * 保存设置
     */
    @ApiOperation(value = "保存设置", tags = {"管理后台-基础配置"})
    @PostMapping("/save")
    public R saveActivityConfig(@RequestBody String json){
        JSONObject jsonObject = JSONObject.parseObject(json);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java
@@ -1,9 +1,14 @@
package com.ruoyi.other.controller;
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.ruoyi.account.api.feignClient.AppUserClient;
import com.ruoyi.account.api.feignClient.UserCouponClient;
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.api.domain.CouponInfo;
import com.ruoyi.other.service.CouponInfoService;
@@ -22,7 +27,7 @@
/**
 * <p>
 *  前端控制器
 * 前端控制器
 * </p>
 *
 * @author luodangjia
@@ -37,18 +42,75 @@
    private TokenService tokenService;
    @Resource
    private AppUserClient appUserClient;
    @Resource
    private UserCouponClient userCouponClient;
    @GetMapping("/list")
    @ApiOperation(value = "优惠劵管理-列表", tags = {"管理后台-活动管理"})
    public R<IPage<CouponInfo>> list(@RequestParam("pageNum") Integer pageNum,
                                     @RequestParam("pageSize") Integer pageSize,
                                     CouponInfo couponInfo) {
        IPage<CouponInfo> couponInfoIPage = couponInfoService.queryCouponInfoPage(Page.of(pageNum, pageSize), couponInfo);
        for (CouponInfo record : couponInfoIPage.getRecords()) {
            R<Long> r = userCouponClient.getCouponCount(record.getId());
            record.setSendNumNow(r.getData());
        }
        return R.ok(couponInfoIPage);
    }
    //查看详情
    @PostMapping("/detail")
    @ApiOperation(value = "活动管理-优惠劵管理-详情", tags = {"管理后台"})
    public R<CouponInfo> detail(@RequestParam("id") Integer id){
    @GetMapping("/detail")
    @ApiOperation(value = "优惠劵管理-详情", tags = {"管理后台-活动管理"})
    public R<CouponInfo> detail(@RequestParam("id") Integer id) {
        CouponInfo byId = couponInfoService.getById(id);
        return R.ok(byId);
    }
    // 删除优惠劵
    @DeleteMapping("/delete")
    @ApiOperation(value = "优惠劵管理-删除", tags = {"管理后台-活动管理"})
    public R<Void> delete(@RequestParam("id") Integer id) {
        couponInfoService.removeById(id);
        return R.ok();
    }
    // 编辑优惠劵
    @PostMapping("/edit")
    @ApiOperation(value = "优惠劵管理-编辑", tags = {"管理后台-活动管理"})
    public R<Void> edit(@RequestBody CouponInfo couponInfo) {
        couponInfoService.updateById(couponInfo);
        return R.ok();
    }
    // 修改上/下架状态
    @PostMapping("/editStatus")
    @ApiOperation(value = "优惠劵管理-修改上/下架状态", tags = {"管理后台-活动管理"})
    public R<Void> editStatus(@RequestParam("id") Integer id,
                               @RequestParam("shelfStatus") Integer shelfStatus) {
        CouponInfo couponInfo = new CouponInfo();
        couponInfo.setId(id);
        couponInfo.setShelfStatus(shelfStatus);
        couponInfoService.updateById(couponInfo);
        return R.ok();
    }
    // 添加优惠券
    @PostMapping("/add")
    @ApiOperation(value = "优惠劵管理-添加", tags = {"管理后台-活动管理"})
    public R<Void> add(@RequestBody CouponInfo couponInfo) {
        couponInfo.setShelfStatus(0);
        couponInfoService.save(couponInfo);
        return R.ok();
    }
    @GetMapping("/gift/list")
    @ApiOperation(value = "待领取列表", tags = {"小程序-个人中心-优惠劵"})
    public R<List<CouponInfo>> giftlist(){
    public R<List<CouponInfo>> giftlist() {
        Long userid = tokenService.getLoginUserApplet().getUserid();
        AppUser appUserById = appUserClient.getAppUserById(userid);
        LocalDateTime now = LocalDateTime.now();
@@ -58,7 +120,7 @@
        List<CouponInfo> list1 = couponInfoService.lambdaQuery().le(CouponInfo::getSendStartTime, now).ge(CouponInfo::getSendEndTime, now).eq(CouponInfo::getPersonType, 2).apply("FIND_IN_SET('" + appUserById.getId() + "', person_ids)").list();
        //查出指定会员可领取优惠劵
        List<CouponInfo> list2 = couponInfoService.lambdaQuery().le(CouponInfo::getSendStartTime, now).ge(CouponInfo::getSendEndTime, now).eq(CouponInfo::getPersonType, 3).apply("FIND_IN_SET('" + appUserById.getVipId() + "', person_ids)").list();
        List<CouponInfo> returnList=  new ArrayList<>();
        List<CouponInfo> returnList = new ArrayList<>();
        count(userid, list, returnList);
        count(userid, list1, returnList);
        count(userid, list2, returnList);
@@ -70,26 +132,26 @@
    private void count(Long userid, List<CouponInfo> list1, List<CouponInfo> returnList) {
        for (CouponInfo couponInfo : list1) {
            Long count = appUserClient.getCouponCount(userid, couponInfo.getId()).getData();
            couponInfo.setMaxNum(couponInfo.getMaxNum()-count.intValue());
            couponInfo.setMaxNum(couponInfo.getMaxNum() - count.intValue());
            for (int i = 0; i < couponInfo.getMaxNum(); i++) {
                returnList.add(couponInfo);
            }
        }
    }
    /**
     * 根据id获取优惠券数据
     * @param ids
     * @return
     */
    @ResponseBody
    @PostMapping("/getCouponInfoList")
    public R<List<CouponInfo>> getCouponInfoList(@RequestParam("ids") List<Integer> ids){
        List<CouponInfo> couponInfos = couponInfoService.listByIds(ids);
        return R.ok(couponInfos);
    }
    /**
     * 根据id获取优惠券数据
     *
     * @param ids
     * @return
     */
    @ResponseBody
    @PostMapping("/getCouponInfoList")
    public R<List<CouponInfo>> getCouponInfoList(@RequestParam("ids") List<Integer> ids) {
        List<CouponInfo> couponInfos = couponInfoService.listByIds(ids);
        return R.ok(couponInfos);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java
@@ -64,8 +64,6 @@
    /**
     * 根据商品id和会员等级获取门店特价
     *
     * @param goodsBargainPrice
     * @return
     */
    @PostMapping("/getGoodsBargainPrice")
    public R<GoodsBargainPriceDetail> getGoodsBargainPrice(@RequestBody GetGoodsBargainPrice goodsBargainPrice) {
@@ -176,24 +174,22 @@
                .eq(!CollectionUtils.isEmpty(goodsIds), GoodsBargainPrice::getGoodsId, goodsId)
                .eq(auditStatus != null, GoodsBargainPrice::getAuditStatus, auditStatus));
        page.getRecords().forEach(goodsBargainPrice -> {
            goodsList.stream()
                    .filter(goods -> goods.getId().equals(goodsBargainPrice.getGoodsId()))
                    .findFirst().ifPresent(g -> {
                        GoodsCategory goodsCategory = goodsCategoryService.getById(g.getGoodsCategoryId());
                        Integer shopId = goodsBargainPrice.getShopId();
                        Shop shop = shopService.getById(shopId);
                        R<AppUser> r = appUserClient.getAppUserByPhone(shop.getPhone());
                        if (R.isError(r)){
                            throw new RuntimeException("获取店长信息失败");
                        }
                        goodsBargainPrice.setOwnerName(r.getData().getName());
                        goodsBargainPrice.setOwnerPhone(shop.getPhone());
                        goodsBargainPrice.setShopName(shop.getName());
                        goodsBargainPrice.setGoodsName(g.getName());
                        goodsBargainPrice.setCategoryName(goodsCategory.getName());
                    });
        });
        page.getRecords().forEach(goodsBargainPrice -> goodsList.stream()
                .filter(goods -> goods.getId().equals(goodsBargainPrice.getGoodsId()))
                .findFirst().ifPresent(g -> {
                    GoodsCategory goodsCategory = goodsCategoryService.getById(g.getGoodsCategoryId());
                    Integer shopId = goodsBargainPrice.getShopId();
                    Shop shop = shopService.getById(shopId);
                    R<AppUser> r = appUserClient.getAppUserByPhone(shop.getPhone());
                    if (R.isError(r)){
                        throw new RuntimeException("获取店长信息失败");
                    }
                    goodsBargainPrice.setOwnerName(r.getData().getName());
                    goodsBargainPrice.setOwnerPhone(shop.getPhone());
                    goodsBargainPrice.setShopName(shop.getName());
                    goodsBargainPrice.setGoodsName(g.getName());
                    goodsBargainPrice.setCategoryName(goodsCategory.getName());
                }));
        return R.ok(page);
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
@@ -8,6 +8,8 @@
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.other.api.domain.Goods;
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.api.feignClient.VipSettingClient;
import com.ruoyi.other.service.GoodsService;
import com.ruoyi.other.vo.GoodsVO;
import io.swagger.annotations.Api;
@@ -32,6 +34,8 @@
public class GoodsController extends BaseController {
    @Resource
    private GoodsService goodsService;
    @Resource
    private VipSettingClient settingClient;
    /**
     * 添加商品
@@ -83,6 +87,15 @@
        return R.ok();
    }
    /**
     * 获取会员等级信息
     */
    @GetMapping("/getVipSetting")
    @ApiOperation(value = "会员等级信息", tags = {"管理后台-商品管理"})
    public R<List<VipSetting>> getVipSetting(){
        return settingClient.info();
    }
    /**
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/OrderActivityInfoController.java
@@ -7,12 +7,14 @@
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.other.api.domain.OrderActivityInfo;
import com.ruoyi.other.service.OrderActivityInfoService;
import com.ruoyi.other.service.VipSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -33,6 +35,8 @@
    @Resource
    private OrderActivityInfoService orderActivityInfoService;
    @Resource
    private VipSettingService vipSettingService;
    
    
    /**
@@ -52,8 +56,9 @@
     * 添加活动
     */
    @PostMapping("/save")
    @ApiOperation(value = "添加活动", tags = {"管理后台-活动管理-订单优惠活动"})
    @ApiOperation(value = "订单优惠活动-添加活动", tags = {"管理后台-活动管理"})
    public R<Void> saveActivityConfig(@RequestBody OrderActivityInfo orderActivityInfo){
        orderActivityInfo.setIsShelf(0);
        orderActivityInfoService.save(orderActivityInfo);
        return R.ok();
    }
@@ -61,8 +66,8 @@
    /**
     * 删除活动
     */
    @PostMapping("/delete")
    @ApiOperation(value = "删除活动", tags = {"管理后台-活动管理-订单优惠活动-"})
    @DeleteMapping("/delete")
    @ApiOperation(value = "订单优惠活动-删除活动", tags = {"管理后台-活动管理"})
    public R<Void> deleteActivityConfig(@RequestParam("id") Long id){
        orderActivityInfoService.removeById(id);
        return R.ok();
@@ -72,8 +77,9 @@
     * 修改活动
     */
    @PostMapping("/update")
    @ApiOperation(value = "修改活动", tags = {"管理后台-活动管理-订单优惠活动-"})
    @ApiOperation(value = "修改活动", tags = {"管理后台-活动管理"})
    public R<Void> updateActivityConfig(@RequestBody OrderActivityInfo orderActivityInfo){
        orderActivityInfo.setId(Long.valueOf(orderActivityInfo.getIdStr()));
        orderActivityInfoService.updateById(orderActivityInfo);
        return R.ok();
    }
@@ -82,26 +88,55 @@
     * 获取活动列表
     */
    @GetMapping("/list")
    @ApiOperation(value = "获取活动列表", tags = {"管理后台-活动管理-订单优惠活动"})
    @ApiOperation(value = "订单优惠活动-获取活动列表", tags = {"管理后台-活动管理"})
    public R<Page<OrderActivityInfo>> list(@ApiParam("页码") @RequestParam Integer pageNum,
                                     @ApiParam("每一页数据大小") Integer pageSize,
                                     OrderActivityInfo orderActivityInfo){
        return R.ok(orderActivityInfoService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<OrderActivityInfo>()
        Page<OrderActivityInfo> page = orderActivityInfoService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<OrderActivityInfo>()
                .eq(orderActivityInfo.getId() != null, OrderActivityInfo::getId, orderActivityInfo.getId())
                .eq(StringUtils.isNotEmpty(orderActivityInfo.getActivityName()), OrderActivityInfo::getActivityName, orderActivityInfo.getActivityName())
                .lt(orderActivityInfo.getStatus() == 0, OrderActivityInfo::getStartTime, orderActivityInfo.getStartTime())
                .ge(orderActivityInfo.getStatus() == 1, OrderActivityInfo::getEndTime, orderActivityInfo.getStartTime())
                .eq(orderActivityInfo.getIsShelf() != null, OrderActivityInfo::getIsShelf, orderActivityInfo.getIsShelf())));
                .lt(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 0, OrderActivityInfo::getStartTime, orderActivityInfo.getStartTime())
                .ge(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 1, OrderActivityInfo::getEndTime, orderActivityInfo.getStartTime())
                .eq(orderActivityInfo.getIsShelf() != null, OrderActivityInfo::getIsShelf, orderActivityInfo.getIsShelf()));
        page.getRecords().forEach(item -> {
            LocalDateTime startTime = item.getStartTime();
            LocalDateTime now = LocalDateTime.now();
            LocalDateTime endTime = item.getEndTime();
            if (endTime.isBefore(now)){
                item.setStatus(2); //已结束
            }else if (startTime.isBefore(now)){
                item.setStatus(1); // 已开始
            }else {
                item.setStatus(0); // 未开始
            }
            String vipIds = item.getVipIds();
            if (StringUtils.isNotEmpty(vipIds)){
                String[] vipIdArr = vipIds.split(",");
                if (vipIdArr.length == 7){
                    item.setVipName("全部");
                }else {
                    List<String> vipNameList = new ArrayList<>();
                    for (String vipId : vipIdArr) {
                        String vipName = vipSettingService.getById(Long.parseLong(vipId)).getVipName();
                        vipNameList.add(vipName);
                    }
                    item.setVipName(String.join(",", vipNameList));
                }
            }
        });
        return R.ok(page);
    }
    /**
     * 获取活动详情
     */
    @GetMapping("/getDetailById")
    @ApiOperation(value = "获取活动详情", tags = {"管理后台-活动管理-订单优惠活动"})
    public R<OrderActivityInfo> getDetailById(@RequestParam("id") Long id){
        return R.ok(orderActivityInfoService.getById(id));
    @ApiOperation(value = "订单优惠活动-获取活动详情", tags = {"管理后台-活动管理"})
    public R<OrderActivityInfo> getDetailById(@RequestParam("id") String id){
        return R.ok(orderActivityInfoService.getById(Long.parseLong(id)));
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java
@@ -43,5 +43,45 @@
        }
    }
    /**
     * 获取红包配置
     */
    @ApiOperation(value = "获取红包配置", tags = {"管理后台-活动管理-签到红包"})
    @GetMapping("/getRedPackegeSet")
    public R<RedPackegeSet> getRedPackegeSet(){
        return R.ok(redPackegeSetService.getOne(null));
    }
    /**
     * 添加红包配置
     */
    @ApiOperation(value = "添加红包配置", tags = {"管理后台-活动管理-签到红包"})
    @GetMapping("/addRedPackegeSet")
    public R<Void> addRedPackegeSet(RedPackegeSet redPackegeSet){
        RedPackegeSet one = redPackegeSetService.getOne(null);
        if (one==null){
            redPackegeSet.setId(1);
            redPackegeSetService.save(redPackegeSet);
        }else {
            if (one.getId()==null){
                return R.fail("参数错误");
            }
            redPackegeSetService.updateById(redPackegeSet);
        }
        return R.ok();
    }
    /**
     * 删除红包配置
     */
    @ApiOperation(value = "删除红包配置", tags = {"管理后台-活动管理-签到红包"})
    @GetMapping("/delRedPackegeSet")
    public R<Void> delRedPackegeSet(){
        redPackegeSetService.removeById(1);
        return R.ok();
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RegionController.java
@@ -17,28 +17,19 @@
@RestController
@RequestMapping("/region")
@Api("地区")
@Api(tags = "地区")
public class RegionController {
    @Resource
    private RegionService regionService;
    /**
     * 获取省份列表
     * 省市区级联
     */
    @GetMapping("/getProvinceList")
    @ApiOperation("获取省份列表")
    public R<List<Region>> getProvinceList() {
    @ApiOperation("省市区级联")
    public R<List<Region>> getProvinceList(@ApiParam("父级id") @RequestParam Long parentId) {
        return R.ok(regionService.list(new LambdaQueryWrapper<Region>()
                .eq(Region::getParentId, 0)));
                .eq(Region::getParentId, parentId)));
    }
    /**
     * 获取下级地区列表
     */
    @GetMapping("/getNextRegionList")
    @ApiOperation("获取下级地区列表")
    public R<List<Region>> getNextRegionList(@ApiParam("父级id") @RequestParam Long id) {
        return R.ok(regionService.list(new LambdaQueryWrapper<Region>()
                .eq(Region::getParentId, id)));
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
@@ -47,7 +48,7 @@
     * 秒杀活动列表
     */
    @GetMapping("/list")
    @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页"})
    @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页","后台管理-活动管理-秒杀活动"})
    public R<TableDataInfo> list(Goods goods)
    {
        startPage();
@@ -81,6 +82,69 @@
        }
        return R.ok(goodsSeckill);
    }
    /**
     * 新增秒杀活动
     */
    @PostMapping("/save")
    @ApiOperation(value = "新增秒杀活动", tags = {"后台管理-活动管理-秒杀活动" })
    public R<Void> save(@RequestBody SeckillActivityInfo seckillActivityInfo)
    {
        seckillActivityInfoService.saveSeckillActivityInfo(seckillActivityInfo);
        return R.ok();
    }
    /**
     * 修改秒杀活动
     */
    @PutMapping("/update")
    @ApiOperation(value = "修改秒杀活动", tags = {"后台管理-活动管理-秒杀活动" })
    public R<Void> update(@RequestBody SeckillActivityInfo seckillActivityInfo)
    {
        seckillActivityInfoService.updateSeckillActivityInfo(seckillActivityInfo);
        return R.ok();
    }
    /**
     * 删除秒杀活动
     */
    @DeleteMapping("/remove/{id}")
    @ApiOperation(value = "删除秒杀活动", tags = {"后台管理-活动管理-秒杀活动" })
    public R<Void> remove(@PathVariable Integer id)
    {
        seckillActivityInfoService.removeById(id);
        return R.ok();
    }
    /**
     * 获取秒杀活动明细
     */
    @GetMapping("/getSeckillActivityDetail")
    @ApiOperation(value = "获取秒杀活动明细", tags = {"后台管理-活动管理-秒杀活动" })
    public R<SeckillActivityInfo> getSeckillActivityDetail(Integer id)
    {
        SeckillActivityInfo seckillActivityInfo = seckillActivityInfoService.getById(id);
        List<GoodsSeckill> goodsSeckills = goodsSeckillService.list(new LambdaQueryWrapper<GoodsSeckill>()
                .eq(GoodsSeckill::getSeckillActivityInfoId, id));
        seckillActivityInfo.setGoodsSeckills(goodsSeckills);
        return R.ok(seckillActivityInfo);
    }
    /**
     * 修改上/下架状态
     */
    @PutMapping("/updateShowStatus")
    @ApiOperation(value = "修改上/下架状态", tags = {"后台管理-活动管理-秒杀活动" })
    public R<Void> updateShowStatus(@RequestBody SeckillActivityVO seckillActivityVO)
    {
        seckillActivityInfoService.update(new LambdaUpdateWrapper<SeckillActivityInfo>()
                .eq(SeckillActivityInfo::getId, seckillActivityVO.getId())
                .set(SeckillActivityInfo::getIsShelves, seckillActivityVO.getShowStatus()));
        return R.ok();
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
@@ -24,7 +24,7 @@
/**
 * <p>
 *  前端控制器
 * 前端控制器
 * </p>
 *
 * @author luodangjia
@@ -51,7 +51,7 @@
            @ApiImplicitParam(value = "对象id(addType=1:平台添加,addType=2:推广人添加,addType=3:门店添加)", name = "objectId", required = true, dataType = "int"),
    })
    @GetMapping("/list")
    public R<List<Share>> list(@RequestParam Integer objectId){
    public R<List<Share>> list(@RequestParam Integer objectId) {
        return R.ok(shareService.list(new LambdaQueryWrapper<Share>()
                .eq(Share::getObjectId, objectId)));
    }
@@ -59,12 +59,11 @@
    @ApiOperation(value = "分享页列表", tags = {"小程序-推广中心"})
    @GetMapping("/recommand/list")
    public R<List<Share>> recommandlist(){
    public R<List<Share>> recommandlist() {
        Long userid = tokenService.getLoginUserApplet().getUserid();
        return R.ok(shareService.list(new LambdaQueryWrapper<Share>().eq(Share::getAddType,2)
        return R.ok(shareService.list(new LambdaQueryWrapper<Share>().eq(Share::getAddType, 2)
                .eq(Share::getObjectId, userid)));
    }
    /**
@@ -72,11 +71,11 @@
     */
    @ApiOperation(value = "分享添加", tags = {"小程序-个人中心-门店管理"})
    @PostMapping
    public R<Void> add(@RequestBody Share share){
    public R<Void> add(@RequestBody Share share) {
        Long userid = tokenService.getLoginUserApplet().getUserid();
        if (share.getAddType()==1) {
        if (share.getAddType() == 1) {
            share.setAuditStatus(ShareAuditStatus.WAIT.getCode());
        }else if (share.getAddType()==2){
        } else if (share.getAddType() == 2) {
            share.setAuditStatus(ShareAuditStatus.WAIT.getCode());
            share.setObjectId(userid.toString());
        }
@@ -91,7 +90,7 @@
     */
    @ApiOperation(value = "分享删除", tags = {"小程序-个人中心-门店管理"})
    @DeleteMapping
    public R<Void> delete(@RequestBody Share share){
    public R<Void> delete(@RequestBody Share share) {
        shareService.removeById(share);
        return R.ok();
    }
@@ -101,7 +100,7 @@
     */
    @ApiOperation(value = "分享编辑", tags = {"小程序-个人中心-门店管理"})
    @PutMapping
     public R<Void> edit(@RequestBody Share share){
    public R<Void> edit(@RequestBody Share share) {
        share.setAuditStatus(ShareAuditStatus.WAIT.getCode());
        shareService.updateById(share);
        return R.ok();
@@ -112,19 +111,20 @@
     */
    @ApiOperation(value = "分享详情", tags = {"小程序-个人中心-门店管理"})
    @GetMapping("/detail/{id}")
    public R<Share> detail(@PathVariable("id") Integer id){
    public R<Share> detail(@PathVariable("id") Integer id) {
        return R.ok(shareService.getById(id));
    }
    @ApiOperation(value = "广告管理-分享管理-添加", tags = {"管理后台"})
    @PostMapping("/manage/add")
    public R<Void> manage(@RequestBody Share share){
    public R<Void> manage(@RequestBody Share share) {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        Long userid = loginUser.getSysUser().getUserId();
        share.setAddType(1);
            share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode());
            share.setObjectId(userid.toString());
        share.setAppletShare(0);
        share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode());
        share.setObjectId(userid.toString());
        share.setDelFlag(0);
        shareService.save(share);
        return R.ok();
@@ -132,7 +132,7 @@
    @ApiOperation(value = "广告管理-分享管理-编辑", tags = {"管理后台"})
    @PostMapping("/manage/edit")
    public R<Void> manageedit(@RequestBody Share share){
    public R<Void> manageedit(@RequestBody Share share) {
        shareService.updateById(share);
        return R.ok();
@@ -140,7 +140,7 @@
    @ApiOperation(value = "广告管理-分享管理-删除", tags = {"管理后台"})
    @GetMapping("/manage/delete")
    public R<Void> managedelete(@RequestParam Integer id){
    public R<Void> managedelete(@RequestParam Integer id) {
        shareService.removeById(id);
        return R.ok();
@@ -148,17 +148,17 @@
    @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().eq(Share::getAuditStatus,1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageSize, pageSize));
    public R<Page<Share>> managelist(String name, Integer addType, @RequestParam Integer pageNum, Integer 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(pageNum, pageSize));
        return R.ok(page);
    }
    @ApiOperation(value = "广告管理-分享管理-设为小程序分享", tags = {"管理后台"})
    @GetMapping("/manage/set")
    public R<Void> set(@RequestParam Integer id){
    public R<Void> set(@RequestParam Integer id) {
        //将所有分享设为不是小程序分享
        List<Share> list = shareService.lambdaQuery().list();
        if (!list.isEmpty()){
        if (!list.isEmpty()) {
            for (Share share : list) {
                share.setAppletShare(0);
            }
@@ -174,17 +174,17 @@
    @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(pageNum, pageSize));
    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(pageNum, pageSize));
        for (Share record : page.getRecords()) {
            if (record.getAddType()==2) {
            if (record.getAddType() == 2) {
                AppUser appUserById = appUserClient.getAppUserById(Long.valueOf(record.getObjectId()));
                record.setAuthName(appUserById.getName());
                record.setAuthPhone(appUserById.getPhone());
            }
            if (record.getAddType()==3) {
            if (record.getAddType() == 3) {
                R<Shop> shopById = shopClient.getShopById(Integer.valueOf(record.getObjectId()));
                if (shopById.getData()!=null){
                if (shopById.getData() != null) {
                    record.setAuthName(shopById.getData().getName());
                }
            }
@@ -194,22 +194,20 @@
    @ApiOperation(value = "广告管理-分享管理-详情", tags = {"管理后台"})
    @GetMapping("/manage/auth/detail")
    public R<Share> authmanagelist(Integer id){
    public R<Share> authmanagelist(Integer id) {
        Share byId = shareService.getById(id);
        return R.ok(byId);
    }
    @ApiOperation(value = "广告管理-分享管理-审核", tags = {"管理后台"})
    @GetMapping("/manage/auth/check")
    public R<Share> authmanagecheck(Integer id, @ApiParam("1=审核通过,2=审核失败") Integer auditStatus, @ApiParam("备注") String auditMsg){
    public R<Share> authmanagecheck(Integer id, @ApiParam("1=审核通过,2=审核失败") Integer auditStatus, @ApiParam("备注") String auditMsg) {
        Share byId = shareService.getById(id);
        byId.setAuditStatus(auditStatus);
        byId.setAuditMsg(auditMsg);
        shareService.updateById(byId);
        return R.ok(byId);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -107,7 +107,7 @@
    }
    @PutMapping("/editShop")
    @ApiOperation(value = "门店管理-编辑门店", tags = {"管理后台"})
    @ApiOperation(value = "门店管理-编辑门店", tags = {"管理后台-门店管理"})
    public R<Void> editShop(@RequestBody Shop shop){
        shopService.updateById(shop);
        return R.ok();
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopPointController.java
@@ -1,8 +1,12 @@
package com.ruoyi.other.controller;
import com.ruoyi.other.service.ShopPointService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
 * <p>
@@ -14,7 +18,20 @@
 */
@RestController
@RequestMapping("/shop-point")
@Api(tags = "管理后台-财务统计-门店积分统计")
public class ShopPointController {
    @Resource
    private ShopPointService shopPointService;
    /**
     * 门店积分统计
     */
    public Object statistics() {
        return shopPointService.statistics();
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/CouponInfoMapper.java
@@ -1,6 +1,7 @@
package com.ruoyi.other.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.other.api.domain.CouponInfo;
/**
@@ -12,5 +13,5 @@
 * @since 2024-11-20
 */
public interface CouponInfoMapper extends BaseMapper<CouponInfo> {
    IPage<CouponInfo> queryCouponInfoPage(IPage<CouponInfo> page, CouponInfo couponInfo);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/CouponInfoService.java
@@ -1,5 +1,6 @@
package com.ruoyi.other.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.other.api.domain.CouponInfo;
@@ -13,4 +14,6 @@
 */
public interface CouponInfoService extends IService<CouponInfo> {
    IPage<CouponInfo> queryCouponInfoPage(IPage<CouponInfo> page, CouponInfo couponInfo);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsSeckillService.java
@@ -13,4 +13,5 @@
 */
public interface GoodsSeckillService extends IService<GoodsSeckill> {
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/SeckillActivityInfoService.java
@@ -21,4 +21,8 @@
    List<SeckillActivityVO> listSeckillActivity(Goods goods);
    SeckillActivityDetailVO detail(Integer seckillActivityId);
    void saveSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo);
    void updateSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopPointService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.other.api.domain.ShopPoint;
import com.ruoyi.other.vo.ShopPointStatistics;
/**
 * <p>
@@ -13,4 +14,5 @@
 */
public interface ShopPointService extends IService<ShopPoint> {
    ShopPointStatistics statistics();
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/CouponInfoServiceImpl.java
@@ -1,5 +1,6 @@
package com.ruoyi.other.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.other.mapper.CouponInfoMapper;
import com.ruoyi.other.api.domain.CouponInfo;
@@ -17,4 +18,8 @@
@Service
public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponInfo> implements CouponInfoService {
    @Override
    public IPage<CouponInfo> queryCouponInfoPage(IPage<CouponInfo> page, CouponInfo couponInfo) {
        return this.baseMapper.queryCouponInfoPage(page, couponInfo);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java
@@ -5,18 +5,17 @@
import com.ruoyi.account.api.feignClient.AppUserClient;
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.api.domain.Goods;
import com.ruoyi.other.api.domain.GoodsShop;
import com.ruoyi.other.api.domain.SeckillActivityInfo;
import com.ruoyi.other.api.domain.Shop;
import com.ruoyi.other.api.domain.*;
import com.ruoyi.other.mapper.GoodsShopMapper;
import com.ruoyi.other.mapper.SeckillActivityInfoMapper;
import com.ruoyi.other.mapper.ShopMapper;
import com.ruoyi.other.service.GoodsSeckillService;
import com.ruoyi.other.service.SeckillActivityInfoService;
import com.ruoyi.other.vo.SeckillActivityDetailVO;
import com.ruoyi.other.vo.SeckillActivityVO;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@@ -42,6 +41,8 @@
    private TokenService tokenService;
    @Resource
    private AppUserClient appUserClient;
    @Resource
    private GoodsSeckillService goodsSeckillService;
    @Override
    public List<SeckillActivityVO> listSeckillActivity(Goods goods) {
@@ -68,4 +69,23 @@
        seckillActivityDetailVO.setShopList(shopNames);
        return seckillActivityDetailVO;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo) {
        this.baseMapper.insert(seckillActivityInfo);
        List<GoodsSeckill> goodsSeckills = seckillActivityInfo.getGoodsSeckills();
        goodsSeckills.forEach(goodsSeckill -> goodsSeckill.setSeckillActivityInfoId(seckillActivityInfo.getId()));
        goodsSeckillService.saveBatch(goodsSeckills);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo) {
        this.baseMapper.updateById(seckillActivityInfo);
        goodsSeckillService.remove(new LambdaQueryWrapper<GoodsSeckill>().eq(GoodsSeckill::getSeckillActivityInfoId, seckillActivityInfo.getId()));
        List<GoodsSeckill> goodsSeckills = seckillActivityInfo.getGoodsSeckills();
        goodsSeckills.forEach(goodsSeckill -> goodsSeckill.setSeckillActivityInfoId(seckillActivityInfo.getId()));
        goodsSeckillService.saveBatch(goodsSeckills);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java
@@ -4,6 +4,7 @@
import com.ruoyi.other.mapper.ShopPointMapper;
import com.ruoyi.other.api.domain.ShopPoint;
import com.ruoyi.other.service.ShopPointService;
import com.ruoyi.other.vo.ShopPointStatistics;
import org.springframework.stereotype.Service;
/**
@@ -17,4 +18,8 @@
@Service
public class ShopPointServiceImpl extends ServiceImpl<ShopPointMapper, ShopPoint> implements ShopPointService {
    @Override
    public ShopPointStatistics statistics() {
        return null;
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
@@ -49,8 +49,7 @@
        Page<Shop> page = new Page<>();
        page.setCurrent(PageNum);
        page.setSize(pageSize);
        IPage<Shop> shopIPage = shopMapper.selectShopList(page, shop);
        return shopIPage;
        return shopMapper.selectShopList(page, shop);
    }
    @Override
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityVO.java
@@ -20,6 +20,24 @@
    @ApiModelProperty(value = "商品简介")
    private String introduction;
    @ApiModelProperty(value = "商品类型")
    private String goodsType;
    @ApiModelProperty(value = "商品分类名称")
    private String goodsCategoryName;
    @ApiModelProperty(value = "运营成本")
    private BigDecimal operatingCost;
    @ApiModelProperty(value = "门店成本")
    private BigDecimal shopCost;
    @ApiModelProperty(value = "限购数量")
    private Integer maxNum;
    @ApiModelProperty(value = "销量")
    private Integer saleNum;
    @ApiModelProperty(value = "封面图")
    private String homePagePicture;
@@ -29,8 +47,6 @@
    @ApiModelProperty(value = "基础售价")
    private BigDecimal sellingPrice;
    @ApiModelProperty(value = "已售数量")
    private Integer saleNum;
    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -40,4 +56,10 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;
    @ApiModelProperty(value = "状态:1未开始 2已开始 3已结束")
    private Integer status;
    @ApiModelProperty(value = "展示状态:0下架中  1上架中")
    private Integer showStatus;
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopPointStatistics.java
New file
@@ -0,0 +1,39 @@
package com.ruoyi.other.vo;
import com.ruoyi.other.api.domain.ShopPoint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("门店积分统计")
public class ShopPointStatistics {
    /**
     * 门店获得总积分
     */
    @ApiModelProperty("门店获得总积分")
    private Integer totalPoint;
    /**
     * 门店业绩积分
     */
    @ApiModelProperty("门店业绩积分")
    private Integer shopPoint;
    /**
     * 门店返佣积分
     */
    @ApiModelProperty("门店返佣积分")
    private Integer shopCommissionPoint;
    /**
     * 下级门店返佣积分
     */
    @ApiModelProperty("下级门店返佣积分")
    private Integer subShopCommissionPoint;
    private List<ShopPoint> shopPointList;
}
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/CouponInfoMapper.xml
New file
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.other.mapper.CouponInfoMapper">
    <select id="queryCouponInfoPage" resultType="com.ruoyi.other.api.domain.CouponInfo">
        SELECT
            tci.id,
            tci.create_time,
            tci.coupon_name,
            tci.coupon_type,
            tci.condition_amount,
            tci.discount_amount,
            tci.money_amount,
            tci.discount,
            tci.for_good_ids,
            tci.send_num,
            tci.max_num,
            tci.period_type,
            tci.period_start_time,
            tci.period_end_time,
            tci.period_days,
            tci.send_start_time,
            tci.send_end_time,
            tci.send_type,
            tci.need_point,
            tci.person_type,
            tci.person_ids
        FROM
            t_coupon_info tci
        <where>
            tci.del_flag = 0
            <if test="couponInfo.couponName != null and couponInfo.couponName != ''">
                AND tci.coupon_name LIKE concat('%', #{couponInfo.couponName}, '%')
            </if>
            <if test="couponInfo.couponType != null">
                AND tci.coupon_type = #{couponInfo.couponType}
            </if>
            <if test="couponInfo.send_type != null">
                AND tci.send_type = #{couponInfo.send_type}
            </if>
            <if test="couponInfo.personType != null">
                AND tci.person_type = #{couponInfo.personType}
            </if>
            <if test="couponInfo.shelfStatus != null">
                AND tci.shelf_status = #{couponInfo.shelfStatus}
            </if>
        </where>
    </select>
</mapper>
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml
@@ -58,20 +58,21 @@
            ts.id,
            ts.`name`,
            ts.business_date,
            tau.`name` managerName,
            ts.start_time,
            ts.end_time,
            ts.phone,
            ts.address,
            ts.`status`
            ts.`status`,
            ts.shop_manager
        FROM
            `qijisheng_other`.t_shop ts
                LEFT JOIN `qijisheng_account`.t_app_user tau ON ts.app_user_id = tau.id
            t_shop ts
        <where>
            ts.del_flag = 0
            <if test="shop.name != null and shop.name != ''">
                and ts.name like concat('%',#{shop.name},'%')
            </if>
            <if test="shop.managerName != null and shop.managerName != ''">
                and tau.name like concat('%',#{shop.managerName},'%')
            <if test="shop.shopManager != null and shop.shopManager != ''">
                and ts.shop_manager like concat('%',#{shop.shopManager},'%')
            </if>
            <if test="shop.phone != null and shop.phone != ''">
                and ts.phone like concat('%',#{shop.phone},'%')