Bläddra i källkod

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

zd_123 7 år sedan
förälder
incheckning
c4ace5f91c
25 ändrade filer med 382 tillägg och 109 borttagningar
  1. 9 0
      common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticleES.java
  2. 4 4
      edu-article/JkEdu/src/Article.sql.xml
  3. 1 1
      edu-article/JkEdu/src/articlePc.sql.xml
  4. 3 1
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  5. 26 6
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java
  6. 2 3
      edu-article/JkEdu/src/com/yihu/jk/api/BehaviorApi.java
  7. 67 36
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java
  8. 10 1
      edu-article/JkEdu/src/com/yihu/jk/vo/ArticleStatistic.java
  9. 0 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/SignZYService.java
  10. 2 2
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/FollowUpSynJob.java
  11. 44 18
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  12. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java
  13. 8 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorGuidanceTempDao.java
  14. 6 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorTeamGuidanceTemplateDao.java
  15. 24 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  16. 15 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  17. 66 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempService.java
  18. 11 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  19. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ElasticsearchUtil.java
  20. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java
  21. 42 28
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java
  22. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java
  23. 18 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java
  24. 2 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/jimeiJkEdu/PatientJMJkEduArticleController.java
  25. 10 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/HealthEduArticlePatientModel.java

+ 9 - 0
common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticleES.java

@ -58,6 +58,7 @@ public class HealthEduArticleES {
    private String currentUserRoleLevel;//发送者当前登录的角色级别
    private Integer sendSource; //1或者为空 i健康后台推送  2PC端推送
    private Integer allCount;//所有的推送数目
    private Long readNumber;//阅读数(备注和浏览数不一样)
    @Transient
    private Boolean newArricleFlag;//新版文章推送标志
@ -367,4 +368,12 @@ public class HealthEduArticleES {
    public void setUserType(Integer userType) {
        this.userType = userType;
    }
    public Long getReadNumber() {
        return readNumber;
    }
    public void setReadNumber(Long readNumber) {
        this.readNumber = readNumber;
    }
}

+ 4 - 4
edu-article/JkEdu/src/Article.sql.xml

@ -3,8 +3,8 @@
	<Sqls>
		<Sql name='getArticleList'>
			<![CDATA[
		select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber  from Org_Article m
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
		select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber, IFNULL(n.PushNumber,0) as PushNumber
		from Org_Article m JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
		
			]]>
		</Sql>
@ -17,7 +17,7 @@ LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Conditi
		</Sql>
		<Sql name='getCollectionArticleList'>
			<![CDATA[
select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from (
select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber, IFNULL(n.PushNumber,0) as PushNumber from (
select m.* from Org_Article m  INNER JOIN User_ArticleCollection n on  m.articleid=n.ArticleId and  1=1 @UserParam) as aa LEFT JOIN 
User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
@ -94,7 +94,7 @@ FROM dual   where not exists( select ArticleId from User_ArticleStatistics where
		<Sql name='insertArticleInitStatistic'>
			<![CDATA[
			INSERT INTO User_ArticleStatistics (ArticleId, BrowseNumber, PointNumber, CommentNumber, ShareNumber, CollectionNumber) VALUES (?,?,?,?,?,?);
			INSERT INTO User_ArticleStatistics (ArticleId, BrowseNumber, PointNumber, CommentNumber, ShareNumber, CollectionNumber,PushNumber) VALUES (?,?,?,?,?,?,?);
			]]>

+ 1 - 1
edu-article/JkEdu/src/articlePc.sql.xml

@ -4,7 +4,7 @@
		 <Sql name='getArticlePcList'>
		 <![CDATA[
				select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber ,
				(select count(1) from user_articlecollection a where a.ArticleId=m.ArticleId  @Condition2 )as collectionType from Org_Article m
				(select count(1) from user_articlecollection a where a.ArticleId=m.ArticleId  @Condition2 )as collectionType, IFNULL(n.PushNumber,0) as PushNumber from Org_Article m
				LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1   and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   @PageParam
			]]>
		</Sql>

+ 3 - 1
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -236,6 +236,7 @@ public class ArticleApi {
					jsonObj.put("userScope", StringUtil.getJSONValue(vbo.getUserScope()));
					jsonObj.put("articleCategoryId", StringUtil.getJSONValue(vbo.getArticleCategoryId()));
					jsonObj.put("articleCategoryName", StringUtil.getJSONValue(vbo.getArticleCategoryName()));
					jsonObj.put("pushNumber", StringUtil.getJSONValue(vbo.getPushNumber()));
					if (StringUtil.isNotEmpty(userId)) {
						vo.setUserId(userId);
						vo.setUserType(userType);
@ -281,7 +282,8 @@ public class ArticleApi {
				dao.updateArticleStatistic(articleId, "CommentNumber", behaviorAction, number);
			} else if (behaviorAction == 6) {// 收藏
				dao.updateArticleStatistic(articleId, "CollectionNumber", behaviorAction, number);
			}else if (behaviorAction == 7) {// 发送
				dao.updateArticleStatistic(articleId, "PushNumber", behaviorAction, number);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block

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

@ -2,6 +2,7 @@ package com.yihu.jk.api;
import com.coreframework.remoting.standard.DateOper;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.vo.Behavior;
import com.yihu.jk.vo.Category;
import net.sf.json.JSONObject;
@ -33,7 +34,7 @@ public class ArticleApiTest {
		// System.out.println(api.getCollectionArticalList(im));
		// System.out.println(api.getArticalById(im));
		queryArticlePcList();
		saveBehavior();
//		System.out.printf("350200".substring(0,3));
	}
@ -60,25 +61,25 @@ public class ArticleApiTest {
//		obj.put("articleId","0");
//		obj.put("isAuthentication","1");
		obj.put("secondLevelCategoryId","74889da6-955e-4454-870f-4da37b466264");
//		obj.put("secondLevelCategoryId","74889da6-955e-4454-870f-4da37b466264");
//        obj.put("firstLevelCategoryName","健康文章");
//        obj.put("secondLevelCategoryName","孕检知识");
//		obj.put("insertTimeStart","1");
//		obj.put("insertTimeEnd","1");
//		obj.put("articlelevel","1");
//		obj.put("articleTitle","1");
//		obj.put("articleTitle","我是");
//		obj.put("userCode","0de7295862dd11e69faffa163e8aee56");
		obj.put("currentUserRole","3502110100");
		obj.put("currentUserRole","350200");
		obj.put("userCode","37959ddf86f211e6b394fa163e424525");//ylp201703150222
		obj.put("roleType",1);
		obj.put("isMyArticle",true);
		obj.put("page","0");
		obj.put("pageSize","9");
		obj.put("currentUserRoleLevel",4);//
		obj.put("currentUserRoleLevel",2);//
		obj.put("sEcho","1");
//		obj.put("articleTitle","我口试");
		obj.put("articleTitle","健管师");
		im.setParam(obj.toString());
		initDB();
		try{
@ -115,4 +116,23 @@ public class ArticleApiTest {
		}
	}
	public static void saveBehavior(){
		BehaviorApi api = new BehaviorApi();
		InterfaceMessage im = new InterfaceMessage();
		JSONObject obj = new JSONObject();
		obj.put("articleId","0A2BABB7A6734DD7B47496461CF04B21");
		obj.put("cName","标题");//
		obj.put("userId","11");
		obj.put("number",2);//
		obj.put("behaviorAction",7);
		im.setParam(obj.toString());
		initDB();
		try{
//			api.authenticationArticle(im);
			System.out.println(api.saveBehavior(im));
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}

+ 2 - 3
edu-article/JkEdu/src/com/yihu/jk/api/BehaviorApi.java

@ -31,10 +31,10 @@ public class BehaviorApi {
		String articleId = StringUtil.isEmpty(json.get("articleId")) ? null : json.getString("articleId");
		String cName = StringUtil.isEmpty(json.get("cName")) ? null : json.getString("cName");
		String userId = StringUtil.isEmpty(json.get("userId")) ? null : json.getString("userId");
		int number = StringUtil.isEmpty(json.get("number")) ? 1 : json.getInt("number");
		// 1、点赞 2、转发3、分享 4、浏览
		Integer behaviorAction = StringUtil.isEmpty(json.get("behaviorAction")) ? null : json.getInt("behaviorAction");
		if (StringUtil.isEmpty(articleId) || StringUtil.isEmpty(behaviorAction) || StringUtil.isEmpty(cName)
				|| StringUtil.isEmpty(userId)) {
		if (StringUtil.isEmpty(articleId) || StringUtil.isEmpty(behaviorAction) || StringUtil.isEmpty(userId)) {
			return ApiUtil.getRespJSON(-10000, "ArticleId,BehaviorAction,CName,UserId 为必填项,入参为:" + json.toString())
					.toString();
		}
@ -47,7 +47,6 @@ public class BehaviorApi {
		arvo.setArticleId(articleId);
		try {
			subDao.saveBehavior(vo);
			int number = 1;
			ArticleApi.updateArticleStatistic(articleId, behaviorAction, number);
			return ApiUtil.getRespJSON(10000, "成功").toString();
		} catch (SQLException e) {

+ 67 - 36
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java

@ -560,6 +560,31 @@ public class ArticleDao {
		if (StringUtil.isNotEmpty(vo.getOperatorId())) {
			param.append(" and OperatorId ='"+vo.getOperatorId()+"' ");
		}
		if(StringUtil.isNotEmpty(vo.getOperatorRoleLevel())){
			int roleLevel = Integer.valueOf(vo.getOperatorRoleLevel())-1;
			String temp = "";
			for(int i=1;i<roleLevel;i++){//123
				switch(i){
					case 1:{temp+=" or UserScope = 1 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,4)+"00 "):vo.getOperatorRoleCode())+"'";break;}
					case 2:{temp+=" or UserScope = 2 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,6)):vo.getOperatorRoleCode())+"'";break;}
					case 3:{temp+=" or UserScope = 3 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode()):vo.getOperatorRoleCode())+"'";break;}
				}
			}
			if(!StringUtils.isEmpty(temp)){
				param3.append(temp.substring(3));
				param3.append("  or (UserScope = ? and OperatorRoleCode =?) ");
			}else{
				param3.append("  (UserScope = ? and OperatorRoleCode =?) ");
			}
			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
			sql.addParamValue(vo.getOperatorRoleCode());
		}else{
			param3.append(" UserScope <= 3 ");
//
		}
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+")");
		if("1".equals(vo.getOperatorRoleLevel())){//省
//			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,3)+"%' ");
		}else if("2".equals(vo.getOperatorRoleLevel())){//市
@ -574,20 +599,10 @@ public class ArticleDao {
		}
		param3.append(" or (OperatorRoleLevel= "+vo.getOperatorRoleLevel()+" and OperatorRoleCode = '"+vo.getOperatorRoleCode()+"' ) ");
		if(param3.toString().startsWith(" or")){
			param.append("and ("+param3.toString().substring(3)+")");
		}
		if(StringUtil.isNotEmpty(vo.getOperatorRoleLevel())){
			param.append(" and (UserScope <= ? ");
            sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
        }else{
			param.append(" and (UserScope <= 3 ");
//
        }
        param.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 and RoleType = "+vo.getRoleType()+"))");
		if(StringUtil.isNotEmpty(vo.getRoleType())) {
		param.append("and ("+param3.toString()+")");
		if(vo.getRoleType()!=null) {
			param.append(" and RoleType = ? ");
			sql.addParamValue(vo.getRoleType());
			sql.addParamValue(vo.getRoleType().intValue());
		}
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
			param.append(" and FirstLevelCategoryId = ? ");
@ -598,7 +613,8 @@ public class ArticleDao {
			sql.addParamValue(vo.getSecondLevelCategoryId());
		}
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
			param.append(" and ArticleTitle like '%"+vo.getArticleTitle()+"%' ");
			param.append(" and m.ArticleTitle like ? ");
			sql.addParamValue("%"+vo.getArticleTitle()+"%");
		}
		if (StringUtil.isNotEmpty(vo.getStartTime())) {
			param.append(" and m.InsertTime >= ? ");
@ -643,8 +659,8 @@ public class ArticleDao {
//			result = dao.getCategoryList( temp, 0, 1000);
//			one.setSecondLevelCategoryName(result.get("CategoryName")+"");
//		}
		log.info("queryArticlePcList:"+sql.toString());
		System.out.printf("queryArticlePcList:"+sql.toString());
//		log.info("queryArticlePcList:"+sql.toString());
//		System.out.printf("queryArticlePcList:"+sql.toString());
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);
	}
@ -670,6 +686,26 @@ public class ArticleDao {
		if (StringUtil.isNotEmpty(vo.getOperatorId())) {
			param.append(" and OperatorId ='"+vo.getOperatorId()+"' ");
		}
		if(StringUtil.isNotEmpty(vo.getOperatorRoleLevel())){
			int roleLevel = Integer.valueOf(vo.getOperatorRoleLevel())-1;
			String temp = "";
			for(int i=1;i<roleLevel;i++){//123
				switch(i){
					case 1:{temp+=" or (UserScope = 1 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,4)+"00 "):vo.getOperatorRoleCode())+"')";break;}
					case 2:{temp+=" or (UserScope = 2 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,6)):vo.getOperatorRoleCode())+"')";break;}
					case 3:{temp+=" or (UserScope = 3 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode()):vo.getOperatorRoleCode())+"')";break;}
				}
			}
			if(!StringUtils.isEmpty(temp)){
				param3.append(temp.substring(3));
				param3.append("  or (UserScope = ? and OperatorRoleCode =?) ");
			}else{
				param3.append("  (UserScope = ? and OperatorRoleCode =?) ");
			}
			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
			sql.addParamValue(vo.getOperatorRoleCode());
		}
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+")");
		if("1".equals(vo.getOperatorRoleLevel())){//省
//			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,3)+"%' ");
		}else if("2".equals(vo.getOperatorRoleLevel())){//市
@ -683,19 +719,11 @@ public class ArticleDao {
			param3.append(" or (OperatorRoleLevel= 3 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,6)+" "):vo.getOperatorRoleCode())+"') ");
		}
		param3.append(" or (OperatorRoleLevel= "+vo.getOperatorRoleLevel()+" and OperatorRoleCode = '"+vo.getOperatorRoleCode()+"' ) ");
		if(param3.toString().startsWith(" or")){
			param.append("and ("+param3.toString().substring(3)+")");
		}
		if(StringUtil.isNotEmpty(vo.getOperatorRoleLevel())){
			param.append(" and (UserScope <= ? ");
			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
		}else{
            param.append(" and (UserScope <= 3 ");
		}
		param.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 and RoleType = "+vo.getRoleType()+"))");
		if(StringUtil.isNotEmpty(vo.getRoleType())) {
		param.append("and ("+param3.toString()+")");
		if(vo.getRoleType()!=null) {
			param.append(" and RoleType = ? ");
			sql.addParamValue(vo.getRoleType());
			sql.addParamValue(vo.getRoleType().intValue());
		}
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
			param.append(" and FirstLevelCategoryId = ? ");
@ -706,7 +734,8 @@ public class ArticleDao {
			sql.addParamValue(vo.getSecondLevelCategoryId());
		}
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
			param.append(" and ArticleTitle like '%"+vo.getArticleTitle()+"%' ");
			param.append(" and m.ArticleTitle like ? ");
			sql.addParamValue("%"+vo.getArticleTitle()+"%");
		}
		if (StringUtil.isNotEmpty(vo.getStartTime())) {
			param.append(" and m.InsertTime >= ? ");
@ -732,8 +761,8 @@ public class ArticleDao {
		sql.addVar("@Condition", param.toString());
		sql.addVar("@Condition2", param2.toString());
		sql.addVar("@PageParam", pageParam.toString());
		log.info("queryArticleAPPList:"+sql.toString());
		System.out.printf("queryArticleAPPList:"+sql.toString());
//		log.info("queryArticleAPPList:"+sql.toString());
//		System.out.printf("queryArticleAPPList:"+sql.toString());
		List<Article> list = DB.me().queryForBeanList(MyDatabaseEnum.JkEduDB, sql,Article.class);
		return list;
//		Category temp = null;
@ -795,7 +824,8 @@ public class ArticleDao {
			sql.addParamValue(vo.getOperatorRoleLevel());
		}
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
			param.append(" and ArticleTitle like '%"+vo.getArticleTitle()+"%' ");
			param.append(" and m.ArticleTitle like ? ");
			sql.addParamValue("%"+vo.getArticleTitle()+"%");
		}
		sql.addVar("@Condition", param.toString());
@ -828,15 +858,16 @@ public class ArticleDao {
        }
        if (vo.getIsAuthentication() != null ) {
            param.append(" and IsAuthentication = ? ");
            sql.addParamValue(vo.getEndTime());
            sql.addParamValue(vo.getIsAuthentication());
        }
        if (StringUtil.isNotEmpty(vo.getOperatorRoleLevel())) {
            param.append(" and OperatorRoleLevel = ? ");
            sql.addParamValue(vo.getOperatorRoleLevel());
        }
        if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
            param.append(" and ArticleTitle like '%"+vo.getArticleTitle()+"%' ");
        }
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
			param.append(" and m.ArticleTitle like ? ");
			sql.addParamValue("%"+vo.getArticleTitle()+"%");
		}
        if (StringUtil.isNotEmpty(vo.getOperatorRoleCode())) {
            param.append(" and OperatorRoleCode ='"+vo.getOperatorRoleCode()+"' ");
        }

+ 10 - 1
edu-article/JkEdu/src/com/yihu/jk/vo/ArticleStatistic.java

@ -33,6 +33,7 @@ public class ArticleStatistic {
	private int commentNumber;// 评论数
	private int shareNumber;// 分享数
	private int collectionNumber;// 收藏数
	private Integer PushNumber;//发送数
	private String secondLevelCategoryName;// 一级类别名称
	private String secondLevelCategoryId;// 二级类别ID
	private String firstLevelCategoryId;// 一级类别ID
@ -41,8 +42,8 @@ public class ArticleStatistic {
	private int userType;// 用户类别 1医生 2居民
	private String DeptName;// 操作人所在科室
	private String TitleLevel;// 等级职称
	private String OperatorImg;// 操作人头像
	private String OperatorImg;// 操作人头像
	private String OperatorRoleCode;//操作人角色code
	private String OperatorRoleLevel;//操作人角色级别
	private Integer UserScope;//使用范围(1、全市使用,2、全区使用,3、全社区使用)
@ -367,4 +368,12 @@ public class ArticleStatistic {
	public void setArticleCategoryName(String articleCategoryName) {
		ArticleCategoryName = articleCategoryName;
	}
	public Integer getPushNumber() {
		return PushNumber;
	}
	public void setPushNumber(Integer pushNumber) {
		PushNumber = pushNumber;
	}
}

+ 0 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/SignZYService.java

@ -1,6 +1,5 @@
package com.yihu.wlyy.service.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.common.SystemConfig;
import com.yihu.wlyy.service.common.util.*;
import com.yihu.wlyy.service.dao.*;

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

@ -35,8 +35,8 @@ public class FollowUpSynJob implements Job {
			do{
				String startTime =  systemDictService.getFollowupSynTime();   //上次执行时间
				logger.info("采集时间:start="+startTime);
				end = DateUtil.getNextMin(DateUtil.strToDate(startTime), 60);
				String endTime = DateUtil.dateToStrLong(end);//采集60分钟后的数据
				end = DateUtil.getNextMin(DateUtil.strToDate(startTime), 20);
				String endTime = DateUtil.dateToStrLong(end);//采集20分钟后的数据
				logger.info("采集时间:end="+endTime);
				//根据起止时间查询家签居民随访记录,并同步到本地数据库
				jwPrescriptionService.getFollowUpByTime(startTime,endTime);

+ 44 - 18
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -455,8 +455,8 @@ public class JwPrescriptionService {
//            params.add(new BasicNameValuePair("IDENTITY_CARD_NO", "350221197506113526"));//身份证
            String response = httpClientUtil.post(url, params, "UTF-8");
    
            //居民随访记录
            List<Followup> followups = new ArrayList<>();
            //随访ID,ES集合对象 MAP
            HashMap<String,List<FollowupContentESDO>> followupidToESDOListMap = new HashMap<>();
    
            if (StringUtils.isNotBlank(response)) {
//                logger.info("从基卫获取随访信息报文为:"+response);
@ -803,7 +803,9 @@ public class JwPrescriptionService {
    
//                                logger.info("同步单条随访记录-ES数据对象组装完毕,时间:"+DateUtil.getStringDate());
                                //ES保存新数据
                                this.esSaveFollowupContentData(String.valueOf(followupId),newList);
//                                this.esSaveFollowupContentData(String.valueOf(followupId),newList);
    
                                followupidToESDOListMap.put(String.valueOf(followupId),newList);
                        
                                List<FollowupDrugs> DRUG_LIST = new ArrayList<>();//用药记录
                        
@ -864,6 +866,11 @@ public class JwPrescriptionService {
                logger.info("同步随访信息报错接口失败:无数据返回, hosipitalcode" + hospitalMapping.getCode());
                continue;
            }
            
            //处理随访详情数据
            if(!followupidToESDOListMap.isEmpty()){
                this.esSaveFollowupContentData(followupidToESDOListMap);
            }
        }
    }
    
@ -1204,32 +1211,51 @@ public class JwPrescriptionService {
     *@author huangwenjie
     *@date 2017/11/1 14:57
     */
    public void esSaveFollowupContentData(String followupid, List<FollowupContentESDO> newdatalist) throws Exception {
    public void esSaveFollowupContentData(HashMap<String,List<FollowupContentESDO>>  newdataMap) throws Exception {
        JestClient jestClient = null;
        
        try {
//            logger.info("同步单条随访记录-开始建立ES数据连接,时间:"+DateUtil.getStringDate());
            //            logger.info("同步单条随访记录-开始建立ES数据连接,时间:"+DateUtil.getStringDate());
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", id))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build();
            SearchResult result = jestClient.execute(search);
    
            List<FollowupContentESDO> resultdata = new ArrayList<>();
    
            for (String followid: newdataMap.keySet()) {
                //先根据条件查找出来
                SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
                searchSourceBuilder.query(
                        new BoolQueryBuilder()
                                .must(QueryBuilders.matchQuery("followup_id", followid))
                );
                Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build();
                SearchResult result = jestClient.execute(search);
//            logger.info("同步单条随访记录-开始查询ES数据,时间:"+DateUtil.getStringDate());
            List<FollowupContentESDO> dataList = result.getSourceAsObjectList(FollowupContentESDO.class);
                List<FollowupContentESDO> dataList = result.getSourceAsObjectList(FollowupContentESDO.class);
//            logger.info("同步单条随访记录-ES数据查询成功,时间:"+DateUtil.getStringDate());
            if(!dataList.isEmpty()){
                //删除原有记录
                if(!dataList.isEmpty()){
                    //删除原有记录
//                logger.info("同步单条随访记录-开始删除ES数据,时间:"+DateUtil.getStringDate());
                this.esDeleteFollowUpContent(dataList);
//                    this.esDeleteFollowUpContent(dataList);
                    //根据id批量删除
                    Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
                    for (FollowupContentESDO obj : dataList) {
                        Delete index = new Delete.Builder(obj.getId()).build();
                        bulk.addAction(index);
                    }
                    BulkResult br = jestClient.execute(bulk.build());
    
                    logger.info("delete data count:" + dataList.size());
                    logger.info("delete flag:" + br.isSucceeded());
//                logger.info("同步单条随访记录-ES数据删除成功,时间:"+DateUtil.getStringDate());
                }
                resultdata.addAll(newdataMap.get(followid));
            }
            //保存新的随访详情记录
//            logger.info("同步单条随访记录-开始保存ES数据,时间:"+DateUtil.getStringDate());
            elastricSearchSave.save(newdatalist,esIndex,esType);
            if(!resultdata.isEmpty()){
                elastricSearchSave.save(resultdata,esIndex,esType);
            }
//            logger.info("同步单条随访记录-ES数据保存成功,时间:"+DateUtil.getStringDate());
            jestClient.shutdownClient();
        }catch (Exception e){

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java

@ -16,6 +16,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import java.util.Date;
import java.util.List;
public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam, Long>, JpaSpecificationExecutor<ConsultTeam> {
@ -296,4 +297,8 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	
	@Query("select a from ConsultTeam a where a.patient = ?1 and a.del = '1' and a.status = 0 and a.type = 8")
	List<ConsultTeam> findUnfinishedConsultPrescription(String code);
	//按时间、类型、咨询时间统计居民咨询数量
	@Query("SELECT COUNT(1) FROM ConsultTeam a WHERE a.patient = ?1 AND a.type = ?2 AND a.czrq >= ?3 AND a.status = 1 AND a.del = '1' ")
	int countRemainConsult(String patient, int type, Date consultTime);
}

+ 8 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorGuidanceTempDao.java

@ -30,4 +30,12 @@ public interface DoctorGuidanceTempDao extends PagingAndSortingRepository<Doctor
    //验证医生健康指导模板标题是否重复
    @Query("select t from DoctorGuidanceTemp t where t.owner = ?1 and t.modelName = ?2 ")
    List<DoctorGuidanceTemp> findByTitle(String owner,String title);
    //根据模板文章标题模糊搜索系统指导模板
    @Query(value = "select t from DoctorGuidanceTemp t where t.owner = 'system' and t.modelName like ?1 order by t.sendTimes desc ")
    Page<DoctorGuidanceTemp> listByTileSystem(String filter, Pageable pageRequest);
    //根据模板文章标题模糊搜索个人指导模板
    @Query(value = "select t from DoctorGuidanceTemp t where t.owner != 'system' and t.modelName like ?1 order by t.sendTimes desc ")
    Page<DoctorGuidanceTemp> listByTile(String filter, Pageable pageRequest);
}

+ 6 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorTeamGuidanceTemplateDao.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.repository.template;
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceTemplate;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
@ -46,4 +47,9 @@ public interface DoctorTeamGuidanceTemplateDao extends PagingAndSortingRepositor
    @Query("update DoctorTeamGuidanceTemplate t set t.useTimes =  0 ,t.del = 0 where t.teamId = ?1 and t.teamTemplateCode =?2 ")
    int deleteByTeam(int teamId, String guidanceCode);
    // 根据模板文章标题模糊搜索团队指导模板
    @Query("SELECT b FROM DoctorTeamGuidanceDetail a, DoctorTeamGuidanceTemplate b WHERE a.code = b.teamTemplateCode  " +
            " AND b.del = 1 AND b.teamId = ?1 AND b.title LIKE ?2 order by b.useTimes desc  ")
    Page<DoctorTeamGuidanceTemplate> listByTile(int teamId, String owner, Pageable pageRequest);
}

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -22,6 +22,7 @@ import com.yihu.wlyy.entity.zydict.ZyIvPhysicDict;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDoctorDao;
import com.yihu.wlyy.repository.consult.ConsultTeamLogDao;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.doctor.DoctorPatientDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
@ -152,6 +153,8 @@ public class ConsultTeamService extends ConsultService {
    private PatientHealthIndexService healthIndexService;
    @Autowired
    private MessageService messageService;
    @Autowired
    private SystemDictDao systemDictDao;
    //健康问题 高血压
    private static final String gxy = "HP0093";
    //健康问题 糖尿病
@ -2718,4 +2721,25 @@ public class ConsultTeamService extends ConsultService {
        return  re;
    }
    /**
     * 根据居民code获取剩余家庭咨询次数
     *
     * @param patient
     * @return
     * @throws Exception
     */
    public int countRemainConsult(String patient) throws Exception{
        int count = 10;
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            String versionTime = systemDictDao.findByDictNameAndCode("VERSION_TIME","1.4.2");
            int amount = consultTeamDao.countRemainConsult(patient,2,format.parse(versionTime));
            count -= amount;
        }catch (Exception e){
            e.printStackTrace();
            count = -1;
        }
        return count;
    }
}

+ 15 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -140,8 +140,11 @@ public class JMJkEduArticleService extends BaseService {
        Doctor doctor = null;
    
        List<HealthEduArticlePatientModel> resultList = new ArrayList<>();
        
        StringBuffer sql3 = null;
        for (HealthEduArticleES one : esList) {
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
//            if (result.get(one.getArticleId()) != null) {
//                heapm = result.get(one.getArticleId());
@ -163,6 +166,15 @@ public class JMJkEduArticleService extends BaseService {
            heapm.setLevel2TypeName(one.getSecondLevelCategoryName());
            heapm.setLevel(article.getString("articlelevel"));
//            heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
            sql3 = new StringBuffer();
            sql3.append("SELECT COUNT(*) as num FROM health_edu_article_patient_test3 WHERE isRead='1' AND patientCode is not null AND articleId='"+article.getString("articleId")+"'");
            Long num = elasticsearchUtil.excuteForLong(sql3.toString(), esType, esIndex);
            if(num!=null){
                heapm.setReadNumber(num.longValue());
            }else{
                heapm.setReadNumber(0L);
            }
            if(!StringUtils.isEmpty(article.getString("browseNumber"))){
                heapm.setBrowseNumbere(Integer.valueOf(article.getString("browseNumber")));//文章浏览数
            }else{
@ -628,6 +640,8 @@ public class JMJkEduArticleService extends BaseService {
        e.setPatientCode(null);
        e.setPatientName(null);
        elastricSearchSave.save(e, esIndex, esType);
        //记录推送量
        thirdJkEduArticleService.saveBehavior(articleId,sendCode,7,patientSet.size());
        return healthEduArticleESList;
    }

+ 66 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempService.java

@ -1,7 +1,9 @@
package com.yihu.wlyy.service.template;
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceTemplate;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
import com.yihu.wlyy.repository.template.DoctorTeamGuidanceTemplateDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.CodeFomat;
import com.yihu.wlyy.util.CommonUtil;
@ -29,6 +31,8 @@ public class DoctorGuidanceTempService extends BaseService {
    DoctorGuidanceTempDao guidanceTempDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    private DoctorTeamGuidanceTemplateDao doctorTeamGuidanceTemplateDao;
    @Autowired
    private CommonUtil CommonUtil;
@ -247,4 +251,66 @@ public class DoctorGuidanceTempService extends BaseService {
        return listMap;
    }
    /**
     * 根据模板类型、文章标题模糊搜索指导模板
     *
     * @param filter 搜索关键字
     * @param type 1:系统 2:个人 3:团队摸版
     * @param pageSize
     * @param pageNo
     * @return
     * @throws Exception
     */
    public List<Map<String, Object>> listByTitle(String filter,String type, Integer teamId, int pageSize, int pageNo) throws Exception {
        PageRequest pageRequest = new PageRequest(pageNo, pageSize);
        List<Map<String, Object>> listMap = new ArrayList<>();
        if ("1".equals(type)) {
            Page<DoctorGuidanceTemp> temps = guidanceTempDao.listByTileSystem("%"+filter+"%", pageRequest);
            List<DoctorGuidanceTemp> list = temps.getContent();
            for (int i = 0; i < list.size(); i++) {
                DoctorGuidanceTemp dgt = list.get(i);
                Map<String, Object> tem = new HashMap<>();
                tem.put("code", dgt.getCode());
                tem.put("owner", dgt.getOwner());
                tem.put("sendTimes", dgt.getSendTimes());
                tem.put("lastTime", dgt.getLastTime());
                tem.put("modelName", dgt.getModelName());
                listMap.add(tem);
            }
        } else if ("2".equals(type)) {
            Page<DoctorGuidanceTemp> temps = guidanceTempDao.listByTile("%"+filter+"%", pageRequest);
            List<DoctorGuidanceTemp> list = temps.getContent();
            for (int i = 0; i < list.size(); i++) {
                DoctorGuidanceTemp dgt = list.get(i);
                Map<String, Object> tem = new HashMap<>();
                tem.put("code", dgt.getCode());
                tem.put("owner", dgt.getOwner());
                tem.put("sendTimes", dgt.getSendTimes());
                tem.put("lastTime", dgt.getLastTime());
                tem.put("modelName", dgt.getModelName());
                listMap.add(tem);
            }
        } else if("3".equals(type) && teamId!=null){
            Page<DoctorTeamGuidanceTemplate> temps = doctorTeamGuidanceTemplateDao.listByTile(teamId,"%"+filter+"%", pageRequest);
            List<DoctorTeamGuidanceTemplate> list = temps.getContent();
            for (int i = 0; i < list.size(); i++) {
                DoctorTeamGuidanceTemplate dgt = list.get(i);
                Map<String, Object> tem = new HashMap<>();
                tem.put("teamId", dgt.getTeamId());
                tem.put("code", dgt.getTeamTemplateCode());
                tem.put("owner", dgt.getCreater());
                tem.put("sendTimes", dgt.getUseTimes());
                tem.put("lastTime", dgt.getCzrq());
                tem.put("modelName", dgt.getTitle());
                listMap.add(tem);
            }
        }
        return listMap;
    }
}

+ 11 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java

@ -945,14 +945,23 @@ public class ThirdJkEduArticleService extends BaseService {
    /**************************************************** behaver *******************************************************/
    public void saveBehavior(String articleId,String cName,String userId) throws Exception {
    public void saveBehavior(String articleId,String userId,Integer behaviorAction,Integer number) throws Exception {
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("articleId",articleId);// 文章ID
            Patient patient = patientDao.findByCode(userId);
            Doctor doctor = doctorDao.findByCode(userId);
            String cName = "";
            if(patient!=null){
                cName = patient.getName();
            }else if(doctor!=null){
                cName = doctor.getName();
            }
            param.put("cName",cName);//用户名称
            param.put("userId",userId);//用户ID
            param.put("behaviorAction",behaviorAction);//用户
            param.put("number",number);//用户
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(saveBehavior, param.toString(), "1"));
            json = JSON.parseObject(response);
        }catch (Exception e) {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ElasticsearchUtil.java

@ -184,7 +184,7 @@ public class ElasticsearchUtil {
            }
            SearchResponse response = (SearchResponse) requestBuilder.get();
            ObjectResult temp = new ObjectResultsExtractor(true, true, true).extractResults(response.getAggregations(), true);
            Long Longvalue = ((Double) temp.getLines().get(0).get(1)).longValue();
            Long Longvalue = ((Double) temp.getLines().get(0).get(0)).longValue();
            return Longvalue;
        } catch (Exception e) {
            logger.error(e.getMessage());

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

@ -199,7 +199,7 @@ public class BaseController {
            if(StringUtils.isNotEmpty(currentUserRole)){
                Hospital hospital = hospitalDao.findByCode(currentUserRole);
                if(hospital.getLevel()==3){
                if(hospital!=null&&hospital.getLevel()==3){
                    return hospital.getTown();
                }
            }

+ 42 - 28
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java

@ -53,33 +53,6 @@ public class DoctorGuidanceTempController extends BaseController {
        return write(200, "查询成功!", "data", temp);
    }
    /**
     * 添加指导模板
     *
     * @param content
     * @return
     */
    /*@RequestMapping(value = "/add", method = RequestMethod.POST)
    @ApiOperation(value = "添加指导模板")
    public String add(@RequestParam @ApiParam(value = "指导内容") String content) {
        try {
            if (StringUtils.isEmpty(content)) {
                return error(-1, "内容不能为空");
            }
            DoctorGuidanceTemp temp = guidanceTempService.add(getUID(), content);
            if (temp != null) {
                return write(200, "添加成功");
            } else {
                return write(-1, "添加失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "添加失败");
        }
    }*/
//  =====================
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ApiOperation(value = "添加指导模板")
    @ObserverRequired
@ -111,7 +84,6 @@ public class DoctorGuidanceTempController extends BaseController {
            return error(-1, "添加失败");
        }
    }
//  =====================
    /**
     * 修改指导模板
@ -217,4 +189,46 @@ public class DoctorGuidanceTempController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    /**
     * 根据模板类型、文章标题模糊搜索指导模板
     * (自定义即个人模板)
     * @param filter  搜索关键字
     * @param type  模板类型
     * @param type  teamId
     * @param pageSize 页展示数量
     * @param pageNo  当前页码
     * @return
     */
    @RequestMapping(value = "/search", method = RequestMethod.GET)
    @ApiOperation(value = "模糊搜索指导模板")
    public String searchByTitle(
                        @RequestParam(required = true, defaultValue = "")
                        @ApiParam(value = "搜索关键字") String filter,
                        @RequestParam(required = true, defaultValue = "")
                        @ApiParam(value = "模板类型 1:系统 2:个人 3:团队摸版") String type,
                        @RequestParam(required = false)
                        @ApiParam(value = "3:团队摸版时 团队ID") Integer teamId,
                        @RequestParam(defaultValue = "10")
                        @ApiParam(value = "页展示数量") String pageSize,
                        @RequestParam(defaultValue = "1") @ApiParam(value = "当前页码") String pageNo) {
        try {
            int pagesize = Integer.parseInt(pageSize);
            int pageno = Integer.parseInt(pageNo) - 1;
            List<Map<String, Object>> temps = null;
            if (StringUtils.isNotEmpty(type) && StringUtils.isNotEmpty(filter)){
                temps = guidanceTempService.listByTitle(filter,type,teamId,pagesize, pageno);
            }else {
                return error(-1, "模板类型不能为空!");
            }
            if (temps == null || temps.size() < 1) {
                return write(200, "查询成功!", "data", new JSONArray());
            } else {
                return write(200, "查询成功!", "data", new JSONArray(temps));
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败!");
        }
    }
}

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java

@ -95,15 +95,19 @@ public class PatientController extends WeixinBaseController {
            SignFamily jiating = familyContractService.findByPatientByType(getRepUID(), 2);
            int prescription = 0;
            int sign = 0;
            String expensesStatus = "";
            if (sanshi != null && jiating != null) {
                expensesStatus = jiating.getExpensesStatus();
                sign = 3;
            } else if (jiating != null) {
                expensesStatus = jiating.getExpensesStatus();
                sign = 2;
                List<SignFamilyServer> list = signFamilyServerDao.findBySignCodeAndType(jiating.getCode());
                if(list!=null&&list.size()>0){
                    prescription = 1;
                }
            } else if (sanshi != null) {
                expensesStatus = sanshi.getExpensesStatus();
                sign = 1;
            }
            if (temp != null) {
@ -146,6 +150,7 @@ public class PatientController extends WeixinBaseController {
                // 设置地址
                json.put("address", temp.getAddress());
                // 设置签约状态:0未签约,1三师,2家庭,3三师和家庭
                json.put("expensesStatus", expensesStatus);
                json.put("sign", sign);
                json.put("prescription", prescription);//是否可以续方咨询0不可以、1可以
                json.put("countryCode",temp.getSickVillage()==null?"":temp.getSickVillage());

+ 18 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -1223,6 +1223,24 @@ public class ConsultController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "remainConsultTimes",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取剩余家庭咨询次数")
    public String countRemainConsult(){
        try {
            String patient = getRepUID();
            int count = consultTeamService.countRemainConsult(patient);
            if (count>=0){
                return write(200, "查询成功!", "data", count);
            }else {
                return error(-1, "已缴费用户无家庭咨询次数限制!");
            }
        }catch (Exception e){
            error(e);
            return error(-1, "查询失败!");
        }
    }
    /**
     * 解析contentType
     *   PlainText: 1,   // 信息

+ 2 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/jimeiJkEdu/PatientJMJkEduArticleController.java

@ -191,10 +191,9 @@ public class PatientJMJkEduArticleController extends BaseController {
    @ApiOperation("添加 浏览、转发、分享、点赞 ")
    public String saveBehavior(
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId,
            @ApiParam(name = "cName", value = "用户名称", required = true) @RequestParam(value = "cName", required = true) String cName,
            @ApiParam(name = "userId", value = "用户ID", required = true) @RequestParam(value = "userId", required = false) String  userId){
            @ApiParam(name = "behaviorAction", value = "1、点赞 2、转发 3、分享 4、浏览 5、评论 6、收藏 7、发送", required = true) @RequestParam(value = "behaviorAction", required = true) Integer behaviorAction){
        try {
            thirdJkEduArticleService.saveBehavior(articleId,cName,userId);
            thirdJkEduArticleService.saveBehavior(articleId,getUID(),behaviorAction,null);
//            Long count = healthEducationArticleService.pushArticleLogsCount("ece5c665b16542b0847e52b4a9fee44a");
            return write(200,"保存成功!");
        }catch (Exception e) {

+ 10 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/HealthEduArticlePatientModel.java

@ -41,6 +41,8 @@ public class HealthEduArticlePatientModel {
    private Integer commentNumber=0;//文章评论数
    @ApiModelProperty(value = "文章点赞数", required = false, access = "response")
    private Integer pointNumber=0;//文章点赞数
    @ApiModelProperty(value = "文章阅读数", required = false, access = "response")
    private Long readNumber=0L;//文章阅读数
    @ApiModelProperty(value = "封面图", required = false, access = "response")
    private String articleCover="";//封面图
    @ApiModelProperty(value = "发送类型", required = false, access = "response")
@ -257,4 +259,12 @@ public class HealthEduArticlePatientModel {
    public void setArticleSource(String articleSource) {
        this.articleSource = articleSource;
    }
    public Long getReadNumber() {
        return readNumber;
    }
    public void setReadNumber(Long readNumber) {
        this.readNumber = readNumber;
    }
}