更新
This commit is contained in:
0
mes/hd/logPath_IS_UNDEFINED/2022-09-01.0.log
Normal file
0
mes/hd/logPath_IS_UNDEFINED/2022-09-01.0.log
Normal file
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -147,6 +148,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
map.put("update_time", now);
|
||||
map.put("realproduceend_date", now);
|
||||
wo.update(map, "produceorder_id = '" + ext_order_id + "'");
|
||||
JSONObject jsonObject = wo.query("produceorder_id = '" + ext_order_id + "'").uniqueResult(0);
|
||||
String real_qty = jsonObject.getString("real_qty");
|
||||
if (StrUtil.isEmpty(real_qty)){
|
||||
real_qty = "0";
|
||||
}
|
||||
//同时修改工单记录表中的期末数量及完成数量
|
||||
WQLObject wo_record = WQLObject.getWQLObject("MPS_BD_MacOperateRecord");
|
||||
JSONObject result1 = wo_record.query("produceorder_id = '" + ext_order_id + "' and (operatetime_end = '' or operatetime_end is null) ").uniqueResult(0);
|
||||
result1.put("finish_qty",real_qty);
|
||||
result1.put("finishproduct_qty",real_qty);
|
||||
result1.put("operatetime_end",now);
|
||||
wo_record.update(result1);
|
||||
} catch (Exception e){
|
||||
result.put("status", 400);
|
||||
result.put("message", e.getMessage());
|
||||
|
||||
@@ -417,7 +417,7 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
|
||||
int nowproductivity = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "13").addParam("workprocedure_id", workprocedure_id).addParam("produce_date", today)
|
||||
.process().uniqueResult(0).getIntValue("real_qty");
|
||||
BigDecimal teep = new BigDecimal(0);
|
||||
if (nowproductivity != 0) {
|
||||
if (nowproductivity != 0 && Maxproductivity > 0) {
|
||||
teep = NumberUtil.round(NumberUtil.div(nowproductivity * 100, Maxproductivity), 2);
|
||||
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@
|
||||
SELECT
|
||||
device.productivity,
|
||||
CASE WHEN TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) = '0' THEN device.productivity
|
||||
ELSE device.productivity * TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) END AS max_productivity,
|
||||
ELSE device.productivity * (TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) + 1) END AS max_productivity,
|
||||
shiftorder.produceorder_code,
|
||||
shiftorder.realproducestart_date
|
||||
FROM
|
||||
|
||||
@@ -408,6 +408,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
JSONObject row = param.getJSONObject("row");
|
||||
//强制完成时修改工单状态
|
||||
String produceorder_id = row.getString("produceorder_id");
|
||||
WQLObject wo = WQLObject.getWQLObject("MPS_BD_ProduceShiftOrder");
|
||||
JSONObject produceorderMap = new JSONObject();
|
||||
@@ -419,6 +420,20 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
produceorderMap.put("update_time", now);
|
||||
produceorderMap.put("realproduceend_date", now);
|
||||
wo.update(produceorderMap);
|
||||
JSONObject jsonObject = wo.query("produceorder_id = '" + produceorder_id + "'").uniqueResult(0);
|
||||
String real_qty = jsonObject.getString("real_qty");
|
||||
if (StrUtil.isEmpty(real_qty)){
|
||||
real_qty = "0";
|
||||
}
|
||||
//同时修改工单记录表中的期末数量及完成数量
|
||||
WQLObject wo_record = WQLObject.getWQLObject("MPS_BD_MacOperateRecord");
|
||||
JSONObject result = wo_record.query("produceorder_id = '" + produceorder_id + "' and (operatetime_end = '' or operatetime_end is null) ").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(result)){
|
||||
result.put("finish_qty",real_qty);
|
||||
result.put("finishproduct_qty",real_qty);
|
||||
result.put("operatetime_end",now);
|
||||
wo_record.update(result);
|
||||
}
|
||||
//wms向acs发送请求 工单强制完成
|
||||
// TODO
|
||||
JSONArray array = new JSONArray();
|
||||
|
||||
@@ -135,11 +135,14 @@
|
||||
workprocedure.workprocedure_name,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
material.material_spec
|
||||
material.material_spec,
|
||||
device.device_code,
|
||||
device.device_name
|
||||
FROM
|
||||
MPS_BD_ProduceShiftOrder shiftOrder
|
||||
left join PDM_BI_WorkProcedure workprocedure on workprocedure.workprocedure_id = shiftOrder.workprocedure_id
|
||||
left join md_me_materialbase material on material.material_id = shiftOrder.material_id
|
||||
left join pdm_bi_device device on device.device_id = shiftOrder.device_id
|
||||
WHERE
|
||||
shiftOrder.is_delete = '0' and shiftOrder.order_status in ('01', '02', '03')
|
||||
and shiftOrder.workprocedure_id in 输入.workprocedure_ids
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
size="small"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@@ -37,26 +37,27 @@
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="produceorder_id" label="生产班次工单标识" />
|
||||
<el-table-column prop="produceorder_code" label="工单编号" width="130px" />
|
||||
<el-table-column prop="order_status" label="工单状态">
|
||||
<el-table-column prop="produceorder_code" label="工单编号" min-width="100px" />
|
||||
<el-table-column prop="order_status" label="工单状态" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.MPS_BD_ORDERSTATUS[scope.row.order_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="shift_type_scode" label="班次类型">
|
||||
<el-table-column prop="shift_type_scode" label="班次类型" min-width="90px">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.PDM_BI_SHIFTTYPE[scope.row.shift_type_scode] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="false" prop="workprocedure_id" label="工序标识" />
|
||||
<el-table-column prop="produce_date" label="生产日期" width="100px" />
|
||||
<el-table-column prop="plan_qty" label="计划数量" />
|
||||
<el-table-column prop="report_qty" label="完工数量" />
|
||||
<el-table-column v-if="false" prop="material_id" label="物料标识" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="realproducestart_date" label="开始时间" width="150" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="生产设备" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="plan_qty" label="计划数量" min-width="80px" />
|
||||
<el-table-column prop="real_qty" label="实际数量" min-width="80px" />
|
||||
<el-table-column prop="produce_date" label="生产日期" min-width="100px" />
|
||||
<el-table-column prop="realproducestart_date" label="开始时间" min-width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
|
||||
@@ -64,7 +65,7 @@
|
||||
<el-dialog
|
||||
title="请绑定设备"
|
||||
:visible.sync="devicedialogVisible"
|
||||
width="35%"
|
||||
width="350px"
|
||||
:before-close="handleClose">
|
||||
<el-form :model="deviceForm" status-icon label-width="90px" ref="deviceForm" class="demo-ruleForm">
|
||||
<el-form-item label="选择设备" prop="device_id">
|
||||
@@ -95,7 +96,7 @@
|
||||
:visible.sync="reportdialogVisibler"
|
||||
width="35%"
|
||||
:before-close="handleClose">
|
||||
<el-form :model="reportForm" status-icon ref="reportForm" label-width="90px" class="demo-ruleForm">
|
||||
<el-form :model="reportForm" status-icon ref="reportForm" label-width="70px" class="demo-ruleForm">
|
||||
<el-form-item label="生产数量" prop="produce_qty">
|
||||
<el-input disabled v-model="reportForm.produce_qty" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -162,8 +162,8 @@
|
||||
type="danger"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="forceFinish(crud.selections[0])"
|
||||
:disabled="is_finished(crud.selections)"
|
||||
@click="forceFinish(crud.selections)"
|
||||
>
|
||||
强制完成
|
||||
</el-button>
|
||||
@@ -266,8 +266,8 @@
|
||||
style="width: 200px"
|
||||
clearable
|
||||
filterable
|
||||
@change="change"
|
||||
placeholder="请选择"
|
||||
@change="change"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.PDM_BI_SHIFTTYPE"
|
||||
@@ -623,11 +623,24 @@ export default {
|
||||
}
|
||||
},
|
||||
// 强制完成
|
||||
forceFinish(data) {
|
||||
forceFinish(rows) {
|
||||
var i = Number(0)
|
||||
rows.forEach((item) => {
|
||||
crudProduceshiftorder.forceFinish({ row: item }).then(res => {
|
||||
i = i + 1
|
||||
if (i === rows.length) {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
/*
|
||||
|
||||
crudProduceshiftorder.forceFinish({ row: data }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
})*/
|
||||
},
|
||||
// 取两位小数点
|
||||
rounding(row, column) {
|
||||
@@ -651,6 +664,25 @@ export default {
|
||||
return true
|
||||
}
|
||||
},
|
||||
|
||||
// 强制完成禁用条件
|
||||
is_finished(rows) {
|
||||
var length = rows.length
|
||||
if (length > 1) {
|
||||
var flag = false
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
if (rows[i].order_status === '04') {
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
return flag
|
||||
} else if (length === 1 && rows[0].order_status !== '04') {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
},
|
||||
// 新增编辑给form表单物料相关信息赋值
|
||||
setMaterValue(row) {
|
||||
this.form.material_id = row.material_id
|
||||
@@ -666,13 +698,17 @@ export default {
|
||||
},
|
||||
// 下发
|
||||
submits(rows) {
|
||||
var i = Number(0)
|
||||
rows.forEach((item) => {
|
||||
var produceorder_id = item.produceorder_id
|
||||
crudProduceshiftorder.submits({ produceorder_id: produceorder_id }).then(res => {
|
||||
})
|
||||
})
|
||||
i = i + 1
|
||||
if (i === rows.length) {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.addShow = true
|
||||
|
||||
@@ -197,7 +197,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
public synchronized void execute() throws Exception {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
@@ -318,6 +318,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
}
|
||||
|
||||
synchronized (this){
|
||||
int realError = 0;
|
||||
long now_feedTime = System.currentTimeMillis();
|
||||
if (now_feedTime - last_feedDeviceStatusTime >= 5000){
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
@@ -327,10 +328,13 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
status_type = 02;
|
||||
if (error == 1 || error == 51) {
|
||||
status_type = 05;
|
||||
realError = error;
|
||||
}else if (mode == 1 && order > 0) {
|
||||
status_type = 03;
|
||||
realError = 0;
|
||||
} else if (mode == 0 && order > 0) {
|
||||
status_type = 04;
|
||||
realError = 0;
|
||||
}
|
||||
}
|
||||
if (status_type != last_status_type) {
|
||||
@@ -338,7 +342,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
map.put("device_code", device_code);
|
||||
map.put("status_type", "0" + status_type);
|
||||
map.put("start_time", DateUtil.now());
|
||||
map.put("error_code",error);
|
||||
map.put("error_code",realError);
|
||||
acsToWmsService.feedDeviceStatusType(map);
|
||||
last_status_type = status_type;
|
||||
}
|
||||
@@ -391,8 +395,8 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
}
|
||||
produceshiftorderService.updateByOrderCode(dto);
|
||||
this.writing("to_confirm_finished","1");
|
||||
this.writing("to_clear","1");
|
||||
this.writing("to_order", "0");
|
||||
this.writing("to_clear","1");
|
||||
this.writing("to_pause","1");
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,任务确认完成,电器信号写入成功");
|
||||
}else {
|
||||
|
||||
@@ -171,7 +171,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
public synchronized void execute() throws Exception {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
@@ -262,6 +262,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
|
||||
synchronized (this){
|
||||
int realError = 0;
|
||||
long now_feedTime = System.currentTimeMillis();
|
||||
if (now_feedTime - last_feedDeviceStatusTime >= 5000){
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
@@ -271,17 +272,20 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
status_type = 02;
|
||||
if (error == 1 || error == 51) {
|
||||
status_type = 05;
|
||||
realError = error;
|
||||
}else if (mode == 1 && order > 0) {
|
||||
status_type = 03;
|
||||
realError = 0;
|
||||
} else if (mode == 0 && order > 0) {
|
||||
status_type = 04;
|
||||
realError = 0;
|
||||
}
|
||||
}
|
||||
if (status_type != last_status_type) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("device_code", device_code);
|
||||
map.put("status_type", "0" + status_type);
|
||||
map.put("error_code",error);
|
||||
map.put("error_code",realError);
|
||||
map.put("start_time", DateUtil.now());
|
||||
acsToWmsService.feedDeviceStatusType(map);
|
||||
last_status_type = status_type;
|
||||
@@ -337,9 +341,9 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
produceshiftorderService.updateByOrderCode(dto);
|
||||
this.writing("to_confirm_finished", "1");
|
||||
this.writing("to_order", "0");
|
||||
this.writing("to_clear", "1");
|
||||
this.writing("to_pause", "1");
|
||||
this.writing("to_order", "0");
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,任务确认完成,电器信号写入成功");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,order_finish>"+ order_finish +",last_order_finish>"+last_order_finish + "mode:" + mode + "order:" + order);
|
||||
|
||||
@@ -202,7 +202,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
public synchronized void execute() throws Exception {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
@@ -339,10 +339,10 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
logServer.deviceLog(this.device_code,"open_ready_time" ,String.valueOf(task));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task);
|
||||
}
|
||||
if (device_running_time != last_device_running_time) {
|
||||
/* if (device_running_time != last_device_running_time) {
|
||||
logServer.deviceLog(this.device_code,"device_running_time" ,String.valueOf(device_running_time));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号device_running_time:" + last_device_running_time + "->" + device_running_time);
|
||||
}
|
||||
}*/
|
||||
if (await_time != last_await_time) {
|
||||
logServer.deviceLog(this.device_code,"await_time" ,String.valueOf(await_time));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号await_time:" + last_await_time + "->" + await_time);
|
||||
@@ -352,6 +352,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_prod_allnum:" + last_order_prod_allnum + "->" + order_prod_allnum);
|
||||
}
|
||||
synchronized (this){
|
||||
int realError = 0;
|
||||
long now_feedTime = System.currentTimeMillis();
|
||||
if (now_feedTime - last_feedDeviceStatusTime >= 5000){
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
@@ -361,9 +362,12 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
status_type = 02;
|
||||
if (error == 1 || error == 51) {
|
||||
status_type = 05;
|
||||
realError = error;
|
||||
}else if (mode == 1 && order > 0) {
|
||||
status_type = 03;
|
||||
realError = 0;
|
||||
} else if (mode == 0 && order > 0) {
|
||||
realError = 0;
|
||||
status_type = 04;
|
||||
}
|
||||
}
|
||||
@@ -372,7 +376,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
map.put("device_code", device_code);
|
||||
map.put("status_type", "0" + status_type);
|
||||
map.put("start_time", DateUtil.now());
|
||||
map.put("error_code",error);
|
||||
map.put("error_code",realError);
|
||||
acsToWmsService.feedDeviceStatusType(map);
|
||||
last_status_type = status_type;
|
||||
}
|
||||
@@ -427,8 +431,8 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
produceshiftorderService.updateByOrderCode(dto);
|
||||
this.writing("to_confirm_finished","1");
|
||||
this.writing("to_clear","1");
|
||||
this.writing("to_order", "0");
|
||||
this.writing("to_clear","1");
|
||||
this.writing("to_pause","1");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,finish>"+ finish +",last_finish>"+last_finish + "mode:" + mode + "order:" + order);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ItemProtocol {
|
||||
public static String item_full_ready_req_agv = "full_ready_req_agv"; //满箱位就绪,请求AGV
|
||||
public static String item_full_out = "full_out"; //满箱已运出满箱位
|
||||
public static String item_device_prepare = "device_prepare"; //专机准备中
|
||||
public static String item_device_ready = "device_prepare"; //专机就绪
|
||||
public static String item_device_ready = "device_ready"; //专机就绪
|
||||
public static String item_line_ready = "line_ready"; //线体就绪
|
||||
|
||||
|
||||
@@ -86,11 +86,17 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_error);
|
||||
}
|
||||
|
||||
public int getRunning() { return this.getOpcIntegerValue(item_running);}
|
||||
public int getRunning() {
|
||||
return this.getOpcIntegerValue(item_running);
|
||||
}
|
||||
|
||||
public int getAllReady() { return this.getOpcIntegerValue(item_all_ready);}
|
||||
public int getAllReady() {
|
||||
return this.getOpcIntegerValue(item_all_ready);
|
||||
}
|
||||
|
||||
public int getOrder() { return this.getOpcIntegerValue(item_order);}
|
||||
public int getOrder() {
|
||||
return this.getOpcIntegerValue(item_order);
|
||||
}
|
||||
|
||||
public int getTask() {
|
||||
return this.getOpcIntegerValue(item_task);
|
||||
@@ -213,15 +219,23 @@ 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_mode, "手自动状态", "DB1.B1.7", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(item_is_open, "线体是否启动", "DB1.B0.1"));
|
||||
list.add(new ItemDto(item_device_is_running, "专机运行状态", "DB1.B0.3"));
|
||||
list.add(new ItemDto(item_empty_is_lack, "空箱位缺箱", "DB1.B0.5"));
|
||||
list.add(new ItemDto(item_running, "是否运行", "DB1.B0.6"));
|
||||
list.add(new ItemDto(item_empty_is_finish, "空位完成", "DB1.B0.7"));
|
||||
list.add(new ItemDto(item_full_out, "满箱已运出满箱位", "DB1.B1.1"));
|
||||
list.add(new ItemDto(item_finish, "订单完成", "DB1.B1.2"));
|
||||
list.add(new ItemDto(item_device_prepare, "专机准备中", "DB1.B1.3"));
|
||||
list.add(new ItemDto(item_device_ready, "专机就绪", "DB1.B1.4"));
|
||||
list.add(new ItemDto(item_line_ready, "线体就绪", "DB1.B1.5"));
|
||||
list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B1.6"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.W4"));
|
||||
list.add(new ItemDto(item_mode, "手自动状态", "DB1.B1.7", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(item_order_compel_finish, "订单强制完成", "DB1.B2.0"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.W4"));
|
||||
list.add(new ItemDto(item_now_order_prod_num, "当前生产总量", "DB1.D84"));
|
||||
list.add(new ItemDto(item_now_one_box_num, "每框箱数量", "DB1.D99"));
|
||||
list.add(new ItemDto(item_now_one_box_num, "每框箱数量", "DB1.D88"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D92"));
|
||||
list.add(new ItemDto(item_full_number, "出料口满框数量", "DB1.D96"));
|
||||
list.add(new ItemDto(item_storage_stock_num, "储料仓库存数量", "DB1.D100"));
|
||||
list.add(new ItemDto(item_line_stock_num, "线体库存数量", "DB1.D104"));
|
||||
@@ -229,15 +243,7 @@ public class ItemProtocol {
|
||||
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_order_prod_allnum, "订单生产总量", "DB1.D120"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D22"));
|
||||
list.add(new ItemDto(item_empty_is_lack, "空箱位缺箱", "DB1.B0.5"));
|
||||
list.add(new ItemDto(item_device_is_running, "专机运行状态", "DB1.B0.3"));
|
||||
list.add(new ItemDto(item_empty_is_finish, "空位完成", "DB1.B0.7"));
|
||||
list.add(new ItemDto(item_full_ready_req_agv, "满箱位就绪,请求AGV", "DB1.B1.0"));
|
||||
list.add(new ItemDto(item_full_out, "满箱已运出满箱位", "DB1.B1.1"));
|
||||
list.add(new ItemDto(item_device_prepare, "专机准备中", "DB1.B1.3"));
|
||||
list.add(new ItemDto(item_device_ready, "专机就绪", "DB1.B1.4"));
|
||||
list.add(new ItemDto(item_line_ready, "线体就绪", "DB1.B1.5"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB1.D160"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_finish, "是否完成", "DB1.B0.7"));
|
||||
list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B1.6"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.W4"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D22"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D92"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB1.D160"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_finish, "是否完成", "DB1.B0.7"));
|
||||
list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B1.6"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.W4"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D22"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D92"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB1.D160"));
|
||||
list.add(new ItemDto(item_full_number, "出料口满框数量", "DB1.D96"));
|
||||
return list;
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_status, "手自动状态", "DB1.B0.0", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(item_finish, "是否完成", "DB1.B0.7"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.W4"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D22"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D92"));
|
||||
list.add(new ItemDto(item_full_number, "出料口满框数量", "DB1.D96"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB1.D160"));
|
||||
return list;
|
||||
|
||||
@@ -94,7 +94,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_full_number, "出料口满框数量", "DB1.D96"));
|
||||
list.add(new ItemDto(item_storage_stock_num, "储料仓库存数量", "DB1.D100"));
|
||||
list.add(new ItemDto(item_line_stock_num, "线体库存数量", "DB1.D104"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D22"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D92"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB1.D160"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -663,7 +663,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
}
|
||||
//强制完成
|
||||
if (type.equals("3")){
|
||||
hailiangSpecialDeviceDriver.writing("to_order_compel_finished","1");
|
||||
obj.setOrder_status("3");
|
||||
obj.setUpdate_by("mes");
|
||||
obj.setUpdate_time(DateUtil.now());
|
||||
@@ -674,8 +673,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
|
||||
//强制完成
|
||||
if (type.equals("3")){
|
||||
hailiangPackerStationDeviceDriver.writing("to_order_compel_finished","1");
|
||||
obj.setOrder_status("3");
|
||||
obj.setOrder_status("3");
|
||||
obj.setUpdate_by("mes");
|
||||
produceshiftorderService.update(obj);
|
||||
@@ -693,7 +690,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
}
|
||||
//强制完成
|
||||
if (type.equals("3")){
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished","1");
|
||||
obj.setOrder_status("3");
|
||||
obj.setUpdate_by("mes");
|
||||
obj.setUpdate_time(DateUtil.now());
|
||||
|
||||
@@ -160,11 +160,11 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
}
|
||||
dto.setOne_qty(BigDecimal.valueOf((Long.parseLong(extra_value))));
|
||||
hailiangSpecialDeviceDriver.writing("to_clear", "1");
|
||||
hailiangSpecialDeviceDriver.writing("to_pause", "0");
|
||||
hailiangSpecialDeviceDriver.writing("to_order", dto.getOrder_code());
|
||||
hailiangSpecialDeviceDriver.writing("to_one_box_num", extra_value);
|
||||
hailiangSpecialDeviceDriver.writing("to_order_prod_num", dto.getQty().toString());
|
||||
hailiangSpecialDeviceDriver.writing("to_out_num", "0");
|
||||
hailiangSpecialDeviceDriver.writing("to_order", dto.getOrder_code());
|
||||
hailiangSpecialDeviceDriver.writing("to_pause", "0");
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) {
|
||||
@@ -180,23 +180,23 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
}
|
||||
dto.setOne_qty(BigDecimal.valueOf((Long.parseLong(extra_value))));
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_clear", "1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order", dto.getOrder_code());
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_one_box_num", extra_value);
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order_prod_num", dto.getQty().toString());
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order", dto.getOrder_code());
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) {
|
||||
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
|
||||
hailiangPackerStationDeviceDriver.writing("to_clear", "1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_order_prod_num", dto.getQty().toString());
|
||||
hailiangPackerStationDeviceDriver.writing("to_order", dto.getOrder_code());
|
||||
hailiangPackerStationDeviceDriver.writing("to_order_prod_num", dto.getQty().toString());
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof HailiangSmartplcTestDeviceDriver) {
|
||||
hailiangSmartplcTestDeviceDriver = (HailiangSmartplcTestDeviceDriver) device.getDeviceDriver();
|
||||
hailiangSmartplcTestDeviceDriver.writing("to_clear", "1");
|
||||
hailiangSmartplcTestDeviceDriver.writing("to_qty", dto.getQty().toString());
|
||||
hailiangSmartplcTestDeviceDriver.writing("to_task", dto.getOrder_code());
|
||||
hailiangSmartplcTestDeviceDriver.writing("to_qty", dto.getQty().toString());
|
||||
hailiangSmartplcTestDeviceDriver.writing("to_material", dto.getMaterial_code());
|
||||
hailiangSmartplcTestDeviceDriver.writing("to_pause", "0");
|
||||
}
|
||||
@@ -230,23 +230,77 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
order.add(dto);
|
||||
}
|
||||
if (StrUtil.equals(dto.getOrder_status(), "3")) {
|
||||
WQLObject wo1 = WQLObject.getWQLObject("acs_deviceisonline");
|
||||
String device_code = dto.getDevice_code();
|
||||
JSONObject jsonObject = wo1.query("device_code = '" + device_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonObject)){
|
||||
jsonObject = new JSONObject();
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("online_id",IdUtil.simpleUUID());
|
||||
map.put("device_code",device_code);
|
||||
map.put("order_code", dto.getOrder_code());
|
||||
map.put("online_status","0");
|
||||
map.put("create_by",currentUsername);
|
||||
map.put("create_time",now);
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver;
|
||||
HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver;
|
||||
HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver) {
|
||||
hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangSpecialDeviceDriver.getStatus_type() == 1){
|
||||
if (ObjectUtil.isEmpty(jsonObject)){
|
||||
wo1.insert(map);
|
||||
} else {
|
||||
jsonObject.put("online_status","0");
|
||||
jsonObject.put("order_code",dto.getOrder_code());
|
||||
jsonObject.put("update_by",currentUsername);
|
||||
jsonObject.put("update_time",now);
|
||||
wo1.update(jsonObject);
|
||||
}
|
||||
}else {
|
||||
hailiangSpecialDeviceDriver.writing("to_order_compel_finished","1");
|
||||
hailiangSpecialDeviceDriver.writing("to_confirm_finished", "1");
|
||||
hailiangSpecialDeviceDriver.writing("to_order", "0");
|
||||
hailiangSpecialDeviceDriver.writing("to_clear", "1");
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) {
|
||||
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangPackerStationDeviceDriver.getStatus_type() == 1){
|
||||
if (ObjectUtil.isEmpty(jsonObject)){
|
||||
wo1.insert(map);
|
||||
} else {
|
||||
jsonObject.put("online_status","0");
|
||||
jsonObject.put("order_code",dto.getOrder_code());
|
||||
jsonObject.put("update_by",currentUsername);
|
||||
jsonObject.put("update_time",now);
|
||||
wo1.update(jsonObject);
|
||||
}
|
||||
}else {
|
||||
hailiangPackerStationDeviceDriver.writing("to_order_compel_finished","1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_confirm_finished", "1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_order", "0");
|
||||
hailiangPackerStationDeviceDriver.writing("to_clear", "1");
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) {
|
||||
hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangEngravingMachineDeviceDriver.getStatus_type() == 1){
|
||||
if (ObjectUtil.isEmpty(jsonObject)){
|
||||
wo1.insert(map);
|
||||
} else {
|
||||
jsonObject.put("online_status","0");
|
||||
jsonObject.put("order_code",dto.getOrder_code());
|
||||
jsonObject.put("update_by",currentUsername);
|
||||
jsonObject.put("update_time",now);
|
||||
wo1.update(jsonObject);
|
||||
}
|
||||
}else {
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished","1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_confirm_finished", "1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order", "0");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_clear", "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -319,46 +373,103 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishd(JSONObject param) {
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_deviceisonline");
|
||||
param = param.getJSONObject("data");
|
||||
String now = DateUtil.now();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String order_id = param.getString("order_id");
|
||||
String ext_order_id = param.getString("ext_order_id");
|
||||
String device_code = param.getString("device_code");
|
||||
String order_code = param.getString("order_code");
|
||||
if (StrUtil.isNotEmpty(ext_order_id)) {
|
||||
// TODO
|
||||
param.put("status", "3");
|
||||
param.put("type", "2");
|
||||
acsToWmsService.feedbackOrderStatus(param);
|
||||
}
|
||||
Device device = deviceAppService.findDeviceByCode(param.getString("device_code"));
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver;
|
||||
HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver;
|
||||
HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver;
|
||||
JSONObject jsonObject = wo.query("device_code = '" + device_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonObject)){
|
||||
jsonObject = new JSONObject();
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("online_id",IdUtil.simpleUUID());
|
||||
map.put("device_code",device_code);
|
||||
map.put("order_code",order_code);
|
||||
map.put("online_status","0");
|
||||
map.put("create_by",currentUsername);
|
||||
map.put("create_time",now);
|
||||
if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver) {
|
||||
hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangSpecialDeviceDriver.getStatus_type() == 1) {
|
||||
if (ObjectUtil.isEmpty(jsonObject)){
|
||||
wo.insert(map);
|
||||
} else {
|
||||
jsonObject.put("online_status","0");
|
||||
jsonObject.put("order_code",order_code);
|
||||
jsonObject.put("update_by",currentUsername);
|
||||
jsonObject.put("update_time",now);
|
||||
wo.update(jsonObject);
|
||||
}
|
||||
} else {
|
||||
hailiangSpecialDeviceDriver.writing("to_order_compel_finished", "1");
|
||||
hailiangSpecialDeviceDriver.writing("to_confirm_finished", "1");
|
||||
hailiangSpecialDeviceDriver.writing("to_order", "0");
|
||||
hailiangSpecialDeviceDriver.writing("to_clear", "1");
|
||||
}
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) {
|
||||
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangPackerStationDeviceDriver.getStatus_type() == 1) {
|
||||
if (ObjectUtil.isEmpty(jsonObject)){
|
||||
wo.insert(map);
|
||||
} else {
|
||||
jsonObject.put("online_status","0");
|
||||
jsonObject.put("order_code",order_code);
|
||||
jsonObject.put("update_by",currentUsername);
|
||||
jsonObject.put("update_time",now);
|
||||
wo.update(jsonObject);
|
||||
}
|
||||
} else {
|
||||
hailiangPackerStationDeviceDriver.writing("to_order_compel_finished", "1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_confirm_finished", "1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_order", "0");
|
||||
hailiangPackerStationDeviceDriver.writing("to_clear", "1");
|
||||
}
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) {
|
||||
hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangEngravingMachineDeviceDriver.getStatus_type() == 1){
|
||||
if (ObjectUtil.isEmpty(jsonObject)){
|
||||
wo.insert(map);
|
||||
} else {
|
||||
jsonObject.put("online_status","0");
|
||||
jsonObject.put("order_code",order_code);
|
||||
jsonObject.put("update_by",currentUsername);
|
||||
jsonObject.put("update_time",now);
|
||||
wo.update(jsonObject);
|
||||
}
|
||||
} else {
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished", "1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_confirm_finished", "1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order", "0");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_clear", "1");
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("order_id", order_id);
|
||||
map.put("order_status", "3");
|
||||
map.put("update_by", SecurityUtils.getNickName());
|
||||
map.put("update_time", now);
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
|
||||
wo.update(map);
|
||||
}
|
||||
JSONObject map1 = new JSONObject();
|
||||
map1.put("order_id", order_id);
|
||||
map1.put("order_status", "3");
|
||||
map1.put("update_by", SecurityUtils.getNickName());
|
||||
map1.put("update_time", now);
|
||||
WQLObject wo1 = WQLObject.getWQLObject("acs_produceshiftorder");
|
||||
wo1.update(map1);
|
||||
Iterator<ProduceshiftorderDto> iterator = order.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ProduceshiftorderDto instruction = iterator.next();
|
||||
if (instruction.getOrder_code().equals(param.getString("order_code"))) {
|
||||
if (instruction.getOrder_code().equals(order_code)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,103 @@
|
||||
package org.nl.modules.quartz.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_device.HailiangSpecialDeviceDriver;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* 自动查询强制完成时,设备处于关机状态下的
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoUpdateDeviceOnline {
|
||||
|
||||
private final DeviceAppService deviceAppService;
|
||||
|
||||
public void run() throws Exception {
|
||||
try {
|
||||
//海亮专机
|
||||
HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver;
|
||||
//刻字机
|
||||
HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver;
|
||||
//包装机
|
||||
HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver;
|
||||
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_deviceisonline");
|
||||
JSONArray jsonArray = wo.query("online_status = '0'").getResultJSONArray(0);
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String deviceCode = jsonObject.getString("device_code");
|
||||
Device device = deviceAppService.findDeviceByCode(deviceCode);
|
||||
String order_code = wo.query("device_code = '" + deviceCode + "'").uniqueResult(0).getString("order_code");
|
||||
if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver) {
|
||||
hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangSpecialDeviceDriver.getStatus_type() != 1) {
|
||||
String order = String.valueOf(hailiangSpecialDeviceDriver.getOrder());
|
||||
if (order.equals(order_code)) {
|
||||
hailiangSpecialDeviceDriver.writing("to_order_compel_finished", "1");
|
||||
hailiangSpecialDeviceDriver.writing("to_confirm_finished", "1");
|
||||
hailiangSpecialDeviceDriver.writing("to_order", "0");
|
||||
hailiangSpecialDeviceDriver.writing("to_clear", "1");
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("update_time",now);
|
||||
map.put("online_status", "1");
|
||||
wo.update(map, "device_code = '" + deviceCode + "' and online_status = '0'");
|
||||
System.out.println("设备:" + deviceCode + ",工单:" + order + " 复位成功!");
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) {
|
||||
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangPackerStationDeviceDriver.getStatus_type() != 1) {
|
||||
String order = String.valueOf(hailiangPackerStationDeviceDriver.getOrder());
|
||||
if (order.equals(order_code)) {
|
||||
hailiangPackerStationDeviceDriver.writing("to_order_compel_finished", "1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_confirm_finished", "1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_order", "0");
|
||||
hailiangPackerStationDeviceDriver.writing("to_clear", "1");
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("update_time",now);
|
||||
map.put("online_status", "1");
|
||||
wo.update(map, "device_code = '" + deviceCode + "' and online_status = '0'");
|
||||
System.out.println("设备:" + deviceCode + ",工单:" + order + " 复位成功!");
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) {
|
||||
hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangEngravingMachineDeviceDriver.getStatus_type() != 1) {
|
||||
String order = String.valueOf(hailiangEngravingMachineDeviceDriver.getOrder());
|
||||
if (order.equals(order_code)) {
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished", "1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_confirm_finished", "1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order", "0");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_clear", "1");
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("update_time",now);
|
||||
map.put("online_status", "1");
|
||||
wo.update(map, "device_code = '" + deviceCode + "' and online_status = '0'");
|
||||
System.out.println("设备:" + deviceCode + ",工单:" + order + " 复位成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,19 +46,14 @@ public class Test3 extends BaseTest {
|
||||
|
||||
String now = DateUtil.now();
|
||||
WQLObject tab= WQLObject.getWQLObject("acs_opc");
|
||||
for (int i = 5; i < 29; i++) {
|
||||
for (int i = 3; i <= 6; i++) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("opc_id",IdUtil.simpleUUID());
|
||||
if (i < 10){
|
||||
map.put("opc_code","TW0"+i);
|
||||
map.put("opc_name","TW0"+i);
|
||||
} else {
|
||||
map.put("opc_code","TW"+i);
|
||||
map.put("opc_name","TW"+i);
|
||||
}
|
||||
map.put("opc_host","127.0.0.1");
|
||||
map.put("opc_code","TW5"+i);
|
||||
map.put("opc_name","TW5"+i);
|
||||
map.put("opc_host","192.168.46.225");
|
||||
map.put("user","administrator");
|
||||
map.put("password","damien");
|
||||
map.put("password","nl123");
|
||||
map.put("prog_id","Kepware.KEPServerEX.V6");
|
||||
map.put("remark","Kepware.KEPServerEX.V6");
|
||||
map.put("cls_id","7bc0cc8e-482c-47ca-abdc-0fe7f9c6e729");
|
||||
|
||||
@@ -94,7 +94,12 @@
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="规格型号" />
|
||||
<el-table-column prop="one_qty" label="每箱接料数量" />
|
||||
<el-table-column prop="is_needmove" label="是否AGV搬运" />
|
||||
<el-table-column prop="is_needmove" label="是否AGV搬运">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.is_needmove=='1' ">搬运</span>
|
||||
<span v-else>不搬运</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_by" label="创建者" />
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="150" show-overflow-tooltip />
|
||||
</el-table>
|
||||
|
||||
Reference in New Issue
Block a user