Prechádzať zdrojové kódy

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

zd_123 7 rokov pred
rodič
commit
db3e664495
79 zmenil súbory, kde vykonal 1916 pridanie a 1017 odobranie
  1. 1 1
      edu-article/JkEdu/src/Article.sql.xml
  2. 61 0
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  3. 31 6
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java
  4. 104 7
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java
  5. 3 8
      patient-co-manage/redis-cache/pom.xml
  6. 11 61
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/constants/ServiceApi.java
  7. 5 0
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/controller/EnvelopRestEndPoint.java
  8. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheCategory.java
  9. 43 24
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheAuthorizationEndPoint.java
  10. 40 24
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheCategoryEndPoint.java
  11. 26 19
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheKeyRuleEndPoint.java
  12. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheOperationEndPoint.java
  13. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheStatisticsEndPoint.java
  14. 41 28
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqChannelEndPoint.java
  15. 38 26
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqPublisherEndPoint.java
  16. 6 6
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqSubscriberEndPoint.java
  17. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisScheduledController.java
  18. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisSubscribeMessageEndPoint.java
  19. 0 106
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/entity/SystemDict.java
  20. 0 152
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/entity/SystemDictList.java
  21. 3 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/listener/ApplicationReadyEventListener.java
  22. 0 22
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/SystemDictDao.java
  23. 0 12
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/SystemDictListDao.java
  24. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheAuthorizationDao.java
  25. 7 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheCategoryDao.java
  26. 1 1
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheKeyMemoryDao.java
  27. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheKeyRuleDao.java
  28. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqChannelDao.java
  29. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqPublisherDao.java
  30. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqSubscriberDao.java
  31. 0 45
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/manager/dict/SystemDictService.java
  32. 3 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/DefaultMessageDelegate.java
  33. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheAuthorizationService.java
  34. 5 4
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheCategoryService.java
  35. 1 1
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheKeyMemoryService.java
  36. 4 4
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheKeyRuleService.java
  37. 4 4
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqChannelService.java
  38. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqPublisherService.java
  39. 4 4
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqSubscriberService.java
  40. 6 7
      patient-co-manage/redis-cache/src/main/resources/application.yml
  41. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/detailJs.jsp
  42. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/listJs.jsp
  43. 1 1
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/detail.jsp
  44. 85 78
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/detailJs.jsp
  45. 105 103
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/listJs.jsp
  46. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/detailJs.jsp
  47. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/listJs.jsp
  48. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/detailJs.jsp
  49. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/listJs.jsp
  50. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/detailJs.jsp
  51. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/listJs.jsp
  52. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/detailJs.jsp
  53. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/listJs.jsp
  54. 25 1
      patient-co-manage/redis-cache/src/main/webapp/static/develop/module/util.js
  55. 93 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/DoctorMapping.java
  56. 6 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/Prescription.java
  57. 219 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionExpressageLog.java
  58. 258 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionLog.java
  59. 25 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionExpressageLogDao.java
  60. 20 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionLogDao.java
  61. 28 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/wechat/DoctorMappingDao.java
  62. 31 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/Icd10DictServcie.java
  63. 46 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/JwPrescriptionService.java
  64. 127 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/PresModeAdapter.java
  65. 28 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/ZyDictService.java
  66. 104 4
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/prescription/PrescriptionService.java
  67. 2 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/HttpClientUtil.java
  68. 14 10
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_info_js.jsp
  69. 1 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  70. BIN
      patient-co/patient-co-wlyy/doc/接口文档/~$i健康API文档.docx
  71. BIN
      patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/~$健康教育对外接口文档(11).docx
  72. BIN
      patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/~$健康教育对外接口文档.docx
  73. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  74. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  75. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  76. 33 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  77. 48 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  78. 69 145
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java
  79. 7 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

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

@ -3,7 +3,7 @@
	<Sqls>
		<Sql name='getArticleList'>
			<![CDATA[
		select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m 
		select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber  from Org_Article m
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
		
			]]>

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

