From 46c4bdded3d5bdf953e271271ec48a75f272d1d2 Mon Sep 17 00:00:00 2001 From: gsz Date: Tue, 10 Sep 2024 13:58:22 +0800 Subject: [PATCH] =?UTF-8?q?42966=20=E8=AE=BE=E5=A4=87=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8A=A5=E8=A1=A8-=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=90=8D=E7=A7=B0=E3=80=81=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=8F=98=E9=87=8FID=E5=8F=AF=E4=BB=A5=E5=A4=9A=E9=80=89?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=8C=E8=BE=93=E5=85=A5=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E7=94=A8=E9=80=97=E5=8F=B7=E9=9A=94=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/api/base/IMesPartInspectionService.java | 3 ++ .../base/MesPartInspectionController.java | 23 +++++++++++ .../serviceimpl/base/MesPartInspectionService.java | 46 +++++++++++++++++++++- .../report/MesEquipmentLogDetailService.java | 10 ++++- 4 files changed, 79 insertions(+), 3 deletions(-) diff --git a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesPartInspectionService.java b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesPartInspectionService.java index b16b48c..d197332 100644 --- a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesPartInspectionService.java +++ b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesPartInspectionService.java @@ -1,5 +1,7 @@ package cn.estsh.i3plus.ext.mes.api.base; +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection; /** @@ -10,4 +12,5 @@ import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection; public interface IMesPartInspectionService extends IBaseMesService { + ListPager queryMesPartInspectionParamByPager(MesPartInspection mesPartInspection, Pager pager); } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesPartInspectionController.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesPartInspectionController.java index 1834a31..aa6b659 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesPartInspectionController.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesPartInspectionController.java @@ -1,8 +1,16 @@ package cn.estsh.i3plus.ext.mes.apiservice.controller.base; +import cn.estsh.i3plus.ext.mes.api.base.IMesPartInspectionService; import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant; +import cn.estsh.i3plus.pojo.base.common.Pager; import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection; +import cn.estsh.impp.framework.boot.exception.ImppBusiException; +import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; +import cn.estsh.impp.framework.boot.util.ResultBean; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -14,4 +22,19 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping(MesCommonConstant.MES_YANFEN + "/mesPartInspection") public class MesPartInspectionController extends BaseMesController { + @Autowired + private IMesPartInspectionService mesPartInspectionService; + + @GetMapping("/query-param") + @ApiOperation(value = "查询零件检测") + public ResultBean queryMesPartInspectionParamByPager(MesPartInspection mesPartInspection, Pager pager) { + + try { + return ResultBean.success("查询成功").setListPager(mesPartInspectionService.queryMesPartInspectionParamByPager(mesPartInspection, pager)); + } catch (ImppBusiException imppException) { + return ResultBean.fail(imppException); + } catch (Exception e) { + return ImppExceptionBuilder.newInstance().buildExceptionResult(e); + } + } } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesPartInspectionService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesPartInspectionService.java index 68e037b..b7c1eb0 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesPartInspectionService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesPartInspectionService.java @@ -1,17 +1,29 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base; import cn.estsh.i3plus.ext.mes.api.base.IMesPartInspectionService; +import cn.estsh.i3plus.platform.common.util.MesConstWords; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.bean.ListPager; +import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.base.common.PagerHelper; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter; import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection; +import cn.estsh.i3plus.pojo.mes.repository.MesWorkCenterRepository; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.util.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service @Slf4j public class MesPartInspectionService extends BaseMesService implements IMesPartInspectionService { - + @Autowired + private MesWorkCenterRepository mesWorkCenterRDao; @Override protected void setPackQueryBean(MesPartInspection bean, DdlPackBean packBean) { DdlPreparedPack.getStringEqualPack(bean.getSn(), "sn", packBean); @@ -28,4 +40,36 @@ public class MesPartInspectionService extends BaseMesService // DdlPreparedPack.getStringLikerPack(bean.getInspectionDate(), "inspectionDate", packBean); } + @Override + public ListPager queryMesPartInspectionParamByPager(MesPartInspection bean, Pager pager) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(bean.getSn(), "sn", packBean); + DdlPreparedPack.getStringLikerPack(bean.getPartNo(), "partNo", packBean); + DdlPreparedPack.getStringLikerPack(bean.getPartName(), "partName", packBean); + DdlPreparedPack.getStringLikerPack(bean.getWorkCenterCode(), "workCenterCode", packBean); + DdlPreparedPack.getNumEqualPack(bean.getNcStatus(), "ncStatus", packBean); + if (StringUtils.isNotBlank(bean.getCreateDateTimeStart()) && StringUtils.isNotBlank(bean.getCreateDateTimeEnd())) { + DdlPreparedPack.timeBuilder(bean.getCreateDateTimeStart(), bean.getCreateDateTimeEnd(), "createDatetime", packBean, true); + } + if (StringUtils.isNotBlank(bean.getModifyDateTimeStart()) && StringUtils.isNotBlank(bean.getModifyDateTimeEnd())) { + DdlPreparedPack.timeBuilder(bean.getModifyDateTimeStart(), bean.getModifyDateTimeEnd(), "modifyDatetime", packBean, true); + } + pager = PagerHelper.getPager(pager, baseRDao.findByHqlWhereCount(packBean)); + + List resultList = baseRDao.findByHqlWherePage(packBean, pager); + if (!CollectionUtils.isEmpty(resultList)){ + for (MesPartInspection mesPartInspection : resultList) { + if (!StringUtils.isEmpty(mesPartInspection.getWorkCenterCode())){ + MesWorkCenter mesWorkCenter = mesWorkCenterRDao.getByProperty( + new String[]{MesConstWords.ORGANIZE_CODE, MesConstWords.IS_DELETED, MesConstWords.IS_VALID, "workCenterCode"}, + new Object[]{bean.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), + CommonEnumUtil.IS_VAILD.VAILD.getValue(), mesPartInspection.getWorkCenterCode()}); + if (null != mesWorkCenter) { + mesPartInspection.setWorkCenterName(mesWorkCenter.getWorkCenterName()); + } + } + } + } + return new ListPager<>(resultList, pager); + } } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/report/MesEquipmentLogDetailService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/report/MesEquipmentLogDetailService.java index 21c9e0a..750a8b2 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/report/MesEquipmentLogDetailService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/report/MesEquipmentLogDetailService.java @@ -30,9 +30,15 @@ public class MesEquipmentLogDetailService extends BaseMesService 1) { + DdlPreparedPack.getInPackList(Arrays.asList(bean.getEquipVariableName().split(",")), MesExtConstWords.EQUIP_VARIABLE_NAME, packBean); + } else { + DdlPreparedPack.getStringLikerPack(bean.getEquipVariableName(), MesExtConstWords.EQUIP_VARIABLE_NAME, packBean); + } DdlPreparedPack.timeBuilder(bean.getCreateDateTimeStart(), bean.getCreateDateTimeEnd(), MesExtConstWords.CREATE_DATE_TIME, packBean, true); DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{MesExtConstWords.CREATE_DATE_TIME}, packBean); }