diff --git a/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java b/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java index 49b4329..d838143 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java @@ -75,6 +75,15 @@ public class ProduceshiftorderController { return new ResponseEntity<>(HttpStatus.OK); } + @Log("下发工单") + @ApiOperation("下发工单") + //@PreAuthorize("@el.check('produceshiftorder:del')") + @DeleteMapping + public ResponseEntity send(@RequestBody String id) { + produceshiftorderService.send(id); + return new ResponseEntity<>(HttpStatus.OK); + } + @Log("导出工单") @ApiOperation("导出工单") @GetMapping(value = "/download") diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java index 1cd42e4..87458e7 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java @@ -94,6 +94,13 @@ public interface ProduceshiftorderService { */ void deleteAll(String[] ids); + /** + * 下发 + * + * @param id / + */ + void send(String id); + /** * 取消任务 * diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java b/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java index 53196a8..67a0c11 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java @@ -12,13 +12,13 @@ import java.io.Serializable; public class ProduceshiftorderdetailDto implements Serializable { /** 工单明细标识 */ - private String orderDetail_id; + private String order_detail_id; /** 工单明细编码 */ - private String orderDetail_code; + private String order_detail_code; /** 工单明细类型 */ - private String orderDetail_type; + private String order_detail_type; /** 优先级 */ private String priority; diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java index 49c5dd1..4a771a0 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java @@ -80,8 +80,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A for (int j = 0; j < orderDteail_ja.size(); j++) { JSONObject orderDteail_jo = orderDteail_ja.getJSONObject(j); JSONObject new_jo = new JSONObject(); - new_jo.put("order_id", orderDteail_jo.getString("orderdetail_id")); - new_jo.put("order_code", orderDteail_jo.getString("orderdetail_code")); + new_jo.put("order_id", orderDteail_jo.getString("order_detail_id")); + new_jo.put("order_code", orderDteail_jo.getString("order_detail_code")); + new_jo.put("order_status", orderDteail_jo.getString("order_detail_status")); new_jo.put("is_active", orderDteail_jo.getString("is_active")); new_jo.put("is_delete", orderDteail_jo.getString("is_delete")); new_jo.put("create_by", orderDteail_jo.getString("create_by")); @@ -91,7 +92,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A new_jo.put("cust_id", orderDteail_jo.getString("cust_id")); new_jo.put("cust_code", orderDteail_jo.getString("cust_code")); new_jo.put("cust_name", orderDteail_jo.getString("cust_name")); - new_jo.put("order_qty", orderDteail_jo.getString("order_qty")); + new_jo.put("qty", orderDteail_jo.getString("order_detail_qty")); new_jo.put("type", "orderDteail"); jo.put("is_flag", "0"); children.add(new_jo); @@ -171,6 +172,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A orderDto.setMaterial_code(material_code); orderDto.setMaterial_name(material_name); orderDto.setMaterial_spec(material_spec); + orderDto.setMaterial_uuid(material_id); orderDto.setLength(length); orderDto.setOuter_diameter(outer_diameter); orderDto.setWall_thickness(wall_thickness); @@ -208,9 +210,10 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A detaildto.setOrder_id(order_id); detaildto.setOrder_code(order_code); detaildto.setOrder_detail_status("00"); + detaildto.setOrder_qty(qty); detaildto.setIs_deleted("0"); - detaildto.setOrderDetail_id(IdUtil.simpleUUID()); - detaildto.setOrderDetail_code(String.valueOf(i)); + detaildto.setOrder_detail_id(IdUtil.simpleUUID()); + detaildto.setOrder_detail_code(String.valueOf(i+1)); detaildto.setCust_id(customer_id); detaildto.setCust_code(customer_code); detaildto.setCust_name(customer_name); @@ -220,7 +223,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A detaildto.setLength(length); detaildto.setWall_thickness(wall_thickness); detaildto.setOuter_diameter(outer_diameter); - detaildto.setOrderDetail_code(detail_qty); detaildto.setLabeling_message(lettering_message); detaildto.setStrap_number(strap_number); detaildto.setStrap_tailint_number(strap_tailint_number); @@ -271,6 +273,24 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A } + + @Override + @Transactional(rollbackFor = Exception.class) + public void send(String id) { + ProduceshiftorderDto entity = this.findById(id); + if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); + entity.setIs_deleted("1"); + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); + JSONObject json= (JSONObject) JSONObject.toJSON(entity); + wo.update(json); + + HashMap map = new HashMap<>(); + map.put("is_deleted","1"); + WQLObject.getWQLObject("acs_produceshiftorderdetail").update(map,"order_id = '"+ id + "'"); + + } + + @Override public void download(List dtos, HttpServletResponse response) throws IOException { diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls b/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls index d9efd34..5b75b2b 100644 Binary files a/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls and b/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls differ