|  | @ -42,13 +42,12 @@ public class HealthEduArticleService extends BaseService {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      * 保存福州健康教育文章
 |  |      * 保存福州健康教育文章
 | 
												
													
														
															|  |      *
 |  | 
 | 
												
													
														
															|  |      * @param result xml格式
 |  |      * @param result xml格式
 | 
												
													
														
															|  |      * @return
 |  |      * @return
 | 
												
													
														
															|  |      * @throws Exception
 |  |      * @throws Exception
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  |     public int saveHealthEduArticles(String result) throws Exception {
 |  |     public int saveHealthEduArticles(String result) throws Exception {
 | 
												
													
														
															|  |         List<Map<String, String>> listmap = Xml2ListMap.xml2List(result);
 |  | 
 | 
												
													
														
															|  | 
 |  |         List<Map<String,String>> listmap= Xml2ListMap.xml2List(result);
 | 
												
													
														
															|  |         String code = null;
 |  |         String code = null;
 | 
												
													
														
															|  |         String title = null;
 |  |         String title = null;
 | 
												
													
														
															|  |         String imgUrl = null;
 |  |         String imgUrl = null;
 | 
												
											
												
													
														
															|  | @ -56,13 +55,13 @@ public class HealthEduArticleService extends BaseService {
 | 
												
													
														
															|  |         String keyWord = null;
 |  |         String keyWord = null;
 | 
												
													
														
															|  |         String type = null;
 |  |         String type = null;
 | 
												
													
														
															|  |         int rows = 0;
 |  |         int rows = 0;
 | 
												
													
														
															|  |         for (Map<String, String> temp : listmap) {
 |  | 
 | 
												
													
														
															|  | 
 |  |         for(Map<String,String> temp : listmap){
 | 
												
													
														
															|  |             code = temp.get("xml.Result.MessageId");
 |  |             code = temp.get("xml.Result.MessageId");
 | 
												
													
														
															|  |             title = temp.get("xml.Result.MessageTitle");
 |  |             title = temp.get("xml.Result.MessageTitle");
 | 
												
													
														
															|  |             imgUrl = temp.get("xml.Result.ImageUrlSmall");
 |  |             imgUrl = temp.get("xml.Result.ImageUrlSmall");
 | 
												
													
														
															|  |             content = temp.get("xml.Result.MessageContent");
 |  |             content = temp.get("xml.Result.MessageContent");
 | 
												
													
														
															|  |             keyWord = temp.get("xml.Result.MessageType");
 |  |             keyWord = temp.get("xml.Result.MessageType");
 | 
												
													
														
															|  |             switch (keyWord) {
 |  | 
 | 
												
													
														
															|  | 
 |  |             switch (keyWord){
 | 
												
													
														
															|  |                 case "1":
 |  |                 case "1":
 | 
												
													
														
															|  |                     keyWord = "高血压";
 |  |                     keyWord = "高血压";
 | 
												
													
														
															|  |                     type = "2";
 |  |                     type = "2";
 | 
												
											
												
													
														
															|  | @ -102,19 +101,15 @@ public class HealthEduArticleService extends BaseService {
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             String sql = "INSERT INTO wlyy_health_edu_article  " +
 |  |             String sql = "INSERT INTO wlyy_health_edu_article  " +
 | 
												
													
														
															|  |                     "VALUES(NULL,?,?,?,?,?,NULL,?,?)";
 |  | 
 | 
												
													
														
															|  |             String summary = content.replaceAll("</?[^>]+>", "")
 |  | 
 | 
												
													
														
															|  |                     .replaceAll("<a>\\s*|\t|\r|\n</a>", "")
 |  | 
 | 
												
													
														
															|  |                     .replaceAll(" ", "").replaceAll(" ", "");
 |  | 
 | 
												
													
														
															|  |             rows = jdbcTemplate.update(sql, code, title, summary, imgUrl, content, keyWord, type);
 |  | 
 | 
												
													
														
															|  |             rows += rows;
 |  | 
 | 
												
													
														
															|  | 
 |  |                     "VALUES(NULL,?,?,?,?,NULL,?,?)";
 | 
												
													
														
															|  | 
 |  |             rows = jdbcTemplate.update(sql,code,title,imgUrl,content,keyWord,type);
 | 
												
													
														
															|  | 
 |  |             rows+=rows;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         return rows;
 |  |         return rows;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      * 由请求参数获取福州健康教育文章
 |  |      * 由请求参数获取福州健康教育文章
 | 
												
													
														
															|  |      *
 |  | 
 | 
												
													
														
															|  |      * @param params
 |  |      * @param params
 | 
												
													
														
															|  |      * @return
 |  |      * @return
 | 
												
													
														
															|  |      * @throws Exception
 |  |      * @throws Exception
 | 
												
											
												
													
														
															|  | @ -125,19 +120,19 @@ public class HealthEduArticleService extends BaseService {
 | 
												
													
														
															|  | //      获取远程地址url 、App Key 和 App secret  
 |  | //      获取远程地址url 、App Key 和 App secret  
 | 
												
													
														
															|  |         String prixUrl = SystemConf.getInstance().getYihuOpenPlatformUrl();
 |  |         String prixUrl = SystemConf.getInstance().getYihuOpenPlatformUrl();
 | 
												
													
														
															|  | //        String prixUrl ="http://apitest.yihu.com.cn/OpenPlatform/cgiBin/1.0/";
 |  | //        String prixUrl ="http://apitest.yihu.com.cn/OpenPlatform/cgiBin/1.0/";
 | 
												
													
														
															|  |         String appId = SystemConf.getInstance().getYihuOpenPlatformAppId();
 |  | 
 | 
												
													
														
															|  | 
 |  |         String appId =SystemConf.getInstance().getYihuOpenPlatformAppId();
 | 
												
													
														
															|  | //        String appId = "9000276";
 |  | //        String appId = "9000276";
 | 
												
													
														
															|  |         String secret = SystemConf.getInstance().getYihuOpenPlatformSecret();
 |  |         String secret = SystemConf.getInstance().getYihuOpenPlatformSecret();
 | 
												
													
														
															|  | //        String secret = "OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA";
 |  | //        String secret = "OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA";
 | 
												
													
														
															|  | //      请求参数(i健康接口说明文档)正式接口 由prixUrl获取apixUrl
 |  | //      请求参数(i健康接口说明文档)正式接口 由prixUrl获取apixUrl
 | 
												
													
														
															|  |         String apiUrl = prixUrl + "jkjy/JkjyImpl/queryHealtheducationForIHealth";
 |  | 
 | 
												
													
														
															|  | 
 |  |         String apiUrl = prixUrl+"jkjy/JkjyImpl/queryHealtheducationForIHealth";
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | //      获取加密后参数集合
 |  | //      获取加密后参数集合
 | 
												
													
														
															|  |         Map<String, String> param = httpClientUtil.getSecretParams(params, appId, secret);
 |  | 
 | 
												
													
														
															|  | 
 |  |         Map<String,String> param = httpClientUtil.getSecretParams(params,appId,secret);
 | 
												
													
														
															|  | //      拼接请求URL (加密签名+apiUrl)
 |  | //      拼接请求URL (加密签名+apiUrl)
 | 
												
													
														
															|  | //      获取返回数据( HTTP post请求,参数需要utf-8编码)
 |  | //      获取返回数据( HTTP post请求,参数需要utf-8编码)
 | 
												
													
														
															|  |         String results = httpClientUtil.httpPost(apiUrl, param);
 |  | 
 | 
												
													
														
															|  | 
 |  |         String  results = httpClientUtil.httpPost(apiUrl,param);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         return results;
 |  |         return results;
 | 
												
											
												
													
														
															|  | @ -214,24 +209,26 @@ public class HealthEduArticleService extends BaseService {
 | 
												
													
														
															|  |         List<Object> params = new ArrayList<Object>();
 |  |         List<Object> params = new ArrayList<Object>();
 | 
												
													
														
															|  |         String sql = "select " +
 |  |         String sql = "select " +
 | 
												
													
														
															|  |                 "    a.article" +
 |  |                 "    a.article" +
 | 
												
													
														
															|  |                 "    ,a.title" +
 |  | 
 | 
												
													
														
															|  |                 "    ,a.url" +
 |  | 
 | 
												
													
														
															|  | 
 |  |                 "    ,b.title" +
 | 
												
													
														
															|  | 
 |  |                 "    ,b.url" +
 | 
												
													
														
															|  |                 "    ,a.czrq" +
 |  |                 "    ,a.czrq" +
 | 
												
													
														
															|  |                 "    ,a.summary content" +
 |  | 
 | 
												
													
														
															|  | 
 |  |                 "    ,b.summary content" +
 | 
												
													
														
															|  |                 "    ,d.code" +
 |  |                 "    ,d.code" +
 | 
												
													
														
															|  |                 "    ,d.name" +
 |  |                 "    ,d.name" +
 | 
												
													
														
															|  |                 "    ,d.photo" +
 |  |                 "    ,d.photo" +
 | 
												
													
														
															|  |                 "    ,a.admin_team_code" +
 |  |                 "    ,a.admin_team_code" +
 | 
												
													
														
															|  |                 "  from" +
 |  |                 "  from" +
 | 
												
													
														
															|  |                 "    wlyy_health_edu_article_patient a" +
 |  |                 "    wlyy_health_edu_article_patient a" +
 | 
												
													
														
															|  | 
 |  |                 "    ,wlyy_health_edu_article b" +
 | 
												
													
														
															|  |                 "    ,wlyy_doctor d" +
 |  |                 "    ,wlyy_doctor d" +
 | 
												
													
														
															|  |                 "  where" +
 |  |                 "  where" +
 | 
												
													
														
															|  |                 "    a.doctor = d.code " +
 |  | 
 | 
												
													
														
															|  | 
 |  |                 "    a.article = b.code " +
 | 
												
													
														
															|  | 
 |  |                 "    and a.doctor = d.code " +
 | 
												
													
														
															|  |                 "    and a.patient = ?" +
 |  |                 "    and a.patient = ?" +
 | 
												
													
														
															|  |                 "    and a.admin_team_code = ?" +
 |  |                 "    and a.admin_team_code = ?" +
 | 
												
													
														
															|  |                 "  order by a.czrq desc limit " + page * pageSize + "," + pageSize;
 |  | 
 | 
												
													
														
															|  | 
 |  |                 "  order by a.czrq desc limit " + page*pageSize + "," + pageSize;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{patient, teamCode});
 |  | 
 | 
												
													
														
															|  | 
 |  |         List<Map<String,Object>> result = jdbcTemplate.queryForList(sql,new Object[]{patient,teamCode});
 | 
												
													
														
															|  |         return result;
 |  |         return result;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 |