From c128ed33c2447e8daea89d70795098748bd5b2af Mon Sep 17 00:00:00 2001
From: zhangfeng <1603559716@qq.com>
Date: Fri, 06 Jan 2023 10:53:27 +0800
Subject: [PATCH] 补充查询单条领取记录接口
---
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialInfoServiceImpl.java | 72 ++++++++++++++++++++++++++----------
1 files changed, 52 insertions(+), 20 deletions(-)
diff --git a/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialInfoServiceImpl.java b/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialInfoServiceImpl.java
index 6c6d4cd..c77eb64 100644
--- a/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialInfoServiceImpl.java
+++ b/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialInfoServiceImpl.java
@@ -5,15 +5,14 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.utils.StringUtils;
-import com.gkhy.safePlatform.equipment.entity.SafeMaterialCountDO;
-import com.gkhy.safePlatform.equipment.entity.SafeMaterialDO;
-import com.gkhy.safePlatform.equipment.entity.SafeMaterialInfo;
+import com.gkhy.safePlatform.equipment.entity.*;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialQuery;
import com.gkhy.safePlatform.equipment.repository.SafeMaterialInfoRepository;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
import java.util.List;
@@ -31,26 +30,11 @@
}
@Override
- public SafeMaterialInfo queryById(Long id) {
+ public SafeMaterialDO queryById(Long id) {
if(null == id){
throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
}
- SafeMaterialInfo safeMaterialInfo = repository.selectOne(new LambdaQueryWrapper<SafeMaterialInfo>()
- .eq(SafeMaterialInfo::getId, id)
- .eq(SafeMaterialInfo::getDelFlag, 0)
- );
- return safeMaterialInfo;
- }
-
- /**
- * 根据类型统计数据
- */
- @Override
- public int getCountByClassify(Long classifyId){
- if(null == classifyId){
- throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
- }
- return repository.getCountByClassify(classifyId);
+ return repository.queryById(id);
}
@Override
@@ -76,5 +60,53 @@
return materialInfoList;
}
+ @Override
+ public int getCountBySmallClassifyId(Long smallClassifyId) {
+ if(null == smallClassifyId){
+ throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
+ }
+ return repository.getCountBySmallClassifyId(smallClassifyId);
+ }
+
+ @Override
+ public boolean checkMaterial(Long smallClassifyId, Long depId, Long id) {
+ if(null == depId || null == smallClassifyId){
+ throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
+ }
+ boolean flag = false;
+ int i = repository.checkMatrial(smallClassifyId,depId,id);
+ if (i>0){
+ flag = true;
+ }
+ return flag;
+ }
+
+ @Override
+ public void updateCountById(SafeMaterialBO safeMaterialBO) {
+ if(null == safeMaterialBO){
+ throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
+ }
+ repository.updateCountById(safeMaterialBO);
+ }
+
+ @Override
+ public List<SafeMaterialInfo> listByDepId(Long depId) {
+ if(null == depId){
+ throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
+ }
+ List<SafeMaterialInfo> safeMaterialInfoList = repository.selectList(new LambdaQueryWrapper<SafeMaterialInfo>()
+ .eq(SafeMaterialInfo::getDelFlag, 0)
+ .eq(SafeMaterialInfo::getDepId, depId));
+ return safeMaterialInfoList;
+ }
+
+ @Override
+ public void updateStockCount(List<SafeMaterialBO> safeMaterialBOList) {
+ if(CollectionUtils.isEmpty(safeMaterialBOList)){
+ throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
+ }
+ repository.updateStockCount(safeMaterialBOList);
+ }
+
}
--
Gitblit v1.9.2