From d02b6ed98e5a247c633be0285a301c78c1d4a046 Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期五, 30 六月 2023 20:22:09 +0800 Subject: [PATCH] 质检管理下拉框 --- igds-core/src/main/java/com/ld/igds/check/CheckStandardManager.java | 41 +++++++++++++++++++++++------------------ 1 files changed, 23 insertions(+), 18 deletions(-) diff --git a/igds-core/src/main/java/com/ld/igds/check/CheckStandardManager.java b/igds-core/src/main/java/com/ld/igds/check/CheckStandardManager.java index f5611ec..f0422a7 100644 --- a/igds-core/src/main/java/com/ld/igds/check/CheckStandardManager.java +++ b/igds-core/src/main/java/com/ld/igds/check/CheckStandardManager.java @@ -3,7 +3,6 @@ import com.ld.igds.check.dto.CheckItemData; import com.ld.igds.check.dto.CheckUpdateResult; import com.ld.igds.check.service.CoreCheckStandardService; -import com.ld.igds.inout.InoutConstant; import com.ld.igds.util.ContextUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -24,30 +23,28 @@ @Autowired private CoreCheckStandardService checkStandardService; - /** * 鏍规嵁鍙傛暟鑾峰彇鍖栭獙椤瑰垪琛� * * @param checkId * @param companyId - * @param deptId * @param foodVariety * @return */ - public List<CheckItemData> listCheckItem(String checkId, String companyId, - String deptId, String foodVariety) { + public List<CheckItemData> listCheckItem(String companyId, String checkId, + String foodVariety) { if (StringUtils.isEmpty(companyId)) { companyId = ContextUtil.getCompanyId(); } - if (StringUtils.isEmpty(deptId)) { - deptId = ContextUtil.subDeptId(ContextUtil.getLoginUser()); - } - List<CheckItemData> list = checkStandardService.getCheckItemById(checkId, companyId); + List<CheckItemData> list = null; + if (null != checkId) + list = checkStandardService.getCheckItemById(checkId, companyId); if (list == null || list.isEmpty()) { - list = checkStandardService.getCheckItemByStandard(checkId, companyId, deptId, foodVariety); + list = checkStandardService.getCheckItemByStandard(companyId, checkId, foodVariety); } + return list; } @@ -70,21 +67,29 @@ item.setUpperLimit(0.0); } - //姘村垎淇℃伅鍥炲~ - if (InoutConstant.CHECK_ITEM_C01.equals(item.getStandardId()) || InoutConstant.CHECK_ITEM_C020101.equals(item.getStandardId())) { - if(null != item.getValue()) result.setWet(Double.valueOf(item.getValue())); + if (null != item.getDeNum() && item.getDeNum() > 0) { + result.setDeSum(result.getDeSum() + item.getDeNum()); } - //鏉傝川淇℃伅鍥炲~ - if (InoutConstant.CHECK_ITEM_C02.equals(item.getStandardId()) || InoutConstant.CHECK_ITEM_C01010301.equals(item.getStandardId())) { - if(null != item.getValue()) result.setImpurity(Double.valueOf(item.getValue())); + if (null != item.getAddNum() && item.getAddNum() > 0) { + result.setAddSum(result.getAddSum() + item.getAddNum()); } - //鍏堟洿鏂帮紝鏇存柊澶辫触鍒欐柊澧� + if (null != item.getAddPrice() && item.getAddPrice() > 0) { + result.setAddPriceSum(result.getAddPriceSum() + + item.getAddPrice()); + } + if (null != item.getDePrice() && item.getDePrice() > 0) { + result.setDePriceSum(result.getDePriceSum() + item.getDePrice()); + } + + //濡傛灉娌℃湁澶栭敭涓嶆墽琛屾寔涔呭寲鎿嶄綔 + if (null == checkId) return result; + + // 鍏堟洿鏂帮紝鏇存柊澶辫触鍒欐柊澧� int i = checkStandardService.updateCheckItem(item); if (i < 1) { checkStandardService.insertCheckItem(item); } } - return result; } } \ No newline at end of file -- Gitblit v1.9.3