|  |  | @ -263,6 +263,43 @@ public class UdiProductServiceImpl implements UdiProductService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiRelevanceDao.insertUdiRelevance(udiRelevanceEntity); |  |  |  |         udiRelevanceDao.insertUdiRelevance(udiRelevanceEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public void addDrug(AddProductRequest addProductRequest) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         UdiProductEntity udiProductEntity = new UdiProductEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BeanUtils.copyProperties(addProductRequest, udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         long relId = gennerOrderUtils.getRelId(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiProductEntity.setId(relId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String code = addProductRequest.getCode(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isEmpty(code)){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             udiProductEntity.setNameCode(relId + ""); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             udiProductEntity.setNameCode(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiProductEntity.setUuid(IdUtil.getSnowflakeNextId() + ""); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiProductEntity.setCpmctymc(addProductRequest.getCpmctymc()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiProductEntity.setGgxh(addProductRequest.getSpec()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiProductEntity.setPrice(addProductRequest.getPrice().toString()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiProductEntity.setZczbhhzbapzbh(addProductRequest.getRegisterNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiProductEntity.setDiType(ConstantStatus.DI_TYPE_MAIN); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiRelevanceEntity.setId(IdUtil.getSnowflakeNextId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiRelevanceEntity.setIsDisable(false); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiRelevanceEntity.setIsUseDy(false); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiRelevanceEntity.setUuid(udiProductEntity.getUuid()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiRelevanceEntity.setNeedCert(false); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiRelevanceEntity.setPurType(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiRelevanceEntity.setAttributeType(addProductRequest.getAttributeType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiRelevanceEntity.setHcType(addProductRequest.getHcType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         // TODO: 2024/2/27 初始化其他字段
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         setUpdateInfo(udiProductEntity,udiRelevanceEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //处理是否需要扫码字段
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         classifyCodeService.updateRequireScanCode(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiProductDao.insertUdiInfo(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         udiRelevanceDao.insertUdiRelevance(udiRelevanceEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     private void setUpdateInfo(UdiProductEntity udiProductEntity, UdiRelevanceEntity udiRelevanceEntity) { |  |  |  |     private void setUpdateInfo(UdiProductEntity udiProductEntity, UdiRelevanceEntity udiRelevanceEntity) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         Date now = new Date(); |  |  |  |         Date now = new Date(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         String userId = String.valueOf(customerService.getUserBean().getId()); |  |  |  |         String userId = String.valueOf(customerService.getUserBean().getId()); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |