diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo.java index 2e6fe84..cc116a6 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo.java @@ -68,7 +68,7 @@ public class PatientInfo implements Serializable { private Integer createdby; /** - * + * 病例id */ @TableField(value = "cid") private Integer cid; diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PushArticle.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PushArticle.java new file mode 100644 index 0000000..9594798 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PushArticle.java @@ -0,0 +1,259 @@ +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 push_article + */ +@TableName(value ="push_article") +@Data +public class PushArticle implements Serializable { + /** + * 患者id + */ + @TableField(value = "id") + private Integer id; + + /** + * 患者姓名 + */ + @TableField(value = "pname") + private String pname; + + /** + * 身份证号 + */ + @TableField(value = "idno") + private String idno; + + /** + * 登录密码 + */ + @TableField(value = "ppasswd") + private String ppasswd; + + /** + * 性别 + */ + @TableField(value = "sex") + private Integer sex; + + /** + * 问诊卡数量 + */ + @TableField(value = "ccnt") + private Integer ccnt; + + /** + * 环信对应标识 + */ + @TableField(value = "hxid") + private String hxid; + + /** + * 出生日期 + */ + @TableField(value = "birth") + private String birth; + + /** + * 创建人 + */ + @TableField(value = "createdby") + private Integer createdby; + + /** + * 患者头像 + */ + @TableField(value = "headimg") + private String headimg; + + /** + * 病例id + */ + @TableField(value = "cid") + private Integer cid; + + /** + * 手机号 + */ + @TableField(value = "mobile") + private String mobile; + + /** + * 填写医院id + */ + @TableField(value = "hid") + private Integer hid; + + /** + * 就诊医院名称 + */ + @TableField(value = "hname") + private String hname; + + /** + * 填写科室id + */ + @TableField(value = "did") + private Integer did; + + /** + * 科室名称 + */ + @TableField(value = "dname") + private String dname; + + /** + * 就诊医生id + */ + @TableField(value = "dtid") + private Integer dtid; + + /** + * 就诊医生姓名 + */ + @TableField(value = "dtname") + private String dtname; + + /** + * 病例创建时间 + */ + @TableField(value = "createdtime") + private Date createdtime; + + /** + * 疾病ID + */ + @TableField(value = "iid") + private Integer iid; + + /** + * 疾病名称 + */ + @TableField(value = "iname") + private String iname; + + /** + * 疾病行ID + */ + @TableField(value = "ilid") + private Integer ilid; + + /** + * 文章id + */ + @TableField(value = "aid") + private Integer aid; + + @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; + } + PushArticle other = (PushArticle) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getPname() == null ? other.getPname() == null : this.getPname().equals(other.getPname())) + && (this.getIdno() == null ? other.getIdno() == null : this.getIdno().equals(other.getIdno())) + && (this.getPpasswd() == null ? other.getPpasswd() == null : this.getPpasswd().equals(other.getPpasswd())) + && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex())) + && (this.getCcnt() == null ? other.getCcnt() == null : this.getCcnt().equals(other.getCcnt())) + && (this.getHxid() == null ? other.getHxid() == null : this.getHxid().equals(other.getHxid())) + && (this.getBirth() == null ? other.getBirth() == null : this.getBirth().equals(other.getBirth())) + && (this.getCreatedby() == null ? other.getCreatedby() == null : this.getCreatedby().equals(other.getCreatedby())) + && (this.getHeadimg() == null ? other.getHeadimg() == null : this.getHeadimg().equals(other.getHeadimg())) + && (this.getCid() == null ? other.getCid() == null : this.getCid().equals(other.getCid())) + && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile())) + && (this.getHid() == null ? other.getHid() == null : this.getHid().equals(other.getHid())) + && (this.getHname() == null ? other.getHname() == null : this.getHname().equals(other.getHname())) + && (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid())) + && (this.getDname() == null ? other.getDname() == null : this.getDname().equals(other.getDname())) + && (this.getDtid() == null ? other.getDtid() == null : this.getDtid().equals(other.getDtid())) + && (this.getDtname() == null ? other.getDtname() == null : this.getDtname().equals(other.getDtname())) + && (this.getCreatedtime() == null ? other.getCreatedtime() == null : this.getCreatedtime().equals(other.getCreatedtime())) + && (this.getIid() == null ? other.getIid() == null : this.getIid().equals(other.getIid())) + && (this.getIname() == null ? other.getIname() == null : this.getIname().equals(other.getIname())) + && (this.getIlid() == null ? other.getIlid() == null : this.getIlid().equals(other.getIlid())) + && (this.getAid() == null ? other.getAid() == null : this.getAid().equals(other.getAid())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getPname() == null) ? 0 : getPname().hashCode()); + result = prime * result + ((getIdno() == null) ? 0 : getIdno().hashCode()); + result = prime * result + ((getPpasswd() == null) ? 0 : getPpasswd().hashCode()); + result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode()); + result = prime * result + ((getCcnt() == null) ? 0 : getCcnt().hashCode()); + result = prime * result + ((getHxid() == null) ? 0 : getHxid().hashCode()); + result = prime * result + ((getBirth() == null) ? 0 : getBirth().hashCode()); + result = prime * result + ((getCreatedby() == null) ? 0 : getCreatedby().hashCode()); + result = prime * result + ((getHeadimg() == null) ? 0 : getHeadimg().hashCode()); + result = prime * result + ((getCid() == null) ? 0 : getCid().hashCode()); + result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode()); + result = prime * result + ((getHid() == null) ? 0 : getHid().hashCode()); + result = prime * result + ((getHname() == null) ? 0 : getHname().hashCode()); + result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode()); + result = prime * result + ((getDname() == null) ? 0 : getDname().hashCode()); + result = prime * result + ((getDtid() == null) ? 0 : getDtid().hashCode()); + result = prime * result + ((getDtname() == null) ? 0 : getDtname().hashCode()); + result = prime * result + ((getCreatedtime() == null) ? 0 : getCreatedtime().hashCode()); + result = prime * result + ((getIid() == null) ? 0 : getIid().hashCode()); + result = prime * result + ((getIname() == null) ? 0 : getIname().hashCode()); + result = prime * result + ((getIlid() == null) ? 0 : getIlid().hashCode()); + result = prime * result + ((getAid() == null) ? 0 : getAid().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(", pname=").append(pname); + sb.append(", idno=").append(idno); + sb.append(", ppasswd=").append(ppasswd); + sb.append(", sex=").append(sex); + sb.append(", ccnt=").append(ccnt); + sb.append(", hxid=").append(hxid); + sb.append(", birth=").append(birth); + sb.append(", createdby=").append(createdby); + sb.append(", headimg=").append(headimg); + sb.append(", cid=").append(cid); + sb.append(", mobile=").append(mobile); + sb.append(", hid=").append(hid); + sb.append(", hname=").append(hname); + sb.append(", did=").append(did); + sb.append(", dname=").append(dname); + sb.append(", dtid=").append(dtid); + sb.append(", dtname=").append(dtname); + sb.append(", createdtime=").append(createdtime); + sb.append(", iid=").append(iid); + sb.append(", iname=").append(iname); + sb.append(", ilid=").append(ilid); + sb.append(", aid=").append(aid); + 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/PushArticleMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/PushArticleMapper.java new file mode 100644 index 0000000..2951688 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/PushArticleMapper.java @@ -0,0 +1,15 @@ +package com.lyms.talkonlineweb.mapper; + +import com.lyms.talkonlineweb.domain.PushArticle; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Entity com.lyms.talkonlineweb.domain.PushArticle + */ +public interface PushArticleMapper extends BaseMapper { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/PushArticleService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/PushArticleService.java new file mode 100644 index 0000000..def6712 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/PushArticleService.java @@ -0,0 +1,11 @@ +package com.lyms.talkonlineweb.service; + +import com.lyms.talkonlineweb.domain.PushArticle; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * + */ +public interface PushArticleService extends IService { + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/PushArticleServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/PushArticleServiceImpl.java new file mode 100644 index 0000000..37bf59d --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/PushArticleServiceImpl.java @@ -0,0 +1,20 @@ +package com.lyms.talkonlineweb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lyms.talkonlineweb.domain.PushArticle; +import com.lyms.talkonlineweb.service.PushArticleService; +import com.lyms.talkonlineweb.mapper.PushArticleMapper; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class PushArticleServiceImpl extends ServiceImpl + implements PushArticleService{ + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java index f5b3980..abf066a 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java @@ -1,14 +1,8 @@ package com.lyms.talkonlineweb.task; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.lyms.talkonlineweb.domain.LymsArticle; -import com.lyms.talkonlineweb.domain.LymsDict; -import com.lyms.talkonlineweb.domain.LymsPushedart; -import com.lyms.talkonlineweb.domain.PatientInfo; -import com.lyms.talkonlineweb.service.LymsArticleService; -import com.lyms.talkonlineweb.service.LymsDictService; -import com.lyms.talkonlineweb.service.LymsPushedartService; -import com.lyms.talkonlineweb.service.PatientInfoService; +import com.lyms.talkonlineweb.domain.*; +import com.lyms.talkonlineweb.service.*; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; @@ -33,6 +27,8 @@ public class PushArticleTask { private PatientInfoService patientInfoService; @Autowired private LymsPushedartService lymsPushedartService;//推送的历史记录 + @Autowired + private PushArticleService pushArticleService;//推送文章新逻辑shiy改 @Autowired private LymsDictService lymsDictService; @@ -47,23 +43,32 @@ public class PushArticleTask { List dcLst=lymsDictService.listByMap(param); if (dcLst.size()>0 && dcLst.get(0).getCode()==1){ log.debug("开始给患者推送文章>>>>>>"); - List aLst=lymsArticleService.sltNeedPush();//获取待推送文章 - - aLst.forEach(e->{ - PatientInfo patientInfo=new PatientInfo(); - patientInfo.setIid(e.getIid());//针对特定疾病人群推送文章 - List pLst=patientInfoService.list(Wrappers.query(patientInfo)); - - pLst.forEach(p->{ - LymsPushedart pushedart=new LymsPushedart(); - pushedart.setPid(p.getId()); - pushedart.setAid(e.getAid()); + List pushArticle=pushArticleService.list(); + for (PushArticle article : pushArticle) { + LymsPushedart pushedart=new LymsPushedart(); + pushedart.setPid(article.getId()); + pushedart.setAid(article.getAid()); pushedart.setCreatedtime(new Date()); pushedart.setIsread((byte) 0); lymsPushedartService.save(pushedart);//插入到提送记录 - }); - - }); + } +// List aLst=lymsArticleService.sltNeedPush();//获取待推送文章 +// +// aLst.forEach(e->{ +// PatientInfo patientInfo=new PatientInfo(); +// patientInfo.setIid(e.getIid());//针对特定疾病人群推送文章 +// List pLst=patientInfoService.list(Wrappers.query(patientInfo)); +// +// pLst.forEach(p->{ +// LymsPushedart pushedart=new LymsPushedart(); +// pushedart.setPid(p.getId()); +// pushedart.setAid(e.getAid()); +// pushedart.setCreatedtime(new Date()); +// pushedart.setIsread((byte) 0); +// lymsPushedartService.save(pushedart);//插入到提送记录 +// }); +// +// }); } } diff --git a/talkonlineweb/src/main/resources/mapper/PushArticleMapper.xml b/talkonlineweb/src/main/resources/mapper/PushArticleMapper.xml new file mode 100644 index 0000000..3614f83 --- /dev/null +++ b/talkonlineweb/src/main/resources/mapper/PushArticleMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,pname,idno, + ppasswd,sex,ccnt, + hxid,birth,createdby, + headimg,cid,mobile, + hid,hname,did, + dname,dtid,dtname, + createdtime,iid,iname, + ilid,aid + +