Kaynağa Gözat

集美宣教代码提交

liuwenbin 7 yıl önce
ebeveyn
işleme
68d6c05fba

+ 14 - 4
common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticleES.java

@ -18,7 +18,7 @@ public class HealthEduArticleES {
    private String id;
    private String batchNo;//批次号记录发送所属批次
    private String patientCode; // 患者标识
    private String patientName; // 患者标识
    private String patientName; // 患者名称
    private String doctorCode;  //推送的医生code(包括医生本人、卫计委)
    private String doctorName;  //推送的医生名称(包括医生本人、卫计委)
    private String sendCode;   // 发送人code(如管理员推送,保存登陆者code)
@ -49,7 +49,7 @@ public class HealthEduArticleES {
    private String secondLevelCategoryId;//文章二级类别id
    private String secondLevelCategoryName;//文章二级类别Name
    private String operatorId;//文章作者Id
    private int isRead=0;//文章是否已读 0未读,1已读
    private Integer isRead=0;//文章是否已读 0未读,1已读
    private String articleSource;//文章来源
    private List<RoleVo> roleList;//发送者角色
@ -58,6 +58,8 @@ public class HealthEduArticleES {
    private String currentUserRoleLevel;//发送者当前登录的角色级别
    private Integer sendSource; //1或者为空 i健康后台推送  2PC端推送
    private Integer allCount;//所有的推送数目
    @Transient
    private Boolean newArricleFlag;//新版文章推送标志
    public String getId() {
        return id;
@ -291,11 +293,11 @@ public class HealthEduArticleES {
        this.operatorId = operatorId;
    }
    public int getIsRead() {
    public Integer getIsRead() {
        return isRead;
    }
    public void setIsRead(int isRead) {
    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }
@ -354,4 +356,12 @@ public class HealthEduArticleES {
    public void setAllCount(Integer allCount) {
        this.allCount = allCount;
    }
    public Boolean getNewArricleFlag() {
        return newArricleFlag;
    }
    public void setNewArricleFlag(Boolean newArricleFlag) {
        this.newArricleFlag = newArricleFlag;
    }
}

+ 15 - 0
edu-article/JkEdu/src/ArticleQR.sql.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<das-client>
	<Sqls> 
		<Sql name='getArticleORCode'>
		 	<![CDATA[
					select * from Config_ArticleQRCode
			]]>
		</Sql>
		<Sql name='getArticleQRDetail'>
			<![CDATA[
					select * from Config_ArticleQRCode where 1=1  @Condition
			]]>
		</Sql>
	</Sqls>
</das-client>

+ 8 - 0
edu-article/JkEdu/src/com/yihu/jk/enums/ArticleQRSqlNameEnum.java

@ -0,0 +1,8 @@
package com.yihu.jk.enums;
import com.coreframework.db.SqlNameEnum;
public enum ArticleQRSqlNameEnum implements SqlNameEnum {
	 getArticleQRDetail
}

+ 114 - 0
edu-article/JkEdu/src/com/yihu/jk/vo/ArticleQR.java

@ -0,0 +1,114 @@
package com.yihu.jk.vo;
//二维码管理
public class ArticleQR {
	private int id;// 主键ID
	private String imgUrl;// 图片地址
	private Integer position;// 1、顶部 2、底部
	private String insertTime;// 插入时间
	private String updateTime;// √ 修改时间
	private String operatorName;// 创建人
	private String operatorId;// 创建人ID
	private String orgId;// 创建人所属机构ID
	private String orgName;// 创建人所属机构名称
	private String identification;//认证标识文字
	private String operatorRoleCode;//操作人角色code
	private String operatorRoleLevel;//操作人角色级别
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getImgUrl() {
		return imgUrl;
	}
	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}
	public Integer getPosition() {
		return position;
	}
	public void setPosition(Integer position) {
		this.position = position;
	}
	public String getInsertTime() {
		return insertTime;
	}
	public void setInsertTime(String insertTime) {
		this.insertTime = insertTime;
	}
	public String getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}
	public String getOperatorName() {
		return operatorName;
	}
	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}
	public String getOperatorId() {
		return operatorId;
	}
	public void setOperatorId(String operatorId) {
		this.operatorId = operatorId;
	}
	public String getOrgId() {
		return orgId;
	}
	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}
	public String getOrgName() {
		return orgName;
	}
	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	public String getIdentification() {
		return identification;
	}
	public void setIdentification(String identification) {
		this.identification = identification;
	}
	public String getOperatorRoleCode() {
		return operatorRoleCode;
	}
	public void setOperatorRoleCode(String operatorRoleCode) {
		this.operatorRoleCode = operatorRoleCode;
	}
	public String getOperatorRoleLevel() {
		return operatorRoleLevel;
	}
	public void setOperatorRoleLevel(String operatorRoleLevel) {
		this.operatorRoleLevel = operatorRoleLevel;
	}
}

+ 11 - 10
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.activemq;
import com.yihu.es.entity.HealthEduArticleES;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.consult.ConsultService;
@ -46,9 +47,9 @@ public class HealthArtListener implements MessageListener {
    public void onMessage(Message message) {
        try {
            TextMessage textMessage = (TextMessage) message;
            HealthEduArticlePatient healthEduArticlePatient = (HealthEduArticlePatient)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticlePatient.class);
            HealthEduArticleES healthEduArticleES = (HealthEduArticleES)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticlePatient.class);
//            logger.info(jo.toString());
            sendWxTemplateAndIM(healthEduArticlePatient);
            sendWxTemplateAndIM(healthEduArticleES);
            //返回服务器表示消息消费成功
            message.acknowledge();
        } catch (JMSException e) {
@ -58,18 +59,18 @@ public class HealthArtListener implements MessageListener {
    //发送到IM和微信消息模板
    private void sendWxTemplateAndIM(HealthEduArticlePatient one) {
    private void sendWxTemplateAndIM(HealthEduArticleES one) {
        String endMsg = "";//"为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
//        healthEduArticlePatients.stream().forEach(one -> {
            Patient patient = patientService.findByCode(one.getPatient());
            Patient patient = patientService.findByCode(one.getPatientCode());
            try {
                //卫纪委发送不推IM
                if (1 == one.getSendType()) {
                    consultService.sendMucMessageBySingnType(one.getDoctorCode(), one.getDoctorName(), patient.getCode(), "{\"title\":\"" + one.getAttachedTitle() + "\",\"type\":0,\"id\":\"" + one.getId() + "\",\"img\":\"" + one.getAttachedPic() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patient.getName());
                    if (StringUtils.isNotBlank(one.getAttachedMessage())) {
                    consultService.sendMucMessageBySingnType(one.getDoctorCode(), one.getDoctorName(), patient.getCode(), "{\"title\":\"" + one.getArticleTitle() + "\",\"type\":0,\"id\":\"" + one.getId() + "\",\"img\":\"" + one.getArticleCover() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patient.getName());
                    if (StringUtils.isNotBlank(one.getLeaveWords())) {
                        //发送备注
                        consultService.sendMucMessageBySingnType(one.getDoctorCode(), one.getDoctorName(), patient.getCode(), one.getAttachedMessage(), ImUtill.CONTENT_TYPE_TEXT, patient.getName());
                        consultService.sendMucMessageBySingnType(one.getDoctorCode(), one.getDoctorName(), patient.getCode(), one.getLeaveWords(), ImUtill.CONTENT_TYPE_TEXT, patient.getName());
                    }
                }
                // 推送消息给微信端
@ -77,12 +78,12 @@ public class HealthArtListener implements MessageListener {
                json.put("first", patient.getName() + ",您好! " + one.getSendName() + (one.getSendType()==2 ? "卫计委":"医生") +"给您发来了一篇患教文章");
                json.put("toUser", patient.getCode());
                json.put("article", one.getArticleId() + "");
                json.put("title", one.getAttachedTitle());
                json.put("title", one.getArticleTitle());
                json.put("doctorName", one.getDoctorName()+(one.getSendType()==2 ? "卫计委":"医生"));
                json.put("represented", patient.getCode());//被代理人
                json.put("date", DateUtil.dateToStrLong(DateUtil.getNowDate()));
                json.put("remark", org.springframework.util.StringUtils.isEmpty(one.getAttachedMessage()) ? "  " : one.getAttachedMessage());
                json.put("articleUrl",one.getArticleUrl());
                json.put("remark", org.springframework.util.StringUtils.isEmpty(one.getLeaveWords()) ? "  " : one.getLeaveWords());
                json.put("newArricleFlag",one.getNewArricleFlag());
                if (StringUtils.isNotBlank(patient.getOpenid())) {
                    pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9,
                            patient.getOpenid(),

+ 2 - 2
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -458,8 +458,8 @@ public class PushMsgTask {
            } else if (type == 9) {
                temp.setUrl(url + "jkjy/html/article.html?openid=" + openid + "&dataId=" + json.getString("article") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                //如果是ArticleUrl不为空,那就说明是外部系统推送文章(如:集美宣教)
                String articleUrl = json.has("articleUrl") ? json.getString("articleUrl") : null;
                if(StringUtils.isNotEmpty(articleUrl)){
                Boolean articleUrl = json.has("newArricleFlag") ? json.getBoolean("newArricleFlag") : false;
                if(articleUrl.booleanValue()){
                    temp.setUrl(url + "jkjy/html/article2.html?openid=" + openid + "&dataId=" + json.getString("article") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                }
                temp_id = template_healthy_article;

+ 2 - 2
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -101,11 +101,11 @@ pushMes:
  redis_prescription_title: redisMessage
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test3
    HealthEduArticlePatient: health_edu_article_patient_test5
    FollowUp: wlyy_followup
    Statistics: wlyy_quota_test
  type:
    HealthEduArticlePatient: health_edu_article_patient_test3
    HealthEduArticlePatient: health_edu_article_patient_test5
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
  host:  http://172.19.103.68:9200