Merge remote-tracking branch 'origin/master'
New file |
| | |
| | | |
| | | { |
| | | "province": "", |
| | | "city":"", |
| | | "area": "", |
| | | "vip": [] |
| | | } |
| | |
| | | private String userName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("消费用户手机号") |
| | | private String userPhone; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("消费金额") |
| | | private BigDecimal amount; |
| | | |
| | |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | @TableField(exist = false) |
| | | private String userPhone; |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @TableField(exist = false) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @TableField(exist = false) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endTime; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Long> userIds; |
| | | @TableField(exist = false) |
| | | private Integer pageNum; |
| | | @TableField(exist = false) |
| | | private Integer pageSize; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "审核状态 1'待审核',2'审核通过',3'审核拒绝' ") |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | @TableField(exist = false) |
| | | private String userPhone; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField("bound_shop_superiors_points") |
| | | private Integer boundShopSuperiorsPoints; |
| | | |
| | | @TableField(exist = false) |
| | | private List<GoodsArea> goodsAreaList; |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.dto.BalanceQuery; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | import com.ruoyi.account.service.BalanceChangeRecordService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | balanceChangeRecordService.save(balanceChangeRecord); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "余额变更明细", tags = {"后台"}) |
| | | public R<IPage<BalanceChangeRecord>> page(@RequestBody BalanceQuery agentQuery) { |
| | | |
| | | return R.ok(balanceChangeRecordService.pageList(agentQuery)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | import com.ruoyi.account.service.UserClickLogService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/user-click-log") |
| | | public class UserClickLogController { |
| | | @Resource |
| | | private UserClickLogService userClickLogService; |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "申请点击列表", tags = {"后台"}) |
| | | public R<IPage<UserClickLog>> page(@RequestBody UserCancelQuery agentQuery) { |
| | | |
| | | return R.ok(userClickLogService.pageList(agentQuery)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | @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); |
| | | public R<IPage<UserPoint>> list(UserPoint userPoint) { |
| | | IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(userPoint.getPageNum(), userPoint.getPageSize()), userPoint); |
| | | return R.ok(userPointPage); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.dto.WithQuery; |
| | | import com.ruoyi.account.dto.WithdrawalRequestsDTO; |
| | | import com.ruoyi.account.service.WithdrawalRequestsService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "提现申请", tags = {"后台"}) |
| | | public R<IPage<WithdrawalRequests>> page(@RequestBody WithQuery withQuery){ |
| | | return R.ok(withdrawalRequestsService.pageList(withQuery)); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class BalanceQuery { |
| | | @ApiModelProperty("用户名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | @ApiModelProperty("类型:1充值2提现3红包4分佣5商城购物") |
| | | private Integer changeType; |
| | | |
| | | private LocalDate localDate1; |
| | | private LocalDate localDate2; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class WithQuery { |
| | | @ApiModelProperty("用户名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.dto.BalanceQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface BalanceChangeRecordMapper extends BaseMapper<BalanceChangeRecord> { |
| | | IPage<BalanceChangeRecord> pageList(@Param("page") Page<BalanceChangeRecord> page,@Param("agentQuery") BalanceQuery agentQuery); |
| | | } |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface UserClickLogMapper extends BaseMapper<UserClickLog> { |
| | | |
| | | IPage<UserClickLog> pageList(@Param("page") Page<UserClickLog> page,@Param("agentQuery") UserCancelQuery agentQuery); |
| | | } |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.dto.WithQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface WithdrawalRequestsMapper extends BaseMapper<WithdrawalRequests> { |
| | | |
| | | IPage<WithdrawalRequests> pageList(@Param("page") Page<UserClickLog> page, @Param("withQuery")WithQuery withQuery); |
| | | } |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.dto.BalanceQuery; |
| | | |
| | | public interface BalanceChangeRecordService extends IService<BalanceChangeRecord> { |
| | | IPage<BalanceChangeRecord> pageList(BalanceQuery agentQuery); |
| | | } |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface UserClickLogService extends IService<UserClickLog> { |
| | | |
| | | IPage<UserClickLog> pageList(UserCancelQuery agentQuery); |
| | | } |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.dto.WithQuery; |
| | | import com.ruoyi.account.dto.WithdrawalRequestsDTO; |
| | | |
| | | /** |
| | |
| | | * 提现申请 |
| | | */ |
| | | void withdrawalApply(WithdrawalRequestsDTO params); |
| | | |
| | | IPage<WithdrawalRequests> pageList(WithQuery withQuery); |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | 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.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.dto.BalanceQuery; |
| | | import com.ruoyi.account.mapper.BalanceChangeRecordMapper; |
| | | import com.ruoyi.account.service.BalanceChangeRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class BalanceChangeRecordServiceImpl extends ServiceImpl<BalanceChangeRecordMapper, BalanceChangeRecord> implements BalanceChangeRecordService { |
| | | @Override |
| | | public IPage<BalanceChangeRecord> pageList(BalanceQuery agentQuery) { |
| | | Page<BalanceChangeRecord> page = new Page<>(); |
| | | page.setCurrent(agentQuery.getPageNum()); |
| | | page.setSize(agentQuery.getPageSize()); |
| | | IPage<BalanceChangeRecord> shopIPage = this.baseMapper.pageList(page, agentQuery); |
| | | return shopIPage; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | 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.AgentApplication; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | import com.ruoyi.account.mapper.UserClickLogMapper; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.service.UserClickLogService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class UserClickLogServiceImpl extends ServiceImpl<UserClickLogMapper, UserClickLog> implements UserClickLogService { |
| | | |
| | | @Override |
| | | public IPage<UserClickLog> pageList(UserCancelQuery agentQuery) { |
| | | Page<UserClickLog> page = new Page<>(); |
| | | page.setCurrent(agentQuery.getPageNum()); |
| | | page.setSize(agentQuery.getPageSize()); |
| | | IPage<UserClickLog> shopIPage = this.baseMapper.pageList(page, agentQuery); |
| | | return shopIPage; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | 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.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.dto.WithQuery; |
| | | import com.ruoyi.account.dto.WithdrawalRequestsDTO; |
| | | import com.ruoyi.account.mapper.WithdrawalRequestsMapper; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | |
| | | save(withdrawalRequests); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<WithdrawalRequests> pageList(WithQuery withQuery) { |
| | | Page<UserClickLog> page = new Page<>(); |
| | | page.setCurrent(withQuery.getPageNum()); |
| | | page.setSize(withQuery.getPageSize()); |
| | | IPage<WithdrawalRequests> shopIPage = this.baseMapper.pageList(page, withQuery); |
| | | return shopIPage; |
| | | } |
| | | |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.account.mapper.BalanceChangeRecordMapper"> |
| | | |
| | | <select id="pageList" resultType="com.ruoyi.account.api.model.BalanceChangeRecord"> |
| | | select t1.*,t2.name as userName,t2.phone as userPhone |
| | | 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> |
| | | <if test="agentQuery.phone != null and agentQuery.phone != ''"> |
| | | and t2.phone like concat('%',#{agentQuery.phone},'%') |
| | | </if> |
| | | <if test="agentQuery.changeType != null"> |
| | | and t1.change_type = #{agentQuery.changeType} |
| | | </if> |
| | | <if test="agentQuery.localDate1 != null"> |
| | | and DATE(t1.create_time) between #{agentQuery.localDate1} and #{agentQuery.localDate2} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, del_flag, create_time, app_user_id, vip_id |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.account.api.model.UserClickLog"> |
| | | select t1.* ,t2.phone as userPhone,t2.name as userName |
| | | from t_user_click_log t1 |
| | | left join t_app_user t2 on t1.app_user_id = t2.id |
| | | <where> |
| | | <if test="agentQuery.phone != null and agentQuery.phone != ''"> |
| | | and t2.phone like concat('%',#{agentQuery.phone},'%') |
| | | </if> |
| | | <if test="agentQuery.name != null and agentQuery.name != ''"> |
| | | and t2.name like concat('%',#{agentQuery.name},'%') |
| | | </if> |
| | | <if test="agentQuery.vipId != null"> |
| | | and t1.vip_id = #{agentQuery.vipId} |
| | | </if> |
| | | <if test="agentQuery.localDate1 != null"> |
| | | and DATE(t1.create_time) between #{agentQuery.localDate1} and #{agentQuery.localDate2} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, del_flag, create_time, app_user_id, withdrawal_amount, withdrawal_method, account_holder, bank_card_number, audit_status |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.account.api.model.WithdrawalRequests"> |
| | | select t1.*,t2.name as userName,t2.phone as userPhone |
| | | from t_withdrawal_requests t1 |
| | | left join t_app_user t2 on t1.app_user_id = t2.id |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.RechargeSet; |
| | | import com.ruoyi.other.service.RechargeSetService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/recharge-set") |
| | | public class RechargeSetController { |
| | | @Resource |
| | | private RechargeSetService rechargeSetService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "充值设置查询", tags = {"后台"}) |
| | | public R<List<RechargeSet>> list() { |
| | | return R.ok(rechargeSetService.list()); |
| | | } |
| | | @PostMapping("/set") |
| | | @ApiOperation(value = "充值设置", tags = {"后台"}) |
| | | public R<List<RechargeSet>> detail(@RequestBody List<RechargeSet> rechargeSets) { |
| | | boolean remove = rechargeSetService.remove(Wrappers.lambdaQuery()); |
| | | rechargeSetService.saveBatch(rechargeSets); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.other.api.domain.RedPackegeSet; |
| | | import com.ruoyi.other.service.RedPackegeSetService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 添加红包配置 |
| | | */ |
| | | @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("参数错误"); |
| | | @PostMapping("/addRedPackegeSet") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Void> addRedPackegeSet(@RequestBody List<RedPackegeSet> redPackegeSets){ |
| | | for (RedPackegeSet redPackegeSet : redPackegeSets) { |
| | | 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); |
| | | } |
| | | redPackegeSetService.updateById(redPackegeSet); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private ShopScoreService shopScoreService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | |
| | | |
| | |
| | | return R.ok(shopService.cheUserByPhone(phone)); |
| | | } |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @GetMapping ("/resetPassword") |
| | | @ApiOperation(value = "重置密码", tags = {"管理后台-门店管理"}) |
| | | public R<Void> resetPassword(@RequestParam(value = "ids") String ids) { |
| | | String[] idsArr = ids.split(","); |
| | | for (String id : idsArr) { |
| | | Shop shop = shopService.getById(Integer.valueOf(id)); |
| | | R<SysUser> sysUser = sysUserClient.getSysUser(shop.getAppUserId()); |
| | | SysUser userData = sysUser.getData(); |
| | | userData.setPassword(getLastSixDigits(userData.getPhonenumber())); |
| | | sysUserClient.resetPassword(userData); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取手机号的后六位。 |
| | | * |
| | | * @param phoneNumber 以字符串形式提供的手机号 |
| | | * @return 手机号的后六位 |
| | | * @throws IllegalArgumentException 如果手机号长度不足六位 |
| | | */ |
| | | public String getLastSixDigits(String phoneNumber) { |
| | | if (phoneNumber == null || phoneNumber.length() < 6) { |
| | | throw new IllegalArgumentException("手机号长度不足六位"); |
| | | } |
| | | // 取字符串的最后六位 |
| | | return phoneNumber.substring(phoneNumber.length() - 6); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 附近门店列表 |
New file |
| | |
| | | package com.ruoyi.other.dto; |
| | | |
| | | public class GoodsAreaDto { |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | // 特殊地区售价设置 |
| | | List<GoodsArea> goodsAreaList = goods.getGoodsAreaList(); |
| | | if (!CollectionUtils.isEmpty(goodsAreaList)){ |
| | | goodsAreaService.saveBatch(goodsAreaList); |
| | | for (GoodsArea goodsArea : goodsAreaList) { |
| | | List<GoodsArea> goodsAreaList1 = goodsArea.getGoodsAreaList(); |
| | | for (GoodsArea area : goodsAreaList1) { |
| | | area.setProvince(goodsArea.getProvince()); |
| | | area.setCity(goodsArea.getCity()); |
| | | area.setDistricts(goodsArea.getDistricts()); |
| | | area.setProvinceCode(goodsArea.getProvinceCode()); |
| | | area.setCityCode(goodsArea.getCityCode()); |
| | | area.setDistrictsCode(goodsArea.getDistrictsCode()); |
| | | } |
| | | goodsAreaService.saveBatch(goodsAreaList1); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | // 特殊地区售价设置 |
| | | List<GoodsArea> goodsAreaList = goods.getGoodsAreaList(); |
| | | goodsAreaService.updateBatchById(goodsAreaList); |
| | | if (!CollectionUtils.isEmpty(goodsAreaList)){ |
| | | for (GoodsArea goodsArea : goodsAreaList) { |
| | | List<GoodsArea> goodsAreaList1 = goodsArea.getGoodsAreaList(); |
| | | for (GoodsArea area : goodsAreaList1) { |
| | | area.setProvince(goodsArea.getProvince()); |
| | | area.setCity(goodsArea.getCity()); |
| | | area.setDistricts(goodsArea.getDistricts()); |
| | | area.setProvinceCode(goodsArea.getProvinceCode()); |
| | | area.setCityCode(goodsArea.getCityCode()); |
| | | area.setDistrictsCode(goodsArea.getDistrictsCode()); |
| | | } |
| | | goodsAreaService.updateBatchById(goodsAreaList1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | // 特殊地区售价设置 |
| | | List<GoodsArea> goodsAreaList = goodsAreaService.list(new LambdaQueryWrapper<GoodsArea>() |
| | | .eq(GoodsArea::getGoodsId, goodsId)); |
| | | goods.setGoodsAreaList(goodsAreaList); |
| | | |
| | | Map<String, List<GoodsArea>> listMap = goodsAreaList.stream() |
| | | .collect(Collectors.groupingBy(goodsArea -> |
| | | goodsArea.getProvinceCode() + goodsArea.getCityCode() + goodsArea.getDistrictsCode())); |
| | | |
| | | List<GoodsArea> goodsAreaList1 = new ArrayList<>(); |
| | | listMap.forEach((s, goodsAreas) -> { |
| | | GoodsArea goodsArea = goodsAreas.get(0); |
| | | goodsArea.setGoodsAreaList(goodsAreas); |
| | | goodsAreaList1.add(goodsArea); |
| | | }); |
| | | |
| | | goods.setGoodsAreaList(goodsAreaList1); |
| | | return goods; |
| | | } |
| | | } |