rev: 大屏修改
This commit is contained in:
@@ -132,4 +132,14 @@ public class PointUpdateUtil {
|
||||
}
|
||||
return mode.equals("0") ? DeviceStatusEnum.STANDBY.getCode() : DeviceStatusEnum.RUNNING.getCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找设备状态
|
||||
* @return
|
||||
*/
|
||||
public static JSONObject getDevicesStatus(JSONArray deviceCode) {
|
||||
WmsToAcsServiceImpl wmsToAcsService = new WmsToAcsServiceImpl();
|
||||
JSONObject deviceStatus = wmsToAcsService.getDeviceStatus(deviceCode);
|
||||
return ObjectUtil.isNotEmpty(deviceStatus)?deviceStatus:null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class DeviceInfoDto implements Serializable {
|
||||
/**
|
||||
* 已生产数量
|
||||
*/
|
||||
private BigDecimal real_qty;
|
||||
private String real_qty = "0";
|
||||
/**
|
||||
* 生产时间
|
||||
*/
|
||||
|
||||
@@ -80,4 +80,5 @@ public class SchBasePointDto implements Serializable{
|
||||
* 是否满托
|
||||
*/
|
||||
private String is_full;
|
||||
private String struct_url;
|
||||
}
|
||||
|
||||
@@ -205,33 +205,25 @@ public class CockpitServiceImpl implements CockpitService{
|
||||
public List<DeviceInfoDto> deviceMonitor() {
|
||||
List<DeviceInfoDto> res;
|
||||
ConcurrentHashMap<String,List<DeviceInfoDto>> map = new ConcurrentHashMap<>();
|
||||
JSONArray result = WQL.getWO("COCKPIT_DEVICE").addParam("flag", "3").process().getResultJSONArray(0);
|
||||
if(ObjectUtil.isNotEmpty(result)) {
|
||||
JSONArray result = WQL.getWO("COCKPIT_DEVICE")
|
||||
.addParam("flag", "3")
|
||||
.process()
|
||||
.getResultJSONArray(0);
|
||||
// JSONObject devicesStatus = PointUpdateUtil.getDevicesStatus(result);
|
||||
// if (ObjectUtil.isEmpty(devicesStatus)) {
|
||||
// return null;
|
||||
// }
|
||||
// JSONArray data = ObjectUtil.isNotEmpty(
|
||||
// devicesStatus.getJSONArray("data"))?devicesStatus.getJSONArray("data"):null;
|
||||
// if (ObjectUtil.isEmpty(data)) {
|
||||
// return null;
|
||||
// }
|
||||
if(ObjectUtil.isNotEmpty(result)) { //todo: result -> data
|
||||
res = result.toJavaList(DeviceInfoDto.class);
|
||||
res.forEach(d -> {
|
||||
if (ObjectUtil.isNotEmpty(d.getRealproducestart_date())) {
|
||||
// 如果时间存在
|
||||
LocalDateTime dateTime = LocalDateTimeUtil.parse(d.getRealproducestart_date().replace(" ", "T"));
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
Duration duration = Duration.between(dateTime, now);
|
||||
d.setWork_time(duration.toHours() + "");
|
||||
}
|
||||
// 设置设备状态
|
||||
// d.setDevice_status(PointUpdateUtil.getDeviceStatus(d.getDevice_code()));
|
||||
DeviceEnum deviceEnum = DeviceEnum.get(d.getDevice_model(), d.getDevice_code());
|
||||
// 添加图片名字
|
||||
d.setDevice_url(deviceEnum.getPictureName());
|
||||
// todo: 区分窑与其他设备
|
||||
if (d.getDevice_model().equals(DeviceEnum.YAO.getModel())) {
|
||||
// acs上报
|
||||
d.setVehicle_qty(15);
|
||||
d.setVehicle_max_qty(42); // 最大值 已确认
|
||||
}
|
||||
// todo: RGV
|
||||
if (d.getDevice_model().equals(DeviceEnum.RGV.getModel())) {
|
||||
d.setDevice_status_name("空位无车,满位有车");
|
||||
}
|
||||
// todo: 包装机、碟盘机
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT point.*, material.material_name
|
||||
SELECT point.*, material.material_code
|
||||
FROM sch_base_point point
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
||||
WHERE
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT point.*, material.material_name
|
||||
SELECT point.*, material.material_code
|
||||
FROM sch_base_point point
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
||||
WHERE 1=1
|
||||
@@ -74,10 +74,10 @@
|
||||
d.device_model,
|
||||
w.real_qty,
|
||||
w.realproducestart_date,
|
||||
IF(NULLIF(m.material_name, '') IS NULL, '-', m.material_name) as material_name
|
||||
IF(NULLIF(m.material_code, '') IS NULL, '-', m.material_code) as material_name
|
||||
FROM
|
||||
`pdm_bi_device` d
|
||||
LEFT JOIN pdm_bd_workorder w ON (d.device_code = w.device_code) AND w.order_status <> '5'
|
||||
LEFT JOIN pdm_bd_workorder w ON (d.device_code = w.device_code) AND w.order_status = '3'
|
||||
LEFT JOIN md_me_material_detail m ON w.material_id = m.material_id
|
||||
WHERE
|
||||
d.is_used = '1'
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
dict.label,
|
||||
dicts.label order_status,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
device.device_name,
|
||||
workorder.*
|
||||
FROM
|
||||
|
||||
@@ -42,13 +42,23 @@
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
vd.qty as ivt_qty,
|
||||
vd.weight as ivt_weight,
|
||||
vd.create_time as instorage_time,
|
||||
IF(LENGTH(point.vehicle_code)>0, '1', '') AS struct_url,
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN st_ivt_vehicle_detail vd ON vd.vehicle_code = point.vehicle_code AND vd.vehicle_type = point.vehicle_type AND vd.is_delete = '0'
|
||||
LEFT JOIN md_me_material_detail material ON material.material_id = (
|
||||
SELECT ve.material_id FROM st_ivt_vehicle_detail ve WHERE ve.vehicle_code = point.vehicle_code
|
||||
AND ve.vehicle_type = point.vehicle_type AND ve.is_delete = '0'
|
||||
SELECT
|
||||
ve.material_id
|
||||
FROM
|
||||
st_ivt_vehicle_detail ve
|
||||
WHERE
|
||||
ve.vehicle_code = point.vehicle_code
|
||||
AND ve.vehicle_type = point.vehicle_type
|
||||
AND ve.is_delete = '0'
|
||||
)
|
||||
WHERE
|
||||
point.region_code = 'KLHJ'
|
||||
@@ -61,17 +71,27 @@
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
point.*
|
||||
material.material_code,
|
||||
vd.qty as ivt_qty,
|
||||
CASE WHEN vd.is_full = '1' THEN '是' ELSE '否' END AS is_full,
|
||||
IF(LENGTH(point.vehicle_code)>0, '2', '') AS struct_url,
|
||||
vd.create_time as instorage_time,
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN md_me_material_detail material ON material.material_id = (
|
||||
SELECT ve.material_id FROM st_ivt_vehicle_detail ve WHERE ve.vehicle_code = point.vehicle_code
|
||||
AND ve.vehicle_type = point.vehicle_type AND ve.is_delete = '0'
|
||||
)
|
||||
sch_base_point point
|
||||
LEFT JOIN st_ivt_vehicle_detail vd ON vd.vehicle_code = point.vehicle_code AND vd.vehicle_type = point.vehicle_type AND vd.is_delete = '0'
|
||||
LEFT JOIN md_me_material_detail material ON material.material_id = (
|
||||
SELECT
|
||||
ve.material_id
|
||||
FROM
|
||||
st_ivt_vehicle_detail ve
|
||||
WHERE
|
||||
ve.vehicle_code = point.vehicle_code
|
||||
AND ve.vehicle_type = point.vehicle_type
|
||||
AND ve.is_delete = '0'
|
||||
)
|
||||
WHERE
|
||||
point.region_code = 'CPHJ'
|
||||
point.region_code = 'CPHJ'
|
||||
ORDER BY
|
||||
point.create_time DESC
|
||||
ENDSELECT
|
||||
@@ -82,7 +102,6 @@
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
|
||||
@@ -56,6 +56,12 @@ public interface WmsToAcsService {
|
||||
*/
|
||||
JSONObject getPointStatus(JSONArray whereJson);
|
||||
|
||||
/**
|
||||
* 获取设备状态
|
||||
* @return
|
||||
*/
|
||||
JSONObject getDeviceStatus(JSONArray whereJson);
|
||||
|
||||
/**
|
||||
* 获取木托盘
|
||||
* @param whereJson
|
||||
|
||||
@@ -54,6 +54,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return AcsUtil.notifyAcs(api, whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatus(JSONArray whereJson) {
|
||||
String api = "api/wms/getDeviceStatus";
|
||||
return AcsUtil.notifyAcs(api, whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getTray(JSONArray whereJson) {
|
||||
String api = "api/wms/queryTray";
|
||||
|
||||
@@ -10,8 +10,8 @@ import cn.hutool.core.util.StrUtil;
|
||||
public enum DeviceEnum {
|
||||
HLJ("1", "混料机", "HLJ", "HLJ"),
|
||||
HLJ_S("2", "高速混料机", "HLJ_S", "HLJ_S"),
|
||||
YZJ("3", "压制机", "YZJ", "YZJ"),
|
||||
YZJ_S("4", "高速压制机", "YZJ_S", "YZJ_S"),
|
||||
YZJ("3", "压机", "YZJ", "YZJ"),
|
||||
YZJ_S("4", "液压机", "YZJ_S", "YZJ_S"), //
|
||||
FJJXS("5", "分拣机械手", "FJJXS", "FJJXS"),
|
||||
CPX("6", "拆盘线", "CPX", "CPX"),
|
||||
BZX("6", "包装线", "BZX", "BZX"),
|
||||
|
||||
@@ -9,7 +9,7 @@ public enum DeviceStatusEnum {
|
||||
STANDBY("1", "待机"),
|
||||
RUNNING("2", "运行"),
|
||||
FAILURE("3", "故障"),
|
||||
SHUTDOWN("4", "关机");
|
||||
SHUTDOWN("0", "关机");
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user