统计任务看板

This commit is contained in:
2022-06-30 15:45:59 +08:00
parent 805db30284
commit 2f27393184
4 changed files with 335 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
package org.nl.wms.sb.stat.websocket;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.mnt.websocket.MsgType;
import org.nl.modules.mnt.websocket.SocketMsg;
import org.nl.modules.mnt.websocket.WebSocketServer;
import org.nl.wms.pf.service.AutoPfTaskService;
import org.nl.wql.WQL;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.HashMap;
@Slf4j
@Component
@RequiredArgsConstructor
public class AutoWebSocketTask {
public void run() {
try {
String today = DateUtil.today();
HashMap<String, String> map = new HashMap<>();
map.put("flag", "1");
map.put("today", "%"+today+"%");
JSONArray resultJSONArray = WQL.getWO("TASK_AUTOWEBSOCKETTSK").addParamMap(map).process().getResultJSONArray(0);
SocketMsg socketMsg = new SocketMsg(resultJSONArray, MsgType.INFO);
WebSocketServer.sendInfo(socketMsg,"20");
} catch (IOException e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,163 @@
[交易说明]
交易名: 实时查询统计任务
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库为空采用默认值默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.today TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
QUERY
SELECT
mst.input_time AS input_time,
mst.repair_code AS repair_code,
(
CASE
mst.maintenancecycle
WHEN '01' THEN '计划维修'
WHEN '02' THEN '临时维修'
END
) AS maintenancecycle,
file.device_code,
file.device_name,
(
CASE
mst.invstatus
WHEN '01' THEN '生成'
WHEN '02' THEN '提交'
WHEN '03' THEN '开始'
WHEN '04' THEN '委外维修'
WHEN '05' THEN '委外验收'
WHEN '06' THEN '结束'
WHEN '07' THEN '确认'
WHEN '99' THEN '审核'
END
) AS invstatus,
mst.real_start_date,
mst.real_end_date
FROM
EM_BI_DeviceRepairMst mst
LEFT JOIN EM_BI_EquipmentFile file ON mst.devicerecord_id = file.devicerecord_id
WHERE
mst.is_delete = '0'
AND (mst.invstatus <> '99' or (mst.invstatus = '99' and mst.audit_time like 输入.today))
AND ( ISNULL( mst.source_bill_id ) OR mst.source_bill_type = 'WXJH' )
UNION
SELECT
st.create_time AS input_time,
st.request_code AS repair_code,
class.class_name AS maintenancecycle,
file.device_code,
file.device_name,
(
CASE
st.is_passed
WHEN '0' THEN
(
CASE st.is_passed
WHEN '0' THEN '否'
WHEN '1' THEN '是'
END
)
WHEN '1' THEN
(
CASE mst.invstatus
WHEN '01' THEN '生成'
WHEN '02' THEN '提交'
WHEN '03' THEN '开始'
WHEN '04' THEN '委外维修'
WHEN '05' THEN '委外验收'
WHEN '06' THEN '结束'
WHEN '07' THEN '确认'
WHEN '99' THEN '审核'
END
)
END
) AS invstatus,
mst.real_start_date,
mst.real_end_date
FROM
EM_BI_DeviceRepairRequest st
LEFT JOIN EM_BI_EquipmentFile file ON st.devicerecord_id = file.devicerecord_id
LEFT JOIN md_pb_classstandard class ON class.class_id = st.device_faultclass_id
LEFT JOIN EM_BI_DeviceRepairMst mst ON mst.source_bill_id = st.request_id
WHERE
st.is_delete = '0'
AND (st.status <> '99' or (st.status = '99' and st.finish_time like 输入.today))
AND mst.source_bill_type = 'BXD'
UNION
SELECT
mst.input_time AS input_time,
mst.maint_code AS repair_code,
(
CASE
mst.maintenancecycle
WHEN '01' THEN '计划保养'
WHEN '02' THEN '临时保养'
END
) AS maintenancecycle,
file.device_code,
file.device_name,
(
CASE
mst.invstatus
WHEN '01' THEN '生成'
WHEN '02' THEN '提交'
WHEN '03' THEN '开始'
WHEN '04' THEN '结束'
WHEN '05' THEN '确认'
WHEN '99' THEN '审核'
END
) AS invstatus,
mst.real_start_date,
mst.real_end_date
FROM
EM_BI_DeviceMaintenanceMst mst
LEFT JOIN EM_BI_EquipmentFile file ON mst.devicerecord_id = file.devicerecord_id
WHERE
mst.is_delete = '0'
AND (mst.invstatus <> '99' or (mst.invstatus = '99' and mst.audit_time like 输入.today))
ENDSELECT
ENDQUERY
ENDIF