|
|
@ -15,6 +15,8 @@ import com.docus.webservice.service.IMrReportErrorService;
|
|
|
|
import com.docus.webservice.service.ITBasicService;
|
|
|
|
import com.docus.webservice.service.ITBasicService;
|
|
|
|
import com.docus.webservice.utils.*;
|
|
|
|
import com.docus.webservice.utils.*;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
|
|
|
|
import org.apache.logging.log4j.Logger;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.jws.WebService;
|
|
|
|
import javax.jws.WebService;
|
|
|
@ -37,6 +39,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private AfInterfaceCollectMapper afInterfaceCollectMapper;
|
|
|
|
private AfInterfaceCollectMapper afInterfaceCollectMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Logger log= LogManager.getLogger(TBasicWebService.class);
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取jar包所在位置
|
|
|
|
* 获取jar包所在位置
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -66,6 +69,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String OUT_HOS_REG(String tbasic) {
|
|
|
|
public String OUT_HOS_REG(String tbasic) {
|
|
|
|
|
|
|
|
log.info("打印底层xml"+tbasic);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//解析xml
|
|
|
|
//解析xml
|
|
|
|
HashMap<String, Object> tBasicMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> tBasicMap = new HashMap<>();
|
|
|
@ -81,16 +85,20 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
this.saveAndCall(tBasic);
|
|
|
|
this.saveAndCall(tBasic);
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
insertLog(tbasic);
|
|
|
|
insertLog(tbasic);
|
|
|
|
|
|
|
|
log.error("OUT_HOS_REG方法中错误信息:"+e.getMessage());
|
|
|
|
return ResultUtils.fail(e.getMessage());
|
|
|
|
return ResultUtils.fail(e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
insertLog(tbasic);
|
|
|
|
insertLog(tbasic);
|
|
|
|
|
|
|
|
log.info("请提供完整的xml");
|
|
|
|
return ResultUtils.fail("请提供完整的xml");
|
|
|
|
return ResultUtils.fail("请提供完整的xml");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
log.error("OUT_HOS_REG方法中错误信息:"+e.getMessage());
|
|
|
|
return ResultUtils.fail();
|
|
|
|
return ResultUtils.fail();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.info("返回结果:"+ResultUtils.success().asXML());
|
|
|
|
return ResultUtils.success().asXML();
|
|
|
|
return ResultUtils.success().asXML();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -102,7 +110,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void parseXml(String tbasic, HashMap<String, Object> tBasicMap, HashMap<String, Object> tBasicSubMap) {
|
|
|
|
private void parseXml(String tbasic, HashMap<String, Object> tBasicMap, HashMap<String, Object> tBasicSubMap) {
|
|
|
|
XmlUtils xmlUtils = null;
|
|
|
|
XmlUtils xmlUtils = null;
|
|
|
|
|
|
|
|
log.info("开始解析xml");
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
xmlUtils = new XmlUtils(new ByteArrayInputStream(tbasic.getBytes("UTF-8")));
|
|
|
|
xmlUtils = new XmlUtils(new ByteArrayInputStream(tbasic.getBytes("UTF-8")));
|
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
@ -119,11 +127,13 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
value = xmlUtils.getElementText(selectColumn.getQualityColumn()) == null ? null : String.valueOf(xmlUtils.getElementText(selectColumn.getQualityColumn()));
|
|
|
|
value = xmlUtils.getElementText(selectColumn.getQualityColumn()) == null ? null : String.valueOf(xmlUtils.getElementText(selectColumn.getQualityColumn()));
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
String message = e.getMessage();
|
|
|
|
String message = e.getMessage();
|
|
|
|
|
|
|
|
log.error("解析xml出现:"+message);
|
|
|
|
throw new RuntimeException(message);
|
|
|
|
throw new RuntimeException(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isBlank(value)) {
|
|
|
|
if (StringUtils.isBlank(value)) {
|
|
|
|
if (selectColumn.getByNull() == 0) {
|
|
|
|
if (selectColumn.getByNull() == 0) {
|
|
|
|
insertLog(tbasic);
|
|
|
|
insertLog(tbasic);
|
|
|
|
|
|
|
|
log.error(selectColumn.getQualityColumn() + " 字段不能为空值");
|
|
|
|
throw new RuntimeException(selectColumn.getQualityColumn() + " 字段不能为空值");
|
|
|
|
throw new RuntimeException(selectColumn.getQualityColumn() + " 字段不能为空值");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
@ -138,9 +148,9 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String OUT_HOS_CAN(String tbasic) {
|
|
|
|
public String OUT_HOS_CAN(String tbasic) {
|
|
|
|
|
|
|
|
log.info("打印底层xml"+tbasic);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
HashMap<String, Object> tBasicMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> tBasicMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> tBasicSubMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> tBasicSubMap = new HashMap<>();
|
|
|
@ -151,6 +161,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
tBasic = JSON.parseObject(JSON.toJSONString(tBasicMap), TBasic.class);
|
|
|
|
tBasic = JSON.parseObject(JSON.toJSONString(tBasicMap), TBasic.class);
|
|
|
|
if (StringUtils.isBlank(tBasic.getEmpId())) {
|
|
|
|
if (StringUtils.isBlank(tBasic.getEmpId())) {
|
|
|
|
insertLog(tbasic);
|
|
|
|
insertLog(tbasic);
|
|
|
|
|
|
|
|
log.info("emp_id字段不能为空值");
|
|
|
|
return ResultUtils.fail("emp_id字段不能为空值");
|
|
|
|
return ResultUtils.fail("emp_id字段不能为空值");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tBasic.setUpdateTime(new Date());
|
|
|
|
tBasic.setUpdateTime(new Date());
|
|
|
@ -160,6 +171,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
insertLog(tbasic);
|
|
|
|
insertLog(tbasic);
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
log.error("OUT_HOS_CAN方法中错误信息:"+e.getMessage());
|
|
|
|
return ResultUtils.fail(e.getMessage());
|
|
|
|
return ResultUtils.fail(e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -168,12 +180,14 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
log.error("OUT_HOS_CAN方法中错误信息:"+e.getMessage());
|
|
|
|
return ResultUtils.fail();
|
|
|
|
return ResultUtils.fail();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.info("OUT_HOS_CAN方法运行结果:"+ResultUtils.success().asXML());
|
|
|
|
return ResultUtils.success().asXML();
|
|
|
|
return ResultUtils.success().asXML();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void saveAndCall(TBasic tBasic) throws URISyntaxException {
|
|
|
|
public void saveAndCall(TBasic tBasic) throws URISyntaxException {
|
|
|
|
|
|
|
|
log.info("病案对象"+tBasic.toString());
|
|
|
|
//解析json映射文件
|
|
|
|
//解析json映射文件
|
|
|
|
String json = JsonUtils.readJsonFile(CurrentPath() + Codes.JSON_COLLECTLIST.getMessage());
|
|
|
|
String json = JsonUtils.readJsonFile(CurrentPath() + Codes.JSON_COLLECTLIST.getMessage());
|
|
|
|
if (StringUtils.isNotBlank(json)) {
|
|
|
|
if (StringUtils.isNotBlank(json)) {
|
|
|
@ -191,8 +205,10 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
afc.setJzh(tBasic.getJzh());
|
|
|
|
afc.setJzh(tBasic.getJzh());
|
|
|
|
afc.setTaskCount(task_count);
|
|
|
|
afc.setTaskCount(task_count);
|
|
|
|
afc.setCreateTime(new Date());
|
|
|
|
afc.setCreateTime(new Date());
|
|
|
|
afInterfaceCollectMapper.addAfInterfaceCollect(afc);
|
|
|
|
int i = afInterfaceCollectMapper.addAfInterfaceCollect(afc);
|
|
|
|
|
|
|
|
if (i<0) {
|
|
|
|
|
|
|
|
log.info("省中医病案采集表添加信息失败!");
|
|
|
|
|
|
|
|
}
|
|
|
|
//添加省中医病案采集-子任务
|
|
|
|
//添加省中医病案采集-子任务
|
|
|
|
List<AfInterfaceCollectSub> list=new ArrayList<>();
|
|
|
|
List<AfInterfaceCollectSub> list=new ArrayList<>();
|
|
|
|
for (CollectList collectList : collectLists) {
|
|
|
|
for (CollectList collectList : collectLists) {
|
|
|
@ -205,8 +221,10 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
collectList.setId(afcsId);
|
|
|
|
collectList.setId(afcsId);
|
|
|
|
list.add(afInterfaceCollectSub);
|
|
|
|
list.add(afInterfaceCollectSub);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
afInterfaceCollectMapper.addAfInterfaceCollectSub(list);
|
|
|
|
int i1 = afInterfaceCollectMapper.addAfInterfaceCollectSub(list);
|
|
|
|
|
|
|
|
if (i1<0) {
|
|
|
|
|
|
|
|
log.info("省中医病案采集-子任务失败!");
|
|
|
|
|
|
|
|
}
|
|
|
|
for (CollectList collectList : collectLists) {
|
|
|
|
for (CollectList collectList : collectLists) {
|
|
|
|
//调用http发送请求
|
|
|
|
//调用http发送请求
|
|
|
|
this.sendHttp(collectList,tBasic.getJzh());
|
|
|
|
this.sendHttp(collectList,tBasic.getJzh());
|
|
|
|