Browse Source

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

zd_123 7 years ago
parent
commit
2ab41c7c50
69 changed files with 1517 additions and 601 deletions
  1. 9 0
      common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticlePatient.java
  2. 1 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/SignFamily.java
  3. 0 2
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionAdjust.java
  4. 0 2
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionReviewed.java
  5. 7 1
      edu-article/JkEdu/WebRoot/WEB-INF/classes/articlePc.sql.xml
  6. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  7. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class
  8. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class
  9. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  10. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticlePcDao.class
  11. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class
  12. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class
  13. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/enums/MyTableEnum.class
  14. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/Article.class
  15. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class
  16. 1 1
      edu-article/JkEdu/WebRoot/ssoLogin.html
  17. 6 1
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/articlePc.sql.xml
  18. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  19. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class
  20. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class
  21. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  22. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticlePcDao.class
  23. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class
  24. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class
  25. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/enums/MyTableEnum.class
  26. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/Article.class
  27. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class
  28. 7 1
      edu-article/JkEdu/src/articlePc.sql.xml
  29. 150 115
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  30. 11 6
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java
  31. 4 2
      edu-article/JkEdu/src/com/yihu/jk/api/CategoryApi.java
  32. 95 4
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java
  33. 1 0
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticlePcDao.java
  34. 6 1
      edu-article/JkEdu/src/com/yihu/jk/dao/CategoryDao.java
  35. 1 1
      edu-article/JkEdu/src/com/yihu/jk/enums/ArticleSqlNameEnum.java
  36. 1 0
      edu-article/JkEdu/src/com/yihu/jk/enums/MyTableEnum.java
  37. 37 0
      edu-article/JkEdu/src/com/yihu/jk/vo/Article.java
  38. 27 0
      edu-article/JkEdu/src/com/yihu/jk/vo/ArticleStatistic.java
  39. 15 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/PrescriptionStaticController.java
  40. 80 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionAdjust.java
  41. 85 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionDiagnosis.java
  42. 66 66
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionInfo.java
  43. 170 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionReviewed.java
  44. 18 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionAdjustDao.java
  45. 18 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDiagnosisDao.java
  46. 24 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionInfoDao.java
  47. 21 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionReviewedDao.java
  48. 2 2
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/user/UserService.java
  49. 59 7
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/prescription/PrescriptionService.java
  50. 1 111
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_info.jsp
  51. 4 22
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_info_js.jsp
  52. 31 33
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_order.jsp
  53. 5 0
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/ChargeZYService.java
  54. 13 7
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  55. 15 8
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  56. 7 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  57. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/PatientRemindService.java
  58. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/RoleService.java
  59. 169 111
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  60. 76 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  61. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java
  62. 19 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  63. 157 55
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java
  64. 43 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java
  65. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java
  66. 6 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcLabelService.java
  67. 16 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java
  68. 5 4
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  69. 13 13
      patient-co/patient-co-wlyy/src/main/resources/logback.xml

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

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

+ 1 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/SignFamily.java

@ -541,6 +541,7 @@ public class SignFamily extends IdEntity {
                '}';
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getExpensesTime() {
        return expensesTime;
    }

+ 0 - 2
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionAdjust.java

@ -1,9 +1,7 @@
package com.yihu.wlyy.entity.patient.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;

+ 0 - 2
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionReviewed.java

@ -3,10 +3,8 @@ package com.yihu.wlyy.entity.patient.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;
/**

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

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

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


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


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


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


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


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


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


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


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


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


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

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

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

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

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


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


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


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


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


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


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


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


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


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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ 15 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/PrescriptionStaticController.java

@ -3,6 +3,8 @@ package com.yihu.wlyy.controller.manager.datastatic;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.prescription.PrescriptionVO;
import com.yihu.wlyy.service.prescription.PrescriptionService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jxl.Workbook;
import jxl.write.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -34,11 +36,13 @@ public class PrescriptionStaticController extends BaseController {
	
	@RequestMapping(value = "infoInit/{code}",method = RequestMethod.GET)
	public String infoInit(@PathVariable(value = "code") String code){
		request.setAttribute("code",code);
		return "prescription/prescription_info";
	}
	
	@RequestMapping(value = "orderInit/{code}",method = RequestMethod.GET)
	public String orderInit(@PathVariable(value = "code") String code){
		request.setAttribute("code",code);
		return "prescription/prescription_order";
	}
	
@ -65,6 +69,17 @@ public class PrescriptionStaticController extends BaseController {
		}
	}
	
	@RequestMapping(value = "/getinfo", method = RequestMethod.GET)
	@ApiOperation(value = "续方详情")
	public String getContinuedPrescriptionAsDoctor(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code) {
		try {
			return write(200, "查询成功!", "data", prescriptionService.getContinuedPrescriptionAsDoctor(code));
		} catch (Exception e) {
			error(e);
			return error(-1, "查询失败!");
		}
	}
	
	//导出设备报表
	@RequestMapping(value="toExcel",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
	public void exportList(

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

@ -0,0 +1,80 @@
package com.yihu.wlyy.entity.prescription;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * @author huangwenjie
 * @date 2017/12/20 14:50
 */
@Entity
@Table(name = "wlyy_prescription_adjust")
public class PrescriptionAdjust extends IdEntity {
	
	private String code;                    //业务主键
	private String prescriptionCode;// 处方code
	private Date createTime;               //调整时间
	private String reason;                      //调整原因
	private String userCode;    //调整用户code
	private String userName;    //调整用户名称
	private String userType;// 1医生 2患者
	
	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;
	}
	
	public Date getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	public String getReason() {
		return reason;
	}
	
	public void setReason(String reason) {
		this.reason = reason;
	}
	
	public String getUserCode() {
		return userCode;
	}
	
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	
	public String getUserName() {
		return userName;
	}
	
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	public String getUserType() {
		return userType;
	}
	
	public void setUserType(String userType) {
		this.userType = userType;
	}
}

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

@ -0,0 +1,85 @@
package com.yihu.wlyy.entity.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import java.util.Date;
/**
 * @author huangwenjie
 * @date 2017/12/20 14:57
 */
public class PrescriptionDiagnosis  extends IdEntity {
	
	private String code;
	private String prescriptionCode;
	private String name;
	private Integer type;//1主诊断 2次诊断
	private Date createTime;
	private Date updateTime;
	private String healthProblem;
	private String healthProblemName;
	
	public String getHealthProblem() {
		return healthProblem;
	}
	public void setHealthProblem(String healthProblem) {
		this.healthProblem = healthProblem;
	}
	
	public String getHealthProblemName() {
		return healthProblemName;
	}
	
