浏览代码

Merge branch 'dev' of liuwenbin/patient-co-management into dev

trick9191 7 年之前
父节点
当前提交
24249ac50f
共有 46 个文件被更改,包括 813 次插入305 次删除
  1. 9 0
      common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticlePatient.java
  2. 7 1
      edu-article/JkEdu/WebRoot/WEB-INF/classes/articlePc.sql.xml
  3. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  4. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class
  5. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class
  6. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  7. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticlePcDao.class
  8. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class
  9. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class
  10. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/enums/MyTableEnum.class
  11. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/Article.class
  12. 二进制
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class
  13. 1 1
      edu-article/JkEdu/WebRoot/ssoLogin.html
  14. 6 1
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/articlePc.sql.xml
  15. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  16. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class
  17. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class
  18. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  19. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticlePcDao.class
  20. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class
  21. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class
  22. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/enums/MyTableEnum.class
  23. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/Article.class
  24. 二进制
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class
  25. 7 1
      edu-article/JkEdu/src/articlePc.sql.xml
  26. 150 115
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  27. 11 6
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java
  28. 4 2
      edu-article/JkEdu/src/com/yihu/jk/api/CategoryApi.java
  29. 95 4
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java
  30. 1 0
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticlePcDao.java
  31. 6 1
      edu-article/JkEdu/src/com/yihu/jk/dao/CategoryDao.java
  32. 1 1
      edu-article/JkEdu/src/com/yihu/jk/enums/ArticleSqlNameEnum.java
  33. 1 0
      edu-article/JkEdu/src/com/yihu/jk/enums/MyTableEnum.java
  34. 37 0
      edu-article/JkEdu/src/com/yihu/jk/vo/Article.java
  35. 27 0
      edu-article/JkEdu/src/com/yihu/jk/vo/ArticleStatistic.java
  36. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/RoleService.java
  37. 169 111
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  38. 76 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  39. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java
  40. 19 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  41. 103 36
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java
  42. 43 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java
  43. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java
  44. 6 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcLabelService.java
  45. 16 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java
  46. 5 4
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

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

@ -55,6 +55,7 @@ public class HealthEduArticlePatient {
    private List<Patient> patients;//被推送文章的患者
    private List<Patient> patients;//被推送文章的患者
    private String operatorId;//文章作者Id
    private String operatorId;//文章作者Id
    private List<RoleVo> roleList;//发送者角色
    private List<RoleVo> roleList;//发送者角色
    private String leaveWords;//医生留言
    public String getId() {
    public String getId() {
        return id;
        return id;
@ -328,4 +329,12 @@ public class HealthEduArticlePatient {
    public void setRoleList(List<RoleVo> roleList) {
    public void setRoleList(List<RoleVo> roleList) {
        this.roleList = roleList;
        this.roleList = roleList;
    }
    }
    public String getLeaveWords() {
        return leaveWords;
    }
    public void setLeaveWords(String leaveWords) {
        this.leaveWords = leaveWords;
    }
}
}

+ 7 - 1
edu-article/JkEdu/WebRoot/WEB-INF/classes/articlePc.sql.xml

@ -3,7 +3,8 @@
	<Sqls> 
	<Sqls> 
		 <Sql name='getArticlePcList'>
		 <Sql name='getArticlePcList'>
		 <![CDATA[
		 <![CDATA[
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   @PageParam
				select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber 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>
		</Sql>
		<Sql name='getArticlePcListCount'>
		<Sql name='getArticlePcListCount'>
@ -34,5 +35,10 @@
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition     
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition     
			]]>
			]]>
		</Sql>
		</Sql>
		<Sql name='updateArticle'>
			<![CDATA[
				update  Org_Article  set @behaviorParam where 1=1 @Condition
			]]>
		</Sql>
	</Sqls>
	</Sqls>
</das-client>
</das-client>

二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticlePcDao.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/enums/MyTableEnum.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/Article.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class


+ 1 - 1
edu-article/JkEdu/WebRoot/ssoLogin.html

@ -16,7 +16,7 @@
		"id" :4798,
		"id" :4798,
		"hospital":"3502110400",
		"hospital":"3502110400",
		"userRole":[{"code":"350200","name":"厦门市卫生与计划生育委员会","areas":"350203"}],
		"userRole":[{"code":"350200","name":"厦门市卫生与计划生育委员会","areas":"350203"}],
		"currentUserRole":{"code":"350200","name":"厦门市卫生与计划生育委员会","areas":"350203","level":""}
		"currentUserRole":{"code":"350200","name":"厦门市卫生与计划生育委员会","areas":"350203","level":"","isManage":""}
		
		
	}));
	}));
	
	

+ 6 - 1
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/articlePc.sql.xml

@ -3,7 +3,7 @@
	<Sqls> 
	<Sqls> 
		 <Sql name='getArticlePcList'>
		 <Sql name='getArticlePcList'>
		 <![CDATA[
		 <![CDATA[
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   @PageParam
				select * from Org_Article  where 1=1  and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   @PageParam
			]]>
			]]>
		</Sql>
		</Sql>
		<Sql name='getArticlePcListCount'>
		<Sql name='getArticlePcListCount'>
@ -34,5 +34,10 @@
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition     
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition     
			]]>
			]]>
		</Sql>
		</Sql>
		<Sql name='updateArticle'>
			<![CDATA[
				update  Org_Article  set @behaviorParam where 1=1 @Condition
			]]>
		</Sql>
	</Sqls>
	</Sqls>
</das-client>
</das-client>

二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class


二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class


二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class


二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class


二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticlePcDao.class


二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class


二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class


二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/enums/MyTableEnum.class


二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/Article.class


二进制
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class


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

@ -3,7 +3,8 @@
	<Sqls> 
	<Sqls> 
		 <Sql name='getArticlePcList'>
		 <Sql name='getArticlePcList'>
		 <![CDATA[
		 <![CDATA[
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   @PageParam
				select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber 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>
		</Sql>
		<Sql name='getArticlePcListCount'>
		<Sql name='getArticlePcListCount'>
@ -34,5 +35,10 @@
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition     
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition     
			]]>
			]]>
		</Sql>
		</Sql>
		<Sql name='updateArticle'>
			<![CDATA[
				update  Org_Article  set @behaviorParam where 1=1 @Condition
			]]>
		</Sql>
	</Sqls>
	</Sqls>
</das-client>
</das-client>

