diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsChatInfo.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsChatInfo.java new file mode 100644 index 0000000..e93c1c3 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsChatInfo.java @@ -0,0 +1,106 @@ +package com.lyms.talkonlineweb.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 回访聊天信息自动回复话术 + * @TableName lyms_chat_Info + */ +@TableName(value ="lyms_chat_Info") +@Data +public class LymsChatInfo implements Serializable { + /** + * + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 自动回复内容 + */ + @TableField(value = "conten") + private String conten; + + /** + * 自动回复周期建档后-1:第二天2:第五天3:第十天4:第二十天5:第三十天 + */ + @TableField(value = "type") + private Integer type; + + /** + * 疾病id + */ + @TableField(value = "illid") + private String illid; + + /** + * 创建时间 + */ + @TableField(value = "createdtime") + private Date createdtime; + + /** + * 修改时间 + */ + @TableField(value = "update_time") + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + LymsChatInfo other = (LymsChatInfo) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getConten() == null ? other.getConten() == null : this.getConten().equals(other.getConten())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getIllid() == null ? other.getIllid() == null : this.getIllid().equals(other.getIllid())) + && (this.getCreatedtime() == null ? other.getCreatedtime() == null : this.getCreatedtime().equals(other.getCreatedtime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getConten() == null) ? 0 : getConten().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getIllid() == null) ? 0 : getIllid().hashCode()); + result = prime * result + ((getCreatedtime() == null) ? 0 : getCreatedtime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", conten=").append(conten); + sb.append(", type=").append(type); + sb.append(", illid=").append(illid); + sb.append(", createdtime=").append(createdtime); + sb.append(", updateTime=").append(updateTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsReturnVisitRecord.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsReturnVisitRecord.java new file mode 100644 index 0000000..4e42b1d --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsReturnVisitRecord.java @@ -0,0 +1,124 @@ +package com.lyms.talkonlineweb.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 医生回访记录 + * @TableName lyms_return_visit_record + */ +@TableName(value ="lyms_return_visit_record") +@Data +public class LymsReturnVisitRecord implements Serializable { + /** + * + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 回访医生dlogin组 + */ + @TableField(value = "dlogins") + private String dlogins; + + /** + * 科室id + */ + @TableField(value = "dpid") + private Integer dpid; + + /** + * 患者身份证 + */ + @TableField(value = "idno") + private String idno; + + /** + * 回访类型0:自动回访 1:医生回访 + */ + @TableField(value = "type") + private Integer type; + + /** + * 环信群组id + */ + @TableField(value = "hxgroupid") + private String hxgroupid; + + /** + * 创建时间 + */ + @TableField(value = "createdtime") + private Date createdtime; + + /** + * 修改时间 + */ + @TableField(value = "update_time") + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + LymsReturnVisitRecord other = (LymsReturnVisitRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getDlogins() == null ? other.getDlogins() == null : this.getDlogins().equals(other.getDlogins())) + && (this.getDpid() == null ? other.getDpid() == null : this.getDpid().equals(other.getDpid())) + && (this.getIdno() == null ? other.getIdno() == null : this.getIdno().equals(other.getIdno())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getHxgroupid() == null ? other.getHxgroupid() == null : this.getHxgroupid().equals(other.getHxgroupid())) + && (this.getCreatedtime() == null ? other.getCreatedtime() == null : this.getCreatedtime().equals(other.getCreatedtime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getDlogins() == null) ? 0 : getDlogins().hashCode()); + result = prime * result + ((getDpid() == null) ? 0 : getDpid().hashCode()); + result = prime * result + ((getIdno() == null) ? 0 : getIdno().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getHxgroupid() == null) ? 0 : getHxgroupid().hashCode()); + result = prime * result + ((getCreatedtime() == null) ? 0 : getCreatedtime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", dlogins=").append(dlogins); + sb.append(", dpid=").append(dpid); + sb.append(", idno=").append(idno); + sb.append(", type=").append(type); + sb.append(", hxgroupid=").append(hxgroupid); + sb.append(", createdtime=").append(createdtime); + sb.append(", updateTime=").append(updateTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsChatInfoMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsChatInfoMapper.java new file mode 100644 index 0000000..599309f --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsChatInfoMapper.java @@ -0,0 +1,15 @@ +package com.lyms.talkonlineweb.mapper; + +import com.lyms.talkonlineweb.domain.LymsChatInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Entity com.lyms.talkonlineweb.domain.LymsChatInfo + */ +public interface LymsChatInfoMapper extends BaseMapper { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsReturnVisitRecordMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsReturnVisitRecordMapper.java new file mode 100644 index 0000000..8f2b630 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsReturnVisitRecordMapper.java @@ -0,0 +1,15 @@ +package com.lyms.talkonlineweb.mapper; + +import com.lyms.talkonlineweb.domain.LymsReturnVisitRecord; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Entity com.lyms.talkonlineweb.domain.LymsReturnVisitRecord + */ +public interface LymsReturnVisitRecordMapper extends BaseMapper { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsChatInfoService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsChatInfoService.java new file mode 100644 index 0000000..f79f817 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsChatInfoService.java @@ -0,0 +1,11 @@ +package com.lyms.talkonlineweb.service; + +import com.lyms.talkonlineweb.domain.LymsChatInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * + */ +public interface LymsChatInfoService extends IService { + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsReturnVisitRecordService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsReturnVisitRecordService.java new file mode 100644 index 0000000..ccc7b72 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsReturnVisitRecordService.java @@ -0,0 +1,11 @@ +package com.lyms.talkonlineweb.service; + +import com.lyms.talkonlineweb.domain.LymsReturnVisitRecord; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * + */ +public interface LymsReturnVisitRecordService extends IService { + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsChatInfoServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsChatInfoServiceImpl.java new file mode 100644 index 0000000..89ceee6 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsChatInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.lyms.talkonlineweb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lyms.talkonlineweb.domain.LymsChatInfo; +import com.lyms.talkonlineweb.service.LymsChatInfoService; +import com.lyms.talkonlineweb.mapper.LymsChatInfoMapper; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class LymsChatInfoServiceImpl extends ServiceImpl + implements LymsChatInfoService{ + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsReturnVisitRecordServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsReturnVisitRecordServiceImpl.java new file mode 100644 index 0000000..3c03c96 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsReturnVisitRecordServiceImpl.java @@ -0,0 +1,20 @@ +package com.lyms.talkonlineweb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lyms.talkonlineweb.domain.LymsReturnVisitRecord; +import com.lyms.talkonlineweb.service.LymsReturnVisitRecordService; +import com.lyms.talkonlineweb.mapper.LymsReturnVisitRecordMapper; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class LymsReturnVisitRecordServiceImpl extends ServiceImpl + implements LymsReturnVisitRecordService{ + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushChatInfoTask.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushChatInfoTask.java new file mode 100644 index 0000000..5d0db8c --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushChatInfoTask.java @@ -0,0 +1,64 @@ +package com.lyms.talkonlineweb.task; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.lyms.talkonlineweb.domain.*; +import com.lyms.talkonlineweb.service.*; +import com.lyms.talkonlineweb.util.Constant; +import com.lyms.talkonlineweb.util.StringUtil; +import com.lyms.talkonlineweb.util.WeiXinUtil; +import lombok.Data; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 回访信息回复 + */ + +@Component +@Log4j2 +public class PushChatInfoTask { + + @Autowired + private LymsArticleService lymsArticleService; + @Autowired + private PatientInfoService patientInfoService; + @Autowired + private LymsPushedartService lymsPushedartService;//推送的历史记录 + @Autowired + private PushArticleService pushArticleService;//推送文章新逻辑shiy改 + @Autowired + private LymsPatientService lymsPatientService; + @Autowired + private LymsPushMessagesService lymsPushMessagesService; + @Autowired + private LymsPcaseService lymsPcaseService;//病例 + @Autowired + private LymsDictService lymsDictService; + @Autowired + public LymsPushAttentionRecordService lymsPushAttentionRecordService; + @Autowired + private LymsChatgroupService lymsChatgroupService; + @Autowired + private LymsReturnVisitRecordService lymsReturnVisitRecordService; + + /** + * 每天12点执行回访信息系统回复 + */ +// @Scheduled(cron = "0 0 12 * * ?") + public void pushChatInfo() { + final List chatgroupList = lymsChatgroupService.list(); + for (LymsChatgroup lymsChatgroup : chatgroupList) { + final List lymsReturnVisitRecords = lymsReturnVisitRecordService.list(new QueryWrapper() + .lambda().eq(LymsReturnVisitRecord::getHxgroupid, lymsChatgroup.getHxgroupid())); + } + } +} + diff --git a/talkonlineweb/src/main/resources/mapper/LymsChatInfoMapper.xml b/talkonlineweb/src/main/resources/mapper/LymsChatInfoMapper.xml new file mode 100644 index 0000000..dc55f33 --- /dev/null +++ b/talkonlineweb/src/main/resources/mapper/LymsChatInfoMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + id,conten,type, + illid,createdtime,update_time + + diff --git a/talkonlineweb/src/main/resources/mapper/LymsReturnVisitRecordMapper.xml b/talkonlineweb/src/main/resources/mapper/LymsReturnVisitRecordMapper.xml new file mode 100644 index 0000000..40f6ed5 --- /dev/null +++ b/talkonlineweb/src/main/resources/mapper/LymsReturnVisitRecordMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + id,dlogins,dpid, + idno,type,hxgroupid, + createdtime,update_time + +