From fb8a266b94d104d4863a7d8b400ddb4d49bd7fae Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Thu, 8 Jul 2021 17:47:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B6=88=E5=8C=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=97=AE=E5=8D=B7=E7=A7=BB=E9=99=A4=E5=87=8F?= =?UTF-8?q?=E8=84=82=E7=BB=8F=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stdiet-ui/src/utils/healthyData.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js index c286b1df6..e8ac89b1b 100644 --- a/stdiet-ui/src/utils/healthyData.js +++ b/stdiet-ui/src/utils/healthyData.js @@ -823,12 +823,12 @@ export function dealHealthy(customerHealthy) { return customerHealthy; } -export const extendHealthyTitle = {"0":"减脂","5":"降血压","6":"降血糖","3": "备孕营养", "1": "月经不调", "2": "多囊调理", "11":"心脑血管调理","13":"胃肠肿瘤调理","4":"产后调理","7":"高血脂"}; -export const projectName = {"0":"减脂","5":"高血压","6":"高血糖","3": "备孕营养", "1":"月经不调", "2":"多囊卵巢综合症", "13":"胃肠肿瘤","4":"产后调理","7":"高血脂"}; +export const extendHealthyTitle = {"0":"减脂","5":"降血压","6":"降血糖","3": "备孕营养", "1": "月经不调", "2": "多囊调理", "11":"心脑血管调理","13":"胃肠肿瘤调理","4":"产后调理","7":"高血脂","10":"消化系统管理"}; +export const projectName = {"0":"减脂","5":"高血压","6":"高血糖","3": "备孕营养", "1":"月经不调", "2":"多囊卵巢综合症", "13":"胃肠肿瘤","4":"产后调理","7":"高血脂","10":"消化系统管理"}; //需要填写慢病调查问卷的项目 export const extendHealthyIndex = [5, 6, 1, 2, 13,4,7]; //跳过减脂经历问卷的项目 -export const notExperienceIndex = [3,1,2,13,4,7]; +export const notExperienceIndex = [3,1,2,13,4,7,10]; export function getTitleKey(projectId){ return extendHealthyTitle[projectId+""] != null ? extendHealthyTitle[projectId+""] : extendHealthyTitle["0"]; From 9b86f2e5572899c12fc8dcedc6258a35a0e09313 Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Thu, 8 Jul 2021 18:29:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/filters/local/application.yml | 4 +- .../custom/SysNutritionalVideoController.java | 21 +++++ .../stdiet/common/utils/AliyunVideoUtils.java | 23 ++++++ .../custom/domain/SysNutritionalVideo.java | 3 + .../stdiet/custom/domain/SysWxUserLog.java | 8 ++ .../dto/response/CommunityPunchReponse.java | 65 ++++++++++++++++ .../mapper/custom/SysWxUserLogMapper.xml | 24 ++++++ stdiet-ui/public/index.html | 3 + stdiet-ui/src/api/custom/nutritionalVideo.js | 9 +++ stdiet-ui/src/components/OrderAdd/index.vue | 4 +- stdiet-ui/src/components/VideoPlay/index.vue | 63 +++++++++++++++ .../src/components/VideoPlay/video/index.vue | 78 +++++++++++++++++++ .../views/custom/nutritionalVideo/index.vue | 18 ++++- 13 files changed, 318 insertions(+), 5 deletions(-) create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/dto/response/CommunityPunchReponse.java create mode 100644 stdiet-ui/src/components/VideoPlay/index.vue create mode 100644 stdiet-ui/src/components/VideoPlay/video/index.vue diff --git a/stdiet-admin/src/main/filters/local/application.yml b/stdiet-admin/src/main/filters/local/application.yml index 81d11d386..0c2e5b125 100644 --- a/stdiet-admin/src/main/filters/local/application.yml +++ b/stdiet-admin/src/main/filters/local/application.yml @@ -9,7 +9,7 @@ stdiet: # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: /Users/wonder/Documents/Workspaces/java/ShengtangManage/running/uploadPath + profile: D:/ruoyi/uploadPath # profile: D:/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false @@ -19,7 +19,7 @@ stdiet: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8090 + port: 8091 servlet: # 应用的访问路径 context-path: / diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysNutritionalVideoController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysNutritionalVideoController.java index 5a55b905c..f805f9af8 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysNutritionalVideoController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysNutritionalVideoController.java @@ -152,6 +152,27 @@ public class SysNutritionalVideoController extends BaseController return AjaxResult.success(sysNutritionalVideos); } + /** + * 获取营养视频播放凭证 + */ + @PreAuthorize("@ss.hasPermi('custom:nutritionalVideo:query')") + @GetMapping(value = "/getVideoPlayAuth/{id}") + public AjaxResult getVideoPlayAuth(@PathVariable("id") Long id) + { + SysNutritionalVideo sysNutritionalVideos = sysNutritionalVideoService.selectSysNutritionalVideoById(id); + if(sysNutritionalVideos != null && StringUtils.isNotEmpty(sysNutritionalVideos.getVideoId())){ + try{ + String playAuth = AliyunVideoUtils.getVideoPlayAuth(sysNutritionalVideos.getVideoId()); + sysNutritionalVideos.setPlayAuth(playAuth); + }catch (Exception e){ + e.printStackTrace(); + } + } + return AjaxResult.success(sysNutritionalVideos); + } + + + /** * 根据视频videoId提交视频截图请求 */ diff --git a/stdiet-common/src/main/java/com/stdiet/common/utils/AliyunVideoUtils.java b/stdiet-common/src/main/java/com/stdiet/common/utils/AliyunVideoUtils.java index 37e174d34..2b72e266a 100644 --- a/stdiet-common/src/main/java/com/stdiet/common/utils/AliyunVideoUtils.java +++ b/stdiet-common/src/main/java/com/stdiet/common/utils/AliyunVideoUtils.java @@ -137,6 +137,29 @@ public class AliyunVideoUtils { return client.createUploadVideo(createUploadVideoRequest); } + /** + * 根据视频ID获取对应播放凭证 + * @param videoId + * @return + * @throws Exception + */ + public static String getVideoPlayAuth(String videoId) throws Exception{ + com.aliyun.vod20170321.Client client = AliyunVideoUtils.createClient(); + GetVideoPlayAuthRequest getVideoPlayAuthRequest = new GetVideoPlayAuthRequest() + .setVideoId(videoId); + GetVideoPlayAuthResponse response = client.getVideoPlayAuth(getVideoPlayAuthRequest); + if(response != null){ + GetVideoPlayAuthResponseBody body = response.body; + if(body != null && StringUtils.isNotEmpty(body.playAuth)){ + return body.playAuth; + } + } + return null; + } + + + + /** * * @param key diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysNutritionalVideo.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysNutritionalVideo.java index 738f38d1d..c73e37e71 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysNutritionalVideo.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysNutritionalVideo.java @@ -74,6 +74,9 @@ public class SysNutritionalVideo extends BaseEntity private String playUrl; + //播放凭证 + private String playAuth; + //文件名称 private String fileName; diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxUserLog.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxUserLog.java index cb6bdc102..dc188c0fe 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxUserLog.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxUserLog.java @@ -146,6 +146,14 @@ public class SysWxUserLog extends BaseEntity @Excel(name = "点评") private String comment; + /** 点赞数量 */ + @Excel(name = "点赞数量") + private Long thumbsupNum; + + /** 健康宣言 */ + @Excel(name = "健康宣言") + private String healthManifesto; + /** 删除标识 0未删除 1已删除 */ private Long delFlag; diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/dto/response/CommunityPunchReponse.java b/stdiet-custom/src/main/java/com/stdiet/custom/dto/response/CommunityPunchReponse.java new file mode 100644 index 000000000..f16c3d8fe --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/dto/response/CommunityPunchReponse.java @@ -0,0 +1,65 @@ +package com.stdiet.custom.dto.response; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 打卡社区 + */ +@Data +public class CommunityPunchReponse { + + /** + * 微信openid + */ + private String openid; + + /** + * 客户ID + */ + private Long cusId; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String avatarUrl; + + /** + * 打卡日期时间 + */ + private Date logTime; + + /** + * 当天打卡体重 + */ + private BigDecimal weight; + + /** + * 营养师评论 + */ + private String comment; + + /** + * 点赞数 + */ + private String thumbsupNum; + + /** + * 健康宣言 + */ + private String healthManifesto; + + /** + * 近期打卡体重信息 logTime: 打卡日期 weight: 体重 + */ + private List> recentWeight; +} diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysWxUserLogMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysWxUserLogMapper.xml index dc47112cb..f9f4b8718 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysWxUserLogMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysWxUserLogMapper.xml @@ -38,6 +38,8 @@ + + @@ -71,6 +73,8 @@ + + @@ -168,6 +172,8 @@ target_weight, execution_score, comment, + thumbsup_num, + health_manifesto, del_flag, @@ -202,6 +208,8 @@ target_weight = #{targetWeight}, execution_score = #{executionScore}, comment = #{comment}, + #{thumbsupNum}, + #{healthManifesto}, del_flag = #{delFlag}, @@ -240,6 +248,8 @@ target_weight = #{targetWeight}, execution_score = #{executionScore}, comment = #{comment}, + thumbsup_num = #{thumbsupNum}, + health_manifesto = #{healthManifesto}, del_flag = #{delFlag}, where id = #{id} @@ -307,4 +317,18 @@ order by wxlog.log_time desc + + + + + + \ No newline at end of file diff --git a/stdiet-ui/public/index.html b/stdiet-ui/public/index.html index a533aa273..107777e5e 100644 --- a/stdiet-ui/public/index.html +++ b/stdiet-ui/public/index.html @@ -13,10 +13,13 @@ rel="stylesheet" href="//at.alicdn.com/t/font_2343184_w0runuauamq.css" /> + + + <%= webpackConfig.name %>