Browse Source

rev:master更新

master
gengby 4 months ago
parent
commit
e7725d7993
  1. 57
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java
  2. 3
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/xg_agv/XianGongAgvDeviceDriver.java
  3. 8
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/rgv/RGVDeviceDriver.java
  4. 18
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java
  5. 7
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java
  6. 36
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  7. 62
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/wql/EXT_QUERY001.wql
  8. 15
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXGTaskStatus.java
  9. 76
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/controller/BigScreenController.java
  10. 69
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/BigScreenService.java
  11. 77
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/impl/BigScreenServiceImpl.java
  12. 23
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/mapper/BigScreenMapper.java
  13. 186
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/mapper/BigScreenMapper.xml
  14. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java
  15. 19
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java
  16. 1
      lms/nladmin-ui/src/views/wms/basedata/vehicle/index.vue
  17. 8
      lms/nladmin-ui/src/views/wms/sch/point/index.vue

57
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 <T> UnifiedResponse<T> queryXZAgvDeviceStatus(String vehicles, Class<T> 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);
}
}
}

3
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;
}

8
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;
}

18
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<Object> getAGVAndRGVInfo() {
return new ResponseEntity<>(wmstoacsService.getAGVAndRGVInfo(), HttpStatus.OK);
public ResponseEntity<Object> agvInfo(@RequestBody JSONObject req) {
return new ResponseEntity<>(wmstoacsService.agvInfo(req), HttpStatus.OK);
}
@PostMapping("/rgvInfo")
@OthersToInterfaceLog("LMS->ACS")
public ResponseEntity<Object> rgvInfo(@RequestBody JSONObject req) {
return new ResponseEntity<>(wmstoacsService.rgvInfo(req), HttpStatus.OK);
}
@PostMapping("/todayTask")
@OthersToInterfaceLog("LMS->ACS")
public ResponseEntity<Object> todayTask(@RequestBody JSONObject req) {
return new ResponseEntity<>(wmstoacsService.todayTask(req), HttpStatus.OK);
}
@PostMapping("/test")

7
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<String, Object> cancelFromWms(String jsonObject) throws Exception;
JSONObject getAGVAndRGVInfo();
JSONObject agvInfo(JSONObject req);
JSONObject rgvInfo(JSONObject req);
JSONObject todayTask(JSONObject req);
}

36
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<Device> agvs = deviceAppService.findDevice(DeviceType.agv);
List<JSONObject> 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<Device> rgvs = deviceAppService.findDevice(DeviceType.rgv);
List<JSONObject> 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<String, String> 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;
}
}

62
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

15
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<Instruction> allInstFromCache = instructionService.findAllInstFromCache();
for (Instruction instruction : allInstFromCache) {
if (!instruction.getSend_status().equals("1")) {
continue;
}
UnifiedResponse<JSONObject> resp = agvService.queryXZAgvInstStatusByCode(instruction.getInstruction_code(), JSONObject.class);
if (resp.isSuccess()) {
// 已创建=CREATED,

76
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<Object> inventoryAnalysis() {
return new ResponseEntity<>(bigScreenService.inventoryAnalysis(), HttpStatus.OK);
}
@PostMapping("/agvInfo")
@Log("获取AGV信息")
public ResponseEntity<Object> agvInfo() {
return new ResponseEntity<>(bigScreenService.agvInfo(), HttpStatus.OK);
}
@PostMapping("/rgvInfo")
@Log("获取RGV信息")
public ResponseEntity<Object> rgvInfo() {
return new ResponseEntity<>(bigScreenService.rgvInfo(), HttpStatus.OK);
}
@PostMapping("/todayProduceStatistic")
@Log("当日生产统计")
public ResponseEntity<Object> todayProduceStatistic() {
return new ResponseEntity<>(bigScreenService.todayProduceStatistic(), HttpStatus.OK);
}
@PostMapping("/inventoryIOAnalysis")
@Log("当日出入库分析")
public ResponseEntity<Object> inventoryIOAnalysis() {
return new ResponseEntity<>(bigScreenService.inventoryIOAnalysis(), HttpStatus.OK);
}
@PostMapping("/historyInventoryIOAnalysis")
@Log("历史出入库分析")
public ResponseEntity<Object> historyInventoryIOAnalysis() {
return new ResponseEntity<>(bigScreenService.historyInventoryIOAnalysis(), HttpStatus.OK);
}
@PostMapping("/todayTask")
@Log("当日任务")
public ResponseEntity<Object> todayTask() {
return new ResponseEntity<>(bigScreenService.todayTask(), HttpStatus.OK);
}
@PostMapping("/todayLoadingAndUnloadingStatistics")
@Log("当日车间上下料根据区域统计")
public ResponseEntity<Object> todayLoadingAndUnloadingStatistics() {
return new ResponseEntity<>(bigScreenService.todayLoadingAndUnloadingStatistics(), HttpStatus.OK);
}
}

69
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<Map<String, Object>> inventoryAnalysis();
/**
* 获取AGV信息
*
* @return
*/
JSONArray agvInfo();
/**
* 获取RGV信息
*
* @return
*/
JSONArray rgvInfo();
/**
* 当日生产统计
*
* @return
*/
List<Map<String, Object>> todayProduceStatistic();
/**
* 当日上下料统计
*
* @return
*/
List<Map<String,Object>> todayLoadingAndUnloadingStatistics();
/**
* 当日任务
*
* @return
*/
JSONArray todayTask();
/**
* 历史分析(出库和入库近半个月的)
*
* @return
*/
List<Map<String, Object>> historyInventoryIOAnalysis();
/**
* 当日出入库统计
*
* @return
*/
List<Map<String, Object>> inventoryIOAnalysis();
}

77
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<Map<String, Object>> inventoryAnalysis() {
List<Map<String, Object>> 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<Map<String, Object>> todayProduceStatistic() {
List<Map<String, Object>> res = bigScreenMapper.todayProduceStatistic();
return res;
}
@Override
public List<Map<String, Object>> todayLoadingAndUnloadingStatistics() {
List<Map<String, Object>> res = bigScreenMapper.todayLoadingAndUnloadingStatistics();
return res;
}
@Override
public JSONArray todayTask() {
AcsResponse acsResponse = wmsToAcsService.todayTask();
JSONArray data = acsResponse.getData();
return data;
}
@Override
public List<Map<String, Object>> historyInventoryIOAnalysis() {
List<Map<String, Object>> res = bigScreenMapper.historyInventoryIOAnalysis();
return res;
}
@Override
public List<Map<String, Object>> inventoryIOAnalysis() {
List<Map<String, Object>> res = bigScreenMapper.inventoryIOAnalysis();
return res;
}
}

23
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<Map<String, Object>> inventoryAnalysis();
List<Map<String, Object>> todayProduceStatistic();
List<Map<String, Object>> inventoryIOAnalysis();
List<Map<String, Object>> historyInventoryIOAnalysis();
List<Map<String, Object>> todayLoadingAndUnloadingStatistics();
}

186
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/bigScreen/service/mapper/BigScreenMapper.xml

@ -0,0 +1,186 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.bigScreen.service.mapper.BigScreenMapper">
<!--原料库存物料分析 物料、数量、百分比-->
<select id="inventoryAnalysis" resultType="java.util.Map">
SELECT vm.material_id,
material.material_code,
material.material_name,
SUM(vm.material_qty) AS total_material_qty,
CONCAT(FORMAT((SUM(vm.material_qty) / total.total_qty) * 100, 2), '%') AS percentage
FROM sch_base_point `point`
LEFT JOIN sch_base_vehiclematerialgroup vm ON `point`.vehicle_code = vm.vehicle_code
LEFT JOIN md_base_material material ON vm.material_id = material.material_id
CROSS JOIN (
SELECT SUM(vm.material_qty) AS total_qty
FROM sch_base_point `point`
LEFT JOIN sch_base_vehiclematerialgroup vm ON `point`.vehicle_code = vm.vehicle_code
WHERE `point`.region_code = 'YCL'
AND vm.group_bind_material_status = '2'
AND vm.group_status = '2'
AND vm.link_status = '1'
) total
WHERE `point`.region_code = 'YCL'
AND vm.group_bind_material_status = '2'
AND vm.group_status = '2'
AND vm.link_status = '1'
GROUP BY vm.material_id,
material.material_code,
material.material_name,
total.total_qty;
</select>
<!--根据任务流转统计当日搬运托数-->
<select id="todayProduceStatistic" resultType="java.util.Map">
SELECT
region.region_name,
region.region_code,
COALESCE(task_counts.count, 0) AS count
FROM (
SELECT
region.region_code,
region.region_name
FROM
sch_base_region region
LEFT JOIN sch_base_point `point` ON region.region_code = `point`.region_code
WHERE
`point`.point_code IN ('XKBSKT', 'ZQTLKT1', 'BCXZKKT')
GROUP BY
region.region_code
) AS region
LEFT JOIN (
SELECT
`point`.region_code,
COUNT(task.task_id) AS count
FROM
sch_base_task task
LEFT JOIN sch_base_point `point` ON task.point_code1 = `point`.point_code
WHERE
task.point_code1 IN ('XKBSKT', 'ZQTLKT1', 'BCXZKKT')
AND task.task_status = '5'
AND task.create_time = CURDATE()
GROUP BY
`point`.region_code
) AS task_counts ON region.region_code = task_counts.region_code
ORDER BY
region.region_code;
</select>
<!--查询当天物料的出入库数量-->
<select id="inventoryIOAnalysis" resultType="java.util.Map">
SELECT COALESCE
( instorage.material_id, outstorage.material_id ) AS material_id,
material.material_code,
material.material_name,
COALESCE ( instorage.total_material_qty, 0 ) AS total_instorage_qty,
COALESCE ( outstorage.total_material_qty, 0 ) AS total_outstorage_qty
FROM
md_base_material material
LEFT JOIN (
SELECT
vm.material_id,
SUM( vm.material_qty ) AS total_material_qty
FROM
sch_base_vehiclematerialgroup vm
WHERE
DATE ( vm.instorage_time ) = CURDATE()
AND (vm.group_bind_material_status = '2' or vm.group_bind_material_status = '3')
AND vm.group_status = '2'
AND vm.link_status = '1'
GROUP BY
vm.material_id
) AS instorage ON material.material_id = instorage.material_id
LEFT JOIN (
SELECT
vm.material_id,
SUM( vm.material_qty ) AS total_material_qty
FROM
sch_base_vehiclematerialgroup vm
WHERE
DATE ( vm.update_time ) = CURDATE()
AND vm.group_bind_material_status = '3'
AND vm.group_status = '2'
AND vm.link_status = '1'
GROUP BY
vm.material_id
) AS outstorage ON material.material_id = outstorage.material_id
WHERE
instorage.material_id IS NOT NULL
OR outstorage.material_id IS NOT NULL;
</select>
<!--查询历史出入库数量-->
<select id="historyInventoryIOAnalysis" resultType="java.util.Map">
SELECT
DATE_FORMAT( date_table.DATE, '%m-%d' ) AS `data`,
SUM(
CASE
WHEN (vm.group_bind_material_status = '2' or vm.group_bind_material_status = '3')
AND vm.group_status = '2'
AND vm.link_status = '1'
AND DATE ( vm.instorage_time ) = date_table.DATE THEN
vm.material_qty ELSE 0
END
) AS total_instorage_qty,
SUM(
CASE
WHEN vm.group_bind_material_status = '3'
AND vm.group_status = '2'
AND vm.link_status = '1'
AND DATE ( vm.update_time ) = date_table.DATE THEN
vm.material_qty ELSE 0
END
) AS total_outstorage_qty
FROM
(
SELECT
CURDATE() - INTERVAL seq DAY AS DATE
FROM
( SELECT 0 AS seq UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 ) AS seq_table
) AS date_table
LEFT JOIN sch_base_vehiclematerialgroup vm ON DATE ( vm.instorage_time ) = date_table.DATE
OR DATE ( vm.update_time ) = date_table.DATE
GROUP BY
date_table.DATE
ORDER BY
date_table.DATE;
</select>
<!--当日车间上下料根据区域统计-->
<select id="todayLoadingAndUnloadingStatistics" resultType="java.util.Map">
SELECT
region.region_code,
region.region_name,
COALESCE(loading.material_loading_count, 0) AS material_loading_count,
COALESCE(unloading.material_unloading_count, 0) AS material_unloading_count
FROM sch_base_region region
LEFT JOIN (
SELECT
`point`.region_code,
SUM(CASE WHEN point.point_type = '1' THEN 1 ELSE 0 END) AS material_loading_count
FROM sch_base_task task
LEFT JOIN sch_base_point `point` ON task.point_code2 = `point`.point_code
WHERE task.task_status = '5'
AND `point`.region_code NOT IN ('YCL', 'JLHC', 'ZP', 'KTPHC1', 'KTPHC2')
AND DATE(task.create_time) = CURDATE()
GROUP BY `point`.region_code
) AS loading ON region.region_code = loading.region_code
LEFT JOIN (
SELECT
`point`.region_code,
SUM(CASE WHEN point.point_type = '2' THEN 1 ELSE 0 END) AS material_unloading_count
FROM sch_base_task task
LEFT JOIN sch_base_point `point` ON task.point_code1 = `point`.point_code
WHERE task.task_status = '5'
AND `point`.region_code NOT IN ('YCL', 'JLHC', 'ZP', 'KTPHC1', 'KTPHC2')
AND DATE(task.create_time) = CURDATE()
GROUP BY `point`.region_code
) AS unloading ON region.region_code = unloading.region_code
WHERE region.region_code NOT IN ('YCL', 'JLHC', 'ZP', 'KTPHC1', 'KTPHC2')
ORDER BY region.region_code;
</select>
</mapper>

7
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<DeviceInfoDto> list);
AcsResponse agvInfo();
AcsResponse rgvInfo();
AcsResponse todayTask();
}

19
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());
}
}

1
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,

8
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()

Loading…
Cancel
Save