!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);
}
@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 String remark;
}

View File

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

View File

@ -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);
/**
* 更新微信展示状态
*
* @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);
}

View File

@ -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);
}
/**
* 判断是否为阿里点播的截图
*

View File

@ -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,7 +188,8 @@
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
@ -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">

View File

@ -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>

View File

@ -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() {

View File

@ -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",
@ -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>

View File

@ -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)
});
},