| | |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Log; |
| | | using WIDESEA_Core.LogHelper; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEA_IBasicRepository; |
| | |
| | | Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x=>x.LABEL_NO == item.LABEL_NO); |
| | | if (labMaster != null)//æ´æ°ç¶æ |
| | | { |
| | | labMaster.RECEIPT_NO = item.RECEIPT_NO; |
| | | labMaster.QC_RESULT_CODE = item.QC_RESULT_CODE; |
| | | labMaster.LABEL_STATUS = item.LABEL_STATUS; |
| | | _labelMasterRepository.UpdateData(labMaster); |
| | | } |
| | | else |
| | | { |
| | | item.WH_NUMBER = AppSettings.Configuration["SYSNO"]; |
| | | _labelMasterRepository.AddData(item); |
| | | } |
| | | } |
| | |
| | | |
| | | string inparam = JsonConvert.SerializeObject(putAway); |
| | | new LogFactory().GetLog("BYD_WMSæ¥å£").InfoFormat(true, "CallPutAway", "请æ±", $"{inparam}"); |
| | | //Logger.Write_Log("System/test_in", "", "inparam = " + inparam); |
| | | string response = likuClient.putaway(inparam); |
| | | //Logger.Write_Log("System/test_in", "", "response = " + response); |
| | | new LogFactory().GetLog("BYD_WMSæ¥å£").InfoFormat(true, "CallPutAway", "ååº", $"{response}"); |
| | | if (response != null) |
| | | { |
| | | PutAwayResponse res = JsonConvert.DeserializeObject<PutAwayResponse>(response); |
| | | if (res != null && res.MSGTX == "S") |
| | | if (res != null && res.MSGTY == "S") |
| | | { |
| | | content = WebResponseContent.Instance.OK("䏿¶åä¼ æå"); |
| | | new LogFactory().GetLog("BYD_WMSæ¥å£").InfoFormat(true, "CallPutAway", "ååº", $"䏿¶åä¼ æåï¼"); |
| | |
| | | |
| | | string inparam = JsonConvert.SerializeObject(putAwayReturn); |
| | | new LogFactory().GetLog("BYD_WMSæ¥å£").InfoFormat(true, "CallPutAwayReturn", "请æ±", $"{inparam}"); |
| | | //Logger.Write_Log("System/test_re", "", "inparam = "+ inparam); |
| | | string response = likuClient.putAwayReturn(inparam); |
| | | //Logger.Write_Log("System/test_re", "", "response = " + response); |
| | | if (response != null) |
| | | { |
| | | PutAwayReturnResponse res = JsonConvert.DeserializeObject<PutAwayReturnResponse>(response); |
| | | if (res != null && res.MSGTX == "S") |
| | | if (res != null && res.MSGTY == "S") |
| | | { |
| | | content = WebResponseContent.Instance.OK("䏿¶åä¼ æåï¼"); |
| | | new LogFactory().GetLog("BYD_WMSæ¥å£").InfoFormat(true, "CallPutAwayReturn", "ååº", $"䏿¶åä¼ æåï¼"); |
| | |
| | | outStoreOrder.WERKS = AppSettings.Configuration["WERKS"]; |
| | | outStoreOrder.WH_NUMBER = AppSettings.Configuration["SYSNO"]; |
| | | string inparam = JsonConvert.SerializeObject(outStoreOrder); |
| | | //string response = client.selectOutStoreOrder(inparam); |
| | | string response = "{\r\n \"MSGTY\": \"S\",\r\n \"DATA\": \"[{REQUIREMENT_NO=XAXQGX25012005354, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:å®åè¶
, CREATE_DATE=2024-12-18 11:36:17, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}, {REQUIREMENT_NO=XAXQGX25012005353, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:å®åè¶
, CREATE_DATE=2024-12-18 11:35:22, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}]\",\r\n \"MSGTX\": \"success\"\r\n}"; |
| | | string response = client.selectOutStoreOrder(inparam); |
| | | //string response = "{\r\n \"MSGTY\": \"S\",\r\n \"DATA\": \"[{REQUIREMENT_NO=XAXQGX25012005354, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:å®åè¶
, CREATE_DATE=2024-12-18 11:36:17, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}, {REQUIREMENT_NO=XAXQGX25012005353, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:å®åè¶
, CREATE_DATE=2024-12-18 11:35:22, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}]\",\r\n \"MSGTX\": \"success\"\r\n}"; |
| | | if (response != null) |
| | | { |
| | | SelectOutStoreOrderResponse res = JsonConvert.DeserializeObject<SelectOutStoreOrderResponse>(response); |
| | | if (res != null && res.MSGTY == "S"&&!string.IsNullOrEmpty(res.DATA)) |
| | | if (res != null && res.MSGTY == "S") |
| | | { |
| | | string data = stringToJson(res.DATA); |
| | | string newdata = data.Replace("},\"", "},").Replace("\" ", "\""); |
| | | List<OutStoreData> outStoreList = JsonConvert.DeserializeObject<List<OutStoreData>>(newdata); |
| | | foreach (var item in outStoreList) |
| | | if (string.IsNullOrEmpty(res.DATA) || res.DATA == "[]") |
| | | { |
| | | Dt_OutBoundOrderBYD bydOrder = _outBoundOrderBYDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO); |
| | | if (bydOrder != null)//æ´æ° |
| | | { |
| | | |
| | | bydOrder.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | bydOrder.WRKS = item.WERKS; |
| | | bydOrder.WH_NUMBER = item.WH_NUMBER; |
| | | bydOrder.SYSNOD = item.SYSNOD; |
| | | bydOrder.BUSINESS_CODE = item.BUSINESS_CODE; |
| | | bydOrder.BUSINESS_NAME = item.BUSINESS_NAME; |
| | | bydOrder.LGORT = item.LGORT; |
| | | bydOrder.STATION = item.STATION; |
| | | bydOrder.MO_NO = item.MO_NO; |
| | | bydOrder.SAP_OUT_NO = item.SAP_OUT_NO; |
| | | bydOrder.RECEIVE_LGORT = item.RECEIVE_LGORT; |
| | | bydOrder.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG; |
| | | bydOrder.SPLIT = item.SPLIT; |
| | | bydOrder.STATUS = item.STATUS; |
| | | bydOrder.CREATE_PERSON = item.CREATE_PERSON; |
| | | bydOrder.CREATE_DATE = item.CREATE_DATE; |
| | | _outBoundOrderBYDRepository.UpdateData(bydOrder); |
| | | foreach (var detail in item.ITEMS) |
| | | { |
| | | Dt_OutboundOrderDetailBYD byddetail = _outboundOrderDetailByDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO && x.REQUIREMENT_ITEM_NO == detail.REQUIREMENT_ITEM_NO); |
| | | if (byddetail != null) |
| | | { |
| | | byddetail.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | byddetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO; |
| | | byddetail.MATNR = detail.MATNR; |
| | | byddetail.BATCH = detail.BATCH; |
| | | byddetail.BATCH = detail.BATCH; |
| | | byddetail.QTY = detail.QTY; |
| | | byddetail.GEAR = detail.GEAR; |
| | | byddetail.PI_NO = detail.PI_NO; |
| | | _outboundOrderDetailByDRepository.UpdateData(byddetail); |
| | | } |
| | | else |
| | | { |
| | | Dt_OutboundOrderDetailBYD newdetail = new Dt_OutboundOrderDetailBYD(); |
| | | newdetail.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | newdetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO; |
| | | newdetail.MATNR = detail.MATNR; |
| | | newdetail.BATCH = detail.BATCH; |
| | | newdetail.BATCH = detail.BATCH; |
| | | newdetail.QTY = detail.QTY; |
| | | newdetail.GEAR = detail.GEAR; |
| | | newdetail.PI_NO = detail.PI_NO; |
| | | _outboundOrderDetailByDRepository.AddData(newdetail); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | Dt_OutBoundOrderBYD outBoundOrderBYD = new Dt_OutBoundOrderBYD(); |
| | | outBoundOrderBYD.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | outBoundOrderBYD.WRKS = item.WERKS; |
| | | outBoundOrderBYD.WH_NUMBER = item.WH_NUMBER; |
| | | outBoundOrderBYD.SYSNOD = item.SYSNOD; |
| | | outBoundOrderBYD.BUSINESS_CODE = item.BUSINESS_CODE; |
| | | outBoundOrderBYD.BUSINESS_NAME = item.BUSINESS_NAME; |
| | | outBoundOrderBYD.LGORT = item.LGORT; |
| | | outBoundOrderBYD.STATION = item.STATION; |
| | | outBoundOrderBYD.MO_NO = item.MO_NO; |
| | | outBoundOrderBYD.SAP_OUT_NO = item.SAP_OUT_NO; |
| | | outBoundOrderBYD.RECEIVE_LGORT = item.RECEIVE_LGORT; |
| | | outBoundOrderBYD.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG; |
| | | outBoundOrderBYD.SPLIT = item.SPLIT; |
| | | outBoundOrderBYD.STATUS = item.STATUS; |
| | | outBoundOrderBYD.CREATE_PERSON = item.CREATE_PERSON; |
| | | outBoundOrderBYD.CREATE_DATE = item.CREATE_DATE; |
| | | _outBoundOrderBYDRepository.AddData(outBoundOrderBYD); |
| | | foreach (var detail in item.ITEMS) |
| | | { |
| | | Dt_OutboundOrderDetailBYD outboundOrderDetailBYD = new Dt_OutboundOrderDetailBYD(); |
| | | outboundOrderDetailBYD.REQUIREMENT_NO = outBoundOrderBYD.REQUIREMENT_NO; |
| | | outboundOrderDetailBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO; |
| | | outboundOrderDetailBYD.MATNR = detail.MATNR; |
| | | outboundOrderDetailBYD.BATCH = detail.BATCH; |
| | | outboundOrderDetailBYD.QTY = detail.QTY; |
| | | outboundOrderDetailBYD.GEAR = detail.GEAR; |
| | | outboundOrderDetailBYD.PI_NO = detail.PI_NO; |
| | | _outboundOrderDetailByDRepository.AddData(outboundOrderDetailBYD); |
| | | foreach (var label in detail.LABELS) |
| | | { |
| | | if (label != null) |
| | | { |
| | | Dt_OutboundOrderDetail_LabelsBYD outboundOrderDetail_LabelsBYD = new Dt_OutboundOrderDetail_LabelsBYD(); |
| | | outboundOrderDetail_LabelsBYD.LABEL_NO = label.LABLEL_NO; |
| | | outboundOrderDetail_LabelsBYD.CONTENT_LABEL_NO = label.CONTENT_LABLEL_NO; |
| | | outboundOrderDetail_LabelsBYD.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | outboundOrderDetail_LabelsBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO; |
| | | _outboundOrderDetailLabelsByDRepository.AddData(outboundOrderDetail_LabelsBYD); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | content = WebResponseContent.Instance.Error("åºåºåæ°æ®ä¸ºç©º"); |
| | | } |
| | | |
| | | //忥å°WMSåºåºåä¸ |
| | | foreach(var item in outStoreList) |
| | | else |
| | | { |
| | | if (item != null) |
| | | string data = stringToJson(res.DATA); |
| | | string newdata = data.Replace("},\"", "},").Replace("\" ", "\""); |
| | | List<OutStoreData> outStoreList = JsonConvert.DeserializeObject<List<OutStoreData>>(newdata); |
| | | foreach (var item in outStoreList) |
| | | { |
| | | Dt_OutboundOrder outOrder =_outboundOrderRepository.QueryFirst(x=>x.OrderNo==item.REQUIREMENT_NO); |
| | | if (outOrder != null) |
| | | Dt_OutBoundOrderBYD bydOrder = _outBoundOrderBYDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO); |
| | | if (bydOrder != null)//æ´æ° |
| | | { |
| | | outOrder.OrderNo = item.REQUIREMENT_NO; |
| | | outOrder.UpperOrderNo = ""; |
| | | outOrder.OrderType = (int)OutOrderTypeEnum.Issue; |
| | | outOrder.OrderStatus = (int)OutboundStatusEnum.æªå¼å§; |
| | | outOrder.CreateType = (int)CreateType.UpperSystemPush; |
| | | outOrder.Creater = "System"; |
| | | |
| | | _outboundOrderRepository.UpdateData(outOrder); |
| | | foreach (var orderdetail in item.ITEMS) |
| | | |
| | | bydOrder.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | bydOrder.WRKS = item.WERKS; |
| | | bydOrder.WH_NUMBER = item.WH_NUMBER; |
| | | bydOrder.SYSNOD = item.SYSNOD; |
| | | bydOrder.BUSINESS_CODE = item.BUSINESS_CODE; |
| | | bydOrder.BUSINESS_NAME = item.BUSINESS_NAME; |
| | | bydOrder.LGORT = item.LGORT; |
| | | bydOrder.STATION = item.STATION; |
| | | bydOrder.MO_NO = item.MO_NO; |
| | | bydOrder.SAP_OUT_NO = item.SAP_OUT_NO; |
| | | bydOrder.RECEIVE_LGORT = item.RECEIVE_LGORT; |
| | | bydOrder.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG; |
| | | bydOrder.SPLIT = item.SPLIT; |
| | | bydOrder.STATUS = item.STATUS; |
| | | bydOrder.CREATE_PERSON = item.CREATE_PERSON; |
| | | bydOrder.CREATE_DATE = item.CREATE_DATE; |
| | | _outBoundOrderBYDRepository.UpdateData(bydOrder); |
| | | foreach (var detail in item.ITEMS) |
| | | { |
| | | Dt_OutboundOrderDetail detail = _outboundOrderDetailRepository.QueryFirst(x => x.OrderId == outOrder.Id && x.Remark == orderdetail.REQUIREMENT_ITEM_NO); |
| | | if (detail != null) |
| | | Dt_OutboundOrderDetailBYD byddetail = _outboundOrderDetailByDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO && x.REQUIREMENT_ITEM_NO == detail.REQUIREMENT_ITEM_NO); |
| | | if (byddetail != null) |
| | | { |
| | | detail.OrderId = outOrder.Id; |
| | | detail.MaterielCode = orderdetail.MATNR; |
| | | detail.BatchNo = orderdetail.BATCH; |
| | | detail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY); |
| | | detail.LockQuantity = 0; |
| | | detail.OverOutQuantity = 0; |
| | | detail.OrderDetailStatus = (int)OrderDetailStatusEnum.New; |
| | | detail.Creater = "System"; |
| | | detail.Remark = orderdetail.REQUIREMENT_ITEM_NO; |
| | | _outboundOrderDetailRepository.UpdateData(detail); |
| | | byddetail.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | byddetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO; |
| | | byddetail.MATNR = detail.MATNR; |
| | | byddetail.BATCH = detail.BATCH; |
| | | byddetail.BATCH = detail.BATCH; |
| | | byddetail.QTY = detail.QTY; |
| | | byddetail.GEAR = detail.GEAR; |
| | | byddetail.PI_NO = detail.PI_NO; |
| | | _outboundOrderDetailByDRepository.UpdateData(byddetail); |
| | | } |
| | | else |
| | | { |
| | | Dt_OutboundOrderDetailBYD newdetail = new Dt_OutboundOrderDetailBYD(); |
| | | newdetail.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | newdetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO; |
| | | newdetail.MATNR = detail.MATNR; |
| | | newdetail.BATCH = detail.BATCH; |
| | | newdetail.BATCH = detail.BATCH; |
| | | newdetail.QTY = detail.QTY; |
| | | newdetail.GEAR = detail.GEAR; |
| | | newdetail.PI_NO = detail.PI_NO; |
| | | _outboundOrderDetailByDRepository.AddData(newdetail); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | Dt_OutBoundOrderBYD outBoundOrderBYD = new Dt_OutBoundOrderBYD(); |
| | | outBoundOrderBYD.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | outBoundOrderBYD.WRKS = item.WERKS; |
| | | outBoundOrderBYD.WH_NUMBER = item.WH_NUMBER; |
| | | outBoundOrderBYD.SYSNOD = item.SYSNOD; |
| | | outBoundOrderBYD.BUSINESS_CODE = item.BUSINESS_CODE; |
| | | outBoundOrderBYD.BUSINESS_NAME = item.BUSINESS_NAME; |
| | | outBoundOrderBYD.LGORT = item.LGORT; |
| | | outBoundOrderBYD.STATION = item.STATION; |
| | | outBoundOrderBYD.MO_NO = item.MO_NO; |
| | | outBoundOrderBYD.SAP_OUT_NO = item.SAP_OUT_NO; |
| | | outBoundOrderBYD.RECEIVE_LGORT = item.RECEIVE_LGORT; |
| | | outBoundOrderBYD.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG; |
| | | outBoundOrderBYD.SPLIT = item.SPLIT; |
| | | outBoundOrderBYD.STATUS = item.STATUS; |
| | | outBoundOrderBYD.CREATE_PERSON = item.CREATE_PERSON; |
| | | outBoundOrderBYD.CREATE_DATE = item.CREATE_DATE; |
| | | _outBoundOrderBYDRepository.AddData(outBoundOrderBYD); |
| | | foreach (var detail in item.ITEMS) |
| | | { |
| | | Dt_OutboundOrderDetailBYD outboundOrderDetailBYD = new Dt_OutboundOrderDetailBYD(); |
| | | outboundOrderDetailBYD.REQUIREMENT_NO = outBoundOrderBYD.REQUIREMENT_NO; |
| | | outboundOrderDetailBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO; |
| | | outboundOrderDetailBYD.MATNR = detail.MATNR; |
| | | outboundOrderDetailBYD.BATCH = detail.BATCH; |
| | | outboundOrderDetailBYD.QTY = detail.QTY; |
| | | outboundOrderDetailBYD.GEAR = detail.GEAR; |
| | | outboundOrderDetailBYD.PI_NO = detail.PI_NO; |
| | | _outboundOrderDetailByDRepository.AddData(outboundOrderDetailBYD); |
| | | foreach (var label in detail.LABELS) |
| | | { |
| | | if (label != null) |
| | | { |
| | | Dt_OutboundOrderDetail_LabelsBYD outboundOrderDetail_LabelsBYD = new Dt_OutboundOrderDetail_LabelsBYD(); |
| | | outboundOrderDetail_LabelsBYD.LABEL_NO = label.LABLEL_NO; |
| | | outboundOrderDetail_LabelsBYD.CONTENT_LABEL_NO = label.CONTENT_LABLEL_NO; |
| | | outboundOrderDetail_LabelsBYD.REQUIREMENT_NO = item.REQUIREMENT_NO; |
| | | outboundOrderDetail_LabelsBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO; |
| | | _outboundOrderDetailLabelsByDRepository.AddData(outboundOrderDetail_LabelsBYD); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //忥å°WMSåºåºåä¸ |
| | | foreach (var item in outStoreList) |
| | | { |
| | | if (item != null) |
| | | { |
| | | Dt_OutboundOrder outOrder = _outboundOrderRepository.QueryFirst(x => x.OrderNo == item.REQUIREMENT_NO); |
| | | if (outOrder != null) |
| | | { |
| | | outOrder.OrderNo = item.REQUIREMENT_NO; |
| | | outOrder.UpperOrderNo = ""; |
| | | outOrder.OrderType = (int)OutOrderTypeEnum.Issue; |
| | | outOrder.OrderStatus = (int)OutboundStatusEnum.æªå¼å§; |
| | | outOrder.CreateType = (int)CreateType.UpperSystemPush; |
| | | outOrder.Creater = "System"; |
| | | |
| | | _outboundOrderRepository.UpdateData(outOrder); |
| | | foreach (var orderdetail in item.ITEMS) |
| | | { |
| | | Dt_OutboundOrderDetail detail = _outboundOrderDetailRepository.QueryFirst(x => x.OrderId == outOrder.Id && x.Remark == orderdetail.REQUIREMENT_ITEM_NO); |
| | | if (detail != null) |
| | | { |
| | | detail.OrderId = outOrder.Id; |
| | | detail.MaterielCode = orderdetail.MATNR; |
| | | detail.BatchNo = orderdetail.BATCH; |
| | | detail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY); |
| | | detail.LockQuantity = 0; |
| | | detail.OverOutQuantity = 0; |
| | | detail.OrderDetailStatus = (int)OrderDetailStatusEnum.New; |
| | | detail.Creater = "System"; |
| | | detail.Remark = orderdetail.REQUIREMENT_ITEM_NO; |
| | | _outboundOrderDetailRepository.UpdateData(detail); |
| | | } |
| | | else |
| | | { |
| | | Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail(); |
| | | outboundOrderDetail.OrderId = outOrder.Id; |
| | | outboundOrderDetail.MaterielCode = orderdetail.MATNR; |
| | | outboundOrderDetail.BatchNo = orderdetail.BATCH; |
| | | outboundOrderDetail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY); |
| | | outboundOrderDetail.LockQuantity = 0; |
| | | outboundOrderDetail.OverOutQuantity = 0; |
| | | outboundOrderDetail.OrderDetailStatus = (int)OrderDetailStatusEnum.New; |
| | | outboundOrderDetail.Creater = "System"; |
| | | outboundOrderDetail.Remark = orderdetail.REQUIREMENT_ITEM_NO; |
| | | _outboundOrderDetailRepository.AddData(outboundOrderDetail); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder(); |
| | | outboundOrder.OrderNo = item.REQUIREMENT_NO; |
| | | outboundOrder.UpperOrderNo = ""; |
| | | outboundOrder.OrderType = (int)OutOrderTypeEnum.Issue; |
| | | outboundOrder.OrderStatus = (int)OutboundStatusEnum.æªå¼å§; |
| | | outboundOrder.CreateType = (int)CreateType.UpperSystemPush; |
| | | outboundOrder.Creater = "System"; |
| | | _outboundOrderRepository.AddData(outboundOrder); |
| | | Dt_OutboundOrder outOrdertemp = _outboundOrderRepository.QueryFirst(x => x.OrderNo == item.REQUIREMENT_NO); |
| | | foreach (var orderdetail in item.ITEMS) |
| | | { |
| | | Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail(); |
| | | outboundOrderDetail.OrderId = outOrder.Id; |
| | | outboundOrderDetail.OrderId = outOrdertemp.Id; |
| | | outboundOrderDetail.MaterielCode = orderdetail.MATNR; |
| | | outboundOrderDetail.BatchNo = orderdetail.BATCH; |
| | | outboundOrderDetail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY); |
| | |
| | | _outboundOrderDetailRepository.AddData(outboundOrderDetail); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder(); |
| | | outboundOrder.OrderNo = item.REQUIREMENT_NO; |
| | | outboundOrder.UpperOrderNo = ""; |
| | | outboundOrder.OrderType = (int)OutOrderTypeEnum.Issue; |
| | | outboundOrder.OrderStatus = (int)OutboundStatusEnum.æªå¼å§; |
| | | outboundOrder.CreateType = (int)CreateType.UpperSystemPush; |
| | | outboundOrder.Creater = "System"; |
| | | _outboundOrderRepository.AddData(outboundOrder); |
| | | Dt_OutboundOrder outOrdertemp = _outboundOrderRepository.QueryFirst(x => x.OrderNo == item.REQUIREMENT_NO); |
| | | foreach (var orderdetail in item.ITEMS) |
| | | { |
| | | Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail(); |
| | | outboundOrderDetail.OrderId = outOrdertemp.Id; |
| | | outboundOrderDetail.MaterielCode = orderdetail.MATNR; |
| | | outboundOrderDetail.BatchNo = orderdetail.BATCH; |
| | | outboundOrderDetail.OrderQuantity =Convert.ToDecimal(orderdetail.QTY); |
| | | outboundOrderDetail.LockQuantity = 0; |
| | | outboundOrderDetail.OverOutQuantity = 0; |
| | | outboundOrderDetail.OrderDetailStatus = (int)OrderDetailStatusEnum.New; |
| | | outboundOrderDetail.Creater="System"; |
| | | outboundOrderDetail.Remark = orderdetail.REQUIREMENT_ITEM_NO; |
| | | _outboundOrderDetailRepository.AddData(outboundOrderDetail); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | content = WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | content = WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | StereoServiceReference.WhStereoWebServiceClient client = new StereoServiceReference.WhStereoWebServiceClient(); |
| | | LikuServiceReference.WmsStereoWhServiceClient likuClient = new LikuServiceReference.WmsStereoWhServiceClient(); |
| | | |
| | | string inparam = JsonConvert.SerializeObject(pickAndPost); |
| | | //Logger.Write_Log("System/test_out", "", "inparam= "+ inparam); |
| | | new LogFactory().GetLog("BYD_WMSæ¥å£").InfoFormat(true, "CallPickAndPost", "请æ±", $"{inparam}"); |
| | | string response = client.pickAndPost(inparam); |
| | | string response = likuClient.pickAndPost(inparam); |
| | | new LogFactory().GetLog("BYD_WMSæ¥å£").InfoFormat(true, "CallPickAndPost", "ååº", $"{response}"); |
| | | //Logger.Write_Log("System/test_out", "", "response= " + response); |
| | | if (response != null) |
| | | { |
| | | PickAndPostResponse res = JsonConvert.DeserializeObject<PickAndPostResponse>(response); |
| | | if (res != null && res.MSGTX == "S") |
| | | if (res != null && res.MSGTY == "S") |
| | | { |
| | | content = WebResponseContent.Instance.OK("åºåºåä¼ æåï¼"); |
| | | new LogFactory().GetLog("BYD_WMSæ¥å£").InfoFormat(true, "CallPickAndPost", "ååº", $"åºåºåä¼ æåï¼"); |