From 7f5ecaf7dbd07e218fbda575e45d8264a560a1e6 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期一, 05 六月 2023 13:50:59 +0800 Subject: [PATCH] 出入库优化-称重页面逻辑优化完成 --- igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java | 67 ++++++++++++++++++--------------- 1 files changed, 37 insertions(+), 30 deletions(-) diff --git a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java index dc26b86..3bba0c7 100644 --- a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java +++ b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java @@ -1,5 +1,6 @@ package com.ld.igds.inout.manager; +import com.ld.igds.constant.Constant; import com.ld.igds.inout.InoutConstant; import com.ld.igds.inout.dto.InoutData; import com.ld.igds.inout.service.InoutService; @@ -76,7 +77,7 @@ * @return 杞︾墝璁惧閰嶇疆锛屾病鏈夊垯杩斿洖NULL */ public InoutConf getInoutConf(List<InoutConf> listInoutConf, String sort, String type, String inoutProgress, int inOrder) { - if (null == listInoutConf) return null; + if (null == listInoutConf) return new InoutConf(sort); if (StringUtils.isEmpty(sort)) sort = "1"; InoutConf result = null; @@ -89,7 +90,34 @@ } } - if (null == result) return null; + if (null == result) return new InoutConf(sort); + + return result; + } + + public List<InoutConf> getInoutConf(List<InoutConf> listInoutConf, String type) { + List<InoutConf> result = new ArrayList<>(); + if (null == listInoutConf) return result; + for (InoutConf conf : listInoutConf) { + if (type.equals(conf.getType())) { + result.add(conf); + } + } + return result; + } + + public InoutConf getInoutConf(List<InoutConf> listInoutConf, String sort, String type) { + if (null == listInoutConf) return new InoutConf(sort); + if (StringUtils.isEmpty(sort)) sort = "1"; + + InoutConf result = null; + for (InoutConf conf : listInoutConf) { + if (sort.equals(conf.getSort()) && type.equals(conf.getType())) { + return conf; + } + } + + if (null == result) return new InoutConf(sort); return result; } @@ -116,34 +144,13 @@ public String getWeightEditTag(String companyId, String deptId) { // 浠庣紦瀛樹腑鑾峰彇鍑哄叆搴撶郴缁熼厤缃俊鎭� InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(companyId, deptId); - String weightEditTag = null; + String weightEditTag = Constant.YN_N; if (inoutSysConf != null) { weightEditTag = inoutSysConf.getWeightEditTag(); } + if (null == weightEditTag) weightEditTag = Constant.YN_N; + return weightEditTag; - } - - public List<WeightDto> getInoutWeightAll(List<InoutConf> listInoutConf, String type) { - List<WeightDto> result = new ArrayList<>(); - if (null == listInoutConf) return result; - - for (InoutConf conf : listInoutConf) { - if (type.equals(conf.getType())) { - result.add(new WeightDto(conf)); - } - } - return result; - } - - public WeightDto getInoutCurWeight(List<WeightDto> listWeight, String sort) { - if (null == listWeight || listWeight.isEmpty()) return new WeightDto(); - - if (listWeight.size() == 1) return listWeight.get(0); - - for (WeightDto weight : listWeight) { - if (weight.getSort().equals(sort)) return weight; - } - return new WeightDto(); } @@ -152,10 +159,10 @@ * * @param deptId */ - public void initInoutScreen(String deptId) { - if (StringUtils.isEmpty(deptId)) - deptId = ContextUtil.subDeptId(null); - inoutService.initInoutScreen(deptId); + public void initInoutScreen(String companyId, String deptId) { + if (StringUtils.isEmpty(companyId)) return; + if (StringUtils.isEmpty(deptId)) return; + inoutService.notifyToScreen(companyId, deptId, null); } public List<InoutData> getListInoutCache(String deptId) { -- Gitblit v1.9.3