Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development

This commit is contained in:
cheche
2024-03-27 14:22:35 +08:00
18 changed files with 208 additions and 55 deletions

View File

@@ -1,15 +1,11 @@
using Dlhis.Basic.BusinessPlace.Response;
using Dlhis.Basic.Device.Response;
using Dlhis.Basic.Device.Services;
using Dlhis.Basic.Organization.Request;
using Dlhis.Basic.Organization.Response;
using Dlhis.Basic.Organization.Services;
using Dlhis.Basic.Organization.Services.Implements;
using Dlhis.Entity.Device.Entities;
using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Org.BouncyCastle.Asn1.Ocsp;
namespace Dlhis.Basic.Organization.Controllers;
@@ -32,7 +28,7 @@ public class GainfoPermissionsController : ControllerBase
/// <param name="request"></param>
/// <returns></returns>
[HttpGet("placesByGainfo")]
public async Task<Pagination<BusinessPlaceResponse>> GetPlaceByGainfoAsync([FromQuery]DeviceAssRequest request)
public async Task<Pagination<BusinessPlaceResponse>> GetPlaceByGainfoAsync([FromQuery] DeviceAssRequest request)
{
return await _gainfoPermissions.GetPlaceByGainfoAsync(request);
}
@@ -55,7 +51,7 @@ public class GainfoPermissionsController : ControllerBase
/// <param name="request"></param>
/// <returns></returns>
[HttpGet("assignDeviceCodes")]
public async Task<Pagination<DevicePageResponse>> GetAssignDeviceCodesAsync([FromQuery]DeviceAssRequest request)
public async Task<Pagination<DevicePageResponse>> GetAssignDeviceCodesAsync([FromQuery] DeviceAssRequest request)
{
return await _gainfoPermissions.GetAssignDeviceCodesAsync(request);
}

View File

@@ -1,11 +1,17 @@
using Kurisu.Core.DataAccess.Dto;
using Dlhis.Entity.Device.Enums;
using Kurisu.Core.DataAccess.Dto;
using System.ComponentModel.DataAnnotations;
namespace Dlhis.Basic.Organization.Request
namespace Dlhis.Basic.Organization.Request;
public class DeviceAssRequest : PageDto
{
public class DeviceAssRequest : PageDto
{
[Required]
public string UserNo { get; set; }
}
[Required]
public string UserNo { get; set; }
/// <summary>
/// 设备类型
/// </summary>
[EnumDataType(typeof(DeviceTypeEnumType))]
public DeviceTypeEnumType? DeviceType { get; set; }
}

View File

@@ -25,11 +25,6 @@ public class GainfoDetailResponse
/// </summary>
public string Code { get; set; }
/// <summary>
/// 部门
/// </summary>
public string DepartmentNo { get; set; }
/// <summary>
/// 部门名称
/// </summary>
@@ -71,7 +66,7 @@ public class GainfoDetailResponse
public string Address { get; set; }
/// <summary>
/// 生日
/// 出生日期
/// </summary>
public DateTime Birthday { get; set; }
@@ -95,6 +90,11 @@ public class GainfoDetailResponse
/// </summary>
public string Degree { get; set; }
/// <summary>
/// 职级
/// </summary>
public string Title { get; set; }
/// <summary>
/// 人事范围
/// </summary>

View File

@@ -1,5 +1,4 @@
using Dlhis.Basic.BusinessPlace.Response;
using Dlhis.Basic.Device.Request;
using Dlhis.Basic.Device.Response;
using Dlhis.Basic.Device.Services;
using Dlhis.Basic.Organization.Request;
@@ -10,7 +9,6 @@ using Dlhis.Entity.Canteen.Enums;
using Dlhis.Entity.Device.Entities;
using Dlhis.Entity.Device.Enums;
using Dlhis.Entity.Sys.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
using Kurisu.Core.DataAccess.Dto;
using Kurisu.SqlSugar.Extensions;
using Kurisu.SqlSugar.Services;
@@ -157,6 +155,7 @@ public class GainfoPermissions : IGainfoPermissions
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
.LeftJoin<DeviceRegistryEntity>((d, dt, dr) => d.UniqueNo == dr.DeviceUniqueNo)
.LeftJoin<BusinessPlaceEntity>((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code)
.WhereIF(request.DeviceType.HasValue, d => d.Type == request.DeviceType)
.Where(d => ids.Contains(d.Code))
.Select((d, dt, dr, bp) => new DevicePageResponse
{

View File

@@ -424,46 +424,56 @@ public class GainfoService : IGainfoService
{
var info = await _gainfoStore.Queryable(request.Status)
.LeftJoin<DepartmentEntity>((ga, de) => ga.DepartmentNo == de.No)
.LeftJoin<BasicTypeEntity>((ga, de, type) => ga.Native == type.Code && type.Type == "native")
.LeftJoin<PositionEntity>((ga, de, type, posi) => ga.Position == posi.Name)
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2) => ga.CountryNo == type2.Code && type2.Type == "country")
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2, type3) => ga.Nation == type3.Code && type3.Type == "nation")
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2, type3, type4) => ga.IdClass == type4.Code && type4.Type == "cls")
.LeftJoin<PositionEntity>((ga, de, pos) => ga.PositionNo == pos.No)
.Where(ga => ga.No == request.No)
.Select((ga, de, type, posi, type2, type3, type4) => new GainfoDetailResponse
.Select((ga, de, pos) => new GainfoDetailResponse
{
No = ga.No,
SapNo = ga.SapNo,
Name = ga.Name,
Code = ga.Code,
DepartmentName = de.Name,
IdClass = ga.IdClass,
IdNo = ga.IdNo,
Gender = ga.Gender,
NativeName = type.Display,
Address = ga.Address,
Birthday = ga.Birthday,
Phone = ga.Phone,
Position = ga.Position,
Grade = posi.Grade,
Grade = ga.Grade,
Title = ga.Title,
Degree = ga.Degree,
Werks = ga.Werks,
CostId = ga.CostId,
Marital = ga.Marital == "Single" ? "未婚" : "已婚",
CountryName = type2.Display,
NationName = type3.Display,
ClassName = type4.Display,
Marital = "未知",
NativeName = ga.Native,
CountryName = ga.CountryNo,
NationName = ga.Nation,
ClassName = ga.IdClass,
Factory = ga.Factory,
OnboardingDate = ga.CreateTime,
DepartmentName = de.Name,
Position = pos.Name,
})
.FirstAsync();
.SingleAsync();
if (info != null)
{
var searchTypes = new List<string>() { "native", "country", "nation", "cls" };
var types = await _dbContext.Queryable<BasicTypeEntity>().Where(x => searchTypes.Contains(x.Type)).ToListAsync();
info.NativeName = types.Where(x => x.Type == "native").FirstOrDefault(x => x.Code == info.NativeName)?.Display;
info.CountryName = types.Where(x => x.Type == "country").FirstOrDefault(x => x.Code == info.CountryName)?.Display ?? "中国";
info.NationName = types.Where(x => x.Type == "nation").FirstOrDefault(x => x.Code == info.NationName)?.Display;
info.ClassName = types.Where(x => x.Type == "cls").FirstOrDefault(x => x.Code == info.ClassName)?.Display ?? "身份证";
if (request.WithFace)
{
info.Face = await _dbContext.ChangeDb("face").Queryable<GainfoFaceEntity>().Where(x => x.UserCode == info.Code).Select(x => x.Face).SingleAsync();
}
var tenantsResult = await _tenantApi.GetTenantsInternalAsync();
var tenants = tenantsResult.Data;
info.FactoryName = tenants.FirstOrDefault(x => x.Code == info.Factory)?.Name;
}
return info;

View File

@@ -34,7 +34,7 @@ public class OrderBookingResponse
/// 用户
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 部门名称
/// </summary>
@@ -76,4 +76,6 @@ public class OrderBookingResponse
/// 汇总数量
/// </summary>
public int TotalNumber { get; set; }
public object DishesInfos { get; set; }
}

View File

@@ -201,20 +201,26 @@ public class BookingOrderService : BaseOrderService, IBookingOrderService
UserCode = x.UserCode,
UserName = ga.Name,
Source = x.Source,
DepartmentName = dept.Name
DepartmentName = dept.Name,
})
.ToPageListAsync(request);
var nos = page.Data.Select(x => x.No).ToList();
var details = await DbContext.Queryable<CanteenOrderDetailEntity>()
.LeftJoin<DishesEntity>((x, dishes) => x.DishesCode == dishes.CustomCode)
.Where(x => nos.Contains(x.OrderNo))
.Select(x => new { x.OrderNo, x.BookingDate, x.Number }).
.Select((x, dishes) => new { x.OrderNo, x.BookingDate, x.Number, dishes.Name }).
ToListAsync();
page.Data.ForEach(x =>
{
x.BookingDate = details.FirstOrDefault(item => item.OrderNo == x.No).BookingDate;
x.TotalNumber = details.Where(item => item.OrderNo == x.No).Sum(item => item.Number);
x.DishesInfos = details.Where(item => item.OrderNo == x.No).Select(item => new
{
item.Name
})
.ToList();
});
return page;

View File

@@ -12,7 +12,7 @@ public class DepartmentEntity : SugarBaseEntity
/// <summary>
/// 部门号
/// </summary>
[SugarColumn(ColumnDescription = "部门号", IsNullable = false)]
[SugarColumn(ColumnDescription = "部门号", IsNullable = false, UniqueGroupNameList = new[] { "idx_Department_No" })]
public string No { get; set; }
/// <summary>
@@ -24,6 +24,6 @@ public class DepartmentEntity : SugarBaseEntity
/// <summary>
/// 部门名称
/// </summary>
[SugarColumn(ColumnDescription = "部门名称" , IsNullable = false)]
[SugarColumn(ColumnDescription = "部门名称", IsNullable = false)]
public string Name { get; set; }
}

View File

@@ -89,11 +89,11 @@ public class GainfoEntity : SugarBaseEntity
[SugarColumn(ColumnDescription = "身份证地址")]
public string Address { get; set; }
/// <summary>
/// 已婚/未婚
/// </summary>
[SugarColumn(ColumnDescription = "已婚/未婚")]
public string Marital { get; set; }
///// <summary>
///// 已婚/未婚
///// </summary>
//[SugarColumn(ColumnDescription = "已婚/未婚")]
//public string Marital { get; set; }
/// <summary>
/// 部门编码
@@ -123,7 +123,19 @@ public class GainfoEntity : SugarBaseEntity
/// 岗位
/// </summary>
[SugarColumn(ColumnDescription = "岗位")]
public string Position { get; set; }
public string PositionNo { get; set; }
/// <summary>
/// 职等
/// </summary>
[SugarColumn(ColumnDescription = "职等")]
public string Grade { get; set; }
/// <summary>
/// 职级
/// </summary>
[SugarColumn(ColumnDescription = "职级")]
public string Title { get; set; }
/// <summary>
/// 卡号

View File

@@ -12,7 +12,7 @@ public class PositionEntity : SugarBaseEntity
/// <summary>
/// 岗位编码
/// </summary>
[SugarColumn(ColumnDescription = "岗位编码")]
[SugarColumn(ColumnDescription = "岗位编码", IndexGroupNameList = new[] { "idx_position_No" })]
public string No { get; set; }
/// <summary>

View File

@@ -68,6 +68,16 @@ public class DeviceUploadLogPageRequest : PageDto, IValidatableObject
SearchDateTimePeriod.Start = SearchDateTimePeriod.Start.Value;
SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value;
}
else
{
if (SearchDateTimePeriod != null)
{
if (SearchDateTimePeriod.End.HasValue)
{
SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1);
}
}
}
yield break;
}

View File

@@ -72,7 +72,7 @@ public class JobPack : BaseAppPack
});
//处理餐补
RecurringJob.AddOrUpdate<MealSupplementHandlerJob>("MealSupplementHandler", s => s.RunAsync(), "0 0/1 * * * ?", new RecurringJobOptions
RecurringJob.AddOrUpdate<MealSupplementHandlerJob>("MealSupplementHandler", s => s.RunAsync(), "0 0 0/1 * * ?", new RecurringJobOptions
{
TimeZone = TimeZoneInfo.Local
});

View File

@@ -174,7 +174,9 @@ public class SyncPersonJob
Nation = item.nation,
Phone = item.phone,
Degree = item.email,
Position = item.web,
Grade = item.ZZ_ZD,
Title = item.Z_ZJ,
PositionNo = item.STELL,
Remark = item.remark,
Werks = item.WERKS,
CostId = item.KOSTL,
@@ -200,6 +202,9 @@ public class SyncPersonJob
email = item.email,
WERKS = item.WERKS,
KOSTL = item.KOSTL,
STELL = item.STELL,
Z_ZJ = item.Z_ZJ,
ZZ_ZD = item.ZZ_ZD,
ZZ_GZDJDNM = item.ZZ_GZDJDNM,
ZZ_GZDCQNM = item.ZZ_GZDCQNM,
})
@@ -217,7 +222,9 @@ public class SyncPersonJob
{
SapNo = item.PERNR,
Name = item.gname,
Position = item.web,
PositionNo = item.STELL,
Grade = item.ZZ_ZD,
Title = item.Z_ZJ,
Phone = item.phone,
DepartmentNo = item.appellation,
Remark = item.remark,

View File

@@ -12,11 +12,13 @@ public class SyncPositionJob
{
private readonly IDbContext _dbContext;
private readonly IJinkoSapService _jinkoSapService;
private readonly ILogger<SyncPositionJob> _logger;
public SyncPositionJob(IDbContext dbContext, IJinkoSapService jinkoSapService)
public SyncPositionJob(IDbContext dbContext, IJinkoSapService jinkoSapService, ILogger<SyncPositionJob> logger)
{
_dbContext = dbContext;
_jinkoSapService = jinkoSapService;
_logger = logger;
}
public async Task RunAsync()
@@ -25,6 +27,7 @@ public class SyncPositionJob
if (positionResult.Position != null && positionResult.Position.Items.Count > 0)
{
_logger.LogWarning("SAP岗位数量:{count}", positionResult.Position.Items.Count);
await SaveOrg(positionResult.Position.Items);
}
}
@@ -38,7 +41,7 @@ public class SyncPositionJob
{
position = new PositionEntity
{
No = item.ZDEPID,
No = item.ZJOBID,
Name = item.ZJOBNAME,
DepartmentNo = item.ZDEPID,
Grade = item.ZZWID

View File

@@ -14,4 +14,12 @@
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.8" />
</ItemGroup>
<ItemGroup>
<Content Update="ocelot.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
</Project>

View File

@@ -6,9 +6,10 @@ public class Program
public static void Main(string[] args)
{
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(builder =>
.ConfigureAppConfiguration((context, builder) =>
{
builder.AddJsonFile("ocelot.json", true, true);
builder.AddJsonFile($"ocelot.{context.HostingEnvironment.EnvironmentName}.json", true, true);
})
.ConfigureWebHostDefaults(webBuilder =>
{

View File

@@ -7,7 +7,7 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5001"
"applicationUrl": "http://*:6000"
}
},
"$schema": "https://json.schemastore.org/launchsettings.json"

View File

@@ -0,0 +1,93 @@
{
"Routes": [
{
"UpstreamPathTemplate": "/api/oauth2/{url}",
"DownstreamPathTemplate": "/api/{url}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5000
}
]
},
{
"UpstreamPathTemplate": "/api/common/{url}",
"DownstreamPathTemplate": "/api/{url}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5001
}
]
},
{
"UpstreamPathTemplate": "/api/sys/{url}",
"DownstreamPathTemplate": "/api/{url}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5003
}
]
},
{
"UpstreamPathTemplate": "/api/user/{url}",
"DownstreamPathTemplate": "/api/{url}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5004
}
]
},
{
"UpstreamPathTemplate": "/api/basic/{url}",
"DownstreamPathTemplate": "/api/{url}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5002
}
]
},
{
"UpstreamPathTemplate": "/api/scheduled/{url}",
"DownstreamPathTemplate": "/api/{url}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5010
}
]
},
{
"UpstreamPathTemplate": "/api/canteen/{url}",
"DownstreamPathTemplate": "/api/{url}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5008
}
]
},
{
"UpstreamPathTemplate": "/{url}/swagger/v1/swagger.json",
"DownstreamPathTemplate": "/{url}/swagger/v1/swagger.json",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 6000
}
]
}
],
"GlobalConfiguration": {}
}