Browse Source

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

huangwenjie 7 years ago
parent
commit
b0040f0723

+ 8 - 8
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/GuahaoController.java

@ -285,9 +285,9 @@ public class GuahaoController {
	@RequestMapping(value = "/imm/GetOrgNumberList",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("计免:获取免疫接种号源")
	public Result GetOrgNumberList(@ApiParam(name="orgId",value="机构编码",defaultValue = "")
	public Result GetOrgNumberList(@ApiParam(name="orgId",value="机构编码",defaultValue = "350206")
	                               @RequestParam String orgId,
	                               @ApiParam(name="ScheduleId",value="排班ID",defaultValue = "")
	                               @ApiParam(name="ScheduleId",value="排班ID",defaultValue = "350211B10402017080901")
	                               @RequestParam String ScheduleId)
	{
		try {
@ -304,16 +304,16 @@ public class GuahaoController {
	@RequestMapping(value = "/imm/GetOrgScheduleList",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("计免:获取免疫接种排班信息")
	public Result GetOrgScheduleList(@ApiParam(name="OrgCode",value="机构编码",defaultValue = "")
	public Result GetOrgScheduleList(@ApiParam(name="OrgCode",value="机构编码",defaultValue = "350211B1040")
	                               @RequestParam String OrgCode,
	                               @ApiParam(name="strStart",value="开始日期",defaultValue = "")
	                               @RequestParam String strStart,
	                               @ApiParam(name="strEnd",value="结束日期",defaultValue = "")
	                               @RequestParam String strEnd)
	                               @ApiParam(name="StartTime",value="开始日期",defaultValue = "2017-08-09")
	                               @RequestParam String StartTime,
	                               @ApiParam(name="EndTime",value="结束日期",defaultValue = "2017-08-10")
	                               @RequestParam String EndTime)
	{
		try {
			
			String data = guahaoService.GetOrgScheduleList(OrgCode,strStart,strEnd);
			String data = guahaoService.GetOrgScheduleList(OrgCode,StartTime,EndTime);
			
			return Result.success("获取免疫接种排班信息!",data);
		} catch (Exception ex) {

+ 3 - 42
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/guahao/GuahaoService.java

@ -1332,45 +1332,6 @@ public class GuahaoService {
        return immPostSecond("GetOrgImmuneList","计免预约-获取免疫接种机构列表",params);
    }
    public static byte[] encrypt(byte[] data, PublicKey publicKey) throws Exception{
        Cipher cipher=Cipher.getInstance("RSA");//java默认"RSA"="RSA/ECB/PKCS1Padding"
        cipher.init(Cipher.ENCRYPT_MODE, publicKey);
        int inputLen = data.length;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int offSet = 0;
        byte[] cache;
        int i = 0;
        // 对数据分段加密
        while (inputLen - offSet > 0) {
            if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {
                cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);
            } else {
                cache = cipher.doFinal(data, offSet, inputLen - offSet);
            }
            out.write(cache, 0, cache.length);
            i++;
            offSet = i * MAX_ENCRYPT_BLOCK;
        }
        byte[] encryptedData = out.toByteArray();
        out.close();
        return encryptedData;
    }
    public PublicKey immPublicKeyget(String filename) throws Exception {
        File f = new File(filename);
        FileInputStream fis = new FileInputStream(f);
        DataInputStream dis = new DataInputStream(fis);
        byte[] keyBytes = new byte[(int)f.length()];
        dis.readFully(keyBytes);
        dis.close();
        X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes);
        KeyFactory kf = KeyFactory.getInstance("RSA");
        return kf.generatePublic(spec);
    }
    
    
    
    /**
     * 获取免疫接种号源
     * @param orgId 机构编码
@ -1380,7 +1341,7 @@ public class GuahaoService {
    public String GetOrgNumberList(String orgId, String scheduleId) throws Exception  {
        String result = "";
        Map<String,String> params = new HashMap<>();
        params.put("orgId", orgId);
        params.put("OrgId", orgId);
        params.put("ScheduleId", scheduleId);
        return immPostSecond("GetOrgNumberList","计免预约-获取免疫接种号源",params);
    }
@ -1397,8 +1358,8 @@ public class GuahaoService {
        String result = "";
        Map<String,String> params = new HashMap<>();
        params.put("OrgCode", orgCode);
        params.put("strStart", strStart);
        params.put("strEnd", strEnd);
        params.put("StartTime", strStart);
        params.put("EndTime", strEnd);
        return immPostSecond("GetOrgScheduleList","计免预约-获取免疫接种排班信息",params);
    }
    

+ 6 - 2
patient-co-service/wlyy_service/src/main/resources/application.yml

@ -75,6 +75,10 @@ spring:
im:
  data_base_name: im_new
imm:
  url: imm
  credential: <root><org code="jkzl" /><visitor type="0" code="jkzl" key="jkzl" /></root>
zyapi:
  openCrypto: false
#    i健康项目地址
@ -101,7 +105,7 @@ im:
imm:
  url: imm
  credential: <root><org code="jkzk" /><visitor type="0" code="jkzl" key="jkzl" /></root>
  credential: <root><org code="jkzl" /><visitor type="0" code="jkzl" key="jkzl" /></root>
zyapi:
  openCrypto: false
@ -128,7 +132,7 @@ im:
imm:
  url: imm
  credential: <root><org code="jkzk" /><visitor type="0" code="jkzl" key="jkzl" /></root>
  credential: <root><org code="jkzl" /><visitor type="0" code="jkzl" key="jkzl" /></root>
zyapi:
  openCrypto: false