直播记录页面添加进粉记录

This commit is contained in:
xiezhijun
2021-08-20 15:57:53 +08:00
parent af454ecf9a
commit ad3b5be706
12 changed files with 506 additions and 17 deletions

View File

@ -81,5 +81,9 @@ public class SysLiveSchedul extends BaseEntity
private String fanChannelName;
//导粉情况
private List<Map<String,Object>> wxAccountList;
//进粉情况
private List<Map<String,Object>> addFanList;
}

View File

@ -0,0 +1,43 @@
package com.stdiet.custom.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.stdiet.common.utils.DateUtils;
import lombok.Data;
import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity;
/**
* 直播记录中每场直播对应进粉记录对象 sys_live_schedul_fan_record
*
* @author xzj
* @date 2021-08-19
*/
@Data
public class SysLiveSchedulFanRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 直播ID */
@Excel(name = "直播ID")
private Long liveSchedulId;
/** 微信账号ID */
@Excel(name = "微信账号ID")
private Long saleWxAccountId;
/** 进粉客户微信号 */
@Excel(name = "进粉客户微信号")
private String fanWxNumber;
/** 进粉时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@Excel(name = "进粉时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
private Date enterFanTime;
/** 删除标识 0未删除 1已删除 */
private Integer delFlag;
}

View File

@ -0,0 +1,61 @@
package com.stdiet.custom.mapper;
import java.util.List;
import com.stdiet.custom.domain.SysLiveSchedulFanRecord;
/**
* 直播记录中每场直播对应进粉记录Mapper接口
*
* @author xzj
* @date 2021-08-19
*/
public interface SysLiveSchedulFanRecordMapper
{
/**
* 查询直播记录中每场直播对应进粉记录
*
* @param id 直播记录中每场直播对应进粉记录ID
* @return 直播记录中每场直播对应进粉记录
*/
public SysLiveSchedulFanRecord selectSysLiveSchedulFanRecordById(Long id);
/**
* 查询直播记录中每场直播对应进粉记录列表
*
* @param sysLiveSchedulFanRecord 直播记录中每场直播对应进粉记录
* @return 直播记录中每场直播对应进粉记录集合
*/
public List<SysLiveSchedulFanRecord> selectSysLiveSchedulFanRecordList(SysLiveSchedulFanRecord sysLiveSchedulFanRecord);
/**
* 新增直播记录中每场直播对应进粉记录
*
* @param sysLiveSchedulFanRecord 直播记录中每场直播对应进粉记录
* @return 结果
*/
public int insertSysLiveSchedulFanRecord(SysLiveSchedulFanRecord sysLiveSchedulFanRecord);
/**
* 修改直播记录中每场直播对应进粉记录
*
* @param sysLiveSchedulFanRecord 直播记录中每场直播对应进粉记录
* @return 结果
*/
public int updateSysLiveSchedulFanRecord(SysLiveSchedulFanRecord sysLiveSchedulFanRecord);
/**
* 删除直播记录中每场直播对应进粉记录
*
* @param id 直播记录中每场直播对应进粉记录ID
* @return 结果
*/
public int deleteSysLiveSchedulFanRecordById(Long id);
/**
* 批量删除直播记录中每场直播对应进粉记录
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysLiveSchedulFanRecordByIds(Long[] ids);
}

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.stdiet.common.core.domain.AjaxResult;
import com.stdiet.custom.domain.SysLiveSchedul;
import com.stdiet.custom.domain.SysLiveSchedulFanRecord;
/**
* 直播排班Service接口
@ -91,4 +92,25 @@ public interface ISysLiveSchedulService
* @return
*/
public SysLiveSchedul getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul);
/**
* 给对应直播添加进粉记录
* @return
*/
int addLiveSchedulFanRecord(SysLiveSchedulFanRecord sysLiveSchedulFanRecord);
/**
* 给对应直播更新进粉记录
* @param sysLiveSchedulFanRecord
* @return
*/
int updateLiveSchedulFanRecord(SysLiveSchedulFanRecord sysLiveSchedulFanRecord);
/**
* 给对应直播删除进粉记录
* @param id
* @return
*/
int delLiveSchedulFanRecord(Long id);
}

View File

@ -8,6 +8,8 @@ import java.util.List;
import com.stdiet.common.core.domain.AjaxResult;
import com.stdiet.common.utils.DateUtils;
import com.stdiet.common.utils.SecurityUtils;
import com.stdiet.custom.domain.SysLiveSchedulFanRecord;
import com.stdiet.custom.mapper.SysLiveSchedulFanRecordMapper;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -27,6 +29,9 @@ public class SysLiveSchedulServiceImpl implements ISysLiveSchedulService
@Autowired
private SysLiveSchedulMapper sysLiveSchedulMapper;
@Autowired
private SysLiveSchedulFanRecordMapper sysLiveSchedulFanRecordMapper;
/**
* 查询直播排班
*
@ -186,4 +191,29 @@ public class SysLiveSchedulServiceImpl implements ISysLiveSchedulService
public SysLiveSchedul getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul){
return sysLiveSchedulMapper.getLiveSchedulByTime(sysLiveSchedul);
}
/**
* 给对应直播添加进粉记录
* @return
*/
public int addLiveSchedulFanRecord(SysLiveSchedulFanRecord sysLiveSchedulFanRecord){
return sysLiveSchedulFanRecordMapper.insertSysLiveSchedulFanRecord(sysLiveSchedulFanRecord);
}
/**
* 给对应直播修改进粉记录
* @return
*/
public int updateLiveSchedulFanRecord(SysLiveSchedulFanRecord sysLiveSchedulFanRecord){
return sysLiveSchedulFanRecordMapper.updateSysLiveSchedulFanRecord(sysLiveSchedulFanRecord);
}
/**
* 给对应直播删除进粉记录
* @param id
* @return
*/
public int delLiveSchedulFanRecord(Long id){
return sysLiveSchedulFanRecordMapper.deleteSysLiveSchedulFanRecordById(id);
}
}

View File

@ -0,0 +1,85 @@
<?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.stdiet.custom.mapper.SysLiveSchedulFanRecordMapper">
<resultMap type="SysLiveSchedulFanRecord" id="SysLiveSchedulFanRecordResult">
<result property="id" column="id" />
<result property="liveSchedulId" column="live_schedul_id" />
<result property="saleWxAccountId" column="sale_wx_account_id" />
<result property="fanWxNumber" column="fan_wx_number" />
<result property="enterFanTime" column="enter_fan_time" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectSysLiveSchedulFanRecordVo">
select id, live_schedul_id, sale_wx_account_id, fan_wx_number, enter_fan_time, create_time, create_by, update_time, update_by, del_flag from sys_live_schedul_fan_record
</sql>
<select id="selectSysLiveSchedulFanRecordList" parameterType="SysLiveSchedulFanRecord" resultMap="SysLiveSchedulFanRecordResult">
<include refid="selectSysLiveSchedulFanRecordVo"/> where del_flag = 0
</select>
<select id="selectSysLiveSchedulFanRecordById" parameterType="Long" resultMap="SysLiveSchedulFanRecordResult">
<include refid="selectSysLiveSchedulFanRecordVo"/>
where id = #{id} and del_flag = 0
</select>
<insert id="insertSysLiveSchedulFanRecord" parameterType="SysLiveSchedulFanRecord" useGeneratedKeys="true" keyProperty="id">
insert into sys_live_schedul_fan_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="liveSchedulId != null">live_schedul_id,</if>
<if test="saleWxAccountId != null">sale_wx_account_id,</if>
<if test="fanWxNumber != null">fan_wx_number,</if>
<if test="enterFanTime != null">enter_fan_time,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="liveSchedulId != null">#{liveSchedulId},</if>
<if test="saleWxAccountId != null">#{saleWxAccountId},</if>
<if test="fanWxNumber != null">#{fanWxNumber},</if>
<if test="enterFanTime != null">#{enterFanTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateSysLiveSchedulFanRecord" parameterType="SysLiveSchedulFanRecord">
update sys_live_schedul_fan_record
<trim prefix="SET" suffixOverrides=",">
<if test="liveSchedulId != null">live_schedul_id = #{liveSchedulId},</if>
<if test="saleWxAccountId != null">sale_wx_account_id = #{saleWxAccountId},</if>
<if test="fanWxNumber != null">fan_wx_number = #{fanWxNumber},</if>
<if test="enterFanTime != null">enter_fan_time = #{enterFanTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<update id="deleteSysLiveSchedulFanRecordById" parameterType="Long">
update sys_live_schedul_fan_record set del_flag = 1 where id = #{id}
</update>
<update id="deleteSysLiveSchedulFanRecordByIds" parameterType="String">
update sys_live_schedul_fan_record set del_flag = 1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@ -29,6 +29,8 @@
<!-- 根据渠道查询对应微信号(微信账号分配表中) -->
<association property="wxAccountList" column="id" select="getWxAccountListByLiveId"/>
<!-- 查询该场直播真实进粉情况 -->
<association property="addFanList" column="id" select="getAddFanRecordByLiveSchedulId"></association>
</resultMap>
<resultMap type="SysLiveSchedul" id="SysLiveSchedulResultSigle">
@ -220,5 +222,16 @@
and #{liveStartTime} >= live_start_time order by live_start_time desc limit 1
</select>
<!-- 根据直播记录ID查询对应进粉情况 -->
<select id="getAddFanRecordByLiveSchedulId" parameterType="Long" resultType="Map">
select
fr.id, fr.live_schedul_id liveSchedulId, fr.sale_wx_account_id saleWxAccountId, fr.fan_wx_number as fanWxNumber, DATE_FORMAT(fr.enter_fan_time,'%Y-%m-%d %H:%i') as enterFanTime,
w.wx_account as saleWxAccount, u.nick_name as saleName
from sys_live_schedul_fan_record as fr
left join sys_wx_sale_account as w on w.id = fr.sale_wx_account_id and w.del_flag = 0
left join sys_wx_distribution as swd on swd.wechat_account = w.id and swd.del_flag = 0
left join sys_user u on u.user_id = swd.user_id
where fr.del_flag = 0 and fr.live_schedul_id = #{id} order by fr.create_time desc
</select>
</mapper>