From 7a7ccfd74dbdff086d2aabe5117ec1dc6f804d91 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期三, 31 五月 2023 18:48:41 +0800 Subject: [PATCH] 出入库优化-称重 --- igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java | 59 +++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 33 insertions(+), 26 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..da03cd4 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(); } -- Gitblit v1.9.3