|
|
|
@ -824,21 +824,21 @@ public class OrderController {
|
|
|
|
|
PostUdimsOrderRequest postUdimsOrderRequest = new PostUdimsOrderRequest();
|
|
|
|
|
List<PostUdimsOrderRequest.OrderBean> orderBeans = new ArrayList<>();
|
|
|
|
|
String orderId = orderUploadRequest.getOrderIds().get(0);
|
|
|
|
|
OrderEntity orderEntity = orderService.findById(orderId);
|
|
|
|
|
UnitMaintainPlatformEntity unitMaintainPlatform = platformService.findLinkData(customerService.getUserBean().getCustomerId(), orderEntity.getAction(), orderEntity.getFromCorpId());
|
|
|
|
|
StockOrderEntity stockOrder = stockOrderService.findByBillNo(orderId);
|
|
|
|
|
UnitMaintainPlatformEntity unitMaintainPlatform = platformService.findLinkData(customerService.getUserBean().getCustomerId(), stockOrder.getBillType(), stockOrder.getCorpId());
|
|
|
|
|
if (unitMaintainPlatform == null || unitMaintainPlatform.getAppid() == null) {
|
|
|
|
|
return ResultVOUtils.error(500, "该往来单位未绑定UDI自助平台!");
|
|
|
|
|
}
|
|
|
|
|
if (!orderEntity.getAction().equals(unitMaintainPlatform.getSourceAction())) {
|
|
|
|
|
if (!stockOrder.getBillType().equals(unitMaintainPlatform.getSourceAction())) {
|
|
|
|
|
return ResultVOUtils.error(500, "该单据类型不支持提交!");
|
|
|
|
|
}
|
|
|
|
|
PostUdimsOrderRequest.OrderBean orderBean = new PostUdimsOrderRequest.OrderBean();
|
|
|
|
|
BeanUtils.copyProperties(orderEntity, orderBean);
|
|
|
|
|
BeanUtils.copyProperties(stockOrder, orderBean);
|
|
|
|
|
orderBean.setAction(unitMaintainPlatform.getTargetAction());
|
|
|
|
|
orderBean.setInvStorageCode(unitMaintainPlatform.getInvCode());
|
|
|
|
|
orderBean.setInvWarehouseCode(unitMaintainPlatform.getInvSubCode());
|
|
|
|
|
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
|
|
|
|
|
warehouseQueryRequest.setOrderId(orderEntity.getId());
|
|
|
|
|
warehouseQueryRequest.setOrderId(stockOrder.getBillNo());
|
|
|
|
|
List<WarehouseEntity> warehouseEntities = codesService.findByOrderId(warehouseQueryRequest);
|
|
|
|
|
List<PostUdimsOrderRequest.OrderBean.CodeBean> codeBeans = new ArrayList<>();
|
|
|
|
|
warehouseEntities.forEach(data -> {
|
|
|
|
@ -884,8 +884,8 @@ public class OrderController {
|
|
|
|
|
JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
|
|
|
|
|
});
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
orderEntity.setUploadStatus("1");
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
|
stockOrder.setUploadStatus("1");
|
|
|
|
|
stockOrderService.updateById(stockOrder);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, baseResponse.getMessage());
|
|
|
|
|