Browse Source

更新

master
汪菘 3 years ago
parent
commit
b98a702bcd
  1. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDefination.java
  2. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/ItemProtocol.java
  3. 7
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDefination.java
  4. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/ItemProtocol.java
  5. 65
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDefination.java
  6. 68
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/ItemProtocol.java
  7. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDefination.java
  8. 54
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java
  9. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/ItemProtocol.java
  10. 10
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDefination.java
  11. 46
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java
  12. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/ItemProtocol.java
  13. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDefination.java
  14. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/ItemProtocol.java
  15. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDefination.java
  16. 8
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/ItemProtocol.java
  17. 3
      nladmin-system/src/main/java/org/nl/acs/order/service/LabelingTemplateService.java
  18. 86
      nladmin-system/src/main/java/org/nl/acs/order/service/impl/LabelingTemplateServiceImpl.java
  19. BIN
      nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDefination.java

@ -56,10 +56,10 @@ public class HaiLiangCoatingDefination implements OpcDeviceDriverDefination {
public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB605.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB605.B2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB605.B3"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB605.B4"));
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB605.W0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB605.W2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB605.W4"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB605.W6"));
list.add(new ItemDto(ItemProtocol.item_order, "当前执行工单号", "DB605.D8"));
list.add(new ItemDto(ItemProtocol.item_order_detail, "当前工单明细号", "DB605.D12"));
list.add(new ItemDto(ItemProtocol.item_detail_qty, "当前工单实时上料数量", "DB605.D16"));

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/ItemProtocol.java

@ -76,10 +76,10 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB605.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB605.B2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB605.B3"));
list.add(new ItemDto(item_error, "故障信号", "DB605.B4"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB605.W0"));
list.add(new ItemDto(item_mode, "工作模式", "DB605.W2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB605.W4"));
list.add(new ItemDto(item_error, "故障信号", "DB605.W6"));
list.add(new ItemDto(item_order, "当前执行工单号", "DB605.D8"));
list.add(new ItemDto(item_order_detail, "当前工单明细号", "DB605.D12"));
list.add(new ItemDto(item_detail_qty, "当前工单实时上料数量", "DB605.D16"));

7
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDefination.java

@ -56,9 +56,10 @@ public class HaiLiangFeedingDefination implements OpcDeviceDriverDefination {
public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB601.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB601.B2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB601.B3"));
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB601.W0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB601.W2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB601.W4"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB601.W6"));
list.add(new ItemDto(ItemProtocol.item_order, "当前执行工单号", "DB601.D8"));
list.add(new ItemDto(ItemProtocol.item_order_detail, "当前工单明细号", "DB601.D12"));
list.add(new ItemDto(ItemProtocol.item_order_qty, "当前工单上料数量 ", "DB601.D16"));

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/ItemProtocol.java

@ -90,10 +90,10 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB601.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB601.B2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB601.B3"));
list.add(new ItemDto(item_error, "故障信号", "DB601.B4"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB601.W0"));
list.add(new ItemDto(item_mode, "工作模式", "DB601.W2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB601.W4"));
list.add(new ItemDto(item_error, "故障信号", "DB601.W6"));
list.add(new ItemDto(item_order, "当前执行工单号", "DB601.D8"));
list.add(new ItemDto(item_order_detail, "当前工单明细号", "DB601.D12"));
list.add(new ItemDto(item_order_qty, "当前工单上料数量 ", "DB601.D16"));

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

@ -56,38 +56,39 @@ public class HaiLiangFeedingTrunkDefination implements OpcDeviceDriverDefination
public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB600.B2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB600.B3"));
list.add(new ItemDto(ItemProtocol.item_order, "当前执行工单号", "DB600.D4"));
list.add(new ItemDto(ItemProtocol.item_order_detail, "当前工单明细号", "DB600.D8"));
list.add(new ItemDto(ItemProtocol.item_last_order_detail, "上次完成工单明细号", "DB600.D12"));
list.add(new ItemDto(ItemProtocol.item_order_feeding_qty, "当前工单上料数量", "DB600.D16"));
list.add(new ItemDto(ItemProtocol.item_detail_feeding_qty, "当前工单明细号上料数量", "DB600.D20"));
list.add(new ItemDto(ItemProtocol.item_detail_lettering_qty, "当前工单明细号刻字数量", "DB600.D24"));
list.add(new ItemDto(ItemProtocol.item_detail_lettering_qualified_qty, "当前工单明细号刻字合格数量", "DB600.D28"));
list.add(new ItemDto(ItemProtocol.item_detail_risking_qualified_qty, "当前工单明细号套冒合格数", "DB600.D32"));
list.add(new ItemDto(ItemProtocol.item_detail_risking_qty, "当前工单明细号套冒数", "DB600.D36"));
list.add(new ItemDto(ItemProtocol.item_detail_strapping_qty, "当前工单明细号捆扎包数", "DB600.D40"));
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_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"));
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.W0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB600.W2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB600.W4"));
list.add(new ItemDto(ItemProtocol.item_order, "当前执行工单号", "DB600.D6"));
list.add(new ItemDto(ItemProtocol.item_order_detail, "当前工单明细号", "DB600.D10"));
list.add(new ItemDto(ItemProtocol.item_last_order_detail, "上次完成工单明细号", "DB600.D14"));
list.add(new ItemDto(ItemProtocol.item_order_feeding_qty, "当前工单上料数量", "DB600.D18"));
list.add(new ItemDto(ItemProtocol.item_detail_feeding_qty, "当前工单明细号上料数量", "DB600.D22"));
list.add(new ItemDto(ItemProtocol.item_detail_feeding_qualified_qty, "当前工单明细号上料合格数量", "DB600.D122"));
list.add(new ItemDto(ItemProtocol.item_detail_lettering_qty, "当前工单明细号刻字数量", "DB600.D26"));
list.add(new ItemDto(ItemProtocol.item_detail_lettering_qualified_qty, "当前工单明细号刻字合格数量", "DB600.D30"));
list.add(new ItemDto(ItemProtocol.item_detail_risking_qualified_qty, "当前工单明细号套冒合格数", "DB600.D34"));
list.add(new ItemDto(ItemProtocol.item_detail_risking_qty, "当前工单明细号套冒数", "DB600.D38"));
list.add(new ItemDto(ItemProtocol.item_detail_strapping_qty, "当前工单明细号捆扎包数", "DB600.D42"));
list.add(new ItemDto(ItemProtocol.item_detail_strapping_oneqty, "当前工单明细号捆扎根数", "DB600.D46"));
list.add(new ItemDto(ItemProtocol.item_detail_coating_qty, "当前工单明细号裹膜数", "DB600.D50"));
list.add(new ItemDto(ItemProtocol.item_labeling_order, "当前贴标工单明细号", "DB600.D54"));
list.add(new ItemDto(ItemProtocol.item_detail_labeling_qualified_qty, "当前工单明细号刻字数量", "DB600.D58"));
list.add(new ItemDto(ItemProtocol.item_detail_labeling_qty, "当前贴标工单明细号贴标数", "DB600.D62"));
list.add(new ItemDto(ItemProtocol.item_ready, "设备就绪", "DB600.D66"));
list.add(new ItemDto( ItemProtocol.item_clear, "清料", "DB600.D70"));
list.add(new ItemDto( ItemProtocol.item_pause, "暂停", "DB600.D74"));
list.add(new ItemDto(ItemProtocol.item_line_speed, "线体速度", "DB600.REAL78"));
list.add(new ItemDto(ItemProtocol.item_feeding_mouth, "上料口", "DB600.D82"));
list.add(new ItemDto(ItemProtocol.item_is_lettering, "是否刻字", "DB600.D86"));
list.add(new ItemDto(ItemProtocol.item_is_risking, "是否套冒", "DB600.D90"));
list.add(new ItemDto(ItemProtocol.item_is_coating, "是否裹膜", "DB600.D94"));
list.add(new ItemDto(ItemProtocol.item_is_strapping, "是否捆扎", "DB600.D98"));
list.add(new ItemDto(ItemProtocol.item_is_labeling, "是否贴标", "DB600.D102"));
list.add(new ItemDto(ItemProtocol.item_delay_time, "工段动作延时", "DB600.D106"));
list.add(new ItemDto(ItemProtocol.item_lettering_frequency, "刻字频率", "DB600.D110"));
list.add(new ItemDto(ItemProtocol.item_one_speed, "捆扎裹膜贴标段输送速度", "DB600.REAL114"));
list.add(new ItemDto(ItemProtocol.item_coating_frequency, "裹膜机频率", "DB600.D118"));
return list;
}

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

@ -369,46 +369,46 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB600.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB600.B2", Boolean.valueOf(true)));
list.add(new ItemDto(item_error, "故障信号", "DB600.B3"));
list.add(new ItemDto(item_order, "当前执行工单号", "DB600.D4"));
list.add(new ItemDto(item_order_detail, "当前工单明细号", "DB600.D8"));
list.add(new ItemDto(item_last_order_detail, "上次完成工单明细号", "DB600.D12"));
list.add(new ItemDto(item_order_feeding_qty, "当前工单上料数量", "DB600.D16"));
list.add(new ItemDto(item_detail_feeding_qty, "当前工单明细号上料数量", "DB600.D20"));
list.add(new ItemDto(item_detail_feeding_qualified_qty, "当前工单明细号上料合格数量", "DB600.D120"));
list.add(new ItemDto(item_detail_lettering_qty, "当前工单明细号刻字数量", "DB600.D24"));
list.add(new ItemDto(item_detail_lettering_qualified_qty, "当前工单明细号刻字合格数量", "DB600.D28"));
list.add(new ItemDto(item_detail_risking_qualified_qty, "当前工单明细号套冒合格数", "DB600.D32"));
list.add(new ItemDto(item_detail_risking_qty, "当前工单明细号套冒数", "DB600.D36"));
list.add(new ItemDto(item_detail_strapping_qty, "当前工单明细号捆扎包数", "DB600.D40"));
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_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"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB600.W0"));
list.add(new ItemDto(item_mode, "工作模式", "DB600.W2", Boolean.valueOf(true)));
list.add(new ItemDto(item_error, "故障信号", "DB600.W4"));
list.add(new ItemDto(item_order, "当前执行工单号", "DB600.D6"));
list.add(new ItemDto(item_order_detail, "当前工单明细号", "DB600.D10"));
list.add(new ItemDto(item_last_order_detail, "上次完成工单明细号", "DB600.D14"));
list.add(new ItemDto(item_order_feeding_qty, "当前工单上料数量", "DB600.D18"));
list.add(new ItemDto(item_detail_feeding_qty, "当前工单明细号上料数量", "DB600.D22"));
list.add(new ItemDto(item_detail_feeding_qualified_qty, "当前工单明细号上料合格数量", "DB600.D122"));
list.add(new ItemDto(item_detail_lettering_qty, "当前工单明细号刻字数量", "DB600.D26"));
list.add(new ItemDto(item_detail_lettering_qualified_qty, "当前工单明细号刻字合格数量", "DB600.D30"));
list.add(new ItemDto(item_detail_risking_qualified_qty, "当前工单明细号套冒合格数", "DB600.D34"));
list.add(new ItemDto(item_detail_risking_qty, "当前工单明细号套冒数", "DB600.D38"));
list.add(new ItemDto(item_detail_strapping_qty, "当前工单明细号捆扎包数", "DB600.D42"));
list.add(new ItemDto(item_detail_strapping_oneqty, "当前工单明细号捆扎根数", "DB600.D46"));
list.add(new ItemDto(item_detail_coating_qty, "当前工单明细号裹膜数", "DB600.D50"));
list.add(new ItemDto(item_labeling_order, "当前贴标工单明细号", "DB600.D54"));
list.add(new ItemDto(item_detail_labeling_qualified_qty, "当前工单明细号刻字数量", "DB600.D58"));
list.add(new ItemDto(item_detail_labeling_qty, "当前贴标工单明细号贴标数", "DB600.D62"));
list.add(new ItemDto(item_ready, "设备就绪", "DB600.D66"));
list.add(new ItemDto( item_clear, "清料", "DB600.D70"));
list.add(new ItemDto( item_pause, "暂停", "DB600.D74"));
list.add(new ItemDto(item_line_speed, "线体速度", "DB600.REAL78"));
list.add(new ItemDto(item_feeding_mouth, "上料口", "DB600.D82"));
list.add(new ItemDto(item_is_lettering, "是否刻字", "DB600.D86"));
list.add(new ItemDto(item_is_risking, "是否套冒", "DB600.D90"));
list.add(new ItemDto(item_is_coating, "是否裹膜", "DB600.D94"));
list.add(new ItemDto(item_is_strapping, "是否捆扎", "DB600.D98"));
list.add(new ItemDto(item_is_labeling, "是否贴标", "DB600.D102"));
list.add(new ItemDto(item_delay_time, "工段动作延时", "DB600.D106"));
list.add(new ItemDto(item_lettering_frequency, "刻字频率", "DB600.D110"));
list.add(new ItemDto(item_one_speed, "捆扎裹膜贴标段输送速度", "DB600.REAL114"));
list.add(new ItemDto(item_coating_frequency, "裹膜机频率", "DB600.D118"));
return list;
}
public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_heartbeat, "心跳", "DB610.B0"));
list.add(new ItemDto(item_to_heartbeat, "心跳", "DB610.W0"));
list.add(new ItemDto(item_to_order, "工单号", "DB610.D2"));
list.add(new ItemDto(item_to_order_detail, "工单明细号", "DB610.D6"));
list.add(new ItemDto(item_to_order_feeding_qty, "工单上料总数量", "DB610.D10"));

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDefination.java

@ -56,10 +56,10 @@ public class HaiLiangLabelingDefination implements OpcDeviceDriverDefination {
public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB606.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB606.B2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB606.B3"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB606.B4"));
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB606.W0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB606.W2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB606.W4"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB606.W6"));
list.add(new ItemDto(ItemProtocol.item_order, "当前执行工单号", "DB606.D8"));
list.add(new ItemDto(ItemProtocol.item_order_detail, "当前工单明细号", "DB606.D12"));
list.add(new ItemDto(ItemProtocol.item_detail_qty, "当前工单实时上料数量", "DB606.D16"));

54
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java

@ -1,17 +1,22 @@
package org.nl.acs.device_driver.hailiang.hailiang_labeling;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.config.AcsConfig;
import org.nl.acs.config.server.AcsConfigService;
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.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.LabelingTemplateService;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.ProduceshiftorderdetailService;
import org.nl.acs.order.service.dto.LabelingTemplateDto;
import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto;
import org.nl.exception.BadRequestException;
import org.nl.utils.SpringContextHolder;
@ -45,6 +50,9 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServer.class);
@Autowired
LabelingTemplateService labelingTemplateService = SpringContextHolder.getBean(LabelingTemplateService.class);
String device_code;
int mode = 0;
int last_mode = 0;
@ -65,6 +73,8 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
private Date detail_time = new Date();
private int detail_time_out = 3000;
@Override
public void execute() {
String message = null;
@ -125,18 +135,30 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
break;
case 2:
break;
case 4:
case 3:
//申请贴标
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
apply_labeling_message(String.valueOf(order),String.valueOf(order_detail),String.valueOf(detail_qty));
}
break;
case 5:
//贴标完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
}
break;
case 5:
case 6:
//强制贴标完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
}
break;
//工单完成
case 7:
break;
//工单强制完成
case 8:
break;
}
}
last_mode = mode;
@ -170,6 +192,34 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
}
}
public synchronized boolean apply_labeling_message(String order, String order_detail,String qty) {
Date date = new Date();
if (date.getTime() - this.detail_time_out < (long) this.detail_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.detail_time_out);
return false;
} else {
if (date.getTime() - this.detail_time_out < (long) this.detail_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.detail_time_out);
return false;
} else {
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
if(ObjectUtil.isEmpty(dto)){
throw new BadRequestException("未找到可下发工单明细!");
}
Boolean flag = labelingTemplateService.printMessage(dto,qty);
if(flag){
logServer.deviceLogToacs(this.device_code,"","","下发贴标信息成功");
writing(itemProtocol.item_to_command,String.valueOf(mode));
requireSucess = true;
return true;
} else {
return false;
}
}
}
}
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;

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/ItemProtocol.java

@ -71,10 +71,10 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB606.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB606.B2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB606.B3"));
list.add(new ItemDto(item_error, "故障信号", "DB606.B4"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB606.W0"));
list.add(new ItemDto(item_mode, "工作模式", "DB606.W2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB606.W4"));
list.add(new ItemDto(item_error, "故障信号", "DB606.W6"));
list.add(new ItemDto(item_order, "当前执行工单号", "DB606.D8"));
list.add(new ItemDto(item_order_detail, "当前工单明细号", "DB606.D12"));
list.add(new ItemDto(item_detail_qty, "当前工单实时上料数量", "DB606.D16"));

10
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDefination.java

@ -12,7 +12,7 @@ import java.util.LinkedList;
import java.util.List;
/**
* 海亮贴标线体
* 海亮刻字线体
*/
@Service
public class HaiLiangLetteringDefination implements OpcDeviceDriverDefination {
@ -56,10 +56,10 @@ public class HaiLiangLetteringDefination implements OpcDeviceDriverDefination {
public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB602.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB602.B2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB602.B3"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB602.B4"));
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB602.W0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB602.W2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB602.W4"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB602.W6"));
list.add(new ItemDto(ItemProtocol.item_order, "当前执行工单号", "DB602.D8"));
list.add(new ItemDto(ItemProtocol.item_order_detail, "当前工单明细号", "DB602.D12"));
list.add(new ItemDto(ItemProtocol.item_detail_qty, "当前工单实时上料数量", "DB602.D16"));

46
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java

@ -25,7 +25,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* 海亮贴标线体
* 海亮刻字线体
*/
@Slf4j
@Data
@ -42,9 +42,6 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServer.class);
@Autowired
AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class);
String device_code;
int mode = 0;
int last_mode = 0;
@ -66,10 +63,6 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
private Date detail_time = new Date();
private int detail_time_out = 3000;
Process printProcess;
String printName = "HP LaserJet Pro MFP M225-M226 PCL 6";
String printurl = "";
@Override
public Device getDevice() {
@ -137,11 +130,7 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
case 2:
break;
case 3:
//申请贴标
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
printMessage(String.valueOf(order),String.valueOf(order_detail),String.valueOf(detail_qualified_qty));
}
break;
case 4:
//贴标完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
@ -181,37 +170,6 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
return true;
}
}
public synchronized boolean printMessage(String order, String order_detail,String qty) {
Date date = new Date();
if (date.getTime() - this.detail_time_out < (long) this.detail_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.detail_time_out);
return false;
} else {
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
if(ObjectUtil.isEmpty(dto)){
throw new BadRequestException("未找到可下发工单明细!");
}
String template = dto.getLabeling_template();
printName = acsConfigService.findConfigFromCache().get(AcsConfig.PRINTNAME);
printurl = acsConfigService.findConfigFromCache().get(AcsConfig.PRINTURL);
try
{
printProcess = Runtime
.getRuntime()
.exec(new String[] {
printurl, "PrinterName=" + printName,
"LabelName=Label.ct", "Text5="+ "111","Text6="+"222","Text7="+"333","Text8="+"444"});
}
catch (Exception e)
{
System.out.println("aaa");
}
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()

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/ItemProtocol.java

@ -71,10 +71,10 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB602.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB602.B2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB602.B3"));
list.add(new ItemDto(item_error, "故障信号", "DB602.B4"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB602.W0"));
list.add(new ItemDto(item_mode, "工作模式", "DB602.W2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB602.W4"));
list.add(new ItemDto(item_error, "故障信号", "DB602.W6"));
list.add(new ItemDto(item_order, "当前执行工单号", "DB602.D8"));
list.add(new ItemDto(item_order_detail, "当前工单明细号", "DB602.D12"));
list.add(new ItemDto(item_detail_qty, "当前工单实时上料数量", "DB602.D16"));

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDefination.java

@ -56,10 +56,10 @@ public class HaiLiangRiskingDefination implements OpcDeviceDriverDefination {
public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB603.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB603.B2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB603.B3"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB603.B4"));
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB603.W0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB603.W2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB603.W4"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB603.W6"));
list.add(new ItemDto(ItemProtocol.item_order, "当前执行工单号", "DB603.D8"));
list.add(new ItemDto(ItemProtocol.item_order_detail, "当前工单明细号", "DB603.D12"));
list.add(new ItemDto(ItemProtocol.item_detail_qty, "当前工单实时上料数量", "DB603.D16"));

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/ItemProtocol.java

@ -74,10 +74,10 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB603.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB603.B2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB603.B3"));
list.add(new ItemDto(item_error, "故障信号", "DB603.B4"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB603.W0"));
list.add(new ItemDto(item_mode, "工作模式", "DB603.W2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB603.W4"));
list.add(new ItemDto(item_error, "故障信号", "DB603.W6"));
list.add(new ItemDto(item_order, "当前执行工单号", "DB603.D8"));
list.add(new ItemDto(item_order_detail, "当前工单明细号", "DB603.D12"));
list.add(new ItemDto(item_detail_qty, "当前工单实时上料数量", "DB603.D16"));

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDefination.java

@ -56,10 +56,10 @@ public class HaiLiangStrappingDefination implements OpcDeviceDriverDefination {
public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB604.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB604.B2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB604.B3"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB604.B4"));
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB604.W0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB604.W2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电信号", "DB604.W4"));
list.add(new ItemDto(ItemProtocol.item_error, "故障信号", "DB604.W6"));
list.add(new ItemDto(ItemProtocol.item_order, "当前执行工单号", "DB604.D8"));
list.add(new ItemDto(ItemProtocol.item_order_detail, "当前工单明细号", "DB604.D12"));
list.add(new ItemDto(ItemProtocol.item_detail_qty, "当前工单实时上料数量", "DB604.D16"));

8
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/ItemProtocol.java

@ -86,10 +86,10 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB604.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB604.B2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB604.B3"));
list.add(new ItemDto(item_error, "故障信号", "DB604.B4"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB604.W0"));
list.add(new ItemDto(item_mode, "工作模式", "DB604.W2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电信号", "DB604.W4"));
list.add(new ItemDto(item_error, "故障信号", "DB604.W6"));
list.add(new ItemDto(item_order, "当前执行工单号", "DB604.D8"));
list.add(new ItemDto(item_order_detail, "当前工单明细号", "DB604.D12"));
list.add(new ItemDto(item_detail_qty, "当前工单实时上料数量", "DB604.D16"));

3
nladmin-system/src/main/java/org/nl/acs/order/service/LabelingTemplateService.java

@ -2,6 +2,7 @@
package org.nl.acs.order.service;
import org.nl.acs.order.service.dto.LabelingTemplateDto;
import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;
@ -79,4 +80,6 @@ public interface LabelingTemplateService {
* @param is_used 1 启用0 禁用
*/
void enabled(String template_id, String is_used) throws SQLException;
boolean printMessage(ProduceshiftorderdetailDto dto,String qty);
}

86
nladmin-system/src/main/java/org/nl/acs/order/service/impl/LabelingTemplateServiceImpl.java

@ -9,14 +9,19 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.config.AcsConfig;
import org.nl.acs.config.server.AcsConfigService;
import org.nl.acs.order.service.LabelingTemplateService;
import org.nl.acs.order.service.dto.LabelingTemplateDto;
import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto;
import org.nl.exception.BadRequestException;
import org.nl.utils.FileUtil;
import org.nl.utils.SecurityUtils;
import org.nl.utils.SpringContextHolder;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import org.nl.wql.util.WqlUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -36,6 +41,9 @@ import java.util.*;
@Slf4j
public class LabelingTemplateServiceImpl implements LabelingTemplateService {
@Autowired
AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class);
@Override
public Map<String,Object> queryAll(Map whereJson, Pageable page){
HashMap<String, String> map = new HashMap<>();
@ -153,4 +161,82 @@ public class LabelingTemplateServiceImpl implements LabelingTemplateService {
dto.setIs_used(is_used);
this.update(dto);
}
@Override
public boolean printMessage(ProduceshiftorderdetailDto dto,String qty){
Process printProcess;
String printName = "";
String printurl = "";
String template = dto.getLabeling_template();
printName = acsConfigService.findConfigFromCache().get(AcsConfig.PRINTNAME);
printurl = acsConfigService.findConfigFromCache().get(AcsConfig.PRINTURL);
int temp = Integer.parseInt(dto.getLabeling_template());
LabelingTemplateDto labelingTemplateDto = this.findByCode(dto.getLabeling_template());
String address = labelingTemplateDto.getTemplate_address();
try
{
switch (temp) {
case 0:
break;
case 1:
printProcess = Runtime
.getRuntime()
.exec(new String[] {
printurl, "PrinterName=" + printName,
"LabelName="+address, "Text1="+ "111","Text2="+"222","Text3="+"333"});
break;
case 2:
printProcess = Runtime
.getRuntime()
.exec(new String[] {
printurl, "PrinterName=" + printName,
"LabelName="+address, "Text1="+ "111","Text2="+"222"});
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
case 10:
break;
case 11:
break;
case 12:
break;
case 13:
break;
case 14:
break;
case 15:
break;
case 16:
break;
case 17:
break;
case 18:
break;
case 19:
break;
default:
break;
}
}
catch (Exception e)
{
System.out.println("aaa");
return false;
}
return true;
}
}

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

Binary file not shown.
Loading…
Cancel
Save