Commit e7d020d7 by lcx

核算组别配置返回列表修改

parent ded99a36
......@@ -534,7 +534,7 @@ public ApiResponse DepttypeDelete([CustomizeValidator(RuleSet = "Delete"), FromB
public ApiResponse GetAccountingList([FromBody] AccoungingRequest request)
{
var enumItems = EnumHelper.GetItems<AccountTypeEnum>();
if (request.AllotId == 0 || !enumItems.Select(t => t.Value).Contains(request.Type))
if ((request.AllotId == 0 && request.HospitalId == 0) || !enumItems.Select(t => t.Value).Contains(request.Type))
return new ApiResponse(ResponseType.ParameterError);
var result = _configService.GetAccountingList(request);
......
......@@ -645,6 +645,14 @@ public bool AgainDelete(CofAgainRequest request)
public List<cof_accounting> GetAccountingList(AccoungingRequest request)
{
Expression<Func<cof_accounting, bool>> exp = t => t.AllotId == request.AllotId;
if (request.AllotId == 0)
{
var allots = perforPerAllotRepository.GetEntities(t => t.HospitalId == request.HospitalId);
if (allots == null || !allots.Any())
throw new PerformanceException("请先配置科室信息");
exp = t => allots.Select(a => a.ID).Contains(t.AllotId);
}
if (request.Type == (int)AccountTypeEnum.AccountingUnit && !string.IsNullOrEmpty(request.UnitType))
exp = exp.And(t => t.UnitType == request.UnitType);
......@@ -730,7 +738,7 @@ public HandsonTable GetBatchAccountingStructrue(int AllotId)
public bool BatchSaveAccounting(int allotId, SaveCollectData request)
{
var dicData = CreateDataRow(0, allotId, request, Accounting);
var getAccounts = cofaccountingRepository.GetEntities();
var getAccounts = cofaccountingRepository.GetEntities(t => t.AllotId == allotId);
var unitType = EnumHelper.GetItems<UnitType>().Select(w => w.Description.Replace("行政后勤", "行政工勤")).ToArray();
List<cof_accounting> accounts = new List<cof_accounting>();
foreach (var item in dicData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment