Merge remote-tracking branch 'origin/master'
| | |
| | | @ApiModelProperty(value = "已提现金额") |
| | | @TableField("withdraw_money") |
| | | private BigDecimal withdrawMoney; |
| | | @ApiModelProperty(value = "审核中金额") |
| | | @TableField(exist = false) |
| | | private BigDecimal withdrawAuditMoney; |
| | | |
| | | @ApiModelProperty(value = "余额") |
| | | @TableField("balance") |
| | |
| | | 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); |
| | |
| | | //获取在该本店下单的用户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); |
| | |
| | | */ |
| | | @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(); |
| | | } |
| | | } |
| | |
| | | |
| | | @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); |
| | |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | 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()); |
| | |
| | | |
| | | @PostMapping("/saveWithdrawalAccount") |
| | | @ApiOperation(value = "保存提现账户", tags = {"门店后台-财务统计-提现明细"}) |
| | | public R saveWithdrawalAccount(SaveWithdrawalAccount saveWithdrawalAccount) { |
| | | public R saveWithdrawalAccount(@RequestBody SaveWithdrawalAccount saveWithdrawalAccount) { |
| | | shopService.saveWithdrawalAccount(saveWithdrawalAccount); |
| | | return R.ok(); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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("提现金额不能大于可提现金额"); |
| | | } |
| | |
| | | </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> |