소스 검색

Merge branch 'dev' of huangwenjie/patient-co-management into dev

huangwenjie 7 년 전
부모
커밋
d18160a836

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

@ -44,7 +44,7 @@ spring:
  jpa:
    database-platform: org.hibernate.dialect.MySQL5Dialect
    hibernate.dialect: org.hibernate.dialect.MySQL5Dialect
    show-sql: true
    show-sql: false
    # REDIS
  redis:
    database: 0 # Database index used by the connection factory.
@ -141,6 +141,21 @@ Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test3
    FollowUp: wlyy_followup
    Statistics: wlyy_quota_test
    QuestionnaireWinning: wlyy_questionnaire_winning
  type:
    HealthEduArticlePatient: health_edu_article_patient_test3
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
    QuestionnaireWinning: wlyy_questionnaire_winning
  host:  http://172.19.103.68:9200
  tHost: 172.19.103.68:9300
  clusterName: jkzl
---
spring:
  profiles: test
@ -227,6 +242,21 @@ Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test3
    FollowUp: wlyy_followup
    Statistics: wlyy_quota_test
    QuestionnaireWinning: wlyy_questionnaire_winning
  type:
    HealthEduArticlePatient: health_edu_article_patient_test3
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
    QuestionnaireWinning: wlyy_questionnaire_winning
  host:  http://172.19.103.68:9200
  tHost: 172.19.103.68:9300
  clusterName: jkzl
---
spring:
  profiles: prod
@ -312,3 +342,18 @@ testPattern:
Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_prod
    FollowUp: wlyy_followup
    QuestionnaireWinning: wlyy_questionnaire_winning
  type:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_prod
    FollowUpContent: wlyy_followup_content
    QuestionnaireWinning: wlyy_questionnaire_winning
  host:  http://59.61.92.90:9065,http://59.61.92.90:9067
  tHost: 59.61.92.90:9066,59.61.92.90:9068
  clusterName: jkzl

+ 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${path.separator}${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>

+ 36 - 108
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/ImmuneService.java

@ -554,92 +554,7 @@ public class ImmuneService {
		String xml = data.getString("data");
		
//		int status = 200;
//		String xml = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n" +
//				"<ArrayOfViewImmuneModel xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
//				"\t<ViewImmuneModel>\n" +
//				"\t\t<Org>\n" +
//				"\t\t\t<ORG_ID>106</ORG_ID>\n" +
//				"\t\t\t<CODE>350211B1009</CODE>\n" +
//				"\t\t\t<NAME>思明区鹭江街道社区卫生服务中心</NAME>\n" +
//				"\t\t\t<ADDRESS /><REMARK />\n" +
//				"\t\t\t<SHORT_NAME>思明区鹭江街道社区卫生服务中心</SHORT_NAME>\n" +
//				"\t\t\t<RESERVATION_TELEPHONE />\n" +
//				"\t\t\t<NUMBER_RELEASE_TIME xsi:nil=\"true\" />\n" +
//				"\t\t\t<NUMBER_RELEASE_DAY xsi:nil=\"true\" />\n" +
//				"\t\t\t<AVG_SCORE>10</AVG_SCORE>\n" +
//				"\t\t\t<PHONE_INTRODUCTION />\n" +
//				"\t\t\t<STATUS xsi:nil=\"true\" />\n" +
//				"\t\t\t<SORT>0</SORT>\n" +
//				"\t\t\t<ORG_TYPE xsi:nil=\"true\" />\n" +
//				"\t\t\t<ZONE_CODE>350203</ZONE_CODE>\n" +
//				"\t\t\t<UPDATE_DATE xsi:nil=\"true\" />\n" +
//				"\t\t\t<ORG_IMMUNE xsi:nil=\"true\" />\n" +
//				"\t\t</Org>\n" +
//				"\t\t<DateNumbers>\n" +
//				"\t\t\t<DateNumber>\n" +
//				"\t\t\t\t<SECTIONLIST />\n" +
//				"\t\t\t\t<ID>8adf96c561193b5e0161196985600086</ID>\n" +
//				"\t\t\t\t<DATE>2018-01-29T00:00:00</DATE>\n" +
//				"\t\t\t\t<TIME>AM</TIME>\n" +
//				"\t\t\t\t<MAX>43</MAX>\n" +
//				"\t\t\t\t<USED>1</USED>\n" +
//				"\t\t\t\t<FEE>0</FEE>\n" +
//				"\t\t\t\t<STATUS>1</STATUS>\n" +
//				"\t\t\t</DateNumber>\n" +
//				"\t\t\t<DateNumber>\n" +
//				"\t\t\t\t<SECTIONLIST />\n" +
//				"\t\t\t\t<ID>8adf96c561193b5e01611969856a0101</ID>\n" +
//				"\t\t\t\t<DATE>2018-01-29T00:00:00</DATE>\n" +
//				"\t\t\t\t<TIME>PM</TIME>\n" +
//				"\t\t\t\t<MAX>41</MAX>\n" +
//				"\t\t\t\t<USED>1</USED>\n" +
//				"\t\t\t\t<FEE>0</FEE>\n" +
//				"\t\t\t\t<STATUS>1</STATUS>\n" +
//				"\t\t\t</DateNumber>\n" +
//				"\t\t\t<DateNumber>\n" +
//				"\t\t\t\t<SECTIONLIST />\n" +
//				"\t\t\t\t<ID>8adf96c5611b73ac01611e8fd97c0e82</ID>\n" +
//				"\t\t\t\t<DATE>2018-01-30T00:00:00</DATE>\n" +
//				"\t\t\t\t<TIME>AM</TIME>\n" +
//				"\t\t\t\t<MAX>43</MAX>\n" +
//				"\t\t\t\t<USED>1</USED>\n" +
//				"\t\t\t\t<FEE>0</FEE>\n" +
//				"\t\t\t\t<STATUS>1</STATUS>\n" +
//				"\t\t\t</DateNumber>\n" +
//				"\t\t\t<DateNumber>\n" +
//				"\t\t\t\t<SECTIONLIST />\n" +
//				"\t\t\t\t<ID>8adf96c5611b73ac01611e8fd9830efd</ID>\n" +
//				"\t\t\t\t<DATE>2018-01-30T00:00:00</DATE>\n" +
//				"\t\t\t\t<TIME>PM</TIME>\n" +
//				"\t\t\t\t<MAX>41</MAX>\n" +
//				"\t\t\t\t<USED>1</USED>\n" +
//				"\t\t\t\t<FEE>0</FEE>\n" +
//				"\t\t\t\t<STATUS>1</STATUS>\n" +
//				"\t\t\t</DateNumber>\n" +
//				"\t\t\t<DateNumber>\n" +
//				"\t\t\t\t<SECTIONLIST />\n" +
//				"\t\t\t\t<ID>8adf96c5611b73ac01611e8fd97c0e82</ID>\n" +
//				"\t\t\t\t<DATE>2018-01-31T00:00:00</DATE>\n" +
//				"\t\t\t\t<TIME>AM</TIME>\n" +
//				"\t\t\t\t<MAX>43</MAX>\n" +
//				"\t\t\t\t<USED>1</USED>\n" +
//				"\t\t\t\t<FEE>0</FEE>\n" +
//				"\t\t\t\t<STATUS>1</STATUS>\n" +
//				"\t\t\t</DateNumber>\n" +
//				"\t\t\t<DateNumber>\n" +
//				"\t\t\t\t<SECTIONLIST />\n" +
//				"\t\t\t\t<ID>8adf96c5611b73ac01611e8fd9830efd</ID>\n" +
//				"\t\t\t\t<DATE>2018-01-31T00:00:00</DATE>\n" +
//				"\t\t\t\t<TIME>PM</TIME>\n" +
//				"\t\t\t\t<MAX>41</MAX>\n" +
//				"\t\t\t\t<USED>1</USED>\n" +
//				"\t\t\t\t<FEE>0</FEE>\n" +
//				"\t\t\t\t<STATUS>1</STATUS>\n" +
//				"\t\t\t</DateNumber>\n" +
//				"\t\t</DateNumbers>\n" +
//				"\t</ViewImmuneModel>\n" +
//				"</ArrayOfViewImmuneModel>";
		
//		String xml = "<?xml version=\"1.0\" encoding=\"utf-16\"?><ArrayOfImmuneSchudleModel xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><ImmuneSchudleModel><ORG_ID>108</ORG_ID><ORG_CODE>350211B1012</ORG_CODE><ORG_NAME>思明区中华街道社区卫生服务中心</ORG_NAME><DateNumbers /></ImmuneSchudleModel></ArrayOfImmuneSchudleModel>";
		
		
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
@ -651,34 +566,47 @@ public class ImmuneService {
			
			
			Element ArrayOfImmuneSchudleModel = document.getRootElement();
			Element ViewImmuneModel = ArrayOfImmuneSchudleModel.element("ViewImmuneModel");
			Element Org = ViewImmuneModel.element("Org");
			Element ImmuneSchudleModel = ArrayOfImmuneSchudleModel.element("ImmuneSchudleModel");
			
			//机构信息
			Element ORG_ID = Org.element("ORG_ID");
			Element CODE = Org.element("CODE");
			Element NAME = Org.element("NAME");
			Element SHORT_NAME = Org.element("SHORT_NAME");
			Element SORT = Org.element("SORT");
			Element ZONE_CODE = Org.element("ZONE_CODE");
			Element AVG_SCORE = Org.element("AVG_SCORE");
			Element ORG_ID = ImmuneSchudleModel.element("ORG_ID");
			Element ORG_CODE = ImmuneSchudleModel.element("ORG_CODE");
			Element ORG_NAME = ImmuneSchudleModel.element("ORG_NAME");
			Element SHORT_NAME = ImmuneSchudleModel.element("SHORT_NAME");
			Element SORT = ImmuneSchudleModel.element("SORT");
			Element ZONE_CODE = ImmuneSchudleModel.element("ZONE_CODE");
			Element AVG_SCORE = ImmuneSchudleModel.element("AVG_SCORE");
			
			result.put("ORG_CODE",CODE.getTextTrim());//机构编码
			result.put("ORG_CODE",ORG_CODE.getTextTrim());//机构编码
			result.put("ORG_ID",ORG_ID.getTextTrim());//机构ID
			result.put("ORG_NAME",NAME.getTextTrim());//机构名称
			result.put("ORG_SHORT_NAME",SHORT_NAME.getTextTrim());//机构简称
			String hospitalcode = hospitalMappingDao.getCodeByMapping(CODE.getTextTrim(), "1");
			Hospital hospital = hospitalDao.findByCode(hospitalcode);
			result.put("ORG_PHOTO",hospital.getPhoto());//机构图片
			result.put("ORG_PHONE",hospital.getPhone());//机构电话
			result.put("ORG_ADDRESS",hospital.getAddress());//机构地址
			result.put("ORG_INFO",hospital.getIntro());//机构简介
			result.put("AVG_SCORE",AVG_SCORE.getTextTrim());
			result.put("SORT",SORT.getTextTrim());
			result.put("ZONE_CODE",ZONE_CODE.getTextTrim());//机构区域编码
			result.put("ORG_NAME",ORG_NAME.getTextTrim());//机构名称
			if(SHORT_NAME != null){
				result.put("ORG_SHORT_NAME",SHORT_NAME.getTextTrim());//机构简称
			}
			
			if(ORG_CODE != null){
				String hospitalcode = hospitalMappingDao.getCodeByMapping(ORG_CODE.getTextTrim(), "1");
				Hospital hospital = hospitalDao.findByCode(hospitalcode);
				result.put("ORG_PHOTO",hospital.getPhoto());//机构图片
				result.put("ORG_PHONE",hospital.getPhone());//机构电话
				result.put("ORG_ADDRESS",hospital.getAddress());//机构地址
				result.put("ORG_INFO",hospital.getIntro());//机构简介
			}
			if(AVG_SCORE != null){
				result.put("AVG_SCORE",AVG_SCORE.getTextTrim());
			}
			
			if(SORT != null){
				result.put("SORT",SORT.getTextTrim());
			}
			
			if(ZONE_CODE != null){
				result.put("ZONE_CODE",ZONE_CODE.getTextTrim());//机构区域编码
			}
			
			//排班列表
			Element DateNumbers = ViewImmuneModel.element("DateNumbers");
			Element DateNumbers = ImmuneSchudleModel.element("DateNumbers");
			Iterator<Element> iterator = DateNumbers.elementIterator();
			JSONArray DateNumbersJSON = new JSONArray();
			while(iterator.hasNext()){

+ 187 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DesUtil.java

@ -0,0 +1,187 @@
package com.yihu.wlyy.util;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
/**
 * ClassName: DesUtil 
 * @Description: 字符串加密 、解密 类
 * @author houzq  
 * @Company www.yihu.com
 * @date 2017-8-31 下午03:12:54
 */
public class DesUtil {
	private final static String DES = "DES";
	private final static String key = "zkzlcom1yihu67890123";
	/**
	 * Description 根据键值进行加密
	 * 
	 * @param data
	 * @param key
	 *            加密键byte数组
	 * @return
	 * @throws Exception
	 */
	public static String encrypt(String data, String key) throws Exception {
		byte[] bt = encrypt(data.getBytes(), key.getBytes());
		String strs = new BASE64Encoder().encode(bt);
		return strs;
	}
	public static String encrypt(String data) throws Exception {
		byte[] bt = encrypt(data.getBytes(), key.getBytes());
		String strs = new BASE64Encoder().encode(bt);
		return strs;
	}
	/**
	 * Description 根据键值进行解密
	 * 
	 * @param data
	 * @param key
	 *            加密键byte数组
	 * @return
	 * @throws IOException
	 * @throws Exception
	 */
	public static String decrypt(String data, String key) throws IOException, Exception {
		if (data == null)
			return null;
		BASE64Decoder decoder = new BASE64Decoder();
		byte[] buf = decoder.decodeBuffer(data);
		byte[] bt = decrypt(buf, key.getBytes());
		return new String(bt);
	}
	public static String decrypt(String data) throws IOException, Exception {
		if (data == null)
			return null;
		BASE64Decoder decoder = new BASE64Decoder();
		byte[] buf = decoder.decodeBuffer(data);
		byte[] bt = decrypt(buf, key.getBytes());
		return new String(bt);
	}
	
	/**
	 * Description 根据键值进行加密
	 * 
	 * @param data
	 * @param key
	 *            加密键byte数组
	 * @return
	 * @throws Exception
	 */
	private static byte[] encrypt(byte[] data, byte[] key) throws Exception {
		// 生成一个可信任的随机数源
		SecureRandom sr = new SecureRandom();
		// 从原始密钥数据创建DESKeySpec对象
		DESKeySpec dks = new DESKeySpec(key);
		// 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
		SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
		SecretKey securekey = keyFactory.generateSecret(dks);
		// Cipher对象实际完成加密操作
		Cipher cipher = Cipher.getInstance(DES);
		// 用密钥初始化Cipher对象
		cipher.init(Cipher.ENCRYPT_MODE, securekey, sr);
		return cipher.doFinal(data);
	}
	/**
	 * Description 根据键值进行解密
	 * 
	 * @param data
	 * @param key
	 *            加密键byte数组
	 * @return
	 * @throws Exception
	 */
	private static byte[] decrypt(byte[] data, byte[] key) throws Exception {
		// 生成一个可信任的随机数源
		SecureRandom sr = new SecureRandom();
		// 从原始密钥数据创建DESKeySpec对象
		DESKeySpec dks = new DESKeySpec(key);
		// 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
		SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
		SecretKey securekey = keyFactory.generateSecret(dks);
		// Cipher对象实际完成解密操作
		Cipher cipher = Cipher.getInstance(DES);
		// 用密钥初始化Cipher对象
		cipher.init(Cipher.DECRYPT_MODE, securekey, sr);
		return cipher.doFinal(data);
	}
	/**
	 * MD5工具
	 * 
	 * @param string
	 * @return
	 */
	public static String md5(String string) {
		MessageDigest md = null;
		try {
			md = MessageDigest.getInstance("md5");
			md.update(string.getBytes());
			byte[] md5Bytes = md.digest();
			return bytes2Hex(md5Bytes);
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		return null;
	}
	private static String bytes2Hex(byte[] byteArray) {
		StringBuffer strBuf = new StringBuffer();
		for (int i = 0; i < byteArray.length; i++) {
			if (byteArray[i] >= 0 && byteArray[i] < 16) {
				strBuf.append("0");
			}
			strBuf.append(Integer.toHexString(byteArray[i] & 0xFF));
		}
		return strBuf.toString();
	}
	/**
	 *  BASE64 编码
	 * @param s
	 * @return
	 */
	public static String getBASE64(String s) {
		if (s == null)
			return null;
		return (new BASE64Encoder()).encode(s.getBytes());
	}
	// 将 BASE64 编码的字符串 s 进行解码
	public static String getFromBASE64(String s) {
		if (s == null)
			return null;
		BASE64Decoder decoder = new BASE64Decoder();
		try {
			byte[] b = decoder.decodeBuffer(s);
			return new String(b);
		} catch (Exception e) {
			return null;
		}
	}
}