Commit c5bdeb1a by ruyun.zhang@suvalue.com

Merge branch 'develop' of http://192.168.0.110:8880/zry/performance into develop

# Conflicts:
#	performance/Performance.DtoModels/PerExcel/ExcelEnum.cs
#	performance/Performance.EntityModels/Entity/cof_workyear.cs
#	performance/Performance.Repository/PerforCofworkyearRepository.cs
parents 8a19fa10 1e3f69cb
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
using Performance.DtoModels;
using Performance.DtoModels.AppSettings;
using Performance.Infrastructure;
using Performance.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Performance.Api.Controllers
{
[Route("api/[controller]")]
public class ConfigController : Controller
{
private ConfigService _configService;
public ConfigController(ConfigService configService)
{
_configService = configService;
}
#region director
/// <summary>
/// 获取director列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("directorlist")]
[HttpPost]
public ApiResponse<List<DirectorResponse>> GetDireList([FromBody]ApiRequest request)
{
var list = _configService.GetDireList();
return new ApiResponse<List<DirectorResponse>>(ResponseType.OK, "ok", list);
}
/// <summary>
/// 添加数据 director
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("direinsert")]
[HttpPost]
public ApiResponse<DirectorResponse> DireInsert([FromBody]DirectorRequest request)
{
var director = _configService.DireInsert(request);
return new ApiResponse<DirectorResponse>(ResponseType.OK, director);
}
/// <summary>
/// 更新数据 director
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("direupdate")]
[HttpPost]
public ApiResponse<DirectorResponse> DireUpdate([CustomizeValidator(RuleSet = "Update"), FromBody]DirectorRequest request)
{
var director = _configService.DireUpdate(request);
return new ApiResponse<DirectorResponse>(ResponseType.OK, director);
}
/// <summary>
/// 删除数据 director
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("diredelete")]
[HttpPost]
public ApiResponse DireDelete([CustomizeValidator(RuleSet = "Delete"), FromBody]DirectorRequest request)
{
if (!_configService.DireDelete(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
#endregion
#region drugprop
[Route("drugproplist")]
[HttpPost]
public ApiResponse<List<DrugpropResponse>> GetDrugList([FromBody]ApiRequest request)
{
var list = _configService.GetDrugList();
return new ApiResponse<List<DrugpropResponse>>(ResponseType.OK, "ok", list);
}
[Route("druginsert")]
[HttpPost]
public ApiResponse<DrugpropResponse> DrugInsert([FromBody]DrugpropRequest request)
{
var drugprop = _configService.DrugInsert(request);
return new ApiResponse<DrugpropResponse>(ResponseType.OK, drugprop);
}
[Route("drugupdate")]
[HttpPost]
public ApiResponse<DrugpropResponse> Update([CustomizeValidator(RuleSet = "Update"), FromBody]DrugpropRequest request)
{
var drugprop = _configService.DrugUpdate(request);
return new ApiResponse<DrugpropResponse>(ResponseType.OK, drugprop);
}
[Route("drugdelete")]
[HttpPost]
public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]DrugpropRequest request)
{
if (!_configService.DrugDelete(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
#endregion
#region income
[Route("incomelist")]
[HttpPost]
public ApiResponse<List<IncomeResponse>> GetIncomeList([FromBody]ApiRequest request)
{
var list = _configService.GetIncomeList();
return new ApiResponse<List<IncomeResponse>>(ResponseType.OK, "ok", list);
}
[Route("incomeinsert")]
[HttpPost]
public ApiResponse<IncomeResponse> Insert([FromBody]IncomeRequest request)
{
var income = _configService.IncomeInsert(request);
return new ApiResponse<IncomeResponse>(ResponseType.OK, income);
}
[Route("incomeupdate")]
[HttpPost]
public ApiResponse<IncomeResponse> Update([CustomizeValidator(RuleSet = "Update"), FromBody]IncomeRequest request)
{
var income = _configService.IncomeUpdate(request);
return new ApiResponse<IncomeResponse>(ResponseType.OK, income);
}
[Route("incomedelete")]
[HttpPost]
public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]IncomeRequest request)
{
if (!_configService.IncomeDelete(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
#endregion
#region position
[Route("positionlist")]
[HttpPost]
public ApiResponse<List<PositionResponse>> GetPositionList([FromBody]ApiRequest request)
{
var list = _configService.GetPositionList();
return new ApiResponse<List<PositionResponse>>(ResponseType.OK, "ok", list);
}
[Route("posinsert")]
[HttpPost]
public ApiResponse<PositionResponse> PositionInsert([FromBody]PositionRequest request)
{
var position = _configService.PositionInsert(request);
return new ApiResponse<PositionResponse>(ResponseType.OK, position);
}
[Route("posupdate")]
[HttpPost]
public ApiResponse<PositionResponse> PositionUpdate([CustomizeValidator(RuleSet = "Update"), FromBody]PositionRequest request)
{
var position = _configService.PositionUpdate(request);
return new ApiResponse<PositionResponse>(ResponseType.OK, position);
}
[Route("posdelete")]
[HttpPost]
public ApiResponse PositionDelete([CustomizeValidator(RuleSet = "Delete"), FromBody]PositionRequest request)
{
if (!_configService.PositionDelete(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
#endregion
#region workyear
[Route("workyearlist")]
[HttpPost]
public ApiResponse<List<WorkyearResponse>> GetWorkList([FromBody]ApiRequest request)
{
var list = _configService.GetWorkList();
return new ApiResponse<List<WorkyearResponse>>(ResponseType.OK, "ok", list);
}
[Route("workinsert")]
[HttpPost]
public ApiResponse<WorkyearResponse> WorkyearInsert([FromBody]WorkyearRequest request)
{
var workyear = _configService.WorkInsert(request);
return new ApiResponse<WorkyearResponse>(ResponseType.OK, workyear);
}
[Route("workupdate")]
[HttpPost]
public ApiResponse<WorkyearResponse> WorkyearUpdate([CustomizeValidator(RuleSet = "Update"), FromBody]WorkyearRequest request)
{
var workyear = _configService.WorkUpdate(request);
return new ApiResponse<WorkyearResponse>(ResponseType.OK, workyear);
}
[Route("workdelete")]
[HttpPost]
public ApiResponse WorkyearDelete([CustomizeValidator(RuleSet = "Delete"), FromBody]WorkyearRequest request)
{
if (!_configService.WorkDelete(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
#endregion
}
}
\ No newline at end of file
......@@ -23,6 +23,7 @@
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.0" />
<PackageReference Include="MySql.Data" Version="8.0.15" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.15" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
......
......@@ -75,5 +75,6 @@ public enum PerformanceType
/// <summary> 临床科室护士长人均绩效 (绩效标准取 护士长 平均值)</summary>
[Description("临床科室护士长人均绩效")]
ReferenceHeadNurse = 7,
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class DirectorRequest : ApiRequest
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public string TypeName { get; set; }
public string JobTitle { get; set; }
public Nullable<decimal> Value { get; set; }
public class DirectorRequestValidator : AbstractValidator<DirectorRequest>
{
public DirectorRequestValidator()
{
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
RuleSet("Delete", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
}
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class DrugpropRequest : ApiRequest
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public Nullable<decimal> MaxRange { get; set; }
public Nullable<decimal> MinRange { get; set; }
public Nullable<decimal> Value { get; set; }
public class DrugpropRequestValidator : AbstractValidator<DrugpropRequest>
{
public DrugpropRequestValidator()
{
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
RuleSet("Delete", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
}
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class IncomeRequest : ApiRequest
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public string SheetNameKeyword { get; set; }
public string UnitName { get; set; }
public Nullable<decimal> Value { get; set; }
public class IncomeRequestValidator : AbstractValidator<IncomeRequest>
{
public IncomeRequestValidator()
{
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
RuleSet("Delete", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
}
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class PositionRequest : ApiRequest
{
public int ID { get; set; }
/// <summary>
/// 绩效ID
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
/// 职位名称
/// </summary>
public string JobTitle { get; set; }
/// <summary>
/// 职位归类 1 院领导 2 行政中层 3 行政工勤 4 临床科室主任 5 临床科室副主任 6 临床科室护士长
/// </summary>
public Nullable<int> JobType { get; set; }
/// <summary>
/// 额外补偿系数
/// </summary>
public Nullable<decimal> ExtraFactor { get; set; }
/// <summary>
/// 职位类别 1 普通类别 2 基础绩效来源
/// </summary>
public Nullable<int> State { get; set; }
public class PositionRequestValidator : AbstractValidator<PositionRequest>
{
public PositionRequestValidator()
{
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
RuleSet("Delete", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
}
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class WorkyearRequest : ApiRequest
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public Nullable<decimal> MaxRange { get; set; }
public Nullable<decimal> MinRange { get; set; }
public Nullable<decimal> Value { get; set; }
public class WorkyearRequestValidator : AbstractValidator<WorkyearRequest>
{
public WorkyearRequestValidator()
{
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
RuleSet("Delete", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class DirectorResponse
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public string TypeName { get; set; }
public string JobTitle { get; set; }
public Nullable<decimal> Value { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class DrugpropResponse
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public Nullable<decimal> MaxRange { get; set; }
public Nullable<decimal> MinRange { get; set; }
public Nullable<decimal> Value { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class IncomeResponse
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public string SheetNameKeyword { get; set; }
public string UnitName { get; set; }
public Nullable<decimal> Value { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class PositionResponse
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public string JobTitle { get; set; }
public Nullable<int> JobType { get; set; }
public Nullable<decimal> ExtraFactor { get; set; }
public Nullable<int> State { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class WorkyearResponse
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public Nullable<decimal> MaxRange { get; set; }
public Nullable<decimal> MinRange { get; set; }
public Nullable<decimal> Value { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" cof_workyear.cs">
// * FileName: cof_workyear.cs
// * history : 2019-03-25 11:33:14
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
/// cof_workyear Entity Model
/// </summary>
[Table("cof_workyear")]
public class cof_workyear
{
......
......@@ -4,17 +4,20 @@
// * history : Created by T4 2019-03-25 11:32:42
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
using System;
namespace Performance.Repository
{
/// <summary>
/// cof_workyear Repository
/// </summary>
public class PerforCofworkyearRepository : PerforRepository<cof_workyear>
{
public PerforCofworkyearRepository(PerformanceDbContext context) : base(context)
{
}
}
......
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