|  | @@ -1156,6 +1156,10 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
 | 
	
		
			
				|  |  |          if (ObjectUtil.isNotEmpty(dto.getId())) {
 | 
	
		
			
				|  |  |              dto.setTableIds(null);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        //获取之前关联的委托单id
 | 
	
		
			
				|  |  | +        TrialSelfInspectionRecord oldData = baseMapper.selectById(dto.getId());
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  |          this.saveOrUpdate(dto);
 | 
	
		
			
				|  |  |          dto.setTableIds(tableIds);
 | 
	
		
			
				|  |  |          if (ObjectUtil.isNotEmpty(dto.getId())) {
 | 
	
	
		
			
				|  | @@ -1186,6 +1190,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
 | 
	
		
			
				|  |  |              //修改项目节点基础信息
 | 
	
		
			
				|  |  |              jdbcTemplate.update("update u_entrust_info set sample_status=4 where id ='" + dto.getEntrustId() + "'");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        if(oldData != null && oldData.getEntrustId() != null && dto.getEntrustId() == null){
 | 
	
		
			
				|  |  | +            entrustInfoService.update(Wrappers.<EntrustInfo>lambdaUpdate().eq(EntrustInfo::getId, oldData.getEntrustId()).set(EntrustInfo::getExpCount, 0));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          String[] strings = dto.getTableType().split(",");
 | 
	
		
			
				|  |  |          if (StringUtils.isNotEmpty(dto.getRecordAutoNumber()) || StringUtils.isNotEmpty(dto.getReportAutoNumber())) {
 | 
	
		
			
				|  |  |              if (dto.getOldRecordNumber() != null && dto.getOldRecordNumber().equals(dto.getRecordNo()) || dto.getOldReportNumber() != null && dto.getOldReportNumber().equals(dto.getReportNo())) {
 |