|
|
|
@ -1132,46 +1132,39 @@ public class WareHouseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Integer userId = customerService.getUserId();
|
|
|
|
|
try {
|
|
|
|
|
PostOrderRequest inPostOrder = new PostOrderRequest();
|
|
|
|
|
List<PostOrderRequest.PostOrder> inPostOrders = new ArrayList<>();
|
|
|
|
|
PostOrderRequest outPostOrder = new PostOrderRequest();
|
|
|
|
|
List<PostOrderRequest.PostOrder> outPostOrders = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrders();
|
|
|
|
|
if (postOrders != null && postOrders.size() > 0) {
|
|
|
|
|
for (PostOrderRequest.PostOrder postOrder : postOrders) {
|
|
|
|
|
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(postOrder.getCodes().get(0).getAction());
|
|
|
|
|
if (bussinessTypeEntity.isOutTospms()) {
|
|
|
|
|
outPostOrders.add(postOrder);
|
|
|
|
|
} else {
|
|
|
|
|
inPostOrders.add(postOrder);
|
|
|
|
|
}
|
|
|
|
|
PostOrderRequest inPostOrder = new PostOrderRequest();
|
|
|
|
|
List<PostOrderRequest.PostOrder> inPostOrders = new ArrayList<>();
|
|
|
|
|
PostOrderRequest outPostOrder = new PostOrderRequest();
|
|
|
|
|
List<PostOrderRequest.PostOrder> outPostOrders = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrders();
|
|
|
|
|
if (postOrders != null && postOrders.size() > 0) {
|
|
|
|
|
for (PostOrderRequest.PostOrder postOrder : postOrders) {
|
|
|
|
|
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(postOrder.getCodes().get(0).getAction());
|
|
|
|
|
if (bussinessTypeEntity.isOutTospms()) {
|
|
|
|
|
outPostOrders.add(postOrder);
|
|
|
|
|
} else {
|
|
|
|
|
inPostOrders.add(postOrder);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(postOrderRequest, inPostOrder);
|
|
|
|
|
BeanUtils.copyProperties(postOrderRequest, outPostOrder);
|
|
|
|
|
inPostOrder.setPostOrders(inPostOrders);
|
|
|
|
|
outPostOrder.setPostOrders(outPostOrders);
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(outPostOrders)) {
|
|
|
|
|
outPostOrder.setWmsUserId(userId + "");
|
|
|
|
|
return spsDirectClient.uploadPdaOrder(outPostOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(inPostOrders)) {
|
|
|
|
|
String customerId = getCustomerId();
|
|
|
|
|
inPostOrder.setCustomerId(customerId);
|
|
|
|
|
inPostOrder.setUserId(userId);
|
|
|
|
|
ioTransInoutService.creatOrder(inPostOrder, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(postOrderRequest, inPostOrder);
|
|
|
|
|
BeanUtils.copyProperties(postOrderRequest, outPostOrder);
|
|
|
|
|
inPostOrder.setPostOrders(inPostOrders);
|
|
|
|
|
outPostOrder.setPostOrders(outPostOrders);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
|
|
|
|
if (CollUtil.isNotEmpty(outPostOrders)) {
|
|
|
|
|
outPostOrder.setWmsUserId(userId + "");
|
|
|
|
|
return spsDirectClient.uploadPdaOrder(outPostOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(inPostOrders)) {
|
|
|
|
|
String customerId = getCustomerId();
|
|
|
|
|
inPostOrder.setCustomerId(customerId);
|
|
|
|
|
inPostOrder.setUserId(userId);
|
|
|
|
|
ioTransInoutService.creatOrder(inPostOrder, null);
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success("上传成功,等待后台处理");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1376,12 +1369,12 @@ public class WareHouseController {
|
|
|
|
|
if (null == id)
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
WarehouseBussinessTypeEntity warehouseBussinessTypeEntity = warehouseBussinessTypeService.selectById(id);
|
|
|
|
|
FilterInvBusUserRequest filterInvBusUserRequest=new FilterInvBusUserRequest();
|
|
|
|
|
FilterInvBusUserRequest filterInvBusUserRequest = new FilterInvBusUserRequest();
|
|
|
|
|
filterInvBusUserRequest.setScAction(warehouseBussinessTypeEntity.getAction());
|
|
|
|
|
filterInvBusUserRequest.setSubInvCode(warehouseBussinessTypeEntity.getCode());
|
|
|
|
|
List<InvBusUserEntity> invBusUserEntityList=invBusUserService.filterInvBusUser(filterInvBusUserRequest);
|
|
|
|
|
if(invBusUserEntityList.size()>0){
|
|
|
|
|
return ResultVOUtils.error(999,"有用户关联该单据请先移除再进行删除!");
|
|
|
|
|
List<InvBusUserEntity> invBusUserEntityList = invBusUserService.filterInvBusUser(filterInvBusUserRequest);
|
|
|
|
|
if (invBusUserEntityList.size() > 0) {
|
|
|
|
|
return ResultVOUtils.error(999, "有用户关联该单据请先移除再进行删除!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InvSubWarehouseEntity invSubWarehouseEntity =
|
|
|
|
|