rev:优化
This commit is contained in:
@@ -109,7 +109,7 @@ public class AgvController {
|
||||
|
||||
@PostMapping ("/inBlockGroup")
|
||||
@Log("请求进入")
|
||||
@ApiOperation("请求离开")
|
||||
@ApiOperation("请求进入")
|
||||
public ResponseEntity<JSONObject> inBlockGroup(@RequestBody JSONObject requestParam) {
|
||||
return new ResponseEntity<>(agvService.inBlockGroup(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -215,4 +215,23 @@ public interface AgvService {
|
||||
* @return
|
||||
*/
|
||||
JSONObject outBlockGroup(JSONObject requestParam);
|
||||
|
||||
|
||||
/**
|
||||
* 仙工AGV暂停
|
||||
*
|
||||
* @param requestParam
|
||||
* @return
|
||||
*/
|
||||
HttpResponse gotoSitePause(JSONObject requestParam);
|
||||
|
||||
/**
|
||||
* 仙工AGV恢复
|
||||
*
|
||||
* @param requestParam
|
||||
* @return
|
||||
*/
|
||||
HttpResponse gotoSiteResume(JSONObject requestParam);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONArray;
|
||||
@@ -2172,6 +2173,48 @@ public class AgvServiceImpl implements AgvService {
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse gotoSitePause(JSONObject requestParam) {
|
||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) {
|
||||
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
|
||||
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT);
|
||||
|
||||
agvurl = agvurl + ":" + agvport + "/gotoSitePause";
|
||||
log.info("暂停{} agv请求:{}", requestParam, agvurl);
|
||||
|
||||
HttpResponse result = HttpRequest.post(agvurl)
|
||||
.body(JSON.toJSONString(requestParam))
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute();
|
||||
log.info("暂停{} agv请求反馈:{}", requestParam, result);
|
||||
|
||||
return result;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse gotoSiteResume(JSONObject requestParam) {
|
||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) {
|
||||
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
|
||||
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT);
|
||||
|
||||
agvurl = agvurl + ":" + agvport + "/gotoSiteResume";
|
||||
log.info("恢复{} agv请求:{}", requestParam, agvurl);
|
||||
|
||||
HttpResponse result = HttpRequest.post(agvurl)
|
||||
.body(JSON.toJSONString(requestParam))
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute();
|
||||
log.info("恢复{} agv请求反馈:{}", result, result);
|
||||
|
||||
return result;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String hexToString(int i) {
|
||||
return (i < 16 ? "0" + Integer.toHexString(i) : Integer.toHexString(i)).toUpperCase();
|
||||
|
||||
@@ -26,4 +26,21 @@ public class XGToAcsController {
|
||||
public ResponseEntity<JSONObject> xgAGVQueryWlsStatus(@RequestBody JSONObject requestParam) {
|
||||
return new ResponseEntity<>(XGToAcsService.xgAGVQueryWlsStatus(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping ("/api/agv/start")
|
||||
@Log("恢复AGV")
|
||||
@ApiOperation("恢复AGV")
|
||||
public ResponseEntity<JSONObject> start(@RequestBody JSONObject requestParam) {
|
||||
XGToAcsService.start(requestParam);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping ("/api/agv/stop")
|
||||
@Log("暂停AGV")
|
||||
@ApiOperation("暂停AGV")
|
||||
public ResponseEntity<JSONObject> stop(@RequestBody JSONObject requestParam) {
|
||||
XGToAcsService.stop(requestParam);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,8 @@ public interface XGToAcsService {
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
public JSONObject xgAGVQueryWlsStatus(JSONObject from);
|
||||
|
||||
void start(JSONObject requestParam);
|
||||
|
||||
void stop(JSONObject requestParam);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package org.nl.acs.ext.wms.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.nl.acs.agv.server.AgvService;
|
||||
import org.nl.acs.config.server.AcsConfigService;
|
||||
import org.nl.acs.device.address.service.AddressService;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.ext.wms.service.XGToAcsService;
|
||||
import org.nl.acs.log.service.LogServer;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -28,6 +31,10 @@ public class XGToAcsImpl implements XGToAcsService {
|
||||
|
||||
@Autowired
|
||||
AcsToWmsService acsToWmsService;
|
||||
|
||||
@Autowired
|
||||
private AgvService agvService;
|
||||
|
||||
@Override
|
||||
public JSONObject xgAGVQueryWlsStatus(JSONObject from) {
|
||||
JSONArray datas = JSONArray.fromObject(from);
|
||||
@@ -51,5 +58,17 @@ public class XGToAcsImpl implements XGToAcsService {
|
||||
log.info("updateDeviceGoodsFromWms--------------:输出参数" + resultJson.toString());
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(JSONObject requestParam) {
|
||||
requestParam.put("vehicles", new JSONArray());
|
||||
agvService.gotoSiteResume(requestParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(JSONObject requestParam) {
|
||||
requestParam.put("vehicles", new JSONArray());
|
||||
agvService.gotoSitePause(requestParam);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ spring:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:tg_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3307}/${DB_NAME:yq_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:mysql}
|
||||
password: ${DB_PWD:123456}
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
|
||||
@@ -18,6 +18,12 @@ export const constantRouterMap = [
|
||||
hidden: true,
|
||||
meta: { title: '呼叫看板' }
|
||||
},
|
||||
{
|
||||
path: '/bigscreen/agvControler',
|
||||
component: (resolve) => require(['@/views/bigscreen/agvControler'], resolve),
|
||||
hidden: true,
|
||||
meta: { title: 'AGV控制', requiresAuth: false }
|
||||
},
|
||||
{
|
||||
path: '/bigscreen/request',
|
||||
component: (resolve) => require(['@/views/bigscreen/request'], resolve),
|
||||
|
||||
19
qd/src/views/bigscreen/agv.js
Normal file
19
qd/src/views/bigscreen/agv.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function start(data) {
|
||||
return request({
|
||||
url: '/api/agv/start',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function stop(data) {
|
||||
return request({
|
||||
url: '/api/agv/stop',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { start, stop }
|
||||
72
qd/src/views/bigscreen/agvControler.vue
Normal file
72
qd/src/views/bigscreen/agvControler.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<div style="border: 1px solid #938d8d;margin-left: 10px;margin-right: 10px;">
|
||||
<el-row
|
||||
style="border: 1px solid chartreuse;margin-left: 10px;margin-right: 10px;margin-bottom: 10px;margin-top: 20px;min-height: 600px; display: flex; align-items: center; justify-content: center;"
|
||||
>
|
||||
<form id="myForm" name="testForm">
|
||||
<el-row :gutter="5" type="flex" justify="center" align="middle">
|
||||
<el-col :span="24" style="text-align: center;">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
style="width: 400px; height: 200px; font-size: 100px; margin-right: 100px;"
|
||||
@click="pauseOperation"
|
||||
>
|
||||
暂停
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
style="width: 400px; height: 200px; font-size: 100px;"
|
||||
@click="resumeOperation"
|
||||
>
|
||||
恢复
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</form>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudAgv from './agv'
|
||||
import CRUD from '@crud/crud'
|
||||
|
||||
export default {
|
||||
mixins: [],
|
||||
data() {
|
||||
return {
|
||||
currentDate: new Date(),
|
||||
getTime: '',
|
||||
getDate: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pauseOperation() {
|
||||
crudAgv.stop({}).then(res => {
|
||||
this.$message({
|
||||
message: '暂停成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
},
|
||||
resumeOperation() {
|
||||
crudAgv.start({}).then(res => {
|
||||
this.$message({
|
||||
message: '恢复成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user