| | |
| | | private final IApiMallMemberWalletService memberWalletService; |
| | | private final MallLeaderAchieveMapper mallLeaderAchieveMapper; |
| | | private final MallMoneyFlowMapper mallMoneyFlowMapper; |
| | | private final MallGoodsMapper mallGoodsMapper; |
| | | private final MallGoodsSkuMapper mallGoodsSkuMapper; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | //更新订单详情 |
| | | mallOrderItem.setState(3); |
| | | mallOrderItemMapper.updateById(mallOrderItem); |
| | | //更新库存信息 |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(mallOrderItem.getGoodsId()); |
| | | mallGoods.setStock(mallGoods.getStock() + mallOrderItem.getCnt()); |
| | | mallGoods.setVolume(mallGoods.getVolume() - mallOrderItem.getCnt()); |
| | | mallGoodsMapper.updateById(mallGoods); |
| | | |
| | | MallGoodsSku mallGoodsSku = mallGoodsSkuMapper.selectById(mallOrderItem.getSkuId()); |
| | | mallGoodsSku.setStock(mallGoodsSku.getStock() + mallOrderItem.getCnt()); |
| | | mallGoodsSku.setSkuVolume(mallGoodsSku.getSkuVolume() - mallOrderItem.getCnt()); |
| | | mallGoodsSkuMapper.updateById(mallGoodsSku); |
| | | //更新退款订单 |
| | | mallRefundEntity.setState(1); |
| | | mallRefundEntity.setUpdatedTime(DateUtil.date()); |
| | |
| | | //更新订单详情 |
| | | mallOrderItem.setState(3); |
| | | mallOrderItemMapper.updateById(mallOrderItem); |
| | | //更新库存信息 |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(mallOrderItem.getGoodsId()); |
| | | mallGoods.setStock(mallGoods.getStock() + mallOrderItem.getCnt()); |
| | | mallGoods.setVolume(mallGoods.getVolume() - mallOrderItem.getCnt()); |
| | | mallGoodsMapper.updateById(mallGoods); |
| | | |
| | | MallGoodsSku mallGoodsSku = mallGoodsSkuMapper.selectById(mallOrderItem.getSkuId()); |
| | | mallGoodsSku.setStock(mallGoodsSku.getStock() + mallOrderItem.getCnt()); |
| | | mallGoodsSku.setSkuVolume(mallGoodsSku.getSkuVolume() - mallOrderItem.getCnt()); |
| | | mallGoodsSkuMapper.updateById(mallGoodsSku); |
| | | |
| | | //更新退款订单 |
| | | mallRefundEntity.setState(1); |
| | | mallRefundEntity.setUpdatedTime(DateUtil.date()); |
| | |
| | | null,null, |
| | | DateUtil.date()); |
| | | apiLeaderProfitVo.setMonthProfit(monthProfit); |
| | | BigDecimal waitProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(1,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | apiLeaderProfitVo.setWaitProfit(waitProfit); |
| | | String inviteId = loginUser.getInviteId(); |
| | | MallTeamLeader mallTeamLeader = mallTeamLeaderMapper.selectLeaderByUniqueCode(inviteId); |
| | | Integer profitSwitch = mallTeamLeader.getProfitSwitch() == null ? 2:mallTeamLeader.getProfitSwitch(); |
| | | if(2 == profitSwitch){ |
| | | apiLeaderProfitVo.setWaitProfit(BigDecimal.ZERO); |
| | | }else{ |
| | | BigDecimal waitProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(1,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | apiLeaderProfitVo.setWaitProfit(waitProfit); |
| | | } |
| | | |
| | | return new FebsResponse().success().data(apiLeaderProfitVo); |
| | | } |