Bläddra i källkod

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

trick9191 7 år sedan
förälder
incheckning
49fb4a6245
19 ändrade filer med 497 tillägg och 57 borttagningar
  1. 59 42
      common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticleES.java
  2. 15 1
      edu-article/JkEdu/WebRoot/WEB-INF/classes/Article.sql.xml
  3. 8 1
      edu-article/JkEdu/WebRoot/WEB-INF/classes/articlePc.sql.xml
  4. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  5. 15 1
      edu-article/JkEdu/src/Article.sql.xml
  6. 8 1
      edu-article/JkEdu/src/articlePc.sql.xml
  7. 2 2
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java
  8. 1 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp
  9. 1 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java
  10. 1 1
      patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml
  11. 1 1
      patient-co/patient-co-wlyy-job/src/main/resources/application-test.yml
  12. 167 0
      patient-co/patient-co-wlyy/doc/技术文档/es/健教文章新增索引.txt
  13. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java
  14. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  15. 82 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/iot/IotDeviceService.java
  16. 9 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java
  17. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/HealthEduArticlePatientModel.java
  18. 112 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/iot/IotDeviceController.java
  19. 3 3
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

+ 59 - 42
common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticleES.java

@ -16,54 +16,60 @@ import java.util.List;
public class HealthEduArticleES {
    @JestId
    private String id;
    private String batchNo;//批次号记录发送所属批次
    private String patientCode; // 患者标识
    private String patientName; // 患者名称
    private String doctorCode;  //发送人code(如管理员推送,保存登陆者code)
    private String doctorName;  //发送人名称(如管理员推送,保存登陆者name)
//    private String sendCode;   // 发送人code(如管理员推送,保存登陆者code)
    private String sendName;   // 推送的医生名称(包括医生本人、卫计委)
    private String sendPic;   // 发送人头像
    private String sendSex;   // 发送人性别
    private Long adminTeamCode;// 行政团队
    private String adminTeamName;// 行政团队
    private String hospital; // 所属机构
    private String hospitalName; // 所属机构
    private String town; // 所属区划
    private String townName; // 所属区划
    //说明:如医生推送文章给5个居民,则保存5条userType=1的记录和1条userType=2的记录(共6条)batchNo批次号一样。
    private String batchNo;//批次号记录发送所属批次(ES:必填)
    private String patientCode; // 患者标识(ES)(根据userType的值,userType=1,必填;userType=2,为空)
    private String patientName; // 患者名称(ES)(根据userType的值,userType=1,必填;userType=2,为空)
    private String doctorCode;  //发送人code(doctor表中的code)(ES:必填)
    private String doctorName;  //发送人名称(doctor表中的name)(ES:必填)
    private String sendName;   // 推送人的名称(包括医生本人、卫计委)(ES:必填)(如医生本人推送则记录医生名称,如管理员推送则记录管理员的角色名称)
    //备注:从发送人的信息中获取(doctor表获取)
    private String sendPic;   // 发送人头像(ES)
    private String sendSex;   // 发送人性别(ES)
    private Long adminTeamCode;// 行政团队(ES)
    private String adminTeamName;// 行政团队(ES)
    private String hospital; // 所属机构(ES)
    private String hospitalName; // 所属机构(ES)
    private String town; // 所属区划(ES)
    private String townName; // 所属区划(ES)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date createTime;  // 创建时间
    private Integer sendType;//发送类型 1医生发送 2(管理员)卫纪委发送
    private String sendLevel;   // 发送人级别  1专科医生,2全科医生,3健康管理师 4 管理员
    private String articleId;  //文章id
    private String articleTitle;  //文章标题
    private String articleCover;//文章封面
    private String articleContent; //文章内容
    private String articleCategoryId;//文章类别
    private String firstLevelCategoryId;//文章一级类别id
    private String firstLevelCategoryName;//文章一级类别Name
    private String secondLevelCategoryId;//文章二级类别id
    private String secondLevelCategoryName;//文章二级类别Name
    private String operatorId;//文章作者Id
    private Integer isRead=0;//文章是否已读 0未读,1已读
    private String articleSource;//文章来源
    private List<RoleVo> roleList;//发送者角色
    private String leaveWords;//医生留言
    private String currentUserRoleCode;//发送者当前登录的角色code  currentUserRoleCode与currentUserRoleLevel要一一对应取
    private String currentUserRoleLevel;//发送者当前登录的角色级别  省,市,区,机构,对应1.2.3.4   旧数据默认是2
    private Integer sendSource; //1或者为空 i健康后台推送  2PC端推送
    private Integer allCount;//所有的推送数目
    private Long readNumber;//阅读数(备注和浏览数不一样)
    private Date createTime;  // 创建时间(ES:必填)
    private Integer sendType;//发送类型 1医生发送 2(管理员)卫纪委发送(ES:必填)
    private String sendLevel;   // 发送人级别  1专科医生,2全科医生,3健康管理师 4 管理员(ES)
    private String articleId;  //文章id(ES:必填)
    private String articleTitle;  //文章标题(ES:必填)
    private String articleCover;//文章封面(ES:必填)
    private String articleContent; //文章内容(ES:必填)
    private String articleCategoryId;//文章类别(ES:必填)
    private String firstLevelCategoryId;//文章一级类别id(ES:必填)
    private String firstLevelCategoryName;//文章一级类别Name(ES:必填)
    private String secondLevelCategoryId;//文章二级类别id(ES:必填)
    private String secondLevelCategoryName;//文章二级类别Name(ES:必填)
    private String operatorId;//文章作者Id(ES:必填)
    private Integer isRead=0;//文章是否已读 0未读,1已读(ES:必填)
    private String articleSource;//文章来源(ES:必填)(备注:医生所属机构名称)
    private List<RoleVo> roleList;//发送者角色List(ES:非必填)(备注:管理员有值,普通医生为空)
    private String leaveWords;//医生留言(ES:非必填)
    //说明:如普通医生推送则保存doctor表中的hospital字段,如管理员推送则保存当前角色的code(取wlyy_user_role表中的role字段)
    private String currentUserRoleCode;//发送者当前登录的角色code(ES:必填)
    private String currentUserRoleLevel;//发送者当前登录的角色级别,1、省,2、市,3、区,4、机构(ES:必填)
    private Integer sendSource; //1或者为空 i健康后台推送  2PC端推送(默认旧数据为1)(为后续平台推送统计做备用字段)
    private Integer allCount;//所有的推送数目(ES:必填)
    private Long readNumber;//阅读数(备注:和浏览数不一样)(不保存ES)
    @Transient
    private Boolean newArricleFlag;//新版文章推送标志
    private Boolean newArricleFlag;//新版文章推送标志(不保存ES)
    private Integer userType; // 1、患者,2医生
    //说明:如医生推送文章给5个居民,则保存5条userType=1的记录和1条userType=2的记录(共6条)
    //业务需求:userType=1为居民被推送文章列表;userType=2医生推送的文章列表;
    private Integer userType; // 1、患者,2医生(ES:必填)
    private Date czrq;//阅读时间(默认为空,isRead=0;如isRead=1已读,则该字段有值)(ES:非必填)
    public String getId() {
        return id;
@ -376,4 +382,15 @@ public class HealthEduArticleES {
    public void setReadNumber(Long readNumber) {
        this.readNumber = readNumber;
    }
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
    public HealthEduArticleES() {
    }
}

+ 15 - 1
edu-article/JkEdu/WebRoot/WEB-INF/classes/Article.sql.xml

@ -8,6 +8,13 @@
		
			]]>
		</Sql>
		<!--<Sql name='getArticleList'>
			<![CDATA[
		select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.PushNumber,0) as CommentNumber, IFNULL(n.PushNumber,0) as PushNumber
		from Org_Article m JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
		</Sql>-->
		<Sql name='getArticleListCount'>
			<![CDATA[
	select count(*) from Org_Article m 
@ -15,10 +22,17 @@ LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Conditi
			]]>
		</Sql>
		<Sql name='getCollectionArticleList'>
		<!--<Sql name='getCollectionArticleList'>
			<![CDATA[
select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber, IFNULL(n.PushNumber,0) as PushNumber from (
select m.* from Org_Article m  INNER JOIN User_ArticleCollection n on  m.articleid=n.ArticleId and  1=1 @UserParam) as aa LEFT JOIN 
User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
		</Sql>-->
		<Sql name='getCollectionArticleList'>
			<![CDATA[
select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber, IFNULL(n.PushNumber,0) as PushNumber from (
select m.* from Org_Article m  INNER JOIN User_ArticleCollection n on  m.articleid=n.ArticleId and  1=1 @UserParam) as aa LEFT JOIN
User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
		</Sql>

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

@ -1,12 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<das-client>
	<Sqls> 
		 <Sql name='getArticlePcList'>
		 <!--<Sql name='getArticlePcList'>
		 <![CDATA[
				select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber ,IFNULL(n.PushNumber,0) as PushNumber ,
				(select count(1) from user_articlecollection a where a.ArticleId=m.ArticleId  @Condition2 )as collectionType, IFNULL(n.PushNumber,0) as PushNumber 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='getArticlePcList'>
			<![CDATA[
				select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber ,IFNULL(n.PushNumber,0) as PushNumber ,
				(select count(1) from user_articlecollection a where a.ArticleId=m.ArticleId  @Condition2 )as collectionType, IFNULL(n.PushNumber,0) as PushNumber 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'>
			<![CDATA[

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


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

@ -8,6 +8,13 @@
		
			]]>
		</Sql>
		<!--<Sql name='getArticleList'>
			<![CDATA[
		select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.PushNumber,0) as CommentNumber, IFNULL(n.PushNumber,0) as PushNumber
		from Org_Article m JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
		</Sql>-->
		<Sql name='getArticleListCount'>
			<![CDATA[
	select count(*) from Org_Article m 
@ -15,10 +22,17 @@ LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Conditi
			]]>
		</Sql>
		<Sql name='getCollectionArticleList'>
		<!--<Sql name='getCollectionArticleList'>
			<![CDATA[
select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber, IFNULL(n.PushNumber,0) as PushNumber from (
select m.* from Org_Article m  INNER JOIN User_ArticleCollection n on  m.articleid=n.ArticleId and  1=1 @UserParam) as aa LEFT JOIN 
User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
		</Sql>-->
		<Sql name='getCollectionArticleList'>
			<![CDATA[
select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber, IFNULL(n.PushNumber,0) as PushNumber from (
select m.* from Org_Article m  INNER JOIN User_ArticleCollection n on  m.articleid=n.ArticleId and  1=1 @UserParam) as aa LEFT JOIN
User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
		</Sql>

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

@ -1,12 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<das-client>
	<Sqls> 
		 <Sql name='getArticlePcList'>
		 <!--<Sql name='getArticlePcList'>
		 <![CDATA[
				select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber ,IFNULL(n.PushNumber,0) as PushNumber ,
				(select count(1) from user_articlecollection a where a.ArticleId=m.ArticleId  @Condition2 )as collectionType, IFNULL(n.PushNumber,0) as PushNumber 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='getArticlePcList'>
			<![CDATA[
				select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber ,IFNULL(n.PushNumber,0) as PushNumber ,
				(select count(1) from user_articlecollection a where a.ArticleId=m.ArticleId  @Condition2 )as collectionType, IFNULL(n.PushNumber,0) as PushNumber 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'>
			<![CDATA[

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

@ -590,7 +590,7 @@ public class ArticleDao {
//			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
//			sql.addParamValue(vo.getOperatorRoleCode());
		}
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+" and OperatorRoleCode = "+vo.getOperatorRoleCode()+")");
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+" and OperatorRoleCode = '"+vo.getOperatorRoleCode()+"')");
		if("1".equals(vo.getOperatorRoleLevel())){//省
//			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,3)+"%' ");
		}else if("2".equals(vo.getOperatorRoleLevel())){//市
@ -719,7 +719,7 @@ public class ArticleDao {
//			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
//			sql.addParamValue(vo.getOperatorRoleCode());
		}
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+" and OperatorRoleCode = "+vo.getOperatorRoleCode()+")");
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+" and OperatorRoleCode = '"+vo.getOperatorRoleCode()+"')");
		if("1".equals(vo.getOperatorRoleLevel())){//省
//			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,3)+"%' ");
		}else if("2".equals(vo.getOperatorRoleLevel())){//市

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

@ -138,7 +138,7 @@
							<sec:authorize url="/admin/static/pay/initial">
								<li><a href="javascript:locationMenu('staticPay');">支付统计报表</a></li>
							</sec:authorize>
							<sec:authorize url="/admin/static/static/center">
							<sec:authorize url="/admin/static/center">
						</ul>
					</div>
				</div>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java


+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml

@ -105,7 +105,7 @@ activemq:
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test
    healtHarticleQueue: healthArticleChannel_devtest
  consumers:
    count: 10 #消费者集群数

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/resources/application-test.yml

@ -110,7 +110,7 @@ activemq:
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送
    healtHarticleQueue: healthArticleChannel_dev  #健康文章推送
  consumers:
    count: 10 #消费者集群数

+ 167 - 0
patient-co/patient-co-wlyy/doc/技术文档/es/健教文章新增索引.txt

@ -0,0 +1,167 @@
创建索引
POST  http://172.19.103.68:9200/health_edu_article_patient_test
查询索引
GET http://172.19.103.68:9200/health_edu_article_patient_test/
给索引加mapping
POST http://172.19.103.68:9200/health_edu_article_patient_test/health_edu_article_patient_test/_mapping
{
    "health_edu_article_patient": {
        "properties": {
            "currentUserRoleCode": {
                "index": "not_analyzed",
                "type": "string"
            },
            "isRead": {
                "type": "integer"
            },
            "allCount": {
                "type": "integer"
            },
            "articleCover": {
                "index": "not_analyzed",
                "type": "string"
            },
            "doctorName": {
                "index": "not_analyzed",
                "type": "string"
            },
            "adminTeamCode": {
                "type": "long"
            },
            "articleContent": {
                "index": "not_analyzed",
                "type": "string"
            },
            "sendLevel": {
                "index": "not_analyzed",
                "type": "string"
            },
            "id": {
                "type": "string"
            },
            "hospital": {
                "index": "not_analyzed",
                "type": "string"
            },
            "operatorId": {
                "index": "not_analyzed",
                "type": "string"
            },
            "secondLevelCategoryName": {
                "index": "not_analyzed",
                "type": "string"
            },
            "patientCode": {
                "index": "not_analyzed",
                "type": "string"
            },
            "sendPic": {
                "index": "not_analyzed",
                "type": "string"
            },
            "sendSource": {
                "type": "integer"
            },
            "patientName": {
                "index": "not_analyzed",
                "type": "string"
            },
            "articleTitle": {
                "index": "not_analyzed",
                "type": "string"
            },
            "batchNo": {
                "index": "not_analyzed",
                "type": "string"
            },
            "currentUserRoleLevel": {
                "index": "not_analyzed",
                "type": "string"
            },
            "firstLevelCategoryId": {
                "index": "not_analyzed",
                "type": "string"
            },
            "townName": {
                "index": "not_analyzed",
                "type": "string"
            },
            "adminTeamName": {
                "index": "not_analyzed",
                "type": "string"
            },
            "sendName": {
                "index": "not_analyzed",
                "type": "string"
            },
            "town": {
                "index": "not_analyzed",
                "type": "string"
            },
            "articleId": {
                "index": "not_analyzed",
                "type": "string"
            },
            "articleCategoryId": {
                "index": "not_analyzed",
                "type": "string"
            },
            "secondLevelCategoryId": {
                "index": "not_analyzed",
                "type": "string"
            },
            "hospitalName": {
                "index": "not_analyzed",
                "type": "string"
            },
            "roleList": {
                "type": "nested",
                "properties": {
                    "code": {
                        "index": "not_analyzed",
                        "type": "string"
                    },
                    "name": {
                        "index": "not_analyzed",
                        "type": "string"
                    }
                }
            },
            "firstLevelCategoryName": {
                "index": "not_analyzed",
                "type": "string"
            },
            "articleSource": {
                "index": "not_analyzed",
                "type": "string"
            },
            "createTime": {
                "format": "strict_date_optional_time||epoch_millis",
                "type": "date"
            },
            "czrq": {
                "format": "strict_date_optional_time||epoch_millis",
                "type": "date"
            },
            "leaveWords": {
                "index": "not_analyzed",
                "type": "string"
            },
            "doctorCode": {
                "index": "not_analyzed",
                "type": "string"
            },
            "sendType": {
                "type": "integer"
            },
            "userType": {
                "type": "integer"
            },
            "sendSex": {
                "index": "not_analyzed",
                "type": "string"
            }
        }
    }
  }

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -175,6 +175,7 @@ public class SwaggerConfig {
                        regex("/wechat/.*"),
                        regex("/nofilter/.*"),
                        regex("/idc10/.*"),
                        regex("/iot/.*"),
                        regex("/im_new/.*"),
                        regex("/dataHandling/.*"),
                        regex("/version/.*"),

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

@ -161,6 +161,7 @@ public class JMJkEduArticleService extends BaseService {
            heapm.setSendCode(one.getDoctorCode());
//            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            heapm.setCreateTime(DateUtil.dateToStrLong(one.getCreateTime()));
            heapm.setCzrq(DateUtil.dateToStrLong(one.getCzrq()));//阅读时间
            heapm.setArticleId(article.getString("articleId"));
            heapm.setAttachedTitle(article.getString("articleTitle"));
            heapm.setAttachedContent(article.getString("articleContent"));
@ -1138,6 +1139,7 @@ public class JMJkEduArticleService extends BaseService {
            }
            for (HealthEduArticleES healthEduArticleES:dataList) {
                healthEduArticleES.setIsRead(1);
                healthEduArticleES.setCzrq(new Date());
            }
            elastricSearchSave.save(dataList,esIndex,esType);
            jestClient.shutdownClient();
@ -1180,6 +1182,7 @@ public class JMJkEduArticleService extends BaseService {
            }
            for (HealthEduArticleES healthEduArticleES:dataList) {
                healthEduArticleES.setIsRead(1);
                healthEduArticleES.setCzrq(new Date());
            }
            elastricSearchSave.save(dataList,esIndex,esType);
            jestClient.shutdownClient();

+ 82 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/iot/IotDeviceService.java

@ -0,0 +1,82 @@
package com.yihu.wlyy.service.third.iot;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * 物联网设备对接
 * @author yeshijie on 2018/1/3.
 */
@Service
public class IotDeviceService {
//    @Value("${}")
    private String baseUrl = "https://iot.xmtyw.cn/";
    private String grantType = "client_credentials&";
    private String clientId = "Va5yQRHlA4Fq4eR3LT0vuXV4&";
    private String clientSecret = "0rDSjzQ20XUj5itV7WRtznPQSzr5pVw2";
    @Autowired
    private HttpClientUtil httpClientUtil;
    private String accessToken = "";
    public String getAccessToken(){
        String url = baseUrl+"/oauth/2.0/token";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("grant_type",grantType));
        params.add(new BasicNameValuePair("client_id",clientId));
        params.add(new BasicNameValuePair("client_secret",clientSecret));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return null;
    }
    /**
     * 设备注册及绑定
     * @return
     */
    public String registedevice(JSONObject json){
        json.put("access_token",accessToken);
        String url = baseUrl+"/registedevice";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("json",json.toString()));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return null;
    }
    /**
     * 数据上传
     * @param json
     * @return
     */
    public String upload(JSONObject json){
        json.put("access_token",accessToken);
        String url = baseUrl+"/upload";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("json",json.toString()));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return null;
    }
    /**
     * 查询
     * @param json
     * @return
     */
    public String search(JSONObject json){
        json.put("access_token",accessToken);
        String url = baseUrl+"/upload";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("json",json.toString()));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return null;
    }
}

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

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.jimeiJkEduPC;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.es.entity.HealthEduArticleES;
import com.yihu.wlyy.service.app.health.HealthEduArticleLabelService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.web.BaseController;
@ -39,6 +40,8 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    private String esIndex;
    @Autowired
    private ElasticsearchUtil elasticsearchUtil;
    @Autowired
    private HealthEduArticleLabelService healthEduArticleLabelService;
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加、编辑文章")
@ -137,8 +140,12 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize,sEcho,roleType);
            
            
            if(StringUtils.isNotBlank(articleTitle)){
                //记录搜索记录
                healthEduArticleLabelService.saveOrUpdateLabel(articleTitle,getUID());
            }
            //判断文章列表是否有推送过该居民
            if(StringUtils.isNotBlank(patient)){
                com.alibaba.fastjson.JSONArray pushresponse = jmJkEduArticleService.pushArticleLogs(0,0,patient,"");

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/HealthEduArticlePatientModel.java

@ -59,6 +59,7 @@ public class HealthEduArticlePatientModel {
    private String computeTime;//时间
    private String photo;//医生头像
    private String operatorName;//文章作者
    private String czrq;//阅读时间
    public String getSendCode() {
        return sendCode;
@ -267,4 +268,12 @@ public class HealthEduArticlePatientModel {
    public void setReadNumber(Long readNumber) {
        this.readNumber = readNumber;
    }
    
    public String getCzrq() {
        return czrq;
    }
    
    public void setCzrq(String czrq) {
        this.czrq = czrq;
    }
}

+ 112 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/iot/IotDeviceController.java

@ -0,0 +1,112 @@
package com.yihu.wlyy.web.third.iot;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.third.iot.IotDeviceService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
 * @author yeshijie on 2018/1/3.
 */
@RestController
@RequestMapping(value = "/iot",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "物联网测试类")
public class IotDeviceController extends BaseController{
    @Autowired
    private IotDeviceService iotDeviceService;
    @RequestMapping(value = "/registedevice",method = RequestMethod.POST)
    @ApiOperation("注册设备")
    public String registedevice(){
        try {
            JSONObject json = new JSONObject();
            JSONObject js = new JSONObject();
            js.put("sn","2638234828");
            js.put("ext_code","1");
            js.put("device_name","血压计-康为A206G");
            js.put("device_model","血压计-康为A206G");
            js.put("idcard","350429198905194016");
            js.put("username","邹林");
            js.put("manufacture_code","");
            js.put("manufacture_name","");
            js.put("owner_org_code","");
            js.put("owner_org_name","");
            js.put("sale_org_code","");
            js.put("sale_org_name","");
            js.put("manufacture_tel","");
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(js);
            json.put("data",jsonArray);
            String re = iotDeviceService.registedevice(json);
            return write(200, "注册设备成功!", "data", re);
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/upload1",method = RequestMethod.POST)
    @ApiOperation("不含居民身份的数据上传协议")
    public String upload1(){
        try {
            JSONObject json = new JSONObject();
            JSONObject js = new JSONObject();
            js.put("measure_time","2018-01-01 01:01:01");
            js.put("systolic","111");
            js.put("diastolic","60");
            js.put("pulse","66");
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(js);
            json.put("data",jsonArray);
            json.put("sn","2638234828");
            json.put("ext_code","1");
            json.put("device_name","血压计-康为A206G");
            json.put("device_model","血压计-康为A206G");
            String re = iotDeviceService.upload(json);
            return write(200, "注册设备成功!", "data", re);
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/upload2",method = RequestMethod.POST)
    @ApiOperation("不含居民身份的数据上传协议")
    public String upload2(){
        try {
            JSONObject json = new JSONObject();
            JSONObject js = new JSONObject();
            js.put("measure_time","2018-01-01 11:01:01");
            js.put("blood_sugar","6.7");
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(js);
            json.put("data",jsonArray);
            json.put("data",jsonArray);
            json.put("sn","2638234828");
            json.put("ext_code","1");
            json.put("device_name","血压计-康为A206G");
            json.put("device_model","血压计-康为A206G");
            json.put("idcard","350429198905194016");
            json.put("username","邹林");
            String re = iotDeviceService.upload(json);
            return write(200, "注册设备成功!", "data", re);
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
}

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

@ -105,11 +105,11 @@ pushMes:
  redis_prescription_title: redisMessage
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test3
    HealthEduArticlePatient: health_edu_article_patient_test6
    FollowUp: wlyy_followup
    Statistics: wlyy_quota_test
  type:
    HealthEduArticlePatient: health_edu_article_patient_test3
    HealthEduArticlePatient: health_edu_article_patient_test6
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
  host:  http://172.19.103.68:9200
@ -129,7 +129,7 @@ activemq:
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送
##如果是外网项目就是flase 内网是true
neiwang: