湖里妇幼单据上传修改

hlfyyy
qiuyt 3 months ago
parent 405e1dea17
commit 8de7758e99

@ -659,9 +659,9 @@ public class CtqyyClient extends CommonHttpClient {
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
zaxzyyOrderRequest.setInoutType(1); //入库
zaxzyyOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
zaxzyyOrderRequest.setInoutType(2); //出库
zaxzyyOrderRequest.setInoutType("2"); //出库
}
//设置备注信息

@ -313,9 +313,9 @@ public class DsxyyClient extends CommonHttpClient {
dsOrderRequest.setBillFlag("1");
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
dsOrderRequest.setInoutType(1); //入库
dsOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
dsOrderRequest.setInoutType(2); //出库
dsOrderRequest.setInoutType("2"); //出库
}
dsOrderRequest.setRemark("udi管理系统提交单据");

@ -7,6 +7,9 @@ import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@ -665,7 +668,7 @@ public class HlfyyyClient extends CommonHttpClient {
//查询单据和详情信息,组装第三方系统接口所需参数
IoOrderEntity orderEntity = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().eq("billNo", ioCollectOrder.getBillNo()));
zaxzyyOrderRequest.setBillDate(DateUtil.formatDateTime(orderEntity.getCreateTime()));
zaxzyyOrderRequest.setBillDate(DateUtil.formatDateTime(orderEntity.getCreateTime()).substring(0, 10));
//查询对应的第三方单据类型
// ThrSystemBusApiEntity thrSystemBusApiEntity = thrSystemBusApiDao.selectOne(new QueryWrapper<ThrSystemBusApiEntity>().eq("code", ioCollectOrder.getBusType()));
zaxzyyOrderRequest.setBillType(ioCollectOrder.getBusType());
@ -704,9 +707,9 @@ public class HlfyyyClient extends CommonHttpClient {
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
zaxzyyOrderRequest.setInoutType(1); //入库
zaxzyyOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
zaxzyyOrderRequest.setInoutType(2); //出库
zaxzyyOrderRequest.setInoutType("2"); //出库
}
//设置备注信息
@ -720,6 +723,7 @@ public class HlfyyyClient extends CommonHttpClient {
// 查询业务单据详情
List<IoOrderDetailBizEntity> detailBizEntities = orderDetailBizDao.selectList(new QueryWrapper<IoOrderDetailBizEntity>().eq("orderIdFk", orderEntity.getBillNo()));
String errMsg = setOrderDetailList(ioCodeEntities, items, detailBizEntities);
// 处理
zaxzyyOrderRequest.setItem(items);
if (CollUtil.isEmpty(items)) {
orderUploadLogService.updateLocalErr(orderEntity, errMsg);
@ -747,6 +751,13 @@ public class HlfyyyClient extends CommonHttpClient {
i.setSecSalesInvNo(fphm);
i.setInvoiceDate(fprq);
}
if(zaxzyyOrderRequest!=null ){
for (UdiwmsOrderDetailRequest udiwmsOrderDetailRequest : zaxzyyOrderRequest.getItem()) {
if(udiwmsOrderDetailRequest!= null){
udiwmsOrderDetailRequest.setCodeList(new ArrayList<>());
}
}
}
//构造诏安接口参数
ZzzyyRequest zaZyRequest = new ZzzyyRequest();
zaZyRequest.setMsgHeader(getMsgHeader("saveBuyApplyInfo"));
@ -756,17 +767,17 @@ public class HlfyyyClient extends CommonHttpClient {
}
public String submitByWebService(String msgHeader, String msgBody) {
String response = null;
try {
response = callInterface(msgHeader, msgBody);
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
log.error(ExceptionUtil.stacktraceToString(axisFault));
}
log.error("Service Response: " + response);
return response;
}
// public String submitByWebService(String msgHeader, String msgBody) {
// String response = null;
// try {
// response = callInterface(msgHeader, msgBody);
// } catch (AxisFault axisFault) {
// axisFault.printStackTrace();
// log.error(ExceptionUtil.stacktraceToString(axisFault));
// }
// log.error("Service Response: " + response);
// return response;
// }
/**
*
@ -1182,6 +1193,7 @@ 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());
@ -1235,8 +1247,8 @@ public class HlfyyyClient extends CommonHttpClient {
uploadLog.setFromType(Constants.THIRD_ORDER_UPLOAD);
String data = submitByWebService(zaZyRequest.getMsgHeader(), zaZyRequest.getMsgBody());
String response = parserResult(data);
BaseResponse<String> baseResponseA = callInterface(zaZyRequest.getMsgHeader(), zaZyRequest.getMsgBody());
String response = parserResult((String) baseResponseA.getData());
if (StrUtil.isNotBlank(response)) {
try {
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
@ -2379,36 +2391,58 @@ public class HlfyyyClient extends CommonHttpClient {
// WebService地址
private static final String METHOD_NAME = "CallInterface";
// private static final String WSDL_URL = "http://192.168.158.208:8152/ZoesoftHipService.asmx?WSDL";
private static final String WSDL_URL = "http://192.168.158.208:8152/ZoesoftHipService.asmx?WSDL";
public BaseResponse callInterface(String msgHeader, String msgBody) {
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 {
HttpRequest request = HttpRequest.post(WSDL_URL)
.addHeaders(headers)
.body(xml);
HttpResponse response = request.execute();
log.error("response:" + response);
log.error("response.body():" + response.body());
public String callInterface(String msgHeader, String msgBody) throws AxisFault {
return ResultVOUtils.success(response.body());
} catch (Exception e) {
return ResultVOUtils.error(500,"上传智业单据错误==="+e.getMessage());
}
Object[] params = new Object[]{msgHeader, msgBody, ""};
Class<?>[] returnTypes = new Class[]{String.class};
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
String url = thrSystemDetailService.getUrlExclude(Constants.URL_NAME_ORDER_SUBMIT_URL);
EndpointReference targetEPR = new EndpointReference(url);
options.setTo(targetEPR);
// 设置 SOAPAction
options.setAction("http://www.zoesoft.com.cn/CallInterface"); // 添加这行
// 或者使用空字符串
// options.setAction("");
// 设置超时时间(毫秒)
options.setTimeOutInMilliSeconds(30000);
}
log.error("msgHeader:" + msgHeader);
log.error("msgBody:" + msgBody);
Object[] response = serviceClient.invokeBlocking(QName.valueOf(METHOD_NAME), params, returnTypes);
public static void main(String[] args) {
// Return the response
return response[0] != null ? response[0].toString() : null;
}
}

@ -408,9 +408,9 @@ public class NjxyyClient extends CommonHttpClient {
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
phOrderRequest.setInoutType(1); //入库
phOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
phOrderRequest.setInoutType(2); //出库
phOrderRequest.setInoutType("2"); //出库
}
phOrderRequest.setRemark("UDI单据" + udiwmsOrderRequest.getBillNo()); //备注

@ -244,9 +244,9 @@ public class PhxyyClient extends CommonHttpClient {
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
phOrderRequest.setInoutType(1); //入库
phOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
phOrderRequest.setInoutType(2); //出库
phOrderRequest.setInoutType("2"); //出库
}
phOrderRequest.setRemark("UDI单据" + udiwmsOrderRequest.getBillNo()); //备注

@ -187,9 +187,9 @@ public class PtxhyyClient extends CommonHttpClient {
udiwmsOrderRequest.setBillFlag("1");
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
udiwmsOrderRequest.setInoutType(1); //入库
udiwmsOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
udiwmsOrderRequest.setInoutType(2); //出库
udiwmsOrderRequest.setInoutType("2"); //出库
}
udiwmsOrderRequest.setRemark("udi管理系统提交单据:" + orderEntity.getBillNo());

@ -632,9 +632,9 @@ public class ScpwxyyClient extends CommonHttpClient {
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
zaxzyyOrderRequest.setInoutType(1); //入库
zaxzyyOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
zaxzyyOrderRequest.setInoutType(2); //出库
zaxzyyOrderRequest.setInoutType("2"); //出库
}
//设置备注信息

@ -625,9 +625,9 @@ public class YxfyyyClient extends CommonHttpClient {
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
zaxzyyOrderRequest.setInoutType(1); //入库
zaxzyyOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
zaxzyyOrderRequest.setInoutType(2); //出库
zaxzyyOrderRequest.setInoutType("2"); //出库
}
//设置备注信息

@ -221,9 +221,9 @@ public class YxzyyClient extends CommonHttpClient {
dsOrderRequest.setBillFlag("1");
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
dsOrderRequest.setInoutType(1); //入库
dsOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
dsOrderRequest.setInoutType(2); //出库
dsOrderRequest.setInoutType("2"); //出库
}
dsOrderRequest.setRemark("udi管理系统提交单据");

@ -320,9 +320,9 @@ public class ZaxyyClient extends CommonHttpClient {
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
zaxzyyOrderRequest.setInoutType(1); //入库
zaxzyyOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
zaxzyyOrderRequest.setInoutType(2); //出库
zaxzyyOrderRequest.setInoutType("2"); //出库
}
//设置备注信息

@ -215,9 +215,9 @@ public class ZzzyyClient extends CommonHttpClient {
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
zaxzyyOrderRequest.setInoutType(1); //入库
zaxzyyOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
zaxzyyOrderRequest.setInoutType(2); //出库
zaxzyyOrderRequest.setInoutType("2"); //出库
}
//设置备注信息

@ -302,9 +302,9 @@ public class ZzzyyClient1 extends CommonHttpClient {
//设置单据出入库类型
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
zaxzyyOrderRequest.setInoutType(1); //入库
zaxzyyOrderRequest.setInoutType("1"); //入库
} else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
zaxzyyOrderRequest.setInoutType(2); //出库
zaxzyyOrderRequest.setInoutType("2"); //出库
}
//设置备注信息

@ -30,7 +30,7 @@ public class UdiwmsOrderRequest {
/**
* 1:2:
*/
private Integer inoutType;
private String inoutType;
/**
* /

Loading…
Cancel
Save