Kaynağa Gözat

Merge branch 'dev_v1_1_20220720'

liweifan 3 yıl önce
ebeveyn
işleme
975485f920

+ 5 - 5
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/PlatformCashAccountRecordController.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.admin.controller;
 
+import com.yonge.cooleshow.biz.dal.vo.PlatformCashAccountPageVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -32,13 +33,12 @@ public class PlatformCashAccountRecordController extends BaseController {
 	@ApiOperation(value = "平台账户记录-列表", httpMethod = "POST", consumes = "application/json", produces = "application/json")
 	@PostMapping(value = "/list", consumes = "application/json", produces = "application/json")
 	@PreAuthorize("@pcs.hasPermissions('platformCashAccountRecord/list')")
-	public HttpResponseResult<ModelMap> list(@Valid @RequestBody PlatformCashAccountRecordSearch query) {
-		ModelMap model = new ModelMap();
+	public HttpResponseResult<PlatformCashAccountPageVo> list(@Valid @RequestBody PlatformCashAccountRecordSearch query) {
+		PlatformCashAccountPageVo model = new PlatformCashAccountPageVo();
 		
 		PageInfo<PlatformCashAccountRecord> pageInfo = PageUtil.pageInfo(platformCashAccountRecordService.queryPage(PageUtil.getPage(query),query));
-		model.put("pageInfo", pageInfo);
-		model.put("summary", platformCashAccountRecordService.querySummary(query));
-		
+		model.setPageInfo(pageInfo);
+		model.setSummary(platformCashAccountRecordService.querySummary(query));
 		return succeed(model);
 	}
 

+ 5 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/task/TaskController.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.admin.task;
 
+import com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord;
 import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.wordfilter.WordContext;
 import com.yonge.cooleshow.biz.dal.wordfilter.WordFilter;
@@ -36,6 +37,8 @@ public class TaskController extends BaseController {
     private UserAccountRecordService userAccountRecordService;
     @Autowired
     private RedissonClient redissonClient;
+    @Autowired
+    private PlatformCashAccountRecordService platformCashAccountRecordService;
 
     /***
      * 轮询用户订单
@@ -59,6 +62,8 @@ public class TaskController extends BaseController {
     public HttpResponseResult<Boolean> daysTask() {
         //超过天数无琴房课的解除绑定关系
         userBindingTeacherService.unbindTask();
+        //平台老师结算
+        platformCashAccountRecordService.updateWaitRecord();
         return succeed(true);
     }
 

+ 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);

+ 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
      */

+ 31 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/PlatformCashAccountPageVo.java

@@ -0,0 +1,31 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord;
+import com.yonge.toolset.base.page.PageInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+@ApiModel(value = "PlatformCashAccountPageVo对象", description = "平台账户页面查询对象")
+public class PlatformCashAccountPageVo {
+    @ApiModelProperty(value = "页头统计")
+    PlatformCashAccountRecordSummaryVo summary;
+
+    @ApiModelProperty(value = "分页内容")
+    PageInfo<PlatformCashAccountRecord> pageInfo;
+
+    public PlatformCashAccountRecordSummaryVo getSummary() {
+        return summary;
+    }
+
+    public void setSummary(PlatformCashAccountRecordSummaryVo summary) {
+        this.summary = summary;
+    }
+
+    public PageInfo<PlatformCashAccountRecord> getPageInfo() {
+        return pageInfo;
+    }
+
+    public void setPageInfo(PageInfo<PlatformCashAccountRecord> pageInfo) {
+        this.pageInfo = pageInfo;
+    }
+}

+ 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;
+	}
 }

+ 3 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -44,7 +44,7 @@
             (case when isnull(u.id_card_no_) then 0 else 1 end) as isReal,
             (!isnull(membership_end_time_) and membership_end_time_ > now()) as isVip,
             (
-            SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+            SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
             ) as subjectName,
             u.user_type_ as userType
         FROM student t
@@ -65,7 +65,7 @@
             (case when isnull(u.id_card_no_) then 0 else 1 end) as isReal,
             (!isnull(membership_end_time_) and membership_end_time_ > now()) as isVip,
             (
-                SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
             ) as subjectName,
             u.user_type_ as userType
         FROM student t
@@ -84,7 +84,7 @@
             !isnull(birthdate_) as isReal,
             (!isnull(membership_end_time_) and membership_end_time_ > now()) as isVip,
             (
-            SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+            SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
             ) as subjectName
         FROM student t
         left join sys_user u on t.user_id_ = u.id_

+ 3 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherAuthEntryRecordMapper.xml

@@ -46,7 +46,7 @@
             u.gender_ as gender,
             v.username_ as verifyUser,
             (
-                SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
             ) as subjectName
         FROM teacher_auth_entry_record t
         left join sys_user u on t.user_id_ = u.id_
@@ -84,7 +84,7 @@
 			u.phone_ as phone,
 			u.gender_ as gender,
 			(
-                SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
             ) as subjectName,
             (
                 SELECT u.username_ FROM sys_user u WHERE u.id_ = t.verify_user_id_
@@ -100,7 +100,7 @@
             u.id_card_no_ as idCardNo,
             u.gender_ as gender,
             (
-                SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
             ) as subjectName,
             (
                 SELECT u.username_ FROM sys_user u WHERE u.id_ = t.verify_user_id_

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

@@ -131,7 +131,7 @@
             u.lock_flag_ as lockFlag,
             (case when isnull(b.user_id_) then 0 else 1 end) as isBank,
             (
-                SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
             ) as subjectName,
             u.user_type_ as userType
         FROM teacher t

+ 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>

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

@@ -70,7 +70,7 @@
             u.id_card_no_ as idCardNo,
             u.lock_flag_ as lockFlag,
             (
-                SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
             ) as subjectName
         FROM (
             select a.* from user_binding_teacher a