| | |
| | | if (Objects.isNull(mats)) { |
| | | throw new CoolException("物料编码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(mats.getPro_type())) { |
| | | throw new CoolException("零件类型不能为空!!"); |
| | | } |
| | | Mat matnr = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", mats.getPro_komcode())); |
| | | if (!Objects.isNull(matnr)) { |
| | | // 订单时间 |
| | |
| | | } |
| | | matnr.setMaktx(mats.getPro_name()); |
| | | matnr.setSpecs(mats.getPro_size()); |
| | | matnr.setWeight(Double.parseDouble(mats.getPro_wet())); |
| | | matnr.setWeight(Objects.isNull(mats.getPro_wet()) ? 0.0 : Double.parseDouble(mats.getPro_wet())); |
| | | matnr.setSuppCode(mats.getPro_id()); |
| | | matnr.setTagId(MatLocType.getTag(mats.getPro_type())); |
| | | matnr.setLocType(MatLocType.getTag(mats.getPro_type())); |
| | |
| | | OrderParams orderParams = JSONObject.parseObject(JSONObject.toJSONString(params), OrderParams.class); |
| | | // Order order = orderService.selectOne(new |
| | | // EntityWrapper<Order>().eq("order_no", orderParams.getDispatch_no())); |
| | | Order order = new Order(); |
| | | Order order = null; |
| | | if (OrderType.ORDER_IN.type.equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | // 入库 |
| | | order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", |
| | |
| | | // 备货指示派工单(EO/SO)出库 |
| | | order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", |
| | | orderParams.getDispatch_no())); |
| | | } else { |
| | | throw new CoolException("单据类型不存在,不支持添加!!"); |
| | | } |
| | | } else { |
| | | throw new CoolException("单据类型不存在,不支持添加!!"); |
| | | } |
| | | // 出库 |
| | | |
| | | if (type.equals("add") && !Objects.isNull(order)) { |
| | | throw new CoolException("单据已存在, 不可重复添加!!"); |
| | | } |
| | |
| | | newOrder.setUuid(generateUUID(params)); |
| | | // 流水号(唯一) |
| | | newOrder.setDefNumber(params.getKopen_id()); |
| | | newOrder.setTargetLocation(params.getTarget_location()); |
| | | // 箱号 |
| | | newOrder.setItemName(params.getPm_tktid()); |
| | | newOrder.setSettle(OrderSettle.ORDER_SETTLE_HOLDING.type); |