+ 150 - 115
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -11,6 +11,7 @@ import com.yihu.jk.vo.OrgArticleVo;
import net.sf.json.JSONArray;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.log4j.Logger;
import com.common.json.JSONException;
import com.common.json.JSONException;
@ -232,7 +233,7 @@ public class ArticleApi {
					jsonObj.put("deptName", StringUtil.getJSONValue(vbo.getDeptName()));
					jsonObj.put("deptName", StringUtil.getJSONValue(vbo.getDeptName()));
					jsonObj.put("titleLevel", StringUtil.getJSONValue(vbo.getTitleLevel()));
					jsonObj.put("titleLevel", StringUtil.getJSONValue(vbo.getTitleLevel()));
					jsonObj.put("operatorImg", StringUtil.getJSONValue(vbo.getOperatorImg()));
					jsonObj.put("operatorImg", StringUtil.getJSONValue(vbo.getOperatorImg()));
					jsonObj.put("userScope", StringUtil.getJSONValue(vbo.getUserScope()));
					if (StringUtil.isNotEmpty(userId)) {
					if (StringUtil.isNotEmpty(userId)) {
						vo.setUserId(userId);
						vo.setUserId(userId);
						int pointNumberCount = dao.pointNumberCount(vo);
						int pointNumberCount = dao.pointNumberCount(vo);
@ -481,7 +482,7 @@ public class ArticleApi {
	/************************************************* new ************************************************************/
	/************************************************* new ************************************************************/
	/**
	/**
	 * 添加文章
	 * 添加、编辑文章
	 * @param im
	 * @param im
	 * @return
	 * @return
	 * @throws JSONException
	 * @throws JSONException
@ -490,76 +491,73 @@ public class ArticleApi {
		JSONObject json = JSONObject.fromObject(im.getParam());
		JSONObject json = JSONObject.fromObject(im.getParam());
		String articleId = StringUtil.isEmpty(json.get("articleId")) ? null : json.getString("articleId");
		String articleId = StringUtil.isEmpty(json.get("articleId")) ? null : json.getString("articleId");
		String userCode = StringUtil.isEmpty(json.get("userCode")) ? null : json.getString("userCode");
		if (StringUtil.isEmpty(userCode)) {
			return ApiUtil.getRespJSON(-10000, "userCode 必传").toString();
		String firstLevelCategoryId = StringUtil.isEmpty(json.get("firstLevelCategoryId")) ? null : json.getString("firstLevelCategoryId");//一级分类id
		String firstLevelCategoryName = StringUtil.isEmpty(json.get("firstLevelCategoryName")) ? null : json.getString("firstLevelCategoryName");// 一级分类名称
		String secondLevelCategoryId = StringUtil.isEmpty(json.get("secondLevelCategoryId")) ? null : json.getString("secondLevelCategoryId");//二级分类id
		String secondLevelCategoryName = StringUtil.isEmpty(json.get("secondLevelCategoryName")) ? null : json.getString("secondLevelCategoryName");// 二级分类名称
		String content = StringUtil.isEmpty(json.get("content")) ? null : json.getString("content");//内容
		String articleTitle = StringUtil.isEmpty(json.get("articleTitle")) ? null : json.getString("articleTitle");//标题
		Integer articlelevel = StringUtil.isEmpty(json.get("articlelevel")) ? null : json.getInt("articlelevel");//文章级别
		Integer userScope = StringUtil.isEmpty(json.get("userScope")) ? null : json.getInt("userScope");//使用范围(1、全市使用,2、全区使用,3、全社区使用)
		String newUrl = StringUtil.isEmpty(json.get("newUrl")) ? null : json.getString("newUrl");//封面图片地址
		}
		String	orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName");//组织名称
		String	deptName = StringUtil.isEmpty(json.get("deptName")) ? null : json.getString("deptName");//科室名称
		String	levelName = StringUtil.isEmpty(json.get("levelName")) ? null : json.getString("levelName");//职称
		String	photo = StringUtil.isEmpty(json.get("photo")) ? null : json.getString("photo");//头像
		String	orgId = StringUtil.isEmpty(json.get("orgId")) ? null : json.getString("orgId");//组织
		String	userName = StringUtil.isEmpty(json.get("userName")) ? null : json.getString("userName");//登录名称
		String	articleTitle = StringUtil.isEmpty(json.get("articleTitle")) ? null : json.getString("articleTitle");//标题
		String	articleType = StringUtil.isEmpty(json.get("articleType")) ? null : json.getString("articleType");//类型
		Integer	articlelevel = StringUtil.isEmpty(json.get("articlelevel")) ? null : json.getInt("articlelevel");//文章级别
		String	secondLevelCategoryId = StringUtil.isEmpty(json.get("secondLevelCategoryId")) ? null : json.getString("secondLevelCategoryId");//二级分类id
		String	secondLevelCategoryName = StringUtil.isEmpty(json.get("secondLevelCategoryName")) ? null : json.getString("secondLevelCategoryName");// 二级分类名称
		String	firstLevelCategoryId = StringUtil.isEmpty(json.get("firstLevelCategoryId")) ? null : json.getString("firstLevelCategoryId");//一级分类id
		String	firstLevelCategoryName = StringUtil.isEmpty(json.get("firstLevelCategoryName")) ? null : json.getString("firstLevelCategoryName");// 一级分类名称
		String	content = StringUtil.isEmpty(json.get("content")) ? null : json.getString("content");//内容
		String	newUrl = StringUtil.isEmpty(json.get("newUrl")) ? null : json.getString("newUrl");//封面图片地址
		String	operatorRoleCode = StringUtil.isEmpty(json.get("operatorRoleCode")) ? null : json.getString("operatorRoleCode");//操作人角色code
		String	opertorRoleLevel = StringUtil.isEmpty(json.get("opertorRoleLevel")) ? null : json.getString("opertorRoleLevel");//操作人角色级别
		Integer	userScope = StringUtil.isEmpty(json.get("userScope")) ? null : json.getInt("userScope");//使用范围(1、全市使用,2、全区使用,3、全社区使用)
		Integer	isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否认证
		String	authentication = StringUtil.isEmpty(json.get("authentication")) ? null : json.getString("authentication");//认证单位
		String	authenticationId = StringUtil.isEmpty(json.get("authenticationId")) ? null : json.getString("authenticationId");//认证单位ID
		Timestamp nowTime = DateOper.getNowDateTime();//插入和更新时间一样
		OrgArticleVo orgArticleVo = new OrgArticleVo();
		OrgArticleVo orgArticleVo = new OrgArticleVo();
		orgArticleVo.setArticleId(articleId);
		com.common.json.JSONObject jsonObject = articlePcDao.queryArticlePcId(orgArticleVo);
//		json = JSONObject.parseObject(str);
//		if(){
//
//		}
		articleId=StringUtil.createUUID();
		orgArticleVo.setArticleId(articleId);
		orgArticleVo.setArticleOrder(99);
		orgArticleVo.setArticleType(articleType);
		orgArticleVo.setArticleTitle(articleTitle);
		orgArticleVo.setArticleTitle(articleTitle);
		orgArticleVo.setArticleContent(content);
		orgArticleVo.setArticleContent(content);
		orgArticleVo.setInsertTime(nowTime);
		orgArticleVo.setUpdateTime(nowTime);
		orgArticleVo.setArticleState(1);
		orgArticleVo.setArticlelevel(articlelevel);
		orgArticleVo.setArticlelevel(articlelevel);
		orgArticleVo.setSecondLevelCategoryId(secondLevelCategoryId);
		orgArticleVo.setUserScope(userScope);
		orgArticleVo.setFirstLevelCategoryId(firstLevelCategoryId);
		orgArticleVo.setFirstLevelCategoryId(firstLevelCategoryId);
		orgArticleVo.setFirstLevelCategoryName(firstLevelCategoryName);
		orgArticleVo.setFirstLevelCategoryName(firstLevelCategoryName);
		orgArticleVo.setSecondLevelCategoryId(secondLevelCategoryId);
		orgArticleVo.setSecondLevelCategoryName(secondLevelCategoryName);
		orgArticleVo.setArticleCover(newUrl);
		orgArticleVo.setArticleCover(newUrl);
		orgArticleVo.setDeptName(deptName);
		orgArticleVo.setTitleLevel(levelName);
		orgArticleVo.setOperatorImg(photo);
		orgArticleVo.setOrgId(orgId);
		orgArticleVo.setOperatorName(userName);
		orgArticleVo.setOperatorId(userCode);
		orgArticleVo.setLastOperatorId(userCode);
		orgArticleVo.setLastOperatorName(userName);
		orgArticleVo.setOperatorRoleCode(operatorRoleCode);
		orgArticleVo.setOperatorRoleLevel(opertorRoleLevel);
		orgArticleVo.setUserScope(userScope);
		orgArticleVo.setIsAuthentication(isAuthentication);
		orgArticleVo.setAuthentication(authentication);
		orgArticleVo.setAuthenticationId(authenticationId);
		if ("".equals(orgName)&&orgName==null){
			orgName = "无";
		Timestamp nowTime = DateOper.getNowDateTime();//插入和更新时间一样
		orgArticleVo.setUpdateTime(nowTime);
		if(StringUtil.isEmpty(articleId)) {
			String userCode = StringUtil.isEmpty(json.get("userCode")) ? null : json.getString("userCode");
			String orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName");//组织名称
			String deptName = StringUtil.isEmpty(json.get("deptName")) ? null : json.getString("deptName");//科室名称
			String levelName = StringUtil.isEmpty(json.get("levelName")) ? null : json.getString("levelName");//职称
			String photo = StringUtil.isEmpty(json.get("photo")) ? null : json.getString("photo");//头像
			String orgId = StringUtil.isEmpty(json.get("orgId")) ? null : json.getString("orgId");//组织
			String userName = StringUtil.isEmpty(json.get("userName")) ? null : json.getString("userName");//登录名称
			String articleType = StringUtil.isEmpty(json.get("articleType")) ? null : json.getString("articleType");//类型
			String operatorRoleCode = StringUtil.isEmpty(json.get("operatorRoleCode")) ? null : json.getString("operatorRoleCode");//操作人角色code
			String opertorRoleLevel = StringUtil.isEmpty(json.get("opertorRoleLevel")) ? null : json.getString("opertorRoleLevel");//操作人角色级别
			Integer isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否认证
			String authentication = StringUtil.isEmpty(json.get("authentication")) ? null : json.getString("authentication");//认证单位
			String authenticationId = StringUtil.isEmpty(json.get("authenticationId")) ? null : json.getString("authenticationId");//认证单位ID
			orgArticleVo.setArticleId(articleId);
			articleId = StringUtil.createUUID();
			orgArticleVo.setArticleId(articleId);
			orgArticleVo.setArticleOrder(99);
			orgArticleVo.setArticleType(articleType);
			orgArticleVo.setInsertTime(nowTime);
			orgArticleVo.setArticleState(1);
			orgArticleVo.setDeptName(deptName);
			orgArticleVo.setTitleLevel(levelName);
			orgArticleVo.setOperatorImg(photo);
			orgArticleVo.setOrgId(orgId);
			orgArticleVo.setOperatorName(userName);
			orgArticleVo.setOperatorId(userCode);
			orgArticleVo.setLastOperatorId(userCode);
			orgArticleVo.setLastOperatorName(userName);
			orgArticleVo.setOperatorRoleCode(operatorRoleCode);
			orgArticleVo.setOperatorRoleLevel(opertorRoleLevel);
			orgArticleVo.setIsAuthentication(isAuthentication);
			orgArticleVo.setAuthentication(authentication);
			orgArticleVo.setAuthenticationId(authenticationId);
			if ("".equals(orgName) && orgName == null) {
				orgName = "无";
			}
			orgArticleVo.setOrgName(orgName);
			orgArticleVo.setArticleSource(orgName);
			return dao.saveArticle(orgArticleVo).toString();
		}else{
			orgArticleVo.setArticleId(articleId);
			return dao.updateArticle(orgArticleVo).toString();
		}
		}
		orgArticleVo.setOrgName(orgName);
		orgArticleVo.setArticleSource(orgName);
		orgArticleVo.setFirstLevelCategoryName(firstLevelCategoryName);
		orgArticleVo.setSecondLevelCategoryName(secondLevelCategoryName);
		return dao.saveArticle(orgArticleVo).toString();
	}
	}
	/************************************************ PC *************************************************************/
	/************************************************ PC *************************************************************/
@ -576,16 +574,14 @@ public class ArticleApi {
		Integer  isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否有权限
		Integer  isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否有权限
		String  currentUserRole = StringUtil.isEmpty(json.get("currentUserRole")) ? null : json.getString("currentUserRole");//当前登录的角色
		String  currentUserRole = StringUtil.isEmpty(json.get("currentUserRole")) ? null : json.getString("currentUserRole");//当前登录的角色
		String  currentUserRoleLevel = StringUtil.isEmpty(json.get("currentUserRoleLevel")) ? null : json.getString("currentUserRoleLevel");//当前登录的角色级别
		String  currentUserRoleLevel = StringUtil.isEmpty(json.get("currentUserRoleLevel")) ? null : json.getString("currentUserRoleLevel");//当前登录的角色级别
		Integer	page = 0;
		Integer	pageSize = 0;
		if(!StringUtil.isEmpty(json.get("page"))){
			page = json.getInt("page");
		}else{
		Integer	page = StringUtil.isEmpty(json.get("page")) ? null : json.getInt("page");
		Integer	pageSize = StringUtil.isEmpty(json.get("pageSize")) ? null : json.getInt("pageSize");
		Integer	sEcho = StringUtil.isEmpty(json.get("sEcho")) ? 0 : json.getInt("sEcho");
		if(page==null){
			return ApiUtil.getRespJSON(-10000, "page 必传").toString();
			return ApiUtil.getRespJSON(-10000, "page 必传").toString();
		}
		}
		if(!StringUtil.isEmpty(json.get("pageSize"))){
			pageSize = json.getInt("pageSize");
		}else{
		if(pageSize==null){
			return ApiUtil.getRespJSON(-10000, "pageSize 必传").toString();
			return ApiUtil.getRespJSON(-10000, "pageSize 必传").toString();
		}
		}
@ -603,17 +599,22 @@ public class ArticleApi {
		JSONArray array = new JSONArray();
		JSONArray array = new JSONArray();
		try {
		try {
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
			List<Article> list = dao.queryArticlePcList(vo, page, pageSize);
			array.addAll(list);
			Integer count = dao.queryArticlePcListCount(vo);
			rv.put("Result", array);
			rv.put("Count", count);
			com.common.json.JSONObject result = dao.queryArticlePcList(vo, page, pageSize);
//			array.addAll(list);
//			int count = dao.queryArticlePcListCount(vo);
//			rv.put("Result", array);
//			rv.put("Count", count);
			rv.put("aaData",  result.get("result").toString());
			rv.put("iTotalDisplayRecords", result.get("totalProperty"));
			rv.put("iTotalRecords", result.get("totalProperty"));
			rv.put("sEcho", sEcho);
//			System.out.printf("article:"+rv.toString());
			return rv.toString();
		}catch (SQLException e) {
		}catch (SQLException e) {
			e.printStackTrace();
			e.printStackTrace();
			return ApiUtil.getRespJSON(-14444, "获取数据异常:" + e.getMessage()).toString();
			return ApiUtil.getRespJSON(-14444, "获取数据异常:" + e.getMessage()).toString();
		}
		}
		return array.toString();
	}
	}
	/**
	/**
@ -622,44 +623,44 @@ public class ArticleApi {
	 * @return
	 * @return
	 * @throws Exception
	 * @throws Exception
	 */
	 */
	public String editArticle(InterfaceMessage im) throws Exception {
		JSONObject json = JSONObject.fromObject(im.getParam());
		String	articleid = StringUtil.isEmpty(json.get("articleid")) ? null : json.getString("articleid");//文章id
		String	articleTitle = StringUtil.isEmpty(json.get("articleTitle")) ? null : json.getString("articleTitle");//文章id
		String	articleType = StringUtil.isEmpty(json.get("articleType")) ? null : json.getString("articleType");//文章id
		String	remark = StringUtil.isEmpty(json.get("remark")) ? null : json.getString("remark");//文章id
		Integer	articleState = StringUtil.isEmpty(json.get("articleState")) ? null : json.getInt("articleState");//文章id
		Integer	articlelevel = StringUtil.isEmpty(json.get("articlelevel")) ? null : json.getInt("articlelevel");//文章id
		String	firstLevelCategoryId = StringUtil.isEmpty(json.get("firstLevelCategoryId")) ? null : json.getString("firstLevelCategoryId");//文章id
		String	secondLevelCategoryId = StringUtil.isEmpty(json.get("secondLevelCategoryId")) ? null : json.getString("secondLevelCategoryId");//文章id
		String	newUrl = StringUtil.isEmpty(json.get("newUrl")) ? null : json.getString("newUrl");//文章id
		String	userName = StringUtil.isEmpty(json.get("userName")) ? null : json.getString("userName");//文章id
		String	userid = StringUtil.isEmpty(json.get("userid")) ? null : json.getString("userid");//文章id
		String	firstLevelCategoryName = StringUtil.isEmpty(json.get("firstLevelCategoryName")) ? null : json.getString("firstLevelCategoryName");//文章id
		String	secondLevelCategoryName = StringUtil.isEmpty(json.get("secondLevelCategoryName")) ? null : json.getString("secondLevelCategoryName");//文章id
		Timestamp nowTime = DateOper.getNowDateTime();
		OrgArticleVo orgArticleVo = new OrgArticleVo();
		orgArticleVo.setArticleId(articleid);
		orgArticleVo.setArticleType(articleType);
		orgArticleVo.setArticleTitle(articleTitle);
		orgArticleVo.setArticleContent(remark);
		orgArticleVo.setUpdateTime(nowTime);
		orgArticleVo.setArticleState(articleState);
		orgArticleVo.setArticlelevel(articlelevel);
		orgArticleVo.setSecondLevelCategoryId(secondLevelCategoryId);
		orgArticleVo.setFirstLevelCategoryId(firstLevelCategoryId);
		orgArticleVo.setArticleCover(newUrl);
		orgArticleVo.setOperatorName(userName);
		orgArticleVo.setOperatorId(userid);
		orgArticleVo.setFirstLevelCategoryName(firstLevelCategoryName);
		orgArticleVo.setSecondLevelCategoryName(secondLevelCategoryName);
		orgArticleVo.setLastOperatorId(userid);
		orgArticleVo.setLastOperatorName(userName);
		return null;
	}
//	public String editArticle(InterfaceMessage im) throws Exception {
//
//		JSONObject json = JSONObject.fromObject(im.getParam());
//		String	articleid = StringUtil.isEmpty(json.get("articleid")) ? null : json.getString("articleid");//文章id
//		String	articleTitle = StringUtil.isEmpty(json.get("articleTitle")) ? null : json.getString("articleTitle");//文章id
//
//		String	articleType = StringUtil.isEmpty(json.get("articleType")) ? null : json.getString("articleType");//文章id
//		String	remark = StringUtil.isEmpty(json.get("remark")) ? null : json.getString("remark");//文章id
//		Integer	articleState = StringUtil.isEmpty(json.get("articleState")) ? null : json.getInt("articleState");//文章id
//		Integer	articlelevel = StringUtil.isEmpty(json.get("articlelevel")) ? null : json.getInt("articlelevel");//文章id
//		String	firstLevelCategoryId = StringUtil.isEmpty(json.get("firstLevelCategoryId")) ? null : json.getString("firstLevelCategoryId");//文章id
//		String	secondLevelCategoryId = StringUtil.isEmpty(json.get("secondLevelCategoryId")) ? null : json.getString("secondLevelCategoryId");//文章id
//		String	newUrl = StringUtil.isEmpty(json.get("newUrl")) ? null : json.getString("newUrl");//文章id
//		String	userName = StringUtil.isEmpty(json.get("userName")) ? null : json.getString("userName");//文章id
//		String	userid = StringUtil.isEmpty(json.get("userid")) ? null : json.getString("userid");//文章id
//		String	firstLevelCategoryName = StringUtil.isEmpty(json.get("firstLevelCategoryName")) ? null : json.getString("firstLevelCategoryName");//文章id
//		String	secondLevelCategoryName = StringUtil.isEmpty(json.get("secondLevelCategoryName")) ? null : json.getString("secondLevelCategoryName");//文章id
//
//		Timestamp nowTime = DateOper.getNowDateTime();
//		OrgArticleVo orgArticleVo = new OrgArticleVo();
//		orgArticleVo.setArticleId(articleid);
//		orgArticleVo.setArticleType(articleType);
//		orgArticleVo.setArticleTitle(articleTitle);
//		orgArticleVo.setArticleContent(remark);
//		orgArticleVo.setUpdateTime(nowTime);
//		orgArticleVo.setArticleState(articleState);
//		orgArticleVo.setArticlelevel(articlelevel);
//		orgArticleVo.setSecondLevelCategoryId(secondLevelCategoryId);
//		orgArticleVo.setFirstLevelCategoryId(firstLevelCategoryId);
//		orgArticleVo.setArticleCover(newUrl);
//		orgArticleVo.setOperatorName(userName);
//		orgArticleVo.setOperatorId(userid);
//		orgArticleVo.setFirstLevelCategoryName(firstLevelCategoryName);
//		orgArticleVo.setSecondLevelCategoryName(secondLevelCategoryName);
//		orgArticleVo.setLastOperatorId(userid);
//		orgArticleVo.setLastOperatorName(userName);
//		return null;
//	}
	/**
	/**
@ -694,4 +695,38 @@ public class ArticleApi {
		net.sf.json.JSONObject jsonObject = articlePcDao.editArticle(orgArticleVo);
		net.sf.json.JSONObject jsonObject = articlePcDao.editArticle(orgArticleVo);
		return jsonObject.toString();
		return jsonObject.toString();
	}
	}
	/**
	 * 删除文章
	 * @param im
	 * @return
	 * @throws Exception
	 */
	public String removeArticle(InterfaceMessage im) throws Exception {
		JSONObject json = JSONObject.fromObject(im.getParam());
		String	ids = StringUtil.isEmpty(json.get("ids")) ? null : json.getString("ids");//文章id
		if(!StringUtils.isNotEmpty(ids)){
			return ApiUtil.getRespJSON(-14444, "ids必传").toString();
		}
		Timestamp nowTime = DateOper.getNowDateTime();
		String[] idsArr = ids.split(",");
		Integer code = null;
		for (int i = 0; i < idsArr.length; i++) {
			try {
				// 参数赋值
				OrgArticleVo orgArticleVo = new OrgArticleVo();
				orgArticleVo.setArticleId(idsArr[i]);
				orgArticleVo.setArticleState(0);
				orgArticleVo.setUpdateTime(nowTime);
				// 修改
				articlePcDao.removeArticle(orgArticleVo);
			} catch (Exception e) {
				e.printStackTrace();
				return ApiUtil.getRespJSON(-14444, "获取数据异常:" + e.getMessage()).toString();
			}
		}
		return ApiUtil.getRespJSON(10000, "删除成功").toString();
	}
}
}

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

@ -34,6 +34,7 @@ public class ArticleApiTest {
		// System.out.println(api.getArticalById(im));
		// System.out.println(api.getArticalById(im));
		queryArticlePcList();
		queryArticlePcList();
//		System.out.printf("350200".substring(0,3));
	}
	}
	public static void initDB() {
	public static void initDB() {
@ -56,23 +57,27 @@ public class ArticleApiTest {
		JSONObject obj = new JSONObject();
		JSONObject obj = new JSONObject();
//		obj.put("page","1");
//		obj.put("page","1");
//		obj.put("pageSize","2");
//		obj.put("pageSize","2");
//		obj.put("firstLevelCategoryId","37");
		obj.put("firstLevelCategoryId","43");
//		obj.put("secondLevelCategoryId","32");
//		obj.put("secondLevelCategoryId","32");
//		obj.put("insertTimeStart","1");
//		obj.put("insertTimeStart","1");
//		obj.put("insertTimeEnd","1");
//		obj.put("insertTimeEnd","1");
//		obj.put("articlelevel","1");
//		obj.put("articlelevel","1");
//		obj.put("articleTitle","1");
//		obj.put("articleTitle","1");
//		obj.put("userCode","wjw00000001000e6badcfa163e424525");
		obj.put("userCode","0de7295862dd11e69faffa163e8aee56");
//		obj.put("isManage",true);
//		obj.put("isManage",true);
//		obj.put("currentUserRole","350200");
//		obj.put("currentUserRole","350200");
//		obj.put("currentUserRoleLevel","1");
//		obj.put("currentUserRoleLevel","1");
		obj.put("articleid","1");
		obj.put("isAuthentication","0");
		obj.put("currentUserRole","350200");
		obj.put("currentUserRoleLevel","1");
		obj.put("page","0");
		obj.put("pageSize","9");
//		obj.put("articleId","1");
//		obj.put("articleTitle","我口试");
		im.setParam(obj.toString());
		im.setParam(obj.toString());
		initDB();
		initDB();
		try{
		try{
			api.authenticationArticle(im);
//			System.out.println(api.queryArticlePcList(im));
//			api.authenticationArticle(im);
			System.out.println(api.queryArticlePcList(im));
		}catch(Exception e){
		}catch(Exception e){
			e.printStackTrace();
			e.printStackTrace();
		}
		}

+ 4 - 2
edu-article/JkEdu/src/com/yihu/jk/api/CategoryApi.java

@ -26,10 +26,12 @@ public class CategoryApi {
		JSONObject json = JSONObject.fromObject(im.getParam());
		JSONObject json = JSONObject.fromObject(im.getParam());
		Integer categoryLevel = StringUtil.isEmpty(json.get("categoryLevel")) ? null : json.getInt("categoryLevel");
		Integer categoryLevel = StringUtil.isEmpty(json.get("categoryLevel")) ? null : json.getInt("categoryLevel");
//		String userId = StringUtil.isEmpty(json.get("userId")) ? null : json.getString("userId");
//		String userId = StringUtil.isEmpty(json.get("userId")) ? null : json.getString("userId");
		String firstlevelId = StringUtil.isEmpty(json.get("firstlevelId")) ? null : json.getString("firstlevelId");
		String secondLevelId = StringUtil.isEmpty(json.get("secondLevelId")) ? null : json.getString("secondLevelId");
		Category vo = new Category();
		Category vo = new Category();
		vo.setCategoryLevel(categoryLevel);
		vo.setCategoryLevel(categoryLevel);
		vo.setFirstlevelId(firstlevelId);
		vo.setSecondLevelId(secondLevelId);
		try {
		try {
			com.common.json.JSONObject result = dao.getCategoryList( vo, 0, 1000);
			com.common.json.JSONObject result = dao.getCategoryList( vo, 0, 1000);
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");

+ 95 - 4
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java

@ -3,22 +3,27 @@ package com.yihu.jk.dao;
import java.sql.SQLException;
import java.sql.SQLException;
import java.util.List;
import java.util.List;
import com.common.json.JSONException;
import com.common.json.JSONObject;
import com.common.json.JSONObject;
import com.coreframework.db.DB;
import com.coreframework.db.DB;
import com.coreframework.db.Sql;
import com.coreframework.db.Sql;
import com.coreframework.util.AppConfig;
import com.coreframework.util.AppConfig;
import com.yihu.jk.enums.ArticleSqlNameEnum;
import com.yihu.jk.enums.ArticleSqlNameEnum;
import com.yihu.jk.enums.CategorySqlNameEnum;
import com.yihu.jk.enums.MyDatabaseEnum;
import com.yihu.jk.enums.MyDatabaseEnum;
import com.yihu.jk.enums.MyTableEnum;
import com.yihu.jk.enums.MyTableEnum;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.utils.Utils;
import com.yihu.jk.utils.Utils;
import com.yihu.jk.vo.Article;
import com.yihu.jk.vo.Article;
import com.yihu.jk.vo.ArticleStatistic;
import com.yihu.jk.vo.ArticleStatistic;
import com.yihu.jk.vo.Category;
import com.yihu.jk.vo.OrgArticleVo;
import com.yihu.jk.vo.OrgArticleVo;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
@Component
@Component
public class ArticleDao {
public class ArticleDao {
	private CategoryDao dao = new CategoryDao();
	public List<ArticleStatistic> getArticleList(ArticleStatistic vo, int start, int pageSize) throws SQLException {
	public List<ArticleStatistic> getArticleList(ArticleStatistic vo, int start, int pageSize) throws SQLException {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticleList);
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticleList);
		StringBuffer param = new StringBuffer();
		StringBuffer param = new StringBuffer();
@ -455,6 +460,60 @@ public class ArticleDao {
		}
		}
	}
	}
	/**
	 * 添加文章
	 * @param vo
	 * @return
	 */
	public JSONObject updateArticle(OrgArticleVo vo) {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.updateArticle);
		StringBuffer param = new StringBuffer();
		param.append(" and ArticleId  ='").append(vo.getArticleId()).append("'");
		sql.addVar("@Condition", param.toString());
//		if (vo.getCategoryState() == 2) {
//			sql.addVar("@behaviorParam",
//					"CategoryState=" + vo.getCategoryState() + ",UpdateTime='" + vo.getUpdateTime() + "'");
//		}
//		if (!StringUtil.isEmpty(vo.getCategoryName())) {
//			sql.addVar("@behaviorParam",
//					"CategoryName='" + vo.getCategoryName() + "',UpdateTime='" + vo.getUpdateTime() + "'");
//		}
		if(!StringUtils.isEmpty(vo.getFirstLevelCategoryId())){
			sql.addVar("@behaviorParam"," FirstLevelCategoryId='"+vo.getFirstLevelCategoryId()+"',FirstLevelCategoryName='"+vo.getFirstLevelCategoryName()+"'");
		}
		if(!StringUtils.isEmpty(vo.getSecondLevelCategoryId())){
			sql.addVar("@behaviorParam"," SecondLevelCategoryId='"+vo.getSecondLevelCategoryId()+"',SecondLevelCategoryName='"+vo.getSecondLevelCategoryName()+"'");
		}//
		if(!StringUtils.isEmpty(vo.getArticlelevel())){
			sql.addVar("@behaviorParam"," Articlelevel='"+vo.getArticlelevel()+"'");
		}
		if(!StringUtils.isEmpty(vo.getArticleTitle())){
			sql.addVar("@behaviorParam"," ArticleTitle='"+vo.getArticleTitle()+"'");
		}
		if(!StringUtils.isEmpty(vo.getArticleCover())){
			sql.addVar("@behaviorParam"," ArticleCover='"+vo.getArticleCover()+"'");
		}
		if(!StringUtils.isEmpty(vo.getUserScope())){
			sql.addVar("@behaviorParam"," ArticleCover="+vo.getUserScope()+"");
		}
		if(!StringUtils.isEmpty(vo.getArticleContent())){
			sql.addVar("@behaviorParam"," ArticleCover='"+vo.getArticleContent()+"'");
		}
		try {
			// System.out.println(sql);
			DB.me().insert(MyDatabaseEnum.JkEduDB, sql);
			JSONObject json = new JSONObject();
			json.put("Code", 10000);
			json.put("Message", "更新成功");
			return json;
		} catch (JSONException | SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return new JSONObject(StringUtil.jsonResult(-1, Utils.getException(e)));
		}
	}
	/**
	/**
	 * PC端获取文章列表
	 * PC端获取文章列表
	 * @param vo
	 * @param vo
@ -463,7 +522,7 @@ public class ArticleDao {
	 * @return
	 * @return
	 * @throws Exception
	 * @throws Exception
	 */
	 */
	public List<Article> queryArticlePcList(OrgArticleVo vo, int start, int pageSize) throws Exception {
	public JSONObject queryArticlePcList(OrgArticleVo vo, int start, int pageSize) throws Exception {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcList);
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcList);
		StringBuffer param = new StringBuffer();
		StringBuffer param = new StringBuffer();
@ -499,11 +558,42 @@ public class ArticleDao {
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
			param.append(" and ArticleTitle like '%"+vo.getArticleTitle()+"%' ");
			param.append(" and ArticleTitle like '%"+vo.getArticleTitle()+"%' ");
		}
		}
		pageParam.append(" limit ").append(start * pageSize + "," + pageSize);
		if (StringUtil.isNotEmpty(vo.getOperatorId())) {
			param.append(" and OperatorId ='"+vo.getOperatorId()+"' ");
		}
		if("1".equals(vo.getOperatorRoleLevel())){//省
			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,3)+"%' ");
		}else if("2".equals(vo.getOperatorRoleLevel())){//市
			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,4)+"%' ");
		}else if("3".equals(vo.getOperatorRoleLevel())){//区
			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,6)+"%' ");
		}else if("4".equals(vo.getOperatorRoleLevel())){//社区、机构
			param.append(" and OperatorRoleCode = '"+vo.getOperatorRoleCode()+"' ");
		}
		param.append(" and UserScope >= ? ");
		sql.addParamValue(vo.getOperatorRoleLevel());
