|
|
|
@ -550,6 +550,8 @@ public class OrderDetailController {
|
|
|
|
|
erpOrderEntity.setBatchNo(subPurchase.getBatchNo());
|
|
|
|
|
erpOrderEntity.setErpCount(subPurchase.getCount());
|
|
|
|
|
erpOrderEntity.setReCount(subPurchase.getReCount());
|
|
|
|
|
erpOrderEntity.setInvWarehouseCode(purchaseinResponse.getInvWarehouseCode());
|
|
|
|
|
erpOrderEntity.setLocStorageCode(purchaseinResponse.getLocStorageCode());
|
|
|
|
|
erpOrderEntity.setGoodsunit(subPurchase.getSpec());
|
|
|
|
|
erpOrderEntity.setBindRlFk(subPurchase.getRelId());
|
|
|
|
|
erpOrderEntities.add(erpOrderEntity);
|
|
|
|
@ -562,7 +564,16 @@ public class OrderDetailController {
|
|
|
|
|
ErpOrderEntity temp = erpOrderEntities.get(0);
|
|
|
|
|
for (int i = 0; i < erpOrderEntities.size(); i++) {
|
|
|
|
|
if (!temp.getCompanyname().equals(erpOrderEntities.get(i).getCompanyname())) {
|
|
|
|
|
return ResultVOUtils.error(500, "选择Erp订单往来单位不一致!");
|
|
|
|
|
return ResultVOUtils.error(500, "所选业务单据往来单位不一致!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!temp.getLocStorageCode().equals(erpOrderEntities.get(i).getLocStorageCode())) {
|
|
|
|
|
return ResultVOUtils.error(500, "所选业务单据当前仓库不一致!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!temp.getInvWarehouseCode().equals(erpOrderEntities.get(i).getInvWarehouseCode())) {
|
|
|
|
|
return ResultVOUtils.error(500, "所选业务单据当前分库不一致!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -572,7 +583,7 @@ public class OrderDetailController {
|
|
|
|
|
orderEntity.setReviewUser(authAdmin.getId().intValue());
|
|
|
|
|
ErpOrderEntity exitErp = new ContrastErpUtil().vailErpExit(orderDetailService, erpOrderEntities, importErpOrderRequest.getOrderId());
|
|
|
|
|
if (exitErp != null) {
|
|
|
|
|
String errMsg = "所选ERP单" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定";
|
|
|
|
|
String errMsg = "所选业务单据" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定";
|
|
|
|
|
orderEntity.setRemark(errMsg);
|
|
|
|
|
orderEntity.setUpdateTime(new Date());
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
@ -586,7 +597,7 @@ public class OrderDetailController {
|
|
|
|
|
transInoutService.genOrderDetail(warehouseEntityList);
|
|
|
|
|
checkOrderUtils.check(orderEntity.getId(), erpOrderEntities);
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "ERP订单不能为空");
|
|
|
|
|
return ResultVOUtils.error(500, "业务单据不能为空");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success("导入成功");
|
|
|
|
|