diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java index 0206a02..50071c2 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java +++ b/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))); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 0d825b5..815c3da 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/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); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index b70835d..3d283f6 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/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 queryAll(Map whereJson, Pageable page) { - this.reload(); +// this.reload(); +// HashMap 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 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 instructions = jsonArray.toJavaList(Instruction.class); + List 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 diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/LuceneExecuteLogService.java b/acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/LuceneExecuteLogService.java index 861dc72..b740d3c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/LuceneExecuteLogService.java +++ b/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); /** * 设备执行日志,会保留历史记录 diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/impl/LuceneExecuteLogServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/impl/LuceneExecuteLogServiceImpl.java index 2ce92ee..c97f22b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/lucene/service/impl/LuceneExecuteLogServiceImpl.java +++ b/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(); diff --git a/acs/nladmin-ui/src/views/acs/instruction/index.vue b/acs/nladmin-ui/src/views/acs/instruction/index.vue index 6385c31..89e8717 100644 --- a/acs/nladmin-ui/src/views/acs/instruction/index.vue +++ b/acs/nladmin-ui/src/views/acs/instruction/index.vue @@ -55,6 +55,18 @@ class="filter-item" @keyup.enter.native="crud.toQuery" /> + + + @@ -109,7 +121,12 @@ - + + + + @@ -126,34 +143,28 @@ 失败 - - - - - - - - + + + + + + - - - - - - + + + + + + - - + + @@ -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 } }