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 0fc332f..21bcbc6 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 @@ -70,8 +70,8 @@ public class ProduceshiftorderController { @Log("修改工单") @ApiOperation("修改工单") //@PreAuthorize("@el.check('produceshiftorder:edit')") - public ResponseEntity update(@Validated @RequestBody ProduceshiftorderDto dto) { - produceshiftorderService.update(dto); + public ResponseEntity update(@Validated @RequestBody Map whereJson) { + produceshiftorderService.update(whereJson); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -100,6 +100,22 @@ public class ProduceshiftorderController { return new ResponseEntity<>(HttpStatus.OK); } + @Log("急停") + @ApiOperation("急停") + @PostMapping(value = "/stop") + public ResponseEntity stop() { + produceshiftorderService.stop(); + return new ResponseEntity<>(HttpStatus.OK); + } + + @Log("设备恢复") + @ApiOperation("设备恢复") + @PostMapping(value = "/device_restore") + public ResponseEntity device_restore() { + produceshiftorderService.device_restore(); + return new ResponseEntity<>(HttpStatus.OK); + } + @Log("清料") @ApiOperation("清料") @PostMapping(value = "/clear") 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 e9d8e99..0a275c8 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 @@ -95,6 +95,13 @@ public interface ProduceshiftorderService { void update(ProduceshiftorderDto dto); + /** + * 编辑 + * + * @param whereJson / + */ + void update(Map whereJson); + /** * 多选删除 * @@ -116,6 +123,19 @@ public interface ProduceshiftorderService { */ void device_pause(); + /** + * 设备恢复 + * + */ + void device_restore(); + + /** + * 急停 + * + */ + void stop(); + + /** * 清料 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 590d2da..208966b 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 @@ -58,7 +58,7 @@ public class ProduceshiftorderdetailDto implements Serializable { private String lettering_message; /** 刻字图标类型 */ - private String lettering_icon_type; + private String lettering_icon; /** 图标后刻字信息 */ private String lettering_message2; 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 06407f9..7534231 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 @@ -97,6 +97,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A new_jo.put("cust_code", orderDteail_jo.getString("cust_code")); new_jo.put("cust_name", orderDteail_jo.getString("cust_name")); new_jo.put("qty", orderDteail_jo.getString("order_detail_qty")); + new_jo.put("lettering_icon_type", orderDteail_jo.getString("lettering_icon")); + new_jo.put("lettering_message", orderDteail_jo.getString("lettering_message")); + new_jo.put("lettering_message2", orderDteail_jo.getString("lettering_message2")); new_jo.put("type", "orderDteail"); new_jo.put("is_flag", "0"); children.add(new_jo); @@ -152,6 +155,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A new_jo.put("cust_code", orderDteail_jo.getString("cust_code")); new_jo.put("cust_name", orderDteail_jo.getString("cust_name")); new_jo.put("qty", orderDteail_jo.getString("order_detail_qty")); + new_jo.put("lettering_icon_type", orderDteail_jo.getString("lettering_icon_type")); + new_jo.put("lettering_message", orderDteail_jo.getString("lettering_message")); + new_jo.put("lettering_message2", orderDteail_jo.getString("lettering_message2")); new_jo.put("type", "orderDteail"); new_jo.put("is_flag", "0"); children.add(new_jo); @@ -308,6 +314,132 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A } } + @Override + public void update(Map whereJson) { + JSONObject param=new JSONObject(whereJson); + String currentUsername = SecurityUtils.getCurrentUsername(); + ProduceshiftorderDto orderDto = new ProduceshiftorderDto(); + String order_id = MapUtil.getStr(whereJson, "order_id"); + String order_code = MapUtil.getStr(whereJson, "order_code"); + String material_id = MapUtil.getStr(whereJson, "material_id"); + String material_code = MapUtil.getStr(whereJson, "material_code"); + String material_name = MapUtil.getStr(whereJson, "material_name"); + String material_spec = MapUtil.getStr(whereJson, "material_spec"); + String outer_diameter = MapUtil.getStr(whereJson, "outer_diameter"); + String wall_thickness = MapUtil.getStr(whereJson, "wall_thickness"); + String length = MapUtil.getStr(whereJson, "length"); + String qty = MapUtil.getStr(whereJson, "qty"); + if(StrUtil.isEmpty(material_code)){ + throw new RuntimeException("物料编号不可为空!"); + } + JSONArray tableData = param.getJSONArray("tableData"); + if (ObjectUtil.isEmpty(tableData)){ + throw new BadRequestException("客户信息不可为空!"); + } + + ProduceshiftorderDto entity = this.findById(order_id); + if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); + 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); + orderDto.setOrder_code(order_code); + orderDto.setQty(qty); + orderDto.setCreate_by(currentUsername); + orderDto.setIs_coating("1"); + orderDto.setIs_labeling("1"); + orderDto.setIs_lettering("1"); + orderDto.setIs_risking("1"); + orderDto.setIs_strapping("1"); + orderDto.setIs_unbundling("1"); + + for(int i=0; i deviceAll = deviceAppService.findDeviceDriver(HaiLiangFeedingTrunkDeviceDriver.class); + if (deviceAll.get(0) instanceof HaiLiangFeedingTrunkDeviceDriver) { + haiLiangFeedingTrunkDeviceDriver = (HaiLiangFeedingTrunkDeviceDriver) deviceAll.get(0); + if(haiLiangFeedingTrunkDeviceDriver.getMode() !=2){ + throw new BadRequestException("设备未联机,无法下发恢复!"); + } + if(haiLiangFeedingTrunkDeviceDriver.getPause() == 0 ){ + throw new BadRequestException("设备已处于恢复状态,无法下发恢复!"); + } + haiLiangFeedingTrunkDeviceDriver.writing("item_to_pause","0"); + } + } + + + @Override + public void stop() { + HaiLiangFeedingTrunkDeviceDriver haiLiangFeedingTrunkDeviceDriver; + List deviceAll = deviceAppService.findDeviceDriver(HaiLiangFeedingTrunkDeviceDriver.class); + if (deviceAll.get(0) instanceof HaiLiangFeedingTrunkDeviceDriver) { + haiLiangFeedingTrunkDeviceDriver = (HaiLiangFeedingTrunkDeviceDriver) deviceAll.get(0); + if(haiLiangFeedingTrunkDeviceDriver.getMode() !=2){ + throw new BadRequestException("设备未联机,无法下发恢复!"); + } + if(haiLiangFeedingTrunkDeviceDriver.getPause() == 0 ){ + throw new BadRequestException("设备已处于恢复状态,无法下发恢复!"); + } + haiLiangFeedingTrunkDeviceDriver.writing("item_to_pause","0"); + } + } + @Override public void clear() { HaiLiangFeedingTrunkDeviceDriver haiLiangFeedingTrunkDeviceDriver; @@ -399,8 +564,8 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A if(haiLiangFeedingTrunkDeviceDriver.getMode() !=2){ throw new BadRequestException("设备未联机,无法下发暂停!"); } - if(haiLiangFeedingTrunkDeviceDriver.getPause() == 0 ){ - throw new BadRequestException("设备已处于恢复状态,无法下发恢复!"); + if(haiLiangFeedingTrunkDeviceDriver.getPause() != 0 ){ + throw new BadRequestException("设备已处于暂停状态,无法下发暂停!"); } haiLiangFeedingTrunkDeviceDriver.writing("item_to_pause","0"); } 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 848ea71..7f56323 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