| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -7,6 +7,7 @@ using Shentun.Peis.DeviceTypes; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					using Shentun.Peis.Enums; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					using Shentun.Peis.ForSexs; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					using Shentun.Peis.Models; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					using Shentun.Peis.PatientRegisters; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					using Shentun.Peis.RegisterCheckCriticalValues; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					using Shentun.Peis.RegisterCheckItems; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					using Shentun.Peis.RegisterCheckPictures; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -330,8 +331,79 @@ namespace Shentun.Peis.RegisterAsbitems | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                   OrderBy(o => o.Id).ToList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return entdto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="input"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        [HttpGet("api/app/registerasbitem/GetCanChargeAsbitemsByPatientRegisterId")] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        public async Task<List<RegisterCheckAsbitemOrAsbitemDto>> GetCanChargeAsbitemsByPatientRegisterIdAsync(PatientRegisterIdInputDto input) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var patientReigister = await _patientRegisterRepository.GetAsync(input.PatientRegisterId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var entlist = (await _registerCheckAsbitemRepository.GetQueryableAsync()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .Include(x => x.Asbitem) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .Include(x => x.Asbitem.ItemType) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .Include(x => x.RegisterCheck) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					              .Where(m => m.PatientRegisterId == input.PatientRegisterId &&  | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        m.IsCharge == 'Y' && m.PayTypeFlag == PayTypeFlag.PersonPay).ToList().OrderByDescending(o => o.GroupPackageId).ThenBy(o => o.Asbitem.DisplayOrder); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var entdto = entlist.Select(s => new RegisterCheckAsbitemOrAsbitemDto | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Discount = s.StandardPrice == 0 ? 100 : Math.Round(Convert.ToDecimal(s.ChargePrice * 100 / s.StandardPrice), 2), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                IsLock = s.RegisterCheck.IsLock, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                CreationTime = s.CreationTime, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                CreatorId = s.CreatorId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Id = s.Id, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                LastModificationTime = s.LastModificationTime, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                LastModifierId = s.LastModifierId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Amount = s.Amount, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                AsbitemId = s.AsbitemId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                AsbitemName = s.Asbitem.DisplayName, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ChargePrice = s.ChargePrice, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                IsBelongGroupPackage = 'N', | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //GroupPackageId = s.GroupPackageId,
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                CheckCompleteFlag = s.RegisterCheck.CompleteFlag, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                DeviceTypeName = s.Asbitem.DeviceTypeId != null ? _cacheService.GetDeviceTypeNameAsync(s.Asbitem.DeviceTypeId.Value).Result : "", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                IsCharge = s.IsCharge, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ItemTypeName = s.Asbitem.ItemType.DisplayName, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                LisRequestId = s.LisRequestId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                PatientRegisterId = s.PatientRegisterId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                PayTypeFlag = s.PayTypeFlag, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                SexName = _cacheService.GetForSexNameAsync(s.Asbitem.ForSexId).Result, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                StandardPrice = s.StandardPrice, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).Result, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).Result | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }).ToList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //设置GroupPackageId
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (patientReigister.CustomerOrgGroupId != null && patientReigister.CustomerOrgGroupId != Guid.Empty) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                var groupDetails = (await _customerOrgGroupDetailRepository.GetQueryableAsync()).Where(o => o.CustomerOrgGroupId == patientReigister.CustomerOrgGroupId).ToList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                entdto.ForEach(o => | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (groupDetails.Where(x => x.AsbitemId == o.AsbitemId).Count() > 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        o.IsBelongGroupPackage = 'Y'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            else if (patientReigister.MedicalPackageId != null && patientReigister.MedicalPackageId != Guid.Empty) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                var groupDetails = (await _medicalPackageDetailRepository.GetQueryableAsync()).Where(o => o.MedicalPackageId == patientReigister.MedicalPackageId).ToList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                entdto.ForEach(o => | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (groupDetails.Where(x => x.AsbitemId == o.AsbitemId).Count() > 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        o.IsBelongGroupPackage = 'Y'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entdto = entdto.OrderByDescending(o => o.IsBelongGroupPackage). | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                   OrderBy(o => o.Id).ToList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return entdto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        #region 批量操作组合项目业务,单位操作
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |