|  |  | @ -234,9 +234,9 @@ public class UdiProductServiceImpl implements UdiProductService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         long relId = gennerOrderUtils.getRelId(); |  |  |  |         long relId = gennerOrderUtils.getRelId(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiProductEntity.setId(relId); |  |  |  |         udiProductEntity.setId(relId); | 
			
		
	
		
		
			
				
					
					|  |  |  |         String code = addProductRequest.getCode(); |  |  |  |         String code = addProductRequest.getCode(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (StrUtil.isEmpty(code)){ |  |  |  |         if (StrUtil.isEmpty(code)) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             udiProductEntity.setNameCode(relId + ""); |  |  |  |             udiProductEntity.setNameCode(relId + ""); | 
			
		
	
		
		
			
				
					
					|  |  |  |         }else { |  |  |  |         } else { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             udiProductEntity.setNameCode(code); |  |  |  |             udiProductEntity.setNameCode(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiProductEntity.setUuid(IdUtil.getSnowflakeNextId() + ""); |  |  |  |         udiProductEntity.setUuid(IdUtil.getSnowflakeNextId() + ""); | 
			
		
	
	
		
		
			
				
					|  |  | @ -256,7 +256,7 @@ public class UdiProductServiceImpl implements UdiProductService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiRelevanceEntity.setAttributeType(addProductRequest.getAttributeType()); |  |  |  |         udiRelevanceEntity.setAttributeType(addProductRequest.getAttributeType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiRelevanceEntity.setHcType(addProductRequest.getHcType()); |  |  |  |         udiRelevanceEntity.setHcType(addProductRequest.getHcType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         // TODO: 2024/2/27 初始化其他字段
 |  |  |  |         // TODO: 2024/2/27 初始化其他字段
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         setUpdateInfo(udiProductEntity,udiRelevanceEntity); |  |  |  |         setUpdateInfo(udiProductEntity, udiRelevanceEntity); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         //处理是否需要扫码字段
 |  |  |  |         //处理是否需要扫码字段
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         classifyCodeService.updateRequireScanCode(udiProductEntity); |  |  |  |         classifyCodeService.updateRequireScanCode(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiProductDao.insertUdiInfo(udiProductEntity); |  |  |  |         udiProductDao.insertUdiInfo(udiProductEntity); | 
			
		
	
	
		
		
			
				
					|  |  | @ -270,9 +270,9 @@ public class UdiProductServiceImpl implements UdiProductService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         long relId = gennerOrderUtils.getRelId(); |  |  |  |         long relId = gennerOrderUtils.getRelId(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiProductEntity.setId(relId); |  |  |  |         udiProductEntity.setId(relId); | 
			
		
	
		
		
			
				
					
					|  |  |  |         String code = addProductRequest.getCode(); |  |  |  |         String code = addProductRequest.getCode(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (StrUtil.isEmpty(code)){ |  |  |  |         if (StrUtil.isEmpty(code)) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             udiProductEntity.setNameCode(relId + ""); |  |  |  |             udiProductEntity.setNameCode(relId + ""); | 
			
		
	
		
		
			
				
					
					|  |  |  |         }else { |  |  |  |         } else { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             udiProductEntity.setNameCode(code); |  |  |  |             udiProductEntity.setNameCode(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiProductEntity.setUuid(IdUtil.getSnowflakeNextId() + ""); |  |  |  |         udiProductEntity.setUuid(IdUtil.getSnowflakeNextId() + ""); | 
			
		
	
	
		
		
			
				
					|  |  | @ -293,13 +293,47 @@ public class UdiProductServiceImpl implements UdiProductService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiRelevanceEntity.setAttributeType(addProductRequest.getAttributeType()); |  |  |  |         udiRelevanceEntity.setAttributeType(addProductRequest.getAttributeType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiRelevanceEntity.setHcType(addProductRequest.getHcType()); |  |  |  |         udiRelevanceEntity.setHcType(addProductRequest.getHcType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         // TODO: 2024/2/27 初始化其他字段
 |  |  |  |         // TODO: 2024/2/27 初始化其他字段
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         setUpdateInfo(udiProductEntity,udiRelevanceEntity); |  |  |  |         setUpdateInfo(udiProductEntity, udiRelevanceEntity); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         //处理是否需要扫码字段
 |  |  |  |         //处理是否需要扫码字段
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         classifyCodeService.updateRequireScanCode(udiProductEntity); |  |  |  |         classifyCodeService.updateRequireScanCode(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiProductDao.insertUdiInfo(udiProductEntity); |  |  |  |         udiProductDao.insertUdiInfo(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiRelevanceDao.insertUdiRelevance(udiRelevanceEntity); |  |  |  |         udiRelevanceDao.insertUdiRelevance(udiRelevanceEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     /** | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * 添加或更新层级药品信息 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * @param addProductRequest | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      */ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public void saveOrUpadateLevelDrug(AddProductRequest addProductRequest) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         UdiProductEntity udiProductEntity = new UdiProductEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BeanUtils.copyProperties(addProductRequest, udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (addProductRequest.getRelId() != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             UdiRelevanceEntity udiRelevanceEntity = udiRelevanceDao.selectById(addProductRequest.getRelId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (udiRelevanceEntity != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 udiProductEntity.setUuid(udiRelevanceEntity.getUuid()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             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); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //处理是否需要扫码字段
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         classifyCodeService.updateRequireScanCode(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         UdiProductEntity udiProductEntity1 = udiProductDao.findByNameCode(udiProductEntity.getNameCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (udiProductEntity1 != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             udiProductDao.updateUdiInfoById(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             udiProductDao.insertUdiInfo(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     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()); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |