diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWapController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWapController.java index 48bb3ab96..54a448c51 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWapController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWapController.java @@ -276,5 +276,15 @@ public class SysWapController extends BaseController { return AjaxResult.success(reply); } + @DeleteMapping("/video/delete/comment/{id}") + public AjaxResult deleteVideoComment(@PathVariable String id) { + return toAjax(iSysNutritionalVideoService.deleteVideoCommentById(id)); + } + + @DeleteMapping("/video/delete/reply/{id}") + public AjaxResult deleteVideoReply(@PathVariable String id) { + return toAjax(iSysNutritionalVideoService.deleteVideoCommentReplyById(id)); + } + } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysRecipesPlanListInfo.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysRecipesPlanListInfo.java index e333258da..bfcffbe02 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysRecipesPlanListInfo.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysRecipesPlanListInfo.java @@ -31,4 +31,6 @@ public class SysRecipesPlanListInfo { private Integer status; + private String remark; + } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysVideoCommentMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysVideoCommentMapper.java index 34a66a7b0..241e26cf7 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysVideoCommentMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysVideoCommentMapper.java @@ -11,4 +11,7 @@ public interface SysVideoCommentMapper { int insertVideoCommentReply(SysVideoComment videoComment); + int deleteVideoCommentById(String id); + + int deleteVideoCommentReplyById(String id); } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysNutritionalVideoService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysNutritionalVideoService.java index 1e57c4009..1131879ba 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysNutritionalVideoService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysNutritionalVideoService.java @@ -1,21 +1,18 @@ package com.stdiet.custom.service; +import com.stdiet.custom.domain.SysNutritionalVideo; +import com.stdiet.custom.domain.SysVideoComment; + import java.util.List; import java.util.Map; -import com.stdiet.custom.domain.SysNutritionalVideo; -import com.stdiet.custom.domain.SysVideoClassify; -import com.stdiet.custom.domain.SysVideoComment; -import org.apache.ibatis.annotations.Param; - /** * 营养视频Service接口 * * @author xzj * @date 2021-04-29 */ -public interface ISysNutritionalVideoService -{ +public interface ISysNutritionalVideoService { /** * 查询营养视频 * @@ -66,6 +63,7 @@ public interface ISysNutritionalVideoService /** * 获取视频 + * * @param videoId * @return */ @@ -73,12 +71,14 @@ public interface ISysNutritionalVideoService /** * 阿里云视频查询检索 + * * @return */ - public Map<String,Object> searchVideo(String key, Integer status, Integer pageNo, Integer pageSize, String scrollToken); + public Map<String, Object> searchVideo(String key, Integer status, Integer pageNo, Integer pageSize, String scrollToken); /** * 更新微信展示状态 + * * @param wxShow * @param ids * @return @@ -87,12 +87,14 @@ public interface ISysNutritionalVideoService /** * 更新视频播放量 + * * @return */ public int updateVideoPlayNum(String videoId); /** * 获取评论 + * * @param videoComment * @return */ @@ -100,6 +102,7 @@ public interface ISysNutritionalVideoService /** * 添加评论 + * * @param videoComment * @return */ @@ -107,8 +110,15 @@ public interface ISysNutritionalVideoService /** * 添加回复 + * * @param videoComment * @return */ public SysVideoComment insertVideoCommentReply(SysVideoComment videoComment); + + public int deleteVideoCommentById(String id); + + public int deleteVideoCommentReplyById(String id); + + } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysNutritionalVideoServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysNutritionalVideoServiceImpl.java index cb4544263..a1b571a04 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysNutritionalVideoServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysNutritionalVideoServiceImpl.java @@ -345,6 +345,16 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi return null; } + @Override + public int deleteVideoCommentById(String id) { + return sysVideoCommentMapper.deleteVideoCommentById(id); + } + + @Override + public int deleteVideoCommentReplyById(String id) { + return sysVideoCommentMapper.deleteVideoCommentReplyById(id); + } + /** * 判断是否为阿里点播的截图 * diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysRecipesPlanMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysRecipesPlanMapper.xml index 1bde54407..68dedc763 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysRecipesPlanMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysRecipesPlanMapper.xml @@ -36,11 +36,13 @@ <result property="nutritionist" column="nutritionist"/> <result property="nutritionistAssisId" column="nutritionist_assis_id"/> <result property="nutritionistAssis" column="nutritionist_assis"/> + <result property="remark" column="remark"/> </resultMap> <sql id="selectSysRecipesPlanVo"> - select id, order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, pause_date, create_time, create_by, update_time, update_by, del_flag, review_status, sub_send, sms_send, subscribed from sys_recipes_plan + select id, order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, pause_date, create_time, create_by, update_time, update_by, del_flag, review_status, sub_send, sms_send, subscribed, remark + from sys_recipes_plan </sql> <select id="selectSysRecipesPlanList" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult"> @@ -141,6 +143,7 @@ <if test="subscribed != null">subscribed = #{subscribed},</if> <if test="subSend != null">sub_send = #{subSend},</if> <if test="smsSend != null">sms_send = #{smsSend},</if> + <if test="remark != null">remark = #{remark},</if> </trim> where id = #{id} and del_flag = 0 </update> @@ -185,10 +188,11 @@ srp.subscribed FROM sys_recipes_plan srp LEFT JOIN sys_customer sc ON sc.id = srp.cus_id - LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sc.main_dietitian AND su_nutritionist.del_flag = 0 + LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sc.main_dietitian AND su_nutritionist.del_flag = + 0 LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sc.assistant_dietitian AND su_nutritionist_assis.del_flag = 0 - WHERE srp.del_flag = 0 AND sc.del_flag = 0 AND srp.type = 0 + WHERE srp.del_flag = 0 AND sc.del_flag = 0 AND srp.type = 0 <if test="orderId != null">AND srp.order_id = #{orderId}</if> <if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if> <if test="customer != null and customer != ''">AND (sc.name like concat('%',#{customer},'%') OR sc.phone like @@ -249,6 +253,7 @@ <result property="recipesId" column="recipes_id"/> <result property="sendFlag" column="send_flag"/> <result property="subscribed" column="subscribed"/> + <result property="remark" column="remark"/> <association property="menus" column="recipes_id" select="selectMenuIds"/> </resultMap> @@ -256,12 +261,12 @@ and review_status = 2 and send_flag = 1 --> <select id="selectRecipesPlanListInfo" resultMap="SysRecipesPlanListInfoResult"> - select id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, subscribed from sys_recipes_plan where out_id=#{outId} and del_flag = 0 + select id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, subscribed, remark from sys_recipes_plan where out_id=#{outId} and del_flag = 0 </select> <!-- and review_status = 2 and send_flag = 1--> <select id="selectRecipesPlanListInfoByCusId" resultMap="SysRecipesPlanListInfoResult"> - select id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, subscribed from sys_recipes_plan where cus_id=#{cusId} and del_flag = 0 + select id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, subscribed, remark from sys_recipes_plan where cus_id=#{cusId} and del_flag = 0 </select> <resultMap type="SysRecipesDaily" id="SysRecipesResult"> diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysVideoCommentMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysVideoCommentMapper.xml index b07635c84..c837bf606 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysVideoCommentMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysVideoCommentMapper.xml @@ -12,11 +12,11 @@ <result column="from_role" property="fromRole"/> <result column="to_uid" property="toUid"/> <result column="to_role" property="toRole"/> -<!-- <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>--> + <!-- <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>--> <result column="create_time" property="createTime"/> -<!-- <association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/>--> -<!-- <association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>--> -<!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>--> + <!-- <association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/>--> + <!-- <association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>--> + <!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>--> <association property="replys" column="id" select="selectVideoCommentReplyByCommentId"/> </resultMap> @@ -31,11 +31,11 @@ <result column="to_uid" property="toUid"/> <result column="to_role" property="toRole"/> <result column="reply_id" property="replyId"/> -<!-- <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>--> + <!-- <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>--> <result column="create_time" property="createTime"/> -<!-- <association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/>--> -<!-- <association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>--> -<!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>--> + <!-- <association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/>--> + <!-- <association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>--> + <!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>--> <!-- <association property="toAvatar" column="{uid=to_uid,role=to_role}" select="selectUserAvatar"/>--> </resultMap> @@ -137,4 +137,12 @@ </trim> </insert> + <update id="deleteVideoCommentById" parameterType="String"> + update sys_nutritional_video_comment set del_flag = 1 where id = #{id} + </update> + + <update id="deleteVideoCommentReplyById" parameterType="String"> + update sys_nutritional_video_reply set del_flag = 1 where id = #{id} + </update> + </mapper> \ No newline at end of file diff --git a/stdiet-ui/src/components/HealthyView/RemarkCom/index.vue b/stdiet-ui/src/components/HealthyView/RemarkCom/index.vue index 119b84075..b8a78cabb 100644 --- a/stdiet-ui/src/components/HealthyView/RemarkCom/index.vue +++ b/stdiet-ui/src/components/HealthyView/RemarkCom/index.vue @@ -4,7 +4,7 @@ placement="right" trigger="click" width="400" - title="备注" + :title="title" @hide="handleOnHide" > <el-input @@ -15,7 +15,7 @@ maxlength="300" show-word-limit /> - <span slot="reference" class="trigger">备注: </span> + <span slot="reference" class="trigger">{{ title }}:</span> </el-popover> <div class="content"> <span v-if="newLine"> @@ -35,6 +35,10 @@ export default { type: String, default: "", }, + title: { + type: String, + default: "备注", + }, }, components: {}, data() { diff --git a/stdiet-ui/src/components/HealthyView/index.vue b/stdiet-ui/src/components/HealthyView/index.vue index c61af37f0..08195e6d8 100644 --- a/stdiet-ui/src/components/HealthyView/index.vue +++ b/stdiet-ui/src/components/HealthyView/index.vue @@ -21,6 +21,12 @@ :value.sync="data.avoidFood" @onConfirm="handleOnConfirm" /> + <RemarkCom + v-if="dev" + title="营养师点评" + :value.sync="data.recipesPlanRemark" + @onConfirm="handleOnRemarkConfirm" + /> </div> <el-collapse> <el-collapse-item @@ -57,6 +63,7 @@ import TextInfo from "@/components/TextInfo"; import ACFCom from "./ACFCom"; import RemarkCom from "./RemarkCom"; import { updateHealthy } from "@/api/custom/healthy"; +import { updateRecipesPlan } from "@/api/custom/recipesPlan"; export default { name: "HealthyView", @@ -121,7 +128,7 @@ export default { { title: "过敏源", value: "allergen" }, ], }, - { + { title: "运动习惯评估", content: [ { title: "每周运动次数", value: "motionNum" }, @@ -238,6 +245,18 @@ export default { } }); }, + handleOnRemarkConfirm(data) { + const { pathname } = window.location; + const recipesId = pathname.substring(pathname.lastIndexOf("/") + 1); + updateRecipesPlan({ + id: recipesId, + ...data, + }).then((res) => { + if (res.code === 200) { + this.$message.success("修改成功"); + } + }); + }, }, }; </script> diff --git a/stdiet-ui/src/store/modules/recipes.js b/stdiet-ui/src/store/modules/recipes.js index 23e4e2a08..f01aaecf2 100644 --- a/stdiet-ui/src/store/modules/recipes.js +++ b/stdiet-ui/src/store/modules/recipes.js @@ -49,7 +49,8 @@ const oriState = { igdTypeOptions: [], physicalSignsOptions: [], // - curShortCutObj: {} + curShortCutObj: {}, + recipesPlanRemark: "" }; const mutations = { @@ -147,7 +148,8 @@ const actions = { endNumDay, recipesId, cusId, - reviewStatus + reviewStatus, + remark } = planResponse.data; commit("updateStateData", { cusId, @@ -157,7 +159,8 @@ const actions = { name: payload.name, planId: payload.planId, startNum: startNumDay, - endNum: endNumDay + endNum: endNumDay, + recipesPlanRemark: remark }); getDicts("cus_cus_unit").then(response => { commit("updateStateData", { cusUnitOptions: response.data }); @@ -237,7 +240,8 @@ const actions = { commit("updateStateData", payload); } }, - async getHealthyData({ commit }, payload) { + async getHealthyData({ commit, state }, payload) { + const { recipesPlanRemark } = state; commit("updateStateData", { healthDataLoading: true }); const healthyDataResult = await getCustomerPhysicalSignsByCusId( payload.cusId @@ -256,7 +260,10 @@ const actions = { commit("updateStateData", { healthDataLoading: false, healthyDataType, - healthyData, + healthyData: { + ...healthyData, + recipesPlanRemark + }, avoidFoodIds: (healthyData.avoidFood || []).map(obj => obj.id) }); }, @@ -555,7 +562,7 @@ const actions = { id: new Date().getTime(), name: tarDishes.name, type: response.data.type.split(",").sort(), - className: response.data.className, //大类小类名称 + className: response.data.className, //大类小类名称 data: tarDishes }).then(() => { window.postMessage(