rev: 大屏修改
This commit is contained in:
@@ -132,4 +132,14 @@ public class PointUpdateUtil {
|
|||||||
}
|
}
|
||||||
return mode.equals("0") ? DeviceStatusEnum.STANDBY.getCode() : DeviceStatusEnum.RUNNING.getCode();
|
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 is_full;
|
||||||
|
private String struct_url;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,33 +205,25 @@ public class CockpitServiceImpl implements CockpitService{
|
|||||||
public List<DeviceInfoDto> deviceMonitor() {
|
public List<DeviceInfoDto> deviceMonitor() {
|
||||||
List<DeviceInfoDto> res;
|
List<DeviceInfoDto> res;
|
||||||
ConcurrentHashMap<String,List<DeviceInfoDto>> map = new ConcurrentHashMap<>();
|
ConcurrentHashMap<String,List<DeviceInfoDto>> map = new ConcurrentHashMap<>();
|
||||||
JSONArray result = WQL.getWO("COCKPIT_DEVICE").addParam("flag", "3").process().getResultJSONArray(0);
|
JSONArray result = WQL.getWO("COCKPIT_DEVICE")
|
||||||
if(ObjectUtil.isNotEmpty(result)) {
|
.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 = result.toJavaList(DeviceInfoDto.class);
|
||||||
res.forEach(d -> {
|
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());
|
DeviceEnum deviceEnum = DeviceEnum.get(d.getDevice_model(), d.getDevice_code());
|
||||||
// 添加图片名字
|
// 添加图片名字
|
||||||
d.setDevice_url(deviceEnum.getPictureName());
|
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;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
IF 输入.flag = "1"
|
IF 输入.flag = "1"
|
||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT point.*, material.material_name
|
SELECT point.*, material.material_code
|
||||||
FROM sch_base_point point
|
FROM sch_base_point point
|
||||||
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
||||||
WHERE
|
WHERE
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
IF 输入.flag = "2"
|
IF 输入.flag = "2"
|
||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT point.*, material.material_name
|
SELECT point.*, material.material_code
|
||||||
FROM sch_base_point point
|
FROM sch_base_point point
|
||||||
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
@@ -74,10 +74,10 @@
|
|||||||
d.device_model,
|
d.device_model,
|
||||||
w.real_qty,
|
w.real_qty,
|
||||||
w.realproducestart_date,
|
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
|
FROM
|
||||||
`pdm_bi_device` d
|
`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
|
LEFT JOIN md_me_material_detail m ON w.material_id = m.material_id
|
||||||
WHERE
|
WHERE
|
||||||
d.is_used = '1'
|
d.is_used = '1'
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
dict.label,
|
dict.label,
|
||||||
dicts.label order_status,
|
dicts.label order_status,
|
||||||
material.material_code,
|
material.material_code,
|
||||||
material.material_name,
|
|
||||||
device.device_name,
|
device.device_name,
|
||||||
workorder.*
|
workorder.*
|
||||||
FROM
|
FROM
|
||||||
|
|||||||
@@ -42,13 +42,23 @@
|
|||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT
|
SELECT
|
||||||
material.material_code,
|
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.*
|
point.*
|
||||||
FROM
|
FROM
|
||||||
sch_base_point point
|
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 = (
|
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
|
SELECT
|
||||||
AND ve.vehicle_type = point.vehicle_type AND ve.is_delete = '0'
|
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
|
WHERE
|
||||||
point.region_code = 'KLHJ'
|
point.region_code = 'KLHJ'
|
||||||
@@ -61,17 +71,27 @@
|
|||||||
IF 输入.flag = "2"
|
IF 输入.flag = "2"
|
||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT
|
SELECT
|
||||||
material.material_code,
|
material.material_code,
|
||||||
material.material_name,
|
vd.qty as ivt_qty,
|
||||||
point.*
|
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
|
FROM
|
||||||
sch_base_point point
|
sch_base_point point
|
||||||
LEFT JOIN md_me_material_detail material ON material.material_id = (
|
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'
|
||||||
SELECT ve.material_id FROM st_ivt_vehicle_detail ve WHERE ve.vehicle_code = point.vehicle_code
|
LEFT JOIN md_me_material_detail material ON material.material_id = (
|
||||||
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
|
WHERE
|
||||||
point.region_code = 'CPHJ'
|
point.region_code = 'CPHJ'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
point.create_time DESC
|
point.create_time DESC
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
@@ -82,7 +102,6 @@
|
|||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT
|
SELECT
|
||||||
material.material_code,
|
material.material_code,
|
||||||
material.material_name,
|
|
||||||
point.*
|
point.*
|
||||||
FROM
|
FROM
|
||||||
sch_base_point point
|
sch_base_point point
|
||||||
|
|||||||
@@ -56,6 +56,12 @@ public interface WmsToAcsService {
|
|||||||
*/
|
*/
|
||||||
JSONObject getPointStatus(JSONArray whereJson);
|
JSONObject getPointStatus(JSONArray whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备状态
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JSONObject getDeviceStatus(JSONArray whereJson);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取木托盘
|
* 获取木托盘
|
||||||
* @param whereJson
|
* @param whereJson
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
return AcsUtil.notifyAcs(api, whereJson);
|
return AcsUtil.notifyAcs(api, whereJson);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject getDeviceStatus(JSONArray whereJson) {
|
||||||
|
String api = "api/wms/getDeviceStatus";
|
||||||
|
return AcsUtil.notifyAcs(api, whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getTray(JSONArray whereJson) {
|
public JSONObject getTray(JSONArray whereJson) {
|
||||||
String api = "api/wms/queryTray";
|
String api = "api/wms/queryTray";
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
public enum DeviceEnum {
|
public enum DeviceEnum {
|
||||||
HLJ("1", "混料机", "HLJ", "HLJ"),
|
HLJ("1", "混料机", "HLJ", "HLJ"),
|
||||||
HLJ_S("2", "高速混料机", "HLJ_S", "HLJ_S"),
|
HLJ_S("2", "高速混料机", "HLJ_S", "HLJ_S"),
|
||||||
YZJ("3", "压制机", "YZJ", "YZJ"),
|
YZJ("3", "压机", "YZJ", "YZJ"),
|
||||||
YZJ_S("4", "高速压制机", "YZJ_S", "YZJ_S"),
|
YZJ_S("4", "液压机", "YZJ_S", "YZJ_S"), //
|
||||||
FJJXS("5", "分拣机械手", "FJJXS", "FJJXS"),
|
FJJXS("5", "分拣机械手", "FJJXS", "FJJXS"),
|
||||||
CPX("6", "拆盘线", "CPX", "CPX"),
|
CPX("6", "拆盘线", "CPX", "CPX"),
|
||||||
BZX("6", "包装线", "BZX", "BZX"),
|
BZX("6", "包装线", "BZX", "BZX"),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public enum DeviceStatusEnum {
|
|||||||
STANDBY("1", "待机"),
|
STANDBY("1", "待机"),
|
||||||
RUNNING("2", "运行"),
|
RUNNING("2", "运行"),
|
||||||
FAILURE("3", "故障"),
|
FAILURE("3", "故障"),
|
||||||
SHUTDOWN("4", "关机");
|
SHUTDOWN("0", "关机");
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user