	public void setHealthProblemName(String healthProblemName) {
		this.healthProblemName = healthProblemName;
	}
	
	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;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	@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;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getUpdateTime() {
		return updateTime;
	}
	
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	public Integer getType() {
		return type;
	}
	
	public void setType(Integer type) {
		this.type = type;
	}
}

+ 66 - 66
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionInfo.java

@ -48,275 +48,275 @@ public class PrescriptionInfo extends IdEntity{
    private String physicSkinTest;//注射地点名称
    private String physicSkinTestName;//皮试类型名称
    private String remark;//备注
    
    @Column(name = "code",unique = true , nullable=false)
    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;
    }
    
    @Column(name = "drug_code")
    public String getDrugCode() {
        return drugCode;
    }
    
    public void setDrugCode(String drugCode) {
        this.drugCode = drugCode;
    }
    
    @Column(name = "drug_name")
    public String getDrugName() {
        return drugName;
    }
    
    public void setDrugName(String drugName) {
        this.drugName = drugName;
    }
    
    public String getDrugRate() {
        return drugRate;
    }
    
    public void setDrugRate(String drugRate) {
        this.drugRate = drugRate;
    }
    
    public String getDrugFormat() {
        return drugFormat;
    }
    
    public void setDrugFormat(String drugFormat) {
        this.drugFormat = drugFormat;
    }
    
    public Integer getNum() {
        return num;
    }
    
    public void setNum(Integer num) {
        this.num = num;
    }
    
    public Integer getIsRefrigerate() {
        return isRefrigerate;
    }
    
    public void setIsRefrigerate(Integer isRefrigerate) {
        this.isRefrigerate = isRefrigerate;
    }
    
    public String getDirection() {
        return direction;
    }
    
    public void setDirection(String direction) {
        this.direction = direction;
    }
    
    public Integer getPrice() {
        return price;
    }
    
    public void setPrice(Integer price) {
        this.price = price;
    }
    
    public Integer getDel() {
        return del;
    }
    
    public void setDel(Integer del) {
        this.del = del;
    }
    
    public String getJwSubCode() {
        return jwSubCode;
    }
    
    public void setJwSubCode(String jwSubCode) {
        this.jwSubCode = jwSubCode;
    }
    
    public String getDrugNumUnit() {
        return drugNumUnit;
    }
    
    public void setDrugNumUnit(String drugNumUnit) {
        this.drugNumUnit = drugNumUnit;
    }
    
    public String getDrugNumUnitName() {
        return drugNumUnitName;
    }
    
    public void setDrugNumUnitName(String drugNumUnitName) {
        this.drugNumUnitName = drugNumUnitName;
    }
    
    public Integer getCost() {
        return cost;
    }
    
    public void setCost(Integer cost) {
        this.cost = cost;
    }
    
    public Integer getCharge() {
        return charge;
    }
    
    public void setCharge(Integer charge) {
        this.charge = charge;
    }
    
    @Column(name = "bind_flag")
    public String getBindFlag() {
        return bindFlag;
    }
    
    public void setBindFlag(String bindFlag) {
        this.bindFlag = bindFlag;
    }
    
    @Column(name = "day_count")
    public Integer getDayCount() {
        return dayCount;
    }
    
    public void setDayCount(Integer dayCount) {
        this.dayCount = dayCount;
    }
    
    public String getDrugUsage() {
        return drugUsage;
    }
    
    public void setDrugUsage(String drugUsage) {
        this.drugUsage = drugUsage;
    }
    
    @Column(name = "usage_name")
    public String getUsageName() {
        return usageName;
    }
    
    public void setUsageName(String usageName) {
        this.usageName = usageName;
    }
    
    @Column(name = "physic_dose")
    public String getPhysicDose() {
        return physicDose;
    }
    
    public void setPhysicDose(String physicDose) {
        this.physicDose = physicDose;
    }
    
    public String getPhysicDoseUnit() {
        return physicDoseUnit;
    }
    
    public void setPhysicDoseUnit(String physicDoseUnit) {
        this.physicDoseUnit = physicDoseUnit;
    }
    
    public String getPhysicDoseUnitName() {
        return physicDoseUnitName;
    }
    
    public void setPhysicDoseUnitName(String physicDoseUnitName) {
        this.physicDoseUnitName = physicDoseUnitName;
    }
    
    public String getPhysicAmount() {
        return physicAmount;
    }
    
    public void setPhysicAmount(String physicAmount) {
        this.physicAmount = physicAmount;
    }
    
    public String getPhysicAmountUnit() {
        return physicAmountUnit;
    }
    
    public void setPhysicAmountUnit(String physicAmountUnit) {
        this.physicAmountUnit = physicAmountUnit;
    }
    
    public String getPhysicAmountUnitName() {
        return physicAmountUnitName;
    }
    
    public void setPhysicAmountUnitName(String physicAmountUnitName) {
        this.physicAmountUnitName = physicAmountUnitName;
    }
    
    public String getPhysicInjectPlace() {
        return physicInjectPlace;
    }
    
    public void setPhysicInjectPlace(String physicInjectPlace) {
        this.physicInjectPlace = physicInjectPlace;
    }
    
    public String getPhysicInjectPlaceName() {
        return physicInjectPlaceName;
    }
    
    public void setPhysicInjectPlaceName(String physicInjectPlaceName) {
        this.physicInjectPlaceName = physicInjectPlaceName;
    }
    
    public String getPhysicSkinTest() {
        return physicSkinTest;
    }
    
    public void setPhysicSkinTest(String physicSkinTest) {
        this.physicSkinTest = physicSkinTest;
    }
    
    public String getPhysicSkinTestName() {
        return physicSkinTestName;
    }
    
    public void setPhysicSkinTestName(String physicSkinTestName) {
        this.physicSkinTestName = physicSkinTestName;
    }
    
    public String getRemark() {
        return remark;
    }
    
    public void setRemark(String remark) {
        this.remark = remark;
    }
    
    public String getDrugRateName() {
        return drugRateName;
    }
    
    public void setDrugRateName(String drugRateName) {
        this.drugRateName = drugRateName;
    }
    
    public String getSubjectClass() {
        return subjectClass;
    }
    
    public void setSubjectClass(String subjectClass) {
        this.subjectClass = subjectClass;
    }

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

@ -0,0 +1,170 @@
package com.yihu.wlyy.entity.prescription;
/**
 * @author huangwenjie
 * @date 2017/12/20 14:48
 */
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "wlyy_prescription_reviewed")
public class PrescriptionReviewed extends IdEntity {
	//状态枚举
	public enum PrescriptionReviewedStatus {
		
		del("删除", -2),
		reviewed_fail("审核失败", -1),
		reviewed_wait("待审核", 0),
		reviewed_success("审核成功", 1);
		
		private String name;
		private int value;
		
		PrescriptionReviewedStatus(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 String hospital;                  //医院 关联 dm_hospital code
	private String hospitalName;              //医院 关联 dm_hospital name
	private String dept;                       //科室code
	private String deptName;                   //科室名称
	private String doctor;                  //审核医生
	private String doctorName;                  //审核医生名称
	private Integer status;               //  1审核通过1 0待审核  -1  审核不通过   -2无效审核
	private String reason;                  //审核不通过原因
	private String remark;                  //备注
	private Date reviewedTime;           //审核时间
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getReviewedTime() {
		return reviewedTime;
	}
	
	public void setReviewedTime(Date reviewedTime) {
		this.reviewedTime = reviewedTime;
	}
	
	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 getHospital() {
		return hospital;
	}
	
	public void setHospital(String hospital) {
		this.hospital = hospital;
	}
	
	public String getHospitalName() {
		return hospitalName;
	}
	
	public void setHospitalName(String hospitalName) {
		this.hospitalName = hospitalName;
	}
	
	public String getDept() {
		return dept;
	}
	
	public void setDept(String dept) {
		this.dept = dept;
	}
	
	public String getDeptName() {
		return deptName;
	}
	
	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	
	public String getDoctor() {
		return doctor;
	}
	
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}
	
	public String getDoctorName() {
		return doctorName;
	}
	
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
	
	public Integer getStatus() {
		return status;
	}
	
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	public String getReason() {
		return reason;
	}
	
	public void setReason(String reason) {
		this.reason = reason;
	}
	
	public String getRemark() {
		return remark;
	}
	
	public void setRemark(String remark) {
		this.remark = remark;
	}
}

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

@ -0,0 +1,18 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.prescription.PrescriptionAdjust;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @author huangwenjie
 * @date 2017/12/20 14:55
 */
public interface PrescriptionAdjustDao extends PagingAndSortingRepository<PrescriptionAdjust, Long>,JpaSpecificationExecutor<PrescriptionAdjust> {
	
	List<PrescriptionAdjust> findByPrescriptionCode(String code);
	
	List<PrescriptionAdjust> findByPrescriptionCodeOrderByIdDesc(String code);
}

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

@ -0,0 +1,18 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.prescription.PrescriptionDiagnosis;
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/20 14:57
 */
public interface PrescriptionDiagnosisDao extends PagingAndSortingRepository<PrescriptionDiagnosis, Long>, JpaSpecificationExecutor<PrescriptionDiagnosis> {
	
	@Query("select p from PrescriptionDiagnosis p where p.prescriptionCode=?1 ")
	List<PrescriptionDiagnosis> findByPrescriptionCode(String prescriptionCode);
}

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

@ -0,0 +1,24 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.prescription.PrescriptionInfo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @author huangwenjie
 * @date 2017/12/20 14:52
 */
public interface PrescriptionInfoDao extends PagingAndSortingRepository<PrescriptionInfo, Long>, JpaSpecificationExecutor<PrescriptionInfo> {
	@Query("from PrescriptionInfo p where p.prescriptionCode=?1 and p.del=1")
	List<PrescriptionInfo> findByPrescriptionCode(String prescriptionCode);
	
	
	@Modifying
	@Query("update PrescriptionInfo p set p.cost=?2 where p.drugCode=?1 and p.prescriptionCode=?3 and p.del=1")
	void updateStatus(String code,Integer cost,String prescriptionCode);
	
}

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

@ -0,0 +1,21 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.prescription.PrescriptionReviewed;
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/20 14:53
 */
public interface PrescriptionReviewedDao extends PagingAndSortingRepository<PrescriptionReviewed, Long>, JpaSpecificationExecutor<PrescriptionReviewed> {
	
	@Query(value = "select p from PrescriptionReviewed p where p.prescriptionCode=?1 order by p.reviewedTime desc")
	PrescriptionReviewed findByPrescriptionCode(String prescriptionCode);
	
	@Query("select p from PrescriptionReviewed p where p.prescriptionCode=?1 and p.status=?2")
	List<PrescriptionReviewed> findByPrescriptionCodeAndStatus(String prescriptionCode, Integer status);
}

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/user/UserService.java

@ -196,8 +196,8 @@ public class UserService extends BaseJpaService<User,UserDao> {
            String[] codes = code.split(",");
            List<ManageDictEntry> manageDictEntries = manageDictEntryDao.findByDictIdAndCodes(dictId, codes);
            if (null != manageDictEntries && manageDictEntries.size() > 0) {
                return manageDictEntries.get(0).getValue();
//                return "http://localhost:8180/admin/main";
//                return manageDictEntries.get(0).getValue();
                return "http://localhost:8180/admin/main";
            }
        }
        return null;

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

@ -1,10 +1,8 @@
package com.yihu.wlyy.service.prescription;
import com.yihu.wlyy.entity.prescription.PrescriptionPayVO;
import com.yihu.wlyy.entity.prescription.PrescriptionVO;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.vo.SignPayVO;
import com.yihu.wlyy.entity.prescription.*;
import com.yihu.wlyy.repository.PatientDao;
import com.yihu.wlyy.repository.prescription.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -21,12 +19,30 @@ import java.util.List;
 * @date 2017/12/8 09:00
 */
@Service
public class PrescriptionService extends BaseService {
public class PrescriptionService {
	
	private static Logger logger = LoggerFactory.getLogger(PrescriptionService.class);
	
	@Autowired
	JdbcTemplate jdbcTemplate;
	
	private static Logger logger = LoggerFactory.getLogger(PrescriptionService.class);
	@Autowired
	PrescriptionDao prescriptionDao;
	
	@Autowired
	PrescriptionInfoDao prescriptionInfoDao;
	
	@Autowired
	PrescriptionReviewedDao prescriptionReviewedDao;
	@Autowired
	PrescriptionAdjustDao prescriptionAdjustDao;
	
	@Autowired
	PatientDao patientDao;
	
	@Autowired
	private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
	
	public List<PrescriptionVO> getPrescriptionList(String hospital,
	                                                String disease,
@ -247,4 +263,40 @@ public class PrescriptionService extends BaseService {
		list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(PrescriptionPayVO.class));
		return list ;
	}
	
