diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java index a31b3ac..d64bb04 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java @@ -90,7 +90,7 @@ public class ApplicationForUseController { DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - IPage applicationForUseVOList = applicationForUseService.getApplicationForUseVOPage(page, Wrappers.query().eq("create_by", dlpUser.getId()).orderByDesc("create_time")); + IPage applicationForUseVOList = applicationForUseService.getApplicationForUseVOPage(page, Wrappers.query().eq("create_by", dlpUser.getId()).eq(applicationForUse.getStatus()!=null,"status",applicationForUse.getStatus()).orderByDesc("create_time")); return R.ok(applicationForUseVOList); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/BatchDetailsController.java b/src/main/java/digital/laboratory/platform/reagent/controller/BatchDetailsController.java index c0924ba..b0a9b6e 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/BatchDetailsController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/BatchDetailsController.java @@ -147,5 +147,10 @@ public class BatchDetailsController { } } + @PutMapping("/update/data") + public R updateCabinetData(){ + batchDetailsService.updateCabinetData(); + return R.ok("更新数据成功"); + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/BatchDetailsService.java b/src/main/java/digital/laboratory/platform/reagent/service/BatchDetailsService.java index a221441..3d445ad 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/BatchDetailsService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/BatchDetailsService.java @@ -15,4 +15,6 @@ import java.util.List; public interface BatchDetailsService extends IService { List getBatchDetailsList(String reagentConsumableInventoryId); + + void updateCabinetData(); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java index 4932311..f27eba8 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java @@ -6,13 +6,12 @@ import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.mapper.BatchDetailsMapper; import digital.laboratory.platform.reagent.service.*; import digital.laboratory.platform.reagent.vo.BatchDetailsVO; -import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO; +import digital.laboratory.platform.sys.feign.RemoteCabinetService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; -import java.time.LocalDate; -import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -34,6 +33,9 @@ public class BatchDetailsServiceImpl extends ServiceImpl getBatchDetailsList(String reagentConsumableInventoryId) { @@ -84,4 +86,17 @@ public class BatchDetailsServiceImpl extends ServiceImpl list = this.list(new LambdaQueryWrapper().gt(BatchDetails::getQuantity, 0)); + int x = 1; + for (BatchDetails batchDetails : list) { + String latticeId = batchDetails.getLatticeId(); + reagentConsumableInventoryService.updateCabinet(latticeId, batchDetails.getReagentConsumableInventoryId(), 1); + System.out.println("已成功更新" + batchDetails.getReagentConsumableName() + "的柜子信息"); + System.out.println("已成功更新" + x + "条记录"); + x++; + } + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java index 58fb24b..b53949b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java @@ -86,6 +86,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl locationInfoVOList = locationInfoService.getListById(id); HashMap objectObjectHashMap = new HashMap<>(); - objectObjectHashMap.put("batchDetails", batchDetailsVO); objectObjectHashMap.put("reagentConsumableInventory", reagentConsumableInventory); + objectObjectHashMap.put("locationInfoVOList", locationInfoVOList); return objectObjectHashMap; } + + }