!299 添加营养师评论功能

Merge pull request !299 from 德仔/develop
This commit is contained in:
德仔 2021-06-29 10:42:42 +00:00 committed by Gitee
commit c7c5578497
10 changed files with 108 additions and 30 deletions

View File

@ -276,5 +276,15 @@ public class SysWapController extends BaseController {
return AjaxResult.success(reply); 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));
}
} }

View File

@ -31,4 +31,6 @@ public class SysRecipesPlanListInfo {
private Integer status; private Integer status;
private String remark;
} }

View File

@ -11,4 +11,7 @@ public interface SysVideoCommentMapper {
int insertVideoCommentReply(SysVideoComment videoComment); int insertVideoCommentReply(SysVideoComment videoComment);
int deleteVideoCommentById(String id);
int deleteVideoCommentReplyById(String id);
} }

View File

@ -1,21 +1,18 @@
package com.stdiet.custom.service; package com.stdiet.custom.service;
import com.stdiet.custom.domain.SysNutritionalVideo;
import com.stdiet.custom.domain.SysVideoComment;
import java.util.List; import java.util.List;
import java.util.Map; 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接口 * 营养视频Service接口
* *
* @author xzj * @author xzj
* @date 2021-04-29 * @date 2021-04-29
*/ */
public interface ISysNutritionalVideoService public interface ISysNutritionalVideoService {
{
/** /**
* 查询营养视频 * 查询营养视频
* *
@ -66,6 +63,7 @@ public interface ISysNutritionalVideoService
/** /**
* 获取视频 * 获取视频
*
* @param videoId * @param videoId
* @return * @return
*/ */
@ -73,12 +71,14 @@ public interface ISysNutritionalVideoService
/** /**
* 阿里云视频查询检索 * 阿里云视频查询检索
*
* @return * @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 wxShow
* @param ids * @param ids
* @return * @return
@ -87,12 +87,14 @@ public interface ISysNutritionalVideoService
/** /**
* 更新视频播放量 * 更新视频播放量
*
* @return * @return
*/ */
public int updateVideoPlayNum(String videoId); public int updateVideoPlayNum(String videoId);
/** /**
* 获取评论 * 获取评论
*
* @param videoComment * @param videoComment
* @return * @return
*/ */
@ -100,6 +102,7 @@ public interface ISysNutritionalVideoService
/** /**
* 添加评论 * 添加评论
*
* @param videoComment * @param videoComment
* @return * @return
*/ */
@ -107,8 +110,15 @@ public interface ISysNutritionalVideoService
/** /**
* 添加回复 * 添加回复
*
* @param videoComment * @param videoComment
* @return * @return
*/ */
public SysVideoComment insertVideoCommentReply(SysVideoComment videoComment); public SysVideoComment insertVideoCommentReply(SysVideoComment videoComment);
public int deleteVideoCommentById(String id);
public int deleteVideoCommentReplyById(String id);
} }

View File

@ -345,6 +345,16 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
return null; return null;
} }
@Override
public int deleteVideoCommentById(String id) {
return sysVideoCommentMapper.deleteVideoCommentById(id);
}
@Override
public int deleteVideoCommentReplyById(String id) {
return sysVideoCommentMapper.deleteVideoCommentReplyById(id);
}
/** /**
* 判断是否为阿里点播的截图 * 判断是否为阿里点播的截图
* *

View File

@ -36,11 +36,13 @@
<result property="nutritionist" column="nutritionist"/> <result property="nutritionist" column="nutritionist"/>
<result property="nutritionistAssisId" column="nutritionist_assis_id"/> <result property="nutritionistAssisId" column="nutritionist_assis_id"/>
<result property="nutritionistAssis" column="nutritionist_assis"/> <result property="nutritionistAssis" column="nutritionist_assis"/>
<result property="remark" column="remark"/>
</resultMap> </resultMap>
<sql id="selectSysRecipesPlanVo"> <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> </sql>
<select id="selectSysRecipesPlanList" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult"> <select id="selectSysRecipesPlanList" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
@ -141,6 +143,7 @@
<if test="subscribed != null">subscribed = #{subscribed},</if> <if test="subscribed != null">subscribed = #{subscribed},</if>
<if test="subSend != null">sub_send = #{subSend},</if> <if test="subSend != null">sub_send = #{subSend},</if>
<if test="smsSend != null">sms_send = #{smsSend},</if> <if test="smsSend != null">sms_send = #{smsSend},</if>
<if test="remark != null">remark = #{remark},</if>
</trim> </trim>
where id = #{id} and del_flag = 0 where id = #{id} and del_flag = 0
</update> </update>
@ -185,10 +188,11 @@
srp.subscribed srp.subscribed
FROM sys_recipes_plan srp FROM sys_recipes_plan srp
LEFT JOIN sys_customer sc ON sc.id = srp.cus_id 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 LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sc.assistant_dietitian AND
su_nutritionist_assis.del_flag = 0 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="orderId != null">AND srp.order_id = #{orderId}</if>
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</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 <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="recipesId" column="recipes_id"/>
<result property="sendFlag" column="send_flag"/> <result property="sendFlag" column="send_flag"/>
<result property="subscribed" column="subscribed"/> <result property="subscribed" column="subscribed"/>
<result property="remark" column="remark"/>
<association property="menus" column="recipes_id" select="selectMenuIds"/> <association property="menus" column="recipes_id" select="selectMenuIds"/>
</resultMap> </resultMap>
@ -256,12 +261,12 @@
and review_status = 2 and send_flag = 1 and review_status = 2 and send_flag = 1
--> -->
<select id="selectRecipesPlanListInfo" resultMap="SysRecipesPlanListInfoResult"> <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> </select>
<!-- and review_status = 2 and send_flag = 1--> <!-- and review_status = 2 and send_flag = 1-->
<select id="selectRecipesPlanListInfoByCusId" resultMap="SysRecipesPlanListInfoResult"> <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> </select>
<resultMap type="SysRecipesDaily" id="SysRecipesResult"> <resultMap type="SysRecipesDaily" id="SysRecipesResult">

View File

@ -12,11 +12,11 @@
<result column="from_role" property="fromRole"/> <result column="from_role" property="fromRole"/>
<result column="to_uid" property="toUid"/> <result column="to_uid" property="toUid"/>
<result column="to_role" property="toRole"/> <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"/> <result column="create_time" property="createTime"/>
<!-- <association property="fromName" column="{uid=from_uid,role=from_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="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>-->
<!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>--> <!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>-->
<association property="replys" column="id" <association property="replys" column="id"
select="selectVideoCommentReplyByCommentId"/> select="selectVideoCommentReplyByCommentId"/>
</resultMap> </resultMap>
@ -31,11 +31,11 @@
<result column="to_uid" property="toUid"/> <result column="to_uid" property="toUid"/>
<result column="to_role" property="toRole"/> <result column="to_role" property="toRole"/>
<result column="reply_id" property="replyId"/> <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"/> <result column="create_time" property="createTime"/>
<!-- <association property="fromName" column="{uid=from_uid,role=from_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="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>-->
<!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>--> <!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>-->
<!-- <association property="toAvatar" column="{uid=to_uid,role=to_role}" select="selectUserAvatar"/>--> <!-- <association property="toAvatar" column="{uid=to_uid,role=to_role}" select="selectUserAvatar"/>-->
</resultMap> </resultMap>
@ -137,4 +137,12 @@
</trim> </trim>
</insert> </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> </mapper>

View File

@ -4,7 +4,7 @@
placement="right" placement="right"
trigger="click" trigger="click"
width="400" width="400"
title="备注" :title="title"
@hide="handleOnHide" @hide="handleOnHide"
> >
<el-input <el-input
@ -15,7 +15,7 @@
maxlength="300" maxlength="300"
show-word-limit show-word-limit
/> />
<span slot="reference" class="trigger">备注 </span> <span slot="reference" class="trigger">{{ title }}</span>
</el-popover> </el-popover>
<div class="content"> <div class="content">
<span v-if="newLine"> <span v-if="newLine">
@ -35,6 +35,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
title: {
type: String,
default: "备注",
},
}, },
components: {}, components: {},
data() { data() {

View File

@ -21,6 +21,12 @@
:value.sync="data.avoidFood" :value.sync="data.avoidFood"
@onConfirm="handleOnConfirm" @onConfirm="handleOnConfirm"
/> />
<RemarkCom
v-if="dev"
title="营养师点评"
:value.sync="data.recipesPlanRemark"
@onConfirm="handleOnRemarkConfirm"
/>
</div> </div>
<el-collapse> <el-collapse>
<el-collapse-item <el-collapse-item
@ -57,6 +63,7 @@ import TextInfo from "@/components/TextInfo";
import ACFCom from "./ACFCom"; import ACFCom from "./ACFCom";
import RemarkCom from "./RemarkCom"; import RemarkCom from "./RemarkCom";
import { updateHealthy } from "@/api/custom/healthy"; import { updateHealthy } from "@/api/custom/healthy";
import { updateRecipesPlan } from "@/api/custom/recipesPlan";
export default { export default {
name: "HealthyView", name: "HealthyView",
@ -121,7 +128,7 @@ export default {
{ title: "过敏源", value: "allergen" }, { title: "过敏源", value: "allergen" },
], ],
}, },
{ {
title: "运动习惯评估", title: "运动习惯评估",
content: [ content: [
{ title: "每周运动次数", value: "motionNum" }, { 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> </script>

View File

@ -49,7 +49,8 @@ const oriState = {
igdTypeOptions: [], igdTypeOptions: [],
physicalSignsOptions: [], physicalSignsOptions: [],
// //
curShortCutObj: {} curShortCutObj: {},
recipesPlanRemark: ""
}; };
const mutations = { const mutations = {
@ -147,7 +148,8 @@ const actions = {
endNumDay, endNumDay,
recipesId, recipesId,
cusId, cusId,
reviewStatus reviewStatus,
remark
} = planResponse.data; } = planResponse.data;
commit("updateStateData", { commit("updateStateData", {
cusId, cusId,
@ -157,7 +159,8 @@ const actions = {
name: payload.name, name: payload.name,
planId: payload.planId, planId: payload.planId,
startNum: startNumDay, startNum: startNumDay,
endNum: endNumDay endNum: endNumDay,
recipesPlanRemark: remark
}); });
getDicts("cus_cus_unit").then(response => { getDicts("cus_cus_unit").then(response => {
commit("updateStateData", { cusUnitOptions: response.data }); commit("updateStateData", { cusUnitOptions: response.data });
@ -237,7 +240,8 @@ const actions = {
commit("updateStateData", payload); commit("updateStateData", payload);
} }
}, },
async getHealthyData({ commit }, payload) { async getHealthyData({ commit, state }, payload) {
const { recipesPlanRemark } = state;
commit("updateStateData", { healthDataLoading: true }); commit("updateStateData", { healthDataLoading: true });
const healthyDataResult = await getCustomerPhysicalSignsByCusId( const healthyDataResult = await getCustomerPhysicalSignsByCusId(
payload.cusId payload.cusId
@ -256,7 +260,10 @@ const actions = {
commit("updateStateData", { commit("updateStateData", {
healthDataLoading: false, healthDataLoading: false,
healthyDataType, healthyDataType,
healthyData, healthyData: {
...healthyData,
recipesPlanRemark
},
avoidFoodIds: (healthyData.avoidFood || []).map(obj => obj.id) avoidFoodIds: (healthyData.avoidFood || []).map(obj => obj.id)
}); });
}, },
@ -555,7 +562,7 @@ const actions = {
id: new Date().getTime(), id: new Date().getTime(),
name: tarDishes.name, name: tarDishes.name,
type: response.data.type.split(",").sort(), type: response.data.type.split(",").sort(),
className: response.data.className, //大类小类名称 className: response.data.className, //大类小类名称
data: tarDishes data: tarDishes
}).then(() => { }).then(() => {
window.postMessage( window.postMessage(