|
|
@ -12,12 +12,14 @@ import com.docus.webservice.entity.TBasic;
|
|
|
|
import com.docus.webservice.enums.Codes;
|
|
|
|
import com.docus.webservice.enums.Codes;
|
|
|
|
import com.docus.webservice.mapper.AfInterfaceCollectMapper;
|
|
|
|
import com.docus.webservice.mapper.AfInterfaceCollectMapper;
|
|
|
|
import com.docus.webservice.service.IMrReportErrorService;
|
|
|
|
import com.docus.webservice.service.IMrReportErrorService;
|
|
|
|
|
|
|
|
import com.docus.webservice.service.IPcmachineService;
|
|
|
|
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.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.jws.WebService;
|
|
|
|
import javax.jws.WebService;
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
@ -36,6 +38,9 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IMrReportErrorService mrReportErrorService;
|
|
|
|
private IMrReportErrorService mrReportErrorService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
IPcmachineService pcmachineService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private AfInterfaceCollectMapper afInterfaceCollectMapper;
|
|
|
|
private AfInterfaceCollectMapper afInterfaceCollectMapper;
|
|
|
|
|
|
|
|
|
|
|
@ -82,7 +87,8 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
tBasic = JSON.parseObject(JSON.toJSONString(tBasicMap), TBasic.class);
|
|
|
|
tBasic = JSON.parseObject(JSON.toJSONString(tBasicMap), TBasic.class);
|
|
|
|
tBasic.setCreateTime(new Date());
|
|
|
|
tBasic.setCreateTime(new Date());
|
|
|
|
itBasicService.savaAndSub(tBasic, tBasicSubMap);
|
|
|
|
itBasicService.savaAndSub(tBasic, tBasicSubMap);
|
|
|
|
this.saveAndCall(tBasic);
|
|
|
|
// this.saveAndCall(tBasic);
|
|
|
|
|
|
|
|
pcmachineService.saveAndCall(tBasic);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
insertLog(tbasic);
|
|
|
|
insertLog(tbasic);
|
|
|
|
log.info("请提供完整的xml");
|
|
|
|
log.info("请提供完整的xml");
|
|
|
@ -168,7 +174,8 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
tBasic.setUpdateTime(new Date());
|
|
|
|
tBasic.setUpdateTime(new Date());
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
itBasicService.updateAndSub(tBasic, tBasicSubMap);
|
|
|
|
itBasicService.updateAndSub(tBasic, tBasicSubMap);
|
|
|
|
this.saveAndCall(tBasic);
|
|
|
|
// this.saveAndCall(tBasic);
|
|
|
|
|
|
|
|
pcmachineService.saveAndCall(tBasic);
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
insertLog(tbasic);
|
|
|
|
insertLog(tbasic);
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
@ -189,58 +196,8 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void saveAndCall(TBasic tBasic) throws URISyntaxException {
|
|
|
|
|
|
|
|
log.info("病案对象" + tBasic.toString());
|
|
|
|
|
|
|
|
//解析json映射文件
|
|
|
|
|
|
|
|
String json = JsonUtils.readJsonFile(CurrentPath() + Codes.JSON_COLLECTLIST.getMessage());
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(json)) {
|
|
|
|
|
|
|
|
Map jsonMap = JSON.parseObject(json, Map.class);
|
|
|
|
|
|
|
|
//任务数
|
|
|
|
|
|
|
|
Integer task_count = JSON.parseObject(String.valueOf(jsonMap.get(Codes.JSON_TASK_COUNT.getMessage())), Integer.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<CollectList> collectLists = JSON.parseArray(String.valueOf(jsonMap.get(Codes.JSON_COLLECTLIST_ROOT.getMessage())), CollectList.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加省中医病案采集
|
|
|
|
|
|
|
|
SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);
|
|
|
|
|
|
|
|
AfInterfaceCollect afc = new AfInterfaceCollect();
|
|
|
|
|
|
|
|
Long afcId = idWorker.nextId();
|
|
|
|
|
|
|
|
afc.setId(afcId);
|
|
|
|
|
|
|
|
afc.setJzh(tBasic.getJzh());
|
|
|
|
|
|
|
|
afc.setTaskCount(task_count);
|
|
|
|
|
|
|
|
afc.setCreateTime(new Date());
|
|
|
|
|
|
|
|
int i = afInterfaceCollectMapper.addAfInterfaceCollect(afc);
|
|
|
|
|
|
|
|
if (i < 0) {
|
|
|
|
|
|
|
|
log.info("省中医病案采集表添加信息失败!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//添加省中医病案采集-子任务
|
|
|
|
|
|
|
|
List<AfInterfaceCollectSub> list = new ArrayList<>();
|
|
|
|
|
|
|
|
for (CollectList collectList : collectLists) {
|
|
|
|
|
|
|
|
AfInterfaceCollectSub afInterfaceCollectSub = new AfInterfaceCollectSub();
|
|
|
|
|
|
|
|
Long afcsId = idWorker.nextId();
|
|
|
|
|
|
|
|
afInterfaceCollectSub.setId(afcsId);
|
|
|
|
|
|
|
|
afInterfaceCollectSub.setAfInterfaceCollectId(afcId);
|
|
|
|
|
|
|
|
afInterfaceCollectSub.setCollectsysCode(collectList.getCollectsys_code());
|
|
|
|
|
|
|
|
afInterfaceCollectSub.setJzh(tBasic.getJzh());
|
|
|
|
|
|
|
|
collectList.setId(afcsId);
|
|
|
|
|
|
|
|
list.add(afInterfaceCollectSub);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int i1 = afInterfaceCollectMapper.addAfInterfaceCollectSub(list);
|
|
|
|
|
|
|
|
if (i1 < 0) {
|
|
|
|
|
|
|
|
log.info("省中医病案采集-子任务失败!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (CollectList collectList : collectLists) {
|
|
|
|
|
|
|
|
//调用http发送请求
|
|
|
|
|
|
|
|
this.sendHttp(collectList, tBasic.getJzh());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String sendHttp(CollectList collectList, String jzh) throws URISyntaxException {
|
|
|
|
|
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
|
|
|
|
|
params.put("empId", jzh);
|
|
|
|
|
|
|
|
params.put("collectSubId", String.valueOf(collectList.getId()));
|
|
|
|
|
|
|
|
return HttpUtils.get(collectList.getRequestUrl(), params);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|