fix 优化datetime格式

This commit is contained in:
2024-05-30 20:44:41 +08:00
parent 75bd31d4a5
commit 5c30638274
30 changed files with 275 additions and 591 deletions

View File

@@ -1,5 +1,4 @@
using Dlhis.Basic.Api.Dto;
using Dlhis.Basic.Api.Request;
using Kurisu.RemoteCall.Attributes;
using Kurisu.RemoteCall.Default;
@@ -11,7 +10,4 @@ public interface IBusinessPlacePermissionsApi
[Auth]
[Get("/api/businessplacepermissions/my")]
Task<DefaultApiResult<List<BusinessPlaceDto>>> GetMyAsync();
[Post("/api/gainfoPermissions/reset")]
Task<DefaultApiResult> ResetAsync(GainfoPermissionResetRequest request);
}

View File

@@ -0,0 +1,12 @@
using Dlhis.Basic.Api.Request;
using Kurisu.RemoteCall.Attributes;
using Kurisu.RemoteCall.Default;
namespace Dlhis.Basic.Api;
[EnableRemoteClient(Name = "basic-service", BaseUrl = "${InternalRequest:BasicRequestUrl}")]
public interface IGainfoPermissionApi
{
[Post("/api/gainfoPermissions/reset")]
Task<DefaultApiResult> ResetAsync(GainfoPermissionResetRequest request);
}

View File

@@ -27,7 +27,7 @@ public class DevicePermissionsController : ControllerBase
[HttpPost("assign")]
[Transactional]
[IgnoreTenant]
public async Task AssignAsync(DevicePermissionSaveReuqest request)
public async Task AssignAsync(DevicePermissionSaveRequest request)
{
await _devicePermissionService.AssignAsync(request);
}

View File

@@ -4,7 +4,7 @@ using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Basic.Device.Request;
public class DevicePermissionSaveReuqest : IValidatableObject
public class DevicePermissionSaveRequest : IValidatableObject
{
/// <summary>
/// 分配类型 AssignTypeEnumType

View File

@@ -12,7 +12,7 @@ public interface IDevicePermissionService : IScopeDependency
/// </summary>
/// <param name="reuqest"></param>
/// <returns></returns>
Task AssignAsync(DevicePermissionSaveReuqest reuqest);
Task AssignAsync(DevicePermissionSaveRequest reuqest);
/// <summary>
/// 获取分配的权限

View File

@@ -24,7 +24,7 @@ public class DevicePermissionService : IDevicePermissionService
_currentUser = currentUser;
}
public async Task AssignAsync(DevicePermissionSaveReuqest request)
public async Task AssignAsync(DevicePermissionSaveRequest request)
{
var tenantId = request.AssignType == AssignTypeEnumType.Department ? request.TenantId : _currentUser.GetStringTenantId();

View File

@@ -45,10 +45,10 @@ public class DishesResponse
/// <summary>
/// 单位
/// </summary>
public List<string> Units => CurrnetUnits.ToObject<List<string>>();
public List<string> Units => CurrentUnits.ToObject<List<string>>();
[JsonIgnore]
public string CurrnetUnits { get; set; }
public string CurrentUnits { get; set; }
/// <summary>
/// 图片

View File

@@ -39,7 +39,7 @@ public class DishesService : IDishesService
.Select((x, category) => new DishesResponse
{
Id = x.Id,
CurrnetUnits = x.Units.ToString(),
CurrentUnits = x.Units.ToString(),
CategoryName = category.Name,
}, true)
.ToPageListAsync(request);

View File

@@ -1,5 +1,7 @@
using Dlhis.Entity.Basic.Enums;
using Kurisu.AspNetCore.Utils.Converters;
using Kurisu.AspNetCore.Utils.Extensions;
using Newtonsoft.Json;
namespace Dlhis.Basic.Organization.Response;
@@ -43,6 +45,7 @@ public class GainfoCurrentResponse
/// <summary>
/// 出生日期/生日
/// </summary>
[JsonConverter(typeof(ToDateJsonConverter))]
public DateTime Birthday { get; set; }
/// <summary>

View File

@@ -1,5 +1,7 @@
using Dlhis.Entity.Basic.Enums;
using Kurisu.AspNetCore.Utils.Converters;
using Kurisu.AspNetCore.Utils.Extensions;
using Newtonsoft.Json;
namespace Dlhis.Basic.Organization.Response;
@@ -68,6 +70,7 @@ public class GainfoDetailResponse
/// <summary>
/// 出生日期
/// </summary>
[JsonConverter(typeof(ToDateJsonConverter))]
public DateTime Birthday { get; set; }
/// <summary>

View File

@@ -1,9 +0,0 @@
namespace Dlhis.Basic.Organization.Response
{
public class GainfoGainfoNumbersResponse
{
public int OnlineNumber { get; set; }
public int OfflineNumber { get; set; }
public int AttendanceNumber{ get; set; }
}
}

View File

@@ -59,11 +59,13 @@ public class GainfoPageResponse
/// 性别
/// </summary>
public GenderEnumType Gender { get; set; }
public string GenderDesc => Gender.GetDescription();
/// <summary>
/// 生日
/// </summary>
[JsonConverter(typeof(ToDateJsonConverter))]
public DateTime Birthday { get; set; }
/// <summary>

View File

@@ -1,7 +0,0 @@
namespace Dlhis.Basic.Organization.Response
{
public class GetAssignGroupResponse
{
}
}

View File

@@ -1,10 +1,10 @@
using Dlhis.Basic.Device.Response;
namespace Dlhis.Basic.Organization.Response
namespace Dlhis.Basic.Organization.Response;
public class GetDevicesUnderGroupByUserNoResponse
{
public class GetDevicesUnderGroupByUserNoResponse
{
public Guid GroupCode { get; set; }
public List<DevicePageResponse> Devices { get; set; }
}
public Guid GroupCode { get; set; }
public List<DevicePageResponse> Devices { get; set; }
}

View File

@@ -1,8 +0,0 @@
namespace Dlhis.Basic.Organization.Response
{
public class GetPlaceByGainfoResponse
{
public Guid PlaceCode { get; set; }
public string PlaceName { get; set; }
}
}

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using Kurisu.AspNetCore.Utils.Converters;
using Newtonsoft.Json;
namespace Dlhis.Canteen.MealSupplementRecord.Response;
@@ -7,6 +8,7 @@ public class MealSupplementRecordItemResponse
/// <summary>
/// 餐补日期
/// </summary>
[JsonConverter(typeof(ToDateJsonConverter))]
public DateTime Date { get; set; }
[JsonIgnore]

View File

@@ -1,5 +1,7 @@
using Dlhis.Entity.Basic.Enums;
using Kurisu.AspNetCore.Utils.Converters;
using Kurisu.AspNetCore.Utils.Extensions;
using Newtonsoft.Json;
namespace Dlhis.Canteen.MealSupplementRecord.Response;
@@ -30,6 +32,7 @@ public class MealSupplementRecordResponse
/// <summary>
/// 考勤日期
/// </summary>
[JsonConverter(typeof(ToDateJsonConverter))]
public DateTime Date { get; set; }
/// <summary>

View File

@@ -28,7 +28,7 @@ public class OrdersController : ControllerBase
}
/// <summary>
/// 添加充值/消费订单
/// 添加充值
/// </summary>
/// <param name="request"></param>
/// <returns></returns>

View File

@@ -1,62 +0,0 @@
using Dlhis.Entity.Canteen.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Canteen.Order.Response;
public class BalanceRecordByUserResponse
{
/// <summary>
/// 流水号
/// </summary>
public string No { get; set; }
/// <summary>
/// 金额
/// </summary>
public string Name { get; set; }
/// <summary>
/// 学工号
/// </summary>
public string UserCode { get; set; }
/// <summary>
/// 部门号
/// </summary>
public string DepartmentNo { get; set; }
/// <summary>
/// 来源
/// </summary>
public BalanceRecordSourceEnumType Source { get; set; }
/// <summary>
/// 来源CN
/// </summary>
public string SourceCN => Source.GetDescription();
/// <summary>
/// 收入/支出
/// </summary>
public BalanceRecordTypeEnumType Type { get; set; }
/// <summary>
/// 收入/支出
/// </summary>
public string TypeCN => Type.GetDescription();
/// <summary>
/// 金额 + - 表示
/// </summary>
public decimal Amount { get; set; }
/// <summary>
/// 消费时间
/// </summary>
public DateTime CostDateTime { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}

View File

@@ -1,94 +0,0 @@
namespace Dlhis.Canteen.Order.Response
{
public class BalanceRecordCostIdResponse
{
/// <summary>
/// 成本中心
/// </summary>
public string CostId { get; set; }
/// <summary>
/// 早餐人数
/// </summary>
public int BreakfastNumberOfPeople { get; set; }
/// <summary>
/// 早餐单价price
/// </summary>
public decimal BreakfastPrice { get; set; }
/// <summary>
/// 早餐金额
/// </summary>
public decimal BreakfastAmount { get; set; }
/// <summary>
/// 午餐人数
/// </summary>
public int LunchNumberOfPeople { get; set; }
/// <summary>
/// 午餐单价price
/// </summary>
public decimal LunchPrice { get; set; }
/// <summary>
/// 午餐金额
/// </summary>
public decimal LunchAmount { get; set; }
/// <summary>
/// 晚餐人数
/// </summary>
public int DinnerNumberOfPeople { get; set; }
/// <summary>
/// 晚餐单价price
/// </summary>
public decimal DinnerPrice { get; set; }
/// <summary>
/// 晚餐金额
/// </summary>
public decimal DinnerAmount { get; set; }
/// <summary>
/// 宵夜人数
/// </summary>
public int LateNightNumberOfPeople { get; set; }
/// <summary>
/// 宵夜单价price
/// </summary>
public decimal LateNightPrice { get; set; }
/// <summary>
/// 宵夜金额
/// </summary>
public decimal LateNightAmount { get; set; }
/// <summary>
/// 总金额
/// </summary>
public decimal TotalAmount { get; set; }
/// <summary>
/// 总人数
/// </summary>
public int TotalNumberOfPeople { get; set; }
}
}

View File

@@ -1,5 +1,7 @@
using Dlhis.Entity.Canteen.Enums;
using Kurisu.AspNetCore.Utils.Converters;
using Kurisu.AspNetCore.Utils.Extensions;
using Newtonsoft.Json;
namespace Dlhis.Canteen.Order.Response;
@@ -40,6 +42,7 @@ public class BalanceRecordDeviceResponse
/// <summary>
/// 所属成本日期
/// </summary>
[JsonConverter(typeof(ToDateJsonConverter))]
public DateTime CostDate { get; set; }
/// <summary>
@@ -99,9 +102,3 @@ public class BalanceRecordDeviceResponse
/// </summary>
public string TenantName { get; set; }
}
public class BalanceRecordDeviceItemResponse
{
}

View File

@@ -1,5 +1,7 @@
using Dlhis.Entity.Canteen.Enums;
using Kurisu.AspNetCore.Utils.Converters;
using Kurisu.AspNetCore.Utils.Extensions;
using Newtonsoft.Json;
namespace Dlhis.Canteen.Order.Response;
@@ -46,6 +48,7 @@ public class BalanceRecordResponse
/// <summary>
/// 所属成本日期
/// </summary>
[JsonConverter(typeof(ToDateJsonConverter))]
public DateTime CostDate { get; set; }
/// <summary>
@@ -57,12 +60,14 @@ public class BalanceRecordResponse
/// 来源
/// </summary>
public BalanceRecordSourceEnumType Source { get; set; }
public string SourceDesc => Source.GetDescription();
/// <summary>
/// 收入/支出
/// </summary>
public BalanceRecordTypeEnumType Type { get; set; }
public string TypeDesc => Type.GetDescription();
/// <summary>
@@ -79,6 +84,7 @@ public class BalanceRecordResponse
/// 餐次
/// </summary>
public ShiftEnumType? ShiftType { get; set; }
/// <summary>
/// 餐次
/// </summary>

View File

@@ -1,113 +0,0 @@
using SqlSugar;
namespace Dlhis.Canteen.Order.Response
{
public class BalanceRecordSummaryRespones
{
/// <summary>
/// 部门号
/// </summary>
public string DepartmentNo { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DepartmentName { get; set; }
/// <summary>
/// 成本中心
/// </summary>
public string CostId { get; set; }
/// <summary>
/// 消费者所在基地
/// </summary>
public string OriginTenantId { get; set; }
/// <summary>
/// 早餐人数
/// </summary>
public int BreakfastNumberOfPeople { get; set; }
/// <summary>
/// 早餐单价price
/// </summary>
public decimal BreakfastPrice { get; set; }
/// <summary>
/// 早餐金额
/// </summary>
public decimal BreakfastAmount { get; set; }
/// <summary>
/// 午餐人数
/// </summary>
public int LunchNumberOfPeople { get; set; }
/// <summary>
/// 午餐单价price
/// </summary>
public decimal LunchPrice { get; set; }
/// <summary>
/// 午餐金额
/// </summary>
public decimal LunchAmount { get; set; }
/// <summary>
/// 晚餐人数
/// </summary>
public int DinnerNumberOfPeople { get; set; }
/// <summary>
/// 晚餐单价price
/// </summary>
public decimal DinnerPrice { get; set; }
/// <summary>
/// 晚餐金额
/// </summary>
public decimal DinnerAmount { get; set; }
/// <summary>
/// 宵夜人数
/// </summary>
public int LateNightNumberOfPeople { get; set; }
/// <summary>
/// 宵夜单价price
/// </summary>
public decimal LateNightPrice { get; set; }
/// <summary>
/// 宵夜金额
/// </summary>
public decimal LateNightAmount { get; set; }
/// <summary>
/// 总金额
/// </summary>
public decimal TotalAmount { get; set; }
/// <summary>
/// 总人数
/// </summary>
public int TotalNumberOfPeople { get; set; }
}
}

View File

@@ -1,40 +1,39 @@
namespace Dlhis.Canteen.Order.Response
namespace Dlhis.Canteen.Order.Response;
public class ConsumeNumberResponse
{
public class ConsumeNumberResponse
{
/// <summary>
/// 消费机总数
/// </summary>
public int Total { get; set; }
/// <summary>
/// 消费机总数
/// </summary>
public int Total { get; set; }
/// <summary>
/// 消费机离线数
/// </summary>
public int OffNumber { get; set; }
/// <summary>
/// 消费机离线数
/// </summary>
public int OffNumber { get; set; }
/// <summary>
/// 营业点总数
/// </summary>
public int PlaceNumber { get; set; }
/// <summary>
/// 营业点总数
/// </summary>
public int PlaceNumber { get; set; }
/// <summary>
/// 可消费人数
/// </summary>
public int ConsumerableNumber { get; set; }
/// <summary>
/// 可消费人数
/// </summary>
public int ConsumerableNumber { get; set; }
/// <summary>
/// 人均日消费额
/// </summary>
public int DailyNumber { get; set; }
/// <summary>
/// 人均日消费额
/// </summary>
public int DailyNumber { get; set; }
/// <summary>
/// 日消费额走势图
/// </summary>
public List<ConsumptionTrendResponse> Days { get; set; }
/// <summary>
/// 日消费额走势图
/// </summary>
public List<ConsumptionTrendResponse> Days { get; set; }
/// <summary>
/// 月消费额走势图
/// </summary>
public List<ConsumptionTrendResponse> Months { get; set; }
}
/// <summary>
/// 月消费额走势图
/// </summary>
public List<ConsumptionTrendResponse> Months { get; set; }
}

View File

@@ -1,20 +1,19 @@
namespace Dlhis.Canteen.Order.Response
namespace Dlhis.Canteen.Order.Response;
public class ConsumptionTrendResponse
{
public class ConsumptionTrendResponse
{
/// <summary>
/// 时间
/// </summary>
public string DateTime { get; set; }
/// <summary>
/// 时间
/// </summary>
public string DateTime { get; set; }
/// <summary>
/// 当日/月消费总额
/// </summary>
public decimal CurrentAmount { get; set; }
/// <summary>
/// 当日/月消费总额
/// </summary>
public decimal CurrentAmount { get; set; }
/// <summary>
/// 消费总额
/// </summary>
public decimal TotalAmount { get; set; }
}
/// <summary>
/// 消费总额
/// </summary>
public decimal TotalAmount { get; set; }
}

View File

@@ -1,117 +1,115 @@
using Dlhis.Entity.Device.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Canteen.Order.Response
namespace Dlhis.Canteen.Order.Response;
public class DevicePageResponse
{
public class DevicePageResponse
public long Id { get; set; }
/// <summary>
/// 设备code
/// </summary>
public Guid Code { get; set; }
/// <summary>
/// 设备唯一码,IP/MAC/SNO
/// </summary>
public string UniqueNo { get; set; }
/// <summary>
/// 心跳间隔
/// </summary>
public int HeartbeatInterval { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string Brand { get; set; }
/// <summary>
/// 供应商
/// </summary>
public string Supplier { get; set; }
/// <summary>
/// 设备功能 DeviceFuncEnumType
/// </summary>
public List<DeviceFuncEnumType> Funcs
{
public long Id { get; set; }
/// <summary>
/// 设备code
/// </summary>
public Guid Code { get; set; }
/// <summary>
/// 设备唯一码,IP/MAC/SNO
/// </summary>
public string UniqueNo { get; set; }
/// <summary>
/// 心跳间隔
/// </summary>
public int HeartbeatInterval { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string Brand { get; set; }
/// <summary>
/// 供应商
/// </summary>
public string Supplier { get; set; }
/// <summary>
/// 设备功能 DeviceFuncEnumType
/// </summary>
public List<DeviceFuncEnumType> Funcs
get
{
get
{
if (FuncsStr.IsEmpty()) FuncsStr = "[]";
if (FuncsStr.IsEmpty()) FuncsStr = "[]";
return FuncsStr.ToObject<List<DeviceFuncEnumType>>();
}
return FuncsStr.ToObject<List<DeviceFuncEnumType>>();
}
public string FuncsStr { get; set; }
/// <summary>
/// 设备机功能类型
/// </summary>
public DeviceTypeEnumType Type { get; set; }
public string TypeDescription
{
get
{
try
{
return Type.GetDescription();
}
catch (Exception)
{
return string.Empty;
}
}
}
/// <summary>
/// 部署点
/// </summary>
public string DeployPlace { get; set; }
/// <summary>
/// 部署坐标
/// </summary>
public string DeployPosition { get; set; }
/// <summary>
/// 部署方向
/// </summary>
public string DeployDirection { get; set; }
/// <summary>
/// 模板code
/// </summary>
public Guid TemplateCode { get; set; }
/// <summary>
/// 连接信息
/// </summary>
public string ConnectionInfo { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public bool Enable { get; set; }
/// <summary>
/// 是否在线
/// </summary>
public bool IsOnline { get; set; }
/// <summary>
/// 消费总额
/// </summary>
public decimal Amount { get; set; }
/// <summary>
/// 消费人次
/// </summary>
public int UserCount { get; set; }
}
public string FuncsStr { get; set; }
/// <summary>
/// 设备机功能类型
/// </summary>
public DeviceTypeEnumType Type { get; set; }
public string TypeDescription
{
get
{
try
{
return Type.GetDescription();
}
catch (Exception)
{
return string.Empty;
}
}
}
/// <summary>
/// 部署点
/// </summary>
public string DeployPlace { get; set; }
/// <summary>
/// 部署坐标
/// </summary>
public string DeployPosition { get; set; }
/// <summary>
/// 部署方向
/// </summary>
public string DeployDirection { get; set; }
/// <summary>
/// 模板code
/// </summary>
public Guid TemplateCode { get; set; }
/// <summary>
/// 连接信息
/// </summary>
public string ConnectionInfo { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public bool Enable { get; set; }
/// <summary>
/// 是否在线
/// </summary>
public bool IsOnline { get; set; }
/// <summary>
/// 消费总额
/// </summary>
public decimal Amount { get; set; }
/// <summary>
/// 消费人次
/// </summary>
public int UserCount { get; set; }
}

View File

@@ -1,5 +1,7 @@
using Dlhis.Entity.Canteen.Enums;
using Kurisu.AspNetCore.Utils.Converters;
using Kurisu.AspNetCore.Utils.Extensions;
using Newtonsoft.Json;
namespace Dlhis.Canteen.Order.Response;
@@ -64,6 +66,7 @@ public class OrderBookingResponse
/// <summary>
/// 订餐日期
/// </summary>
[JsonConverter(typeof(ToDateJsonConverter))]
public DateTime BookingDate { get; set; }
/// <summary>

View File

@@ -1,34 +0,0 @@
//namespace Dlhis.Canteen.Order.Response;
//public class OrderDetailResponse
//{
// /// <summary>
// /// 菜品编码
// /// </summary>
// public string DishesCode { get; set; }
// /// <summary>
// /// 菜品名称
// /// </summary>
// public string Name { get; set; }
// /// <summary>
// /// 单价
// /// </summary>
// public decimal Price { get; set; }
// /// <summary>
// /// 数量
// /// </summary>
// public int Number { get; set; }
// /// <summary>
// /// 单位
// /// </summary>
// public string Unit { get; set; }
// /// <summary>
// /// 图片
// /// </summary>
// public string ImageUrl { get; set; }
//}

View File

@@ -17,7 +17,7 @@ public class GainfoUpdateService : IGainfoUpdateService
private readonly IDbContext _dbContext;
private readonly ILogger<GainfoUpdateService> _logger;
private readonly ITenantApi _tenantApi;
private readonly IBusinessPlacePermissionsApi _businessPlacePermissionsApi;
private readonly IGainfoPermissionApi _gainfoPermissionApi;
private readonly IDevicePermissionApi _devicePermissionApi;
private readonly IJinkoSapService _jinkoSapService;
@@ -28,7 +28,7 @@ public class GainfoUpdateService : IGainfoUpdateService
public GainfoUpdateService(IDbContext dbContext,
ILogger<GainfoUpdateService> logger,
ITenantApi tenantApi,
IBusinessPlacePermissionsApi businessPlacePermissionsApi,
IGainfoPermissionApi gainfoPermissionApi,
IDevicePermissionApi devicePermissionApi,
IJinkoSapService jinkoSapService)
{
@@ -36,7 +36,7 @@ public class GainfoUpdateService : IGainfoUpdateService
_dbContext.Client.QueryFilter.Clear();
_logger = logger;
_tenantApi = tenantApi;
_businessPlacePermissionsApi = businessPlacePermissionsApi;
_gainfoPermissionApi = gainfoPermissionApi;
_devicePermissionApi = devicePermissionApi;
_jinkoSapService = jinkoSapService;
}
@@ -156,8 +156,6 @@ public class GainfoUpdateService : IGainfoUpdateService
var existsUpdateWorkCodes = originUpdates.Select(x => x.ZWORKCODE).ToList();
var originInserts = persons.Where(x => searchCodes.Contains(x.ZWORKCODE)).Where(x => !existsUpdateWorkCodes.Contains(x.ZWORKCODE)).ToList();
int i = 0;
var updates = ToGainfoSap(originUpdates);
_logger.LogWarning("SAP分批更新数:{count}", updates.Count);
var inserts = ToGainfoSap(originInserts);
@@ -165,7 +163,6 @@ public class GainfoUpdateService : IGainfoUpdateService
foreach (var item in inserts)
{
i++;
try
{
var no = await InsertPersonAsync(item);
@@ -179,7 +176,6 @@ public class GainfoUpdateService : IGainfoUpdateService
foreach (var item in updates)
{
i++;
try
{
var no = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Code == item.ename).Select(x => x.No).SingleAsync();
@@ -200,7 +196,7 @@ public class GainfoUpdateService : IGainfoUpdateService
{
no = await UpdatePersonAsync(item);
_logger.LogWarning("执行更新成功 工号:{code},姓名:{name}", item.ename, item.gname);
await _businessPlacePermissionsApi.ResetAsync(new GainfoPermissionResetRequest
await _gainfoPermissionApi.ResetAsync(new GainfoPermissionResetRequest
{
UserNo = no
});
@@ -351,7 +347,7 @@ public class GainfoUpdateService : IGainfoUpdateService
{
try
{
await _businessPlacePermissionsApi.ResetAsync(new GainfoPermissionResetRequest
await _gainfoPermissionApi.ResetAsync(new GainfoPermissionResetRequest
{
IsLeave = true,
UserNo = gainfo.No
@@ -468,79 +464,71 @@ public class GainfoUpdateService : IGainfoUpdateService
{
return data.Select(person =>
{
GainfoSapEntity o = null;
try
//var position = _positions.FirstOrDefault(x => x.No == person.PLANS);
var rzrq = person.ZRZRQ;
var lzrq = person.ZLZRQ;
var rmk = $"入职时间:{rzrq.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)} ";
if (lzrq != null && lzrq.Value.ToString("yyyy-MM-dd") != "1900-01-01")
rmk += $"离职时间:{lzrq.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)} ";
if (!string.IsNullOrWhiteSpace(person.MGTXT))
rmk += $"变更原因:{person.MGTXT}";
var native = GetNative(person.ZZ_SFZH);
var sex = person.GESCH == "2" ? "F" : "M";
person.ZZ_SFZH = person.ZZ_SFZH?.TrimStart();
GainfoSapEntity o = new()
{
//var position = _positions.FirstOrDefault(x => x.No == person.PLANS);
gname = person.NAME,
ename = person.ZWORKCODE,
idno = person.ZZ_SFZH,
birthday = person.GBDAT,
ZZ_KLX = person.ZZ_KLX,
email = person.ZXUELI,
appellation = person.ORGEH,
phone = person.ZMOBILE,
ZSTATUS = person.ZSTATUS,
createdate = person.ZRZRQ,
PERNR = person.PERNR,
WERKS = person.WERKS,
KOSTL = person.KOSTL,
ZZ_ZD = person.ZZ_ZD,
Z_ZJ = person.Z_ZJ,
STELL = person.STELL,
STELL_NM = person.STELL_NM,
ZLZRQ = person.ZLZRQ,
MASSN = person.MASSN,
MNTXT = person.MNTXT,
remark = rmk,
native = native,
sex = sex,
logdate = DateTime.Now,
isowner = int.Parse(person.ZSTATUS) < 5 ? "T" : "F",
@class = "C",
country = person.ZZ_COUNNM,
log_ip = "127.0.0.1",
log_shift = "1",
log_id = "XX",
address = "",
occupation = "99",
nation = "01",
idcls = "ID",
ZZ_COUNNM = person.ZZ_COUNNM,
ZZ_GZDJDNM = person.ZZ_GZDJDNM,
ZZ_GZDCQNM = person.ZZ_GZDCQNM,
};
var rzrq = person.ZRZRQ;
var lzrq = person.ZLZRQ;
var rmk = $"入职时间:{rzrq.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)} ";
if (lzrq != null && lzrq.Value.ToString("yyyy-MM-dd") != "1900-01-01")
rmk += $"离职时间:{lzrq.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)} ";
if (!string.IsNullOrWhiteSpace(person.MGTXT))
rmk += $"变更原因:{person.MGTXT}";
var native = GetNative(person.ZZ_SFZH);
var sex = person.GESCH == "2" ? "F" : "M";
person.ZZ_SFZH = person.ZZ_SFZH?.TrimStart();
o = new GainfoSapEntity
{
gname = person.NAME,
ename = person.ZWORKCODE,
idno = person.ZZ_SFZH,
birthday = person.GBDAT,
ZZ_KLX = person.ZZ_KLX,
email = person.ZXUELI,
appellation = person.ORGEH,
phone = person.ZMOBILE,
ZSTATUS = person.ZSTATUS,
createdate = person.ZRZRQ,
PERNR = person.PERNR,
WERKS = person.WERKS,
KOSTL = person.KOSTL,
ZZ_ZD = person.ZZ_ZD,
Z_ZJ = person.Z_ZJ,
STELL = person.STELL,
STELL_NM = person.STELL_NM,
ZLZRQ = person.ZLZRQ,
MASSN = person.MASSN,
MNTXT = person.MNTXT,
remark = rmk,
native = native,
sex = sex,
logdate = DateTime.Now,
isowner = int.Parse(person.ZSTATUS) < 5 ? "T" : "F",
@class = "C",
country = person.ZZ_COUNNM,
log_ip = "127.0.0.1",
log_shift = "1",
log_id = "XX",
address = "",
occupation = "99",
nation = "01",
idcls = "ID",
ZZ_COUNNM = person.ZZ_COUNNM,
ZZ_GZDJDNM = person.ZZ_GZDJDNM,
ZZ_GZDCQNM = person.ZZ_GZDCQNM,
};
return o;
}
catch (Exception)
{
throw;
}
return o;
}).ToList();
}
private static string GetNative(string idno)
private static string GetNative(string idNo)
{
if (string.IsNullOrWhiteSpace(idno) || idno.Length < 6) return null;
idno = idno.TrimStart();
return idno[..6];
if (string.IsNullOrWhiteSpace(idNo) || idNo.Length < 6) return null;
idNo = idNo.TrimStart();
return idNo[..6];
}
}