From cdaff9ab0d1b676e3b429171d6de0887c98f488c Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期三, 26 七月 2023 09:15:31 +0800
Subject: [PATCH] LIMS管理系统框架-开发7-26标准库修改前
---
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java | 41 ++++++++++++++++++++++++++++++-----------
1 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java b/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java
index 0f49d8c..d548a76 100644
--- a/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java
+++ b/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java
@@ -1,10 +1,13 @@
package com.yuanchu.limslaboratory.service.impl;
+
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper;
+import com.yuanchu.limslaboratory.mapper.PlanMapper;
import com.yuanchu.limslaboratory.pojo.Inspection;
import com.yuanchu.limslaboratory.mapper.InspectionMapper;
import com.yuanchu.limslaboratory.pojo.InspectionMaterialList;
-import com.yuanchu.limslaboratory.pojo.InspectionProductList;
+import com.yuanchu.limslaboratory.pojo.Plan;
import com.yuanchu.limslaboratory.pojo.dto.InspectionDto;
import com.yuanchu.limslaboratory.service.InspectionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -12,6 +15,7 @@
import javax.annotation.Resource;
import java.time.LocalDateTime;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -28,6 +32,10 @@
@Resource
private InspectionMapper inspectionMapper;
+ @Resource
+ private PlanMapper planMapper;
+ @Resource
+ InspectionMaterialListMapper inspectionMaterialListMapper;
@Override
public Inspection addInspection(String userName,int type) {
@@ -38,28 +46,39 @@
return judge>0?inspection:null;
}
+ //鏌ヨ鎵�鏈夋楠屽崟鍒楄〃
@Override
- public List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state) {
- return inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state);
+ public Map selectAllInspection(int pageSize, int countSize, Integer state) {
+ Map map = new HashMap();
+ map.put("data",inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state));
+ map.put("count", inspectionMapper.selectInspectToCount(state));
+ return map;
}
+ //浣滃簾鐢宠妫�楠屽崟
@Override
public boolean delInspectionByInsId(String inspectionId) {
- Inspection inspection = new Inspection();
+ //妫�楠屽崟浣滃簾
+ Inspection inspection = inspectionMapper.selectById(inspectionId);
inspection.setState(0);
- inspection.setId(inspectionId);
- int judge = inspectionMapper.updateById(inspection);
- return judge>0;
-
+ int judge1 = inspectionMapper.updateById(inspection);
+ //妫�楠屾牱鍝佷綔搴�
+ UpdateWrapper<InspectionMaterialList> wrapper = new UpdateWrapper<>();
+ wrapper.eq("inspection_id", inspectionId).set("state", 0);
+ int judge2 = inspectionMaterialListMapper.update(new InspectionMaterialList(),wrapper);
+ return judge1>0&&judge2>0;
}
+ //鎻愪氦鐢宠妫�楠屽崟
@Override
public boolean subInspectionByInsId(String inspectionId) {
- Inspection inspection = new Inspection();
+ Inspection inspection = inspectionMapper.selectById(inspectionId);
+ //鐘舵�佹敼涓哄凡鎻愪氦2
inspection.setState(2);
- inspection.setId(inspectionId);
- inspection.setInspectStartTime(LocalDateTime.now());
int judge = inspectionMapper.updateById(inspection);
+ //璁″垝琛ㄦ柊澧�
+ Plan plan = Plan.builder().inspectionId(inspectionId).state(1).build();
+ planMapper.insert(plan);
return judge>0;
}
}
--
Gitblit v1.9.3