luodangjia
2025-01-14 64934df4bec0b1447b8835371213c5decefb1325
Merge remote-tracking branch 'origin/master'
12个文件已修改
146 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java
@@ -144,6 +144,9 @@
    @ApiModelProperty(value = "已提现金额")
    @TableField("withdraw_money")
    private BigDecimal withdrawMoney;
    @ApiModelProperty(value = "审核中金额")
    @TableField(exist = false)
    private BigDecimal withdrawAuditMoney;
    
    @ApiModelProperty(value = "余额")
    @TableField("balance")
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -321,13 +321,13 @@
                user.setShopName(shop.getName());
            }
        }
        Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count1 = appUserService.lambdaQuery().ne(AppUser::getStatus,3).eq(AppUser::getVipId, 1).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count2 = appUserService.lambdaQuery().ne(AppUser::getStatus,3).eq(AppUser::getVipId, 2).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count3 = appUserService.lambdaQuery().ne(AppUser::getStatus,3).eq(AppUser::getVipId, 3).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count4 = appUserService.lambdaQuery().ne(AppUser::getStatus,3).eq(AppUser::getVipId, 4).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count5 = appUserService.lambdaQuery().ne(AppUser::getStatus,3).eq(AppUser::getVipId, 5).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count6 = appUserService.lambdaQuery().ne(AppUser::getStatus,3).eq(AppUser::getVipId, 6).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        Long count7 = appUserService.lambdaQuery().ne(AppUser::getStatus,3).eq(AppUser::getVipId, 7).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count();
        user.setCount1(count1);
        user.setCount2(count2);
        user.setCount3(count3);
@@ -463,8 +463,10 @@
        //获取在该本店下单的用户ids
        Integer objectId = sysUser.getObjectId();
        R<List<Order>> listR = remoteOrderGoodsClient.byShopId(objectId);
        if (listR.getData()!=null){
        for (Order datum : listR.getData()) {
            userIds.add(datum.getAppUserId());
            }
        }
        IPage<AppUser> appuserPage = appUserService.getAppuserPage1(pageCurr, pageSize, appUser, objectId, userIds);
        return R.ok(appuserPage);
