From 6ba8a84a42902569c3d7bec5be6a1234bc618c8f Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Wed, 29 Nov 2023 17:08:07 +0800 Subject: [PATCH] =?UTF-8?q?jx=20mes=20=E7=94=9F=E4=BA=A7=E7=BA=BF=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E7=9C=8B=E6=9D=BF=20=E5=B7=A5=E5=BA=8F=E5=B9=B3?= =?UTF-8?q?=E8=A1=A1=E5=8F=AF=E8=A7=86=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/jx/JxCenterWorkingBoardController.java | 3 +- .../jx/JxCenterWorkingBoardDispatchService.java | 25 ++++++---- .../busi/jx/JxCenterWorkingBoardWatchService.java | 53 ++++++++++++++++++++++ 3 files changed, 71 insertions(+), 10 deletions(-) create mode 100644 modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardWatchService.java diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/busi/jx/JxCenterWorkingBoardController.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/busi/jx/JxCenterWorkingBoardController.java index 8438cf6..304573e 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/busi/jx/JxCenterWorkingBoardController.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/busi/jx/JxCenterWorkingBoardController.java @@ -57,9 +57,8 @@ public class JxCenterWorkingBoardController extends MesBaseController { @PostMapping(value = "/ext/jx/center-working-board/delete-cached-data") @ApiOperation(value = "嘉兴产线运行看板缓存数据清除") - public ResultBean deleteCachedCenterWorkingBoardData(@RequestBody Map dataMap) { + public ResultBean deleteCachedCenterWorkingBoardData(String organizeCode) { try { - String organizeCode = (null != dataMap && dataMap.containsKey(MesExtConstWords.ORGANIZE_CODE)) ? (String) dataMap.get(MesExtConstWords.ORGANIZE_CODE) : AuthUtil.getOrganize().getOrganizeCode(); centerWorkingBoardService.execCachedCenterWorkingBoardData(organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValueStr(), null, null); return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); } catch (ImppBusiException busExcep) { diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardDispatchService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardDispatchService.java index d213c85..807a999 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardDispatchService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardDispatchService.java @@ -29,20 +29,29 @@ public class JxCenterWorkingBoardDispatchService implements IJxCenterWorkingBoar switch ((String) dataMap.get(MesExtConstWords.FLAG)) { case "center01": - return new JxCenterWorkingBoardCenterOneService(new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyWorkingStatusService(new JxCenterWorkingBoardProxySpcrService())).queryCenterWorkingBoardData(dataMap); + return new JxCenterWorkingBoardWatchService( + new JxCenterWorkingBoardCenterOneService(new JxCenterWorkingBoardProxyCenterService(), + new JxCenterWorkingBoardProxyWorkingStatusService(new JxCenterWorkingBoardProxySpcrService()) + )).queryCenterWorkingBoardData(dataMap); case "center02": - return new JxCenterWorkingBoardCenterTwoService(new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyStandardWorkService(), - new JxCenterWorkingBoardProxyEnergyRateService(new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyRepairService(new JxCenterWorkingBoardProxySpcrService()))))).queryCenterWorkingBoardData(dataMap); + return new JxCenterWorkingBoardWatchService( + new JxCenterWorkingBoardCenterTwoService(new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyStandardWorkService(), + new JxCenterWorkingBoardProxyEnergyRateService(new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyRepairService(new JxCenterWorkingBoardProxySpcrService())))) + )).queryCenterWorkingBoardData(dataMap); case "center03": - return new JxCenterWorkingBoardCenterThreeService(new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyStandardWorkService(), - new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyTimeSegmentService()))).queryCenterWorkingBoardData(dataMap); + return new JxCenterWorkingBoardWatchService( + new JxCenterWorkingBoardCenterThreeService(new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyStandardWorkService(), + new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyTimeSegmentService())) + )).queryCenterWorkingBoardData(dataMap); case "monitor01": - return new JxCenterWorkingBoardMonitorOneService( - new JxCenterWorkingBoardProxyAllCenterService(), new JxCenterWorkingBoardProxyStandardWorkService(), new JxCenterWorkingBoardProxyWorkingStatusService(), new JxCenterWorkingBoardProxyEnergyRateService(), - new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyRepairService(new JxCenterWorkingBoardProxySpcrService())))).queryCenterWorkingBoardData(dataMap); + return new JxCenterWorkingBoardWatchService( + new JxCenterWorkingBoardMonitorOneService( + new JxCenterWorkingBoardProxyAllCenterService(), new JxCenterWorkingBoardProxyStandardWorkService(), new JxCenterWorkingBoardProxyWorkingStatusService(), new JxCenterWorkingBoardProxyEnergyRateService(), + new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyRepairService(new JxCenterWorkingBoardProxySpcrService()))) + )).queryCenterWorkingBoardData(dataMap); default: return dataMap; diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardWatchService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardWatchService.java new file mode 100644 index 0000000..6f96e79 --- /dev/null +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardWatchService.java @@ -0,0 +1,53 @@ +package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; + +import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.StopWatch; + +import java.util.Map; + +/** + * @Author : wangjie + * @CreateDate : 2022-02-15 + * @Modify: + **/ +@Slf4j +public class JxCenterWorkingBoardWatchService implements IJxCenterWorkingBoardService { + + private IJxCenterWorkingBoardService proxyService; + + public JxCenterWorkingBoardWatchService(IJxCenterWorkingBoardService proxyService) { + this.proxyService = proxyService; + } + + @Override + public Map queryCenterWorkingBoardData(Map dataMap) { + + log.info("嘉兴产线运行看板 --- WATCH START --- DATA:{} --- THREAD:{}", JSONObject.toJSONString(dataMap), Thread.currentThread().getName()); + + StopWatch stopWatch = new StopWatch(); + + stopWatch.start(); + + try { + + dataMap = proxyService.queryCenterWorkingBoardData(dataMap); + + } catch (Exception e) { + + log.info("嘉兴产线运行看板 --- WATCH EXCEPTION --- {} --- THREAD:{} --- {} ---", e.toString(), Thread.currentThread().getName(), "\r\n" + JSONObject.toJSONString(e)); + + } finally { + + stopWatch.stop(); + + log.info("嘉兴产线运行看板 --- WATCH END --- 耗时:{}ms --- DATA:{} --- THREAD:{}", stopWatch.getTotalTimeMillis(), JSONObject.toJSONString(dataMap), Thread.currentThread().getName()); + + } + + return dataMap; + + } + +}