add 封箱拆箱线, rev 测试读写
This commit is contained in:
@@ -31,6 +31,10 @@ public enum StatusEnum {
|
||||
SEND("1", "立即下发", ""),
|
||||
|
||||
|
||||
//是否
|
||||
NO("0", "否", ""),
|
||||
YES("1", "是", ""),
|
||||
|
||||
//暂停或恢复缓存线
|
||||
PAUSE_TYPE("1", "暂停", ""),
|
||||
RESUME_TYPE("2", "恢复", ""),
|
||||
|
||||
@@ -83,7 +83,13 @@ public enum DriverTypeEnum {
|
||||
|
||||
HAILIANG_OLD_SPECIAL_PICK_STATION_DRIVER(37, "hailiang_old_special_pick_station", "海亮-smart专机收料位", "conveyor"),
|
||||
|
||||
HAILIANG_OLD_SPECIAL_EMPTY_POUR_DRIVER(38, "hailiang_old_special_pour_station", "海亮-smart专机倒料位", "conveyor");
|
||||
HAILIANG_OLD_SPECIAL_EMPTY_POUR_DRIVER(38, "hailiang_old_special_pour_station", "海亮-smart专机倒料位", "conveyor"),
|
||||
|
||||
HAILIANG_EALING_MACHINE_DRIVER(39, "hailiang_ealing_machine", "海亮-装箱机", "conveyor"),
|
||||
|
||||
HAILIANG_SEALING_MACHINE_DRIVER(40, "hailiang_sealing_machine", "海亮-封箱机", "conveyor"),
|
||||
|
||||
HAILIANG_UNBOXING_MACHINE_DRIVER(41, "hailiang_unboxing_machine", "海亮-开箱机", "conveyor");
|
||||
|
||||
|
||||
//驱动索引
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspect
|
||||
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_scanner.StandardScannerDeviceDriver;
|
||||
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.*;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
@@ -328,7 +329,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
@Override
|
||||
public JSONArray selectList() {
|
||||
//设备基础信息表【acs_device】
|
||||
JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND is_config = 'true'","device_code").getResultJSONArray(0);
|
||||
JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND is_config = 'true'", "device_code").getResultJSONArray(0);
|
||||
JSONArray result = new JSONArray();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject obj = arr.getJSONObject(i);
|
||||
@@ -689,9 +690,6 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// deviceAppService.reload();
|
||||
}
|
||||
|
||||
@@ -702,19 +700,6 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
String[] point = device_code.split("-");
|
||||
device_code = point[0];
|
||||
}
|
||||
//需要数量
|
||||
String hasGoodStatus = form.getString("hasGoodStatus");
|
||||
if (StrUtil.isEmpty(hasGoodStatus)) {
|
||||
hasGoodStatus = "0";
|
||||
}
|
||||
String batch = form.getString("batch");
|
||||
String material_type = form.getString("material_type");
|
||||
String quantity = form.getString("quantity");
|
||||
String remark = form.getString("remark");
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
String islock = form.getString("islock");
|
||||
String requireSucess = form.getString("requireSucess");
|
||||
String fullrequireSucess = form.getString("fullrequireSucess");
|
||||
if (device_code.indexOf(".") != -1) {
|
||||
device_code = device_code.substring(0, device_code.indexOf("."));
|
||||
}
|
||||
@@ -722,6 +707,10 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
throw new BadRequestException("未找到对应设备:" + device_code);
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof DeviceStageMonitor) {
|
||||
DeviceStageMonitor deviceStageMonitor = (DeviceStageMonitor) device.getDeviceDriver();
|
||||
deviceStageMonitor.setDeviceStatus(form);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1335,12 +1324,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
|
||||
|
||||
@Override
|
||||
public void updateDeviceCodeByAddress(StorageCellDto dto){
|
||||
public void updateDeviceCodeByAddress(StorageCellDto dto) {
|
||||
Iterator iterator = storageCells.iterator();
|
||||
StorageCellDto dto1 = null;
|
||||
while (iterator.hasNext()) {
|
||||
StorageCellDto storageCellDto = (StorageCellDto) iterator.next();
|
||||
if(StrUtil.equals(storageCellDto.getStorage_code(),dto.getStorage_code())){
|
||||
if (StrUtil.equals(storageCellDto.getStorage_code(), dto.getStorage_code())) {
|
||||
storageCells.remove(storageCellDto);
|
||||
storageCells.add(dto);
|
||||
}
|
||||
@@ -1348,16 +1337,16 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDeviceCodeByAddress(StorageCellDto dto){
|
||||
public void addDeviceCodeByAddress(StorageCellDto dto) {
|
||||
Iterator iterator = storageCells.iterator();
|
||||
StorageCellDto dto1 = null;
|
||||
while (iterator.hasNext()) {
|
||||
StorageCellDto storageCellDto = (StorageCellDto) iterator.next();
|
||||
if(StrUtil.equals(storageCellDto.getStorage_code(),dto.getStorage_code())){
|
||||
if (StrUtil.equals(storageCellDto.getStorage_code(), dto.getStorage_code())) {
|
||||
dto1 = storageCellDto;
|
||||
}
|
||||
}
|
||||
if(ObjectUtil.isEmpty(dto1)){
|
||||
if (ObjectUtil.isEmpty(dto1)) {
|
||||
storageCells.add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public interface IssuedDeviceOrderInfo {
|
||||
void issuedOrderInfo(ProduceshiftorderDto dto);
|
||||
|
||||
//下发工单完成信息
|
||||
void issuedOrderFinish();
|
||||
void issuedOrderFinish(String autoFinish);
|
||||
|
||||
//工单暂停
|
||||
void toStop();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_feeding_line;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
@@ -300,6 +299,7 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
|
||||
jo.put("in_ready", in_ready == 1 ? "是" : "否");
|
||||
jo.put("task_finish", task_finish == 1 ? "是" : "否");
|
||||
jo.put("allowed_in", allowed_in == 1 ? "是" : "否");
|
||||
jo.put("requireSucess", requireSucess.toString());
|
||||
jo.put("in_pcsn", in_pcsn);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("error", ErrorUtil.getDictDetail("clean_up_error_type", String.valueOf(this.getError())));
|
||||
@@ -320,9 +320,9 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
|
||||
*/
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
String requestSucess = data.getString("requireSucess");
|
||||
if (StrUtil.isNotEmpty(requestSucess))
|
||||
this.requireSucess = requestSucess.equals("0") ? false : true;
|
||||
Boolean requireSucess = data.getBoolean("requireSucess");
|
||||
if (ObjectUtil.isNotEmpty(requireSucess))
|
||||
this.requireSucess = requireSucess;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +362,7 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
|
||||
* 下发工单完成信息
|
||||
*/
|
||||
@Override
|
||||
public void issuedOrderFinish() {
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 海亮封箱机
|
||||
* 海亮装箱机
|
||||
*/
|
||||
@Service
|
||||
public class EalingMachineDefination implements OpcDeviceDriverDefination {
|
||||
@@ -22,12 +22,12 @@ public class EalingMachineDefination implements OpcDeviceDriverDefination {
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "海亮-封箱机";
|
||||
return "海亮-装箱机";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "海亮-拆箱机";
|
||||
return "海亮-装箱机";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_ealing_machine;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.acsEnum.WorkerOrderEnum;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
@@ -15,6 +18,8 @@ import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.order.service.dto.EalingOrderDto;
|
||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -24,12 +29,12 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 封箱机
|
||||
* 装箱机
|
||||
*/
|
||||
@Slf4j
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
|
||||
public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, IssuedDeviceOrderInfo {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@@ -251,13 +256,59 @@ public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implement
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
itemMap.put(to_param, Integer.parseInt(value));
|
||||
|
||||
this.control(itemMap);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||
@Override
|
||||
public void issuedOrderInfo(ProduceshiftorderDto dto) {
|
||||
EalingOrderDto ealingOrderDto = dto.getEalingOrderDto();
|
||||
if (ObjectUtil.isNotEmpty(ealingOrderDto)) {
|
||||
String x = "0";
|
||||
String y = "0";
|
||||
String[] xys = ealingOrderDto.getX_y().split(",");
|
||||
if (xys.length == 2) {
|
||||
x = xys[0];
|
||||
y = xys[1];
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_clear", "1");
|
||||
map.put("to_order", ealingOrderDto.getOrder_code());
|
||||
map.put("to_order_box_num", ealingOrderDto.getOrder_box_num());
|
||||
map.put("to_order_bag_num", ealingOrderDto.getOrder_bag_num());
|
||||
map.put("to_template_no", ealingOrderDto.getTemplate_no());
|
||||
map.put("to_x" + x, x);
|
||||
map.put("to_y" + y, y);
|
||||
//模板号大于100 再下发这些信息
|
||||
if (StrUtil.isNotEmpty(ealingOrderDto.getTemplate_no()) && Integer.parseInt(ealingOrderDto.getTemplate_no()) > 100) {
|
||||
map.put("to_bag_length", ealingOrderDto.getBag_length());
|
||||
map.put("to_bag_width", ealingOrderDto.getBag_width());
|
||||
map.put("to_bag_num_of_one_floor_box", ealingOrderDto.getBag_num_of_one_floor_box());
|
||||
map.put("to_bag_num_of_box", ealingOrderDto.getBag_num_of_box());
|
||||
map.put("to_one_box_weight", ealingOrderDto.getOne_box_weight());
|
||||
map.put("to_one_bag_weight", ealingOrderDto.getOne_bag_weight());
|
||||
map.put("to_empty_box_weight", ealingOrderDto.getEmpty_box_weight());
|
||||
map.put("to_one_bag_up_weight", ealingOrderDto.getOne_bag_up_weight());
|
||||
map.put("to_one_bag_down_weight", ealingOrderDto.getOne_bag_down_weight());
|
||||
map.put("to_one_box_up_weight", ealingOrderDto.getOne_box_up_weight());
|
||||
map.put("to_one_box_down_weight", ealingOrderDto.getOne_box_down_weight());
|
||||
}
|
||||
this.writing(map);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())){
|
||||
this.writing("to_order_compel_finished", "1");
|
||||
}
|
||||
this.writing("to_confirm_finished", "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toStop() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toStart() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,10 +144,10 @@ public class ItemProtocol {
|
||||
public static String item_to_empty_box_weight = "to_empty_box_weight";
|
||||
//工单号
|
||||
public static String item_to_order = "to_order";
|
||||
//是否自动确认
|
||||
public static String item_to_is_auto_confirm = "to_is_auto_confirm";
|
||||
//封箱确认时间秒数
|
||||
public static String item_to_time = "to_time";
|
||||
//是否自动确认 封箱机驱动
|
||||
//public static String item_to_is_auto_confirm = "to_is_auto_confirm";
|
||||
//封箱确认时间秒数 封箱机驱动
|
||||
//public static String item_to_time = "to_time";
|
||||
|
||||
private EalingMachineDeviceDriver driver;
|
||||
|
||||
@@ -365,8 +365,8 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_one_box_down_weight, "每箱重量下限重量", "DB2.D156"));
|
||||
list.add(new ItemDto(item_to_empty_box_weight, "空纸箱重量", "DB2.D160"));
|
||||
list.add(new ItemDto(item_to_order, "工单号", "DB2.D200"));
|
||||
list.add(new ItemDto(item_to_is_auto_confirm, "是否自动确认", "DB2.W24"));
|
||||
list.add(new ItemDto(item_to_time, "封箱确认时间秒数", "DB2.W26"));
|
||||
// list.add(new ItemDto(item_to_is_auto_confirm, "是否自动确认", "DB2.W24"));
|
||||
// list.add(new ItemDto(item_to_time, "封箱确认时间秒数", "DB2.W26"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -353,12 +353,6 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
produceshiftorderService.finished(pdto);
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_confirm_finished", "1");
|
||||
map.put("to_order", "0");
|
||||
map.put("to_clear", "1");
|
||||
map.put("to_pause", "1");
|
||||
this.writing(map);
|
||||
}
|
||||
} catch (Exception var17) {
|
||||
var17.printStackTrace();
|
||||
@@ -622,10 +616,13 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
* 下发工单完成信息
|
||||
*/
|
||||
@Override
|
||||
public void issuedOrderFinish() {
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_order_compel_finished", "1");
|
||||
map.put("to_confirm_finished", "1");
|
||||
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())){
|
||||
map.put("to_order_compel_finished", "1");
|
||||
} else {
|
||||
map.put("to_confirm_finished", "1");
|
||||
}
|
||||
map.put("to_order", "0");
|
||||
map.put("to_clear", "1");
|
||||
this.writing(map);
|
||||
@@ -663,7 +660,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
jo.put("full_req", full_req == 1 ? "是" : "否");
|
||||
jo.put("full_finish", full_finish == 1 ? "是" : "否");
|
||||
jo.put("order_finish", order_finish == 1 ? "是" : "否");
|
||||
jo.put("requireSucess", requireSucess);
|
||||
jo.put("requireSucess", requireSucess.toString());
|
||||
jo.put("order_now", order_now);
|
||||
jo.put("one_now", one_now);
|
||||
jo.put("task", task);
|
||||
@@ -688,7 +685,8 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
*/
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
String requireSucess = data.getString("requireSucess");
|
||||
this.requireSucess = requireSucess.equals("0") ? false : true;
|
||||
Boolean requireSucess = data.getBoolean("requireSucess");
|
||||
if (ObjectUtil.isNotEmpty(requireSucess))
|
||||
this.requireSucess = requireSucess;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_old_special_de
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -118,7 +119,7 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
if (error == 1 || error == 51 || error == 0) {
|
||||
if (error == 1 || error == 51 || error == 0) {
|
||||
feedDeviceStatusFlag = false;
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
@@ -227,12 +228,6 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
produceshiftorderService.finished(pdto);
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_confirm_finished", "1");
|
||||
map.put("to_order", "0");
|
||||
map.put("to_clear", "1");
|
||||
map.put("to_pause", "1");
|
||||
this.writing(map);
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
@@ -325,10 +320,13 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
* 下发工单完成信息
|
||||
*/
|
||||
@Override
|
||||
public void issuedOrderFinish() {
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_order_compel_finished", "1");
|
||||
map.put("to_confirm_finished", "1");
|
||||
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
|
||||
map.put("to_order_compel_finished", "1");
|
||||
} else {
|
||||
map.put("to_confirm_finished", "1");
|
||||
}
|
||||
map.put("to_order", "0");
|
||||
map.put("to_clear", "1");
|
||||
this.writing(map);
|
||||
|
||||
@@ -304,7 +304,7 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
|
||||
jo.put("move", move == 1 ? "有货" : "无货");
|
||||
jo.put("order", order);
|
||||
jo.put("full_number", full_number);
|
||||
jo.put("requireSucess", requireSucess);
|
||||
jo.put("requireSucess", requireSucess.toString());
|
||||
jo.put("error", ErrorUtil.getDictDetail("full_error_type", String.valueOf(this.getError())));
|
||||
jo.put("task", task);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
@@ -324,8 +324,9 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
|
||||
*/
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
String requireSucess = data.getString("requireSucess");
|
||||
this.requireSucess = requireSucess.equals("0") ? false : true;
|
||||
Boolean requireSucess = data.getBoolean("requireSucess");
|
||||
if (ObjectUtil.isNotEmpty(requireSucess))
|
||||
this.requireSucess = requireSucess;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
|
||||
jo.put("mode", mode == 1 ? "联机" : "单机");
|
||||
jo.put("order", order);
|
||||
jo.put("storage_stock_num", storage_stock_num);
|
||||
jo.put("requireSucess", requireSucess);
|
||||
jo.put("requireSucess", requireSucess.toString());
|
||||
jo.put("error", ErrorUtil.getDictDetail("pour_error_type", String.valueOf(this.getError())));
|
||||
jo.put("task", task);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
@@ -293,7 +293,8 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
|
||||
*/
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
String requireSucess = data.getString("requireSucess");
|
||||
this.requireSucess = requireSucess.equals("0") ? false : true;
|
||||
Boolean requireSucess = data.getBoolean("requireSucess");
|
||||
if (ObjectUtil.isNotEmpty(requireSucess))
|
||||
this.requireSucess = requireSucess;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
@@ -66,36 +67,64 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class);
|
||||
|
||||
int heartbeat = 0;
|
||||
int packer_ready = 0;//包装机就绪
|
||||
int mode = 0;//模式 所有设备就绪
|
||||
int move = 0;//有货
|
||||
int order_finish = 0;//订单完成
|
||||
int lack_req = 0;//缺料请求
|
||||
int hopper_already = 0;//料斗已就位
|
||||
int req_task_empty = 0;//请求取空料斗
|
||||
int hopper_removed = 0;//料斗已取走
|
||||
int error = 0; //报警信号
|
||||
int order_now = 0; //订单实时
|
||||
int open_ready_time = 0; //开机准备时间(S)
|
||||
int device_running_time = 0; //设备运转时间(S)
|
||||
int await_time = 0; //待机时间(S)
|
||||
int order = 0; //工单号
|
||||
int running = 0;
|
||||
int packer_error = 0;
|
||||
int hot_prepare = 0;
|
||||
int out_num = 0;
|
||||
int packer_ready = 0;
|
||||
int all_ready = 0;
|
||||
int move = 0;
|
||||
int tap_open_pos = 0;
|
||||
int tap_close_pos = 0;
|
||||
int agv_abutment_error = 0;
|
||||
int order_finish = 0;
|
||||
int mode = 0;
|
||||
int lack_req = 0;
|
||||
int hopper_already = 0;
|
||||
int req_task_empty = 0;
|
||||
int hopper_removed = 0;
|
||||
int error = 0;
|
||||
int order_now = 0;
|
||||
int cache_weight = 0;
|
||||
int open_ready_time = 0;
|
||||
int device_running_time = 0;
|
||||
int await_time = 0;
|
||||
int now_up_box_num = 0;
|
||||
int now_bag_num_of_box = 0;
|
||||
int now_bag_num = 0;
|
||||
int now_seal_box_num = 0;
|
||||
int order = 0;
|
||||
|
||||
|
||||
int last_heartbeat = 0;
|
||||
int last_packer_ready = 0;//包装机就绪
|
||||
int last_mode = 0;//模式 所有设备就绪
|
||||
int last_move = 0;//有货
|
||||
int last_order_finish = 0;//订单完成
|
||||
int last_lack_req = 0;//缺料请求
|
||||
int last_hopper_already = 0;//料斗已就位
|
||||
int last_req_task_empty = 0;//请求取空料斗
|
||||
int last_hopper_removed = 0;//料斗已取走
|
||||
int last_error = 0; //报警信号
|
||||
int last_order_now = 0; //订单实时
|
||||
int last_open_ready_time = 0; //开机准备时间(S)
|
||||
int last_device_running_time = 0; //设备运转时间(S)
|
||||
int last_await_time = 0; //待机时间(S)
|
||||
int last_order = 0; //工单号
|
||||
int last_running = 0;
|
||||
int last_packer_error = 0;
|
||||
int last_hot_prepare = 0;
|
||||
int last_out_num = 0;
|
||||
int last_packer_ready = 0;
|
||||
int last_all_ready = 0;
|
||||
int last_move = 0;
|
||||
int last_tap_open_pos = 0;
|
||||
int last_tap_close_pos = 0;
|
||||
int last_agv_abutment_error = 0;
|
||||
int last_order_finish = 0;
|
||||
int last_mode = 0;
|
||||
int last_lack_req = 0;
|
||||
int last_hopper_already = 0;
|
||||
int last_req_task_empty = 0;
|
||||
int last_hopper_removed = 0;
|
||||
int last_error = 0;
|
||||
int last_order_now = 0;
|
||||
int last_cache_weight = 0;
|
||||
int last_open_ready_time = 0;
|
||||
int last_device_running_time = 0;
|
||||
int last_await_time = 0;
|
||||
int last_now_up_box_num = 0;
|
||||
int last_now_bag_num_of_box = 0;
|
||||
int last_now_bag_num = 0;
|
||||
int last_now_seal_box_num = 0;
|
||||
int last_order = 0;
|
||||
|
||||
|
||||
Boolean isonline = true;
|
||||
Boolean last_isonline = true;
|
||||
@@ -138,26 +167,54 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
public synchronized void execute() {
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
packer_ready = this.itemProtocol.getItem_packer_ready();//包装机就绪
|
||||
lack_req = this.itemProtocol.getItem_lack_req();//缺料请求
|
||||
hopper_already = this.itemProtocol.getItem_hopper_already();//料斗已就位
|
||||
req_task_empty = this.itemProtocol.getItem_req_task_empty();//请求取空料斗
|
||||
hopper_removed = this.itemProtocol.getItem_hopper_removed();//料斗已取走
|
||||
mode = this.itemProtocol.getItem_mode();//模式 所有设备就绪
|
||||
move = this.itemProtocol.getItem_move();//有货
|
||||
order_finish = this.itemProtocol.getItem_order_finish();//订单完成
|
||||
error = this.itemProtocol.getItem_error(); //报警信号
|
||||
order_now = this.itemProtocol.getItem_order_now(); //订单实时
|
||||
open_ready_time = this.itemProtocol.getItem_open_ready_time(); //开机准备时间(S)
|
||||
device_running_time = this.itemProtocol.getItem_device_running_time(); //设备运转时间(S)
|
||||
await_time = this.itemProtocol.getItem_await_time(); //待机时间(S)
|
||||
order = this.itemProtocol.getItem_order(); //工单号
|
||||
packer_error = this.itemProtocol.getItem_packer_error();
|
||||
out_num = this.itemProtocol.getItem_out_num();
|
||||
agv_abutment_error = this.itemProtocol.getItem_agv_abutment_error();
|
||||
cache_weight = this.itemProtocol.getItem_cache_weight();
|
||||
now_up_box_num = this.itemProtocol.getItem_now_up_box_num();
|
||||
now_bag_num_of_box = this.itemProtocol.getItem_now_bag_num_of_box();
|
||||
now_bag_num = this.itemProtocol.getItem_now_bag_num();
|
||||
packer_ready = this.itemProtocol.getItem_packer_ready();
|
||||
lack_req = this.itemProtocol.getItem_lack_req();
|
||||
hopper_already = this.itemProtocol.getItem_hopper_already();
|
||||
req_task_empty = this.itemProtocol.getItem_req_task_empty();
|
||||
hopper_removed = this.itemProtocol.getItem_hopper_removed();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
move = this.itemProtocol.getItem_move();
|
||||
order_finish = this.itemProtocol.getItem_order_finish();
|
||||
error = this.itemProtocol.getItem_error();
|
||||
order_now = this.itemProtocol.getItem_order_now();
|
||||
now_seal_box_num = this.itemProtocol.getItem_now_seal_box_num();
|
||||
order = this.itemProtocol.getItem_order();
|
||||
isonline = this.itemProtocol.getIsonline();
|
||||
|
||||
if (now_bag_num != last_now_bag_num) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号now_bag_num:" + last_now_bag_num + "->" + now_bag_num);
|
||||
}
|
||||
if (now_seal_box_num != last_now_seal_box_num) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号now_seal_box_num:" + last_now_seal_box_num + "->" + now_seal_box_num);
|
||||
}
|
||||
if (cache_weight != last_cache_weight) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号cache_weight:" + last_cache_weight + "->" + cache_weight);
|
||||
}
|
||||
if (now_up_box_num != last_now_up_box_num) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号now_up_box_num:" + last_now_up_box_num + "->" + now_up_box_num);
|
||||
}
|
||||
if (now_bag_num_of_box != last_now_bag_num_of_box) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号now_bag_num_of_box:" + last_now_bag_num_of_box + "->" + now_bag_num_of_box);
|
||||
}
|
||||
if (mode != last_mode) {
|
||||
feedDeviceStatusFlag = false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (agv_abutment_error != last_agv_abutment_error) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号agv_abutment_error:" + last_agv_abutment_error + "->" + agv_abutment_error);
|
||||
}
|
||||
if (out_num != last_out_num) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号out_num:" + last_out_num + "->" + out_num);
|
||||
}
|
||||
if (packer_error != last_packer_error) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号packer_error:" + last_packer_error + "->" + packer_error);
|
||||
}
|
||||
if (move != last_move) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
||||
}
|
||||
@@ -282,11 +339,6 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
produceshiftorderService.finished(pdto);
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_confirm_finished", "1");
|
||||
map.put("to_order", "0");
|
||||
map.put("to_clear", "1");
|
||||
this.writing(map);
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
@@ -429,11 +481,17 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
}
|
||||
}
|
||||
last_packer_error = packer_error;
|
||||
last_out_num = out_num;
|
||||
last_agv_abutment_error = agv_abutment_error;
|
||||
last_cache_weight = cache_weight;
|
||||
last_packer_ready = packer_ready;
|
||||
last_now_up_box_num = now_up_box_num;
|
||||
last_lack_req = lack_req;
|
||||
last_hopper_already = hopper_already;
|
||||
last_req_task_empty = req_task_empty;
|
||||
last_hopper_removed = hopper_removed;
|
||||
last_now_bag_num_of_box = now_bag_num_of_box;
|
||||
last_move = move;
|
||||
last_order_finish = order_finish;
|
||||
last_mode = mode;
|
||||
@@ -444,6 +502,8 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
last_await_time = await_time;
|
||||
last_order = order;
|
||||
last_isonline = isonline;
|
||||
last_now_bag_num = now_bag_num;
|
||||
last_now_seal_box_num = now_seal_box_num;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -529,10 +589,13 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
* 下发工单完成信息
|
||||
*/
|
||||
@Override
|
||||
public void issuedOrderFinish() {
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_order_compel_finished", "1");
|
||||
map.put("to_confirm_finished", "1");
|
||||
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
|
||||
map.put("to_order_compel_finished", "1");
|
||||
} else {
|
||||
map.put("to_confirm_finished", "1");
|
||||
}
|
||||
map.put("to_order", "0");
|
||||
map.put("to_clear", "1");
|
||||
this.writing(map);
|
||||
@@ -567,7 +630,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
jo.put("mode", mode == 1 ? "联机" : "单机");
|
||||
jo.put("move", move == 1 ? "有货" : "无货");
|
||||
jo.put("order", order);
|
||||
jo.put("requireSucess", requireSucess);
|
||||
jo.put("requireSucess", requireSucess.toString());
|
||||
jo.put("order_finish", order_finish == 1 ? "是" : "否");
|
||||
jo.put("lack_req", lack_req == 1 ? "是" : "否");
|
||||
jo.put("req_task_empty", req_task_empty == 1 ? "是" : "否");
|
||||
@@ -592,8 +655,9 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
*/
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
String requireSucess = data.getString("requireSucess");
|
||||
this.requireSucess = requireSucess.equals("0") ? false : true;
|
||||
Boolean requireSucess = data.getBoolean("requireSucess");
|
||||
if (ObjectUtil.isNotEmpty(requireSucess))
|
||||
this.requireSucess = requireSucess;
|
||||
}
|
||||
|
||||
private String noFeedMessage() {
|
||||
|
||||
@@ -11,21 +11,63 @@ import java.util.List;
|
||||
@Data
|
||||
public class ItemProtocol {
|
||||
|
||||
//心跳
|
||||
public static String item_heartbeat = "heartbeat";
|
||||
public static String item_packer_ready = "packer_ready";//包装机就绪
|
||||
public static String item_mode = "mode";//模式 所有设备就绪
|
||||
public static String item_move = "move";//有货
|
||||
public static String item_order_finish = "order_finish";//订单完成
|
||||
public static String item_lack_req = "lack_req";//缺料请求
|
||||
public static String item_hopper_already = "hopper_already";//料斗已就位
|
||||
public static String item_req_task_empty = "req_task_empty";//请求取空料斗
|
||||
public static String item_hopper_removed = "hopper_removed";//料斗已取走
|
||||
public static String item_error = "error"; //报警信号
|
||||
public static String item_order_now = "order_now"; //订单实时
|
||||
public static String item_open_ready_time = "open_ready_time"; //开机准备时间(S)
|
||||
public static String item_device_running_time = "device_running_time"; //设备运转时间(S)
|
||||
public static String item_await_time = "await_time"; //待机时间(S)
|
||||
public static String item_order = "order"; //工单号
|
||||
//包装机运行
|
||||
public static String item_running = "running";
|
||||
//包装机故障
|
||||
public static String item_packer_error = "packer_error";
|
||||
//热机准备中
|
||||
public static String item_hot_prepare = "hot_prepare";
|
||||
//出料计数信号
|
||||
public static String item_out_num = "out_num";
|
||||
//包装机就绪
|
||||
public static String item_packer_ready = "packer_ready";
|
||||
//所有设备就绪
|
||||
public static String item_all_ready = "all_ready";
|
||||
//光电信号
|
||||
public static String item_move = "move";
|
||||
//阀门开定位
|
||||
public static String item_tap_open_pos = "tap_open_pos";
|
||||
//阀门关定位
|
||||
public static String item_tap_close_pos = "tap_close_pos";
|
||||
//AGV对接故障
|
||||
public static String item_agv_abutment_error = "agv_abutment_error";
|
||||
//订单完成
|
||||
public static String item_order_finish = "order_finish";
|
||||
//联机模式
|
||||
public static String item_mode = "mode";
|
||||
//请求料
|
||||
public static String item_lack_req = "lack_req";
|
||||
//料斗已经到位
|
||||
public static String item_hopper_already = "hopper_already";
|
||||
//请求取空料斗
|
||||
public static String item_req_task_empty = "req_task_empty";
|
||||
//料斗已取走
|
||||
public static String item_hopper_removed = "hopper_removed";
|
||||
//故障信息
|
||||
public static String item_error = "error";
|
||||
//包装机当前包装包数(实时)
|
||||
public static String item_order_now = "order_now";
|
||||
//缓存称重重量
|
||||
public static String item_cache_weight = "cache_weight";
|
||||
//包装机开机准备时间(S)
|
||||
public static String item_open_ready_time = "open_ready_time";
|
||||
//包装机设备运转时间(S)
|
||||
public static String item_device_running_time = "device_running_time";
|
||||
//包装机待机时间(S)
|
||||
public static String item_await_time = "await_time";
|
||||
//当前装箱数量
|
||||
public static String item_now_up_box_num = "now_up_box_num";
|
||||
//当前装箱机箱实时袋数量
|
||||
public static String item_now_bag_num_of_box = "now_bag_num_of_box";
|
||||
//当前装箱机袋装的总数量
|
||||
public static String item_now_bag_num = "now_bag_num";
|
||||
//当前封箱数量
|
||||
public static String item_now_seal_box_num = "now_seal_box_num";
|
||||
//包装机工单号
|
||||
public static String item_order = "order";
|
||||
|
||||
|
||||
//开机
|
||||
public static String item_to_open = "to_open";
|
||||
@@ -37,13 +79,19 @@ public class ItemProtocol {
|
||||
public static String item_to_clear = "to_clear";
|
||||
//确认完成(订单完成状态置零)
|
||||
public static String item_to_confirm_finished = "to_confirm_finished";
|
||||
//暂停
|
||||
public static String item_to_to_pause = "to_pause";
|
||||
//工单强制完成
|
||||
public static String item_to_order_compel_finished = "to_order_compel_finished";
|
||||
//订单生产总量
|
||||
//包装机包装总包数
|
||||
public static String item_to_order_prod_num = "to_order_prod_num";
|
||||
//订单总箱数
|
||||
public static String item_to_box_total_num = "to_box_total_num";
|
||||
//订单总袋数
|
||||
public static String item_to_bag_total_num = "to_bag_total_num";
|
||||
//工单号
|
||||
public static String item_to_order = "to_order";
|
||||
|
||||
|
||||
|
||||
private HailiangPackerStationDeviceDriver driver;
|
||||
|
||||
@@ -56,49 +104,54 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_heartbeat);
|
||||
}
|
||||
|
||||
public int getItem_running() {
|
||||
return this.getOpcIntegerValue(item_running);
|
||||
}
|
||||
|
||||
public int getItem_packer_error() {
|
||||
return this.getOpcIntegerValue(item_packer_error);
|
||||
}
|
||||
|
||||
public int getItem_hot_prepare() {
|
||||
return this.getOpcIntegerValue(item_hot_prepare);
|
||||
}
|
||||
|
||||
public int getItem_out_num() {
|
||||
return this.getOpcIntegerValue(item_out_num);
|
||||
}
|
||||
|
||||
public int getItem_packer_ready() {
|
||||
return this.getOpcIntegerValue(item_packer_ready);
|
||||
}
|
||||
|
||||
public int getItem_all_ready() {
|
||||
return this.getOpcIntegerValue(item_all_ready);
|
||||
}
|
||||
|
||||
public int getItem_move() {
|
||||
return this.getOpcIntegerValue(item_move);
|
||||
}
|
||||
|
||||
public int getItem_tap_open_pos() {
|
||||
return this.getOpcIntegerValue(item_tap_open_pos);
|
||||
}
|
||||
|
||||
public int getItem_tap_close_pos() {
|
||||
return this.getOpcIntegerValue(item_tap_close_pos);
|
||||
}
|
||||
|
||||
public int getItem_agv_abutment_error() {
|
||||
return this.getOpcIntegerValue(item_agv_abutment_error);
|
||||
}
|
||||
|
||||
public int getItem_order_finish() {
|
||||
return this.getOpcIntegerValue(item_order_finish);
|
||||
}
|
||||
|
||||
|
||||
public int getItem_mode() {
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
}
|
||||
|
||||
public int getItem_error() {
|
||||
return this.getOpcIntegerValue(item_error);
|
||||
}
|
||||
|
||||
public int getItem_order_now() {
|
||||
return this.getOpcIntegerValue(item_order_now);
|
||||
}
|
||||
|
||||
|
||||
public int getItem_open_ready_time() {
|
||||
return this.getOpcIntegerValue(item_open_ready_time);
|
||||
}
|
||||
|
||||
public int getItem_device_running_time() {
|
||||
return this.getOpcIntegerValue(item_device_running_time);
|
||||
}
|
||||
|
||||
public int getItem_await_time() {
|
||||
return this.getOpcIntegerValue(item_await_time);
|
||||
}
|
||||
|
||||
public int getItem_order() {
|
||||
return this.getOpcIntegerValue(item_order);
|
||||
}
|
||||
|
||||
public int getItem_packer_ready() {
|
||||
return this.getOpcIntegerValue(item_packer_ready);
|
||||
}
|
||||
|
||||
public int getItem_lack_req() {
|
||||
return this.getOpcIntegerValue(item_lack_req);
|
||||
}
|
||||
@@ -115,11 +168,51 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_hopper_removed);
|
||||
}
|
||||
|
||||
//是否有货
|
||||
public int hasGoods(int move) {
|
||||
return move;
|
||||
public int getItem_error() {
|
||||
return this.getOpcIntegerValue(item_error);
|
||||
}
|
||||
|
||||
public int getItem_order_now() {
|
||||
return this.getOpcIntegerValue(item_order_now);
|
||||
}
|
||||
|
||||
public int getItem_cache_weight() {
|
||||
return this.getOpcIntegerValue(item_cache_weight);
|
||||
}
|
||||
|
||||
public int getItem_open_ready_time() {
|
||||
return this.getOpcIntegerValue(item_open_ready_time);
|
||||
}
|
||||
|
||||
public int getItem_device_running_time() {
|
||||
return this.getOpcIntegerValue(item_device_running_time);
|
||||
}
|
||||
|
||||
public int getItem_await_time() {
|
||||
return this.getOpcIntegerValue(item_await_time);
|
||||
}
|
||||
|
||||
public int getItem_now_up_box_num() {
|
||||
return this.getOpcIntegerValue(item_now_up_box_num);
|
||||
}
|
||||
|
||||
public int getItem_now_bag_num_of_box() {
|
||||
return this.getOpcIntegerValue(item_now_bag_num_of_box);
|
||||
}
|
||||
|
||||
public int getItem_now_bag_num() {
|
||||
return this.getOpcIntegerValue(item_now_bag_num);
|
||||
}
|
||||
|
||||
public int getItem_now_seal_box_num() {
|
||||
return this.getOpcIntegerValue(item_now_seal_box_num);
|
||||
}
|
||||
|
||||
public int getItem_order() {
|
||||
return this.getOpcIntegerValue(item_order);
|
||||
}
|
||||
|
||||
|
||||
Boolean isonline;
|
||||
|
||||
public int getOpcIntegerValue(String protocol) {
|
||||
@@ -137,33 +230,49 @@ public class ItemProtocol {
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
|
||||
list.add(new ItemDto(item_running, "包装机运行", "DB1.B0.0"));
|
||||
list.add(new ItemDto(item_packer_error, "包装机故障", "DB1.B0.1"));
|
||||
list.add(new ItemDto(item_hot_prepare, "热机准备中", "DB1.B0.2"));
|
||||
list.add(new ItemDto(item_out_num, "出料计数信号", "DB1.B0.3"));
|
||||
list.add(new ItemDto(item_packer_ready, "包装机就绪", "DB1.B0.5"));
|
||||
list.add(new ItemDto(item_mode, "模式", "DB1.B0.6"));
|
||||
list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B0.6"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB1.B1.0"));
|
||||
list.add(new ItemDto(item_tap_open_pos, "阀门开定位", "DB1.B1.1"));
|
||||
list.add(new ItemDto(item_tap_close_pos, "阀门关定位", "DB1.B1.2"));
|
||||
list.add(new ItemDto(item_agv_abutment_error, "AGV对接故障", "DB1.B1.3"));
|
||||
list.add(new ItemDto(item_order_finish, "订单完成", "DB1.B1.5"));
|
||||
list.add(new ItemDto(item_lack_req, "缺料请求", "DB1.B2.0"));
|
||||
list.add(new ItemDto(item_hopper_already, "料斗已到位", "DB1.B2.1"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1.7"));
|
||||
list.add(new ItemDto(item_lack_req, "请求料", "DB1.B2.0"));
|
||||
list.add(new ItemDto(item_hopper_already, "料斗已经到位", "DB1.B2.1"));
|
||||
list.add(new ItemDto(item_req_task_empty, "请求取空料斗", "DB1.B2.6"));
|
||||
list.add(new ItemDto(item_hopper_removed, "料斗已取走", "DB1.B2.7"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.W4"));
|
||||
list.add(new ItemDto(item_order_now, "订单实时", "DB1.D84"));
|
||||
list.add(new ItemDto(item_open_ready_time, "开机准备时间", "DB1.D108"));
|
||||
list.add(new ItemDto(item_device_running_time, "设备运转时间", "DB1.D112"));
|
||||
list.add(new ItemDto(item_await_time, "待机时间", "DB1.D116"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB1.D160"));
|
||||
list.add(new ItemDto(item_error, "故障信息", "DB1.W4"));
|
||||
list.add(new ItemDto(item_order_now, "包装机当前包装包数(实时)", "DB1.D84"));
|
||||
list.add(new ItemDto(item_cache_weight, "缓存称重重量", "DB1.D92"));
|
||||
list.add(new ItemDto(item_open_ready_time, "包装机开机准备时间(S)", "DB1.D108"));
|
||||
list.add(new ItemDto(item_device_running_time, "包装机设备运转时间(S)", "DB1.D112"));
|
||||
list.add(new ItemDto(item_await_time, "包装机待机时间(S)", "DB1.D116"));
|
||||
list.add(new ItemDto(item_now_up_box_num, "当前装箱数量", "DB1.D124"));
|
||||
list.add(new ItemDto(item_now_bag_num_of_box, "当前装箱机箱实时袋数量", "DB1.D128"));
|
||||
list.add(new ItemDto(item_now_bag_num, "当前装箱机袋装的总数量", "DB1.D132"));
|
||||
list.add(new ItemDto(item_now_seal_box_num, "当前封箱数量", "DB1.D136"));
|
||||
list.add(new ItemDto(item_to_order, "工单号", "DB1.D160"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_open, "设备开关", "DB2.W4", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(item_to_open, "设备开关", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_agv_release_finish, "AGV放货完成", "DB2.W6"));
|
||||
list.add(new ItemDto(item_to_agv_take_finish, "AGV取货完成", "DB2.W8"));
|
||||
list.add(new ItemDto(item_to_clear, "当前产量清零", "DB2.W12"));
|
||||
list.add(new ItemDto(item_to_confirm_finished, "确认完成", "DB2.W14"));
|
||||
list.add(new ItemDto(item_to_clear, "产量清零", "DB2.W12"));
|
||||
list.add(new ItemDto(item_to_confirm_finished, "确认完成(订单完成状态置零)", "DB2.W14"));
|
||||
list.add(new ItemDto(item_to_to_pause, "暂停", "DB2.W16"));
|
||||
list.add(new ItemDto(item_to_order_compel_finished, "工单强制完成", "DB2.W82"));
|
||||
list.add(new ItemDto(item_to_order_prod_num, "订单生产总量", "DB2.D84"));
|
||||
list.add(new ItemDto(item_to_order, "工单号", "DB2.D160"));
|
||||
list.add(new ItemDto(item_to_order_prod_num, "包装机包装总包数", "DB2.W84"));
|
||||
list.add(new ItemDto(item_to_box_total_num, "订单总箱数", "DB2.W124"));
|
||||
list.add(new ItemDto(item_to_bag_total_num, "订单总袋数", "DB2.W128"));
|
||||
list.add(new ItemDto(item_to_order, "工单号", "DB2.W160"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_sealing_machine;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Data
|
||||
public class ItemProtocol {
|
||||
|
||||
|
||||
//是否自动确认 封箱机驱动
|
||||
public static String item_to_is_auto_confirm = "to_is_auto_confirm";
|
||||
//封箱确认时间秒数 封箱机驱动
|
||||
public static String item_to_time = "to_time";
|
||||
|
||||
private SealingMachineDeviceDriver driver;
|
||||
|
||||
public ItemProtocol(SealingMachineDeviceDriver driver) {
|
||||
this.driver = driver;
|
||||
}
|
||||
|
||||
//是否有货
|
||||
public int hasGoods(int move) {
|
||||
return move;
|
||||
}
|
||||
|
||||
Boolean isonline;
|
||||
|
||||
public int getOpcIntegerValue(String protocol) {
|
||||
Integer value = this.driver.getIntegeregerValue(protocol);
|
||||
if (value == null) {
|
||||
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
|
||||
setIsonline(false);
|
||||
} else {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_is_auto_confirm, "是否自动确认", "DB2.W24"));
|
||||
list.add(new ItemDto(item_to_time, "封箱确认时间秒数", "DB2.W26"));
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_sealing_machine;
|
||||
|
||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.DeviceType;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 海亮封箱机
|
||||
*/
|
||||
@Service
|
||||
public class SealingMachineDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "hailiang_sealing_machine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "海亮-封箱机";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "海亮-封箱机";
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceDriver getDriverInstance(Device device) {
|
||||
return (new SealingMachineDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||
return SealingMachineDeviceDriver.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.conveyor);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ItemDto> getReadableItemDtos() {
|
||||
return ItemProtocol.getReadableItemDtos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemDto> getWriteableItemDtos() {
|
||||
return ItemProtocol.getWriteableItemDtos();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_sealing_machine;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.order.service.dto.EalingOrderDto;
|
||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 封箱机
|
||||
*/
|
||||
@Slf4j
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
public class SealingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, IssuedDeviceOrderInfo {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
|
||||
Boolean isonline = true;
|
||||
String message = null;
|
||||
Boolean iserror = false;
|
||||
|
||||
private Date instruction_require_time = new Date();
|
||||
private Date instruction_finished_time = new Date();
|
||||
|
||||
boolean requireSucess = false;
|
||||
|
||||
|
||||
String device_code = null;
|
||||
|
||||
@Override
|
||||
public Device getDevice() {
|
||||
return this.device;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
} catch (Exception var17) {
|
||||
var17.printStackTrace();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void issuedOrderInfo(ProduceshiftorderDto dto) {
|
||||
EalingOrderDto ealingOrderDto = dto.getEalingOrderDto();
|
||||
if (ealingOrderDto != null) {
|
||||
String is_auto_confirm = ealingOrderDto.getIs_auto_confirm();
|
||||
String time = ealingOrderDto.getTime();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_is_auto_confirm", is_auto_confirm);
|
||||
map.put("to_time", time);
|
||||
this.writing(map);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toStop() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toStart() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_device
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -225,12 +226,6 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
produceshiftorderService.finished(pdto);
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_confirm_finished", "1");
|
||||
map.put("to_order", "0");
|
||||
map.put("to_clear", "1");
|
||||
map.put("to_pause", "1");
|
||||
this.writing(map);
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
@@ -289,10 +284,13 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
* 下发工单完成信息
|
||||
*/
|
||||
@Override
|
||||
public void issuedOrderFinish() {
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_order_compel_finished", "1");
|
||||
map.put("to_confirm_finished", "1");
|
||||
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
|
||||
map.put("to_order_compel_finished", "1");
|
||||
} else {
|
||||
map.put("to_confirm_finished", "1");
|
||||
}
|
||||
map.put("to_order", "0");
|
||||
map.put("to_clear", "1");
|
||||
this.writing(map);
|
||||
|
||||
@@ -151,7 +151,7 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
|
||||
message = "";
|
||||
//请求放空箱
|
||||
if (agvphase == 0x13 || agvphase == 0x17) {
|
||||
if (mode == 1 && move == 1 && ObjectUtil.isNotEmpty(inst)) {
|
||||
if (mode == 1 /*&& move == 1*/ && ObjectUtil.isNotEmpty(inst)) {
|
||||
writing("to_agv_ready", "1");
|
||||
inst.setExecute_status(InstActionEnum.EXECUTE_TO_PUT_EMPTY.getCode());
|
||||
instructionService.update(inst);
|
||||
@@ -177,7 +177,7 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
|
||||
}
|
||||
//放空箱完成
|
||||
if (agvphase == 0x15 || agvphase == 0x19) {
|
||||
if (mode == 1 && move == 0 && ObjectUtil.isNotEmpty(inst)) {
|
||||
if (mode == 1 /*&& move == 0*/ && ObjectUtil.isNotEmpty(inst)) {
|
||||
// writing("to_agv_finish", "1");
|
||||
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_EMPTY_FINISH.getCode());
|
||||
instructionService.update(inst);
|
||||
|
||||
@@ -307,7 +307,7 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
jo.put("mode", mode == 1 ? "联机" : "单机");
|
||||
jo.put("move", move == 1 ? "有货" : "无货");
|
||||
jo.put("order", order);
|
||||
jo.put("requireSucess", requireSucess);
|
||||
jo.put("requireSucess", requireSucess.toString());
|
||||
jo.put("full_number", full_number);
|
||||
jo.put("error", ErrorUtil.getDictDetail("full_error_type", String.valueOf(this.getError())));
|
||||
jo.put("task", task);
|
||||
@@ -328,7 +328,8 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
*/
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
String requireSucess = data.getString("requireSucess");
|
||||
this.requireSucess = requireSucess.equals("0") ? false : true;
|
||||
Boolean requireSucess = data.getBoolean("requireSucess");
|
||||
if (ObjectUtil.isNotEmpty(requireSucess))
|
||||
this.requireSucess = requireSucess;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
jo.put("mode", mode == 1 ? "联机" : "单机");
|
||||
jo.put("order", order);
|
||||
jo.put("storage_stock_num", storage_stock_num);
|
||||
jo.put("requireSucess", requireSucess);
|
||||
jo.put("requireSucess", requireSucess.toString());
|
||||
jo.put("error", ErrorUtil.getDictDetail("pour_error_type", String.valueOf(this.getError())));
|
||||
jo.put("task", task);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
@@ -298,7 +298,8 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
*/
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
String requireSucess = data.getString("requireSucess");
|
||||
this.requireSucess = requireSucess.equals("0") ? false : true;
|
||||
Boolean requireSucess = data.getBoolean("requireSucess");
|
||||
if (ObjectUtil.isNotEmpty(requireSucess))
|
||||
this.requireSucess = requireSucess;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.acsEnum.StatusEnum;
|
||||
import org.nl.acs.acsEnum.WorkerOrderEnum;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo;
|
||||
@@ -300,9 +301,6 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
|
||||
produceshiftorderService.finished(pdto);
|
||||
}
|
||||
}
|
||||
this.writing("to_confirm_finished", "1");
|
||||
this.writing("to_order", "0");
|
||||
this.writing("to_clear", "1");
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
@@ -377,9 +375,13 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
|
||||
* 下发工单完成信息
|
||||
*/
|
||||
@Override
|
||||
public void issuedOrderFinish() {
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_compel_finish", "1");
|
||||
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
|
||||
map.put("to_compel_finish", "1");
|
||||
} else {
|
||||
map.put("to_confirm_finished", "1");
|
||||
}
|
||||
map.put("to_order", "0");
|
||||
this.writing(map);
|
||||
}
|
||||
|
||||
@@ -198,10 +198,10 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_lane1_tray_current_num, "巷道1号托盘当前码垛箱数", "DB1.W64"));
|
||||
list.add(new ItemDto(item_lane2_tray_current_num, "巷道2号托盘当前码垛箱数", "DB1.W66"));
|
||||
list.add(new ItemDto(item_lane1_tray_template, "巷道1号托盘模板", "DB1.W72"));
|
||||
list.add(new ItemDto(item_lane2_tray_template, "巷道2号托盘模板", "DB1.DW74"));
|
||||
list.add(new ItemDto(item_order_now, "订单实时", "DB1.DW84"));
|
||||
list.add(new ItemDto(item_tray_now, "托盘实时", "DB1.DW88"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB1.DW156"));
|
||||
list.add(new ItemDto(item_lane2_tray_template, "巷道2号托盘模板", "DB1.D74"));
|
||||
list.add(new ItemDto(item_order_now, "订单实时", "DB1.D84"));
|
||||
list.add(new ItemDto(item_tray_now, "托盘实时", "DB1.D88"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB1.D156"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -218,9 +218,9 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_lane2_tray_compel_full, "巷道2号托盘强制满托", "DB2.W42"));
|
||||
list.add(new ItemDto(item_to_lane_off, "巷道禁用", "DB2.W48"));
|
||||
list.add(new ItemDto(item_to_compel_finish, "工单强制完成", "DB2.W80"));
|
||||
list.add(new ItemDto(item_to_order_prod_num, "订单生产总量", "DB2.DW84"));
|
||||
list.add(new ItemDto(item_to_tray_num, "托盘总量", "DB2.DW88"));
|
||||
list.add(new ItemDto(item_to_order, "工单号", "DB2.DW156"));
|
||||
list.add(new ItemDto(item_to_order_prod_num, "订单生产总量", "DB2.D84"));
|
||||
list.add(new ItemDto(item_to_tray_num, "托盘总量", "DB2.D88"));
|
||||
list.add(new ItemDto(item_to_order, "工单号", "DB2.D156"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -164,9 +164,9 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_clear, "当前产量清零", "DB2.W6"));
|
||||
list.add(new ItemDto(item_to_confirm_finished, "订单确认完成", "DB2.W8"));
|
||||
list.add(new ItemDto(item_to_pause, "专机暂停", "DB2.W10"));
|
||||
list.add(new ItemDto(item_to_order_compel_finished, "工单强制完成", "DB2.W10"));
|
||||
list.add(new ItemDto(item_to_order_compel_finished, "工单强制完成", "DB2.W80"));
|
||||
list.add(new ItemDto(item_to_order_box_num, "订单总箱数", "DB2.D84"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB2.D84"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB2.D92"));
|
||||
list.add(new ItemDto(item_to_order, "工单号", "DB2.D156"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 拆箱机
|
||||
* 开箱机
|
||||
*/
|
||||
@Service
|
||||
public class UnboxingMachineDefination implements OpcDeviceDriverDefination {
|
||||
@@ -22,12 +22,12 @@ public class UnboxingMachineDefination implements OpcDeviceDriverDefination {
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "海亮-拆箱机";
|
||||
return "海亮-开箱机";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "海亮-拆箱机";
|
||||
return "海亮-开箱机";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_unboxing_machine;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.acsEnum.WorkerOrderEnum;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
@@ -14,6 +17,8 @@ import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.order.service.dto.EalingOrderDto;
|
||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -22,12 +27,12 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 拆箱机
|
||||
* 开箱机
|
||||
*/
|
||||
@Slf4j
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
|
||||
public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, IssuedDeviceOrderInfo {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@@ -160,9 +165,6 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
String mode = "";
|
||||
String action = "";
|
||||
String move = "";
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
return jo;
|
||||
}
|
||||
@@ -172,13 +174,36 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
itemMap.put(to_param, Integer.parseInt(value));
|
||||
@Override
|
||||
public void issuedOrderInfo(ProduceshiftorderDto dto) {
|
||||
EalingOrderDto ealingOrderDto = dto.getEalingOrderDto();
|
||||
if (ealingOrderDto != null) {
|
||||
String is_foreward = ealingOrderDto.getIs_foreward();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_clear", "1");
|
||||
map.put("to_is_foreward", is_foreward);
|
||||
map.put("to_order_box_num", ealingOrderDto.getOrder_box_num());
|
||||
map.put("to_order", ealingOrderDto.getOrder_code());
|
||||
this.writing(map);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
|
||||
this.writing("to_order_compel_finished", "1");
|
||||
} else {
|
||||
this.writing("to_confirm_finished", "1");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toStop() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toStart() {
|
||||
|
||||
this.control(itemMap);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public HttpResponse feedDeviceStatusType(JSONObject param) {
|
||||
// log.info("acs开始向mes反馈设备状态,请求参数:{}", JSON.toJSONString(param));
|
||||
log.info("acs开始向mes反馈设备状态,请求参数:{}", JSON.toJSONString(param));
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
@@ -132,9 +132,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
result = HttpRequest.post(url)
|
||||
.body(JSON.toJSONString(param))
|
||||
.execute();
|
||||
// log.info("acs向mes反馈设备状态成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, JSON.toJSONString(result));
|
||||
log.info("acs向mes反馈设备状态成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, JSON.toJSONString(result));
|
||||
} catch (Exception e) {
|
||||
//log.error("acs向mes反馈设备状态失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(param), url, e.getMessage());
|
||||
log.error("acs向mes反馈设备状态失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(param), url, e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.opc.DeviceExtraManageDto;
|
||||
import org.nl.acs.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.order.service.dto.EalingOrderDto;
|
||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
@@ -242,6 +243,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
String device_code = param.getString("device_code");
|
||||
String is_needmove = param.getString("is_needmove");
|
||||
String in_devices = param.getString("in_devices");
|
||||
String is_used_fxx = param.getString("is_used_fxx");
|
||||
String ealing_device_code = param.getString("ealing_device_code");
|
||||
String unboxing_device_code = param.getString("unboxing_device_code");
|
||||
Map<String, Object> params = param.getJSONObject("params");
|
||||
EalingOrderDto ealingOrderDto = null;
|
||||
if (ObjectUtil.isNotEmpty(params)) {
|
||||
ealingOrderDto = JSONObject.toJavaObject(JSON.parseObject(JSON.toJSONString(params)), EalingOrderDto.class);
|
||||
ealingOrderDto.setOrder_code(workorder_code);
|
||||
}
|
||||
if (StrUtil.isEmpty(workorder_id)) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("workorder_id", workorder_id);
|
||||
@@ -304,6 +314,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
dto.setIs_needmove(is_needmove);
|
||||
dto.setExt_order_id(workorder_id);
|
||||
dto.setIn_devices(in_devices);
|
||||
dto.setIs_used_fxx(is_used_fxx);
|
||||
dto.setEaling_device_code(ealing_device_code);
|
||||
dto.setUnboxing_device_code(unboxing_device_code);
|
||||
dto.setEalingOrderDto(ealingOrderDto);
|
||||
dto.setCreate_by("mes");
|
||||
try {
|
||||
produceshiftorderService.create(dto);
|
||||
@@ -430,7 +444,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
String ext_order_id = jsonObject.getString("workorder_id");
|
||||
String type = jsonObject.getString("type");
|
||||
ProduceshiftorderDto pd = produceshiftorderService.findOrderByExtOrderId(ext_order_id);
|
||||
if (pd == null){
|
||||
if (pd == null) {
|
||||
throw new BadRequestException("工单信息不存在!");
|
||||
}
|
||||
Device device = deviceAppService.findDeviceByCode(pd.getDevice_code());
|
||||
|
||||
@@ -83,7 +83,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public synchronized void reload() {
|
||||
List<Instruction> list = this.queryAll("instruction_status < 2 and is_delete =0");
|
||||
List<Instruction> list = this.queryAll("instruction_status < 2 and is_delete = 0");
|
||||
this.instructions = list == null ? new CopyOnWriteArrayList<>() : new CopyOnWriteArrayList<>(list);
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
dto.setCompound_inst_data(task.getCompound_task_data());
|
||||
}
|
||||
}
|
||||
|
||||
dto.setAgv_system_type(task.getAgv_system_type());
|
||||
dto.setCreate_by(currentUsername);
|
||||
dto.setUpdate_by(currentUsername);
|
||||
dto.setUpdate_time(now);
|
||||
@@ -449,7 +449,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
dto2.setCompound_inst_data(task2.getCompound_task_data());
|
||||
}
|
||||
}
|
||||
|
||||
dto2.setAgv_system_type(task2.getAgv_system_type());
|
||||
dto2.setCreate_by(currentUsername2);
|
||||
dto2.setUpdate_by(currentUsername2);
|
||||
dto2.setUpdate_time(now2);
|
||||
@@ -1266,8 +1266,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public boolean removeByCodeFromCache(String code) {
|
||||
CopyOnWriteArrayList<Instruction> instructions = (CopyOnWriteArrayList<Instruction>) this.instructions;
|
||||
return instructions.removeIf(inst -> inst.getInstruction_code().equals(code));
|
||||
return this.instructions.removeIf(inst -> inst.getInstruction_code().equals(code));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package org.nl.acs.order.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author: geng by
|
||||
* @createDate: 2023/5/5
|
||||
*/
|
||||
@Data
|
||||
public class EalingOrderDto {
|
||||
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
private String order_code;
|
||||
/**
|
||||
* 订单总箱数
|
||||
*/
|
||||
private String order_box_num;
|
||||
/**
|
||||
* 订单总袋数
|
||||
*/
|
||||
private String order_bag_num;
|
||||
/**
|
||||
* 模板号
|
||||
*/
|
||||
private String template_no;
|
||||
/**
|
||||
* 袋长
|
||||
*/
|
||||
private String bag_length;
|
||||
/**
|
||||
* 袋宽
|
||||
*/
|
||||
private String bag_width;
|
||||
/**
|
||||
* 每层码袋数量
|
||||
*/
|
||||
private String bag_num_of_one_floor_box;
|
||||
/**
|
||||
* 每箱袋数
|
||||
*/
|
||||
private String bag_num_of_box;
|
||||
/**
|
||||
* 每箱重量
|
||||
*/
|
||||
private String one_box_weight;
|
||||
/**
|
||||
* 每袋重量
|
||||
*/
|
||||
private String one_bag_weight;
|
||||
/**
|
||||
* 空纸箱重量
|
||||
*/
|
||||
private String empty_box_weight;
|
||||
/**
|
||||
* 袋上限重量
|
||||
*/
|
||||
private String one_bag_up_weight;
|
||||
/**
|
||||
* 袋下限重量
|
||||
*/
|
||||
private String one_bag_down_weight;
|
||||
/**
|
||||
* 箱上限重量
|
||||
*/
|
||||
private String one_box_up_weight;
|
||||
/**
|
||||
* 箱下限重量
|
||||
*/
|
||||
private String one_box_down_weight;
|
||||
/**
|
||||
* 模板坐标
|
||||
*/
|
||||
private String x_y;
|
||||
|
||||
/**
|
||||
* 封箱机是否自动确认
|
||||
*/
|
||||
private String is_auto_confirm;
|
||||
|
||||
/**
|
||||
* 封箱确认时间秒数
|
||||
*/
|
||||
private String time;
|
||||
|
||||
/**
|
||||
* 是否正转
|
||||
*/
|
||||
private String is_foreward;
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
@@ -98,13 +99,40 @@ public class ProduceshiftorderDto implements Serializable {
|
||||
*/
|
||||
private String is_needmove;
|
||||
|
||||
//托盘模板
|
||||
/**
|
||||
* 托盘模板
|
||||
*/
|
||||
private String lane_tray_template;
|
||||
|
||||
//托盘总量
|
||||
/**
|
||||
* 托盘总量
|
||||
*/
|
||||
private String tray_num;
|
||||
|
||||
//清洗上料储料仓设备号,多台设备以,分割
|
||||
/*
|
||||
*清洗上料储料仓设备号,多台设备以,分割
|
||||
*/
|
||||
private String in_devices;
|
||||
|
||||
/**
|
||||
* 是否启用封箱线
|
||||
*/
|
||||
private String is_used_fxx;
|
||||
|
||||
/**
|
||||
* 装箱机编号
|
||||
*/
|
||||
private String ealing_device_code;
|
||||
|
||||
/**
|
||||
* 开箱机编号
|
||||
*/
|
||||
private String unboxing_device_code;
|
||||
|
||||
|
||||
/**
|
||||
* 装箱机订单信息
|
||||
*/
|
||||
private EalingOrderDto ealingOrderDto;
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.acsEnum.StatusEnum;
|
||||
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver;
|
||||
@@ -201,15 +202,47 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
dto.setCreate_by(currentUsername);
|
||||
}
|
||||
dto.setCreate_time(now);
|
||||
IssuedDeviceOrderInfo issuedDeviceOrderInfo;
|
||||
//驱动类中有工单的设备 下发电气工单信息的方法
|
||||
if (device.getDeviceDriver() instanceof IssuedDeviceOrderInfo) {
|
||||
IssuedDeviceOrderInfo issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) device.getDeviceDriver();
|
||||
issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) device.getDeviceDriver();
|
||||
try {
|
||||
issuedDeviceOrderInfo.issuedOrderInfo(dto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//判断是否启用装箱线
|
||||
if (StrUtil.equals(dto.getIs_used_fxx(), StatusEnum.YES.getCode())) {
|
||||
//装箱设备不能为空
|
||||
if (StrUtil.isNotEmpty(dto.getEaling_device_code())) {
|
||||
Device ealiDevice = deviceAppService.findDeviceByCode(dto.getEaling_device_code());
|
||||
//下发装箱设备工单信息
|
||||
if (ealiDevice != null && ealiDevice.getDeviceDriver() instanceof IssuedDeviceOrderInfo) {
|
||||
issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) ealiDevice.getDeviceDriver();
|
||||
issuedDeviceOrderInfo.issuedOrderInfo(dto);
|
||||
//获取装箱设备关联的封箱设备 并下发封箱机是否自动确认和封箱确认时间秒数
|
||||
String fx_device_code = ObjectUtil.isNotEmpty(ealiDevice.getExtraValue().get("link_device_code")) ? ealiDevice.getExtraValue().get("link_device_code").toString() : "";
|
||||
if (StrUtil.isNotEmpty(fx_device_code)) {
|
||||
Device fx_device = deviceAppService.findDeviceByCode(fx_device_code);
|
||||
if (fx_device != null && fx_device.getDeviceDriver() instanceof IssuedDeviceOrderInfo) {
|
||||
issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) fx_device.getDeviceDriver();
|
||||
issuedDeviceOrderInfo.issuedOrderInfo(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotEmpty(dto.getUnboxing_device_code())) {
|
||||
String[] udcs = dto.getUnboxing_device_code().split(",");
|
||||
for (String udc : udcs) {
|
||||
Device unbox_device = deviceAppService.findDeviceByCode(udc);
|
||||
if (unbox_device != null && unbox_device.getDeviceDriver() instanceof IssuedDeviceOrderInfo) {
|
||||
issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) unbox_device.getDeviceDriver();
|
||||
issuedDeviceOrderInfo.issuedOrderInfo(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
wo.insert(json);
|
||||
order.add(dto);
|
||||
@@ -312,13 +345,40 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
status = WorkerOrderEnum.FORCEFINISH.getCode();
|
||||
}
|
||||
Device device = deviceAppService.findDeviceByCode(pdto.getDevice_code());
|
||||
IssuedDeviceOrderInfo issuedDeviceOrderInfo;
|
||||
if (device != null && device.getDeviceDriver() instanceof IssuedDeviceOrderInfo) {
|
||||
try {
|
||||
IssuedDeviceOrderInfo issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) device.getDeviceDriver();
|
||||
issuedDeviceOrderInfo.issuedOrderFinish();
|
||||
issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) device.getDeviceDriver();
|
||||
issuedDeviceOrderInfo.issuedOrderFinish(status);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (StrUtil.isNotEmpty(pdto.getEaling_device_code())) {
|
||||
Device eal_device = deviceAppService.findDeviceByCode(pdto.getEaling_device_code());
|
||||
if (eal_device != null && eal_device.getDeviceDriver() instanceof IssuedDeviceOrderInfo) {
|
||||
try {
|
||||
issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) eal_device.getDeviceDriver();
|
||||
issuedDeviceOrderInfo.issuedOrderFinish(status);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotEmpty(pdto.getUnboxing_device_code())) {
|
||||
String unboxing_device_code = pdto.getUnboxing_device_code();
|
||||
String[] udcs = unboxing_device_code.split(",");
|
||||
for (String udc : udcs) {
|
||||
Device udcDevice = deviceAppService.findDeviceByCode(udc);
|
||||
if (udcDevice != null && udcDevice.getDeviceDriver() instanceof IssuedDeviceOrderInfo) {
|
||||
try {
|
||||
issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) udcDevice.getDeviceDriver();
|
||||
issuedDeviceOrderInfo.issuedOrderFinish(status);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pdto.setOrder_status(status);
|
||||
this.update(pdto);
|
||||
@@ -343,7 +403,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
if (device != null && device.getDeviceDriver() instanceof IssuedDeviceOrderInfo) {
|
||||
try {
|
||||
IssuedDeviceOrderInfo issuedDeviceOrderInfo = (IssuedDeviceOrderInfo) device.getDeviceDriver();
|
||||
issuedDeviceOrderInfo.issuedOrderFinish();
|
||||
issuedDeviceOrderInfo.issuedOrderFinish(WorkerOrderEnum.FORCEFINISH.getCode());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -389,6 +449,8 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
this.reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void addDeviceIsOnline(String device_code, ProduceshiftorderDto dto) {
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_deviceisonline");
|
||||
|
||||
Binary file not shown.
@@ -654,8 +654,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
@Override
|
||||
public boolean removeByCodeFromCache(String code) {
|
||||
CopyOnWriteArrayList<TaskDto> taskDtos = this.tasks;
|
||||
return taskDtos.removeIf(task -> task.getTask_code().equals(code));
|
||||
return this.tasks.removeIf(task -> task.getTask_code().equals(code));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.modules.quartz.task;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.acsEnum.AgvTypeEnum;
|
||||
import org.nl.acs.acsEnum.StatusEnum;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
@@ -62,18 +63,24 @@ public class AutoCreateInst {
|
||||
.stream()
|
||||
.sorted((t1, t2) -> t1.getIs_send().compareTo(t2.getIs_send()))
|
||||
.collect(Collectors.toList());
|
||||
//生产指令关联编号
|
||||
String link_no = CodeUtil.getNewCode("LINK_NO");
|
||||
|
||||
|
||||
//如果分组后任务数量为1 下发单任务,分组后任务数量为2 下发双任务
|
||||
if (tasks.size() == TASK_SIZE_1) {
|
||||
TaskDto taskDto = tasks.get(0);
|
||||
|
||||
//如果任务类型是双工任务 但是任务个数是1 则不下发
|
||||
if (StrUtil.equals(taskDto.getTask_type(), AgvTypeEnum.NB_TYPE_1.getTaskType()) ||
|
||||
StrUtil.equals(taskDto.getTask_type(), AgvTypeEnum.NB_TYPE_4.getTaskType())) {
|
||||
continue;
|
||||
}
|
||||
//判断任务是否需要立即下发AGV 不需要则是双任务,等待系统下发第二条任务后,走下发双任务的逻辑
|
||||
if (StrUtil.equals(taskDto.getIs_send(), StatusEnum.NO_SEND.getCode())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//生产指令关联编号
|
||||
String link_no = CodeUtil.getNewCode("LINK_NO");
|
||||
|
||||
Instruction instDto = instructionService.createInstDtoByTask(taskDto, link_no);
|
||||
|
||||
try {
|
||||
@@ -90,6 +97,8 @@ public class AutoCreateInst {
|
||||
|
||||
} else if (tasks.size() == TASK_SIZE_2) {
|
||||
|
||||
//生产指令关联编号
|
||||
String link_no = CodeUtil.getNewCode("LINK_NO");
|
||||
|
||||
TaskDto taskDto1 = tasks.get(0);
|
||||
TaskDto taskDto2 = tasks.get(1);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.modules.quartz.task;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
@@ -21,6 +22,8 @@ public class AutoFeedDeviceNum {
|
||||
private AcsToWmsService acsToWmsService;
|
||||
|
||||
public void run() throws Exception {
|
||||
acsToWmsService.feedDeviceNum(MonitoringLargeScreenData.deviceNumData);
|
||||
if (ObjectUtil.isNotEmpty(MonitoringLargeScreenData.deviceNumData)) {
|
||||
acsToWmsService.feedDeviceNum(MonitoringLargeScreenData.deviceNumData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.modules.quartz.task;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -36,6 +37,8 @@ public class AutoFeedOrderNum {
|
||||
.collect(Collectors.toList());
|
||||
MonitoringLargeScreenData.orderData.values().removeAll(collect);
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(MonitoringLargeScreenData.orderData));
|
||||
acsToWmsService.feedOrderRealQty(param);
|
||||
if (ObjectUtil.isNotEmpty(param)) {
|
||||
acsToWmsService.feedOrderRealQty(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ spring:
|
||||
multi-statement-allow: true
|
||||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:9}
|
||||
database: ${REDIS_DB:12}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
|
||||
Reference in New Issue
Block a user