Commit 0e8dd71e by ryun

Merge branch 'feature/其他绩效类别' into develop

parents d84c2e13 9ab1441b
......@@ -5,8 +5,10 @@
using Microsoft.AspNetCore.StaticFiles;
using Newtonsoft.Json;
using Performance.DtoModels;
using Performance.DtoModels.Request;
using Performance.DtoModels.Response;
using Performance.EntityModels;
using Performance.EntityModels.Entity;
using Performance.Infrastructure;
using Performance.Services;
using Performance.Services.ExtractExcelService;
......@@ -1167,5 +1169,116 @@ public IActionResult DownloadGatherFile(string path)
return File(memoryStream, memi, Path.GetFileName(fileInfo.Name));
}
#endregion
#region 医院其他绩效类型
/// <summary>
/// 医院其他绩效类型清单
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[Route("apr/type/list/{allotId}")]
[HttpPost]
public ApiResponse<List<per_apr_amount_type>> GetAprTypeList([FromRoute] int allotId)
{
return employeeService.GetAprTypeList(allotId);
}
/// <summary>
/// 医院其他绩效列表清单添加
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("apr/type/insert")]
[HttpPost]
public ApiResponse<AprTypeRequest> InsertAprType([FromBody] AprTypeRequest request)
{
var createUser = claim.GetUserId();
return employeeService.InsertAprType(createUser, request);
}
/// <summary>
/// 医院其他绩效列表清单修改
/// </summary>
/// <param name="typeId"></param>
/// <param name="request"></param>
/// <returns></returns>
[Route("apr/type/update")]
[HttpPost]
public ApiResponse<AprTypeRequest> UpdateAprType([FromQuery] int typeId, [FromBody] AprTypeRequest request)
{
return employeeService.UpdateAprType(typeId, request);
}
/// <summary>
/// 医院其他绩效列表清单删除
/// </summary>
/// <param name="typeId"></param>
/// <returns></returns>
[Route("apr/type/delete")]
[HttpPost]
public ApiResponse DeleteAprType([FromQuery] int typeId)
{
return employeeService.DeleteAprType(typeId);
}
#endregion
#region 不公示医院其他绩效类型
/// <summary>
/// 不公示医院其他绩效类型清单
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[Route("apr/hide/type/list/{allotId}")]
[HttpPost]
public ApiResponse<List<per_apr_amount_hide_type>> GetAprTypeListHide([FromRoute] int allotId)
{
return employeeService.GetAprTypeListHide(allotId);
}
/// <summary>
/// 不公示医院其他绩效列表清单添加
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("apr/hide/type/insert")]
[HttpPost]
public ApiResponse<AprTypeRequest> InsertAprTypeHide([FromBody] AprTypeRequest request)
{
var createUser = claim.GetUserId();
return employeeService.InsertAprTypeHide(createUser, request);
}
/// <summary>
/// 不公示医院其他绩效列表清单修改
/// </summary>
/// <param name="typeId"></param>
/// <param name="request"></param>
/// <returns></returns>
[Route("apr/hide/type/update")]
[HttpPost]
public ApiResponse<AprTypeRequest> UpdateAprTypehide([FromQuery] int typeId, [FromBody] AprTypeRequest request)
{
return employeeService.UpdateAprTypeHide(typeId, request);
}
/// <summary>
/// 不公示医院其他绩效列表清单删除
/// </summary>
/// <param name="typeId"></param>
/// <returns></returns>
[Route("apr/hide/type/delete")]
[HttpPost]
public ApiResponse DeleteAprTypeHide([FromQuery] int typeId)
{
return employeeService.DeleteAprTypeHide(typeId);
}
#endregion
}
}
......@@ -7,7 +7,7 @@
},
"AppConnection": {
//"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"PerformanceConnectionString": "server=192.168.18.166;database=db_test_dingxieryuan;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
"PerformanceConnectionString": "server=192.168.18.166;database=db_test_beiliu;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
//"PerformanceConnectionString": "server=116.62.245.55;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
},
"Application": {
......
......@@ -1459,6 +1459,64 @@
<param name="path"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.GetAprTypeList(System.Int32)">
<summary>
医院其他绩效类型清单
</summary>
<param name="allotId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.InsertAprType(Performance.DtoModels.Request.AprTypeRequest)">
<summary>
医院其他绩效列表清单添加
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.UpdateAprType(System.Int32,Performance.DtoModels.Request.AprTypeRequest)">
<summary>
医院其他绩效列表清单修改
</summary>
<param name="typeId"></param>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.DeleteAprType(System.Int32)">
<summary>
医院其他绩效列表清单删除
</summary>
<param name="typeId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.GetAprTypeListHide(System.Int32)">
<summary>
不公示医院其他绩效类型清单
</summary>
<param name="allotId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.InsertAprTypeHide(Performance.DtoModels.Request.AprTypeRequest)">
<summary>
不公示医院其他绩效列表清单添加
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.UpdateAprTypehide(System.Int32,Performance.DtoModels.Request.AprTypeRequest)">
<summary>
不公示医院其他绩效列表清单修改
</summary>
<param name="typeId"></param>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.DeleteAprTypeHide(System.Int32)">
<summary>
不公示医院其他绩效列表清单删除
</summary>
<param name="typeId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ExConfigController.Extract(Performance.DtoModels.ModModuleRequest)">
<summary>
绩效数据抽取模板
......
......@@ -6048,6 +6048,76 @@
</summary>
</member>
<member name="T:Performance.EntityModels.Entity.per_apr_amount_hide_type">
<summary>
不公示医院其他绩效类型
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_hide_type.Id">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_hide_type.AllotId">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_hide_type.PerforType">
<summary>
费用类型
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_hide_type.CreateDate">
<summary>
创建时间
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_hide_type.CreateUser">
<summary>
创建人
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_hide_type.UpdateTime">
<summary>
修改时间
</summary>
</member>
<member name="T:Performance.EntityModels.Entity.per_apr_amount_type">
<summary>
医院其他绩效类型
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_type.Id">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_type.AllotId">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_type.PerforType">
<summary>
费用类型
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_type.CreateDate">
<summary>
创建时间
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_type.CreateUser">
<summary>
创建人
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_apr_amount_type.UpdateTime">
<summary>
修改时间
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_attendance_type.IsDeduction">
<summary>
是否核减出勤 1 核减 2 不核减
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Performance.DtoModels.Request
{
public class AprTypeRequest
{
public int AllotId { get; set; }
public string PerforType { get; set; }
}
}
......@@ -257,6 +257,9 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public virtual DbSet<per_attendance_type> per_attendance_type { get; set; }
public virtual DbSet<per_attendance_vacation> per_attendance_vacation { get; set; }
public virtual DbSet<per_allot_action> per_allot_action { get; set; }
public virtual DbSet<per_apr_amount_type> per_apr_amount_type { get; set; }
public virtual DbSet<per_apr_amount_hide_type> per_apr_amount_hide_type { get; set; }
}
}
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels.Entity
{
/// <summary>
/// 不公示医院其他绩效类型
/// </summary>
[Table("per_apr_amount_hide_type")]
public class per_apr_amount_hide_type
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public int AllotId { get; set; }
/// <summary>
/// 费用类型
/// </summary>
public string PerforType { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateUser { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels.Entity
{
/// <summary>
/// 医院其他绩效类型
/// </summary>
[Table("per_apr_amount_type")]
public class per_apr_amount_type
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public int AllotId { get; set; }
/// <summary>
/// 费用类型
/// </summary>
public string PerforType { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateUser { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}
using Performance.EntityModels;
using Performance.EntityModels.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Performance.Repository.Repository
{
public partial class PerAprAmountTypeHideRepository : PerforRepository<per_apr_amount_hide_type>
{
/// <summary>
/// per_attendance_type Repository
/// </summary>
public PerAprAmountTypeHideRepository(PerformanceDbContext context) : base(context)
{
}
}
}
using Performance.EntityModels;
using Performance.EntityModels.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Performance.Repository.Repository
{
public partial class PerAprAmountTypeRepository : PerforRepository<per_apr_amount_type>
{
/// <summary>
/// per_attendance_type Repository
/// </summary>
public PerAprAmountTypeRepository(PerformanceDbContext context) : base(context)
{
}
}
}
using AutoMapper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text.RegularExpressions;
using AutoMapper;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using Performance.DtoModels;
using Performance.DtoModels.Request;
using Performance.DtoModels.Response;
using Performance.EntityModels;
using Performance.EntityModels.Entity;
using Performance.Infrastructure;
using Performance.Repository;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text.RegularExpressions;
using Performance.Repository.Repository;
namespace Performance.Services
{
......@@ -34,20 +37,23 @@ public class EmployeeService : IAutoInjection
private readonly PerforUserroleRepository userroleRepository;
private readonly PerforPeremployeeRepository peremployeeRepository;
private readonly PerforUserRepository userRepository;
private readonly PerforRoleRepository _roleRepository;
private readonly PerforPerapramounthideRepository _hideRepository;
private readonly PerforExresultgatherRepository exresultgatherRepository;
private readonly PerforImheaderRepository imheaderRepository;
private readonly PerforPerdeptdicRepository perdeptdicRepository;
private readonly PerforExmoduleRepository exmoduleRepository;
private readonly PerforExitemRepository exitemRepository;
private readonly PerforExspecialRepository exspecialRepository;
private readonly PerforExresultRepository exresultRepository;
private readonly PerforCollectpermissionRepository perforcollectpermissionRepository;
private ILogger<EmployeeService> logger;
private readonly ILogger<EmployeeService> logger;
private readonly RoleService roleService;
private readonly UserService userService;
private readonly DownloadService downloadService;
private readonly PerAprAmountTypeRepository perAprAmountTypeRepository;
private readonly PerAprAmountTypeHideRepository perAprAmountTypeHIdeRepository;
public EmployeeService(
IMapper mapper,
......@@ -64,10 +70,8 @@ public class EmployeeService : IAutoInjection
PerforUserroleRepository userroleRepository,
PerforPeremployeeRepository peremployeeRepository,
PerforUserRepository userRepository,
PerforRoleRepository roleRepository,
PerforPerapramounthideRepository hideRepository,
PerforExresultgatherRepository exresultgatherRepository,
PerforImheaderRepository imheaderRepository,
PerforPerdeptdicRepository perdeptdicRepository,
PerforExmoduleRepository exmoduleRepository,
PerforExitemRepository exitemRepository,
......@@ -77,7 +81,10 @@ public class EmployeeService : IAutoInjection
ILogger<EmployeeService> logger,
RoleService roleService,
UserService userService,
DownloadService downloadService)
DownloadService downloadService,
PerAprAmountTypeRepository perAprAmountTypeRepository,
PerAprAmountTypeHideRepository perAprAmountTypeHideRepository
)
{
_mapper = mapper;
_service = service;
......@@ -93,20 +100,19 @@ public class EmployeeService : IAutoInjection
this.userroleRepository = userroleRepository;
this.peremployeeRepository = peremployeeRepository;
this.userRepository = userRepository;
_roleRepository = roleRepository;
_hideRepository = hideRepository;
this.exresultgatherRepository = exresultgatherRepository;
this.imheaderRepository = imheaderRepository;
this.perdeptdicRepository = perdeptdicRepository;
this.exmoduleRepository = exmoduleRepository;
this.exitemRepository = exitemRepository;
this.exspecialRepository = exspecialRepository;
this.exresultRepository = exresultRepository;
this.perforcollectpermissionRepository = perforcollectpermissionRepository;
this.logger = logger;
this.roleService = roleService;
this.userService = userService;
this.downloadService = downloadService;
this.perAprAmountTypeRepository = perAprAmountTypeRepository;
this.perAprAmountTypeHIdeRepository = perAprAmountTypeHideRepository;
}
#region 行政人员
......@@ -538,6 +544,10 @@ public bool InsertApr(per_apr_amount request, int userId)
if (employee == null)
throw new PerformanceException("工号或姓名信息错误");
var types = perAprAmountTypeRepository.GetEntities(t => t.AllotId == request.AllotId);
if (types?.Any() == true && !types.Any(w => w.PerforType == request.PerforType))
throw new PerformanceException("“绩效类型”错误,请按规定类型填入");
request.TypeInDepartment = GetTypeInDepartment(userId);
request.Status = 1;
request.CreateUser = userId;
......@@ -566,6 +576,10 @@ public bool UpdateApr(per_apr_amount request)
if (employee == null)
throw new PerformanceException("工号或姓名信息错误");
var types = perAprAmountTypeRepository.GetEntities(t => t.AllotId == request.AllotId);
if (types?.Any() == true && !types.Any(w => w.PerforType == request.PerforType))
throw new PerformanceException("“绩效类型”错误,请按规定类型填入");
data.Status = 1;
data.PersonnelNumber = request.PersonnelNumber;
data.DoctorName = request.DoctorName;
......@@ -696,7 +710,9 @@ public ApiResponse ImportAprEmployees(int allotid, string path, int userid)
var typeIn = GetTypeInDepartment(userid);
var createtime = DateTime.Now;
var res = OpenAndReadAprAmountExcel(allotid, path, entities);
var types = perAprAmountTypeRepository.GetEntities(t => t.AllotId == allotid) ?? new List<per_apr_amount_type>();
var res = OpenAndReadAprAmountExcel(allotid, path, types.Select(w => w.PerforType).ToList(), entities);
if (res.State == ResponseType.OK)
{
if (!entities.Any()) throw new PerformanceException("未能找到有效数据,请检查后重试!");
......@@ -720,7 +736,7 @@ public ApiResponse ImportAprEmployees(int allotid, string path, int userid)
/// <param name="allotid"></param>
/// <param name="path"></param>
/// <param name="userid"></param>
private ApiResponse OpenAndReadAprAmountExcel(int allotid, string path, List<per_apr_amount> entities)
private ApiResponse OpenAndReadAprAmountExcel(int allotid, string path, List<string> types, List<per_apr_amount> entities)
{
entities ??= new List<per_apr_amount>();
try
......@@ -828,9 +844,21 @@ private ApiResponse OpenAndReadAprAmountExcel(int allotid, string path, List<per
{ "错误原因", "“姓名”与人员字典不一致,请修改或删除" },
});
}
else if (types.Any() && !types.Any(type => type == entity.PerforType))
{
errors.Add(new Dictionary<string, string>
{
{ "行号", $"第{rowindex}行" },
{ "人员工号", entity.PersonnelNumber },
{ "姓名", entity.DoctorName },
{ "来源", "上传文件" },
{ "错误原因", "“绩效类型”错误,请按规定类型填入" },
});
}
entities.Add(entity);
}
if (errors.Count > 0) return new ApiResponse(ResponseType.WarningTable, "验证不通过,当前操作已拒绝", errors);
}
catch (Exception ex)
......@@ -899,6 +927,67 @@ public List<TitleValue> GetPerforTypeDict(int allotId)
return others;
}
#endregion
#region 医院其他绩效类型
public ApiResponse<List<per_apr_amount_type>> GetAprTypeList(int allotId)
{
var result = perAprAmountTypeRepository.GetEntities(t => t.AllotId == allotId).ToList();
if (result != null)
return new ApiResponse<List<per_apr_amount_type>>(ResponseType.OK, result);
else return new ApiResponse<List<per_apr_amount_type>>(ResponseType.NotFound);
}
public ApiResponse<AprTypeRequest> InsertAprType(int createUser, AprTypeRequest request)
{
if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能为空!");
var tepm = perAprAmountTypeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType);
if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
per_apr_amount_type per_Apr_Amount_Type = new per_apr_amount_type()
{
AllotId = request.AllotId,
PerforType = request.PerforType.Trim(),
CreateDate = DateTime.Now,
CreateUser = createUser,
};
if (perAprAmountTypeRepository.Add(per_Apr_Amount_Type)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "添加成功");
else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "添加失败");
}
public ApiResponse<AprTypeRequest> UpdateAprType(int typeId, AprTypeRequest request)
{
if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能为空!");
var tepm = perAprAmountTypeRepository.GetEntity(t =>t.Id!=t.Id && t.AllotId == request.AllotId && t.PerforType == request.PerforType);
if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
var res = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId);
if (res == null)
return new ApiResponse<AprTypeRequest>(ResponseType.NotFound, "未查询到内容");
var use = perapramountRepository.GetEntity(t => t.AllotId == res.AllotId && t.PerforType == res.PerforType);
if (use != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "该类型正在使用!");
res.UpdateTime = DateTime.Now;
res.AllotId = request.AllotId;
res.PerforType = request.PerforType.Trim();
if (perAprAmountTypeRepository.Update(res)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "修改成功");
else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "修改失败");
}
public ApiResponse DeleteAprType(int typeId)
{
var any = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId);
if (any == null)
return new ApiResponse(ResponseType.NotFound, "没有该数据");
var use = perapramountRepository.GetEntity(t => t.AllotId == any.AllotId && t.PerforType == any.PerforType);
if (use != null)
return new ApiResponse(ResponseType.ParameterError, "该类型正在使用!");
if (perAprAmountTypeRepository.DeleteFromQuery(t => t.Id == typeId) > 0)
return new ApiResponse(ResponseType.OK, "删除成功");
else return new ApiResponse(ResponseType.Fail, "删除失败");
}
#endregion
/// <summary>
/// 根据人员工号获取人员信息
/// </summary>
......@@ -1059,6 +1148,10 @@ public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, in
return result.ToList();
}
/// <summary>
/// 不公示其他绩效提交
/// </summary>
......@@ -1118,6 +1211,10 @@ public bool InsertAprHide(per_apr_amount_hide request, int userId)
if (employee == null)
throw new PerformanceException("工号在字典中不存在");
var types = perAprAmountTypeHIdeRepository.GetEntities(t => t.AllotId == request.AllotId);
if (types?.Any() == true && !types.Any(w => w.PerforType == request.PerforType))
throw new PerformanceException("“绩效类型”错误,请按规定类型填入");
request.TypeInDepartment = GetTypeInDepartment(userId);
request.Status = 1;
request.CreateUser = userId;
......@@ -1142,6 +1239,10 @@ public bool UpdateAprHide(per_apr_amount_hide request)
if (data == null)
throw new PerformanceException("修改数据无效");
var types = perAprAmountTypeHIdeRepository.GetEntities(t => t.AllotId == request.AllotId);
if (types?.Any() == true && !types.Any(w => w.PerforType == request.PerforType))
throw new PerformanceException("“绩效类型”错误,请按规定类型填入");
data.Status = 1;
data.PersonnelNumber = request.PersonnelNumber;
data.DoctorName = request.DoctorName;
......@@ -1274,7 +1375,9 @@ public ApiResponse ImportAprHideEmployees(int allotid, string path, int userid)
var typeIn = GetTypeInDepartment(userid);
var createtime = DateTime.Now;
var res = OpenAndReadAprAmountExcel(allotid, path, entities);
var types = perAprAmountTypeHIdeRepository.GetEntities(t => t.AllotId == allotid) ?? new List<per_apr_amount_hide_type>();
var res = OpenAndReadAprAmountExcel(allotid, path, types.Select(w => w.PerforType).ToList(), entities);
if (res.State == ResponseType.OK)
{
if (!entities.Any()) throw new PerformanceException("未能找到有效数据,请检查后重试!");
......@@ -1361,6 +1464,66 @@ public List<TitleValue> GetPerforTypeDictHide(int allotId)
}
#endregion
#region 不公示医院其他绩效类型
public ApiResponse<List<per_apr_amount_hide_type>> GetAprTypeListHide(int allotId)
{
var result = perAprAmountTypeHIdeRepository.GetEntities(t => t.AllotId == allotId).ToList();
if (result != null)
return new ApiResponse<List<per_apr_amount_hide_type>>(ResponseType.OK, result);
else return new ApiResponse<List<per_apr_amount_hide_type>>(ResponseType.NotFound);
}
public ApiResponse<AprTypeRequest> InsertAprTypeHide(int createUser, AprTypeRequest request)
{
if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能为空!");
var tepm = perAprAmountTypeHIdeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType);
if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
per_apr_amount_hide_type per_apr_amount_hide_type = new per_apr_amount_hide_type()
{
AllotId = request.AllotId,
PerforType = request.PerforType.Trim(),
CreateDate = DateTime.Now,
CreateUser = createUser,
};
if (perAprAmountTypeHIdeRepository.Add(per_apr_amount_hide_type)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "添加成功");
else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "添加失败");
}
public ApiResponse<AprTypeRequest> UpdateAprTypeHide(int typeId, AprTypeRequest request)
{
if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能为空!");
var tepm = perAprAmountTypeHIdeRepository.GetEntity(t => t.Id != t.Id && t.AllotId == request.AllotId && t.PerforType == request.PerforType);
if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
var res = perAprAmountTypeHIdeRepository.GetEntity(t => t.Id == typeId);
if (res == null)
return new ApiResponse<AprTypeRequest>(ResponseType.NotFound, "未查询到内容");
var use = _hideRepository.GetEntity(t => t.AllotId == res.AllotId && t.PerforType == res.PerforType);
if (use != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "该类型正在使用!");
res.UpdateTime = DateTime.Now;
res.AllotId = request.AllotId;
res.PerforType = request.PerforType.Trim();
if (perAprAmountTypeHIdeRepository.Update(res)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "修改成功");
else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "修改失败");
}
public ApiResponse DeleteAprTypeHide(int typeId)
{
var any = perAprAmountTypeHIdeRepository.GetEntity(t => t.Id == typeId);
if (any == null)
return new ApiResponse(ResponseType.NotFound, "没有该数据");
var use = _hideRepository.GetEntity(t => t.AllotId == any.AllotId && t.PerforType == any.PerforType);
if (use != null)
return new ApiResponse(ResponseType.ParameterError, "该类型正在使用!");
if (perAprAmountTypeHIdeRepository.DeleteFromQuery(t => t.Id == typeId) > 0)
return new ApiResponse(ResponseType.OK, "删除成功");
else return new ApiResponse(ResponseType.Fail, "删除失败");
}
#endregion
public ComparisonResponse<DtoModels.Comparison<view_check_emp>> GetComparison(ComparisonPagingRequest request)
{
var result = new ComparisonResponse<DtoModels.Comparison<view_check_emp>>();
......
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