固化室按照最新逻辑调整
This commit is contained in:
@@ -48,7 +48,8 @@ import java.util.Map;
|
||||
public class GuhuashiSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
|
||||
private AcsToWmsService acsToWmsService=SpringContextHolder.getBean("acsToWmsServiceImpl");;
|
||||
private AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
|
||||
;
|
||||
|
||||
String devicecode;
|
||||
|
||||
@@ -76,7 +77,7 @@ public class GuhuashiSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
int VW7040 = 0;
|
||||
int VW7042 = 0;
|
||||
int VW7044 = 0;
|
||||
int VW7046 = 0;
|
||||
int VD7046 = 0;
|
||||
int VW7056 = 0;
|
||||
int VW7058 = 0;
|
||||
int VW7076 = 0;
|
||||
@@ -106,7 +107,7 @@ public class GuhuashiSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
int last_VW7040 = 0;
|
||||
int last_VW7042 = 0;
|
||||
int last_VW7044 = 0;
|
||||
int last_VW7046 = 0;
|
||||
int last_VD7046 = 0;
|
||||
int last_VW7056 = 0;
|
||||
int last_VW7058 = 0;
|
||||
int last_VW7076 = 0;
|
||||
@@ -142,43 +143,49 @@ public class GuhuashiSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
VW7040 = this.itemProtocol.getVW7040();
|
||||
VW7042 = this.itemProtocol.getVW7042();
|
||||
VW7044 = this.itemProtocol.getVW7044();
|
||||
VW7046 = this.itemProtocol.getVW7046();
|
||||
VD7046 = this.itemProtocol.getVD7046();
|
||||
VW7056 = this.itemProtocol.getVW7056();
|
||||
VW7058 = this.itemProtocol.getVW7058();
|
||||
// VW7076 = this.itemProtocol.getVW7076();
|
||||
// VW70001 = this.itemProtocol.getVW70001();
|
||||
// VW70002 = this.itemProtocol.getVW70002();
|
||||
// VW70003 = this.itemProtocol.getVW70003();
|
||||
// VW70004 = this.itemProtocol.getVW70004();
|
||||
// VW70005 = this.itemProtocol.getVW70005();
|
||||
// VW70006 = this.itemProtocol.getVW70006();
|
||||
// VW70007 = this.itemProtocol.getVW70007();
|
||||
VW7076 = this.itemProtocol.getVW7076();
|
||||
VW70001 = this.itemProtocol.getVW70001();
|
||||
VW70002 = this.itemProtocol.getVW70002();
|
||||
VW70003 = this.itemProtocol.getVW70003();
|
||||
VW70004 = this.itemProtocol.getVW70004();
|
||||
VW70005 = this.itemProtocol.getVW70005();
|
||||
VW70006 = this.itemProtocol.getVW70006();
|
||||
VW70007 = this.itemProtocol.getVW70007();
|
||||
|
||||
if(VW7058!=last_VW7058){
|
||||
//固化室状态变更后通知lms更新固化室状态
|
||||
log.info("固化室{}设备状态VW7058发生变更{},开始通知lms",devicecode,VW7058);
|
||||
if (VW70001 != last_VW70001 && VW70001 == 1) {
|
||||
log.info("固化室{}反馈工艺运行中,开始通知lms", devicecode);
|
||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
||||
request.setDevice_code(this.devicecode);
|
||||
request.setType("1");
|
||||
switch(VW7058) {
|
||||
case 2:
|
||||
request.setState("4");
|
||||
acsToWmsService.notify(request);
|
||||
break;
|
||||
case 3:
|
||||
request.setState("3");
|
||||
acsToWmsService.notify(request);
|
||||
break;
|
||||
case 4:
|
||||
request.setState("5");
|
||||
acsToWmsService.notify(request);
|
||||
break;
|
||||
case 5:
|
||||
request.setType("3");
|
||||
request.setState("故障");
|
||||
acsToWmsService.notify(request);
|
||||
break;
|
||||
}
|
||||
request.setState("4");
|
||||
acsToWmsService.notify(request);
|
||||
}
|
||||
|
||||
if (VW70002 != last_VW70002 && VW70002 == 1) {
|
||||
log.info("固化室{}反馈工艺运行结束,开始通知lms", devicecode);
|
||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
||||
request.setDevice_code(this.devicecode);
|
||||
request.setType("1");
|
||||
request.setState("5");
|
||||
acsToWmsService.notify(request);
|
||||
}
|
||||
if (VD7046 != last_VD7046 && VD7046 == 0) {
|
||||
log.info("固化室{}反馈固化室恢复正常,开始通知lms", devicecode);
|
||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
||||
request.setDevice_code(this.devicecode);
|
||||
request.setType("3");
|
||||
request.setState(String.valueOf(VD7046));
|
||||
acsToWmsService.notify(request);
|
||||
}else if(VD7046 != last_VD7046) {
|
||||
log.info("固化室{}反馈固化室发生异常,开始通知lms", devicecode);
|
||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
||||
request.setDevice_code(this.devicecode);
|
||||
request.setType("3");
|
||||
request.setState(String.valueOf(VD7046));
|
||||
acsToWmsService.notify(request);
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
@@ -202,17 +209,17 @@ public class GuhuashiSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
last_VW7040 = VW7040;
|
||||
last_VW7042 = VW7042;
|
||||
last_VW7044 = VW7044;
|
||||
last_VW7046 = VW7046;
|
||||
last_VD7046 = VD7046;
|
||||
last_VW7056 = VW7056;
|
||||
last_VW7058 = VW7058;
|
||||
last_VW7076 = VW7076;
|
||||
// last_VW70001 = VW70001;
|
||||
// last_VW70002 = VW70002;
|
||||
// last_VW70003 = VW70003;
|
||||
// last_VW70004 = VW70004;
|
||||
// last_VW70005 = VW70005;
|
||||
// last_VW70006 = VW70006;
|
||||
// last_VW70007 = VW70007;
|
||||
last_VW70001 = VW70001;
|
||||
last_VW70002 = VW70002;
|
||||
last_VW70003 = VW70003;
|
||||
last_VW70004 = VW70004;
|
||||
last_VW70005 = VW70005;
|
||||
last_VW70006 = VW70006;
|
||||
last_VW70007 = VW70007;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ItemProtocol {
|
||||
public static String item_VW7040 = "VW7040";
|
||||
public static String item_VW7042 = "VW7042";
|
||||
public static String item_VW7044 = "VW7044";
|
||||
public static String item_VW7046 = "VW7046";
|
||||
public static String item_VD7046 = "VD7046";
|
||||
public static String item_VW7056 = "VW7056";
|
||||
public static String item_VW7058 = "VW7058";
|
||||
public static String item_VW7076 = "VW7076";
|
||||
@@ -133,8 +133,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_VW7044);
|
||||
}
|
||||
|
||||
public int getVW7046() {
|
||||
return this.getOpcIntegerValue(item_VW7046);
|
||||
public int getVD7046() {
|
||||
return this.getOpcIntegerValue(item_VD7046);
|
||||
}
|
||||
|
||||
public int getVW7056() {
|
||||
@@ -224,17 +224,17 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_VW7040, "阶段累加分", "VW7040"));
|
||||
list.add(new ItemDto(item_VW7042, "实际运行程序套数", "VW7042"));
|
||||
list.add(new ItemDto(item_VW7044, "正在执行的阶段数", "VW7044"));
|
||||
// list.add(new ItemDto(item_VW7046, "报警内容", "VW7046"));
|
||||
list.add(new ItemDto(item_VD7046, "报警内容", "VD7046"));
|
||||
list.add(new ItemDto(item_VW7056, "工作模式", "VW7056"));
|
||||
list.add(new ItemDto(item_VW7058, "设备状态", "VW7058"));
|
||||
list.add(new ItemDto(item_VW7076, "心跳", "VW7076"));
|
||||
// list.add(new ItemDto(item_VW70001, "工艺运行中信号", "VW7004.0"));
|
||||
// list.add(new ItemDto(item_VW70002, "工艺运行结束信号", "VW7004.1"));
|
||||
// list.add(new ItemDto(item_VW70003, "固化室内允许进板或出板信号(室内温度低于允许进入温度)", "VW7004.2"));
|
||||
// list.add(new ItemDto(item_VW70004, "固化室前门已开信号", "VW7004.3"));
|
||||
// list.add(new ItemDto(item_VW70005, "固化室前门已关信号", "VW7004.4"));
|
||||
// list.add(new ItemDto(item_VW70006, "固化室后门已开信号", "VW7005.0"));
|
||||
// list.add(new ItemDto(item_VW70007, "固化室后门已关信号", "VW7005.1"));
|
||||
list.add(new ItemDto(item_VW70001, "工艺运行中信号", "VW7004.0"));
|
||||
list.add(new ItemDto(item_VW70002, "工艺运行结束信号", "VW7004.1"));
|
||||
list.add(new ItemDto(item_VW70003, "固化室内允许进板或出板信号(室内温度低于允许进入温度)", "VW7004.2"));
|
||||
list.add(new ItemDto(item_VW70004, "固化室前门已开信号", "VW7004.3"));
|
||||
list.add(new ItemDto(item_VW70005, "固化室前门已关信号", "VW7004.4"));
|
||||
list.add(new ItemDto(item_VW70006, "固化室后门已开信号", "VW7005.0"));
|
||||
list.add(new ItemDto(item_VW70007, "固化室后门已关信号", "VW7005.1"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -633,11 +633,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
JSONObject result = new JSONObject();
|
||||
Integer type=param.getInteger("type");
|
||||
String device_code=param.getString("device_code");
|
||||
Device device;
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);;
|
||||
switch(type){
|
||||
case 1:
|
||||
//LMS通知固化室极板已进满信号,开始固化
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) {
|
||||
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver = (GuhuashiSiteDeviceDriver) device.getDeviceDriver();
|
||||
guhuashiSiteDeviceDriver.writing("VW70043",1);
|
||||
@@ -645,12 +644,18 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
break;
|
||||
case 2:
|
||||
//LMS通知固化室在下班时未进满信号,开始固化
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) {
|
||||
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver = (GuhuashiSiteDeviceDriver) device.getDeviceDriver();
|
||||
guhuashiSiteDeviceDriver.writing("VW70045",1);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
//LMS通知固化室极板已出完
|
||||
if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) {
|
||||
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver = (GuhuashiSiteDeviceDriver) device.getDeviceDriver();
|
||||
guhuashiSiteDeviceDriver.writing("VW70053",1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class SyncDeviceStatus {
|
||||
json.put("device_statue", guhuashiSiteDeviceDriver.getVW7058());
|
||||
json.put("front_door", guhuashiSiteDeviceDriver.getVW70004()==0?1:0);
|
||||
json.put("back_door", guhuashiSiteDeviceDriver.getVW7010());
|
||||
json.put("error", guhuashiSiteDeviceDriver.getVW7046());
|
||||
json.put("error", guhuashiSiteDeviceDriver.getVD7046());
|
||||
guhuashi.add(json);
|
||||
} else if (device.getDeviceDriver() instanceof SiteStatusDeviceDriver) {
|
||||
SiteStatusDeviceDriver siteStatusDeviceDriver=(SiteStatusDeviceDriver)device.getDeviceDriver();
|
||||
|
||||
@@ -199,14 +199,25 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
case 3:
|
||||
//设备反馈故障
|
||||
try {
|
||||
DasDeviceFault dasDeviceFault = new DasDeviceFault();
|
||||
String now = DateUtil.now();
|
||||
dasDeviceFault.setDevice_code(device_code);
|
||||
dasDeviceFault.setRegion_code(pointService.getById(device_code).getRegion_code());
|
||||
dasDeviceFault.setData_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
dasDeviceFault.setFailure_time(now);
|
||||
dasDeviceFault.setFailure_info(state);
|
||||
cockpitMapper.insertDeviceFault(dasDeviceFault);
|
||||
SchBasePoint schBasePoint=pointService.getById(device_code);
|
||||
if(ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||
if ("0".equals(state)) {
|
||||
schBasePoint.setIs_used(true);
|
||||
pointService.update(schBasePoint);
|
||||
} else {
|
||||
DasDeviceFault dasDeviceFault = new DasDeviceFault();
|
||||
String now = DateUtil.now();
|
||||
dasDeviceFault.setDevice_code(device_code);
|
||||
dasDeviceFault.setRegion_code(pointService.getById(device_code).getRegion_code());
|
||||
dasDeviceFault.setData_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
dasDeviceFault.setFailure_time(now);
|
||||
dasDeviceFault.setFailure_info(state+"故障");
|
||||
cockpitMapper.insertDeviceFault(dasDeviceFault);
|
||||
schBasePoint.setIs_used(false);
|
||||
pointService.update(schBasePoint);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception exception) {
|
||||
throw new BadRequestException(exception.toString());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.sch.point.service.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -43,7 +44,7 @@ public class SyncPoint {
|
||||
log.info("自动线程开始查询天眼点位状态");
|
||||
String url = "http://10.44.101.61:9001/api/getStatus?binNo=ALL";
|
||||
log.info("下发天眼查询点位状态请求:{}", url);
|
||||
HttpResponse result = HttpRequest.post(url)
|
||||
HttpResponse result = HttpRequest.get(url)
|
||||
.body(String.valueOf(new JSONObject()))//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute();
|
||||
@@ -70,11 +71,13 @@ public class SyncPoint {
|
||||
temp.getVehicle_code(),
|
||||
temp.getVehicle_type(),
|
||||
GroupBindMaterialStatusEnum.BOUND.getValue());
|
||||
groupInfo.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
|
||||
vehiclematerialgroupService.update(groupInfo);
|
||||
// 插入生产过程跟踪表
|
||||
PdmBdProductionProcessTracking processTracking = new PdmBdProductionProcessTracking();
|
||||
processTracking.setBuss_move_id(groupInfo.getBuss_move_id());
|
||||
if (ObjectUtil.isNotEmpty(groupInfo)) {
|
||||
groupInfo.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
|
||||
vehiclematerialgroupService.update(groupInfo);
|
||||
processTracking.setBuss_move_id(groupInfo.getBuss_move_id());
|
||||
}
|
||||
processTracking.setProcess_action("暂存区人工出库");
|
||||
processTracking.setProcess_location(temp.getPoint_code());
|
||||
processTracking.setRecord_time(DateUtil.now());
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.system.service.notice.ISysNoticeService;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
|
||||
import org.nl.wms.pdm.track.service.IPdmBdProductionProcessTrackingService;
|
||||
import org.nl.wms.pdm.track.service.dao.PdmBdProductionProcessTracking;
|
||||
@@ -63,6 +64,8 @@ public class GHCQLTask extends AbstractTask {
|
||||
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
|
||||
@Autowired
|
||||
private IPdmBdProductionProcessTrackingService processTrackingService;
|
||||
@Autowired
|
||||
private WmsToAcsService wmsToAcsService;
|
||||
|
||||
@Override
|
||||
protected void create() throws BadRequestException {
|
||||
@@ -101,11 +104,16 @@ public class GHCQLTask extends AbstractTask {
|
||||
SchBasePoint point = findStartPoint(startRegionStr, extGroupData);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("固化室没有所需物料,将该固化室改为无货状态!", TASK_CONFIG_CODE + task.getPoint_code2(),
|
||||
noticeService.createNotice("固化室没有所需物料,将该固化室改为允许进料状态!", TASK_CONFIG_CODE + task.getPoint_code2(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
SchBasePoint schBasePoint=pointService.getById(task.getPoint_code2().substring(0, task.getPoint_code2().length() - 1));
|
||||
schBasePoint.setPoint_status(PointStatusEnum.EMPTY_POINT.getCode());
|
||||
schBasePoint.setPoint_status(PointStatusEnum.MATERIAL_IN.getCode());
|
||||
pointService.update(schBasePoint);
|
||||
//通知acs极板已出完
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device_code", schBasePoint);
|
||||
jsonObject.put("type", 3);
|
||||
wmsToAcsService.notifyAcs(jsonObject);
|
||||
return;
|
||||
}
|
||||
// 设置起点并修改创建成功状态
|
||||
|
||||
@@ -388,7 +388,6 @@ public class TBXMLTask extends AbstractTask {
|
||||
}
|
||||
|
||||
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
// todo: 最后一个位置完成放货需要请求固化,将设备设置为固化状
|
||||
// 获取参数
|
||||
String endPoint = taskObj.getPoint_code2();
|
||||
SchBasePoint endPointObj = pointService.getById(endPoint);
|
||||
|
||||
Reference in New Issue
Block a user