From 1ebe2726a5f8fe55f01481b37d1ac1f75a088520 Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期四, 25 四月 2024 16:34:23 +0800 Subject: [PATCH] 2024-4-25 资源要求-设备管理后端调整 --- cnas-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodServiceImpl.java | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/cnas-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodServiceImpl.java b/cnas-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodServiceImpl.java index 462cae1..55785fe 100644 --- a/cnas-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodServiceImpl.java +++ b/cnas-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodServiceImpl.java @@ -9,6 +9,7 @@ import com.yuanchu.mom.pojo.StructureItemParameter; import com.yuanchu.mom.service.StandardMethodService; import com.yuanchu.mom.mapper.StandardMethodMapper; +import com.yuanchu.mom.service.StandardTreeService; import com.yuanchu.mom.utils.QueryWrappers; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; @@ -31,6 +32,8 @@ private StandardMethodMapper standardMethodMapper; + private StandardTreeService standardTreeService; + @Override public Map<String, Object> selectStandardMethodList(Page page, StandardMethod standardMethod) { Map<String, Object> map = new HashMap<>(); @@ -45,6 +48,27 @@ public List<StandardMethod> selectStandardMethods() { return standardMethodMapper.selectList(Wrappers.<StandardMethod>lambdaQuery().select(StandardMethod::getId,StandardMethod::getCode,StandardMethod::getName)); } + + @Override + public int addStandardMethod(StandardMethod standardMethod) { + int insert = standardMethodMapper.insert(standardMethod); + standardTreeService.reTreeBySampleType(standardMethod.getSampleType()); + return insert; + } + + @Override + public int delStandardMethod(Integer id) { + standardTreeService.reTreeBySampleType(standardMethodMapper.selectById(id).getSampleType()); + int i = standardMethodMapper.deleteById(id); + return i; + } + + @Override + public int upStandardMethod(StandardMethod standardMethod) { + int i = standardMethodMapper.updateById(standardMethod); + standardTreeService.reTreeBySampleType(standardMethodMapper.selectStandMethodById(standardMethod.getId()).getSampleType()); + return i; + } } -- Gitblit v1.9.3