Преглед на файлове

集美宣教代码提交

liuwenbin преди 7 години
родител
ревизия
76ad41e5fd

+ 2 - 0
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -235,6 +235,8 @@ public class ArticleApi {
					jsonObj.put("titleLevel", StringUtil.getJSONValue(vbo.getTitleLevel()));
					jsonObj.put("operatorImg", StringUtil.getJSONValue(vbo.getOperatorImg()));
					jsonObj.put("userScope", StringUtil.getJSONValue(vbo.getUserScope()));
					jsonObj.put("articleCategoryId", StringUtil.getJSONValue(vbo.getArticleCategoryId()));
					jsonObj.put("articleCategoryName", StringUtil.getJSONValue(vbo.getArticleCategoryName()));
					if (StringUtil.isNotEmpty(userId)) {
						vo.setUserId(userId);
						int pointNumberCount = dao.pointNumberCount(vo);

+ 5 - 5
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java

@ -55,11 +55,11 @@ public class ArticleApiTest {
		ArticleApi api = new ArticleApi();
		InterfaceMessage im = new InterfaceMessage();
		JSONObject obj = new JSONObject();
		obj.put("firstLevelCategoryId","43");
//		obj.put("firstLevelCategoryId","43");
//		obj.put("articleId","0");
		obj.put("isAuthentication","1");
//		obj.put("isAuthentication","1");
//		obj.put("secondLevelCategoryId","74889da6-955e-4454-870f-4da37b466264");
//        obj.put("firstLevelCategoryName","健康文章");
//        obj.put("secondLevelCategoryName","孕检知识");
@ -69,10 +69,10 @@ public class ArticleApiTest {
//		obj.put("articleTitle","1");
//		obj.put("userCode","0de7295862dd11e69faffa163e8aee56");
		obj.put("roleType",1);
		obj.put("currentUserRole","3502110400");
		obj.put("currentUserRoleLevel","4");
		obj.put("currentUserRole","3502030700");
		obj.put("currentUserRoleLevel",4);//
//		obj.put("currentUserRole","3502110400");
//		obj.put("currentUserRoleLevel","4");
		obj.put("userCode","0de7295862dd11e69faffa163e8aee56");//ylp201703150222
		obj.put("page","0");
		obj.put("pageSize","10");
		obj.put("sEcho","1");

+ 23 - 0
edu-article/JkEdu/src/com/yihu/jk/api/ArticleQRCodeApi.java

@ -47,6 +47,7 @@ public class ArticleQRCodeApi {
			String orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName"); //创建人所属机构名称
			String operatorRoleCode = StringUtil.isEmpty(json.get("operatorRoleCode")) ? null : json.getString("operatorRoleCode"); //操作人角色code
			String operatorRoleLevel = StringUtil.isEmpty(json.get("operatorRoleLevel")) ? null : json.getString("operatorRoleLevel"); //操作人角色级别
			String identification = StringUtil.isEmpty(json.get("identification")) ? null : json.getString("identification"); //认证标识文字
			ArticleQR bean = new ArticleQR();
			bean.setImgUrl(imgUrl);
			bean.setPosition(Integer.valueOf(position));
@ -56,6 +57,7 @@ public class ArticleQRCodeApi {
			bean.setOrgName(orgName);
			bean.setOperatorRoleCode(operatorRoleCode);
			bean.setOperatorRoleLevel(operatorRoleLevel);
			bean.setIdentification(identification);
			Integer code = dao.saveArticleQRCode(bean);
			if (code != 1) {
				return ApiUtil.getRespJSON(-1, "数据库操作异常").toString();
@ -78,6 +80,7 @@ public class ArticleQRCodeApi {
		String userName = StringUtil.isEmpty(json.get("userName")) ? null : json.getString("userName"); //创建人名称
		String orgId = StringUtil.isEmpty(json.get("orgId")) ? null : json.getString("orgId"); //创建人所属机构ID
		String orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName"); //创建人所属机构名称
		String identification = StringUtil.isEmpty(json.get("identification")) ? null : json.getString("identification"); //认证标识文字
//		String operatorRoleCode = StringUtil.isEmpty(json.get("operatorRoleCode")) ? null : json.getString("operatorRoleCode"); //操作人角色code
//		String operatorRoleLevel = StringUtil.isEmpty(json.get("operatorRoleLevel")) ? null : json.getString("operatorRoleLevel"); //操作人角色级别
		try {
@ -92,6 +95,7 @@ public class ArticleQRCodeApi {
			bean.setOperatorName(userName);
			bean.setOrgId(orgId);
			bean.setOrgName(orgName);
			bean.setIdentification(identification);
			Integer code = dao.updateArticleQRCode(bean);
			if (code != 1) {
				return ApiUtil.getRespJSON(-1, "数据库操作异常").toString();
@ -103,4 +107,23 @@ public class ArticleQRCodeApi {
			return ApiUtil.getRespJSON(-14444, e.getMessage()).toString();
		}
	}
	public String getArticleQRCodeById(InterfaceMessage im){
		JSONObject json = JSONObject.fromObject(im.getParam());
		Integer id = StringUtil.isEmpty(json.get("id")) ? null : json.getInt("id"); //id
		try {
			ArticleQR bean = new ArticleQR();
			bean.setId(id);
			ArticleQR articleQR = dao.getArticleQRCodeById(bean);
			JSONObject jsonArticleQR = JSONObject.fromObject(articleQR);
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
			rv.put("Result", jsonArticleQR.toString());
			return rv.toString();
		}catch (Exception e) {
			e.printStackTrace();
			return ApiUtil.getRespJSON(-14444, e.getMessage()).toString();
		}
	}
}

+ 5 - 3
edu-article/JkEdu/src/com/yihu/jk/api/ArticleQRCodeApiTest.java

@ -27,11 +27,13 @@ public class ArticleQRCodeApiTest {
		ArticleQRCodeApi api = new ArticleQRCodeApi();
		InterfaceMessage im = new InterfaceMessage();
		JSONObject obj = new JSONObject();
		obj.put("currentRoleLevel","1");
		obj.put("currentRoleCode","350200");
//		obj.put("currentRoleLevel","1");
//		obj.put("currentRoleCode","350200");
		obj.put("id",7);
		obj.put("identification","认证");
		im.setParam(obj.toString());
		initDB();
		System.out.println(api.getArticleQRCode(im));
		System.out.println(api.updateArticleQRCode(im));
	}

+ 2 - 0
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java

@ -600,6 +600,7 @@ public class ArticleDao {
        if(StringUtil.isNotEmpty(userCode)){
			param2.append(" and  a.UserId='"+userCode+"'");
			param.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 and RoleType = '"+vo.getRoleType()+"')");
		}
//		pageParam.append(" limit ").append(start * pageSize + "," + pageSize);
		sql.addVar("@Condition", param.toString());
@ -697,6 +698,7 @@ public class ArticleDao {
		if(StringUtil.isNotEmpty(userCode)){
			param2.append(" and  a.UserId='"+userCode+"'");
			param.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 and RoleType = '"+vo.getRoleType()+"')");
		}
		pageParam.append(" limit ").append(start * pageSize + "," + pageSize);
		sql.addVar("@Condition", param.toString());

+ 16 - 0
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleQRCodeDao.java

@ -2,13 +2,16 @@ package com.yihu.jk.dao;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;
import com.common.json.JSONObject;
import com.coreframework.db.DB;
import com.coreframework.db.Sql;
import com.coreframework.remoting.standard.DateOper;
import com.yihu.jk.enums.*;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.vo.ArticleQR;
import com.yihu.jk.vo.ArticleStatistic;
import com.yihu.jk.vo.OperationLogVo;
import org.springframework.stereotype.Component;
@ -112,4 +115,17 @@ public class ArticleQRCodeDao {
		return code;
	}
	public ArticleQR getArticleQRCodeById(ArticleQR vo) throws SQLException {
		Sql sql = DB.me().createSql(ArticleQRSqlNameEnum.getArticleQRDetail);
		StringBuffer param = new StringBuffer();
		if (StringUtil.isNotEmpty(vo.getId())) {
			param.append(" and Id = ").append(vo.getId());
		}
		sql.addVar("@Condition", param.toString());
		ArticleQR articleQR = DB.me().queryForBean(MyDatabaseEnum.JkEduDB, sql, ArticleQR.class);
		return articleQR;
	}
}

+ 18 - 0
edu-article/JkEdu/src/com/yihu/jk/vo/ArticleStatistic.java

@ -26,6 +26,8 @@ public class ArticleStatistic {
	private String endTime;
	private String articleType;// 文章类型
	private Integer isAuthentication;// 是否认证
	private String ArticleCategoryId;// 文章类别Id
	private String ArticleCategoryName;// 文章类别
	private int browseNumber;// 浏览数
	private int pointNumber;// 点赞数
	private int commentNumber;// 评论数
@ -349,4 +351,20 @@ public class ArticleStatistic {
	public void setRoleType(Integer roleType) {
		RoleType = roleType;
	}
	public String getArticleCategoryId() {
		return ArticleCategoryId;
	}
	public void setArticleCategoryId(String articleCategoryId) {
		ArticleCategoryId = articleCategoryId;
	}
	public String getArticleCategoryName() {
		return ArticleCategoryName;
	}
	public void setArticleCategoryName(String articleCategoryName) {
		ArticleCategoryName = articleCategoryName;
	}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java

@ -85,7 +85,7 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        String tempPath = SystemConf.getInstance().getTempPath() ;
        registry.addResourceHandler(tempPath+"/**").addResourceLocations("file:"+tempPath+ File.separator);
        registry.addResourceHandler(tempPath+"/**").addResourceLocations("file:"+tempPath+ "/");
        super.addResourceHandlers(registry);
    }

+ 155 - 67
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.yihu.edu.entity.RoleWithAuthorityCheck;
import com.yihu.es.entity.FollowupContentESDO;
import com.yihu.es.entity.HealthEduArticleES;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.es.entity.RoleVo;
import com.yihu.wlyy.config.es.ElasticFactory;
@ -14,6 +15,7 @@ import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
@ -57,6 +59,8 @@ public class JMJkEduArticleService extends BaseService {
    private String esType;
    @Value("${es.index.HealthEduArticlePatient}")
    private String esIndex;
    @Autowired
    private AdminTeamService adminTeamService;
    
    @Autowired
    private ElasticFactory elasticFactory;
@ -69,6 +73,8 @@ public class JMJkEduArticleService extends BaseService {
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private ElastricSearchSave elastricSearchSave;
    @Autowired
    private GcLabelService labelService;
@ -415,7 +421,7 @@ public class JMJkEduArticleService extends BaseService {
     * @param articleId   文章列表
     */
    @Transactional
    public HealthEduArticlePatient savePCPushArticle(Set<String> patientSet,
    public List<HealthEduArticleES> savePCPushArticle(Set<String> patientSet,
                                                     String sendCode,
//                                                  String sendName,
                                                     Integer sendType,
@ -427,87 +433,169 @@ public class JMJkEduArticleService extends BaseService {
                                                     String currentUserRoleLevel) throws Exception {
        String batchNo = UUID.randomUUID().toString();
        List<Patient> patientList = new ArrayList<>();
//        String batchNo = UUID.randomUUID().toString();
//        List<Patient> patientList = new ArrayList<>();
//
//        for (String patient : patientSet) {
//            patientList.add(new Patient(patient));
//        }
//        HealthEduArticlePatient healthEduArticlePatient = new HealthEduArticlePatient();
//
//        Doctor doctor = doctorDao.findByCode(sendCode);
//        String sendName = doctor.getName();
//        //1、普通医生,2、管理员
//        if(sendType==2){
//            String resultSql ="";
//            String whereSql ="";
//            switch (currentUserRoleLevel){
//                case "1":{resultSql +=" DISTINCT (province_name) as name";
//                    whereSql+=" and province ='"+currentUserRoleCode+"'";break;}
//                case "2":{resultSql +=" DISTINCT (city_name) as name";
//                    whereSql+=" and city ='"+currentUserRoleCode+"'";break;}
//                case "3":{resultSql +=" DISTINCT (town_name) as name";
//                    whereSql+=" and town ='"+currentUserRoleCode+"'";break;}
//                case "4":{resultSql +=" DISTINCT (name) as name";
//                    whereSql+=" and code ='"+currentUserRoleCode+"'";break;}
//            }
//            String sql = "select "+resultSql+" from dm_hospital  where level=2 "+whereSql ;
//            List<Map<String, Object>> returnList = jdbcTemplate.queryForList(sql);
//            sendName = returnList.get(0).get("name")+"";
//
//            Map<String,Object> resultMap = labelService.fetchUserHighestAuthority(sendCode);
//            List<String> roleList = (List<String>)resultMap.get("roleList");
//            List<RoleVo> roleVoLists= new ArrayList<>();
//            for(String one:roleList){
//                RoleVo roleVo = new RoleVo();
//                roleVo.setCode(one);
//                roleVoLists.add(roleVo);
//            }
//            healthEduArticlePatient.setRoleList(roleVoLists);
//            healthEduArticlePatient.setCurrentUserRoleCode(currentUserRoleCode);
//            healthEduArticlePatient.setCurrentUserRoleLevel(currentUserRoleLevel);
//        }else{
//            healthEduArticlePatient.setCurrentUserRoleCode(doctor.getHospital());
//            healthEduArticlePatient.setCurrentUserRoleLevel("4");
//        }
//        healthEduArticlePatient.setSendType(sendType);
//        healthEduArticlePatient.setDoctorCode(sendCode);
//        healthEduArticlePatient.setSendName(sendName);
//        healthEduArticlePatient.setAdminTeamCode(teamId);
//        healthEduArticlePatient.setLeaveWords(leaveWords);
//        if (doctor != null) {
//            healthEduArticlePatient.setDoctorName(doctor.getName());
//            healthEduArticlePatient.setHospital(doctor.getHospital());
//            healthEduArticlePatient.setHospitalName(doctor.getHospitalName());
//            healthEduArticlePatient.setTown(doctor.getTown());
//            healthEduArticlePatient.setTownName(doctor.getTownName());
//            healthEduArticlePatient.setSendLevel(doctor.getLevel() != null ? String.valueOf(doctor.getLevel()) : "");
//            healthEduArticlePatient.setSendPic(doctor.getPhoto());
//            healthEduArticlePatient.setSendSex(doctor.getSex() != null ? String.valueOf(doctor.getSex()) : "");
//        }
//        healthEduArticlePatient.setBatchNo(batchNo);
//        healthEduArticlePatient.setCreateTime(new Date());
//
//
//        //通过文章id 获取文章详情
//        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
//
//        healthEduArticlePatient.setArticleId(article.get("articleId") + "");
//        healthEduArticlePatient.setAttachedTitle(article.get("articleTitle") + "");
//        healthEduArticlePatient.setAttachedPic(article.get("articleCover") + "");
//        healthEduArticlePatient.setAttachedContent(article.get("articleContent") + "");
//        healthEduArticlePatient.setAttachedMessage(sendMessage);
//        healthEduArticlePatient.setArticleType(article.get("articleType") + "");
//        healthEduArticlePatient.setLevel(article.get("articlelevel") + "");
//        healthEduArticlePatient.setLevel1Type(article.get("firstLevelCategoryId") + "");
//        healthEduArticlePatient.setLevel2Type(article.get("secondLevelCategoryId") + "");
//        healthEduArticlePatient.setType("1");//文章
////        healthEduArticlePatient.setArticleUrl(articleBaseUrl+"JkEduWeb/web/jkEdu/articleDetail.html?behavior=4&articleId="+articleId+"&userId="+);
//        healthEduArticlePatient.setPatients(patientList);
        for (String patient : patientSet) {
            patientList.add(new Patient(patient));
        List<HealthEduArticleES> healthEduArticleESList = new ArrayList<>();
        String resultSql ="";
        String whereSql ="";
        switch (currentUserRoleLevel){
            case "1":{resultSql +=" DISTINCT (province_name) as name";
                whereSql+=" and province ='"+currentUserRoleCode+"'";break;}
            case "2":{resultSql +=" DISTINCT (city_name) as name";
                whereSql+=" and city ='"+currentUserRoleCode+"'";break;}
            case "3":{resultSql +=" DISTINCT (town_name) as name";
                whereSql+=" and town ='"+currentUserRoleCode+"'";break;}
            case "4":{resultSql +=" DISTINCT (name) as name";
                whereSql+=" and code ='"+currentUserRoleCode+"'";break;}
        }
        HealthEduArticlePatient healthEduArticlePatient = new HealthEduArticlePatient();
        String sql = "select "+resultSql+" from dm_hospital  where level=2 "+whereSql ;
        List<Map<String, Object>> returnList = jdbcTemplate.queryForList(sql);
        String doctorName = returnList.get(0).get("name")+"";
        Doctor doctor = doctorDao.findByCode(sendCode);
        String sendName = doctor.getName();
        //1、普通医生,2、管理员
        if(sendType==2){
            String resultSql ="";
            String whereSql ="";
            switch (currentUserRoleLevel){
                case "1":{resultSql +=" DISTINCT (province_name) as name";
                    whereSql+=" and province ='"+currentUserRoleCode+"'";break;}
                case "2":{resultSql +=" DISTINCT (city_name) as name";
                    whereSql+=" and city ='"+currentUserRoleCode+"'";break;}
                case "3":{resultSql +=" DISTINCT (town_name) as name";
                    whereSql+=" and town ='"+currentUserRoleCode+"'";break;}
                case "4":{resultSql +=" DISTINCT (name) as name";
                    whereSql+=" and code ='"+currentUserRoleCode+"'";break;}
        AdminTeam adminTeam = adminTeamService.getTeam(teamId);
        Patient one = null;
        String batchNo = UUID.randomUUID().toString();
        for (String patient : patientSet) {
            one = patientDao.findByCode(patient);
            HealthEduArticleES healthEduArticleES = new HealthEduArticleES();
            healthEduArticleES.setBatchNo(batchNo);
            healthEduArticleES.setPatientCode(patient);
            healthEduArticleES.setPatientName(one.getName());
            if(sendType==2){
                healthEduArticleES.setDoctorCode(currentUserRoleCode);
                healthEduArticleES.setDoctorName(doctorName);
                healthEduArticleES.setSendLevel("4");
            }else{
                healthEduArticleES.setSendLevel(doctor.getLevel()+"");
            }
            String sql = "select "+resultSql+" from dm_hospital  where level=2 "+whereSql ;
            List<Map<String, Object>> returnList = jdbcTemplate.queryForList(sql);
            sendName = returnList.get(0).get("name")+"";
            healthEduArticleES.setSendCode(doctor.getCode());
            healthEduArticleES.setSendName(doctor.getName());
            healthEduArticleES.setSendPic(doctor.getPhoto());
            healthEduArticleES.setSendSex(doctor.getSex()+"");
            healthEduArticleES.setAdminTeamCode(adminTeam.getId());
            healthEduArticleES.setAdminTeamName(adminTeam.getName());
            healthEduArticleES.setHospital(doctor.getHospital());
            healthEduArticleES.setHospitalName(doctor.getHospitalName());
            healthEduArticleES.setTown(doctor.getTown());
            healthEduArticleES.setTownName(doctor.getTownName());
            healthEduArticleES.setCreateTime(new Date());
            healthEduArticleES.setSendType(sendType);
            JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
            healthEduArticleES.setArticleId(article.get("articleId") + "");
            healthEduArticleES.setArticleTitle(article.get("articleTitle") + "");
            healthEduArticleES.setArticleCover(article.get("articleCover") + "");
            healthEduArticleES.setArticleContent(article.get("articleContent") + "");
            healthEduArticleES.setArticleCategoryId(article.get("articleCategoryId") + "");
            healthEduArticleES.setFirstLevelCategoryId(article.get("firstLevelCategoryId") + "");
            healthEduArticleES.setFirstLevelCategoryName(article.get("firstLevelCategoryName") + "");
            healthEduArticleES.setSecondLevelCategoryId(article.get("secondLevelCategoryId") + "");
            healthEduArticleES.setSecondLevelCategoryName(article.get("secondLevelCategoryName") + "");
            healthEduArticleES.setOperatorId(article.get("operatorId") + "");
            healthEduArticleES.setArticleSource(article.get("articleSource") + "");
            Map<String,Object> resultMap = labelService.fetchUserHighestAuthority(sendCode);
            List<String> roleList = (List<String>)resultMap.get("roleList");
            List<RoleVo> roleVoLists= new ArrayList<>();
            for(String one:roleList){
            for(String temp:roleList){
                RoleVo roleVo = new RoleVo();
                roleVo.setCode(one);
                roleVo.setCode(temp);
                roleVoLists.add(roleVo);
            }
            healthEduArticlePatient.setRoleList(roleVoLists);
            healthEduArticlePatient.setCurrentUserRoleCode(currentUserRoleCode);
            healthEduArticlePatient.setCurrentUserRoleLevel(currentUserRoleLevel);
        }else{
            healthEduArticlePatient.setCurrentUserRoleCode(doctor.getHospital());
            healthEduArticlePatient.setCurrentUserRoleLevel("4");
        }
        healthEduArticlePatient.setSendType(sendType);
        healthEduArticlePatient.setDoctorCode(sendCode);
        healthEduArticlePatient.setSendName(sendName);
        healthEduArticlePatient.setAdminTeamCode(teamId);
        healthEduArticlePatient.setLeaveWords(leaveWords);
        if (doctor != null) {
            healthEduArticlePatient.setDoctorName(doctor.getName());
            healthEduArticlePatient.setHospital(doctor.getHospital());
            healthEduArticlePatient.setHospitalName(doctor.getHospitalName());
            healthEduArticlePatient.setTown(doctor.getTown());
            healthEduArticlePatient.setTownName(doctor.getTownName());
            healthEduArticlePatient.setSendLevel(doctor.getLevel() != null ? String.valueOf(doctor.getLevel()) : "");
            healthEduArticlePatient.setSendPic(doctor.getPhoto());
            healthEduArticlePatient.setSendSex(doctor.getSex() != null ? String.valueOf(doctor.getSex()) : "");
            healthEduArticleES.setRoleList(roleVoLists);
            healthEduArticleES.setLeaveWords(leaveWords);
            healthEduArticleES.setCurrentUserRoleCode(currentUserRoleCode);
            healthEduArticleES.setCurrentUserRoleLevel(currentUserRoleLevel);
//            healthEduArticleES.setSendSource();
            healthEduArticleES.setAllCount(patientSet.size());
            healthEduArticleESList.add(healthEduArticleES);
        }
        healthEduArticlePatient.setBatchNo(batchNo);
        healthEduArticlePatient.setCreateTime(new Date());
        //通过文章id 获取文章详情
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        healthEduArticlePatient.setArticleId(article.get("articleId") + "");
        healthEduArticlePatient.setAttachedTitle(article.get("articleTitle") + "");
        healthEduArticlePatient.setAttachedPic(article.get("articleCover") + "");
        healthEduArticlePatient.setAttachedContent(article.get("articleContent") + "");
        healthEduArticlePatient.setAttachedMessage(sendMessage);
        healthEduArticlePatient.setArticleType(article.get("articleType") + "");
        healthEduArticlePatient.setLevel(article.get("articlelevel") + "");
        healthEduArticlePatient.setLevel1Type(article.get("firstLevelCategoryId") + "");
        healthEduArticlePatient.setLevel2Type(article.get("secondLevelCategoryId") + "");
        healthEduArticlePatient.setType("1");//文章
//        healthEduArticlePatient.setArticleUrl(articleBaseUrl+"JkEduWeb/web/jkEdu/articleDetail.html?behavior=4&articleId="+articleId+"&userId="+);
        healthEduArticlePatient.setPatients(patientList);
        //保存到ES中
        elastricSearchSave.save(healthEduArticlePatient, esIndex, esType);
        return healthEduArticlePatient;
        elastricSearchSave.save(healthEduArticleESList, esIndex, esType);
        return healthEduArticleESList;
    }
    public JSONObject pushArticleConfirm(String articleId, String labelUnit, String labelSex, String labelServe, String labelDisease, String labelHealth,String userCode,String currentUserRole, String currentUserRoleLevel) throws Exception {
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java

@ -47,7 +47,7 @@ public class BaseController {
            JSONObject json = new JSONObject(userAgent);
            return json.getString("uid");
//            return "hqD2016082902";// wjw00000001000e6badcfa163e424589/wjw00000001000e6badcfa163e424525
//            return "xh1D2017031502222";// wjw00000001000e6badcfa163e424589/wjw00000001000e6badcfa163e424525
        } catch (Exception e) {
            return null;
        }

+ 16 - 15
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.doctor.jimeiJkEdu;
import com.alibaba.fastjson.JSONObject;
import com.yihu.es.entity.HealthEduArticleES;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.education.HealthEduArticle;
@ -57,21 +58,21 @@ public class DoctorJMJkEduArticleController extends BaseController {
     * 发送到redis
     *
     */
    public void sender(HealthEduArticlePatient healthEduArticlePatient) {
    public void sender(List<HealthEduArticleES> HealthEduArticleES) {
        //送到到队列
        List<Patient> patients = healthEduArticlePatient.getPatients();
        patients.stream().forEach(one -> {
            healthEduArticlePatient.setPatient(one.getCode());
            healthEduArticlePatient.setPatients(null);
//        List<Patient> patients = healthEduArticlePatient.getPatients();
        HealthEduArticleES.stream().forEach(one -> {
//            healthEduArticlePatient.setPatient(one.getCode());
//            healthEduArticlePatient.setPatients(null);
            //temp.setUrl(url + "jkjy/html/article.html?openid=" + openid + "&dataId=" + json.getString("article") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
//            healthEduArticlePatient.setArticleUrl(articleBaseUrl+"jkjy/html/article2.html?openid=" + openid + "&dataId=" + json.getString("article") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"))
//            healthEduArticlePatient.setArticleUrl(articleBaseUrl+"JkEduWeb/web/jkEdu/articleDetail.html?behavior=4&articleId="+healthEduArticlePatient.getArticleId()+"&userId="+one);
            healthEduArticlePatient.setArticleUrl("新版文章请求路径");
            one.setNewArricleFlag(true);
            jmsTemplate.send(channelName, new MessageCreator() {
                @Override
                public Message createMessage(Session session) throws JMSException {
                    TextMessage textMessage = session.createTextMessage();
                    textMessage.setText(net.sf.json.JSONObject.fromObject(healthEduArticlePatient).toString());
                    textMessage.setText(net.sf.json.JSONObject.fromObject(one).toString());
                    return textMessage;
                }
            });
@ -147,13 +148,13 @@ public class DoctorJMJkEduArticleController extends BaseController {
            jmJkEduArticleService.initPatient(patientSet,labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID(),currentRoleCode,currentRoleLevel);
//            patientSet.add(patientService.findByCode("wjw00000001000e6badcfa163e424525"));
            //获取保存发送记录
            patientSet = new HashSet<>();
            patientSet.add("915cc456-5b1d-11e6-8344-fa163e8aee56");
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 2,"", 0L, articleId,leaveWords,currentRoleCode,currentRoleLevel);
//            patientSet = new HashSet<>();
//            patientSet.add("915cc456-5b1d-11e6-8344-fa163e8aee56");
            List<HealthEduArticleES> healthEduArticleESList = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 2,"", 0L, articleId,leaveWords,currentRoleCode,currentRoleLevel);
            //推送微信模板消息和发送im消息
            new Thread(() -> {
                //发送任务到redis
                sender(healthEduArticlePatient);
                sender(healthEduArticleESList);
            }).start();
            return new BaseResultModel();
        }catch (Exception e) {
@ -351,11 +352,11 @@ public class DoctorJMJkEduArticleController extends BaseController {
            if(StringUtils.isEmpty(currentUserRoleLevel)){
                currentUserRoleLevel = getCurrentRoleLevel();
            }
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 1,"", teamCode, articleId,leaveWords,currentUserRole,currentUserRoleLevel);
            List<HealthEduArticleES> healthEduArticleESList = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 1,"", teamCode, articleId,leaveWords,currentUserRole,currentUserRoleLevel);
            //推送微信模板消息和发送im消息
            new Thread(() -> {
                //发送任务到redis
                sender(healthEduArticlePatient);
                sender(healthEduArticleESList);
            }).start();
            return new BaseResultModel();
        } catch (Exception e) {
@ -384,11 +385,11 @@ public class DoctorJMJkEduArticleController extends BaseController {
            //得到需要发送的患者
            patientSet.add(patientCode);
//            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 1,"", 0L, articleId,leaveWords,currentUserRole,currentUserRoleLevel);
            List<HealthEduArticleES> healthEduArticleESList = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 1,"", 0L, articleId,leaveWords,currentUserRole,currentUserRoleLevel);
            //推送微信模板消息和发送im消息
            new Thread(() -> {
                //发送任务到redis
                sender(healthEduArticlePatient);
                sender(healthEduArticleESList);
            }).start();
            return new BaseResultModel();
        }catch (Exception e) {