Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
@ -2,6 +2,8 @@ package com.stdiet.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
@ -102,4 +104,10 @@ public class SysCustomer extends BaseEntity
|
||||
|
||||
private String[] channels;
|
||||
|
||||
//病史体征ID集合,非持久化字段
|
||||
private List<Long> signIdList;
|
||||
|
||||
//病史体征ID
|
||||
private String physicalSignsId;
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户消息通知对象 sys_message_notice
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-04-26
|
||||
*/
|
||||
@Data
|
||||
public class SysMessageNotice extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 消息属性,0 公共消息 1 私有消息 */
|
||||
@Excel(name = "消息属性,0 公共消息 1 私有消息")
|
||||
private Integer messageProperty;
|
||||
|
||||
/** 消息对应客户ID (公共消息时该字段为0) */
|
||||
@Excel(name = "消息对应客户ID (公共消息时该字段为0)")
|
||||
private Long messageCustomer;
|
||||
|
||||
//用户加密ID,非持久化字段
|
||||
private String customerId;
|
||||
|
||||
/** 消息类型 */
|
||||
@Excel(name = "消息类型")
|
||||
private Integer messageType;
|
||||
|
||||
/** 消息标题 */
|
||||
@Excel(name = "消息标题")
|
||||
private String messageTitle;
|
||||
|
||||
/** 消息内容 */
|
||||
@Excel(name = "消息内容")
|
||||
private String messageContent;
|
||||
|
||||
/** 是否已读 0未读 1已读 */
|
||||
@Excel(name = "是否已读 0未读 1已读")
|
||||
private Integer readType;
|
||||
|
||||
/** 当前消息对应关键参数,多个参数可保存json字符串 */
|
||||
@Excel(name = "当前消息对应关键参数,多个参数可保存json字符串")
|
||||
private String messageKey;
|
||||
|
||||
/** 删除标识 0未删除 1已删除 */
|
||||
private Integer delFlag;
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 营养视频对象 sys_nutritional_video
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-04-29
|
||||
*/
|
||||
@Data
|
||||
public class SysNutritionalVideo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 视频分类ID */
|
||||
@Excel(name = "视频分类ID")
|
||||
private Long cateId;
|
||||
|
||||
/** 阿里云视频ID */
|
||||
@Excel(name = "阿里云视频ID")
|
||||
private String videoId;
|
||||
|
||||
/** 视频封面URL */
|
||||
@Excel(name = "视频封面URL")
|
||||
private String coverUrl;
|
||||
|
||||
/** 视频标题 */
|
||||
@Excel(name = "视频标题")
|
||||
private String title;
|
||||
|
||||
/** 视频描述 */
|
||||
@Excel(name = "视频描述")
|
||||
private String description;
|
||||
|
||||
/** 视频大小,单位:字节 */
|
||||
@Excel(name = "视频大小,单位:字节")
|
||||
private Long videoSize;
|
||||
|
||||
/** 标签,使用 , 隔开 */
|
||||
@Excel(name = "标签,使用 , 隔开")
|
||||
private String tags;
|
||||
|
||||
/** 是否显示,0不显示 1显示,默认0 */
|
||||
@Excel(name = "是否显示,0不显示 1显示,默认0")
|
||||
private Integer showFlag;
|
||||
|
||||
/** 删除标识,0未删除 1已删除,默认0 */
|
||||
private Integer delFlag;
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.stdiet.custom.domain.entityEnum;
|
||||
|
||||
public enum MessageNoticeEnum{
|
||||
|
||||
systemMessage("系统通知", 0, 0, "系统通知"),
|
||||
punchComment("打卡点评", 1, 1, "%s打卡点评"); //%s 为打卡时间
|
||||
|
||||
|
||||
//消息名称
|
||||
private String name;
|
||||
|
||||
//消息属性 0公共 1私有
|
||||
private Integer property;
|
||||
|
||||
//消息类型
|
||||
private Integer type;
|
||||
|
||||
//消息标题模板
|
||||
private String titleTemplate;
|
||||
|
||||
MessageNoticeEnum(String name, Integer property, Integer type, String titleTemplate){
|
||||
this.name = name;
|
||||
this.property = property;
|
||||
this.type = type;
|
||||
this.titleTemplate = titleTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据type类型获取枚举对象
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static MessageNoticeEnum getNoticeEnumByType(Integer type){
|
||||
for (MessageNoticeEnum messageEnum : MessageNoticeEnum.values()) {
|
||||
if(messageEnum.getType().intValue() == type.intValue()){
|
||||
return messageEnum;
|
||||
}
|
||||
}
|
||||
return systemMessage;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
public void setProperty(Integer property) {
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
public String getTitleTemplate() {
|
||||
return titleTemplate;
|
||||
}
|
||||
|
||||
public void setTitleTemplate(String titleTemplate) {
|
||||
this.titleTemplate = titleTemplate;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.stdiet.custom.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class MessageNoticeResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/** 消息属性,0 公共消息 1 私有消息 */
|
||||
private Integer messageProperty;
|
||||
|
||||
/** 消息对应客户ID (公共消息时该字段为0) */
|
||||
private Long messageCustomer;
|
||||
|
||||
/** 消息类型 */
|
||||
private Integer messageType;
|
||||
|
||||
//消息类型名称
|
||||
private String messageTypeName;
|
||||
|
||||
/** 消息标题 */
|
||||
private String messageTitle;
|
||||
|
||||
/** 消息内容 */
|
||||
private String messageContent;
|
||||
|
||||
/** 是否已读 0未读 1已读 */
|
||||
private Integer readType;
|
||||
|
||||
/** 当前消息对应关键参数,多个参数可保存json字符串 */
|
||||
private String messageKey;
|
||||
|
||||
/** 创建时间 **/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private Date createTime;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.stdiet.custom.dto.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class NutritionalVideoResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//分类ID
|
||||
public Long cateId;
|
||||
|
||||
//分类名称
|
||||
public String cateName;
|
||||
|
||||
//标题
|
||||
public String title;
|
||||
|
||||
//标签
|
||||
public String tags;
|
||||
|
||||
//视频ID
|
||||
public String videoId;
|
||||
|
||||
//封面URL
|
||||
public String coverURL;
|
||||
|
||||
//视频描述
|
||||
public String description;
|
||||
|
||||
//播放链接
|
||||
public String playUrl;
|
||||
|
||||
|
||||
public String createTime;
|
||||
|
||||
}
|
@ -67,4 +67,11 @@ public interface SysCustomerMapper
|
||||
* @return 结果
|
||||
*/
|
||||
SysCustomer getCustomerByPhone(@Param("phone")String phone);
|
||||
|
||||
/**
|
||||
* 根据openid查询客户信息
|
||||
* @param openid
|
||||
* @return
|
||||
*/
|
||||
SysCustomer getCustomerByOpenId(@Param("openid")String openid);
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.stdiet.custom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysMessageNotice;
|
||||
import com.stdiet.custom.dto.response.MessageNoticeResponse;
|
||||
|
||||
/**
|
||||
* 客户消息通知Mapper接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-04-26
|
||||
*/
|
||||
public interface SysMessageNoticeMapper
|
||||
{
|
||||
/**
|
||||
* 查询客户消息通知
|
||||
*
|
||||
* @param id 客户消息通知ID
|
||||
* @return 客户消息通知
|
||||
*/
|
||||
public SysMessageNotice selectSysMessageNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询客户消息通知列表
|
||||
*
|
||||
* @param sysMessageNotice 客户消息通知
|
||||
* @return 客户消息通知集合
|
||||
*/
|
||||
public List<SysMessageNotice> selectSysMessageNoticeList(SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 新增客户消息通知
|
||||
*
|
||||
* @param sysMessageNotice 客户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysMessageNotice(SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 修改客户消息通知
|
||||
*
|
||||
* @param sysMessageNotice 客户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysMessageNotice(SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 删除客户消息通知
|
||||
*
|
||||
* @param id 客户消息通知ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysMessageNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除客户消息通知
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysMessageNoticeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据客户ID查询客户信息(包含私有信息以及公共消息)
|
||||
* @param sysMessageNotice
|
||||
* @return
|
||||
*/
|
||||
public List<MessageNoticeResponse> getCustomerMessage(SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 根据客户ID查询客户消息数量
|
||||
* @param sysMessageNotice
|
||||
* @return
|
||||
*/
|
||||
public int getCustomerMessageCount(SysMessageNotice sysMessageNotice);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.stdiet.custom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysNutritionalVideo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 营养视频Mapper接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-04-29
|
||||
*/
|
||||
public interface SysNutritionalVideoMapper
|
||||
{
|
||||
/**
|
||||
* 查询营养视频
|
||||
*
|
||||
* @param id 营养视频ID
|
||||
* @return 营养视频
|
||||
*/
|
||||
public SysNutritionalVideo selectSysNutritionalVideoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询营养视频列表
|
||||
*
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 营养视频集合
|
||||
*/
|
||||
public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo);
|
||||
|
||||
/**
|
||||
* 新增营养视频
|
||||
*
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysNutritionalVideo(SysNutritionalVideo sysNutritionalVideo);
|
||||
|
||||
/**
|
||||
* 修改营养视频
|
||||
*
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysNutritionalVideo(SysNutritionalVideo sysNutritionalVideo);
|
||||
|
||||
/**
|
||||
* 删除营养视频
|
||||
*
|
||||
* @param id 营养视频ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysNutritionalVideoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除营养视频
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysNutritionalVideoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取视频
|
||||
* @param videoId
|
||||
* @return
|
||||
*/
|
||||
public SysNutritionalVideo selectSysNutritionalVideByVideoId(@Param("videoId")String videoId);
|
||||
}
|
@ -2,6 +2,7 @@ package com.stdiet.custom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysPhysicalSigns;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 体征Mapper接口
|
||||
@ -58,4 +59,11 @@ public interface SysPhysicalSignsMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysPhysicalSignsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据名称查询体征ID集合
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
List<Long> getSignIdByName(@Param("name") String name);
|
||||
}
|
@ -81,4 +81,11 @@ public interface ISysCustomerService
|
||||
|
||||
Map<String,Object> getPhysicalSignsByOutId(String id);
|
||||
|
||||
/**
|
||||
* 根据openid查询客户信息
|
||||
* @param openid
|
||||
* @return
|
||||
*/
|
||||
SysCustomer getCustomerByOpenId(String openid);
|
||||
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysMessageNotice;
|
||||
import com.stdiet.custom.domain.SysWxUserLog;
|
||||
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
|
||||
import com.stdiet.custom.dto.response.MessageNoticeResponse;
|
||||
|
||||
/**
|
||||
* 客户消息通知Service接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-04-26
|
||||
*/
|
||||
public interface ISysMessageNoticeService
|
||||
{
|
||||
/**
|
||||
* 查询客户消息通知
|
||||
*
|
||||
* @param id 客户消息通知ID
|
||||
* @return 客户消息通知
|
||||
*/
|
||||
public SysMessageNotice selectSysMessageNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询客户消息通知列表
|
||||
*
|
||||
* @param sysMessageNotice 客户消息通知
|
||||
* @return 客户消息通知集合
|
||||
*/
|
||||
public List<SysMessageNotice> selectSysMessageNoticeList(SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 新增客户消息通知
|
||||
*
|
||||
* @param sysMessageNotice 客户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysMessageNotice(SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 修改客户消息通知
|
||||
*
|
||||
* @param sysMessageNotice 客户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysMessageNotice(SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 批量删除客户消息通知
|
||||
*
|
||||
* @param ids 需要删除的客户消息通知ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysMessageNoticeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除客户消息通知信息
|
||||
*
|
||||
* @param id 客户消息通知ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysMessageNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 根据客户ID查询客户信息(包含私有信息以及公共消息)
|
||||
* @param sysMessageNotice
|
||||
* @return
|
||||
*/
|
||||
public List<MessageNoticeResponse> getCustomerMessage(SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 消息发送
|
||||
* @param messageNoticeEnum
|
||||
* @param sysMessageNotice
|
||||
* @return
|
||||
*/
|
||||
public int sendMessageNoticeToCustomer(MessageNoticeEnum messageNoticeEnum, SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 根据客户ID查询客户消息数量
|
||||
* @param sysMessageNotice
|
||||
* @return
|
||||
*/
|
||||
public int getCustomerMessageCount(SysMessageNotice sysMessageNotice);
|
||||
|
||||
/**
|
||||
* 发送打卡点评消息
|
||||
* @param sysWxUserLog
|
||||
*/
|
||||
public void sendPunchCommentMessage(SysWxUserLog sysWxUserLog);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysNutritionalVideo;
|
||||
|
||||
/**
|
||||
* 营养视频Service接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-04-29
|
||||
*/
|
||||
public interface ISysNutritionalVideoService
|
||||
{
|
||||
/**
|
||||
* 查询营养视频
|
||||
*
|
||||
* @param id 营养视频ID
|
||||
* @return 营养视频
|
||||
*/
|
||||
public SysNutritionalVideo selectSysNutritionalVideoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询营养视频列表
|
||||
*
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 营养视频集合
|
||||
*/
|
||||
public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo);
|
||||
|
||||
/**
|
||||
* 新增营养视频
|
||||
*
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysNutritionalVideo(SysNutritionalVideo sysNutritionalVideo);
|
||||
|
||||
/**
|
||||
* 修改营养视频
|
||||
*
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysNutritionalVideo(SysNutritionalVideo sysNutritionalVideo);
|
||||
|
||||
/**
|
||||
* 批量删除营养视频
|
||||
*
|
||||
* @param ids 需要删除的营养视频ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysNutritionalVideoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除营养视频信息
|
||||
*
|
||||
* @param id 营养视频ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysNutritionalVideoById(Long id);
|
||||
|
||||
/**
|
||||
* 获取视频
|
||||
* @param videoId
|
||||
* @return
|
||||
*/
|
||||
public SysNutritionalVideo selectSysNutritionalVideByVideoId(String videoId);
|
||||
}
|
@ -58,4 +58,11 @@ public interface ISysPhysicalSignsService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysPhysicalSignsById(Long id);
|
||||
|
||||
/**
|
||||
* 根据名称查询体征ID集合
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
List<Long> getSignIdByName(String name);
|
||||
}
|
@ -168,4 +168,13 @@ public class SysCustomerServiceImpl implements ISysCustomerService {
|
||||
public Map<String, Object> getPhysicalSignsByOutId(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据openid查询客户信息
|
||||
* @param openid
|
||||
* @return
|
||||
*/
|
||||
public SysCustomer getCustomerByOpenId(String openid){
|
||||
return sysCustomerMapper.getCustomerByOpenId(openid);
|
||||
}
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
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.entityEnum.MessageNoticeEnum;
|
||||
import com.stdiet.custom.dto.response.MessageNoticeResponse;
|
||||
import com.stdiet.custom.service.ISysCustomerService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 客户消息通知Service业务层处理
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-04-26
|
||||
*/
|
||||
@Service
|
||||
public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
||||
{
|
||||
@Autowired
|
||||
private SysMessageNoticeMapper sysMessageNoticeMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysCustomerService sysCustomerService;
|
||||
|
||||
/**
|
||||
* 查询客户消息通知
|
||||
*
|
||||
* @param id 客户消息通知ID
|
||||
* @return 客户消息通知
|
||||
*/
|
||||
@Override
|
||||
public SysMessageNotice selectSysMessageNoticeById(Long id)
|
||||
{
|
||||
return sysMessageNoticeMapper.selectSysMessageNoticeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户消息通知列表
|
||||
*
|
||||
* @param sysMessageNotice 客户消息通知
|
||||
* @return 客户消息通知
|
||||
*/
|
||||
@Override
|
||||
public List<SysMessageNotice> selectSysMessageNoticeList(SysMessageNotice sysMessageNotice)
|
||||
{
|
||||
return sysMessageNoticeMapper.selectSysMessageNoticeList(sysMessageNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户消息通知
|
||||
*
|
||||
* @param sysMessageNotice 客户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysMessageNotice(SysMessageNotice sysMessageNotice)
|
||||
{
|
||||
sysMessageNotice.setCreateTime(DateUtils.getNowDate());
|
||||
return sysMessageNoticeMapper.insertSysMessageNotice(sysMessageNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户消息通知
|
||||
*
|
||||
* @param sysMessageNotice 客户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysMessageNotice(SysMessageNotice sysMessageNotice)
|
||||
{
|
||||
sysMessageNotice.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysMessageNoticeMapper.updateSysMessageNotice(sysMessageNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户消息通知
|
||||
*
|
||||
* @param ids 需要删除的客户消息通知ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysMessageNoticeByIds(Long[] ids)
|
||||
{
|
||||
return sysMessageNoticeMapper.deleteSysMessageNoticeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户消息通知信息
|
||||
*
|
||||
* @param id 客户消息通知ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysMessageNoticeById(Long id)
|
||||
{
|
||||
return sysMessageNoticeMapper.deleteSysMessageNoticeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据客户ID查询客户信息(包含私有信息以及公共消息)
|
||||
* @param sysMessageNotice
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MessageNoticeResponse> getCustomerMessage(SysMessageNotice sysMessageNotice){
|
||||
List<MessageNoticeResponse> responsesList = sysMessageNoticeMapper.getCustomerMessage(sysMessageNotice);
|
||||
if(responsesList != null && responsesList.size() > 0){
|
||||
for (MessageNoticeResponse messageNoticeResponse : responsesList) {
|
||||
messageNoticeResponse.setMessageTypeName(MessageNoticeEnum.getNoticeEnumByType(messageNoticeResponse.getMessageType()).getName());
|
||||
}
|
||||
}
|
||||
return responsesList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息发送
|
||||
* @param messageNoticeEnum
|
||||
* @param sysMessageNotice
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int sendMessageNoticeToCustomer(MessageNoticeEnum messageNoticeEnum, SysMessageNotice sysMessageNotice){
|
||||
sysMessageNotice.setMessageProperty(messageNoticeEnum.getProperty());
|
||||
sysMessageNotice.setMessageType(messageNoticeEnum.getType());
|
||||
return sysMessageNoticeMapper.insertSysMessageNotice(sysMessageNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据客户ID查询客户消息数量
|
||||
* @param sysMessageNotice
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int getCustomerMessageCount(SysMessageNotice sysMessageNotice){
|
||||
return sysMessageNoticeMapper.getCustomerMessageCount(sysMessageNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送打卡点评消息
|
||||
* @param sysWxUserLog
|
||||
*/
|
||||
@Override
|
||||
@Async
|
||||
public void sendPunchCommentMessage(SysWxUserLog sysWxUserLog){
|
||||
if(sysWxUserLog == null || StringUtils.isEmpty(sysWxUserLog.getOpenid())){
|
||||
return;
|
||||
}
|
||||
SysCustomer sysCustomer = sysCustomerService.getCustomerByOpenId(sysWxUserLog.getOpenid());
|
||||
if(sysCustomer != null){
|
||||
SysMessageNotice sysMessageNotice = new SysMessageNotice();
|
||||
sysMessageNotice.setMessageProperty(1);
|
||||
sysMessageNotice.setMessageType(MessageNoticeEnum.punchComment.getType());
|
||||
sysMessageNotice.setReadType(0);
|
||||
sysMessageNotice.setMessageCustomer(sysCustomer.getId());
|
||||
sysMessageNotice.setMessageTitle(String.format(MessageNoticeEnum.punchComment.getTitleTemplate(), DateUtils.dateTime(sysWxUserLog.getLogTime())));
|
||||
sysMessageNotice.setMessageContent(sysWxUserLog.getComment());
|
||||
sendMessageNoticeToCustomer(MessageNoticeEnum.punchComment, sysMessageNotice);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysNutritionalVideoMapper;
|
||||
import com.stdiet.custom.domain.SysNutritionalVideo;
|
||||
import com.stdiet.custom.service.ISysNutritionalVideoService;
|
||||
|
||||
/**
|
||||
* 营养视频Service业务层处理
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-04-29
|
||||
*/
|
||||
@Service
|
||||
public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoService
|
||||
{
|
||||
@Autowired
|
||||
private SysNutritionalVideoMapper sysNutritionalVideoMapper;
|
||||
|
||||
/**
|
||||
* 查询营养视频
|
||||
*
|
||||
* @param id 营养视频ID
|
||||
* @return 营养视频
|
||||
*/
|
||||
@Override
|
||||
public SysNutritionalVideo selectSysNutritionalVideoById(Long id)
|
||||
{
|
||||
return sysNutritionalVideoMapper.selectSysNutritionalVideoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询营养视频列表
|
||||
*
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 营养视频
|
||||
*/
|
||||
@Override
|
||||
public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo)
|
||||
{
|
||||
return sysNutritionalVideoMapper.selectSysNutritionalVideoList(sysNutritionalVideo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增营养视频
|
||||
*
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysNutritionalVideo(SysNutritionalVideo sysNutritionalVideo)
|
||||
{
|
||||
sysNutritionalVideo.setCreateTime(DateUtils.getNowDate());
|
||||
return sysNutritionalVideoMapper.insertSysNutritionalVideo(sysNutritionalVideo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改营养视频
|
||||
*
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysNutritionalVideo(SysNutritionalVideo sysNutritionalVideo)
|
||||
{
|
||||
sysNutritionalVideo.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysNutritionalVideoMapper.updateSysNutritionalVideo(sysNutritionalVideo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除营养视频
|
||||
*
|
||||
* @param ids 需要删除的营养视频ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysNutritionalVideoByIds(Long[] ids)
|
||||
{
|
||||
return sysNutritionalVideoMapper.deleteSysNutritionalVideoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除营养视频信息
|
||||
*
|
||||
* @param id 营养视频ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysNutritionalVideoById(Long id)
|
||||
{
|
||||
return sysNutritionalVideoMapper.deleteSysNutritionalVideoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取视频
|
||||
* @param videoId
|
||||
* @return
|
||||
*/
|
||||
public SysNutritionalVideo selectSysNutritionalVideByVideoId(String videoId){
|
||||
return sysNutritionalVideoMapper.selectSysNutritionalVideByVideoId(videoId);
|
||||
}
|
||||
}
|
@ -90,4 +90,14 @@ public class SysPhysicalSignsServiceImpl implements ISysPhysicalSignsService
|
||||
{
|
||||
return sysPhysicalSignsMapper.deleteSysPhysicalSignsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称查询体征ID集合
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Long> getSignIdByName(String name){
|
||||
return sysPhysicalSignsMapper.getSignIdByName(name);
|
||||
}
|
||||
}
|
@ -8,8 +8,11 @@ import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.common.utils.file.FileUploadUtils;
|
||||
import com.stdiet.common.utils.file.MimeTypeUtils;
|
||||
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
||||
import com.stdiet.custom.domain.SysMessageNotice;
|
||||
import com.stdiet.custom.domain.SysWxUserInfo;
|
||||
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
|
||||
import com.stdiet.custom.page.WxLogInfo;
|
||||
import com.stdiet.custom.service.ISysMessageNoticeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysWxUserLogMapper;
|
||||
|
Reference in New Issue
Block a user