	/**
	 * 获取续方信息
	 *
	 * @param code
	 * @return
	 */
	public com.alibaba.fastjson.JSONObject getContinuedPrescriptionAsDoctor(String code) {
		Prescription prescription = prescriptionDao.findByCode(code);
		List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code);
		PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code);
		List<PrescriptionAdjust> prescriptionAdjusts = prescriptionAdjustDao.findByPrescriptionCodeOrderByIdDesc(code);
		com.alibaba.fastjson.JSONObject rs = new com.alibaba.fastjson.JSONObject();
		rs.put("prescription", prescription);
		rs.put("prescriptionInfo", prescriptionInfos);
		rs.put("reviewed", reviewed);
//        if(prescription!=null&&StringUtils.isNotBlank(prescription.getDoctor())){
//            rs.put("doctor",doctorDao.findByCode(prescription.getDoctor()));
//        }else{
//            rs.put("doctor","");
//        }
		if (prescription != null && StringUtils.isNotBlank(prescription.getPatient())) {
			rs.put("patient", patientDao.findByCode(prescription.getPatient()));
		} else {
			rs.put("patient", "");
		}
		rs.put("diagnosis", prescriptionDiagnosisDao.findByPrescriptionCode(code));
		
		if (prescriptionAdjusts != null && prescriptionAdjusts.size() > 0) {
			rs.put("prescriptionAdjust", prescriptionAdjusts.get(0));
		} else {
			rs.put("prescriptionAdjust", "");
		}
		
		return rs;
	}
}

+ 1 - 111
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_info.jsp

