167 lines
5.7 KiB
C#
167 lines
5.7 KiB
C#
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
|
//
|
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SimpleAdmin.Application.Services.Prescription.Dto
|
|
{
|
|
// 人员类型枚举
|
|
public enum PersonType
|
|
{
|
|
[Description("员工")]
|
|
Employee = 1,
|
|
[Description("家属")]
|
|
Relative = 2
|
|
}
|
|
|
|
// 处方列表DTO
|
|
public class PrescriptionDto
|
|
{
|
|
public long Id { get; set; }
|
|
public long PersonId { get; set; }
|
|
public string PersonName { get; set; }
|
|
public PersonType PersonType { get; set; }
|
|
/// <summary>
|
|
/// 关联的员工名称
|
|
/// </summary>
|
|
public string EmployeeName { get; set; }
|
|
public DateTime? VisitDate { get; set; }
|
|
public bool CanEdit { get; set; }
|
|
|
|
public DateTime CreateTime { get; set; }
|
|
|
|
public decimal TotalMedicineCost { get; set; }
|
|
public int? Type { get; set; }
|
|
|
|
}
|
|
// 辅助类:存储FIFO计算所需的入库记录信息
|
|
public class MedicinalFifoRecord
|
|
{
|
|
public long MedicinalId { get; set; }
|
|
public decimal AddWeight { get; set; }
|
|
public decimal UnitPrice { get; set; }
|
|
}
|
|
// 处方查询输入DTO
|
|
public class PrescriptionQueryInput: BasePageInput
|
|
{
|
|
public DateTime? VisitDate { get; set; }
|
|
public long? MedicinalId { get; set; }
|
|
public PersonType? PersonType { get; set; }
|
|
public long? EmployeeId { get; set; }
|
|
|
|
public string PersonName { get; set; }
|
|
}
|
|
|
|
// 处方详情DTO
|
|
public class PrescriptionDetailDto
|
|
{
|
|
public long Id { get; set; }
|
|
public PersonDetailDto Person { get; set; }
|
|
public string DiagnosisResult { get; set; }
|
|
public string UserMedicinaAdvice { get; set; }
|
|
public DateTime? VisitDate { get; set; }
|
|
public List<PrescriptionHerbDto> Herbs { get; set; }
|
|
public bool CanEdit { get; set; }
|
|
}
|
|
|
|
// 人员详情DTO
|
|
public class PersonDetailDto
|
|
{
|
|
public long? Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string Birthday { get; set; }
|
|
public decimal? Weight { get; set; }
|
|
public decimal? Height { get; set; }
|
|
public bool IsEmployee { get; set; }
|
|
public long? EmployeeId { get; set; }
|
|
public string EmployeeName { get; set; }
|
|
public long? RelationShip { get; set; }
|
|
public string RelationShipName { get; set; }
|
|
public int? Type { get; set; }
|
|
}
|
|
|
|
// 处方药材DTO
|
|
public class PrescriptionHerbDto
|
|
{
|
|
public long MedicinalId { get; set; }
|
|
public string MedicinalName { get; set; }
|
|
public decimal AmountG { get; set; }
|
|
public string Note { get; set; }
|
|
}
|
|
|
|
// DTOs(替换/合并到你的 DTO 定义处)
|
|
public class SavePrescriptionInput
|
|
{
|
|
public long? Id { get; set; }
|
|
public PersonInputDto Person { get; set; }
|
|
public string DiagnosisResult { get; set; }
|
|
public string UserMedicinaAdvice { get; set; }
|
|
public DateTime? VisitDate { get; set; }
|
|
public List<PrescriptionHerbInputDto> Herbs { get; set; }
|
|
}
|
|
|
|
// 人员输入 DTO(新增字段以支持前端发送临时员工信息)
|
|
public class PersonInputDto
|
|
{
|
|
public long? Id { get; set; } // 可能的已存在人员ID
|
|
public string TempId { get; set; } // 可选:前端临时 id(兼容旧流程)
|
|
public string Name { get; set; }
|
|
public string Birthday { get; set; }
|
|
public decimal? Weight { get; set; }
|
|
public decimal? Height { get; set; }
|
|
public bool IsEmployee { get; set; }
|
|
public long? RelationShip { get; set; } // 亲属关系 id(若为家属)
|
|
public long? EmployeeId { get; set; } // 关联员工 id(如果是家属)
|
|
/// <summary>
|
|
/// 当前关联的员工是否是前端临时新增(需要后端创建)
|
|
/// </summary>
|
|
public bool EmployeeIsTemp { get; set; }
|
|
/// <summary>
|
|
/// 当 EmployeeIsTemp 为 true 或者前端直接传了员工名字时,后端可用此字段创建员工
|
|
/// </summary>
|
|
public string EmployeeName { get; set; }
|
|
public int? Type { get; set; }
|
|
}
|
|
// 处方药材输入DTO
|
|
public class PrescriptionHerbInputDto
|
|
{
|
|
public long Id { get; set; }
|
|
public decimal AmountG { get; set; }
|
|
public string Note { get; set; }
|
|
}
|
|
|
|
// 人员DTO
|
|
public class PersonDto
|
|
{
|
|
public long Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string Birthday { get; set; }
|
|
|
|
public decimal? Height { get; set; }
|
|
|
|
public long? RelationShip { get; set; }
|
|
public int? Type { get; set; }
|
|
}
|
|
|
|
// 关系类型DTO
|
|
public class RelationTypeDto
|
|
{
|
|
public long Id { get; set; }
|
|
public string Name { get; set; }
|
|
}
|
|
|
|
}
|