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>
 | 
			
		||||
       /// <returns></returns>
 | 
			
		||||
        [HttpPost("addwasherlist")]
 | 
			
		||||
        public async Task<IActionResult> AddWasherList(List<AddWasher> input)
 | 
			
		||||
        public async Task<IActionResult> AddWasherList([FromBody] List<AddWasher> input)
 | 
			
		||||
        {
 | 
			
		||||
            await _washerService.addWasher(input);
 | 
			
		||||
            return Ok(new ApiResult() { code = 0 });
 | 
			
		||||
| 
						 | 
				
			
			@ -97,7 +97,7 @@ namespace langguanApi.Controllers
 | 
			
		|||
        /// <param name="input"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        [HttpPost("addruckscaleslist")]
 | 
			
		||||
        public async Task<IActionResult> AddRuckScalesList(List<AddTruckScalesDto> input)
 | 
			
		||||
        public async Task<IActionResult> AddRuckScalesList([FromBody] List<AddTruckScalesDto> input)
 | 
			
		||||
        {
 | 
			
		||||
            await _truckScalesService.AddTruckScalesList(input);
 | 
			
		||||
            return Ok(new ApiResult() { code = 0 });    
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -154,7 +154,7 @@
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 添加洗车机
 | 
			
		||||
    /// 获取洗车机
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    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;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,7 +23,7 @@ namespace langguanApi.Service
 | 
			
		|||
            List<Washer> result = new List<Washer>();
 | 
			
		||||
            foreach (var item in input)
 | 
			
		||||
            {
 | 
			
		||||
                var entity = input.Adapt<Washer>();
 | 
			
		||||
                var entity = item.Adapt<Washer>();
 | 
			
		||||
                result.Add(entity);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -43,9 +43,9 @@ namespace langguanApi.Service
 | 
			
		|||
                var entity = item.Adapt<GetWasherDto>();
 | 
			
		||||
                entity.EquipmentStatusString = item.EquipmentStatus == 0 ? "异常" : "正常";
 | 
			
		||||
                entity.FaultAlarmString = item.FaultAlarm == 0 ? "异常" : "正常";
 | 
			
		||||
                entity.PSAlarmString=item.PSAlarm==0?"异常":"正常";
 | 
			
		||||
                entity.RunStatusString=item.RunStatus==0?"停止":"运行";
 | 
			
		||||
                entity.WPAlarmString=item.WPAlarm==0?"异常":"正常";
 | 
			
		||||
                entity.PSAlarmString = item.PSAlarm == 0 ? "异常" : "正常";
 | 
			
		||||
                entity.RunStatusString = item.RunStatus == 0 ? "停止" : "运行";
 | 
			
		||||
                entity.WPAlarmString = item.WPAlarm == 0 ? "异常" : "正常";
 | 
			
		||||
                washerResult.Add(entity);
 | 
			
		||||
            }
 | 
			
		||||
            return washerResult;
 | 
			
		||||
| 
						 | 
				
			
			@ -63,25 +63,28 @@ namespace langguanApi.Service
 | 
			
		|||
            foreach (var item in result)
 | 
			
		||||
            {
 | 
			
		||||
                var entity = item.Adapt<WasherHistoryDto>();
 | 
			
		||||
                entity.StateString=item.State==0?"停止":"运行";
 | 
			
		||||
                entity.StateString = item.State == 0 ? "停止" : "运行";
 | 
			
		||||
                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())
 | 
			
		||||
            {
 | 
			
		||||
                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