Merge branch 'xzj' of gitee.com:darlk/ShengTangManage into develop

This commit is contained in:
huangdeliang 2021-08-04 17:52:34 +08:00
commit 875473b668
25 changed files with 949 additions and 34 deletions

@ -10,6 +10,7 @@ import com.stdiet.common.utils.DateUtils;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.common.utils.oss.AliyunOSSUtils;
import com.stdiet.common.utils.poi.ExcelUtil;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.page.WxLogInfo;
@ -223,4 +224,16 @@ public class SysWxUserLogController extends BaseController {
}
return toAjax(row);
}
/**
* 查询指定日期未打卡用户
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserLog:list')")
@GetMapping("/selectNotPunchCustomerByDate")
public TableDataInfo selectNotPunchCustomerByDate(SysCustomer sysCustomer) {
startPage();
List<SysCustomer> list = sysWxUserLogService.selectNotPunchCustomerByDate(sysCustomer);
return getDataTable(list);
}
}

@ -754,6 +754,10 @@ public class WechatAppletController extends BaseController {
sysPunchThumbsup.setPunchId(Long.parseLong(AesUtils.decrypt(sysPunchThumbsup.getEncPunchId())));
rows = sysPunchThumbsupService.insertSysPunchThumbsup(sysPunchThumbsup);
if (rows > 0) {
//发送点赞消息
SysWxUserLog sysWxUserLog = sysWxUserLogService.selectSysWxUserLogById(sysPunchThumbsup.getPunchId()+"");
sysMessageNoticeService.sendpunchDynamicThumbsUpMessage(sysWxUserLog, sysPunchThumbsup.getCusOpenid());
Map<String, Object> resultData = new HashMap<>();
resultData.put("id", AesUtils.encrypt(String.valueOf(sysPunchThumbsup.getId())));
resultData.put("openid", sysPunchThumbsup.getCusOpenid());
@ -904,6 +908,41 @@ public class WechatAppletController extends BaseController {
return AjaxResult.success(reply);
}
/**
* 查询消息列表
* @param cusId 客户ID
* @param messageType 0 查询全部 1 查询打卡点评消息 2 打卡动态点赞消息 3 服务消息食谱更新执行反馈消息
* @return
*/
@GetMapping("/getMessageNoticeData")
public AjaxResult getMessageNoticeList(@RequestParam("cusId")String cusId, @RequestParam(value = "messageType", required = false, defaultValue = "0")Integer messageType) {
cusId = StringUtils.isNotEmpty(cusId) ? AesUtils.decrypt(cusId) : "0";
Map<String, Object> result = new HashMap<>();
//查询打卡消息
if(messageType.intValue() == 0 || messageType.intValue() == 1){
startPage();
Map<String,Object> punchResult = sysMessageNoticeService.getPunchCommentMessageByCusId(Long.parseLong(cusId));
List<Map<String,Object>> list = (List<Map<String,Object>>)punchResult.get("data");
punchResult.put("data",getDataTable(list));
result.put("punchMessageData", punchResult);
}
if(messageType.intValue() == 0 || messageType.intValue() == 2){
startPage();
Map<String,Object> thumbsUpResult = sysMessageNoticeService.getPunchDynamicThumbsUpMessage(Long.parseLong(cusId));
List<Map<String,Object>> list = (List<Map<String,Object>>)thumbsUpResult.get("data");
thumbsUpResult.put("data",getDataTable(list));
result.put("thumbsUpMessageData", thumbsUpResult);
}
if(messageType.intValue() == 0 || messageType.intValue() == 3){
startPage();
Map<String,Object> serviceResult = sysMessageNoticeService.getServiceMessage(Long.parseLong(cusId));
List<Map<String,Object>> list = (List<Map<String,Object>>)serviceResult.get("data");
serviceResult.put("data",getDataTable(list));
result.put("serviceMessageData", serviceResult);
}
return AjaxResult.success(result);
}
}

@ -1,6 +1,7 @@
package com.stdiet.custom.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.stdiet.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
@ -21,6 +22,9 @@ public class SysRecipesTemplate {
Long planId;
/** 关键词,使用 , 隔开 */
private String keyWord;
String remark;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

@ -3,8 +3,10 @@ package com.stdiet.custom.domain.entityEnum;
public enum MessageNoticeEnum{
systemMessage("系统通知", 0, 0, "系统通知"),
punchComment("打卡点评", 1, 1, "%s打卡点评"); //%s 为打卡时间
punchComment("打卡点评", 1, 1, "%s打卡点评"), //%s 为打卡时间
punchDynamicThumbsUp("打卡动态点赞", 1, 2, ""),
recipesPlanMessage("食谱更新通知", 1, 3, ""),
topicMessage("执行反馈通知", 1, 4, "");
//消息名称
private String name;

@ -1,8 +1,11 @@
package com.stdiet.custom.mapper;
import java.util.List;
import java.util.Map;
import com.stdiet.custom.domain.SysMessageNotice;
import com.stdiet.custom.dto.response.MessageNoticeResponse;
import org.apache.ibatis.annotations.Param;
/**
* 客户消息通知Mapper接口
@ -73,4 +76,58 @@ public interface SysMessageNoticeMapper
* @return
*/
public int getCustomerMessageCount(SysMessageNotice sysMessageNotice);
/**
* 根据客户ID查询打卡点评消息包含点评营养师信息客户信息点评内容
* @param cusId 客户ID
* @return
*/
List<Map<String,Object>> getPunchCommentMessageByCusId(@Param("cusId")Long cusId);
/**
* 查询打卡点评未读消息数量
* @param cusId 客户ID
* @return
*/
int getUnReadPunchMessageNum(@Param("cusId")Long cusId);
/**
* 根据打卡ID和openid查询点赞消息
* @param punchId 打卡ID
* @param openid 点赞用户openid
* @return
*/
SysMessageNotice getMessageByPunchIdAndOpenId(@Param("punchId")Long punchId, @Param("openid")String openid);
/**
* 根据客户ID查询点赞消息列表
* @param cusId 客户ID
* @return
*/
List<Map<String,Object>> getPunchDynamicThumbsUpMessage(Long cusId);
/**
* 查询未读点赞数量
* @param cusId 客户ID
* @return
*/
int getUnReadThumbsUpMessageNum(Long cusId);
/**
* 根据消息类型客户ID消息关键词查询消息
*/
SysMessageNotice getMessageByCusIdAndTypeKey(SysMessageNotice sysMessageNotice);
/**
* 根据客户ID查询服务消息食谱发送消息执行反馈回复消息
* @return
*/
List<Map<String,Object>> getServiceMessage(Long cusId);
/**
* 根据客户ID查询未读服务消息数量
* @param cusId
* @return
*/
int getUnReadServiceMessageNum(Long cusId);
}

@ -32,4 +32,25 @@ public interface SysServicesTopicMapper {
* @return
*/
int getServicesTopicNum(@Param("cusId")Long cusId);
/**
* 根据topicId查询内容
* @param topicId
* @return
*/
String getTopicContentByTopicId(String topicId);
/**
* 根据评论ID查询评论内容
* @param commentId
* @return
*/
String getCommentContentByCommentId(String commentId);
/**
* 查询回复内容
* @param replyId
* @return
*/
String getReplyContentByReplyId(String replyId);
}

@ -2,9 +2,11 @@ package com.stdiet.custom.mapper;
import java.util.List;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.dto.response.CommunityPunchReponse;
import com.stdiet.custom.dto.response.CustomerListResponse;
import com.stdiet.custom.page.WxLogInfo;
/**
@ -115,4 +117,10 @@ public interface SysWxUserLogMapper
*/
int getPunchCustomerTotalNum();
/**
* 根据日期营养师助理售后查询指定日期未打卡的客户信息
* @return
*/
List<SysCustomer> selectNotPunchCustomerByDate(SysCustomer sysCustomer);
}