@ -14,28 +14,6 @@
        font-size: 12px;
        font-weight: bold!important;
    }
    .fd-input{
        width: 150px;
        border: none;
        font-size: 12px;
        height: 30px;
        margin-bottom: 5px;
    }
    .fd-padl{
        margin-left: 24px;
    }
    .fd-autoh{
        height: auto;
    }
    .fd-pd{
        padding: 35px 35px 10px 35px;
    }
    .fd-group{
        display: -webkit-box;
        display: -moz-box;
        display: -ms-flexbox;
        display: flex;
    }
    .fd-img img{
        width: 100px;
        height: 100px;
@ -44,99 +22,11 @@
    .fd-img img:last-child{
        margin-right: 0px;
    }
    .fd-file{
        font-size: 12px;
        font-weight: bold;
        padding-left: 35px;
        padding-right: 10px;
        display: -webkit-box;
        -webkit-box-align: center;
        display: -moz-box;
        -moz-box-align: center;
        display: -ms-flexbox;
        -ms-flex-align: center;
        display: flex;
        align-items: center;
    }
    .no-img{
        display: -webkit-box;
        -webkit-box-align: center;
        display: -moz-box;
        -moz-box-align: center;
        display: -ms-flexbox;
        -ms-flex-align: center;
        display: flex;
        align-items: center;
    }
    .fd-bttn{
        width: 100px;
        height: 35px;
        display: block;
        margin:40px auto 0px;
        background-color: #b9c8d2;
        color: #fff;
        line-height: 35px;
        text-align: center;
    }
    .ad-padd{
        height: 280px;
        width: 100%;
        padding: 10px;
        border: solid 1px #dcdcdc;
        border-radius: 2px;
        font-size: 12px;
    }
    .ad-padd::-webkit-input-placeholder{
        color:#ccc;
    }
    .ad-padd::-moz-placeholder{
        color:#ccc;
    }
    .ad-padd:-moz-placeholder{
        color:#ccc;
    }
    .ad-padd:-ms-input-placeholder{
        color:#ccc;
    }
    .ad-result{
        margin: 20px 35px 0px 35px;
        border-top: solid 1px #ccc;
        padding-top:10px ;
    }
    .ad-label{
        text-align: left!important;
        padding-left: 0px!important;
        font-weight: bold!important;
    }
    .ad-pd{
        padding-top: 35px;
    }
</style>
<body>
<div id="div_roles_info_form" class="m-form-inline f-mt20" data-role-form>
    <div id="detail">
        <div style="margin-left:10px;">
            <label class="label_title fd-label">原处方记录</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">开方时间:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">开方医生:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="min-length-6 validate-special-char" />
            </div>
        </div>
        <div class="m-form-group" style="">
            <label class="label_title fd-label">科室/医生</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
        </div>
        <input type="hidden" id="code" value='${code}'/>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">居民信息</label>
        </div>

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

@ -12,40 +12,22 @@
            /* *************************** 函数定义 ******************************* */
            function pageInit() {
                rolesInfo.init();
                $('#image').on('click','img',function(){
                    var imgSrc = $(this).attr('src');
                    var html = '<img src="'+imgSrc+'" alt="."/>';
                    var imgView =  $('#fd-img-view', parent.document);
                    imgView.find('.fd-img-show').html(html);
                    imgView.show();
                })
            }
            /* *************************** 模块初始化 ***************************** */
            rolesInfo = {
                dealDialog:null,
                $type: $("#type"),//申诉类型
                $name: $("#name"),//姓名
                $identity:$("#identity"),//身份
                $phone:$("#phone"),//联系方式
                $createTime:$("#createTime"),//时间
                $idcard:$("#idcard"),//身份证
                $description:$("#description"),//申诉详情
                $result:$("#result1"),//处理结果
                $btndeal: $("#deal"),//处理按钮
                $btnclose: $("#close"),//关闭按钮
                $image:$("#image"),
                init: function () {
                    _this = this;
                    var id = $("#id").val();
                    var id = $("#code").val();
                    //id不为空,初始化数据
                    if (isNoEmpty(id)) {
                        $.ajax({
                            url: ctx + "/admin/appeal/getAppealById",
                            method: "post",
                            url: ctx + "/admin/static/prescription/getinfo",
                            method: "get",
                            dataType: "json",
                            data: {id: id},
                            success: function (result) {
                                alert(result.toString())
                                if (result.status == '200') {
                                    var data = result.data;
                                    if(data.type==1){

+ 31 - 33
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_order.jsp

@ -115,20 +115,20 @@
<body>
<div class="m-form-inline f-mt20" data-role-form>
    <div id="detail">
        <div style="margin-left:10px;">
            <label class="label_title fd-label">续方记录</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">申请时间:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
        <%--<div style="margin-left:10px;">--%>
            <%--<label class="label_title fd-label">续方记录</label>--%>
        <%--</div>--%>
        <%--<div class="m-form-group" style="border-top: solid 1px #ccc;">--%>
            <%--<label class="label_title fd-label">申请时间:</label>--%>
            <%--<div class="l-text-wrapper m-form-control">--%>
                <%--<input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />--%>
            <%--</div>--%>
            <label class="label_title fd-label">审核医生:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="min-length-6 validate-special-char" />
            </div>
        </div>
            <%--<label class="label_title fd-label">审核医生:</label>--%>
            <%--<div class="l-text-wrapper m-form-control">--%>
                <%--<input class="fd-input" type="text"  class="min-length-6 validate-special-char" />--%>
            <%--</div>--%>
        <%--</div>--%>
        <div style="margin-left:10px;">
@ -193,26 +193,24 @@
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">药品信息.</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">药品名称1 </label>
            <label class="label_title fd-label"> 用法:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">总量:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">规格:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
        </div>
        <%--<div style="margin-left:10px;">--%>
            <%--<label class="label_title fd-label">药品信息.</label>--%>
        <%--</div>--%>
        <%--<div class="m-form-group" style="border-top: solid 1px #ccc;">--%>
            <%--<label class="label_title fd-label">药品名称1 </label>--%>
            <%--<label class="label_title fd-label"> 用法:</label>--%>
            <%--<div class="l-text-wrapper m-form-control">--%>
                <%--<input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />--%>
            <%--</div>--%>
            <%--<label class="label_title fd-label">总量:</label>--%>
            <%--<div class="l-text-wrapper m-form-control">--%>
                <%--<input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />--%>
            <%--</div>--%>
            <%--<label class="label_title fd-label">规格:</label>--%>
            <%--<div class="l-text-wrapper m-form-control">--%>
                <%--<input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />--%>
            <%--</div>--%>
        <%--</div>--%>
    </div>
</div>
</body>

+ 5 - 0
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/ChargeZYService.java

@ -81,6 +81,7 @@ public class ChargeZYService {
            total = list.size();
            for(WlyyCharge obj : list)
            {
                System.out.println("chargecode:"+obj.getId());
                try {
                    if(!uploadWlyyCharge(obj.getCode()))
                    {
@ -109,6 +110,7 @@ public class ChargeZYService {
        WlyyCharge charge = chargeDao.findByCode(code);
        if(charge!=null) {
            SignFamily sign = signFamilyDao.findByCode(charge.getChargeRelation());
            System.out.println("获取到签约数据,签约CODE:"+sign.getCode());
            String proId = "";
            String idcard = sign.getIdcard();
@ -118,6 +120,7 @@ public class ChargeZYService {
            String[] hm = null;
            Patient patient = patientDao.findByCode(sign.getPatient());
            System.out.println("获取到签约居民,居民CODE:"+sign.getPatient());
            try {
                hm = getHospitalMapping(sign.getHospital()); //获取机构映射
    
@ -218,6 +221,8 @@ public class ChargeZYService {
                infoobj.put("zhzfe0",charge.getAccountPay());//医保账户支付
                infoobj.put("xjzfe0",charge.getSelfPay());//个人现金自付
                jsonObject.put("INSUR_FEE_INFO",infoobj);
    
                System.out.println("开始上传缴费数据:"+jsonObject.toString());
                
                String response = zysoftService.uploadChargeInfo(jsonObject, hm[0], hm[1], operator);

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

@ -28,7 +28,9 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by yeshijie on 2017/6/6.
@ -167,11 +169,12 @@ public class PrenatalInspectorPreCardService extends BaseService {
                Patient patient = patientDao.findByCode(code);
                Date begin = DateUtil.getPreDays(planTime,-14);
                Date end = DateUtil.getPreDays(planTime,14);
                Long days = DateUtil.getDays(new Date(), planTime);
                Long days = DateUtil.getDays(DateUtil.getNowDateShort(), planTime);
                String content = "您的签约居民" + patient.getName() + "超期未进行孕检,原计划孕检时间" + format.format(plan.getInspectionTime());
                if (StringUtils.isNotEmpty(pregnancyNo) && (pregnancyNo != null)) {
                    Boolean examStatus = getExamStatus(code, pregnancyNo, begin, end);
                    if (!examStatus) {
                    Map<String,String> exams = getExamStatus(code, pregnancyNo, begin, end);
                    String examStatus = exams.get("status");
                    if ("0".equals(examStatus)) {
                        if (days > 7) {
                            SignFamily signFamily = signFamilyDao.findByPatient(code);
@ -263,8 +266,9 @@ public class PrenatalInspectorPreCardService extends BaseService {
     * @return
     * @throws Exception
     */
    public Boolean getExamStatus(String patient,String pregnancyNo,Date begin,Date end) throws Exception {
        Boolean flag = false;
    public Map getExamStatus(String patient, String pregnancyNo, Date begin, Date end) throws Exception {
        Map<String,String> respose = new HashMap();
        respose.put("status","0");
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            JSONArray natals = reExamRecode(patient,pregnancyNo);
@ -273,13 +277,15 @@ public class PrenatalInspectorPreCardService extends BaseService {
                String exam_time = examRecord.getString("EXAM_TIME");
                Date examTime = format.parse(exam_time);
                if ((examTime.getTime()<= end.getTime()) && (examTime.getTime() >= begin.getTime())){
                    return true;
                    respose.put("status","1");
                    respose.put("examTime",exam_time);
                    return respose;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
        return respose;
    }
    /**

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

@ -808,14 +808,17 @@ public class PrenatalInspectorPreCardService extends BaseService {
            String pregnancyNo = plan.getInspectionCode();
            String patient = plan.getPatient();
            Boolean flag = getSendStatus(prenatalId);
            Long days = DateUtil.getDays(new Date(), planTime);
            Long days = DateUtil.getDays(DateUtil.getNowDateShort(), planTime);
            Date begin = DateUtil.getPreDays(planTime,-14);
            Date end = DateUtil.getPreDays(planTime,14);
            //有产检code
            if (StringUtils.isNotEmpty(pregnancyNo) && (pregnancyNo != null)){
                Boolean examStatus = getExamStatus(patient,pregnancyNo,begin,end);
                if (examStatus){
                Map<String,String> exams = getExamStatus(patient,pregnancyNo,begin,end);
                String examStatus = exams.get("status");
                if ("1".equals(examStatus)){
                    String examTime = exams.get("examTime");
                    json.put("renatalStatus", "4");
                    json.put("examTime", examTime);
                }else {
                    if (days > 7) {
                        json.put("renatalStatus", "3");
@ -883,6 +886,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
        try {
            String relation = prenatalId.toString();
            Patient patient = patientDao.findByCode(code);
            Doctor doctor = doctorDao.findByCode(doc);
            String name = patient.getName();
            String openId = patient.getOpenid();
            String mobile = patient.getMobile();
@ -923,7 +927,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
            }
            if (!flag && StringUtils.isNotEmpty(mobile)) {
//                发送短信消息
                org.json.JSONObject resultJson = smsService.sendMsg(mobile, ":张三,您好!您的家庭医生李四提醒你,您和您的宝宝需要进行产检啦~" +
                org.json.JSONObject resultJson = smsService.sendMsg(mobile, name + ":,您好!您的家庭医生" + doctor.getName() + "提醒你,您和您的宝宝需要进行产检啦~" +
                        " 您可微信搜索公众号:厦门i健康,关注公众号预约产检时间/查看孕检计划及历史检查记录,更可及时获取产检提醒哟~");
                if (resultJson != null && resultJson.getInt("result") == 0) {
                    flag = true;
@ -989,8 +993,9 @@ public class PrenatalInspectorPreCardService extends BaseService {
     * @return
     * @throws Exception
     */
    public Boolean getExamStatus(String patient,String pregnancyNo,Date begin,Date end) throws Exception {
        Boolean flag = false;
    public Map getExamStatus(String patient,String pregnancyNo,Date begin,Date end) throws Exception {
        Map<String,String> respose = new HashMap();
        respose.put("status","0");
        try {
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                JSONArray natals = reExamRecode(patient,pregnancyNo);
@ -999,13 +1004,15 @@ public class PrenatalInspectorPreCardService extends BaseService {
                    String exam_time = examRecord.getString("EXAM_TIME");
                    Date examTime = format.parse(exam_time);
                    if ((examTime.getTime()<= end.getTime()) && (examTime.getTime() >= begin.getTime())){
                        return true;
                        respose.put("status","1");
                        respose.put("examTime",exam_time);
                        return respose;
                    }
                }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
        return respose;
    }
}

+ 7 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -1173,7 +1173,7 @@ public class FamilyContractService extends BaseService {
        Map<String, Object> oldSign = checkLastYearIsSign(sf.getPatient(), sf.getDoctor());
        if (oldSign != null) {
            //如果为续签
            signWebService.setRenewLog(sf);
            //signWebService.setRenewLog(sf);
            Integer adminTCode = (Integer) oldSign.get("admin_team_code");
            Long aTCode = adminTCode.longValue();
            if (aTCode != null && aTCode == adminTeamCode) {
@ -1233,7 +1233,12 @@ public class FamilyContractService extends BaseService {
        SignFamily temp = signFamilyDao.save(sf);
        //设置基卫标识1.3.3.2版本更新
        setSignFamilyMapping(temp.getCode(), temp.getIdcard(), temp.getSignYear());
        if("0".equals(sf.getRenewFlag())){
            setSignFamilyMapping(temp.getCode(), temp.getIdcard(), temp.getSignYear());
        }else{
            //设置续签Log
            signWebService.setRenewLog(temp);
        }
        if (temp != null && patient != null) {
            Doctor doc = doctorDao.findByCode(sf.getDoctor());

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/PatientRemindService.java

@ -453,8 +453,8 @@ public class PatientRemindService extends BaseService {
                RemindFocusWechatTask task = new RemindFocusWechatTask(patients, doc,sMSService);
                new Thread(task).start();
                for(String pString:redisPatients){
                    redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+pString, pString,2,TimeUnit.MINUTES);//向redis里存入数据和设置缓存时
                    //redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+pString, pString,today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(),TimeUnit.MILLISECONDS);//向redis里存入数据和设置缓存时
                    //redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+pString, pString,2,TimeUnit.MINUTES);//向redis里存入数据和设置缓存时
                    redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+pString, pString,today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(),TimeUnit.MILLISECONDS);//向redis里存入数据和设置缓存时
                }
            }
            redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + doctor, "0");

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

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

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

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

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

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

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

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

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

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

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

@ -2,7 +2,11 @@ package com.yihu.wlyy.web.doctor.jimeiJkEdu;
import com.alibaba.fastjson.JSONObject;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.call.CustomerService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.web.BaseController;
@ -13,6 +17,8 @@ import com.yihu.wlyy.web.third.gateway.vo.base.ResultPageListModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
@ -24,9 +30,7 @@ import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
/**
 * Created by Trick on 2017/11/14.
@ -35,7 +39,7 @@ import java.util.Set;
@RequestMapping(value = "/doctor/jkEdu/article", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生、卫计委")
public class DoctorJMJkEduArticleController extends BaseController {
    
    @Autowired
    private JMJkEduArticleService jmJkEduArticleService;
    @Autowired
@ -47,7 +51,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
    private String channelName;
    @Value("${jkEdu.web.articleBaseUrl}")
    private String articleBaseUrl;
    
    
    /**
     * 发送到redis
     *
@ -69,7 +74,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
            });
        });
    }
    
    /*************************************************************************卫计委(管理员)角色start***************************************************************************************************/
    /**医生、卫计委(管理员)-已推送文章
     * @param page
@ -96,7 +101,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
            return new ResultPageListModel(BaseResultModel.statusEm.find_error.getCode(), BaseResultModel.statusEm.find_error.getMessage() + "," + e.getMessage());
        }
    }
    
    @RequestMapping(value = "manageSendArticleToPatients", method = RequestMethod.POST)
    @ApiOperation("卫计委(管理员)文章群推送")
    public BaseResultModel manageSendArticleToPatients(
@ -107,16 +112,17 @@ public class DoctorJMJkEduArticleController extends BaseController {
            @ApiParam(name = "labelServeType", value = "标签类型  3:服务类型,多个用逗号分隔", required = false) @RequestParam(value = "labelServeType", required = false, defaultValue = "") String labelServeType,
            @ApiParam(name = "labelDiseaseType", value = "标签类型  4:疾病类型,多个用逗号分隔", required = false) @RequestParam(value = "labelDiseaseType", required = false, defaultValue = "") String labelDiseaseType,
            @ApiParam(name = "labelHealthType", value = "标签类型  5:健康情况,多个用逗号分隔", required = false) @RequestParam(value = "labelHealthType", required = false, defaultValue = "") String labelHealthType,
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId,
            @ApiParam(name = "leaveWords", value = "医生留言", required = false) @RequestParam(value = "leaveWords", required = false) String leaveWords
    ){
        try {
            
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            //得到需要发送的患者
            jmJkEduArticleService.initPatient(patientSet,labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID());
//            patientSet.add(patientService.findByCode("wjw00000001000e6badcfa163e424525"));
            //获取保存发送记录
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 2,"", 0L, articleId);
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 2,"", 0L, articleId,leaveWords);
            //推送微信模板消息和发送im消息
            new Thread(() -> {
                //发送任务到redis
@ -126,21 +132,21 @@ public class DoctorJMJkEduArticleController extends BaseController {
        }catch (Exception e) {
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
        }
        
    }
    
    
    
    @RequestMapping(value = "managePushArticleConfirm",method = RequestMethod.GET)
    @ApiOperation("卫计委(管理员)确认健教推送人数")
    public String managePushArticleConfirm(@ApiParam(name = "labelUnitType", value = "标签类型  1:下属单位,多个用逗号分隔", required = false) @RequestParam(value = "labelUnitType", required = false, defaultValue = "") String labelUnitType,
                                     @ApiParam(name = "labelSexType", value = "标签类型  2:性别,多个用逗号分隔", required = false) @RequestParam(value = "labelSexType", required = false, defaultValue = "") String labelSexType,
                                     @ApiParam(name = "labelServeType", value = "标签类型  3:服务类型,多个用逗号分隔", required = false) @RequestParam(value = "labelServeType", required = false, defaultValue = "") String labelServeType,
                                     @ApiParam(name = "labelDiseaseType", value = "标签类型  4:疾病类型,多个用逗号分隔", required = false) @RequestParam(value = "labelDiseaseType", required = false, defaultValue = "") String labelDiseaseType,
                                     @ApiParam(name = "labelHealthType", value = "标签类型  5:健康情况,多个用逗号分隔", required = false) @RequestParam(value = "labelHealthType", required = false, defaultValue = "") String labelHealthType,
                                     @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
                                           @ApiParam(name = "labelSexType", value = "标签类型  2:性别,多个用逗号分隔", required = false) @RequestParam(value = "labelSexType", required = false, defaultValue = "") String labelSexType,
                                           @ApiParam(name = "labelServeType", value = "标签类型  3:服务类型,多个用逗号分隔", required = false) @RequestParam(value = "labelServeType", required = false, defaultValue = "") String labelServeType,
                                           @ApiParam(name = "labelDiseaseType", value = "标签类型  4:疾病类型,多个用逗号分隔", required = false) @RequestParam(value = "labelDiseaseType", required = false, defaultValue = "") String labelDiseaseType,
                                           @ApiParam(name = "labelHealthType", value = "标签类型  5:健康情况,多个用逗号分隔", required = false) @RequestParam(value = "labelHealthType", required = false, defaultValue = "") String labelHealthType,
                                           @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
        try {
            
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.pushArticleConfirm(articleId, labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,"wjw00000001000e6badcfa163e424525");
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
@ -148,10 +154,10 @@ public class DoctorJMJkEduArticleController extends BaseController {
            return error(-1,"查询失败!");
        }
    }
    
    /*************************************************************************卫计委(管理员)角色end***************************************************************************************************/
    
    
    /*************************************************************************医生角色start***************************************************************************************************/
    @RequestMapping(value = "labelWithPushPatients", method = RequestMethod.GET)
    @ApiOperation("医生-查询推送对象 ")
@ -159,9 +165,9 @@ public class DoctorJMJkEduArticleController extends BaseController {
            @ApiParam(name = "teamId", value = "行政团队id", required = false) @RequestParam(value = "teamId", required = false) Long teamId,
            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "labelType", required = true) String labelType,
            @ApiParam(name = "codition", value = "筛选多个条件以逗号分割", required = false) @RequestParam(value = "codition", required = false) String codition){
        
        try {
            
            com.alibaba.fastjson.JSONArray response = jmJkEduArticleService.labelWithPushPatients(labelType,codition,teamId,getUID());
            return write(200,"查询成功!","data",response);
        }catch (Exception e) {
@ -169,19 +175,35 @@ public class DoctorJMJkEduArticleController extends BaseController {
            return error(-1,"查询失败!");
        }
    }
    
    @ApiOperation("医生确认健教推送人数")
    @ResponseBody
    @RequestMapping(value = "doctorPushArticleConfirm",method = RequestMethod.GET)
    public String doctorPushArticleConfirm(
            @ApiParam(name = "teamId", value = "行政团队id", required = false) @RequestParam(value = "teamId", required = false) Long teamId,
            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "labelType", required = true) String labelType,
            @ApiParam(name = "condition", value = "多个筛选条件以逗号分割", required = false) @RequestParam(value = "condition", required = false) String condition,
            @ApiParam(name = "groupType", value = "多个分组以逗号分割", required = false) @RequestParam(value = "groupType", required = false) String groupType,
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
            @RequestParam(value = "code") String code,
            @RequestParam(value = "patient", required = false) String patient,
            @RequestParam(value = "group", required = false, defaultValue = "") String group,
            @RequestParam(value = "labelType", required = false) String labelType,
            @RequestParam(value = "teamCode", required = false) long teamCode,
            @RequestParam(value = "articleId", required = false) String articleId){
        try {
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.pushArticleConfirm(articleId,labelType,condition,groupType,teamId,getUID());
            
            if (StringUtils.isEmpty(code)) {
                return error(-1,"请至少选择一篇文章!");
            }
            if (StringUtils.isEmpty(patient) && StringUtils.isEmpty(group)) {
                return error(-1,"请至少选择一个患者!");
            }
            String[] articles = code.split(",");
            String[] patients = patient.split(",");
            String[] groups = group.split(",");
            if (articles.length == 0) {
                return error(-1,"请至少选择一篇文章!");
            }
            if (patients.length == 0 && groups.length == 0) {
                return error(-1,"请至少选择一个患者!");
            }
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.pushArticleConfirm(getUID(),groups,group,labelType,teamCode,patients,articleId);
            return write(200,"查询成功!","data",response);
        }catch (Exception e) {
            e.printStackTrace();
@ -189,41 +211,87 @@ public class DoctorJMJkEduArticleController extends BaseController {
        }
    }
//    @RequestMapping(value = "doctorSendArticleToPatients", method = RequestMethod.POST)
//    @ApiOperation("医生文章群推送")
//    public BaseResultModel doctorSendArticleToPatients(
//            @ApiParam(name = "teamId", value = "行政团队id", required = false) @RequestParam(value = "teamId", required = false) Long teamId,
//            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "labelType", required = true) String labelType,
//            @ApiParam(name = "condition", value = "多个筛选条件以逗号分割", required = false) @RequestParam(value = "condition", required = false) String condition,
//            @ApiParam(name = "groupType", value = "多个分组以逗号分割", required = false) @RequestParam(value = "groupType", required = false) String groupType,
//            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
//        try {
//            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
//            //得到需要发送的患者
//            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
//            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", teamId, articleId);
//            //推送微信模板消息和发送im消息
//            new Thread(() -> {
//                //发送任务到redis
//                sender(healthEduArticlePatient);
//            }).start();
//            return new BaseResultModel();
//        }catch (Exception e) {
//            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
//        }
//    }
    
    @RequestMapping(value = "doctorSendArticleToPatients", method = RequestMethod.POST)
    @ApiOperation("医生文章群推送")
    public BaseResultModel doctorSendArticleToPatients(
            @ApiParam(name = "teamId", value = "行政团队id", required = false) @RequestParam(value = "teamId", required = false) Long teamId,
            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "labelType", required = true) String labelType,
            @ApiParam(name = "condition", value = "多个筛选条件以逗号分割", required = false) @RequestParam(value = "condition", required = false) String condition,
            @ApiParam(name = "groupType", value = "多个分组以逗号分割", required = false) @RequestParam(value = "groupType", required = false) String groupType,
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
    public BaseResultModel doctorSendArticleToPatients(@RequestParam(value = "code") String code,
                                                       @RequestParam(value = "patient", required = false) String patient,
                                                       @RequestParam(value = "group", required = false, defaultValue = "") String group,
                                                       @RequestParam(value = "labelType", required = false) String labelType,
                                                       @RequestParam(value = "teamCode", required = false) long teamCode,
                                                       @RequestParam(value = "articleId", required = false) String articleId,
                                                       @RequestParam(value = "leaveWords", required = false) String leaveWords){
        
        try {
            if (StringUtils.isEmpty(code)) {
                return new BaseResultModel("请至少选择一篇文章!");
            }
            if (StringUtils.isEmpty(patient) && StringUtils.isEmpty(group)) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            String[] articles = code.split(",");
            String[] patients = patient.split(",");
            String[] groups = group.split(",");
            if (articles.length == 0) {
                return new BaseResultModel("请至少选择一篇文章!");
            }
            if (patients.length == 0 && groups.length == 0) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            //得到需要发送的患者
            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", teamId, articleId);
            jmJkEduArticleService.initPatients(getUID(),groups, group,labelType,teamCode,patients,patientSet);
//            jmJkEduArticleService.initPatient(getUID(),groups,group,labelType,teamCode,patients,patientSet);
            if (patientSet.size() == 0) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", teamCode, articleId,leaveWords);
            //推送微信模板消息和发送im消息
            new Thread(() -> {
                //发送任务到redis
                sender(healthEduArticlePatient);
            }).start();
            return new BaseResultModel();
        }catch (Exception e) {
        } catch (Exception e) {
            error(e);
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
        }
    }
    
    @RequestMapping(value = "doctorSendArticleToSingle", method = RequestMethod.POST)
    @ApiOperation("医生文章单个患者推送")
    public BaseResultModel doctorSendArticleToSingle(
            @ApiParam(name = "patientCode", value = "患者Code", required = true) @RequestParam(value = "patientCode", required = true) String patientCode,
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId,
            @ApiParam(name = "leaveWords", value = "医生留言", required = false) @RequestParam(value = "leaveWords", required = false) String leaveWords){
        try {
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            //得到需要发送的患者
            patientSet.add(patientCode);
//            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", 0L, articleId);
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", 0L, articleId,leaveWords);
            //推送微信模板消息和发送im消息
            new Thread(() -> {
                //发送任务到redis
@ -253,7 +321,6 @@ public class DoctorJMJkEduArticleController extends BaseController {
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnds
     * @param articlelevel
     * @param articleTitle
     * @return
@ -274,8 +341,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @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 = "currentUserRoleLevel", value = "当前登录的角色级别")
                                      @RequestParam(value = "currentUserRoleLevel", required = false )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
@ -287,9 +354,9 @@ public class DoctorJMJkEduArticleController extends BaseController {
        try {
            
            
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize);
            
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId, secondLevelCategoryId, insertTimeStart, insertTimeEnd, articlelevel, articleTitle,
                    getUID(), currentUserRole, currentUserRoleLevel, isAuthentication, isMyArticle, page, pageSize,null);
            
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
@ -336,8 +403,43 @@ public class DoctorJMJkEduArticleController extends BaseController {
            return error(-1,"添加失败!");
        }
    }
    
    @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,"取消失败!");
        }
    }
    
    
    /*************************************************************************医生角色end***************************************************************************************************/
    
}

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

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

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

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

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

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

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

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

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

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

+ 13 - 13
patient-co/patient-co-wlyy/src/main/resources/logback.xml

@ -11,9 +11,9 @@
    </appender>
    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/tmp/logs/wlyy.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/tmp/logs/wlyy.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/tmp/logs/wlyy.%d{yyyy-MM-dd}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/tmp/logs/wlyy.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>15</maxHistory>
        </rollingPolicy>
        <encoder>
@ -23,9 +23,9 @@
    </appender>
    <appender name="business_m" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/datadisk/wlyy_logs/business_m.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/business_m.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/datadisk/wlyy_logs/rolling/business_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/rolling/business_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
            <maxHistory>15</maxHistory>
        </rollingPolicy>
        <encoder>
@ -34,9 +34,9 @@
        </encoder>
    </appender>
    <appender name="business_d" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/datadisk/wlyy_logs/business.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/business.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/datadisk/wlyy_logs/dayLogs/business.%d{yyyy-MM-dd}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/dayLogs/business.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>15</maxHistory>
        </rollingPolicy>
        <encoder>
@ -45,9 +45,9 @@
        </encoder>
    </appender>
    <appender name="interface_call_m" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/datadisk/wlyy_logs/interface_call_m.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/interface_call_m.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/datadisk/wlyy_logs/rolling/interface_call_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/rolling/interface_call_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
            <maxHistory>15</maxHistory>
        </rollingPolicy>
        <encoder>
@ -56,9 +56,9 @@
        </encoder>
    </appender>
    <appender name="interface_call_d" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/datadisk/wlyy_logs/interface_call.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/interface_call.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/datadisk/wlyy_logs/dayLogs/interface_call.%d{yyyy-MM-dd}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/dayLogs/interface_call.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>15</maxHistory>
        </rollingPolicy>
        <encoder>
@ -90,10 +90,10 @@
    <!--处方支付日志 start-->
    <!-- 演示按时间滚动的策略 -->
    <appender name="dailyRollingFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>/tmp/logs/wlyy_prescription_pay.log</File>
        <File>/Users/Mewtwo/ideaSpace/log/tmp/logs/wlyy_prescription_pay.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- daily rollover -->
            <FileNamePattern>/tmp/logs/wlyy_prescription_pay.%d{yyyy-MM-dd}.log</FileNamePattern>
            <FileNamePattern>/Users/Mewtwo/ideaSpace/log/tmp/logs/wlyy_prescription_pay.%d{yyyy-MM-dd}.log</FileNamePattern>
            <!-- 保留 15天数据,默认无限
            <maxHistory>15</maxHistory>-->
        </rollingPolicy>
@ -110,4 +110,4 @@
        <!--<appender-ref ref="console" />-->
        <appender-ref ref="rollingFile" />
    </root>
</configuration>
</configuration>