This commit is contained in:
psh
2023-12-26 10:22:05 +08:00
parent 68c68e6c4d
commit 5d2a3def53
2 changed files with 58 additions and 23 deletions

View File

@@ -196,25 +196,25 @@ public class SiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceD
case 5:
//叫料
if (move==0 && !requireSucess){
apply(4);
apply(5);
}
break;
case 6:
//满料出库
if(move==1 && !requireSucess){
apply(5);
apply(6);
}
break;
case 7:
//申请空盘
if (move==0 && !requireSucess){
apply(6);
apply(7);
}
break;
case 8:
//空托盘出库
if(move==1 && !requireSucess){
apply(7);
apply(8);
}
break;
}
@@ -392,30 +392,13 @@ public class SiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceD
this.time = date;
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
request.setDevice_code(devicecode);
request.setMaterial_type(String.valueOf(material_type));
request.setVehicle_code(String.valueOf(barcode));
if (devicecode.startsWith("TBX")&&type==5&&barcode>0) {
//满架下料
request.setRequest_medthod_code(RequestMethodEnum.apply_mjxl.getCode());
request.setRequest_medthod_name(RequestMethodEnum.apply_mjxl.getName());
}else if (devicecode.startsWith("TBX")&&type==6) {
//补空架
request.setRequest_medthod_code(RequestMethodEnum.apply_tbxbkj.getCode());
request.setRequest_medthod_name(RequestMethodEnum.apply_tbxbkj.getName());
}else if (type==7) {
//空托盘出库,包片机和销售出库空位都可以
request.setRequest_medthod_code(RequestMethodEnum.apply_kghjrk.getCode());
request.setRequest_medthod_name(RequestMethodEnum.apply_kghjrk.getName());
}else if(devicecode.startsWith("BP")&&material_type>0){
request.setRequest_medthod_code(RequestMethodEnum.apply_bpsl.getCode());
request.setRequest_medthod_name(RequestMethodEnum.apply_bpsl.getName());
}
request.setRequest_medthod_code(String.valueOf(type));
String resp = acsToWmsService.applyTask(request);
JSONObject res_jo = JSONObject.parseObject(resp);
if (StrUtil.equals(res_jo.getString("code"), "200")) {
this.writing(type);
this.setRequireSucess(true);
log.info("acs申请任务", this.devicecode, "满盅入库任务申请成功!");
log.info("acs申请任务", this.devicecode, "任务申请成功!");
}else{
this.writing(99);
}

View File

@@ -0,0 +1,52 @@
package org.nl.quartz.task;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONArray;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver;
import org.nl.acs.device_driver.tianneng.guhuashi.GuhuashiSiteDeviceDriver;
import org.nl.acs.device_driver.tianneng.site.SiteDeviceDriver;
import org.nl.acs.device_driver.tianneng.site_status.SiteStatusDeviceDriver;
import org.nl.acs.device_driver.tianneng.tubanxian.TubanxianSiteDeviceDriver;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.DeviceAppService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
* 自动上报驱动数据
*/
@Slf4j
@Component
public class AutoSendDeviceData {
@Resource
private DeviceAppService deviceAppService;
public void run() throws Exception {
long startTime = System.currentTimeMillis();
JSONArray jsonArray=new JSONArray();
List<Device> deviceList = deviceAppService.findAllDevice();
for(Device device:deviceList){
if (device.getDeviceDriver() instanceof TubanxianSiteDeviceDriver) {
JSONObject json = new JSONObject();
//todo 待提供字段
jsonArray.add(json);
}else if(device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) {
JSONObject json = new JSONObject();
//todo 待提供字段
jsonArray.add(json);
}else if(device.getDeviceDriver() instanceof SiteStatusDeviceDriver) {
JSONObject json = new JSONObject();
//todo 待提供字段
jsonArray.add(json);
}else if(device.getDeviceDriver() instanceof SiteDeviceDriver) {
JSONObject json = new JSONObject();
//todo 待提供字段
jsonArray.add(json);
}
}
log.trace("自动上报驱动状态,完毕耗时{}", System.currentTimeMillis()-startTime);
}
}