Przeglądaj źródła

Merge branch 'dev_v1_1_20220720' of http://git.dayaedu.com/yonge/cooleshow into dev_v1_1_20220720

liujunchi 2 lat temu
rodzic
commit
80b5241672

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/req/OrderReq.java

@@ -54,7 +54,7 @@ public class OrderReq {
     public class OrderReqInfo {
         @ApiModelProperty(value = "y用户id", hidden = true)
         private Long userId;
-        @ApiModelProperty(value = "推荐用户id(有推荐人的情况)")
+        @ApiModelProperty(value = "推荐用户id(有推荐人的情况)", hidden = true)
         private Long recomUserId;
         @ApiModelProperty(value = "订单号", hidden = true)
         private String orderNo;

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -1147,7 +1147,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         List<UserAccountRecordDto> userAccountRecordDtos = new ArrayList<>();
         for (CourseScheduleTeacherSalary salary : teacherSalaryList) {
             UserAccountRecordDto dto = new UserAccountRecordDto(orderParam.getMerchId(), PostStatusEnum.WAIT, salary.getActualSalary(),
-                    InOrOutEnum.IN, AccountBizTypeEnum.LIVE, salary.getCourseScheduleId(), orderParam.getGoodName(), orderParam.getOrderNo(), orderParam.getUserId());
+                    InOrOutEnum.IN, AccountBizTypeEnum.PRACTICE, salary.getCourseScheduleId(), orderParam.getGoodName(), orderParam.getOrderNo(), orderParam.getUserId());
             userAccountRecordDtos.add(dto);
         }
         userAccountService.accountRecord(userAccountRecordDtos);

+ 4 - 9
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PlatformCashAccountRecordServiceImpl.java

@@ -28,6 +28,7 @@ import com.yonge.cooleshow.biz.dal.service.SysConfigService;
 import com.yonge.cooleshow.biz.dal.vo.PlatformCashAccountRecordSummaryVo;
 import com.yonge.cooleshow.common.constant.SysConfigConstant;
 import com.yonge.cooleshow.common.enums.PostStatusEnum;
+import org.springframework.util.CollectionUtils;
 
 /**
  * 平台账户流水表(PlatformCashAccountRecord)表服务实现类
@@ -76,19 +77,13 @@ public class PlatformCashAccountRecordServiceImpl extends ServiceImpl<PlatformCa
         paramNames.add(AccountBizTypeEnum.VIP_SHARE.getCode());
 
         List<PlatformCashAccountRecord> list = getDao().queryCanAccountByBizType(paramNames);
-        if (list.size() > 0) {
-            Date date = new Date();
-            List<PlatformCashAccountRecord> batchUpdateList = new ArrayList<>();
+        if(!CollectionUtils.isEmpty(list)){
             for (PlatformCashAccountRecord pcar : list) {
                 //预收改成实收
                 pcar.setPostStatus(PostStatusEnum.RECORDED);
-                pcar.setUpdateTime(date);
-                batchUpdateList.add(pcar);
-            }
-
-            if (batchUpdateList.size() > 0) {
-                getDao().batchUpdate(batchUpdateList);
+                pcar.setUpdateTime(new Date());
             }
+            getDao().batchUpdate(list);
         }
         //老师账户修改
         userAccountRecordService.updateWaitRecord();

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserAccountRecordServiceImpl.java

@@ -88,8 +88,11 @@ public class UserAccountRecordServiceImpl extends ServiceImpl<UserAccountRecordD
         //平台账户修改
         List<String> paramNames = new ArrayList<>();
         paramNames.add(AccountBizTypeEnum.LIVE_SHARE.getCode());
+        paramNames.add(AccountBizTypeEnum.VIDEO.getCode());
         paramNames.add(AccountBizTypeEnum.VIDEO_SHARE.getCode());
+        paramNames.add(AccountBizTypeEnum.MUSIC.getCode());
         paramNames.add(AccountBizTypeEnum.MUSIC_SHARE.getCode());
+        paramNames.add(AccountBizTypeEnum.VIP.getCode());
         paramNames.add(AccountBizTypeEnum.VIP_SHARE.getCode());
         List<UserAccountRecord> accountRecords = baseMapper.queryCanAccountByBizType(paramNames);
         for (UserAccountRecord accountRecord : accountRecords) {

+ 5 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserOrderRefundServiceImpl.java

@@ -417,6 +417,7 @@ public class UserOrderRefundServiceImpl extends ServiceImpl<UserOrderRefundDao,
         refundBill.setRefundAmt(orderRefund.getActualAmount());
         refundBill.setReason(orderRefund.getReason());
 
+
         BaseResult<RefundBill> refundBillBaseResult = paymentClient.refundPayment(refundBill);
         log.info("退款返回: {} ", JSONObject.toJSONString(refundBillBaseResult));
 
@@ -434,6 +435,9 @@ public class UserOrderRefundServiceImpl extends ServiceImpl<UserOrderRefundDao,
         }
         refundBillService.save(orderRefundBill);
         updateById(orderRefund);
+
+        //处理退款业务
+        orderRefundSuccessBizHandle(orderRefund.getId());
         return HttpResponseResult.succeed(orderRefundBill);
     }
 
@@ -459,8 +463,6 @@ public class UserOrderRefundServiceImpl extends ServiceImpl<UserOrderRefundDao,
         one.setStatus(TradeStatusEnum.succeeded);
         one.setUpdateTime(new Date());
         refundBillService.updateById(one);
-
-        orderRefundSuccessBizHandle(one.getRefundId());
     }
 
     /***
@@ -492,7 +494,7 @@ public class UserOrderRefundServiceImpl extends ServiceImpl<UserOrderRefundDao,
     }
 
     /**
-     * 处理退款成功业务
+     * 处理退款业务
      *
      * @param refundId 退款单id
      */

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/UserAccountVo.java

@@ -21,6 +21,9 @@ public class UserAccountVo extends UserAccount{
 	@ApiModelProperty("已入账金额 ")
 	private BigDecimal amountRecorded;
 
+	@ApiModelProperty("酷乐秀推广已入账金额 ")
+	private BigDecimal amountShare;
+
 	public BigDecimal getAmountUnrecorded() {
 		return amountUnrecorded;
 	}
@@ -36,4 +39,12 @@ public class UserAccountVo extends UserAccount{
 	public void setAmountRecorded(BigDecimal amountRecorded) {
 		this.amountRecorded = amountRecorded;
 	}
+
+	public BigDecimal getAmountShare() {
+		return amountShare;
+	}
+
+	public void setAmountShare(BigDecimal amountShare) {
+		this.amountShare = amountShare;
+	}
 }

+ 2 - 2
cooleshow-user/user-biz/src/main/resources/config/mybatis/PlatformCashAccountRecordMapper.xml

@@ -57,8 +57,8 @@
 	    		<if test="param.bizType">
 	    			biz_type_ = #{param.bizType}
 	    		</if>
-	    		<if test="param.status">
-	    			post_status_ = #{param.status}
+	    		<if test="param.postStatus">
+	    			post_status_ = #{param.postStatus}
 	    		</if>
 				<if test="param.accountPeriodTime">
 					account_period_time_ = #{param.accountPeriodTime}

+ 4 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/UserAccountMapper.xml

@@ -79,7 +79,10 @@
         SELECT
             <include refid="baseColumns"/>,
             (select sum(a.trans_amount_) from user_cash_account_record a where a.account_id_ = t.user_id_
-                and a.post_status_ = 'WAIT' and a.in_or_out_ = 'IN') as amountUnrecorded
+                and a.post_status_ = 'WAIT' and a.in_or_out_ = 'IN') as amountUnrecorded,
+            (select sum(a.trans_amount_) from user_cash_account_record a where a.account_id_ = t.user_id_
+                and a.post_status_ = 'RECORDED' and a.in_or_out_ = 'IN'
+                and a.biz_type_ in ('LIVE_SHARE','VIDEO_SHARE','MUSIC_SHARE','VIP_SHARE','MALL_SHARE')) as amountShare
         FROM user_cash_account t
         where t.user_id_ = #{id}
     </select>