Forráskód Böngészése

sign同步缴费明细代码修改

huangwenjie 7 éve
szülő
commit
66224863eb
71 módosított fájl, 1256 hozzáadás és 522 törlés
  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. 7 1
      edu-article/JkEdu/WebRoot/WEB-INF/classes/articlePc.sql.xml
  4. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  5. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class
  6. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class
  7. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  8. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticlePcDao.class
  9. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class
  10. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class
  11. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/enums/MyTableEnum.class
  12. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/Article.class
  13. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class
  14. 1 1
      edu-article/JkEdu/WebRoot/ssoLogin.html
  15. 6 1
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/articlePc.sql.xml
  16. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  17. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class
  18. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/api/CategoryApi.class
  19. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  20. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/ArticlePcDao.class
  21. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/dao/CategoryDao.class
  22. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/enums/ArticleSqlNameEnum.class
  23. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/enums/MyTableEnum.class
  24. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/Article.class
  25. BIN
      edu-article/JkEdu/classes/artifacts/JkEdu_war_exploded/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class
  26. 7 1
      edu-article/JkEdu/src/articlePc.sql.xml
  27. 150 115
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  28. 11 6
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java
  29. 4 2
      edu-article/JkEdu/src/com/yihu/jk/api/CategoryApi.java
  30. 95 4
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java
  31. 1 0
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticlePcDao.java
  32. 6 1
      edu-article/JkEdu/src/com/yihu/jk/dao/CategoryDao.java
  33. 1 1
      edu-article/JkEdu/src/com/yihu/jk/enums/ArticleSqlNameEnum.java
  34. 1 0
      edu-article/JkEdu/src/com/yihu/jk/enums/MyTableEnum.java
  35. 37 0
      edu-article/JkEdu/src/com/yihu/jk/vo/Article.java
  36. 27 0
      edu-article/JkEdu/src/com/yihu/jk/vo/ArticleStatistic.java
  37. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/FeedbackService.java
  38. 11 11
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/reservation/PatientReservationService.java
  39. 2 1
      patient-co-manage/wlyy-manage/src/main/resources/application.yml
  40. 20 20
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_info.jsp
  41. 31 33
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_order.jsp
  42. 1 1
      patient-co/patient-co-wlyy-job/pom.xml
  43. 13 7
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  44. 1 1
      patient-co/patient-co-wlyy/pom.xml
  45. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java
  46. 15 8
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  47. 6 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  48. 84 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/PatientRemindService.java
  49. 27 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  50. 171 86
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java
  51. 8 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  52. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/RoleService.java
  53. 169 111
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  54. 76 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  55. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java
  56. 19 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  57. 123 53
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java
  58. 43 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java
  59. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java
  60. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java
  61. 6 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcLabelService.java
  62. 16 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java
  63. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/template/ThirdTemplateController.java
  64. 7 4
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  65. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  66. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  67. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  68. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml
  69. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml
  70. 13 13
      patient-co/patient-co-wlyy/src/main/resources/logback.xml
  71. 1 1
      pom.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;
    }

+ 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;
	}
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/FeedbackService.java

