fix 细节调整
This commit is contained in:
@@ -21,6 +21,7 @@ public class MiddleService : IMiddleService
|
||||
public async Task<OrderResultResponse> MiddleUploadAsync(BalanceRecordEntity entity)
|
||||
{
|
||||
entity.Id = 0;
|
||||
entity.Amount = -Math.Abs(entity.Amount);
|
||||
if (!await _dbContext.Queryable<BalanceRecordEntity>().AnyAsync(x => x.No == entity.No))
|
||||
{
|
||||
await _dbContext.InsertAsync(entity);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Dlhis.Middle.Api;
|
||||
using Dlhis.Middle.Request;
|
||||
using Dlhis.Middle.Response;
|
||||
using Dlhis.Middle.Services;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -18,11 +19,13 @@ namespace Dlhis.Middle.Controllers;
|
||||
public class AssignmentsController : ControllerBase
|
||||
{
|
||||
private readonly IAssignmentDeviceTaskApi _assignmentDeviceTaskApi;
|
||||
private readonly IHealthCheckService _healthCheckService;
|
||||
private readonly string _internalIp;
|
||||
|
||||
public AssignmentsController(IAssignmentDeviceTaskApi assignmentDeviceTaskApi, IConfiguration configuration)
|
||||
public AssignmentsController(IAssignmentDeviceTaskApi assignmentDeviceTaskApi, IConfiguration configuration, IHealthCheckService healthCheckService)
|
||||
{
|
||||
_assignmentDeviceTaskApi = assignmentDeviceTaskApi;
|
||||
_healthCheckService = healthCheckService;
|
||||
_internalIp = configuration.GetSection("InternalIP").Value;
|
||||
}
|
||||
|
||||
@@ -34,6 +37,14 @@ public class AssignmentsController : ControllerBase
|
||||
[HttpGet("deviceTasks")]
|
||||
public async Task<DefaultApiResult<List<DeviceTaskToDeviceByDeviceResponse>>> DeviceGetTasksGetAsync([FromQuery] DeviceTaskGetRequest request)
|
||||
{
|
||||
if (_healthCheckService.GetIsOffline())
|
||||
{
|
||||
return new DefaultApiResult<List<DeviceTaskToDeviceByDeviceResponse>>
|
||||
{
|
||||
Data = new List<DeviceTaskToDeviceByDeviceResponse>()
|
||||
};
|
||||
}
|
||||
|
||||
var result = await _assignmentDeviceTaskApi.DeviceGetTasksAsync(request);
|
||||
foreach (var data in result.Data)
|
||||
{
|
||||
@@ -48,6 +59,7 @@ public class AssignmentsController : ControllerBase
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -58,6 +70,14 @@ public class AssignmentsController : ControllerBase
|
||||
[IgnoreTenant]
|
||||
public async Task<DefaultApiResult<List<DeviceTaskToDeviceByDeviceResponse>>> DeviceGetTasksPostAsync(DeviceTaskGetRequest request)
|
||||
{
|
||||
if (_healthCheckService.GetIsOffline())
|
||||
{
|
||||
return new DefaultApiResult<List<DeviceTaskToDeviceByDeviceResponse>>
|
||||
{
|
||||
Data = new List<DeviceTaskToDeviceByDeviceResponse>()
|
||||
};
|
||||
}
|
||||
|
||||
var result = await _assignmentDeviceTaskApi.DeviceGetTasksAsync(request);
|
||||
foreach (var data in result.Data)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Dlhis.Middle.Api;
|
||||
using Dlhis.Middle.Request;
|
||||
using Dlhis.Middle.Request;
|
||||
using Dlhis.Middle.Response;
|
||||
using Dlhis.Middle.Services;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
@@ -32,6 +31,5 @@ public class OrdersController : ControllerBase
|
||||
public async Task<DefaultApiResult<OrderResultResponse>> AddAsync(OrderAddRequest request)
|
||||
{
|
||||
return await _orderService.AddAsync(request);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public class OrderService : IOrderService
|
||||
Source = request.Source,
|
||||
UserNo = gainfo.No,
|
||||
UserCode = gainfo.Code,
|
||||
Amount = request.Amount,
|
||||
Amount = -Math.Abs(request.Amount),
|
||||
BusinessPlaceCode = businessPlaceInfo?.Code,
|
||||
BusinessShiftCode = shift?.ShiftCode,
|
||||
ShiftType = shift?.ShiftType,
|
||||
|
||||
Reference in New Issue
Block a user