@ -623,6 +623,67 @@ public class ArticleApi {
		}
	}
	public String queryArticleAPPList(InterfaceMessage im) throws Exception {
		JSONObject json = JSONObject.fromObject(im.getParam());
		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  insertTimeStart = StringUtil.isEmpty(json.get("insertTimeStart")) ? null : json.getString("insertTimeStart");//添加时间开始
		String  insertTimeEnd = StringUtil.isEmpty(json.get("insertTimeEnd")) ? null : json.getString("insertTimeEnd");//添加时间结束
		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
		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 = StringUtil.isEmpty(json.get("page")) ? null : json.getInt("page");
		Integer	pageSize = StringUtil.isEmpty(json.get("pageSize")) ? null : json.getInt("pageSize");
		Integer	sEcho = StringUtil.isEmpty(json.get("sEcho")) ? 0 : json.getInt("sEcho");
		Boolean	isMyArticle = StringUtil.isEmpty(json.get("isMyArticle")) ? false : json.getBoolean("isMyArticle");
		Integer roleType = StringUtil.isEmpty(json.get("roleType")) ? null : json.getInt("roleType");//1、健管师,2、管理员
		if(page==null){
			return ApiUtil.getRespJSON(-10000, "page 必传").toString();
		}
		if(pageSize==null){
			return ApiUtil.getRespJSON(-10000, "pageSize 必传").toString();
		}
		OrgArticleVo vo = new OrgArticleVo();
		vo.setFirstLevelCategoryId(firstLevelCategoryId);
		vo.setSecondLevelCategoryId(secondLevelCategoryId);
		vo.setStartTime(insertTimeStart);
		vo.setEndTime(insertTimeEnd);
		vo.setArticlelevel(articlelevel);
		if(isMyArticle){
			vo.setOperatorId(userCode);
		}
		vo.setOperatorRoleCode(currentUserRole);
		vo.setArticleTitle(articleTitle);
		vo.setOperatorRoleLevel(currentUserRoleLevel);
		vo.setIsAuthentication(isAuthentication);
		vo.setRoleType(roleType);
		JSONArray array = new JSONArray();
		try {
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
			List<Article> result = dao.queryArticleAPPList(vo, page, pageSize,userCode);
			array.addAll(result);
//			int count = dao.queryArticlePcListCount(vo);
//			rv.put("Result", array);
//			rv.put("Count", count);
			rv.put("aaData",  array);
//			rv.put("iTotalDisplayRecords", result.get("totalProperty"));
//			rv.put("iTotalRecords", result.get("totalProperty"));
//			rv.put("sEcho", sEcho);
//			System.out.printf("article:"+rv.toString());
			return rv.toString();
		}catch (SQLException e) {
			e.printStackTrace();
			return ApiUtil.getRespJSON(-14444, "获取数据异常:" + e.getMessage()).toString();
		}
	}
    /**
     * 文章认证列表
     * @param im

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

@ -59,7 +59,7 @@ public class ArticleApiTest {
//		obj.put("articleId","0");
//		obj.put("isAuthentication","1");
		obj.put("isAuthentication","1");
//		obj.put("secondLevelCategoryId","74889da6-955e-4454-870f-4da37b466264");
//        obj.put("firstLevelCategoryName","健康文章");
//        obj.put("secondLevelCategoryName","孕检知识");
@ -68,20 +68,45 @@ public class ArticleApiTest {
//		obj.put("articlelevel","1");
//		obj.put("articleTitle","1");
//		obj.put("userCode","0de7295862dd11e69faffa163e8aee56");
//		obj.put("isManage",true);
		obj.put("currentUserRole","350200");
		obj.put("currentUserRoleLevel","2");
		obj.put("roleType",1);
		obj.put("currentUserRole","3502110400");
		obj.put("currentUserRoleLevel","4");
//		obj.put("currentUserRole","3502110400");
//		obj.put("currentUserRoleLevel","4");
		obj.put("page","0");
		obj.put("pageSize","10");
//		obj.put("articleId","1");
		obj.put("sEcho","1");
//		obj.put("articleTitle","我口试");
		im.setParam(obj.toString());
		initDB();
		try{
//			api.authenticationArticle(im);
			System.out.println(api.queryArticlePcList(im));
			System.out.println(api.queryArticleAPPList(im));
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void saveArticle(){
		ArticleApi api = new ArticleApi();
		InterfaceMessage im = new InterfaceMessage();
		JSONObject obj = new JSONObject();
		obj.put("content","<p>内容</p>");
		obj.put("articleTitle","标题");
		obj.put("articlelevel","1");
		obj.put("secondLevelCategoryId","281f1e5f-218b-4ee4-9071-d6c3bf0c0369");
		obj.put("secondLevelCategoryName","领导指示");
		obj.put("firstLevelCategoryId","42");
		obj.put("firstLevelCategoryName","公告通知");
		obj.put("userScope",1);
		obj.put("roleType",1);
		obj.put("ArticleState",1);
		obj.put("ArticleOrder",99);
		im.setParam(obj.toString());
		initDB();
		try{
//			api.authenticationArticle(im);
			System.out.println(api.saveArticle(im));
		}catch(Exception e){
			e.printStackTrace();
		}

+ 104 - 7
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java

@ -559,13 +559,13 @@ public class ArticleDao {
			param.append(" and m.InsertTime <= ? ");
			sql.addParamValue(vo.getEndTime());
		}
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
		if (vo.getArticlelevel()!=null) {
			param.append(" and Articlelevel = ? ");
			sql.addParamValue(vo.getArticlelevel());
			sql.addParamValue(vo.getArticlelevel().intValue());
		}
		if (StringUtil.isNotEmpty(vo.getIsAuthentication())) {
		if (vo.getIsAuthentication()!=null) {
			param.append(" and IsAuthentication = ? ");
			sql.addParamValue(vo.getIsAuthentication());
			sql.addParamValue(vo.getIsAuthentication().intValue());
		}
		if (StringUtil.isNotEmpty(vo.getOperatorRoleLevel())) {
			param.append(" and OperatorRoleLevel >= ? ");
@ -589,9 +589,9 @@ public class ArticleDao {
		param.append(" and UserScope <= ? ");
		if(StringUtil.isNotEmpty(vo.getOperatorRoleLevel())){
            sql.addParamValue(vo.getOperatorRoleLevel());
            sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
        }else{
            sql.addParamValue(4);
            sql.addParamValue(3);
        }
		if(StringUtil.isNotEmpty(vo.getRoleType())) {
			param.append(" and RoleType = ? ");
@ -604,7 +604,7 @@ public class ArticleDao {
//		pageParam.append(" limit ").append(start * pageSize + "," + pageSize);
		sql.addVar("@Condition", param.toString());
		sql.addVar("@Condition2", param2.toString());
		sql.addVar("@PageParam", pageParam.toString());
		sql.addVar("@PageParam", "");
//		List<Article> list = DB.me().queryForBeanList(MyDatabaseEnum.JkEduDB, sql,Article.class);
//		Category temp = null;
@ -626,6 +626,103 @@ public class ArticleDao {
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);
	}
	/**
	 * PC端获取文章列表
	 * @param vo
	 * @param start
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<Article> queryArticleAPPList(OrgArticleVo vo, int start, int pageSize,String userCode) throws Exception {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcList);
		StringBuffer param = new StringBuffer();
		StringBuffer param2 = new StringBuffer();
		StringBuffer pageParam = new StringBuffer();
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
			param.append(" and FirstLevelCategoryId = ? ");
			sql.addParamValue(vo.getFirstLevelCategoryId());
		}
		if (StringUtil.isNotEmpty(vo.getSecondLevelCategoryId())) {
			param.append(" and SecondLevelCategoryId = ? ");
			sql.addParamValue(vo.getSecondLevelCategoryId());
		}
		if (StringUtil.isNotEmpty(vo.getStartTime())) {
			param.append(" and m.InsertTime >= ? ");
			sql.addParamValue(vo.getStartTime());
		}
		if (StringUtil.isNotEmpty(vo.getEndTime())) {
			param.append(" and m.InsertTime <= ? ");
			sql.addParamValue(vo.getEndTime());
		}
		if (vo.getArticlelevel()!=null) {
			param.append(" and Articlelevel = ? ");
			sql.addParamValue(vo.getArticlelevel().intValue());
		}
		if (vo.getIsAuthentication()!=null) {
			param.append(" and IsAuthentication = ? ");
			sql.addParamValue(vo.getIsAuthentication().intValue());
		}
		if (StringUtil.isNotEmpty(vo.getOperatorRoleLevel())) {
			param.append(" and OperatorRoleLevel >= ? ");
			sql.addParamValue(vo.getOperatorRoleLevel());
		}
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
			param.append(" and ArticleTitle like '%"+vo.getArticleTitle()+"%' ");
		}
		if (StringUtil.isNotEmpty(vo.getOperatorId())) {
			param.append(" and OperatorId ='"+vo.getOperatorId()+"' ");
		}
		if("1".equals(vo.getOperatorRoleLevel())){//省
			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,3)+"%' ");
		}else if("2".equals(vo.getOperatorRoleLevel())){//市
			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,4)+"%' ");
		}else if("3".equals(vo.getOperatorRoleLevel())){//区
			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,6)+"%' ");
		}else if("4".equals(vo.getOperatorRoleLevel())){//社区、机构
			param.append(" and OperatorRoleCode = '"+vo.getOperatorRoleCode()+"' ");
		}
		param.append(" and UserScope <= ? ");
		if(StringUtil.isNotEmpty(vo.getOperatorRoleLevel())){
			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
		}else{
			sql.addParamValue(3);
		}
		if(StringUtil.isNotEmpty(vo.getRoleType())) {
			param.append(" and RoleType = ? ");
			sql.addParamValue(vo.getRoleType());
		}
		if(StringUtil.isNotEmpty(userCode)){
			param2.append(" and  a.UserId='"+userCode+"'");
		}
		pageParam.append(" limit ").append(start * pageSize + "," + pageSize);
		sql.addVar("@Condition", param.toString());
		sql.addVar("@Condition2", param2.toString());
		sql.addVar("@PageParam", pageParam.toString());
		List<Article> list = DB.me().queryForBeanList(MyDatabaseEnum.JkEduDB, sql,Article.class);
		return list;
//		Category temp = null;
//		for(Article one:list){
//
//			temp = new Category();
//			temp.setCategoryLevel(1);
//			temp.setFirstlevelId(one.getFirstLevelCategoryId());
//			temp.setSecondLevelId(null);
//			com.common.json.JSONObject result = dao.getCategoryList( temp, 0, 1000);
//			one.setFirstLevelCategoryName(result.get("CategoryName")+"");
//			temp = new Category();
//			temp.setCategoryLevel(2);
//			temp.setFirstlevelId(null);
//			temp.setSecondLevelId(one.getSecondLevelCategoryId());
//			result = dao.getCategoryList( temp, 0, 1000);
//			one.setSecondLevelCategoryName(result.get("CategoryName")+"");
//		}
//		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);
	}
	/**
	 * PC端获取文章列表总数
	 * @param vo

+ 3 - 8
patient-co-manage/redis-cache/pom.xml

@ -10,7 +10,7 @@
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.5.RELEASE</version>
        <version>1.3.8.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <properties>
@ -251,20 +251,15 @@
        </dependency>
    </dependencies>
    <build>
        <finalName>redis-cache</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin </artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

+ 11 - 61
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/constants/ServiceApi.java

@ -19,69 +19,14 @@ public class ServiceApi {
     */
    public static class Redis {
        //初始化缓存
        public static final String InitAddress = "/redis/init/address";
        public static final String InitHealthProblem = "/redis/init/healthProblem";
        public static final String InitIcd10HpR = "/redis/init/icd10HpR";
        public static final String InitIcd10 = "/redis/init/icd10";
        public static final String InitIndicatorsDict = "/redis/init/indicatorsDict";
        public static final String InitOrgName = "/redis/init/orgName";
        public static final String InitOrgArea = "/redis/init/orgArea";
        public static final String InitOrgSaasArea = "/redis/init/orgSaasArea";
        public static final String InitOrgSaasOrg = "/redis/init/orgSaasOrg";
        public static final String InitVersions = "/redis/init/versions";
        public static final String InitRsAdapterDict = "/redis/init/rsAdapterDict/{id}";
        public static final String InitRsAdapterMeta = "/redis/init/rsAdapterMeta/{id}";
        public static final String InitRsMetadata = "/redis/init/rsMetadata";
        //清除缓存
        public static final String Delete = "/redis/delete";
        //更新缓存
        public static final String UpdateOrgName = "/redis/update/orgName";
        public static final String UpdateOrgArea = "/redis/update/orgArea";
        public static final String UpdateOrgSaasArea = "/redis/update/orgSaasArea";
        public static final String UpdateOrgSaasOrg = "/redis/update/orgSaasOrg";
        //获取缓存数据
        public static final String Address = "/redis/address";
        public static final String HealthProblem = "/redis/healthProblem";
        public static final String Icd10HpR = "/redis/icd10HpRelation";
        public static final String Icd10Name = "/redis/icd10Name";
        public static final String Icd10HpCode = "/redis/icd10HpCode";
        public static final String IndicatorsDict = "/redis/indicatorsDict";
        public static final String OrgName = "/redis/orgName";
        public static final String OrgArea = "/redis/orgArea";
        public static final String OrgSaasArea = "/redis/orgSaasArea";
        public static final String OrgSaasOrg = "/redis/orgSaasOrg";
        //App前端Redis
        public static final String AppGetRedisValue = "/redis/getAppClientValue";
        public static final String AppSetRedisValue = "/redis/setAppClientValue";
        public static final String AppSetRedisJsonValue = "/redis/setAppClientJsonValue";
        public static final String AppDeleteRedisValue = "/redis/deleteAppClientValue";
        //资源化相关Redis
        public static final String RsAdapterDict = "/redis/rsAdapterDict";
        public static final String RsAdapterMetadata = "/redis/rsAdapterMetaData";
        public static final String RsMetadata = "/redis/rsMetadata";
        //标准相关Redis
        public static final String StdVersion = "/redis/stdVersion";
        public static final String StdDataSetCode = "/redis/stdDataSetCode";
        public static final String StdDataSetName = "/redis/stdDataSetName";
        public static final String StdDataSetNameByCode = "/redis/stdDataSetNameByCode";
        public static final String StdDataSetMultiRecord = "/redis/stdDataSetMultiRecord";
        public static final String StdMetadataType = "/redis/stdMetaDataType";
        public static final String StdMetadataDict = "/redis/stdMetaDataDict";
        public static final String StdDictEntryValue = "/redis/stdDictEntryValue";
        // Redis消息队列
        public static class MqChannel {
            public static final String Prefix = "/redis/mq/channel/";
            public static final String GetById = "/redis/mq/channel/{id}";
            public static final String GetById = "/redis/mq/channel/detail";
            public static final String Search = "/redis/mq/channel/search";
            public static final String Save = "/redis/mq/channel/save";
            public static final String Update = "/redis/mq/channel/update";
            public static final String Delete = "/redis/mq/channel/delete";
            public static final String IsUniqueChannel = "/redis/mq/channel/isUniqueChannel";
            public static final String IsUniqueChannelName = "/redis/mq/channel/isUniqueChannelName";
@ -90,9 +35,10 @@ public class ServiceApi {
        // Redis消息订阅者
        public static class MqSubscriber {
            public static final String Prefix = "/redis/mq/subscriber/";
            public static final String GetById = "/redis/mq/subscriber/{id}";
            public static final String GetById = "/redis/mq/subscriber/detail";
            public static final String Search = "/redis/mq/subscriber/search";
            public static final String Save = "/redis/mq/subscriber/save";
            public static final String Update = "/redis/mq/subscriber/update";
            public static final String Delete = "/redis/mq/subscriber/delete";
            public static final String IsUniqueAppId = "/redis/mq/subscriber/isUniqueAppId";
            public static final String IsUniqueSubscribedUrl = "/redis/mq/subscriber/isUniqueSubscribedUrl";
@ -103,16 +49,18 @@ public class ServiceApi {
            public static final String GetById = "/redis/mq/publisher/{id}";
            public static final String Search = "/redis/mq/publisher/search";
            public static final String Save = "/redis/mq/publisher/save";
            public static final String Update = "/redis/mq/publisher/update";
            public static final String Delete = "/redis/mq/publisher/delete";
            public static final String IsUniqueAppId = "/redis/mq/publisher/isUniqueAppId";
        }
        // 缓存分类
        public static class CacheCategory {
            public static final String Prefix = "/redis/cache/category/";
            public static final String GetById = "/redis/cache/category/{id}";
            public static final String GetById = "/redis/cache/category/detail";
            public static final String Search = "/redis/cache/category/search";
            public static final String SearchNoPage = "/redis/cache/category/searchNoPage";
            public static final String Save = "/redis/cache/category/save";
            public static final String Update = "/redis/cache/category/update";
            public static final String Delete = "/redis/cache/category/delete";
            public static final String IsUniqueName = "/redis/cache/category/isUniqueName";
            public static final String IsUniqueCode = "/redis/cache/category/isUniqueCode";
@ -120,18 +68,20 @@ public class ServiceApi {
        // 缓存授权
        public static class CacheAuthorization {
            public static final String Prefix = "/redis/cache/authorization/";
            public static final String GetById = "/redis/cache/authorization/{id}";
            public static final String GetById = "/redis/cache/authorization/detail";
            public static final String Search = "/redis/cache/authorization/search";
            public static final String Save = "/redis/cache/authorization/save";
            public static final String Update = "/redis/cache/authorization/update";
            public static final String Delete = "/redis/cache/authorization/delete";
            public static final String IsUniqueAppId = "/redis/cache/authorization/isUniqueAppId";
        }
        // 缓存Key规则
        public static class CacheKeyRule {
            public static final String Prefix = "/redis/cache/keyRule/";
            public static final String GetById = "/redis/cache/keyRule/{id}";
            public static final String GetById = "/redis/cache/keyRule/detail";
            public static final String Search = "/redis/cache/keyRule/search";
            public static final String Save = "/redis/cache/keyRule/save";
            public static final String Update = "/redis/cache/keyRule/update";
            public static final String Delete = "/redis/cache/keyRule/delete";
            public static final String IsUniqueName = "/redis/cache/keyRule/isUniqueName";
            public static final String IsUniqueCode = "/redis/cache/keyRule/isUniqueCode";

+ 5 - 0
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/controller/EnvelopRestEndPoint.java

@ -4,8 +4,10 @@ package com.yihu.wlyy.common.controller;
import com.yihu.wlyy.common.constants.BizObject;
import com.yihu.wlyy.common.util.ObjectId;
import com.yihu.wlyy.util.Envelop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
@ -24,6 +26,9 @@ public class EnvelopRestEndPoint extends BaseRestEndPoint {
    @Value("${deploy.region}")
    Short deployRegion = 3502;
    @Autowired
    protected HttpServletRequest request;
    /**
     * 返回一个信封对象。信封对象的返回场景参见 Envelop.
     *

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheCategory.java

@ -14,7 +14,7 @@ import java.util.Date;
 */
public class MRedisCacheCategory implements Serializable{
    public Integer id; // 主键
    public Long id; // 主键
    private String name; // 缓存分类名称
    private String code; // 缓存分类编码
    private String remark; // 备注
@ -23,11 +23,11 @@ public class MRedisCacheCategory implements Serializable{
    private Date modifyDate; // 修改时间
    private String modifier; // 修改者
    public Integer getId() {
    public Long getId() {
        return id;
    }
    public void setId(Integer id) {
    public void setId(Long id) {
        this.id = id;
    }

+ 43 - 24
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheAuthorizationEndPoint.java

@ -5,16 +5,22 @@ import com.yihu.wlyy.common.constants.ApiVersion;
import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheAuthorization;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisCacheAuthorization;
import com.yihu.wlyy.service.redis.cache.RedisCacheAuthorizationService;
import com.yihu.wlyy.util.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -23,7 +29,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存授权接口", tags = {"缓存服务管理--缓存授权接口"})
public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
@ -33,30 +39,31 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取缓存授权")
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisCacheAuthorization mRedisCacheAuthorization = convertToModel(redisCacheAuthorizationService.getById(id), MRedisCacheAuthorization.class);
            envelop.setObj(mRedisCacheAuthorization);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取缓存授权。");
            if(id!=null){
                MRedisCacheAuthorization mRedisCacheAuthorization = convertToModel(redisCacheAuthorizationService.getById(id), MRedisCacheAuthorization.class);
                model.addAttribute("detailModel", toJson(mRedisCacheAuthorization));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取缓存授权发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/cache/authorization/detail";
    }
    @ApiOperation(value = "根据条件获取缓存授权")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "筛选条件")
            @RequestParam(value = "filters", required = false) String filters,
            @RequestParam(value = "filters", required = false) String searchContent,
            @ApiParam(name = "categoryCode", value = "类别")
            @RequestParam(value = "categoryCode", required = false) String categoryCode,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
@ -66,6 +73,10 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            String filters = "categoryCode=" + categoryCode + ";";
            if (!StringUtils.isEmpty(searchContent)) {
                filters = "appId?" + searchContent + ";";
            }
            List<RedisCacheAuthorization> redisCacheAuthorization = redisCacheAuthorizationService.search(fields, filters, sorts, page, rows);
            int count = (int) redisCacheAuthorizationService.getCount(filters);
            List<MRedisCacheAuthorization> mRedisCacheAuthorization = (List<MRedisCacheAuthorization>) convertToModels(redisCacheAuthorization, new ArrayList<MRedisCacheAuthorization>(), MRedisCacheAuthorization.class, fields);
@ -80,14 +91,18 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增缓存授权")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "缓存授权JSON", required = true)
            @RequestBody String entityJson) {
    public Envelop add(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheAuthorization newEntity = objectMapper.readValue(entityJson, RedisCacheAuthorization.class);
            RedisCacheAuthorization newEntity = objectMapper.readValue(data, RedisCacheAuthorization.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            newEntity.setCreator(currentUser.getCode());
            newEntity.setCreateDate(new Date());
            newEntity.setModifyDate(new Date());
            newEntity.setModifier(currentUser.getCode());
            newEntity = redisCacheAuthorizationService.save(newEntity);
            MRedisCacheAuthorization mRedisCacheAuthorization = convertToModel(newEntity, MRedisCacheAuthorization.class);
@ -102,14 +117,16 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新缓存授权")
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Save, method = RequestMethod.PUT)
    public Envelop update(
            @ApiParam(value = "缓存授权JSON", required = true)
            @RequestBody String entityJson) {
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Update, method = RequestMethod.POST)
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheAuthorization updateEntity = objectMapper.readValue(entityJson, RedisCacheAuthorization.class);
            RedisCacheAuthorization updateEntity = objectMapper.readValue(data, RedisCacheAuthorization.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisCacheAuthorizationService.save(updateEntity);
            MRedisCacheAuthorization mRedisCacheAuthorization = convertToModel(updateEntity, MRedisCacheAuthorization.class);
@ -124,10 +141,11 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除缓存授权")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "缓存授权ID", required = true)
            @RequestParam(value = "id") Integer id) {
            @RequestParam(value = "id") Long id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
@ -143,10 +161,11 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证指定缓存分类下应用ID是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.IsUniqueAppId, method = RequestMethod.GET)
    public Envelop isUniqueAppId(
            @ApiParam(name = "id", value = "缓存授权ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "categoryCode", value = "缓存分类编码", required = true)
            @RequestParam(value = "categoryCode") String categoryCode,
            @ApiParam(name = "appId", value = "应用ID", required = true)

+ 40 - 24
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheCategoryEndPoint.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.common.constants.ApiVersion;
import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisCacheCategory;
import com.yihu.wlyy.service.redis.cache.RedisCacheCategoryService;
import com.yihu.wlyy.util.Envelop;
@ -13,9 +14,15 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
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.ResponseBody;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -24,7 +31,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存分类接口", tags = {"缓存服务管理--缓存分类接口"})
public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
@ -34,24 +41,23 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取缓存分类")
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisCacheCategory mRedisCacheCategory = convertToModel(redisCacheCategoryService.getById(id), MRedisCacheCategory.class);
            envelop.setObj(mRedisCacheCategory);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取缓存分类。");
            if(id!=null){
                MRedisCacheCategory mRedisCacheCategory = convertToModel(redisCacheCategoryService.getById(id), MRedisCacheCategory.class);
                model.addAttribute("detailModel", toJson(mRedisCacheCategory));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取缓存分类发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/cache/category/detail";
    }
    @ApiOperation(value = "根据条件获取缓存分类")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
@ -85,6 +91,7 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation(value = "根据条件获取缓存分类(不分页)")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.SearchNoPage, method = RequestMethod.GET)
    public Envelop searchNoPage(
            @ApiParam(name = "filters", value = "筛选条件")
@ -106,14 +113,18 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增缓存分类")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "缓存分类JSON", required = true)
            @RequestBody String entityJson) {
    public Envelop add(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheCategory newEntity = objectMapper.readValue(entityJson, RedisCacheCategory.class);
            RedisCacheCategory newEntity = objectMapper.readValue(data, RedisCacheCategory.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            newEntity.setCreator(currentUser.getCode());
            newEntity.setCreateDate(new Date());
            newEntity.setModifyDate(new Date());
            newEntity.setModifier(currentUser.getCode());
            newEntity = redisCacheCategoryService.save(newEntity);
            MRedisCacheCategory mRedisCacheCategory = convertToModel(newEntity, MRedisCacheCategory.class);
@ -128,14 +139,16 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新缓存分类")
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Save, method = RequestMethod.PUT)
    public Envelop update(
            @ApiParam(value = "缓存分类JSON", required = true)
            @RequestBody String entityJson) {
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Update, method = RequestMethod.POST)
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheCategory updateEntity = objectMapper.readValue(entityJson, RedisCacheCategory.class);
            RedisCacheCategory updateEntity = objectMapper.readValue(data, RedisCacheCategory.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisCacheCategoryService.save(updateEntity);
            MRedisCacheCategory mRedisCacheCategory = convertToModel(updateEntity, MRedisCacheCategory.class);
@ -150,6 +163,7 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除缓存分类")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "缓存分类ID", required = true)
@ -169,10 +183,11 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证缓存分类名称是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.IsUniqueName, method = RequestMethod.GET)
    public Envelop isUniqueName(
            @ApiParam(name = "id", value = "缓存分类ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "name", value = "缓存分类名称", required = true)
            @RequestParam(value = "name") String name) {
        Envelop envelop = new Envelop();
@ -191,10 +206,11 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证缓存分类编码是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.IsUniqueCode, method = RequestMethod.GET)
    public Envelop isUniqueCode(
            @ApiParam(name = "id", value = "缓存分类ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "code", value = "缓存分类编码", required = true)
            @RequestParam(value = "code") String code) {
        Envelop envelop = new Envelop();

+ 26 - 19
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheKeyRuleEndPoint.java

@ -4,6 +4,7 @@ package com.yihu.wlyy.controller.redis;
import com.yihu.wlyy.common.constants.ApiVersion;
import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.common.vo.MRedisCacheKeyRule;
import com.yihu.wlyy.entity.redis.RedisCacheKeyRule;
import com.yihu.wlyy.service.redis.cache.RedisCacheKeyRuleService;
@ -12,6 +13,8 @@ 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.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
@ -23,7 +26,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存Key规则接口", tags = {"缓存服务管理--缓存Key规则接口"})
public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
@ -33,30 +36,29 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取缓存Key规则")
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisCacheKeyRule mRedisCacheKeyRule = convertToModel(redisCacheKeyRuleService.getById(id), MRedisCacheKeyRule.class);
            envelop.setObj(mRedisCacheKeyRule);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取缓存Key规则。");
            if(id!=null){
                MRedisCacheKeyRule mRedisCacheKeyRule = convertToModel(redisCacheKeyRuleService.getById(id), MRedisCacheKeyRule.class);
                model.addAttribute("detailModel", toJson(mRedisCacheKeyRule));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取缓存Key规则发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/cache/cache/detail";
    }
    @ApiOperation(value = "根据条件获取缓存Key规则")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "筛选条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "searchContent", value = "筛选条件")
            @RequestParam(value = "searchContent", required = false) String searchContent,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
@ -66,8 +68,8 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            List<RedisCacheKeyRule> redisCacheKeyRuleList = redisCacheKeyRuleService.search(fields, filters, sorts, page, rows);
            int count = (int) redisCacheKeyRuleService.getCount(filters);
            List<RedisCacheKeyRule> redisCacheKeyRuleList = redisCacheKeyRuleService.search(fields, searchContent, sorts, page, rows);
            int count = (int) redisCacheKeyRuleService.getCount(searchContent);
            List<MRedisCacheKeyRule> mRedisCacheKeyRule = (List<MRedisCacheKeyRule>) convertToModels(redisCacheKeyRuleList, new ArrayList<MRedisCacheKeyRule>(), MRedisCacheKeyRule.class, fields);
            envelop = getPageResult(mRedisCacheKeyRule, count, page, rows);
            envelop.setSuccessFlg(true);
@ -80,6 +82,7 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增缓存Key规则")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "缓存Key规则JSON", required = true)
@ -102,7 +105,8 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新缓存Key规则")
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Save, method = RequestMethod.PUT)
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Update, method = RequestMethod.POST)
    public Envelop update(
            @ApiParam(value = "缓存Key规则JSON", required = true)
            @RequestBody String entityJson) {
@ -124,6 +128,7 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除缓存Key规则")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "缓存Key规则ID", required = true)
@ -143,10 +148,11 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证缓存Key规则名称是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.IsUniqueName, method = RequestMethod.GET)
    public Envelop isUniqueName(
            @ApiParam(name = "id", value = "缓存Key规则ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "name", value = "缓存Key规则名称", required = true)
            @RequestParam(value = "name") String name) {
        Envelop envelop = new Envelop();
@ -165,10 +171,11 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证缓存Key规则编码是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.IsUniqueCode, method = RequestMethod.GET)
    public Envelop isUniqueCode(
            @ApiParam(name = "id", value = "缓存Key规则ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "code", value = "缓存Key规则编码", required = true)
            @RequestParam(value = "code") String code) {
        Envelop envelop = new Envelop();

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheOperationEndPoint.java

@ -16,10 +16,10 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Controller;
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;
import javax.annotation.Resource;
@ -29,7 +29,7 @@ import javax.annotation.Resource;
 * @author 张进军
 * @date 2017/11/23 15:09
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存操作接口", tags = {"缓存服务管理--缓存操作接口"})
public class RedisCacheOperationEndPoint extends EnvelopRestEndPoint {

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheStatisticsEndPoint.java

@ -16,9 +16,9 @@ import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -32,7 +32,7 @@ import java.util.Map;
 * @author 张进军
 * @date 2017/11/30 17:07
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存统计接口", tags = {"缓存服务管理--缓存统计接口"})
public class RedisCacheStatisticsEndPoint extends EnvelopRestEndPoint {

+ 41 - 28
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqChannelEndPoint.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.common.vo.MRedisMqChannel;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisMqChannel;
import com.yihu.wlyy.entity.redis.RedisMqMessageLog;
import com.yihu.wlyy.entity.redis.RedisMqSubscriber;
@ -23,10 +24,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.ChannelTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -35,7 +39,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/10 11:45
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "消息队列接口", tags = {"Redis消息发布订阅--消息队列接口"})
public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
@ -55,30 +59,29 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取消息队列")
    @RequestMapping(value = ServiceApi.Redis.MqChannel.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisMqChannel mRedisMqChannel = convertToModel(redisMqChannelService.getById(id), MRedisMqChannel.class);
            envelop.setObj(mRedisMqChannel);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取消息队列。");
            if(id!=null){
                MRedisMqChannel mRedisMqChannel = convertToModel(redisMqChannelService.getById(id), MRedisMqChannel.class);
                model.addAttribute("detailModel", toJson(mRedisMqChannel));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取消息队列发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/mq/channel/detail";
    }
    @ApiOperation(value = "根据条件获取消息队列")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "筛选条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "searchContent", value = "筛选条件")
            @RequestParam(value = "searchContent", required = false) String searchContent,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
@ -88,8 +91,8 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            List<RedisMqChannel> redisMqChannelList = redisMqChannelService.search(fields, filters, sorts, page, rows);
            int count = (int) redisMqChannelService.getCount(filters);
            List<RedisMqChannel> redisMqChannelList = redisMqChannelService.search(fields, searchContent, sorts, page, rows);
            int count = (int) redisMqChannelService.getCount(searchContent);
            List<MRedisMqChannel> mRedisMqChannelList = (List<MRedisMqChannel>) convertToModels(redisMqChannelList, new ArrayList<MRedisMqChannel>(), MRedisMqChannel.class, fields);
            envelop = getPageResult(mRedisMqChannelList, count, page, rows);
            envelop.setSuccessFlg(true);
@ -102,14 +105,18 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增消息队列")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "消息队列JSON", required = true)
            @RequestBody String entityJson) {
    public Envelop add(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisMqChannel newEntity = objectMapper.readValue(entityJson, RedisMqChannel.class);
            RedisMqChannel newEntity = objectMapper.readValue(data, RedisMqChannel.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            newEntity.setCreator(currentUser.getCode());
            newEntity.setCreateDate(new Date());
            newEntity.setModifyDate(new Date());
            newEntity.setModifier(currentUser.getCode());
            newEntity = redisMqChannelService.save(newEntity);
            // 开启该订阅者的消息队列的消息监听
@ -129,14 +136,16 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新消息队列")
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Save, method = RequestMethod.PUT)
    public Envelop update(
            @ApiParam(value = "消息队列JSON", required = true)
            @RequestBody String entityJson) {
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Update, method = RequestMethod.POST)
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisMqChannel updateEntity = objectMapper.readValue(entityJson, RedisMqChannel.class);
            RedisMqChannel updateEntity = objectMapper.readValue(data, RedisMqChannel.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisMqChannelService.save(updateEntity);
            MRedisMqChannel mRedisMqChannel = convertToModel(updateEntity, MRedisMqChannel.class);
@ -151,10 +160,11 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除消息队列")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "消息队列ID", required = true)
            @RequestParam(value = "id") Integer id) {
            @RequestParam(value = "id") Long id) {
        Envelop envelop = new Envelop();
        RedisMqChannel redisMqChannel = redisMqChannelService.getById(id);
        String channel = redisMqChannel.getChannel();
@ -183,10 +193,11 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证消息队列编码是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.IsUniqueChannel, method = RequestMethod.GET)
    public Envelop isUniqueChannel(
            @ApiParam(name = "id", value = "消息队列ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channel", value = "消息队列编码", required = true)
            @RequestParam(value = "channel") String channel) {
        Envelop envelop = new Envelop();
@ -205,10 +216,11 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证消息队列名称是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.IsUniqueChannelName, method = RequestMethod.GET)
    public Envelop isUniqueChannelName(
            @ApiParam(name = "id", value = "消息队列ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channelName", value = "消息队列名称", required = true)
            @RequestParam(value = "channelName") String channelName) {
        Envelop envelop = new Envelop();
@ -227,6 +239,7 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("发布消息")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.SendMessage, method = RequestMethod.POST)
    public Envelop sendMessage(
            @ApiParam(name = "publisherAppId", value = "发布者应用ID", required = true)

+ 38 - 26
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqPublisherEndPoint.java

@ -4,7 +4,9 @@ package com.yihu.wlyy.controller.redis;
import com.yihu.wlyy.common.constants.ApiVersion;
import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.common.vo.MRedisMqPublisher;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisMqPublisher;
import com.yihu.wlyy.service.redis.pubsub.RedisMqPublisherService;
import com.yihu.wlyy.util.Envelop;
@ -12,9 +14,12 @@ 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.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -23,7 +28,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/20 09:35
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "消息发布者接口", tags = {"Redis消息发布订阅--消息发布者接口"})
public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
@ -33,30 +38,29 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取消息发布者")
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisMqPublisher mRedisMqPublisher = convertToModel(redisMqPublisherService.getById(id), MRedisMqPublisher.class);
            envelop.setObj(mRedisMqPublisher);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取消息发布者。");
            if(id!=null){
                MRedisMqPublisher mRedisMqPublisher = convertToModel(redisMqPublisherService.getById(id), MRedisMqPublisher.class);
                model.addAttribute("detailModel", toJson(mRedisMqPublisher));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取消息发布者发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/mq/publisher/detail";
    }
    @ApiOperation(value = "根据条件获取消息发布者")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "筛选条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "searchContent", value = "筛选条件")
            @RequestParam(value = "searchContent", required = false) String searchContent,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
@ -66,8 +70,8 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            List<RedisMqPublisher> list = redisMqPublisherService.search(fields, filters, sorts, page, size);
            int count = (int) redisMqPublisherService.getCount(filters);
            List<RedisMqPublisher> list = redisMqPublisherService.search(fields, searchContent, sorts, page, size);
            int count = (int) redisMqPublisherService.getCount(searchContent);
            List<MRedisMqPublisher> mList = (List<MRedisMqPublisher>) convertToModels(list, new ArrayList<MRedisMqPublisher>(), MRedisMqPublisher.class, fields);
            envelop = getPageResult(mList, count, page, size);
            envelop.setSuccessFlg(true);
@ -80,14 +84,18 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增消息发布者")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "消息发布者JSON", required = true)
            @RequestBody String entityJson) {
    public Envelop add(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisMqPublisher newEntity = objectMapper.readValue(entityJson, RedisMqPublisher.class);
            RedisMqPublisher newEntity = objectMapper.readValue(data, RedisMqPublisher.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            newEntity.setCreator(currentUser.getCode());
            newEntity.setCreateDate(new Date());
            newEntity.setModifyDate(new Date());
            newEntity.setModifier(currentUser.getCode());
            newEntity = redisMqPublisherService.save(newEntity);
            MRedisMqPublisher mRedisMqPublisher = convertToModel(newEntity, MRedisMqPublisher.class);
@ -102,14 +110,16 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新消息发布者")
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Save, method = RequestMethod.PUT)
    public Envelop update(
            @ApiParam(value = "消息发布者JSON", required = true)
            @RequestBody String entityJson) {
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Update, method = RequestMethod.POST)
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisMqPublisher updateEntity = objectMapper.readValue(entityJson, RedisMqPublisher.class);
            RedisMqPublisher updateEntity = objectMapper.readValue(data, RedisMqPublisher.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisMqPublisherService.save(updateEntity);
            MRedisMqPublisher mRedisMqPublisher = convertToModel(updateEntity, MRedisMqPublisher.class);
@ -124,6 +134,7 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除消息发布者")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "消息发布者ID", required = true)
@ -143,10 +154,11 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证指定队列中发布者应用ID是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.IsUniqueAppId, method = RequestMethod.GET)
    public Envelop isUniqueAppId(
            @ApiParam(name = "id", value = "消息订阅者ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channel", value = "消息队列编码", required = true)
            @RequestParam(value = "channel") String channel,
            @ApiParam(name = "appId", value = "发布者应用ID", required = true)

+ 6 - 6
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqSubscriberEndPoint.java

@ -14,6 +14,8 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
@ -25,7 +27,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/13 15:14
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "消息订阅者接口", tags = {"Redis消息发布订阅--消息订阅者接口"})
public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
@ -39,9 +41,7 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取消息订阅者")
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
    public Envelop getById(Model model, Long id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
@ -152,7 +152,7 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.IsUniqueAppId, method = RequestMethod.GET)
    public Envelop isUniqueAppId(
            @ApiParam(name = "id", value = "消息订阅者ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channel", value = "消息队列编码", required = true)
            @RequestParam(value = "channel") String channel,
            @ApiParam(name = "appId", value = "消息订阅者应用ID", required = true)
@ -176,7 +176,7 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.IsUniqueSubscribedUrl, method = RequestMethod.GET)
    public Envelop isUniqueSubscribedUrl(
            @ApiParam(name = "id", value = "消息订阅者ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channel", value = "消息队列编码", required = true)
            @RequestParam(value = "channel") String channel,
            @ApiParam(name = "subscriberUrl", value = "消息订阅者服务地址", required = true)

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisScheduledController.java

@ -24,9 +24,9 @@ import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.*;
@ -39,7 +39,7 @@ import java.util.List;
 * @author ysj
 * @date 2017/12/20
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "定时任务", tags = {"缓存服务管理--定时任务"})
public class RedisScheduledController {

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisSubscribeMessageEndPoint.java

@ -14,10 +14,10 @@ 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.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@ -25,7 +25,7 @@ import java.util.Map;
 * @author 张进军
 * @date 2017/12/4 15:19
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "接收消息队列的消息订阅接口", tags = {"缓存服务管理--接收消息队列的消息订阅接口"})
public class RedisSubscribeMessageEndPoint extends EnvelopRestEndPoint {

+ 0 - 106
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/entity/SystemDict.java

@ -1,106 +0,0 @@
package com.yihu.wlyy.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
/**
 * SystemDict entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "system_dict")
public class SystemDict  implements java.io.Serializable {
	// Fields
	private String dictName;
	private String code;
	private String value;
	private String pyCode;
	private Integer sort;
	private String id;
	// Constructors
	/** default constructor */
	public SystemDict() {
	}
	/** minimal constructor */
	public SystemDict(String dictName, String code, String value) {
		this.dictName = dictName;
		this.code = code;
		this.value = value;
	}
	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 50)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	/** full constructor */
	public SystemDict(String dictName, String code, String value,
			String pyCode, Integer sort) {
		this.dictName = dictName;
		this.code = code;
		this.value = value;
		this.pyCode = pyCode;
		this.sort = sort;
	}
	@Column(name = "dict_name", nullable = false, length = 50)
	public String getDictName() {
		return this.dictName;
	}
	public void setDictName(String dictName) {
		this.dictName = dictName;
	}
	@Column(name = "code", nullable = false, length = 50)
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	@Column(name = "value", nullable = false, length = 50)
	public String getValue() {
		return this.value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	@Column(name = "py_code", length = 50)
	public String getPyCode() {
		return this.pyCode;
	}
	public void setPyCode(String pyCode) {
		this.pyCode = pyCode;
	}
	@Column(name = "sort")
	public Integer getSort() {
		return this.sort;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
}

+ 0 - 152
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/entity/SystemDictList.java

@ -1,152 +0,0 @@
package com.yihu.wlyy.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
/**
 * SystemDictList entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "system_dict_list")
public class SystemDictList   implements java.io.Serializable {
	// Fields
	private String dictName;
	private String chineseName;
	private String pyCode;
	private String pid;
	private String remark;
	private String relationTable;
	private String relationColCode;
	private String relationColValue;
	private String relationColExtend;
	private String id;
	// Constructors
	/** default constructor */
	public SystemDictList() {
	}
	/** minimal constructor */
	public SystemDictList(String dictName, String chineseName, String pid) {
		this.dictName = dictName;
		this.chineseName = chineseName;
		this.pid = pid;
	}
	/** full constructor */
	public SystemDictList(String dictName, String chineseName, String pyCode,
			String pid, String remark, String relationTable,
			String relationColCode, String relationColValue,
			String relationColExtend) {
		this.dictName = dictName;
		this.chineseName = chineseName;
		this.pyCode = pyCode;
		this.pid = pid;
		this.remark = remark;
		this.relationTable = relationTable;
		this.relationColCode = relationColCode;
		this.relationColValue = relationColValue;
		this.relationColExtend = relationColExtend;
	}
	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 50)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	@Column(name = "dict_name", nullable = false, length = 50)
	public String getDictName() {
		return this.dictName;
	}
	public void setDictName(String dictName) {
		this.dictName = dictName;
	}
	@Column(name = "chinese_name", nullable = false, length = 50)
	public String getChineseName() {
		return this.chineseName;
	}
	public void setChineseName(String chineseName) {
		this.chineseName = chineseName;
	}
	@Column(name = "py_code", length = 50)
	public String getPyCode() {
		return this.pyCode;
	}
	public void setPyCode(String pyCode) {
		this.pyCode = pyCode;
	}
	@Column(name = "pid", nullable = false, length = 50)
	public String getPid() {
		return this.pid;
	}
	public void setPid(String pid) {
		this.pid = pid;
	}
	@Column(name = "remark", length = 200)
	public String getRemark() {
		return this.remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	@Column(name = "relation_table", length = 50)
	public String getRelationTable() {
		return this.relationTable;
	}
	public void setRelationTable(String relationTable) {
		this.relationTable = relationTable;
	}
	@Column(name = "relation_col_code", length = 50)
	public String getRelationColCode() {
		return this.relationColCode;
	}
	public void setRelationColCode(String relationColCode) {
		this.relationColCode = relationColCode;
	}
	@Column(name = "relation_col_value", length = 50)
	public String getRelationColValue() {
		return this.relationColValue;
	}
	public void setRelationColValue(String relationColValue) {
		this.relationColValue = relationColValue;
	}
	@Column(name = "relation_col_extend", length = 50)
	public String getRelationColExtend() {
		return this.relationColExtend;
	}
	public void setRelationColExtend(String relationColExtend) {
		this.relationColExtend = relationColExtend;
	}
}

+ 3 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/listener/ApplicationReadyEventListener.java

@ -9,7 +9,8 @@ import com.yihu.wlyy.service.redis.MessageCommonBiz;
import com.yihu.wlyy.service.redis.pubsub.RedisMqChannelService;
import com.yihu.wlyy.service.redis.pubsub.RedisMqMessageLogService;
import com.yihu.wlyy.service.redis.pubsub.RedisMqSubscriberService;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
@ -33,7 +34,7 @@ import java.util.Map;
@Component
public class ApplicationReadyEventListener implements ApplicationListener<ApplicationReadyEvent> {
    Logger logger = Logger.getLogger(ApplicationReadyEventListener.class);
    Logger logger = LoggerFactory.getLogger(ApplicationReadyEventListener.class);
    @Autowired
    RedisMessageListenerContainer redisMessageListenerContainer;
    @Autowired

+ 0 - 22
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/SystemDictDao.java

@ -1,22 +0,0 @@
package com.yihu.wlyy.repository;
import com.yihu.wlyy.entity.SystemDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Administrator on 2016/8/13.
 */
public interface SystemDictDao extends PagingAndSortingRepository<SystemDict, Long>, JpaSpecificationExecutor<SystemDict> {
    @Query("from SystemDict s where s.dictName=?1 order by sort asc ")
    List<SystemDict> findByDictName(String name);
    List<SystemDict> findByDictNameAndCode(String name,String code);
    @Query("select s.value from SystemDict s where s.dictName=?1 and s.code =?2")
    String findByDictNameAndCode2(String dictName, String code);
}

+ 0 - 12
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/SystemDictListDao.java

@ -1,12 +0,0 @@
package com.yihu.wlyy.repository;
import com.yihu.wlyy.entity.SystemDictList;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Administrator on 2016/8/13.
 */
public interface SystemDictListDao extends PagingAndSortingRepository<SystemDictList, Long>, JpaSpecificationExecutor<SystemDictList> {
}

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheAuthorizationDao.java

@ -11,11 +11,11 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
public interface RedisCacheAuthorizationDao extends PagingAndSortingRepository<RedisCacheAuthorization, Integer> {
public interface RedisCacheAuthorizationDao extends PagingAndSortingRepository<RedisCacheAuthorization, Long> {
    RedisCacheAuthorization findByCategoryCodeAndAppId(@Param("categoryCode") String categoryCode, @Param("appId") String appId);
    @Query(" FROM RedisCacheAuthorization a WHERE a.id <> :id AND a.categoryCode = :categoryCode AND a.appId = :appId ")
    RedisCacheAuthorization isUniqueAppId(@Param("id") Integer id, @Param("categoryCode") String categoryCode, @Param("appId") String appId);
    RedisCacheAuthorization isUniqueAppId(@Param("id") Long id, @Param("categoryCode") String categoryCode, @Param("appId") String appId);
}

+ 7 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheCategoryDao.java

@ -1,6 +1,8 @@
package com.yihu.wlyy.repository.redis;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisCacheCategory;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
@ -11,12 +13,14 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
public interface RedisCacheCategoryDao extends PagingAndSortingRepository<RedisCacheCategory, Integer> {
public interface RedisCacheCategoryDao extends PagingAndSortingRepository<RedisCacheCategory, Long> , JpaSpecificationExecutor<RedisCacheCategory> {
    RedisCacheCategory findById(Long id);
    @Query(" FROM RedisCacheCategory a WHERE a.id <> :id AND a.name = :name ")
    RedisCacheCategory isUniqueName(@Param("id") Integer id, @Param("name") String name);
    RedisCacheCategory isUniqueName(@Param("id") Long id, @Param("name") String name);
    @Query(" FROM RedisCacheCategory a WHERE a.id <> :id AND a.code = :code ")
    RedisCacheCategory isUniqueCode(@Param("id") Integer id, @Param("code") String code);
    RedisCacheCategory isUniqueCode(@Param("id") Long id, @Param("code") String code);
}

+ 1 - 1
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheKeyMemoryDao.java

@ -11,7 +11,7 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/12/6 14:58
 */
public interface RedisCacheKeyMemoryDao extends JpaRepository<RedisCacheKeyMemory, Integer> {
public interface RedisCacheKeyMemoryDao extends JpaRepository<RedisCacheKeyMemory, Long> {
    RedisCacheKeyMemory findByCacheKey(@Param("cacheKey") String cacheKey);

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheKeyRuleDao.java

@ -11,14 +11,14 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
public interface RedisCacheKeyRuleDao extends PagingAndSortingRepository<RedisCacheKeyRule, Integer> {
public interface RedisCacheKeyRuleDao extends PagingAndSortingRepository<RedisCacheKeyRule, Long> {
    RedisCacheKeyRule findByCode(@Param("code") String code);
    @Query(" FROM RedisCacheKeyRule a WHERE a.id <> :id AND a.name = :name ")
    RedisCacheKeyRule isUniqueName(@Param("id") Integer id, @Param("name") String name);
    RedisCacheKeyRule isUniqueName(@Param("id") Long id, @Param("name") String name);
    @Query(" FROM RedisCacheKeyRule a WHERE a.id <> :id AND a.code = :code ")
    RedisCacheKeyRule isUniqueCode(@Param("id") Integer id, @Param("code") String code);
    RedisCacheKeyRule isUniqueCode(@Param("id") Long id, @Param("code") String code);
}

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqChannelDao.java

@ -11,14 +11,14 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/11/10 11:45
 */
public interface RedisMqChannelDao extends PagingAndSortingRepository<RedisMqChannel, Integer> {
public interface RedisMqChannelDao extends PagingAndSortingRepository<RedisMqChannel, Long> {
    RedisMqChannel findByChannel(@Param("channel") String channel);
    @Query(" FROM RedisMqChannel rmc WHERE rmc.id <> :id AND rmc.channel = :channel ")
    RedisMqChannel isUniqueChannel(@Param("id") Integer id, @Param("channel") String channel);
    RedisMqChannel isUniqueChannel(@Param("id") Long id, @Param("channel") String channel);
    @Query(" FROM RedisMqChannel rmc WHERE rmc.id <> :id AND rmc.channelName = :channelName ")
    RedisMqChannel isUniqueChannelName(@Param("id") Integer id, @Param("channelName") String channelName);
    RedisMqChannel isUniqueChannelName(@Param("id") Long id, @Param("channelName") String channelName);
}

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqPublisherDao.java

@ -13,13 +13,13 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/20 09:35
 */
public interface RedisMqPublisherDao extends PagingAndSortingRepository<RedisMqPublisher, Integer> {
public interface RedisMqPublisherDao extends PagingAndSortingRepository<RedisMqPublisher, Long> {
    List<RedisMqPublisher> findByChannel(@Param("channel") String channel);
    RedisMqPublisher findByChannelAndAppId(@Param("channel") String channel, @Param("appId") String appId);
    @Query(" FROM RedisMqPublisher rmp WHERE rmp.id <> :id AND rmp.channel = :channel AND rmp.appId = :appId ")
    RedisMqPublisher isUniqueAppId(@Param("id") Integer id, @Param("channel") String channel, @Param("appId") String appId);
    RedisMqPublisher isUniqueAppId(@Param("id") Long id, @Param("channel") String channel, @Param("appId") String appId);
}

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqSubscriberDao.java

@ -13,14 +13,14 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/10 11:45
 */
public interface RedisMqSubscriberDao extends PagingAndSortingRepository<RedisMqSubscriber, Integer> {
public interface RedisMqSubscriberDao extends PagingAndSortingRepository<RedisMqSubscriber, Long> {
    List<RedisMqSubscriber> findByChannel(@Param("channel") String channel);
    @Query(" FROM RedisMqSubscriber rms WHERE rms.id <> :id AND rms.channel = :channel AND rms.appId = :appId ")
    RedisMqSubscriber isUniqueAppId(@Param("id") Integer id, @Param("channel") String channel, @Param("appId") String appId);
    RedisMqSubscriber isUniqueAppId(@Param("id") Long id, @Param("channel") String channel, @Param("appId") String appId);
    @Query(" FROM RedisMqSubscriber rms WHERE rms.id <> :id AND rms.channel = :channel AND rms.subscribedUrl = :subscribedUrl ")
    RedisMqSubscriber isUniqueSubscribedUrl(@Param("id") Integer id, @Param("channel") String channel, @Param("subscribedUrl") String subscribedUrl);
    RedisMqSubscriber isUniqueSubscribedUrl(@Param("id") Long id, @Param("channel") String channel, @Param("subscribedUrl") String subscribedUrl);
}

+ 0 - 45
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/manager/dict/SystemDictService.java

@ -1,45 +0,0 @@
package com.yihu.wlyy.service.manager.dict;
import com.yihu.wlyy.entity.SystemDict;
import com.yihu.wlyy.repository.SystemDictDao;
import com.yihu.wlyy.util.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * Created by Administrator on 2017/1/24.
 */
@Service
public class SystemDictService extends BaseJpaService<SystemDict, SystemDictDao> {
    @Autowired
    SystemDictDao systemDictDao;
    private String dictName = "SYSTEM_PARAMS";
    public List<SystemDict> getByDictName(String name){
        return systemDictDao.findByDictName(name);
    }
    /**
     * http_log是否记录成功消息
     *
     * @return
     */
    public Boolean getSaveSuccessLog() {
        try {
            String re = systemDictDao.findByDictNameAndCode2(dictName, "SAVE_SUCCESS_LOG");
            if ("1".equals(re)) {
                return true;
            } else {
                return false;
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }
    }
}

+ 3 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/DefaultMessageDelegate.java

@ -5,7 +5,8 @@ import com.yihu.wlyy.entity.redis.RedisMqMessageLog;
import com.yihu.wlyy.entity.redis.RedisMqSubscriber;
import com.yihu.wlyy.service.redis.pubsub.RedisMqMessageLogService;
import com.yihu.wlyy.service.redis.pubsub.RedisMqSubscriberService;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@ -24,7 +25,7 @@ import java.util.Map;
 */
public class DefaultMessageDelegate implements MessageDelegate {
    Logger logger = Logger.getLogger(DefaultMessageDelegate.class);
    Logger logger = LoggerFactory.getLogger(DefaultMessageDelegate.class);
    private RestTemplate restTemplate = new RestTemplate();

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheAuthorizationService.java

@ -21,7 +21,7 @@ public class RedisCacheAuthorizationService extends BaseJpaService<RedisCacheAut
    @Autowired
    RedisCacheAuthorizationDao redisCacheAuthorizationDao;
    
    public RedisCacheAuthorization getById(Integer id) {
    public RedisCacheAuthorization getById(Long id) {
        return redisCacheAuthorizationDao.findOne(id);
    }
@ -35,11 +35,11 @@ public class RedisCacheAuthorizationService extends BaseJpaService<RedisCacheAut
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisCacheAuthorizationDao.delete(id);
    }
    public Boolean isUniqueAppId(Integer id, String categoryCode, String appId) {
    public Boolean isUniqueAppId(Long id, String categoryCode, String appId) {
        RedisCacheAuthorization redisCacheAuthorization = redisCacheAuthorizationDao.isUniqueAppId(id, categoryCode, appId);
        if (redisCacheAuthorization == null) {
            return true;

+ 5 - 4
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheCategoryService.java

@ -20,8 +20,9 @@ public class RedisCacheCategoryService extends BaseJpaService<RedisCacheCategory
    @Autowired
    RedisCacheCategoryDao redisCacheCategoryDao;
    
    public RedisCacheCategory getById(Integer id) {
    public RedisCacheCategory getById(Long id) {
        return redisCacheCategoryDao.findOne(id);
    }
@ -31,11 +32,11 @@ public class RedisCacheCategoryService extends BaseJpaService<RedisCacheCategory
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisCacheCategoryDao.delete(id);
    }
    public Boolean isUniqueName(Integer id, String name) {
    public Boolean isUniqueName(Long id, String name) {
        RedisCacheCategory redisCacheCategory = redisCacheCategoryDao.isUniqueName(id, name);
        if (redisCacheCategory == null) {
            return true;
@ -44,7 +45,7 @@ public class RedisCacheCategoryService extends BaseJpaService<RedisCacheCategory
        }
    }
    public Boolean isUniqueCode(Integer id, String code) {
    public Boolean isUniqueCode(Long id, String code) {
        RedisCacheCategory redisCacheCategory = redisCacheCategoryDao.isUniqueCode(id, code);
        if (redisCacheCategory == null) {
            return true;

+ 1 - 1
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheKeyMemoryService.java

@ -76,7 +76,7 @@ public class RedisCacheKeyMemoryService extends BaseJpaService<RedisCacheKeyMemo
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisCacheKeyMemoryDao.delete(id);
    }

+ 4 - 4
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheKeyRuleService.java

@ -21,7 +21,7 @@ public class RedisCacheKeyRuleService extends BaseJpaService<RedisCacheKeyRule,
    @Autowired
    RedisCacheKeyRuleDao redisCacheKeyRuleDao;
    
    public RedisCacheKeyRule getById(Integer id) {
    public RedisCacheKeyRule getById(Long id) {
        return redisCacheKeyRuleDao.findOne(id);
    }
@ -35,11 +35,11 @@ public class RedisCacheKeyRuleService extends BaseJpaService<RedisCacheKeyRule,
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisCacheKeyRuleDao.delete(id);
    }
    public Boolean isUniqueName(Integer id, String name) {
    public Boolean isUniqueName(Long id, String name) {
        RedisCacheKeyRule redisCacheKeyRule = redisCacheKeyRuleDao.isUniqueName(id, name);
        if (redisCacheKeyRule == null) {
            return true;
@ -48,7 +48,7 @@ public class RedisCacheKeyRuleService extends BaseJpaService<RedisCacheKeyRule,
        }
    }
    public Boolean isUniqueCode(Integer id, String code) {
    public Boolean isUniqueCode(Long id, String code) {
        RedisCacheKeyRule redisCacheKeyRule = redisCacheKeyRuleDao.isUniqueCode(id, code);
        if (redisCacheKeyRule == null) {
            return true;

+ 4 - 4
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqChannelService.java

@ -40,7 +40,7 @@ public class RedisMqChannelService extends BaseJpaService<RedisMqChannel, RedisM
    @Autowired
    ObjectMapper objectMapper;
    public RedisMqChannel getById(Integer id) {
    public RedisMqChannel getById(Long id) {
        return redisMqChannelDao.findOne(id);
    }
@ -54,11 +54,11 @@ public class RedisMqChannelService extends BaseJpaService<RedisMqChannel, RedisM
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisMqChannelDao.delete(id);
    }
    public Boolean isUniqueChannel(Integer id, String channel) {
    public Boolean isUniqueChannel(Long id, String channel) {
        RedisMqChannel redisMqChannel = redisMqChannelDao.isUniqueChannel(id, channel);
        if (redisMqChannel == null) {
            return true;
@ -67,7 +67,7 @@ public class RedisMqChannelService extends BaseJpaService<RedisMqChannel, RedisM
        }
    }
    public Boolean isUniqueChannelName(Integer id, String channelName) {
    public Boolean isUniqueChannelName(Long id, String channelName) {
        RedisMqChannel redisMqChannel = redisMqChannelDao.isUniqueChannelName(id, channelName);
        if (redisMqChannel == null) {
            return true;

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqPublisherService.java

@ -23,7 +23,7 @@ public class RedisMqPublisherService extends BaseJpaService<RedisMqPublisher, Re
    @Autowired
    RedisMqPublisherDao redisMqPublisherDao;
    public RedisMqPublisher getById(Integer id) {
    public RedisMqPublisher getById(Long id) {
        return redisMqPublisherDao.findOne(id);
    }
@ -41,11 +41,11 @@ public class RedisMqPublisherService extends BaseJpaService<RedisMqPublisher, Re
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisMqPublisherDao.delete(id);
    }
    public Boolean isUniqueAppId(Integer id, String channel, String appId) {
    public Boolean isUniqueAppId(Long id, String channel, String appId) {
        RedisMqPublisher redisMqPublisher = redisMqPublisherDao.isUniqueAppId(id, channel, appId);
        if (redisMqPublisher == null) {
            return true;

+ 4 - 4
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqSubscriberService.java

@ -23,7 +23,7 @@ public class RedisMqSubscriberService extends BaseJpaService<RedisMqSubscriber,
    @Autowired
    RedisMqSubscriberDao redisMqSubscriberDao;
    public RedisMqSubscriber getById(Integer id) {
    public RedisMqSubscriber getById(Long id) {
        return redisMqSubscriberDao.findOne(id);
    }
@ -37,11 +37,11 @@ public class RedisMqSubscriberService extends BaseJpaService<RedisMqSubscriber,
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisMqSubscriberDao.delete(id);
    }
    public Boolean isUniqueAppId(Integer id, String channel, String appId) {
    public Boolean isUniqueAppId(Long id, String channel, String appId) {
        RedisMqSubscriber redisMqSubscriber = redisMqSubscriberDao.isUniqueAppId(id, channel, appId);
        if (redisMqSubscriber == null) {
            return true;
@ -50,7 +50,7 @@ public class RedisMqSubscriberService extends BaseJpaService<RedisMqSubscriber,
        }
    }
    public Boolean isUniqueSubscribedUrl(Integer id, String channel, String subscriberUrl) {
    public Boolean isUniqueSubscribedUrl(Long id, String channel, String subscriberUrl) {
        RedisMqSubscriber redisMqSubscriber = redisMqSubscriberDao.isUniqueSubscribedUrl(id, channel, subscriberUrl);
        if (redisMqSubscriber == null) {
            return true;

+ 6 - 7
patient-co-manage/redis-cache/src/main/resources/application.yml

@ -1,7 +1,6 @@
server:
  port: 8180
  context-path: /redis
  session-timeout: 3000000
  port: 8083
#  context-path: /redis
spring:
  datasource:
@ -24,7 +23,7 @@ spring:
    # REDIS
  redis:
    database: 0 # Database index used by the connection factory.
    password: # Login password of the redis server.
#    password: # Login password of the redis server.
    timeout: 120000 # 连接超时时间(毫秒) 60秒
    pool:
      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
@ -44,9 +43,9 @@ spring:
      password: 123456
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
    host: 172.19.103.47 # Redis server host.
    port: 6379
    password: redis!@456
fast-dfs:
  tracker-server: 172.19.103.13:22122

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/detailJs.jsp

@ -38,17 +38,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/cache/authorization/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/cache/authorization/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -64,7 +68,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/listJs.jsp

@ -65,9 +65,7 @@
                urlParms: {
                    id: id,
                    categoryCode: categoryCode
                },
                opener: true,
                load: true
                }
            });
        });

+ 1 - 1
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/detail.jsp

@ -22,7 +22,7 @@
    <div class="m-form-group">
        <label>缓存分类编码:</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text" class="f-w240 max-length-30 required ajax validate-alpha-underline"
            <input type="text" class="f-w240 max-length-30"
                   id="code" data-attr-scan="code">
        </div>
    </div>

+ 85 - 78
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/detailJs.jsp

@ -2,96 +2,103 @@
<script>
    var detailModel = ${detailModel};
    var dataModel = $.DataModel.init();
    var validator;
    var $form = $("#redisCacheCategoryForm");
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        validator = customFormValidator();
        initForm();
        bindEvents();
    }
        var detailModel = ${detailModel};
        var dataModel = $.DataModel.init();
        var validator;
        var $form = $("#redisCacheCategoryForm");
    function initForm() {
        var codeTb = $('#code').ligerTextBox({width: 240});
        $('#name').ligerTextBox({width: 240});
        $('#remark').ligerTextBox({width: 240, height: 150});
        $(function () {
            init();
        });
        if(detailModel.id) {
            codeTb.setDisabled(true);
            codeTb.setReadonly(true);
        function init() {
            validator = customFormValidator();
            initForm();
            bindEvents();
        }
        $form.attrScan();
        $form.Fields.fillValues(detailModel);
    }
        function initForm() {
            var codeTb = $('#code').ligerTextBox({width: 240});
            $('#name').ligerTextBox({width: 240});
            $('#remark').ligerTextBox({width: 240, height: 150});
    function bindEvents() {
        // 保存
        $('#btnSave').click(function () {
            if (!validator.validate()) { return; }
            if(detailModel.id) {
                codeTb.setDisabled(true);
                codeTb.setReadonly(true);
            }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/cache/category/save", {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
            $form.attrScan();
            $form.Fields.fillValues(detailModel);
        }
        function bindEvents() {
            // 保存
            $('#btnSave').click(function () {
                if (!validator.validate()) { return; }
                var loading = $.ligerDialog.waitting("正在保存数据...");
                var uri = "save";
                if(detailModel.id!=null&&detailModel.id!=-1){
                    uri = "update"
                }
                dataModel.fetchRemote("${contextRoot}/redis/cache/category/"+uri, {
                    type: 'post',
                    data: {data: JSON.stringify($form.Fields.getValues())},
                    success: function (data) {
                        if (data.successFlg) {
                            if (detailModel.id) {
                                parent.closeDetailDialog('新增成功');
                            } else {
                                parent.closeDetailDialog('修改成功');
                            }
                            parent.reloadMasterGrid();
                        } else {
                            window.closeDetailDialog('修改成功');
                            $.Notice.error(data.errorMsg);
                        }
                        window.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    },
                    error: function () {
                        $.Notice.error('保存发生异常');
                    },
                    complete: function () {
                        loading.close();
                    }
                },
                error: function () {
                    $.Notice.error('保存发生异常');
                },
                complete: function () {
                    loading.close();
                }
                });
            });
        });
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
        })
    }
            // 关闭
            $('#btnClose').click(function () {
                parent.closeDetailDialog();
            })
        }
    // 表单验证对象
    function customFormValidator() {
        return new $.jValidation.Validation($form, {
            immediate: true,
            onElementValidateForAjax: function (el) {
                var id = detailModel.id || -1; // 新增时传-1。
                var elId = $(el).attr("id");
                switch(elId) {
                    case 'code':
                        var code = $("#code").val();
                        if(!$.Util.isStrEquals(code, detailModel.code)) {
                            var ulr = "${contextRoot}/redis/cache/category/isUniqueCode";
                            return $.Util.validateByAjax(ulr, {id: id, code: code});
                        }
                        break;
                    case 'name':
                        var name = $("#name").val();
                        if(!$.Util.isStrEquals(name, detailModel.name)) {
                            var ulr = "${contextRoot}/redis/cache/category/isUniqueName";
                            return $.Util.validateByAjax(ulr, {id: id, name: name});
                        }
                        break;
        // 表单验证对象
        function customFormValidator() {
            return new $.jValidation.Validation($form, {
                immediate: true,
                onElementValidateForAjax: function (el) {
                    var id = detailModel.id || -1; // 新增时传-1。
                    var elId = $(el).attr("id");
                    switch(elId) {
                        case 'code':
                            var code = $("#code").val();
                            if(!$.Util.isStrEquals(code, detailModel.code)) {
                                var ulr = "${contextRoot}/redis/cache/category/isUniqueCode";
                                return $.Util.validateByAjax(ulr, {id: id, code: code});
                            }
                            break;
                        case 'name':
                            var name = $("#name").val();
                            if(!$.Util.isStrEquals(name, detailModel.name)) {
                                var ulr = "${contextRoot}/redis/cache/category/isUniqueName";
                                return $.Util.validateByAjax(ulr, {id: id, name: name});
                            }
                            break;
                    }
                }
            }
        });
    }
            });
        }
    });
})(jQuery, window)
</script>

+ 105 - 103
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/listJs.jsp

@ -2,118 +2,120 @@
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script>
    var dataModel = $.DataModel.init();
    var detailDialog = null;
    var grid = null;
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        initWidget();
        bindEvents();
    }
        var dataModel = $.DataModel.init();
        var detailDialog = null;
        var grid = null;
    function initWidget() {
        $('#searchContent').ligerTextBox({
            width: 200, isSearch: true, search: function () {
                reloadGrid();
            }
        $(function () {
            init();
        });
        grid = $("#grid").ligerGrid($.LigerGridEx.config({
            url: ctx + '/redis/cache/category/search',
            columns: [
                {display: 'ID', name: 'id', hide: true},
                {display: '缓存分类名称', name: 'name', width: '20%', isAllowHide: false, align: 'left'},
                {display: '缓存分类编码', name: 'code', width: '20%', isAllowHide: false, align: 'left'},
                {display: '修改时间', name: 'modifyDate', width: '15%', isAllowHide: false, align: 'left'},
                {display: '备注', name: 'remark', width: '30%', isAllowHide: false, align: 'left'},
                {display: '操作', name: 'operator', width: '15%', minWidth: 120, align: 'center',
                    render: function (row) {
                        var html = '';
                        html += '<sec:authorize url="/redis/cache/category/authorizationList"><a class="label_a f-ml10" title="应用授权" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:category:authorizationList", row.code) + '">应用授权</a></sec:authorize>';
                        html += '<sec:authorize url="/redis/cache/category/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:cache:category:detail", row.id, 'modify') + '"></a></sec:authorize>';
                        html += '<sec:authorize url="/redis/cache/category/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:category:delete", row.id) + '"></a></sec:authorize>';
                        return html;
                    }
                }
            ],
            method:'GET',
            allowHideColumn: false,
            usePager: true
        }));
        grid.collapseAll();
        grid.adjustToWidth();
    }
    function bindEvents() {
        // 应用授权
        $.subscribe('redis:cache:category:authorizationList', function (event, categoryCode) {
            var url = '${contextRoot}/redis/cache/authorization/index?';
            $("#contentPage").empty();
            $("#contentPage").load(url,{categoryCode: categoryCode});
        });
        function init() {
            initWidget();
            bindEvents();
        }
        // 新增/修改
        $.subscribe('redis:cache:category:detail', function (event, id, mode) {
            var title = '新增缓存分类';
            if (mode == 'modify') {
                title = '修改缓存分类';
            }
            detailDialog = $.ligerDialog.open({
                height: 410,
                width: 480,
                title: title,
                url: '${contextRoot}/redis/cache/category/detail',
                urlParms: {
                    id: id,
                    mode: mode
                },
                opener: true,
                load: true
        function initWidget() {
            $('#searchContent').ligerTextBox({
                width: 200, isSearch: true, search: function () {
                    reloadGrid();
                }
            });
        });
        // 删除
        $.subscribe('redis:cache:category:delete', function (event, id) {
            $.Notice.confirm('确认要删除所选数据吗?', function (r) {
                if (r) {
                    var loading = $.ligerDialog.waitting("正在删除数据...");
                    dataModel.updateRemote('${contextRoot}/redis/cache/category/delete', {
                        data: {id: parseInt(id)},
                        success: function (data) {
                            if (data.successFlg) {
                                $.Notice.success('删除成功!');
                                reloadGrid();
                            } else {
                                $.Notice.error(data.errorMsg);
                            }
                        },
                        error: function () {
                            $.Notice.error('删除发生异常');
                        },
                        complete: function () {
                            loading.close();
            grid = $("#grid").ligerGrid($.LigerGridEx.config({
                url: ctx + '/redis/cache/category/search',
                columns: [
                    {display: 'ID', name: 'id', hide: true},
                    {display: '缓存分类名称', name: 'name', width: '20%', isAllowHide: false, align: 'left'},
                    {display: '缓存分类编码', name: 'code', width: '20%', isAllowHide: false, align: 'left'},
                    {display: '修改时间', name: 'modifyDate', width: '15%', isAllowHide: false, align: 'left'},
                    {display: '备注', name: 'remark', width: '30%', isAllowHide: false, align: 'left'},
                    {display: '操作', name: 'operator', width: '15%', minWidth: 120, align: 'center',
                        render: function (row) {
                            var html = '';
                            html += '<sec:authorize url="/redis/cache/category/authorizationList"><a class="label_a f-ml10" title="应用授权" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:category:authorizationList", row.code) + '">应用授权</a></sec:authorize>';
                            html += '<sec:authorize url="/redis/cache/category/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:cache:category:detail", row.id, 'modify') + '"></a></sec:authorize>';
                            html += '<sec:authorize url="/redis/cache/category/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:category:delete", row.id) + '"></a></sec:authorize>';
                            return html;
                        }
                    });
                    }
                ],
                method:'GET',
                allowHideColumn: false,
                usePager: true
            }));
            grid.collapseAll();
            grid.adjustToWidth();
        }
        function bindEvents() {
            // 应用授权
            $.subscribe('redis:cache:category:authorizationList', function (event, categoryCode) {
                var url = '${contextRoot}/redis/cache/authorization/index?';
                $("#contentPage").empty();
                $("#contentPage").load(url,{categoryCode: categoryCode});
            });
            // 新增/修改
            $.subscribe('redis:cache:category:detail', function (event, id, mode) {
                var title = '新增缓存分类';
                if (mode == 'modify') {
                    title = '修改缓存分类';
                }
            })
        });
    }
                detailDialog = $.ligerDialog.open({
                    id:'test',
                    height: 410,
                    width: 480,
                    title: title,
                    url: '${contextRoot}/redis/cache/category/detail',
                    urlParms: {
                        id: id,
                        mode: mode
                    }
                });
            });
    function reloadGrid() {
        var params = {searchContent: $('#searchContent').val()};
        $.Util.reloadGrid.call(grid, '${contextRoot}/redis/cache/category/search', params);
    }
            // 删除
            $.subscribe('redis:cache:category:delete', function (event, id) {
                $.Notice.confirm('确认要删除所选数据吗?', function (r) {
                    if (r) {
                        var loading = $.ligerDialog.waitting("正在删除数据...");
                        dataModel.updateRemote('${contextRoot}/redis/cache/category/delete', {
                            data: {id: parseInt(id)},
                            success: function (data) {
                                if (data.successFlg) {
                                    $.Notice.success('删除成功!');
                                    reloadGrid();
                                } else {
                                    $.Notice.error(data.errorMsg);
                                }
                            },
                            error: function () {
                                $.Notice.error('删除发生异常');
                            },
                            complete: function () {
                                loading.close();
                            }
                        });
                    }
                })
            });
        }
    /*-- 与明细 Dialog 页面间回调的函数 --*/
    window.reloadMasterGrid = function() {
        reloadGrid();
    };
    window.closeDetailDialog = function (type, msg) {
        detailDialog.close();
        msg && $.Notice.success(msg);
    };
        function reloadGrid() {
            var params = {searchContent: $('#searchContent').val()};
            $.Util.reloadGrid.call(grid, '${contextRoot}/redis/cache/category/search', params);
        }
        /*-- 与明细 Dialog 页面间回调的函数 --*/
        win.reloadMasterGrid = function() {
            reloadGrid();
        };
        win.closeDetailDialog = function (type, msg) {
            detailDialog.close();
            msg && $.Notice.success(msg);
        };
    });
})(jQuery, window)
</script>

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/detailJs.jsp

@ -51,17 +51,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/cache/keyRule/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/cache/keyRule/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -77,7 +81,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/listJs.jsp

@ -73,9 +73,7 @@
                url: '${contextRoot}/redis/cache/keyRule/detail',
                urlParms: {
                    id: id
                },
                opener: true,
                load: true
                }
            });
        });

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/detailJs.jsp

@ -38,17 +38,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/mq/channel/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/mq/channel/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -64,7 +68,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/listJs.jsp

@ -82,9 +82,7 @@
                urlParms: {
                    id: id,
                    mode: mode
                },
                opener: true,
                load: true
                }
            });
        });

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/detailJs.jsp

@ -38,17 +38,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/mq/publisher/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/mq/publisher/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -64,7 +68,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/listJs.jsp

@ -65,9 +65,7 @@
                urlParms: {
                    id: id,
                    channel: channel
                },
                opener: true,
                load: true
                }
            });
        });

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/detailJs.jsp

@ -40,17 +40,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/mq/subscriber/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/mq/subscriber/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -66,7 +70,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/listJs.jsp

@ -65,9 +65,7 @@
                urlParms: {
                    id: id,
                    channel: channel
                },
                opener: true,
                load: true
                }
            });
        });

+ 25 - 1
patient-co-manage/redis-cache/src/main/webapp/static/develop/module/util.js

@ -431,8 +431,32 @@
                    this.setOptions({parms: params});
                    this.loadData(true);
                }
            }
            },
            //add by lincl end, 2016-5-10
            validateByAjax: function(url, params,type) { // add by ZhangJinJun 2017-11-28
                var result = new $.jValidation.ajax.Result();
                var dataModel = $.DataModel.init();
                if(!type){
                    type = "GET";
                }
                dataModel.fetchRemote(url, {
                    data: params,
                    type: type,
                    async: false,
                    success: function (data) {
                        if (data.successFlg) {
                            result.setResult(true);
                        } else {
                            result.setResult(false);
                            result.setErrorMsg(data.errorMsg);
                        }
                    },
                    error: function () {
                        $.Notice.error('验证发生异常');
                    }
                });
                return result;
            }
        }
    });
})(jQuery, window);

+ 93 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/DoctorMapping.java

@ -0,0 +1,93 @@
package com.yihu.wlyy.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 机构映射表
 * @author hzp
 */
@Entity
@Table(name = "wlyy_doctor_mapping")
public class DoctorMapping extends IdEntity {
	
	// 基卫医生代码
	private String jwDoctor;
	// 基卫医生名称
	private String jwDoctorName;
	// 基卫医生性别
	private String jwDocotrSex;
	// 基卫医生身份证
	private String jwDocotrIdcard;
	// 基卫医生医院
	private String jwDoctorHospital;
	// 基卫医生医院名称
	private String jwDoctorHospiatlName;
	// 医生代码
	private String doctorCode;
	
	@Column(name="jw_doctor")
	public String getJwDoctor() {
		return jwDoctor;
	}
	
	public void setJwDoctor(String jwDoctor) {
		this.jwDoctor = jwDoctor;
	}
	
	@Column(name="jw_doctor_name")
	public String getJwDoctorName() {
		return jwDoctorName;
	}
	
	public void setJwDoctorName(String jwDoctorName) {
		this.jwDoctorName = jwDoctorName;
	}
	
	@Column(name="jw_doctor_sex")
	public String getJwDocotrSex() {
		return jwDocotrSex;
	}
	
	public void setJwDocotrSex(String jwDocotrSex) {
		this.jwDocotrSex = jwDocotrSex;
	}
	
	@Column(name="jw_doctor_idcard")
	public String getJwDocotrIdcard() {
		return jwDocotrIdcard;
	}
	
	public void setJwDocotrIdcard(String jwDocotrIdcard) {
		this.jwDocotrIdcard = jwDocotrIdcard;
	}
	
	@Column(name="jw_doctor_hospital")
	public String getJwDoctorHospital() {
		return jwDoctorHospital;
	}
	
	public void setJwDoctorHospital(String jwDoctorHospital) {
		this.jwDoctorHospital = jwDoctorHospital;
	}
	
	@Column(name="jw_doctor_hospital_name")
	public String getJwDoctorHospiatlName() {
		return jwDoctorHospiatlName;
	}
	
	public void setJwDoctorHospiatlName(String jwDoctorHospiatlName) {
		this.jwDoctorHospiatlName = jwDoctorHospiatlName;
	}
	
	@Column(name="doctor_code")
	public String getDoctorCode() {
		return doctorCode;
	}
	
	public void setDoctorCode(String doctorCode) {
		this.doctorCode = doctorCode;
	}
}

+ 6 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/Prescription.java

@ -415,6 +415,12 @@ public class Prescription extends IdEntity {
         */
        //-1 审核不通过 , 0 审核中, 10 审核通过/待支付 ,21支付失败  20 配药中/支付成功, 21 等待领药 ,30 配送中 ,100配送成功/已完成
        switch (status) {
            case -5: {
                return "线下取消";
            }
            case -4: {
                return "线下退费";
            }
            case -3: {
                return "支付超时";
            }

+ 219 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionExpressageLog.java

@ -0,0 +1,219 @@
package com.yihu.wlyy.entity.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Administrator on 2017/7/21.
 * 处方配送流程表
 */
@Entity
@Table(name = "wlyy_prescription_expressage_log")
public class PrescriptionExpressageLog extends IdEntity {
	
	private String code;                    //业务code
	private String prescriptionCode;      //处方code  关联表wlyy_prescription code
	private String expressageCode; //配送code 关联wlyy_prescription_expressage code
	private Date createTime;                //创建的时间
	private String remark;//备注
	
	//健管师配送时候填写字段
	//配送人
	private String expressageHospitalName;            // 如果配送方式是健管师那么这个字段存服务站名称,如果是快递配送那么是快递公司名称
	private String expressageHospitalAddress;         // 配送机构地址
	private String expressageHospitalCode;            //配送机构code
	private String expressageUserName;          //配送人名称
	private String expressageUserCode;          //配送人code
	private String expressageUserMobile;        //配送人电话
	private Date   expressageTime;                //开始配送的时间
	//接收人
	private String acceptHospital;// /健管师配送 接收机构
	private String acceptHospitalName;///健管师配送 接收机构名称
	private String acceptUser;///健管师配送 接收人
	private String acceptUserName;///健管师配送 接收名称
	private String acceptUserMobile;///健管师配送 接收人电话
	
	//快递配送填写字段
	private String acceptAddress;//快递配 路由节点发生的城市    健管师配送机构地址
	private Date acceptTime;// 路由节点产生的时间,格式:YYYY-MM-DD HH24:MM:SS,示例:2012-7-30 09:30:00。
	private String opCode;//路由节点操作码
	private String acceptRemark;//路由节点具体描述
	
	@Column(name = "code", unique = true , nullable=false)
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	
	public String getPrescriptionCode() {
		return prescriptionCode;
	}
	
	public void setPrescriptionCode(String prescriptionCode) {
		this.prescriptionCode = prescriptionCode;
	}
	
	
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	public String getExpressageCode() {
		return expressageCode;
	}
	
	public void setExpressageCode(String expressageCode) {
		this.expressageCode = expressageCode;
	}
	
	public String getRemark() {
		return remark;
	}
	
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public String getAcceptAddress() {
		return acceptAddress;
	}
	
	public void setAcceptAddress(String acceptAddress) {
		this.acceptAddress = acceptAddress;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getAcceptTime() {
		return acceptTime;
	}
	
	public void setAcceptTime(Date acceptTime) {
		this.acceptTime = acceptTime;
	}
	
	public String getOpCode() {
		return opCode;
	}
	
	public void setOpCode(String opCode) {
		this.opCode = opCode;
	}
	
	public String getAcceptRemark() {
		return acceptRemark;
	}
	
	public void setAcceptRemark(String acceptRemark) {
		this.acceptRemark = acceptRemark;
	}
	
	public String getAcceptHospital() {
		return acceptHospital;
	}
	
	public void setAcceptHospital(String acceptHospital) {
		this.acceptHospital = acceptHospital;
	}
	
	public String getAcceptHospitalName() {
		return acceptHospitalName;
	}
	
	public void setAcceptHospitalName(String acceptHospitalName) {
		this.acceptHospitalName = acceptHospitalName;
	}
	
	public String getAcceptUser() {
		return acceptUser;
	}
	
	public void setAcceptUser(String acceptUser) {
		this.acceptUser = acceptUser;
	}
	
	public String getAcceptUserName() {
		return acceptUserName;
	}
	
	public void setAcceptUserName(String acceptUserName) {
		this.acceptUserName = acceptUserName;
	}
	
	public String getAcceptUserMobile() {
		return acceptUserMobile;
	}
	
	public void setAcceptUserMobile(String acceptUserMobile) {
		this.acceptUserMobile = acceptUserMobile;
	}
	
	public String getExpressageHospitalName() {
		return expressageHospitalName;
	}
	
	public void setExpressageHospitalName(String expressageHospitalName) {
		this.expressageHospitalName = expressageHospitalName;
	}
	
	public String getExpressageHospitalAddress() {
		return expressageHospitalAddress;
	}
	
	public void setExpressageHospitalAddress(String expressageHospitalAddress) {
		this.expressageHospitalAddress = expressageHospitalAddress;
	}
	
	public String getExpressageHospitalCode() {
		return expressageHospitalCode;
	}
	
	public void setExpressageHospitalCode(String expressageHospitalCode) {
		this.expressageHospitalCode = expressageHospitalCode;
	}
	
	public String getExpressageUserName() {
		return expressageUserName;
	}
	
	public void setExpressageUserName(String expressageUserName) {
		this.expressageUserName = expressageUserName;
	}
	
	public String getExpressageUserCode() {
		return expressageUserCode;
	}
	
	public void setExpressageUserCode(String expressageUserCode) {
		this.expressageUserCode = expressageUserCode;
	}
	
	public String getExpressageUserMobile() {
		return expressageUserMobile;
	}
	
	public void setExpressageUserMobile(String expressageUserMobile) {
		this.expressageUserMobile = expressageUserMobile;
	}
	
	public Date getExpressageTime() {
		return expressageTime;
	}
	
	public void setExpressageTime(Date expressageTime) {
		this.expressageTime = expressageTime;
	}
}

+ 258 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionLog.java

@ -0,0 +1,258 @@
package com.yihu.wlyy.entity.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
/**
 * Created by Administrator on 2017/7/21.
 * 处方日志
 */
@Entity
@Table(name = "wlyy_prescription_log")
public class PrescriptionLog extends IdEntity {
	
	
	public enum PrescriptionLogType {
		zy("智业对接", 1),
		ylz("易联众对接", 2),
		create("创建处方", 3),
		reviewed("审核", 4),
		pay("支付", 5),
		expressage("配送", 6),
		finish("已完成", 7),
		sf("顺丰对接", 8);
		private String name;
		private int value;
		
		PrescriptionLogType(String name, int value) {
			this.name = name;
			this.value = value;
		}
		
		public String getName() {
			return name;
		}
		
		public void setName(String name) {
			this.name = name;
		}
		
		public int getValue() {
			return value;
		}
		
		public void setValue(int value) {
			this.value = value;
		}
	}
	
	//状态枚举
	public enum PrescriptionLogStatus {
		
		pay_cancle("线下取消", -5),
		
		pay_refund("线下退费", -4),
		//续方取消
		pay_outtime("支付超时", -3),
		patient_canel("患者自己取消", -2),
		
		// 审核不通过
		no_reviewed("审核不通过", -1),
		
		//审核中
		revieweding("待审核", 0),
		changeing("调整中", 2),
		change_success("调整成功", 3),
		change_error("调整失败", 4),
		reviewed_success(" 医生审核(CA)通过", 10),
		
		//药师审核中
		Pharmacist_examination("药师审核中", 20),
		Pharmacist_examination_error("药师审核失败", 21),
		
		//开方中/药师审核成功
		adding("开方中/药师审核成功", 30),
		add_error("开方失败", 31),
		
		//待支付
		wait_pay("开方完成/待支付", 40),
		pay_error("支付失败", 41),
		
		//配药中
		pay_success("支付成功/待配药", 50),
		
		//等待领药
		wait_expressage("配药成功/待配送", 60),
		
		//配送中
		expressageing_error("配送失败", 61),
		expressageJGS("分配健管师", 62),
		expressageing("配送中", 65),
		expressage2hospital("配送到服务站", 69),
		
		//已完成
		finish("配送到患者手中/已完成", 100);
		
		private String name;
		private int value;
		
		PrescriptionLogStatus(String name, int value) {
			this.name = name;
			this.value = value;
		}
		
		public String getName() {
			return name;
		}
		
		public void setName(String name) {
			this.name = name;
		}
		
		public int getValue() {
			return value;
		}
		
		public void setValue(int value) {
			this.value = value;
		}
	}
	
	private String code;                    //业务流程
	private String prescriptionCode;      //处方code 关联表wlyy_prescription code
	private Date createTime;               //处方创建时间
	private Integer status;                 //状态 (-4线下退费 -3 支付过期 -2 患者自己取消 )续方取消,-1 审核不通过 ,
	// (0 待审核, 2调整中,3调整成功, 4调整失败 ,10 医生审核(CA)通过)审核中,
	// 20药师审核中,21.药师审核失败,30 开方中/药师审核成功,31.开方失败/预结算失败,
	// (40开方完成/待支付 ,41 支付失败 )待支付,  50 支付成功/待配药,(60配药成功/待配送)等待领药,
	// (61配送失败62分配健管师 65配送中,69配送到服务站)配送中,(100配送到患者手中/已完成)已完成',
	
	private Integer type;                   //类型: 1智业对接 2易联众对接  3创建处方 4 审核  5付款 6 配送 7完成
	private String userCode;                  //医生或者患者code
	private String userName;                  //医生或者患者name
	private Integer userType;                 //1 患者 2医生
	private Integer flag;                      //操作是否成功 1成功 0失败
	private String remark;                     //备注信息
	private String hospital;                //医院code
	private String hospitalName;            //医院名称
	
	private String statusName;  //状态名称
	
	@Column(name = "code")
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	
	@Column(name = "prescription_code")
	public String getPrescriptionCode() {
		return prescriptionCode;
	}
	
	public void setPrescriptionCode(String prescriptionCode) {
		this.prescriptionCode = prescriptionCode;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	@Column(name = "create_time")
	public Date getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@Column(name = "type")
	public Integer getType() {
		return type;
	}
	
	public void setType(Integer type) {
		this.type = type;
	}
	
	@Column(name = "user_code")
	public String getUserCode() {
		return userCode;
	}
	
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	
	@Column(name = "user_name")
	public String getUserName() {
		return userName;
	}
	
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	@Column(name = "user_type")
	public Integer getUserType() {
		return userType;
	}
	
	public void setUserType(Integer userType) {
		this.userType = userType;
	}
	
	@Column(name = "flag")
	public Integer getFlag() {
		return flag;
	}
	
	public void setFlag(Integer flag) {
		this.flag = flag;
	}
	
	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}
	
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public Integer getStatus() {
		return status;
	}
	
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	public String getHospital() {
		return hospital;
	}
	
	public void setHospital(String hospital) {
		this.hospital = hospital;
	}
	
	public String getHospitalName() {
		return hospitalName;
	}
	
	public void setHospitalName(String hospitalName) {
		this.hospitalName = hospitalName;
	}
	
	
	@Transient
	public String getStatusName() {
		return Prescription.getStatusName(this.status, hospitalName, userName);
	}
}

+ 25 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionExpressageLogDao.java

@ -0,0 +1,25 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.prescription.PrescriptionExpressageLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @author huangwenjie
 * @date 2017/12/22 10:39
 */
public interface PrescriptionExpressageLogDao extends
		PagingAndSortingRepository<PrescriptionExpressageLog, Long>,
		JpaSpecificationExecutor<PrescriptionExpressageLog> {
	
	/**
	 * 根据处方号获取该处方的物流配送日志,按路由节点发生的时间倒序排序
	 * @param prescriptionCode
	 * @return
	 */
	@Query("from PrescriptionExpressageLog p where p.prescriptionCode=?1 order by p.acceptTime desc")
	List<PrescriptionExpressageLog> findByPrescriptionCode(String prescriptionCode);
}

+ 20 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionLogDao.java

@ -0,0 +1,20 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.prescription.PrescriptionLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by chenweida on 2017/7/27.
 */
public interface PrescriptionLogDao extends PagingAndSortingRepository<PrescriptionLog, Long>, JpaSpecificationExecutor<PrescriptionLog> {
	
	@Query(" from PrescriptionLog l where l.prescriptionCode=?1 and l.status in ?2 order by createTime desc")
	List<PrescriptionLog> findPrescriptionLogsByPrescriptionCode(String prescriptionCode, Integer[] types);
	
	@Query(" from PrescriptionLog l where l.prescriptionCode=?1 and l.status = ?2 ")
	List<PrescriptionLog> findByPrescriptionCodeAndStutas(String prescriptionCode, int status);
}

+ 28 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/wechat/DoctorMappingDao.java

@ -0,0 +1,28 @@
package com.yihu.wlyy.repository.wechat;
import com.yihu.wlyy.entity.Doctor;
import com.yihu.wlyy.entity.DoctorMapping;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 医生映射接口
 **/
public interface DoctorMappingDao extends PagingAndSortingRepository<DoctorMapping, Long>,JpaSpecificationExecutor<DoctorMapping> {
	
	
	@Query("select a.jwDoctor from DoctorMapping a where a.doctorCode = ?1 and a.jwDoctorHospital = ?2")
	String findByDocotrCodeAndJwDoctorHospital(String docotrCode,String jwDoctorHospital);
	
	DoctorMapping findByJwDoctorHospitalAndJwDoctor(String jwDoctorHospital,String jwDoctor);
	
	@Query("select a from Doctor a,DoctorMapping b where a.code = b.doctorCode and b.jwDoctorHospital = ?1 and b.jwDoctor = ?2")
	Doctor getDoctorByJw(String jwDoctorHospital, String jwDoctor);
	
	@Query("select a from Doctor a,DoctorMapping b where a.code = b.doctorCode and a.code = ?1 and b.jwDoctorHospital = ?2")
	Doctor getDoctor(String docotrCode,String jwDoctorHospital);
	
	@Query("from DoctorMapping a where a.jwDoctorHospital = ?1 and a.doctorCode = ?2")
	DoctorMapping findByJwDoctorHospitalAndDoctorCode(String jwDoctorHospital,String doctorCode);
}

+ 31 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/Icd10DictServcie.java

@ -0,0 +1,31 @@
package com.yihu.wlyy.service.jw;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
/**
 * @author huangwenjie
 * @date 2017/12/22 09:43
 */
@Service
public class Icd10DictServcie {
	private final String keyIcd10 = "wlyy:dict:icd:Icd10:";
	private final String keyHealthProblem = "wlyy:dict:icd:HealthProblem:";
	private final String keyDict2healthProblem = "wlyy:dict:icd:Icd10ToHealthProblem:";
	private final String keyHealthProblem2Dict = "wlyy:dict:icd:HealthProblemToIcd10:";
	private final String ok = "wlyy:dict:icd:init";
	
	
	@Autowired
	private StringRedisTemplate redisTemplate;
	/**
	 * 根据icd10的 code 获取全部的健康问题
	 *
	 * @param Icd10Code
	 * @return
	 */
	public String getHealthProblemsByIcd10Code(String Icd10Code) {
		return redisTemplate.opsForValue().get(keyDict2healthProblem + Icd10Code);
	}
}

+ 46 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/JwPrescriptionService.java

@ -0,0 +1,46 @@
package com.yihu.wlyy.service.jw;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * 基位长处方接口
 * Created by yeshijie on 2017/8/3.
 */
@Service
public class JwPrescriptionService {
	
	private static final Logger logger = LoggerFactory.getLogger(JwPrescriptionService.class);
	//基卫服务地址
	@Value("${sign.check_upload}")
	private String jwUrl;
	@Autowired
	private HttpClientUtil httpClientUtil;
	
	/**
	 * 获取单条历史处方
	 * @param recipeNo
	 * @param cardNo
	 * @return
	 */
	public String getRecipe(String recipeNo,String cardNo){
		String url = jwUrl + "/third/prescription/getRecipe";
		List<NameValuePair> params = new ArrayList<>();
		params.add(new BasicNameValuePair("recipeNo", recipeNo));
		params.add(new BasicNameValuePair("cardNo", cardNo));
		
		String response = httpClientUtil.post(url, params, "UTF-8");
		
		return response;
	}
	
}

+ 127 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/PresModeAdapter.java

@ -0,0 +1,127 @@
package com.yihu.wlyy.service.jw;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.Doctor;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Iterator;
/**
 * Created by Trick on 2017/8/10.
 */
@Component
public class PresModeAdapter {
	
	private static Logger logger = LoggerFactory.getLogger(PresModeAdapter.class);
	@Autowired
	private Icd10DictServcie icd10DictServcie;
	@Autowired
	private ZyDictService zyDictService;
	/**
	 * 处方详情转换
	 * @param json
	 * @return
	 */
	public JSONObject modelToSinglePrescription(String json){
		try{
			JSONObject oldJson = JSONObject.parseObject(json);
			if(oldJson.getInteger("status")!=200){
				throw new RuntimeException("智业接口失败:"+oldJson.getString("msg"));
			}
			JSONObject data = oldJson.getJSONObject("data");
			JSONArray returnData = data.getJSONArray("returnData");
			String code = data.getString("CODE");
			if(StringUtils.isNotBlank(code)&&"1".equals(code)&&returnData.size()>0){
				JSONArray modeArray = returnData.getJSONArray(0);
				JSONObject mode = (JSONObject) modeArray.get(0);
				JSONObject p  = new JSONObject();
				p.put("code",mode.getInteger("RECIPE_NO")+"");
				p.put("createTime",mode.getString("APPLY_TIME"));
				
				Doctor doctor =  zyDictService.getDoctByJw(mode.getString("APPLY_OPERATOR"),mode.getString("HEALTH_ORG_CODE"));
				// "APPLY_OPERATOR_NAME": 开单医生姓名","HEALTH_ORG_CODE": "开单机构编码",
				if(doctor!=null){
					p.put("doctor",doctor.getCode());
					p.put("doctorName",doctor.getName());
					p.put("hospitalName",doctor.getHospitalName());
					p.put("hospital",doctor.getHospital());
				}else{
					p.put("doctor",mode.getString("APPLY_OPERATOR"));
					p.put("doctorName",mode.getString("APPLY_OPERATOR_NAME"));
					p.put("hospitalName",mode.getString("HEALTH_ORG_CODE"));
					p.put("hospital",mode.getString("HEALTH_ORG_CODE"));
				}
				JSONObject diagnosis = new JSONObject();
				String diagnoseCode = mode.getString("DIAGNOSE_CODE");
				String diagnoseName = mode.getString("DIAGNOSE_NAME");
//                String diagnoseCode = "E10.100";
//                String diagnoseName = "1型糖尿病性酮症";
				diagnosis.put("code",diagnoseCode);//诊断代码
				diagnosis.put("name",diagnoseName);//诊断名称
				String icd10 = icd10DictServcie.getHealthProblemsByIcd10Code(diagnoseCode);
				if(!StringUtils.isEmpty(icd10)){
					JSONObject icd = JSONObject.parseObject(icd10);
					diagnosis.put("healthProblemName",icd.getString("value"));//诊断名称
					diagnosis.put("healthProblem",icd.getString("key"));//诊断代码
				}else{
					diagnosis.put("healthProblemName",diagnoseName);//诊断名称
					diagnosis.put("healthProblem",diagnoseCode);//诊断代码
				}
				JSONArray jsonArrayDt = new JSONArray();
				jsonArrayDt.add(diagnosis);
				p.put("prescriptionDt",jsonArrayDt);
				
				JSONArray infos = mode.getJSONArray("RECIPE_DETAIL");
				Iterator infoIt = infos.iterator();
				JSONArray prescriptionInfos = new JSONArray();
				while (infoIt.hasNext()){
					JSONObject info = (JSONObject) infoIt.next();
					JSONObject prescriptionInfo = new JSONObject();
					prescriptionInfo.put("Remark",info.getString("REMARK"));
					prescriptionInfo.put("BindFlag",info.getString("BIND_FLAG"));
					prescriptionInfo.put("direction",info.getString("USAGE_NAME"));//药品用法
					prescriptionInfo.put("drugCode",info.getString("ITEM_CODE"));//药品code
					prescriptionInfo.put("drugName",info.getString("ITEM_NAME"));//药品名称
					prescriptionInfo.put("drugRate",info.getString("FREQUENCY"));//吃药频率 FREQUENCY
					prescriptionInfo.put("drugRateName",info.getString("FREQUENCY_NAME"));
					prescriptionInfo.put("drugFormat",info.getString("ITEM_SPEC"));//药品规格
					prescriptionInfo.put("price",info.getDouble("ITEM_PRICE"));//药品单价
					prescriptionInfo.put("num",info.getInteger("ITEM_QUANTITY"));//药品数目
					prescriptionInfo.put("jwSubCode",info.getString("RECIPE_SUB_NO"));//智业子处方号
					prescriptionInfo.put("drugNumUnit",info.getString("ITEM_UNIT"));//数量单位编码
					prescriptionInfo.put("drugNumUnitName",info.getString("ITEM_UNIT_NAME"));//数量单位名称
					prescriptionInfo.put("cost",info.getDouble("COST"));//金额
					prescriptionInfo.put("charge",info.getDouble("CHARGE"));//自付
					prescriptionInfo.put("bindFlag",info.getString("BIND_FLAG"));//成组标志, 0.非成组,1.成组
					prescriptionInfo.put("dayCount",info.getInteger("DAY_COUNT"));//用药天数
					prescriptionInfo.put("drugUsage",info.getString("USAGE"));//用药方法编码
					prescriptionInfo.put("usageName",info.getString("USAGE_NAME"));//用药方法名称
					prescriptionInfo.put("physicDose",info.getString("PHYSIC_DOSE"));//用药剂量
					prescriptionInfo.put("physicDoseUnit",info.getString("PHYSIC_DOSE_UNIT"));//剂量单位编码
					prescriptionInfo.put("physicDoseUnitName",info.getString("PHYSIC_DOSE_UNIT_NAME"));//剂量单位名称
					prescriptionInfo.put("physicAmount",info.getString("PHYSIC_AMOUNT"));//用药总量
					prescriptionInfo.put("physicAmountUnit",info.getString("PHYSIC_AMOUNT_UNIT"));//总量单位编码
					prescriptionInfo.put("physicAmountUnitName",info.getString("PHYSIC_AMOUNT_UNIT_NAME"));//总量单位名称
					prescriptionInfo.put("physicInjectPlace",info.getString("PHYSIC_INJECT_PLACE"));//注射地点编码
					prescriptionInfo.put("physicInjectPlaceName",info.getString("PHYSIC_INJECT_PLACE_NAME"));//注射地点名称
					prescriptionInfo.put("physicSkinTest",info.getString("PHYSIC_SKIN_TEST"));//皮试类型名称
					prescriptionInfo.put("physicSkinTestName",info.getString("PHYSIC_SKIN_TEST_NAME"));//皮试类型名称
					prescriptionInfo.put("subjectClass",info.getString("SUBJECT_CLASS"));//科目类型
					prescriptionInfos.add(prescriptionInfo);
				}
				p.put("prescriptionInfo",prescriptionInfos);
				return p;
			}
		}catch (Exception e){
			logger.info("PresModeAdapter:modelToSinglePrescription:Json:"+json);
			throw e;
		}
		return new JSONObject();
	}
	
}

+ 28 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/ZyDictService.java

@ -0,0 +1,28 @@
package com.yihu.wlyy.service.jw;
import com.yihu.wlyy.entity.Doctor;
import com.yihu.wlyy.repository.wechat.DoctorMappingDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Created by chenweida on 2017/8/10.
 */
@Service
public class ZyDictService {
	@Autowired
	private DoctorMappingDao doctorMappingDao;
	
	
	/**
	 * 根据基位code 获取医生
	 * @param jwDoctor
	 * @param jwHospital
	 * @return
	 */
	public Doctor getDoctByJw(String jwDoctor, String jwHospital){
		return doctorMappingDao.getDoctorByJw(jwHospital,jwDoctor);
	}
	
	
}

+ 104 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/prescription/PrescriptionService.java

@ -1,11 +1,15 @@
package com.yihu.wlyy.service.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.Patient;
import com.yihu.wlyy.entity.prescription.*;
import com.yihu.wlyy.repository.PatientDao;
import com.yihu.wlyy.repository.prescription.*;
import com.yihu.wlyy.service.jw.JwPrescriptionService;
import com.yihu.wlyy.service.jw.PresModeAdapter;
import com.yihu.wlyy.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -15,6 +19,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @author huangwenjie
@ -52,6 +57,18 @@ public class PrescriptionService {
	@Autowired
	PrescriptionPayDao prescriptionPayDao;
	
	@Autowired
	PrescriptionLogDao prescriptionLogDao;
	
	@Autowired
	private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
	
	@Autowired
	private JwPrescriptionService jwPrescriptionService;
	
	@Autowired
	private PresModeAdapter presModeAdapter;
	
	public List<PrescriptionVO> getPrescriptionList(String hospital,
	                                                String disease,
	                                                String dispensarytype,
@ -287,7 +304,7 @@ public class PrescriptionService {
		prescription.setStatusName("");
		rs.put("prescription", prescription);
		rs.put("createTime", DateUtil.dateToStrLong(prescription.getCreateTime()));
		rs.put("reviewedTime",DateUtil.dateToStrLong(reviewed.getCreateTime()));
		rs.put("reviewedTime",DateUtil.dateToStrLong(reviewed.getReviewedTime()));
		rs.put("prescriptionInfo", prescriptionInfos);
		rs.put("reviewed", reviewed);
		if (prescription != null && StringUtils.isNotBlank(prescription.getPatient())) {
@ -305,8 +322,18 @@ public class PrescriptionService {
		return rs;
	}
	
	public String presCheckStateObj(String code) {
		StringBuffer sql = new StringBuffer(" SELECT pr.code FROM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND pr.status >= " + PrescriptionLog.PrescriptionLogStatus.revieweding.getValue() + " AND pr.status < " + PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
		List<Map<String, Object>> mp = jdbcTemplate.queryForList(sql.toString(), code);
		if (mp != null && mp.size() > 0) {
			return (String) ((mp.get(0)).get("code"));
		} else {
			return "1";
		}
	}
	
	/**
	 * 获取续方信息
	 * 获取订单跟踪
	 *
	 * @param code
	 * @return
@ -315,12 +342,19 @@ public class PrescriptionService {
		JSONObject jo = new JSONObject();
		//获取处方信息
		Prescription prescription = prescriptionDao.findByCode(code);
		
//		AdminTeam adminTeam = adminTeamService.getTeam(prescription.getAdminTeamId());
		//获取处方药品信息
		List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code);
		//获取付款信息
		PrescriptionPay prescriptionPay = prescriptionPayDao.findByPrescriptionPay(code);
		//获取配送信息
		PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionCode(code);
		jo.put("prescriptionExpressage", prescriptionExpressage);
		
		jo.put("prescriptionInfos", prescriptionInfos);
		jo.put("prescriptionPay", prescriptionPay);
		jo.put("prescriptionExpressage", prescriptionExpressage);
//		jo.put("leadCode", adminTeam.getLeaderCode());//团队长code
		if (prescription != null) {
			jo.put("createTime", prescription.getCreateTime());//创建时间
			jo.put("doctorName", prescription.getDoctorName());//审核医生
@ -329,8 +363,74 @@ public class PrescriptionService {
			jo.put("dispensaryDispensaryTypeName", prescription.getDispensaryTypeName());//处方配送方式
			jo.put("prescriptionStatus", prescription.getStatus());//处方状态
			jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(), "",""));//处方状态名称
			jo.put("ssc",prescription.getSsc());//医保卡号
			Patient p =  patientDao.findByCode(prescription.getPatient());
			jo.put("patient",p.getCode());
			jo.put("patientName",p.getName());
			jo.put("IdCard",p.getIdcard());
			jo.put("ssc",p.getSsc());
		}
		
		
		// (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 ,
		//  40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
		Integer[] status = new Integer[]{
				PrescriptionLog.PrescriptionLogStatus.reviewed_success.getValue(),
//                    PrescriptionLog.PrescriptionLogStatus.adding.getValue(), //暂无此状态
				PrescriptionLog.PrescriptionLogStatus.pay_success.getValue(),
				PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue(),
				PrescriptionLog.PrescriptionLogStatus.expressageing.getValue(),
				PrescriptionLog.PrescriptionLogStatus.finish.getValue()};
		List<PrescriptionLog> prescriptionLogs = prescriptionLogDao.findPrescriptionLogsByPrescriptionCode(code, status);
		
		//加上快递的log
		List<PrescriptionExpressageLog> expressageLogs = prescriptionExpressageLogDao.findByPrescriptionCode(code);
		for (int i = 0; i < expressageLogs.size(); i++) {
			PrescriptionExpressageLog prescriptionExpressageLog = expressageLogs.get(i);
			PrescriptionLog prescriptionLog = new PrescriptionLog();
			prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
			prescriptionLog.setCreateTime(prescriptionExpressageLog.getCreateTime());
			prescriptionLog.setHospital(prescriptionExpressageLog.getAcceptHospital());
			prescriptionLog.setHospitalName(prescriptionExpressageLog.getAcceptHospitalName());
			prescriptionLog.setUserCode(prescriptionExpressageLog.getAcceptUser());
			prescriptionLog.setUserName(prescriptionExpressageLog.getAcceptUserName());
			prescriptionLogs.add(prescriptionLog);
		}
		//排序
		//排序
		prescriptionLogs.sort((o1, o2) -> {
			long map1value = o1.getCreateTime().getTime();
			long map2value = o2.getCreateTime().getTime();
			
			if (map1value - map2value > 0) {
				return -1;
			} else if (map1value - map2value < 0) {
				return 1;
			} else {
				return 0;
			}
		});
		if (prescriptionLogs != null && prescriptionLogs.size() > 0) {
			JSONArray ja = new JSONArray();
			for (int i = 0; i < prescriptionLogs.size(); i++) {
				PrescriptionLog one = prescriptionLogs.get(i);
				org.json.JSONObject eo = new org.json.JSONObject();
				eo.put("createTime", DateUtil.dateToStrLong(one.getCreateTime()));
				eo.put("statusName", one.getStatusName());
				eo.put("drugDeliveryflag", "0");
				if(one.getStatus()==100){
					prescription = prescriptionDao.findByCode(one.getPrescriptionCode());
					if(prescription!=null&&prescription.getDrugDeliveryFlag()==1){
						eo.put("drugDeliveryflag", "1");
						eo.put("drugDeliveryOperatorName",prescription.getDrugDeliveryOperatorName());
						eo.put("drugDelivery",prescription.getDrugDeliveryReasonValue()+","+prescription.getDrugDeliveryReason());
					}
				}
				ja.put(eo);
				jo.put("expresslog",jo);
			}
		}
		
		
		return jo;
	}
}

+ 2 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/HttpClientUtil.java

@ -14,12 +14,14 @@ import org.apache.http.util.EntityUtils;
import org.json.JSONObject;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
@Component
public class HttpClientUtil {
	/**

+ 14 - 10
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_info_js.jsp

@ -47,7 +47,7 @@
                                            if(i != 0){
                                                diagnosisinfo = diagnosisinfo +"/"
                                            }
                                            diagnosisinfo = diagnosisinfo + diagnosis[i].healthProblemName;
                                            diagnosisinfo = diagnosisinfo + diagnosis[i].name;
                                        }
                                    }
                                    $('#diagnosisinfo').val(diagnosisinfo);
@ -57,8 +57,8 @@
                                        var prescriptionInfoStr = "";
                                        for (var i=0;i<prescriptionInfo.length;i++)
                                        {
                                            var str = "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp药品信息:"+prescriptionInfo[i].drugName+"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp用法:"+prescriptionInfo[i].usageName+"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp每次 "+prescriptionInfo[i].physicDose+prescriptionInfo[i].drugNumUnitName+prescriptionInfo[i].drugRateName;
                                            str += "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp总量:"+prescriptionInfo[i].physicAmountUnit+prescriptionInfo[i].physicAmountUnitName;
                                            var str = "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp药品信息:"+prescriptionInfo[i].drugName+"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp用法:"+prescriptionInfo[i].usageName+"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp每次 "+prescriptionInfo[i].physicDose+prescriptionInfo[i].physicDoseUnitName+prescriptionInfo[i].drugRateName;
                                            str += "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp总量:"+prescriptionInfo[i].num+prescriptionInfo[i].drugNumUnitName;
                                            str += "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp规格:"+prescriptionInfo[i].drugFormat;
                                            prescriptionInfoStr += "<a style=\"margin-left:10px;\">"+str+"</a><br>";
//                                            prescriptionInfoStr += "<div class=\"l-text-wrapper m-form-control\"><input readonly value=\""+str+"\" class=\"fd-input\" type=\"text\"   /></div>";
@ -73,15 +73,15 @@
//                                            prescriptionInfoStr += "<div class=\"l-text-wrapper m-form-control\"><input readonly value=\""+prescriptionInfo[i].drugFormat+"\" class=\"fd-input\" type=\"text\"   /></div><br>";
                                        }
                                    }
                                    $('#prescriptionInfo_div').html(prescriptionInfoStr)
                                    $('#prescriptionInfo_div').html(prescriptionInfoStr);
                                    //续方状态
                                    var prescriptionStatueName = data.prescription.statusName;
                                    $('#prescriptionStatueName').val(prescriptionStatueName)
                                    $('#prescriptionStatueName').val(prescriptionStatueName);
                                    //续方说明
                                    var reason = data.prescription.reason;
                                    $('#reason').val(reason)
                                    $('#reason').val(reason);
                                    //申请时间
                                    var createTime = data.createTime;
@ -101,10 +101,14 @@
                                    //审核结果
                                    var status = data.prescription.status;
                                    if(status > 1){
                                        $('#presult').val("审核通过")
                                    }else{
                                        $('#presult').val("审核未通过")
                                    if(status ==  -2){
                                        $('#presult').val("删除")
                                    }else if (status ==  -1){
                                        $('#presult').val("审核失败:"+data.prescription.reason)
                                    }else if (status ==  0){
                                        $('#presult').val("待审核")
                                    }else if (status ==  1){
                                        $('#presult').val("审核成功")
                                    }

+ 1 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -249,6 +249,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
            message.setTitle("孕检提醒");
            message.setContent(content);
            message.setType(13);
            message.setDel("1");
            messageDao.save(message);
            // 推送消息给医生
            pushMsgTask.put(doctor, "13", "孕检提醒", content, "");

BIN
patient-co/patient-co-wlyy/doc/接口文档/~$i健康API文档.docx


BIN
patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/~$健康教育对外接口文档(11).docx


BIN
patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/~$健康教育对外接口文档.docx


+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -62,7 +62,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
    List<Message> getSysTemMessageByPrescription(String doctor, String prescriptionStatus);
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12)")
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12) and (a.del = '1' or a.del is null) ")
    List<Message> getSystemMessage(String doctor, Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=?2 and a.prescriptionStatus='0' ")

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -263,6 +263,15 @@ public class MessageService extends BaseService {
     * @param msgid
     */
    public int readHealth(long msgid) {
        //        by wujunjie type13 医生点击阅读后隐藏
        Message message = messageDao.findOne(msgid);
        int type = message.getType();
        switch (type){
            case 13:
                message.setDel("0");
                messageDao.save(message);
                break;
        }
        return messageDao.read(msgid);
    }

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -214,7 +214,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
                        Long nextExamDay = 0l;
                        for (PrenatalInspectorPlan plan : plans) {
                            Long temp = DateUtil.getDays(plan.getInspectionTime(), date);
                            if (nextExamDay == 0 || nextExamDay > temp) {
                            if ((nextExamDay == 0 || nextExamDay > temp) && (temp > 0)) {
                                nextExamDay = temp;
                            }
                        }
@ -275,7 +275,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
                            planJson.put("endTime", END_TIME);
                            planJson.put("mensesLast", MENSES_LAST);
                            planJson.put("expectedTime", DateUtil.dateToStrLong(dueday));
                            Date date = new Date();
                            Date date = DateUtil.getDateShort(new Date());
                            List<PrenatalInspectorPlan> plans = prenatalInspectorPlanDao.findByPatient(patientCode);
                            List<PrenatalInspectorPlan> savePlans = new ArrayList<>();
@ -329,7 +329,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
                            Long nextExamDay = 0l;
                            for (PrenatalInspectorPlan plan : plans) {
                                Long temp = DateUtil.getDays(plan.getInspectionTime(), date);
                                if (nextExamDay == 0 || nextExamDay > temp) {
                                if ((nextExamDay == 0 || nextExamDay > temp) && (temp > 0)) {
                                    nextExamDay = temp;
                                }
                            }

+ 33 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -127,11 +127,21 @@ public class JMJkEduArticleService extends BaseService {
            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")));//文章点赞数
            if(article.getString("browseNumber") != null){
                heapm.setBrowseNumbere(Integer.valueOf(article.getString("browseNumber")));//文章浏览数
            }
            if(article.getString("commentNumber") != null){
                heapm.setCommentNumber(Integer.valueOf(article.getString("commentNumber")));//文章评论数
            }
            
            if(article.getString("pointNumber") != null){
                heapm.setPointNumber(Integer.valueOf(article.getString("pointNumber")));//文章点赞数
            }
            
            heapm.setArticleCover(article.getString("articleCover"));//封面
            heapm.setComputeTime(computeTime(article.getString("insertTime")));
            if(article.getString("insertTime")!=null){
                heapm.setComputeTime(computeTime(article.getString("insertTime")));
            }
            doctor = doctorDao.findByCode(one.getDoctorCode());
            heapm.setPhoto(doctor.getPhoto());
            heapm.setOperatorName(article.getString("operatorName"));
@ -919,18 +929,29 @@ public class JMJkEduArticleService extends BaseService {
     */
    public JSONObject queryArticlePcList(String firstLevelCategoryId, String secondLevelCategoryId, String insertTimeStart, String insertTimeEnd, String articlelevel, String articleTitle,
                                          String userCode, String currentUserRole, String currentUserRoleLevel, String isAuthentication, Boolean isMyArticle, Integer page, Integer pageSize,Integer sEcho,Integer roleType) throws Exception{
//        Doctor doctor = doctorDao.findByCode(userCode);
//        boolean isManage = false;
//        if(doctor.getLevel()==10){
//            isManage = true;
//        }
//        if(isMyArticle==null||(isMyArticle!=null&&!isMyArticle)){
//            userCode = null;
//        }
        return thirdJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,isMyArticle,
                articleTitle,userCode,isAuthentication,currentUserRole,currentUserRoleLevel,page,pageSize,sEcho,roleType);
    }
    /**
     * 获取APP端文章列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articlelevel
     * @param articleTitle
     * @param userCode
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @throws Exception
     */
    public JSONObject queryArticleAPPList(String firstLevelCategoryId, String secondLevelCategoryId, String insertTimeStart, String insertTimeEnd, String articlelevel, String articleTitle,
                                         String userCode, String currentUserRole, String currentUserRoleLevel, String isAuthentication, Boolean isMyArticle, Integer page, Integer pageSize,Integer roleType) throws Exception{
        return thirdJkEduArticleService.queryArticleAPPList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,isMyArticle,
                articleTitle,userCode,isAuthentication,currentUserRole,currentUserRoleLevel,page,pageSize,roleType);
    }
    /**
     * 文章认证列表
     * @param firstLevelCategoryId

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

@ -75,6 +75,7 @@ public class ThirdJkEduArticleService extends BaseService {
    private String getDoctorArticalList = "JkEdu.Article.getDoctorArticalList";//获取卫计委认证文章+医生发表未认证文章
    private String saveArticle = "JkEdu.Article.saveArticle";//添加文章
    private String queryArticlePcList = "JkEdu.Article.queryArticlePcList";//PC端获取文章列表
    private String queryArticleAPPList = "JkEdu.Article.queryArticleAPPList";//PC端获取文章列表
    private String authenticationArticle = "JkEdu.Article.authenticationArticle";//文章认证
    private String removeArticle = "JkEdu.Article.removeArticle";//删除文章
    private String authenArticlePCList = "JkEdu.Article.authenArticlePCList";//文章认证列表
@ -479,7 +480,7 @@ public class ThirdJkEduArticleService extends BaseService {
    }
    /**
     * 文章认证列表
     * PC端文章列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
@ -490,6 +491,52 @@ public class ThirdJkEduArticleService extends BaseService {
     * @param isAuthentication
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @return
     * @throws Exception
     */
    public JSONObject queryArticleAPPList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,Boolean isMyArticle,
                                         String articleTitle,String userCode,String isAuthentication,String currentUserRole,String currentUserRoleLevel,Integer page,Integer pageSize,Integer roleType) 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("userCode", userCode);
            param.put("isAuthentication", isAuthentication);
            param.put("currentUserRole", currentUserRole);
            param.put("currentUserRoleLevel", currentUserRoleLevel);
            param.put("page", page+"");
            param.put("pageSize", pageSize+"");
            param.put("isMyArticle", isMyArticle);
            param.put("roleType", roleType);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(queryArticleAPPList, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if ("10000".equals(json.getString("Code"))) {
            return json;
        } else {
            throw new Exception(json.getString("Message"));
        }
    }
    /**
     * 文章认证列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articleTitle
     * @param isAuthentication
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @param page
     * @param pageSize
     * @param sEcho

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

@ -85,6 +85,10 @@ public class DoctorJMJkEduArticleController extends BaseController {
    @ApiOperation("查询医生、卫计委(管理员)给患者推送健教文章列表 ")
    public ResultPageListModel<HealthEduArticlePatientModel> pushArticleList(
            @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类", required = false) @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
            @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类", required = false) @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
            @ApiParam(name = "articleTitle", value = "文章标题", required = false) @RequestParam(value = "articleTitle", required = false) String articleTitle,
            @ApiParam(name = "sendTimeStart", value = "发送时间开始", required = false) @RequestParam(value = "sendTimeStart", required = false) String sendTimeStart,
            @ApiParam(name = "sendTimeEnd", value = "发送时间结束", required = false) @RequestParam(value = "sendTimeEnd", required = false) String sendTimeEnd,
            @ApiParam(name = "myArticle", value = "我的文章 1选中0未选", required = false) @RequestParam(value = "myArticle", required = false,defaultValue = "0") Integer myArticle,
            @ApiParam(name = "sendType", value = "1医生 2卫计委(管理员)", required = true) @RequestParam(value = "sendType", required = true) Integer sendType,
            @ApiParam(name = "page", value = "当前页 起始1", required = true) @RequestParam(value = "page", required = true) Integer page,
@ -92,10 +96,10 @@ public class DoctorJMJkEduArticleController extends BaseController {
            @ApiParam(name = "currentRoleCode", value = "当前登录的角色code", required = false) @RequestParam(value = "currentRoleCode", required = false) String currentRoleCode,
            @ApiParam(name = "currentRoleLevel", value = "当前登录的角色级别", required = false) @RequestParam(value = "currentRoleLevel", required = false) String currentRoleLevel) {
        try {
            if(!StringUtils.isNotEmpty(currentRoleCode)){
            if(StringUtils.isEmpty(currentRoleCode)){
                currentRoleCode = getCurrentRoleCode();
            }
            if(!StringUtils.isNotEmpty(currentRoleLevel)){
            if(StringUtils.isEmpty(currentRoleLevel)){
                currentRoleLevel = getCurrentRoleLevel();
            }
            List<HealthEduArticlePatientModel> eduArticlePatients = jmJkEduArticleService.pushArticleList(page,pagesize,getUID(),firstLevelCategoryId,myArticle,sendType,currentRoleCode,currentRoleLevel);
@ -129,10 +133,10 @@ public class DoctorJMJkEduArticleController extends BaseController {
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            //得到需要发送的患者
            if(!StringUtils.isNotEmpty(currentRoleCode)){
            if(StringUtils.isEmpty(currentRoleCode)){
                currentRoleCode = getCurrentRoleCode();
            }
            if(!StringUtils.isNotEmpty(currentRoleLevel)){
            if(StringUtils.isEmpty(currentRoleLevel)){
                currentRoleLevel = getCurrentRoleLevel();
            }
            jmJkEduArticleService.initPatient(patientSet,labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID(),currentRoleCode,currentRoleLevel);
@ -164,10 +168,10 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                     @ApiParam(name = "currentRoleCode", value = "当前登录的角色code", required = false) @RequestParam(value = "currentRoleCode", required = false) String currentRoleCode,
                                     @ApiParam(name = "currentRoleLevel", value = "当前登录的角色级别", required = false) @RequestParam(value = "currentRoleLevel", required = false) String currentRoleLevel){
        try {
            if(!StringUtils.isNotEmpty(currentRoleCode)){
            if(StringUtils.isEmpty(currentRoleCode)){
                currentRoleCode = getCurrentRoleCode();
            }
            if(!StringUtils.isNotEmpty(currentRoleLevel)){
            if(StringUtils.isEmpty(currentRoleLevel)){
                currentRoleLevel = getCurrentRoleLevel();
            }
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.pushArticleConfirm(articleId, labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID(),currentRoleCode,currentRoleLevel);
@ -292,10 +296,10 @@ public class DoctorJMJkEduArticleController extends BaseController {
            if (patientSet.size() == 0) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            if(!StringUtils.isNotEmpty(currentUserRole)){
            if(StringUtils.isEmpty(currentUserRole)){
                currentUserRole = getCurrentRoleCode();
            }
            if(!StringUtils.isNotEmpty(currentUserRoleLevel)){
            if(StringUtils.isEmpty(currentUserRoleLevel)){
                currentUserRoleLevel = getCurrentRoleLevel();
            }
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 1,"", teamCode, articleId,leaveWords,currentUserRole,currentUserRoleLevel);
@ -320,10 +324,10 @@ public class DoctorJMJkEduArticleController extends BaseController {
            @RequestParam(value = "currentUserRole", required = false) String currentUserRole,
            @RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel){
        try {
            if(!StringUtils.isNotEmpty(currentUserRole)){
            if(StringUtils.isEmpty(currentUserRole)){
                currentUserRole = getCurrentRoleCode();
            }
            if(!StringUtils.isNotEmpty(currentUserRoleLevel)){
            if(StringUtils.isEmpty(currentUserRoleLevel)){
                currentUserRoleLevel = getCurrentRoleLevel();
            }
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
@ -342,145 +346,65 @@ public class DoctorJMJkEduArticleController extends BaseController {
        }
    }
//    @RequestMapping(value = "getArticalById",method = RequestMethod.GET)
//    @ApiOperation("获取文章详情")
//    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
//                                 @RequestParam(value = "articleId", required = true) String articleId){
//        try {
//            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,getUID());
//            return write(200,"查询成功!","data",response);
//        }catch (Exception e){
//            e.printStackTrace();
//            return error(-1,"查询失败!");
//        }
//    }
//    /**
//     * 医生端端文章列表
//     * @param firstLevelCategoryId
//     * @param secondLevelCategoryId
//     * @param insertTimeStart
//     * @param articlelevel
//     * @param articleTitle
//     * @return
//     */
//    @RequestMapping(value = "queryArticlePcList", method = RequestMethod.GET)
//    @ApiOperation("医生端文章列表")
//    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 = false )String currentUserRoleLevel,
//                                      @ApiParam(name = "isAuthentication", value = "是否认证")
//                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
//                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
//                                      @RequestParam(value = "isMyArticle", required = false) Boolean isMyArticle,
//                                      @ApiParam(name = "page", value = "当前页")
//                                      @RequestParam(value = "page", required = true) Integer page,
//                                      @ApiParam(name = "pageSize", value = "分页数")
//                                      @RequestParam(value = "pageSize", required = true) Integer pageSize,
//                                      @ApiParam(name = "roleType", value = "1、普通医生,2、管理员")
//                                      @RequestParam(value = "roleType", required = false) Integer roleType){
//        try {
//
//
//
//            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId, secondLevelCategoryId, insertTimeStart, insertTimeEnd, articlelevel, articleTitle,
//                    getUID(), currentUserRole, currentUserRoleLevel, isAuthentication, isMyArticle, page, pageSize,null,roleType);
//
//            return write(200,"查询成功!","data",response);
//        } catch (Exception e){
//            e.printStackTrace();
//            return error(-1,"查询失败!");
//        }
//    }
//    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
//    @ApiOperation("添加文章")
//    public  String saveArticle(@ApiParam(name = "articleId", value = "文章Id")
//                               @RequestParam(value = "articleId", required = false) String articleId,
//                               @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 = "currentUserRole", value = "当前登录的角色")
//                               @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
//                               @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别",defaultValue = "4")
//                               @RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel,
//                               @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,currentUserRole,currentUserRoleLevel,userScope,articleId);
//            return success("添加成功!");
//        }catch (Exception e){
//            e.printStackTrace();
//            return error(-1,"添加失败!");
//        }
//    }
    /*************************************************************************医生角色end***************************************************************************************************/
//    @RequestMapping(value = "saveArticleCollection",method = RequestMethod.POST)
//    @ApiOperation("收藏文章")
//    @ObserverRequired
//    public String saveArticleCollection(@ApiParam(name = "articleId", value = "文章id")
//                                        @RequestParam(value = "articleId", required = true) String articleId,
//                                        @ApiParam(name = "articleCategoryId", value = "文章类别ID")
//                                        @RequestParam(value = "articleCategoryId", required = false,defaultValue = "1") String articleCategoryId,
//                                        @ApiParam(name = "articleCategoryName", value = "文章类别名称")
//                                        @RequestParam(value = "articleCategoryName", required = false) String articleCategoryName){
//        try {
//            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getUID(),1);
////            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
//
//            return success("收藏成功!");
//        }catch (Exception e){
//            e.printStackTrace();
//            return error(-1,"收藏失败!");
//        }
//    }
//
//    @RequestMapping(value = "cancelArticleCollection",method = RequestMethod.POST)
//    @ApiOperation("取消收藏文章")
//    @ObserverRequired
//    public String cancelArticleCollection(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
//                                          @RequestParam(value = "articleId", required = true) String articleId){
//        try {
//            thirdJkEduArticleService.cancelArticleCollection(articleId,getUID(),1);
////            thirdJkEduArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
//            return success("取消成功!");
//        }catch (Exception e){
//            e.printStackTrace();
//            return error(-1,"取消失败!");
//        }
//    }
    /************************************************************************* app 端接口***************************************************************************************************/
    /**
     * 查询pc端文章列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articlelevel
     * @param articleTitle
     * @return
     */
    @RequestMapping(value = "queryArticleAPPList", method = RequestMethod.GET)
    @ApiOperation("查询APP端文章列表")
    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 = false) String currentUserRole,
                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
                                      @RequestParam(value = "currentUserRoleLevel", required = false )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否认证,0未认证 1已认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
                                      @RequestParam(value = "isMyArticle", required = false) Boolean isMyArticle,
                                      @ApiParam(name = "iDisplayStart", value = "当前页")
                                      @RequestParam(value = "iDisplayStart", required = true) Integer page,
                                      @ApiParam(name = "iDisplayLength", value = "是否过滤我的文章")
                                      @RequestParam(value = "iDisplayLength", required = true) Integer pageSize,
                                      @ApiParam(name = "roleType", value = "1、普通医生,2、管理员")
                                      @RequestParam(value = "roleType", required = false) Integer roleType){
        try {
            if(!StringUtils.isNotEmpty(currentUserRole)){
                currentUserRole=getCurrentRoleCode();
            }
            if(!StringUtils.isNotEmpty(currentUserRoleLevel)){
                currentUserRoleLevel=getCurrentRoleLevel();
            }
    /*************************************************************************医生角色end***************************************************************************************************/
            JSONObject response = jmJkEduArticleService.queryArticleAPPList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize,roleType);
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
}

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

@ -54,13 +54,13 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                               @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用,4、自己使用)")
                               @RequestParam(value = "userScope", required = true) Integer userScope,
                               @ApiParam(name = "roleType", value = "1、普通医生,2、管理员")
                               @RequestParam(value = "roleType", required = false) Integer roleType){
                               @RequestParam(value = "roleType", required = true) Integer roleType){
        try {
            if(StringUtils.isNotEmpty(currentUserRole)){
            if(StringUtils.isEmpty(currentUserRole)){
                currentUserRole=getCurrentRoleCode();
            }
            if(StringUtils.isNotEmpty(currentUserRoleLevel)){
            if(StringUtils.isEmpty(currentUserRoleLevel)){
                currentUserRoleLevel=getCurrentRoleLevel();
            }
            jmJkEduArticleService.saveArticle(getUID(),articleTitle,articleType,articlelevel,secondLevelCategoryId,imageUrl,
@ -104,19 +104,17 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
                                      @RequestParam(value = "isMyArticle", required = false) Boolean isMyArticle,
                                      @ApiParam(name = "iDisplayStart", value = "当前页")
                                      @RequestParam(value = "iDisplayStart", required = true) Integer page,
                                      @ApiParam(name = "iDisplayLength", value = "是否过滤我的文章")
                                      @RequestParam(value = "iDisplayLength", required = true) Integer pageSize,
                                      @ApiParam(name = "iDisplayStart", value = "当前页") @RequestParam(value = "iDisplayStart", required = true) Integer page,
                                      @ApiParam(name = "iDisplayLength", value = "是否过滤我的文章") @RequestParam(value = "iDisplayLength", required = true) Integer pageSize,
                                      @ApiParam(name = "sEcho", value = "插件自带")
                                      @RequestParam(value = "sEcho", required = false) Integer sEcho,
                                      @ApiParam(name = "roleType", value = "1、普通医生,2、管理员")
                                      @RequestParam(value = "roleType", required = false) Integer roleType){
        try {
            if(StringUtils.isNotEmpty(currentUserRole)){
            if(StringUtils.isEmpty(currentUserRole)){
                currentUserRole=getCurrentRoleCode();
            }
            if(StringUtils.isNotEmpty(currentUserRoleLevel)){
            if(StringUtils.isEmpty(currentUserRoleLevel)){
                currentUserRoleLevel=getCurrentRoleLevel();
            }