Browse Source

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

huangwenjie 7 years ago
parent
commit
a9f11d6880

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

@ -245,4 +245,23 @@ public class GuahaoController {
			return Result.error(ex.getMessage());
		}
	}
	
	/**
	 * =============================计免预约挂号相关接口======================================START
	 */
	@RequestMapping(value = "GetChildrenInfo",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("获取儿童信息")
	public Result GetChildrenInfo(@ApiParam(name="Credential",value="条形编码") @RequestParam String credential)
	{
		try {
			
			String data = guahaoService.GetChildrenInfo(credential);
			
			return Result.success("获取儿童信息成功!",data);
		} catch (Exception ex) {
			ex.printStackTrace();
			return Result.error(ex.getMessage());
		}
	}
}

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

@ -1,13 +1,18 @@
package com.yihu.wlyy.service.service.guahao;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.common.http.HttpApiException;
import com.yihu.wlyy.service.common.util.DateUtil;
import com.yihu.wlyy.service.common.util.SOAPUtil;
import com.yihu.wlyy.service.common.util.StringUtil;
import com.yihu.wlyy.service.dao.*;
import com.yihu.wlyy.service.entity.Patient;
import com.yihu.wlyy.service.entity.PatientReservation;
import com.yihu.wlyy.service.entity.SignFamily;
import com.yihu.wlyy.service.service.LogService;
import com.yihu.wlyy.service.service.ZysoftApi;
import com.zoe.phip.ssp.sdk.ApiException;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
@ -15,8 +20,11 @@ import org.dom4j.Element;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.*;
@ -58,6 +66,9 @@ public class GuahaoService {
    @Autowired
    private ObjectMapper objectMapper;
    
    @Value("${zyapi.openCrypto}")
    private Boolean openCrypto;
    /**
     * 解析挂号后
@ -1138,6 +1149,75 @@ public class GuahaoService {
            return null;
        }
    }
    
    /**
     * =============================计免预约挂号相关接口==========================================START
     */
    
    /**
     * 获取儿童信息
     * @param credential 条形编码
     * @param orgCode
     * @param regCode
     * @return
     */
    public String GetChildrenInfo(String credential)throws Exception  {
        String result = "";
    
        Map<String,String> params = new HashMap<>();
        params.put("Credential", credential);
        
        return immPostSecond("GetChildrenInfo","计免预约-获取儿童信息",params);
    }
    
    /**
     * 计免预约Post接口
     */
    private String immPostSecond(String api,String content, Map<String,String> params) throws Exception
    {
        String re = "";
    
        //新增日志
        String method = "POST";
        Boolean isSuccess = true;
        String error = "";
    
        int times = 0;
        try {
            re = ZysoftApi.getSingleton().post("imm/"+api, params, null,openCrypto);
        
            Map<String,String> map = objectMapper.readValue(re,Map.class);
            String code = map.get("CODE");
        
            if(!code.equals("1"))
            {
                throw new HttpApiException(Integer.valueOf(code),map.get("MESSAGE"));
            }
        
            //保存http日志
            logService.saveHttpLog(isSuccess,api,content,method,api, net.sf.json.JSONObject.fromObject(params).toString(),re,error);
        }
        catch (Exception ex)
        {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            ex.printStackTrace(pw);
            error = sw.toString();
            isSuccess = false;
        
            //保存http日志
            logService.saveHttpLog(isSuccess,api,content,method,api,net.sf.json.JSONObject.fromObject(params).toString(),re,error);
        
            if(ex instanceof ApiException)
            {
                ApiException apiEx = (ApiException) ex;
                throw new HttpApiException(apiEx.errorCode(),ex.getMessage());
            }
            else{
                throw new HttpApiException(-1,ex.getMessage());
            }
        }
    
        return re;
    }
}

+ 5 - 2
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/ChargeZYService.java

@ -220,14 +220,17 @@ public class ChargeZYService {
                }
                infoobj.put("kfdjh0",misettleno);//扣费单据号
                
                
                infoobj.put("zje000",NumberUtil.feeToYuan(charge.getTotalAmount()));//扣费总额
                
                //--huangwenjie--2018.01.12--扣费总额需要扣除政府补贴
                if(StringUtils.isNotBlank(charge.getCadresPay())){
                    infoobj.put("zfbtzf", NumberUtil.feeToYuan(Integer.parseInt(charge.getCadresPay().trim())));//政府补贴支付
    
                    infoobj.put("zje000",NumberUtil.feeToYuan(charge.getTotalAmount()-Integer.parseInt(charge.getCadresPay().trim())));//扣费总额
                }else{
                    infoobj.put("zfbtzf","0.00");//政府补贴支付
    
                    infoobj.put("zje000",NumberUtil.feeToYuan(charge.getTotalAmount()));//扣费总额
                }
    
                if(StringUtils.isNotBlank(charge.getHealthCarePay())){