This commit is contained in:
2023-08-21 15:24:24 +08:00
14 changed files with 261 additions and 222 deletions

View File

@@ -447,7 +447,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", this.device_code); param.put("device_code", this.device_code);
param.put("error", error); param.put("error", error);
param.put("error_msg", this.getError_message()); param.put("error_msg", error == 0 ? "" : this.getError_message());
param.put("device_name", this.getDevice().getDevice_name()); param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4"); param.put("device_type", "4");
param.put("product_area", paramService.findByCode("productArea").getValue()); param.put("product_area", paramService.findByCode("productArea").getValue());

View File

@@ -690,7 +690,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", this.device_code); param.put("device_code", this.device_code);
param.put("error", error); param.put("error", error);
param.put("error_msg", this.getError_message()); param.put("error_msg", error == 0 ? "" : this.getError_message());
param.put("device_name", this.getDevice().getDevice_name()); param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4"); param.put("device_type", "4");
param.put("product_area", ParamService.findByCode("productArea").getValue()); param.put("product_area", ParamService.findByCode("productArea").getValue());

View File

@@ -118,11 +118,11 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
} }
public void setIserror(Boolean iserror) { public void setIserror(Boolean iserror) {
this.iserror = iserror; this.iserror = iserror;
if (this.iserror != this.last_iserror && this.iserror && device_id.startsWith("RGV")) { if (this.iserror != this.last_iserror && device_id.startsWith("RGV")) {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", this.device_id); param.put("device_code", this.device_id);
param.put("error", alarm); param.put("error", alarm);
param.put("error_msg", ErrorUtil.getDictDetail("ssx_error_type", alarm)); param.put("error_msg", iserror ? ErrorUtil.getDictDetail("ssx_error_type", alarm) : "");
param.put("device_name", this.getDevice().getDevice_name()); param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "3"); param.put("device_type", "3");
param.put("product_area", paramService.findByCode("productArea").getValue()); param.put("product_area", paramService.findByCode("productArea").getValue());

View File

@@ -222,16 +222,17 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
String errorInfo = ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(error)); String errorInfo = ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(error));
dto.setError_info(errorInfo); dto.setError_info(errorInfo);
deviceErrorLogService.create(dto); deviceErrorLogService.create(dto);
}
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", this.device_code); param.put("device_code", this.device_code);
param.put("error", error); param.put("error", error);
param.put("error_msg", errorInfo); param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name()); param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2"); param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue()); param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param); acsToWmsService.sendDeviceStatus(param);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }

View File

@@ -272,18 +272,19 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)); String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
dto.setError_info(errorInfo); dto.setError_info(errorInfo);
deviceErrorLogService.create(dto); deviceErrorLogService.create(dto);
}
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) { if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", this.device_code); param.put("device_code", this.device_code);
param.put("error", error); param.put("error", error);
param.put("error_msg", errorInfo); param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name()); param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1"); param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue()); param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param); acsToWmsService.sendDeviceStatus(param);
} }
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }

View File

@@ -228,16 +228,17 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)); String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
dto.setError_info(errorInfo); dto.setError_info(errorInfo);
deviceErrorLogService.create(dto); deviceErrorLogService.create(dto);
}
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", this.device_code); param.put("device_code", this.device_code);
param.put("error", error); param.put("error", error);
param.put("error_msg", errorInfo); param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name()); param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1"); param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue()); param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param); acsToWmsService.sendDeviceStatus(param);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }

View File

@@ -206,16 +206,17 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)); String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
dto.setError_info(errorInfo); dto.setError_info(errorInfo);
deviceErrorLogService.create(dto); deviceErrorLogService.create(dto);
}
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", this.device_code); param.put("device_code", this.device_code);
param.put("error", error); param.put("error", error);
param.put("error_msg", errorInfo); param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name()); param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1"); param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue()); param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param); acsToWmsService.sendDeviceStatus(param);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog( logServer.deviceExecuteLog(
this.device_code, "", "", "信号error" + last_error + "->" + error); this.device_code, "", "", "信号error" + last_error + "->" + error);

View File

@@ -187,17 +187,17 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)); String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
dto.setError_info(errorInfo); dto.setError_info(errorInfo);
deviceErrorLogService.create(dto); deviceErrorLogService.create(dto);
}
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", this.device_code); param.put("device_code", this.device_code);
param.put("error", error); param.put("error", error);
param.put("error_msg", errorInfo); param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name()); param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1"); param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue()); param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param); acsToWmsService.sendDeviceStatus(param);
} }
}
} catch (Exception var17) { } catch (Exception var17) {
var17.printStackTrace(); var17.printStackTrace();
inst_message = var17.getMessage(); inst_message = var17.getMessage();

View File

@@ -266,16 +266,17 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
String errorInfo = ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(error)); String errorInfo = ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(error));
dto.setError_info(errorInfo); dto.setError_info(errorInfo);
deviceErrorLogService.create(dto); deviceErrorLogService.create(dto);
}
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", this.device_code); param.put("device_code", this.device_code);
param.put("error", error); param.put("error", error);
param.put("error_msg", errorInfo); param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name()); param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2"); param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue()); param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param); acsToWmsService.sendDeviceStatus(param);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }

View File

