From 1d7f7530643b55cc63a4069baeeb294c03234eae Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Thu, 12 Dec 2024 12:08:13 +0800 Subject: [PATCH] =?UTF-8?q?44252=20=E4=BA=A7=E7=BA=BF=E5=B1=8F=E6=94=BE?= =?UTF-8?q?=E5=9C=A8=E8=BE=B9=E7=AB=AF=EF=BC=8C=E6=97=A0=E9=9C=80=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/base/BaseExtDataController.java | 7 ++++--- .../board/MesWorkCenterBoardController.java | 22 ++++++++-------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/BaseExtDataController.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/BaseExtDataController.java index c9d1c32..d39802f 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/BaseExtDataController.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/BaseExtDataController.java @@ -10,7 +10,6 @@ import cn.estsh.i3plus.platform.common.tool.ExcelTool; import cn.estsh.i3plus.pojo.base.bean.ListPager; import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; -import cn.estsh.i3plus.pojo.mes.bean.MesProductionRecord; import cn.estsh.i3plus.pojo.mes.model.MesProductionRecordModel; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import cn.estsh.i3plus.pojo.model.common.ExportDataModel; @@ -26,6 +25,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import javax.persistence.EntityManager; @@ -63,9 +63,10 @@ public class BaseExtDataController extends MesBaseController { @GetMapping(value = "/enumlist") @ApiOperation(value = "获取MES系统所有枚举") - public ResultBean enumlist(@RequestParam(name = "enumName") String enumName) { + public ResultBean enumlistByOrg(@RequestParam(name = "enumName") String enumName, @RequestParam(name = "organizeCode", required = false) String organizeCode) { try { - Map map = enumService.doGetMesEnumByEnumName(AuthUtil.getOrganize().getOrganizeCode(), enumName); + organizeCode = StringUtils.isEmpty(organizeCode) ? AuthUtil.getOrganize().getOrganizeCode() : organizeCode; + Map map = enumService.doGetMesEnumByEnumName(organizeCode, enumName); return ResultBean.success("查询成功") .setResultObject(map) .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/board/MesWorkCenterBoardController.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/board/MesWorkCenterBoardController.java index a84dbd9..6195acd 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/board/MesWorkCenterBoardController.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/board/MesWorkCenterBoardController.java @@ -12,6 +12,7 @@ import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -39,8 +40,7 @@ public class MesWorkCenterBoardController { ValidatorBean.beginValid(conditionModel) .notNull("workCenterCodeList", conditionModel.getWorkCenterCodeList()) .notNull("timeRangeIdentification", conditionModel.getTimeRangeIdentification()); - String organizeCode = AuthUtil.getOrganize().getOrganizeCode(); - conditionModel.setOrganizeCode(organizeCode); + if (StringUtils.isEmpty(conditionModel.getOrganizeCode())) conditionModel.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode()); return ResultBean.success("查询产线状态").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()). setResultList(mesYfBoardService.queryWorkCenterStatus(conditionModel)); } catch (ImppBusiException e) { @@ -57,8 +57,7 @@ public class MesWorkCenterBoardController { ValidatorBean.beginValid(conditionModel) .notNull("workCenterCodeList", conditionModel.getWorkCenterCodeList()) .notNull("timeRangeIdentification", conditionModel.getTimeRangeIdentification()); - String organizeCode = AuthUtil.getOrganize().getOrganizeCode(); - conditionModel.setOrganizeCode(organizeCode); + if (StringUtils.isEmpty(conditionModel.getOrganizeCode())) conditionModel.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode()); return ResultBean.success("查询产线生产完成率").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()). setResultObject(mesYfBoardService.queryWorkCenterProductionCompletionRate(conditionModel)); } catch (ImppBusiException e) { @@ -75,8 +74,7 @@ public class MesWorkCenterBoardController { ValidatorBean.beginValid(conditionModel) .notNull("workCenterCodeList", conditionModel.getWorkCenterCodeList()) .notNull("timeRangeIdentification", conditionModel.getTimeRangeIdentification()); - String organizeCode = AuthUtil.getOrganize().getOrganizeCode(); - conditionModel.setOrganizeCode(organizeCode); + if (StringUtils.isEmpty(conditionModel.getOrganizeCode())) conditionModel.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode()); return ResultBean.success("查询产线工单完成情况").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()). setResultList(mesYfBoardService.queryWorkCenterWorkOrderCompletionStatus(conditionModel)); } catch (ImppBusiException e) { @@ -93,8 +91,7 @@ public class MesWorkCenterBoardController { ValidatorBean.beginValid(conditionModel) .notNull("workCenterCodeList", conditionModel.getWorkCenterCodeList()) .notNull("timeRangeIdentification", conditionModel.getTimeRangeIdentification()); - String organizeCode = AuthUtil.getOrganize().getOrganizeCode(); - conditionModel.setOrganizeCode(organizeCode); + if (StringUtils.isEmpty(conditionModel.getOrganizeCode())) conditionModel.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode()); return ResultBean.success("查询单位小时完工数").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()). setResultList(mesYfBoardService.queryUnitHourCompletionRate(conditionModel)); } catch (ImppBusiException e) { @@ -111,8 +108,7 @@ public class MesWorkCenterBoardController { ValidatorBean.beginValid(conditionModel) .notNull("workCenterCodeList", conditionModel.getWorkCenterCodeList()) .notNull("timeRangeIdentification", conditionModel.getTimeRangeIdentification()); - String organizeCode = AuthUtil.getOrganize().getOrganizeCode(); - conditionModel.setOrganizeCode(organizeCode); + if (StringUtils.isEmpty(conditionModel.getOrganizeCode())) conditionModel.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode()); return ResultBean.success("查询产线一次下线合格率").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()). setResultList(mesYfBoardService.queryWorkCenterFirstTimeOfflineQualificationRate(conditionModel)); } catch (ImppBusiException e) { @@ -129,8 +125,7 @@ public class MesWorkCenterBoardController { ValidatorBean.beginValid(conditionModel) .notNull("workCenterCodeList", conditionModel.getWorkCenterCodeList()) .notNull("timeRangeIdentification", conditionModel.getTimeRangeIdentification()); - String organizeCode = AuthUtil.getOrganize().getOrganizeCode(); - conditionModel.setOrganizeCode(organizeCode); + if (StringUtils.isEmpty(conditionModel.getOrganizeCode())) conditionModel.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode()); return ResultBean.success("查询点检结果").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()). setResultList(mesYfBoardService.queryInspectionResults(conditionModel)); } catch (ImppBusiException e) { @@ -147,8 +142,7 @@ public class MesWorkCenterBoardController { ValidatorBean.beginValid(conditionModel) .notNull("workCenterCodeList", conditionModel.getWorkCenterCodeList()) .notNull("timeRangeIdentification", conditionModel.getTimeRangeIdentification()); - String organizeCode = AuthUtil.getOrganize().getOrganizeCode(); - conditionModel.setOrganizeCode(organizeCode); + if (StringUtils.isEmpty(conditionModel.getOrganizeCode())) conditionModel.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode()); return ResultBean.success("查询异常停线时间").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()). setResultObject(mesYfBoardService.queryAbnormalDowntime(conditionModel)); } catch (ImppBusiException e) {