完善大屏接口生产统计,
设备情况, 仓储情况, 车间情况相关逻辑。
This commit is contained in:
@@ -0,0 +1,57 @@
|
|||||||
|
package org.nl.modules.common.utils.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author gbx
|
||||||
|
* 是否枚举
|
||||||
|
* @since 2023-03-01
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum IsOrNotEnum{
|
||||||
|
/**
|
||||||
|
* true
|
||||||
|
*/
|
||||||
|
YES("否", "0"),
|
||||||
|
/**
|
||||||
|
* false
|
||||||
|
*/
|
||||||
|
NO("是", "1");
|
||||||
|
private String name;
|
||||||
|
private String index;
|
||||||
|
|
||||||
|
IsOrNotEnum(String name, String index) {
|
||||||
|
this.name = name;
|
||||||
|
this.index = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(String index) {
|
||||||
|
for(IsOrNotEnum c : IsOrNotEnum.values()) {
|
||||||
|
if(c.getIndex().equals(index)) {
|
||||||
|
return c.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndex(String index) {
|
||||||
|
this.index = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return this.index + "_" + this.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package org.nl.modules.common.utils.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author gbx
|
||||||
|
* 设备状态枚举
|
||||||
|
* @since 2023-03-01
|
||||||
|
*/
|
||||||
|
public enum PointStatusEnum{
|
||||||
|
/**
|
||||||
|
* 运行
|
||||||
|
*/
|
||||||
|
RUN("运行", "1"),
|
||||||
|
/**
|
||||||
|
* 暂停
|
||||||
|
*/
|
||||||
|
STOP("暂停", "2"),
|
||||||
|
/**
|
||||||
|
* 故障
|
||||||
|
*/
|
||||||
|
FAULT("故障", "3");
|
||||||
|
private String name;
|
||||||
|
private String index;
|
||||||
|
|
||||||
|
PointStatusEnum(String name, String index) {
|
||||||
|
this.name = name;
|
||||||
|
this.index = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(String index) {
|
||||||
|
for(PointStatusEnum c : PointStatusEnum.values()) {
|
||||||
|
if(c.getIndex().equals(index)) {
|
||||||
|
return c.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndex(String index) {
|
||||||
|
this.index = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return this.index + "_" + this.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +1,19 @@
|
|||||||
package org.nl.wms.cockpit.rest;
|
package org.nl.wms.cockpit.rest;
|
||||||
|
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.wms.cockpit.service.CockpitService;
|
import org.nl.wms.cockpit.service.CockpitService;
|
||||||
import org.nl.wms.cockpit.service.dto.WorkorderDto;
|
import org.nl.wms.cockpit.service.dto.DeviceDetailDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.nl.wms.cockpit.service.dto.DeviceStatusDto;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 大屏数据
|
* 大屏数据
|
||||||
*
|
*
|
||||||
@@ -52,12 +54,25 @@ public class CockpitController{
|
|||||||
@GetMapping("/deviceMonitor")
|
@GetMapping("/deviceMonitor")
|
||||||
@Log("设备监控")
|
@Log("设备监控")
|
||||||
@ApiOperation("设备监控")
|
@ApiOperation("设备监控")
|
||||||
public ResponseEntity<Object> deviceMonitor() {
|
public ResponseEntity<List<DeviceStatusDto>> deviceMonitor() {
|
||||||
return new ResponseEntity<>(cockpitService.deviceMonitor(), HttpStatus.OK);
|
return new ResponseEntity<>(cockpitService.deviceMonitor(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车间情况
|
* 根据点位id获取设备信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/findDeviceById/{id}")
|
||||||
|
@Log("根据点位id获取设备信息")
|
||||||
|
@ApiOperation("根据点位id获取设备信息")
|
||||||
|
public ResponseEntity<DeviceDetailDto> findDeviceById(@PathVariable String id) {
|
||||||
|
if(null == id) {
|
||||||
|
throw new BadRequestException("更新定时任务失败");
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(cockpitService.findDeviceById(id), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 車间情况
|
||||||
*/
|
*/
|
||||||
@GetMapping("/workshopCondition")
|
@GetMapping("/workshopCondition")
|
||||||
@Log("车间情况")
|
@Log("车间情况")
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package org.nl.wms.cockpit.service;
|
package org.nl.wms.cockpit.service;
|
||||||
|
|
||||||
import org.nl.wms.cockpit.service.dto.WorkorderDto;
|
import org.nl.wms.cockpit.service.dto.DeviceDetailDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.nl.wms.cockpit.service.dto.DeviceStatusDto;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,21 +16,32 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
public interface CockpitService{
|
public interface CockpitService{
|
||||||
/**
|
/**
|
||||||
* 生产统计
|
* 生产统计
|
||||||
|
* @return 返回统计结果集
|
||||||
*/
|
*/
|
||||||
ConcurrentHashMap<String,Object> productionStatistics();
|
ConcurrentHashMap<String,Object> productionStatistics();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓储监控
|
* 仓储监控
|
||||||
|
* @return 返回统计结果集
|
||||||
*/
|
*/
|
||||||
ConcurrentHashMap<String,Object> storageMonitor();
|
ConcurrentHashMap<String,Object> storageMonitor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备监控
|
* 设备监控
|
||||||
|
* @return 返回统计结果集
|
||||||
*/
|
*/
|
||||||
ConcurrentHashMap<String,Object> deviceMonitor();
|
List<DeviceStatusDto> deviceMonitor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车间情况
|
* 根据point_id获取设备信息
|
||||||
|
* @param id 点位id
|
||||||
|
* @return 返回统计结果集
|
||||||
*/
|
*/
|
||||||
ConcurrentHashMap<String,Object> workshopCondition();
|
DeviceDetailDto findDeviceById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 車间情况
|
||||||
|
* @return 返回统计结果集
|
||||||
|
*/
|
||||||
|
Map<String,Object> workshopCondition();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package org.nl.wms.cockpit.service.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author gbx
|
||||||
|
* 设备状态
|
||||||
|
* @date 2023-03-01
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DeviceDetailDto extends DeviceStatusDto{
|
||||||
|
/**
|
||||||
|
* 混碾机,压力机,窑外层弹出框已生产数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**已生产数量*/")
|
||||||
|
private String real_qty;
|
||||||
|
/**
|
||||||
|
* 载具
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**载具*/")
|
||||||
|
private String vehicle_code;
|
||||||
|
/**
|
||||||
|
* 入库时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**入库时间*/")
|
||||||
|
private String instorage_time;
|
||||||
|
/**
|
||||||
|
* 搬运托盘数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**搬运托盘数*/")
|
||||||
|
private String pallet_qty;
|
||||||
|
/**
|
||||||
|
* 搬入准备车道
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**搬入准备车道*/")
|
||||||
|
private String ready_lane;
|
||||||
|
/**
|
||||||
|
* 窑1窑车数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**窑1窑车数*/")
|
||||||
|
private String first_kiln_qty;
|
||||||
|
/**
|
||||||
|
* 窑2窑车数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**窑2窑车数*/")
|
||||||
|
private String second_kiln_qty;
|
||||||
|
/**
|
||||||
|
* 搬入1号窑
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**搬入1号窑*/")
|
||||||
|
private String move_first_kiln;
|
||||||
|
/**
|
||||||
|
* 搬入2号窑
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**搬入2号窑*/")
|
||||||
|
private String move_second_kiln;
|
||||||
|
/**
|
||||||
|
* 当前窑车数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**当前窑车数*/")
|
||||||
|
private String present_kiln_qty;
|
||||||
|
/**
|
||||||
|
* 容量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**容量*/")
|
||||||
|
private String volume;
|
||||||
|
/**
|
||||||
|
* 故障信息
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**故障信息*/")
|
||||||
|
private String faulty_info;
|
||||||
|
/**
|
||||||
|
* 完成托盘数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**完成托盘数*/")
|
||||||
|
private String finish_pallet_qty;
|
||||||
|
/**
|
||||||
|
* 机械手完成托盘数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**机械手完成托盘数*/")
|
||||||
|
private String mechanical_pallet_qty;
|
||||||
|
/**
|
||||||
|
* 机械手完成数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**机械手完成数量*/")
|
||||||
|
private String mechanical_arm_qty;
|
||||||
|
/**
|
||||||
|
* 包装机完成数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**包装机完成数量*/")
|
||||||
|
private String pack_qty;
|
||||||
|
/**
|
||||||
|
* 完成跺数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**完成跺数*/")
|
||||||
|
private String finish_pile_qty;
|
||||||
|
/**
|
||||||
|
* 混碾机,破碎机本日生产信息
|
||||||
|
*/
|
||||||
|
List<ProductionInfoDto> mixingList;
|
||||||
|
/**
|
||||||
|
* 压力机,机械手本日生产信息
|
||||||
|
*/
|
||||||
|
List<ProductionInfoDto> crushingList;
|
||||||
|
/**
|
||||||
|
* 窑本日生产信息
|
||||||
|
*/
|
||||||
|
List<ProductionInfoDto> mKilnList;
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package org.nl.wms.cockpit.service.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author gbx
|
||||||
|
* 设备统计
|
||||||
|
* @since 2023-03-01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DeviceStatisticsDto{
|
||||||
|
/**
|
||||||
|
* 1混料2压制3干燥4包装(成品)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**1混料2压制3干燥4包装(成品)*/")
|
||||||
|
private String workorder_procedure;
|
||||||
|
/**
|
||||||
|
* 设备编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**设备编码*/")
|
||||||
|
private String deviceCode;
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**设备名称*/")
|
||||||
|
private String deviceName;
|
||||||
|
/**
|
||||||
|
* 1运行2故障3暂停
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**1运行2故障3暂停*/")
|
||||||
|
private String pointStatus;
|
||||||
|
/**
|
||||||
|
* 故障时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**故障时间*/")
|
||||||
|
private String faultyTime;
|
||||||
|
/**
|
||||||
|
* 总设备数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**总设备数*/")
|
||||||
|
private Integer deviceQty;
|
||||||
|
/**
|
||||||
|
* 故障设备数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**故障设备数*/")
|
||||||
|
private Integer faultyDevice;
|
||||||
|
/**
|
||||||
|
* 故障次数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**故障次数*/")
|
||||||
|
private Integer faultyFrequency;
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package org.nl.wms.cockpit.service.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author gbx
|
||||||
|
* 设备状态
|
||||||
|
* @date 2023-02-28
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DeviceStatusDto implements Serializable{
|
||||||
|
/**
|
||||||
|
* 点位标识
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long point_id;
|
||||||
|
/**
|
||||||
|
* 点位编码
|
||||||
|
*/
|
||||||
|
private String point_code;
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String point_name;
|
||||||
|
/**
|
||||||
|
* 设备状态:1未生产2已下发3生产中4暂停5完成
|
||||||
|
*/
|
||||||
|
private String point_status;
|
||||||
|
/**
|
||||||
|
* 当前生产物料ID
|
||||||
|
*/
|
||||||
|
private Long material_id;
|
||||||
|
/**
|
||||||
|
* 当前生产名称
|
||||||
|
*/
|
||||||
|
private String material_name;
|
||||||
|
/**
|
||||||
|
* 重量(如混料 24.00*0.89,0.89为重量)
|
||||||
|
*/
|
||||||
|
private BigDecimal ivt_weight;
|
||||||
|
/**
|
||||||
|
* 已工作时间
|
||||||
|
*/
|
||||||
|
private String work_time;
|
||||||
|
/**
|
||||||
|
* 已生产数量
|
||||||
|
*/
|
||||||
|
private BigDecimal ivt_qty;
|
||||||
|
/**
|
||||||
|
* 载具数量(当前窑车数)
|
||||||
|
*/
|
||||||
|
private Integer vehicle_qty;
|
||||||
|
/**
|
||||||
|
* 容量
|
||||||
|
*/
|
||||||
|
private BigDecimal vehicle_max_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备图片
|
||||||
|
*/
|
||||||
|
private String device_url;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package org.nl.wms.cockpit.service.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author gbx
|
||||||
|
* 成品完成情况
|
||||||
|
* @since 2023/2/27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ProductionInfoDto{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本日生产内容
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**本日生产内容*/")
|
||||||
|
private String productionDetails;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产厂家
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**生产厂家*/")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已生产数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**已生产数量*/")
|
||||||
|
private String productionQty;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产单位
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**生产单位*/")
|
||||||
|
private String weightUnitName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,32 +6,45 @@ import lombok.Builder;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author gbx
|
* @author gbx
|
||||||
* @description
|
* 成品完成情况
|
||||||
* @since 2023/2/27
|
* @since 2023/2/27
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ProductionStatisticsDto
|
public class ProductionStatisticsDto{
|
||||||
{
|
/**
|
||||||
|
* 1混料2压制3干燥4包装(成品)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "/**1混料2压制3干燥4包装(成品)*/")
|
||||||
@ApiModelProperty(value = "/**工序*/")
|
private String workorder_procedure;
|
||||||
/** 工序 */
|
/**
|
||||||
private BigDecimal workorderProcedure;
|
* 计划生产数量
|
||||||
|
*/
|
||||||
@ApiModelProperty(value = "/**计划数量*/")
|
@ApiModelProperty(value = "/**计划数量*/")
|
||||||
/** 计划数量 */
|
private BigDecimal plan_qty;
|
||||||
private BigDecimal planQty;
|
|
||||||
|
|
||||||
|
public void setPlanQty(BigDecimal plan_qty) {
|
||||||
|
if(null == plan_qty) {
|
||||||
|
this.plan_qty = BigDecimal.valueOf(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已完成数量
|
||||||
|
*/
|
||||||
@ApiModelProperty(value = "/**实际数量*/")
|
@ApiModelProperty(value = "/**实际数量*/")
|
||||||
/** 实际数量 */
|
private BigDecimal real_qty;
|
||||||
private BigDecimal realQty;
|
|
||||||
|
public void setRealQty(BigDecimal real_qty) {
|
||||||
|
if(null == real_qty) {
|
||||||
|
this.real_qty = BigDecimal.valueOf(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author gbx
|
* @author gbx
|
||||||
* @description
|
* 仓储状态
|
||||||
* @since 2023/2/27
|
* @since 2023/2/27
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@@ -25,175 +25,40 @@ public class SchBasePointDto implements Serializable{
|
|||||||
*/
|
*/
|
||||||
private String point_code;
|
private String point_code;
|
||||||
/**
|
/**
|
||||||
* 物料号
|
* 货位
|
||||||
*/
|
|
||||||
private String material_code;
|
|
||||||
/**
|
|
||||||
* 生产物料
|
|
||||||
*/
|
|
||||||
private String material_name;
|
|
||||||
/**
|
|
||||||
* 点位名称
|
|
||||||
*/
|
*/
|
||||||
private String point_name;
|
private String point_name;
|
||||||
/**
|
/**
|
||||||
* 所属区域
|
* 货位状态
|
||||||
*/
|
|
||||||
private Long region_id;
|
|
||||||
/**
|
|
||||||
* 区域编码
|
|
||||||
*/
|
|
||||||
private String region_code;
|
|
||||||
/**
|
|
||||||
* 区域名称
|
|
||||||
*/
|
|
||||||
private String region_name;
|
|
||||||
/**
|
|
||||||
* 点位类型
|
|
||||||
*/
|
|
||||||
private String point_type;
|
|
||||||
/**
|
|
||||||
* 点位状态
|
|
||||||
*/
|
*/
|
||||||
private String point_status;
|
private String point_status;
|
||||||
/**
|
|
||||||
* 锁定类型
|
|
||||||
*/
|
|
||||||
private String lock_type;
|
|
||||||
/**
|
|
||||||
* 设备编码
|
|
||||||
*/
|
|
||||||
private String device_code;
|
|
||||||
/**
|
|
||||||
* MES设备编码
|
|
||||||
*/
|
|
||||||
private String mes_device_code;
|
|
||||||
/**
|
|
||||||
* 允许的载具类型
|
|
||||||
*/
|
|
||||||
private String can_vehicle_type;
|
|
||||||
/**
|
|
||||||
* 载具类型
|
|
||||||
*/
|
|
||||||
private String vehicle_type;
|
|
||||||
/**
|
|
||||||
* 载具编码
|
|
||||||
*/
|
|
||||||
private String vehicle_code;
|
|
||||||
/**
|
|
||||||
* 载具数量
|
|
||||||
*/
|
|
||||||
private BigDecimal vehicle_qty;
|
|
||||||
/**
|
|
||||||
* 块
|
|
||||||
*/
|
|
||||||
private BigDecimal block_num;
|
|
||||||
/**
|
|
||||||
* 排
|
|
||||||
*/
|
|
||||||
private BigDecimal row_num;
|
|
||||||
/**
|
|
||||||
* 列
|
|
||||||
*/
|
|
||||||
private BigDecimal col_num;
|
|
||||||
/**
|
|
||||||
* 层
|
|
||||||
*/
|
|
||||||
private BigDecimal layer_num;
|
|
||||||
/**
|
|
||||||
* 点位组编码
|
|
||||||
*/
|
|
||||||
private String point_group_code;
|
|
||||||
/**
|
|
||||||
* 是否建工单
|
|
||||||
*/
|
|
||||||
private String is_have_workder;
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
/**
|
|
||||||
* 来源标识
|
|
||||||
*/
|
|
||||||
private Long source_id;
|
|
||||||
/**
|
|
||||||
* 是否启用
|
|
||||||
*/
|
|
||||||
private String is_used;
|
|
||||||
/**
|
|
||||||
* 是否删除
|
|
||||||
*/
|
|
||||||
private String is_delete;
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private Long create_id;
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String create_name;
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private String create_time;
|
|
||||||
/**
|
|
||||||
* 修改人
|
|
||||||
*/
|
|
||||||
private Long update_optid;
|
|
||||||
/**
|
|
||||||
* 修改人
|
|
||||||
*/
|
|
||||||
private String update_optname;
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
private String update_time;
|
|
||||||
/**
|
|
||||||
* 载具允许最大数量
|
|
||||||
*/
|
|
||||||
private BigDecimal vehicle_max_qty;
|
|
||||||
/**
|
|
||||||
* 入库顺序
|
|
||||||
*/
|
|
||||||
private BigDecimal in_order_seq;
|
|
||||||
/**
|
|
||||||
* 出库顺序
|
|
||||||
*/
|
|
||||||
private BigDecimal out_order_seq;
|
|
||||||
/**
|
|
||||||
* 入空载具顺序
|
|
||||||
*/
|
|
||||||
private BigDecimal in_empty_seq;
|
|
||||||
/**
|
|
||||||
* 出空载具顺序
|
|
||||||
*/
|
|
||||||
private BigDecimal out_empty_seq;
|
|
||||||
/**
|
|
||||||
* 在执行的任务标识
|
|
||||||
*/
|
|
||||||
private Long task_id;
|
|
||||||
/**
|
/**
|
||||||
* 物料标识
|
* 物料标识
|
||||||
*/
|
*/
|
||||||
private Long material_id;
|
private Long material_id;
|
||||||
/**
|
/**
|
||||||
* 批次
|
* 物料名称
|
||||||
*/
|
*/
|
||||||
private String pcsn;
|
private String material_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 托盘号
|
||||||
|
*/
|
||||||
|
private String vehicle_code;
|
||||||
/**
|
/**
|
||||||
* 库存数
|
* 库存数
|
||||||
*/
|
*/
|
||||||
private BigDecimal ivt_qty;
|
private BigDecimal ivt_qty;
|
||||||
/**
|
/**
|
||||||
* 计量单位标识
|
* 重量
|
||||||
*/
|
*/
|
||||||
private Long qty_unit_id;
|
private BigDecimal ivt_weight;
|
||||||
/**
|
/**
|
||||||
* 入库时间
|
* 入库时间
|
||||||
*/
|
*/
|
||||||
private String instorage_time;
|
private String instorage_time;
|
||||||
/**
|
/**
|
||||||
* 静置时间(分钟)
|
* 已静置时间
|
||||||
*/
|
*/
|
||||||
private BigDecimal standing_time;
|
private BigDecimal standing_time;
|
||||||
/**
|
/**
|
||||||
@@ -201,7 +66,11 @@ public class SchBasePointDto implements Serializable{
|
|||||||
*/
|
*/
|
||||||
private String standing_status;
|
private String standing_status;
|
||||||
/**
|
/**
|
||||||
* 是否关联库存表
|
* 阈值
|
||||||
*/
|
*/
|
||||||
private String is_ref_ivt;
|
private String warn_time;
|
||||||
|
/**
|
||||||
|
* 是否满托
|
||||||
|
*/
|
||||||
|
private String is_full;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author gbx
|
* @author gbx
|
||||||
* @description
|
* 生产统计
|
||||||
* @date 2023-02-27
|
* @date 2023-02-27
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class WorkorderDto implements Serializable{
|
public class WorkorderDto implements Serializable{
|
||||||
/**
|
/**
|
||||||
*工单标识
|
* 工单标识
|
||||||
*/
|
*/
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long workorder_id;
|
private Long workorder_id;
|
||||||
@@ -37,95 +37,30 @@ public class WorkorderDto implements Serializable{
|
|||||||
*/
|
*/
|
||||||
private String material_name;
|
private String material_name;
|
||||||
/**
|
/**
|
||||||
* 生产日期
|
* 客户
|
||||||
*/
|
*/
|
||||||
private String produce_date;
|
private String cust_name;
|
||||||
/**
|
/**
|
||||||
* 计划数量
|
* 计划量(计划生产量)
|
||||||
*/
|
*/
|
||||||
private BigDecimal plan_qty;
|
private BigDecimal plan_qty;
|
||||||
/**
|
/**
|
||||||
* 实际数量
|
* 生产量(已完成数量)
|
||||||
*/
|
*/
|
||||||
private BigDecimal real_qty;
|
private BigDecimal real_qty;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料标识
|
* 生产状态1未生产2已下发3生产中4停止5完成
|
||||||
*/
|
|
||||||
private Long material_id;
|
|
||||||
/**
|
|
||||||
* 载具类型
|
|
||||||
*/
|
|
||||||
private String vehicle_type;
|
|
||||||
/**
|
|
||||||
* 计划生产开始时间
|
|
||||||
*/
|
|
||||||
private String planproducestart_date;
|
|
||||||
/**
|
|
||||||
* 计划生产结束时间
|
|
||||||
*/
|
|
||||||
private String planproduceend_date;
|
|
||||||
/**
|
|
||||||
* 实际生产开始时间
|
|
||||||
*/
|
|
||||||
private String realproducestart_date;
|
|
||||||
/**
|
|
||||||
* 实际生产结束时间
|
|
||||||
*/
|
|
||||||
private String realproduceend_date;
|
|
||||||
/**
|
|
||||||
* 设备标识
|
|
||||||
*/
|
|
||||||
private Long device_id;
|
|
||||||
/**
|
|
||||||
* 所属工序:1-压制2-干燥3-成品
|
|
||||||
*/
|
|
||||||
private String workorder_procedure;
|
|
||||||
/**
|
|
||||||
* 工单状态
|
|
||||||
*/
|
*/
|
||||||
private String order_status;
|
private String order_status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否搬运
|
* 班次类型
|
||||||
*/
|
*/
|
||||||
private String is_needmove;
|
private String shift_type;
|
||||||
/**
|
/**
|
||||||
* 回传MES状态
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
private String passback_status;
|
private String realproducestart_date;
|
||||||
/**
|
|
||||||
* 外部标识
|
|
||||||
*/
|
|
||||||
private String ext_id;
|
|
||||||
/**
|
|
||||||
* 是否删除
|
|
||||||
*/
|
|
||||||
private String is_delete;
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private Long create_id;
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String create_name;
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private String create_time;
|
|
||||||
/**
|
|
||||||
* 修改人
|
|
||||||
*/
|
|
||||||
private Long update_optid;
|
|
||||||
/**
|
|
||||||
* 修改人
|
|
||||||
*/
|
|
||||||
private String update_optname;
|
|
||||||
/**
|
|
||||||
* 工单编号
|
|
||||||
*/
|
|
||||||
private String workorder_code;
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
private String update_time;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,37 +3,24 @@ package org.nl.wms.cockpit.service.impl;
|
|||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.var;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.checkerframework.checker.units.qual.A;
|
|
||||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.utils.enums.IsOrNotEnum;
|
||||||
|
import org.nl.modules.common.utils.enums.PointStatusEnum;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.wms.cockpit.service.CockpitService;
|
import org.nl.wms.cockpit.service.CockpitService;
|
||||||
import org.nl.wms.cockpit.service.dto.ProductionStatisticsDto;
|
import org.nl.wms.cockpit.service.dto.*;
|
||||||
import org.nl.wms.cockpit.service.dto.SchBasePointDto;
|
|
||||||
import org.nl.wms.cockpit.service.dto.WorkorderDto;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.nl.modules.common.utils.SecurityUtils;
|
|
||||||
import org.nl.modules.wql.core.bean.ResultBean;
|
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
|
||||||
import org.nl.modules.wql.util.WqlUtil;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 大屏服务实现
|
* 大屏服务实现
|
||||||
@@ -54,37 +41,50 @@ public class CockpitServiceImpl implements CockpitService{
|
|||||||
@Override
|
@Override
|
||||||
public ConcurrentHashMap<String,Object> productionStatistics() {
|
public ConcurrentHashMap<String,Object> productionStatistics() {
|
||||||
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
||||||
ConcurrentHashMap<String,Object> map = new ConcurrentHashMap<>();
|
ConcurrentHashMap<String,Object> map = new ConcurrentHashMap<>(3);
|
||||||
// 1、获取生产任务列表
|
// 1、获取生产任务列表、
|
||||||
CompletableFuture<List<WorkorderDto>> productionTask = CompletableFuture.supplyAsync(() -> {
|
CompletableFuture<List<WorkorderDto>> productionTask = CompletableFuture.supplyAsync(() -> {
|
||||||
List<WorkorderDto> res = new CopyOnWriteArrayList<>();
|
List<WorkorderDto> res = new CopyOnWriteArrayList<>();
|
||||||
JSONArray result = WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "1").process().getResultJSONArray(0);
|
JSONArray result = WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "1").process().getResultJSONArray(0);
|
||||||
if(ObjectUtil.isNotEmpty(result)) {
|
if(ObjectUtil.isNotEmpty(result)) {
|
||||||
res = result.toJavaList(WorkorderDto.class);
|
res = result.toJavaList(WorkorderDto.class);
|
||||||
|
res.forEach(r -> {
|
||||||
|
r.setCust_name("新余钢铁");
|
||||||
|
if(StringUtils.isNotEmpty(r.getLabel())) {
|
||||||
|
r.setLabel(r.getLabel().substring(0, 2));
|
||||||
|
r.setShift_type(r.getLabel().substring(0, 2) + "白班");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}, pool);
|
}, pool);
|
||||||
productionTask.thenAccept((result) -> {
|
productionTask.thenAccept((result) -> map.put("productionTask", result)).exceptionally((e) -> {
|
||||||
map.put("productionTask", result);
|
|
||||||
}).exceptionally((e) -> {
|
|
||||||
log.error("获取生产任务列表: {}", e.getMessage(), e);
|
log.error("获取生产任务列表: {}", e.getMessage(), e);
|
||||||
map.put("productionTask", "");
|
map.put("productionTask", "");
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
// 2、获取原料计划完成情况
|
// 2、获取原料计划完成情况
|
||||||
CompletableFuture<JSONArray> materialTask = CompletableFuture.supplyAsync(() -> WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "2").process().getResultJSONArray(0), pool);
|
CompletableFuture<JSONArray> materialTask = CompletableFuture.supplyAsync(() -> WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "2").process().getResultJSONArray(0), pool);
|
||||||
materialTask.thenAccept((result) -> {
|
materialTask.thenAccept((result) -> map.put("materialTask", result)).exceptionally((e) -> {
|
||||||
map.put("materialTask", result);
|
|
||||||
}).exceptionally((e) -> {
|
|
||||||
log.error("获取原料计划完成情况: {}", e.getMessage(), e);
|
log.error("获取原料计划完成情况: {}", e.getMessage(), e);
|
||||||
map.put("materialTask", "");
|
map.put("materialTask", "");
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
// 3、获取成品计划完成情况,今日压制量,干燥量,成品量
|
// 3、获取成品计划完成情况,今日压制量,干燥量,成品量
|
||||||
CompletableFuture<JSONArray> finishedTask = CompletableFuture.supplyAsync(() -> WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "3").process().getResultJSONArray(0), pool);
|
CompletableFuture<List<ProductionStatisticsDto>> finishedTask = CompletableFuture.supplyAsync(() -> {
|
||||||
finishedTask.thenAccept((result) -> {
|
List<ProductionStatisticsDto> res = new CopyOnWriteArrayList<>();
|
||||||
map.put("finishedTask", result);
|
JSONArray result = WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "3").process().getResultJSONArray(0);
|
||||||
}).exceptionally((e) -> {
|
if(ObjectUtil.isNotEmpty(result)) {
|
||||||
|
res = result.toJavaList(ProductionStatisticsDto.class);
|
||||||
|
res.forEach(r -> {
|
||||||
|
if(StringUtils.isNotEmpty(r.getWorkorder_procedure())) {
|
||||||
|
r.setWorkorder_procedure(Objects.equals(r.getWorkorder_procedure(), "2") ? "今日压制量" : Objects.equals(r.getWorkorder_procedure(), "3") ? "今日干燥量" : "今日成品量");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}, pool);
|
||||||
|
finishedTask.thenAccept((result) -> map.put("finishedTask", result)).exceptionally((e) -> {
|
||||||
log.error("获取成品计划完成情况: {}", e.getMessage(), e);
|
log.error("获取成品计划完成情况: {}", e.getMessage(), e);
|
||||||
map.put("finishedTask", "");
|
map.put("finishedTask", "");
|
||||||
return null;
|
return null;
|
||||||
@@ -107,7 +107,7 @@ public class CockpitServiceImpl implements CockpitService{
|
|||||||
@Override
|
@Override
|
||||||
public ConcurrentHashMap<String,Object> storageMonitor() {
|
public ConcurrentHashMap<String,Object> storageMonitor() {
|
||||||
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
||||||
ConcurrentHashMap<String,Object> map = new ConcurrentHashMap<>();
|
ConcurrentHashMap<String,Object> map = new ConcurrentHashMap<>(2);
|
||||||
// 1、获取原料仓储信息
|
// 1、获取原料仓储信息
|
||||||
CompletableFuture<List<SchBasePointDto>> materialStorage = CompletableFuture.supplyAsync(() -> {
|
CompletableFuture<List<SchBasePointDto>> materialStorage = CompletableFuture.supplyAsync(() -> {
|
||||||
List<SchBasePointDto> res = new CopyOnWriteArrayList<>();
|
List<SchBasePointDto> res = new CopyOnWriteArrayList<>();
|
||||||
@@ -115,11 +115,12 @@ public class CockpitServiceImpl implements CockpitService{
|
|||||||
if(ObjectUtil.isNotEmpty(result)) {
|
if(ObjectUtil.isNotEmpty(result)) {
|
||||||
res = result.toJavaList(SchBasePointDto.class);
|
res = result.toJavaList(SchBasePointDto.class);
|
||||||
res.forEach(schBasePointDto -> {
|
res.forEach(schBasePointDto -> {
|
||||||
|
//Todo 空盅和强制完成状态相关逻辑待完善
|
||||||
//根据入库时间和静置时间判断状态静置状态
|
//根据入库时间和静置时间判断状态静置状态
|
||||||
if(StringUtils.isNotBlank(schBasePointDto.getInstorage_time()) && null != schBasePointDto.getStanding_time()) {
|
if(StringUtils.isNotBlank(schBasePointDto.getInstorage_time()) && null != schBasePointDto.getStanding_time()) {
|
||||||
DateTime nowTime = DateUtil.parse(DateUtil.now(), DatePattern.NORM_DATETIME_FORMAT);
|
DateTime nowTime = DateUtil.parse(DateUtil.now(), DatePattern.NORM_DATETIME_FORMAT);
|
||||||
DateTime instorageTime = DateUtil.parse(schBasePointDto.getInstorage_time(), DatePattern.NORM_DATETIME_FORMAT);
|
DateTime inStorageTime = DateUtil.parse(schBasePointDto.getInstorage_time(), DatePattern.NORM_DATETIME_FORMAT);
|
||||||
long minute = DateUtil.between(nowTime, instorageTime, DateUnit.MINUTE);
|
long minute = DateUtil.between(nowTime, inStorageTime, DateUnit.MINUTE);
|
||||||
if(minute < schBasePointDto.getStanding_time().longValue()) {
|
if(minute < schBasePointDto.getStanding_time().longValue()) {
|
||||||
schBasePointDto.setStanding_status("静置中");
|
schBasePointDto.setStanding_status("静置中");
|
||||||
}
|
}
|
||||||
@@ -127,13 +128,15 @@ public class CockpitServiceImpl implements CockpitService{
|
|||||||
schBasePointDto.setStanding_status("静置完成");
|
schBasePointDto.setStanding_status("静置完成");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//是否满托
|
||||||
|
if(StringUtils.isNotEmpty(schBasePointDto.getIs_full())) {
|
||||||
|
schBasePointDto.setIs_full(IsOrNotEnum.getName(schBasePointDto.getIs_full()));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}, pool);
|
}, pool);
|
||||||
materialStorage.thenAccept((result) -> {
|
materialStorage.thenAccept((result) -> map.put("materialTask", result)).exceptionally((e) -> {
|
||||||
map.put("materialTask", result);
|
|
||||||
}).exceptionally((e) -> {
|
|
||||||
log.error("获取原料仓储信息: {}", e.getMessage(), e);
|
log.error("获取原料仓储信息: {}", e.getMessage(), e);
|
||||||
map.put("materialTask", "");
|
map.put("materialTask", "");
|
||||||
return null;
|
return null;
|
||||||
@@ -147,9 +150,7 @@ public class CockpitServiceImpl implements CockpitService{
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}, pool);
|
}, pool);
|
||||||
finishedStorage.thenAccept((result) -> {
|
finishedStorage.thenAccept((result) -> map.put("productionTask", result)).exceptionally((e) -> {
|
||||||
map.put("productionTask", result);
|
|
||||||
}).exceptionally((e) -> {
|
|
||||||
log.error("获取成品仓储信息: {}", e.getMessage(), e);
|
log.error("获取成品仓储信息: {}", e.getMessage(), e);
|
||||||
map.put("productionTask", "");
|
map.put("productionTask", "");
|
||||||
return null;
|
return null;
|
||||||
@@ -167,15 +168,111 @@ public class CockpitServiceImpl implements CockpitService{
|
|||||||
* 设备监控大屏信息
|
* 设备监控大屏信息
|
||||||
*
|
*
|
||||||
* @author gbx
|
* @author gbx
|
||||||
* @since 2023/2/27
|
* @since 2023/2/28
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ConcurrentHashMap<String,Object> deviceMonitor() {
|
public List<DeviceStatusDto> deviceMonitor() {
|
||||||
|
List<DeviceStatusDto> res;
|
||||||
|
JSONArray result = WQL.getWO("COCKPIT_DEVICE").addParam("flag", "1").process().getResultJSONArray(0);
|
||||||
|
if(ObjectUtil.isNotEmpty(result)) {
|
||||||
|
res = result.toJavaList(DeviceStatusDto.class);
|
||||||
|
//已工作时间
|
||||||
|
res.forEach(r -> {
|
||||||
|
//Todo 设备运行时间和图标相关暂为固定值,逻辑待完善
|
||||||
|
//设备运行时间
|
||||||
|
r.setWork_time("3.5 小时");
|
||||||
|
//设备监控图标
|
||||||
|
r.setDevice_url("ylj");
|
||||||
|
//设备运行状态
|
||||||
|
if(StringUtils.isNotEmpty(r.getPoint_status())) {
|
||||||
|
r.setPoint_status(PointStatusEnum.getName(r.getPoint_status()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return res;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据point_id获取设备信息
|
||||||
|
*
|
||||||
|
* @author gbx
|
||||||
|
* @since 2023/3/1
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ConcurrentHashMap<String,Object> workshopCondition() {
|
public DeviceDetailDto findDeviceById(String id) {
|
||||||
|
JSONObject rows = WQL.getWO("COCKPIT_DEVICE").addParam("flag", "2").addParam("point_id", id).process().uniqueResult(0);
|
||||||
|
if(ObjectUtil.isNotEmpty(rows)) {
|
||||||
|
DeviceDetailDto deviceDetailDto = rows.toJavaObject(DeviceDetailDto.class);
|
||||||
|
//Todo 点击设备弹窗临时演示数据,后面需要根据业务逻辑查询
|
||||||
|
deviceDetailDto.setReal_qty("1500 KG");
|
||||||
|
deviceDetailDto.setVehicle_code("L007");
|
||||||
|
deviceDetailDto.setPoint_status("运行中");
|
||||||
|
deviceDetailDto.setPallet_qty("120 托");
|
||||||
|
deviceDetailDto.setMove_first_kiln("30 托");
|
||||||
|
deviceDetailDto.setWork_time("3.5 小时");
|
||||||
|
deviceDetailDto.setMove_second_kiln("30 托");
|
||||||
|
deviceDetailDto.setDevice_url("ylj");
|
||||||
|
deviceDetailDto.setSecond_kiln_qty("0 车");
|
||||||
|
deviceDetailDto.setPresent_kiln_qty("15 车");
|
||||||
|
deviceDetailDto.setVolume("20 车");
|
||||||
|
deviceDetailDto.setReady_lane("60 托");
|
||||||
|
deviceDetailDto.setFirst_kiln_qty("20 车");
|
||||||
|
deviceDetailDto.setMove_second_kiln("20 托");
|
||||||
|
deviceDetailDto.setMechanical_arm_qty("12000 块");
|
||||||
|
deviceDetailDto.setPack_qty("1200");
|
||||||
|
deviceDetailDto.setFinish_pallet_qty("120 个");
|
||||||
|
deviceDetailDto.setMechanical_pallet_qty("120 托");
|
||||||
|
deviceDetailDto.setFinish_pile_qty("12 垛");
|
||||||
|
List<ProductionInfoDto> setMixingList = new ArrayList<>();
|
||||||
|
List<ProductionInfoDto> setCrushingList = new ArrayList<>();
|
||||||
|
setMixingList.add(ProductionInfoDto.builder().productionDetails("混料23.60*0.68").productionQty("1500").weightUnitName("KG").build());
|
||||||
|
setMixingList.add(ProductionInfoDto.builder().productionDetails("混料24.00*0.89").productionQty("800").weightUnitName("KG").build());
|
||||||
|
//混碾机,破碎机本日生产信息
|
||||||
|
deviceDetailDto.setMixingList(setMixingList);
|
||||||
|
setCrushingList.add(ProductionInfoDto.builder().productionDetails("压制M29*0.90*5.5-6.5M").productionQty("10000").manufacturer("新余").build());
|
||||||
|
setCrushingList.add(ProductionInfoDto.builder().productionDetails("压制Y22.00*0.80*2.5-3M").productionQty("15000").manufacturer("重钢").build());
|
||||||
|
//压力机,机械手本日生产信息
|
||||||
|
deviceDetailDto.setCrushingList(setCrushingList);
|
||||||
|
//窑本日生产信息
|
||||||
|
deviceDetailDto.setMKilnList(setCrushingList);
|
||||||
|
return deviceDetailDto;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 車间情况大屏信息
|
||||||
|
*
|
||||||
|
* @author gbx
|
||||||
|
* @since 2023/3/1
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String,Object> workshopCondition() {
|
||||||
|
//Todo 车间设备情况临时演示数据,后面需要根据业务逻辑查询
|
||||||
|
Map<String,Object> hashMap = new HashMap<>(3);
|
||||||
|
//运行情况
|
||||||
|
List<DeviceStatisticsDto> runningStatusList = new ArrayList<>();
|
||||||
|
runningStatusList.add(DeviceStatisticsDto.builder().workorder_procedure("混料").deviceQty(16).faultyDevice(2).build());
|
||||||
|
runningStatusList.add(DeviceStatisticsDto.builder().workorder_procedure("压制").deviceQty(14).faultyDevice(1).build());
|
||||||
|
runningStatusList.add(DeviceStatisticsDto.builder().workorder_procedure("干燥").deviceQty(6).faultyDevice(0).build());
|
||||||
|
runningStatusList.add(DeviceStatisticsDto.builder().workorder_procedure("包装").deviceQty(9).faultyDevice(3).build());
|
||||||
|
//近一个月故障次数
|
||||||
|
List<DeviceStatisticsDto> faultyStatusList = new ArrayList<>();
|
||||||
|
faultyStatusList.add(DeviceStatisticsDto.builder().deviceName("压制机4").faultyFrequency(91).build());
|
||||||
|
faultyStatusList.add(DeviceStatisticsDto.builder().deviceName("压制机9").faultyFrequency(82).build());
|
||||||
|
faultyStatusList.add(DeviceStatisticsDto.builder().deviceName("混料机5").faultyFrequency(71).build());
|
||||||
|
faultyStatusList.add(DeviceStatisticsDto.builder().deviceName("压制机3").faultyFrequency(33).build());
|
||||||
|
//最近5个故障设备
|
||||||
|
List<DeviceStatisticsDto> faultyInfoList = new ArrayList<>();
|
||||||
|
faultyInfoList.add(DeviceStatisticsDto.builder().faultyTime("2023-02-15 11:09:08").deviceCode("YZJ07SL01").deviceName("压制机7").pointStatus("3").build());
|
||||||
|
faultyInfoList.add(DeviceStatisticsDto.builder().faultyTime("2023-02-15 10:24:12").deviceCode("HLJ45W15").deviceName("混料机15").pointStatus("3").build());
|
||||||
|
faultyInfoList.add(DeviceStatisticsDto.builder().faultyTime("2023-02-15 10:01:33").deviceCode("YZJ02XL01").deviceName("压制机2").pointStatus("3").build());
|
||||||
|
faultyInfoList.add(DeviceStatisticsDto.builder().faultyTime("2023-02-14 15:21:31").deviceCode("HLJ02W03").deviceName("混料机3").pointStatus("3").build());
|
||||||
|
faultyInfoList.add(DeviceStatisticsDto.builder().faultyTime("2023-02-14 11:27:24").deviceCode("YZJ0903").deviceName("压制机9").pointStatus("3").build());
|
||||||
|
hashMap.put("runningStatus", runningStatusList);
|
||||||
|
hashMap.put("faultyStatus", faultyStatusList);
|
||||||
|
hashMap.put("faultyInfo", faultyInfoList);
|
||||||
|
return hashMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
## 表字段对应输入参数
|
## 表字段对应输入参数
|
||||||
#################################################
|
#################################################
|
||||||
输入.flag TYPEAS s_string
|
输入.flag TYPEAS s_string
|
||||||
输入.date TYPEAS s_string
|
输入.point_id TYPEAS s_string
|
||||||
|
|
||||||
|
|
||||||
[临时表]
|
[临时表]
|
||||||
@@ -39,17 +39,29 @@
|
|||||||
# 3、业务主过程 #
|
# 3、业务主过程 #
|
||||||
##########################################
|
##########################################
|
||||||
|
|
||||||
IF 输入.flag = "1"
|
IF 输入.flag = "1"
|
||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
|
SELECT point.*, material.material_name
|
||||||
ENDSELECT
|
FROM sch_base_point point
|
||||||
ENDPAGEQUERY
|
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
||||||
ENDIF
|
WHERE
|
||||||
|
region_code IN ( 'ZDCDX', 'YZQ', 'YZQ', 'YQ', 'HNQ', 'BZQ' )
|
||||||
IF 输入.flag = "2"
|
AND point_code NOT IN ( 'RGCLW01', 'RGCLW02', 'RGCLW03', 'RGCLW04' )
|
||||||
PAGEQUERY
|
ORDER BY
|
||||||
|
region_id
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "2"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT point.*, material.material_name
|
||||||
|
FROM sch_base_point point
|
||||||
|
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
||||||
|
WHERE 1=1
|
||||||
|
OPTION 输入.point_id <> ""
|
||||||
|
point.point_id = 输入.point_id
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
|||||||
@@ -39,10 +39,16 @@
|
|||||||
# 3、业务主过程 #
|
# 3、业务主过程 #
|
||||||
##########################################
|
##########################################
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 4、注释内容 #
|
||||||
|
#暂不统计当天而是统计全部,否则数据返回:AND TO_DAYS(workorder.realproduceend_date) = TO_DAYS(NOW())#
|
||||||
|
##########################################
|
||||||
|
|
||||||
IF 输入.flag = "1"
|
IF 输入.flag = "1"
|
||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT
|
SELECT
|
||||||
dict.label,
|
dict.label,
|
||||||
|
dicts.label order_status,
|
||||||
material.material_code,
|
material.material_code,
|
||||||
material.material_name,
|
material.material_name,
|
||||||
device.device_name,
|
device.device_name,
|
||||||
@@ -53,9 +59,10 @@
|
|||||||
LEFT JOIN pdm_bi_device device ON workorder.device_id = device.device_id
|
LEFT JOIN pdm_bi_device device ON workorder.device_id = device.device_id
|
||||||
LEFT JOIN sys_dict_detail dict ON dict.`VALUE` = workorder.workorder_procedure
|
LEFT JOIN sys_dict_detail dict ON dict.`VALUE` = workorder.workorder_procedure
|
||||||
AND dict.dict_id = 112
|
AND dict.dict_id = 112
|
||||||
|
LEFT JOIN sys_dict_detail dicts ON dicts.`VALUE` = workorder.order_status
|
||||||
|
AND dicts.dict_id = 90
|
||||||
WHERE
|
WHERE
|
||||||
workorder.is_delete = '0'
|
workorder.is_delete = '0'
|
||||||
AND TO_DAYS(workorder.realproduceend_date) = TO_DAYS(NOW())
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
workorder.create_time DESC
|
workorder.create_time DESC
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
@@ -65,13 +72,12 @@
|
|||||||
IF 输入.flag = "2"
|
IF 输入.flag = "2"
|
||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT
|
SELECT
|
||||||
SUM( plan_qty ) planQty,
|
SUM( plan_qty ) plan_qty,
|
||||||
SUM( real_qty ) realQty
|
SUM( real_qty ) real_qty
|
||||||
FROM
|
FROM
|
||||||
PDM_BD_WORKORDER workorder
|
PDM_BD_WORKORDER workorder
|
||||||
WHERE
|
WHERE
|
||||||
workorder.is_delete = '0'
|
workorder.is_delete = '0'
|
||||||
AND TO_DAYS(workorder.realproduceend_date) = TO_DAYS(NOW())
|
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
@@ -79,17 +85,17 @@
|
|||||||
IF 输入.flag = "3"
|
IF 输入.flag = "3"
|
||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT
|
SELECT
|
||||||
workorder.workorder_procedure,
|
workorder.workorder_procedure,
|
||||||
SUM( plan_qty ) planQty,
|
SUM( plan_qty ) plan_qty,
|
||||||
SUM( real_qty ) realQty
|
SUM( real_qty ) real_qty
|
||||||
FROM
|
FROM
|
||||||
PDM_BD_WORKORDER workorder
|
PDM_BD_WORKORDER workorder
|
||||||
WHERE
|
WHERE
|
||||||
workorder.is_delete = '0'
|
workorder.is_delete = '0'
|
||||||
AND TO_DAYS(workorder.realproduceend_date) = TO_DAYS(NOW())
|
|
||||||
GROUP BY
|
GROUP BY
|
||||||
workorder.workorder_procedure
|
workorder.workorder_procedure
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,11 +46,4 @@
|
|||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
IF 输入.flag = "2"
|
|
||||||
PAGEQUERY
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDPAGEQUERY
|
|
||||||
ENDIF
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user