You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.6 KiB
59 lines
1.6 KiB
using AutoMapper.Internal.Mappers;
|
|
using Shentun.Peis.MedicalPackageDetails;
|
|
using Shentun.Peis.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp;
|
|
using Volo.Abp.Domain.Repositories;
|
|
using Volo.Abp.Domain.Services;
|
|
|
|
namespace Shentun.Peis.AsbitemDetails
|
|
{
|
|
public class AsbitemDetailManager : DomainService
|
|
{
|
|
private readonly IRepository<AsbitemDetail> _repository;
|
|
|
|
public AsbitemDetailManager(
|
|
IRepository<AsbitemDetail> repository
|
|
)
|
|
{
|
|
this._repository = repository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
public AsbitemDetail CreateAsbitemAsync(AsbitemDetail entity)
|
|
{
|
|
DataHelper.CheckGuidIsDefaultValue(entity.AsbitemId, "组合项目编号");
|
|
DataHelper.CheckGuidIsDefaultValue(entity.ItemId, "项目编号");
|
|
|
|
return entity;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 删除组合项目明细
|
|
/// </summary>
|
|
/// <param name="AsbitemId">组合项目ID</param>
|
|
/// <returns></returns>
|
|
/// <exception cref="UserFriendlyException"></exception>
|
|
public async Task CheckAndDeleteAsync(Guid AsbitemId)
|
|
{
|
|
var asbitemDetailList = await _repository.GetListAsync(m => m.AsbitemId == AsbitemId);
|
|
if (asbitemDetailList.Any())
|
|
{
|
|
|
|
//删除组合项目明细
|
|
await _repository.DeleteManyAsync(asbitemDetailList);
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|