|  | @@ -15,6 +15,7 @@ import com.yonge.cooleshow.biz.dal.enums.GoodTypeEnum;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.enums.InOrOutEnum;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.service.*;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.vo.UserAccountRecordVo;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.vo.res.AccountShareTotal;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.common.entity.MallOrderItemDto;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.common.enums.CacheNameEnum;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.vo.res.AccountTotal;
 | 
	
	
		
			
				|  | @@ -397,7 +398,7 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountDao, UserAcco
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public void mallTeacherRecordState(List<MallOrderItemDto> shareDto) {
 | 
	
		
			
				|  |  |          if (CollectionUtils.isEmpty(shareDto)) {
 | 
	
		
			
				|  |  | -            return ;
 | 
	
		
			
				|  |  | +            return;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          for (MallOrderItemDto mallOrderItemDto : shareDto) {
 | 
	
		
			
				|  |  |              mallTeacherRecordState(mallOrderItemDto);
 | 
	
	
		
			
				|  | @@ -406,20 +407,20 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountDao, UserAcco
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public void mallTeacherRecordState(MallOrderItemDto shareDto) {
 | 
	
		
			
				|  |  |          List<UserAccountRecord> list = userAccountRecordService.lambdaQuery()
 | 
	
		
			
				|  |  | -                                                               .eq(UserAccountRecord::getOrderNo, shareDto.getOrderSn())
 | 
	
		
			
				|  |  | -                                                               .eq(UserAccountRecord::getBizId, shareDto.getProductSkuId())
 | 
	
		
			
				|  |  | -                                                               .list();
 | 
	
		
			
				|  |  | +                .eq(UserAccountRecord::getOrderNo, shareDto.getOrderSn())
 | 
	
		
			
				|  |  | +                .eq(UserAccountRecord::getBizId, shareDto.getProductSkuId())
 | 
	
		
			
				|  |  | +                .list();
 | 
	
		
			
				|  |  |          if (CollectionUtils.isEmpty(list)) {
 | 
	
		
			
				|  |  |              return;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          for (UserAccountRecord userAccount : list) {
 | 
	
		
			
				|  |  | -            this.accountChange(userAccount.getId(),shareDto.getStatus());
 | 
	
		
			
				|  |  | +            this.accountChange(userAccount.getId(), shareDto.getStatus());
 | 
	
		
			
				|  |  |              if (shareDto.getStatus().equals(PostStatusEnum.RECORDED)) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                platformCashAccountRecordService.mallRecordedRecord(shareDto.getProductSkuId(),shareDto.getOrderSn(),GoodTypeEnum.MALL.getCode());
 | 
	
		
			
				|  |  | +                platformCashAccountRecordService.mallRecordedRecord(shareDto.getProductSkuId(), shareDto.getOrderSn(), GoodTypeEnum.MALL.getCode());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              } else if (shareDto.getStatus().equals(PostStatusEnum.CANCEL)) {
 | 
	
		
			
				|  |  | -                platformCashAccountRecordService.cancelRecord(shareDto.getOrderSn(),GoodTypeEnum.MALL.getCode(),shareDto.getProductSkuId());
 | 
	
		
			
				|  |  | +                platformCashAccountRecordService.cancelRecord(shareDto.getOrderSn(), GoodTypeEnum.MALL.getCode(), shareDto.getProductSkuId());
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -427,6 +428,7 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountDao, UserAcco
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 记录平台收入和用户分润收入
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
	
		
			
				|  | @@ -440,6 +442,11 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountDao, UserAcco
 | 
	
		
			
				|  |  |          return true;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public HttpResponseResult<AccountShareTotal> accountShareTotal(TotalReq query) {
 | 
	
		
			
				|  |  | +        return HttpResponseResult.succeed(baseMapper.accountShareTotal(query));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      public void saveMallAccountRecord(MallOrderItemDto shareDto) {
 | 
	
		
			
				|  |  |          BigDecimal expectPrice = shareDto.getRealAmount();
 | 
	
		
			
				|  |  |          if (expectPrice.compareTo(BigDecimal.ZERO) <= 0) {
 | 
	
	
		
			
				|  | @@ -447,7 +454,7 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountDao, UserAcco
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          //平台收入
 | 
	
		
			
				|  |  |          PlatformCashAccountRecord platformCashAccountRecord = new PlatformCashAccountRecord(shareDto.getUserId(), expectPrice,
 | 
	
		
			
				|  |  | -                          InOrOutEnum.IN, PostStatusEnum.WAIT, AccountBizTypeEnum.MALL, shareDto.getProductSkuId(), shareDto.getOrderSn(),new Date());
 | 
	
		
			
				|  |  | +                InOrOutEnum.IN, PostStatusEnum.WAIT, AccountBizTypeEnum.MALL, shareDto.getProductSkuId(), shareDto.getOrderSn(), new Date());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          platformCashAccountRecordService.save(platformCashAccountRecord);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -462,11 +469,11 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountDao, UserAcco
 | 
	
		
			
				|  |  |                  //插入分润老师账户变更记录-分润老师预收
 | 
	
		
			
				|  |  |                  HttpResponseResult<UserAccountRecord> recomRecordRes = this.accountRecord(
 | 
	
		
			
				|  |  |                          new UserAccountRecordDto(shareDto.getPromoterId(), PostStatusEnum.WAIT, shareFee, InOrOutEnum.IN,
 | 
	
		
			
				|  |  | -                                                 bizTypeEnum, shareDto.getProductSkuId(), shareDto.getProductName(), shareDto.getOrderSn()));
 | 
	
		
			
				|  |  | -                if(recomRecordRes.getStatus()){
 | 
	
		
			
				|  |  | +                                bizTypeEnum, shareDto.getProductSkuId(), shareDto.getProductName(), shareDto.getOrderSn(), shareDto.getUserId()));
 | 
	
		
			
				|  |  | +                if (recomRecordRes.getStatus()) {
 | 
	
		
			
				|  |  |                      //插入平台预支
 | 
	
		
			
				|  |  |                      platformCashAccountRecord = new PlatformCashAccountRecord(shareDto.getPromoterId(), shareFee,
 | 
	
		
			
				|  |  | -                            InOrOutEnum.OUT, PostStatusEnum.WAIT, AccountBizTypeEnum.MALL_SHARE, shareDto.getProductSkuId(), shareDto.getOrderSn(),new Date());
 | 
	
		
			
				|  |  | +                            InOrOutEnum.OUT, PostStatusEnum.WAIT, AccountBizTypeEnum.MALL_SHARE, shareDto.getProductSkuId(), shareDto.getOrderSn(), new Date());
 | 
	
		
			
				|  |  |                      platformCashAccountRecordService.save(platformCashAccountRecord);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 |