From 607e62cd6ec91d53bac549299d986c23e5143d28 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期三, 31 五月 2023 15:06:47 +0800 Subject: [PATCH] 出入库优化-称重相关方法 --- igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java | 49 +++++++++++++++++++++++++++---------------------- 1 files changed, 27 insertions(+), 22 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 7f9ade9..f1c5b38 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 @@ -94,6 +94,33 @@ 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; + } + /** * 鏍规嵁绫诲瀷鑾峰彇瀛楀吀琛ㄤ笅鎷夋 @@ -123,28 +150,6 @@ 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(); - } /** -- Gitblit v1.9.3