日志修改

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

@ -40,7 +40,7 @@
"tableName": "t_basic",
"columnName": "dis_dept",
"qualityColumn": "DEPT_CODE",
"byNull":0
"byNull":1
},
{
"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"));
// 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);
// this.saveAndCall(tBasic);
pcmachineService.saveAndCall(tBasic);

@ -125,14 +125,18 @@ public class PcmachineServiceImpl implements IPcmachineService {
}
for (CollectList collectList : collectLists) {
//调用http发送请求
this.sendHttp(collectList, tBasic.getJzh());
try {
this.sendHttp(collectList, tBasic.getJzh());
}catch (Exception e){
log.info("采集器:"+collectList+"出错");
}
}
}
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<>();
params.put("empId", jzh);
params.put("collectSubId", String.valueOf(collectList.getId()));

@ -37,7 +37,7 @@ public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> impleme
@Transactional
@Override
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) {
int insert = tBasicMapper.insert(tBasic);
if (insert <= 0) {
@ -50,7 +50,7 @@ public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> impleme
throw new RuntimeException("数据库执行出错,请重试");
}
} else {
throw new RuntimeException("emp_id不能和已有的重复");
throw new RuntimeException("就诊号不能和已有的重复");
}
}

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

Loading…
Cancel
Save