From 0329de5a2343a179be54a9c70844515db202a998 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期一, 19 一月 2026 09:42:52 +0800
Subject: [PATCH] 细节调整1
---
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java | 89 +++++++++++++++++++++++++++++++++++++++++---
1 files changed, 82 insertions(+), 7 deletions(-)
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
index 51c8ff2..cbe55e4 100644
--- a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
@@ -2,14 +2,19 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fzzy.igds.constant.RedisConst;
+import com.fzzy.igds.data.QuantityParam;
+import com.fzzy.igds.domain.Quantity;
import com.fzzy.igds.domain.QuantityConf;
import com.fzzy.igds.mapper.QuantityConfMapper;
+import com.fzzy.igds.mapper.QuantityMapper;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
+
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
@@ -29,6 +34,76 @@
private QuantityConfMapper quantityConfMapper;
@Resource
private RedisCache redisCache;
+ @Resource
+ private QuantityMapper quantityMapper;
+
+
+ /**
+ * 鍒嗛〉鏌ヨ璐ㄩ噺妫�娴嬫暟鎹�
+ *
+ * @author sgj
+ * @date 2025/12/18
+ */
+ public void listPageQuantity(Page<Quantity> page, QuantityParam param) {
+ QueryWrapper<Quantity> queryWrapper = new QueryWrapper<>();
+
+ param.setCompanyId(ContextUtil.getCompanyId());
+ queryWrapper.eq("company_id", param.getCompanyId());
+ //搴撳尯妫�绱�
+ if (StringUtils.isNotBlank(param.getDeptId())) {
+ queryWrapper.like("dept_id", param.getDeptId());
+ }
+ //浠撳簱妫�绱�
+ if (StringUtils.isNotBlank(param.getDepotId())) {
+ queryWrapper.eq("depot_id", param.getDepotId());
+ }
+ //鏃堕棿妫�绱�
+ if(param.getStart() != null){
+ queryWrapper.ge("receive_date", param.getStart());
+ }
+ if(param.getEnd() != null){
+ queryWrapper.le("receive_date", param.getEnd());
+ }
+ queryWrapper.orderByAsc("receive_date");
+ quantityMapper.selectPage(page, queryWrapper);
+
+ }
+
+ /**
+ * 鏌ヨ鏁版嵁鍒楄〃
+ * @param depotId
+ * @param limit 鏌ヨ鏉℃暟
+ * @return
+ */
+ public List<Quantity> getQuantityList(String depotId, Integer limit) {
+ if (StringUtils.isEmpty(depotId)) {
+ return null;
+ }
+
+ QueryWrapper<Quantity> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("depot_id", depotId);
+ queryWrapper.orderByDesc("receive_date");
+ queryWrapper.last("LIMIT " + limit);
+
+ return quantityMapper.selectList(queryWrapper);
+ }
+
+ /**
+ * 淇濆瓨鏁版嵁
+ *
+ * @param data
+ */
+ public void saveData(Quantity data) {
+
+ data.setUpdateBy(ContextUtil.getLoginUserName());
+ data.setUpdateTime(new Date());
+
+ if(StringUtils.isBlank(data.getCreateBy())){
+ data.setCreateBy(ContextUtil.getLoginUserName());
+ data.setCreateTime(new Date());
+ }
+ quantityMapper.insert(data);
+ }
/**
* 鏌ヨ閰嶇疆淇℃伅锛屾牴鎹簱鍖虹紪鐮佽幏鍙�
@@ -44,10 +119,10 @@
if (StringUtils.isEmpty(deptId)) {
deptId = ContextUtil.subDeptId(null);
}
-
+
QueryWrapper<QuantityConf> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("company_id", companyId);
- if(StringUtils.isNotBlank(deptId)){
+ if (StringUtils.isNotBlank(deptId)) {
queryWrapper.eq("dept_id", deptId);
}
queryWrapper.orderByAsc("order_num");
@@ -56,7 +131,7 @@
}
/**
- * - 鏌ヨ閰嶇疆淇℃伅锛屾牴鎹粍缁囩紪鐮佽幏鍙�
+ * - 鏌ヨ閰嶇疆淇℃伅锛屾牴鎹粍缁囩紪鐮佽幏鍙�
*
* @param companyId
* @return
@@ -70,7 +145,7 @@
}
/**
- * - 鏇存柊淇濆瓨鏁版嵁
+ * - 鏇存柊淇濆瓨鏁版嵁
*
* @param conf
*/
@@ -90,10 +165,10 @@
conf.setUpdateBy(ContextUtil.getLoginUserName());
conf.setUpdateTime(new Date());
quantityConfMapper.insert(conf);
- }else {
+ } else {
conf.setUpdateBy(ContextUtil.getLoginUserName());
conf.setUpdateTime(new Date());
- quantityConfMapper.updateById(conf);
+ quantityConfMapper.update(conf, new UpdateWrapper<QuantityConf>().eq("depot_id", conf.getDepotId()));
}
//鍒锋柊缂撳瓨
@@ -115,7 +190,7 @@
}
/**
- * - 鍒犻櫎鏁版嵁
+ * - 鍒犻櫎鏁版嵁
*
* @param conf
* @return
--
Gitblit v1.9.3