From 0250db7d47f95bd27df438a1b40262bb6b252bab Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Fri, 22 Nov 2024 15:23:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E5=8F=91=E8=BF=90=E7=BB=84--?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=B7=A5=E5=8E=82=E4=B8=8E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=82=B9=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/base/IMesCustomerMessagePointService.java | 9 +++++++++ .../base/MesCustomerMessagePointController.java | 22 ++++++++++++++++++++++ .../base/MesCustomerMessagePointService.java | 9 ++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesCustomerMessagePointService.java b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesCustomerMessagePointService.java index a9c6520..a4a22e8 100644 --- a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesCustomerMessagePointService.java +++ b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesCustomerMessagePointService.java @@ -2,6 +2,8 @@ package cn.estsh.i3plus.ext.mes.api.base; import cn.estsh.i3plus.pojo.mes.bean.MesCustomerMessagePoint; +import java.util.List; + /** * @Description: * @CreateDate 2024/04/16 @@ -10,4 +12,11 @@ import cn.estsh.i3plus.pojo.mes.bean.MesCustomerMessagePoint; public interface IMesCustomerMessagePointService extends IBaseMesService { MesCustomerMessagePoint getPointByCode(String pointCode,String organizeCode); + + /** + * 根据客户工厂代码查找对应的 + * @param custOrganizeCode + * @return + */ + List getByCustOrganizeCode(String custOrganizeCode); } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesCustomerMessagePointController.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesCustomerMessagePointController.java index 949ee55..e20ef18 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesCustomerMessagePointController.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesCustomerMessagePointController.java @@ -1,15 +1,37 @@ package cn.estsh.i3plus.ext.mes.apiservice.controller.base; +import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.MesCustomerMessagePointService; import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant; import cn.estsh.i3plus.pojo.mes.bean.MesCustomerMessagePoint; import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter; +import cn.estsh.impp.framework.boot.util.ResultBean; +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.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 客户信息点 */ @RestController @RequestMapping(MesCommonConstant.MES_YANFEN + "/mesCustomerMessagePoint") public class MesCustomerMessagePointController extends BaseMesController{ + + @Autowired + private MesCustomerMessagePointService mesCustomerMessagePointService; + //根据客户工厂查找对应的信息点信息 + @GetMapping("/list/{custOrganizeCode}") + @ApiOperation(value = "查询当前客户工厂的信息点", notes = "查询当前客户工厂的信息点") + public ResultBean list(@PathVariable("custOrganizeCode") String custOrganizeCode){ + try { + List messagePoints = mesCustomerMessagePointService.getByCustOrganizeCode(custOrganizeCode); + return ResultBean.success("查询成功").setResultList(messagePoints); + } catch (Exception e) { + return ResultBean.fail("查询失败").setErrorMsg(e.getMessage()); + } + } } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCustomerMessagePointService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCustomerMessagePointService.java index 59d81f7..9025a2a 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCustomerMessagePointService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCustomerMessagePointService.java @@ -6,12 +6,12 @@ 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.MesCustomerMessagePoint; +import cn.estsh.impp.framework.boot.auth.AuthUtil; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.util.ValidatorBean; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.List; @Service @@ -65,4 +65,11 @@ public class MesCustomerMessagePointService extends BaseMesService messagePoints = baseRDao.findByHqlWhere(ddlPackBean); return messagePoints.isEmpty() ? null: messagePoints.get(0); } + + @Override + public List getByCustOrganizeCode(String custOrganizeCode) { + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(AuthUtil.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(custOrganizeCode, "custOrganizeCode", ddlPackBean); + return baseRDao.findByHqlWhere(ddlPackBean); + } }