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 4864b29..61687bb 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 @@ -4,7 +4,7 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanCfgModel; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanModel; public interface IMesShippingKanbanCfgService { - MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode); + MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode, String shippingGroupCode); void doSaveShippingKanbanCfg(MesShippingKanbanCfgModel request, String organizeCode, String username); - MesShippingKanbanModel queryShippingKanbanContext(String organizeCode); + MesShippingKanbanModel queryShippingKanbanContext(String organizeCode, String shippingGroupCode); } 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 c687281..c367bc8 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 @@ -26,10 +26,10 @@ public class MesShippingKanbanCfgController { @GetMapping("/query") @ApiOperation(value = "查询发运看板配置项") - public ResultBean queryShippingKanbanCfg(String organizeCode) { + public ResultBean queryShippingKanbanCfg(String organizeCode, String shippingGroupCode) { try { organizeCode = !StringUtils.isEmpty(organizeCode) ? organizeCode : AuthUtil.getOrganize().getOrganizeCode(); - return ResultBean.success("查询成功").setResultObject(shippingKanbanCfgService.queryShippingKanbanCfg(organizeCode)); + return ResultBean.success("查询成功").setResultObject(shippingKanbanCfgService.queryShippingKanbanCfg(organizeCode, shippingGroupCode)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); } catch (Exception e) { @@ -53,10 +53,10 @@ public class MesShippingKanbanCfgController { @GetMapping("/queryContext") @ApiOperation(value = "查询发运看板内容") - public ResultBean queryShippingKanbanContext(String organizeCode) { + public ResultBean queryShippingKanbanContext(String organizeCode, String shippingGroupCode) { try { organizeCode = !StringUtils.isEmpty(organizeCode) ? organizeCode : AuthUtil.getOrganize().getOrganizeCode(); - return ResultBean.success("查询成功").setResultObject(shippingKanbanCfgService.queryShippingKanbanContext(organizeCode)); + return ResultBean.success("查询成功").setResultObject(shippingKanbanCfgService.queryShippingKanbanContext(organizeCode, shippingGroupCode)); } 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 c189975..7e699dc 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 @@ -54,17 +54,19 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer private EntityManager entityManager; @Override - public MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode) { + public MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode, String shippingGroupCode) { MesShippingKanbanCfgModel model = new MesShippingKanbanCfgModel(); DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(shippingGroupCode, "shippingGroupCode", packBean); MesShippingKanbanCfg kanbanCfg = shippingKanbanCfgRDao.getByProperty(packBean); if (kanbanCfg != null) { DdlPackBean detailPackBean = DdlPackBean.getDdlPackBean(organizeCode); - DdlPreparedPack.getNumEqualPack(kanbanCfg.getId(), "configID", packBean); + DdlPreparedPack.getNumEqualPack(kanbanCfg.getId(), "configID", detailPackBean); List details = shippingKanbanCfgDetailRDao.findByHqlWhere(detailPackBean); model.setDetails(details); } else { kanbanCfg = new MesShippingKanbanCfg(); + kanbanCfg.setShippingGroupCode(shippingGroupCode); } model.setConfig(kanbanCfg); @@ -95,13 +97,13 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer MesShippingKanbanCfg cfg = request.getConfig(); DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(cfg.getShippingGroupCode(), "shippingGroupCode", packBean); MesShippingKanbanCfg oldCfg = shippingKanbanCfgRDao.getByProperty(packBean); if (oldCfg == null) { cfg.setOrganizeCode(organizeCode); ConvertBean.serviceModelInitialize(cfg, username); oldCfg = shippingKanbanCfgRDao.insert(cfg); } else { - oldCfg.setShippingGroupCode(cfg.getShippingGroupCode()); oldCfg.setRefreshFrequency(cfg.getRefreshFrequency()); oldCfg.setKanbanName(cfg.getKanbanName()); oldCfg.setOnlinePoint(cfg.getOnlinePoint()); @@ -130,11 +132,11 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer } @Override - public MesShippingKanbanModel queryShippingKanbanContext(String organizeCode) { + public MesShippingKanbanModel queryShippingKanbanContext(String organizeCode, String shippingGroupCode) { MesShippingKanbanModel model = new MesShippingKanbanModel(); Map cfgDetailMap = null; - MesShippingKanbanCfgModel cfgModel = queryShippingKanbanCfg(organizeCode); + MesShippingKanbanCfgModel cfgModel = queryShippingKanbanCfg(organizeCode, shippingGroupCode); MesShippingKanbanCfg cfg = cfgModel != null ? cfgModel.getConfig() : null; if (cfg == null) { return model; @@ -1086,10 +1088,17 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer .getSingleResult(); if (vpCount == null || Objects.equals(vpCount, 0L)) { - values.add(cfg.getCustJph()); + if (!StringUtils.isEmpty(cfg.getCustJph())) { + values.add(cfg.getCustJph()); + } + } else { values.add(vpCount.toString()); } + + if (values.isEmpty()) { + values.add("1"); + } return values; }