//		pageParam.append(" limit ").append(start * pageSize + "," + pageSize);
		sql.addVar("@Condition", param.toString());
		sql.addVar("@Condition", param.toString());
		sql.addVar("@PageParam", pageParam.toString());
		sql.addVar("@PageParam", pageParam.toString());
		List<Article> list = DB.me().queryForBeanList(MyDatabaseEnum.JkEduDB, sql,Article.class);
		return list;
//		List<Article> list = DB.me().queryForBeanList(MyDatabaseEnum.JkEduDB, sql,Article.class);
//		Category temp = null;
//		for(Article one:list){
//
//			temp = new Category();
//			temp.setCategoryLevel(1);
//			temp.setFirstlevelId(one.getFirstLevelCategoryId());
//			temp.setSecondLevelId(null);
//			com.common.json.JSONObject result = dao.getCategoryList( temp, 0, 1000);
//			one.setFirstLevelCategoryName(result.get("CategoryName")+"");
//			temp = new Category();
//			temp.setCategoryLevel(2);
//			temp.setFirstlevelId(null);
//			temp.setSecondLevelId(one.getSecondLevelCategoryId());
//			result = dao.getCategoryList( temp, 0, 1000);
//			one.setSecondLevelCategoryName(result.get("CategoryName")+"");
//		}
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);
	}
	}
	/**
	/**
@ -552,4 +642,5 @@ public class ArticleDao {
		Integer size = DB.me().queryForInteger(MyDatabaseEnum.JkEduDB, sql);
		Integer size = DB.me().queryForInteger(MyDatabaseEnum.JkEduDB, sql);
		return size;
		return size;
	}
	}
}
}

+ 1 - 0
edu-article/JkEdu/src/com/yihu/jk/dao/ArticlePcDao.java

@ -91,6 +91,7 @@ public class ArticlePcDao {
			sql.addParamValue(vo.getArticlelevel());
			sql.addParamValue(vo.getArticlelevel());
		}
		}
		sql.addVar("@Condition", sb.toString());
		sql.addVar("@Condition", sb.toString());
		sql.addVar("@PageParam", "");
		sql.addVar("@PageParam", "");
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);

+ 6 - 1
edu-article/JkEdu/src/com/yihu/jk/dao/CategoryDao.java

@ -34,7 +34,12 @@ public class CategoryDao {
		if (StringUtil.isNotEmpty(vo.getCategoryLevel())) {
		if (StringUtil.isNotEmpty(vo.getCategoryLevel())) {
			param.append(" and CategoryLevel =").append(vo.getCategoryLevel());
			param.append(" and CategoryLevel =").append(vo.getCategoryLevel());
		}
		}
		if (StringUtil.isNotEmpty(vo.getFirstlevelId())) {
			param.append(" and FirstLevelId =").append(vo.getFirstlevelId());
		}
		if (StringUtil.isNotEmpty(vo.getSecondLevelId())) {
			param.append(" and SecondLevelId =").append(vo.getSecondLevelId());
		}
//		if (StringUtil.isNotEmpty(userId)) {
//		if (StringUtil.isNotEmpty(userId)) {
//			paramUserId.append(" and userId ='").append(userId).append("'");
//			paramUserId.append(" and userId ='").append(userId).append("'");
//		}
//		}

+ 1 - 1
edu-article/JkEdu/src/com/yihu/jk/enums/ArticleSqlNameEnum.java

@ -7,5 +7,5 @@ public enum ArticleSqlNameEnum implements SqlNameEnum {
	getArticleList, getArticlePcList, queryCategory, getCollectionArticleList, loadAllConfigDictionary, getArticlePc, querySwitchState, pointNumberCount, collectionNumberCount, updateArticleStatistic, updateCollectionStatistic, updateCommentStatistic, insertArticleStatistic, deleteArticleStatistic, queryArticleStatistic, insertArticleInitStatistic
	getArticleList, getArticlePcList, queryCategory, getCollectionArticleList, loadAllConfigDictionary, getArticlePc, querySwitchState, pointNumberCount, collectionNumberCount, updateArticleStatistic, updateCollectionStatistic, updateCommentStatistic, insertArticleStatistic, deleteArticleStatistic, queryArticleStatistic, insertArticleInitStatistic
	, getArticlePcId, getDoctorArticleList, getDoctorArticleListCount, getDoctorArticalByUserIdCount, getDoctorArticalByUserId,getArticlePcListCount
	, getArticlePcId, getDoctorArticleList, getDoctorArticleListCount, getDoctorArticalByUserIdCount, getDoctorArticalByUserId,getArticlePcListCount
	, getArticleQRDetail
	, getArticleQRDetail,updateArticle
}
}

+ 1 - 0
edu-article/JkEdu/src/com/yihu/jk/enums/MyTableEnum.java

@ -8,4 +8,5 @@ public enum MyTableEnum implements TableEnum {
	Config_ArticleQRCode,
	Config_ArticleQRCode,
	Config_MenuRole,
	Config_MenuRole,
	Operation_Log,
	Operation_Log,
	updateArticle
}
}

+ 37 - 0
edu-article/JkEdu/src/com/yihu/jk/vo/Article.java

@ -28,6 +28,11 @@ public class Article {
	private String EndTime;
	private String EndTime;
	private String ArticleType;// 文章类型
	private String ArticleType;// 文章类型
	private Integer IsAuthentication;// 是否认证
	private Integer IsAuthentication;// 是否认证
	private String FirstLevelCategoryName;// 文章一类别名称
	private String FirstLevelCategoryId;// 文章一级类别id
	private String SecondLevelCategoryName;// 文章二级类别   名称
	private String SecondLevelCategoryId;// 文章二类别  ID
	private String DeptName;// 操作人所在科室
	private String DeptName;// 操作人所在科室
	private String TitleLevel;// 等级职称
	private String TitleLevel;// 等级职称
@ -259,4 +264,36 @@ public class Article {
	public void setUserScope(Integer userScope) {
	public void setUserScope(Integer userScope) {
		UserScope = userScope;
		UserScope = userScope;
	}
	}
	public String getFirstLevelCategoryName() {
		return FirstLevelCategoryName;
	}
	public void setFirstLevelCategoryName(String firstLevelCategoryName) {
		FirstLevelCategoryName = firstLevelCategoryName;
	}
	public String getFirstLevelCategoryId() {
		return FirstLevelCategoryId;
	}
	public void setFirstLevelCategoryId(String firstLevelCategoryId) {
		FirstLevelCategoryId = firstLevelCategoryId;
	}
	public String getSecondLevelCategoryName() {
		return SecondLevelCategoryName;
	}
	public void setSecondLevelCategoryName(String secondLevelCategoryName) {
		SecondLevelCategoryName = secondLevelCategoryName;
	}
	public String getSecondLevelCategoryId() {
		return SecondLevelCategoryId;
	}
	public void setSecondLevelCategoryId(String secondLevelCategoryId) {
		SecondLevelCategoryId = secondLevelCategoryId;
	}
}
}

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

@ -41,6 +41,10 @@ public class ArticleStatistic {
	private String TitleLevel;// 等级职称
	private String TitleLevel;// 等级职称
	private String OperatorImg;// 操作人头像
	private String OperatorImg;// 操作人头像
	private String OperatorRoleCode;//操作人角色code
	private String OperatorRoleLevel;//操作人角色级别
	private Integer UserScope;//使用范围(1、全市使用,2、全区使用,3、全社区使用)
	public String getDeptName() {
	public String getDeptName() {
		return DeptName;
		return DeptName;
	}
	}
@ -313,4 +317,27 @@ public class ArticleStatistic {
		this.shareNumber = shareNumber;
		this.shareNumber = shareNumber;
	}
	}
	public String getOperatorRoleCode() {
		return OperatorRoleCode;
	}
	public void setOperatorRoleCode(String operatorRoleCode) {
		OperatorRoleCode = operatorRoleCode;
	}
	public String getOperatorRoleLevel() {
		return OperatorRoleLevel;
	}
	public void setOperatorRoleLevel(String operatorRoleLevel) {
		OperatorRoleLevel = operatorRoleLevel;
	}
	public Integer getUserScope() {
		return UserScope;
	}
	public void setUserScope(Integer userScope) {
		UserScope = userScope;
	}
}
}

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/RoleService.java

@ -5,8 +5,10 @@
 *******************************************************************************/
 *******************************************************************************/
