日志修改

docus_webservice_1.1
lzy 4 years ago
parent 87c96c6a8b
commit dfa10b03f4

@ -40,7 +40,7 @@
"tableName": "t_basic", "tableName": "t_basic",
"columnName": "dis_dept", "columnName": "dis_dept",
"qualityColumn": "DEPT_CODE", "qualityColumn": "DEPT_CODE",
"byNull":0 "byNull":1
}, },
{ {
"serialNumber": "7", "serialNumber": "7",

@ -89,7 +89,12 @@ public class TBasicWebService implements ITBasicWebService {
// String isDead=StringUtils.isNotBlank(String.valueOf(tBasicMap.get("isDead")))?String.valueOf(tBasicMap.get("isDead")):String.valueOf(tBasicMap.get("is_dead")); // String isDead=StringUtils.isNotBlank(String.valueOf(tBasicMap.get("isDead")))?String.valueOf(tBasicMap.get("isDead")):String.valueOf(tBasicMap.get("is_dead"));
// tBasic.setIsDead(isDead); // tBasic.setIsDead(isDead);
// } // }
tBasic.setCreateTime(new Date()); //特殊处理出院时间 没有就取当前时间
Date currentDate = new Date();
if(tBasic.getDisDate()==null){
tBasic.setDisDate(currentDate);
}
tBasic.setCreateTime(currentDate);
itBasicService.savaAndSub(tBasic, tBasicSubMap); itBasicService.savaAndSub(tBasic, tBasicSubMap);
// this.saveAndCall(tBasic); // this.saveAndCall(tBasic);
pcmachineService.saveAndCall(tBasic); pcmachineService.saveAndCall(tBasic);

@ -125,14 +125,18 @@ public class PcmachineServiceImpl implements IPcmachineService {
} }
for (CollectList collectList : collectLists) { for (CollectList collectList : collectLists) {
//调用http发送请求 //调用http发送请求
this.sendHttp(collectList, tBasic.getJzh()); try {
this.sendHttp(collectList, tBasic.getJzh());
}catch (Exception e){
log.info("采集器:"+collectList+"出错");
}
} }
} }
log.info("------------异步结束---------------"); log.info("------------异步结束---------------");
} }
private String sendHttp(CollectList collectList, String jzh) throws URISyntaxException { private String sendHttp(CollectList collectList, String jzh) throws Exception {
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("empId", jzh); params.put("empId", jzh);
params.put("collectSubId", String.valueOf(collectList.getId())); params.put("collectSubId", String.valueOf(collectList.getId()));

@ -37,7 +37,7 @@ public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> impleme
@Transactional @Transactional
@Override @Override
public void savaAndSub(TBasic tBasic, HashMap<String, Object> tBasicSubMap) { public void savaAndSub(TBasic tBasic, HashMap<String, Object> tBasicSubMap) {
TBasic selectTBasic = tBasicMapper.selectOne(new QueryWrapper<TBasic>().eq("emp_id", tBasic.getEmpId())); TBasic selectTBasic = tBasicMapper.selectOne(new QueryWrapper<TBasic>().eq("jzh", tBasic.getJzh()));
if (selectTBasic == null) { if (selectTBasic == null) {
int insert = tBasicMapper.insert(tBasic); int insert = tBasicMapper.insert(tBasic);
if (insert <= 0) { if (insert <= 0) {
@ -50,7 +50,7 @@ public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> impleme
throw new RuntimeException("数据库执行出错,请重试"); throw new RuntimeException("数据库执行出错,请重试");
} }
} else { } else {
throw new RuntimeException("emp_id不能和已有的重复"); throw new RuntimeException("就诊号不能和已有的重复");
} }
} }

@ -50,7 +50,7 @@ public class HttpUtils {
* @param url * @param url
* @return * @return
*/ */
public static String get(String url) { public static String get(String url) throws Exception {
HttpGet httpGet = new HttpGet(url); HttpGet httpGet = new HttpGet(url);
return getResult(httpGet); return getResult(httpGet);
} }
@ -58,7 +58,7 @@ public class HttpUtils {
* @param urlparams * @param urlparams
* @return * @return
*/ */
public static String get(String url, Map<String, String > params) throws URISyntaxException { public static String get(String url, Map<String, String > params) throws Exception {
URIBuilder ub = new URIBuilder(); URIBuilder ub = new URIBuilder();
ub.setPath(url); ub.setPath(url);
@ -73,7 +73,7 @@ public class HttpUtils {
* @return * @return
*/ */
public static String get(String url, Map<String, Object> headers, Map<String, String> params) public static String get(String url, Map<String, Object> headers, Map<String, String> params)
throws URISyntaxException { throws Exception {
URIBuilder ub = new URIBuilder(); URIBuilder ub = new URIBuilder();
ub.setPath(url); ub.setPath(url);
@ -92,7 +92,7 @@ public class HttpUtils {
* @param url * @param url
* @return * @return
*/ */
public static String post(String url) { public static String post(String url) throws Exception {
HttpPost httpPost = new HttpPost(url); HttpPost httpPost = new HttpPost(url);
return getResult(httpPost); return getResult(httpPost);
} }
@ -100,7 +100,7 @@ public class HttpUtils {
* @param urlparams * @param urlparams
* @return * @return
*/ */
public static String post(String url, Map<String, String> params) throws UnsupportedEncodingException { public static String post(String url, Map<String, String> params) throws Exception {
HttpPost httpPost = new HttpPost(url); HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(covertParams2NVPS(params), "utf-8"));//设置表单提交编码 httpPost.setEntity(new UrlEncodedFormEntity(covertParams2NVPS(params), "utf-8"));//设置表单提交编码
@ -108,7 +108,7 @@ public class HttpUtils {
return getResult(httpPost); return getResult(httpPost);
} }
public static String post(String url, Object params, Map<String, Object> head) throws UnsupportedEncodingException { public static String post(String url, Object params, Map<String, Object> head) throws Exception {
HttpPost httpPost = new HttpPost(url); HttpPost httpPost = new HttpPost(url);
System.out.println(params); System.out.println(params);
httpPost.setEntity(new StringEntity(params.toString()));//设置表单提交编码 httpPost.setEntity(new StringEntity(params.toString()));//设置表单提交编码
@ -136,7 +136,7 @@ public class HttpUtils {
* @return * @return
*/ */
public static String post(String url, Map<String, Object> headers, Map<String, Object> params) public static String post(String url, Map<String, Object> headers, Map<String, Object> params)
throws UnsupportedEncodingException { throws Exception {
HttpPost httpPost = new HttpPost(url); HttpPost httpPost = new HttpPost(url);
System.out.println(params); System.out.println(params);
if (params != null) { if (params != null) {
@ -156,10 +156,10 @@ public class HttpUtils {
* @param request * @param request
* @return * @return
*/ */
private static String getResult(HttpRequestBase request) { private static String getResult(HttpRequestBase request) throws Exception{
// CloseableHttpClient httpClient = HttpClients.createDefault(); // CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpClient httpClient = getHttpClient(); CloseableHttpClient httpClient = getHttpClient();
try {
CloseableHttpResponse response = httpClient.execute(request); CloseableHttpResponse response = httpClient.execute(request);
// response.getStatusLine().getStatusCode(); // response.getStatusLine().getStatusCode();
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();
@ -170,13 +170,7 @@ public class HttpUtils {
// httpClient.close(); // httpClient.close();
return result; return result;
} }
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
}
return EMPTY_STR; return EMPTY_STR;
} }

Loading…
Cancel
Save