|
@ -1,9 +1,12 @@
|
|
|
package com.yihu.jw.base.service.a3service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
|
|
|
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
|
|
|
import com.yihu.jw.entity.util.AesEncryptUtils;
|
|
|
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
|
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@ -171,4 +174,86 @@ public class YlzService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 医保人员信息接口参数封装测试
|
|
|
*/
|
|
|
public com.alibaba.fastjson.JSONArray readcardParamTest(String cardNo,String orgCode) throws Exception {
|
|
|
JSONArray result = new JSONArray();
|
|
|
String sql = " select dp.* from t_mediicine_device de INNER JOIN t_mediicine_device_param dp on de.id = dp.device_id " +
|
|
|
"where de.del=1 and dp.del=1 and de.belong_community='"+orgCode+"' ";
|
|
|
List<Map<String,Object>> deviceParams = jdbcTemplate.queryForList(sql);
|
|
|
if (deviceParams.size()==0){
|
|
|
throw new Exception("药柜参数获取错误");
|
|
|
}
|
|
|
Map<String,Object> deviceParam = deviceParams.get(0);
|
|
|
JSONObject settleTmp = new JSONObject();
|
|
|
/**
|
|
|
* 封装医保人员信息获取接口
|
|
|
**/
|
|
|
JSONObject strinObj = JSONObject.parseObject(deviceParam.get("yb_strin").toString());
|
|
|
JSONObject netData = new JSONObject();
|
|
|
netData.put("opter","010XXX");
|
|
|
netData.put("msgid",strinObj.getString("outBizNo")+ DateUtil.getYyyymmddhhmmss(new Date()));
|
|
|
netData.put("opmsgidter","123123");
|
|
|
netData.put("fixmedins_code",strinObj.getString("outBizNo"));
|
|
|
netData.put("opter_name","XX");
|
|
|
netData.put("infver","V1.0");
|
|
|
netData.put("opter_type","1");
|
|
|
netData.put("mdtrtarea_admvs","350200");
|
|
|
netData.put("fixmedins_name","XX");
|
|
|
netData.put("signtype","SM2");
|
|
|
netData.put("recer_sys_code","0");
|
|
|
netData.put("dev_no",strinObj.getString("serialNo"));
|
|
|
JSONObject input = new JSONObject();
|
|
|
JSONObject inputDetail = new JSONObject();
|
|
|
JSONObject dataDetail = new JSONObject();
|
|
|
inputDetail.put("mdtrt_cert_type","03");
|
|
|
inputDetail.put("mdtrt_cert_no",cardNo);
|
|
|
input.put("data",inputDetail);
|
|
|
dataDetail.put("input",input);
|
|
|
dataDetail.put("net_data",netData);
|
|
|
strinObj.put("func","fsi.terminal.readcard");
|
|
|
strinObj.put("data",dataDetail);
|
|
|
settleTmp.put("readcardParam",strinObj.toJSONString());
|
|
|
if ("jwtest".equals(springProfiles)){//测试线返回模拟数据
|
|
|
JSONObject readcardResult = new JSONObject();
|
|
|
readcardResult.put("func","fsi.terminal.readcard");
|
|
|
readcardResult.put("retCode","0000");
|
|
|
readcardResult.put("retMsg","操作成功");
|
|
|
readcardResult.put("data",new JSONObject());
|
|
|
readcardResult.put("net_data",new JSONObject());
|
|
|
readcardResult.put("inf_refmsgid",strinObj.getString("outBizNo")+ DateUtil.getYyyymmddhhmmss(new Date()));
|
|
|
readcardResult.put("refmsg_time",DateUtil.getYyyymmddhhmmss(new Date()));
|
|
|
readcardResult.put("respond_time",DateUtil.getYyyymmddhhmmss(new Date()));
|
|
|
JSONObject output = new JSONObject();
|
|
|
JSONObject baseinfo = new JSONObject();
|
|
|
baseinfo.put("psn_no",cardNo+cardNo);
|
|
|
baseinfo.put("psn_cert_type","03");
|
|
|
baseinfo.put("certno",cardNo);
|
|
|
baseinfo.put("psn_name","XXX");
|
|
|
baseinfo.put("gend","未知");
|
|
|
baseinfo.put("age",1);
|
|
|
JSONObject insuinfo = new JSONObject();
|
|
|
insuinfo.put("balc",16.20);
|
|
|
insuinfo.put("insutype","310");
|
|
|
insuinfo.put("psn_type","11");
|
|
|
insuinfo.put("psn_insu_stas","1");
|
|
|
insuinfo.put("psn_insu_date",DateUtil.getStringDateShort());
|
|
|
insuinfo.put("paus_insu_date",DateUtil.getStringDateShort());
|
|
|
insuinfo.put("cvlserv_flag","1");
|
|
|
insuinfo.put("insuplc_admdvs","350200");
|
|
|
JSONObject idetinfo = new JSONObject();
|
|
|
idetinfo.put("psn_idet_type","");
|
|
|
idetinfo.put("begntime",DateUtil.getStringDate());
|
|
|
output.put("baseinfo",baseinfo);
|
|
|
output.put("insuinfo",insuinfo);
|
|
|
output.put("idetinfo",idetinfo);
|
|
|
readcardResult.put("output",output);
|
|
|
settleTmp.put("readcardResult",readcardResult.toJSONString());
|
|
|
}
|
|
|
result.add(settleTmp);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
}
|