package com.yihu.wlyy.service.common.account;
package com.yihu.wlyy.service.common.account;
import com.yihu.edu.entity.RoleWithAuthorityCheck;
import com.yihu.wlyy.entity.doctor.profile.DoctorRole;
import com.yihu.wlyy.entity.doctor.profile.DoctorRole;
import com.yihu.wlyy.entity.doctor.profile.DoctorRoleRealm;
import com.yihu.wlyy.entity.doctor.profile.DoctorRoleRealm;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorRoleRealmDao;
import com.yihu.wlyy.repository.doctor.DoctorRoleRealmDao;
import com.yihu.wlyy.repository.doctor.DoctorRoleDao;
import com.yihu.wlyy.repository.doctor.DoctorRoleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
@ -35,6 +37,9 @@ public class RoleService extends TokenService {
    private Clock clock = Clock.DEFAULT;
    private Clock clock = Clock.DEFAULT;
    @Autowired
    private DoctorDao doctorDao;
    /**
    /**
     * 获取用户角色列表
     * 获取用户角色列表
     */
     */
@ -148,6 +153,12 @@ public class RoleService extends TokenService {
                }else{
                }else{
                    map.put("isManage", "0");
                    map.put("isManage", "0");
                }
                }
                List<RoleWithAuthorityCheck> list = doctorDao.findEduAuthority(user,role.getCode());
                if(list.size()>0){
                    map.put("authOperate", "1");
                }else{
                    map.put("authOperate", "0");
                }
                re.add(map);
                re.add(map);
            }
            }
        }
        }

