| | |
| | | return responseContent.OK("ææå
¥åºåå·²åå¨ï¼æ éæ°å¢"); |
| | | } |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | try |
| | | { |
| | | List<Dt_CabinOrder> _CabinOrders = new List<Dt_CabinOrder>(); |
| | | //åå¨å
¥åºåå· |
| | | List<string> orderNos = new List<string>(); |
| | | //åå¨å
¥åºåå· |
| | | List<string> orderNos = new List<string>(); |
| | | |
| | | foreach (var order in newOrders) |
| | | foreach (var order in newOrders) |
| | | { |
| | | try |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (order.order_type == "1") //æ£å¸¸å
¥åº |
| | | { |
| | | responseContent = _cabinOrderServices.CreateInboundOrder(order); |
| | | if (!responseContent.Status) throw new Exception(responseContent.Message); |
| | | List<Dt_CabinOrder>? dt_CabinOrders = responseContent.Data as List<Dt_CabinOrder>; |
| | | if (dt_CabinOrders != null) _CabinOrders.AddRange(dt_CabinOrders); |
| | | if (dt_CabinOrders != null) |
| | | _cabinOrderServices.Db.InsertNav(dt_CabinOrders).Include(x => x.Details).ExecuteCommand(); |
| | | } |
| | | else if (order.order_type == "3")//å
¥åºéæ |
| | | { |
| | |
| | | }; |
| | | upstramOutOrderInfo.details.Add(detail); |
| | | } |
| | | _deliveryOrderServices.CreateOutboundOrder(upstramOutOrderInfo); |
| | | var content = _deliveryOrderServices.CreateOutboundOrder(upstramOutOrderInfo); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | #endregion |
| | | } |
| | | else if (order.order_type == "5")//æ¥æº¢å
¥åº |
| | | { |
| | | _cabinOrderServices.CreateCheckInOrder(order); |
| | | var content = _cabinOrderServices.CreateCheckInOrder(order); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | } |
| | | }; |
| | | _cabinOrderServices.Db.InsertNav(_CabinOrders).Include(x => x.Details).ExecuteCommand(); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | SendErrorToUpstream(1, "", ex.Message, ""); |
| | | return responseContent.Error("åæ¥å¤±è´¥: " + ex.Message); |
| | | } |
| | | }; |
| | | |
| | | //å¨ä¸åç»wcs |
| | | //EdiIn(); //åç»ä¸æ¸¸ |
| | | //妿è¿ä¸ªæ¹æ³æåäºï¼é£ä¹å°±è°ç¨CompleteOrderæ¥å£ï¼ç¶åæ¹å |
| | | _unitOfWorkManage.CommitTran(); |
| | | return responseContent.OK("忥å
¥åºåæå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | SendErrorToUpstream(1, "", ex.Message, ""); |
| | | return responseContent.Error("åæ¥å¤±è´¥: " + ex.Message); |
| | | } |
| | | //å¨ä¸åç»wcs |
| | | //EdiIn(); //åç»ä¸æ¸¸ |
| | | //妿è¿ä¸ªæ¹æ³æåäºï¼é£ä¹å°±è°ç¨CompleteOrderæ¥å£ï¼ç¶åæ¹å |
| | | return responseContent.OK("忥å
¥åºåæå"); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | if (outorder.order_type == "1") // æ£å¸¸åºåºå |
| | | { |
| | | _deliveryOrderServices.CreateOutboundOrder(outorder);//å建åºåºåãå¤çåºåãæ·»å åºåºä»»å¡ |
| | | var content = _deliveryOrderServices.CreateOutboundOrder(outorder); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | } |
| | | else if (outorder.order_type == "2")//åºåºéè´§ |
| | | { |
| | |
| | | order.details.Add(detail); |
| | | } |
| | | responseContent = _cabinOrderServices.CreateInboundOrder(order); |
| | | if (!responseContent.Status) throw new Exception(responseContent.Message); |
| | | List<Dt_CabinOrder>? dt_CabinOrders = responseContent.Data as List<Dt_CabinOrder>; |
| | | if (dt_CabinOrders != null && dt_CabinOrders.Count > 0) |
| | | _cabinOrderServices.Db.InsertNav(dt_CabinOrders).Include(x => x.Details).ExecuteCommand(); |
| | |
| | | } |
| | | else if (outorder.order_type == "6")//æ¥æåºåº |
| | | { |
| | | _deliveryOrderServices.CreateCheckOutOrder(outorder); |
| | | var content = _deliveryOrderServices.CreateCheckOutOrder(outorder); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | } |
| | | } |
| | | |