| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | } |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | @Resource |
| | | private UserChangeLogService userChangeLogService; |
| | | @GetMapping("/change/vip") |
| | | @ApiOperation(value = "用户列表-修改会员等级", tags = {"管理后台"}) |
| | | public R<Page<AppUser>> changevip(Long id,Integer vipId) |
| | | { |
| | | AppUser byId = appUserService.getById(id); |
| | | |
| | | UserChangeLog userChangeLog = new UserChangeLog(); |
| | | userChangeLog.setCreateTime(LocalDateTime.now()); |
| | | userChangeLog.setAppUserId(byId.getId()); |
| | | userChangeLog.setBeforeVipId(byId.getVipId()); |
| | | userChangeLog.setAfterVipId(vipId); |
| | | if (userChangeLog.getBeforeVipId()>userChangeLog.getAfterVipId()) { |
| | | userChangeLog.setChangeType(0); |
| | | }else { |
| | | userChangeLog.setChangeType(1); |
| | | } |
| | | userChangeLogService.save(userChangeLog); |
| | | byId.setVipId(vipId); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | @GetMapping("/bottom") |
| | | @ApiOperation(value = "用户列表-绑定下级列表", tags = {"管理后台"}) |
| | | public R<Page<AppUser>> bottom(Long id,Integer pageNum,Integer pageSize) |
| | |
| | | |
| | | @Override |
| | | public IPage<GoodsBargainPrice> queryGoodsBargainPricePage(Page<GoodsBargainPrice> page, GoodsBargainPrice goodsBargainPrice) { |
| | | return null; |
| | | return this.baseMapper.queryGoodsBargainPricePage(page,goodsBargainPrice); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.vo.ShopCommissionStatisticsVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | |
| | | IPage<ShopBalanceStatement> statementIPage = page(page, new LambdaQueryWrapper<ShopBalanceStatement>()); |
| | | List<ShopBalanceStatement> records = statementIPage.getRecords(); |
| | | List<Integer> shopIds = records.stream().map(ShopBalanceStatement::getShopId).collect(Collectors.toList()); |
| | | List<Shop> shopList = shopService.listByIds(shopIds); |
| | | records.forEach(st -> { |
| | | shopList.stream().filter(shop -> shop.getId().equals(st.getShopId())).findFirst().ifPresent(shop -> { |
| | | st.setShopName(shop.getName()); |
| | | st.setShopManagerName(shop.getShopManager()); |
| | | st.setPhone(shop.getPhone()); |
| | | if (!CollectionUtils.isEmpty(records)){ |
| | | List<Integer> shopIds = records.stream().map(ShopBalanceStatement::getShopId).collect(Collectors.toList()); |
| | | List<Shop> shopList = shopService.listByIds(shopIds); |
| | | records.forEach(st -> { |
| | | shopList.stream().filter(shop -> shop.getId().equals(st.getShopId())).findFirst().ifPresent(shop -> { |
| | | st.setShopName(shop.getName()); |
| | | st.setShopManagerName(shop.getShopManager()); |
| | | st.setPhone(shop.getPhone()); |
| | | }); |
| | | }); |
| | | }); |
| | | } |
| | | shopCommissionStatisticsVO.setStatementIPage(statementIPage); |
| | | return shopCommissionStatisticsVO; |
| | | } |
| | |
| | | * 总金额 |
| | | */ |
| | | @ApiModelProperty(value = "总金额") |
| | | private BigDecimal totalAmount; |
| | | private BigDecimal totalAmount = BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 分佣总金额 |
| | | */ |
| | | @ApiModelProperty(value = "分佣总金额") |
| | | private BigDecimal totalCommission; |
| | | private BigDecimal totalCommission = BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 服务费总计 |
| | | */ |
| | | @ApiModelProperty(value = "服务费总计") |
| | | private BigDecimal totalServiceCharge; |
| | | private BigDecimal totalServiceCharge = BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 下级门店分佣总金额 |
| | | */ |
| | | @ApiModelProperty(value = "下级门店分佣总金额") |
| | | private BigDecimal totalSubordinateCommission; |
| | | private BigDecimal totalSubordinateCommission = BigDecimal.ZERO; |
| | | |
| | | private IPage<ShopBalanceStatement> statementIPage; |
| | | } |
| | |
| | | object_id |
| | | FROM |
| | | ( |
| | | SELECT |
| | | id, |
| | | shop_id, |
| | | type, |
| | | historical_balance, |
| | | variable_amount, |
| | | balance, |
| | | create_time, |
| | | create_user_id, |
| | | object_id, |
| | | ROW_NUMBER() OVER ( PARTITION BY type, create_user_id ORDER BY create_time DESC ) AS rn |
| | | FROM |
| | | t_shop_balance_statement |
| | | SELECT |
| | | id, |
| | | shop_id, |
| | | type, |
| | | historical_balance, |
| | | variable_amount, |
| | | balance, |
| | | create_time, |
| | | create_user_id, |
| | | object_id, |
| | | ROW_NUMBER() OVER ( PARTITION BY type, create_user_id ORDER BY create_time DESC ) AS rn |
| | | FROM |
| | | t_shop_balance_statement |
| | | ) AS subquery |
| | | WHERE |
| | | rn = 1 |
| | | </select> |
| | | </mapper> |