@@ -944,7 +946,8 @@
     */
    @PostMapping("/clearBindShop")
    public R clearBindShop(@RequestParam("shopId") Integer shopId){
        appUserService.update(new LambdaUpdateWrapper<AppUser>().eq(AppUser::getShopId, shopId).set(AppUser::getShopId, null));
        appUserService.update(new LambdaUpdateWrapper<AppUser>().eq(AppUser::getShopId, shopId).set(AppUser::getShopId, null)
                .set(AppUser::getUserType,1));
        return R.ok();
    }
}
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -131,9 +131,9 @@
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "String"),
    })
    @GetMapping("/writeOff/{id}/{shopId}")
    public R<Void> writeOff(@PathVariable("id") String id, @PathVariable("shopId") Integer shopId){
        orderService.writeOff(id, shopId);
    @GetMapping("/writeOff/{id}/{shopId}/{technicianId}")
    public R<Void> writeOff(@PathVariable("id") String id, @PathVariable("shopId") Integer shopId, @PathVariable("technicianId") Integer technicianId){
        orderService.writeOff(id, shopId, technicianId);
        return R.ok();
    }
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java
@@ -26,7 +26,7 @@
    boolean check(Order order, Integer shopId, Long userId);
    void writeOff(String id,Integer shopId);
    void writeOff(String id,Integer shopId, Integer technicianId);
    
    
    /**
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -177,14 +177,6 @@
        }
        OrderDetailVO orderDetailVO = new OrderDetailVO();
        orderDetailVO.setDistributionMode(order.getDistributionMode());
        Technician technician = new Technician();
        if (order.getTechnicianId() != null){
            R<Technician> shopdetail = technicianClient.shopdetail(order.getTechnicianId());
            if (shopdetail.getCode() != R.SUCCESS){
                throw new ServiceException("获取技师信息失败");
            }
            technician = shopdetail.getData();
        }
        Shop shop = shopR.getData();
        orderDetailVO.setId(order.getId());
        orderDetailVO.setOrderStatus(order.getOrderStatus());
@@ -209,13 +201,14 @@
        orderDetailVO.setLongitude(shop.getLongitude());
        orderDetailVO.setLatitude(shop.getLatitude());
        orderDetailVO.setShopId(shop.getId());
        orderDetailVO.setTechnicianName(technician.getName());
        orderDetailVO.setTechnicianId(technician.getId());
        if(order.getOrderType() == 1){
            List<TechnicianSubscribe> data = technicianSubscribeClient.getTechnicianSubscribeList(order.getId()).getData();
            if(data.size() > 0){
                Long id = data.get(0).getId();
                orderDetailVO.setTechnicianSubscribeId(id.toString());
                Technician technician = technicianClient.shopdetail(order.getTechnicianId()).getData();
                orderDetailVO.setTechnicianName(technician.getName());
                orderDetailVO.setTechnicianId(technician.getId());
            }
        }
        // 生成核销码BASE64
@@ -258,7 +251,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void writeOff(String id,Integer shopId) {
    public void writeOff(String id,Integer shopId, Integer technicianId) {
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        Order order = orderMapper.selectById(id);
        boolean check = check(order, shopId, loginUserApplet.getUserid());
@@ -283,6 +276,7 @@
        order.setAfterSaleTime(LocalDateTime.now().plusDays(days));
        order.setEndTime(LocalDateTime.now());
        order.setCancellerAppUserId(loginUserApplet.getUserid());
        order.setTechnicianId(technicianId);
        orderMapper.updateById(order);
    }
    
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java
@@ -90,9 +90,12 @@
   
    @GetMapping("/commissionStatistics/info")
    @ApiOperation(value = "门店余额明细上方数据", notes = "门店余额明细", tags = {"门店后台"})
    public R<ShopBalanceDto> shopCommissionStatisticsinfo(){
    public R<ShopBalanceDto> shopCommissionStatisticsinfo(Integer type){
        Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId();
        ShopBalanceDto dto = new ShopBalanceDto();
        Shop byId = shopService.getById(objectId);
        if (type==null){
        List<ShopBalanceStatement> list = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId,objectId).eq(ShopBalanceStatement::getType, 3).list();
        List<ShopBalanceStatement> list1 = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId,objectId).eq(ShopBalanceStatement::getType, 1).list();
        BigDecimal bigDecimal1 = new BigDecimal(0);
@@ -123,10 +126,48 @@
        }
        dto.setBigDecimal4(bigDecimal4);
        Shop byId = shopService.getById(objectId);
        dto.setBigDecimal5(byId.getCanWithdrawMoney());
        dto.setBigDecimal6(byId.getWithdrawMoney());
        return R.ok(dto);
        }else{
            switch (type){
                case 1:
                    // 关联用户分拥
                    BigDecimal bigDecimal = new BigDecimal("0");
                    List<ShopBalanceStatement> list1 = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId,objectId).eq(ShopBalanceStatement::getType, 1).list();
                    for (ShopBalanceStatement shopBalanceStatement : list1) {
                        bigDecimal = bigDecimal.add(shopBalanceStatement.getVariableAmount());
                    }
                    dto.setBigDecimal3(bigDecimal);
                    dto.setBigDecimal1(bigDecimal);
                    break;
                case 2:
                    // 下级门店分佣
                    BigDecimal bigDecimal2= new BigDecimal(0);
                    List<ShopBalanceStatement> list2 = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId,objectId).eq(ShopBalanceStatement::getType, 2).list();
                    for (ShopBalanceStatement shopBalanceStatement : list2) {
                        bigDecimal2 = bigDecimal2.add(shopBalanceStatement.getVariableAmount());
                    }
                    dto.setBigDecimal4(bigDecimal2);
                    dto.setBigDecimal1(bigDecimal2);
                    break;
                case 3:
                    // 服务费分佣
                    List<ShopBalanceStatement> list = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId,objectId).eq(ShopBalanceStatement::getType, 3).list();
                    BigDecimal bigDecimal3= new BigDecimal(0);
                    for (ShopBalanceStatement shopBalanceStatement : list) {
                        bigDecimal3 = bigDecimal3.add(shopBalanceStatement.getVariableAmount());
                    }
                    dto.setBigDecimal2(bigDecimal3);
                    dto.setBigDecimal1(bigDecimal3);
                    break;
                case 4:
                    // 余额提现
                    dto.setBigDecimal6(byId.getWithdrawMoney());
                    break;
            }
        }
        return R.ok(dto);
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -211,7 +211,14 @@
        }
        Shop shop = shopService.getById(id);
        shop.setDelFlag(1);
        shopService.updateById(shop);
        // 查询有没有门店绑定这个被删除的门店
        List<Shop> shops = shopService.lambdaQuery().eq(Shop::getPid, shop.getId()).list();
        for (Shop shop1 : shops) {
            shop1.setPid(0);
        }
        shopService.updateBatchById(shops);
        appUserClient.clearBindShop(shop.getId());
        UserShop userShop = new UserShop();
        userShop.setShopId(shop.getId());
@@ -672,7 +679,7 @@
    
    @PostMapping("/saveWithdrawalAccount")
    @ApiOperation(value = "保存提现账户", tags = {"门店后台-财务统计-提现明细"})
    public R saveWithdrawalAccount(SaveWithdrawalAccount saveWithdrawalAccount) {
    public R saveWithdrawalAccount(@RequestBody SaveWithdrawalAccount saveWithdrawalAccount) {
        shopService.saveWithdrawalAccount(saveWithdrawalAccount);
        return R.ok();
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java
@@ -127,6 +127,14 @@
    public R<Shop> shopCommissionStatisticsinfo(){
        Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId();
        Shop byId = shopService.getById(objectId);
        List<ShopWithdraw> list = shopWithdrawService.lambdaQuery().eq(ShopWithdraw::getShopId, objectId)
                .eq(ShopWithdraw::getAuditStatus, 0).list();
        if (!list.isEmpty()){
            BigDecimal bigDecimal = list.stream().map(ShopWithdraw::getMoney).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
            byId.setWithdrawAuditMoney(bigDecimal);
        }else {
            byId.setWithdrawAuditMoney(BigDecimal.ZERO);
        }
        return R.ok(byId);
    }
    
@@ -137,6 +145,9 @@
        SysUser sysUser = sysUserClient.getSysUser(userid).getData();
        Integer objectId = sysUser.getObjectId();
        Shop shop = shopService.getById(objectId);
        if (money.compareTo(BigDecimal.ZERO)==0){
            return R.fail("提现金额必须大于零");
        }
        if (money.compareTo(shop.getCanWithdrawMoney())>0){
            return R.fail("提现金额不能大于可提现金额");
        }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java
@@ -82,15 +82,7 @@
    }
    /**
     * 预约技师
     */
    @PostMapping("/switchingTechnician")
    @ApiOperation(value = "切换技师", notes = "切换技师", tags = {"小程序-个人中心-门店管理-预约列表"})
    public R<Void> switchingTechnician(@RequestBody TechnicianSubscribe technicianSubscribe) {
        technicianSubscribeService.switchingTechnician(technicianSubscribe);
        return R.ok();
    }
    /**
@@ -149,7 +141,7 @@
    @PostMapping("/getTechnicianSubscribeList")
    public R<List<TechnicianSubscribe>> getTechnicianSubscribeList(@RequestParam("orderId") Long orderId){
        List<TechnicianSubscribe> list = technicianSubscribeService.list(new LambdaQueryWrapper<TechnicianSubscribe>().eq(TechnicianSubscribe::getOrderId, orderId)
                .eq(TechnicianSubscribe::getDelFlag, 0).in(TechnicianSubscribe::getStatus, Arrays.asList(0, 1)));
                .eq(TechnicianSubscribe::getDelFlag, 0).in(TechnicianSubscribe::getStatus, Arrays.asList(0, 1)).orderByDesc(TechnicianSubscribe::getCreateTime));
        return R.ok(list);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java
@@ -33,11 +33,7 @@
    void subscribe(TechnicianSubscribe technicianSubscribe);
    /**
     * 切換技師
     * @param technicianSubscribe
     */
    void switchingTechnician(TechnicianSubscribe technicianSubscribe);
    /**
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -119,19 +119,6 @@
    }
    @Override
    public void switchingTechnician(TechnicianSubscribe technicianSubscribe) {
        List<TechnicianSubscribe> list = this.list(new LambdaQueryWrapper<TechnicianSubscribe>().eq(TechnicianSubscribe::getOrderId, technicianSubscribe.getOrderId())
                .eq(TechnicianSubscribe::getDelFlag, 0).eq(TechnicianSubscribe::getStatus, 0));
        for (TechnicianSubscribe subscribe : list) {
            if(subscribe.getTechnicianId().equals(technicianSubscribe.getTechnicianId())){
                throw new RuntimeException("不能切换相同的技师");
            }
            subscribe.setTechnicianId(technicianSubscribe.getTechnicianId());
            this.updateById(subscribe);
        }
    }
    /**
     * 定时修改到期状态
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml
@@ -47,13 +47,13 @@
            </if>
            <if test="goods.payMethod != null and goods.payMethod == 1 ">
                and tg.`cashPayment` = 1
                and tg.`cash_payment` = 1
            </if>
            <if test="goods.payMethod != null and goods.payMethod == 2 ">
                and tg.`point_payment` = 1
            </if>
            <if test="goods.payMethod != null and goods.payMethod == 3 ">
                and (tg.`point_payment` = 1 or  tg.`cashPayment` = 1 )
                and (tg.`point_payment` = 1 and  tg.`cash_payment` = 1 )
            </if>
        </where>