Merge branch 'master' of http://101.43.201.20:3000/yanghongwei/lg_backend
This commit is contained in:
commit
e3c18ba952
|
|
@ -61,7 +61,7 @@ namespace langguanApi.Controllers
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("addwasherlist")]
|
[HttpPost("addwasherlist")]
|
||||||
public async Task<IActionResult> AddWasherList(List<AddWasher> input)
|
public async Task<IActionResult> AddWasherList([FromBody] List<AddWasher> input)
|
||||||
{
|
{
|
||||||
await _washerService.addWasher(input);
|
await _washerService.addWasher(input);
|
||||||
return Ok(new ApiResult() { code = 0 });
|
return Ok(new ApiResult() { code = 0 });
|
||||||
|
|
@ -97,7 +97,7 @@ namespace langguanApi.Controllers
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("addruckscaleslist")]
|
[HttpPost("addruckscaleslist")]
|
||||||
public async Task<IActionResult> AddRuckScalesList(List<AddTruckScalesDto> input)
|
public async Task<IActionResult> AddRuckScalesList([FromBody] List<AddTruckScalesDto> input)
|
||||||
{
|
{
|
||||||
await _truckScalesService.AddTruckScalesList(input);
|
await _truckScalesService.AddTruckScalesList(input);
|
||||||
return Ok(new ApiResult() { code = 0 });
|
return Ok(new ApiResult() { code = 0 });
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加洗车机
|
/// 获取洗车机
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GetWasherDto
|
public class GetWasherDto
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -110,15 +110,18 @@ namespace langguanApi.Service
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrWhiteSpace(input.startTime))
|
if (result.Any())
|
||||||
{
|
{
|
||||||
result.Where(p => Convert.ToDateTime(p.Time) >= Convert.ToDateTime(input.startTime)).ToList();
|
if (!string.IsNullOrWhiteSpace(input.startTime))
|
||||||
|
{
|
||||||
|
result.Where(p => Convert.ToDateTime(p.Time) >= Convert.ToDateTime(input.startTime)).ToList();
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrWhiteSpace(input.endTime))
|
||||||
|
{
|
||||||
|
result.Where(p => Convert.ToDateTime(p.Time) <= Convert.ToDateTime(input.endTime)).ToList();
|
||||||
|
}
|
||||||
|
result = result.Skip(input.current - 1).Take(input.pageSize).ToList();
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrWhiteSpace(input.endTime))
|
|
||||||
{
|
|
||||||
result.Where(p => Convert.ToDateTime(p.Time) <=Convert.ToDateTime(input.endTime)).ToList();
|
|
||||||
}
|
|
||||||
result = result.Skip(input.current - 1).Take(input.pageSize).ToList();
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ namespace langguanApi.Service
|
||||||
List<Washer> result = new List<Washer>();
|
List<Washer> result = new List<Washer>();
|
||||||
foreach (var item in input)
|
foreach (var item in input)
|
||||||
{
|
{
|
||||||
var entity = input.Adapt<Washer>();
|
var entity = item.Adapt<Washer>();
|
||||||
result.Add(entity);
|
result.Add(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
await base.CreateManyAsync(result);
|
await base.CreateManyAsync(result);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -43,9 +43,9 @@ namespace langguanApi.Service
|
||||||
var entity = item.Adapt<GetWasherDto>();
|
var entity = item.Adapt<GetWasherDto>();
|
||||||
entity.EquipmentStatusString = item.EquipmentStatus == 0 ? "异常" : "正常";
|
entity.EquipmentStatusString = item.EquipmentStatus == 0 ? "异常" : "正常";
|
||||||
entity.FaultAlarmString = item.FaultAlarm == 0 ? "异常" : "正常";
|
entity.FaultAlarmString = item.FaultAlarm == 0 ? "异常" : "正常";
|
||||||
entity.PSAlarmString=item.PSAlarm==0?"异常":"正常";
|
entity.PSAlarmString = item.PSAlarm == 0 ? "异常" : "正常";
|
||||||
entity.RunStatusString=item.RunStatus==0?"停止":"运行";
|
entity.RunStatusString = item.RunStatus == 0 ? "停止" : "运行";
|
||||||
entity.WPAlarmString=item.WPAlarm==0?"异常":"正常";
|
entity.WPAlarmString = item.WPAlarm == 0 ? "异常" : "正常";
|
||||||
washerResult.Add(entity);
|
washerResult.Add(entity);
|
||||||
}
|
}
|
||||||
return washerResult;
|
return washerResult;
|
||||||
|
|
@ -63,25 +63,28 @@ namespace langguanApi.Service
|
||||||
foreach (var item in result)
|
foreach (var item in result)
|
||||||
{
|
{
|
||||||
var entity = item.Adapt<WasherHistoryDto>();
|
var entity = item.Adapt<WasherHistoryDto>();
|
||||||
entity.StateString=item.State==0?"停止":"运行";
|
entity.StateString = item.State == 0 ? "停止" : "运行";
|
||||||
washerHistroyResult.Add(entity);
|
washerHistroyResult.Add(entity);
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrWhiteSpace(input.startTime))
|
|
||||||
{
|
|
||||||
washerHistroyResult = washerHistroyResult.Where(p => Convert.ToDateTime(p.Time) >= Convert.ToDateTime(input.startTime)).ToList();
|
|
||||||
}
|
|
||||||
if (!string.IsNullOrWhiteSpace(input.endTime))
|
|
||||||
{
|
|
||||||
washerHistroyResult = washerHistroyResult.Where(p => Convert.ToDateTime(p.Time) <= Convert.ToDateTime(input.endTime)).ToList();
|
|
||||||
}
|
|
||||||
if (washerHistroyResult.Any())
|
if (washerHistroyResult.Any())
|
||||||
{
|
{
|
||||||
washerHistroyResult = washerHistroyResult.OrderByDescending(p => p.Time).Take(30).ToList();
|
if (!string.IsNullOrWhiteSpace(input.startTime))
|
||||||
|
{
|
||||||
|
washerHistroyResult = washerHistroyResult.Where(p => Convert.ToDateTime(p.Time) >= Convert.ToDateTime(input.startTime)).ToList();
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrWhiteSpace(input.endTime))
|
||||||
|
{
|
||||||
|
washerHistroyResult = washerHistroyResult.Where(p => Convert.ToDateTime(p.Time) <= Convert.ToDateTime(input.endTime)).ToList();
|
||||||
|
}
|
||||||
|
if (string.IsNullOrWhiteSpace(input.startTime) && string.IsNullOrWhiteSpace(input.endTime))
|
||||||
|
{
|
||||||
|
washerHistroyResult = washerHistroyResult.OrderByDescending(p => p.Time).Take(30).ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return washerHistroyResult;
|
||||||
}
|
}
|
||||||
return washerHistroyResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue