REV
This commit is contained in:
@@ -771,7 +771,6 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
|||||||
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
|
||||||
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
|
||||||
request.setWeight(String.valueOf(weight));
|
request.setWeight(String.valueOf(weight));
|
||||||
request.setVehicle_code(String.valueOf(barcode));
|
|
||||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||||
message = RequestMethodEnum.getName("apply_put_empty_vehicle") + "apply_put_empty_vehicle 接口请求LMS...";
|
message = RequestMethodEnum.getName("apply_put_empty_vehicle") + "apply_put_empty_vehicle 接口请求LMS...";
|
||||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ import org.nl.acs.route.service.dto.RouteLineDto;
|
|||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||||
|
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||||
import org.nl.modules.system.service.ParamService;
|
import org.nl.modules.system.service.ParamService;
|
||||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
@@ -68,6 +70,7 @@ import java.util.Map;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class WmsToAcsServiceImpl implements WmsToAcsService {
|
public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||||
|
|
||||||
|
private final LuceneExecuteLogService lucene;
|
||||||
private final InstructionService InstructionService;
|
private final InstructionService InstructionService;
|
||||||
private final TaskService TaskService;
|
private final TaskService TaskService;
|
||||||
private final DeviceService DeviceService;
|
private final DeviceService DeviceService;
|
||||||
@@ -85,7 +88,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
CreateTaskRequest tasks = JSON.toJavaObject(req, CreateTaskRequest.class);
|
CreateTaskRequest tasks = JSON.toJavaObject(req, CreateTaskRequest.class);
|
||||||
JSONObject resultJson = new JSONObject();
|
JSONObject resultJson = new JSONObject();
|
||||||
CreateTaskResponse resp = new CreateTaskResponse();
|
CreateTaskResponse resp = new CreateTaskResponse();
|
||||||
log.info("createFromWms - 请求参数 {}", tasks.toString());
|
log.info("createFromWms - 请求参数 {}", JSON.toJSON(resp));
|
||||||
String request_no = tasks.getRequestNo();
|
String request_no = tasks.getRequestNo();
|
||||||
JSONArray errArr = new JSONArray();
|
JSONArray errArr = new JSONArray();
|
||||||
try {
|
try {
|
||||||
@@ -272,6 +275,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
resp.setResponseDate(AgvUtil.getDate());
|
resp.setResponseDate(AgvUtil.getDate());
|
||||||
resp.setMessage("请求成功");
|
resp.setMessage("请求成功");
|
||||||
log.info("createFromWms - 返回参数 {}", JSON.toJSON(resp));
|
log.info("createFromWms - 返回参数 {}", JSON.toJSON(resp));
|
||||||
|
|
||||||
|
// LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
|
// .device_code("LMSTOACS")
|
||||||
|
// .requestparam(JSON.toJSON(resp).toString())
|
||||||
|
// .responseparam(JSON.toJSON(resp).toString())
|
||||||
|
// .status_code(String.valueOf(resp.getCode()))
|
||||||
|
// .method(tasks.getRequest_medthod_code())
|
||||||
|
// .build();
|
||||||
|
// lucene.interfaceExecuteLog(logDto);
|
||||||
return (JSONObject) JSON.toJSON(resp);
|
return (JSONObject) JSON.toJSON(resp);
|
||||||
} finally {
|
} finally {
|
||||||
MDC.remove(log_file_type);
|
MDC.remove(log_file_type);
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ldjun
|
* @author ldjun
|
||||||
@@ -86,7 +87,38 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
this.reload();
|
// this.reload();
|
||||||
|
// HashMap<String, String> map = new HashMap<>();
|
||||||
|
// map.put("flag", "1");
|
||||||
|
// String code = (String) whereJson.get("code");
|
||||||
|
// String vehicle_code = (String) whereJson.get("vehicle_code");
|
||||||
|
// String material_type = (String) whereJson.get("material_type");
|
||||||
|
// String status = (String) whereJson.get("status");
|
||||||
|
// String point_code = (String) whereJson.get("point_code");
|
||||||
|
// String is_over = (String) whereJson.get("is_over");
|
||||||
|
// if (!StrUtil.isEmpty(code)) {
|
||||||
|
// map.put("code", code);
|
||||||
|
// }
|
||||||
|
// if (!StrUtil.isEmpty(vehicle_code)) {
|
||||||
|
// map.put("vehicle_code", vehicle_code);
|
||||||
|
// }
|
||||||
|
// if (!StrUtil.isEmpty(material_type)) {
|
||||||
|
// map.put("material_type", material_type);
|
||||||
|
// }
|
||||||
|
// if (!StrUtil.isEmpty(status)) {
|
||||||
|
// map.put("status", status);
|
||||||
|
// }
|
||||||
|
// if (!StrUtil.isEmpty(point_code)) {
|
||||||
|
// map.put("point_code", point_code);
|
||||||
|
// }
|
||||||
|
// if (!StrUtil.isEmpty(is_over)) {
|
||||||
|
// map.put("is_over", is_over);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// final JSONObject jo = WQL.getWO("QINST_QUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "");
|
||||||
|
// return jo;
|
||||||
|
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("flag", "1");
|
map.put("flag", "1");
|
||||||
String code = (String) whereJson.get("code");
|
String code = (String) whereJson.get("code");
|
||||||
@@ -95,6 +127,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
String status = (String) whereJson.get("status");
|
String status = (String) whereJson.get("status");
|
||||||
String point_code = (String) whereJson.get("point_code");
|
String point_code = (String) whereJson.get("point_code");
|
||||||
String is_over = (String) whereJson.get("is_over");
|
String is_over = (String) whereJson.get("is_over");
|
||||||
|
String instruction_type = (String) whereJson.get("instruction_type");
|
||||||
if (!StrUtil.isEmpty(code)) {
|
if (!StrUtil.isEmpty(code)) {
|
||||||
map.put("code", code);
|
map.put("code", code);
|
||||||
}
|
}
|
||||||
@@ -110,13 +143,24 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
if (!StrUtil.isEmpty(point_code)) {
|
if (!StrUtil.isEmpty(point_code)) {
|
||||||
map.put("point_code", point_code);
|
map.put("point_code", point_code);
|
||||||
}
|
}
|
||||||
if (!StrUtil.isEmpty(is_over)) {
|
map.put("instruction_type", instruction_type);
|
||||||
map.put("is_over", is_over);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Integer currentPageNumber = page.getPageNumber() + 1;
|
||||||
final JSONObject jo = WQL.getWO("QINST_QUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "");
|
Integer pageMaxSize = page.getPageSize();
|
||||||
|
final JSONObject jo =
|
||||||
|
WQL.getWO("QINST_QUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "");
|
||||||
|
JSONArray jsonArray = jo.getJSONArray("content");
|
||||||
|
List<Instruction> instructions = jsonArray.toJavaList(Instruction.class);
|
||||||
|
List<Instruction> instDtoList =
|
||||||
|
instructions.stream()
|
||||||
|
.skip((currentPageNumber - 1) * pageMaxSize)
|
||||||
|
.limit(pageMaxSize)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
jo.put("content", instDtoList);
|
||||||
|
jo.put("totalElements", jsonArray.size());
|
||||||
return jo;
|
return jo;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public interface LuceneExecuteLogService {
|
|||||||
*
|
*
|
||||||
* @param luceneLogDto 日志结果对象
|
* @param luceneLogDto 日志结果对象
|
||||||
*/
|
*/
|
||||||
void interfaceExecuteLog(LuceneLogDto luceneLogDto) throws IOException;
|
void interfaceExecuteLog(LuceneLogDto luceneLogDto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备执行日志,会保留历史记录
|
* 设备执行日志,会保留历史记录
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ public class LuceneExecuteLogServiceImpl implements LuceneExecuteLogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void interfaceExecuteLog(LuceneLogDto luceneLogDto) throws IOException {
|
public void interfaceExecuteLog(LuceneLogDto luceneLogDto) {
|
||||||
luceneLogDto.setLogType(LogTypeEnum.INTERFACE_LOG.getDesc());
|
luceneLogDto.setLogType(LogTypeEnum.INTERFACE_LOG.getDesc());
|
||||||
addIndex(luceneLogDto);
|
addIndex(luceneLogDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addIndex(LuceneLogDto luceneLogDto) throws IOException {
|
private void addIndex(LuceneLogDto luceneLogDto) {
|
||||||
IndexWriter indexWriter = LuceneIndexWriter.getIndexWriter();
|
IndexWriter indexWriter = LuceneIndexWriter.getIndexWriter();
|
||||||
//创建一个Document对象
|
//创建一个Document对象
|
||||||
Document document = new Document();
|
Document document = new Document();
|
||||||
|
|||||||
@@ -55,6 +55,18 @@
|
|||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
/>
|
/>
|
||||||
|
<el-select
|
||||||
|
v-model="query.instruction_type"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="small"
|
||||||
|
placeholder="指令类型"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 190px"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in dict.task_type" :key="item.id" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
<rrOperation />
|
<rrOperation />
|
||||||
</div>
|
</div>
|
||||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
@@ -109,7 +121,12 @@
|
|||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column v-if="false" prop="instruction_id" label="指令标识" />
|
<el-table-column v-if="false" prop="instruction_id" label="指令标识" />
|
||||||
<el-table-column prop="instruction_code" label="指令编号" />
|
<el-table-column prop="instruction_code" label="指令编号" />
|
||||||
<el-table-column prop="instruction_type" label="指令类型" />
|
<el-table-column prop="instruction_type" label="指令类型">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ dict.label.task_type[scope.row.instruction_type] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column prop="link_num" label="关联编号" />-->
|
||||||
<el-table-column prop="task_code" label="任务号" />
|
<el-table-column prop="task_code" label="任务号" />
|
||||||
<el-table-column prop="vehicle_code" label="载具号" />
|
<el-table-column prop="vehicle_code" label="载具号" />
|
||||||
<el-table-column prop="instruction_status" label="指令状态">
|
<el-table-column prop="instruction_status" label="指令状态">
|
||||||
@@ -126,34 +143,28 @@
|
|||||||
<span v-if="scope.row.send_status=='2' ">失败</span>
|
<span v-if="scope.row.send_status=='2' ">失败</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="start_point_code" label="起点" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="start_point_code" label="取货点1" />
|
||||||
<!-- <el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip />-->
|
<el-table-column prop="next_point_code" label="放货点1" />
|
||||||
<el-table-column prop="next_point_code" label="终点" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="start_point_code2" label="取货点2" />
|
||||||
<!-- <el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip />-->
|
<el-table-column prop="next_point_code2" label="放货点2" />
|
||||||
<el-table-column prop="start_point_code2" label="起点2" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="put_point_code" label="中转点" />
|
||||||
<el-table-column prop="next_point_code2" label="终点2" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="execute_device_code" label="当前执行设备" />
|
||||||
<el-table-column prop="put_device_code" label="放货位" min-width="100" show-overflow-tooltip />
|
|
||||||
|
|
||||||
<el-table-column prop="carno" label="车号" />
|
<el-table-column prop="carno" label="车号" />
|
||||||
<el-table-column prop="compound_inst" label="复合指令">
|
<el-table-column prop="weight" label="重量" />
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="agv_jobno" label="AGV任务号" />
|
||||||
<span v-if="scope.row.compound_inst==='0' ">否</span>
|
<el-table-column prop="agv_inst_type" label="AGV任务类型" />
|
||||||
<span v-if="scope.row.compound_inst==='1' ">是</span>
|
<el-table-column prop="agv_system_type" label="AGV系统类型" />
|
||||||
</template>
|
<el-table-column prop="start_height" label="取货高度" />
|
||||||
</el-table-column>
|
<el-table-column prop="next_height" label="放货高度" />
|
||||||
<el-table-column prop="compound_inst_data" width="200" label="复合路线" />
|
|
||||||
<el-table-column prop="matarial" label="物料" />
|
|
||||||
<el-table-column prop="quantity" label="数量" />
|
|
||||||
<el-table-column prop="remark" label="描述" />
|
<el-table-column prop="remark" label="描述" />
|
||||||
<el-table-column prop="create_by" label="创建者" />
|
<el-table-column prop="create_by" label="创建者" />
|
||||||
<el-table-column prop="create_time" label="创建时间" width="135" />
|
<el-table-column prop="create_time" label="创建时间" width="135" />
|
||||||
<el-table-column prop="update_by" label="修改者" />
|
|
||||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-permission="['admin','instruction:edit','instruction:del']"
|
v-permission="['admin','instruction:edit','instruction:del']"
|
||||||
fixed="left"
|
fixed="left"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="80px"
|
width="150px"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -162,15 +173,22 @@
|
|||||||
<i class="el-icon-menu" />
|
<i class="el-icon-menu" />
|
||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
|
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>-->
|
||||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
|
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>-->
|
||||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">下发</el-dropdown-item>
|
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">强制取消</el-dropdown-item>-->
|
||||||
|
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'d')">初始化</el-dropdown-item>-->
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">下发</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -180,6 +198,7 @@ import crudInstruction from '@/api/acs/instruction/instruction'
|
|||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import { getDicts } from '@/api/system/dict'
|
import { getDicts } from '@/api/system/dict'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
instruction_id: null,
|
instruction_id: null,
|
||||||
@@ -218,9 +237,9 @@ const defaultForm = {
|
|||||||
update_time: null
|
update_time: null
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
dicts: ['task_status'],
|
dicts: ['task_status', 'task_type'],
|
||||||
name: 'Instruction',
|
name: 'Instruction',
|
||||||
components: { crudOperation },
|
components: { crudOperation, pagination },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
@@ -295,10 +314,18 @@ export default {
|
|||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
sendToAGV(index, row) {
|
forceCancel(index, row) {
|
||||||
crudInstruction.sendToAGV(row.instruction_id).then(res => {
|
crudInstruction.forceCancel(row.instruction_id).then(res => {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('强制取消成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
init(index, row) {
|
||||||
|
crudInstruction.init(row.instruction_id).then(res => {
|
||||||
|
this.crud.toQuery()
|
||||||
|
this.crud.notify('初始化成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
@@ -326,8 +353,11 @@ export default {
|
|||||||
case 'b':// 取消
|
case 'b':// 取消
|
||||||
this.cancel(command.index, command.row)
|
this.cancel(command.index, command.row)
|
||||||
break
|
break
|
||||||
case 'c':
|
case 'c':// 强制取消
|
||||||
this.sendToAGV(command.index, command.row)
|
this.forceCancel(command.index, command.row)
|
||||||
|
break
|
||||||
|
case 'd':// 初始化
|
||||||
|
this.init(command.index, command.row)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user