diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysLiveSchedulController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysLiveSchedulController.java index b753274b3..e4fe38404 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysLiveSchedulController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysLiveSchedulController.java @@ -5,16 +5,10 @@ import java.util.List; import com.stdiet.common.utils.DateUtils; import com.stdiet.common.utils.StringUtils; +import com.stdiet.custom.domain.SysLiveSchedulFanRecord; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.stdiet.common.annotation.Log; import com.stdiet.common.core.controller.BaseController; import com.stdiet.common.core.domain.AjaxResult; @@ -261,4 +255,21 @@ public class SysLiveSchedulController extends BaseController } return AjaxResult.success(live); } + + /** + * 给对应直播添加、更新进粉记录 + */ + @PostMapping(value = "/addOrEditSysLiveSchedulFanRecord") + public AjaxResult addOrEditSysLiveSchedulFanRecord(@RequestBody SysLiveSchedulFanRecord sysLiveSchedulFanRecord){ + int row = sysLiveSchedulFanRecord.getId() == null ? sysLiveSchedulService.addLiveSchedulFanRecord(sysLiveSchedulFanRecord) : sysLiveSchedulService.updateLiveSchedulFanRecord(sysLiveSchedulFanRecord); + return toAjax(row); + } + + /** + * 给对应直播删除进粉记录 + */ + @GetMapping(value = "/delSysLiveSchedulFanRecord") + public AjaxResult delSysLiveSchedulFanRecord(@RequestParam("id")Long id){ + return toAjax(sysLiveSchedulService.delLiveSchedulFanRecord(id)); + } } \ No newline at end of file diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWxSaleAccountController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWxSaleAccountController.java index cf02a80f8..6db7ccd63 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWxSaleAccountController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWxSaleAccountController.java @@ -119,4 +119,13 @@ public class SysWxSaleAccountController extends BaseController { return toAjax(sysWxSaleAccountService.deleteSysWxSaleAccountByIds(ids)); } + + /** + * 查询所有微信账号 + */ + @GetMapping("/getAllWxAccount") + public AjaxResult getAllWxAccount() { + List list = sysWxSaleAccountService.selectSysWxSaleAccountList(new SysWxSaleAccount()); + return AjaxResult.success(list); + } } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysLiveSchedul.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysLiveSchedul.java index 774c4434d..f4b023aa7 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysLiveSchedul.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysLiveSchedul.java @@ -81,5 +81,9 @@ public class SysLiveSchedul extends BaseEntity private String fanChannelName; + //导粉情况 private List> wxAccountList; + + //进粉情况 + private List> addFanList; } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysLiveSchedulFanRecord.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysLiveSchedulFanRecord.java new file mode 100644 index 000000000..530d35997 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysLiveSchedulFanRecord.java @@ -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; +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysLiveSchedulFanRecordMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysLiveSchedulFanRecordMapper.java new file mode 100644 index 000000000..39f0ff770 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysLiveSchedulFanRecordMapper.java @@ -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 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); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysLiveSchedulService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysLiveSchedulService.java index 3ae973af1..020b752fa 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysLiveSchedulService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysLiveSchedulService.java @@ -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); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysLiveSchedulServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysLiveSchedulServiceImpl.java index 986f2c047..493068ece 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysLiveSchedulServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysLiveSchedulServiceImpl.java @@ -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); + } } \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysLiveSchedulFanRecordMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysLiveSchedulFanRecordMapper.xml new file mode 100644 index 000000000..37d1a6fa2 --- /dev/null +++ b/stdiet-custom/src/main/resources/mapper/custom/SysLiveSchedulFanRecordMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into sys_live_schedul_fan_record + + live_schedul_id, + sale_wx_account_id, + fan_wx_number, + enter_fan_time, + create_time, + create_by, + update_time, + update_by, + del_flag, + + + #{liveSchedulId}, + #{saleWxAccountId}, + #{fanWxNumber}, + #{enterFanTime}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{delFlag}, + + + + + update sys_live_schedul_fan_record + + live_schedul_id = #{liveSchedulId}, + sale_wx_account_id = #{saleWxAccountId}, + fan_wx_number = #{fanWxNumber}, + enter_fan_time = #{enterFanTime}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + del_flag = #{delFlag}, + + where id = #{id} + + + + update sys_live_schedul_fan_record set del_flag = 1 where id = #{id} + + + + update sys_live_schedul_fan_record set del_flag = 1 where id in + + #{id} + + + \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysLiveSchedulMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysLiveSchedulMapper.xml index 3a0cf375d..ce9bf25a8 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysLiveSchedulMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysLiveSchedulMapper.xml @@ -29,6 +29,8 @@ + + @@ -220,5 +222,16 @@ and #{liveStartTime} >= live_start_time order by live_start_time desc limit 1 + + \ No newline at end of file diff --git a/stdiet-ui/src/api/custom/liveSchedul.js b/stdiet-ui/src/api/custom/liveSchedul.js index 9a2a539e9..b10f3a442 100644 --- a/stdiet-ui/src/api/custom/liveSchedul.js +++ b/stdiet-ui/src/api/custom/liveSchedul.js @@ -89,5 +89,23 @@ export function getLiveSchedulByTime(data) { }) } +//添加、编辑进粉记录 +export function addOrEditSysLiveSchedulFanRecord(data){ + return request({ + url: '/custom/liveSchedul/addOrEditSysLiveSchedulFanRecord', + method: 'post', + data: data + }) +} + +//删除进粉记录 +export function delSysLiveSchedulFanRecord(query){ + return request({ + url: '/custom/liveSchedul/delSysLiveSchedulFanRecord', + method: 'get', + params: query + }) +} + diff --git a/stdiet-ui/src/api/custom/wxAccount.js b/stdiet-ui/src/api/custom/wxAccount.js index 4320b65fa..6a8f4a35c 100644 --- a/stdiet-ui/src/api/custom/wxAccount.js +++ b/stdiet-ui/src/api/custom/wxAccount.js @@ -51,3 +51,12 @@ export function exportWxAccount(query) { params: query }) } + +// 查询所有微信账号 +export function getAllWxAccount() { + return request({ + url: '/custom/wxAccount/getAllWxAccount', + method: 'get' + }) +} + diff --git a/stdiet-ui/src/views/custom/liveSchedul/index.vue b/stdiet-ui/src/views/custom/liveSchedul/index.vue index 303499622..9445c72bc 100644 --- a/stdiet-ui/src/views/custom/liveSchedul/index.vue +++ b/stdiet-ui/src/views/custom/liveSchedul/index.vue @@ -137,16 +137,18 @@ - - + - + + + +