Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | |
| | | public R<List<Order>> byUserId(Long appUserId) { |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Order>> byShopId(Integer shopId) { |
| | | return R.fail(); |
| | | } |
| | | }; |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/order/byUserId") |
| | | public R<List<Order>> byUserId(@RequestParam("appUserId")Long appUserId); |
| | | @PostMapping("/order/byShopId") |
| | | public R<List<Order>> byShopId(@RequestParam("shopId")Integer shopId); |
| | | |
| | | |
| | | /** |
| | |
| | | @TableField("bound_shop_superiors_points") |
| | | private Integer boundShopSuperiorsPoints; |
| | | |
| | | @ApiModelProperty(value = "vip名子") |
| | | @TableField(exist = false) |
| | | private String vipName; |
| | | |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private List<GoodsSeckill> goodsSeckills; |
| | | |
| | | @TableField(exist = false) |
| | | private Goods goods; |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("create_user_id") |
| | | private Long createUserId; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | @TableField(exist = false) |
| | | private String shopName; |
| | | |
| | | |
| | | } |
| | |
| | | public R<AppUser> info(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser user = appUserService.getById(userId); |
| | | |
| | | |
| | | |
| | | return R.ok(user); |
| | | } |
| | | @Resource |
| | |
| | | return R.ok(appuserPage); |
| | | } |
| | | |
| | | @GetMapping("/shop/getAppuserPage") |
| | | @ApiOperation(value = "用户列表", tags = {"门店后台"}) |
| | | public R<IPage<AppUser>> shopGetAppuserPage(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | AppUser appUser) |
| | | { |
| | | Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId(); |
| | | |
| | | List<Long> userIds = new ArrayList<>(); |
| | | userIds.add(-1L); |
| | | //获取在该本店下单的用户ids |
| | | R<List<Order>> listR = remoteOrderGoodsClient.byShopId(objectId); |
| | | for (Order datum : listR.getData()) { |
| | | userIds.add(datum.getAppUserId()); |
| | | } |
| | | IPage<AppUser> appuserPage = appUserService.getAppuserPage1(pageNum, pageSize, appUser,objectId); |
| | | return R.ok(appuserPage); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/danger/info") |
| | | @ApiOperation(value = "用户列表-保级条件详情", tags = {"管理后台"}) |
| | | public R<DangerInfoDto> dangerinfo(Long id) |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | 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.AppUserService; |
| | | 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; |
| | | 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 io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private WithdrawalRequestsService withdrawalRequestsService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | |
| | | /** |
| | | * 提现申请 |
| | |
| | | @ApiOperation(value = "提现申请列表", tags = {"后台"}) |
| | | public R<IPage<WithdrawalRequests>> page(@RequestBody WithQuery withQuery){ |
| | | return R.ok(withdrawalRequestsService.pageList(withQuery)); |
| | | |
| | | } |
| | | // @PostMapping("/auth") |
| | | // @ApiOperation(value = "提现申请", tags = {"后台"}) |
| | | // public R<IPage<WithdrawalRequests>> page(@RequestBody WithQuery withQuery){ |
| | | // return R.ok(withdrawalRequestsService.pageList(withQuery)); |
| | | // |
| | | // } |
| | | @PostMapping("/auth") |
| | | @ApiOperation(value = "提现申请审批", tags = {"后台"}) |
| | | public R<IPage<WithdrawalRequests>> auth(@RequestParam Long id,@ApiParam("2'审核通过',3'审核拒绝'") Integer auditStatus){ |
| | | WithdrawalRequests byId = withdrawalRequestsService.getById(id); |
| | | if (auditStatus==2){ |
| | | |
| | | //将用户待审核金额减少,已提现金额增加 |
| | | AppUser byId1 = appUserService.getById(byId.getAppUserId()); |
| | | byId1.setWithdrawnAmount(byId1.getWithdrawnAmount().add(byId.getWithdrawalAmount())); |
| | | appUserService.updateById(byId1); |
| | | //执行对应的第三方提现 todo |
| | | } |
| | | //通过 |
| | | byId.setAuditStatus(auditStatus); |
| | | withdrawalRequestsService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | List<NearbyReferrerVo> getNearbyReferrer(@Param("cityCode") String cityCode, @Param("nearbyReferrer") NearbyReferrer nearbyReferrer); |
| | | |
| | | IPage<AppUser> getAppuserPage(@Param("page") IPage<AppUser> page, @Param("appUser") AppUser appUser); |
| | | IPage<AppUser> getAppuserPage1(@Param("page") IPage<AppUser> page, @Param("appUser") AppUser appUser,Integer objectId); |
| | | |
| | | |
| | | |
| | |
| | | void onlineRecord(); |
| | | |
| | | IPage<AppUser> getAppuserPage(Integer pageNum, Integer pageSize, AppUser appUser); |
| | | IPage<AppUser> getAppuserPage1(Integer pageNum, Integer pageSize, AppUser appUser,Integer objectId); |
| | | } |
| | |
| | | } |
| | | return appUserMapper.getAppuserPage(new Page<>(pageNum, pageSize), appUser); |
| | | } |
| | | @Override |
| | | public IPage<AppUser> getAppuserPage1(Integer pageNum, Integer pageSize, AppUser appUser,Integer objectId) { |
| | | |
| | | return appUserMapper.getAppuserPage1(new Page<>(pageNum, pageSize), appUser,objectId); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/byUserId") |
| | | public R<List<Order>> byUserId(@RequestParam("appUserId") Long appUserId){ |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getAppUserId, appUserId).list()); |
| | | } |
| | | @PostMapping("/byShopId") |
| | | public R<List<Order>> byShopId(@RequestParam("shopId") Integer shopId){ |
| | | return R.ok(orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).groupBy(Order::getAppUserId).list()); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | import com.ruoyi.other.api.vo.GetSeckillActivityInfo; |
| | | import com.ruoyi.other.mapper.SeckillActivityInfoMapper; |
| | | import com.ruoyi.other.service.GoodsSeckillService; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.service.SeckillActivityInfoService; |
| | | import com.ruoyi.other.vo.SeckillActivityDetailVO; |
| | | import com.ruoyi.other.vo.SeckillActivityVO; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private SeckillActivityInfoMapper seckillActivityInfoMapper; |
| | | |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | |
| | | |
| | |
| | | Goods goods) |
| | | { |
| | | IPage<SeckillActivityVO> IPage = seckillActivityInfoMapper.querySeckillActivity(Page.of(pageNum, pageSize), goods); |
| | | for (SeckillActivityVO record : IPage.getRecords()) { |
| | | LocalDateTime startTime = record.getStartTime(); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime endTime = record.getEndTime(); |
| | | if (endTime.isBefore(now)){ |
| | | record.setStatus(2); //已结束 |
| | | }else if (startTime.isBefore(now)){ |
| | | record.setStatus(1); // 已开始 |
| | | }else { |
| | | record.setStatus(0); // 未开始 |
| | | } |
| | | } |
| | | return R.ok(IPage); |
| | | } |
| | | |
| | |
| | | List<GoodsSeckill> goodsSeckills = goodsSeckillService.list(new LambdaQueryWrapper<GoodsSeckill>() |
| | | .eq(GoodsSeckill::getSeckillActivityInfoId, id)); |
| | | seckillActivityInfo.setGoodsSeckills(goodsSeckills); |
| | | Integer goodId = seckillActivityInfo.getGoodId(); |
| | | Goods goods = goodsService.getById(goodId); |
| | | seckillActivityInfo.setGoods(goods); |
| | | return R.ok(seckillActivityInfo); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "广告管理-分享管理-列表", tags = {"管理后台"}) |
| | | @GetMapping("/manage/list") |
| | | public R<Page<Share>> managelist(String name, Integer addType, @RequestParam Integer pageNum, Integer pageSize) { |
| | | tokenService.getLoginUser(); |
| | | //判断当前登陆人是平台还是门店 |
| | | if (tokenService.getLoginUser().getSysUser().getRoleType()==1) { |
| | | 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); |
| | | }else { |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAddType,3).eq(Share::getObjectId, tokenService.getLoginUser().getSysUser().getObjectId()).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "广告管理-分享管理-设为小程序分享", tags = {"管理后台"}) |
| | |
| | | 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.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.other.api.domain.ShopWithdraw; |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.service.ShopWithdrawService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/shop-withdraw") |
| | | @Api(tags = {"管理后台-门店管理-提现管理"}) |
| | | public class ShopWithdrawController { |
| | | |
| | | @Resource |
| | | private ShopWithdrawService shopWithdrawService; |
| | | @Resource |
| | | private ShopService shopService; |
| | | |
| | | /** |
| | | * 提现申请列表 |
| | | */ |
| | | @RequestMapping("/list") |
| | | @ApiOperation("提现申请列表") |
| | | public R<IPage<ShopWithdraw>> list(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | ShopWithdraw shopWithdraw) { |
| | | |
| | | Page<ShopWithdraw> page = shopWithdrawService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<ShopWithdraw>() |
| | | .like(StringUtils.isNotEmpty(shopWithdraw.getShopName()), ShopWithdraw::getShopName, shopWithdraw.getShopName())); |
| | | page.getRecords().forEach(item-> item.setShopName(shopService.getById(item.getShopId()).getName())); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.other.service.*; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | // 会员价格 |
| | | List<GoodsVip> goodsVipList = goodsVipService.list(new LambdaQueryWrapper<GoodsVip>() |
| | | .eq(GoodsVip::getGoodsId, goodsId)); |
| | | List<VipSetting> vipSettings = getVipSettings(goodsVipList.stream().map(GoodsVip::getVip)); |
| | | goodsVipList.forEach(goodsArea -> vipSettings.stream() |
| | | .filter(vipSetting -> vipSetting.getId().equals(goodsArea.getVip())) |
| | | .findFirst().ifPresent( vipSetting -> goodsArea.setVipName(vipSetting.getVipName()))); |
| | | |
| | | goods.setGoodsVipList(goodsVipList); |
| | | |
| | | // 特殊地区售价设置 |
| | |
| | | List<GoodsArea> goodsAreaList1 = new ArrayList<>(); |
| | | listMap.forEach((s, goodsAreas) -> { |
| | | |
| | | List<Integer> vipIds = goodsAreas.stream().map(GoodsArea::getVip).collect(Collectors.toList()); |
| | | List<VipSetting> vipSettings = vipSettingService.listByIds(vipIds); |
| | | goodsAreas.forEach(goodsArea -> vipSettings.stream() |
| | | List<VipSetting> vipSettings1 = getVipSettings(goodsAreas.stream().map(GoodsArea::getVip)); |
| | | goodsAreas.forEach(goodsArea -> vipSettings1.stream() |
| | | .filter(vipSetting -> vipSetting.getId().equals(goodsArea.getVip())) |
| | | .findFirst().ifPresent( vipSetting -> goodsArea.setVipName(vipSetting.getVipName()))); |
| | | |
| | | GoodsArea goodsArea1 = getGoodsArea(goodsAreas); |
| | | goodsAreaList1.add(goodsArea1); |
| | | }); |
| | | |
| | | goods.setGoodsAreaList(goodsAreaList1); |
| | | return goods; |
| | | } |
| | | |
| | | private List<VipSetting> getVipSettings(Stream<Integer> goodsVipList) { |
| | | List<Integer> vipIds = goodsVipList.collect(Collectors.toList()); |
| | | return vipSettingService.listByIds(vipIds); |
| | | } |
| | | |
| | | @NotNull |
| | | private static GoodsArea getGoodsArea(List<GoodsArea> goodsAreas) { |
| | | GoodsArea goodsArea = goodsAreas.get(0); |
| | | GoodsArea goodsArea1 = new GoodsArea(); |
| | | goodsArea1.setProvinceCode(goodsArea.getProvinceCode()); |
| | |
| | | goodsArea1.setCity(goodsArea.getCity()); |
| | | goodsArea1.setDistricts(goodsArea.getDistricts()); |
| | | goodsArea1.setGoodsAreaList(goodsAreas); |
| | | goodsAreaList1.add(goodsArea1); |
| | | }); |
| | | |
| | | goods.setGoodsAreaList(goodsAreaList1); |
| | | return goods; |
| | | return goodsArea1; |
| | | } |
| | | } |
| | |
| | | <select id="querySeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO"> |
| | | SELECT |
| | | tsai.id, |
| | | tg.`name`, |
| | | tg.`name` goodsName, |
| | | tg.introduction, |
| | | tgc.`name` goodsCategoryName, |
| | | tg.operating_cost, |
| | | tg.shop_cost, |
| | | tg.purchase_limit maxNum, |
| | | tg.home_page_picture, |
| | | tg.original_price, |
| | | tgs.selling_price, |
| | | tg.sale_num, |
| | | tsai.start_time |
| | | tg.`type` goodsType, |
| | | tsai.start_time, |
| | | tsai.end_time, |
| | | tsai.is_shelves showStatus |
| | | FROM |
| | | t_seckill_activity_info tsai |
| | | LEFT JOIN t_goods tg ON tsai.good_id = tg.id |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id |
| | | LEFT JOIN t_goods_category tgc ON tgc.id = tg.goods_category_id |
| | | WHERE tsai.end_time >= NOW() AND tsai.del_flag = 0 |
| | | <if test="goods.name != null and goods.name != ''"> |
| | | AND tg.`name` LIKE concat('%',#{goods.name},'%') |