fix 补充注释,接口兼容设备
This commit is contained in:
@@ -69,7 +69,7 @@ public class BusinessPlacesController : ControllerBase
|
|||||||
/// <param name="placeCustomCode"></param>
|
/// <param name="placeCustomCode"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("shifts")]
|
[HttpGet("shifts")]
|
||||||
public async Task<List<BusinessPlaceShiftResponse>> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
public async Task<BusinessPlaceWithShiftResponse> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
||||||
{
|
{
|
||||||
return await _businessPlaceShiftService.GetShiftsByPlaceCustomCodeAsync(placeCustomCode);
|
return await _businessPlaceShiftService.GetShiftsByPlaceCustomCodeAsync(placeCustomCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using Dlhis.Basic.BusinessShift.Response;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.BusinessPlace.Response;
|
||||||
|
|
||||||
|
public class BusinessPlaceWithShiftResponse
|
||||||
|
{
|
||||||
|
public string CustomCode { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public List<BusinessPlaceShiftResponse> Shifts { get; set; }
|
||||||
|
}
|
||||||
@@ -14,6 +14,11 @@ public class BusinessPlaceShiftResponse
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string BusinessPlaceCustomCode { get; set; }
|
public string BusinessPlaceCustomCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点
|
||||||
|
/// </summary>
|
||||||
|
public string BusinessPlace { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 代号
|
/// 代号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Basic.BusinessShift.Request;
|
using Dlhis.Basic.BusinessPlace.Response;
|
||||||
|
using Dlhis.Basic.BusinessShift.Request;
|
||||||
using Dlhis.Basic.BusinessShift.Response;
|
using Dlhis.Basic.BusinessShift.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
@@ -10,5 +11,5 @@ public interface IBusinessPlaceShiftService : IScopeDependency
|
|||||||
|
|
||||||
Task SaveAsync(BusinessPlaceShiftSaveRequest request);
|
Task SaveAsync(BusinessPlaceShiftSaveRequest request);
|
||||||
|
|
||||||
Task<List<BusinessPlaceShiftResponse>> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode);
|
Task<BusinessPlaceWithShiftResponse> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Basic.BusinessShift.Request;
|
using Dlhis.Basic.BusinessPlace.Response;
|
||||||
|
using Dlhis.Basic.BusinessShift.Request;
|
||||||
using Dlhis.Basic.BusinessShift.Response;
|
using Dlhis.Basic.BusinessShift.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
@@ -29,6 +30,7 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
|||||||
Id = shift.Id,
|
Id = shift.Id,
|
||||||
BusinessPlaceCode = place.Code,
|
BusinessPlaceCode = place.Code,
|
||||||
BusinessPlaceCustomCode = place.CustomCode,
|
BusinessPlaceCustomCode = place.CustomCode,
|
||||||
|
BusinessPlace = place.Name,
|
||||||
Code = shift.Code,
|
Code = shift.Code,
|
||||||
CustomCode = shift.CustomCode,
|
CustomCode = shift.CustomCode,
|
||||||
Name = shift.Name,
|
Name = shift.Name,
|
||||||
@@ -66,24 +68,36 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<List<BusinessPlaceShiftResponse>> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
public async Task<BusinessPlaceWithShiftResponse> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
||||||
{
|
{
|
||||||
return await _dbContext.Queryable<CanteenBusinessShiftEntity>()
|
var place = await _dbContext.Queryable<CanteenBusinessPlaceEntity>().Where(x => x.CustomCode == placeCustomCode).FirstAsync();
|
||||||
.LeftJoin<CanteenBusinessPlaceEntity>((shift, place) => shift.BusinessPlaceCode == place.Code)
|
if (place == null)
|
||||||
.Where((shift, place) => place.CustomCode == placeCustomCode)
|
{
|
||||||
.OrderBy((shift, place) => shift.Start)
|
return new BusinessPlaceWithShiftResponse()
|
||||||
.Select((shift, place) => new BusinessPlaceShiftResponse
|
{
|
||||||
{
|
Shifts = new List<BusinessPlaceShiftResponse>()
|
||||||
Id = shift.Id,
|
};
|
||||||
BusinessPlaceCode = place.Code,
|
}
|
||||||
BusinessPlaceCustomCode = place.CustomCode,
|
var shifts = await _dbContext.Queryable<CanteenBusinessShiftEntity>().Where(x => x.BusinessPlaceCode == place.Code).ToListAsync();
|
||||||
Code = shift.Code,
|
|
||||||
CustomCode = shift.CustomCode,
|
return new BusinessPlaceWithShiftResponse
|
||||||
Name = shift.Name,
|
{
|
||||||
Start = shift.Start,
|
CustomCode = placeCustomCode,
|
||||||
End = shift.End
|
Name = place.Name,
|
||||||
})
|
Shifts = shifts.Select(shift => new BusinessPlaceShiftResponse
|
||||||
.ToListAsync();
|
{
|
||||||
|
Id = shift.Id,
|
||||||
|
BusinessPlaceCode = place.Code,
|
||||||
|
BusinessPlaceCustomCode = place.CustomCode,
|
||||||
|
BusinessPlace = place.Name,
|
||||||
|
Code = shift.Code,
|
||||||
|
CustomCode = shift.CustomCode,
|
||||||
|
Name = shift.Name,
|
||||||
|
Start = shift.Start,
|
||||||
|
End = shift.End
|
||||||
|
})
|
||||||
|
.ToList()
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//*********************************************** help methods ***************************************************//
|
//*********************************************** help methods ***************************************************//
|
||||||
|
|||||||
@@ -9,4 +9,9 @@ public class DeviceResigterRequest
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Required(ErrorMessage = "设备唯一编码不能为空")]
|
[Required(ErrorMessage = "设备唯一编码不能为空")]
|
||||||
public string UniqueNo { get; set; }
|
public string UniqueNo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点手工号; 可为空,后续在后台中设置
|
||||||
|
/// </summary>
|
||||||
|
public string BusinessCustomCode { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,7 @@
|
|||||||
|
|
||||||
public class DeviceNotSetBusinessPlaceResponse
|
public class DeviceNotSetBusinessPlaceResponse
|
||||||
{
|
{
|
||||||
|
public Guid Code { get; set; }
|
||||||
|
|
||||||
|
public string UniqueNo { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,12 +24,17 @@ public class DeviceConnectService : IDeviceConnectService
|
|||||||
var device = await GetEnableDeviceAsync(request.UniqueNo);
|
var device = await GetEnableDeviceAsync(request.UniqueNo);
|
||||||
|
|
||||||
var registry = await _dbContext.Queryable<DeviceRegistryEntity>().Where(x => x.DeviceUniqueNo == request.UniqueNo).FirstAsync();
|
var registry = await _dbContext.Queryable<DeviceRegistryEntity>().Where(x => x.DeviceUniqueNo == request.UniqueNo).FirstAsync();
|
||||||
|
var businessPlace = await _dbContext.Queryable<CanteenBusinessPlaceEntity>().Where(x => x.CustomCode == request.BusinessCustomCode).FirstAsync();
|
||||||
|
|
||||||
if (registry == null)
|
if (registry == null)
|
||||||
{
|
{
|
||||||
registry = new DeviceRegistryEntity()
|
registry = new DeviceRegistryEntity()
|
||||||
{
|
{
|
||||||
DeviceUniqueNo = request.UniqueNo,
|
DeviceUniqueNo = request.UniqueNo,
|
||||||
LastHeartbeatTime = DateTime.Now,
|
LastHeartbeatTime = DateTime.Now,
|
||||||
|
RegisterTime = DateTime.Now,
|
||||||
|
BusinessPlaceCode = businessPlace?.Code,
|
||||||
|
BusinessPlaceCustomCode = businessPlace?.CustomCode,
|
||||||
};
|
};
|
||||||
await _dbContext.InsertAsync(registry);
|
await _dbContext.InsertAsync(registry);
|
||||||
|
|
||||||
@@ -41,7 +46,7 @@ public class DeviceConnectService : IDeviceConnectService
|
|||||||
|
|
||||||
public async Task<List<DeviceNotSetBusinessPlaceResponse>> GetNotSetBusinessPlaceDevicesAsync()
|
public async Task<List<DeviceNotSetBusinessPlaceResponse>> GetNotSetBusinessPlaceDevicesAsync()
|
||||||
{
|
{
|
||||||
var devices = await _dbContext.Queryable<DeviceEntity>().ToListAsync();
|
var devices = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Enable).ToListAsync();
|
||||||
devices = devices.Where(x => x.Funcs.Any(item => item == DeviceFuncEnumType.Meal)).ToList();
|
devices = devices.Where(x => x.Funcs.Any(item => item == DeviceFuncEnumType.Meal)).ToList();
|
||||||
|
|
||||||
return devices.Adapt<List<DeviceNotSetBusinessPlaceResponse>>();
|
return devices.Adapt<List<DeviceNotSetBusinessPlaceResponse>>();
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Basic.Organization.Services;
|
using Dlhis.Basic.Organization.Services;
|
||||||
|
using Kurisu.AspNetCore.MVC;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Controllers;
|
namespace Dlhis.Basic.Organization.Controllers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门
|
/// sap部门
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[ApiDefinition("SAP", Description = "晶科sap组织架构信息")]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class DepartmentsController : ControllerBase
|
public class DepartmentsController : ControllerBase
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Basic.Organization.Services;
|
using Dlhis.Basic.Organization.Services;
|
||||||
|
using Kurisu.AspNetCore.MVC;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -8,9 +9,10 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
namespace Dlhis.Basic.MealUser.Controllers;
|
namespace Dlhis.Basic.MealUser.Controllers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 档案表
|
/// sap档案表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[ApiDefinition("SAP", Description = "晶科sap组织架构信息")]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class GainfosController : ControllerBase
|
public class GainfosController : ControllerBase
|
||||||
@@ -41,7 +43,6 @@ public class GainfosController : ControllerBase
|
|||||||
[HttpGet("page")]
|
[HttpGet("page")]
|
||||||
public async Task<Pagination<GainfoPageResponse>> GetPageAsync([FromQuery] GainfoPageRequest request)
|
public async Task<Pagination<GainfoPageResponse>> GetPageAsync([FromQuery] GainfoPageRequest request)
|
||||||
{
|
{
|
||||||
//var enums = await _enumSettingApi.GetEnums();
|
|
||||||
return await _gainfoService.GetPageAsync(request);
|
return await _gainfoService.GetPageAsync(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Basic.Organization.Services;
|
using Dlhis.Basic.Organization.Services;
|
||||||
|
using Kurisu.AspNetCore.MVC;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Controllers;
|
namespace Dlhis.Basic.Organization.Controllers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 人事范围
|
/// sap人事范围 tenant
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Authorize]
|
||||||
|
[ApiDefinition("SAP", Description = "晶科sap组织架构信息")]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class WerksController : ControllerBase
|
public class WerksController : ControllerBase
|
||||||
@@ -18,6 +22,10 @@ public class WerksController : ControllerBase
|
|||||||
_werkService = werkService;
|
_werkService = werkService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取人事范围列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpGet("list")]
|
[HttpGet("list")]
|
||||||
public async Task<List<WerkResponse>> GetListAsync()
|
public async Task<List<WerkResponse>> GetListAsync()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using SqlSugar;
|
namespace Dlhis.Basic.Organization.Response;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Response;
|
|
||||||
|
|
||||||
public class DepartmentTreeResponse
|
public class DepartmentTreeResponse
|
||||||
{
|
{
|
||||||
@@ -17,5 +15,5 @@ public class DepartmentTreeResponse
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 下级部门
|
/// 下级部门
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<DepartmentTreeResponse> Next { get; set; }
|
public List<DepartmentTreeResponse> Next { get; set; } = new List<DepartmentTreeResponse>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ public class SqlSugarPack : BaseAppPack
|
|||||||
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
//using var scope = app.ApplicationServices.CreateScope();
|
using var scope = app.ApplicationServices.CreateScope();
|
||||||
//var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
|
var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
|
||||||
//var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray();
|
var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray();
|
||||||
//db.DbMaintenance.CreateDatabase();
|
db.DbMaintenance.CreateDatabase();
|
||||||
//db.CodeFirst.InitTables(tables);
|
db.CodeFirst.InitTables(tables);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user