|
@ -171,6 +171,78 @@ public class MedOrderService {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public JSONObject readCardInfo(String orgCode,String cardNo ,String card_sn,String mdtrt_cert_type,String idcard) throws Exception {
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
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 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",mdtrt_cert_type);
|
|
|
|
if ("01".equals(mdtrt_cert_type)){
|
|
|
|
|
|
|
|
}else if ("02".equals(mdtrt_cert_type)){
|
|
|
|
inputDetail.put("mdtrt_cert_no",idcard);
|
|
|
|
}
|
|
|
|
else if ("03".equals(mdtrt_cert_type)){//社保卡时需要传入卡识别码
|
|
|
|
inputDetail.put("mdtrt_cert_no",cardNo);
|
|
|
|
if (StringUtils.isNotBlank(card_sn)){
|
|
|
|
inputDetail.put("card_sn",card_sn);
|
|
|
|
}else{
|
|
|
|
sql = " select dict_code,dict_value from wlyy_hospital_sys_dict where dict_name='ylz_card_sn' ";
|
|
|
|
List<Map<String,Object>> AnalogFlags = jdbcTemplate.queryForList(sql);
|
|
|
|
String AnalogFlag = "0";
|
|
|
|
inputDetail.put("mdtrt_cert_no",cardNo);
|
|
|
|
if (AnalogFlags.size()>0){
|
|
|
|
AnalogFlag = AnalogFlags.get(0).get("dict_code").toString();
|
|
|
|
}
|
|
|
|
if ("1".equals(AnalogFlag)) {//获取调式模拟数据
|
|
|
|
card_sn = AnalogFlags.get(0).get("dict_value").toString();
|
|
|
|
inputDetail.put("card_sn",card_sn);
|
|
|
|
}else {
|
|
|
|
throw new Exception("卡识别码未传入");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
input.put("data",inputDetail);
|
|
|
|
dataDetail.put("input",input);
|
|
|
|
dataDetail.put("net_data",netData);
|
|
|
|
strinObj.put("func","fsi.terminal.readcard");
|
|
|
|
strinObj.put("data",dataDetail);
|
|
|
|
result.put("readcardParam",strinObj.toJSONString());
|
|
|
|
|
|
|
|
WlyyHttpLogDO logDO = new WlyyHttpLogDO();
|
|
|
|
logDO.setCode("fsi.terminal.readcard");
|
|
|
|
logDO.setName("药柜医保读卡请求参数");
|
|
|
|
logDO.setPatient(inputDetail.getString("mdtrt_cert_no"));
|
|
|
|
logDO.setRequest(strinObj.toJSONString());
|
|
|
|
logDO.setResponse(null);
|
|
|
|
logDO.setCreateTime(new Date());
|
|
|
|
httpLogDao.save(logDO);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取患者待结算信息
|
|
* 获取患者待结算信息
|
|
* 医保个人信息、挂号接口封装
|
|
* 医保个人信息、挂号接口封装
|
|
@ -220,7 +292,7 @@ public class MedOrderService {
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public com.alibaba.fastjson.JSONArray getSettlementInfoFirst(String recipe_no,String card_sn) throws Exception {
|
|
|
|
|
|
public com.alibaba.fastjson.JSONArray getSettlementInfoFirst(String recipe_no,String card_sn,String mdtrt_cert_type,String idcard) throws Exception {
|
|
JSONArray result = new JSONArray();
|
|
JSONArray result = new JSONArray();
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByLog_no(recipe_no);
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByLog_no(recipe_no);
|
|
if (null==ylzMedicalRelationDO){
|
|
if (null==ylzMedicalRelationDO){
|
|
@ -279,25 +351,37 @@ public class MedOrderService {
|
|
JSONObject input = new JSONObject();
|
|
JSONObject input = new JSONObject();
|
|
JSONObject inputDetail = new JSONObject();
|
|
JSONObject inputDetail = new JSONObject();
|
|
JSONObject dataDetail = new JSONObject();
|
|
JSONObject dataDetail = new JSONObject();
|
|
inputDetail.put("mdtrt_cert_type","03");
|
|
|
|
inputDetail.put("mdtrt_cert_no",cardNo);
|
|
|
|
if (StringUtils.isNotBlank(card_sn)){
|
|
|
|
inputDetail.put("card_sn",card_sn);
|
|
|
|
}else {
|
|
|
|
sql = " select dict_code,dict_value from wlyy_hospital_sys_dict where dict_name='ylz_card_sn' ";
|
|
|
|
List<Map<String,Object>> AnalogFlags = jdbcTemplate.queryForList(sql);
|
|
|
|
String AnalogFlag = "0";
|
|
|
|
if (AnalogFlags.size()>0){
|
|
|
|
AnalogFlag = AnalogFlags.get(0).get("dict_code").toString();
|
|
|
|
}
|
|
|
|
if ("1".equals(AnalogFlag)) {//获取调式模拟数据
|
|
|
|
card_sn = AnalogFlags.get(0).get("dict_value").toString();
|
|
|
|
|
|
inputDetail.put("mdtrt_cert_type",mdtrt_cert_type);
|
|
|
|
if ("01".equals(mdtrt_cert_type)){
|
|
|
|
|
|
|
|
}else if ("02".equals(mdtrt_cert_type)){
|
|
|
|
inputDetail.put("mdtrt_cert_no",idcard);
|
|
|
|
}
|
|
|
|
else if ("03".equals(mdtrt_cert_type)){//社保卡时需要传入卡识别码
|
|
|
|
inputDetail.put("mdtrt_cert_no",cardNo);
|
|
|
|
if (StringUtils.isNotBlank(card_sn)){
|
|
inputDetail.put("card_sn",card_sn);
|
|
inputDetail.put("card_sn",card_sn);
|
|
}else {
|
|
|
|
throw new Exception("卡识别码未传入");
|
|
|
|
|
|
}else{
|
|
|
|
sql = " select dict_code,dict_value from wlyy_hospital_sys_dict where dict_name='ylz_card_sn' ";
|
|
|
|
List<Map<String,Object>> AnalogFlags = jdbcTemplate.queryForList(sql);
|
|
|
|
String AnalogFlag = "0";
|
|
|
|
inputDetail.put("mdtrt_cert_no",cardNo);
|
|
|
|
if (AnalogFlags.size()>0){
|
|
|
|
AnalogFlag = AnalogFlags.get(0).get("dict_code").toString();
|
|
|
|
}
|
|
|
|
if ("1".equals(AnalogFlag)) {//获取调式模拟数据
|
|
|
|
card_sn = AnalogFlags.get(0).get("dict_value").toString();
|
|
|
|
inputDetail.put("card_sn",card_sn);
|
|
|
|
}else {
|
|
|
|
throw new Exception("卡识别码未传入");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ylzMedicalRelationDO.setCardSn(card_sn);
|
|
|
|
|
|
if (StringUtils.isNotBlank(card_sn)){
|
|
|
|
ylzMedicalRelationDO.setCardSn(card_sn);
|
|
|
|
}if (StringUtils.isNotBlank(idcard)){
|
|
|
|
ylzMedicalRelationDO.setIdcard(idcard);
|
|
|
|
}
|
|
ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
input.put("data",inputDetail);
|
|
input.put("data",inputDetail);
|
|
dataDetail.put("input",input);
|
|
dataDetail.put("input",input);
|
|
@ -331,8 +415,14 @@ public class MedOrderService {
|
|
inputDetail.put("psn_no","");//人员编码 前端封装
|
|
inputDetail.put("psn_no","");//人员编码 前端封装
|
|
inputDetail.put("insutype","310");
|
|
inputDetail.put("insutype","310");
|
|
inputDetail.put("begntime",DateUtil.dateToStrLong(ylzMedicalRelationDO.getDate()));
|
|
inputDetail.put("begntime",DateUtil.dateToStrLong(ylzMedicalRelationDO.getDate()));
|
|
inputDetail.put("mdtrt_cert_type","03");
|
|
|
|
inputDetail.put("mdtrt_cert_no",cardNo);
|
|
|
|
|
|
if ("02".equals(mdtrt_cert_type)){
|
|
|
|
inputDetail.put("mdtrt_cert_no",idcard);
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
inputDetail.put("mdtrt_cert_no",cardNo);
|
|
|
|
}
|
|
|
|
inputDetail.put("mdtrt_cert_type",mdtrt_cert_type);
|
|
|
|
|
|
inputDetail.put("ipt_otp_no",ylzMedicalRelationDO.getRelationCode());
|
|
inputDetail.put("ipt_otp_no",ylzMedicalRelationDO.getRelationCode());
|
|
inputDetail.put("atddr_no",ylzMedicalRelationDO.getAtddrNo());
|
|
inputDetail.put("atddr_no",ylzMedicalRelationDO.getAtddrNo());
|
|
inputDetail.put("dr_name",ylzMedicalRelationDO.getDrName());
|
|
inputDetail.put("dr_name",ylzMedicalRelationDO.getDrName());
|
|
@ -1177,7 +1267,7 @@ public class MedOrderService {
|
|
*/
|
|
*/
|
|
public List<Map<String,Object>> getYjjChargeList(String cardNo,String startTime,String endTime) throws Exception {
|
|
public List<Map<String,Object>> getYjjChargeList(String cardNo,String startTime,String endTime) throws Exception {
|
|
List<Map<String,Object>> list = new ArrayList<>();
|
|
List<Map<String,Object>> list = new ArrayList<>();
|
|
String sql = "select *,CAST(DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') as char) create_time from base_ylz_medical_recharge where ssc='"+cardNo+"' and charge_result<>'ing' ";
|
|
|
|
|
|
String sql = "select *,CAST(DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') as char) create_time from base_ylz_medical_recharge where ssc='"+cardNo+"' ";
|
|
if (StringUtils.isNotBlank(startTime)){
|
|
if (StringUtils.isNotBlank(startTime)){
|
|
sql +=" and create_time>='"+startTime+" 00:00:00' ";
|
|
sql +=" and create_time>='"+startTime+" 00:00:00' ";
|
|
}
|
|
}
|