汪菘 1 year ago
parent
commit
c593bd74f0
  1. 1
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java
  2. 14
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  3. 56
      acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
  4. 2
      acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/LuceneExecuteLogService.java
  5. 4
      acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/impl/LuceneExecuteLogServiceImpl.java
  6. 86
      acs/nladmin-ui/src/views/acs/instruction/index.vue

1
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java

@ -771,7 +771,6 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
request.setWeight(String.valueOf(weight));
request.setVehicle_code(String.valueOf(barcode));
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
message = RequestMethodEnum.getName("apply_put_empty_vehicle") + "apply_put_empty_vehicle 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));

14
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java

@ -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.dto.TaskDto;
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.impl.ParamServiceImpl;
import org.nl.modules.wql.core.bean.WQLObject;
@ -68,6 +70,7 @@ import java.util.Map;
@Slf4j
public class WmsToAcsServiceImpl implements WmsToAcsService {
private final LuceneExecuteLogService lucene;
private final InstructionService InstructionService;
private final TaskService TaskService;
private final DeviceService DeviceService;
@ -85,7 +88,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
CreateTaskRequest tasks = JSON.toJavaObject(req, CreateTaskRequest.class);
JSONObject resultJson = new JSONObject();
CreateTaskResponse resp = new CreateTaskResponse();
log.info("createFromWms - 请求参数 {}", tasks.toString());
log.info("createFromWms - 请求参数 {}", JSON.toJSON(resp));
String request_no = tasks.getRequestNo();
JSONArray errArr = new JSONArray();
try {
@ -272,6 +275,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
resp.setResponseDate(AgvUtil.getDate());
resp.setMessage("请求成功");
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);
} finally {
MDC.remove(log_file_type);

56
acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

@ -52,6 +52,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
* @author ldjun
@ -86,7 +87,38 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
@Override
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<>();
map.put("flag", "1");
String code = (String) whereJson.get("code");
@ -95,6 +127,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
String status = (String) whereJson.get("status");
String point_code = (String) whereJson.get("point_code");
String is_over = (String) whereJson.get("is_over");
String instruction_type = (String) whereJson.get("instruction_type");
if (!StrUtil.isEmpty(code)) {
map.put("code", code);
}
@ -110,13 +143,24 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (!StrUtil.isEmpty(point_code)) {
map.put("point_code", point_code);
}
if (!StrUtil.isEmpty(is_over)) {
map.put("is_over", is_over);
}
map.put("instruction_type", instruction_type);
Integer currentPageNumber = page.getPageNumber() + 1;
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;
final JSONObject jo = WQL.getWO("QINST_QUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "");
return jo;
}
@Override

2
acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/LuceneExecuteLogService.java

@ -27,7 +27,7 @@ public interface LuceneExecuteLogService {
*
* @param luceneLogDto 日志结果对象
*/
void interfaceExecuteLog(LuceneLogDto luceneLogDto) throws IOException;
void interfaceExecuteLog(LuceneLogDto luceneLogDto);
/**
* 设备执行日志,会保留历史记录

4
acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/impl/LuceneExecuteLogServiceImpl.java

@ -43,12 +43,12 @@ public class LuceneExecuteLogServiceImpl implements LuceneExecuteLogService {
}
@Override
public void interfaceExecuteLog(LuceneLogDto luceneLogDto) throws IOException {
public void interfaceExecuteLog(LuceneLogDto luceneLogDto) {
luceneLogDto.setLogType(LogTypeEnum.INTERFACE_LOG.getDesc());
addIndex(luceneLogDto);
}
private void addIndex(LuceneLogDto luceneLogDto) throws IOException {
private void addIndex(LuceneLogDto luceneLogDto) {
IndexWriter indexWriter = LuceneIndexWriter.getIndexWriter();
//创建一个Document对象
Document document = new Document();

86
acs/nladmin-ui/src/views/acs/instruction/index.vue

@ -55,6 +55,18 @@
class="filter-item"
@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 />
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@ -109,7 +121,12 @@
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="instruction_id" 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="vehicle_code" label="载具号" />
<el-table-column prop="instruction_status" label="指令状态">
@ -126,34 +143,28 @@
<span v-if="scope.row.send_status=='2' ">失败</span>
</template>
</el-table-column>
<el-table-column prop="start_point_code" label="起点" min-width="100" show-overflow-tooltip />
<!-- <el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="next_point_code" label="终点" min-width="100" show-overflow-tooltip />
<!-- <el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="start_point_code2" label="起点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_point_code2" label="终点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="put_device_code" label="放货位" min-width="100" show-overflow-tooltip />
<el-table-column prop="start_point_code" label="取货点1" />
<el-table-column prop="next_point_code" label="放货点1" />
<el-table-column prop="start_point_code2" label="取货点2" />
<el-table-column prop="next_point_code2" label="放货点2" />
<el-table-column prop="put_point_code" label="中转点" />
<el-table-column prop="execute_device_code" label="当前执行设备" />
<el-table-column prop="carno" label="车号" />
<el-table-column prop="compound_inst" label="复合指令">
<template slot-scope="scope">
<span v-if="scope.row.compound_inst==='0' "></span>
<span v-if="scope.row.compound_inst==='1' "></span>
</template>
</el-table-column>
<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="weight" label="重量" />
<el-table-column prop="agv_jobno" label="AGV任务号" />
<el-table-column prop="agv_inst_type" label="AGV任务类型" />
<el-table-column prop="agv_system_type" label="AGV系统类型" />
<el-table-column prop="start_height" label="取货高度" />
<el-table-column prop="next_height" label="放货高度" />
<el-table-column prop="remark" label="描述" />
<el-table-column prop="create_by" label="创建者" />
<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
v-permission="['admin','instruction:edit','instruction:del']"
fixed="left"
label="操作"
width="80px"
width="150px"
align="center"
>
<template slot-scope="scope">
@ -162,15 +173,22 @@
<i class="el-icon-menu" />
</span>
<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-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>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
@ -180,6 +198,7 @@ import crudInstruction from '@/api/acs/instruction/instruction'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import { getDicts } from '@/api/system/dict'
import pagination from '@crud/Pagination'
const defaultForm = {
instruction_id: null,
@ -218,9 +237,9 @@ const defaultForm = {
update_time: null
}
export default {
dicts: ['task_status'],
dicts: ['task_status', 'task_type'],
name: 'Instruction',
components: { crudOperation },
components: { crudOperation, pagination },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@ -295,10 +314,18 @@ export default {
console.log(err.response.data.message)
})
},
sendToAGV(index, row) {
crudInstruction.sendToAGV(row.instruction_id).then(res => {
forceCancel(index, row) {
crudInstruction.forceCancel(row.instruction_id).then(res => {
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 => {
console.log(err.response.data.message)
})
@ -326,8 +353,11 @@ export default {
case 'b'://
this.cancel(command.index, command.row)
break
case 'c':
this.sendToAGV(command.index, command.row)
case 'c'://
this.forceCancel(command.index, command.row)
break
case 'd'://
this.init(command.index, command.row)
break
}
}

Loading…
Cancel
Save