| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -9,10 +9,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.dto.TestRecordArgumentDto; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.dto.TestRecordArgumentDto; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.entity.TestRecordReagent; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.entity.TestRecordReagent; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.constant.TestRecordArgumentType; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.constant.TestRecordArgumentType; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.entity.TestRecordSampleData; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.mapper.TestRecordMapper; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.mapper.TestRecordMapper; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.mapper.TestRecordReagentMapper; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.mapper.TestRecordReagentMapper; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.mapper.TestTemplateMapper; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.mapper.TestTemplateMapper; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.service.TestRecordReagentService; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.service.TestRecordReagentService; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.service.TestRecordSampleDataService; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.service.TestRecordService; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.service.TestRecordService; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.service.TestTemplateService; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspection.service.TestTemplateService; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspetion.api.vo.TestRecordVo; | 
					 | 
					 | 
					 | 
					import digital.laboratory.platform.inspetion.api.vo.TestRecordVo; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -48,13 +50,16 @@ public class TestRecordReagentServiceImpl extends ServiceImpl<TestRecordReagentM | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    @Resource | 
					 | 
					 | 
					 | 
					    @Resource | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private TestTemplateMapper testTemplateMapper; | 
					 | 
					 | 
					 | 
					    private TestTemplateMapper testTemplateMapper; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    @Resource | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private TestRecordSampleDataService testRecordSampleDataService; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public TestRecordReagent addTestRecordReagent(TestRecordReagent testRecordReagent) { | 
					 | 
					 | 
					 | 
					    public TestRecordReagent addTestRecordReagent(TestRecordReagent testRecordReagent) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (StringUtils.isBlank(testRecordReagent.getId())) { | 
					 | 
					 | 
					 | 
					        if (StringUtils.isBlank(testRecordReagent.getId())) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            testRecordReagent.setId(IdWorker.get32UUID()); | 
					 | 
					 | 
					 | 
					            testRecordReagent.setId(IdWorker.get32UUID()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            log.info("保存对象testRecordReagent的ID为空,由系统生成一个给它使用 {}", testRecordReagent.getId()); | 
					 | 
					 | 
					 | 
					            log.info("保存对象testRecordReagent的ID为空,由系统生成一个给它使用 {}", testRecordReagent.getId()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (!testRecordReagent.getCategory().equals("试剂")){ | 
					 | 
					 | 
					 | 
					        if (!testRecordReagent.getCategory().equals("试剂")) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            testRecordReagent.setPurityGrade("/"); | 
					 | 
					 | 
					 | 
					            testRecordReagent.setPurityGrade("/"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        boolean ret = this.save(testRecordReagent); | 
					 | 
					 | 
					 | 
					        boolean ret = this.save(testRecordReagent); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -83,6 +88,7 @@ public class TestRecordReagentServiceImpl extends ServiceImpl<TestRecordReagentM | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /** | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * 删除试剂耗材 | 
					 | 
					 | 
					 | 
					     * 删除试剂耗材 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param id | 
					 | 
					 | 
					 | 
					     * @param id | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @return | 
					 | 
					 | 
					 | 
					     * @return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     */ | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -106,6 +112,7 @@ public class TestRecordReagentServiceImpl extends ServiceImpl<TestRecordReagentM | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /** | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * 实验分页查询 | 
					 | 
					 | 
					 | 
					     * 实验分页查询 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param page | 
					 | 
					 | 
					 | 
					     * @param page | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param testId | 
					 | 
					 | 
					 | 
					     * @param testId | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param keywords 标准物质编号、名称查询参数 | 
					 | 
					 | 
					 | 
					     * @param keywords 标准物质编号、名称查询参数 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -151,6 +158,7 @@ public class TestRecordReagentServiceImpl extends ServiceImpl<TestRecordReagentM | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /** | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * 模板分页查询 | 
					 | 
					 | 
					 | 
					     * 模板分页查询 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param page | 
					 | 
					 | 
					 | 
					     * @param page | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param testId | 
					 | 
					 | 
					 | 
					     * @param testId | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param keywords 标准物质编号、名称查询参数 | 
					 | 
					 | 
					 | 
					     * @param keywords 标准物质编号、名称查询参数 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -195,6 +203,7 @@ public class TestRecordReagentServiceImpl extends ServiceImpl<TestRecordReagentM | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /** | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * 实验列表查询 | 
					 | 
					 | 
					 | 
					     * 实验列表查询 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param testId | 
					 | 
					 | 
					 | 
					     * @param testId | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param category 类别查询参数 | 
					 | 
					 | 
					 | 
					     * @param category 类别查询参数 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @return | 
					 | 
					 | 
					 | 
					     * @return | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -237,6 +246,7 @@ public class TestRecordReagentServiceImpl extends ServiceImpl<TestRecordReagentM | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /** | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * 向实验添加或移除试剂耗材 | 
					 | 
					 | 
					 | 
					     * 向实验添加或移除试剂耗材 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param testRecordArgumentDto | 
					 | 
					 | 
					 | 
					     * @param testRecordArgumentDto | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @return | 
					 | 
					 | 
					 | 
					     * @return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     */ | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -244,12 +254,21 @@ public class TestRecordReagentServiceImpl extends ServiceImpl<TestRecordReagentM | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    @Transactional(rollbackFor = Exception.class) | 
					 | 
					 | 
					 | 
					    @Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public boolean useTestRecordReagent(TestRecordArgumentDto testRecordArgumentDto) { | 
					 | 
					 | 
					 | 
					    public boolean useTestRecordReagent(TestRecordArgumentDto testRecordArgumentDto) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        TestRecordReagent testRecordReagent = this.getById(testRecordArgumentDto.getArgumentId()); | 
					 | 
					 | 
					 | 
					        TestRecordReagent testRecordReagent = this.getById(testRecordArgumentDto.getArgumentId()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (testRecordReagent.getCategory().equals("标准物质")) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            Integer opCode = testRecordArgumentDto.getOpCode(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (opCode == 1) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                testRecordSampleDataService.autoCreateData(testRecordArgumentDto.getTestRecordId(), testRecordArgumentDto.getArgumentId()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            }else if (opCode == -1) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                testRecordSampleDataService.autoDelData(testRecordArgumentDto.getTestRecordId(), testRecordArgumentDto.getArgumentId()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        testRecordReagent.setUpdateTime(LocalDateTime.now()); | 
					 | 
					 | 
					 | 
					        testRecordReagent.setUpdateTime(LocalDateTime.now()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return this.updateById(testRecordReagent) && testRecordService.updateTestRecordArgument(testRecordArgumentDto.getTestRecordId(), testRecordArgumentDto.getArgumentId(), TestRecordArgumentType.TEST_RECORD_ARGUMENT_REAGENT.getType(), testRecordArgumentDto.getOpCode()); | 
					 | 
					 | 
					 | 
					        return this.updateById(testRecordReagent) && testRecordService.updateTestRecordArgument(testRecordArgumentDto.getTestRecordId(), testRecordArgumentDto.getArgumentId(), TestRecordArgumentType.TEST_RECORD_ARGUMENT_REAGENT.getType(), testRecordArgumentDto.getOpCode()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /** | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * 向模板添加或移除试剂耗材 | 
					 | 
					 | 
					 | 
					     * 向模板添加或移除试剂耗材 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param testRecordArgumentDto | 
					 | 
					 | 
					 | 
					     * @param testRecordArgumentDto | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @return | 
					 | 
					 | 
					 | 
					     * @return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     */ | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |