|
@ -3,6 +3,8 @@ package com.yihu.jw.hospital.prescription.service.entrance;
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.yihu.jw.entity.hospital.mapping.HospitalDeptMappingDO;
|
|
|
|
import com.yihu.jw.hospital.mapping.dao.HospitalDeptMappingDao;
|
|
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
|
|
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
|
|
import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil;
|
|
import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil;
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyHisPrescriptionVO;
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyHisPrescriptionVO;
|
|
@ -15,12 +17,14 @@ import io.swagger.annotations.ApiParam;
|
|
import net.sf.json.JSONArray;
|
|
import net.sf.json.JSONArray;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.core.io.ClassPathResource;
|
|
import org.springframework.core.io.ClassPathResource;
|
|
import org.springframework.core.io.Resource;
|
|
import org.springframework.core.io.Resource;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
import java.io.BufferedReader;
|
|
import java.io.BufferedReader;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
@ -60,6 +64,8 @@ public class EntranceService {
|
|
private static String MS02013="MS02013";
|
|
private static String MS02013="MS02013";
|
|
//医院频次字典表
|
|
//医院频次字典表
|
|
private static String MS30012="MS30012";
|
|
private static String MS30012="MS30012";
|
|
|
|
@Autowired
|
|
|
|
private HospitalDeptMappingDao hospitalDeptMappingDao;
|
|
|
|
|
|
public String getJosnFileResullt(String fid) throws Exception {
|
|
public String getJosnFileResullt(String fid) throws Exception {
|
|
String contentStr = null;
|
|
String contentStr = null;
|
|
@ -614,7 +620,8 @@ public class EntranceService {
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public JSONArray MS02001(boolean demoFlag) throws Exception {
|
|
|
|
|
|
@org.springframework.transaction.annotation.Transactional(rollbackFor = Exception.class)
|
|
|
|
public List<HospitalDeptMappingDO> MS02001(boolean demoFlag) throws Exception {
|
|
String fid=MS02001;
|
|
String fid=MS02001;
|
|
String resp="";
|
|
String resp="";
|
|
if (demoFlag) {
|
|
if (demoFlag) {
|
|
@ -631,7 +638,46 @@ public class EntranceService {
|
|
resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
|
|
resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
|
|
resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
|
|
resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
|
|
}
|
|
}
|
|
return ConvertUtil.convertListEnvelopInBody(resp);
|
|
|
|
|
|
JSONArray jsonArray= ConvertUtil.convertListEnvelopInBody(resp);
|
|
|
|
List<HospitalDeptMappingDO> hospitalDeptMappingDOS=new ArrayList<>();
|
|
|
|
HospitalDeptMappingDO hdmDo;
|
|
|
|
//删除旧数据
|
|
|
|
hospitalDeptMappingDao.deleteBySource("1");
|
|
|
|
for(Object object:jsonArray){
|
|
|
|
hdmDo=new HospitalDeptMappingDO();
|
|
|
|
net.sf.json.JSONObject jsonObjectBody=(net.sf.json.JSONObject)object;
|
|
|
|
hdmDo.setSerialNo(null==jsonObjectBody.get("Serial_No")?"":jsonObjectBody.get("Serial_No").toString());
|
|
|
|
hdmDo.setDeptCode(null==jsonObjectBody.get("Dept_Code")?"":jsonObjectBody.get("Dept_Code").toString());
|
|
|
|
hdmDo.setDeptName(null==jsonObjectBody.get("Dept_Name")?"":jsonObjectBody.get("Dept_Name").toString());
|
|
|
|
hdmDo.setDeptAlias(null==jsonObjectBody.get("Dept_Alias")?"":jsonObjectBody.get("Dept_Alias").toString());
|
|
|
|
hdmDo.setClinicAttr(null==jsonObjectBody.get("Clinic_Attr")?"":jsonObjectBody.get("Clinic_Attr").toString());
|
|
|
|
hdmDo.setVisitAdmitFlag(null==jsonObjectBody.get("Visit_Admit_Flag")?"":jsonObjectBody.get("Visit_Admit_Flag").toString());
|
|
|
|
hdmDo.setInternalAergeryFlag(null==jsonObjectBody.get("Internal_Sergery_Flag")?"":jsonObjectBody.get("Internal_Sergery_Flag").toString());
|
|
|
|
hdmDo.setGraveDeptFlag(null==jsonObjectBody.get("Grave_Dept_Flag")?"":jsonObjectBody.get("Grave_Dept_Flag").toString());
|
|
|
|
hdmDo.setConsultDeptFlag(null==jsonObjectBody.get("Consult_Dept_Flag")?"":jsonObjectBody.get("Consult_Dept_Flag").toString());
|
|
|
|
hdmDo.setDeptType(null==jsonObjectBody.get("Dept_Type")?"":jsonObjectBody.get("Dept_Type").toString());
|
|
|
|
hdmDo.setInputCode(null==jsonObjectBody.get("Input_Code")?"":jsonObjectBody.get("Input_Code").toString());
|
|
|
|
hdmDo.setPinyinCode(null==jsonObjectBody.get("Pinyin_Code")?"":jsonObjectBody.get("Pinyin_Code").toString());
|
|
|
|
hdmDo.setWubiCode(null==jsonObjectBody.get("Wubi_Code")?"":jsonObjectBody.get("Wubi_Code").toString());
|
|
|
|
hdmDo.setDeptTypeCode(null==jsonObjectBody.get("Dept_Type_Code")?"":jsonObjectBody.get("Dept_Type_Code").toString());
|
|
|
|
hdmDo.setLocation(null==jsonObjectBody.get("Location")?"":jsonObjectBody.get("Location").toString());
|
|
|
|
hdmDo.setDisplaySequence(null==jsonObjectBody.get("Display_Sequence")?"":jsonObjectBody.get("Display_Sequence").toString());
|
|
|
|
hdmDo.setOpenBedNum(null==jsonObjectBody.get("Open_Bed_Num")?"":jsonObjectBody.get("Open_Bed_Num").toString());
|
|
|
|
hdmDo.setFatherDeptCode(null==jsonObjectBody.get("Father_Dept_Code")?"":jsonObjectBody.get("Father_Dept_Code").toString());
|
|
|
|
hdmDo.setFatherDeptName(null==jsonObjectBody.get("Father_Dept_Name")?"":jsonObjectBody.get("Father_Dept_Name").toString());
|
|
|
|
hdmDo.setDeptPosition(null==jsonObjectBody.get("Dept_Position")?"":jsonObjectBody.get("Dept_Position").toString());
|
|
|
|
hdmDo.setDeptRemark(null==jsonObjectBody.get("Dept_Remark")?"":jsonObjectBody.get("Dept_Remark").toString());
|
|
|
|
hdmDo.setDeptAgeLimit(null==jsonObjectBody.get("Dept_Age_Limit")?"":jsonObjectBody.get("Dept_Age_Limit").toString());
|
|
|
|
hdmDo.setDeptTelNum(null==jsonObjectBody.get("Dept_Tel_Num")?"":jsonObjectBody.get("Dept_Tel_Num").toString());
|
|
|
|
hdmDo.setDeptZipCode(null==jsonObjectBody.get("Dept_Zip_Code")?"":jsonObjectBody.get("Dept_Zip_Code").toString());
|
|
|
|
hdmDo.setDeDlid(null==jsonObjectBody.get("De_Dlid")?"":jsonObjectBody.get("De_Dlid").toString());
|
|
|
|
hdmDo.setDeLcid(null==jsonObjectBody.get("De_Lcid")?"":jsonObjectBody.get("De_Lcid").toString());
|
|
|
|
hdmDo.setSource("1");
|
|
|
|
hdmDo.setCreateTime(new Date());
|
|
|
|
hospitalDeptMappingDOS.add(hdmDo);
|
|
|
|
}
|
|
|
|
hospitalDeptMappingDao.save(hospitalDeptMappingDOS);
|
|
|
|
return hospitalDeptMappingDOS;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|