chenweida il y a 7 ans
Parent
commit
98d99e3618

+ 208 - 170
common/common-entity/src/main/java/com/yihu/wlyy/entity/education/HealthEduArticlePatient.java

@ -12,180 +12,218 @@ import com.yihu.wlyy.entity.IdEntity;
/**
/**
 * 患者健康教育文章
 * 患者健康教育文章
 * @author George
 *
 *
 * @author George
 */
 */
@Entity
@Entity
@Table(name = "wlyy_health_edu_article_patient")
@Table(name = "wlyy_health_edu_article_patient")
public class HealthEduArticlePatient extends IdEntity {
public class HealthEduArticlePatient extends IdEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2828104062535279547L;
	// 患者标识
	private String patient;
	// 文章标识
	private String article;
	// 医生标识
	private String doctor;
	// 医生姓名
	private String doctorName;
	// 文章标题
	private String title;
	// 文章链接
	private String url;
	// 文章内容
	private String content;
	// 是否已读:0已读,1未读
	private Integer read;
	// 发布时间
	private Date czrq;
	// 签约类型 1三师 2家庭
	private Integer signType;
	// 行政团队
	private Long adminTeamCode;
	// 简介
	private String summary;
	//附加内容
	private String attachedContent;
	//批次号记录发送所属批次
	private String batchNo;
	//签约表code
	private String signCode;
	private Integer articleId;
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	public String getAttachedContent() {
		return attachedContent;
	}
	public void setAttachedContent(String attachedContent) {
		this.attachedContent = attachedContent;
	}
	public String getPatient() {
		return patient;
	}
	public void setPatient(String patient) {
		this.patient = patient;
	}
	public String getArticle() {
		return article;
	}
	public void setArticle(String article) {
		this.article = article;
	}
	public String getDoctor() {
		return doctor;
	}
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}
	public String getDoctorName() {
		return doctorName;
	}
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
	@Transient
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Transient
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	@Transient
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	@Column(name = "is_read")
	public Integer getRead() {
		return read;
	}
	public void setRead(Integer read) {
		this.read = read;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCzrq() {
		return czrq;
	}
	public void setCzrq(Date czrq) {
		this.czrq = czrq;
	}
	public Integer getSignType() {
		return signType;
	}
	public void setSignType(Integer signType) {
		this.signType = signType;
	}
	public Long getAdminTeamCode() {
		return adminTeamCode;
	}
	public void setAdminTeamCode(Long adminTeamCode) {
		this.adminTeamCode = adminTeamCode;
	}
	@Transient
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public String getSignCode() {
		return signCode;
	}
	public void setSignCode(String signCode) {
		this.signCode = signCode;
	}
	@Transient
	public Integer getArticleId() {
		return articleId;
	}
	public void setArticleId(Integer articleId) {
		this.articleId = articleId;
	}
    /**
     *
     */
    private static final long serialVersionUID = -2828104062535279547L;
    // 患者标识
    private String patient;
    // 文章标识
    private String article;
    // 医生标识
    private String doctor;
    // 医生姓名
    private String doctorName;
    // 文章标题
    private String title;
    // 文章链接
    private String url;
    // 文章内容
    private String content;
    // 是否已读:0已读,1未读
    private Integer read;
    // 发布时间
    private Date czrq;
    // 签约类型 1三师 2家庭
    private Integer signType;
    // 行政团队
    private Long adminTeamCode;
    // 简介
    private String summary;
    //附加内容
    private String attachedContent;
    //批次号记录发送所属批次
    private String batchNo;
    //文章标题
    private String attachedTitle;
    //文章封面
    private String attachedPic;
    //推送类型
    private Integer sendType; //1或者为空 i健康后台推送  2PC端推送
    //签约表code
    private String signCode;
    private Integer articleId;
    public String getBatchNo() {
        return batchNo;
    }
    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }
    public String getAttachedContent() {
        return attachedContent;
    }
    public void setAttachedContent(String attachedContent) {
        this.attachedContent = attachedContent;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getArticle() {
        return article;
    }
    public void setArticle(String article) {
        this.article = article;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @Transient
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    @Transient
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    @Transient
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    @Column(name = "is_read")
    public Integer getRead() {
        return read;
    }
    public void setRead(Integer read) {
        this.read = read;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
    public Integer getSignType() {
        return signType;
    }
    public void setSignType(Integer signType) {
        this.signType = signType;
    }
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    @Transient
    public String getSummary() {
        return summary;
    }
    public void setSummary(String summary) {
        this.summary = summary;
    }
    public String getSignCode() {
        return signCode;
    }
    public void setSignCode(String signCode) {
        this.signCode = signCode;
    }
    @Transient
    public Integer getArticleId() {
        return articleId;
    }
    public void setArticleId(Integer articleId) {
        this.articleId = articleId;
    }
    public static long getSerialVersionUID() {
        return serialVersionUID;
    }
    public String getAttachedTitle() {
        return attachedTitle;
    }
    public void setAttachedTitle(String attachedTitle) {
        this.attachedTitle = attachedTitle;
    }
    public String getAttachedPic() {
        return attachedPic;
    }
    public void setAttachedPic(String attachedPic) {
        this.attachedPic = attachedPic;
    }
    public Integer getSendType() {
        return sendType;
    }
    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }
}
}

