|  |  |  | @ -206,13 +206,14 @@ public class MesNcProcessingService implements IMesNcProcessingService { | 
		
	
		
			
				|  |  |  |  |         if(!Objects.isNull(model.getPart())){ | 
		
	
		
			
				|  |  |  |  |             model.setPart(mesPartService.getMesPartSapByPartNo(model.getPart().getPartNo(), org)); | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |         if (model.getPartInspection().getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { | 
		
	
		
			
				|  |  |  |  |             Integer type = model.getType(); | 
		
	
		
			
				|  |  |  |  |             MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson(); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |             final String redisKey = MesPcnExtConstWords.SAP_TRANS_JOB_LOCK_TAG + model.getSn(); | 
		
	
		
			
				|  |  |  |  |             RLock rLock = (RLock) redisMesPcn.getLock(redisKey); | 
		
	
		
			
				|  |  |  |  |             try { | 
		
	
		
			
				|  |  |  |  |         final String redisKey = MesPcnExtConstWords.SAP_TRANS_JOB_LOCK_TAG + model.getPartInspection().getId(); | 
		
	
		
			
				|  |  |  |  |         RLock rLock = (RLock) redisMesPcn.getLock(redisKey); | 
		
	
		
			
				|  |  |  |  |         try { | 
		
	
		
			
				|  |  |  |  |             if (model.getPartInspection().getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { | 
		
	
		
			
				|  |  |  |  |                 Integer type = model.getType(); | 
		
	
		
			
				|  |  |  |  |                 MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson(); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |                 //使用tryLock拿不到锁直接返回
 | 
		
	
		
			
				|  |  |  |  |                 //rlock的leaseTime为-1,会每隔WatchdogTimeout秒去续约
 | 
		
	
		
			
				|  |  |  |  |                 if (!rLock.tryLock()){ | 
		
	
	
		
			
				
					|  |  |  | @ -221,17 +222,16 @@ public class MesNcProcessingService implements IMesNcProcessingService { | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |                 //保存数据
 | 
		
	
		
			
				|  |  |  |  |                 saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode(),isOrder); | 
		
	
		
			
				|  |  |  |  |             } finally { | 
		
	
		
			
				|  |  |  |  |                 if (rLock.isHeldByCurrentThread()) { | 
		
	
		
			
				|  |  |  |  |                     rLock.unlock(); | 
		
	
		
			
				|  |  |  |  |                 } | 
		
	
		
			
				|  |  |  |  |             } else { | 
		
	
		
			
				|  |  |  |  |                 Integer type = model.getType(); | 
		
	
		
			
				|  |  |  |  |                 MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson(); | 
		
	
		
			
				|  |  |  |  |                 //保存数据
 | 
		
	
		
			
				|  |  |  |  |                 saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode(), isOrder); | 
		
	
		
			
				|  |  |  |  |             } | 
		
	
		
			
				|  |  |  |  |         } finally { | 
		
	
		
			
				|  |  |  |  |             if (rLock.isHeldByCurrentThread()) { | 
		
	
		
			
				|  |  |  |  |                 rLock.unlock(); | 
		
	
		
			
				|  |  |  |  |             } | 
		
	
		
			
				|  |  |  |  |         } else { | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |             Integer type = model.getType(); | 
		
	
		
			
				|  |  |  |  |             MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson(); | 
		
	
		
			
				|  |  |  |  |             //保存数据
 | 
		
	
		
			
				|  |  |  |  |             saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode(), isOrder); | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | 
 |