From f330903e12d38af89d61f16c96856924d241a0f2 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 26 七月 2023 09:08:58 +0800
Subject: [PATCH] 查删检验计划
---
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialListServiceImpl.java | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialListServiceImpl.java b/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialListServiceImpl.java
index c7ed1f0..58f207b 100644
--- a/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialListServiceImpl.java
+++ b/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialListServiceImpl.java
@@ -37,13 +37,18 @@
ProductMapper productMapper;
@Resource
+ InspectionProductListService inspectionProductListService;
+
+ @Resource
InspectionProductListMapper inspectionProductListMapper;
+ //鏌ヨ妫�楠屽崟閲岄潰鐨勭墿鏂欎俊鎭�
@Override
public List<InspectionMaterialList> selectInspectionMaterialListByInsId(String insId) {
return inspectionMaterialListMapper.selectInspectionMaterialListByInsId(insId);
}
+ //娣诲姞妫�楠屽崟涓殑妫�楠屾牱鍝�
@Override
@Transactional(rollbackFor = Exception.class)
public InspectionMaterialList addInspectionMaterialList(InspectionMaterialList inspectionMaterialList,String userId) {
@@ -62,6 +67,7 @@
.setUserId(Integer.parseInt(userId));
list1.add(inspectionProductList);
});
+ //娣诲姞妫�楠岄」鐩�
int judge2 = inspectionProductListMapper.addInspectionProductList(list1);
return judge>0&&judge2>0?inspectionMaterialList:null;
}
@@ -75,19 +81,16 @@
list.setState(0);
list.setId(inspectionMaterialListId);
int judge1 = inspectionMaterialListMapper.updateById(list);
- //鍒犻櫎鏍峰搧妫�楠岄」鐩�
- UpdateWrapper<InspectionProductList> wrapper = new UpdateWrapper<>();
- wrapper.eq("inspection_material_list_id", inspectionMaterialListId).set("state", 0);
- int judge2 = inspectionProductListMapper.update(new InspectionProductList(), wrapper);
+ //鏍规嵁鏍峰搧id鍒犻櫎妫�楠屾牱鍝佷腑鐨勬楠岄」鐩�
+ int judge2 = inspectionProductListService.delInspectionProductList(inspectionMaterialListId);
return judge1>0&&judge2>0;
}
- //淇敼鏍峰搧淇℃伅
+ //鏍规嵁鏍峰搧id淇敼鏍峰搧淇℃伅
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList) {
LambdaUpdateWrapper<InspectionMaterialList> updateWrapper = new LambdaUpdateWrapper<>();
- //鏍规嵁鏍峰搧id鏌ヨ
updateWrapper.eq(InspectionMaterialList::getId,inspectionMaterialListId);
int judge = inspectionMaterialListMapper.update(inspectionMaterialList, updateWrapper);
return judge>0;
--
Gitblit v1.9.3