+ 169 - 111
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -9,9 +9,11 @@ import com.yihu.es.entity.RoleVo;
import com.yihu.wlyy.config.es.ElastricSearchSave;
import com.yihu.wlyy.config.es.ElastricSearchSave;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
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.entity.patient.Patient;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.common.account.RoleService;
import com.yihu.wlyy.service.common.account.RoleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
@ -60,6 +62,8 @@ public class JMJkEduArticleService extends BaseService {
    private AdminTeamService teamService;
    private AdminTeamService teamService;
    @Autowired
    @Autowired
    private CommonUtil commonUtil;
    private CommonUtil commonUtil;
    @Autowired
    private SignPatientLabelInfoService signPatientLabelInfoService;
    /**
    /**
     *
     *
@ -216,7 +220,8 @@ public class JMJkEduArticleService extends BaseService {
                                                  Integer sendType,
                                                  Integer sendType,
                                                  String sendMessage,
                                                  String sendMessage,
                                                  Long teamId,
                                                  Long teamId,
                                                  String articleId) throws Exception {
                                                  String articleId,
                                                  String leaveWords) throws Exception {
        String batchNo = UUID.randomUUID().toString();
        String batchNo = UUID.randomUUID().toString();
@ -274,7 +279,7 @@ public class JMJkEduArticleService extends BaseService {
        healthEduArticlePatient.setSendName(sendName);
        healthEduArticlePatient.setSendName(sendName);
        healthEduArticlePatient.setSendType(2);
        healthEduArticlePatient.setSendType(2);
        healthEduArticlePatient.setAdminTeamCode(teamId);
        healthEduArticlePatient.setAdminTeamCode(teamId);
        healthEduArticlePatient.setLeaveWords(leaveWords);
        if (doctor != null) {
        if (doctor != null) {
            healthEduArticlePatient.setDoctorName(doctor.getName());
            healthEduArticlePatient.setDoctorName(doctor.getName());
            healthEduArticlePatient.setHospital(doctor.getHospital());
            healthEduArticlePatient.setHospital(doctor.getHospital());
@ -459,7 +464,7 @@ public class JMJkEduArticleService extends BaseService {
                whereSql += " (l.label_type = 1 AND l.label in (" + labelDisease + "))) ";
                whereSql += " (l.label_type = 1 AND l.label in (" + labelDisease + "))) ";
            }
            }
        }
        }
        tableSql += " left join wlyy_patient p on p.code=w.patient ";
        tableSql += " left join wlyy_patient p on p.code=w.patient AND p.openid IS NOT NULL and p.openid <>''";
        if (!StringUtils.isEmpty(labelSex)) {
        if (!StringUtils.isEmpty(labelSex)) {
            whereSql += " and p.sex in (" + labelSex + ") ";
            whereSql += " and p.sex in (" + labelSex + ") ";
        }
        }
@ -597,10 +602,38 @@ public class JMJkEduArticleService extends BaseService {
        return re;
        return re;
    }
    }
    public JSONObject pushArticleConfirm(String articleId,String labelType, String condition, String groupType,Long teamId,String doctorCode) throws Exception{
    public void initPatients(String userCode,String[] groups,String group,String labelType,long teamCode,String[] patients,Set<String> patientSet) throws Exception{
        Map<String, HealthEduArticle> maps = new HashMap<String, HealthEduArticle>();
        if (org.apache.commons.lang3.StringUtils.isNotBlank(group) && groups.length > 0) {
            //递归患者数据
            for (String g : groups) {
                getPatientByGroup(userCode,g, labelType, teamCode, patientSet, 0, 100);
            }
        }
        //去重操作
        for (String p : patients) {
            if (org.apache.commons.lang3.StringUtils.isNotBlank(p)) {
                patientSet.add(p);
            }
        }
    }
    private void getPatientByGroup(String userCode,String labelCode, String labelType, Long teamCode, Set<String> patientSet, int page, int pagesize) throws Exception {
        org.json.JSONArray result = signPatientLabelInfoService.getPatientByLabel(userCode, labelCode, labelType, teamCode, page, pagesize, false, "",false);
        for (Object o : result) {
            org.json.JSONObject json = (org.json.JSONObject) o;
            String patient = (String) json.get("code");
            patientSet.add(patient);
        }
        if (result.length() == 100) {
            getPatientByGroup(userCode,labelCode, labelType, teamCode, patientSet, page + 1, pagesize);
        }
    }
    public JSONObject pushArticleConfirm(String userCode,String[] groups,String group,String labelType,long teamCode,String[] patients,String articleId) throws Exception{
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        Set<String> patientSet = new HashSet<>();
        Set<String> patientSet = new HashSet<>();
        initPatients(patientSet,labelType,condition,groupType,teamId,doctorCode);
        initPatients(userCode,groups,group,labelType,teamCode,patients,patientSet);
        long num = patientSet.size();
        long num = patientSet.size();
        JSONObject result = new JSONObject();
        JSONObject result = new JSONObject();
        result.put("num", num);
        result.put("num", num);
@ -608,108 +641,108 @@ public class JMJkEduArticleService extends BaseService {
        return result;
        return result;
    }
    }
    /**
     * 医生推送文章初始化被推患者信息
     * @param patientSet
     * @param labelType
     * @param condition
     * @param groupType
     * @param teamId
     * @param doctorCode
     */
    public void initPatients(Set<String> patientSet, String labelType, String condition, String groupType,Long teamId,String doctorCode) {
        String adminTeamCodetemp = "";
        if(teamId!=null){
            adminTeamCodetemp+=teamId.longValue();
        }else{
            List<AdminTeam> teamList = teamService.getDoctorTeams(doctorCode);
            for(AdminTeam one:teamList){
                adminTeamCodetemp+=","+one.getId();
            }
            adminTeamCodetemp=adminTeamCodetemp.length()>0?adminTeamCodetemp.substring(1):"";
        }
        String[] cond = {};
        String[] group = {};
        if (!StringUtils.isEmpty(condition)) {
            cond = condition.split(",");
        }
        StringBuilder whereSql = new StringBuilder();
        String tableSql = "";
        for (String one : cond) {
            if ("1".equals(one)) {//有绑定设备
                tableSql = " LEFT JOIN wlyy_patient_device d on d.user=aa.patient and d.device_id is not null ";
            } else if ("2".equals(one)) {//孕产妇
                whereSql.append(" and tt LIKE '%41%' ");
            } else if ("3".equals(one)) {//65岁以上老年人
                whereSql.append(" and tt LIKE '%13%' ");
            }
        }
        if (!StringUtils.isEmpty(groupType)) {
            group = groupType.split(",");
        }
        String sql = "";
        List<String> groupPatient = null;
        List<String> resultList = new ArrayList<>();
        switch (labelType) {
            case "1": {
                for (String one : group) {
                    sql = " SELECT DISTINCT(aa.patient)  FROM " +
                            " ( SELECT a.patient, GROUP_CONCAT( concat(a.label_type, a.label) ) tt " +
                            " FROM ( SELECT l.* FROM wlyy_sign_family w, wlyy_sign_patient_label_info l, " +
                            " wlyy_sign_family_server q WHERE w. STATUS > 0 AND l. STATUS = 1 AND w.admin_team_code in (" +adminTeamCodetemp+")"+
                            " AND w.patient = l.patient " +//AND LEFT (w.hospital, 6) = '350211' " +
                            " AND w. CODE = q.sign_code AND q.server_type = 1 ) a " +
                            " GROUP BY a.patient HAVING 1 = 1  " + whereSql +  " and tt LIKE '%" + labelType + one + "%'  ) aa " + tableSql;
                    groupPatient = jdbcTemplate.queryForList(sql, String.class);
                    resultList.addAll(groupPatient);
                }
                break;
            }
            case "2": {
                for (String one : group) {
                    sql = " select DISTINCT(aa.patient) from ( " +
                            " SELECT a.patient, GROUP_CONCAT( concat(a.label_type, a.label) ) tt " +
                            " FROM ( SELECT l.* FROM wlyy_sign_family w, wlyy_sign_patient_label_info l " +
                            " WHERE w. STATUS > 0 and l.status=1 AND w.admin_team_code in ("+adminTeamCodetemp+") AND w.patient = l.patient ) a " +// AND LEFT (w.hospital, 6) = '350211' ) a " +
                            " GROUP BY a.patient HAVING 1=1 " + whereSql + "  and tt LIKE '%" + labelType + one + "%' ) aa " + tableSql;
                    groupPatient = jdbcTemplate.queryForList(sql, String.class);
                    resultList.addAll(groupPatient);
//    /**
//     * 医生推送文章初始化被推患者信息
//     * @param patientSet
//     * @param labelType
//     * @param condition
//     * @param groupType
//     * @param teamId
//     * @param doctorCode
//     */
//    public void initPatients(Set<String> patientSet, String labelType, String condition, String groupType,Long teamId,String doctorCode) {
//
//        String adminTeamCodetemp = "";
//        if(teamId!=null){
//            adminTeamCodetemp+=teamId.longValue();
//        }else{
//            List<AdminTeam> teamList = teamService.getDoctorTeams(doctorCode);
//            for(AdminTeam one:teamList){
//                adminTeamCodetemp+=","+one.getId();
//            }
//            adminTeamCodetemp=adminTeamCodetemp.length()>0?adminTeamCodetemp.substring(1):"";
//        }
//
//        String[] cond = {};
//        String[] group = {};
//        if (!StringUtils.isEmpty(condition)) {
//            cond = condition.split(",");
//        }
//        StringBuilder whereSql = new StringBuilder();
//        String tableSql = "";
//        for (String one : cond) {
//            if ("1".equals(one)) {//有绑定设备
//                tableSql = " LEFT JOIN wlyy_patient_device d on d.user=aa.patient and d.device_id is not null ";
//            } else if ("2".equals(one)) {//孕产妇
//                whereSql.append(" and tt LIKE '%41%' ");
//            } else if ("3".equals(one)) {//65岁以上老年人
//                whereSql.append(" and tt LIKE '%13%' ");
//            }
//        }
//
//        if (!StringUtils.isEmpty(groupType)) {
//            group = groupType.split(",");
//        }
//        String sql = "";
//        List<String> groupPatient = null;
//        List<String> resultList = new ArrayList<>();
//        switch (labelType) {
//            case "1": {
//                for (String one : group) {
//                    sql = " SELECT DISTINCT(aa.patient)  FROM " +
//                            " ( SELECT a.patient, GROUP_CONCAT( concat(a.label_type, a.label) ) tt " +
//                            " FROM ( SELECT l.* FROM wlyy_sign_family w, wlyy_sign_patient_label_info l, " +
//                            " wlyy_sign_family_server q WHERE w. STATUS > 0 AND l. STATUS = 1 AND w.admin_team_code in (" +adminTeamCodetemp+")"+
//                            " AND w.patient = l.patient " +//AND LEFT (w.hospital, 6) = '350211' " +
//                            " AND w. CODE = q.sign_code AND q.server_type = 1 ) a " +
//                            " GROUP BY a.patient HAVING 1 = 1  " + whereSql +  " and tt LIKE '%" + labelType + one + "%'  ) aa " + tableSql;
//                    groupPatient = jdbcTemplate.queryForList(sql, String.class);
//                    resultList.addAll(groupPatient);
//                }
//                }
                }
                break;
            }
            case "3": {
                for (String one : group) {
                    sql = " select DISTINCT(aa.patient)  from ( " +
                            " SELECT a.patient, GROUP_CONCAT( concat(a.label_type, a.label) ) tt " +
                            " FROM ( SELECT l.* FROM wlyy_sign_family w, wlyy_sign_patient_label_info l " +
                            " WHERE w. STATUS > 0 and l.status=1 AND w.admin_team_code in ("+adminTeamCodetemp+") AND w.patient = l.patient ) a " +// AND LEFT (w.hospital, 6) = '350211' ) a " +
                            " GROUP BY a.patient HAVING 1=1 " + whereSql + " and tt LIKE '%" + labelType + one + "%') aa " + tableSql;
                    groupPatient = jdbcTemplate.queryForList(sql, String.class);
                    resultList.addAll(groupPatient);
//                break;
//            }
//            case "2": {
//                for (String one : group) {
//                    sql = " select DISTINCT(aa.patient) from ( " +
//                            " SELECT a.patient, GROUP_CONCAT( concat(a.label_type, a.label) ) tt " +
//                            " FROM ( SELECT l.* FROM wlyy_sign_family w, wlyy_sign_patient_label_info l " +
//                            " WHERE w. STATUS > 0 and l.status=1 AND w.admin_team_code in ("+adminTeamCodetemp+") AND w.patient = l.patient ) a " +// AND LEFT (w.hospital, 6) = '350211' ) a " +
//                            " GROUP BY a.patient HAVING 1=1 " + whereSql + "  and tt LIKE '%" + labelType + one + "%' ) aa " + tableSql;
//                    groupPatient = jdbcTemplate.queryForList(sql, String.class);
//                    resultList.addAll(groupPatient);
////                }
//                }
//                }
                }
                break;
            }
            case "4": {
                for (String one : group) {
                    sql = " select DISTINCT(aa.patient) from ( " +
                            " SELECT a.patient, GROUP_CONCAT( concat(a.label_type, a.label) ) tt " +
                            " FROM ( SELECT l.* FROM wlyy_sign_family w, wlyy_sign_patient_label_info l " +
                            " WHERE w. STATUS > 0 and l.status=1 AND w.admin_team_code in ("+adminTeamCodetemp+") AND w.patient = l.patient ) a " +// AND LEFT (w.hospital, 6) = '350211' ) a " +
                            " GROUP BY a.patient HAVING 1=1 " + whereSql.toString() + " and tt LIKE '%" + labelType + one + "%') aa " + tableSql;
                    groupPatient = jdbcTemplate.queryForList(sql, String.class);
                    resultList.addAll(groupPatient);
//                break;
//            }
//            case "3": {
//                for (String one : group) {
//                    sql = " select DISTINCT(aa.patient)  from ( " +
//                            " SELECT a.patient, GROUP_CONCAT( concat(a.label_type, a.label) ) tt " +
//                            " FROM ( SELECT l.* FROM wlyy_sign_family w, wlyy_sign_patient_label_info l " +
//                            " WHERE w. STATUS > 0 and l.status=1 AND w.admin_team_code in ("+adminTeamCodetemp+") AND w.patient = l.patient ) a " +// AND LEFT (w.hospital, 6) = '350211' ) a " +
//                            " GROUP BY a.patient HAVING 1=1 " + whereSql + " and tt LIKE '%" + labelType + one + "%') aa " + tableSql;
//                    groupPatient = jdbcTemplate.queryForList(sql, String.class);
//                    resultList.addAll(groupPatient);
////                }
//                }
//                }
                }
                break;
            }
        }
        patientSet.addAll(resultList);
    }
//                break;
//            }
//            case "4": {
//                for (String one : group) {
//                    sql = " select DISTINCT(aa.patient) from ( " +
//                            " SELECT a.patient, GROUP_CONCAT( concat(a.label_type, a.label) ) tt " +
//                            " FROM ( SELECT l.* FROM wlyy_sign_family w, wlyy_sign_patient_label_info l " +
//                            " WHERE w. STATUS > 0 and l.status=1 AND w.admin_team_code in ("+adminTeamCodetemp+") AND w.patient = l.patient ) a " +// AND LEFT (w.hospital, 6) = '350211' ) a " +
//                            " GROUP BY a.patient HAVING 1=1 " + whereSql.toString() + " and tt LIKE '%" + labelType + one + "%') aa " + tableSql;
//                    groupPatient = jdbcTemplate.queryForList(sql, String.class);
//                    resultList.addAll(groupPatient);
////                }
//                }
//                break;
//            }
//        }
//        patientSet.addAll(resultList);
//    }
    public JSONArray pushArticleLogs(int page, int pagesize, String patientCode,String level1Type) throws Exception {
    public JSONArray pushArticleLogs(int page, int pagesize, String patientCode,String level1Type) throws Exception {
@ -781,7 +814,10 @@ public class JMJkEduArticleService extends BaseService {
                            String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,String operatorRoleCode,
                            String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,String operatorRoleCode,
                            String opertorRoleLevel,Integer userScope,String articleId) throws Exception {
                            String opertorRoleLevel,Integer userScope,String articleId) throws Exception {
        image = commonUtil.copyTempImage(image);
        if(!StringUtils.isEmpty(image)){
            image = commonUtil.copyTempImage(image);
        }
        Integer isAuthentication = 0;
        Integer isAuthentication = 0;
        //当管理员具有审核权限时,添加文章不需认证,添加后自动认证,
        //当管理员具有审核权限时,添加文章不需认证,添加后自动认证,
        Doctor doctor = doctorDao.findByCode(userCode);
        Doctor doctor = doctorDao.findByCode(userCode);
@ -810,17 +846,39 @@ public class JMJkEduArticleService extends BaseService {
     * @throws Exception
     * @throws Exception
     */
     */
    public JSONObject queryArticlePcList(String firstLevelCategoryId, String secondLevelCategoryId, String insertTimeStart, String insertTimeEnd, String articlelevel, String articleTitle,
    public JSONObject queryArticlePcList(String firstLevelCategoryId, String secondLevelCategoryId, String insertTimeStart, String insertTimeEnd, String articlelevel, String articleTitle,
                                          String userCode, String currentUserRole, String currentUserRoleLevel, String isAuthentication, Boolean isMyArticle, Integer page, Integer pageSize) throws Exception{
                                          String userCode, String currentUserRole, String currentUserRoleLevel, String isAuthentication, Boolean isMyArticle, Integer page, Integer pageSize,Integer sEcho) throws Exception{
//        Doctor doctor = doctorDao.findByCode(userCode);
//        Doctor doctor = doctorDao.findByCode(userCode);
//        boolean isManage = false;
//        boolean isManage = false;
//        if(doctor.getLevel()==10){
//        if(doctor.getLevel()==10){
//            isManage = true;
//            isManage = true;
//        }
//        }
        if(isMyArticle==null||(isMyArticle!=null&&!isMyArticle)){
            userCode = null;
        }
        return thirdJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,
                articleTitle,userCode,isAuthentication,currentUserRole,currentUserRoleLevel,page,pageSize);
//        if(isMyArticle==null||(isMyArticle!=null&&!isMyArticle)){
//            userCode = null;
//        }
        return thirdJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,isMyArticle,
                articleTitle,userCode,isAuthentication,currentUserRole,currentUserRoleLevel,page,pageSize,sEcho);
    }
    /**
     * 文章认证列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articleTitle
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @param isAuthentication
     * @param page
     * @param pageSize
     * @param sEcho
     * @return
     * @throws Exception
     */
    public JSONObject authenArticlePCList(String firstLevelCategoryId, String secondLevelCategoryId, String insertTimeStart, String insertTimeEnd, String articleTitle,
                                         String currentUserRole, String currentUserRoleLevel, String isAuthentication,Integer page, Integer pageSize,Integer sEcho) throws Exception{
        return thirdJkEduArticleService.authenArticlePCList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,
                articleTitle,isAuthentication,currentUserRole,currentUserRoleLevel,page,pageSize,sEcho);
    }
    }
    /**
    /**

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

@ -76,6 +76,8 @@ public class ThirdJkEduArticleService extends BaseService {
    private String saveArticle = "JkEdu.Article.saveArticle";//添加文章
    private String saveArticle = "JkEdu.Article.saveArticle";//添加文章
    private String queryArticlePcList = "JkEdu.Article.queryArticlePcList";//PC端获取文章列表
    private String queryArticlePcList = "JkEdu.Article.queryArticlePcList";//PC端获取文章列表
    private String authenticationArticle = "JkEdu.Article.authenticationArticle";//文章认证
    private String authenticationArticle = "JkEdu.Article.authenticationArticle";//文章认证
    private String removeArticle = "JkEdu.Article.removeArticle";//删除文章
    private String authenArticlePCList = "JkEdu.Article.authenArticlePCList";//文章认证列表
    /*********************************************** Category ******************************************/
    /*********************************************** Category ******************************************/
    private String getCategoryList = "JkEdu.Category.getCategoryList";//获取类别接口
    private String getCategoryList = "JkEdu.Category.getCategoryList";//获取类别接口
    private String addCategory = "JkEdu.Category.addCategory";//新增类别接口
    private String addCategory = "JkEdu.Category.addCategory";//新增类别接口
@ -441,8 +443,8 @@ public class ThirdJkEduArticleService extends BaseService {
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    public JSONObject queryArticlePcList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,
                                        String articleTitle,String userCode,String isAuthentication,String currentUserRole,String currentUserRoleLevel,Integer page,Integer pageSize) throws Exception {
    public JSONObject queryArticlePcList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,Boolean isMyArticle,
                                        String articleTitle,String userCode,String isAuthentication,String currentUserRole,String currentUserRoleLevel,Integer page,Integer pageSize,Integer sEcho) throws Exception {
        String response = "";
        String response = "";
        JSONObject json = null;
        JSONObject json = null;
@ -460,6 +462,8 @@ public class ThirdJkEduArticleService extends BaseService {
            param.put("currentUserRoleLevel", currentUserRoleLevel);
            param.put("currentUserRoleLevel", currentUserRoleLevel);
            param.put("page", page+"");
            param.put("page", page+"");
            param.put("pageSize", pageSize+"");
            param.put("pageSize", pageSize+"");
            param.put("sEcho", sEcho);
            param.put("isMyArticle", isMyArticle);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(queryArticlePcList, param.toString(), "1"));
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(queryArticlePcList, param.toString(), "1"));
            json = JSON.parseObject(response);
            json = JSON.parseObject(response);
        } catch (Exception e) {
        } catch (Exception e) {
@ -473,7 +477,55 @@ public class ThirdJkEduArticleService extends BaseService {
    }
    }
    /**
    /**
     *
     * 文章认证列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articlelevel
     * @param articleTitle
     * @param userCode
     * @param isAuthentication
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @param page
     * @param pageSize
     * @param sEcho
     * @return
     * @throws Exception
     */
    public JSONObject authenArticlePCList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,
                                         String articleTitle,String isAuthentication,String currentUserRole,String currentUserRoleLevel,Integer page,Integer pageSize,Integer sEcho) throws Exception {
        String response = "";
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("firstLevelCategoryId", firstLevelCategoryId);
            param.put("secondLevelCategoryId", secondLevelCategoryId);
            param.put("insertTimeStart", insertTimeStart);
            param.put("insertTimeEnd", insertTimeEnd);
            param.put("articleTitle", articleTitle);
            param.put("isAuthentication", isAuthentication);
            param.put("currentUserRole", currentUserRole);
            param.put("currentUserRoleLevel", currentUserRoleLevel);
            param.put("page", page+"");
            param.put("pageSize", pageSize+"");
            param.put("sEcho", sEcho);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(authenArticlePCList, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if ("10000".equals(json.getString("Code"))) {
            return json;
        } else {
            throw new Exception(json.getString("Message"));
        }
    }
    /**
     * 认证文章
     * @return
     * @return
     */
     */
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName) throws Exception{
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName) throws Exception{
@ -498,6 +550,27 @@ public class ThirdJkEduArticleService extends BaseService {
        }
        }
    }
    }
    /**
     * 删除文章
     * @param ids
     * @throws Exception
     */
    public void removeArticle(String ids) throws Exception{
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("ids", ids);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(removeArticle, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (!"10000".equals(json.getString("Code"))) {
            throw new Exception(json.getString("Message"));
        }
    }
    /*************************************************** Category *****************************************************/
    /*************************************************** Category *****************************************************/

+ 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);
            JSONObject json = new JSONObject(userAgent);
            return json.getString("uid");
            return json.getString("uid");
//            return "wjw00000001000e6badcfa163e424525";// wjw00000001000e6badcfa163e424589
//            return "0de7295862dd11e69faffa163e8aee56";// wjw00000001000e6badcfa163e424589/wjw00000001000e6badcfa163e424525
        } catch (Exception e) {
        } catch (Exception e) {
            return null;
            return null;
        }
        }

+ 19 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -1,9 +1,11 @@
package com.yihu.wlyy.web.common.account;
package com.yihu.wlyy.web.common.account;
import com.yihu.edu.entity.RoleWithAuthorityCheck;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.login.LoginLog;
import com.yihu.wlyy.entity.login.LoginLog;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.security.TokenDao;
import com.yihu.wlyy.repository.security.TokenDao;
import com.yihu.wlyy.service.common.SMSService;
import com.yihu.wlyy.service.common.SMSService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.DoctorService;
@ -72,6 +74,7 @@ public class LoginController extends BaseController {
    @Autowired
    @Autowired
    private RSAUtils rsaUtils;
    private RSAUtils rsaUtils;
    /**
    /**
     * 公钥生成并返回接口
     * 公钥生成并返回接口
     *
     *
@ -249,11 +252,23 @@ public class LoginController extends BaseController {
                    List<Map<String, String>> roleMap = roleService.getUserRoleAndArea(doctor.getCode());
                    List<Map<String, String>> roleMap = roleService.getUserRoleAndArea(doctor.getCode());
                    map.put("userRole", roleMap);
                    map.put("userRole", roleMap);
                    //医生当前登录的角色
                    //医生当前登录的角色
                    for(Map<String, String> one:roleMap){
                        if("1".equals(one.get("isManage"))){
                            map.put("currentUserRole", one);
                            continue;
                    if(roleMap.size()>0){
                        for(Map<String, String> one:roleMap){
                            if("1".equals(one.get("isManage"))){
                                map.put("currentUserRole", one);
                                continue;
                            }
                        }
                        }
                    }else{
                        Map<String, String> one = new HashMap<>();
                        one.put("isManage","0");
                        map.put("code", doctor.getHospital());
                        map.put("name", doctor.getHospitalName());
                        map.put("areas", "");
                        map.put("level","4");
                        map.put("authOperate", "0");
                        map.put("currentUserRole", one);
                    }
                    }
                    if ("10" .equals(doctor.getLevel()) && roleMap.size() == 0) {
                    if ("10" .equals(doctor.getLevel()) && roleMap.size() == 0) {
                        errorMessage = "改用户没有管理员权限";
                        errorMessage = "改用户没有管理员权限";

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

@ -2,7 +2,11 @@ package com.yihu.wlyy.web.doctor.jimeiJkEdu;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.call.CustomerService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
@ -13,6 +17,8 @@ import com.yihu.wlyy.web.third.gateway.vo.base.ResultPageListModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
@ -24,9 +30,7 @@ import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.TextMessage;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
/**
/**
 * Created by Trick on 2017/11/14.
 * Created by Trick on 2017/11/14.
@ -40,7 +44,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
    private JMJkEduArticleService jmJkEduArticleService;
    private JMJkEduArticleService jmJkEduArticleService;
    @Autowired
    @Autowired
    private ThirdJkEduArticleService thirdJkEduArticleService;
    private ThirdJkEduArticleService thirdJkEduArticleService;
    
    @Autowired
    @Autowired
    private JmsTemplate jmsTemplate;
    private JmsTemplate jmsTemplate;
    @Value("${activemq.queue.healtHarticleQueue}")
    @Value("${activemq.queue.healtHarticleQueue}")
@ -48,6 +52,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
    @Value("${jkEdu.web.articleBaseUrl}")
    @Value("${jkEdu.web.articleBaseUrl}")
    private String articleBaseUrl;
    private String articleBaseUrl;
    /**
    /**
     * 发送到redis
     * 发送到redis
     *
     *
@ -107,7 +112,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
            @ApiParam(name = "labelServeType", value = "标签类型  3:服务类型,多个用逗号分隔", required = false) @RequestParam(value = "labelServeType", required = false, defaultValue = "") String labelServeType,
            @ApiParam(name = "labelServeType", value = "标签类型  3:服务类型,多个用逗号分隔", required = false) @RequestParam(value = "labelServeType", required = false, defaultValue = "") String labelServeType,
            @ApiParam(name = "labelDiseaseType", value = "标签类型  4:疾病类型,多个用逗号分隔", required = false) @RequestParam(value = "labelDiseaseType", required = false, defaultValue = "") String labelDiseaseType,
            @ApiParam(name = "labelDiseaseType", value = "标签类型  4:疾病类型,多个用逗号分隔", required = false) @RequestParam(value = "labelDiseaseType", required = false, defaultValue = "") String labelDiseaseType,
            @ApiParam(name = "labelHealthType", value = "标签类型  5:健康情况,多个用逗号分隔", required = false) @RequestParam(value = "labelHealthType", required = false, defaultValue = "") String labelHealthType,
            @ApiParam(name = "labelHealthType", value = "标签类型  5:健康情况,多个用逗号分隔", required = false) @RequestParam(value = "labelHealthType", required = false, defaultValue = "") String labelHealthType,
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId,
            @ApiParam(name = "leaveWords", value = "医生留言", required = false) @RequestParam(value = "leaveWords", required = false) String leaveWords
    ){
    ){
        try {
        try {
@ -116,7 +122,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
            jmJkEduArticleService.initPatient(patientSet,labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID());
            jmJkEduArticleService.initPatient(patientSet,labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID());
//            patientSet.add(patientService.findByCode("wjw00000001000e6badcfa163e424525"));
//            patientSet.add(patientService.findByCode("wjw00000001000e6badcfa163e424525"));
            //获取保存发送记录
            //获取保存发送记录
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 2,"", 0L, articleId);
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 2,"", 0L, articleId,leaveWords);
            //推送微信模板消息和发送im消息
            //推送微信模板消息和发送im消息
            new Thread(() -> {
            new Thread(() -> {
                //发送任务到redis
                //发送任务到redis
@ -174,14 +180,30 @@ public class DoctorJMJkEduArticleController extends BaseController {
    @ResponseBody
    @ResponseBody
    @RequestMapping(value = "doctorPushArticleConfirm",method = RequestMethod.GET)
    @RequestMapping(value = "doctorPushArticleConfirm",method = RequestMethod.GET)
    public String doctorPushArticleConfirm(
    public String doctorPushArticleConfirm(
            @ApiParam(name = "teamId", value = "行政团队id", required = false) @RequestParam(value = "teamId", required = false) Long teamId,
            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "labelType", required = true) String labelType,
            @ApiParam(name = "condition", value = "多个筛选条件以逗号分割", required = false) @RequestParam(value = "condition", required = false) String condition,
            @ApiParam(name = "groupType", value = "多个分组以逗号分割", required = false) @RequestParam(value = "groupType", required = false) String groupType,
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
            @RequestParam(value = "code") String code,
            @RequestParam(value = "patient", required = false) String patient,
            @RequestParam(value = "group", required = false, defaultValue = "") String group,
            @RequestParam(value = "labelType", required = false) String labelType,
            @RequestParam(value = "teamCode", required = false) long teamCode,
            @RequestParam(value = "articleId", required = false) String articleId){
        try {
        try {
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.pushArticleConfirm(articleId,labelType,condition,groupType,teamId,getUID());
            if (StringUtils.isEmpty(code)) {
                return error(-1,"请至少选择一篇文章!");
            }
            if (StringUtils.isEmpty(patient) && StringUtils.isEmpty(group)) {
                return error(-1,"请至少选择一个患者!");
            }
            String[] articles = code.split(",");
            String[] patients = patient.split(",");
            String[] groups = group.split(",");
            if (articles.length == 0) {
                return error(-1,"请至少选择一篇文章!");
            }
            if (patients.length == 0 && groups.length == 0) {
                return error(-1,"请至少选择一个患者!");
            }
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.pushArticleConfirm(getUID(),groups,group,labelType,teamCode,patients,articleId);
            return write(200,"查询成功!","data",response);
            return write(200,"查询成功!","data",response);
        }catch (Exception e) {
        }catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
@ -189,26 +211,71 @@ public class DoctorJMJkEduArticleController extends BaseController {
        }
        }
    }
    }
//    @RequestMapping(value = "doctorSendArticleToPatients", method = RequestMethod.POST)
//    @ApiOperation("医生文章群推送")
//    public BaseResultModel doctorSendArticleToPatients(
//            @ApiParam(name = "teamId", value = "行政团队id", required = false) @RequestParam(value = "teamId", required = false) Long teamId,
//            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "labelType", required = true) String labelType,
//            @ApiParam(name = "condition", value = "多个筛选条件以逗号分割", required = false) @RequestParam(value = "condition", required = false) String condition,
//            @ApiParam(name = "groupType", value = "多个分组以逗号分割", required = false) @RequestParam(value = "groupType", required = false) String groupType,
//            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
//        try {
//            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
//            //得到需要发送的患者
//            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
//            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", teamId, articleId);
//            //推送微信模板消息和发送im消息
//            new Thread(() -> {
//                //发送任务到redis
//                sender(healthEduArticlePatient);
//            }).start();
//            return new BaseResultModel();
//        }catch (Exception e) {
//            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
//        }
//    }
    @RequestMapping(value = "doctorSendArticleToPatients", method = RequestMethod.POST)
    @RequestMapping(value = "doctorSendArticleToPatients", method = RequestMethod.POST)
    @ApiOperation("医生文章群推送")
    @ApiOperation("医生文章群推送")
    public BaseResultModel doctorSendArticleToPatients(
            @ApiParam(name = "teamId", value = "行政团队id", required = false) @RequestParam(value = "teamId", required = false) Long teamId,
            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "labelType", required = true) String labelType,
            @ApiParam(name = "condition", value = "多个筛选条件以逗号分割", required = false) @RequestParam(value = "condition", required = false) String condition,
            @ApiParam(name = "groupType", value = "多个分组以逗号分割", required = false) @RequestParam(value = "groupType", required = false) String groupType,
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
    public BaseResultModel doctorSendArticleToPatients(@RequestParam(value = "code") String code,
                                              @RequestParam(value = "patient", required = false) String patient,
                                              @RequestParam(value = "group", required = false, defaultValue = "") String group,
                                              @RequestParam(value = "labelType", required = false) String labelType,
                                              @RequestParam(value = "teamCode", required = false) long teamCode,
                                              @RequestParam(value = "articleId", required = false) String articleId,
                                              @RequestParam(value = "leaveWords", required = false) String leaveWords){
        try {
        try {
            if (StringUtils.isEmpty(code)) {
                return new BaseResultModel("请至少选择一篇文章!");
            }
            if (StringUtils.isEmpty(patient) && StringUtils.isEmpty(group)) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            String[] articles = code.split(",");
            String[] patients = patient.split(",");
            String[] groups = group.split(",");
            if (articles.length == 0) {
                return new BaseResultModel("请至少选择一篇文章!");
            }
            if (patients.length == 0 && groups.length == 0) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            //得到需要发送的患者
            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", teamId, articleId);
            jmJkEduArticleService.initPatients(getUID(),groups, group,labelType,teamCode,patients,patientSet);
//            jmJkEduArticleService.initPatient(getUID(),groups,group,labelType,teamCode,patients,patientSet);
            if (patientSet.size() == 0) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", teamCode, articleId,leaveWords);
            //推送微信模板消息和发送im消息
            //推送微信模板消息和发送im消息
            new Thread(() -> {
            new Thread(() -> {
                //发送任务到redis
                //发送任务到redis
                sender(healthEduArticlePatient);
                sender(healthEduArticlePatient);
            }).start();
            }).start();
            return new BaseResultModel();
            return new BaseResultModel();
        }catch (Exception e) {
        } catch (Exception e) {
            error(e);
            return new BaseResultModel(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());
        }
        }
    }
    }
@ -217,13 +284,14 @@ public class DoctorJMJkEduArticleController extends BaseController {
    @ApiOperation("医生文章单个患者推送")
    @ApiOperation("医生文章单个患者推送")
    public BaseResultModel doctorSendArticleToSingle(
    public BaseResultModel doctorSendArticleToSingle(
            @ApiParam(name = "patientCode", value = "患者Code", required = true) @RequestParam(value = "patientCode", required = true) String patientCode,
            @ApiParam(name = "patientCode", value = "患者Code", required = true) @RequestParam(value = "patientCode", required = true) String patientCode,
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId,
            @ApiParam(name = "leaveWords", value = "医生留言", required = false) @RequestParam(value = "leaveWords", required = false) String leaveWords){
        try {
        try {
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            //得到需要发送的患者
            //得到需要发送的患者
            patientSet.add(patientCode);
            patientSet.add(patientCode);
//            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
//            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", 0L, articleId);
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", 0L, articleId,leaveWords);
            //推送微信模板消息和发送im消息
            //推送微信模板消息和发送im消息
            new Thread(() -> {
            new Thread(() -> {
                //发送任务到redis
                //发送任务到redis
@ -234,7 +302,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
            return new BaseResultModel(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());
        }
        }
    }
    }
    
    @RequestMapping(value = "getArticalById",method = RequestMethod.GET)
    @RequestMapping(value = "getArticalById",method = RequestMethod.GET)
    @ApiOperation("获取文章详情")
    @ApiOperation("获取文章详情")
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
@ -247,13 +315,12 @@ public class DoctorJMJkEduArticleController extends BaseController {
            return error(-1,"查询失败!");
            return error(-1,"查询失败!");
        }
        }
    }
    }
    
    /**
    /**
     * 医生端端文章列表
     * 医生端端文章列表
     * @param firstLevelCategoryId
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeStart
     * @param insertTimeEnds
     * @param articlelevel
     * @param articlelevel
     * @param articleTitle
     * @param articleTitle
     * @return
     * @return
@ -274,8 +341,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别",defaultValue = "4")
                                      @RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel,
                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
                                      @RequestParam(value = "currentUserRoleLevel", required = false )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
@ -285,19 +352,19 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                      @ApiParam(name = "pageSize", value = "分页数")
                                      @ApiParam(name = "pageSize", value = "分页数")
                                      @RequestParam(value = "pageSize", required = true) Integer pageSize){
                                      @RequestParam(value = "pageSize", required = true) Integer pageSize){
        try {
        try {
            
            
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize);
            
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId, secondLevelCategoryId, insertTimeStart, insertTimeEnd, articlelevel, articleTitle,
                    "0de7295862dd11e69faffa163e8aee56", currentUserRole, currentUserRoleLevel, isAuthentication, isMyArticle, page, pageSize,null);
            return write(200,"查询成功!","data",response);
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
        } catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
            return error(-1,"查询失败!");
            return error(-1,"查询失败!");
        }
        }
    }
    }
    
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加文章")
    @ApiOperation("添加文章")
    public  String saveArticle(@ApiParam(name = "articleId", value = "文章Id")
    public  String saveArticle(@ApiParam(name = "articleId", value = "文章Id")
@ -326,7 +393,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
                               @RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel,
                               @RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel,
                               @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用)")
                               @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用)")
                               @RequestParam(value = "userScope", required = true) Integer userScope){
                               @RequestParam(value = "userScope", required = true) Integer userScope){
        
        try {
        try {
            jmJkEduArticleService.saveArticle(getUID(),articleTitle,articleType,articlelevel,secondLevelCategoryId,imageUrl,
            jmJkEduArticleService.saveArticle(getUID(),articleTitle,articleType,articlelevel,secondLevelCategoryId,imageUrl,
                    secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,currentUserRole,currentUserRoleLevel,userScope,articleId);
                    secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,currentUserRole,currentUserRoleLevel,userScope,articleId);

+ 43 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

@ -31,7 +31,7 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                               @ApiParam(name = "articleTitle", value = "文章标题")
                               @ApiParam(name = "articleTitle", value = "文章标题")
                               @RequestParam(value = "articleTitle", required = true) String articleTitle,
                               @RequestParam(value = "articleTitle", required = true) String articleTitle,
                               @ApiParam(name = "articleType", value = "文章类型")
                               @ApiParam(name = "articleType", value = "文章类型")
                               @RequestParam(value = "articleType", required = true) String articleType,
                               @RequestParam(value = "articleType", required = false) String articleType,
                               @ApiParam(name = "articlelevel", value = "文章级别")
                               @ApiParam(name = "articlelevel", value = "文章级别")
                               @RequestParam(value = "articlelevel", required = true) Integer articlelevel,
                               @RequestParam(value = "articlelevel", required = true) Integer articlelevel,
                               @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类id")
                               @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类id")
@ -45,12 +45,12 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                               @ApiParam(name = "content", value = "文章内容")
                               @ApiParam(name = "content", value = "文章内容")
                               @RequestParam(value = "content", required = true) String content,
                               @RequestParam(value = "content", required = true) String content,
                               @ApiParam(name = "imageUrl", value = "文章封面图片地址")
                               @ApiParam(name = "imageUrl", value = "文章封面图片地址")
                               @RequestParam(value = "imageUrl", required = true) String imageUrl,
                               @RequestParam(value = "imageUrl", required = false) String imageUrl,
//                               @ApiParam(name = "operatorRoleCode", value = "操作人角色code")
//                               @ApiParam(name = "operatorRoleCode", value = "操作人角色code")
//                               @RequestParam(value = "operatorRoleCode", required = true) String operatorRoleCode,
//                               @RequestParam(value = "operatorRoleCode", required = true) String operatorRoleCode,
//                               @ApiParam(name = "opertorRoleLevel", value = "操作人角色级别")
//                               @ApiParam(name = "opertorRoleLevel", value = "操作人角色级别")
//                               @RequestParam(value = "opertorRoleLevel", required = true) String opertorRoleLevel,
//                               @RequestParam(value = "opertorRoleLevel", required = true) String opertorRoleLevel,
                               @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用)")
                               @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用,4、自己使用)")
                               @RequestParam(value = "userScope", required = true) Integer userScope){
                               @RequestParam(value = "userScope", required = true) Integer userScope){
        try {
        try {
@ -98,12 +98,47 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                      @ApiParam(name = "iDisplayStart", value = "当前页")
                                      @ApiParam(name = "iDisplayStart", value = "当前页")
                                      @RequestParam(value = "iDisplayStart", required = true) Integer page,
                                      @RequestParam(value = "iDisplayStart", required = true) Integer page,
                                      @ApiParam(name = "iDisplayLength", value = "是否过滤我的文章")
                                      @ApiParam(name = "iDisplayLength", value = "是否过滤我的文章")
                                      @RequestParam(value = "iDisplayLength", required = true) Integer pageSize){
                                      @RequestParam(value = "iDisplayLength", required = true) Integer pageSize,
                                      @ApiParam(name = "sEcho", value = "插件自带")
                                      @RequestParam(value = "sEcho", required = false) Integer sEcho){
        try {
        try {
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),getCurrentRoleCode(),getCurrentRoleLevel(),isAuthentication,isMyArticle,page,pageSize);
                    getUID(),getCurrentRoleCode(),getCurrentRoleLevel(),isAuthentication,isMyArticle,page,pageSize,sEcho);
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "authenArticlePCList", method = RequestMethod.GET)
    @ApiOperation("查询pc端文章认证列表")
    public  String authenArticlePCList(@ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                      @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                      @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类")
                                      @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
                                      @ApiParam(name = "insertTimeStart", value = "新增文章开始时间")
                                      @RequestParam(value = "insertTimeStart", required = false) String insertTimeStart,
                                      @ApiParam(name = "insertTimeEnd", value = "新增文章结束时间")
                                      @RequestParam(value = "insertTimeEnd", required = false) String insertTimeEnd,
                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "iDisplayStart", value = "当前页")
                                      @RequestParam(value = "iDisplayStart", required = true) Integer page,
                                      @ApiParam(name = "iDisplayLength", value = "是否过滤我的文章")
                                      @RequestParam(value = "iDisplayLength", required = true) Integer pageSize,
                                      @ApiParam(name = "sEcho", value = "插件自带")
                                      @RequestParam(value = "sEcho", required = false) Integer sEcho){
        try {
            JSONObject response = jmJkEduArticleService.authenArticlePCList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articleTitle,
                    getCurrentRoleCode(),getCurrentRoleLevel(),isAuthentication,page,pageSize,sEcho);
            return write(200,"查询成功!","data",response);
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
        } catch (Exception e){
@ -144,11 +179,11 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                          @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                          @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                          @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                          @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                          @ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
                                          @ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
                                          @RequestParam(value = "firstLevelCategoryName", required = true) String firstLevelCategoryName,
                                          @RequestParam(value = "firstLevelCategoryName", required = false) String firstLevelCategoryName,
                                          @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类")
                                          @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类")
                                          @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
                                          @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
                                          @ApiParam(name = "secondLevelCategoryName", value = "文章二级分类名称")
                                          @ApiParam(name = "secondLevelCategoryName", value = "文章二级分类名称")
                                          @RequestParam(value = "secondLevelCategoryName", required = true) String secondLevelCategoryName){
                                          @RequestParam(value = "secondLevelCategoryName", required = false) String secondLevelCategoryName){
        try{
        try{
            jmJkEduArticleService.authenticationArticle(articleId,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            jmJkEduArticleService.authenticationArticle(articleId,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            return success("认证成功!");
            return success("认证成功!");
@ -157,4 +192,5 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
            return error(-1,"认证失败!");
            return error(-1,"认证失败!");
        }
        }
    }
    }
}
}

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

@ -150,7 +150,7 @@ public class SignPatientLabelInfoController extends BaseController {
    @RequestMapping(value = "/patients_by_label")
    @RequestMapping(value = "/patients_by_label")
    @ApiOperation("查询某个团队的某个标签下的患者信息")
    @ApiOperation("查询某个团队的某个标签下的患者信息")
    public String getPatientInfoByLabel(@RequestParam(required = false) String labelCode,
    public String getPatientInfoByLabel(@RequestParam(required = false) String labelCode,
                                        @RequestParam(required = false) String labelType,
                                        @RequestParam(required = false) String labelType,//1
                                        @RequestParam(required = false) Long teamCode,
                                        @RequestParam(required = false) Long teamCode,
                                        @RequestParam(required = false) int page,
                                        @RequestParam(required = false) int page,
                                        @RequestParam(required = false) int pagesize,
                                        @RequestParam(required = false) int pagesize,

+ 6 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcLabelService.java

@ -255,18 +255,19 @@ public class GcLabelService {
        }
        }
        String roleSql = !StringUtils.isEmpty(role+"")?role.substring(1):"";
        String roleSql = !StringUtils.isEmpty(role+"")?role.substring(1):"";
        String whereSql = "";
        String whereSql = "";
        String resultSql="";
        if(StringUtils.isEmpty(roleSql)){
        if(StringUtils.isEmpty(roleSql)){
            switch (level){
            switch (level){
                case 1:{whereSql+=" and province in ("+role+")" ;break;}
                case 2:{whereSql+=" and city in ("+role+")" ;break;}
                case 3:{whereSql+=" and town in ("+role+")" ;break;}
                case 4:{whereSql+=" and code in ("+role+")" ;break;}
                case 1:{whereSql+=" and province in ("+role+") group by city,city_name " ;resultSql=" DISTINCT(city) as code,DISTINCT(city_name) as name ";break;}
                case 2:{whereSql+=" and city in ("+role+") group by town,town_name " ;resultSql=" DISTINCT(town) as code,DISTINCT(town_name) as name ";break;}
                case 3:{whereSql+=" and town in ("+role+") group by code,name " ;resultSql=" DISTINCT(code) as code,DISTINCT(name) as name ";break;}
                case 4:return new ArrayList<>();
            }
            }
        }
        }
        String sql = "select code, name  from dm_hospital  where level=2 "+whereSql ;
        String sql = "select "+resultSql+"  from dm_hospital  where level=2 "+whereSql ;
        List<DictModel> returnList = jdbcTemplate.query(sql, new BeanPropertyRowMapper(DictModel.class));
        List<DictModel> returnList = jdbcTemplate.query(sql, new BeanPropertyRowMapper(DictModel.class));
        return returnList;
        return returnList;
    }
    }

+ 16 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

@ -172,6 +172,22 @@ public class ThirdJkEduArticleController extends BaseController {
        }
        }
    }
    }
    @RequestMapping(value = "removeArticle", method = RequestMethod.POST)
    @ApiOperation("删除文章")
    public  String removeArticle(
            @ApiParam(name = "ids", value = "删除的文章id")
            @RequestParam(value = "ids", required = true) String ids){
        try{
            thirdJkEduArticleService.removeArticle(ids);
            return success("保存成功!");
        } catch (Exception e){
            e.printStackTrace();
            return error(-1,"保存失败!");
        }
    }
    /*************************************************** Category *****************************************************/
    /*************************************************** Category *****************************************************/
    @RequestMapping(value = "addCategory",method = RequestMethod.POST)
    @RequestMapping(value = "addCategory",method = RequestMethod.POST)

+ 5 - 4
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -117,8 +117,8 @@ es:
#集美宣教居民端健康文章
#集美宣教居民端健康文章
jkEdu:
jkEdu:
  web:
  web:
    articleBaseUrl: http://172.19.103.87:9088/
    #articleBaseUrl: http://172.19.103.87:9088/
    articleBaseUrl: http://192.168.131.131:8088/
#消息队列
#消息队列
activemq:
activemq:
  username: admin
  username: admin
@ -129,5 +129,6 @@ activemq:
##如果是外网项目就是flase 内网是true
##如果是外网项目就是flase 内网是true
neiwang:
neiwang:
  enable: true
  wlyy: http://59.61.92.90:8072/wlyy
  enable: false
  #wlyy: http://59.61.92.90:8072/wlyy
  wlyy: http://192.168.131.131:8080/