@ -230,7 +230,7 @@ public class FeedbackService extends BaseService {
                    params.add(new BasicNameValuePair("remark", "感谢你的意见"));
                    SimpleDateFormat formatDate = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                    String newDate = formatDate.format(new Date());
                    String keywords = patientName + "," + typeName + "," + result + "," + newDate;
                    String keywords = newDate + "," + result;
                    params.add(new BasicNameValuePair("keywords", keywords));
                    HttpClientUtil.post(url, params, "UTF-8");

+ 11 - 11
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/reservation/PatientReservationService.java

@ -111,18 +111,17 @@ public class PatientReservationService extends BaseService {
    }
    /**
     * 客服取消预约
     * 居民取消预约
     */
    @Transactional
    public void userCancelOrder(String code,String user) {
    public void patientCancelOrder(String code,String patient) {
        PatientReservation obj = patientReservationDao.findByCode(code);
        if (obj.getStatus()!=0) {
            obj.setStatus(0);
            User u =userDao.findByCode(user);
            obj.setCancelerName(u.getName());
            obj.setCancelerType(6);
            obj.setCanceler(patient);
            obj.setCancelerName(obj.getName());
            obj.setCancelerType(5);
            obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
            obj.setCanceler(user);
            patientReservationDao.save(obj);
        }
    }
@ -130,17 +129,18 @@ public class PatientReservationService extends BaseService {
    /**
     * 居民取消预约
     * 客服取消预约
     */
    @Transactional
    public void patientCancelOrder(String code,String patient) {
    public void userCancelOrder(String code,String user) {
        PatientReservation obj = patientReservationDao.findByCode(code);
        if (obj.getStatus()!=0) {
            obj.setStatus(0);
            obj.setCanceler(patient);
            obj.setCancelerName(obj.getName());
            obj.setCancelerType(5);
            User u =userDao.findByCode(user);
            obj.setCancelerName(u.getName());
            obj.setCancelerType(6);
            obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
            obj.setCanceler(user);
            patientReservationDao.save(obj);
        }
    }

+ 2 - 1
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -253,7 +253,8 @@ wlyyService:
image:
  imgUrlDomain: http://www.xmtyw.cn/
sign:
  check_upload: http://59.61.92.90:8072/wlyy_service
  check_upload: http://59.61.92.90:8087/wlyy_service
  #check_upload: http://59.61.92.90:8072/wlyy_service
server:
  server_url: http://www.xmtyw.cn/wlyy/
wechat:

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

@ -115,26 +115,26 @@
<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>
        <%--<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>--%>
        <div style="margin-left:10px;">

+ 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>

+ 1 - 1
patient-co/patient-co-wlyy-job/pom.xml

@ -474,7 +474,7 @@
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                        <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>

+ 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;
    }
    /**

+ 1 - 1
patient-co/patient-co-wlyy/pom.xml

@ -507,7 +507,7 @@
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                        <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -746,7 +746,7 @@ public class PatientInfoService extends BaseService {
        json.put("BLOOD",archive.getBlood());//血型【1.A型 2.3.O型4.AB型 5.不详】
        json.put("BLOOD_RH","1");//RH阴性【1.否 2.是 3.不详】
        json.put("MARRIAGE",archive.getMarry());//婚姻状况【10.未婚 20.已婚 30.丧偶 40.离婚 90.未说明的婚姻状况】
        json.put("INSUR_CARD_NO",p.getSsc());//医保卡号
        //补充参数

+ 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;
    }
}

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

@ -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());

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

@ -337,6 +337,70 @@ public class PatientRemindService extends BaseService {
        }
    }
//    /**
//     * 提醒所有患者关注微信
//     *
//     * @param doctor
//     */
//    public void remindPatientWechatFocusAll(String doctor) throws Exception {
//        try {
//            Calendar today = Calendar.getInstance();
//            today.set(Calendar.HOUR, 23);
//            today.set(Calendar.MINUTE, 59);
//            today.set(Calendar.SECOND, 59);
//            today.set(Calendar.MILLISECOND, 999);
//            int page = 0;
//            int start = 0;
//            boolean flag = true;
//            Doctor doc = doctorDao.findByCode(doctor);
//            if (doc == null) {
//                throw new Exception("doctor info can not find");
//            }
//            String sql = "select p.code,p.name,p.mobile" +
//                    "     from " +
//                    "        wlyy_sign_family f join wlyy_patient p on f.patient = p.code" +
//                    "     where " +
//                    "        (f.doctor = ? or f.doctor_health = ?) " +
//                    "        and f.status > 0 " +
//                    "        and f.expenses_status = '1' " +
//                    "        and LENGTH(trim(ifnull(p.openid,''))) < 1 limit ?,3000";
//            List<Map<String, Object>> patients = new ArrayList<>();
//            List<String> redisPatients = new ArrayList<>();
//            Set<String> exist = redisTemplate.opsForSet().members("wechat:focus:remind:set");
//            while (flag) {
//                List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, start});
//
//                if (result != null && result.size() > 0) {
//                    patients.addAll(result);
//                    for (Map<String, Object> map : result) {
//                        if (exist != null && exist.contains(map.get("code").toString())) {
//                            continue;
//                        }
//                        redisPatients.add(map.get("code").toString());
//                    }
//                    page = page + 1;
//                    start = page * 3000;
//                } else {
//                    flag = false;
//                }
//            }
//
//            if (patients.size() > 0) {
//                RemindFocusWechatTask task = new RemindFocusWechatTask(patients, doc,sMSService);
//                new Thread(task).start();
//                redisTemplate.opsForSet().add("wechat:focus:remind:set", redisPatients.toArray(new String[]{}));
//                redisTemplate.expire("wechat:focus:remind:set", today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(), TimeUnit.MILLISECONDS);
//            }
//
//            redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + doctor, "0");
//            redisTemplate.expire("wechat:focus:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
//        } catch (Exception e) {
//            redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + doctor, "0");
//            redisTemplate.expire("wechat:focus:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
//            e.printStackTrace();
//        }
//    }
    /**
     * 提醒所有患者关注微信
     *
@ -366,14 +430,14 @@ public class PatientRemindService extends BaseService {
                    "        and LENGTH(trim(ifnull(p.openid,''))) < 1 limit ?,3000";
            List<Map<String, Object>> patients = new ArrayList<>();
            List<String> redisPatients = new ArrayList<>();
            Set<String> exist = redisTemplate.opsForSet().members("wechat:focus:remind:set");
            Set<String> exist = redisTemplate.keys("wechat:focus:remind:flag:*");
            while (flag) {
                List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, start});
                if (result != null && result.size() > 0) {
                    patients.addAll(result);
                    for (Map<String, Object> map : result) {
                        if (exist != null && exist.contains(map.get("code").toString())) {
                        if (exist != null && exist.size()>0&& isExist(map.get("code").toString(),exist)) {
                            continue;
                        }
                        redisPatients.add(map.get("code").toString());
@ -388,10 +452,11 @@ public class PatientRemindService extends BaseService {
            if (patients.size() > 0) {
                RemindFocusWechatTask task = new RemindFocusWechatTask(patients, doc,sMSService);
                new Thread(task).start();
                redisTemplate.opsForSet().add("wechat:focus:remind:set", redisPatients.toArray(new String[]{}));
                redisTemplate.expire("wechat:focus:remind:set", today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(), TimeUnit.MILLISECONDS);
                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:doctor:" + doctor, "0");
            redisTemplate.expire("wechat:focus:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
        } catch (Exception e) {
@ -401,6 +466,15 @@ public class PatientRemindService extends BaseService {
        }
    }
    public boolean isExist(String code,Set<String> set){
        for(String c :set){
            if(c.contains(code)){
                return true;
            }
        }
        return false;
    }
    /**
     * 微信关注提醒
     *
@ -415,8 +489,11 @@ public class PatientRemindService extends BaseService {
        today.set(Calendar.SECOND, 59);
        today.set(Calendar.MILLISECOND, 59);
        JSONObject result = new JSONObject();
        redisTemplate.opsForSet().add("wechat:focus:remind:set", p.get("code").toString());
        redisTemplate.expireAt("wechat:focus:remind:set", today.getTime());
        redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+ p.get("code").toString(),p.get("code").toString(),today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(),TimeUnit.MILLISECONDS);//向redis里存入数据和设置缓存时
//        redisTemplate.opsForSet().add("wechat:focus:remind:set", p.get("code").toString());
//        redisTemplate.expireAt("wechat:focus:remind:set", today.getTime());
        if (p.get("mobile") == null || StringUtils.isEmpty(p.get("mobile").toString())) {
            result.put("status", -1);

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

@ -405,10 +405,11 @@ public class SignWebService extends BaseService {
        List<String> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor}, String.class);
        if (result != null && result.size() > 0) {
            Set<String> set = redisTemplate.opsForSet().members("wechat:focus:remind:set");
            //Set<String> set = redisTemplate.opsForSet().members("wechat:focus:remind:set");
            Set<String> set = redisTemplate.keys("wechat:focus:remind:flag:*");
            if (set == null) {
                isAll = false;
            } else if (!set.containsAll(result)) {
            } else if (!isAllRemind(result,set)) {
                isAll = false;
            }
        } else {
@ -418,6 +419,30 @@ public class SignWebService extends BaseService {
        return isAll ? 1 : 0;
    }
    /**
     * 存在未提醒的返回false,全部提醒过返回true
     * @param result
     * @param set
     * @return
     */
    public boolean isAllRemind(List<String> result,Set<String> set){
        for(String code :result){
            //默认未提醒
            boolean flag = false;
            for(String c :set){
                if(c.contains(code)){
                    //提醒过标识
                   flag = true;
                }
            }
            if(!flag){
                //返回未提醒
                return false;
            }
        }
        return true;
    }
    /**
     * 查询家庭签约已缴费未关注人数
     *

+ 171 - 86
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -3080,8 +3080,10 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorFollowupLine(String teamCode, String startDate, String endDate, String type, String doctor) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        String startDateStr = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        List<Map<String, Object>> totalList = new ArrayList<>();
        List<Map<String, Object>> planList = new ArrayList<>();
        String totalSQL;
        String planSQL;
        if ("0".equals(type)) {
@ -3093,7 +3095,7 @@ public class StatisticsService extends BaseService {
                    " WHERE " +
                    " w.admin_team_code =" + teamCode +
                    " AND w.doctor_code ='" + doctor + "'" +
                    " AND w.create_time >= '" + startDate + "' " +
                    " AND w.create_time >= '" + startDateStr + "' " +
                    " AND w.create_time <= '" + endDate + "' " +
                    " GROUP BY dateNo";
@ -3104,40 +3106,41 @@ public class StatisticsService extends BaseService {
                    " WHERE " +
                    " w.admin_team_code =" + teamCode +
                    " AND w.doctor_code ='" + doctor + "'" +
                    " AND w.create_time >= '" + startDate + "' " +
                    " AND w.create_time >= '" + startDateStr + "' " +
                    " AND w.create_time <= '" + endDate + "' " +
                    " AND w.status ='2'" +
                    " GROUP BY dateNo";
            totalList = jdbcTemplate.queryForList(totalSQL);
             planList = jdbcTemplate.queryForList(planSQL);
        } else {
            //按月
            totalSQL = "SELECT " +
                    " ( " +
                    "  DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('" + DateUtil.getFristDayOfMonth() + "', '%v') + 1 " +
                    "  DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('" + startDateStr + "', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS followupCount " +
                    " FROM " +
                    " wlyy_followup w " +
                    " WHERE " +
                    " w.admin_team_code =" + teamCode +
                    " AND w.doctor_code ='" + doctor + "'" +
                    " AND w.create_time >= '" + startDate + "' " +
                    " AND w.create_time <= '" + endDate + "' " +
                    " GROUP BY weekOfMonth";
                    " AND w.create_time >= '?1' " +
                    " AND w.create_time <= '?2' ";
            planSQL = "SELECT " +
                    " ( " +
                    "  DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('" + DateUtil.getFristDayOfMonth() + "', '%v') + 1 " +
                    "  DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('" + startDateStr + "', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS planCount " +
                    " FROM " +
                    " wlyy_followup w " +
                    " WHERE " +
                    " w.admin_team_code =" + teamCode +
                    " AND w.doctor_code ='" + doctor + "'" +
                    " AND w.create_time >= '" + startDate + "' " +
                    " AND w.create_time <= '" + endDate + "' " +
                    " AND w.status ='2'" +
                    " GROUP BY weekOfMonth";
                    " AND w.create_time >= '?1' " +
                    " AND w.create_time <= '?2' " +
                    " AND w.status ='2'" ;
            totalList = getGZBGDataMonthLineForEs(startDate,endDate,startDateStr,totalSQL);
            planList = getGZBGDataMonthLineForEs(startDate,endDate,startDateStr,planSQL);
        }
        List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSQL);
        List<Map<String, Object>> planList = jdbcTemplate.queryForList(planSQL);
        JSONObject rs = new JSONObject();
        rs.put("totalLine", totalList);
        rs.put("planLine", planList);
@ -3206,22 +3209,9 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getDoctorTeamFolList(String startDate, String endDate, String teamCode, String sort, String sortType) {
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSQL = "SELECT " +
                " IFNULL(c.followupCount,0) AS followupCount, " +
                " d.`code` AS doctorCode, " +
@ -3427,8 +3417,9 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorFolTitle(String teamCode, String doctor, String startDate, String endDate) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSql = "SELECT " +
                " COUNT(1) AS followupCount " +
                " FROM " +
@ -3514,9 +3505,10 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamDoctorResLine(String teamCode, String startDate, String endDate, String type, String doctor) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        String startDateStr = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSql;
        List<Map<String, Object>> resultList = new ArrayList<>();
        if ("0".equals(type)) {
            //查周
            totalSql = "SELECT " +
@ -3527,45 +3519,32 @@ public class StatisticsService extends BaseService {
                    " w.admin_team_code = " + teamCode +
                    " AND w.doctor = '" + doctor + "'" +
                    " AND w.czrq <= '" + endDate + "' " +
                    " AND w.czrq >= '" + startDate + "' " +
                    " AND w.czrq >= '" + startDateStr + "' " +
                    " GROUP BY dateNo";
            resultList = jdbcTemplate.queryForList(totalSql);
        } else {
            //查月
            //查月份
            totalSql = "SELECT " +
                    " ( " +
                    "  DATE_FORMAT(w.czrq, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1 " +
                    "  ( " +
                    "  DATE_FORMAT(w.czrq, '%v') - DATE_FORMAT('" + startDateStr + "', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS reservationCount " +
                    " FROM " +
                    " wlyy_patient_reservation w " +
                    " WHERE " +
                    " w.admin_team_code = " + teamCode +
                    " AND w.doctor = '" + doctor + "'" +
                    " AND w.czrq <= '" + endDate + "' " +
                    " AND w.czrq >= '" + startDate + "' " +
                    " GROUP BY weekOfMonth";
                    " AND w.czrq >= '?1' "+
                    " AND w.czrq <= '?2' " ;
            resultList = getGZBGDataMonthLineForEs(startDate,endDate,startDateStr,totalSql);
        }
        List<Map<String, Object>> list = jdbcTemplate.queryForList(totalSql);
        return new JSONArray(list);
        return new JSONArray(resultList);
    }
    public JSONArray getTeamDoctorResList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSql = "SELECT " +
                " IFNULL(c.reservationCount,0) AS reservationCount, " +
                " d.`code` AS doctorCode, " +
@ -3674,8 +3653,9 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorResTitle(String teamCode, String doctor, String startDate, String endDate) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSQL = "SELECT " +
                " COUNT(1) AS reservationCount " +
                " FROM " +
@ -3751,9 +3731,23 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamDoctorGuidLine(String teamCode, String startDate, String endDate, String type, String doctor) {
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        String SQL;
        if ("0".equals(type)) {
            //按周统计
@ -3789,6 +3783,13 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamGuidList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
@ -3798,13 +3799,7 @@ public class StatisticsService extends BaseService {
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        String totalSql = "SELECT " +
                " IFNULL(c.guidanceCount,0) AS guidanceCount, " +
                " d.`code` AS doctorCode, " +
@ -3913,8 +3908,23 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorGuiTitle(String teamCode, String doctor, String startDate, String endDate) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        String totalSQL = "SELECT " +
                " COUNT(1) AS guidanceCount " +
                " FROM " +
@ -3987,8 +3997,23 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamDoctorEduLine(String teamCode, String startDate, String endDate, String type, String doctor) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        String sql;
        if ("0".equals(type)) {
@ -4022,6 +4047,13 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamEduList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
@ -4031,13 +4063,7 @@ public class StatisticsService extends BaseService {
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        String totalSql = "SELECT " +
                " IFNULL(c.articleCount,0) AS articleCount, " +
                " IFNULL(c.batchno,0) AS batchno, " +
@ -4173,8 +4199,23 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorEduTitle(String teamCode, String startDate, String endDate, String doctor) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        String totalSql = "SELECT " +
                " COUNT(1) AS articleCount, " +
                " COUNT(DISTINCT w.batch_no) batchno " +
@ -4193,8 +4234,7 @@ public class StatisticsService extends BaseService {
                " w.admin_team_code =" + teamCode +
                " AND w.doctor ='" + doctor + "'" +
                " AND w.czrq <= '" + endDate + "' " +
                " AND w.czrq >= '" + startDate + "'"+
                " GROUP BY w.batch_no";
                " AND w.czrq >= '" + startDate + "'";
        List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSql);
        List<Map<String, Object>> addList = jdbcTemplate.queryForList(addSql);
        JSONObject rs = new JSONObject();
@ -6915,5 +6955,50 @@ public class StatisticsService extends BaseService {
        List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSql);
        return totalList;
    }
    /**
     * 工作报告医生个人详情折线图--按照月份的公用方法(为了解决与es的数据冲突).
     * @param startDate
     * @param endDate
     * @param startDateStr
     * @param sql
     * @return
     */
    public List<Map<String,Object>> getGZBGDataMonthLineForEs(String startDate,String endDate,String startDateStr,String sql){
        List<Map<String, Object>> resultList  = new ArrayList<>();
        List<Map<String,Object>> dateList = DateUtil.findDateASWeeks(DateUtil.strToDate(startDate),DateUtil.strToDate(endDate));
        String firstWeekMonday = DateUtil.getMondayOfThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (DateUtil.strToDate(firstWeekMonday).before(DateUtil.strToDate(startDate))){
            Map<String,Object> map = new HashedMap();
            map.put("date",firstWeekMonday);
            dateList.add(0,map);
        }
        //以每天的17:00:00为时间的边界设置每周的起始时间和结束时间查询数据库
        if (dateList!=null && dateList.size()>0) {
            for (Map<String, Object> map : dateList) {
                String resultSql = sql;
                String mondayDate = String.valueOf(map.get("date"));
                String sundayDate = DateUtil.getSundayOfThisDate(DateUtil.strToDate(mondayDate));
                if (DateUtil.strToDate(mondayDate).before(DateUtil.strToDate(startDate))) {
                    mondayDate = startDateStr;
                } else {
                    mondayDate = DateUtil.getNextDay(mondayDate, -1) + " 17:00:00";
                }
                sundayDate += " 17:00:00";
                resultSql = resultSql.replace("?1",mondayDate);
                resultSql = resultSql.replace("?2",sundayDate);
                List<Map<String, Object>> list = jdbcTemplate.queryForList(resultSql);
                //放入结果集
                if (list!=null && list.size()>0){
                    for(Map<String,Object> reMap : list){
                        if (reMap.get("weekOfMonth")!=null){
                            resultList.add(reMap);
                        }
                    }
                }
            }
        }
        return resultList;
    }
}

+ 8 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -2377,7 +2377,6 @@ public class StatisticsESService {
    public JSONArray getTeamEduLine(String teamCode, String startDate, String endDate, String type)throws Exception {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        List<Map<String,Object>> dateList = DateUtil.findDates(dateFormat.parse(startDate),dateFormat.parse(endDate));
        Integer interval = Integer.parseInt(type) + 1;
        List<SaveModel> articleCountList = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.valueOf(SaveModel.teamLevel),"59",SaveModel.timeLevel_ZL,String.valueOf(interval));
@ -2399,7 +2398,12 @@ public class StatisticsESService {
            });
        }
        //获取结果集
        List<Map<String, Object>> resultList = DateUtil.findDateASWeeks(dateFormat.parse(startDate),dateFormat.parse(endDate));
        List<Map<String, Object>> resultList = null;
        if ("0".equals(type)){
            resultList = DateUtil.findDates(dateFormat.parse(startDate),dateFormat.parse(endDate));
        }else{
            resultList = DateUtil.findDateASWeeks(dateFormat.parse(startDate),dateFormat.parse(endDate));
        }
        String MondayWeekDateStr = DateUtil.getMondayOfThisDate(dateFormat.parse(startDate));
        Date MondayWeekDate = DateUtil.strToDate(MondayWeekDateStr,"yyyy-MM-dd");
        if (dateFormat.parse(startDate).after(MondayWeekDate)){
@ -2413,7 +2417,7 @@ public class StatisticsESService {
            for (Map<String, Object> reMap : resultList) {
                //设置时间
                if ("0".equals(type)) {
                    reMap.put("dateNo",dateFormat.format(reMap.get("date")));
                    reMap.put("dateNo",reMap.get("date"));
                } else {
                    if (dateFormat.parse(String.valueOf(reMap.get("date"))).before(dateFormat.parse(startDate))){
                        reMap.put("weekOfMonth", 1);
@ -3082,7 +3086,7 @@ public class StatisticsESService {
                if ("0".equals(type)) {
                    map.put("dateNo", dateFormat.format(one.getQuotaDate()));
                } else {
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                    map.put("weekNo", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                }
                map.put("avgCount", avgCountStr);
                rs.add(map);

+ 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 = "改用户没有管理员权限";

+ 123 - 53
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
@ -275,7 +342,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
                                      @RequestParam(value = "currentUserRoleLevel", required = false)String currentUserRoleLevel,
                                      @RequestParam(value = "currentUserRoleLevel", required = false )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
@ -285,8 +352,11 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                      @ApiParam(name = "pageSize", value = "分页数")
                                      @RequestParam(value = "pageSize", required = true) Integer pageSize){
        try {
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize);
            
            
            
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId, secondLevelCategoryId, insertTimeStart, insertTimeEnd, articlelevel, articleTitle,
                    "0de7295862dd11e69faffa163e8aee56", currentUserRole, currentUserRoleLevel, isAuthentication, isMyArticle, page, pageSize,null);
            
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
@ -333,8 +403,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
            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,

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

@ -293,7 +293,7 @@ public class DoctorSignController extends WeixinBaseController {
                    if (status == 3) {
                        boolean epTime = false;
                        try {
                            epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", temp.get("patient"));
                            epTime = redisTemplate.hasKey("wechat:focus:remind:flag:"+temp.get("patient"));
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

+ 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)

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/template/ThirdTemplateController.java

@ -29,6 +29,8 @@ public class ThirdTemplateController extends BaseController {
    private PushMsgTask pushMsgTask;
    @Value("${wechat.message.template_doctor_survey}")
    private String template_doctor_survey;
    @Value("${wechat.message.template_deal_with}")
    private String template_deal_with;
    /**
     * 发送模板消息
@ -101,7 +103,7 @@ public class ThirdTemplateController extends BaseController {
                templateId = template_doctor_survey;
                break;
            case "2":
                templateId = "";
                templateId = template_deal_with;
                break;
            default:
                templateId = template_doctor_survey;

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

@ -66,6 +66,8 @@ wechat:
   template_doctor_service:  ezr5RlX0nvh7bGU9aVsGDMJbjKDp1uMKP-AGGYXwI5g
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
   #处理结果通知
   template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
@ -115,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
@ -127,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/

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -66,6 +66,8 @@ wechat:
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
    #处理结果通知
    template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-local.yml

@ -66,6 +66,8 @@ wechat:
     template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
     #体检报告提醒
     template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
     #处理结果通知
     template_deal_with:  GyXCmXVYCD7PXi0IbHdPOD8apa-RQoSrSw-4-0pj9Go
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -66,6 +66,8 @@ wechat:
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
    #处理结果通知
    template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -65,6 +65,8 @@ wechat:
   template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
   #处理结果通知
   template_deal_with:  GyXCmXVYCD7PXi0IbHdPOD8apa-RQoSrSw-4-0pj9Go
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -65,6 +65,8 @@ wechat:
   template_doctor_service:  i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
   #体检报告提醒
   template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
   #处理结果通知
   template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

+ 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>

+ 1 - 1
pom.xml

@ -615,7 +615,7 @@
                        <target>1.8</target>
                        <compilerArguments>
                            <verbose/>
                            <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                            <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
                        </compilerArguments>
                    </configuration>
                    <version>3.1</version>