From 84c3d427f22a39fac9431fcda91a2df6a3635e76 Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 26 Feb 2025 11:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=BE=99=E5=85=B4=E5=8F=91?= =?UTF-8?q?=E8=BF=90=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pcn/api/busi/IMesShippingKanbanCfgService.java | 6 +-- .../busi/MesShippingKanbanCfgController.java | 2 +- .../busi/MesShippingKanbanCfgServiceImpl.java | 46 ++++++++++++++++------ .../mes/pcn/pojo/model/MesShippingKanbanModel.java | 16 ++++++++ 4 files changed, 53 insertions(+), 17 deletions(-) create mode 100644 modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesShippingKanbanModel.java diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesShippingKanbanCfgService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesShippingKanbanCfgService.java index aeaac04..4864b29 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesShippingKanbanCfgService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesShippingKanbanCfgService.java @@ -1,12 +1,10 @@ package cn.estsh.i3plus.ext.mes.pcn.api.busi; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanCfgModel; -import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanViewModel; - -import java.util.List; +import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanModel; public interface IMesShippingKanbanCfgService { MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode); void doSaveShippingKanbanCfg(MesShippingKanbanCfgModel request, String organizeCode, String username); - List queryShippingKanbanContext(String organizeCode); + MesShippingKanbanModel queryShippingKanbanContext(String organizeCode); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShippingKanbanCfgController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShippingKanbanCfgController.java index c0b508f..c687281 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShippingKanbanCfgController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesShippingKanbanCfgController.java @@ -56,7 +56,7 @@ public class MesShippingKanbanCfgController { public ResultBean queryShippingKanbanContext(String organizeCode) { try { organizeCode = !StringUtils.isEmpty(organizeCode) ? organizeCode : AuthUtil.getOrganize().getOrganizeCode(); - return ResultBean.success("查询成功").setResultList(shippingKanbanCfgService.queryShippingKanbanContext(organizeCode)); + return ResultBean.success("查询成功").setResultObject(shippingKanbanCfgService.queryShippingKanbanContext(organizeCode)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); } catch (Exception e) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingKanbanCfgServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingKanbanCfgServiceImpl.java index c4780ac..9cbd260 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingKanbanCfgServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingKanbanCfgServiceImpl.java @@ -2,6 +2,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesShippingKanbanCfgService; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanCfgModel; +import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanModel; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanViewModel; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.i3plus.mes.pcn.util.DateUtil; @@ -129,14 +130,35 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer } @Override - public List queryShippingKanbanContext(String organizeCode) { - List viewModels = new ArrayList<>(); + public MesShippingKanbanModel queryShippingKanbanContext(String organizeCode) { + MesShippingKanbanModel model = new MesShippingKanbanModel(); + Map cfgDetailMap = null; MesShippingKanbanCfgModel cfgModel = queryShippingKanbanCfg(organizeCode); MesShippingKanbanCfg cfg = cfgModel != null ? cfgModel.getConfig() : null; if (cfg == null) { - return viewModels; + return model; + } + StringBuilder kabanTitle = new StringBuilder(); + if (!StringUtils.isEmpty(cfg.getShippingGroupCode())) { + for (String groupCode : cfg.getShippingGroupCode().split(",")) { + DdlPackBean groupPackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(groupCode, "shippingGroupCode", groupPackBean); + MesPartShippingGroup shippingGroup = partShippingGroupRDao.getByProperty(groupPackBean); + if (shippingGroup != null) { + if (kabanTitle.length() > 0) { + kabanTitle.append(" "); + } + kabanTitle.append(shippingGroup.getShippingGroupName()); + } + } + } + if (kabanTitle.length() > 0) { + kabanTitle.append("|"); } + kabanTitle.append("发运看板"); + model.setKanbanTitle(kabanTitle.toString()); + if (!CollectionUtils.isEmpty(cfgModel.getDetails())) { cfgDetailMap = cfgModel.getDetails().stream().collect(Collectors.toMap(MesShippingKanbanCfgDetail::getDetailCode, v -> v)); } @@ -147,9 +169,9 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer continue; } - MesShippingKanbanViewModel model = new MesShippingKanbanViewModel(); - model.setDetailName(index.getDescription()); - model.setOrderNumber(cfgDetail.getOrderNumber()); + MesShippingKanbanViewModel viewModel = new MesShippingKanbanViewModel(); + viewModel.setDetailName(index.getDescription()); + viewModel.setOrderNumber(cfgDetail.getOrderNumber()); String rangDescription = ""; if (!StringUtils.isEmpty(cfgDetail.getRangValueLess())) { rangDescription += "<" + cfgDetail.getRangValueLess(); @@ -160,7 +182,7 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer } rangDescription += ">=" + cfgDetail.getRangValueMore(); } - model.setRangDescription(rangDescription); + viewModel.setRangDescription(rangDescription); List values = null; switch (index) { case CLIENT_STOCK_QTY: @@ -212,12 +234,12 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer if (values == null) { values = new ArrayList<>(); } - model.setValues(values); - model.setColor(getColor(cfgDetail, values)); - viewModels.add(model); + viewModel.setValues(values); + viewModel.setColor(getColor(cfgDetail, values)); + model.getDetails().add(viewModel); } - viewModels.sort(Comparator.comparing(MesShippingKanbanViewModel::getOrderNumber)); - return viewModels; + model.getDetails().sort(Comparator.comparing(MesShippingKanbanViewModel::getOrderNumber)); + return model; } private String getColor(MesShippingKanbanCfgDetail cfgDetail, List values) { diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesShippingKanbanModel.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesShippingKanbanModel.java new file mode 100644 index 0000000..0dc2e22 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesShippingKanbanModel.java @@ -0,0 +1,16 @@ +package cn.estsh.i3plus.ext.mes.pcn.pojo.model; + +import io.swagger.annotations.ApiParam; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class MesShippingKanbanModel { + @ApiParam("看板标题") + private String kanbanTitle; + + @ApiParam("指标明细") + private List details = new ArrayList<>(); +}