From 7c6b2c777ebe4ea64c492d2dd5aea69d902c94a7 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期四, 01 六月 2023 19:52:41 +0800
Subject: [PATCH] 提交粮食定价配置
---
igds-core/src/main/java/com/ld/igds/common/manager/CommonManager.java | 92 +++++++++++++++++++++------------------------
1 files changed, 43 insertions(+), 49 deletions(-)
diff --git a/igds-core/src/main/java/com/ld/igds/common/manager/CommonManager.java b/igds-core/src/main/java/com/ld/igds/common/manager/CommonManager.java
index e82212f..54c1018 100644
--- a/igds-core/src/main/java/com/ld/igds/common/manager/CommonManager.java
+++ b/igds-core/src/main/java/com/ld/igds/common/manager/CommonManager.java
@@ -11,6 +11,7 @@
import com.ld.igds.data.BaseParam;
import com.ld.igds.data.Page;
import com.ld.igds.data.PageResponse;
+import com.ld.igds.data.SimpleDepot;
import com.ld.igds.grain.dto.GrainData;
import com.ld.igds.grain.service.CoreGrainService;
import com.ld.igds.inout.dto.InoutParam;
@@ -64,24 +65,45 @@
private RedisUtil redisUtil;
/**
- * 鑾峰彇鍏ュ簱鐨勪笅鎷夋
+ * 鑾峰彇鍏ュ簱浣滀笟涓紝浠撳簱涓嬫媺妗嗭紝鍊艰幏鍙栫姸鎬�=闈炴弧浠撶殑绮簱
*
* @return
*/
- public List<Depot> listInDepot() {
- List<Depot> list = listDepot(true);
- return list;
+ public List<SimpleDepot> getCacheDeptIn(String companyId, String deptId) {
+
+ List<SimpleDepot> result = new ArrayList<>();
+ List<Depot> list = coreCommonService.getCacheDepotList(companyId, deptId);
+
+ for (Depot depot : list) {
+ if (DepotStatus.STATUS_3.getCode().equals(depot.getDepotStatus())) continue;
+ if (DepotStatus.STATUS_31.getCode().equals(depot.getDepotStatus())) continue;
+ if (DepotStatus.STATUS_32.getCode().equals(depot.getDepotStatus())) continue;
+ if (DepotStatus.STATUS_33.getCode().equals(depot.getDepotStatus())) continue;
+ if (DepotStatus.STATUS_34.getCode().equals(depot.getDepotStatus())) continue;
+
+ result.add(new SimpleDepot(depot));
+ }
+
+ return result;
}
/**
- * 鑾峰彇鍑哄簱鐨勪笅鎷夋
+ * 鑾峰彇鍑哄簱涓嬫媺妗嗗垪琛紝鑷姩灞忚斀绌轰粨
*
* @return
*/
- public List<Depot> listOutDepot() {
- List<Depot> list = listDepot(true);
+ public List<SimpleDepot> getCacheDeptOut(String companyId, String deptId) {
+ List<SimpleDepot> result = new ArrayList<>();
+ List<Depot> list = coreCommonService.getCacheDepotList(companyId, deptId);
- return list;
+ for (Depot depot : list) {
+ if (DepotStatus.STATUS_1.getCode().equals(depot.getDepotStatus())) continue;
+ if (DepotStatus.STATUS_2.getCode().equals(depot.getDepotStatus())) continue;
+
+ result.add(new SimpleDepot(depot));
+ }
+
+ return result;
}
/**
@@ -117,38 +139,12 @@
/**
* 鏌ヨ閮ㄩ棬涓嬪睘鎵�鏈変粨搴撳垪琛�
*
- * @param isDelOther
+ * @param companyId
* @param deptId
* @return
*/
- public List<Depot> listDepotByDeptId(boolean isDelOther, String deptId) {
- String companyId = ContextUtil.getCompanyId();
-
- if (StringUtils.isEmpty(deptId)) {
- return null;
- }
-
- List<Depot> list = coreCommonService.getCacheDepotList(companyId);
- if (null == list || list.isEmpty()) {
- return list;
- }
-
- List<Depot> listDepot = new ArrayList<>();
- for (Depot depot : list) {
- if (depot.getDeptId().contains(deptId)) {
- listDepot.add(depot);
- }
- }
-
- // 鍒犻櫎闈炰粨搴撳垪琛�
- if (isDelOther) {
- return listDepot
- .stream()
- .filter(item -> !item.getDepotType().equals(
- DepotType.TYPE_99.getCode())).collect(Collectors.toList());
- }
-
- return listDepot;
+ public List<Depot> listDepotByDeptId(String companyId, String deptId) {
+ return coreCommonService.getCacheDepotList(companyId, deptId);
}
/**
@@ -485,18 +481,6 @@
return new PageResponse<>(RespCodeEnum.CODE_0000, data);
}
- public PageResponse<Page<DicFoodOrigin>> pageFoodLocation(InoutParam param) {
-
- Page<DicFoodOrigin> result = coreDicService.pageFoodLocation(param);
-
- if (null == result.getRecords() || result.getRecords().isEmpty()) {
- return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
- "鑾峰彇鍒版暟鎹俊鎭负绌�");
- }
- return new PageResponse<Page<DicFoodOrigin>>(RespCodeEnum.CODE_0000,
- result);
- }
-
public DepotConf getDepotConf(String companyId, String depotId) {
return coreCommonService.getCacheDepotConf(companyId, depotId);
@@ -621,5 +605,15 @@
return (String) redisUtil.get(key);
}
+ public Page<DicArea> pageDicArea(BaseParam param) {
+
+ Page<DicArea> page = new Page<>(param.getPage(), param.getLimit());
+
+ List<DicArea> list = coreDicService.listDicArea(page, param);
+ page.setRecords(list);
+
+ return page;
+ }
+
}
--
Gitblit v1.9.3