fix 档案表代码调整,代码位置
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
using Dlhis.Basic.MealUser.Response;
|
|
||||||
using Dlhis.Entity.Basic.Entity;
|
|
||||||
using Dlhis.Entity.Basic.Enums;
|
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.MealUser.Request
|
|
||||||
{
|
|
||||||
public class GainfoAddSaveRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
public GainfoPageResponse gainfoPageResponse { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,175 +0,0 @@
|
|||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.MealUser.Response
|
|
||||||
{
|
|
||||||
public class GainfoPageResponse
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 档案号
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "档案号")]
|
|
||||||
public string Guestno { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// SAP内部编号
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "SAP内部编号")]
|
|
||||||
public string Ano { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 人员类型
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "人员类型")]
|
|
||||||
public string Class { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 姓名
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "姓名")]
|
|
||||||
public string Gname { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 工号
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "工号")]
|
|
||||||
public string Ename { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 国家代码
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "国家代码")]
|
|
||||||
public string Country { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 证件类型代码
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "证件类型代码")]
|
|
||||||
public string Idcls { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 身份证号
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "身份证号")]
|
|
||||||
public string IdNO { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 身份证籍贯区域代码
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "身份证籍贯区域代码")]
|
|
||||||
public string Native { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 性别
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "性别")]
|
|
||||||
public string Sex { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 生日
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "生日")]
|
|
||||||
public DateTime Birthday { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 身份证地址
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "身份证地址")]
|
|
||||||
public string Address { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 已婚/未婚
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "已婚/未婚")]
|
|
||||||
public string Postcode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 部门编码
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "部门编码")]
|
|
||||||
public string Appellation { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 民族代码
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "民族代码")]
|
|
||||||
public string Nation { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 手机号码
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "手机号码")]
|
|
||||||
public string Phone { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 联系电话
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "联系电话")]
|
|
||||||
public string Mobile { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 学历
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "学历")]
|
|
||||||
public string Degree { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 岗位
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "岗位")]
|
|
||||||
public string Web { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "备注")]
|
|
||||||
public string Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 操作账号
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "操作账号")]
|
|
||||||
public string Log_id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 操作班次
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "操作班次")]
|
|
||||||
public string Log_shift { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 操作时间
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "操作时间")]
|
|
||||||
public DateTime Log_date { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 操作IP
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "操作IP")]
|
|
||||||
public string Log_ip { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否在职 F 在职 T离职
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "是否在职 F 在职 T离职")]
|
|
||||||
public string Isowner { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "创建时间")]
|
|
||||||
public DateTime Createdate { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 外文名字
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "外文名字")]
|
|
||||||
public string Gname_en { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 卡号
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "卡号")]
|
|
||||||
public string CarNo { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
using Dlhis.Basic.MealUser.Request;
|
|
||||||
using Dlhis.Basic.MealUser.Response;
|
|
||||||
using Dlhis.Entity.Basic.Entity;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.MealUser.Services
|
|
||||||
{
|
|
||||||
public interface IGainfoService : IScopeDependency
|
|
||||||
{
|
|
||||||
Task SaveAsync(GainfoAddSaveRequest request);
|
|
||||||
Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request);
|
|
||||||
Task UpdateAsync(GainfoAddSaveRequest request);
|
|
||||||
Task DimissionAsync(GainfoDImissionRequest request);
|
|
||||||
Task OnboardingAsync(GainfoDImissionRequest request);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
using Dlhis.Basic.BusinessPlace.Response;
|
|
||||||
using Dlhis.Basic.MealUser.Request;
|
|
||||||
using Dlhis.Basic.MealUser.Response;
|
|
||||||
using Dlhis.Basic.Organization.Services;
|
|
||||||
using Dlhis.Entity.Basic.Entity;
|
|
||||||
using Dlhis.Entity.Basic.Enums;
|
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.SqlSugar.Attributes;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.MealUser.Services.Implements
|
|
||||||
{
|
|
||||||
public class GainfoService : IGainfoService
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly IGainfoStore _gainfoStore;
|
|
||||||
|
|
||||||
public GainfoService(IGainfoStore gainfoStore)
|
|
||||||
{
|
|
||||||
_gainfoStore = gainfoStore;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
///保存档案号
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task SaveAsync(GainfoAddSaveRequest request)
|
|
||||||
{
|
|
||||||
await CheckGainfoGuestnoAsync(request);//档案号是否重复
|
|
||||||
|
|
||||||
var gainfos = new List<GainfoEntity>();
|
|
||||||
GainfoEntity aginfoEntity = request.gainfoPageResponse.Adapt<GainfoEntity>();
|
|
||||||
aginfoEntity.Guestno = "F" + Guid.NewGuid().ToString();
|
|
||||||
gainfos.Add(aginfoEntity);
|
|
||||||
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Working, gainfos);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 档案分页
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public Task<Pagination<GainfoPageResponse>> GetPageAsync( GainfoPageRequest request)
|
|
||||||
{
|
|
||||||
var page = _gainfoStore.Queryable(request.gainfoStatus)
|
|
||||||
.Select<GainfoPageResponse>()
|
|
||||||
.ToPageListAsync(request);
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
///修改档案号
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task UpdateAsync(GainfoAddSaveRequest request)
|
|
||||||
{
|
|
||||||
var gainfos = new List<GainfoEntity>();
|
|
||||||
GainfoEntity aginfoEntity = request.gainfoPageResponse.Adapt<GainfoEntity>();
|
|
||||||
gainfos.Add(aginfoEntity);
|
|
||||||
await _gainfoStore.UpdateAsync(GainfoStatusEnumType.Working, gainfos);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 正式转离职
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
|
||||||
[Transactional]
|
|
||||||
public async Task DimissionAsync(GainfoDImissionRequest request)
|
|
||||||
{
|
|
||||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
|
|
||||||
.Where(x => x.Guestno == request.UserId)
|
|
||||||
.FirstAsync();
|
|
||||||
gainfo.ThrowIfNull($"该档案不存在");
|
|
||||||
//添加到离职表
|
|
||||||
var gainfos = new List<GainfoEntity>();
|
|
||||||
gainfos.Add(gainfo);
|
|
||||||
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Leave, gainfos);
|
|
||||||
//删除原数据
|
|
||||||
await _gainfoStore.DeleteAsync(GainfoStatusEnumType.Working, gainfos);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 临时转正式
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
|
||||||
[Transactional]
|
|
||||||
public async Task OnboardingAsync(GainfoDImissionRequest request)
|
|
||||||
{
|
|
||||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.External)
|
|
||||||
.Where(x => x.Guestno == request.UserId)
|
|
||||||
.FirstAsync();
|
|
||||||
gainfo.ThrowIfNull($"该档案不存在");
|
|
||||||
//添加到正式表
|
|
||||||
var gainfos = new List<GainfoEntity>();
|
|
||||||
gainfos.Add(gainfo);
|
|
||||||
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Working, gainfos);
|
|
||||||
//保留原数据
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------help methods ------------------------------------------------
|
|
||||||
/// <summary>
|
|
||||||
/// 检查档案号是否重复
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private async Task CheckGainfoGuestnoAsync(GainfoAddSaveRequest request)
|
|
||||||
{
|
|
||||||
|
|
||||||
var checkGainfoGuestno = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
|
|
||||||
.Where(x => x.Guestno == request.gainfoPageResponse.Guestno)
|
|
||||||
.AnyAsync();
|
|
||||||
checkGainfoGuestno.ThrowIfTrue($"档案号[{request.gainfoPageResponse.Guestno}]已存在");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
using Dlhis.Basic.MealUser.Request;
|
|
||||||
using Dlhis.Basic.MealUser.Response;
|
|
||||||
using Dlhis.Basic.MealUser.Services;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.MealUser.Controllers;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 档案表
|
|
||||||
/// </summary>
|
|
||||||
[Authorize]
|
|
||||||
[Route("api/[controller]")]
|
|
||||||
[ApiController]
|
|
||||||
public class GainfoController : ControllerBase
|
|
||||||
{
|
|
||||||
private readonly IGainfoService _gainfoService;
|
|
||||||
|
|
||||||
public GainfoController(IGainfoService gainfoService)
|
|
||||||
{
|
|
||||||
_gainfoService = gainfoService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 档案表保存
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("save")]
|
|
||||||
public async Task SaveAsync(GainfoAddSaveRequest request)
|
|
||||||
{
|
|
||||||
await _gainfoService.SaveAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 档案分页
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("page")]
|
|
||||||
public async Task<Pagination<GainfoPageResponse>> GetPageAsync([FromQuery] GainfoPageRequest request)
|
|
||||||
{
|
|
||||||
//var enums = await _enumSettingApi.GetEnums();
|
|
||||||
return await _gainfoService.GetPageAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 档案表修改
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPut("update")]
|
|
||||||
public async Task UpdateAsync(GainfoAddSaveRequest request)
|
|
||||||
{
|
|
||||||
await _gainfoService.UpdateAsync(request);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 离职
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("dimission")]
|
|
||||||
public async Task DimissionAsync(GainfoDImissionRequest request)
|
|
||||||
{
|
|
||||||
await _gainfoService.DimissionAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 入职
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("Onboarding")]
|
|
||||||
public async Task OnboardingAsync(GainfoDImissionRequest request)
|
|
||||||
{
|
|
||||||
await _gainfoService.OnboardingAsync(request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,15 +1,81 @@
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Dlhis.Basic.Organization.Request;
|
||||||
|
using Dlhis.Basic.Organization.Response;
|
||||||
|
using Dlhis.Basic.Organization.Services;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Controllers;
|
namespace Dlhis.Basic.MealUser.Controllers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 档案
|
/// 档案表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class GainfosController : ControllerBase
|
public class GainfosController : ControllerBase
|
||||||
{
|
{
|
||||||
|
private readonly IGainfoService _gainfoService;
|
||||||
|
|
||||||
|
public GainfosController(IGainfoService gainfoService)
|
||||||
|
{
|
||||||
|
_gainfoService = gainfoService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 档案表保存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("save")]
|
||||||
|
public async Task SaveAsync(GainfoSaveRequest request)
|
||||||
|
{
|
||||||
|
await _gainfoService.SaveAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 档案分页
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<Pagination<GainfoPageResponse>> GetPageAsync([FromQuery] GainfoPageRequest request)
|
||||||
|
{
|
||||||
|
//var enums = await _enumSettingApi.GetEnums();
|
||||||
|
return await _gainfoService.GetPageAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 档案表修改
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPut("update")]
|
||||||
|
public async Task UpdateAsync(GainfoSaveRequest request)
|
||||||
|
{
|
||||||
|
await _gainfoService.UpdateAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 离职
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("dimission")]
|
||||||
|
public async Task DimissionAsync(GainfoDImissionRequest request)
|
||||||
|
{
|
||||||
|
await _gainfoService.DimissionAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 入职
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("onboarding")]
|
||||||
|
public async Task OnboardingAsync(GainfoDImissionRequest request)
|
||||||
|
{
|
||||||
|
await _gainfoService.OnboardingAsync(request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Dlhis.Basic.MealUser.Request
|
namespace Dlhis.Basic.Organization.Request
|
||||||
{
|
{
|
||||||
public class GainfoDImissionRequest
|
public class GainfoDImissionRequest
|
||||||
{
|
{
|
||||||
@@ -3,7 +3,7 @@ using Dlhis.Entity.Canteen.Enums;
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Dlhis.Basic.MealUser.Request
|
namespace Dlhis.Basic.Organization.Request
|
||||||
{
|
{
|
||||||
public class GainfoPageRequest : PageDto
|
public class GainfoPageRequest : PageDto
|
||||||
{
|
{
|
||||||
158
Src/Dlhis.Basic/Organization/Request/GainfoSaveRequest.cs
Normal file
158
Src/Dlhis.Basic/Organization/Request/GainfoSaveRequest.cs
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Dlhis.Entity.Basic.Enums;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Organization.Request;
|
||||||
|
|
||||||
|
public class GainfoSaveRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
public long? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询类型
|
||||||
|
/// </summary>
|
||||||
|
[EnumDataType(typeof(GainfoStatusEnumType))]
|
||||||
|
public GainfoStatusEnumType? GainfoStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SAP内部编号
|
||||||
|
/// </summary>
|
||||||
|
public string Ano { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 人员类型
|
||||||
|
/// </summary>
|
||||||
|
public string Class { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 姓名
|
||||||
|
/// </summary>
|
||||||
|
public string Gname { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工号
|
||||||
|
/// </summary>
|
||||||
|
public string Ename { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 国家代码
|
||||||
|
/// </summary>
|
||||||
|
public string Country { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 证件类型代码
|
||||||
|
/// </summary>
|
||||||
|
public string Idcls { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 身份证号
|
||||||
|
/// </summary>
|
||||||
|
public string IdNO { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 身份证籍贯区域代码
|
||||||
|
/// </summary>
|
||||||
|
public string Native { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 性别
|
||||||
|
/// </summary>
|
||||||
|
public string Sex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生日
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Birthday { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 身份证地址
|
||||||
|
/// </summary>
|
||||||
|
public string Address { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 已婚/未婚
|
||||||
|
/// </summary>
|
||||||
|
public string Postcode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 部门编码
|
||||||
|
/// </summary>
|
||||||
|
public string Appellation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 民族代码
|
||||||
|
/// </summary>
|
||||||
|
public string Nation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手机号码
|
||||||
|
/// </summary>
|
||||||
|
public string Phone { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 联系电话
|
||||||
|
/// </summary>
|
||||||
|
public string Mobile { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学历
|
||||||
|
/// </summary>
|
||||||
|
public string Degree { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 岗位
|
||||||
|
/// </summary>
|
||||||
|
public string Web { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string Remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作账号
|
||||||
|
/// </summary>
|
||||||
|
public string Log_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作班次
|
||||||
|
/// </summary>
|
||||||
|
public string Log_shift { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Log_date { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作IP
|
||||||
|
/// </summary>
|
||||||
|
public string Log_ip { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否在职 F 在职 T离职
|
||||||
|
/// </summary>
|
||||||
|
public string Isowner { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Createdate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 外文名字
|
||||||
|
/// </summary>
|
||||||
|
public string Gname_en { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号
|
||||||
|
/// </summary>
|
||||||
|
public string CarNo { get; set; }
|
||||||
|
|
||||||
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
if (GainfoStatus.HasValue && GainfoStatus == GainfoStatusEnumType.Leave)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("不支持离职人员新增/修改", new[] { nameof(GainfoStatus) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
144
Src/Dlhis.Basic/Organization/Response/GainfoPageResponse.cs
Normal file
144
Src/Dlhis.Basic/Organization/Response/GainfoPageResponse.cs
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
namespace Dlhis.Basic.Organization.Response;
|
||||||
|
|
||||||
|
public class GainfoPageResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 档案号
|
||||||
|
/// </summary>
|
||||||
|
public string Guestno { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SAP内部编号
|
||||||
|
/// </summary>
|
||||||
|
public string Ano { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 人员类型
|
||||||
|
/// </summary>
|
||||||
|
public string Class { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 姓名
|
||||||
|
/// </summary>
|
||||||
|
public string Gname { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工号
|
||||||
|
/// </summary>
|
||||||
|
public string Ename { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 国家代码
|
||||||
|
/// </summary>
|
||||||
|
public string Country { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 证件类型代码
|
||||||
|
/// </summary>
|
||||||
|
public string Idcls { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 身份证号
|
||||||
|
/// </summary>
|
||||||
|
public string IdNO { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 身份证籍贯区域代码
|
||||||
|
/// </summary>
|
||||||
|
public string Native { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 性别
|
||||||
|
/// </summary>
|
||||||
|
public string Sex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生日
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Birthday { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 身份证地址
|
||||||
|
/// </summary>
|
||||||
|
public string Address { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 已婚/未婚
|
||||||
|
/// </summary>
|
||||||
|
public string Postcode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 部门编码
|
||||||
|
/// </summary>
|
||||||
|
public string Appellation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 民族代码
|
||||||
|
/// </summary>
|
||||||
|
public string Nation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手机号码
|
||||||
|
/// </summary>
|
||||||
|
public string Phone { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 联系电话
|
||||||
|
/// </summary>
|
||||||
|
public string Mobile { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学历
|
||||||
|
/// </summary>
|
||||||
|
public string Degree { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 岗位
|
||||||
|
/// </summary>
|
||||||
|
public string Web { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string Remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作账号
|
||||||
|
/// </summary>
|
||||||
|
public string Log_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作班次
|
||||||
|
/// </summary>
|
||||||
|
public string Log_shift { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Log_date { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作IP
|
||||||
|
/// </summary>
|
||||||
|
public string Log_ip { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否在职 F 在职 T离职
|
||||||
|
/// </summary>
|
||||||
|
public string Isowner { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Createdate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 外文名字
|
||||||
|
/// </summary>
|
||||||
|
public string Gname_en { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号
|
||||||
|
/// </summary>
|
||||||
|
public string CarNo { get; set; }
|
||||||
|
}
|
||||||
@@ -1,5 +1,18 @@
|
|||||||
namespace Dlhis.Basic.Organization.Services;
|
using Dlhis.Basic.Organization.Request;
|
||||||
|
using Dlhis.Basic.Organization.Response;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Organization.Services;
|
||||||
|
|
||||||
public interface IGainfoService : IScopeDependency
|
public interface IGainfoService : IScopeDependency
|
||||||
{
|
{
|
||||||
|
Task SaveAsync(GainfoSaveRequest request);
|
||||||
|
|
||||||
|
Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request);
|
||||||
|
|
||||||
|
Task UpdateAsync(GainfoSaveRequest request);
|
||||||
|
|
||||||
|
Task DimissionAsync(GainfoDImissionRequest request);
|
||||||
|
|
||||||
|
Task OnboardingAsync(GainfoDImissionRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,125 @@
|
|||||||
|
using Dlhis.Basic.Organization.Request;
|
||||||
|
using Dlhis.Basic.Organization.Response;
|
||||||
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Dlhis.Entity.Basic.Enums;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
using Kurisu.SqlSugar.Attributes;
|
||||||
|
using Kurisu.SqlSugar.Extensions;
|
||||||
|
using Mapster;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||||
|
|
||||||
|
public class GainfoService : IGainfoService
|
||||||
|
{
|
||||||
|
|
||||||
|
private readonly IGainfoStore _gainfoStore;
|
||||||
|
|
||||||
|
public GainfoService(IGainfoStore gainfoStore)
|
||||||
|
{
|
||||||
|
_gainfoStore = gainfoStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 档案分页
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request)
|
||||||
|
{
|
||||||
|
var page = _gainfoStore.Queryable(request.gainfoStatus)
|
||||||
|
.Select<GainfoPageResponse>()
|
||||||
|
.ToPageListAsync(request);
|
||||||
|
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///保存档案号
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task SaveAsync(GainfoSaveRequest request)
|
||||||
|
{
|
||||||
|
var gainfos = new List<GainfoEntity>();
|
||||||
|
GainfoEntity aginfoEntity = request.Adapt<GainfoEntity>();
|
||||||
|
|
||||||
|
aginfoEntity.Guestno = "F" + Guid.NewGuid().ToString();
|
||||||
|
gainfos.Add(aginfoEntity);
|
||||||
|
|
||||||
|
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Working, gainfos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///修改档案号
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task UpdateAsync(GainfoSaveRequest request)
|
||||||
|
{
|
||||||
|
var gainfo = await _gainfoStore.Queryable(request.GainfoStatus).Where(x => x.Id == request.Id).FirstAsync();
|
||||||
|
gainfo.ThrowIfNull("档案数据不存在,无法更新");
|
||||||
|
|
||||||
|
request.Adapt(gainfo);
|
||||||
|
|
||||||
|
var gainfos = new List<GainfoEntity>()
|
||||||
|
{
|
||||||
|
gainfo
|
||||||
|
};
|
||||||
|
|
||||||
|
await _gainfoStore.UpdateAsync(request.GainfoStatus, gainfos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 正式转离职
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
[Transactional]
|
||||||
|
public async Task DimissionAsync(GainfoDImissionRequest request)
|
||||||
|
{
|
||||||
|
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
|
||||||
|
.Where(x => x.Guestno == request.UserId)
|
||||||
|
.FirstAsync();
|
||||||
|
gainfo.ThrowIfNull($"该档案不存在");
|
||||||
|
|
||||||
|
//添加到离职表
|
||||||
|
var gainfos = new List<GainfoEntity>
|
||||||
|
{
|
||||||
|
gainfo
|
||||||
|
};
|
||||||
|
|
||||||
|
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Leave, gainfos);
|
||||||
|
|
||||||
|
//删除原数据
|
||||||
|
await _gainfoStore.DeleteAsync(GainfoStatusEnumType.Working, gainfos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临时转正式
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task OnboardingAsync(GainfoDImissionRequest request)
|
||||||
|
{
|
||||||
|
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.External)
|
||||||
|
.Where(x => x.Guestno == request.UserId)
|
||||||
|
.FirstAsync();
|
||||||
|
gainfo.ThrowIfNull($"该档案不存在");
|
||||||
|
|
||||||
|
//添加到正式表
|
||||||
|
var gainfos = new List<GainfoEntity>
|
||||||
|
{
|
||||||
|
gainfo
|
||||||
|
};
|
||||||
|
|
||||||
|
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Working, gainfos);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------help methods ------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user