diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index 206cb60..04b0d4f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -3,8 +3,6 @@ package org.nl.acs.agv.server.impl; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpResponse; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; @@ -14,6 +12,7 @@ import org.nl.acs.agv.server.AgvWaitUtil; import org.nl.acs.agv.server.XianGongAgvService; import org.nl.acs.agv.server.dto.AgvDto; import org.nl.acs.config.AcsConfig; +import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver; import org.nl.acs.ext.UnifiedResponse; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.xg.XgHttpUtil; @@ -90,7 +89,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { @Override public UnifiedResponse queryXZAgvDeviceStatus(String vehicles, Class type) { - String path = "/robotsStatus" + vehicles == null ? "" : "?vehicles = " + vehicles; + String path = "/robotsStatus" + (vehicles == null ? "" : "?vehicles = " + vehicles); return xgHttpUtil.sendGetRequest(path, type); } @@ -585,10 +584,10 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONObject block = new JSONObject(); block.put("blockId", IdUtil.simpleUUID()); block.put("location", inst.getStart_point_code()); - block.put("operation", "JackLoad"); - block.put("operationArgs", new JSONObject() {{ - put("recognize", true); - }}); + block.put("binTask", "ForkLoad"); +// block.put("operationArgs", new JSONObject() {{ +// put("recognize", true); +// }}); blocks.add(block); if ("true".equals(device1.getExtraValue().get("ignore_pickup_check"))) { @@ -610,6 +609,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { scriptArgs.put("protocol", "HTTP"); block.put("script_args", scriptArgs); blocks.add(block); + } else { + if (device1.getDeviceDriver() instanceof StandardStorageDeviceDriver) { + block = new JSONObject(); + block.put("binTask", "ForkHeight"); + block.put("blockId", IdUtil.simpleUUID()); + block.put("location", inst.getStart_point_code() + "OUTGET"); + blocks.add(block); + } } // 终点1 @@ -638,7 +645,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { block = new JSONObject(); block.put("blockId", IdUtil.simpleUUID()); block.put("location", inst.getNext_point_code()); - block.put("operation", "JackUnload"); + block.put("binTask", "ForkUnload"); blocks.add(block); if ("true".equals(device2.getExtraValue().get("ignore_release_check"))) { @@ -660,6 +667,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { scriptArgs.put("protocol", "HTTP"); block.put("script_args", scriptArgs); blocks.add(block); + } else { + if (device2.getDeviceDriver() instanceof StandardStorageDeviceDriver) { + block = new JSONObject(); + block.put("binTask", "ForkHeight"); + block.put("blockId", IdUtil.simpleUUID()); + block.put("location", inst.getNext_point_code() + "OUTPUT"); + blocks.add(block); + } } // 起点2 @@ -689,10 +704,10 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { block = new JSONObject(); block.put("blockId", IdUtil.simpleUUID()); block.put("location", inst.getStart_point_code2()); - block.put("operation", "JackLoad"); - block.put("operationArgs", new JSONObject() {{ - put("recognize", true); - }}); + block.put("binTask", "ForkLoad"); +// block.put("operationArgs", new JSONObject() {{ +// put("recognize", true); +// }}); blocks.add(block); if ("true".equals(device3.getExtraValue().get("ignore_pickup_check"))) { @@ -714,6 +729,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { scriptArgs.put("protocol", "HTTP"); block.put("script_args", scriptArgs); blocks.add(block); + } else { + if (device3.getDeviceDriver() instanceof StandardStorageDeviceDriver) { + block = new JSONObject(); + block.put("binTask", "ForkHeight"); + block.put("blockId", IdUtil.simpleUUID()); + block.put("location", inst.getStart_point_code2() + "OUTGET"); + blocks.add(block); + } } } @@ -744,7 +767,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { block = new JSONObject(); block.put("blockId", IdUtil.simpleUUID()); block.put("location", inst.getNext_point_code2()); - block.put("operation", "JackUnload"); + block.put("binTask", "ForkUnload"); blocks.add(block); if ("true".equals(device4.getExtraValue().get("ignore_release_check"))) { @@ -766,6 +789,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { scriptArgs.put("protocol", "HTTP"); block.put("script_args", scriptArgs); blocks.add(block); + } else { + if (device4.getDeviceDriver() instanceof StandardStorageDeviceDriver) { + block = new JSONObject(); + block.put("binTask", "ForkHeight"); + block.put("blockId", IdUtil.simpleUUID()); + block.put("location", inst.getNext_point_code2() + "OUTPUT"); + blocks.add(block); + } } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/xg_agv/XianGongAgvDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/xg_agv/XianGongAgvDeviceDriver.java index adbe03d..7066f4c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/xg_agv/XianGongAgvDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/xg_agv/XianGongAgvDeviceDriver.java @@ -97,6 +97,8 @@ public class XianGongAgvDeviceDriver extends AbstractOpcDeviceDriver implements */ private Integer monthTaskNum = 0; + private String message; + @Override public Device getDevice() { return this.device; @@ -129,6 +131,7 @@ public class XianGongAgvDeviceDriver extends AbstractOpcDeviceDriver implements //jo.put("status_name", this.statusName); jo.put("todayTaskNum", this.todayTaskNum); jo.put("monthTaskNum", this.monthTaskNum); + jo.put("message", this.message == null ? "运行正常" : "运行异常"); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/rgv/RGVDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/rgv/RGVDeviceDriver.java index 083d2f3..0daf683 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/rgv/RGVDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/rgv/RGVDeviceDriver.java @@ -12,6 +12,7 @@ import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.modules.lucene.service.LuceneExecuteLogService; import org.nl.modules.lucene.service.dto.LuceneLogDto; import org.nl.modules.wql.util.SpringContextHolder; +import org.springframework.util.ObjectUtils; /** * @author zhangjiangwei @@ -124,7 +125,7 @@ public class RGVDeviceDriver extends AbstractOpcDeviceDriver implements /** * 消息 */ - private String message = ""; + private String message; /** * 请求标记相关信息 @@ -224,14 +225,15 @@ public class RGVDeviceDriver extends AbstractOpcDeviceDriver implements jo.put("error", this.error); jo.put("battery_level", (this.energyLevel * 100) + "%"); jo.put("task_code", this.taskCode); - jo.put("startDeviceCode", this.startDeviceCode); - jo.put("nextDeviceCode", this.nextDeviceCode); + jo.put("current_loc", ObjectUtils.isEmpty(this.startDeviceCode) ? "0" : this.startDeviceCode); + jo.put("target_loc", ObjectUtils.isEmpty(this.nextDeviceCode) ? "0" : this.nextDeviceCode); jo.put("vehicleCode", this.vehicleCode); jo.put("x", this.x); jo.put("y", this.y); jo.put("action", this.action); jo.put("todayTaskNum", this.todayTaskNum); jo.put("allTaskNum", this.allTaskNum); + jo.put("message", this.message == null ? "运行正常" : "运行异常"); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java index c5af279..b9f5e1f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java @@ -47,10 +47,22 @@ public class WmsToAcsController { return new ResponseEntity<>(wmstoacsService.cancelFromWms(whereJson), HttpStatus.OK); } - @PostMapping("/获取AGV和RGV数据") + @PostMapping("/agvInfo") @OthersToInterfaceLog("LMS->ACS") - public ResponseEntity getAGVAndRGVInfo() { - return new ResponseEntity<>(wmstoacsService.getAGVAndRGVInfo(), HttpStatus.OK); + public ResponseEntity agvInfo(@RequestBody JSONObject req) { + return new ResponseEntity<>(wmstoacsService.agvInfo(req), HttpStatus.OK); + } + + @PostMapping("/rgvInfo") + @OthersToInterfaceLog("LMS->ACS") + public ResponseEntity rgvInfo(@RequestBody JSONObject req) { + return new ResponseEntity<>(wmstoacsService.rgvInfo(req), HttpStatus.OK); + } + + @PostMapping("/todayTask") + @OthersToInterfaceLog("LMS->ACS") + public ResponseEntity todayTask(@RequestBody JSONObject req) { + return new ResponseEntity<>(wmstoacsService.todayTask(req), HttpStatus.OK); } @PostMapping("/test") diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java index fb766cb..47157f9 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java @@ -2,7 +2,6 @@ package org.nl.acs.ext.wms.service; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import java.util.Map; @@ -24,5 +23,9 @@ public interface WmsToAcsService { */ Map cancelFromWms(String jsonObject) throws Exception; - JSONObject getAGVAndRGVInfo(); + JSONObject agvInfo(JSONObject req); + + JSONObject rgvInfo(JSONObject req); + + JSONObject todayTask(JSONObject req); } 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 716ccdd..f088e77 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 @@ -11,7 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.nl.acs.agv.AgvUtil; import org.nl.acs.config.AcsConfig; import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.ext.wms.data.wmsToAcsData.createTask.CreateTaskRequest; import org.nl.acs.ext.wms.data.wmsToAcsData.createTask.CreateTaskResponse; import org.nl.acs.ext.wms.service.WmsToAcsService; @@ -30,6 +29,7 @@ import org.nl.modules.lucene.service.dto.LuceneLogDto; import org.nl.modules.quartz.task.DeviceStatusMonitor; import org.nl.modules.system.service.ParamService; import org.nl.modules.system.service.impl.ParamServiceImpl; +import org.nl.modules.wql.WQL; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.exception.WDKException; import org.nl.modules.wql.util.SpringContextHolder; @@ -38,6 +38,7 @@ import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -313,26 +314,49 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { @SneakyThrows @Override - public JSONObject getAGVAndRGVInfo() { + public JSONObject agvInfo(JSONObject req) { JSONObject resp = new JSONObject(); List agvs = deviceAppService.findDevice(DeviceType.agv); List agvInfos = new ArrayList<>(); for (Device agv : agvs) { - if (agv != null && agv.getDeviceDriver() instanceof DeviceStatusMonitor) { + if (agv != null && agv.getDeviceDriver() instanceof DeviceStageMonitor) { DeviceStageMonitor deviceStageMonitor = (DeviceStageMonitor) agv.getDeviceDriver(); agvInfos.add(deviceStageMonitor.getDeviceStatusName()); } } - resp.put("agv", agvInfos); + resp.put("status", 0); + resp.put("message", "查询成功"); + resp.put("data", agvInfos); + return resp; + } + + @SneakyThrows + @Override + public JSONObject rgvInfo(JSONObject req) { + JSONObject resp = new JSONObject(); List rgvs = deviceAppService.findDevice(DeviceType.rgv); List rgvInfos = new ArrayList<>(); for (Device rgv : rgvs) { - if (rgv != null && rgv.getDeviceDriver() instanceof DeviceStatusMonitor) { + if (rgv != null && rgv.getDeviceDriver() instanceof DeviceStageMonitor) { DeviceStageMonitor deviceStageMonitor = (DeviceStageMonitor) rgv.getDeviceDriver(); rgvInfos.add(deviceStageMonitor.getDeviceStatusName()); } } - resp.put("rgv", rgvInfos); + resp.put("status", 0); + resp.put("message", "查询成功"); + resp.put("data", rgvInfos); + return resp; + } + + @Override + public JSONObject todayTask(JSONObject req) { + JSONObject resp = new JSONObject(); + Map map = new HashMap<>(); + map.put("flag", "1"); + JSONArray data = WQL.getWO("EXT_QUERY001").addParamMap(map).process().getResultJSONArray(0); + resp.put("status",0); + resp.put("message","查询成功"); + resp.put("data",data); return resp; } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/wql/EXT_QUERY001.wql b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/wql/EXT_QUERY001.wql new file mode 100644 index 0000000..759f964 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/wql/EXT_QUERY001.wql @@ -0,0 +1,62 @@ +[交易说明] + 交易名: WMS接口查询 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + + + + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + IF 输入.flag = "1" + QUERY + SELECT + inst.task_code, + inst.start_point_code, + inst.next_point_code, + CASE + WHEN inst.instruction_status = '0' THEN '就绪' + WHEN inst.instruction_status = '1' THEN '执行中' + WHEN inst.instruction_status = '2' THEN '完成' + ELSE '未知状态' + END AS task_status, + inst.carno, + inst.create_time + FROM + acs_instruction inst + WHERE + inst.`instruction_status` in ('0','1','2') and inst.task_code NOT LIKE '-%' and DATE(inst.create_time) = CURDATE() + ENDSELECT + ENDQUERY + ENDIF diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXGTaskStatus.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXGTaskStatus.java index 0af1205..bf0304b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXGTaskStatus.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXGTaskStatus.java @@ -1,28 +1,16 @@ package org.nl.modules.quartz.task; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpResponse; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.agv.server.XianGongAgvService; import org.nl.acs.ext.UnifiedResponse; -import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.opc.Device; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.service.ParamService; -import org.nl.modules.wql.util.SpringContextHolder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; -import java.util.stream.Collectors; /** * 查询AGV任务状态 @@ -41,6 +29,9 @@ public class QueryXGTaskStatus { try { List allInstFromCache = instructionService.findAllInstFromCache(); for (Instruction instruction : allInstFromCache) { + if (!instruction.getSend_status().equals("1")) { + continue; + } UnifiedResponse resp = agvService.queryXZAgvInstStatusByCode(instruction.getInstruction_code(), JSONObject.class); if (resp.isSuccess()) { // 已创建=CREATED, diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/controller/BigScreenController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/controller/BigScreenController.java new file mode 100644 index 0000000..cc3acc3 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/controller/BigScreenController.java @@ -0,0 +1,76 @@ +package org.nl.wms.bigScreen.controller; + +import cn.dev33.satoken.annotation.SaIgnore; +import lombok.extern.slf4j.Slf4j; +import org.nl.common.logging.annotation.Log; +import org.nl.wms.bigScreen.service.BigScreenService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Description TODO + * @Author Gengby + * @Date 2024/8/2 + */ +@Slf4j +@RestController +@RequestMapping("/api/bigScreen") +@SaIgnore +public class BigScreenController { + + @Autowired + private BigScreenService bigScreenService; + + @PostMapping("/inventoryAnalysis") + @Log("原料库存统计") + public ResponseEntity inventoryAnalysis() { + return new ResponseEntity<>(bigScreenService.inventoryAnalysis(), HttpStatus.OK); + } + + @PostMapping("/agvInfo") + @Log("获取AGV信息") + public ResponseEntity agvInfo() { + return new ResponseEntity<>(bigScreenService.agvInfo(), HttpStatus.OK); + } + + @PostMapping("/rgvInfo") + @Log("获取RGV信息") + public ResponseEntity rgvInfo() { + return new ResponseEntity<>(bigScreenService.rgvInfo(), HttpStatus.OK); + } + + @PostMapping("/todayProduceStatistic") + @Log("当日生产统计") + public ResponseEntity todayProduceStatistic() { + return new ResponseEntity<>(bigScreenService.todayProduceStatistic(), HttpStatus.OK); + } + + @PostMapping("/inventoryIOAnalysis") + @Log("当日出入库分析") + public ResponseEntity inventoryIOAnalysis() { + return new ResponseEntity<>(bigScreenService.inventoryIOAnalysis(), HttpStatus.OK); + } + + @PostMapping("/historyInventoryIOAnalysis") + @Log("历史出入库分析") + public ResponseEntity historyInventoryIOAnalysis() { + return new ResponseEntity<>(bigScreenService.historyInventoryIOAnalysis(), HttpStatus.OK); + } + + @PostMapping("/todayTask") + @Log("当日任务") + public ResponseEntity todayTask() { + return new ResponseEntity<>(bigScreenService.todayTask(), HttpStatus.OK); + } + + @PostMapping("/todayLoadingAndUnloadingStatistics") + @Log("当日车间上下料根据区域统计") + public ResponseEntity todayLoadingAndUnloadingStatistics() { + return new ResponseEntity<>(bigScreenService.todayLoadingAndUnloadingStatistics(), HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/BigScreenService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/BigScreenService.java new file mode 100644 index 0000000..293640b --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/BigScreenService.java @@ -0,0 +1,69 @@ +package org.nl.wms.bigScreen.service; + +import com.alibaba.fastjson.JSONArray; + +import java.util.List; +import java.util.Map; + +/** + * @Description TODO + * @Author Gengby + * @Date 2024/8/2 + */ +public interface BigScreenService { + /** + * 原料库存统计 + * + * @return + */ + List> inventoryAnalysis(); + + /** + * 获取AGV信息 + * + * @return + */ + JSONArray agvInfo(); + + /** + * 获取RGV信息 + * + * @return + */ + JSONArray rgvInfo(); + + /** + * 当日生产统计 + * + * @return + */ + List> todayProduceStatistic(); + + /** + * 当日上下料统计 + * + * @return + */ + List> todayLoadingAndUnloadingStatistics(); + + /** + * 当日任务 + * + * @return + */ + JSONArray todayTask(); + + /** + * 历史分析(出库和入库近半个月的) + * + * @return + */ + List> historyInventoryIOAnalysis(); + + /** + * 当日出入库统计 + * + * @return + */ + List> inventoryIOAnalysis(); +} \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/impl/BigScreenServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/impl/BigScreenServiceImpl.java new file mode 100644 index 0000000..ee07c61 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/impl/BigScreenServiceImpl.java @@ -0,0 +1,77 @@ +package org.nl.wms.bigScreen.service.impl; + +import com.alibaba.fastjson.JSONArray; +import org.nl.wms.bigScreen.service.BigScreenService; +import org.nl.wms.bigScreen.service.mapper.BigScreenMapper; +import org.nl.wms.ext.acs.service.WmsToAcsService; +import org.nl.wms.ext.acs.service.dto.to.wms.AcsResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @Description TODO + * @Author Gengby + * @Date 2024/8/2 + */ +@Service +public class BigScreenServiceImpl implements BigScreenService { + + @Autowired(required = false) + private BigScreenMapper bigScreenMapper; + @Autowired + private WmsToAcsService wmsToAcsService; + + @Override + public List> inventoryAnalysis() { + List> res = bigScreenMapper.inventoryAnalysis(); + return res; + } + + @Override + public JSONArray agvInfo() { + AcsResponse acsResponse = wmsToAcsService.agvInfo(); + JSONArray data = acsResponse.getData(); + return data; + } + + @Override + public JSONArray rgvInfo() { + AcsResponse acsResponse = wmsToAcsService.rgvInfo(); + JSONArray data = acsResponse.getData(); + return data; + } + + @Override + public List> todayProduceStatistic() { + List> res = bigScreenMapper.todayProduceStatistic(); + return res; + } + + @Override + public List> todayLoadingAndUnloadingStatistics() { + List> res = bigScreenMapper.todayLoadingAndUnloadingStatistics(); + return res; + } + + @Override + public JSONArray todayTask() { + AcsResponse acsResponse = wmsToAcsService.todayTask(); + JSONArray data = acsResponse.getData(); + return data; + } + + @Override + public List> historyInventoryIOAnalysis() { + List> res = bigScreenMapper.historyInventoryIOAnalysis(); + return res; + } + + @Override + public List> inventoryIOAnalysis() { + List> res = bigScreenMapper.inventoryIOAnalysis(); + return res; + } +} \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/mapper/BigScreenMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/mapper/BigScreenMapper.java new file mode 100644 index 0000000..578c568 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/mapper/BigScreenMapper.java @@ -0,0 +1,23 @@ +package org.nl.wms.bigScreen.service.mapper; + + +import java.util.List; +import java.util.Map; + +/** + * @Description TODO + * @Author Gengby + * @Date 2024/8/2 + */ +public interface BigScreenMapper { + + List> inventoryAnalysis(); + + List> todayProduceStatistic(); + + List> inventoryIOAnalysis(); + + List> historyInventoryIOAnalysis(); + + List> todayLoadingAndUnloadingStatistics(); +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/mapper/BigScreenMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/mapper/BigScreenMapper.xml new file mode 100644 index 0000000..ea1a3f7 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/mapper/BigScreenMapper.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java index d505198..9f2df36 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java @@ -1,5 +1,6 @@ package org.nl.wms.ext.acs.service; +import com.alibaba.fastjson.JSONObject; import org.nl.wms.ext.acs.service.dto.ResultForAcs; import org.nl.wms.ext.acs.service.dto.to.acs.DeviceInfoDto; import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest; @@ -48,4 +49,10 @@ public interface WmsToAcsService { * @return */ AcsResponse getDeviceStatusByCode(List list); + + AcsResponse agvInfo(); + + AcsResponse rgvInfo(); + + AcsResponse todayTask(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java index adaf23d..572bd56 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java @@ -1,6 +1,7 @@ package org.nl.wms.ext.acs.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.ext.acs.service.dto.ResultForAcs; @@ -65,4 +66,22 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { interactRecordService.saveRecord("获取设备信息", list, resultForAcs, GeneralDefinition.LMS_ACS); return resultForAcs; } + + @Override + public AcsResponse agvInfo() { + String api = "/api/wms/agvInfo"; + return AcsUtil.notifyAcs2(api, new JSONObject()); + } + + @Override + public AcsResponse rgvInfo() { + String api = "/api/wms/rgvInfo"; + return AcsUtil.notifyAcs2(api, new JSONObject()); + } + + @Override + public AcsResponse todayTask() { + String api = "/api/wms/todayTask"; + return AcsUtil.notifyAcs2(api, new JSONObject()); + } } diff --git a/lms/nladmin-ui/src/views/wms/basedata/vehicle/index.vue b/lms/nladmin-ui/src/views/wms/basedata/vehicle/index.vue index 2fcf390..6818386 100644 --- a/lms/nladmin-ui/src/views/wms/basedata/vehicle/index.vue +++ b/lms/nladmin-ui/src/views/wms/basedata/vehicle/index.vue @@ -156,6 +156,7 @@ import rrOperation from '@crud/RR.operation' import crudOperation from '@crud/CRUD.operation' import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' +import { getLodop } from '@/assets/js/lodop/LodopFuncs' const defaultForm = { vehicle_code: null, diff --git a/lms/nladmin-ui/src/views/wms/sch/point/index.vue b/lms/nladmin-ui/src/views/wms/sch/point/index.vue index b1f49dc..98dfec2 100644 --- a/lms/nladmin-ui/src/views/wms/sch/point/index.vue +++ b/lms/nladmin-ui/src/views/wms/sch/point/index.vue @@ -377,6 +377,7 @@ import pagination from '@crud/Pagination' import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop' import ViewDialog from '@/views/wms/sch/point/ViewDialog.vue' import PointDialog from '@/views/wms/sch/point/PointDialog.vue' +import { getLodop } from '@/assets/js/lodop/LodopFuncs' const defaultForm = { point_code: null, @@ -577,11 +578,14 @@ export default { } for (let i = 0; i < _selectData.length; i++) { const code = _selectData[i].point_code + const name = _selectData[i].point_name const LODOP = getLodop() LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮 // 打印纸张大小设置https://www.it610.com/article/2094844.html - LODOP.SET_PRINT_PAGESIZE(1, '50mm', '30mm', '') - LODOP.ADD_PRINT_BARCODE('4.3mm', '8.2mm', '40mm', '20mm', '128Auto', code) + LODOP.SET_PRINT_PAGESIZE(1, '100mm', '50mm', '') + LODOP.ADD_PRINT_BARCODE('4.3mm', '8.2mm', '80mm', '33mm', '128Auto', code) + LODOP.ADD_PRINT_TEXT('40mm', '8.2mm', '80mm', '6mm', name) + // 打印条码下方的第一行文本 LODOP.PRINT()// 打印 this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.toQuery()