@ -1,10 +1,15 @@
package com.stdiet.custom.service;
import java.util.List;
import java.util.Map;
import com.stdiet.custom.domain.SysMessageNotice;
import com.stdiet.custom.domain.SysRecipesPlan;
import com.stdiet.custom.domain.SysServicesTopic;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
import com.stdiet.custom.dto.response.MessageNoticeResponse;
import org.apache.ibatis.annotations.Param;
/**
* 客户消息通知Service接口
@ -89,4 +94,45 @@ public interface ISysMessageNoticeService
* @param sysWxUserLog
*/
public void sendPunchCommentMessage(SysWxUserLog sysWxUserLog);
/**
* 发送打卡动态点赞消息
* @param sysWxUserLog
* @param openId 点赞用户openid
*/
public void sendpunchDynamicThumbsUpMessage(SysWxUserLog sysWxUserLog, String openId);
/**
* 发送食谱消息
* @param sysRecipesPlan
*/
public void sendRecipesPlanMessage(SysRecipesPlan sysRecipesPlan);
/**
* 发送执行反馈话题消息
* @param topic 话题对象
* @param type 类型 1评论 2回复
* @param originalContent 话题内容或被回复的内容
*/
public void sendTopicMessage(SysServicesTopic topic, int type, String originalContent);
/**
* 根据客户ID查询打卡点评消息以及未读消息数量包含点评营养师信息客户信息点评内容
* @param cusId 客户ID
* @return
*/
Map<String,Object> getPunchCommentMessageByCusId(Long cusId);
/**
* 根据客户ID查询点赞消息列表
* @param cusId 客户ID
* @return
*/
Map<String,Object> getPunchDynamicThumbsUpMessage(Long cusId);
/**
* 根据客户ID查询服务消息食谱发送消息执行反馈回复消息
* @return
*/
Map<String,Object> getServiceMessage(Long cusId);
}

@ -30,4 +30,11 @@ public interface ISysServicesTopicService {
* @return
*/
int getServicesTopicNum(Long cusId);
/**
* 根据topicId查询内容
* @param topicId
* @return
*/
String getTopicContentByTopicId(String topicId);
}

@ -2,6 +2,7 @@ package com.stdiet.custom.service;
import java.util.List;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.dto.response.CommunityPunchReponse;
@ -117,4 +118,10 @@ public interface ISysWxUserLogService
*/
int getPunchCustomerTotalNum();
/**
* 根据日期营养师助理售后查询指定日期未打卡的客户信息
* @return
*/
List<SysCustomer> selectNotPunchCustomerByDate(SysCustomer sysCustomer);
}

