luodangjia
2025-01-15 96d936331f7840b8157b64ad8bb9cbace99c1557
Merge remote-tracking branch 'origin/master'
8个文件已修改
95 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/factory/RemoteOrderGoodsFallbackFactory.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/feignClient/RemoteOrderGoodsClient.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/factory/RemoteOrderGoodsFallbackFactory.java
@@ -63,7 +63,7 @@
                return R.fail();
            }
            @Override
            public R<List<Order>> byShopIdAndUserId(Integer shopId,Long userId) {
            public R<List<Order>> byShopIdAndUserId(Long userId,Integer shopId) {
                return R.fail("通过门店和用户id查询订单失败");
            }
        };
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/feignClient/RemoteOrderGoodsClient.java
@@ -36,7 +36,7 @@
    @PostMapping("/order/byShopId")
    R<List<Order>> byShopId(@RequestParam("shopId") Integer shopId);
    @PostMapping("/order/byShopIdAndUserId")
    R<List<Order>> byShopIdAndUserId(@RequestParam("shopId") Integer shopId,@RequestParam("userId") Long userId);
    R<List<Order>> byShopIdAndUserId(@RequestParam("appUserId") Long appUserId,@RequestParam("shopId") Integer shopId);
    /**
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
@@ -91,7 +91,7 @@
        if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
            recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员");
//            throw new ServiceException("对不起,您的账号:" + username + " 已停用");
            throw new ServiceException("您所属门店已被冻结,请联系平台");
            throw new ServiceException("您的账号已被禁用,请联系平台");
        }
//        passwordService.validate(user, password, request);
        recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功");
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -550,8 +550,8 @@
        DangerInfoDto dangerInfoDto = new DangerInfoDto();
        BeanUtils.copyProperties(data, dangerInfoDto);
        List<UserPoint> list1 = userPointService.lambdaQuery().eq(UserPoint::getType, 1).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list();
        List<UserPoint> list2 = userPointService.lambdaQuery().eq(UserPoint::getType, 2).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list();
        List<UserPoint> list3 = userPointService.lambdaQuery().eq(UserPoint::getType, 5).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list();
        List<UserPoint> list2 = userPointService.lambdaQuery().eq(UserPoint::getType, 9).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list();
        List<UserPoint> list3 = userPointService.lambdaQuery().eq(UserPoint::getType, 8).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list();
        Integer userKeepBuyPoint = 0;
        for (UserPoint userPoint : list1) {
            userKeepBuyPoint = userPoint.getVariablePoint() + userKeepBuyPoint;
@@ -676,7 +676,7 @@
        List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, id).list();
        byId.setBottomUsers(list);
        //消费总金额
        R<List<Order>> orderR = remoteOrderGoodsClient.byShopIdAndUserId(sysUser.getObjectId(),userid);
        R<List<Order>> orderR = remoteOrderGoodsClient.byShopIdAndUserId(id,sysUser.getObjectId());
        List<Order> orderList = orderR.getData();
        if (!CollectionUtils.isEmpty(orderList)){
            BigDecimal paymentAmount = orderList.stream().map(Order::getPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -242,8 +242,9 @@
        return R.ok(orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).list());
    }
    @PostMapping("/byShopIdAndUserId")
    public R<List<Order>> byShopIdAndUserId(@RequestParam("shopId") Integer shopId,@RequestParam("appUserId") Long appUserId){
        return R.ok(orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).eq(Order::getAppUserId, appUserId).in(Order::getOrderStatus,4,7,8).list());
    public R<List<Order>> byShopIdAndUserId(@RequestParam("appUserId") Long appUserId,@RequestParam("shopId") Integer shopId){
        List<Order> list = orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).eq(Order::getAppUserId, appUserId).in(Order::getOrderStatus, 4, 7, 8).list();
        return R.ok(list);
    }
    
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -330,7 +330,11 @@
    @Override
    public Long addGoods(ShoppingCart shoppingCart) {
        Long userid = tokenService.getLoginUserApplet().getUserid();
        Integer goodsSaleNum = orderService.getGoodsSaleNum(shoppingCart.getGoodsId(), null, userid);
        long goodsSaleNum = orderService.getGoodsSaleNum(shoppingCart.getGoodsId(), null, userid);
        long count = count(new LambdaQueryWrapper<ShoppingCart>()
                .eq(ShoppingCart::getGoodsId, shoppingCart.getGoodsId())
                .eq(ShoppingCart::getAppUserId, userid));
        goodsSaleNum += count;
        Goods goods = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData();
        if(null != goods.getPurchaseLimit() && -1 != goods.getPurchaseLimit() && (goodsSaleNum + shoppingCart.getNumber()) > goods.getPurchaseLimit()){
            throw new ServiceException("超出购买数量限制");
@@ -358,13 +362,7 @@
    @Override
    public R setGoodsNumber(SetGoodsNumber setGoodsNumber) {
        Long userid = tokenService.getLoginUserApplet().getUserid();
        ShoppingCart shoppingCart = this.getById(setGoodsNumber.getId());
        Integer goodsSaleNum = orderService.getGoodsSaleNum(shoppingCart.getGoodsId(), null, userid);
        Goods goods = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData();
        if(null != goods.getPurchaseLimit() && -1 != goods.getPurchaseLimit() && (goodsSaleNum + shoppingCart.getNumber()) > goods.getPurchaseLimit()){
            throw new ServiceException("超出购买数量限制");
        }
        if(0 >= setGoodsNumber.getNumber()){
            return R.fail("修改数量不能小于等于0");
        }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java
@@ -4,10 +4,14 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.ruoyi.account.api.feignClient.AppUserClient;
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.common.core.utils.ServletUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.sql.SqlUtil;
import com.ruoyi.common.core.web.page.PageDomain;
import com.ruoyi.common.core.web.page.TableSupport;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.order.feignClient.OrderClient;
@@ -69,7 +73,12 @@
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        AppUser appUser = appUserClient.getAppUserById(loginUserApplet.getUserid());
        goods.setVipId(appUser.getVipId());
        startPage();
        PageDomain pageDomain = TableSupport.buildPageRequest();
        Boolean reasonable = pageDomain.getReasonable();
        PageHelper.startPage(goods.getPageCurr(), goods.getPageSize(), goods.getOrderByColumn()).setReasonable(reasonable);
        List<SeckillActivityVO> seckillActivityVOS = seckillActivityInfoMapper.listSeckillActivity(goods);
        for (SeckillActivityVO seckillActivityVO : seckillActivityVOS) {
            Integer data = orderClient.getGoodsSaleNum(seckillActivityVO.getGoodsId(), 2).getData();
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java
@@ -53,6 +53,60 @@
        Integer sPoint = 0;
        Integer shopCommissionPoint = 0;
        Integer subShopCommissionPoint = 0;
        if (sysUser.getRoleType()==1){
            List<Shop> shopIds = shopService.lambdaQuery().eq(Shop::getDelFlag, 0).list();
            for (Shop shop : shopIds) {
                sPoint += shop.getServerPoint();
                shopCommissionPoint += shop.getSharePoint();
                subShopCommissionPoint += shop.getLowerLevelSharePoint();
            }
            ShopPointStatistics shopPointStatistics = new ShopPointStatistics();
            shopPointStatistics.setTotalPoint(sPoint + shopCommissionPoint + subShopCommissionPoint);
            shopPointStatistics.setShopPoint(sPoint);
            shopPointStatistics.setShopCommissionPoint(shopCommissionPoint);
            shopPointStatistics.setSubShopCommissionPoint(subShopCommissionPoint);
            IPage<ShopPoint> shopPointIPage = this.baseMapper.queryShpointPage(page, shopPoint);
            shopPointStatistics.setShopPointIPage(shopPointIPage);
            LocalDateTime startTime = shopPoint.getStartTime();
            LocalDateTime endTime = shopPoint.getEndTime();
            if(null != startTime){
                List<ShopPoint> list = this.list(new LambdaUpdateWrapper<ShopPoint>()
                        .eq(ShopPoint::getShopId, sysUser.getObjectId())
                        .last(" and create_time between '" + startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "' and '" + endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "'"));
                List<String> date = new ArrayList<>();
                List<Map<String, Integer>> data = new ArrayList<>();
                String format = "MM.dd";
                while (true){
                    if(startTime.isAfter(endTime)){
                        break;
                    }
                    date.add(startTime.format(DateTimeFormatter.ofPattern(format)));
                    Map<String, Integer> map = new HashMap<>();
                    //返佣积分
                    LocalDateTime finalStartTime = startTime;
                    List<ShopPoint> collect = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
                            .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 2).collect(Collectors.toList());
                    map.put("fyjf", collect.stream().mapToInt(ShopPoint::getVariablePoint).sum());
                    //服务积分
                    List<ShopPoint> collect1 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
                            .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 4).collect(Collectors.toList());
                    map.put("fwjf", collect1.stream().mapToInt(ShopPoint::getVariablePoint).sum());
                    //绑定下级门店返佣积分
                    List<ShopPoint> collect2 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
                            .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 3).collect(Collectors.toList());
                    map.put("xjmdfyjf", collect2.stream().mapToInt(ShopPoint::getVariablePoint).sum());
                    data.add(map);
                    startTime = startTime.plusDays(1);
                }
                Map<String, Object> brokenLine = new HashMap<>();
                brokenLine.put("date", date);
                brokenLine.put("data", data);
                shopPointStatistics.setBrokenLine(brokenLine);
            }
            return shopPointStatistics;
        }else{
        Shop shop = shopService.getById(sysUser.getObjectId());
        sPoint += shop.getServerPoint();
        shopCommissionPoint += shop.getSharePoint();
@@ -106,3 +160,4 @@
        return shopPointStatistics;
    }
}
}