add 纸管库、立库接口
This commit is contained in:
@@ -112,6 +112,10 @@ public class ItemProtocol {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,12 +149,16 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
} else if (this.getMode() == 2) {
|
} else if (this.getMode() == 2) {
|
||||||
mode = "联机";
|
mode = "联机";
|
||||||
} else if (this.getMode() == 3) {
|
} else if (this.getMode() == 3) {
|
||||||
mode = "运行中";
|
mode = "入库中";
|
||||||
|
} else if (this.getMode() == 4) {
|
||||||
|
mode = "出库中";
|
||||||
}
|
}
|
||||||
jo.put("device_name", this.getDevice().getDevice_name());
|
jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
jo.put("mode", mode);
|
jo.put("mode", mode);
|
||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("inventory_qty", inventory_qty);
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("out_finish", out_finish);
|
||||||
|
jo.put("material", material);
|
||||||
|
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -870,10 +870,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
message = "申请空盘入库任务中...";
|
message = "申请空盘入库任务中...";
|
||||||
|
|
||||||
if(taskserver.querySameOriginTask(this.device_code) > 0 ){
|
// if(taskserver.querySameOriginTask(this.device_code) > 0 ){
|
||||||
message = "已存在空盘出库任务不再请求";
|
// message = "已存在空盘出库任务不再请求";
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
JSONObject apply = new JSONObject();
|
JSONObject apply = new JSONObject();
|
||||||
apply.put("device_code", device_code);
|
apply.put("device_code", device_code);
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.acs.ext.wms.liKuData;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库任务库位解锁Data类
|
||||||
|
* @author: wangs
|
||||||
|
* @createDate: 2022/11/24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OutConfirmReportResponse extends BaseResponseData {
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.nl.acs.ext.wms.liKuData;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库库位解锁 请求参数类
|
||||||
|
*
|
||||||
|
* @author: wangs by
|
||||||
|
* @createDate: 2022/11/24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OutConfirmRequest extends BaseStoreRequest {
|
||||||
|
String outPortNo;
|
||||||
|
}
|
||||||
@@ -111,4 +111,11 @@ public class AcsToLiKuController {
|
|||||||
return new ResponseEntity<>(acsToLiKuService.queryTsjDeviceStatus(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.queryTsjDeviceStatus(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/outConfirm")
|
||||||
|
@Log(value = "下发解锁出库口",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
|
@ApiOperation("下发解锁出库口")
|
||||||
|
public ResponseEntity<Object> outConfirm(@RequestBody OutConfirmRequest requestParam) {
|
||||||
|
return new ResponseEntity<>(acsToLiKuService.outConfirm(requestParam), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,13 @@ public class WmsToAcsController {
|
|||||||
return new ResponseEntity<>(wmstoacsService.crateTask(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.crateTask(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/unLock")
|
||||||
|
@Log(value = "解锁立库点位",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
|
@ApiOperation("解锁立库点位")
|
||||||
|
public ResponseEntity<Object> unLock(@RequestBody String whereJson) {
|
||||||
|
return new ResponseEntity<>(wmstoacsService.unLock(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/cancelTask")
|
@PostMapping("/cancelTask")
|
||||||
@Log(value = "WMS取消任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
@Log(value = "WMS取消任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
@ApiOperation("WMS取消任务")
|
@ApiOperation("WMS取消任务")
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ public interface AcsToLiKuService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Resp<DeviceStatusResponse> querySsxDeviceStatus(DeviceStatusRequest requestParam);
|
public Resp<DeviceStatusResponse> querySsxDeviceStatus(DeviceStatusRequest requestParam);
|
||||||
|
|
||||||
|
|
||||||
|
public Resp<OutConfirmReportResponse> outConfirm(OutConfirmRequest requestParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ public interface WmsToAcsService {
|
|||||||
CreateTaskResponse crateTask(String whereJson);
|
CreateTaskResponse crateTask(String whereJson);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解锁立库点位
|
||||||
|
*
|
||||||
|
* @param jsonObject 条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> unLock(String jsonObject);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消任务
|
* 取消任务
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -204,6 +204,22 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Resp<OutConfirmReportResponse> outConfirm(OutConfirmRequest requestParam) {
|
||||||
|
try {
|
||||||
|
MDC.put(log_file_type, log_type);
|
||||||
|
log.info("outConfirm-----输入参数{}", JSON.toJSONString(requestParam));
|
||||||
|
String api = addressService.findByCode("outConfirm").getMethods_url();
|
||||||
|
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||||
|
log.info("outConfirm-----输出参数{}", result);
|
||||||
|
return RespUtil.getResp(result, new OutConfirmRequest());
|
||||||
|
} finally {
|
||||||
|
MDC.remove(log_file_type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Resp sendInst(String type, Instruction dto){
|
public Resp sendInst(String type, Instruction dto){
|
||||||
AcsToLiKuService acsToLiKuService = SpringContextHolder.getBean(AcsToLiKuService.class);
|
AcsToLiKuService acsToLiKuService = SpringContextHolder.getBean(AcsToLiKuService.class);
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanne
|
|||||||
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDefination;
|
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDefination;
|
||||||
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.data.*;
|
import org.nl.acs.ext.wms.data.*;
|
||||||
|
import org.nl.acs.ext.wms.liKuData.DeviceStatusResponse;
|
||||||
|
import org.nl.acs.ext.wms.liKuData.OutConfirmReportResponse;
|
||||||
|
import org.nl.acs.ext.wms.liKuData.OutConfirmRequest;
|
||||||
import org.nl.acs.ext.wms.liKuData.Resp;
|
import org.nl.acs.ext.wms.liKuData.Resp;
|
||||||
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
||||||
import org.nl.acs.ext.wms.service.WmsToAcsService;
|
import org.nl.acs.ext.wms.service.WmsToAcsService;
|
||||||
@@ -769,6 +772,35 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> unLock(String param) {
|
||||||
|
try {
|
||||||
|
MDC.put(log_file_type, log_type);
|
||||||
|
log.info("unLock--------------:输入参数" + param);
|
||||||
|
JSONObject jo = JSONObject.parseObject(param);
|
||||||
|
String task_code = String.valueOf(jo.get("task_code"));
|
||||||
|
String device_code = String.valueOf(jo.get("device_code"));
|
||||||
|
String vehicle_code = String.valueOf(jo.get("vehicle_code"));
|
||||||
|
OutConfirmRequest outConfirmRequest = new OutConfirmRequest();
|
||||||
|
outConfirmRequest.setOutPortNo(device_code);
|
||||||
|
outConfirmRequest.setPalletCode(vehicle_code);
|
||||||
|
|
||||||
|
Resp<OutConfirmReportResponse> resp = acsToLiKuService.outConfirm(outConfirmRequest);
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.info("unLock--------------:输出参数" + e.getMessage());
|
||||||
|
} finally {
|
||||||
|
MDC.remove(log_file_type);
|
||||||
|
}
|
||||||
|
JSONObject resultJson = new JSONObject();
|
||||||
|
resultJson.put("status", HttpStatus.OK.value());
|
||||||
|
resultJson.put("message", "操作成功");
|
||||||
|
log.info("unLock--------------:输出参数" + resultJson);
|
||||||
|
return resultJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> updateTask(String whereJson) {
|
public Map<String, Object> updateTask(String whereJson) {
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import org.openscada.opc.lib.da.ItemState;
|
|||||||
import org.openscada.opc.lib.da.Server;
|
import org.openscada.opc.lib.da.Server;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class DeviceOpcProtocolRunable implements Runnable {
|
public class DeviceOpcProtocolRunable implements Runnable {
|
||||||
@@ -20,6 +22,8 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
|||||||
int error_num;
|
int error_num;
|
||||||
String message;
|
String message;
|
||||||
private Server server;
|
private Server server;
|
||||||
|
boolean flag =false;
|
||||||
|
|
||||||
|
|
||||||
public DeviceOpcProtocolRunable() {
|
public DeviceOpcProtocolRunable() {
|
||||||
this.error_num = 0;
|
this.error_num = 0;
|
||||||
@@ -172,10 +176,30 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
|||||||
value = OpcUtl.getValue(item, itemState);
|
value = OpcUtl.getValue(item, itemState);
|
||||||
his = accessor_value.getValue(item.getId());
|
his = accessor_value.getValue(item.getId());
|
||||||
if (!ObjectUtl.isEquals(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) {
|
if (!ObjectUtl.isEquals(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) {
|
||||||
|
flag = true;
|
||||||
log.warn("opc 值不健康 item: {}, 状态: {},当前读取值:{}, 系统内存值{} ", item.getId(), itemState.getQuality(), value, his);
|
log.warn("opc 值不健康 item: {}, 状态: {},当前读取值:{}, 系统内存值{} ", item.getId(), itemState.getQuality(), value, his);
|
||||||
}
|
}
|
||||||
|
if(flag){
|
||||||
|
if (this.server != null) {
|
||||||
|
try {
|
||||||
|
this.server.disconnect();
|
||||||
|
} catch (Exception var25) {
|
||||||
|
log.warn("{} : server disconnect", var25);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DeviceOpcProtocolRunable runable = new DeviceOpcProtocolRunable();
|
||||||
|
runable.setProtocols(protocols);
|
||||||
|
runable.setOpcServer(OpcServer);
|
||||||
|
ExecutorService executorService = Executors.newCachedThreadPool();
|
||||||
|
executorService.submit(runable);
|
||||||
|
log.warn("opc 值不健康 item: {}, 重新创建连接,当前线程名:{}", item.getId(),tag);
|
||||||
|
break;
|
||||||
|
}
|
||||||
} while (ObjectUtil.equal(value, his));//如果两次的值相等,不走下面的代码
|
} while (ObjectUtil.equal(value, his));//如果两次的值相等,不走下面的代码
|
||||||
|
|
||||||
|
if(flag){
|
||||||
|
break;
|
||||||
|
}
|
||||||
OpcItemDto itemDto = this.getItem(item.getId());
|
OpcItemDto itemDto = this.getItem(item.getId());
|
||||||
//默认记录日志
|
//默认记录日志
|
||||||
if (true) {
|
if (true) {
|
||||||
@@ -197,7 +221,12 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
|||||||
// accessor_value.getHistoryUnifiedData(item.getId());
|
// accessor_value.getHistoryUnifiedData(item.getId());
|
||||||
//设置值
|
//设置值
|
||||||
accessor_value.setValue(item.getId(), value);
|
accessor_value.setValue(item.getId(), value);
|
||||||
|
if(flag){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception var30) {
|
} catch (Exception var30) {
|
||||||
|
|||||||
@@ -369,9 +369,6 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for (const val in this.data1) {
|
for (const val in this.data1) {
|
||||||
if (this.data1[val].code.indexOf('inventory_qty') !== -1) {
|
|
||||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
|
||||||
}
|
|
||||||
if (this.data1[val].code.indexOf('inventory_qty') !== -1) {
|
if (this.data1[val].code.indexOf('inventory_qty') !== -1) {
|
||||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
||||||
}
|
}
|
||||||
@@ -396,12 +393,9 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for (const val in this.data2) {
|
for (const val in this.data2) {
|
||||||
if (this.data2[val].code.indexOf('to_target') !== -1) {
|
if (this.data2[val].code.indexOf('to_out_qty') !== -1) {
|
||||||
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
||||||
}
|
}
|
||||||
if (this.data2[val].code.indexOf('to_task') !== -1) {
|
|
||||||
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user