@ -1,11 +1,13 @@
package com.stdiet.custom.service.impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONArray;
import com.stdiet.common.utils.DateUtils;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.domain.*;
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
import com.stdiet.custom.dto.response.MessageNoticeResponse;
import com.stdiet.custom.service.ISysCustomerService;
@ -13,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.stdiet.custom.mapper.SysMessageNoticeMapper;
import com.stdiet.custom.domain.SysMessageNotice;
import com.stdiet.custom.service.ISysMessageNoticeService;
/**
@ -151,7 +152,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
@Override
@Async
public void sendPunchCommentMessage(SysWxUserLog sysWxUserLog){
if(sysWxUserLog == null || StringUtils.isEmpty(sysWxUserLog.getOpenid())){
if(sysWxUserLog == null || StringUtils.isEmpty(sysWxUserLog.getOpenid()) || sysWxUserLog.getId() == null){
return;
}
SysCustomer sysCustomer = sysCustomerService.getCustomerByOpenId(sysWxUserLog.getOpenid());
@ -161,9 +162,157 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
sysMessageNotice.setMessageType(MessageNoticeEnum.punchComment.getType());
sysMessageNotice.setReadType(0);
sysMessageNotice.setMessageCustomer(sysCustomer.getId());
sysMessageNotice.setMessageTitle(String.format(MessageNoticeEnum.punchComment.getTitleTemplate(), DateUtils.dateTime(sysWxUserLog.getLogTime())));
sysMessageNotice.setMessageTitle("");
sysMessageNotice.setMessageContent(sysWxUserLog.getComment());
sysMessageNotice.setMessageKey(sysWxUserLog.getId()+"");
sendMessageNoticeToCustomer(MessageNoticeEnum.punchComment, sysMessageNotice);
}
}
/**
* 发送打卡动态点赞消息
* @param sysWxUserLog
* @param openId 点赞用户openid
*/
@Override
@Async
public void sendpunchDynamicThumbsUpMessage(SysWxUserLog sysWxUserLog, String openId){
if(sysWxUserLog == null || StringUtils.isEmpty(sysWxUserLog.getOpenid()) || sysWxUserLog.getId() == null){
return;
}
//自己给自己点赞不发送消息
if(sysWxUserLog.getOpenid().equals(openId)){
return;
}
SysCustomer sysCustomer = sysCustomerService.getCustomerByOpenId(sysWxUserLog.getOpenid());
if(sysCustomer != null){
//根据openid打卡ID查询是否已经存在点赞消息
SysMessageNotice existSysMessageNotice = sysMessageNoticeMapper.getMessageByPunchIdAndOpenId(sysWxUserLog.getId(), openId);
if(existSysMessageNotice != null){
return;
}
SysMessageNotice sysMessageNotice = new SysMessageNotice();
sysMessageNotice.setMessageProperty(1);
sysMessageNotice.setMessageType(MessageNoticeEnum.punchDynamicThumbsUp.getType());
sysMessageNotice.setReadType(0);
sysMessageNotice.setMessageCustomer(sysCustomer.getId());
sysMessageNotice.setMessageTitle("");
sysMessageNotice.setMessageContent(openId);
sysMessageNotice.setMessageKey(sysWxUserLog.getId()+"");
sendMessageNoticeToCustomer(MessageNoticeEnum.punchDynamicThumbsUp, sysMessageNotice);
}
}
/**
* 发送执行反馈消息
*/
@Override
@Async
public void sendTopicMessage(SysServicesTopic topic, int type, String originalContent){
if(topic == null){
return;
}
Map<String,Object> content = new HashMap<>();
//回复内容
content.put("replyContent", topic.getContent());
//类型1 评论 2回复
content.put("type", type);
//topic的内容
content.put("originalContent", originalContent);
SysMessageNotice sysMessageNotice = new SysMessageNotice();
sysMessageNotice.setMessageProperty(1);
sysMessageNotice.setMessageType(MessageNoticeEnum.topicMessage.getType());
sysMessageNotice.setReadType(0);
sysMessageNotice.setMessageCustomer(Long.parseLong(topic.getToUid()));
sysMessageNotice.setMessageTitle("");
sysMessageNotice.setMessageContent(JSONArray.toJSONString(content));
sysMessageNotice.setMessageKey(topic.getTopicId());
sendMessageNoticeToCustomer(MessageNoticeEnum.topicMessage, sysMessageNotice);
}
/**
* 发送食谱更新消息
*/
@Override
@Async
public void sendRecipesPlanMessage(SysRecipesPlan sysRecipesPlan){
if(sysRecipesPlan == null || sysRecipesPlan.getCusId() == null || sysRecipesPlan.getRecipesId() == null){
return;
}
SysMessageNotice sysMessageNotice = new SysMessageNotice();
sysMessageNotice.setMessageType(MessageNoticeEnum.recipesPlanMessage.getType());
sysMessageNotice.setMessageKey(sysRecipesPlan.getRecipesId()+"");
sysMessageNotice.setMessageCustomer(sysRecipesPlan.getCusId());
//根据食谱ID查询是否已经发送过
SysMessageNotice existMessageNotice = sysMessageNoticeMapper.getMessageByCusIdAndTypeKey(sysMessageNotice);
if(existMessageNotice != null){
return;
}
sysMessageNotice.setMessageProperty(1);
sysMessageNotice.setReadType(0);
sysMessageNotice.setMessageTitle("");
Map<String,Object> content = new HashMap<>();
content.put("startNumDay", sysRecipesPlan.getStartNumDay());
content.put("endNumDay", sysRecipesPlan.getEndNumDay());
sysMessageNotice.setMessageContent(JSONArray.toJSONString(content));
sendMessageNoticeToCustomer(MessageNoticeEnum.recipesPlanMessage, sysMessageNotice);
}
/**
* 根据客户ID查询打卡点评消息以及未读消息数量包含点评营养师信息客户信息点评内容
* @param cusId 客户ID
* @return
*/
@Override
public Map<String,Object> getPunchCommentMessageByCusId(Long cusId){
List<Map<String,Object>> punchMessageList = sysMessageNoticeMapper.getPunchCommentMessageByCusId(cusId);
int unReadPunchMessageNum = 0;
if(punchMessageList != null && punchMessageList.size() > 0){
//查询未读消息
unReadPunchMessageNum = sysMessageNoticeMapper.getUnReadPunchMessageNum(cusId);
}
Map<String, Object> result = new HashMap<>();
result.put("data", punchMessageList);
result.put("unReadNum", unReadPunchMessageNum);
return result;
}
/**
* 根据客户ID查询点赞消息列表
* @param cusId 客户ID
* @return
*/
@Override
public Map<String,Object> getPunchDynamicThumbsUpMessage(Long cusId){
List<Map<String,Object>> thumbsUpMessageList = sysMessageNoticeMapper.getPunchDynamicThumbsUpMessage(cusId);
int unReadThumbsUpMessageNum = 0;
if(thumbsUpMessageList != null && thumbsUpMessageList.size() > 0){
//查询未读消息
unReadThumbsUpMessageNum = sysMessageNoticeMapper.getUnReadThumbsUpMessageNum(cusId);
}
Map<String, Object> result = new HashMap<>();
result.put("data", thumbsUpMessageList);
result.put("unReadNum", unReadThumbsUpMessageNum);
return result;
}
/**
* 根据客户ID查询服务消息食谱发送消息执行反馈回复消息
* @return
*/
@Override
public Map<String,Object> getServiceMessage(Long cusId){
List<Map<String,Object>> serviceMessageList = sysMessageNoticeMapper.getServiceMessage(cusId);
int unReadServiceMessageNum = 0;
if(serviceMessageList != null && serviceMessageList.size() > 0){
//查询未读消息
unReadServiceMessageNum = sysMessageNoticeMapper.getUnReadServiceMessageNum(cusId);
}
Map<String, Object> result = new HashMap<>();
result.put("data", serviceMessageList);
result.put("unReadNum", unReadServiceMessageNum);
return result;
}
}

@ -44,6 +44,8 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
private ISysCustomerService sysCustomerService;
@Autowired
private SysRecipesMapper sysRecipesMapper;
@Autowired
private ISysMessageNoticeService sysMessageNoticeService;
//2021-06-11之后大于等于成交的订单只生成定金单食谱计划不生成尾款食谱计划之前成交的订单还是保持之前逻辑
public static final LocalDate newVersionPlanStartDate = DateUtils.stringToLocalDate("2021-06-01", "yyyy-MM-dd");
@ -117,6 +119,10 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
sysRecipesPlan.setSmsSend(1);
}
}
//发送食谱消息
if(StringUtils.isNotNull(recipesPlan)) {
sysMessageNoticeService.sendRecipesPlanMessage(recipesPlan);
}
}
}

@ -10,6 +10,7 @@ import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.mapper.SysCustomerMapper;
import com.stdiet.custom.mapper.SysServicesTopicMapper;
import com.stdiet.custom.server.WebSocketServer;
import com.stdiet.custom.service.ISysMessageNoticeService;
import com.stdiet.custom.service.ISysServicesTopicService;
import com.stdiet.custom.service.ISysWxUserInfoService;
import com.stdiet.custom.utils.WsUtils;
@ -31,6 +32,9 @@ public class SysServicesTopicServiceImp implements ISysServicesTopicService {
@Autowired
ISysWxUserInfoService iSysWxUserInfoService;
@Autowired
ISysMessageNoticeService sysMessageNoticeService;
@Override
public List<SysServicesTopic> selectSysServicesTopicByUserIdAndRole(SysServicesTopic topic) {
return servicesTopicMapper.selectSysServicesTopicByUserIdAndRole(topic);
@ -145,6 +149,19 @@ public class SysServicesTopicServiceImp implements ISysServicesTopicService {
status.setRole(topic.getRole());
servicesTopicMapper.updateSysServicesTopicStatus(status);
//发送消息
if("customer".equals(topic.getToRole()) && StringUtils.isNotEmpty(topic.getToUid())){
String content = "";
if(StringUtils.isNotEmpty(topic.getReplyId()) ){
content = servicesTopicMapper.getReplyContentByReplyId(topic.getReplyId());
}else if(StringUtils.isNotEmpty(topic.getCommentId())){
content = servicesTopicMapper.getCommentContentByCommentId(topic.getReplyId());
}
if(StringUtils.isNotEmpty(content)){
sysMessageNoticeService.sendTopicMessage(topic, 2, content);
}
}
afterReply(topic);
}
return topic;
@ -164,6 +181,15 @@ public class SysServicesTopicServiceImp implements ISysServicesTopicService {
status.setRole(topic.getRole());
servicesTopicMapper.updateSysServicesTopicStatus(status);
//发送消息
if("customer".equals(topic.getToRole()) && StringUtils.isNotEmpty(topic.getToUid())){
//查询topic内容
String content = servicesTopicMapper.getTopicContentByTopicId(topic.getTopicId());
if(StringUtils.isNotEmpty(content)){
sysMessageNoticeService.sendTopicMessage(topic, 1, content);
}
}
afterReply(topic);
}
return topic;
@ -229,4 +255,13 @@ public class SysServicesTopicServiceImp implements ISysServicesTopicService {
public int getServicesTopicNum(Long cusId){
return servicesTopicMapper.getServicesTopicNum(cusId);
}
/**
* 根据topicId查询内容
* @param topicId
* @return
*/
public String getTopicContentByTopicId(String topicId){
return servicesTopicMapper.getTopicContentByTopicId(topicId);
}
}

@ -1,5 +1,6 @@
package com.stdiet.custom.service.impl;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.dto.response.CommunityPunchReponse;
import com.stdiet.custom.mapper.SysWxUserLogMapper;
@ -171,4 +172,14 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
return sysWxUserLogMapper.getPunchCustomerTotalNum();
}
/**
* 根据日期营养师助理售后查询指定日期未打卡的客户信息
*
* @return
*/
@Override
public List<SysCustomer> selectNotPunchCustomerByDate(SysCustomer sysCustomer) {
return sysWxUserLogMapper.selectNotPunchCustomerByDate(sysCustomer);
}
}

@ -202,9 +202,37 @@
where phone = #{phone} and del_flag = 0
</select>
<resultMap type="SysCustomer" id="SysCustomerResultExtended">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="phone" column="phone"/>
<result property="email" column="email"/>
<result property="address" column="address"/>
<result property="payDate" column="pay_date"/>
<result property="startDate" column="start_date"/>
<result property="fansTime" column="fans_time"/>
<result property="fansChannel" column="fans_channel"/>
<result property="purchaseNum" column="purchase_num"/>
<result property="payTotal" column="pay_total"/>
<result property="chargePerson" column="charge_person"/>
<result property="followStatus" column="follow_status"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="channelId" column="channel_id"/>
<result property="mainDietitian" column="main_dietitian"/>
<result property="assistantDietitian" column="assistant_dietitian"/>
<result property="afterDietitian" column="after_dietitian"/>
<result property="salesman" column="salesman"/>
<result property="onSaleId" column="on_sale_id" />
</resultMap>
<!-- 根据openId查询客户 -->
<select id="getCustomerByOpenId" parameterType="String" resultMap="SysCustomerResult">
select sc.id from sys_customer sc
<select id="getCustomerByOpenId" parameterType="String" resultMap="SysCustomerResultExtended">
select sc.id, sc.name, sc.phone, sc.main_dietitian, sc.assistant_dietitian, sc.after_dietitian, sc.salesman, sc.on_sale_id
from sys_customer sc
left join sys_wx_user_info wu on wu.phone = sc.phone
where wu.openid = #{openid} and sc.del_flag = 0 order by sc.id desc limit 1
</select>

@ -141,4 +141,77 @@
and smn.message_type = #{messageType}
</if>
</select>
<!-- 根据客户ID查询打卡点评消息包含点评营养师信息、客户信息、点评内容 -->
<select id="getPunchCommentMessageByCusId" parameterType="Long" resultType="Map">
select
message.id,message.message_type as messageType, message.message_content as content, message.read_type as readType,
DATE_FORMAT(message.create_time,'%Y-%m-%d %H:%i') as createTime, log.id as punchId, log.health_manifesto as healthManifesto,info.nick_name cusNickName,info.avatar_url as cusAvatar,diet.nick_name as dietNickName,diet.avatar as dietAvatar
from (
select id,message_customer,message_type,message_title,message_content,message_key,read_type,create_time from sys_message_notice
where del_flag = 0 and message_property = 1 and message_customer = #{cusId}
and message_type = 1
) message
left join sys_wx_user_log log on log.id = message.message_key and log.del_flag = 0
left join sys_wx_user_info info on info.openid = log.openid
left join sys_customer cus on cus.del_flag = 0 and cus.id = message.message_customer
left join sys_user diet on diet.user_id = cus.main_dietitian and diet.del_flag = 0 and diet.status = 0
order by message.id desc
</select>
<!-- 根据用户查询打卡点评的未读消息 -->
<select id="getUnReadPunchMessageNum" parameterType="Long" resultType="int">
select count(id) from sys_message_notice
where del_flag = 0 and message_property = 1
and message_type = 1 and read_type = 0 and message_customer = #{cusId}
</select>
<!-- 根据打卡ID、点赞openid查询点赞消息 -->
<select id="getMessageByPunchIdAndOpenId" resultMap="SysMessageNoticeResult">
select * from sys_message_notice where message_property = 1 and del_flag = 0 and message_type = 2
and message_key = #{punchId} and message_content = #{openid} order by id desc limit 1
</select>
<!-- 根据客户ID查询点赞消息 -->
<select id="getPunchDynamicThumbsUpMessage" parameterType="Long" resultType="Map">
select message.id,message.read_type as readType, message.message_type as messageType,DATE_FORMAT(message.create_time,'%Y-%m-%d %H:%i') as createTime, log.id as punchId, log.health_manifesto as healthManifesto,
thumbsUpUser.nick_name as thumbsUpUserNickName,thumbsUpUser.avatar_url as thumbsUpUserAvatar, punchUser.nick_name as cusNickName, punchUser.avatar_url as cusAvatarUrl
from
(
select id,message_customer,message_type,message_title,message_content,message_key,read_type,create_time from sys_message_notice
where del_flag = 0 and message_property = 1 and message_customer = #{cusId}
and message_type = 2
) message
left join sys_wx_user_info as thumbsUpUser on thumbsUpUser.openid = message.message_content
left join sys_wx_user_log as log on log.id = message.message_key and log.del_flag = 0
left join sys_wx_user_info as punchUser on punchUser.openid = log.openid
order by message.id desc
</select>
<!-- 查询点赞未读消息数量 -->
<select id="getUnReadThumbsUpMessageNum" parameterType="Long" resultType="int">
select count(id) from sys_message_notice
where del_flag = 0 and message_property = 1 and read_type = 0 and message_type = 2 and message_customer = #{cusId}
</select>
<!-- 查询消息是否存在 -->
<select id="getMessageByCusIdAndTypeKey" parameterType="SysMessageNotice" resultMap="SysMessageNoticeResult">
select * from sys_message_notice where del_flag = 0 and message_customer = #{messageCustomer}
and message_type = #{messageType} and message_key= #{messageKey} order by id desc limit 1
</select>
<!-- 查询服务消息(包含食谱更新消息、意见反馈回复消息) -->
<select id="getServiceMessage" parameterType="Long" resultType="Map">
select id, message_content as content, message_key as messageKey,
read_type as readType, message_type as messageType, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i') as createTime from sys_message_notice
where del_flag = 0 and message_property = 1 and message_customer = #{cusId}
and (message_type = 3 or message_type = 4)
order by id desc
</select>
<!-- 查询未读服务消息数量 -->
<select id="getUnReadServiceMessageNum" parameterType="Long" resultType="int">
select count(id) from sys_message_notice
where del_flag = 0 and message_property = 1 and read_type = 0 and (message_type = 3 || message_type = 4) and message_customer = #{cusId}
</select>
</mapper>

@ -10,6 +10,7 @@
<result property="planId" column="plan_id"/>
<result property="nutritionistId" column="nutritionist_id"/>
<result property="nutriAssisId" column="nutri_assis_id"/>
<result property="keyWord" column="key_word" />
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
@ -23,7 +24,7 @@
</resultMap>
<select id="selectRecipesTemplateListByCondition" parameterType="SysRecipesTemplate" resultMap="SysRecipesTemplateResult">
select srt.id, srt.name, srt.nutritionist_id, srt.nutri_assis_id, srt.remark, srt.update_time,
select srt.id, srt.name, srt.nutritionist_id, srt.nutri_assis_id, srt.key_word, srt.remark, srt.update_time,
srt.create_time, srt.update_by, srt.create_by, srt.plan_id, srp.recipes_id, srp.review_status,
su_nutritionist.nick_name as nutritionist, su_nutritionist_assis.nick_name as nutritionist_assis
from sys_recipes_template srt
@ -31,19 +32,31 @@
left join sys_user su_nutritionist on su_nutritionist.user_id = srt.nutritionist_id and su_nutritionist.del_flag = 0
left join sys_user su_nutritionist_assis on su_nutritionist_assis.user_id = srt.nutri_assis_id and su_nutritionist_assis.del_flag = 0
where srt.del_flag = 0
<if test="keys != null">and
<if test="keys != null and keys.length > 0">and
<foreach collection="keys" item="key" separator="and" open="(" close=")">
srt.name like concat('%', #{key}, '%') or srt.remark like concat('%', #{key}, '%')
(
srt.name like concat('%', #{key}, '%') or srt.remark like concat('%', #{key}, '%')
or FIND_IN_SET(#{key}, srt.key_word)
)
</foreach>
</if>
<if test="nutriAssisId != null ">and srt.nutri_assis_id = #{nutriAssisId}</if>
<if test="nutritionistId != null ">and srt.nutritionist_id = #{nutritionistId}</if>
<if test="reviewStatus != null ">and srp.review_status = #{reviewStatus}</if>
order by srt.id desc
order by
<if test="keys != null and keys.length > 0">
FIND_IN_SET(srt.id, (
SELECT group_concat(t.id Separator ',') from sys_recipes_template t WHERE
<foreach collection="keys" item="key" separator="and" open="(" close=")">
FIND_IN_SET(#{key}, srt.key_word)
</foreach>
)) desc,
</if>
srt.id desc
</select>
<select id="getRecipesTemplateById" parameterType="Long" resultType="SysRecipesTemplate">
select srt.id, srt.name, srt.nutritionist_id as nutritionistId, srt.nutri_assis_id as nutriAssisId, srt.remark, srt.update_time as updateTime,
select srt.id, srt.name, srt.nutritionist_id as nutritionistId, srt.nutri_assis_id as nutriAssisId, srt.key_word, srt.remark, srt.update_time as updateTime,
srt.create_time as createTime, srt.update_by as updateBy, srt.create_by as createBy, srt.plan_id as planId,
su_nutritionist.nick_name as nutritionist, su_nutritionist_assis.nick_name as nutriAssis
from sys_recipes_template srt
@ -59,6 +72,7 @@
<if test="planId != null">plan_id,</if>
<if test="nutriAssisId != null">nutri_assis_id,</if>
<if test="nutritionistId != null">nutritionist_id,</if>
<if test="keyWord != null">key_word,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
@ -70,6 +84,7 @@
<if test="planId != null">#{planId},</if>
<if test="nutriAssisId != null">#{nutriAssisId},</if>
<if test="nutritionistId != null">#{nutritionistId},</if>
<if test="keyWord != null">#{keyWord},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
@ -84,6 +99,7 @@
<if test="name != null">name = #{name},</if>
<if test="nutriAssisId != null">nutri_assis_id = #{nutriAssisId},</if>
<if test="nutritionistId != null">nutritionist_id = #{nutritionistId},</if>
<if test="keyWord != null">key_word = #{keyWord},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>

@ -325,4 +325,19 @@
<select id="getServicesTopicNum" parameterType="Long" resultType="int">
select count(1) from sys_services_topic where del_flag = 0 and uid = #{cusId}
</select>
<!-- 根据topicId查询内容 -->
<select id="getTopicContentByTopicId" resultType="String" parameterType="String">
select content from sys_services_topic where topic_id = #{topicId} limit 1
</select>
<!-- 根据CommentId查询评论内容 -->
<select id="getCommentContentByCommentId" resultType="String" parameterType="String">
select content from sys_services_topic_comment where id = #{commentId} limit 1
</select>
<!-- 根据replyId查询回复内容 -->
<select id="getReplyContentByReplyId" resultType="String" parameterType="String">
select content from sys_services_topic_reply where id = #{replyId} limit 1
</select>
</mapper>

@ -465,5 +465,35 @@
select count(wxlog.openid) from sys_wx_user_log wxlog where wxlog.del_flag = 0 and to_days(log_time) = to_days(now())
</select>
<!-- 根据日期查询该日期中未打卡客户(根据食谱计划判断今日是否需要打卡) -->
<select id="selectNotPunchCustomerByDate" parameterType="SysCustomer" resultType="SysCustomer">
select plan.cus_id as id, cus.name, cus.main_dietitian as mainDietitian, cus.assistant_dietitian as assistantDietitian,cus.after_dietitian as afterDietitian from
(
select DISTINCT cus_id from sys_recipes_plan where end_date >= DATE_FORMAT(#{startDate},'%Y-%m-%d') and DATE_FORMAT(#{startDate},'%Y-%m-%d') >= start_date and del_flag = 0 and instr(pause_date, DATE_FORMAT(#{startDate},'%Y%m%d')) = 0
) as plan
left join sys_customer cus on cus.id = plan.cus_id and cus.del_flag = 0
where plan.cus_id not in
(
select info.cus_id from sys_wx_user_log log left join sys_wx_user_info info on info.openid = log.openid
where log.del_flag = 0 and DATE_FORMAT(log.log_time,'%Y-%m-%d') = DATE_FORMAT(#{startDate},'%Y-%m-%d')
)
<if test="mainDietitian != null">
and cus.main_dietitian = #{mainDietitian}
</if>
<if test="assistantDietitian != null">
and cus.assistant_dietitian = #{assistantDietitian}
</if>
<if test="afterDietitian != null">
and cus.after_dietitian = #{afterDietitian}
</if>
order by plan.cus_id desc
</select>
</mapper>

@ -79,6 +79,17 @@ export function commentPunchContent(data) {
})
}
// 查询未打卡用户列表
export function getNotPunchCustomer(query) {
return request({
url: '/custom/wxUserLog/selectNotPunchCustomerByDate',
method: 'get',
params: query
})
}

@ -0,0 +1,208 @@
<template>
<!-- -->
<!-- 查询未打卡客户信息 -->
<el-dialog :title="title" :visible.sync="open" width="1050px" :close-on-click-modal="false" append-to-body @closed="cancel">
<!--<div style="margin-bottom: 20px;color:red"></div>-->
<el-form :model="queryParams" ref="queryForm" :inline="true" >
<el-form-item label="打卡日期" prop="startDate" >
<el-date-picker
v-model="queryParams.startDate"
align="right"
type="date"
placeholder="选择打卡日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="营养师" prop="mainDietitian" >
<el-select
v-model="queryParams.mainDietitian"
placeholder="请选择销售"
clearable
filterable
size="small"
>
<el-option
v-for="dict in nutritionistIdOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
/>
</el-select>
</el-form-item>
<!--<el-form-item label="营养师助理" prop="assistantDietitian" label-width="50px">
<el-select
v-model="queryParams.assistantDietitian"
placeholder="请选择销售"
clearable
filterable
size="small"
>
<el-option
v-for="dict in nutriAssisIdOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
/>
</el-select>
</el-form-item>-->
<el-form-item label="售后" prop="afterDietitian" >
<el-select
v-model="queryParams.afterDietitian"
placeholder="请选择销售"
clearable
filterable
size="small"
>
<el-option
v-for="dict in afterSaleIdOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<div style="height: 550px; overflow: auto">
<el-table v-loading="loading" :data="notPunchCustomerList">
<el-table-column label="客户姓名" align="center" prop="name" />
<el-table-column label="营养师" align="center" prop="mainDietitian" :formatter="nutritionistFormat"/>
<el-table-column label="售后营养师" align="center" prop="afterDietitian" :formatter="afterDietitianFormat"/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getNotLunchCustomer"
/>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { getNotPunchCustomer } from "@/api/custom/wxUserLog";
import { mapGetters } from "vuex";
import dayjs from "dayjs";
const nowTime = dayjs().format("YYYY-MM-DD");
export default {
name: "NotPunchCustomer",
components: {
},
data() {
return {
//
loading: true,
//
title: "",
//
open: false,
total: 0,
//
rules: {
},
queryParams:{
startDate: nowTime,
mainDietitian: null,
assistantDietitian: null,
afterDietitian: null,
pageNum: 1,
pageSize: 10
},
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
},
notPunchCustomerList: [],
nutritionistIdOptions: [],
afterSaleIdOptions: []
};
},
created(){
},
computed: {
...mapGetters([
//
//"preSaleIdOptions"
]),
},
methods: {
showDialog(queryParams, nutritionistIdOptions, afterSaleIdOptions) {
this.nutritionistIdOptions = nutritionistIdOptions != null ? nutritionistIdOptions.slice(1) : [];
this.afterSaleIdOptions = afterSaleIdOptions != null ? afterSaleIdOptions.slice(1) : [];
this.queryParams.startDate = queryParams.startDate != null ? queryParams.startDate : nowTime;
this.queryParams.mainDietitian = queryParams.nutritionistId != null ? queryParams.nutritionistId : null;
this.queryParams.afterDietitian = queryParams.afterNutritionistId != null ? queryParams.afterNutritionistId : null;
this.title = "未打卡用户列表";
this.reset();
this.getNotLunchCustomer();
this.open = true;
},
reset(){
},
/** 提交按钮 */
submitForm() {
},
onClosed() {
this.reset();
},
cancel(){
this.open = false;
this.reset();
},
//
getNotLunchCustomer() {
getNotPunchCustomer(this.queryParams).then((response) => {
/*response.data.forEach((item,index) => {
item.liveRoomName = item.liveNutritionistName + " " + item.liveRoomName;
});*/
this.notPunchCustomerList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleQuery(){
this.getNotLunchCustomer();
},
resetQuery(){
this.queryParams = {
startDate: nowTime,
mainDietitian: null,
assistantDietitian: null,
afterDietitian: null
};
},
//
nutritionistFormat(row, column) {
return this.selectDictLabel(this.nutritionistIdOptions, row.mainDietitian);
},
//
nutriAssisFormat(row, column) {
return this.selectDictLabel(this.nutriAssisIdOptions, row.assistantDietitian);
},
//
afterDietitianFormat(row, column) {
return this.selectDictLabel(this.afterSaleIdOptions, row.afterDietitian);
},
}
};
</script>
<style lang="scss" scoped>
</style>

@ -29,6 +29,27 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="关键词" prop="keyWordArray" label-width="100px">
<el-select
v-model="form.keyWordArray"
multiple
filterable
clearable
allow-create
default-first-option
placeholder="请创建模板关键词,用于模板检索,按回车创建"
style="width:100%"
>
<el-option
v-for="dict in keyOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark" label-width="100px">
<el-input
v-model="form.remark"
@ -58,6 +79,8 @@ export default {
nutriAssisId: null,
nutritionistId: null,
remark: null,
keyWordArray: null,
keyWord: null
},
//
rules: {
@ -70,6 +93,16 @@ export default {
],
},
visible: false,
keyOptions:[
{
dictLabel: "1-7",
dictValue: "1-7"
},
{
dictLabel: "高血压",
dictValue: "高血压"
}
]
};
},
computed: {
@ -87,6 +120,7 @@ export default {
this.reset();
if (data) {
this.title = "修改模板";
data.keyWordArray = (data.keyWord != null && data.keyWord != "") ? data.keyWord.split(",") : null;
this.form = data;
} else {
this.title = "创建模板";
@ -94,7 +128,9 @@ export default {
},
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (valid && this.checkFormat(this.form.keyWordArray)) {
this.form.keyWord = (this.form.keyWordArray != null && this.form.keyWordArray.length > 0) ? this.form.keyWordArray.join(",") : null;
this.form.keyWord = this.form.keyWord.replace("",",");
this.$emit("onConfirm", this.form);
this.visible = false;
}
@ -108,12 +144,30 @@ export default {
nutriAssisId: null,
nutritionistId: null,
remark: null,
keyWordArray: null,
keyWord: null
};
this.resetForm("form");
},
cancel() {
this.visible = false;
},
checkFormat(keyWordArray){
let flag = true;
let msg = "";
if(keyWordArray != null && keyWordArray.length > 0){
keyWordArray.forEach((item,index) => {
if(item.indexOf(",") != -1 || item.indexOf("") != -1 || item.indexOf(" ") != -1){
msg = "关键词中不能含有逗号和空格";
flag = false;
}
});
}
if(!flag){
this.msgError(msg);
}
return flag;
}
},
};
</script>

@ -8,11 +8,22 @@
<!-- 筛选 -->
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="搜索内容" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入模板名称或备注"
@keyup.enter.native="handleQuery"
/>
<el-select
v-model="queryParams.keys"
multiple
filterable
allow-create
clearable
default-first-option
@keyup.enter.native="handleQuery"
placeholder="请输入或选择关键字">
<!--<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>-->
</el-select>
</el-form-item>
<el-form-item label="营养师" prop="nutritionistId">
<el-select
@ -67,7 +78,16 @@
<el-table-column label="模板名称" align="center" prop="name" />
<el-table-column label="营养师" align="center" prop="nutritionist" />
<el-table-column label="营养师助理" align="center" prop="nutriAssis" />
<el-table-column label="备注" prop="remark" align="center" />
<el-table-column label="关键词" align="center" prop="keyWord">
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.keyWord" :maxLength="20"></AutoHideMessage>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" align="center" >
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.remark" :maxLength="20"></AutoHideMessage>
</template>
</el-table-column>
</el-table>
<pagination
@ -83,6 +103,7 @@
<script>
import { listRecipesTemplate } from "@/api/custom/recipesTemplate";
import { mapState } from "vuex";
import AutoHideMessage from "@/components/AutoHideMessage";
export default {
name: "TemplateView",
data() {
@ -97,9 +118,13 @@ export default {
pageNum: 1,
pageSize: 10,
reviewStatus: 2,
keys: null
},
};
},
components:{
AutoHideMessage
},
props: ["view"],
computed: {
...mapState({
@ -119,6 +144,7 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keys = null;
this.handleQuery();
},
handleOnBackClick() {
@ -132,7 +158,7 @@ export default {
getList() {
this.loading = true;
const params = JSON.parse(JSON.stringify(this.queryParams));
params.keys = (params.name || "").split(" ");
//params.keys = (params.name || "").split(" ");
listRecipesTemplate(params).then((res) => {
if (res.code === 200) {
this.dataList = res.rows;

@ -7,11 +7,28 @@
v-show="showSearch"
>
<el-form-item label="搜索内容" prop="name">
<el-input
<!--<el-input
clearable
v-model="queryParams.name"
placeholder="请输入模板名称或备注"
@keyup.enter.native="handleQuery"
/>
/>-->
<el-select
v-model="queryParams.keys"
multiple
filterable
allow-create
clearable
default-first-option
@keyup.enter.native="handleQuery"
placeholder="请输入或选择关键字">
<!--<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>-->
</el-select>
</el-form-item>
<el-form-item label="营养师" prop="nutritionistId">
<el-select
@ -116,13 +133,30 @@
prop="nutriAssisId"
:formatter="nutriAssisIdFormat"
/>
<el-table-column
label="关键词"
align="center"
width="200"
prop="kwyWordArray"
>
<!--<template slot-scope="scope">
<AutoHideInfo :data="scope.row.keyWordArray" :line="2"> </AutoHideInfo>
</template>-->
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.keyWord" :maxLength="20"></AutoHideMessage>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" align="center" >
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.remark" :maxLength="20"></AutoHideMessage>
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
width="180"
prop="createTime"
/>
<el-table-column label="备注" prop="remark" align="center" />
<el-table-column
label="操作"
align="center"
@ -181,6 +215,8 @@ import {
deleteRecipesTemplate,
} from "@/api/custom/recipesTemplate";
import TemplateDialog from "@/components/TemplateDialog";
import AutoHideInfo from "@/components/AutoHideInfo";
import AutoHideMessage from "@/components/AutoHideMessage";
import { mapGetters, mapState } from "vuex";
export default {
@ -210,6 +246,7 @@ export default {
nutritionistId: null,
nutriAssisId: null,
reviewStatus: null,
keys: null
},
open: false,
title: "",
@ -231,6 +268,8 @@ export default {
},
components: {
TemplateDialog,
AutoHideInfo,
AutoHideMessage
// "order-dialog": OrderDetail,
// body_sign_dialog: BodySignDetail,
},
@ -270,8 +309,11 @@ export default {
getList() {
this.loading = true;
const params = JSON.parse(JSON.stringify(this.queryParams));
params.keys = params.name ? params.name.split(" ") : null;
//params.keys = params.name ? params.name.split(" ") : null;
listRecipesTemplate(params).then((response) => {
response.rows.forEach((item,index) => {
item.keyWordArray = (item.keyWord != null && item.keyWord != "") ? item.keyWord.split(",") : [];
});
this.recipesTemplateList = response.rows;
this.total = response.total;
this.loading = false;
@ -289,6 +331,7 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keys = null;
this.handleQuery();
},
getReviewStatusName(status) {

@ -81,16 +81,15 @@
</el-form>
<el-row :gutter="10" class="mb8">
<!--<el-col :span="1.5">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
icon="el-icon-s-flag"
size="mini"
@click="handleAdd"
v-hasPermi="['custom:wxUserLog:add']"
>新增
@click="showNotLunch()"
>未打卡客户列表
</el-button>
</el-col>-->
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
@ -298,6 +297,8 @@
<PunchLogEdit ref="punchLogEditRef"></PunchLogEdit>
<!-- 详情 -->
<PunchLogDetail ref="punchLogDetailRef"></PunchLogDetail>
<!-- 未打卡用户 -->
<NotPunchCustomer ref="notPunchCustomerRef"></NotPunchCustomer>
</div>
</template>
@ -314,6 +315,7 @@ import { mapGetters } from "vuex";
import PunchLogDetail from "@/components/PunchLog/PunchLogDetail";
import PunchLogEdit from "@/components/PunchLog/PunchLogEdit";
import AutoHideMessage from "@/components/AutoHideMessage";
import NotPunchCustomer from "@/components/PunchLog/NotPunchCustomer"
import dayjs from "dayjs";
export default {
name: "WxUserLog",
@ -369,7 +371,7 @@ export default {
};
},
components:{
PunchLogDetail,AutoHideMessage,PunchLogEdit
PunchLogDetail,AutoHideMessage,PunchLogEdit,NotPunchCustomer
},
created() {
this.getList();
@ -563,6 +565,10 @@ export default {
})
.catch(function () {});
},
showNotLunch(){
this.queryParams.startDate = this.logTimeScope && this.logTimeScope.length > 0 ? this.logTimeScope[0] : null;
this.$refs.notPunchCustomerRef.showDialog(this.queryParams, this.nutritionistIdOptions,this.afterSaleIdOptions);
}
},
};
</script>