|
|
|
|
@@ -5,9 +5,12 @@ import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.nl.modules.wql.core.bean.ResultBean;
|
|
|
|
|
import org.nl.modules.wql.core.bean.WQLObject;
|
|
|
|
|
import org.nl.modules.wql.util.WqlUtil;
|
|
|
|
|
@@ -16,10 +19,19 @@ import org.nl.wms.ext_manage.bigScreen.service.BigScreenService;
|
|
|
|
|
import org.nl.wms.ext_manage.bigScreen.service.dto.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.nl.wms.product_manage.service.device.IPdmBiDeviceService;
|
|
|
|
|
import org.nl.wms.product_manage.service.device.dao.PdmBiDevice;
|
|
|
|
|
import org.nl.wms.product_manage.service.workorder.IPdmProduceWorkorderService;
|
|
|
|
|
import org.nl.wms.product_manage.service.workprocedure.IPdmBiWorkprocedureService;
|
|
|
|
|
import org.nl.wms.system_manage.service.dict.ISysDictService;
|
|
|
|
|
import org.nl.wms.system_manage.service.dict.dao.Dict;
|
|
|
|
|
import org.nl.wms.system_manage.service.param.ISysParamService;
|
|
|
|
|
import org.nl.wms.system_manage.service.param.dao.Param;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
@@ -27,6 +39,15 @@ import java.util.*;
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class BigScreenServiceImpl implements BigScreenService, ApplicationAutoInitial {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IPdmBiWorkprocedureService workprocedureService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private final IPdmProduceWorkorderService workorderService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysDictService dictService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IPdmBiDeviceService deviceService;
|
|
|
|
|
|
|
|
|
|
List<TodayandplannumDto> todayandplannumDtos = new ArrayList<>();
|
|
|
|
|
YearinoutDto yearinoutDtos = new YearinoutDto();
|
|
|
|
|
List<SupplyDto> supplyDtos = new ArrayList<>();
|
|
|
|
|
@@ -90,10 +111,49 @@ public class BigScreenServiceImpl implements BigScreenService, ApplicationAutoIn
|
|
|
|
|
return returnjo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
String str = "{\"code\":\"1\",\"desc\":\"查询成功\",\"result\":{\"screenname\":\"车间下料看板\",\"arr1\":[{\"workprocedure_name\":\"盘管双斜口下料\",\"device_runningnum\":\"0\",\"device_errornum\":\"0\",\"device_waitingnum\":\"0\",\"shutdownnum\":\"5\",\"device_num\":\"5\"},{\"workprocedure_name\":\"直管双斜口下料\",\"device_runningnum\":\"0\",\"device_errornum\":\"0\",\"device_waitingnum\":\"0\",\"shutdownnum\":\"1\",\"device_num\":\"1\"},{\"workprocedure_name\":\"盘管无屑下料\",\"device_runningnum\":\"0\",\"device_errornum\":\"1\",\"device_waitingnum\":\"0\",\"shutdownnum\":\"3\",\"device_num\":\"4\"},{\"workprocedure_name\":\"直管无屑下料\",\"device_runningnum\":\"0\",\"device_errornum\":\"0\",\"device_waitingnum\":\"0\",\"shutdownnum\":\"1\",\"device_num\":\"1\"}],\"arr2\":[{\"produceschedule_date\":\"2021-05-06\",\"produceorder_code\":\"0506009\",\"workprocedure_name\":\"推弯一体机加工\",\"sysdic_name\":\"弯头工段\",\"worksection_type_scode\":\"01\",\"finishproduce_qty\":\"0\",\"produce_qty\":\"4200\",\"waiting_qty\":\"4200\",\"progress_qty\":\"0\"},{\"produceschedule_date\":\"2020-09-16\",\"produceorder_code\":\"0916014\",\"workprocedure_name\":\"盘管无屑下料\",\"sysdic_name\":\"综合工段\",\"worksection_type_scode\":\"02\",\"finishproduce_qty\":\"3500\",\"produce_qty\":\"3500\",\"waiting_qty\":\"0\",\"progress_qty\":\"100\"},{\"produceschedule_date\":\"2020-12-31\",\"produceorder_code\":\"1231013\",\"workprocedure_name\":\"三通拉伸\",\"sysdic_name\":\"综合工段\",\"worksection_type_scode\":\"02\",\"finishproduce_qty\":\"790\",\"produce_qty\":\"3500\",\"waiting_qty\":\"2710\",\"progress_qty\":\"23\"},{\"produceschedule_date\":\"2020-05-06\",\"produceorder_code\":\"0506009\",\"workprocedure_name\":\"三通拉伸\",\"sysdic_name\":\"综合工段\",\"worksection_type_scode\":\"02\",\"finishproduce_qty\":\"4225\",\"produce_qty\":\"6000\",\"waiting_qty\":\"1775\",\"progress_qty\":\"70\"}],\"jo3\":{\"sumproduce_qty\":\"0\",\"sumfinishproduce_qty\":\"0\",\"sumproducing_qty\":\"0\",\"sumweek_qty\":\"0\"},\"arr4\":[{\"device_name\":\"L28\",\"devicestatus_name\":\"急停报警\",\"update_date\":\" 00:00:30\"},{\"device_name\":\"1-L22\",\"devicestatus_name\":\"急停报警\",\"update_date\":\" 00:00:24\"},{\"device_name\":\"L22-2\",\"devicestatus_name\":\"急停报警\",\"update_date\":\" 00:00:21\"},{\"device_name\":\"L22-1\",\"devicestatus_name\":\"急停报警\",\"update_date\":\" 00:00:20\"}],\"arr5\":[[\"product\",\"昨日\",\"今日\"],[\"盘管双斜口\",\"2\",\"2\"],[\"直管双斜口\",\"1\",\"1\"],[\"盘管无屑\",\"1\",\"1\"],[\"直管无屑\",\"0\",\"0\"]],\"jo6\":{\"sumproduce_orderqty\":\"\",\"sumfinishproduce_orderqty\":\"\",\"sumproducing_orderqty\":\"\"},\"arr7\":[{\"count\":\"0\",\"date\":\"07-10\"},{\"count\":\"0\",\"date\":\"07-11\"},{\"count\":\"0\",\"date\":\"07-12\"},{\"count\":\"0\",\"date\":\"07-13\"},{\"count\":\"0\",\"date\":\"07-14\"},{\"count\":\"0\",\"date\":\"07-15\"},{\"count\":\"0\",\"date\":\"07-16\"}]}}";
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(str);
|
|
|
|
|
String cdeo = jsonObject.getString("cdeo");
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject workScreen(JSONObject param) {
|
|
|
|
|
String web_flag = param.getString("web_flag");
|
|
|
|
|
String str = "";
|
|
|
|
|
/**
|
|
|
|
|
* 1。配置web_flag对应工序id
|
|
|
|
|
* 2.数据库查看当前工序设备,
|
|
|
|
|
* 3.查询设备对应工单信息
|
|
|
|
|
* 4.查询设备故障记录表
|
|
|
|
|
* 5.统计周工单
|
|
|
|
|
*/
|
|
|
|
|
if (StringUtils.isNotEmpty(param.getString("web_flag"))){
|
|
|
|
|
Dict one = dictService.getOne(new UpdateWrapper<Dict>()
|
|
|
|
|
.eq("code", "WEB_FLAG")
|
|
|
|
|
.eq("label", param.getString("web_flag")));
|
|
|
|
|
String screenname = one.getName();
|
|
|
|
|
List<String> ids = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isNotEmpty(one.getPara1())){
|
|
|
|
|
ids.add(one.getPara1());
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotEmpty(one.getPara2())){
|
|
|
|
|
ids.add(one.getPara2());
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotEmpty(one.getPara3())){
|
|
|
|
|
ids.add(one.getPara3());
|
|
|
|
|
}
|
|
|
|
|
//查询所有工序设备列表: private Boolean is_delete;
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 是否在用
|
|
|
|
|
// */
|
|
|
|
|
// private Boolean is_used;
|
|
|
|
|
List<PdmBiDevice> list = deviceService.list(new QueryWrapper<PdmBiDevice>()
|
|
|
|
|
.in("workprocedure_id", ids)
|
|
|
|
|
.eq("is_delete", false));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
String str = null;
|
|
|
|
|
String web_flag="1";
|
|
|
|
|
//1车间下料看板
|
|
|
|
|
if ("1".equals(web_flag)) {
|
|
|
|
|
str = "{\"code\":\"1\",\"desc\":\"查询成功\",\"result\":{\"screenname\":\"车间下料看板\",\"arr1\":[{\"workprocedure_name\":\"盘管双斜口下料\",\"device_runningnum\":\"0\",\"device_errornum\":\"0\",\"device_waitingnum\":\"0\",\"shutdownnum\":\"5\",\"device_num\":\"5\"},{\"workprocedure_name\":\"直管双斜口下料\",\"device_runningnum\":\"0\",\"device_errornum\":\"0\",\"device_waitingnum\":\"0\",\"shutdownnum\":\"1\",\"device_num\":\"1\"},{\"workprocedure_name\":\"盘管无屑下料\",\"device_runningnum\":\"0\",\"device_errornum\":\"1\",\"device_waitingnum\":\"0\",\"shutdownnum\":\"3\",\"device_num\":\"4\"},{\"workprocedure_name\":\"直管无屑下料\",\"device_runningnum\":\"0\",\"device_errornum\":\"0\",\"device_waitingnum\":\"0\",\"shutdownnum\":\"1\",\"device_num\":\"1\"}],\"arr2\":[{\"produceschedule_date\":\"2021-05-06\",\"produceorder_code\":\"0506009\",\"workprocedure_name\":\"推弯一体机加工\",\"sysdic_name\":\"弯头工段\",\"worksection_type_scode\":\"01\",\"finishproduce_qty\":\"0\",\"produce_qty\":\"4200\",\"waiting_qty\":\"4200\",\"progress_qty\":\"0\"},{\"produceschedule_date\":\"2020-09-16\",\"produceorder_code\":\"0916014\",\"workprocedure_name\":\"盘管无屑下料\",\"sysdic_name\":\"综合工段\",\"worksection_type_scode\":\"02\",\"finishproduce_qty\":\"3500\",\"produce_qty\":\"3500\",\"waiting_qty\":\"0\",\"progress_qty\":\"100\"},{\"produceschedule_date\":\"2020-12-31\",\"produceorder_code\":\"1231013\",\"workprocedure_name\":\"三通拉伸\",\"sysdic_name\":\"综合工段\",\"worksection_type_scode\":\"02\",\"finishproduce_qty\":\"790\",\"produce_qty\":\"3500\",\"waiting_qty\":\"2710\",\"progress_qty\":\"23\"},{\"produceschedule_date\":\"2020-05-06\",\"produceorder_code\":\"0506009\",\"workprocedure_name\":\"三通拉伸\",\"sysdic_name\":\"综合工段\",\"worksection_type_scode\":\"02\",\"finishproduce_qty\":\"4225\",\"produce_qty\":\"6000\",\"waiting_qty\":\"1775\",\"progress_qty\":\"70\"}],\"jo3\":{\"sumproduce_qty\":\"0\",\"sumfinishproduce_qty\":\"0\",\"sumproducing_qty\":\"0\",\"sumweek_qty\":\"0\"},\"arr4\":[{\"device_name\":\"L28\",\"devicestatus_name\":\"急停报警\",\"update_date\":\" 00:00:30\"},{\"device_name\":\"1-L22\",\"devicestatus_name\":\"急停报警\",\"update_date\":\" 00:00:24\"},{\"device_name\":\"L22-2\",\"devicestatus_name\":\"急停报警\",\"update_date\":\" 00:00:21\"},{\"device_name\":\"L22-1\",\"devicestatus_name\":\"急停报警\",\"update_date\":\" 00:00:20\"}],\"arr5\":[[\"product\",\"昨日\",\"今日\"],[\"盘管双斜口\",\"2\",\"2\"],[\"直管双斜口\",\"1\",\"1\"],[\"盘管无屑\",\"1\",\"1\"],[\"直管无屑\",\"0\",\"0\"]],\"jo6\":{\"sumproduce_orderqty\":\"\",\"sumfinishproduce_orderqty\":\"\",\"sumproducing_orderqty\":\"\"},\"arr7\":[{\"count\":\"0\",\"date\":\"07-10\"},{\"count\":\"0\",\"date\":\"07-11\"},{\"count\":\"0\",\"date\":\"07-12\"},{\"count\":\"0\",\"date\":\"07-13\"},{\"count\":\"0\",\"date\":\"07-14\"},{\"count\":\"0\",\"date\":\"07-15\"},{\"count\":\"0\",\"date\":\"07-16\"}]}}";
|
|
|
|
|
|