From 76d68b5860bd6d1868e750f23c4f3fd8c44166bc Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Tue, 21 Nov 2023 17:59:34 +0800 Subject: [PATCH] =?UTF-8?q?jx=20pmc=20=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ext/mes/api/base/bu/IBusiConfigService.java | 10 + .../busi/jx/JxCenterWorkingBoardController.java | 3 +- .../serviceimpl/base/bu/BusiConfigService.java | 9 + .../serviceimpl/busi/ProjectBadRateService.java | 4 +- .../busi/ep/EpWorkCenterRunningStateService.java | 10 +- ...a => JxCenterWorkingBoardCenterOneService.java} | 92 +++----- ...=> JxCenterWorkingBoardCenterThreeService.java} | 29 ++- ...a => JxCenterWorkingBoardCenterTwoService.java} | 84 ++++--- .../busi/jx/JxCenterWorkingBoardCommonService.java | 45 ++++ .../jx/JxCenterWorkingBoardDispatchService.java | 21 +- .../jx/JxCenterWorkingBoardMonitorOneService.java | 241 +++++++++++++++++++++ .../JxCenterWorkingBoardProxyAllCenterService.java | 36 +++ .../jx/JxCenterWorkingBoardProxyCenterService.java | 1 - .../jx/JxCenterWorkingBoardProxyOrderService.java | 22 +- .../jx/JxCenterWorkingBoardProxyOutPutService.java | 34 +-- .../jx/JxCenterWorkingBoardProxyRepairService.java | 62 ++++++ .../jx/JxCenterWorkingBoardProxySpcrService.java | 30 ++- ...enterWorkingBoardProxyWorkingStatusService.java | 95 ++++++++ .../i3plus/ext/mes/pojo/util/MesExtConstWords.java | 4 + .../i3plus/ext/mes/pojo/util/MesExtEnumUtil.java | 4 + 20 files changed, 674 insertions(+), 162 deletions(-) rename modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/{JxCenterWorkingBoardBusiOneService.java => JxCenterWorkingBoardCenterOneService.java} (57%) rename modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/{JxCenterWorkingBoardBusiThreeService.java => JxCenterWorkingBoardCenterThreeService.java} (75%) rename modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/{JxCenterWorkingBoardBusiTwoService.java => JxCenterWorkingBoardCenterTwoService.java} (83%) create mode 100644 modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardMonitorOneService.java create mode 100644 modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyAllCenterService.java create mode 100644 modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyRepairService.java create mode 100644 modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyWorkingStatusService.java diff --git a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/bu/IBusiConfigService.java b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/bu/IBusiConfigService.java index 91aa786..5eb43d5 100644 --- a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/bu/IBusiConfigService.java +++ b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/bu/IBusiConfigService.java @@ -5,6 +5,7 @@ import cn.estsh.i3plus.pojo.base.bean.ListPager; import cn.estsh.i3plus.pojo.base.common.Pager; import io.swagger.annotations.ApiOperation; +import java.util.List; import java.util.Map; /** @@ -69,4 +70,13 @@ public interface IBusiConfigService { @ApiOperation(value = "获取配置信息MAP", notes = "获取配置信息MAP") Map getConfigMap(String organizeCode, String cfgCode); + /** + * 获取配置信息集合 + * @param organizeCode 组织代码 + * @param cfgCode 配置代码 + * @return 配置信息集合 + */ + @ApiOperation(value = "获取配置信息集合", notes = "获取配置信息集合") + List getConfigListSortSeq(String organizeCode, String cfgCode); + } 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 0b58399..2aa2399 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 @@ -47,8 +47,7 @@ public class JxCenterWorkingBoardController extends MesBaseController { .setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode()) .setErrorDetail("参数缺失业务标志[flag]!") .build(); - dataMap.put(MesExtConstWords.ORGANIZE_CODE, AuthUtil.getOrganize().getOrganizeCode()); - dataMap.put(MesExtConstWords.START_TIME, TimeTool.getNowTime(true)); + if (!dataMap.containsKey(MesExtConstWords.ORGANIZE_CODE)) dataMap.put(MesExtConstWords.ORGANIZE_CODE, AuthUtil.getOrganize().getOrganizeCode()); return ResultBean.success("查询成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultMap(centerWorkingBoardService.queryCenterWorkingBoardData(dataMap)); } catch (ImppBusiException busExcep) { return ResultBean.fail(busExcep); diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/bu/BusiConfigService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/bu/BusiConfigService.java index 1a5272d..9cf963a 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/bu/BusiConfigService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/bu/BusiConfigService.java @@ -203,4 +203,13 @@ public class BusiConfigService implements IBusiConfigService { busiConfigList.stream().filter(o -> null != o).collect(Collectors.toMap(MesBusiConfig::getCfgValueSeq, MesBusiConfig::getCfgValue)); } + @Override + public List getConfigListSortSeq(String organizeCode, String cfgCode) { + List busiConfigList = busiConfigRepository.findByProperty( + new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.CFG_CODE}, + new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), cfgCode}); + return CollectionUtils.isEmpty(busiConfigList) ? null : + busiConfigList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getCfgValueSeq()) && !StringUtils.isEmpty(o.getCfgValue()))).sorted(Comparator.comparing(MesBusiConfig::getCfgValueSeq)).collect(Collectors.toList()); + } + } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/ProjectBadRateService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/ProjectBadRateService.java index 38d0c31..c1cbf53 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/ProjectBadRateService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/ProjectBadRateService.java @@ -62,8 +62,6 @@ public class ProjectBadRateService implements IProjectBadRateService { //看板生产计划达成率标志 public static final String MAIN_BOARD_PRODUCT_PLAN_RATE = "MAIN_BOARD_PRODUCT_PLAN_RATE"; - //PMC主看板产线是否显示标志 - public static final String BOARD_WORK_SHOW_FLAG = "BOARD_WORK_SHOW_FLAG"; @Override public List queryProjectBadRate(String organizeCode) throws ParseException { @@ -988,7 +986,7 @@ public class ProjectBadRateService implements IProjectBadRateService { private List getBusiConfigWorkCenterList(String organizeCode) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); - DdlPreparedPack.getStringEqualPack(BOARD_WORK_SHOW_FLAG, MesExtConstWords.CFG_CODE, packBean); + DdlPreparedPack.getStringEqualPack(MesExtConstWords.BOARD_WORK_SHOW_FLAG, MesExtConstWords.CFG_CODE, packBean); packBean.setOrderByStr(" order by cfgValueSeq asc "); return busiConfigRepository.findByHqlWhere(packBean); } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/ep/EpWorkCenterRunningStateService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/ep/EpWorkCenterRunningStateService.java index 665eafc..ee8d753 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/ep/EpWorkCenterRunningStateService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/ep/EpWorkCenterRunningStateService.java @@ -21,7 +21,10 @@ import org.springframework.util.StringUtils; import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -60,9 +63,6 @@ public class EpWorkCenterRunningStateService implements IEpWorkCenterRunningStat @Autowired private IProjectBadRateService projectBadRateService; - //PMC主看板产线是否显示标志 - public static final String BOARD_WORK_SHOW_FLAG = "BOARD_WORK_SHOW_FLAG"; - @Override public List getWorkCenterState(String organizeCode) { @@ -201,7 +201,7 @@ public class EpWorkCenterRunningStateService implements IEpWorkCenterRunningStat private List getBusiConfigWorkCenterList(String organizeCode) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); - DdlPreparedPack.getStringEqualPack(BOARD_WORK_SHOW_FLAG, MesExtConstWords.CFG_CODE, packBean); + DdlPreparedPack.getStringEqualPack(MesExtConstWords.BOARD_WORK_SHOW_FLAG, MesExtConstWords.CFG_CODE, packBean); packBean.setOrderByStr(" order by cfgValueSeq asc "); return busiConfigRepository.findByHqlWhere(packBean); } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardBusiOneService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterOneService.java similarity index 57% rename from modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardBusiOneService.java rename to modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterOneService.java index 164f4d2..d259b80 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardBusiOneService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterOneService.java @@ -9,17 +9,17 @@ import cn.estsh.i3plus.ext.mes.pojo.repository.MesFourMDetailRepository; import cn.estsh.i3plus.ext.mes.pojo.repository.MesWorkCenterNotificationBarRepository; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.platform.common.tool.TimeTool; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.impp.framework.boot.util.SpringContextsUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; -import java.util.Comparator; import java.util.List; import java.util.Map; -import java.util.StringJoiner; import java.util.stream.Collectors; /** @@ -28,7 +28,9 @@ import java.util.stream.Collectors; * @Modify: **/ @Slf4j -public class JxCenterWorkingBoardBusiOneService implements IJxCenterWorkingBoardService { +public class JxCenterWorkingBoardCenterOneService implements IJxCenterWorkingBoardService { + + private IJxCenterWorkingBoardService proxyService0; private IJxCenterWorkingBoardService proxyService; @@ -36,7 +38,8 @@ public class JxCenterWorkingBoardBusiOneService implements IJxCenterWorkingBoard private MesWorkCenterNotificationBarRepository workCenterNotificationBarRepository; - public JxCenterWorkingBoardBusiOneService(IJxCenterWorkingBoardService proxyService) { + public JxCenterWorkingBoardCenterOneService(IJxCenterWorkingBoardService proxyService0, IJxCenterWorkingBoardService proxyService) { + this.proxyService0 = proxyService0; this.proxyService = proxyService; this.fourMDetailRepository = (MesFourMDetailRepository) SpringContextsUtil.getBean("mesFourMDetailRepository"); this.workCenterNotificationBarRepository = (MesWorkCenterNotificationBarRepository) SpringContextsUtil.getBean("mesWorkCenterNotificationBarRepository"); @@ -45,19 +48,25 @@ public class JxCenterWorkingBoardBusiOneService implements IJxCenterWorkingBoard @Override public Map queryCenterWorkingBoardData(Map dataMap) { - dataMap = proxyService.queryCenterWorkingBoardData(dataMap); + dataMap = proxyService0.queryCenterWorkingBoardData(dataMap); MesWorkCenterExt workCenterExtDb = (MesWorkCenterExt) dataMap.get(MesWorkCenterExt.class.getSimpleName()); - String startTime = (String) dataMap.get(MesExtConstWords.START_TIME); + String curTime = TimeTool.getNowTime(true); + + packProxyCondition(dataMap, workCenterExtDb, curTime); + + dataMap = proxyService.queryCenterWorkingBoardData(dataMap); List shiftProdCenterRecordList = (List) dataMap.get(MesShiftProdCenterRecord.class.getSimpleName()); - dataMap.put("生产状态", getWorkingStatusData(shiftProdCenterRecordList, startTime)); + dataMap.put("BOARD_TITLE", workCenterExtDb.getWorkCenterName() + "产线运行状态看板"); - dataMap.put("异常停工时间", getUnnormalStopCenterData(shiftProdCenterRecordList, startTime)); + dataMap.put("BOARD_BOTTOM", "PKATJX·松下厨电科技(嘉兴)有限公司"); - dataMap.put("4M变更信息", getFourMChangeData(workCenterExtDb, startTime)); + dataMap.put("异常停工时间", getUnnormalStopCenterData(shiftProdCenterRecordList, curTime)); + + dataMap.put("4M变更信息", getFourMChangeData(workCenterExtDb, curTime)); dataMap.put("公告信息", getWorkCenterNotificationBarData(workCenterExtDb)); @@ -68,31 +77,30 @@ public class JxCenterWorkingBoardBusiOneService implements IJxCenterWorkingBoard public Map clearUselessData(Map dataMap) { dataMap.remove(MesWorkCenterExt.class.getSimpleName()); dataMap.remove(MesShiftProdCenterRecord.class.getSimpleName()); + dataMap.remove(MesExtConstWords.WORK_TIME); + dataMap.remove(MesExtConstWords.SHIFT_CODE); + dataMap.remove(MesExtConstWords.WORK_CENTER_CODE); + dataMap.remove("curTime"); return dataMap; } - private String getWorkingStatusData(List shiftProdCenterRecordList, String startTime) { - - List filterList = CollectionUtils.isEmpty(shiftProdCenterRecordList) ? null : - shiftProdCenterRecordList.stream().filter(o -> (null != o && MesExtEnumUtil.SHIFT_PROD_TYPE.UNNORMAL_PROD.getValue() >= o.getProdType() && o.getStartTime().compareTo(startTime) <= 0 && o.getEndTime().compareTo(startTime) >= 0)).collect(Collectors.toList()); - MesShiftProdCenterRecord filterData = CollectionUtils.isEmpty(filterList) ? null : - filterList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesShiftProdCenterRecord::getModifyDatetime).reversed()).collect(Collectors.toList()).get(0); - - SHIFT_PROD_TYPE_COLOR enumItem; - if (null == filterData) enumItem = SHIFT_PROD_TYPE_COLOR.NO_WORKING; - else enumItem = SHIFT_PROD_TYPE_COLOR.getByValue(filterData.getProdType()); - return new StringJoiner(MesExtConstWords.COMMA).add(enumItem.workingStatusName).add(enumItem.color).toString(); + private void packProxyCondition(Map dataMap, MesWorkCenterExt workCenterExtDb, String curTime) { + if (StringUtils.isEmpty(workCenterExtDb.getWorkTime()) || StringUtils.isEmpty(workCenterExtDb.getShiftCode())) return; + dataMap.put(MesExtConstWords.WORK_TIME, workCenterExtDb.getWorkTime()); + dataMap.put(MesExtConstWords.SHIFT_CODE, workCenterExtDb.getShiftCode()); + dataMap.put(MesExtConstWords.WORK_CENTER_CODE, workCenterExtDb.getWorkCenterCode()); + dataMap.put("curTime", curTime); } - private List getUnnormalStopCenterData(List shiftProdCenterRecordList, String startTime) { + private List getUnnormalStopCenterData(List shiftProdCenterRecordList, String curTime) { return CollectionUtils.isEmpty(shiftProdCenterRecordList) ? null : - shiftProdCenterRecordList.stream().filter(o -> (null != o && MesExtEnumUtil.SHIFT_PROD_TYPE.UNNORMAL_STOP_CENTER.getValue() == o.getProdType() && o.getStartTime().compareTo(startTime) <= 0)).collect(Collectors.toList()); + shiftProdCenterRecordList.stream().filter(o -> (null != o && MesExtEnumUtil.SHIFT_PROD_TYPE.UNNORMAL_STOP_CENTER.getValue() == o.getProdType() && o.getStartTime().compareTo(curTime) <= 0)).collect(Collectors.toList()); } - private List getFourMChangeData(MesWorkCenterExt workCenterExtDb, String startTime) { + private List getFourMChangeData(MesWorkCenterExt workCenterExtDb, String curTime) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(workCenterExtDb.getOrganizeCode()); DdlPreparedPack.getStringEqualPack(workCenterExtDb.getWorkCenterCode(), MesExtConstWords.WORK_CENTER_CODE, packBean); - DdlPreparedPack.getStringRightLikerPack(startTime.substring(0, 10), MesExtConstWords.CREATE_DATE_TIME, packBean); + DdlPreparedPack.getStringRightLikerPack(curTime.substring(0, 10), MesExtConstWords.CREATE_DATE_TIME, packBean); DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{MesExtConstWords.CREATE_DATE_TIME}, packBean); packBean.setHqlAppend(" limit 3 "); List fourMDetailList = fourMDetailRepository.findByHqlWhere(packBean); @@ -110,40 +118,4 @@ public class JxCenterWorkingBoardBusiOneService implements IJxCenterWorkingBoard return null == workCenterNotificationBar ? "暂无公告" : workCenterNotificationBar.getContent(); } - enum SHIFT_PROD_TYPE_COLOR { - //System.out.println(String.format("#%02x%02x%02x", Color.white.getRed(), Color.white.getGreen(), Color.white.getBlue())); - NO_WORKING(0, "无生产", "无生产", "#808080", "gray"), - NORMAL_STOP_CENTER(10, "常规停机", "常规停机", "#808080", "gray"), - UNNORMAL_STOP_CENTER(20, "非常规停机", "异常停机", "#ff0000", "red"), - NORMAL_PROD(30, "常规生产", "正常生产", "#00ff00", "green"), - UNNORMAL_PROD(40, "非常规生产", "加班生产", "#ff0000", "red"); - - private int value; - private String description; - private String workingStatusName; - private String color; - private String colorName; - - SHIFT_PROD_TYPE_COLOR(int value, String description, String workingStatusName, String color, String colorName) { - this.value = value; - this.description = description; - this.workingStatusName = workingStatusName; - this.color = color; - this.colorName = colorName; - } - - public int getValue() { - return value; - } - - public static SHIFT_PROD_TYPE_COLOR getByValue(int value) { - for (SHIFT_PROD_TYPE_COLOR matchType : values()) { - if (matchType.getValue() == value) { - return matchType; - } - } - return null; - } - } - } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardBusiThreeService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterThreeService.java similarity index 75% rename from modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardBusiThreeService.java rename to modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterThreeService.java index fa4206b..ed55dab 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardBusiThreeService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterThreeService.java @@ -5,11 +5,13 @@ import cn.estsh.i3plus.ext.mes.pojo.bean.MesOutPutStatistics; import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; import cn.estsh.i3plus.platform.common.tool.MathOperation; +import cn.estsh.i3plus.platform.common.tool.TimeTool; import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder; import lombok.extern.slf4j.Slf4j; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import java.util.Calendar; import java.util.List; import java.util.Map; import java.util.Optional; @@ -21,21 +23,28 @@ import java.util.stream.Collectors; * @Modify: **/ @Slf4j -public class JxCenterWorkingBoardBusiThreeService extends JxCenterWorkingBoardCommonService implements IJxCenterWorkingBoardService { +public class JxCenterWorkingBoardCenterThreeService extends JxCenterWorkingBoardCommonService implements IJxCenterWorkingBoardService { + + private IJxCenterWorkingBoardService proxyService0; private IJxCenterWorkingBoardService proxyService; - public JxCenterWorkingBoardBusiThreeService(IJxCenterWorkingBoardService proxyService) { + public JxCenterWorkingBoardCenterThreeService(IJxCenterWorkingBoardService proxyService0, IJxCenterWorkingBoardService proxyService) { + this.proxyService0 = proxyService0; this.proxyService = proxyService; } @Override public Map queryCenterWorkingBoardData(Map dataMap) { - dataMap = proxyService.queryCenterWorkingBoardData(dataMap); + dataMap = proxyService0.queryCenterWorkingBoardData(dataMap); MesWorkCenterExt workCenterExtDb = (MesWorkCenterExt) dataMap.get(MesWorkCenterExt.class.getSimpleName()); + packProxyCondition(dataMap, workCenterExtDb); + + dataMap = proxyService.queryCenterWorkingBoardData(dataMap); + List workOrderList = (List) dataMap.get(MesWorkOrder.class.getSimpleName()); List outPutStatisticsList = (List) dataMap.get(MesOutPutStatistics.class.getSimpleName()); @@ -59,9 +68,23 @@ public class JxCenterWorkingBoardBusiThreeService extends JxCenterWorkingBoardCo dataMap.remove(MesWorkOrder.class.getSimpleName()); dataMap.remove(MesOutPutStatistics.class.getSimpleName()); dataMap.remove(MesExtConstWords.COMPLET_QTY); + dataMap.remove(MesExtConstWords.START_TIME); + dataMap.remove(MesExtConstWords.END_TIME); + dataMap.remove(MesExtConstWords.WORK_TIME); + dataMap.remove(MesExtConstWords.SHIFT_CODE); + dataMap.remove(MesExtConstWords.WORK_CENTER_CODE); return dataMap; } + private void packProxyCondition(Map dataMap, MesWorkCenterExt workCenterExtDb) { + if (StringUtils.isEmpty(workCenterExtDb.getWorkTime()) || StringUtils.isEmpty(workCenterExtDb.getShiftCode())) return; + dataMap.put(MesExtConstWords.START_TIME, TimeTool.timeCalc(TimeTool.stringParseToDate(workCenterExtDb.getWorkTime(), MesExtConstWords.DATE_FORMAT), Calendar.DATE, -1, MesExtConstWords.DATE_FORMAT)); + dataMap.put(MesExtConstWords.END_TIME, workCenterExtDb.getWorkTime()); + dataMap.put(MesExtConstWords.WORK_TIME, workCenterExtDb.getWorkTime()); + dataMap.put(MesExtConstWords.SHIFT_CODE, workCenterExtDb.getShiftCode()); + dataMap.put(MesExtConstWords.WORK_CENTER_CODE, workCenterExtDb.getWorkCenterCode()); + } + private Optional getFirstWorkOrder(List workOrderList, List outPutStatisticsList, MesWorkCenterExt workCenterExtDb) { if (!CollectionUtils.isEmpty(outPutStatisticsList)) return CollectionUtils.isEmpty(workOrderList) ? null : workOrderList.stream().filter(o -> (null != o && o.getOrderNo().equals(outPutStatisticsList.get(0).getWorkOrderNo()))).findFirst(); diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardBusiTwoService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterTwoService.java similarity index 83% rename from modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardBusiTwoService.java rename to modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterTwoService.java index d2a0e43..0ddf5ad 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardBusiTwoService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterTwoService.java @@ -1,10 +1,10 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService; +import cn.estsh.i3plus.ext.mes.apiservice.dao.IPartExtDao; import cn.estsh.i3plus.ext.mes.pojo.bean.*; import cn.estsh.i3plus.ext.mes.pojo.model.jx.JxCenterWorkingBoardBusiModel; import cn.estsh.i3plus.ext.mes.pojo.repository.MesOrderJobRepository; -import cn.estsh.i3plus.ext.mes.pojo.repository.MesRepairTaskRepository; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; import cn.estsh.i3plus.platform.common.tool.MathOperation; @@ -28,7 +28,9 @@ import java.util.stream.Collectors; * @Modify: **/ @Slf4j -public class JxCenterWorkingBoardBusiTwoService extends JxCenterWorkingBoardCommonService implements IJxCenterWorkingBoardService { +public class JxCenterWorkingBoardCenterTwoService extends JxCenterWorkingBoardCommonService implements IJxCenterWorkingBoardService { + + private IJxCenterWorkingBoardService proxyService0; private IJxCenterWorkingBoardService proxyService; @@ -36,35 +38,40 @@ public class JxCenterWorkingBoardBusiTwoService extends JxCenterWorkingBoardComm private MesOrderJobRepository orderJobRepository; - private MesRepairTaskRepository repairTaskRepository; + private IPartExtDao partExtDao; - public JxCenterWorkingBoardBusiTwoService(IJxCenterWorkingBoardService proxyService) { + public JxCenterWorkingBoardCenterTwoService(IJxCenterWorkingBoardService proxyService0, IJxCenterWorkingBoardService proxyService) { + this.proxyService0 = proxyService0; this.proxyService = proxyService; this.shiftRepository = (MesShiftRepository) SpringContextsUtil.getBean("mesShiftRepository"); this.orderJobRepository = (MesOrderJobRepository) SpringContextsUtil.getBean("mesOrderJobRepository"); - this.repairTaskRepository = (MesRepairTaskRepository) SpringContextsUtil.getBean("mesRepairTaskRepository"); + this.partExtDao = (IPartExtDao) SpringContextsUtil.getBean("partExtDao"); } @Override public Map queryCenterWorkingBoardData(Map dataMap) { - dataMap = proxyService.queryCenterWorkingBoardData(dataMap); - - String startTime = (String) dataMap.get(MesExtConstWords.START_TIME); + dataMap = proxyService0.queryCenterWorkingBoardData(dataMap); MesWorkCenterExt workCenterExtDb = (MesWorkCenterExt) dataMap.get(MesWorkCenterExt.class.getSimpleName()); - List workOrderList = (List) dataMap.get(MesWorkOrder.class.getSimpleName()); + packProxyCondition(dataMap, workCenterExtDb); + + dataMap = proxyService.queryCenterWorkingBoardData(dataMap); + + String curTime = TimeTool.getNowTime(true); List shiftProdCenterRecordList = (List) dataMap.get(MesShiftProdCenterRecord.class.getSimpleName()); + List workOrderList = (List) dataMap.get(MesWorkOrder.class.getSimpleName()); + List outPutStatisticsList = (List) dataMap.get(MesOutPutStatistics.class.getSimpleName()); - Map partStandardWorkMap = (Map) dataMap.get(MesExtConstWords.STANDARD_WORK); + List repairTaskList = (List) dataMap.get(MesRepairTask.class.getSimpleName()); - List repairTaskList = getRepairTaskList(workCenterExtDb); + Map partStandardWorkMap = partExtDao.queryPartExtStandardWorkMap(workCenterExtDb.getOrganizeCode()); - statisticsData(shiftProdCenterRecordList, outPutStatisticsList, partStandardWorkMap, workCenterExtDb, startTime, dataMap); + statisticsData(shiftProdCenterRecordList, outPutStatisticsList, partStandardWorkMap, workCenterExtDb, curTime, dataMap); dataMap.put("当前班次", getShiftName(workCenterExtDb)); @@ -99,9 +106,13 @@ public class JxCenterWorkingBoardBusiTwoService extends JxCenterWorkingBoardComm dataMap.remove(MesShiftProdCenterRecord.class.getSimpleName()); dataMap.remove(MesWorkOrder.class.getSimpleName()); dataMap.remove(MesOutPutStatistics.class.getSimpleName()); - dataMap.remove(MesExtConstWords.STANDARD_WORK); dataMap.remove(MesExtConstWords.QTY); dataMap.remove(MesExtConstWords.COMPLET_QTY); + dataMap.remove(MesExtConstWords.START_TIME); + dataMap.remove(MesExtConstWords.END_TIME); + dataMap.remove(MesExtConstWords.WORK_TIME); + dataMap.remove(MesExtConstWords.SHIFT_CODE); + dataMap.remove(MesExtConstWords.WORK_CENTER_CODE); dataMap.remove("serviceTime"); dataMap.remove("nonWorkingTime"); dataMap.remove("standardTime"); @@ -109,25 +120,27 @@ public class JxCenterWorkingBoardBusiTwoService extends JxCenterWorkingBoardComm return dataMap; } - private List getRepairTaskList(MesWorkCenterExt workCenterExtDb) { - return StringUtils.isEmpty(workCenterExtDb.getWorkTime()) ? null : - repairTaskRepository.findByProperty( - new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME}, - new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getWorkTime()}); + private void packProxyCondition(Map dataMap, MesWorkCenterExt workCenterExtDb) { + if (StringUtils.isEmpty(workCenterExtDb.getWorkTime()) || StringUtils.isEmpty(workCenterExtDb.getShiftCode())) return; + dataMap.put(MesExtConstWords.START_TIME, TimeTool.timeCalc(TimeTool.stringParseToDate(workCenterExtDb.getWorkTime(), MesExtConstWords.DATE_FORMAT), Calendar.DATE, -1, MesExtConstWords.DATE_FORMAT)); + dataMap.put(MesExtConstWords.END_TIME, workCenterExtDb.getWorkTime()); + dataMap.put(MesExtConstWords.WORK_TIME, workCenterExtDb.getWorkTime()); + dataMap.put(MesExtConstWords.SHIFT_CODE, workCenterExtDb.getShiftCode()); + dataMap.put(MesExtConstWords.WORK_CENTER_CODE, workCenterExtDb.getWorkCenterCode()); } private void statisticsData(List shiftProdCenterRecordList, List outPutStatisticsList, - Map partStandardWorkMap, MesWorkCenterExt workCenterExtDb, String startTime, Map dataMap) { + Map partStandardWorkMap, MesWorkCenterExt workCenterExtDb, String curTime, Map dataMap) { List filterList2OutPut = CollectionUtils.isEmpty(outPutStatisticsList) ? null : outPutStatisticsList.stream().filter(o -> (null != o && o.getShiftCode().equals(workCenterExtDb.getShiftCode()))).collect(Collectors.toList()); List filterList2ShiftProd = CollectionUtils.isEmpty(shiftProdCenterRecordList) ? null : - shiftProdCenterRecordList.stream().filter(o -> (null != o && o.getShiftCode().equals(workCenterExtDb.getShiftCode()) && o.getStartTime().compareTo(startTime) <= 0)).collect(Collectors.toList()); + shiftProdCenterRecordList.stream().filter(o -> (null != o && o.getShiftCode().equals(workCenterExtDb.getShiftCode()) && o.getStartTime().compareTo(curTime) <= 0)).collect(Collectors.toList()); List stopList = getShiftProdDataListByFlag(filterList2ShiftProd, false); List prodList = getShiftProdDataListByFlag(filterList2ShiftProd, true); - Double serviceTime = CollectionUtils.isEmpty(prodList) ? new Double(0) : prodList.stream().filter(o -> null != o).mapToDouble(o -> getStatisticsTime(o, startTime)).sum(); - Double nonWorkingTime = CollectionUtils.isEmpty(stopList) ? new Double(0) : stopList.stream().filter(o -> null != o).mapToDouble(o -> getStatisticsTime(o, startTime)).sum(); + Double serviceTime = CollectionUtils.isEmpty(prodList) ? new Double(0) : prodList.stream().filter(o -> null != o).mapToDouble(o -> getStatisticsTime(o, curTime)).sum(); + Double nonWorkingTime = CollectionUtils.isEmpty(stopList) ? new Double(0) : stopList.stream().filter(o -> null != o).mapToDouble(o -> getStatisticsTime(o, curTime)).sum(); Double standardTime = CollectionUtils.isEmpty(filterList2OutPut) ? new Double(0) : filterList2OutPut.stream().filter(o -> null != o).mapToDouble(o -> getStatisticsTime(o, partStandardWorkMap)).sum(); Double workingTime = MathOperation.sub(serviceTime, nonWorkingTime); @@ -138,9 +151,9 @@ public class JxCenterWorkingBoardBusiTwoService extends JxCenterWorkingBoardComm } - private Double getStatisticsTime(MesShiftProdCenterRecord shiftProdCenterRecord, String startTime) { + private Double getStatisticsTime(MesShiftProdCenterRecord shiftProdCenterRecord, String curTime) { try { - String endTime = shiftProdCenterRecord.getEndTime().compareTo(startTime) <= 0 ? shiftProdCenterRecord.getEndTime() : startTime; + String endTime = shiftProdCenterRecord.getEndTime().compareTo(curTime) <= 0 ? shiftProdCenterRecord.getEndTime() : curTime; return MathOperation.mul(new Double(TimeTool.getSecoundsBetweenTime(2, shiftProdCenterRecord.getStartTime(), endTime)), shiftProdCenterRecord.getWorkerQty()); } catch (ParseException e) { return new Double(0); @@ -176,10 +189,6 @@ public class JxCenterWorkingBoardBusiTwoService extends JxCenterWorkingBoardComm return new StringJoiner(MesExtConstWords.SINGLE_SLASH).add(getListSizeStr(orderJobList4Complete)).add(getListSizeStr(orderJobList)).toString(); } - private String getListSizeStr(List list) { return CollectionUtils.isEmpty(list) ? MesExtConstWords.ZERO_STR : String.valueOf(list.size()); - } - private Double getListSizeD(List list) { return new Double(CollectionUtils.isEmpty(list) ? MesExtConstWords.ZERO : list.size()); } - private String getTodayOrderPlanQty(List workOrderList, MesWorkCenterExt workCenterExtDb, Map dataMap) { Double qty = CollectionUtils.isEmpty(workOrderList) ? new Double(0) : workOrderList.stream().filter(o -> (null != o && o.getStartTime().contains(workCenterExtDb.getWorkTime()))).mapToDouble(MesWorkOrder::getQty).sum(); dataMap.put(MesExtConstWords.QTY, qty); @@ -229,7 +238,7 @@ public class JxCenterWorkingBoardBusiTwoService extends JxCenterWorkingBoardComm List orderList = CollectionUtils.isEmpty(orderMap) ? null : orderMap.get(partNo); List outPutList = CollectionUtils.isEmpty(outPutMap) ? null : outPutMap.get(partNo); - Map> itemMap2OutPut = CollectionUtils.isEmpty(outPutList) ? null : outPutList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesOutPutStatistics::getWorkOrderNo)); + Map> itemMap2OutPut = getOutPutStatisticsMapByOrderNo(outPutList); psData.addChartData2ChartDataLists(5, partNo, statisticsPlanQty(orderList, itemMap2OutPut, workCenterExtDb), getOutPutStatisticsList2AmountQty(outPutList), !CollectionUtils.isEmpty(psData.getChartDataList()) ? "#ffffff" : "#00ff00"); @@ -249,21 +258,4 @@ public class JxCenterWorkingBoardBusiTwoService extends JxCenterWorkingBoardComm return getOutPutStatisticsList2AmountQty(outPutStatisticsList); } - private String getBigDecimalPercent(BigDecimal b) { - return b + MesExtConstWords.PERCENT; - } - - private BigDecimal divThenMul100Format1RoundHalfUp(Double d1, Double d2) { - Double d = (MathOperation.compareTo(d1, new Double(0)) == 0 || MathOperation.compareTo(d2, new Double(0)) == 0) - ? null : MathOperation.mul(MathOperation.div(d1, d2), new Double(100)); - return format1RounHalfUp(d); - } - - private BigDecimal format1RounHalfUp(Double d) { - if (StringUtils.isEmpty(d)) d = new Double(0); - BigDecimal bd = new BigDecimal(d); - bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP); - return bd; - } - } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCommonService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCommonService.java index d0a33a1..b1d96e3 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCommonService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCommonService.java @@ -2,13 +2,17 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; import cn.estsh.i3plus.ext.mes.pojo.bean.MesOutPutStatistics; import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt; +import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; import cn.estsh.i3plus.platform.common.tool.MathOperation; import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder; import lombok.extern.slf4j.Slf4j; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; +import java.math.BigDecimal; import java.util.Comparator; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -27,10 +31,51 @@ public class JxCenterWorkingBoardCommonService { ))).sorted(Comparator.comparing(MesWorkOrder::getSeq)).collect(Collectors.toList()); } + public List getWorkOrderListByWorkTime(List workOrderList, String workTime) { + return CollectionUtils.isEmpty(workOrderList) ? null : workOrderList.stream().filter(o -> (null != o && o.getStartTime().contains(workTime))).collect(Collectors.toList()); + } + + public List getOutPutStatisticsListByWorkTime(List outPutStatisticsList, String workTime) { + return CollectionUtils.isEmpty(outPutStatisticsList) ? null : outPutStatisticsList.stream().filter(o -> (null != o && o.getWorkTime().equals(workTime))).collect(Collectors.toList()); + } + + public Double getWorkOrderList2AmountQty(List workOrderList) { + return CollectionUtils.isEmpty(workOrderList) ? new Double(0) : workOrderList.stream().filter(o -> null != o).mapToDouble(MesWorkOrder::getQty).sum(); + } + public Double getOutPutStatisticsList2AmountQty(List outPutStatisticsList) { return CollectionUtils.isEmpty(outPutStatisticsList) ? new Double(0) : outPutStatisticsList.stream().filter(o -> null != o).mapToDouble(MesOutPutStatistics::getQty).sum(); } + public Map> getOutPutStatisticsMapByOrderNo(List outPutStatisticsList) { + return CollectionUtils.isEmpty(outPutStatisticsList) ? null : outPutStatisticsList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesOutPutStatistics::getWorkOrderNo)); + } + + public List sortOutPutStatisticsList(List outPutStatisticsList) { + return CollectionUtils.isEmpty(outPutStatisticsList) ? null : outPutStatisticsList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesOutPutStatistics::getModifyDatetime).reversed()).collect(Collectors.toList()); + } + public String getQtyStr(Double qty) { return qty.intValue() + "台"; } + public String getListSizeStr(List list) { return CollectionUtils.isEmpty(list) ? MesExtConstWords.ZERO_STR : String.valueOf(list.size()); } + + public Double getListSizeD(List list) { return new Double(CollectionUtils.isEmpty(list) ? MesExtConstWords.ZERO : list.size()); } + + public String getBigDecimalPercent(BigDecimal b) { + return b + MesExtConstWords.PERCENT; + } + + public BigDecimal divThenMul100Format1RoundHalfUp(Double d1, Double d2) { + Double d = (MathOperation.compareTo(d1, new Double(0)) == 0 || MathOperation.compareTo(d2, new Double(0)) == 0) + ? null : MathOperation.mul(MathOperation.div(d1, d2), new Double(100)); + return format1RounHalfUp(d); + } + + public BigDecimal format1RounHalfUp(Double d) { + if (StringUtils.isEmpty(d)) d = new Double(0); + BigDecimal bd = new BigDecimal(d); + bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP); + return bd; + } + } \ No newline at end of file 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 00ecfb3..32cfd86 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 @@ -20,12 +20,21 @@ public class JxCenterWorkingBoardDispatchService implements IJxCenterWorkingBoar public Map queryCenterWorkingBoardData(Map dataMap) { switch ((String) dataMap.get(MesExtConstWords.FLAG)) { - case "1": - return new JxCenterWorkingBoardBusiOneService(new JxCenterWorkingBoardProxySpcrService(new JxCenterWorkingBoardProxyCenterService())).queryCenterWorkingBoardData(dataMap); - case "2": - return new JxCenterWorkingBoardBusiTwoService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxySpcrService(new JxCenterWorkingBoardProxyCenterService())))).queryCenterWorkingBoardData(dataMap); - case "3": - return new JxCenterWorkingBoardBusiThreeService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyCenterService()))).queryCenterWorkingBoardData(dataMap); + + case "center01": + return new JxCenterWorkingBoardCenterOneService(new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyWorkingStatusService(new JxCenterWorkingBoardProxySpcrService())).queryCenterWorkingBoardData(dataMap); + + case "center02": + return new JxCenterWorkingBoardCenterTwoService(new JxCenterWorkingBoardProxyCenterService(), + new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyRepairService(new JxCenterWorkingBoardProxySpcrService())))).queryCenterWorkingBoardData(dataMap); + + case "center03": + return new JxCenterWorkingBoardCenterThreeService(new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService())).queryCenterWorkingBoardData(dataMap); + + case "monitor01": + return new JxCenterWorkingBoardMonitorOneService(new JxCenterWorkingBoardProxyAllCenterService(), new JxCenterWorkingBoardProxyWorkingStatusService(), + 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/JxCenterWorkingBoardMonitorOneService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardMonitorOneService.java new file mode 100644 index 0000000..0901cb4 --- /dev/null +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardMonitorOneService.java @@ -0,0 +1,241 @@ +package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; + +import cn.estsh.i3plus.ext.mes.api.base.IMesAccidentDateService; +import cn.estsh.i3plus.ext.mes.api.base.IMesNumberOfSafeOperationDaysService; +import cn.estsh.i3plus.ext.mes.api.base.bu.IBusiConfigService; +import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService; +import cn.estsh.i3plus.ext.mes.pojo.bean.*; +import cn.estsh.i3plus.ext.mes.pojo.model.MesAccidentDateModel; +import cn.estsh.i3plus.ext.mes.pojo.model.jx.JxCenterWorkingBoardBusiModel; +import cn.estsh.i3plus.ext.mes.pojo.repository.MesOutPutStatisticsRepository; +import cn.estsh.i3plus.ext.mes.pojo.repository.MesPlantInfoRepository; +import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; +import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.platform.common.tool.MathOperation; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder; +import cn.estsh.impp.framework.boot.util.SpringContextsUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author : wangjie + * @CreateDate : 2022-02-15 + * @Modify: + **/ +@Slf4j +public class JxCenterWorkingBoardMonitorOneService extends JxCenterWorkingBoardCommonService implements IJxCenterWorkingBoardService { + + private IJxCenterWorkingBoardService proxyService0; + + private IJxCenterWorkingBoardService proxyService1; + + private IJxCenterWorkingBoardService proxyService; + + private MesPlantInfoRepository plantInfoRepository; + + private IMesNumberOfSafeOperationDaysService numberOfSafeOperationDaysService; + + private IMesAccidentDateService accidentDateService; + + private IBusiConfigService busiConfigService; + + private MesOutPutStatisticsRepository outPutStatisticsRepository; + + public JxCenterWorkingBoardMonitorOneService(IJxCenterWorkingBoardService proxyService0, IJxCenterWorkingBoardService proxyService1, IJxCenterWorkingBoardService proxyService) { + this.proxyService0 = proxyService0; + this.proxyService1 = proxyService1; + this.proxyService = proxyService; + this.plantInfoRepository = (MesPlantInfoRepository) SpringContextsUtil.getBean("mesPlantInfoRepository"); + this.numberOfSafeOperationDaysService = (IMesNumberOfSafeOperationDaysService) SpringContextsUtil.getBean("mesNumberOfSafeOperationDaysService"); + this.accidentDateService = (IMesAccidentDateService) SpringContextsUtil.getBean("mesAccidentDateService"); + this.busiConfigService = (IBusiConfigService) SpringContextsUtil.getBean("busiConfigService"); + this.outPutStatisticsRepository = (MesOutPutStatisticsRepository) SpringContextsUtil.getBean("mesOutPutStatisticsRepository"); + } + + @Override + public Map queryCenterWorkingBoardData(Map dataMap) { + + dataMap = proxyService0.queryCenterWorkingBoardData(dataMap); + + List workCenterExtDbList = (List) dataMap.get(MesWorkCenterExt.class.getSimpleName()); + + packProxyCondition(dataMap, workCenterExtDbList); + + dataMap = proxyService.queryCenterWorkingBoardData(dataMap); + + String organizeCode = (String) dataMap.get(MesExtConstWords.ORGANIZE_CODE); + + dataMap.put("BOARD_TITLE", "PKATJX智能工场监控中心"); + + dataMap.put("BOARD_BOTTOM", "PKATJX·松下厨电科技(嘉兴)有限公司"); + + dataMap.put("工厂信息总览", getOrganizeInfo(organizeCode)); + + dataMap.put("累计安全运行天数", getAmountSafeRunningDays(organizeCode)); + + dataMap.put("当年累计总事故数", getCurYearAmountAccident(organizeCode)); + + dataMap.put("生产进度", getProductionSchedule(organizeCode, workCenterExtDbList, dataMap)); + + dataMap.put("本体产线状态", getOntologyLineWorkingStatus(organizeCode, workCenterExtDbList, dataMap)); + + dataMap.put("本体能率", ""); + + return clearUselessData(dataMap); + } + + @Override + public Map clearUselessData(Map dataMap) { + dataMap.remove(MesWorkCenterExt.class.getSimpleName()); + dataMap.remove(MesWorkOrder.class.getSimpleName()); + dataMap.remove(MesOutPutStatistics.class.getSimpleName()); + dataMap.remove(MesExtConstWords.START_TIME); + dataMap.remove(MesExtConstWords.END_TIME); + dataMap.remove(MesExtConstWords.WORK_TIME); + dataMap.remove(MesExtConstWords.SHIFT_CODE); + dataMap.remove(MesExtConstWords.WORK_CENTER_CODE); + return dataMap; + } + + private void packProxyCondition(Map dataMap, List workCenterExtDbList) { + List workTimeList = workCenterExtDbList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getWorkTime()) && !StringUtils.isEmpty(o.getShiftCode()))).map(MesWorkCenterExt::getWorkTime).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(workTimeList)) return; + Collections.sort(workTimeList); + dataMap.put(MesExtConstWords.START_TIME, workTimeList.get(0)); + dataMap.put(MesExtConstWords.END_TIME, workTimeList.get(workTimeList.size() - 1)); + } + + private MesPlantInfo getOrganizeInfo(String organizeCode) { + return plantInfoRepository.getByProperty( + new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID}, + new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue()}); + } + + private MesNumberOfSafeOperationDays getAmountSafeRunningDays(String organizeCode) { + return numberOfSafeOperationDaysService.queryNumberOfSafeOperationDays(organizeCode); + } + + private MesAccidentDateModel getCurYearAmountAccident(String organizeCode) { + return accidentDateService.queryAccidentDaysBoard(organizeCode); + } + + private Map> getCenterMap4Order(List workOrderList) { + return CollectionUtils.isEmpty(workOrderList) ? null : workOrderList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesWorkOrder::getWorkCenterCode)); + } + + private Map> getCenterMap4OutPut(List outPutStatisticsList) { + return CollectionUtils.isEmpty(outPutStatisticsList) ? null : outPutStatisticsList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesOutPutStatistics::getWorkCenterCode)); + } + + private JxCenterWorkingBoardBusiModel getProductionSchedule(String organizeCode, List workCenterExtDbList, Map dataMap) { + + JxCenterWorkingBoardBusiModel psData = new JxCenterWorkingBoardBusiModel().title("生产进度"); + + List workOrderList = (List) dataMap.get(MesWorkOrder.class.getSimpleName()); + List outPutStatisticsList = (List) dataMap.get(MesOutPutStatistics.class.getSimpleName()); + if (CollectionUtils.isEmpty(workOrderList) && CollectionUtils.isEmpty(outPutStatisticsList)) return psData; + + MesBusiConfig catagoryCodeCfg = busiConfigService.getBusiConfigByCfgCode(organizeCode, MesExtConstWords.SX_CATEGORY_CFG); + if (null == catagoryCodeCfg || StringUtils.isEmpty(catagoryCodeCfg.getCfgValue()) || StringUtils.isEmpty(catagoryCodeCfg.getCfgValueSeq())) return psData; + + String[] categoryCodeArr = catagoryCodeCfg.getCfgValueSeq().split(MesExtConstWords.COMMA); + String[] categoryNameArr = catagoryCodeCfg.getCfgValue().split(MesExtConstWords.COMMA); + if (categoryCodeArr.length != categoryNameArr.length) return psData; + + Map> centerMap4OrderFilter = new HashMap<>(); + Map> centerMap4OutPutFilter = new HashMap<>(); + + Map> centerMap4Order = getCenterMap4Order(workOrderList); + Map> centerMap4OutPut = getCenterMap4OutPut(outPutStatisticsList); + + Map> categoryCodeMap4Order = new HashMap<>(); + Map> categoryCodeMap4OutPut = new HashMap<>(); + + for (MesWorkCenterExt workCenterExtDb : workCenterExtDbList) { + if (null == workCenterExtDb) continue; + if (StringUtils.isEmpty(workCenterExtDb.getCategoryCode()) || StringUtils.isEmpty(workCenterExtDb.getWorkTime()) || StringUtils.isEmpty(workCenterExtDb.getShiftCode())) continue; + + List workOrderList4Center = CollectionUtils.isEmpty(centerMap4Order) ? null : getWorkOrderListByWorkTime(centerMap4Order.get(workCenterExtDb.getWorkCenterCode()), workCenterExtDb.getWorkTime()); + List outPutStatisticsList4Center = CollectionUtils.isEmpty(centerMap4OutPut) ? null : getOutPutStatisticsListByWorkTime(centerMap4OutPut.get(workCenterExtDb.getWorkCenterCode()), workCenterExtDb.getWorkTime()); + + List categoryCodeList4Order = (!CollectionUtils.isEmpty(categoryCodeMap4Order) && categoryCodeMap4Order.containsKey(workCenterExtDb.getCategoryCode())) ? categoryCodeMap4Order.get(workCenterExtDb.getCategoryCode()) : new ArrayList<>(); + List categoryCodeList4OutPut = (!CollectionUtils.isEmpty(categoryCodeMap4OutPut) && categoryCodeMap4OutPut.containsKey(workCenterExtDb.getCategoryCode())) ? categoryCodeMap4OutPut.get(workCenterExtDb.getCategoryCode()) : new ArrayList<>(); + if (!CollectionUtils.isEmpty(workOrderList4Center)) categoryCodeList4Order.addAll(workOrderList4Center); + if (!CollectionUtils.isEmpty(outPutStatisticsList4Center)) categoryCodeList4OutPut.addAll(outPutStatisticsList4Center); + + categoryCodeMap4Order.put(workCenterExtDb.getCategoryCode(), categoryCodeList4Order); + categoryCodeMap4OutPut.put(workCenterExtDb.getCategoryCode(), categoryCodeList4OutPut); + + if (!CollectionUtils.isEmpty(workOrderList4Center)) centerMap4OrderFilter.put(workCenterExtDb.getWorkCenterCode(), workOrderList4Center); + if (!CollectionUtils.isEmpty(outPutStatisticsList4Center)) centerMap4OutPutFilter.put(workCenterExtDb.getWorkCenterCode(), sortOutPutStatisticsList(outPutStatisticsList4Center)); + } + + for (int i = 0; i < categoryCodeArr.length; i ++) { + List workOrderList4Category = CollectionUtils.isEmpty(categoryCodeMap4Order) ? null : categoryCodeMap4Order.get(categoryCodeArr[i]); + List outPutStatisticsList4Category = CollectionUtils.isEmpty(categoryCodeMap4OutPut) ? null : categoryCodeMap4OutPut.get(categoryCodeArr[i]); + + Double planQtyAmount = getWorkOrderList2AmountQty(workOrderList4Category); + Double completeQtyAmount = getOutPutStatisticsList2AmountQty(outPutStatisticsList4Category); + + psData.addChartData(categoryNameArr[i], completeQtyAmount, planQtyAmount, getBigDecimalPercent(divThenMul100Format1RoundHalfUp(completeQtyAmount, planQtyAmount))); + } + + dataMap.put(MesWorkOrder.class.getSimpleName(), centerMap4OrderFilter); + dataMap.put(MesOutPutStatistics.class.getSimpleName(), centerMap4OutPutFilter); + + return psData; + } + + private JxCenterWorkingBoardBusiModel getOntologyLineWorkingStatus(String organizeCode, List workCenterExtDbList, Map dataMap) { + + JxCenterWorkingBoardBusiModel psData = new JxCenterWorkingBoardBusiModel().title("本体产线状态"); + + List busiConfigList = busiConfigService.getConfigListSortSeq(organizeCode, MesExtConstWords.BOARD_WORK_SHOW_FLAG); + if (CollectionUtils.isEmpty(busiConfigList)) return psData; + + Map workCenterExtDbMap = workCenterExtDbList.stream().filter(o -> null != o).collect(Collectors.toMap(MesWorkCenterExt::getWorkCenterCode, o -> o)); + + Map> centerMap4OutPutFilter = (Map>) dataMap.get(MesOutPutStatistics.class.getSimpleName()); + List repairTaskList = (List) dataMap.get(MesRepairTask.class.getSimpleName()); + + for (MesBusiConfig busiConfig : busiConfigList) { + if (null == busiConfig || !workCenterExtDbMap.containsKey(busiConfig.getCfgValue())) continue; + MesWorkCenterExt workCenterExtDb = workCenterExtDbMap.get(busiConfig.getCfgValue()); + if (StringUtils.isEmpty(workCenterExtDb.getLineType()) || !workCenterExtDb.getLineType().equals(MesExtEnumUtil.LINE_TYPE.ONTOLOGY_LINE.getValueStr())) continue; + dataMap.put(MesExtConstWords.WORK_TIME, workCenterExtDb.getWorkTime()); + dataMap.put(MesExtConstWords.SHIFT_CODE, workCenterExtDb.getShiftCode()); + dataMap.put(MesExtConstWords.WORK_CENTER_CODE, workCenterExtDb.getWorkCenterCode()); + MesOutPutStatistics outPutStatistics = (!CollectionUtils.isEmpty(centerMap4OutPutFilter) && centerMap4OutPutFilter.containsKey(workCenterExtDb.getWorkCenterCode())) ? centerMap4OutPutFilter.get(workCenterExtDb.getWorkCenterCode()).get(0) : getOutPutStatisticsByCenter(organizeCode, workCenterExtDb.getWorkCenterCode()); + List outPutStatisticsListFilter = (null == outPutStatistics || CollectionUtils.isEmpty(centerMap4OutPutFilter)) ? null : centerMap4OutPutFilter.get(workCenterExtDb.getWorkCenterCode()); + outPutStatisticsListFilter = CollectionUtils.isEmpty(outPutStatisticsListFilter) ? null : outPutStatisticsListFilter.stream().filter(o -> (null != o && o.getWorkOrderNo().equals(outPutStatistics.getWorkOrderNo()))).collect(Collectors.toList()); + psData.addChartData(workCenterExtDb.getWorkCenterCode(), null == outPutStatistics ? null : outPutStatistics.getPartNo(), getRepairRate(outPutStatisticsListFilter, repairTaskList, workCenterExtDb), proxyService1.queryCenterWorkingBoardData(dataMap).get("生产状态")); + } + + return psData; + } + + private String getRepairRate(List outPutStatisticsList, List repairTaskList, MesWorkCenterExt workCenterExtDb) { + return (CollectionUtils.isEmpty(outPutStatisticsList) || StringUtils.isEmpty(workCenterExtDb.getWorkTime())) ? getBigDecimalPercent(format1RounHalfUp(new Double(0))) : calcRepairRate(outPutStatisticsList, repairTaskList, workCenterExtDb); + } + + private String calcRepairRate(List outPutStatisticsList, List repairTaskList, MesWorkCenterExt workCenterExtDb) { + Double repairQty = CollectionUtils.isEmpty(repairTaskList) ? new Double(0) : getListSizeD(repairTaskList.stream().filter(o -> (null != o && o.getWorkOrderNo().equals(outPutStatisticsList.get(0).getWorkOrderNo()) && o.getWorkTime().equals(workCenterExtDb.getWorkTime()))).collect(Collectors.toList())); + Double qty = getOutPutStatisticsList2AmountQty(outPutStatisticsList); + return getBigDecimalPercent(format1RounHalfUp(MathOperation.sub(new Double(100), MathOperation.div(qty, MathOperation.add(qty, repairQty))))); + } + + private MesOutPutStatistics getOutPutStatisticsByCenter(String organizeCode, String workCenterCode) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getNumEqualPack(workCenterCode, MesExtConstWords.WORK_CENTER_CODE, packBean); + DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.WORK_ORDER_TYPE.STANDARD_ORDER.getValue(), MesExtConstWords.WORK_ORDER_TYPE, packBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{MesExtConstWords.MODIFY_DATE_TIME}, packBean); + return outPutStatisticsRepository.getByProperty(packBean); + } +} diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyAllCenterService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyAllCenterService.java new file mode 100644 index 0000000..65532fe --- /dev/null +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyAllCenterService.java @@ -0,0 +1,36 @@ +package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; + +import cn.estsh.i3plus.ext.mes.api.base.IProdOrgExtService; +import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService; +import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt; +import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; +import cn.estsh.impp.framework.boot.util.SpringContextsUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Map; + +/** + * @Author : wangjie + * @CreateDate : 2022-02-15 + * @Modify: + **/ +@Slf4j +public class JxCenterWorkingBoardProxyAllCenterService implements IJxCenterWorkingBoardService { + + private IProdOrgExtService prodOrgExtService; + + public JxCenterWorkingBoardProxyAllCenterService() { + this.prodOrgExtService = (IProdOrgExtService) SpringContextsUtil.getBean("prodOrgExtService"); + } + + @Override + public Map queryCenterWorkingBoardData(Map dataMap) { + List workCenterExtDbList = prodOrgExtService.queryWorkCenterExtList((String) dataMap.get(MesExtConstWords.ORGANIZE_CODE)); + if (CollectionUtils.isEmpty(workCenterExtDbList)) return dataMap; + dataMap.put(MesWorkCenterExt.class.getSimpleName(), workCenterExtDbList); + return dataMap; + } + +} diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyCenterService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyCenterService.java index 17ab2b2..70e01e8 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyCenterService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyCenterService.java @@ -27,7 +27,6 @@ public class JxCenterWorkingBoardProxyCenterService implements IJxCenterWorkingB public Map queryCenterWorkingBoardData(Map dataMap) { MesWorkCenterExt workCenterExtDb = prodOrgExtService.getWorkCenterExt((String) dataMap.get(MesExtConstWords.ORGANIZE_CODE), (String) dataMap.get(MesExtConstWords.WORK_CENTER_CODE)); dataMap.put(MesWorkCenterExt.class.getSimpleName(), workCenterExtDb); - dataMap.put("BOARD_NAME", workCenterExtDb.getWorkCenterName() + "产线运行状态看板"); return dataMap; } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyOrderService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyOrderService.java index 0a60ecf..816e769 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyOrderService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyOrderService.java @@ -1,10 +1,8 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService; -import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; -import cn.estsh.i3plus.platform.common.tool.TimeTool; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder; @@ -14,7 +12,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; -import java.util.Calendar; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -39,18 +36,19 @@ public class JxCenterWorkingBoardProxyOrderService implements IJxCenterWorkingBo @Override public Map queryCenterWorkingBoardData(Map dataMap) { - dataMap = proxyService.queryCenterWorkingBoardData(dataMap); + if (null != proxyService) dataMap = proxyService.queryCenterWorkingBoardData(dataMap); - MesWorkCenterExt workCenterExtDb = (MesWorkCenterExt) dataMap.get(MesWorkCenterExt.class.getSimpleName()); - if (StringUtils.isEmpty(workCenterExtDb.getWorkTime()) || StringUtils.isEmpty(workCenterExtDb.getShiftCode())) return dataMap; + String orgainzeCode = (String) dataMap.get(MesExtConstWords.ORGANIZE_CODE); + String workCenterCode = (String) dataMap.get(MesExtConstWords.WORK_CENTER_CODE); + String startTime = (String) dataMap.get(MesExtConstWords.START_TIME); + String endTime = (String) dataMap.get(MesExtConstWords.END_TIME); - DdlPackBean packBean = DdlPackBean.getDdlPackBean(workCenterExtDb.getOrganizeCode()); - DdlPreparedPack.getStringEqualPack(workCenterExtDb.getWorkCenterCode(), MesExtConstWords.WORK_CENTER_CODE, packBean); + if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) return dataMap; + + DdlPackBean packBean = DdlPackBean.getDdlPackBean(orgainzeCode); + DdlPreparedPack.getStringEqualPack(workCenterCode, MesExtConstWords.WORK_CENTER_CODE, packBean); DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.WORK_ORDER_TYPE.STANDARD_ORDER.getValue(), MesExtConstWords.WORK_ORDER_TYPE, packBean); - DdlPreparedPack.timeBuilder( - TimeTool.timeCalc(TimeTool.stringParseToDate(workCenterExtDb.getWorkTime(), MesExtConstWords.DATE_FORMAT), Calendar.DATE, -1, MesExtConstWords.DATE_FORMAT) + MesExtConstWords.APPEND_ZERO_HMS, - workCenterExtDb.getWorkTime() + MesExtConstWords.APPEND_24_HMS, MesExtConstWords.START_TIME, true, true, packBean - ); + DdlPreparedPack.timeBuilder(startTime + MesExtConstWords.APPEND_ZERO_HMS, endTime + MesExtConstWords.APPEND_24_HMS, MesExtConstWords.START_TIME, true, true, packBean); List workOrderList = workOrderRepository.findByHqlWhere(packBean); workOrderList = CollectionUtils.isEmpty(workOrderList) ? null : workOrderList.stream().filter(o -> (null != o && MesExtEnumUtil.WORK_ORDER_STATUS.CREATE.getValue() != o.getWorkOrderStatus() && MesExtEnumUtil.WORK_ORDER_STATUS.REMOVE.getValue() != o.getWorkOrderStatus())).collect(Collectors.toList()); if (CollectionUtils.isEmpty(workOrderList)) return dataMap; diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyOutPutService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyOutPutService.java index cd1bc86..4906923 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyOutPutService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyOutPutService.java @@ -1,13 +1,13 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService; -import cn.estsh.i3plus.ext.mes.apiservice.dao.IPartExtDao; import cn.estsh.i3plus.ext.mes.pojo.bean.MesOutPutStatistics; -import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt; import cn.estsh.i3plus.ext.mes.pojo.repository.MesOutPutStatisticsRepository; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.impp.framework.boot.util.SpringContextsUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.util.CollectionUtils; @@ -28,35 +28,43 @@ public class JxCenterWorkingBoardProxyOutPutService implements IJxCenterWorkingB private MesOutPutStatisticsRepository outPutStatisticsRepository; - private IPartExtDao partExtDao; + public JxCenterWorkingBoardProxyOutPutService() { + this.outPutStatisticsRepository = (MesOutPutStatisticsRepository) SpringContextsUtil.getBean("mesOutPutStatisticsRepository"); + } public JxCenterWorkingBoardProxyOutPutService(IJxCenterWorkingBoardService proxyService) { this.proxyService = proxyService; this.outPutStatisticsRepository = (MesOutPutStatisticsRepository) SpringContextsUtil.getBean("mesOutPutStatisticsRepository"); - this.partExtDao = (IPartExtDao) SpringContextsUtil.getBean("partExtDao"); } @Override public Map queryCenterWorkingBoardData(Map dataMap) { - dataMap = proxyService.queryCenterWorkingBoardData(dataMap); + if (null != proxyService) dataMap = proxyService.queryCenterWorkingBoardData(dataMap); - MesWorkCenterExt workCenterExtDb = (MesWorkCenterExt) dataMap.get(MesWorkCenterExt.class.getSimpleName()); - if (StringUtils.isEmpty(workCenterExtDb.getWorkTime()) || StringUtils.isEmpty(workCenterExtDb.getShiftCode())) return dataMap; + String orgainzeCode = (String) dataMap.get(MesExtConstWords.ORGANIZE_CODE); + String workCenterCode = (String) dataMap.get(MesExtConstWords.WORK_CENTER_CODE); + String workTime = (String) dataMap.get(MesExtConstWords.WORK_TIME); + String startTime = (String) dataMap.get(MesExtConstWords.START_TIME); + String endTime = (String) dataMap.get(MesExtConstWords.END_TIME); - List outPutStatisticsList = outPutStatisticsRepository.findByProperty( + List outPutStatisticsList = null; + if (!StringUtils.isEmpty(workCenterCode) && !StringUtils.isEmpty(workTime)) + outPutStatisticsList = outPutStatisticsRepository.findByProperty( new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME, MesExtConstWords.WORK_ORDER_TYPE}, - new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getWorkTime(), MesExtEnumUtil.WORK_ORDER_TYPE.STANDARD_ORDER.getValue()}, + new Object[]{orgainzeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode, workTime, MesExtEnumUtil.WORK_ORDER_TYPE.STANDARD_ORDER.getValue()}, " order by modifyDatetime desc "); + else if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(orgainzeCode); + DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.WORK_ORDER_TYPE.STANDARD_ORDER.getValue(), MesExtConstWords.WORK_ORDER_TYPE, packBean); + DdlPreparedPack.timeBuilder(startTime, endTime, MesExtConstWords.WORK_TIME, true, true, packBean); + outPutStatisticsList = outPutStatisticsRepository.findByHqlWhere(packBean); + } if (CollectionUtils.isEmpty(outPutStatisticsList)) return dataMap; dataMap.put(MesOutPutStatistics.class.getSimpleName(), outPutStatisticsList); - Map partStandardWorkMap = partExtDao.queryPartExtStandardWorkMap(workCenterExtDb.getOrganizeCode()); - - dataMap.put(MesExtConstWords.STANDARD_WORK, partStandardWorkMap); - return dataMap; } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyRepairService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyRepairService.java new file mode 100644 index 0000000..f38d772 --- /dev/null +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyRepairService.java @@ -0,0 +1,62 @@ +package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; + +import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService; +import cn.estsh.i3plus.ext.mes.pojo.bean.MesRepairTask; +import cn.estsh.i3plus.ext.mes.pojo.repository.MesRepairTaskRepository; +import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.impp.framework.boot.util.SpringContextsUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.List; +import java.util.Map; + +/** + * @Author : wangjie + * @CreateDate : 2022-02-15 + * @Modify: + **/ +@Slf4j +public class JxCenterWorkingBoardProxyRepairService implements IJxCenterWorkingBoardService { + + private IJxCenterWorkingBoardService proxyService; + + private MesRepairTaskRepository repairTaskRepository; + + public JxCenterWorkingBoardProxyRepairService(IJxCenterWorkingBoardService proxyService) { + this.proxyService = proxyService; + this.repairTaskRepository = (MesRepairTaskRepository) SpringContextsUtil.getBean("mesRepairTaskRepository"); + } + + @Override + public Map queryCenterWorkingBoardData(Map dataMap) { + + String orgainzeCode = (String) dataMap.get(MesExtConstWords.ORGANIZE_CODE); + String workCenterCode = (String) dataMap.get(MesExtConstWords.WORK_CENTER_CODE); + String workTime = (String) dataMap.get(MesExtConstWords.WORK_TIME); + String startTime = (String) dataMap.get(MesExtConstWords.START_TIME); + String endTime = (String) dataMap.get(MesExtConstWords.END_TIME); + + List repairTaskDbList = null; + if (!StringUtils.isEmpty(workCenterCode) && !StringUtils.isEmpty(workTime)) + repairTaskDbList = repairTaskRepository.findByProperty( + new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME}, + new Object[]{orgainzeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode, workTime}); + else if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(orgainzeCode); + DdlPreparedPack.timeBuilder(startTime, endTime, MesExtConstWords.WORK_TIME, true, true, packBean); + repairTaskDbList = repairTaskRepository.findByHqlWhere(packBean); + } + + if (CollectionUtils.isEmpty(repairTaskDbList)) return dataMap; + + dataMap.put(MesRepairTask.class.getSimpleName(), repairTaskDbList); + + return dataMap; + } + +} diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxySpcrService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxySpcrService.java index cf371db..e0bab62 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxySpcrService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxySpcrService.java @@ -2,10 +2,11 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService; import cn.estsh.i3plus.ext.mes.pojo.bean.MesShiftProdCenterRecord; -import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt; import cn.estsh.i3plus.ext.mes.pojo.repository.MesShiftProdCenterRecordRepository; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.impp.framework.boot.util.SpringContextsUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.util.CollectionUtils; @@ -22,26 +23,33 @@ import java.util.Map; @Slf4j public class JxCenterWorkingBoardProxySpcrService implements IJxCenterWorkingBoardService { - private IJxCenterWorkingBoardService proxyService; - private MesShiftProdCenterRecordRepository shiftProdCenterRecordRepository; - public JxCenterWorkingBoardProxySpcrService(IJxCenterWorkingBoardService proxyService) { - this.proxyService = proxyService; + public JxCenterWorkingBoardProxySpcrService() { this.shiftProdCenterRecordRepository = (MesShiftProdCenterRecordRepository) SpringContextsUtil.getBean("mesShiftProdCenterRecordRepository"); } @Override public Map queryCenterWorkingBoardData(Map dataMap) { - dataMap = proxyService.queryCenterWorkingBoardData(dataMap); - - MesWorkCenterExt workCenterExtDb = (MesWorkCenterExt) dataMap.get(MesWorkCenterExt.class.getSimpleName()); - if (StringUtils.isEmpty(workCenterExtDb.getWorkTime()) || StringUtils.isEmpty(workCenterExtDb.getShiftCode())) return dataMap; + String orgainzeCode = (String) dataMap.get(MesExtConstWords.ORGANIZE_CODE); + String workCenterCode = (String) dataMap.get(MesExtConstWords.WORK_CENTER_CODE); + String workTime = (String) dataMap.get(MesExtConstWords.WORK_TIME); + String shiftCode = (String) dataMap.get(MesExtConstWords.SHIFT_CODE); + String startTime = (String) dataMap.get(MesExtConstWords.START_TIME); + String endTime = (String) dataMap.get(MesExtConstWords.END_TIME); - List shiftProdCenterRecordList = shiftProdCenterRecordRepository.findByProperty( + List shiftProdCenterRecordList = null; + if (!StringUtils.isEmpty(workCenterCode) && !StringUtils.isEmpty(workTime) && !StringUtils.isEmpty(shiftCode)) + shiftProdCenterRecordList = shiftProdCenterRecordRepository.findByProperty( new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME, MesExtConstWords.SHIFT_CODE}, - new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getWorkTime(), workCenterExtDb.getShiftCode()}); + new Object[]{orgainzeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode, workTime, shiftCode}); + else if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(orgainzeCode); + DdlPreparedPack.timeBuilder(startTime, endTime, MesExtConstWords.WORK_TIME, true, true, packBean); + shiftProdCenterRecordList = shiftProdCenterRecordRepository.findByHqlWhere(packBean); + } + if (CollectionUtils.isEmpty(shiftProdCenterRecordList)) return dataMap; dataMap.put(MesShiftProdCenterRecord.class.getSimpleName(), shiftProdCenterRecordList); diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyWorkingStatusService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyWorkingStatusService.java new file mode 100644 index 0000000..b38f0a7 --- /dev/null +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardProxyWorkingStatusService.java @@ -0,0 +1,95 @@ +package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx; + +import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService; +import cn.estsh.i3plus.ext.mes.pojo.bean.MesShiftProdCenterRecord; +import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; +import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +/** + * @Author : wangjie + * @CreateDate : 2022-02-15 + * @Modify: + **/ +@Slf4j +public class JxCenterWorkingBoardProxyWorkingStatusService implements IJxCenterWorkingBoardService { + + private IJxCenterWorkingBoardService proxyService; + + public JxCenterWorkingBoardProxyWorkingStatusService() {} + + public JxCenterWorkingBoardProxyWorkingStatusService(IJxCenterWorkingBoardService proxyService) { + this.proxyService = proxyService; + } + + @Override + public Map queryCenterWorkingBoardData(Map dataMap) { + + if (null != proxyService) proxyService.queryCenterWorkingBoardData(dataMap); + + String workCenterCode = (String) dataMap.get(MesExtConstWords.WORK_CENTER_CODE); + String workTime = (String) dataMap.get(MesExtConstWords.WORK_TIME); + String shiftCode = (String) dataMap.get(MesExtConstWords.SHIFT_CODE); + String curTime = (String) dataMap.get("curTime"); + List shiftProdCenterRecordList = (List) dataMap.get(MesShiftProdCenterRecord.class.getSimpleName()); + + List filterList = (CollectionUtils.isEmpty(shiftProdCenterRecordList) || StringUtils.isEmpty(workTime) || StringUtils.isEmpty(shiftCode)) ? null : + shiftProdCenterRecordList.stream().filter(o -> (null != o && o.getWorkCenterCode().equals(workCenterCode) && o.getWorkTime().equals(workTime) && o.getShiftCode().equals(shiftCode) && + MesExtEnumUtil.SHIFT_PROD_TYPE.UNNORMAL_PROD.getValue() >= o.getProdType() && o.getStartTime().compareTo(curTime) <= 0 && o.getEndTime().compareTo(curTime) >= 0)).collect(Collectors.toList()); + MesShiftProdCenterRecord filterData = CollectionUtils.isEmpty(filterList) ? null : + filterList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesShiftProdCenterRecord::getModifyDatetime).reversed()).collect(Collectors.toList()).get(0); + + SHIFT_PROD_TYPE_COLOR enumItem; + if (null == filterData) enumItem = SHIFT_PROD_TYPE_COLOR.NO_WORKING; + else enumItem = SHIFT_PROD_TYPE_COLOR.getByValue(filterData.getProdType()); + + dataMap.put("生产状态", new StringJoiner(MesExtConstWords.COMMA).add(enumItem.workingStatusName).add(enumItem.color).toString()); + + return dataMap; + } + + enum SHIFT_PROD_TYPE_COLOR { + //System.out.println(String.format("#%02x%02x%02x", Color.white.getRed(), Color.white.getGreen(), Color.white.getBlue())); + NO_WORKING(0, "无生产", "无生产", "#808080", "gray"), + NORMAL_STOP_CENTER(10, "常规停机", "常规停机", "#808080", "gray"), + UNNORMAL_STOP_CENTER(20, "非常规停机", "异常停机", "#ff0000", "red"), + NORMAL_PROD(30, "常规生产", "正常生产", "#00ff00", "green"), + UNNORMAL_PROD(40, "非常规生产", "加班生产", "#ff0000", "red"); + + private int value; + private String description; + private String workingStatusName; + private String color; + private String colorName; + + SHIFT_PROD_TYPE_COLOR(int value, String description, String workingStatusName, String color, String colorName) { + this.value = value; + this.description = description; + this.workingStatusName = workingStatusName; + this.color = color; + this.colorName = colorName; + } + + public int getValue() { + return value; + } + + public static SHIFT_PROD_TYPE_COLOR getByValue(int value) { + for (SHIFT_PROD_TYPE_COLOR matchType : values()) { + if (matchType.getValue() == value) { + return matchType; + } + } + return null; + } + } + +} diff --git a/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtConstWords.java b/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtConstWords.java index fc79d18..6af7b5d 100644 --- a/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtConstWords.java +++ b/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtConstWords.java @@ -747,6 +747,8 @@ public class MesExtConstWords { public static final String VALIDITY_DATE = "validityDate"; //事业别配置 + public static final String SX_CATEGORY_CFG = "SX_CATEGORY_CFG"; + //事业别配置 public static final String SX_CAREER_CFG = "SX_CAREER_CFG"; //仕损明细记录类型明细配置 @@ -895,4 +897,6 @@ public class MesExtConstWords { //总不良率 public static final String AMOUNT_BAD_RATE = "amountBadRate"; + public static final String BOARD_WORK_SHOW_FLAG = "BOARD_WORK_SHOW_FLAG"; + } diff --git a/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtEnumUtil.java b/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtEnumUtil.java index d62f113..0796477 100644 --- a/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtEnumUtil.java +++ b/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtEnumUtil.java @@ -2292,6 +2292,10 @@ public class MesExtEnumUtil { return value; } + public String getValueStr() { + return value + ""; + } + public String getDescription() { return description; }