| | |
| | | { |
| | | public class OrderDetailsService : ServiceBase<OrderDetails, IOrderDetailsRepository>, IOrderDetailsService |
| | | { |
| | | public OrderDetailsService(IOrderDetailsRepository BaseDal) : base(BaseDal) |
| | | private readonly IOrderrowsRepository _orderrowsRepository; |
| | | public OrderDetailsService(IOrderDetailsRepository BaseDal, IOrderrowsRepository orderrowsRepository) : base(BaseDal) |
| | | { |
| | | |
| | | _orderrowsRepository = orderrowsRepository; |
| | | } |
| | | |
| | | private static bool toggle = false; |
| | |
| | | Width = Convert.ToInt32(orderDetails.Orderdetails_width), |
| | | }; |
| | | useableStations = useableStations.OrderByDescending(x => x).ToList(); |
| | | if (orderDetails.Orderdetails_width < 60) |
| | | useableStations = useableStations.Where(x => x != 1).OrderByDescending(x => x).ToList(); |
| | | |
| | | if (orderDetails.Orderdetails_width <= 800 && orderDetails.Orderdetails_width >= 50)//1,2,3 |
| | | { |
| | | if (lastStaion == 0) |
| | |
| | | return toMesBarc; |
| | | } |
| | | |
| | | public OrderInfo GetOrderInfoByBarcode(string barcode) |
| | | { |
| | | try |
| | | { |
| | | OrderDetails orderDetails = BaseDal.QueryFirst(x => x.Orderdetails_outid == barcode); |
| | | if (orderDetails == null) |
| | | { |
| | | throw new Exception("æªæ¾å°æ¡ç 对åºè®¢åä¿¡æ¯"); |
| | | } |
| | | |
| | | Orderrows orderrows = _orderrowsRepository.QueryFirst(x => x.id == orderDetails.Orderrowsid); |
| | | if (orderrows == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°å¯¹åºè®¢å头信æ¯"); |
| | | } |
| | | |
| | | OrderInfo orderInfo = new OrderInfo() |
| | | { |
| | | Barcode = barcode, |
| | | Length = orderDetails.Orderdetails_length, |
| | | OrderBatch = orderrows.Orderrows_batchid, |
| | | OrderHeadId = orderrows.id, |
| | | OrderNo = orderrows.Orderrows_orderid, |
| | | OrderRowNum = orderrows.Orderrows_id, |
| | | Quantity = Convert.ToInt32(orderrows.Orderrows_num), |
| | | Thickness = orderDetails.Orderdetails_thickness, |
| | | Width = orderDetails.Orderdetails_width, |
| | | }; |
| | | return orderInfo; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |