汪菘 3 years ago
parent
commit
4cf2aee8ad
  1. 18
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDefination.java
  2. 21
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java
  3. 42
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/ItemProtocol.java
  4. 22
      nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java
  5. 14
      nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java
  6. BIN
      nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls

18
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDefination.java

@ -72,10 +72,22 @@ public class HaiLiangFeedingTrunkDefination implements OpcDeviceDriverDefination
list.add(new ItemDto(ItemProtocol.item_detail_strapping_oneqty, "当前工单明细号捆扎根数", "DB600.D44"));
list.add(new ItemDto(ItemProtocol.item_detail_coating_qty, "当前工单明细号裹膜数", "DB600.D48"));
list.add(new ItemDto(ItemProtocol.item_labeling_order, "当前贴标工单明细号", "DB600.D52"));
list.add(new ItemDto(ItemProtocol.item_detail_rlabeling_qualified_qty, "当前工单明细号刻字数量", "DB600.D56"));
list.add(new ItemDto(ItemProtocol.item_detail_rlabeling_qty, "当前贴标工单明细号贴标数", "DB600.D60"));
list.add(new ItemDto(ItemProtocol.item_detail_labeling_qualified_qty, "当前工单明细号刻字数量", "DB600.D56"));
list.add(new ItemDto(ItemProtocol.item_detail_labeling_qty, "当前贴标工单明细号贴标数", "DB600.D60"));
list.add(new ItemDto(ItemProtocol.item_ready, "设备就绪", "DB600.D64"));
list.add(new ItemDto(ItemProtocol.item_clear, "清料", "DB600.D68"));
list.add(new ItemDto(ItemProtocol.item_pause, "暂停", "DB600.D72"));
list.add(new ItemDto(ItemProtocol.item_line_speed, "线体速度", "DB600.REAL76"));
list.add(new ItemDto(ItemProtocol.item_feeding_mouth, "上料口", "DB600.D80"));
list.add(new ItemDto(ItemProtocol.item_is_lettering, "是否刻字", "DB600.D84"));
list.add(new ItemDto(ItemProtocol.item_is_risking, "是否套冒", "DB600.D88"));
list.add(new ItemDto(ItemProtocol.item_is_coating, "是否裹膜", "DB600.D92"));
list.add(new ItemDto(ItemProtocol.item_is_strapping, "是否捆扎", "DB600.D96"));
list.add(new ItemDto(ItemProtocol.item_is_labeling, "是否贴标", "DB600.D100"));
list.add(new ItemDto(ItemProtocol.item_delay_time, "工段动作延时", "DB600.D104"));
list.add(new ItemDto(ItemProtocol.item_lettering_frequency, "刻字频率", "DB600.D108"));
list.add(new ItemDto(ItemProtocol.item_one_speed, "捆扎裹膜贴标段输送速度", "DB600.REAL112"));
list.add(new ItemDto(ItemProtocol.item_coating_frequency, "裹膜机频率", "DB600.D116"));
return list;
}

21
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java

@ -3,13 +3,17 @@ package org.nl.acs.device_driver.hailiang.hailiang_feeding_trunk;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.opc.Device;
import org.openscada.opc.lib.da.Server;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 海亮-上料总线体
@ -35,6 +39,9 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
int last_mode = 0;
int last_order = order;
int ready = 0;
int pause = 0;
int clear = 0;
@Override
public void execute() throws Exception {
String message = null;
@ -45,6 +52,9 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
order = this.itemProtocol.getOrder();
order_detail = this.itemProtocol.getOrder_detail();
ready = this.itemProtocol.getReady();
pause = this.itemProtocol.getPause();
clear = this.itemProtocol.getPause();
if (mode != last_mode) {
this.setRequireSucess(false);
}
@ -94,4 +104,15 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
return true;
}
public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + param;
String opcservcerid = this.getDevice().getOpc_server_id();
Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_param, Integer.parseInt(value));
ReadUtil.write(itemMap, server);
}
}

42
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/ItemProtocol.java

@ -35,11 +35,13 @@ public class ItemProtocol {
//当前贴标工单明细号
public static String item_labeling_order = "labeling_order";
//当前贴标工单明细号贴标合格数
public static String item_detail_rlabeling_qualified_qty = "detail_rlabeling_qualified_qty";
public static String item_detail_labeling_qualified_qty = "detail_labeling_qualified_qty";
//当前贴标工单明细号贴标数
public static String item_detail_rlabeling_qty = "detail_rlabeling_qty";
public static String item_detail_labeling_qty = "detail_labeling_qty";
//设备就绪
public static String item_ready = "ready";
public static String item_clear = "clear";
public static String item_pause = "pause";
public static String item_line_speed = "line_speed";
public static String item_feeding_mouth = "feeding_mouth";
public static String item_is_lettering = "is_lettering";
@ -156,20 +158,25 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_labeling_order);
}
public int getDetail_rlabeling_qualified_qty() {
return this.getOpcIntegerValue(item_detail_rlabeling_qualified_qty);
public int getDetail_labeling_qualified_qty() {
return this.getOpcIntegerValue(item_detail_labeling_qualified_qty);
}
public int getDetail_rlabeling_qty() {
return this.getOpcIntegerValue(item_detail_rlabeling_qty);
public int getDetail_labeling_qty() {
return this.getOpcIntegerValue(item_detail_labeling_qty);
}
public int getReady() {
return this.getOpcIntegerValue(item_ready);
}
public int getClear() {
return this.getOpcIntegerValue(item_clear);
}
public int getLline_speed() {
public int getLine_speed() {
return this.getOpcIntegerValue(item_line_speed);
}
@ -213,7 +220,9 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_coating_frequency);
}
public int getPause() {
return this.getOpcIntegerValue(item_pause);
}
public int getTo_heartbeat() {
return this.getOpcIntegerValue(item_to_heartbeat);
@ -370,9 +379,22 @@ public class ItemProtocol {
list.add(new ItemDto(item_detail_strapping_oneqty, "当前工单明细号捆扎根数", "DB600.D44"));
list.add(new ItemDto(item_detail_coating_qty, "当前工单明细号裹膜数", "DB600.D48"));
list.add(new ItemDto(item_labeling_order, "当前贴标工单明细号", "DB600.D52"));
list.add(new ItemDto(item_detail_rlabeling_qualified_qty, "当前工单明细号刻字数量", "DB600.D56"));
list.add(new ItemDto(item_detail_rlabeling_qty, "当前贴标工单明细号贴标数", "DB600.D60"));
list.add(new ItemDto(item_detail_labeling_qualified_qty, "当前工单明细号刻字数量", "DB600.D56"));
list.add(new ItemDto(item_detail_labeling_qty, "当前贴标工单明细号贴标数", "DB600.D60"));
list.add(new ItemDto(item_ready, "设备就绪", "DB600.D64"));
list.add(new ItemDto( item_clear, "清料", "DB600.D68"));
list.add(new ItemDto( item_pause, "暂停", "DB600.D72"));
list.add(new ItemDto(item_line_speed, "线体速度", "DB600.REAL76"));
list.add(new ItemDto(item_feeding_mouth, "上料口", "DB600.D80"));
list.add(new ItemDto(item_is_lettering, "是否刻字", "DB600.D84"));
list.add(new ItemDto(item_is_risking, "是否套冒", "DB600.D88"));
list.add(new ItemDto(item_is_coating, "是否裹膜", "DB600.D92"));
list.add(new ItemDto(item_is_strapping, "是否捆扎", "DB600.D96"));
list.add(new ItemDto(item_is_labeling, "是否贴标", "DB600.D100"));
list.add(new ItemDto(item_delay_time, "工段动作延时", "DB600.D104"));
list.add(new ItemDto(item_lettering_frequency, "刻字频率", "DB600.D108"));
list.add(new ItemDto(item_one_speed, "捆扎裹膜贴标段输送速度", "DB600.REAL112"));
list.add(new ItemDto(item_coating_frequency, "裹膜机频率", "DB600.D116"));
return list;
}

22
nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java

@ -86,7 +86,7 @@ public class ProduceshiftorderController {
@Log("工单分拣")
@ApiOperation("下发工单")
@PostMapping(value = "/工单分拣")
@PostMapping(value = "/send")
public ResponseEntity<Object> send(@RequestBody String id) {
produceshiftorderService.send(id);
return new ResponseEntity<>(HttpStatus.OK);
@ -111,24 +111,32 @@ public class ProduceshiftorderController {
@Log("工单暂停")
@ApiOperation("工单暂停")
@PostMapping(value = "/order_pause")
public ResponseEntity<Object> order_pause(@RequestBody String id) {
produceshiftorderService.order_pause(id);
public ResponseEntity<Object> order_pause(@Validated @RequestBody Map whereJson) {
produceshiftorderService.order_pause(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("工单明细暂停")
@ApiOperation("工单明细暂停")
@PostMapping(value = "/detail_pause")
public ResponseEntity<Object> detail_pause(@Validated @RequestBody Map whereJson) {
produceshiftorderService.detail_pause(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("工单强制完成")
@ApiOperation("工单强制完成")
@PostMapping(value = "/order_force_complete")
public ResponseEntity<Object> order_force_complete(@RequestBody String id) {
produceshiftorderService.order_force_complete(id);
public ResponseEntity<Object> order_force_complete(@Validated @RequestBody Map whereJson) {
produceshiftorderService.order_force_complete(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("工单明细强制完成")
@ApiOperation("工单明细强制完成")
@PostMapping(value = "/detail_force_complete")
public ResponseEntity<Object> detail_force_complete(@RequestBody String id) {
produceshiftorderService.detail_force_complete(id);
public ResponseEntity<Object> detail_force_complete(@Validated @RequestBody Map whereJson) {
produceshiftorderService.detail_force_complete(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}

14
nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java

@ -129,25 +129,27 @@ public interface ProduceshiftorderService {
/**
* 工单暂停
*
* @param id /
*/
void order_pause(String id);
void order_pause(Map whereJson);
/**
* 明细暂停
*
*/
void detail_pause(Map whereJson);
/**
* 工单强制完成
*
* @param id /
*/
void order_force_complete(String id);
void order_force_complete(Map whereJson);
/**
* 工单明细强制完成
*
* @param id /
*/
void detail_force_complete(String id);
void detail_force_complete(Map whereJson);

BIN
nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls

Binary file not shown.
Loading…
Cancel
Save