Commit 1efc93a4 by ryun

Merge branch 'feature/其他绩效类别' into release/v23.2.19高县版

parents 8e73e6ff 78877750
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
using Microsoft.AspNetCore.StaticFiles; using Microsoft.AspNetCore.StaticFiles;
using Newtonsoft.Json; using Newtonsoft.Json;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.DtoModels.Request;
using Performance.DtoModels.Response; using Performance.DtoModels.Response;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.EntityModels.Entity;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Services; using Performance.Services;
using Performance.Services.ExtractExcelService; using Performance.Services.ExtractExcelService;
...@@ -1167,5 +1169,116 @@ public IActionResult DownloadGatherFile(string path) ...@@ -1167,5 +1169,116 @@ public IActionResult DownloadGatherFile(string path)
return File(memoryStream, memi, Path.GetFileName(fileInfo.Name)); return File(memoryStream, memi, Path.GetFileName(fileInfo.Name));
} }
#endregion #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 @@ ...@@ -7,7 +7,7 @@
}, },
"AppConnection": { "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=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;" //"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": { "Application": {
......
...@@ -1459,6 +1459,64 @@ ...@@ -1459,6 +1459,64 @@
<param name="path"></param> <param name="path"></param>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:Performance.Api.Controllers.ExConfigController.Extract(Performance.DtoModels.ModModuleRequest)">
<summary> <summary>
绩效数据抽取模板 绩效数据抽取模板
......
...@@ -6048,6 +6048,76 @@ ...@@ -6048,6 +6048,76 @@
</summary> </summary>
</member> </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"> <member name="P:Performance.EntityModels.Entity.per_attendance_type.IsDeduction">
<summary> <summary>
是否核减出勤 1 核减 2 不核减 是否核减出勤 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) ...@@ -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_type> per_attendance_type { get; set; }
public virtual DbSet<per_attendance_vacation> per_attendance_vacation { 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_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 Microsoft.Extensions.Logging;
using Newtonsoft.Json; using Newtonsoft.Json;
using NPOI.HSSF.UserModel; using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel; using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel; using NPOI.XSSF.UserModel;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.DtoModels.Request;
using Performance.DtoModels.Response; using Performance.DtoModels.Response;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.EntityModels.Entity;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Repository; using Performance.Repository;
using System; using Performance.Repository.Repository;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text.RegularExpressions;
namespace Performance.Services namespace Performance.Services
{ {
...@@ -34,20 +37,23 @@ public class EmployeeService : IAutoInjection ...@@ -34,20 +37,23 @@ public class EmployeeService : IAutoInjection
private readonly PerforUserroleRepository userroleRepository; private readonly PerforUserroleRepository userroleRepository;
private readonly PerforPeremployeeRepository peremployeeRepository; private readonly PerforPeremployeeRepository peremployeeRepository;
private readonly PerforUserRepository userRepository; private readonly PerforUserRepository userRepository;
private readonly PerforRoleRepository _roleRepository;
private readonly PerforPerapramounthideRepository _hideRepository; private readonly PerforPerapramounthideRepository _hideRepository;
private readonly PerforExresultgatherRepository exresultgatherRepository; private readonly PerforExresultgatherRepository exresultgatherRepository;
private readonly PerforImheaderRepository imheaderRepository;
private readonly PerforPerdeptdicRepository perdeptdicRepository; private readonly PerforPerdeptdicRepository perdeptdicRepository;
private readonly PerforExmoduleRepository exmoduleRepository; private readonly PerforExmoduleRepository exmoduleRepository;
private readonly PerforExitemRepository exitemRepository; private readonly PerforExitemRepository exitemRepository;
private readonly PerforExspecialRepository exspecialRepository; private readonly PerforExspecialRepository exspecialRepository;
private readonly PerforExresultRepository exresultRepository;
private readonly PerforCollectpermissionRepository perforcollectpermissionRepository; private readonly PerforCollectpermissionRepository perforcollectpermissionRepository;
private ILogger<EmployeeService> logger; private readonly ILogger<EmployeeService> logger;
private readonly RoleService roleService; private readonly RoleService roleService;
private readonly UserService userService; private readonly UserService userService;
private readonly DownloadService downloadService; private readonly DownloadService downloadService;
private readonly PerAprAmountTypeRepository perAprAmountTypeRepository;
private readonly PerAprAmountTypeHideRepository perAprAmountTypeHIdeRepository;
public EmployeeService( public EmployeeService(
IMapper mapper, IMapper mapper,
...@@ -64,10 +70,8 @@ public class EmployeeService : IAutoInjection ...@@ -64,10 +70,8 @@ public class EmployeeService : IAutoInjection
PerforUserroleRepository userroleRepository, PerforUserroleRepository userroleRepository,
PerforPeremployeeRepository peremployeeRepository, PerforPeremployeeRepository peremployeeRepository,
PerforUserRepository userRepository, PerforUserRepository userRepository,
PerforRoleRepository roleRepository,
PerforPerapramounthideRepository hideRepository, PerforPerapramounthideRepository hideRepository,
PerforExresultgatherRepository exresultgatherRepository, PerforExresultgatherRepository exresultgatherRepository,
PerforImheaderRepository imheaderRepository,
PerforPerdeptdicRepository perdeptdicRepository, PerforPerdeptdicRepository perdeptdicRepository,
PerforExmoduleRepository exmoduleRepository, PerforExmoduleRepository exmoduleRepository,
PerforExitemRepository exitemRepository, PerforExitemRepository exitemRepository,
...@@ -77,7 +81,10 @@ public class EmployeeService : IAutoInjection ...@@ -77,7 +81,10 @@ public class EmployeeService : IAutoInjection
ILogger<EmployeeService> logger, ILogger<EmployeeService> logger,
RoleService roleService, RoleService roleService,
UserService userService, UserService userService,
DownloadService downloadService) DownloadService downloadService,
PerAprAmountTypeRepository perAprAmountTypeRepository,
PerAprAmountTypeHideRepository perAprAmountTypeHideRepository
)
{ {
_mapper = mapper; _mapper = mapper;
_service = service; _service = service;
...@@ -93,20 +100,19 @@ public class EmployeeService : IAutoInjection ...@@ -93,20 +100,19 @@ public class EmployeeService : IAutoInjection
this.userroleRepository = userroleRepository; this.userroleRepository = userroleRepository;
this.peremployeeRepository = peremployeeRepository; this.peremployeeRepository = peremployeeRepository;
this.userRepository = userRepository; this.userRepository = userRepository;
_roleRepository = roleRepository;
_hideRepository = hideRepository; _hideRepository = hideRepository;
this.exresultgatherRepository = exresultgatherRepository; this.exresultgatherRepository = exresultgatherRepository;
this.imheaderRepository = imheaderRepository;
this.perdeptdicRepository = perdeptdicRepository; this.perdeptdicRepository = perdeptdicRepository;
this.exmoduleRepository = exmoduleRepository; this.exmoduleRepository = exmoduleRepository;
this.exitemRepository = exitemRepository; this.exitemRepository = exitemRepository;
this.exspecialRepository = exspecialRepository; this.exspecialRepository = exspecialRepository;
this.exresultRepository = exresultRepository;
this.perforcollectpermissionRepository = perforcollectpermissionRepository; this.perforcollectpermissionRepository = perforcollectpermissionRepository;
this.logger = logger; this.logger = logger;
this.roleService = roleService; this.roleService = roleService;
this.userService = userService; this.userService = userService;
this.downloadService = downloadService; this.downloadService = downloadService;
this.perAprAmountTypeRepository = perAprAmountTypeRepository;
this.perAprAmountTypeHIdeRepository = perAprAmountTypeHideRepository;
} }
#region 行政人员 #region 行政人员
...@@ -539,6 +545,10 @@ public bool InsertApr(per_apr_amount request, int userId) ...@@ -539,6 +545,10 @@ public bool InsertApr(per_apr_amount request, int userId)
if (employee == null) if (employee == null)
throw new PerformanceException("工号或姓名信息错误"); 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.TypeInDepartment = GetTypeInDepartment(userId);
request.Status = 1; request.Status = 1;
request.CreateUser = userId; request.CreateUser = userId;
...@@ -567,6 +577,10 @@ public bool UpdateApr(per_apr_amount request) ...@@ -567,6 +577,10 @@ public bool UpdateApr(per_apr_amount request)
if (employee == null) if (employee == null)
throw new PerformanceException("工号或姓名信息错误"); 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.Status = 1;
data.PersonnelNumber = request.PersonnelNumber; data.PersonnelNumber = request.PersonnelNumber;
data.DoctorName = request.DoctorName; data.DoctorName = request.DoctorName;
...@@ -697,7 +711,9 @@ public ApiResponse ImportAprEmployees(int allotid, string path, int userid) ...@@ -697,7 +711,9 @@ public ApiResponse ImportAprEmployees(int allotid, string path, int userid)
var typeIn = GetTypeInDepartment(userid); var typeIn = GetTypeInDepartment(userid);
var createtime = DateTime.Now; 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 (res.State == ResponseType.OK)
{ {
if (!entities.Any()) throw new PerformanceException("未能找到有效数据,请检查后重试!"); if (!entities.Any()) throw new PerformanceException("未能找到有效数据,请检查后重试!");
...@@ -721,7 +737,7 @@ public ApiResponse ImportAprEmployees(int allotid, string path, int userid) ...@@ -721,7 +737,7 @@ public ApiResponse ImportAprEmployees(int allotid, string path, int userid)
/// <param name="allotid"></param> /// <param name="allotid"></param>
/// <param name="path"></param> /// <param name="path"></param>
/// <param name="userid"></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>(); entities ??= new List<per_apr_amount>();
try try
...@@ -829,9 +845,21 @@ private ApiResponse OpenAndReadAprAmountExcel(int allotid, string path, List<per ...@@ -829,9 +845,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); entities.Add(entity);
} }
if (errors.Count > 0) return new ApiResponse(ResponseType.WarningTable, "验证不通过,当前操作已拒绝", errors); if (errors.Count > 0) return new ApiResponse(ResponseType.WarningTable, "验证不通过,当前操作已拒绝", errors);
} }
catch (Exception ex) catch (Exception ex)
...@@ -900,6 +928,67 @@ public List<TitleValue> GetPerforTypeDict(int allotId) ...@@ -900,6 +928,67 @@ public List<TitleValue> GetPerforTypeDict(int allotId)
return others; return others;
} }
#endregion #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, "输入参数不能填空或者小于1");
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, "输入参数不能填空或者小于1");
var tepm = perAprAmountTypeRepository.GetEntity(t => 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>
/// 根据人员工号获取人员信息 /// 根据人员工号获取人员信息
/// </summary> /// </summary>
...@@ -1060,6 +1149,10 @@ public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, in ...@@ -1060,6 +1149,10 @@ public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, in
return result.ToList(); return result.ToList();
} }
/// <summary> /// <summary>
/// 不公示其他绩效提交 /// 不公示其他绩效提交
/// </summary> /// </summary>
...@@ -1120,6 +1213,10 @@ public bool InsertAprHide(per_apr_amount_hide request, int userId) ...@@ -1120,6 +1213,10 @@ public bool InsertAprHide(per_apr_amount_hide request, int userId)
if (employee == null) if (employee == null)
throw new PerformanceException("工号在字典中不存在"); 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.TypeInDepartment = GetTypeInDepartment(userId);
request.Status = 1; request.Status = 1;
request.CreateUser = userId; request.CreateUser = userId;
...@@ -1144,6 +1241,10 @@ public bool UpdateAprHide(per_apr_amount_hide request) ...@@ -1144,6 +1241,10 @@ public bool UpdateAprHide(per_apr_amount_hide request)
if (data == null) if (data == null)
throw new PerformanceException("修改数据无效"); 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.Status = 1;
data.PersonnelNumber = request.PersonnelNumber; data.PersonnelNumber = request.PersonnelNumber;
data.DoctorName = request.DoctorName; data.DoctorName = request.DoctorName;
...@@ -1276,7 +1377,9 @@ public ApiResponse ImportAprHideEmployees(int allotid, string path, int userid) ...@@ -1276,7 +1377,9 @@ public ApiResponse ImportAprHideEmployees(int allotid, string path, int userid)
var typeIn = GetTypeInDepartment(userid); var typeIn = GetTypeInDepartment(userid);
var createtime = DateTime.Now; 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 (res.State == ResponseType.OK)
{ {
if (!entities.Any()) throw new PerformanceException("未能找到有效数据,请检查后重试!"); if (!entities.Any()) throw new PerformanceException("未能找到有效数据,请检查后重试!");
...@@ -1363,6 +1466,66 @@ public List<TitleValue> GetPerforTypeDictHide(int allotId) ...@@ -1363,6 +1466,66 @@ public List<TitleValue> GetPerforTypeDictHide(int allotId)
} }
#endregion #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, "输入参数不能填空或者小于1");
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, "输入参数不能填空或者小于1");
var tepm = perAprAmountTypeHIdeRepository.GetEntity(t => 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) public ComparisonResponse<DtoModels.Comparison<view_check_emp>> GetComparison(ComparisonPagingRequest request)
{ {
var result = new ComparisonResponse<DtoModels.Comparison<view_check_emp>>(); 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