فهرست منبع

Merge remote-tracking branch 'origin/dev_v1_1_20220720' into dev_v1_1_20220720

liweifan 3 سال پیش
والد
کامیت
472bddf88f

+ 19 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/PlatformCashAccountRecordDao.java

@@ -0,0 +1,19 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 平台账户流水表(PlatformCashAccountRecord)表数据库访问层
+ *
+ * @author zx
+ * @since 2022-07-21 10:32:06
+ */
+public interface PlatformCashAccountRecordDao extends BaseMapper<PlatformCashAccountRecord> {
+
+    int insertBatch(@Param("entities") List<PlatformCashAccountRecord> entities);
+}
+

+ 157 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/PlatformCashAccountRecord.java

@@ -0,0 +1,157 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+
+/**
+ * 平台账户流水表(PlatformCashAccountRecord)表实体类
+ *
+ * @author zx
+ * @since 2022-07-21 10:32:06
+ */
+@ApiModel(value = "platform_cash_account_record-平台账户流水表")
+public class PlatformCashAccountRecord implements Serializable {
+    @TableId(value = "id_", type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    @TableField("account_id_")
+    @ApiModelProperty(value = "支出账户id")
+    private Long accountId;
+
+    @TableField("trans_amount_")
+    @ApiModelProperty(value = "交易金额")
+    private BigDecimal transAmount;
+
+    @TableField("in_or_out_")
+    @ApiModelProperty(value = "收支类型:IN、收入 OUT、支出")
+    private String inOrOut;
+
+    @TableField("post_status_")
+    @ApiModelProperty(value = "入账状态 WAIT 待入账 RECORDED 已入账 CANCEL 取消")
+    private String postStatus;
+
+    @TableField("biz_type_")
+    @ApiModelProperty(value = "业务类型:PRACTICE、陪练课 LIVE、直播课 VIDEO、视频课 MUSIC、乐谱")
+    private String bizType;
+
+    @TableField("biz_id_")
+    @ApiModelProperty(value = "业务id(陪练课,直播课course_schedule_id_ | 视频课,乐谱为课程组曲子id | 提现为提现记录id)")
+    private Long bizId;
+
+    @TableField("memo_")
+    @ApiModelProperty(value = "备注")
+    private String memo;
+
+    @TableField("order_no_")
+    @ApiModelProperty(value = "订单号")
+    private String orderNo;
+
+    @TableField("create_time_")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @TableField("update_time_")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public BigDecimal getTransAmount() {
+        return transAmount;
+    }
+
+    public void setTransAmount(BigDecimal transAmount) {
+        this.transAmount = transAmount;
+    }
+
+    public String getInOrOut() {
+        return inOrOut;
+    }
+
+    public void setInOrOut(String inOrOut) {
+        this.inOrOut = inOrOut;
+    }
+
+    public String getPostStatus() {
+        return postStatus;
+    }
+
+    public void setPostStatus(String postStatus) {
+        this.postStatus = postStatus;
+    }
+
+    public String getBizType() {
+        return bizType;
+    }
+
+    public void setBizType(String bizType) {
+        this.bizType = bizType;
+    }
+
+    public Long getBizId() {
+        return bizId;
+    }
+
+    public void setBizId(Long bizId) {
+        this.bizId = bizId;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+}
+

+ 18 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/PlatformCashAccountRecordService.java

@@ -0,0 +1,18 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.dao.PlatformCashAccountRecordDao;
+import com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord;
+
+/**
+ * 平台账户流水表(PlatformCashAccountRecord)表服务接口
+ *
+ * @author zx
+ * @since 2022-07-21 10:32:06
+ */
+public interface PlatformCashAccountRecordService extends IService<PlatformCashAccountRecord> {
+
+    PlatformCashAccountRecordDao getDao();
+}
+

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

@@ -1109,8 +1109,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
             teacherSalary.setReduceSalary(expectPrice.subtract(actualSalary));//扣除薪水 = 预计 - 实际
             teacherSalary.setReduceSalaryRemark(SysConfigConstant.PRACTICE_SERVICE_FEE);//扣除原因
             teacherSalary.setStatus(TeacherSalaryEnum.NOT_START.getCode());
-            teacherSalaryList.add(teacherSalary);
             teacherSalary.setCreateTime(now);
+            teacherSalaryList.add(teacherSalary);
 
             teacherId = payment.getTeacherId();
             studentId = payment.getUserId();

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

@@ -3,13 +3,12 @@ package com.yonge.cooleshow.biz.dal.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yonge.cooleshow.biz.dal.dto.req.OrderReq;
+import com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord;
 import com.yonge.cooleshow.biz.dal.entity.VipCardRecord;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
 import com.yonge.cooleshow.biz.dal.enums.PeriodEnum;
-import com.yonge.cooleshow.biz.dal.service.StudentService;
-import com.yonge.cooleshow.biz.dal.service.SysMessageService;
-import com.yonge.cooleshow.biz.dal.service.VipCardRecordService;
+import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.vo.StudentVo;
 import com.yonge.cooleshow.biz.dal.vo.UserOrderDetailVo;
 import com.yonge.cooleshow.biz.dal.vo.res.OrderCreateRes;
@@ -24,7 +23,6 @@ import com.yonge.cooleshow.biz.dal.entity.MemberPriceSettings;
 import com.yonge.cooleshow.biz.dal.vo.MemberPriceSettingsVo;
 import com.yonge.cooleshow.biz.dal.dto.search.MemberPriceSettingsSearch;
 import com.yonge.cooleshow.biz.dal.dao.MemberPriceSettingsDao;
-import com.yonge.cooleshow.biz.dal.service.MemberPriceSettingsService;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
@@ -39,6 +37,8 @@ public class MemberPriceSettingsServiceImpl extends ServiceImpl<MemberPriceSetti
     private VipCardRecordService vipCardRecordService;
     @Autowired
     private SysMessageService sysMessageService;
+    @Autowired
+    private PlatformCashAccountRecordService platformCashAccountRecordService;
 
     @Override
     public MemberPriceSettingsVo detail(Long id) {
@@ -94,6 +94,11 @@ public class MemberPriceSettingsServiceImpl extends ServiceImpl<MemberPriceSetti
         studentService.updateById(studentVo);
         //会员购买记录入库
         vipCardRecordService.save(vipCardRecord);
+        //记录平台收入
+        PlatformCashAccountRecord platformCashAccountRecord = new PlatformCashAccountRecord();
+        platformCashAccountRecord.setAccountId(orderDetailVo.getUserId());
+//        platformCashAccountRecord.setTransAmount(ClientEnum.STUDENT.getCode());
+//        platformCashAccountRecordService.save();
         //会员购买消息推送
         authSend(studentVo.getUserId(), studentVo.getPhone(), DateUtil.format(vipCardRecord.getEndTime(), DateUtil.DEFAULT_PATTERN));
     }

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

@@ -0,0 +1,29 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.biz.dal.dao.PlatformCashAccountRecordDao;
+import com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord;
+import com.yonge.cooleshow.biz.dal.service.PlatformCashAccountRecordService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+/**
+ * 平台账户流水表(PlatformCashAccountRecord)表服务实现类
+ *
+ * @author zx
+ * @since 2022-07-21 10:32:07
+ */
+@Service("platformCashAccountRecordService")
+public class PlatformCashAccountRecordServiceImpl extends ServiceImpl<PlatformCashAccountRecordDao, PlatformCashAccountRecord> implements PlatformCashAccountRecordService {
+
+    private final static Logger log = LoggerFactory.getLogger(PlatformCashAccountRecordServiceImpl.class);
+
+    @Override
+    public PlatformCashAccountRecordDao getDao() {
+        return this.baseMapper;
+    }
+
+}
+

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

@@ -32,6 +32,17 @@ public class UserOrderDetailVo extends UserOrderDetail {
     @ApiModelProperty(value = "推荐用户id(有推荐人的情况)")
     private Long recomUserId;
 
+    @ApiModelProperty(value = "分润用户编号")
+    private Long routeUserId;
+
+    public Long getRouteUserId() {
+        return routeUserId;
+    }
+
+    public void setRouteUserId(Long routeUserId) {
+        this.routeUserId = routeUserId;
+    }
+
     public Long getUserId() {
         return userId;
     }

+ 29 - 0
cooleshow-user/user-biz/src/main/java/controller/PlatformCashAccountRecordController.java

@@ -0,0 +1,29 @@
+package controller;
+
+
+import com.ym.mec.biz.dal.entity.PlatformCashAccountRecord;
+import com.ym.mec.biz.service.PlatformCashAccountRecordService;
+import org.springframework.web.bind.annotation.*;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+
+import javax.annotation.Resource;
+
+/**
+ * 平台账户流水表(PlatformCashAccountRecord)表控制层
+ *
+ * @author zx
+ * @since 2022-07-21 10:32:05
+ */
+@Api(tags = "平台账户流水表")
+@RestController
+@RequestMapping("/platformCashAccountRecord")
+public class PlatformCashAccountRecordController extends BaseController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private PlatformCashAccountRecordService platformCashAccountRecordService;
+
+}
+

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

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yonge.cooleshow.biz.dal.dao.PlatformCashAccountRecordDao">
+    <resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord">
+        <id column="id_" jdbcType="INTEGER" property="id"/>
+        <result column="account_id_" jdbcType="INTEGER" property="accountId"/>
+        <result column="trans_amount_" jdbcType="VARCHAR" property="transAmount"/>
+        <result column="in_or_out_" jdbcType="VARCHAR" property="inOrOut"/>
+        <result column="post_status_" jdbcType="VARCHAR" property="postStatus"/>
+        <result column="biz_type_" jdbcType="VARCHAR" property="bizType"/>
+        <result column="biz_id_" jdbcType="INTEGER" property="bizId"/>
+        <result column="memo_" jdbcType="VARCHAR" property="memo"/>
+        <result column="order_no_" jdbcType="VARCHAR" property="orderNo"/>
+        <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id_
+        , account_id_, trans_amount_, in_or_out_, post_status_, biz_type_, biz_id_, memo_, order_no_, create_time_, update_time_
+    </sql>
+
+    <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
+            parameterType="com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord">
+        insert into platform_cash_account_record(account_id_, trans_amount_, in_or_out_, post_status_, biz_type_,
+        biz_id_, memo_, order_no_, create_time_, update_time_)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.accountId}, #{entity.transAmount}, #{entity.inOrOut}, #{entity.postStatus}, #{entity.bizType},
+            #{entity.bizId}, #{entity.memo}, #{entity.orderNo}, #{entity.createTime}, #{entity.updateTime})
+        </foreach>
+    </insert>
+
+</mapper>