+ 4 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java

@ -78,7 +78,7 @@ public class GcEduArticleController extends WeixinBaseController {
     */
     */
    @RequestMapping(value = "send", method = RequestMethod.POST)
    @RequestMapping(value = "send", method = RequestMethod.POST)
    @ApiOperation("文章推送")
    @ApiOperation("文章推送")
    public ResultBatchModel send(
    public BaseResultModel send(
            @ApiParam(name = "sendType", value = "发送类型 1医生发送 2卫纪委发送", required = true) @RequestParam(value = "sendType", required = true) String sendType,
            @ApiParam(name = "sendType", value = "发送类型 1医生发送 2卫纪委发送", required = true) @RequestParam(value = "sendType", required = true) String sendType,
            @ApiParam(name = "sendCode", value = "发送人code", required = true) @RequestParam(value = "sendCode", required = true) String sendCode,
            @ApiParam(name = "sendCode", value = "发送人code", required = true) @RequestParam(value = "sendCode", required = true) String sendCode,
            @ApiParam(name = "sendName", value = "发送人名", required = true) @RequestParam(value = "sendName", required = true) String sendName,
            @ApiParam(name = "sendName", value = "发送人名", required = true) @RequestParam(value = "sendName", required = true) String sendName,
@ -100,8 +100,6 @@ public class GcEduArticleController extends WeixinBaseController {
            if ((articleIdArr.length != articlePicArr.length) || (articleIdArr.length != articleTitleArr.length) || (articlePicArr.length != articleTitleArr.length)) {
            if ((articleIdArr.length != articlePicArr.length) || (articleIdArr.length != articleTitleArr.length) || (articlePicArr.length != articleTitleArr.length)) {
                return new ResultBatchModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":文章参数长度错误");
                return new ResultBatchModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":文章参数长度错误");
            }
            }
            int success = 0;
            int error = 0;
            //得到需要发送的患者
            //得到需要发送的患者
            gcEduArticleService.initPatient(patientSet, patients, labelType, labelCode, teamId);
            gcEduArticleService.initPatient(patientSet, patients, labelType, labelCode, teamId);
            //保存发送记录
            //保存发送记录
@ -110,9 +108,9 @@ public class GcEduArticleController extends WeixinBaseController {
            sendWxTemplateAndIM(healthEduArticlePatients);
            sendWxTemplateAndIM(healthEduArticlePatients);
            return null;
            return new BaseResultModel();
        } catch (Exception e) {
        } catch (Exception e) {
            return new ResultBatchModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
        }
        }
    }
    }
@ -126,6 +124,7 @@ public class GcEduArticleController extends WeixinBaseController {
                //发送备注
                //发送备注
                consultService.sendMucMessageBySingnType(one.getDoctor(),one.getDoctorName(), patient.getCode(), one.getAttachedContent(), ImUtill.CONTENT_TYPE_TEXT, patient.getName());
                consultService.sendMucMessageBySingnType(one.getDoctor(),one.getDoctorName(), patient.getCode(), one.getAttachedContent(), ImUtill.CONTENT_TYPE_TEXT, patient.getName());
            }
            }
            // 推送消息给微信端
            // 推送消息给微信端
            JSONObject json = new JSONObject();
            JSONObject json = new JSONObject();
            json.put("first", patient.getName() + ",您好!\n" +  one.getDoctorName() + "医生给您发来了一篇患教文章");
            json.put("first", patient.getName() + ",您好!\n" +  one.getDoctorName() + "医生给您发来了一篇患教文章");