Browse Source

惠氏更新

master
loujf 2 years ago
parent
commit
7f3bb522ec
  1. 18
      hd/nladmin-system/src/main/java/org/nl/acs/device/rest/DeviceController.java
  2. 11
      hd/nladmin-system/src/main/java/org/nl/acs/device/service/DeviceService.java
  3. 96
      hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java
  4. 30
      hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsDeviceStatus.java
  5. 26
      qd/src/api/acs/device/device.js
  6. 171
      qd/src/views/bigscreen/hs.vue

18
hd/nladmin-system/src/main/java/org/nl/acs/device/rest/DeviceController.java

@ -298,6 +298,15 @@ public class DeviceController {
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PostMapping("/cleans4")
@Log("多选清空区域四设备")
@ApiOperation("多选清空区域四设备")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> cleans4(@RequestBody JSONObject json) {
deviceService.cleans4(json);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PostMapping("/enterSite1")
@Log("人工进出区域一库位")
@ApiOperation("人工进出区域一库位")
@ -316,6 +325,15 @@ public class DeviceController {
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PostMapping("/enterSite3")
@Log("人工进出区域三库位")
@ApiOperation("人工进出区域三库位")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> enterSite3(@RequestBody JSONObject json) {
deviceService.enterSite3(json);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@GetMapping("/selectDriverCodeList/{device_code}")
@Log("下拉选设备驱动")
@ApiOperation("下拉选设备驱动")

11
hd/nladmin-system/src/main/java/org/nl/acs/device/service/DeviceService.java

@ -166,6 +166,13 @@ public interface DeviceService {
*/
JSONArray selectDeviceListThree();
/**
* 查询区域四设备
*
* @return
*/
JSONArray selectDeviceListFour();
/**
* 更新驱动配置信息
*
@ -227,10 +234,14 @@ public interface DeviceService {
void cleans3(JSONObject json);
void cleans4(JSONObject json);
void enterSite1(JSONObject json);
void enterSite2(JSONObject json);
void enterSite3(JSONObject json);
/**
* 根据设备标识查询设备驱动配置,如果未配置过就从驱动配置定义找否则从数据库里面找
*

96
hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java

@ -529,6 +529,42 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
return result;
}
@Override
public JSONArray selectDeviceListFour() {
//设备基础信息表【acs_device】
JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND region = '4'", "seq_num").getResultJSONArray(0);
JSONArray result = new JSONArray();
for (int i = 0; i < arr.size(); i++) {
JSONObject obj = arr.getJSONObject(i);
JSONObject json = new JSONObject();
json.put("device_id", obj.optString("device_id"));
json.put("device_code", obj.optString("device_code"));
json.put("checked", false);
json.put("device_name", obj.optString("device_name"));
Device device = deviceAppService.findDeviceByCode(obj.optString("device_code"));
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
json.put("quantity", standardOrdinarySiteDeviceDriver.getQty());
json.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial());
json.put("remark", standardOrdinarySiteDeviceDriver.getRemark());
json.put("islock",standardOrdinarySiteDeviceDriver.getIslock());
json.put("hasGood",standardOrdinarySiteDeviceDriver.getHasGoods());
}
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
json.put("quantity", standardInspectSiteDeviceDriver.getQty());
json.put("material_type", standardInspectSiteDeviceDriver.getMaterial());
json.put("remark", standardInspectSiteDeviceDriver.getRemark());
json.put("islock",standardInspectSiteDeviceDriver.getIslock());
json.put("hasGood",standardInspectSiteDeviceDriver.getHasGoods());
}
result.add(json);
}
return result;
}
@Override
public JSONArray selectDeviceDevicerInfo(String status) {
@ -1436,6 +1472,41 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
}
}
@Override
public void cleans4(JSONObject json) {
JSONArray array = json.optJSONArray("data");
if (array.size() == 0) {
throw new RuntimeException("请选择库位");
} else {
for (int i = 0; i < array.size(); i++) {
JSONObject arrjo = array.getJSONObject(i);
String device_code = arrjo.get("device_code").toString();
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
Device device = deviceAppService.findDeviceByCode(device_code);
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setHasGoods(0);
standardOrdinarySiteDeviceDriver.setMaterial("");
standardOrdinarySiteDeviceDriver.setQty("");
standardOrdinarySiteDeviceDriver.setRemark("");
JSONObject jsonjo = new JSONObject();
jsonjo.put("device_code", device_code);
jsonjo.put("hasGoodStatus", "0");
changeDeviceStatus(jsonjo);
}
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.setMaterial("");
standardInspectSiteDeviceDriver.setQty("");
standardInspectSiteDeviceDriver.setRemark("");
}
}
}
}
@Override
public void enterSite1(JSONObject json) {
JSONArray array = json.optJSONArray("data");
@ -1486,6 +1557,31 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
}
}
@Override
public void enterSite3(JSONObject json) {
JSONArray array = json.optJSONArray("data");
String islock = json.optString("islock");
for (int i = 0; i < array.size(); i++) {
JSONObject arrjo = array.getJSONObject(i);
String device_code = arrjo.get("device_code").toString();
if (ObjectUtil.isNotEmpty(taskService.findByNextCode(device_code))) {
throw new RuntimeException("当前行的库位有任务!");
}
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
Device device = deviceAppService.findDeviceByCode(device_code);
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setIslock(Boolean.valueOf(islock));
}
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.setIslock(Boolean.valueOf(islock));
}
}
}
@Override
public JSONObject queryDriverConfigByDeviceId(String device_id, String driver_code) {
final JSONObject extraObj = new JSONObject();

30
hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsDeviceStatus.java

@ -38,11 +38,14 @@ public class HsDeviceStatus {
JSONObject json = new JSONObject();
JSONArray device = new JSONArray();
JSONArray device2 = new JSONArray();
JSONArray device3 = new JSONArray();
JSONObject jo = new JSONObject();
Map whereJson1;
Map whereJson2;
Map whereJson3;
JSONArray array1 = deviceService.selectDeviceListOne();
JSONArray array2 = deviceService.selectDeviceListTwo();
JSONArray array3 = deviceService.selectDeviceListFour();
for (int i = 0; i < array1.size(); i++) {
whereJson1 = (Map) array1.get(i);
String device_code = MapUtil.getStr(whereJson1, "device_code");
@ -95,8 +98,35 @@ public class HsDeviceStatus {
}
device2.add(jo);
}
for (int i = 0; i < array3.size(); i++) {
whereJson3 = (Map) array3.get(i);
String device_code = MapUtil.getStr(whereJson3, "device_code");
Device deviceApp = deviceAppService.findDeviceByCode(device_code);
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (deviceApp.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) deviceApp.getDeviceDriver();
jo.put("device_code", device_code);
jo.put("quantity", standardOrdinarySiteDeviceDriver.getQty());
jo.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial());
jo.put("hasGood", standardOrdinarySiteDeviceDriver.getHasGoods());
jo.put("remark", standardOrdinarySiteDeviceDriver.getRemark());
jo.put("islock", standardOrdinarySiteDeviceDriver.getIslock());
}
if (deviceApp.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) deviceApp.getDeviceDriver();
jo.put("device_code", device_code);
jo.put("quantity", standardInspectSiteDeviceDriver.getQty());
jo.put("material_type", standardInspectSiteDeviceDriver.getMaterial());
jo.put("hasGood", standardInspectSiteDeviceDriver.getHasGoods());
jo.put("remark", standardInspectSiteDeviceDriver.getRemark());
jo.put("islock", standardInspectSiteDeviceDriver.getIslock());
}
device3.add(jo);
}
json.put("device", device);
json.put("device2", device2);
json.put("device3", device3);
SocketMsg deviceInfo = new SocketMsg(json, MsgType.INFO);
WebSocketServer.sendInfo(deviceInfo, "hs_data");

26
qd/src/api/acs/device/device.js

@ -64,6 +64,13 @@ export function selectDeviceListThree() {
})
}
export function selectDeviceListFour() {
return request({
url: 'api/device/selectListFour',
method: 'get'
})
}
export function selectDeviceDevicerInfo(status) {
return request({
url: 'api/device/selectDeviceDevicerInfo/' + status,
@ -189,6 +196,14 @@ export function enterSite2(data) {
})
}
export function enterSite3(data) {
return request({
url: 'api/device/enterSite3',
method: 'post',
data
})
}
export function cleans3(data) {
return request({
url: 'api/device/cleans3',
@ -197,6 +212,14 @@ export function cleans3(data) {
})
}
export function cleans4(data) {
return request({
url: 'api/device/cleans4',
method: 'post',
data
})
}
export function selectAGVList() {
return request({
url: 'api/device/selectAGVList',
@ -214,4 +237,5 @@ export function agvTaskType(data) {
export default { add, edit, del, selectDeviceList, selectDeviceListByRegion, callAgv, responseAgv, selectDeviceDevicerInfo, autoCreateTask,
changeDeviceStatus, cleanTask, queryStorageExtra, selectConDeviceList, saveBarcode, selectDeviceListOne, selectDeviceListTwo, selectDeviceListThree,
addMaterial, cleanMaterial, changeFenceStatus,reload, cleans1, cleans2, enterSite1, enterSite2, cleans3, selectAGVList, agvTaskType}
addMaterial, cleanMaterial, changeFenceStatus,reload, cleans1, cleans2, enterSite1, enterSite2, cleans3, selectAGVList, agvTaskType, selectDeviceListFour,
cleans4, enterSite3}

171
qd/src/views/bigscreen/hs.vue

@ -3,7 +3,7 @@
<el-row
style="border: 1px solid chartreuse;margin-left: 10px;margin-right: 10px;margin-bottom: 10px;margin-top: 20px;min-height: 600px"
>
<form id="myForm" name="testForm" style="margin-top: 100px;">
<form id="myForm" name="testForm" style="margin-top: 10px;">
<el-row :gutter="5" type="flex" justify="center" align="middle" style="min-height: 40px">
<el-col :span="10">
<el-button type="primary" @click="enterSite1">进入</el-button>
@ -96,6 +96,52 @@
</div>
</el-col>
</el-row>
<el-row :gutter="5" type="flex" justify="center" align="middle" style="min-height: 40px; margin-top: 50px">
<el-col :span="10">
<el-button type="primary" @click="enterSite3">进入</el-button>
<el-button type="primary" @click="outSite3">离开</el-button>
<el-button type="primary" @click="cleans3">清空货位</el-button>
</el-col>
</el-row>
<el-row :gutter="5" type="flex" align="bottom" justify="center">
<el-col :span="20">
<el-checkbox @change="checkeds3" v-model="resultAll13" class="fla">全选</el-checkbox>
<div v-for="(item,i) in deviceList3">
<div
v-if="item.islock"
style="float: left;margin-right: 5px;width: 120px;height: 120px;background-color: #FEC171;border-radius: 10%;"
>
<el-checkbox v-model="item.checked" style="margin-left: 20px;"/>
<el-button size="mini" round style="margin-left: 18px; margin-block-end: 10px">
{{ '设备:' + item.device_code }}
</el-button>
</div>
<div
v-else-if="item.hasGood != 0"
style="float: left;margin-right: 5px;width: 120px;height: 120px;background-color: rgb(0, 238, 153);border-radius: 10%;"
>
<el-checkbox v-model="item.checked" style="margin-left: 20px;"/>
<el-button size="mini" round style="margin-left: 18px;">
{{ '设备:' + item.device_code }}
</el-button>
<div style="font-size: 8px; margin-left: 10px; margin-block-end: 15px; margin-top: 18px">
{{ '物料类型:' + item.material_type }}
</div>
<div style="font-size: 8px; margin-left: 10px;">{{ '物料数量:' + item.quantity }}</div>
</div>
<div
v-else-if="item.hasGood === 0"
style="float: left;margin-right: 5px;width: 120px;height: 120px;background-color: beige;border-radius: 10%;"
>
<el-checkbox v-model="item.checked" style="margin-left: 20px;"/>
<el-button size="mini" round style="margin-left: 18px;">
{{ '设备:' + item.device_code }}
</el-button>
</div>
</div>
</el-col>
</el-row>
</form>
</el-row>
</div>
@ -114,8 +160,10 @@ export default {
return {
resultAll1: false,
resultAll12: false,
resultAll13: false,
requestDialogVisible: false,
requestDialogVisible2: false,
requestDialogVisible3: false,
responseDialogVisible: false,
region: '',
imgUrl: '站点',
@ -140,6 +188,14 @@ export default {
quantity: 0,
remark: ''
},
form3: {
device_id: '',
device_code: '',
device_name: '',
material_type: '',
quantity: 0,
remark: ''
},
testdata: {
check: null,
device_code: null
@ -147,8 +203,10 @@ export default {
material_types: [],
deviceList: [],
deviceList2: [],
deviceList3: [],
deviceListOne: [],
deviceListTwo: [],
deviceListThree: [],
currentDate: new Date(),
getTime: '',
getDate: ''
@ -176,6 +234,11 @@ export default {
this.deviceListTwo = data
})
})
this.$nextTick(() => {
deviceCrud.selectDeviceListFour().then(data => {
this.deviceListThree = data
})
})
},
methods: {
cleans1() {
@ -225,6 +288,29 @@ export default {
this.resultAll12 = false
})
},
cleans3() {
var obj = this.deviceList3
var arr = []
for (let i = 0; i < obj.length; i++) {
if (obj[i].checked) {
arr.push(obj[i])
}
}
const data = {
'data': arr
}
deviceCrud.cleans4(data).then(res => {
this.$notify({
title: '操作成功',
type: 'success',
duration: 3000
})
for (let i = 0; i < arr.length; i++) {
arr[i].checked = false
}
this.resultAll13 = false
})
},
checkeds(value) {
this.deviceList.forEach((item) => {
item.checked = value
@ -237,6 +323,12 @@ export default {
})
this.$forceUpdate();
},
checkeds3(value) {
this.deviceList3.forEach((item) => {
item.checked = value
})
this.$forceUpdate();
},
enterSite1() {
const data = {
'data': this.deviceList,
@ -289,6 +381,32 @@ export default {
})
})
},
enterSite3() {
const data = {
'data': this.deviceList3,
'islock': 'true'
}
deviceCrud.enterSite3(data).then(res => {
this.$notify({
title: '操作成功',
type: 'success',
duration: 3000
})
})
},
outSite3() {
const data = {
'data': this.deviceList3,
'islock': 'false'
}
deviceCrud.enterSite3(data).then(res => {
this.$notify({
title: '操作成功',
type: 'success',
duration: 3000
})
})
},
saveRequest() {
deviceCrud.addMaterial(this.form).then(res => {
this.$notify({
@ -315,6 +433,19 @@ export default {
console.log(err.response.data.message)
})
},
saveRequest3() {
deviceCrud.addMaterial(this.form3).then(res => {
this.$notify({
title: '操作成功',
type: 'success',
duration: 3000
})
this.requestDialogVisible3 = false
}).catch(err => {
this.requestDialogVisible3 = false
console.log(err.response.data.message)
})
},
// false
[CRUD.HOOK.beforeRefresh]() {
return true
@ -419,6 +550,44 @@ export default {
}
}
}
for (let i = 0; i < data.msg.device3.length; i++) {
const item = data.msg.device3[i]
//
if (that.deviceList3.length != data.msg.device3.length) {
const obj = {
device_code: item.device_code,
hasGood: item.hasGood,
material_type: item.material_type,
quantity: item.quantity,
remark: item.remark,
islock: item.islock,
checked: false
}
that.deviceList3.push(obj)
} else {
for (let j = 0; j < that.deviceList3.length; j++) {
if (that.deviceList3[j].device_code == item.device_code) {
if (that.deviceList3[j].hasGood != item.hasGood) {
that.deviceList3[j].device_code = item.device_code
that.deviceList3[j].hasGood = item.hasGood
}
if (that.deviceList3[j].material_type != item.material_type) {
that.deviceList3[j].material_type = item.material_type
}
if (that.deviceList3[j].quantity != item.quantity) {
that.deviceList3[j].quantity = item.quantity
}
if (that.deviceList3[j].remark != item.remark) {
that.deviceList2[j].remark = item.remark
}
if (that.deviceList3[j].islock != item.islock) {
that.deviceList3[j].islock = item.islock
}
}
}
}
}
}
// socket
this.socket.onerror = function() {

Loading…
Cancel
Save