| | |
| | | return; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | if (profitDate == null) { |
| | | profitDate = DateUtil.offset(new Date(), DateField.DAY_OF_YEAR, -1); |
| | | } |
| | |
| | | // BigDecimal tcIncome = mallOrderInfoMapper.selectTotalAmountUnCostForDate(profitDate, null, "D", 2); |
| | | // 普通商品业绩 |
| | | // BigDecimal normalIncome = mallOrderInfoMapper.selectTotalAmountUnCostForDate(profitDate, null, "D", 1); |
| | | //今日总业绩 |
| | | BigDecimal totalIncome = mallAchieveRecordMapper.selectAchieveTotal("D", profitDate); |
| | | |
| | | if (totalIncome.compareTo(BigDecimal.ZERO) == 0) { |
| | |
| | | BigDecimal preStaticProfit = staticProfit.divide(new BigDecimal(list.size()), 2, RoundingMode.HALF_UP); |
| | | |
| | | for (Map<String, Object> item : list) { |
| | | Long memberId = (Long) item.get("memberId"); |
| | | // Long memberId = (Long) item.get("memberId"); |
| | | String orderNo = (String) item.get("orderNo"); |
| | | |
| | | changeAllScoreAndCommission(preStaticProfit,orderNo); |
| | | // int reduce = walletService.reduce(preStaticProfit, memberId, "score"); |
| | | // if (reduce == 2) { |
| | | // break; |
| | |
| | | // walletService.add(preStaticProfit, memberId, "commission"); |
| | | // moneyFlowService.addMoneyFlow(memberId, preStaticProfit, MoneyFlowTypeEnum.STATIC_BONUS.getValue(), orderNo, FlowTypeEnum.COMMISSION.getValue()); |
| | | // moneyFlowService.addMoneyFlow(memberId, preStaticProfit.negate(), MoneyFlowTypeEnum.STATIC_BONUS.getValue(), orderNo, FlowTypeEnum.SCORE.getValue()); |
| | | changeScoreAndCommission(memberId, preStaticProfit, MoneyFlowTypeEnum.STATIC_BONUS.getValue(), orderNo); |
| | | // changeScoreAndCommission(memberId, preStaticProfit, MoneyFlowTypeEnum.STATIC_BONUS.getValue(), orderNo); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void changeAllScoreAndCommission(BigDecimal preStaticProfit,String orderNo){ |
| | | List<MallMember> members = mallMemberMapper.selectList(null); |
| | | for(MallMember mallMember : members){ |
| | | changeScoreAndCommission(mallMember.getId(), preStaticProfit, MoneyFlowTypeEnum.STATIC_BONUS.getValue(), orderNo); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void dynamicProfit(Long orderId) { |
| | | dynamicProfit(orderId, 2); |