第三方单据修改

master
anthonyywj2 3 years ago
parent d82d01f143
commit 99faf1988c

@ -131,6 +131,11 @@ public class PhxyyClient {
}
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailDao.selectByKey("orderSubmitUrl", thirdSysConfig.getThirdSysConfig().getThirdId());
String response = httpClient.postJson(thirdSysConfig.getThirdSysConfig().getThirdSysUrl() + basicThirdSysDetailEntity.getValue(), udiwmsOrderRequest, getHeaderArray());
BaseResponse baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});

@ -232,7 +232,7 @@ public class ZaxyyClient {
}
public BaseResponse submitOrders(ZaxzyyOrderRequest udiwmsOrderRequest) {
if (StrUtil.isBlank(udiwmsOrderRequest.getId())) {
if (StrUtil.isEmpty(udiwmsOrderRequest.getId())) {
return ResultVOUtils.error(500, "单据ID不能为空");
}
//查询单据和详情信息,组装第三方系统接口参数所需数据
@ -252,9 +252,7 @@ public class ZaxyyClient {
if (StrUtil.isBlank(thirdSysBusApiEntity.getUrl())) {
return ResultVOUtils.error(500, "接口未配置,无法提交!");
}
String thirdId = getThirdId(thirdSysBusApiEntity);
udiwmsOrderRequest.setThirdSys(thirdId); //第三方系统标识
udiwmsOrderRequest.setBillType(thirdSysBusApiEntity.getThirdBuyCode());
@ -368,6 +366,8 @@ public class ZaxyyClient {
zaZyHeareRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsOrderRequest));
} else if (thirdSysBusApiEntity.getUrl().equals("saveMaterialHight")) {
//临床出库
udiwmsOrderRequest.setLocInvCode(udiwmsOrderRequest.getLocStorageCode());
udiwmsOrderRequest.setLocInvName(udiwmsOrderRequest.getLocStorageName());
zaZyHeareRequest.setMsgHeader(getMsgHeader("saveMaterialHight"));
key = "preInOrderSubmit";
@ -395,38 +395,38 @@ public class ZaxyyClient {
uploadLog.setFromType(ConstantStatus.THIRD_ORDER_UPLOAD);
String response = httpClient.postJson(thirdSysConfig.getThirdSysConfig().getThirdSysUrl() + interStr, zaZyHeareRequest, getHeaderArray());
response = parseErrorMsg(response);
if (StrUtil.isNotBlank(response)){
try {
BaseResponse baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode().equals(20000)) {
String thirdBillNo = String.valueOf(baseResponse.getData());
orderEntity.setExportStatus(1);
orderEntity.setThirdBillNo(thirdBillNo);
uploadLog.setStatus(2);
uploadLog.setThrBillNo(null);
uploadLog.setResult("提交成功");
stockOrderUploadLogDao.insert(uploadLog);
return ResultVOUtils.success("提交成功");
}
uploadLog.setStatus(3);
uploadLog.setResult("提交失败,错误信息:" + baseResponse.getMessage());
stockOrderUploadLogDao.insert(uploadLog);
return baseResponse;
} catch (Exception e) {
log.error(e.getMessage(), e);
uploadLog.setStatus(3);
uploadLog.setResult("提交失败,错误信息:" + e.getMessage());
stockOrderUploadLogDao.insert(uploadLog);
return ResultVOUtils.error(500, "提交失败");
}
}else {
uploadLog.setStatus(3);
uploadLog.setResult("提交失败,调用接口返回为空");
stockOrderUploadLogDao.insert(uploadLog);
return ResultVOUtils.error(500, "提交失败");
}
if (StrUtil.isNotBlank(response)) {
try {
BaseResponse baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode().equals(20000)) {
String thirdBillNo = String.valueOf(baseResponse.getData());
orderEntity.setExportStatus(1);
orderEntity.setThirdBillNo(thirdBillNo);
uploadLog.setStatus(2);
uploadLog.setThrBillNo(null);
uploadLog.setResult("提交成功");
stockOrderUploadLogDao.insert(uploadLog);
return ResultVOUtils.success("提交成功");
}
uploadLog.setStatus(3);
uploadLog.setResult("提交失败,错误信息:" + baseResponse.getMessage());
stockOrderUploadLogDao.insert(uploadLog);
return baseResponse;
} catch (Exception e) {
log.error(e.getMessage(), e);
uploadLog.setStatus(3);
uploadLog.setResult("提交失败,错误信息:" + e.getMessage());
stockOrderUploadLogDao.insert(uploadLog);
return ResultVOUtils.error(500, "提交失败");
}
} else {
uploadLog.setStatus(3);
uploadLog.setResult("提交失败,调用接口返回为空");
stockOrderUploadLogDao.insert(uploadLog);
return ResultVOUtils.error(500, "提交失败");
}
}

@ -156,8 +156,6 @@ public class UdiWmsController {
} else if (curFlag.equals("ZAXZYY")) {
ZaxzyyOrderRequest zaxzyyOrderRequest = new ZaxzyyOrderRequest();
BeanUtil.copyProperties(udiwmsOrderRequest, zaxzyyOrderRequest);
zaxzyyOrderRequest.setLocInvCode(udiwmsOrderRequest.getLocStorageCode());
zaxzyyOrderRequest.setLocInvName(udiwmsOrderRequest.getLocStorageName());
return zaxyyClient.submitOrders(zaxzyyOrderRequest);
}
return ResultVOUtils.error(500, "当前第三方系统不支持提交单据!");

Loading…
Cancel
Save