From cf766cb8177aa7daa060cd0d47042d7600c5c991 Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Wed, 26 May 2021 19:06:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=BA=E5=AE=A2=E6=88=B7=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=97=B6=E6=A0=B9=E6=8D=AE=E7=9B=B4=E6=92=AD=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E8=90=A5=E5=85=BB=E5=B8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/SysLiveSchedulController.java | 19 ++++ .../stdiet/custom/domain/SysLiveSchedul.java | 2 + .../custom/mapper/SysLiveSchedulMapper.java | 6 + .../service/ISysLiveSchedulService.java | 6 + .../impl/SysLiveSchedulServiceImpl.java | 8 ++ .../mapper/custom/SysLiveSchedulMapper.xml | 9 ++ stdiet-ui/src/api/custom/liveSchedul.js | 9 ++ .../ImportFanRecord/ImportFan/index.vue | 32 ++++-- stdiet-ui/src/components/OrderAdd/index.vue | 26 +++-- stdiet-ui/src/views/custom/customer/index.vue | 106 +++++++++++++----- .../views/custom/importFanRecord/index.vue | 1 + 11 files changed, 182 insertions(+), 42 deletions(-) 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 dff6fa13f..b753274b3 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 @@ -4,6 +4,7 @@ import java.util.Date; import java.util.List; import com.stdiet.common.utils.DateUtils; +import com.stdiet.common.utils.StringUtils; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -242,4 +243,22 @@ public class SysLiveSchedulController extends BaseController List list = sysLiveSchedulService.selectSysLiveSchedulList(sysLiveSchedul); return AjaxResult.success(list); } + + /** + * 根据日期查询直播记录 + */ + @GetMapping(value = "/getLiveSchedulByTime") + public AjaxResult getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul){ + SysLiveSchedul live = null; + try { + if(sysLiveSchedul.getFanChannel() != null && StringUtils.isNotEmpty(sysLiveSchedul.getLiveStartTimeString())){ + sysLiveSchedul.setLiveStartTimeString(java.net.URLDecoder.decode(sysLiveSchedul.getLiveStartTimeString(), "UTF-8")); + sysLiveSchedul.setLiveStartTime(DateUtils.parseDate(sysLiveSchedul.getLiveStartTimeString())); + live = sysLiveSchedulService.getLiveSchedulByTime(sysLiveSchedul); + } + }catch (Exception e){ + e.printStackTrace(); + } + return AjaxResult.success(live); + } } \ 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 1af68872a..774c4434d 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 @@ -37,6 +37,8 @@ public class SysLiveSchedul extends BaseEntity @Excel(name = "直播开始时间", width = 30, dateFormat = "yyyy-MM-dd") private Date liveStartTime; + private String liveStartTimeString; + /** 直播结束时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm") @Excel(name = "直播结束时间", width = 30, dateFormat = "yyyy-MM-dd") diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysLiveSchedulMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysLiveSchedulMapper.java index 4f876aac1..50e5494ad 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysLiveSchedulMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysLiveSchedulMapper.java @@ -90,4 +90,10 @@ public interface SysLiveSchedulMapper * @return */ public SysLiveSchedul getLastLiveSchedul(); + + /** + * 根据时间确定最近的直播记录 + * @return + */ + public SysLiveSchedul getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul); } \ 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 e22d2b77a..3ae973af1 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 @@ -85,4 +85,10 @@ public interface ISysLiveSchedulService * @return */ public AjaxResult copyLastTimeLiveSchedul(); + + /** + * 根据时间确定最近的直播记录 + * @return + */ + public SysLiveSchedul getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul); } \ 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 37455737b..986f2c047 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 @@ -178,4 +178,12 @@ public class SysLiveSchedulServiceImpl implements ISysLiveSchedulService } return result; } + + /** + * 根据时间确定最近的直播记录 + * @return + */ + public SysLiveSchedul getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul){ + return sysLiveSchedulMapper.getLiveSchedulByTime(sysLiveSchedul); + } } \ 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 2b309d9cd..3a0cf375d 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysLiveSchedulMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysLiveSchedulMapper.xml @@ -211,5 +211,14 @@ where del_flag = 0 order by live_schedul_date 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 61318fca8..9a2a539e9 100644 --- a/stdiet-ui/src/api/custom/liveSchedul.js +++ b/stdiet-ui/src/api/custom/liveSchedul.js @@ -80,5 +80,14 @@ export function getAllLiveSchedulByDate(data) { }) } +// 根据进粉时间查询最近直播记录 +export function getLiveSchedulByTime(data) { + return request({ + url: '/custom/liveSchedul/getLiveSchedulByTime', + method: 'get', + params: data + }) +} + diff --git a/stdiet-ui/src/components/ImportFanRecord/ImportFan/index.vue b/stdiet-ui/src/components/ImportFanRecord/ImportFan/index.vue index 7fa8f0234..8460863f6 100644 --- a/stdiet-ui/src/components/ImportFanRecord/ImportFan/index.vue +++ b/stdiet-ui/src/components/ImportFanRecord/ImportFan/index.vue @@ -1,7 +1,8 @@ - + diff --git a/stdiet-ui/src/views/custom/importFanRecord/index.vue b/stdiet-ui/src/views/custom/importFanRecord/index.vue index f5f0b373a..a236280e7 100644 --- a/stdiet-ui/src/views/custom/importFanRecord/index.vue +++ b/stdiet-ui/src/views/custom/importFanRecord/index.vue @@ -233,6 +233,7 @@