@@ -1,5 +1,7 @@
// 适配 Nginx 反向代理 // 适配 Nginx 反向代理
const baseUrl = process.env.VUE_APP_BASE_API === '/' ? '' : process.env.VUE_APP_BASE_API const baseUrl = window.g.prod.VUE_APP_BASE_API === '/' ? '' : window.g.prod.VUE_APP_BASE_API
// window.g.prod.VUE_APP_BASE_API
const baseImageUrl = window.g.prod.VUE_APP_BASE_API
const api = { const api = {
state: { state: {

View File

@@ -340,6 +340,19 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
b、没有则优先找空的巷道按空位置顺序分配 b、没有则优先找空的巷道按空位置顺序分配
3、任务下发判断巷道的任务类型只能为空盘入库或者无任务类型 3、任务下发判断巷道的任务类型只能为空盘入库或者无任务类型
* */ * */
// 查询此点位是否有正在进行的任务,如果有则不生成任务
JSONObject jsonTask = WQLObject.getWQLObject("sch_base_task")
.query("point_code2 = '" + device_code + "' and is_delete = '0' and task_status <> '07'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonTask)) {
result.put("status", HttpStatus.OK.value());
result.put("message", "此点位已生成任务,请等待任务结束!");
log.info("apply返回参数---------------------------------------------" + result.toString());
return result;
}
JSONArray empArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "22").process().getResultJSONArray(0); JSONArray empArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "22").process().getResultJSONArray(0);
JSONObject struct_jo = new JSONObject(); JSONObject struct_jo = new JSONObject();

View File

@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
@@ -29,11 +30,14 @@ import org.nl.wms.sch.tasks.InTask;
import org.nl.wms.st.inbill.service.RawAssistIStorService; import org.nl.wms.st.inbill.service.RawAssistIStorService;
import org.nl.wms.st.inbill.service.StorPublicService; import org.nl.wms.st.inbill.service.StorPublicService;
import org.nl.wms.st.inbill.service.impl.InbillServiceImpl; import org.nl.wms.st.inbill.service.impl.InbillServiceImpl;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.concurrent.TimeUnit;
/** /**
* @author zhouz * @author zhouz
@@ -53,6 +57,8 @@ public class ProductInstorServiceImpl implements ProductInstorService {
private final CutConveyorTask cutConveyorTask; private final CutConveyorTask cutConveyorTask;
private final RedissonClient redissonClient;
@Override @Override
public JSONObject boxQuery(JSONObject whereJson) { public JSONObject boxQuery(JSONObject whereJson) {
String box_no = whereJson.getString("box_no"); String box_no = whereJson.getString("box_no");
@@ -91,6 +97,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@SneakyThrows
public JSONObject confirm(JSONObject whereJson) { public JSONObject confirm(JSONObject whereJson) {
String box_no = whereJson.getString("box_no"); String box_no = whereJson.getString("box_no");
//1-报废入库2-生产入库3-退货入库4-拆分入库 //1-报废入库2-生产入库3-退货入库4-拆分入库
@@ -117,6 +124,11 @@ public class ProductInstorServiceImpl implements ProductInstorService {
JSONObject mst_jo = new JSONObject(); JSONObject mst_jo = new JSONObject();
mst_jo.put("tableData", box_rows); mst_jo.put("tableData", box_rows);
mst_jo.put("biz_date", DateUtil.now()); mst_jo.put("biz_date", DateUtil.now());
RLock lock = redissonClient.getLock("pda_ioIn:" + option);
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
try {
if (tryLock) {
if (option.equals("1")) { if (option.equals("1")) {
mst_jo.put("bill_type", "0003"); mst_jo.put("bill_type", "0003");
} }
@@ -282,6 +294,13 @@ public class ProductInstorServiceImpl implements ProductInstorService {
inbillService.confirmDis(dis_form); inbillService.confirmDis(dis_form);
} }
}
} finally {
if (tryLock) {
lock.unlock();
}
}
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("message", "确认成功!"); jo.put("message", "确认成功!");
return jo; return jo;

View File

@@ -243,7 +243,7 @@ public class InBillQueryServiceImpl implements InBillQueryService {
mp.put("班次", json.getString("classes")); mp.put("班次", json.getString("classes"));
mp.put("库区", json.getString("sect_name")); mp.put("库区", json.getString("sect_name"));
mp.put("客户编码", json.getString("customer_name")); mp.put("客户编码", json.getString("customer_name"));
mp.put("客户订单", json.getString("sale_order_name")); mp.put("销售订单及行", json.getString("sale_order_name"));
mp.put("生产日期", json.getString("date_of_production").replace("-","/")); mp.put("生产日期", json.getString("date_of_production").replace("-","/"));
mp.put("箱号", json.getString("box_no")); mp.put("箱号", json.getString("box_no"));
mp.put("生产批号", (json.getString("confirm_time").substring(0,10)).replace("-","").trim()); mp.put("生产批号", (json.getString("confirm_time").substring(0,10)).replace("-","").trim());

View File

@@ -87,7 +87,7 @@
@change="hand" @change="hand"
/> />
</el-form-item> </el-form-item>
<el-form-item label="入库日期"> <el-form-item label="业务日期">
<el-date-picker <el-date-picker
v-model="query.date_of_FG_inbound" v-model="query.date_of_FG_inbound"
type="date" type="date"
@@ -235,7 +235,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="入库日期"> <el-form-item label="业务日期">
<el-input v-model="form.date_of_fg_inbound" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" /> <el-input v-model="form.date_of_fg_inbound" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -473,8 +473,8 @@
/> />
<el-table-column <el-table-column
prop="date_of_fg_inbound" prop="date_of_fg_inbound"
label="入库日期" label="业务日期"
:min-width="flexWidth('date_of_fg_inbound',crud.data,'入库日期')" :min-width="flexWidth('date_of_fg_inbound',crud.data,'业务日期')"
/> />
<el-table-column prop="status" label="状态" :min-width="flexWidth('status',crud.data,'状态')"> <el-table-column prop="status" label="状态" :min-width="flexWidth('status',crud.data,'状态')">
<template slot-scope="scope"> <template slot-scope="scope">