|
|
|
@ -56,6 +56,7 @@ import com.glxp.mipsdl.req.drugMachine.PutGoodsB001Request;
|
|
|
|
|
import com.glxp.mipsdl.req.drugMachine.SendGoodsB002Request;
|
|
|
|
|
import com.glxp.mipsdl.req.post.*;
|
|
|
|
|
import com.glxp.mipsdl.req.yb.*;
|
|
|
|
|
import com.glxp.mipsdl.req.zaxyy.ZaxzyyOrderHlfyRequest;
|
|
|
|
|
import com.glxp.mipsdl.req.zaxyy.ZaxzyyOrderRequest;
|
|
|
|
|
import com.glxp.mipsdl.req.zzzyy.ZzzyyRequest;
|
|
|
|
|
import com.glxp.mipsdl.res.BaseResponse;
|
|
|
|
@ -519,7 +520,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
baseResponse.setData(map);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("解析长泰医院智业返回病人信息数据异常,返回结果:{}", response);
|
|
|
|
|
log.error("解析湖里妇幼医院智业返回病人信息数据异常,返回结果:{}", response);
|
|
|
|
|
log.error("异常信息:{}", e);
|
|
|
|
|
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
|
|
|
|
|
}
|
|
|
|
@ -556,7 +557,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
baseResponse.setData(map);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("解析长泰医院智业返回处方信息数据异常,返回结果:{}", response);
|
|
|
|
|
log.error("解析湖里妇幼医院智业返回处方信息数据异常,返回结果:{}", response);
|
|
|
|
|
log.error("异常信息:{}", e);
|
|
|
|
|
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
|
|
|
|
|
}
|
|
|
|
@ -603,7 +604,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
baseResponse.setData(map);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("解析长泰医院智业返回项目信息数据异常,返回结果:{}", response);
|
|
|
|
|
log.error("解析湖里妇幼医院智业返回项目信息数据异常,返回结果:{}", response);
|
|
|
|
|
log.error("异常信息:{}", e);
|
|
|
|
|
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
|
|
|
|
|
}
|
|
|
|
@ -640,7 +641,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
baseResponse.setData(map);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("解析长泰医院智业返回物价类别信息异常,返回结果:{}", response);
|
|
|
|
|
log.error("解析湖里妇幼医院智业返回物价类别信息异常,返回结果:{}", response);
|
|
|
|
|
log.error("异常信息:{}", e);
|
|
|
|
|
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
|
|
|
|
|
}
|
|
|
|
@ -683,15 +684,32 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
if (StrUtil.isNotEmpty(orderEntity.getFromCorp())) {
|
|
|
|
|
basicCorpEntity = basicCorpDao.selectByErpId(orderEntity.getFromCorp());
|
|
|
|
|
}
|
|
|
|
|
VA001 va001;
|
|
|
|
|
if (basicCorpEntity != null) {
|
|
|
|
|
zaxzyyOrderRequest.setCorpId(basicCorpEntity.getThirdId());
|
|
|
|
|
// zaxzyyOrderRequest.setCorpId(basicCorpEntity.getThirdId());
|
|
|
|
|
zaxzyyOrderRequest.setCorpName(basicCorpEntity.getName());
|
|
|
|
|
LambdaQueryWrapper<VA001> wrapper = new LambdaQueryWrapper();
|
|
|
|
|
wrapper.eq(VA001::getName,basicCorpEntity.getName());
|
|
|
|
|
wrapper.eq(VA001::getUnitid,"3");
|
|
|
|
|
|
|
|
|
|
// 补充数据
|
|
|
|
|
va001 = va001Service.getOne(wrapper);
|
|
|
|
|
if(va001!=null){
|
|
|
|
|
zaxzyyOrderRequest.setCorpId(va001.getUnitid());
|
|
|
|
|
}else {
|
|
|
|
|
String msg = "查询单据对应的第三方往来单位信息异常";
|
|
|
|
|
orderUploadLogService.updateLocalErr(orderEntity, msg);
|
|
|
|
|
log.error("----单据提交-----" + orderEntity.getBillNo() + msg);
|
|
|
|
|
return ResultVOUtils.error(500, msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
String msg = "查询单据对应的第三方往来单位信息异常";
|
|
|
|
|
orderUploadLogService.updateLocalErr(orderEntity, msg);
|
|
|
|
|
log.error("----单据提交-----" + orderEntity.getBillNo() + msg);
|
|
|
|
|
return ResultVOUtils.error(500, msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//查询仓库信息
|
|
|
|
|
AuthWarehouseEntity warehouseEntity = authWarehouseDao.selectOne(new QueryWrapper<AuthWarehouseEntity>().eq("code", orderEntity.getInvCode()));
|
|
|
|
|
try {
|
|
|
|
@ -727,6 +745,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
// 处理
|
|
|
|
|
zaxzyyOrderRequest.setItem(items);
|
|
|
|
|
if (CollUtil.isEmpty(items)) {
|
|
|
|
|
|
|
|
|
|
orderUploadLogService.updateLocalErr(orderEntity, errMsg);
|
|
|
|
|
return ResultVOUtils.error(500, errMsg);
|
|
|
|
|
}
|
|
|
|
@ -742,7 +761,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
.selectList(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class).eq(IoOrderInvoiceEntity::getOrderIdFk, orderEntity.getBillNo())
|
|
|
|
|
.eq(IoOrderInvoiceEntity::getBindRlFk, i.getBindRlFk())
|
|
|
|
|
.eq(StrUtil.isNotEmpty(i.getBatchNo()), IoOrderInvoiceEntity::getBatchNo, i.getBatchNo()).
|
|
|
|
|
groupBy(IoOrderInvoiceEntity::getInvoiceEncode));
|
|
|
|
|
groupBy(IoOrderInvoiceEntity::getInvoiceEncode));
|
|
|
|
|
if (CollectionUtil.isNotEmpty(invoiceList)) {
|
|
|
|
|
fphm = invoiceList.stream().map(IoOrderInvoiceEntity::getInvoiceEncode).collect(Collectors.joining(","));
|
|
|
|
|
if (invoiceList.get(0).getInvoiceDate() != null)
|
|
|
|
@ -752,17 +771,36 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
i.setSecSalesInvNo(fphm);
|
|
|
|
|
i.setInvoiceDate(fprq);
|
|
|
|
|
}
|
|
|
|
|
ZaxzyyOrderHlfyRequest zaxzyyOrderHlfyRequest = new ZaxzyyOrderHlfyRequest();
|
|
|
|
|
if(zaxzyyOrderRequest!=null ){
|
|
|
|
|
zaxzyyOrderHlfyRequest =new ZaxzyyOrderHlfyRequest();
|
|
|
|
|
BeanUtils.copyProperties(zaxzyyOrderRequest,zaxzyyOrderHlfyRequest,"item,items");
|
|
|
|
|
List<UdiwmsOrderDetailHlfyRequest> udiwmsOrderDetailHlfyRequestArrayList = new ArrayList<>();
|
|
|
|
|
for (UdiwmsOrderDetailRequest udiwmsOrderDetailRequest : zaxzyyOrderRequest.getItem()) {
|
|
|
|
|
if(udiwmsOrderDetailRequest!= null){
|
|
|
|
|
udiwmsOrderDetailRequest.setCodeList(new ArrayList<>());
|
|
|
|
|
}
|
|
|
|
|
log.error("udiwmsOrderDetailRequest==="+udiwmsOrderDetailRequest);
|
|
|
|
|
|
|
|
|
|
// if(udiwmsOrderDetailRequest!= null){
|
|
|
|
|
// udiwmsOrderDetailRequest.setCodeList(new ArrayList<>());
|
|
|
|
|
// }
|
|
|
|
|
UdiwmsOrderDetailHlfyRequest udiwmsOrderDetailHlfyRequest = new UdiwmsOrderDetailHlfyRequest();
|
|
|
|
|
BeanUtils.copyProperties(udiwmsOrderDetailRequest,udiwmsOrderDetailHlfyRequest,"price,count,allowNoBatch");
|
|
|
|
|
udiwmsOrderDetailHlfyRequest.setPrice(udiwmsOrderDetailRequest.getPrice().toString());
|
|
|
|
|
udiwmsOrderDetailHlfyRequest.setCount(udiwmsOrderDetailRequest.getCount()+"");
|
|
|
|
|
udiwmsOrderDetailHlfyRequest.setAllowNoBatch(Boolean.toString(udiwmsOrderDetailRequest.isAllowNoBatch()));
|
|
|
|
|
udiwmsOrderDetailHlfyRequestArrayList.add(udiwmsOrderDetailHlfyRequest);
|
|
|
|
|
}
|
|
|
|
|
zaxzyyOrderHlfyRequest.setItem(udiwmsOrderDetailHlfyRequestArrayList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 药品先写死为是
|
|
|
|
|
zaxzyyOrderHlfyRequest.setPhysicFlag("Y");
|
|
|
|
|
//构造诏安接口参数
|
|
|
|
|
ZzzyyRequest zaZyRequest = new ZzzyyRequest();
|
|
|
|
|
zaZyRequest.setMsgHeader(getMsgHeader("saveBuyApplyInfo"));
|
|
|
|
|
zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest));
|
|
|
|
|
|
|
|
|
|
zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderHlfyRequest));
|
|
|
|
|
// submitByWebService(zaZyRequest.getMsgHeader(), zaZyRequest.getMsgBody());
|
|
|
|
|
return submitOrder(orderEntity, zaZyRequest);
|
|
|
|
|
}
|
|
|
|
@ -1161,7 +1199,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
private String setOrderDetailList(List<IoCodeEntity> ioCodeEntities, List<UdiwmsOrderDetailRequest> orderDetailRequests, List<IoOrderDetailBizEntity> detailBizEntities) {
|
|
|
|
|
String errMsg = "";
|
|
|
|
|
for (IoOrderDetailBizEntity detailBizEntity : detailBizEntities) {
|
|
|
|
|
|
|
|
|
|
log.error("detailBizEntity==="+detailBizEntity);
|
|
|
|
|
IoOrderDetailCodeEntity orderDetailCodeEntity = orderDetailCodeDao
|
|
|
|
|
.selectOne(new QueryWrapper<IoOrderDetailCodeEntity>()
|
|
|
|
|
.eq("orderIdFk", detailBizEntity.getOrderIdFk())
|
|
|
|
@ -1194,28 +1232,51 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
|
|
|
|
|
UdiwmsOrderDetailRequest item = new UdiwmsOrderDetailRequest();
|
|
|
|
|
BeanUtil.copyProperties(detailBizEntity, item);
|
|
|
|
|
log.error("detailBizEntity: "+detailBizEntity);
|
|
|
|
|
item.setProductDate(DateUtil.formatExpireTime(StrUtil.isBlank(detailBizEntity.getProductDate()) ? null : "20" + detailBizEntity.getProductDate()));
|
|
|
|
|
item.setExpireDate(DateUtil.formatExpireTime(StrUtil.isBlank(detailBizEntity.getExpireDate()) ? null : "20" + detailBizEntity.getExpireDate()));
|
|
|
|
|
// String thirdProductId = (String) ReflectUtil.getFieldValue(basicUdirel, thirdSysConfig.getThirdId());
|
|
|
|
|
item.setProductId(basicUdirel.getThirdId1()); //产品ID
|
|
|
|
|
String thirdId1 = org.apache.commons.lang3.StringUtils.isNotEmpty(basicUdirel.getThirdId1()) ? basicUdirel.getThirdId1() : basicUdirel.getThirdId();
|
|
|
|
|
// item.setProductId(thirdId1); //产品ID
|
|
|
|
|
//查询第三方产品名称 --医保编码
|
|
|
|
|
ThrProductsEntity thrProductsEntity = thrProductsDao.selectOne(new LambdaQueryWrapper<ThrProductsEntity>()
|
|
|
|
|
.eq(ThrProductsEntity::getCode, basicUdirel.getThirdId1()).last("limit 1"));
|
|
|
|
|
.eq(ThrProductsEntity::getCode, thirdId1).last("limit 1"));
|
|
|
|
|
|
|
|
|
|
// 物资字典
|
|
|
|
|
// ThrProductsEntity thrProductsEntity = thrProductsDao.selectOne(new LambdaQueryWrapper<ThrProductsEntity>()
|
|
|
|
|
// .eq(ThrProductsEntity::getCode, thirdProductId).eq(ThrProductsEntity::getThirdSysFk, "thirdId1").last("limit 1"));
|
|
|
|
|
if (thrProductsEntity == null) {
|
|
|
|
|
log.error("第三方产品编码未关联");
|
|
|
|
|
log.error("第三方产品编码未关联: "+detailBizEntity.getBindRlFk()+thirdId1);
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
//产品ID
|
|
|
|
|
LambdaQueryWrapper<VA003> wrapper = new LambdaQueryWrapper();
|
|
|
|
|
wrapper.eq(VA003::getYbbm,thirdId1);
|
|
|
|
|
wrapper.eq(VA003::getRemark, "Y");
|
|
|
|
|
VA003 va003 = va003Mapper.selectOne(wrapper);
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<VA001> wrapperVa001 = new LambdaQueryWrapper();
|
|
|
|
|
wrapperVa001.eq(VA001::getName,basicProducts.getManufactory());
|
|
|
|
|
wrapperVa001.eq(VA001::getUnitid,"2");
|
|
|
|
|
|
|
|
|
|
// 补充数据
|
|
|
|
|
VA001 va001 = va001Service.getOne(wrapperVa001);
|
|
|
|
|
if (va003 == null) {
|
|
|
|
|
log.error("第三方产品未查到: "+thirdId1);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
if (va001 == null) {
|
|
|
|
|
log.error("第三方生产厂家未查到: "+thirdId1);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
item.setProductId(va003.getCode()); //产品ID
|
|
|
|
|
|
|
|
|
|
item.setProductName(thrProductsEntity.getName()); //产品名称
|
|
|
|
|
// item.setBindRlFk(detailBizEntity.getBindRlFk());
|
|
|
|
|
item.setStandard(detailBizEntity.getSpec()); //规格型号
|
|
|
|
|
item.setBillNo(detailBizEntity.getOrderIdFk()); //单据号
|
|
|
|
|
item.setRegisterNo(detailBizEntity.getCertCode()); //注册/备案证号
|
|
|
|
|
item.setManufactory(basicProducts.getManufactory()); //生产厂家
|
|
|
|
|
item.setManufactory(va001.getUnitid()); //生产厂家
|
|
|
|
|
item.setMeasname(thrProductsEntity.getMeasname()); //计量单位
|
|
|
|
|
item.setAllowNoBatch(IntUtil.value(basicProducts.getAllowNoBatch())); //是否允许无批次号
|
|
|
|
|
// if (StrUtil.isNotEmpty(item.getManufactory())) {
|
|
|
|
@ -1227,6 +1288,10 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
// item.setCplb(thrProductsEntity.getFlbm());
|
|
|
|
|
// item.setHslb(thrProductsEntity.getCplb());
|
|
|
|
|
item.setCount(detailBizEntity.getCount());
|
|
|
|
|
item.setInvoiceDate(detailBizEntity.getInvoiceDate());
|
|
|
|
|
item.setFirstSalesInvNo(detailBizEntity.getFirstSalesInvNo());
|
|
|
|
|
log.error("item==="+item);
|
|
|
|
|
|
|
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1677,7 +1742,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
}
|
|
|
|
|
Date date = null;
|
|
|
|
|
try {
|
|
|
|
|
date = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(item.getPrescribedate());
|
|
|
|
|
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(item.getPrescribedate());
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -2395,39 +2460,40 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
private static final String WSDL_URL = "http://192.168.158.208:8152/ZoesoftHipService.asmx?WSDL";
|
|
|
|
|
|
|
|
|
|
public BaseResponse callInterface(String msgHeader, String msgBody) {
|
|
|
|
|
// 先将JSON字符串转为Map
|
|
|
|
|
Map<String, Object> map = JSONUtil.toBean(msgBody, Map.class);
|
|
|
|
|
// 遍历Map将所有值转换为字符串
|
|
|
|
|
map.replaceAll((key, value) -> value == null? null : value.toString());
|
|
|
|
|
// 再将转换后的Map转回JSON字符串(此时所有值都已是字符串类型)
|
|
|
|
|
msgBody = JSONUtil.toJsonStr(map);
|
|
|
|
|
String xml = "\n" +
|
|
|
|
|
"<soap:Envelope\n" +
|
|
|
|
|
" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" +
|
|
|
|
|
" xmlns:pm=\"http://www.zoesoft.com.cn/\">\n" +
|
|
|
|
|
" <soap:Body>\n" +
|
|
|
|
|
" <pm:CallInterface>\n" +
|
|
|
|
|
" <msgHeader>\n" +
|
|
|
|
|
" <?xmlversion=\"1.0\"encoding=\"utf-8\"?>\n" +
|
|
|
|
|
" <root>\n" +
|
|
|
|
|
" <serverName>saveBuyApplyInfo</serverName>\n" +
|
|
|
|
|
" <format>xml</format>\n" +
|
|
|
|
|
" </root>\n" +
|
|
|
|
|
" </msgHeader>\n" +
|
|
|
|
|
" <msgBody>\n" +
|
|
|
|
|
msgBody +
|
|
|
|
|
"\n" +
|
|
|
|
|
" </msgBody>\n" +
|
|
|
|
|
" </pm:CallInterface>\n" +
|
|
|
|
|
" </soap:Body>\n" +
|
|
|
|
|
"</soap:Envelope>";
|
|
|
|
|
log.error("msgHeader:" + msgHeader);
|
|
|
|
|
log.error("msgBody:" + msgBody);
|
|
|
|
|
log.error("xml:" + xml);
|
|
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
|
|
headers.put("Content-Type", "text/xml;charset=UTF-8");
|
|
|
|
|
headers.put("SOAPAction", "http://www.zoesoft.com.cn/HIPMessageServerTransit");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// // 先将JSON字符串转为Map
|
|
|
|
|
// Map<String, Object> map = JSONUtil.toBean(msgBody, Map.class);
|
|
|
|
|
// // 遍历Map将所有值转换为字符串
|
|
|
|
|
// map.replaceAll((key, value) -> value == null? null : value.toString());
|
|
|
|
|
// // 再将转换后的Map转回JSON字符串(此时所有值都已是字符串类型)
|
|
|
|
|
// msgBody = JSONUtil.toJsonStr(map);
|
|
|
|
|
String xml = "\n" +
|
|
|
|
|
"<soap:Envelope\n" +
|
|
|
|
|
" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" +
|
|
|
|
|
" xmlns:pm=\"http://www.zoesoft.com.cn/\">\n" +
|
|
|
|
|
" <soap:Body>\n" +
|
|
|
|
|
" <pm:CallInterface>\n" +
|
|
|
|
|
" <msgHeader>\n" +
|
|
|
|
|
" <?xmlversion=\"1.0\"encoding=\"utf-8\"?>\n" +
|
|
|
|
|
" <root>\n" +
|
|
|
|
|
" <serverName>saveBuyApplyInfo</serverName>\n" +
|
|
|
|
|
" <format>xml</format>\n" +
|
|
|
|
|
" </root>\n" +
|
|
|
|
|
" </msgHeader>\n" +
|
|
|
|
|
" <msgBody>\n" +
|
|
|
|
|
msgBody +
|
|
|
|
|
"\n" +
|
|
|
|
|
" </msgBody>\n" +
|
|
|
|
|
" </pm:CallInterface>\n" +
|
|
|
|
|
" </soap:Body>\n" +
|
|
|
|
|
"</soap:Envelope>";
|
|
|
|
|
log.error("msgHeader:" + msgHeader);
|
|
|
|
|
log.error("msgBody:" + msgBody);
|
|
|
|
|
log.error("xml:" + xml);
|
|
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
|
|
headers.put("Content-Type", "text/xml;charset=UTF-8");
|
|
|
|
|
headers.put("SOAPAction", "http://www.zoesoft.com.cn/HIPMessageServerTransit");
|
|
|
|
|
HttpRequest request = HttpRequest.post(WSDL_URL)
|
|
|
|
|
.addHeaders(headers)
|
|
|
|
|
.body(xml);
|
|
|
|
@ -2438,6 +2504,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
return ResultVOUtils.success(response.body());
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("上传智业单据错误==="+e.getMessage());
|
|
|
|
|
return ResultVOUtils.error(500,"上传智业单据错误==="+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2448,8 +2515,5 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|