1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using wms.dto.response.hj;
- using wms.service.IService;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using wms.service.Service.StrategyService;
- namespace wms.service.Service
- {
- /// <summary>
- /// 先入先出策略
- /// </summary>
- public class FIFOStrategyService : IWorkStrategyService
- {
- public List<LocationForStrategyInfo> Filter(List<LocationForStrategyInfo> listLocation)
- {
- if (listLocation == null || !listLocation.Any())
- {
- return listLocation;
- }
- //List<LocationForStrategyInfo> list = null;
- if (_isContainer)
- {
- listLocation.Sort(new LocationForStrategyInfoComparer("LastInTime"));
- }
- else
- {
- //listLocation.Sort(new LocationForStrategyInfoComparer("InTime"));//按照实际入库时间
- listLocation.Sort(new LocationForStrategyInfoComparer("ProductTime"));//按照生产时间先进先出
- }
- if (_days > 0)
- {
- //根据天数进行处理结果集
- }
- return listLocation.ToList();
- }
- private int _days { get; set; }
- private bool _isContainer { get; set; }
- private FIFOStrategyService() { }
- /// <summary>
- /// 几天认为是一个同等时间点
- /// </summary>
- /// <param name="days"></param>
- public FIFOStrategyService(int days, bool isContainer)
- {
- _days = days;
- _isContainer = isContainer;
- }
- }
- }
|