Przeglądaj źródła

集美宣教代码提交

liuwenbin 7 lat temu
rodzic
commit
11da573ff0
50 zmienionych plików z 1091 dodań i 240 usunięć
  1. 15 0
      edu-article/JkEdu/WebRoot/WEB-INF/classes/ArticleQR.xml
  2. 7 2
      edu-article/JkEdu/WebRoot/WEB-INF/classes/Category.sql.xml
  3. 0 5
      edu-article/JkEdu/WebRoot/WEB-INF/classes/ConfigSys.sql.xml
  4. 6 1
      edu-article/JkEdu/WebRoot/WEB-INF/classes/articlePc.sql.xml
  5. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/action/CategoryAction.class
  6. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  7. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class
  8. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleQRCodeApi.class
  9. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleQRCodeApiTest.class
  10. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class
  11. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  12. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleQRCodeDao.class
  13. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class
  14. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class
  15. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/ArticleQRCode.class
  16. 1 0
      edu-article/JkEdu/WebRoot/WEB-INF/classes/route/JkEdu.xml
  17. 15 0
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/ArticleQR.xml
  18. 7 2
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/Category.sql.xml
  19. 0 5
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/ConfigSys.sql.xml
  20. 6 1
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/articlePc.sql.xml
  21. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/action/CategoryAction.class
  22. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  23. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class
  24. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleQRCodeApi.class
  25. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleQRCodeApiTest.class
  26. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class
  27. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  28. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticlePcDao.class
  29. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticleQRCodeDao.class
  30. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class
  31. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class
  32. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/ArticleQRCode.class
  33. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/OrgArticleVo.class
  34. 1 0
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/route/JkEdu.xml
  35. 10 6
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/sys.xml
  36. 7 2
      edu-article/JkEdu/src/Category.sql.xml
  37. 1 1
      edu-article/JkEdu/src/com/yihu/jk/action/CategoryAction.java
  38. 92 7
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  39. 6 4
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java
  40. 70 0
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleQRCodeApi.java
  41. 2 2
      edu-article/JkEdu/src/com/yihu/jk/api/CategoryApi.java
  42. 18 0
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticleQRCodeDao.java
  43. 5 5
      edu-article/JkEdu/src/com/yihu/jk/dao/CategoryDao.java
  44. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorDao.java
  45. 143 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  46. 445 168
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  47. 134 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java
  48. 1 15
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java
  49. 22 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/jimeiJkEdu/PatientJMJkEduArticleController.java
  50. 72 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

+ 15 - 0
edu-article/JkEdu/WebRoot/WEB-INF/classes/ArticleQR.xml

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

+ 7 - 2
edu-article/JkEdu/WebRoot/WEB-INF/classes/Category.sql.xml

@ -1,12 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<das-client>
	<Sqls> 
		 <Sql name='getCategoryList'>
		 <!--<Sql name='getCategoryList'>
		 <![CDATA[
		select m.*, ISNULL (n.CategoryId)  as isSubscrive from Org_Category m left JOIN
 User_Subscrive n on m.CategoryId=n.CategoryId and  1=1 @UserId where 1=1 and CategoryState!=2 @Condition
			]]>
			</Sql>
			</Sql>-->
		<Sql name='getCategoryList'>
			<![CDATA[
		select m.* from Org_Category m  where 1=1 and CategoryState!=2 @Condition
			]]>
		</Sql>
			
			 <Sql name='addCategory'>
		 <![CDATA[

+ 0 - 5
edu-article/JkEdu/WebRoot/WEB-INF/classes/ConfigSys.sql.xml

@ -5,11 +5,6 @@
		 <![CDATA[
	select * from Config_Signatur
				]]>
			</Sql>
				 <Sql name='getArticleORCode'>
		 <![CDATA[
	select * from Config_ArticleQRCode
				]]>
			</Sql>
				 <Sql name='getConfigSys'>
		 <![CDATA[

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

@ -3,7 +3,12 @@
	<Sqls> 
		 <Sql name='getArticlePcList'>
		 <![CDATA[
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   @PageParam
			]]>
		</Sql>
		<Sql name='getArticlePcListCount'>
			<![CDATA[
				select count(1) from Org_Article where 1=1  and  ArticleState =1  @Condition
			]]>
		</Sql>
		

BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/action/CategoryAction.class


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


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


BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleQRCodeApi.class


BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleQRCodeApiTest.class


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


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


BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleQRCodeDao.class


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


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


BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/ArticleQRCode.class


+ 1 - 0
edu-article/JkEdu/WebRoot/WEB-INF/classes/route/JkEdu.xml

@ -6,6 +6,7 @@
<module name="JkEdu.Category" remoteClass="com.yihu.jk.api.CategoryApi"></module>
<module name="JkEdu.ConfigSys" remoteClass="com.yihu.jk.api.ConfigSysApi"></module>
<module name="JkEdu.ConfigDicSho" remoteClass="com.yihu.jk.api.ConfigDicShoApi"></module>
<module name="JkEdu.ArticleQR" remoteClass="com.yihu.jk.api.getArticleQRCodeApi"></module>
</Mapping>
<Route url="url.JkEdu"></Route>
</Config>

+ 15 - 0
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/ArticleQR.xml

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

+ 7 - 2
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/Category.sql.xml

@ -1,12 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<das-client>
	<Sqls> 
		 <Sql name='getCategoryList'>
		 <!--<Sql name='getCategoryList'>
		 <![CDATA[
		select m.*, ISNULL (n.CategoryId)  as isSubscrive from Org_Category m left JOIN
 User_Subscrive n on m.CategoryId=n.CategoryId and  1=1 @UserId where 1=1 and CategoryState!=2 @Condition
			]]>
			</Sql>
			</Sql>-->
		<Sql name='getCategoryList'>
			<![CDATA[
		select m.* from Org_Category m  where 1=1 and CategoryState!=2 @Condition
			]]>
		</Sql>
			
			 <Sql name='addCategory'>
		 <![CDATA[

+ 0 - 5
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/ConfigSys.sql.xml

@ -5,11 +5,6 @@
		 <![CDATA[
	select * from Config_Signatur
				]]>
			</Sql>
				 <Sql name='getArticleORCode'>
		 <![CDATA[
	select * from Config_ArticleQRCode
				]]>
			</Sql>
				 <Sql name='getConfigSys'>
		 <![CDATA[

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

@ -3,7 +3,12 @@
	<Sqls> 
		 <Sql name='getArticlePcList'>
		 <![CDATA[
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   
				select * from Org_Article where 1=1  and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   @PageParam
			]]>
		</Sql>
		<Sql name='getArticlePcListCount'>
			<![CDATA[
				select count(1) from Org_Article where 1=1  and  ArticleState =1  @Condition
			]]>
		</Sql>
		

BIN
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/action/CategoryAction.class


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


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


BIN
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleQRCodeApi.class


BIN
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleQRCodeApiTest.class


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


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


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


BIN
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticleQRCodeDao.class


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


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


BIN
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/ArticleQRCode.class


BIN
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/OrgArticleVo.class


+ 1 - 0
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/route/JkEdu.xml

@ -6,6 +6,7 @@
<module name="JkEdu.Category" remoteClass="com.yihu.jk.api.CategoryApi"></module>
<module name="JkEdu.ConfigSys" remoteClass="com.yihu.jk.api.ConfigSysApi"></module>
<module name="JkEdu.ConfigDicSho" remoteClass="com.yihu.jk.api.ConfigDicShoApi"></module>
<module name="JkEdu.ArticleQR" remoteClass="com.yihu.jk.api.getArticleQRCodeApi"></module>
</Mapping>
<Route url="url.JkEdu"></Route>
</Config>

+ 10 - 6
edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/sys.xml

@ -8,13 +8,17 @@
  <!-- 数据库连接配置  -->
  <DB.Alias>jkedudb</DB.Alias>
  <DB.DatabaseName>jkedudb</DB.DatabaseName>
  <DB.IP>172.19.103.85</DB.IP>
  <!--<DB.IP>172.19.103.85</DB.IP>-->
  <!--<DB.Port>3306</DB.Port>-->
  <!--<DB.UserName>linzhou</DB.UserName>-->
  <!--<DB.Password>FDw6DUFgoKg=</DB.Password>-->
  <DB.IP>172.19.103.77</DB.IP>
  <DB.Port>3306</DB.Port>
  <DB.UserName>linzhou</DB.UserName>
  <DB.Password>FDw6DUFgoKg=</DB.Password>
  <EhrApiUrl>http://ehr.yihu.com/wlyyfz</EhrApiUrl>
  <DB.UserName>root</DB.UserName>
  <DB.Password>VYhw4YNnygE=</DB.Password>
  <!--<EhrApiUrl>http://ehr.yihu.com/wlyyfz</EhrApiUrl>-->
  <EhrApiUrl>http://192.168.131.131:8080/</EhrApiUrl>
  <!--ehr的登入地址(重定向到本工程的登入页)-->
  <LoginUrl>http://ehr.yihu.com/wlyyfz/auth/login.html?redirect_url=http://localhost:8080/JkEdu/ssoLogin.html</LoginUrl>
  <LoginUrl>http://172.19.103.87:9088/wlyyfz/auth/login.html?redirect_url=http://192.168.131.131:8088/JkEdu/ssoLogin.html</LoginUrl>
</Config>

+ 7 - 2
edu-article/JkEdu/src/Category.sql.xml

@ -1,12 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<das-client>
	<Sqls> 
		 <Sql name='getCategoryList'>
		 <!--<Sql name='getCategoryList'>
		 <![CDATA[
		select m.*, ISNULL (n.CategoryId)  as isSubscrive from Org_Category m left JOIN
 User_Subscrive n on m.CategoryId=n.CategoryId and  1=1 @UserId where 1=1 and CategoryState!=2 @Condition
			]]>
			</Sql>
			</Sql>-->
		<Sql name='getCategoryList'>
			<![CDATA[
		select m.* from Org_Category m  where 1=1 and CategoryState!=2 @Condition
			]]>
		</Sql>
			
			 <Sql name='addCategory'>
		 <![CDATA[

+ 1 - 1
edu-article/JkEdu/src/com/yihu/jk/action/CategoryAction.java

@ -35,7 +35,7 @@ public class CategoryAction {
		int pageSize = StringUtil.isEmpty(request.getParameter("pageSize")) ? 1000 : Integer.valueOf(request
				.getParameter("pageSize"));
		userId = StringUtil.isEmpty(request.getParameter("userId")) ? userId : request.getParameter("userId");
		JSONObject CategoryList = dao.getCategoryList(userId, category, start, pageSize);
		JSONObject CategoryList = dao.getCategoryList( category, start, pageSize);
		try {
			CategoryList.put("Code", 10000);
			response.getWriter().write(CategoryList.toString());

+ 92 - 7
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -5,6 +5,7 @@ import java.sql.Timestamp;
import java.util.List;
import com.coreframework.remoting.standard.DateOper;
import com.yihu.jk.dao.ArticlePcDao;
import com.yihu.jk.vo.Article;
import com.yihu.jk.vo.OrgArticleVo;
import net.sf.json.JSONArray;
@ -23,6 +24,7 @@ import com.yihu.wsgw.api.InterfaceMessage;
public class ArticleApi {
	private static ArticleDao dao = new ArticleDao();
	private static ArticlePcDao articlePcDao = new ArticlePcDao();
	static Logger log = Logger.getLogger(ArticleApi.class.getName());
	/**
@ -484,9 +486,10 @@ public class ArticleApi {
	 * @return
	 * @throws JSONException
	 */
	public String saveArticle(InterfaceMessage im) throws JSONException {
	public String saveArticle(InterfaceMessage im) throws Exception {
		JSONObject json = JSONObject.fromObject(im.getParam());
		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();
@ -514,9 +517,14 @@ public class ArticleApi {
		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();
		String articleId=StringUtil.createUUID();
		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);
@ -565,7 +573,7 @@ public class ArticleApi {
		Integer	articlelevel = StringUtil.isEmpty(json.get("articlelevel")) ? null : json.getInt("articlelevel");//文章级别
		String  articleTitle = StringUtil.isEmpty(json.get("articleTitle")) ? null : json.getString("articleTitle");//文章标题
		String  userCode = StringUtil.isEmpty(json.get("userCode")) ? null : json.getString("userCode");//操作人id
		boolean  isManage = StringUtil.isEmpty(json.get("isManage")) ? false : json.getBoolean("isManage");//是否为管理员
		Integer  isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否有权限
		String  currentUserRole = StringUtil.isEmpty(json.get("currentUserRole")) ? null : json.getString("currentUserRole");//当前登录的角色
		String  currentUserRoleLevel = StringUtil.isEmpty(json.get("currentUserRoleLevel")) ? null : json.getString("currentUserRoleLevel");//当前登录的角色级别
		Integer	page = 0;
@ -591,9 +599,7 @@ public class ArticleApi {
		vo.setOperatorRoleCode(currentUserRole);
		vo.setArticleTitle(articleTitle);
		vo.setOperatorRoleLevel(currentUserRoleLevel);
		if(!isManage){
			vo.setIsAuthentication(1);
		}
		vo.setIsAuthentication(isAuthentication);
		JSONArray array = new JSONArray();
		try {
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
@ -609,4 +615,83 @@ public class ArticleApi {
		}
		return array.toString();
	}
	/**
	 * 修改文章
	 * @param im
	 * @return
	 * @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;
	}
	/**
	 * 认证管理
	 * @param im
	 * @return
	 * @throws Exception
	 */
	public String authenticationArticle(InterfaceMessage im) throws Exception {
		JSONObject json = JSONObject.fromObject(im.getParam());
		String	articleId = StringUtil.isEmpty(json.get("articleId")) ? null : json.getString("articleId");//文章id
		Integer	isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否认证过
        String	firstLevelCategoryId = StringUtil.isEmpty(json.get("firstLevelCategoryId")) ? null : json.getString("firstLevelCategoryId");//文章一级分类
        String	firstLevelCategoryName = StringUtil.isEmpty(json.get("firstLevelCategoryName")) ? null : json.getString("firstLevelCategoryName");//文章一级分类名称
        String	secondLevelCategoryId = StringUtil.isEmpty(json.get("secondLevelCategoryId")) ? null : json.getString("secondLevelCategoryId");//文章二级分类
        String	secondLevelCategoryName = StringUtil.isEmpty(json.get("secondLevelCategoryName")) ? null : json.getString("secondLevelCategoryName");//文章二级分类名称
		OrgArticleVo orgArticleVo = new OrgArticleVo();
		orgArticleVo.setArticleId(articleId);
		orgArticleVo.setIsAuthentication(isAuthentication);
		if(!StringUtil.isEmpty(firstLevelCategoryId)){
            orgArticleVo.setFirstLevelCategoryId(firstLevelCategoryId);
        }
        if(!StringUtil.isEmpty(firstLevelCategoryName)){
            orgArticleVo.setFirstLevelCategoryName(firstLevelCategoryName);
        }
        if(!StringUtil.isEmpty(secondLevelCategoryId)){
            orgArticleVo.setSecondLevelCategoryId(secondLevelCategoryId);
        }
        if(!StringUtil.isEmpty(secondLevelCategoryName)){
            orgArticleVo.setSecondLevelCategoryName(secondLevelCategoryName);
        }
		net.sf.json.JSONObject jsonObject = articlePcDao.editArticle(orgArticleVo);
		return jsonObject.toString();
	}
}

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

@ -54,8 +54,8 @@ public class ArticleApiTest {
		ArticleApi api = new ArticleApi();
		InterfaceMessage im = new InterfaceMessage();
		JSONObject obj = new JSONObject();
		obj.put("page","1");
		obj.put("pageSize","2");
//		obj.put("page","1");
//		obj.put("pageSize","2");
//		obj.put("firstLevelCategoryId","37");
//		obj.put("secondLevelCategoryId","32");
//		obj.put("insertTimeStart","1");
@ -66,11 +66,13 @@ public class ArticleApiTest {
//		obj.put("isManage",true);
//		obj.put("currentUserRole","350200");
//		obj.put("currentUserRoleLevel","1");
		obj.put("articleid","1");
		obj.put("isAuthentication","0");
		im.setParam(obj.toString());
		initDB();
		try{
			System.out.println(api.queryArticlePcList(im));
			api.authenticationArticle(im);
//			System.out.println(api.queryArticlePcList(im));
		}catch(Exception e){
			e.printStackTrace();
		}

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

@ -1,5 +1,6 @@
package com.yihu.jk.api;
import com.alibaba.fastjson.JSON;
import com.yihu.jk.dao.ArticleQRCodeDao;
import com.yihu.jk.utils.ApiUtil;
import com.yihu.jk.utils.ConfigDictionaryUtil;
@ -39,4 +40,73 @@ public class ArticleQRCodeApi {
			return ApiUtil.getRespJSON(-14444, e.getMessage()).toString();
		}
	}
	public String saveArticleQRCode(InterfaceMessage im){
		try {
			JSONObject json = JSONObject.fromObject(im.getParam());
//			String id = StringUtil.createUUID();; //主键ID
			String imgUrl = StringUtil.isEmpty(json.get("imgUrl")) ? null : json.getString("imgUrl"); //图片云地址
			Integer position = StringUtil.isEmpty(json.get("position")) ? null : json.getInt("position"); //添加位置
			String userId = StringUtil.isEmpty(json.get("userId")) ? null : json.getString("userId"); //创建人ID
			String userName = StringUtil.isEmpty(json.get("userName")) ? null : json.getString("userName"); //创建人名称
			String orgId = StringUtil.isEmpty(json.get("orgId")) ? null : json.getString("orgId"); //创建人所属机构ID
			String orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName"); //创建人所属机构名称
			String operatorRoleCode = StringUtil.isEmpty(json.get("operatorRoleCode")) ? null : json.getString("operatorRoleCode"); //操作人角色code
			String operatorRoleLevel = StringUtil.isEmpty(json.get("operatorRoleLevel")) ? null : json.getString("operatorRoleLevel"); //操作人角色级别
			ArticleQRCode bean = new ArticleQRCode();
			bean.setImgUrl(imgUrl);
			bean.setPosition(Integer.valueOf(position));
			bean.setOperatorId(userId);
			bean.setOperatorName(userName);
			bean.setOrgId(orgId);
			bean.setOrgName(orgName);
			bean.setOperatorRoleCode(operatorRoleCode);
			bean.setOperatorRoleLevel(operatorRoleLevel);
			Integer code = dao.saveArticleQRCode(bean);
			if (code != 1) {
				return ApiUtil.getRespJSON(-1, "数据库操作异常").toString();
			}else{
				return ApiUtil.getRespJSON(10000, "操作成功").toString();
			}
		}catch (Exception e) {
			e.printStackTrace();
			return ApiUtil.getRespJSON(-14444, e.getMessage()).toString();
		}
	}
	public String  updateArticleQRCode(InterfaceMessage im){
		JSONObject json = JSONObject.fromObject(im.getParam());
		Integer id = StringUtil.isEmpty(json.get("id")) ? null : json.getInt("id"); //id
		String imgUrl = StringUtil.isEmpty(json.get("imgUrl")) ? null : json.getString("imgUrl"); //图片云地址
		Integer position = StringUtil.isEmpty(json.get("position")) ? null : json.getInt("position"); //添加位置
		String userId = StringUtil.isEmpty(json.get("userId")) ? null : json.getString("userId"); //创建人ID
		String userName = StringUtil.isEmpty(json.get("userName")) ? null : json.getString("userName"); //创建人名称
		String orgId = StringUtil.isEmpty(json.get("orgId")) ? null : json.getString("orgId"); //创建人所属机构ID
		String orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName"); //创建人所属机构名称
//		String operatorRoleCode = StringUtil.isEmpty(json.get("operatorRoleCode")) ? null : json.getString("operatorRoleCode"); //操作人角色code
//		String operatorRoleLevel = StringUtil.isEmpty(json.get("operatorRoleLevel")) ? null : json.getString("operatorRoleLevel"); //操作人角色级别
		try {
//			String result = getArticleQRCode(im);
//			com.alibaba.fastjson.JSONObject js = JSON.parseObject(result);
//			ArticleQRCode bean = (ArticleQRCode) js.get("Result");
			ArticleQRCode bean = new ArticleQRCode();
			bean.setId(id);
			bean.setImgUrl(imgUrl);
			bean.setPosition(position);
			bean.setOperatorId(userId);
			bean.setOperatorName(userName);
			bean.setOrgId(orgId);
			bean.setOrgName(orgName);
			Integer code = dao.updateArticleQRCode(bean);
			if (code != 1) {
				return ApiUtil.getRespJSON(-1, "数据库操作异常").toString();
			}else{
				return ApiUtil.getRespJSON(10000, "操作成功").toString();
			}
		}catch (Exception e) {
			e.printStackTrace();
			return ApiUtil.getRespJSON(-14444, e.getMessage()).toString();
		}
	}
}

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

@ -25,13 +25,13 @@ public class CategoryApi {
	public String getCategoryList(InterfaceMessage im) {
		JSONObject json = JSONObject.fromObject(im.getParam());
		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");
		Category vo = new Category();
		vo.setCategoryLevel(categoryLevel);
		try {
			com.common.json.JSONObject result = dao.getCategoryList(userId, vo, 0, 1000);
			com.common.json.JSONObject result = dao.getCategoryList( vo, 0, 1000);
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
			rv.put("Result", result.toString());
			return rv.toString();

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

@ -97,4 +97,22 @@ public class ArticleQRCodeDao {
		return articleQRCode;
	}
	/**
	 * 修改二维码管理
	 * @author chenzhibin <br> 2017-9-6 下午15:50:30
	 * @param bean
	 * @throws SQLException
	 */
	public int updateArticleQRCode(ArticleQRCode bean) throws SQLException {
		Timestamp nowTime = DateOper.getNowDateTime();
		bean.setUpdateTime(nowTime.toString());
		Sql sql = DB.me().createUpdateSql(bean, MyTableEnum.Config_ArticleQRCode,
				" id = ? ");
		sql.addParamValue(bean.getId());
//		sql.addParamValue(bean.getOperatorRoleCode());
//		sql.addParamValue(bean.getOperatorRoleLevel());
		int code = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
		return code;
	}
}

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

@ -27,7 +27,7 @@ public class CategoryDao {
	}
	// 查询类别
	public JSONObject getCategoryList(String userId, Category vo, int start, int pageSize) throws SQLException {
	public JSONObject getCategoryList( Category vo, int start, int pageSize) throws SQLException {
		Sql sql = DB.me().createSql(CategorySqlNameEnum.getCategoryList);
		StringBuffer param = new StringBuffer();
		StringBuffer paramUserId = new StringBuffer();
@ -35,10 +35,10 @@ public class CategoryDao {
			param.append(" and CategoryLevel =").append(vo.getCategoryLevel());
		}
		if (StringUtil.isNotEmpty(userId)) {
			paramUserId.append(" and userId ='").append(userId).append("'");
		}
		sql.addVar("@UserId", paramUserId.toString());
//		if (StringUtil.isNotEmpty(userId)) {
//			paramUserId.append(" and userId ='").append(userId).append("'");
//		}
//		sql.addVar("@UserId", paramUserId.toString());
		sql.addVar("@Condition", param.toString());
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorDao.java

@ -7,6 +7,7 @@ package com.yihu.wlyy.repository.doctor;
import java.util.List;
import com.yihu.edu.entity.RoleWithAuthorityCheck;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
@ -161,4 +162,8 @@ public interface DoctorDao extends PagingAndSortingRepository<Doctor, Long>, Jpa
    @Query("select count(1) from Doctor where code=?1 and idcard=?2 ")
    Integer checkCertificate(String doctorCode,String certificateNum);
//    @Query("select a from RoleWithAuthorityCheck a , WlyyUserRole b where a.userRoleId = b.id and  b.user=?1 and b.role=?2 ")
    @Query(value = "select a.* from wlyy_edu_role_authority a,wlyy_user_role b where a.user_role_id=b.id and b.user=?1 and b.role=?2 " ,nativeQuery = true)
    List<RoleWithAuthorityCheck> findEduAuthority(String userCode,String operatorRoleCode);
}

+ 143 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.service.jimeiJkEdu;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.edu.entity.RoleWithAuthorityCheck;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.es.entity.RoleVo;
import com.yihu.wlyy.config.es.ElastricSearchSave;
@ -13,6 +14,7 @@ import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.common.account.RoleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.web.third.gateway.service.GcLabelService;
@ -20,6 +22,7 @@ import com.yihu.wlyy.web.third.gateway.vo.DictModel;
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.annotation.Transient;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -54,6 +57,8 @@ public class JMJkEduArticleService extends BaseService {
    private GcLabelService labelService;
    @Autowired
    private AdminTeamService teamService;
    @Autowired
    private CommonUtil commonUtil;
    /**
     *
@ -705,4 +710,142 @@ public class JMJkEduArticleService extends BaseService {
        patientSet.addAll(resultList);
    }
    public JSONArray pushArticleLogs(int page, int pagesize, String patientCode) throws Exception {
        pagesize = page * pagesize;
        page = (page - 1) * pagesize;
//
//        StringBuffer sql2 = new StringBuffer("select *  from   " + esType +
//                " where  sendCode='" + sendCode + "' ");
//        sql2.append("  order by createTime limit " + page + "," + pagesize);
        String sql = "SELECT * FROM " + esType + "  where nested(patients.code)= '" + patientCode + "' order by createTime desc limit " + page + "," + pagesize;
        List<com.yihu.es.entity.HealthEduArticlePatient> esList = elasticsearchUtil.excute(sql, com.yihu.es.entity.HealthEduArticlePatient.class, esIndex, esType);
        HealthEduArticlePatientModel heapm = null;
        com.alibaba.fastjson.JSONObject article = null;
        List<HealthEduArticlePatientModel> result = new ArrayList<>();
        Doctor doctor = null;
        for (HealthEduArticlePatient one : esList) {
            article = thirdJkEduArticleService.getArticalById(one.getArticleId());
            heapm = new HealthEduArticlePatientModel();
            heapm.setSendName(one.getSendName());
            heapm.setSendCode(one.getDoctorCode());
            heapm.setCreateTime(one.getCreateTime());
            heapm.setArticleId(article.getString("articleId"));
            heapm.setAttachedTitle(article.getString("articleTitle"));
            heapm.setAttachedContent(article.getString("articleContent"));
            heapm.setArticleType(article.getString("articleType"));
            heapm.setLevel1Type(article.getString("firstLevelCategoryId"));
            heapm.setLevel2Type(article.getString("secondLevelCategoryId"));
            heapm.setLevel(article.getString("articlelevel"));
            heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
            heapm.setBrowseNumbere(Integer.valueOf(article.getString("browseNumber")));//文章浏览数
            heapm.setCommentNumber(Integer.valueOf(article.getString("commentNumber")));//文章评论数
            heapm.setPointNumber(Integer.valueOf(article.getString("pointNumber")));//文章点赞数
            heapm.setArticleCover(article.getString("articleCover"));//封面
            heapm.setComputeTime(computeTime(article.getString("insertTime")));
            heapm.setOperatorName(article.getString("operatorName"));
            doctor = doctorDao.findByCode(one.getDoctorCode());
            heapm.setPhoto(doctor.getPhoto());
            result.add(heapm);
            // heapm.setTime();//时间  xx小时前  2017-10-11
        }
        JSONArray re = new JSONArray();
        re.addAll(result);
        return re;
    }
    /**************************************************** PC **********************************************************/
    /**
     * 新增文章 备注:把封面图片上传到fastDFS
     * @param userCode
     * @param articleTitle
     * @param articleType
     * @param articlelevel
     * @param secondLevelCategoryId
     * @param image
     * @param secondLevelCategoryName
     * @param firstLevelCategoryId
     * @param firstLevelCategoryName
     * @param content
     * @throws Exception
     */
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String image,
                            String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,String operatorRoleCode,
                            String opertorRoleLevel,Integer userScope) throws Exception {
        image = commonUtil.copyTempImage(image);
        Integer isAuthentication = 0;
        //当管理员具有审核权限时,添加文章不需认证,添加后自动认证,
        Doctor doctor = doctorDao.findByCode(userCode);
        if(doctor.getLevel()==10){
            List<RoleWithAuthorityCheck> list = doctorDao.findEduAuthority(userCode,operatorRoleCode);
            if(list.size()>0){
                isAuthentication = 1;
            }
        }
        thirdJkEduArticleService.saveArticle(userCode,articleTitle,articleType,articlelevel,secondLevelCategoryId,image,
                secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,operatorRoleCode,opertorRoleLevel,
                userScope,isAuthentication);
    }
    /**
     * 获取PC端文章列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articlelevel
     * @param articleTitle
     * @param userCode
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @throws Exception
     */
    public JSONArray queryArticlePcList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,String articleTitle,
                                   String userCode,String currentUserRole,String currentUserRoleLevel,String isAuthentication,boolean isMyArticle) throws Exception{
//        Doctor doctor = doctorDao.findByCode(userCode);
//        boolean isManage = false;
//        if(doctor.getLevel()==10){
//            isManage = true;
//        }
        if(!isMyArticle){
            userCode = null;
        }
        return thirdJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,
                articleTitle,userCode,isAuthentication,currentUserRole,currentUserRoleLevel);
    }
    /**
     * 保存或更新 认证标识
     * @param currentRoleLevel
     * @param currentRoleCode
     * @param position
     * @param imgUrl
     * @param userCode
     * @param id
     * @throws Exception
     */
    public void saveOrUpdateArticleQR(String currentRoleLevel,String currentRoleCode,Integer position,String imgUrl,String userCode,Integer id) throws Exception{
//        thirdJkEduArticleService.getArticleQRCode(currentRoleLevel,currentRoleCode);
        imgUrl = commonUtil.copyTempImage(imgUrl);
        Doctor doctor = doctorDao.findByCode(userCode);
        String userName = doctor.getName();
        String orgId = doctor.getHospital();
        String orgName = doctor.getHospitalName();
        if(id!=null){
            thirdJkEduArticleService.updateArticleQRCode(currentRoleLevel,currentRoleCode,imgUrl,position,userCode,userName,orgId,orgName,id);
        }else {
            thirdJkEduArticleService.saveArticleQRCode(currentRoleLevel,currentRoleCode,imgUrl,position,userCode,userName,orgId,orgName);
        }
    }
    @Transient
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName) throws Exception{
        String[] str = articleId.split(",");
        for(String one: str){
            thirdJkEduArticleService.authenticationArticle(one,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
        }
    }
}

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

@ -11,6 +11,7 @@ import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.web.third.gateway.service.GcLabelService;
import com.yihu.wlyy.web.third.gateway.vo.DictModel;
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
import org.slf4j.Logger;
@ -52,6 +53,8 @@ public class ThirdJkEduArticleService extends BaseService {
    private PatientService patientService;
    @Value("${jkEdu.web.articleBaseUrl}")
    private String articleBaseUrl;
    @Autowired
    private GcLabelService labelService;
    //    private String baseUrl = "http://service.yihu.com:8085/WsPlatform/rest";
//    private String baseUrl = "http://172.17.110.230:83/WsPlatform/rest";
@ -61,15 +64,28 @@ public class ThirdJkEduArticleService extends BaseService {
    private String clientId;
    private String clientVersion = "1.0";
    private String getArticalById = "JkEdu.Article.getArticalById";//获取单篇文章详情
    private String getDoctorArticalList = "JkEdu.Article.getDoctorArticalList";//获取卫计委认证文章+医生发表未认证文章
    /*********************************************** Collection ***************************************/
    private String getCollectionArticalList = "JkEdu.Article.getCollectionArticalList";//获取收藏文章列表
    private String getCategoryList = "JkEdu.Category.getCategoryList";//获取类别接口
    private String cancelArticleCollection = "JkEdu.Behavior.cancelArticleCollection";//取消收藏接口
    private String saveArticleCollection = "JkEdu.Behavior.saveArticleCollection";//医生收藏接口
    /*********************************************** Article ******************************************/
    private String getDoctorArticalByUserId = "JkEdu.Article.getDoctorArticalByUserId";//医生发表文章接口
    private String getArticalList = "JkEdu.Article.getArticalList";//获取文章列表 多ID
    private String getArticalById = "JkEdu.Article.getArticalById";//获取单篇文章详情
    private String getDoctorArticalList = "JkEdu.Article.getDoctorArticalList";//获取卫计委认证文章+医生发表未认证文章
    private String saveArticle = "JkEdu.Article.saveArticle";//添加文章
    private String queryArticlePcList = "JkEdu.Article.queryArticlePcList";//PC端获取文章列表
    private String authenticationArticle = "JkEdu.Article.authenticationArticle";//文章认证
    /*********************************************** Category ******************************************/
    private String getCategoryList = "JkEdu.Category.getCategoryList";//获取类别接口
    private String addCategory = "JkEdu.Category.addCategory";//新增类别接口
    private String updateCategory = "JkEdu.Category.updateCategory";//更新类别接口
    /*********************************************** ConfigDicSho ***************************************/
    private String getConfigDicShoList = "JkEdu.ConfigDicSho.getConfigDicShoList";//更新类别接口
    /*********************************************** ArticleQR ***************************************/
    private String getArticleQRCode = "JkEdu.ArticleQR.getArticleQRCode";//获取认证标识
    private String updateArticleQRCode = "JkEdu.ArticleQR.updateArticleQRCode";//更新认证标识
    private String saveArticleQRCode = "JkEdu.ArticleQR.saveArticleQRCode";//添加认证标识
    /**
     * 封装入参
@ -97,8 +113,10 @@ public class ThirdJkEduArticleService extends BaseService {
        return params;
    }
    /*************************************************** Collection ***************************************************/
    /**
     * 获取文章列表
     * 获取收藏文章列表
     *
     * @param articleTitle         否 文章标题
     * @param articleState         否 传1
@ -106,9 +124,11 @@ public class ThirdJkEduArticleService extends BaseService {
     * @param pageIndex            否    起始页数 0开始,默认0
     * @param pageSize             否    每页显示数 ,默认5
     * @param userId               是    当前用户ID
     * @param userType             是    1 医生 2 居民
     * @return
     */
    public JSONArray getDoctorArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize, String userId) throws Exception {
    public JSONArray getCollectionArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId,
                                              Integer pageIndex, Integer pageSize, String userId, Integer userType,Boolean myArticle) throws Exception {
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try {
@ -119,7 +139,9 @@ public class ThirdJkEduArticleService extends BaseService {
            param.put("pageIndex", pageIndex);
            param.put("pageSize", pageSize);
            param.put("userId", userId);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getDoctorArticalList, param.toString(), "1"));
            param.put("userType", userType);
            param.put("myArticle", myArticle);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getCollectionArticalList, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
@ -133,38 +155,84 @@ public class ThirdJkEduArticleService extends BaseService {
        }
    }
    /**
     * 获取文章详情
     * 取消收藏文章
     *
     * @param articleId 文章id
     * @param articleId 是 文章id
     * @param userId    是    当前用户ID
     * @param userType  是    1 医生 2 居民
     * @return
     */
    public JSONObject getArticalById(String articleId) throws Exception {
        JSONObject re = new JSONObject();
    public void cancelArticleCollection(String articleId, String userId, Integer userType) throws Exception {
        String response = "";
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getArticalById, param.toString(), "1"));
            param.put("userId", userId);
            param.put("userType", userType);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(cancelArticleCollection, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
            return re;
        }
        if ("10000".equals(json.getString("Code"))) {
        } else {
            new Exception(json.getString("Message"));
        }
    }
    /**
     * 收藏文章列表
     *
     * @param articleId           文章id
     * @param articleCategoryId   文章类别ID
     * @param articleCategoryName 文章类别名称
     * @param userId              是    当前用户ID
     * @param userType            是    1 医生 2 居民
     * @return
     */
    public void saveArticleCollection(String articleId, String articleCategoryId, String articleCategoryName, String userId, Integer userType) throws Exception {
        String response = "";
        JSONObject json = null;
        try {
            Doctor doctor = doctorDao.findByCode(userId);
            String orgName = doctor.getHospitalName();//用户所属机构
            String orgId = doctor.getHospital();//用户所属机构ID
            String cName = doctor.getName();//用户名
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            param.put("cName", cName);
            param.put("articleCategoryId", articleCategoryId);
            param.put("articleCategoryName", articleCategoryName);
            param.put("orgName", orgName);
            param.put("orgId", orgId);
            param.put("userId", userId);
            param.put("userType", userType);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(saveArticleCollection, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if ("10000".equals(json.getString("Code"))) {
            JSONArray result = json.getJSONArray("Result");
            if (result.size() > 0) {
                return result.getJSONObject(0);
            }
            return re;
        } else {
            throw new Exception(json.getString("Message"));
            new Exception(json.getString("Message"));
        }
    }
    /*************************************************** Article ******************************************************/
    /**
     * 获取收藏文章列表
     * 获取医生文章列表
     *
     * @param articleTitle         否 文章标题
     * @param articleState         否 传1
@ -172,11 +240,9 @@ public class ThirdJkEduArticleService extends BaseService {
     * @param pageIndex            否    起始页数 0开始,默认0
     * @param pageSize             否    每页显示数 ,默认5
     * @param userId               是    当前用户ID
     * @param userType             是    1 医生 2 居民
     * @return
     */
    public JSONArray getCollectionArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId,
                                              Integer pageIndex, Integer pageSize, String userId, Integer userType,Boolean myArticle) throws Exception {
    public JSONArray getDoctorArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize, String userId) throws Exception {
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try {
@ -187,9 +253,7 @@ public class ThirdJkEduArticleService extends BaseService {
            param.put("pageIndex", pageIndex);
            param.put("pageSize", pageSize);
            param.put("userId", userId);
            param.put("userType", userType);
            param.put("myArticle", myArticle);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getCollectionArticalList, param.toString(), "1"));
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getDoctorArticalList, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
@ -203,21 +267,54 @@ public class ThirdJkEduArticleService extends BaseService {
        }
    }
    public JSONArray getArticalList(String articleId, int articleState, int pageIndex, int pageSize,String firstLevelCategoryId) throws Exception {
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            param.put("articleState", articleState);
            param.put("pageIndex", pageIndex);
            param.put("pageSize", pageSize);
            param.put("firstLevelCategoryId", firstLevelCategoryId);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getArticalList, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
            return re;
        }
        if ("10000".equals(json.getString("Code"))) {
            return json.getJSONArray("Result");
        } else {
            throw new Exception(json.getString("Message"));
        }
    }
    /**
     * 获取文章类别
     * 获取医生发表的文章列表
     *
     * @param categoryLevel 是    获取类别:1、一级类别 2、二级类别
     * @param articleTitle         否 文章标题
     * @param articleState         否 传1
     * @param firstLevelCategoryId 否    一级类别ID ,多个逗号隔开
     * @param pageIndex            否    起始页数 0开始,默认0
     * @param pageSize             否    每页显示数 ,默认5
     * @param userId               是    当前用户ID
     * @return
     */
    public JSONArray getCategoryList(String categoryLevel,String userId) throws Exception {
    public JSONArray getDoctorArticalByUserId(String articleTitle, Integer articleState, String firstLevelCategoryId,
                                              Integer pageIndex, Integer pageSize, String userId) throws Exception {
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("categoryLevel", categoryLevel);
            param.put("articleTitle", articleTitle);
            param.put("articleState", articleState);
            param.put("firstLevelCategoryId", firstLevelCategoryId);
            param.put("pageIndex", pageIndex);
            param.put("pageSize", pageSize);
            param.put("userId", userId);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getCategoryList, param.toString(), "1"));
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getDoctorArticalByUserId, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
@ -225,108 +322,195 @@ public class ThirdJkEduArticleService extends BaseService {
        }
        if ("10000".equals(json.getString("Code"))) {
            return json.getJSONObject("Result").getJSONArray("result");
            return json.getJSONArray("Result");
        } else {
            throw new Exception(json.getString("Message"));
        }
    }
    /**
     * 取消收藏文章
     * 获取文章详情
     *
     * @param articleId 是 文章id
     * @param userId    是    当前用户ID
     * @param userType  是    1 医生 2 居民
     * @param articleId 文章id
     * @return
     */
    public void cancelArticleCollection(String articleId, String userId, Integer userType) throws Exception {
        String response = "";
    public JSONObject getArticalById(String articleId) throws Exception {
        JSONObject re = new JSONObject();
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            param.put("userId", userId);
            param.put("userType", userType);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(cancelArticleCollection, param.toString(), "1"));
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getArticalById, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
            return re;
        }
        if ("10000".equals(json.getString("Code"))) {
        if ("10000".equals(json.getString("Code"))) {
            JSONArray result = json.getJSONArray("Result");
            if (result.size() > 0) {
                return result.getJSONObject(0);
            }
            return re;
        } else {
            new Exception(json.getString("Message"));
            throw new Exception(json.getString("Message"));
        }
    }
    /**
     * 收藏文章列表
     *
     * @param articleId           文章id
     * @param articleCategoryId   文章类别ID
     * @param articleCategoryName 文章类别名称
     * @param userId              是    当前用户ID
     * @param userType            是    1 医生 2 居民
     * 添加文章
     * @param userCode 医生code
     * @param articleTitle 标题
     * @param articleType 类型
     * @param articlelevel 优先级
     * @param secondLevelCategoryId 二级分类id
     * @param newUrl 封面图片地址
     * @param secondLevelCategoryName 二级分类名称
     * @param firstLevelCategoryId 一级分类id
     * @param firstLevelCategoryName 一级分类名称
     * @param content 内容
     * @return
     * @throws Exception
     */
    public void saveArticleCollection(String articleId, String articleCategoryId, String articleCategoryName, String userId, Integer userType) {
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String newUrl,
                                 String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,
                                 String operatorRoleCode,String opertorRoleLevel,Integer userScope,Integer isAuthentication) throws Exception {
        String response = "";
        JSONObject json = null;
        try {
            Doctor doctor = doctorDao.findByCode(userId);
            String orgName = doctor.getHospitalName();//用户所属机构
            String orgId = doctor.getHospital();//用户所属机构ID
            String cName = doctor.getName();//用户名
            Doctor doctor = doctorDao.findByCode(userCode);
            String	orgName = doctor.getHospitalName();//组织名称
            String	deptName = doctor.getDeptName();//科室名称
            String	levelName = doctor.getJobName();//职称
            String	photo = doctor.getPhoto();//头像
            String	orgId = doctor.getHospital();//组织
            String	userName = doctor.getName();//登录名称
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            param.put("cName", cName);
            param.put("articleCategoryId", articleCategoryId);
            param.put("articleCategoryName", articleCategoryName);
            param.put("userCode", userCode);
            param.put("orgName", orgName);
            param.put("deptName", deptName);
            param.put("levelName", levelName);
            param.put("photo", photo);
            param.put("orgId", orgId);
            param.put("userId", userId);
            param.put("userType", userType);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(saveArticleCollection, param.toString(), "1"));
            param.put("userName", userName);
            param.put("articleTitle", articleTitle);
            param.put("articleType", articleType);
            param.put("articlelevel", articlelevel);
            param.put("secondLevelCategoryId", secondLevelCategoryId);
            param.put("secondLevelCategoryName", secondLevelCategoryName);
            param.put("firstLevelCategoryId", firstLevelCategoryId);
            param.put("firstLevelCategoryName", firstLevelCategoryName);
            param.put("content", content);
            param.put("newUrl", newUrl);
            param.put("operatorRoleCode", operatorRoleCode);
            param.put("opertorRoleLevel", opertorRoleLevel);
            param.put("userScope", userScope);
            param.put("isAuthentication", isAuthentication);
            if(isAuthentication==1){
                param.put("authentication", doctor.getHospital());
                param.put("authenticationId", doctor.getHospitalName());
            }
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(saveArticle, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if ("10000".equals(json.getString("Code"))) {
        } else {
            new Exception(json.getString("Message"));
            throw new Exception(json.getString("Message"));
        }
    }
    /**
     * 获取医生发表的文章列表
     *
     * @param articleTitle         否 文章标题
     * @param articleState         否 传1
     * @param firstLevelCategoryId 否    一级类别ID ,多个逗号隔开
     * @param pageIndex            否    起始页数 0开始,默认0
     * @param pageSize             否    每页显示数 ,默认5
     * @param userId               是    当前用户ID
     * PC端文章列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articlelevel
     * @param articleTitle
     * @param userCode
     * @param isAuthentication
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @return
     * @throws Exception
     */
    public JSONArray getDoctorArticalByUserId(String articleTitle, Integer articleState, String firstLevelCategoryId,
                                              Integer pageIndex, Integer pageSize, String userId) throws Exception {
        JSONArray re = new JSONArray();
    public JSONArray queryArticlePcList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,
                                        String articleTitle,String userCode,String isAuthentication,String currentUserRole,String currentUserRoleLevel) 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("articlelevel", articlelevel);
            param.put("articleTitle", articleTitle);
            param.put("articleState", articleState);
            param.put("userCode", userCode);
            param.put("isAuthentication", isAuthentication);
            param.put("currentUserRole", currentUserRole);
            param.put("currentUserRoleLevel", currentUserRoleLevel);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(queryArticlePcList, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if ("10000".equals(json.getString("Code"))) {
            return json.getJSONArray("Result");
        } else {
            throw new Exception(json.getString("Message"));
        }
    }
    /**
     *
     * @return
     */
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName) throws Exception{
        String response = "";
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            param.put("isAuthentication", isAuthentication);
            param.put("firstLevelCategoryId", firstLevelCategoryId);
            param.put("pageIndex", pageIndex);
            param.put("pageSize", pageSize);
            param.put("userId", userId);
            param.put("firstLevelCategoryName", firstLevelCategoryName);
            param.put("secondLevelCategoryId", secondLevelCategoryId);
            param.put("secondLevelCategoryName", secondLevelCategoryName);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(authenticationArticle, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (!"10000".equals(json.getString("Code"))) {
            throw new Exception(json.getString("Message"));
        }
    }
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getDoctorArticalByUserId, param.toString(), "1"));
    /*************************************************** Category *****************************************************/
    /**
     * 获取文章类别
     *
     * @param categoryLevel 是    获取类别:1、一级类别 2、二级类别
     * @return
     */
    public JSONArray getCategoryList(String categoryLevel) throws Exception {
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("categoryLevel", categoryLevel);
//            param.put("userId", userId);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getCategoryList, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
@ -334,26 +518,97 @@ public class ThirdJkEduArticleService extends BaseService {
        }
        if ("10000".equals(json.getString("Code"))) {
            return json.getJSONArray("Result");
            return json.getJSONObject("Result").getJSONArray("result");
        } else {
            throw new Exception(json.getString("Message"));
        }
    }
    public JSONArray getArticalList(String articleId, int articleState, int pageIndex, int pageSize,String firstLevelCategoryId) throws Exception {
        JSONArray re = new JSONArray();
    /**
     * 添加分类
     * @param categoryLevel
     * @return
     * @throws Exception
     */
    public void addCategory(String categoryName,Integer categoryLevel,String firstlevelId,String secondLevelId,String userCode,String currentRoleCode) throws Exception {
        JSONObject json = null;
        Doctor doctor = doctorDao.findByCode(userCode);
        boolean bl = checkEduArticleAhthority(doctor,currentRoleCode);
        if(!bl){
            new Exception("二级分类仅向市级管理员开放编辑权限!");
        }
        try {
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            param.put("articleState", articleState);
            param.put("pageIndex", pageIndex);
            param.put("pageSize", pageSize);
            param.put("firstLevelCategoryId", firstLevelCategoryId);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getArticalList, param.toString(), "1"));
            param.put("categoryId", UUID.randomUUID().toString());
            param.put("categoryName", categoryName);
            param.put("categoryLevel", categoryLevel);
            param.put("firstlevelId", firstlevelId);
            param.put("secondLevelId", secondLevelId);
            param.put("orgName", doctor.getHospital());
            param.put("orgId", doctor.getHospitalName());
            param.put("operatorName", doctor.getName());
            param.put("operatorId", userCode);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(addCategory, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (!"10000".equals(json.getString("Code"))) {
            new Exception(json.getString("Message"));
        }
    }
    /**
     * 更新文章分类
     * @param categoryId
     * @param categoryName
     * @param categoryState
     * @param userCode
     * @param currentRoleCode
     * @throws Exception
     */
    public void updateCategory(String categoryId,String categoryName,Integer categoryState,String userCode,String currentRoleCode) throws Exception {
        JSONObject json = null;
        Doctor doctor = doctorDao.findByCode(userCode);
        boolean bl = checkEduArticleAhthority(doctor,currentRoleCode);
        if(!bl){
            new Exception("二级分类仅向市级管理员开放编辑权限!");
        }
        try {
            JSONObject param = new JSONObject();
            param.put("categoryId",categoryId);
            param.put("categoryName", categoryName);
            param.put("categoryState", categoryState);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(updateCategory, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (!"10000".equals(json.getString("Code"))) {
            new Exception(json.getString("Message"));
        }
    }
    /**************************************************** ConfigDicSho ************************************************/
    /**
     * 获取优先级
     * @param typeName
     * @return
     * @throws Exception
     */
    public JSONArray getConfigDicShoList(String typeName) throws Exception {
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("typeName",typeName);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getConfigDicShoList, param.toString(), "1"));
            json = JSON.parseObject(response);
        }catch (Exception e) {
            e.printStackTrace();
            return re;
        }
        if ("10000".equals(json.getString("Code"))) {
@ -363,91 +618,113 @@ public class ThirdJkEduArticleService extends BaseService {
        }
    }
//    public JSONArray getPatientHealthLogs(int page, int pagesize,String sendCode, String articleType)throws Exception{
//
//        pagesize = page * pagesize;
//        page = (page - 1) * pagesize;
//        StringBuffer sql = new StringBuffer("select *,count(articleId) allCount from   " + esType +
//                " where  sendCode='" + sendCode + "' ");
//        if (!StringUtils.isEmpty(articleType)) {
//            sql.append(" and  articleType='" + articleType + "'  ");
//        }
//        sql.append(" group by articleId order by createTime limit " + page + "," + pagesize);
//        List<HealthEduArticlePatient> esList = elasticsearchUtil.excute(sql.toString(), com.yihu.es.entity.HealthEduArticlePatient.class, esIndex, esType);
//        for(HealthEduArticlePatient one :esList){
//            JSONObject jsonObject = getArticalById(one.getArticleId());
//
//        }
//        return null;
//    }
    public JSONArray pushArticleLogs(int page, int pagesize, String patientCode) throws Exception {
        pagesize = page * pagesize;
        page = (page - 1) * pagesize;
//
//        StringBuffer sql2 = new StringBuffer("select *  from   " + esType +
//                " where  sendCode='" + sendCode + "' ");
//        sql2.append("  order by createTime limit " + page + "," + pagesize);
        String sql = "SELECT * FROM " + esType + "  where nested(patients.code)= '" + patientCode + "' order by createTime desc limit " + page + "," + pagesize;
        List<com.yihu.es.entity.HealthEduArticlePatient> esList = elasticsearchUtil.excute(sql, com.yihu.es.entity.HealthEduArticlePatient.class, esIndex, esType);
        HealthEduArticlePatientModel heapm = null;
        com.alibaba.fastjson.JSONObject article = null;
        List<HealthEduArticlePatientModel> result = new ArrayList<>();
        Doctor doctor = null;
        for (HealthEduArticlePatient one : esList) {
            article = healthEducationArticleService.getArticalById(one.getArticleId());
            heapm = new HealthEduArticlePatientModel();
            heapm.setSendName(one.getSendName());
            heapm.setSendCode(one.getDoctorCode());
            heapm.setCreateTime(one.getCreateTime());
            heapm.setArticleId(article.getString("articleId"));
            heapm.setAttachedTitle(article.getString("articleTitle"));
            heapm.setAttachedContent(article.getString("articleContent"));
            heapm.setArticleType(article.getString("articleType"));
            heapm.setLevel1Type(article.getString("firstLevelCategoryId"));
            heapm.setLevel2Type(article.getString("secondLevelCategoryId"));
            heapm.setLevel(article.getString("articlelevel"));
            heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
            heapm.setBrowseNumbere(Integer.valueOf(article.getString("browseNumber")));//文章浏览数
            heapm.setCommentNumber(Integer.valueOf(article.getString("commentNumber")));//文章评论数
            heapm.setPointNumber(Integer.valueOf(article.getString("pointNumber")));//文章点赞数
            heapm.setArticleCover(article.getString("articleCover"));//封面
            heapm.setComputeTime(computeTime(article.getString("insertTime")));
            heapm.setOperatorName(article.getString("operatorName"));
            doctor = doctorDao.findByCode(one.getDoctorCode());
            heapm.setPhoto(doctor.getPhoto());
            result.add(heapm);
            // heapm.setTime();//时间  xx小时前  2017-10-11
    /**************************************************** ArticleQR ********************************************************/
    /**
     * 获取认证标识
     * @param currentRoleLevel
     * @param currentRoleCode
     * @return
     * @throws Exception
     */
    public JSONObject getArticleQRCode(String currentRoleLevel,String currentRoleCode) throws Exception {
        JSONObject re = new JSONObject();
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("currentRoleLevel",currentRoleLevel);
            param.put("currentRoleCode",currentRoleCode);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getArticleQRCode, param.toString(), "1"));
            json = JSON.parseObject(response);
        }catch (Exception e) {
            e.printStackTrace();
            return re;
        }
        if ("10000".equals(json.getString("Code"))) {
            return json;
        }else {
            throw new Exception(json.getString("Message"));
        }
        JSONArray re = new JSONArray();
        re.addAll(result);
        return re;
    }
    /**
     * 更新认证标识
     * @param currentRoleLevel
     * @param currentRoleCode
     * @return
     * @throws Exception
     */
    public void updateArticleQRCode(String currentRoleLevel,String currentRoleCode,String imgUrl,Integer position,String userId,String userName,
                                          String orgId,String orgName,Integer id) throws Exception {
    public String computeTime(String create) {
        Date createDate = DateUtil.strToDate(create, "yyyy-MM-dd HH:mm:ss.SSS");
        Date nowDate = new Date();
        //计算2个时间差
        Long l = nowDate.getTime() - createDate.getTime();
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("id",id);
            param.put("currentRoleLevel",currentRoleLevel);
            param.put("currentRoleCode",currentRoleCode);
            param.put("imgUrl",imgUrl);
            param.put("position",position);
            param.put("userId",userId);
            param.put("userName",userName);
            param.put("orgId",orgId);
            param.put("orgName",orgName);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(updateArticleQRCode, param.toString(), "1"));
            json = JSON.parseObject(response);
        }catch (Exception e) {
            e.printStackTrace();
        }
        if (!"10000".equals(json.getString("Code"))) {
        long hour = l / (60 * 60 * 1000); //小时
        long min = l / (60 * 1000);//分钟
        long s = l / 1000;//秒
        if (s < 60) {
            return s + "秒前";
            throw new Exception(json.getString("Message"));
        }
        if (min < 60) {
            return min + "分钟前";
    }
    public void saveArticleQRCode(String currentRoleLevel,String currentRoleCode,String imgUrl,Integer position,String userId,String userName,
                                          String orgId,String orgName) throws Exception {
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("imgUrl",imgUrl);
            param.put("position",position);
            param.put("userId",userId);
            param.put("userName",userName);
            param.put("orgId",orgId);
            param.put("orgName",orgName);
            param.put("operatorRoleCode",currentRoleCode);
            param.put("currentRoleLevel",currentRoleLevel);//saveArticleQRCode
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(saveArticleQRCode, param.toString(), "1"));
            json = JSON.parseObject(response);
        }catch (Exception e) {
            e.printStackTrace();
        }
        if (hour < 24) {
            return hour + "小时前";
        if (!"10000".equals(json.getString("Code"))) {
            throw new Exception(json.getString("Message"));
        }
        return DateUtil.dateToStr(createDate, "yyyy-MM-dd");
    }
    /**************************************************** other *******************************************************/
    /**
     * 校验是否有编辑权限
     */
    public boolean checkEduArticleAhthority(Doctor doctor,String currentRoleCode){
//        Doctor doctor = doctorDao.findByCode(userCode);
        //1专科医生,2全科医生,3健康管理师, 10管理员
        if(doctor.getLevel()==10){
//            Map<String,Object> resultMap = labelService.fetchUserHighestAuthority(userCode);
//            Integer level = (Integer)resultMap.get("level");
//            List<String> roleList = (List<String>)resultMap.get("roleList");
            Integer level = labelService.roleConverse(currentRoleCode);
            //判断是否是市级
            if(level==1){
                return true;
            }
        }
        return false;
    }
}

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

@ -1,10 +1,15 @@
package com.yihu.wlyy.web.doctor.jimeiJkEduPC;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
 * Created by Trick on 2017/11/14.
@ -14,6 +19,133 @@ import org.springframework.web.bind.annotation.RestController;
@Api(description = "医生、卫计委")
public class DoctorJMJkEduArticlePCController extends BaseController {
    @Autowired
    private JMJkEduArticleService jmJkEduArticleService;
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加文章")
    public  String saveArticle(@ApiParam(name = "articleTitle", value = "文章标题")
                               @RequestParam(value = "articleTitle", required = true) String articleTitle,
                               @ApiParam(name = "articleType", value = "文章类型")
                               @RequestParam(value = "articleType", required = true) String articleType,
                               @ApiParam(name = "articlelevel", value = "文章级别")
                               @RequestParam(value = "articlelevel", required = true) Integer articlelevel,
                               @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类id")
                               @RequestParam(value = "secondLevelCategoryId", required = true) String secondLevelCategoryId,
                               @ApiParam(name = "secondLevelCategoryName", value = "文章二级分类名称")
                               @RequestParam(value = "secondLevelCategoryName", required = true) String secondLevelCategoryName,
                               @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类id")
                               @RequestParam(value = "firstLevelCategoryId", required = true) String firstLevelCategoryId,
                               @ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
                               @RequestParam(value = "firstLevelCategoryName", required = true) String firstLevelCategoryName,
                               @ApiParam(name = "content", value = "文章内容")
                               @RequestParam(value = "content", required = true) String content,
                               @ApiParam(name = "imageUrl", value = "文章封面图片地址")
                               @RequestParam(value = "imageUrl", required = true) String imageUrl,
                               @ApiParam(name = "operatorRoleCode", value = "操作人角色code")
                               @RequestParam(value = "operatorRoleCode", required = true) String operatorRoleCode,
                               @ApiParam(name = "opertorRoleLevel", value = "操作人角色级别")
                               @RequestParam(value = "opertorRoleLevel", required = true) String opertorRoleLevel,
                               @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用)")
                               @RequestParam(value = "userScope", required = true) Integer userScope){
        try {
            jmJkEduArticleService.saveArticle(getUID(),articleTitle,articleType,articlelevel,secondLevelCategoryId,imageUrl,
                    secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,operatorRoleCode,opertorRoleLevel,userScope);
            return success("添加成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"添加失败!");
        }
    }
    /**
     * 查询pc端文章列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articlelevel
     * @param articleTitle
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @return
     */
    @RequestMapping(value = "queryArticlePcList", method = RequestMethod.GET)
    @ApiOperation("查询pc端文章列表")
    public  String queryArticlePcList(@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 = "articlelevel", value = "文章级别")
                                      @RequestParam(value = "articlelevel", required = false) String articlelevel,
                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
                                      @RequestParam(value = "currentUserRoleLevel", required = true )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否有权限")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
                                      @RequestParam(value = "isMyArticle", required = false) Boolean isMyArticle){
        try {
            JSONArray response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle);
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "saveOrUpdateArticleQR", method = RequestMethod.POST)
    @ApiOperation("保存或更新认证标识")
    public  String saveOrUpdateArticleQR(@ApiParam(name = "currentRoleLevel", value = "当前登录角色的级别")
                                         @RequestParam(value = "currentRoleLevel", required = true) String currentRoleLevel,
                                         @ApiParam(name = "currentRoleCode", value = "当前登录角色的code")
                                         @RequestParam(value = "currentRoleCode", required = true) String currentRoleCode,
                                         @ApiParam(name = "position", value = "位置")
                                         @RequestParam(value = "position", required = false) Integer position,
                                         @ApiParam(name = "imgUrl", value = "二维码图片地址")
                                         @RequestParam(value = "imgUrl", required = false) String imgUrl,
                                         @ApiParam(name = "id", value = "认证标识id")
                                         @RequestParam(value = "id", required = false) Integer id){
        try{
            jmJkEduArticleService.saveOrUpdateArticleQR(currentRoleLevel,currentRoleCode,position,imgUrl,getUID(),id);
            return success("保存成功!");
        } catch (Exception e){
            e.printStackTrace();
            return error(-1,"保存失败!");
        }
    }
    @RequestMapping(value = "authenticationArticle", method = RequestMethod.POST)
    @ApiOperation("文章认证")
    public  String authenticationArticle(@ApiParam(name = "articleId", value = "文章id,多个文章‘,’隔开")
                                          @RequestParam(value = "articleId", required = true) String articleId,
                                          @ApiParam(name = "isAuthentication", value = "认证,0取消认证,1认证")
                                          @RequestParam(value = "isAuthentication", required = true) String isAuthentication,
                                          @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                          @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                          @ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
                                          @RequestParam(value = "firstLevelCategoryName", required = true) String firstLevelCategoryName,
                                          @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类")
                                          @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
                                          @ApiParam(name = "secondLevelCategoryName", value = "文章二级分类名称")
                                          @RequestParam(value = "secondLevelCategoryName", required = true) String secondLevelCategoryName){
        try{
            jmJkEduArticleService.authenticationArticle(articleId,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            return success("认证成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"认证失败!");
        }
    }
}

+ 1 - 15
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java

@ -264,19 +264,5 @@ public class HealthEduArticleController extends BaseController {
        }
    }
    @RequestMapping(value = "pushArticleLogs", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("居民获取被推送文章列表 ")
    public String pushArticleLogs(
            @ApiParam(name = "page", value = "当前页 起始1", required = true) @RequestParam(value = "page", required = true) Integer page,
            @ApiParam(name = "pagesize", value = "每页显示条数", required = true) @RequestParam(value = "pagesize", required = true) Integer pagesize){
        try {
            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.pushArticleLogs(page,pagesize,getUID());
//            Long count = healthEducationArticleService.pushArticleLogsCount("ece5c665b16542b0847e52b4a9fee44a");
            return write(200,"查询成功!","data",response);
        }catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
}

+ 22 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/jimeiJkEdu/PatientJMJkEduArticleController.java

@ -1,9 +1,15 @@
package com.yihu.wlyy.web.patient.jimeiJkEdu;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
@ -14,5 +20,21 @@ import org.springframework.web.bind.annotation.RestController;
@Api(description = "集美宣教微信端(患者端)")
public class PatientJMJkEduArticleController extends BaseController {
    @Autowired
    private JMJkEduArticleService jmJkEduArticleService;
    @RequestMapping(value = "fetchArticlePushedList", method = RequestMethod.GET)
    @ApiOperation("居民获取被推送文章列表 ")
    public String pushArticleLogs(
            @ApiParam(name = "page", value = "当前页 起始1", required = true) @RequestParam(value = "page", required = true) Integer page,
            @ApiParam(name = "pagesize", value = "每页显示条数", required = true) @RequestParam(value = "pagesize", required = true) Integer pagesize){
        try {
            com.alibaba.fastjson.JSONArray response = jmJkEduArticleService.pushArticleLogs(page,pagesize,getUID());
//            Long count = healthEducationArticleService.pushArticleLogsCount("ece5c665b16542b0847e52b4a9fee44a");
            return write(200,"查询成功!","data",response);
        }catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
}

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

@ -13,6 +13,7 @@ import com.yihu.wlyy.wechat.util.WeiXinTempMsgSendUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.elasticsearch.common.collect.HppcMaps;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -75,18 +76,6 @@ public class ThirdJkEduArticleController extends BaseController {
        }
    }
    @RequestMapping(value = "getCategoryList",method = RequestMethod.GET)
    @ApiOperation("获取文章类别")
    public String getCategoryList(@ApiParam(name = "categoryLevel", value = "获取类别:1、一级类别 2、二级类别",defaultValue = "1")
                                  @RequestParam(value = "categoryLevel", required = true) String categoryLevel){
        try {
            com.alibaba.fastjson.JSONArray response = thirdJkEduArticleService.getCategoryList(categoryLevel,getUID());
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "getCollectionArticalList",method = RequestMethod.GET)
    @ApiOperation("获取收藏文章列表")
@ -202,4 +191,75 @@ public class ThirdJkEduArticleController extends BaseController {
        }
    }
    /*************************************************** Category *****************************************************/
    @RequestMapping(value = "addCategory",method = RequestMethod.GET)
    @ApiOperation("添加二级分类-仅向市级管理员开放编辑权限")
    public String addCategory(@ApiParam(name = "categoryName", value = "文章分类名称")
                                           @RequestParam(value = "categoryName", required = true) String categoryName,
                                           @ApiParam(name = "categoryLevel", value = "分类级别-默认二级")
                                           @RequestParam(value = "categoryLevel", required = true,defaultValue = "2") Integer categoryLevel,
                                           @ApiParam(name = "firstlevelId", value = "一级类别ID")
                                           @RequestParam(value = "firstlevelId", required = true ) String firstlevelId,
                                           @ApiParam(name = "secondLevelId", value = "二级类别ID")
                                           @RequestParam(value = "secondLevelId", required = true ) String secondLevelId,
                                           @ApiParam(name = "currentRoleCode", value = "当前登录角色")
                                           @RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode){
        try {
            thirdJkEduArticleService.addCategory(categoryName,categoryLevel,firstlevelId,secondLevelId,getUID(),currentRoleCode);
            return success("添加成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"添加失败!");
        }
    }
    @RequestMapping(value = "updateCategory",method = RequestMethod.POST)
    @ApiOperation("更新二级分类-仅向市级管理员开放编辑权限")
    public String updateCategory(@ApiParam(name = "categoryId", value = "文章分类code")
                              @RequestParam(value = "categoryId", required = true) String categoryId,
                              @ApiParam(name = "categoryName", value = "文章分类名称")
                              @RequestParam(value = "categoryName", required = true ) String categoryName,
                              @ApiParam(name = "categoryState", value = "类别状态1、正常、2删除")
                              @RequestParam(value = "categoryState", required = true ) Integer categoryState,
                              @ApiParam(name = "currentRoleCode", value = "当前登录角色")
                              @RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode){
        try {
            thirdJkEduArticleService.updateCategory(categoryId,categoryName,categoryState,getUID(),currentRoleCode);
            return success("更新成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"更新失败!");
        }
    }
    @RequestMapping(value = "getCategoryList",method = RequestMethod.GET)
    @ApiOperation("获取文章类别")
    public String getCategoryList(@ApiParam(name = "categoryLevel", value = "获取类别:1、一级类别 2、二级类别",defaultValue = "1")
                                  @RequestParam(value = "categoryLevel", required = false) String categoryLevel){
        try {
            com.alibaba.fastjson.JSONArray response = thirdJkEduArticleService.getCategoryList(categoryLevel);
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    /*************************************************** ConfigDicSho *************************************************/
    @RequestMapping(value = "getConfigDicShoList",method = RequestMethod.GET)
    @ApiOperation("获取优先级-数据字典")
    public String getConfigDicShoList(@ApiParam(name = "typeName", value = "优先级-字典业务类型")
                                          @RequestParam(value = "typeName", required = true) String typeName){
        try {
            com.alibaba.fastjson.JSONArray response = thirdJkEduArticleService.getConfigDicShoList(typeName);
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
}