Browse Source

修改合并项目前备份

bjmzak
wxd 2 years ago
parent
commit
4a4380c304
  1. 26
      src/Shentun.Peis.Application.Contracts/CardRegisters/CardRegisterRechargeDto.cs
  2. 44
      src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportDto.cs
  3. 25
      src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportRequestDto.cs
  4. 24
      src/Shentun.Peis.Application.Contracts/InternalReports/GetSumCheckDoctorWorkLoadReportDto.cs
  5. 24
      src/Shentun.Peis.Application.Contracts/InternalReports/GetSumCheckDoctorWorkLoadReportRequestDto.cs
  6. 42
      src/Shentun.Peis.Application/CardRegisters/CardRegisterAppService.cs
  7. 72
      src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs

26
src/Shentun.Peis.Application.Contracts/CardRegisters/CardRegisterRechargeDto.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Shentun.Peis.CardRegisters
{
public class CardRegisterRechargeDto
{
/// <summary>
/// 会员卡ID
/// </summary>
public Guid CardRegisterId { get; set; }
/// <summary>
/// 支付方式
/// </summary>
public string PayModeId { get; set; }
/// <summary>
/// 充值金额
/// </summary>
public decimal RechargeAmount { get; set; }
}
}

44
src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportDto.cs

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace Shentun.Peis.InternalReports
{
public class GetDoctorPersonnelWorkLoadReportDto
{
/// <summary>
/// 医生名称
/// </summary>
public string DoctorName { get; set; }
/// <summary>
/// 组合项目名称
/// </summary>
public string AsbitemName { get; set; }
/// <summary>
/// 检查人数
/// </summary>
public int CheckCount { get; set; }
/// <summary>
/// 标准均价
/// </summary>
public decimal AvgStandardPrice { get; set; }
/// <summary>
/// 实收均价
/// </summary>
public decimal AvgChargePrice { get; set; }
/// <summary>
/// 标准价格总金额
/// </summary>
public decimal SumStandardPrice { get; set; }
/// <summary>
/// 实收价格总金额
/// </summary>
public decimal SumChargePrice { get; set; }
}
}

25
src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportRequestDto.cs

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.InternalReports
{
public class GetDoctorPersonnelWorkLoadReportRequestDto
{
/// <summary>
/// 医生ID 集合
/// </summary>
public List<Guid> UserIds { get; set; }
/// <summary>
/// 开始检查日期
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束检查日期
/// </summary>
public string EndDate { get; set; }
}
}

24
src/Shentun.Peis.Application.Contracts/InternalReports/GetSumCheckDoctorWorkLoadReportDto.cs

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.InternalReports
{
public class GetSumCheckDoctorWorkLoadReportDto
{
/// <summary>
/// 人员名称
/// </summary>
public string PersonnelName { get; set; }
/// <summary>
/// 登记数量
/// </summary>
public int RegisterCount { get; set; }
/// <summary>
/// 占百分比
/// </summary>
public string Percentage { get; set; }
}
}

24
src/Shentun.Peis.Application.Contracts/InternalReports/GetSumCheckDoctorWorkLoadReportRequestDto.cs

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.InternalReports
{
public class GetSumCheckDoctorWorkLoadReportRequestDto
{
/// <summary>
/// 总检医生ID 集合
/// </summary>
public List<Guid> UserIds { get; set; }
/// <summary>
/// 开始登记日期
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束登记日期
/// </summary>
public string EndDate { get; set; }
}
}

42
src/Shentun.Peis.Application/CardRegisters/CardRegisterAppService.cs

@ -22,16 +22,19 @@ namespace Shentun.Peis.CardRegisters
public class CardRegisterAppService : ApplicationService
{
private readonly IRepository<CardRegister, Guid> _cardRegisterRepository;
private readonly IRepository<CardBill, Guid> _cardBillRepository;
private readonly IRepository<IdentityUser, Guid> _userRepository;
private readonly IRepository<OrganizationUnit, Guid> _organizationUnitRepository;
public CardRegisterAppService(
IRepository<CardRegister, Guid> cardRegisterRepository,
IRepository<CardBill, Guid> cardBillRepository,
IRepository<IdentityUser, Guid> userRepository,
IRepository<OrganizationUnit, Guid> organizationUnitRepository
)
{
this._cardRegisterRepository = cardRegisterRepository;
this._cardBillRepository = cardBillRepository;
this._userRepository = userRepository;
this._organizationUnitRepository = organizationUnitRepository;
}
@ -235,5 +238,44 @@ namespace Shentun.Peis.CardRegisters
await _cardRegisterRepository.DeleteAsync(id);
}
/// <summary>
/// 会员卡充值
/// </summary>
/// <returns></returns>
[HttpPost("api/app/cardregister/cardregisterrecharge")]
public async Task CardRegisterRechargeAsync(CardRegisterRechargeDto input)
{
if (input != null)
{
var cardRegisterEnt = await _cardRegisterRepository.FindAsync(m => m.Id == input.CardRegisterId);
if (cardRegisterEnt != null)
{
cardRegisterEnt.CardBalance += input.RechargeAmount;
await _cardRegisterRepository.UpdateAsync(cardRegisterEnt);
//增加充值记录
var cardBill = new CardBill
{
BillFlag = '2',
BillMoney = input.RechargeAmount,
CardRegisterId = input.CardRegisterId,
PayModeId = input.PayModeId
};
await _cardBillRepository.InsertAsync(cardBill);
}
else
{
throw new UserFriendlyException("会员卡不存在");
}
}
else
{
throw new UserFriendlyException("参数有误");
}
}
}
}

72
src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs

@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using NUglify.Helpers;
using Shentun.Peis.Models;
using System;
using System.Collections.Generic;
@ -17,19 +18,25 @@ namespace Shentun.Peis.InternalReports
/// 内部报表
/// </summary>
[ApiExplorerSettings(GroupName = "Work")]
[Authorize]
//[Authorize]
public class InternalReportAppService : ApplicationService
{
private readonly IRepository<IdentityUser, Guid> _userRepository;
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository;
private readonly IRepository<RegisterAsbitem, Guid> _registerAsbitemRepository;
private readonly IRepository<Asbitem, Guid> _asbitemRepository;
public InternalReportAppService(
IRepository<IdentityUser, Guid> userRepository,
IRepository<PatientRegister, Guid> patientRegisterRepository
IRepository<PatientRegister, Guid> patientRegisterRepository,
IRepository<RegisterAsbitem, Guid> registerAsbitemRepository,
IRepository<Asbitem, Guid> asbitemRepository
)
{
this._userRepository = userRepository;
this._patientRegisterRepository = patientRegisterRepository;
this._registerAsbitemRepository = registerAsbitemRepository;
this._asbitemRepository = asbitemRepository;
}
/// <summary>
@ -65,5 +72,66 @@ namespace Shentun.Peis.InternalReports
return entlistdto;
}
/// <summary>
/// 医生工作量统计
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/internalreport/getdoctorpersonnelworkloadreport")]
public async Task<List<GetDoctorPersonnelWorkLoadReportDto>> GetDoctorPersonnelWorkLoadReportAsync(GetDoctorPersonnelWorkLoadReportRequestDto input)
{
var query = (from a in await _registerAsbitemRepository.GetQueryableAsync()
join b in await _userRepository.GetQueryableAsync() on a.CreatorId equals b.Id into bb
from ab in bb.DefaultIfEmpty()
join c in await _asbitemRepository.GetQueryableAsync() on a.AsbitemId equals c.Id into cc
from ac in cc.DefaultIfEmpty()
where (a.CreationTime >= Convert.ToDateTime(input.StartDate) &&
a.CreationTime < Convert.ToDateTime(input.EndDate).AddDays(1))
select new
{
a,
DoctorName = ab != null ? ab.UserName : "",
AsbitemName = ac != null ? ac.DisplayName : ""
});
if (input.UserIds.Count > 0)
{
query = query.Where(m => input.UserIds.Contains(m.a.CreatorId.Value));
}
var ssd = query.ToQueryString();
var entlistdto = query.GroupBy(g => new { g.a.AsbitemId, g.a.CreatorId, })
.Select(s => new GetDoctorPersonnelWorkLoadReportDto
{
AsbitemName = s.FirstOrDefault().AsbitemName,
CheckCount = s.Count(),
DoctorName = s.FirstOrDefault().DoctorName,
AvgChargePrice = Math.Round(s.Average(v => v.a.ChargePrice.Value), 2),
AvgStandardPrice = Math.Round(s.Average(v => v.a.StandardPrice.Value), 2),
SumChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice.Value), 2),
SumStandardPrice = Math.Round(s.Sum(v => v.a.StandardPrice.Value), 2)
}).ToList();
return entlistdto;
}
/// <summary>
/// 总检医生工作量统计
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/internalreport/getsumcheckdoctorworkloadreport")]
public async Task<List<GetSumCheckDoctorWorkLoadReportDto>> GetSumCheckDoctorWorkLoadReportAsync(GetSumCheckDoctorWorkLoadReportRequestDto input)
{
}
}
}
Loading…
Cancel
Save