调整wms出入库、返库逻辑,调整与比亚迪接口对接的类型和方法,调整配置参数,写入服务器上数据库密码
| | |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.LogHelper; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Inbound; |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.0 ", ""); |
| | | |
| | | materielGroupDTO.OrderNo = GetOrderNo(); |
| | | //Logger.Write_Log("System/test", "", "2.1 ", ""); |
| | | Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(materielGroupDTO.PalletCode); |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.2 ", ""); |
| | | (bool, string, object?) result = CheckMaterielGroupParam(materielGroupDTO, stockInfo); |
| | | if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); |
| | | if (stockInfo == null) |
| | | { |
| | | //Logger.Write_Log("System/test", "", "2.2.1 ", ""); |
| | | stockInfo = new Dt_StockInfo(); |
| | | stockInfo.PalletCode = materielGroupDTO.PalletCode; |
| | | stockInfo.StockStatus = StockStatusEmun.ç»çæå.ObjToInt(); |
| | |
| | | stockInfo.Details = new List<Dt_StockInfoDetail>(); |
| | | |
| | | } |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.3 ", ""); |
| | | List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); |
| | | List<Dt_LabelMaster> notExistLabels = new List<Dt_LabelMaster>(); |
| | | foreach (var lablel in materielGroupDTO.SerialNumbers) |
| | |
| | | Dt_LabelMaster labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == lablel); |
| | | if(labmaster == null) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.3.1 lablel=" + lablel); |
| | | //éè¿æ¡ç æ¥å£åæ¥æ¡ç ä¸»æ°æ® |
| | | var res= _sys_JobService.GetLabMaster(lablel); |
| | | if (res != null && res.Status) |
| | | { |
| | | //Logger.Write_Log("System/test", "", "2.3.2 res.Status=" + res.Status.ToString()); |
| | | labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == lablel); |
| | | if (labmaster == null) |
| | | { |
| | | //Logger.Write_Log("System/test", "", "2.3.3 ", ""); |
| | | notExistLabels.Add(labmaster); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.3.4 ", ""); |
| | | return content = WebResponseContent.Instance.Error("ç»çæ¡ç å¨ä¸æ¸¸WMSç³»ç»ä¸ä¸åå¨!"); |
| | | } |
| | | } |
| | | if(labmaster!=null) |
| | | { |
| | | //Logger.Write_Log("System/test", "", "2.3.5 ", ""); |
| | | //ä¸»æ°æ®æ¡ç ç¶æå
许ç»çï¼01å·²æ¶æå¾
è´¨æ£ï¼02å·²æ¶ææ éè´¨æ£ï¼03å¾
è¿ä»å·²è´¨æ£ï¼09已䏿¶ï¼ |
| | | //ä¸»æ°æ®æ¡ç ç¶æä¸å
许ç»çï¼00å建ï¼04已质æ£å¾
éè´§ï¼05æ¶ææ¿éè´§ï¼06åºæ¿éè´§ï¼07å·²è¿ä»ï¼08已䏿¶ï¼10å·²åºåºï¼11å·²å»ç»ï¼12å·²éå®ï¼20å
³éçï¼ |
| | | if (labmaster.LABEL_STATUS=="00"|| labmaster.LABEL_STATUS == "04" || labmaster.LABEL_STATUS == "05"|| labmaster.LABEL_STATUS == "06" || labmaster.LABEL_STATUS == "07" || labmaster.LABEL_STATUS == "08" || labmaster.LABEL_STATUS == "10" || labmaster.LABEL_STATUS == "11" || labmaster.LABEL_STATUS == "12" || labmaster.LABEL_STATUS == "20") |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.3.6 LABEL_STATUS=" + labmaster.LABEL_STATUS); |
| | | return content = WebResponseContent.Instance.Error("ä¸»æ°æ®æ¡ç ç¶æä¸å
许ç»ç!æ¡ç ç¶æï¼"+ labmaster.LABEL_STATUS); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.4 ", ""); |
| | | |
| | | if (notExistLabels.Count == 0) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.4.1 ", ""); |
| | | foreach (var item in materielGroupDTO.SerialNumbers) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.4.2 "+ item); |
| | | //Logger.Write_Log("System/test", "", "2.4.2.0 ", ""); |
| | | Dt_LabelMaster labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == item); |
| | | |
| | | Dt_StockInfoDetail dt_StockInfoDetail = new Dt_StockInfoDetail(); |
| | | dt_StockInfoDetail.Status = 0; |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.4.2.1 ", ""); |
| | | dt_StockInfoDetail.OrderNo = materielGroupDTO.OrderNo; |
| | | dt_StockInfoDetail.StockId = stockInfo.Id != 0 ? stockInfo.Id : 0; |
| | | dt_StockInfoDetail.MaterielCode = labmaster.MATNR; |
| | | dt_StockInfoDetail.MaterielName = labmaster.MAKTX; |
| | | dt_StockInfoDetail.BatchNo = labmaster.BATCH; |
| | | dt_StockInfoDetail.SerialNumber = labmaster.LABEL_NO; |
| | | dt_StockInfoDetail.StockQuantity = int.Parse(labmaster.BOX_QTY); |
| | | //Logger.Write_Log("System/test", "", "2.4.2.2 "+ labmaster.BOX_QTY); |
| | | dt_StockInfoDetail.StockQuantity = (int)Convert.ToDouble(labmaster.BOX_QTY); |
| | | dt_StockInfoDetail.OutboundQuantity = 0; |
| | | dt_StockInfoDetail.Creater = "System"; |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.4.2.3 ", ""); |
| | | stockInfoDetails.Add(dt_StockInfoDetail); |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.4.2.4 ", ""); |
| | | stockInfo.Details.AddRange(stockInfoDetails); |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.4.2.5 ", ""); |
| | | } |
| | | content = MaterielGroupUpdateData(stockInfo); |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.4.3 ", ""); |
| | | content = WebResponseContent.Instance.Error("ç»çæ¡ç å¨ä¸æ¸¸WMSç³»ç»ä¸ä¸åå¨!"); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //Logger.Write_Log("System/test", "", "2.4.4 " + ex.ToString()); |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | finally |
| | |
| | | dt_StockInfoDetail.MaterielName = ""; |
| | | dt_StockInfoDetail.BatchNo = ""; |
| | | dt_StockInfoDetail.SerialNumber = item.LABEL_NO; |
| | | dt_StockInfoDetail.StockQuantity = int.Parse(item.QTY); |
| | | dt_StockInfoDetail.StockQuantity = (int)Convert.ToDouble(item.QTY); |
| | | dt_StockInfoDetail.OutboundQuantity = 0; |
| | | dt_StockInfoDetail.Creater = "WMS"; |
| | | stockInfoDetails.Add(dt_StockInfoDetail); |
| | |
| | | { |
| | | public class PickAndPostRequest |
| | | { |
| | | public string WH_NUMBER { get; set; } |
| | | public string SYSNOD { get; set; } |
| | | public string WERKS { get; set; } |
| | | public string WH_NUMBER { get; set; } |
| | | //public string SYSNOD { get; set; } |
| | | //public string REQUIREMENT_NO { get; set; } |
| | | //public string BUSINESS_NAME { get; set; } |
| | | //public string BUSINESS_CODE { get; set; } |
| | | public List<PickAndPost> ITEMDATA { get; set; } |
| | | |
| | | |
| | |
| | | { |
| | | public string REQUIREMENT_NO { get; set; } |
| | | public string REQUIREMENT_ITEM_NO { get; set; } |
| | | public string WERKS { get; set; } |
| | | public string ORDERCODE { get; set; } |
| | | public string ORDERCODE_ITEM_NO { get; set; } |
| | | public string SYSNOD { get; set; } |
| | | |
| | | public string MATNR { get; set; } |
| | | public string LIFNR { get; set; } |
| | | public string QTY { get; set; } |
| | |
| | | public string STATION { get; set; } |
| | | public string SPLIT { get; set; } |
| | | public string LABEL_NO { get; set; } |
| | | public string Pack_LABEL_NO { get; set; } |
| | | public string pallet_label_no { get; set; } |
| | | public string CREATE_DATE { get; set; } |
| | | public string UPDATE_DATE { get; set; } |
| | | public string STATUS { get; set; } |
| | | public string MO_NO { get; set; } |
| | | |
| | | // /// <summary> |
| | | // /// éæ±è¡ |
| | |
| | | { |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å·ï¼ç³»ç»æ è¯ï¼ |
| | | /// </summary> |
| | | public string WH_NUMBER { get; set; } |
| | | /// <summary> |
| | | /// ä¸å¡ç±»ååç§° |
| | | /// </summary> |
| | | public string BUSINESS_NAME { get; set; } |
| | | /// <summary> |
| | | /// å·¥å代ç |
| | | /// </summary> |
| | | public string WERKS { get; set; } |
| | | /// <summary> |
| | | /// ä»åºç¼å·ï¼ç³»ç»æ è¯ï¼ |
| | | /// ç®æ åºåå°ç¹ |
| | | /// </summary> |
| | | public string WH_NUMBER { get; set; } |
| | | |
| | | public string LGORT { get; set; } |
| | | public string TOTAL_RETURN_QTY { get; set; } |
| | | /// <summary> |
| | | /// å
¥åºæä»¤ |
| | | /// ä¸å¡ç±»å代ç |
| | | /// </summary> |
| | | public string IZLID { get; set; } |
| | | public string BUSINESS_CODE { get; set; } |
| | | /// <summary> |
| | | /// éè´§åå· |
| | | /// </summary> |
| | |
| | | /// éè´§åè¡é¡¹ç® |
| | | /// </summary> |
| | | public string RETURN_ITEM_NO { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡ç±»ååç§° |
| | | /// </summary> |
| | | public string BUSINESS_NAME { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡ç±»å代ç |
| | | /// </summary> |
| | | public string BUSINESS_CODE { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçå· |
| | | /// </summary> |
| | | public string TPNUM { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºåå°ç¹ |
| | | /// </summary> |
| | | public string LGORT { get; set; } |
| | | |
| | | public string MO_NO { get; set; } |
| | | |
| | | public string YLZD5 { get; set; } |
| | | public List<PutAwayReturn> DATA { get; set; } |
| | | /// <summary> |
| | | /// å
¥åºæä»¤ |
| | | /// </summary> |
| | | public string IZLID { get; set; } |
| | | public string MO_NO { get; set; } |
| | | public string YLZD3 { get; set; } |
| | | public string YLZD4 { get; set; } |
| | | public string YLZD1 { get; set; } |
| | | public string YLZD2 { get; set; } |
| | | public string SYSNOD { get; set; } |
| | | |
| | | } |
| | | |
| | | public class PutAwayReturn |
| | | { |
| | | public string LABEL_NO { get; set; } |
| | | public string SOBKZ { get; set; } |
| | | public string UNIT { get; set; } |
| | | public string SOBKZ { get; set; } |
| | | public string LGORT { get; set; } |
| | | public string TOTAL_RETURN_QTY { get; set; } |
| | | public string QTY { get; set; } |
| | | |
| | | public string F_LGORT { get; set; } |
| | | public string MO_NO { get; set; } |
| | | public string LIFNR { get; set; } |
| | | public string MO_NO { get; set; } |
| | | |
| | | public string MATNR { get; set; } |
| | | |
| | | public string BATCH { get; set;} |
| | | } |
| | | } |
| | |
| | | |
| | | public string TPNUM { get; set; } |
| | | public string YLZD5 { get; set; } |
| | | public List<ReturnInventory> DATA { get; set; } |
| | | public string IZLID { get; set; } |
| | | public string SYSNOD { get; set; } |
| | | public string MO_NO { get; set; } |
| | | public string SYSNOD { get; set; } |
| | | public string YLZD3 { get; set; } |
| | | public string YLZD4 { get; set; } |
| | | public string YLZD1 { get; set; } |
| | | public string YLZD2 { get; set; } |
| | | |
| | | public List<ReturnInventory> DATA { get; set; } |
| | | } |
| | | |
| | | public class ReturnInventory |
| | | { |
| | | public string LABEL_NO { get; set; } |
| | | public string SOBKZ { get; set; } |
| | | public string UNIT { get; set; } |
| | | public string SOBKZ { get; set; } |
| | | public string LGORT { get; set; } |
| | | public string QTY { get; set; } |
| | | public string LIFNR { get; set; } |
| | | public string F_LGORT { get; set; } |
| | | public string LIFNR { get; set; } |
| | | public string MO_NO { get; set; } |
| | | public string MATNR { get; set; } |
| | | |
| | | } |
| | |
| | | public string WH_NUMBER { get; set; } |
| | | public string MATNR { get; set; } |
| | | public string BATCH { get; set; } |
| | | public string FREEZE_TYPE { get; set; } |
| | | public string YWLX { get; set; } |
| | | |
| | | public string EFFECT_DATE { get; set; } |
| | | public string VALTO { get; set; } |
| | | |
| | | public string REASON_CODE { get; set; } |
| | | //public string REASON_CODE { get; set; } |
| | | |
| | | public string REASON { get; set; } |
| | | public string EDITOR { get; set; } |
| | | //public string REASON { get; set; } |
| | | //public string EDITOR { get; set; } |
| | | |
| | | } |
| | | |
| | |
| | | stockItem.LGORT = "0030";//åºä½ |
| | | if (labelMaster != null) |
| | | { |
| | | if (labelMaster.WH_NUMBER == inventoryQueryRequest.DATA[0].WH_NUMBER && labelMaster.WERKS == inventoryQueryRequest.DATA[0].WH_NUMBER) |
| | | if (labelMaster.WH_NUMBER == inventoryQueryRequest.DATA[0].WH_NUMBER && labelMaster.WERKS == inventoryQueryRequest.DATA[0].WERKS) |
| | | { |
| | | stockItem.LIFNR = labelMaster.LIFNR; |
| | | stockItem.LIKTX = labelMaster.LIKTX; |
| | |
| | | stockItem.MATNR = labelMaster.MATNR; |
| | | stockItem.MEINS = labelMaster.UNIT; |
| | | stockItem.QTY = labelMaster.BOX_QTY; |
| | | stockItem.SOBKZ = labelMaster.SOBKZ; |
| | | var sobkz = "ééå¶"; |
| | | if (labelMaster.SOBKZ == "0") |
| | | { |
| | | sobkz = "ééå¶"; |
| | | } |
| | | else if (labelMaster.SOBKZ == "1") |
| | | { |
| | | sobkz = "å»ç»"; |
| | | } |
| | | else if (labelMaster.SOBKZ == "2") |
| | | { |
| | | sobkz = "å¾
è´¨æ£"; |
| | | } |
| | | stockItem.SOBKZ = sobkz; |
| | | stockItem.TPNUM = view.PalletCode; |
| | | stockItem.WERKS = labelMaster.WERKS;//å·¥å |
| | | stockItem.WH_NUMBER = labelMaster.WH_NUMBER;//ä»åºå· |
| | |
| | | try |
| | | { |
| | | freezeByCustomerRequest freezeRequest = JsonConvert.DeserializeObject<freezeByCustomerRequest>(freezeRequeststr); |
| | | if (freezeRequest.WERKS == AppSettings.Configuration["WERKS"] && freezeRequest.WH_NUMBER == AppSettings.Configuration["SYSNO"]) |
| | | if (freezeRequest.WERKS == AppSettings.Configuration["WERKS"] && freezeRequest.WH_NUMBER == AppSettings.Configuration["WERKS"]) |
| | | { |
| | | //æ ¹æ®æ¹æ¬¡åç©æå·æ¥æ¾å¯¹åºçæçå·ï¼å»ç»åºåï¼åªæå
¥åºæåäºï¼æè½è¢«å»ç» |
| | | List<Dt_StockInfo> stockInfos = GetStockInfos(freezeRequest.MATNR, freezeRequest.BATCH); |
| | | if (freezeRequest.FREEZE_TYPE == "00")//00å»ç» |
| | | |
| | | List<Dt_LabelMaster> labelInfos = _labelMasterRepository.QueryData(x => x.MATNR == freezeRequest.MATNR && x.BATCH == freezeRequest.BATCH); |
| | | if (freezeRequest.YWLX == "00")//00å»ç» |
| | | { |
| | | foreach (var item in stockInfos) |
| | | { |
| | |
| | | UpdateData(item); |
| | | } |
| | | } |
| | | |
| | | foreach (var li in labelInfos) |
| | | { |
| | | li.SOBKZ = "1"; |
| | | } |
| | | _labelMasterRepository.UpdateData(labelInfos); |
| | | |
| | | freezeResponse.MSGTY = "S"; |
| | | freezeResponse.MSGTX = ""; |
| | | } |
| | | else if (freezeRequest.FREEZE_TYPE == "01") //01è§£å» |
| | | else if (freezeRequest.YWLX == "01") //01è§£å» |
| | | { |
| | | foreach (var item in stockInfos) |
| | | { |
| | |
| | | UpdateData(item); |
| | | } |
| | | } |
| | | |
| | | foreach (var li in labelInfos) |
| | | { |
| | | //if (li.LABEL_STATUS == "01") |
| | | //{ |
| | | // li.SOBKZ = "2"; |
| | | //} |
| | | //else |
| | | //{ |
| | | li.SOBKZ = "0"; |
| | | //} |
| | | } |
| | | _labelMasterRepository.UpdateData(labelInfos); |
| | | |
| | | freezeResponse.MSGTY = "S"; |
| | | freezeResponse.MSGTX = ""; |
| | | |
| | |
| | | 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") |
| | | { |
| | | if (string.IsNullOrEmpty(res.DATA) || res.DATA == "[]") |
| | | { |
| | | content = WebResponseContent.Instance.Error("åºåºåæ°æ®ä¸ºç©º"); |
| | | } |
| | | else |
| | | { |
| | | string data = stringToJson(res.DATA); |
| | | string newdata = data.Replace("},\"", "},").Replace("\" ", "\""); |
| | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | 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", "ååº", $"åºåºåä¼ æåï¼"); |
| | |
| | | using System.Net.Http.Headers; |
| | | using System.Security.Policy; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Core.LogHelper; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "1.0 ", ""); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(palletCode); |
| | | //Logger.Write_Log("System/test_in", "", "1.1 ", ""); |
| | | (bool, string) result = CheckRequestInbound(stationCode, palletCode, true, stockInfo); |
| | | //Logger.Write_Log("System/test_in", "", "1.2 ", ""); |
| | | if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); |
| | | //Logger.Write_Log("System/test_in", "", "1.3 ", ""); |
| | | content = AssignLocUpdateData(stationCode, TaskTypeEnum.Inbound.ObjToInt(), palletCode, true, stockInfo); |
| | | //Logger.Write_Log("System/test_in", "", "1.4 ", ""); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "2.0 "); |
| | | _unitOfWorkManage.BeginTran(); |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType,palletCode); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.1 "); |
| | | if (locationInfo != null) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.2 "); |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | Dt_Task task = new() |
| | | { |
| | |
| | | BaseDal.AddData(task); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.3 "); |
| | | if (isUpdateStock) |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1 "); |
| | | locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | if (locationInfo.Depth == 2) |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1.1 "); |
| | | _basicService.LocationInfoService.UpdateLocationLock(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false); |
| | | } |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1.2 "); |
| | | if (stockInfo != null && stockInfo.Details != null && stockInfo.Details.Count > 0) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1.3 "); |
| | | orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? ""; |
| | | |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1.4 "); |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°åºåä¿¡æ¯"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "2.3.2 "); |
| | | locationInfo.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt(); |
| | | if (locationInfo.Depth == 2) |
| | | { |
| | |
| | | } |
| | | task.Grade = 1; |
| | | } |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.4 "); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | tasks.Add(task); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.5 "); |
| | | var response = HttpHelper.Post<WebResponseContent>(url + "ReceiveTask/", tasks, "å
¥åºä»»å¡ä¸å"); |
| | | if (!response.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content = WebResponseContent.Instance.Error($"{response.Message}"); |
| | | } |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.6 "); |
| | | return content = WebResponseContent.Instance.OK(); |
| | | |
| | | } |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°å¯åé
è´§ä½"); |
| | | } |
| | |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Log; |
| | | using WIDESEA_Core.LogHelper; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IBasicRepository; |
| | |
| | | { |
| | | try |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "3.0 "); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | decimal beforeQuantity = 0; |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | //Logger.Write_Log("System/test_in", "", "3.1 "); |
| | | CheckCompleted(stockInfo, locationInfo); |
| | | //Logger.Write_Log("System/test_in", "", "3.2 "); |
| | | |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "3.3 "); |
| | | beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity); |
| | | |
| | | foreach (Dt_StockInfoDetail detail in stockInfo.Details) |
| | | { |
| | | //0 - ééå¶ï¼å¨åºæ£å¸¸çç©æï¼ |
| | | //1 - å»ç»ï¼å¨åºå·²å»ç»çç©æï¼ |
| | | //2 - å¾
è´¨æ£ï¼å·²ä¸æ¶ç«åºï¼è¿æªè´¨æ£æå·²è´¨æ£ä¸åæ ¼çç©æï¼ |
| | | Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber); |
| | | if (labMaster.LABEL_STATUS == "01") |
| | | { |
| | | labMaster.SOBKZ = "0"; |
| | | } |
| | | else |
| | | { |
| | | labMaster.SOBKZ = "2"; |
| | | } |
| | | _labelMasterRepository.UpdateData(labMaster); |
| | | } |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "3.4 "); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt(); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "3.5 "); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "3.6 "); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.Inbound,task.TaskNum); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "3.7 "); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | #region åä¼ é»è¾å¤ç |
| | | try |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "3.8 "); |
| | | PutAwayRequest request = new PutAwayRequest(); |
| | | List<PutAway> itemData = new List<PutAway>(); |
| | | request.ITEMDATA = itemData; |
| | | request.WERKS = AppSettings.Configuration["WERKS"]; |
| | | request.WH_NUMBER = AppSettings.Configuration["WERKS"]; |
| | | request.WH_NUMBER = AppSettings.Configuration["SYSNO"]; |
| | | request.IZLID = request.WERKS + request.WH_NUMBER+ DateTime.Now.ToString("yyyyMMdd") + task.TaskNum.ToString(); |
| | | request.CREATE_DATE = task.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | request.PSTNG_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | request.INBOUND_NO = "";//todo:åå·è¦ä»æ¡ç ä¸»æ°æ®ä¸è·åï¼ä¸ç¶åä¼ ä¼æç¤ºï¼è¯¥æ¡ç æ è¿ä»åæ°æ®ï¼ |
| | | request.RECEIPT_NO = "";//todo:åå·è¦ä»æ¡ç ä¸»æ°æ®ä¸ï¼ä¸ç¶åä¼ ä¼æç¤ºï¼è¯¥æ¡ç æ è¿ä»åæ°æ®ï¼ |
| | | //Logger.Write_Log("System/test_in", "", "3.9 "); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | //Logger.Write_Log("System/test_in", "", "3.10 "); |
| | | foreach (Dt_StockInfoDetail detail in stockInfo.Details) |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "3.11 "); |
| | | Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber); |
| | | if (labMaster != null) |
| | | { |
| | | if (request.INBOUND_NO == "") |
| | | //Logger.Write_Log("System/test_in", "", "3.12 "); |
| | | if (string.IsNullOrWhiteSpace(request.INBOUND_NO)) |
| | | { |
| | | request.INBOUND_NO = labMaster.INBOUND_NO; |
| | | } |
| | | if (request.RECEIPT_NO == "") |
| | | if (string.IsNullOrWhiteSpace(request.RECEIPT_NO)) |
| | | { |
| | | request.RECEIPT_NO = labMaster.RECEIPT_NO; |
| | | } |
| | |
| | | putAway.RECEIPT_ITEM_NO = labMaster.RECEIPT_ITEM_NO; |
| | | putAway.INBOUND_NO = task.TaskNum.ToString(); |
| | | //LABEL _STATUS æ¡ç ç¶æ 02å·²æ¶æ(æ éè´¨æ£)03 å¾
è¿ä»(已质æ£)ï¼å¹¶ä¸ï¼QC RESULT CODEè´¨æ£ç¶æä¸ºâ02â æå
è®¡ä¸æ¶ |
| | | //Logger.Write_Log("System/test_in", "", "3.13 "); |
| | | if (labMaster.QC_RESULT_CODE=="02"&&(labMaster.LABEL_STATUS=="02"|| labMaster.LABEL_STATUS == "03")) |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "3.14 "); |
| | | itemData.Add(putAway); |
| | | } |
| | | |
| | |
| | | } |
| | | if (itemData.Count > 0) |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "3.15 "); |
| | | WebResponseContent content= _sys_JobService.CallPutAway(request); |
| | | //Logger.Write_Log("System/test_in", "", "3.16 "); |
| | | if (content != null&&content.Message== "䏿¶åä¼ æå") //妿䏿¶æåï¼ä¿®æ¹åºåç¶æä¸ºå·²ä¸æ¶ |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "3.17 "); |
| | | stockInfo.StockStatus = StockStatusEmun.已䏿¶.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | } |
| | | else |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "3.18 " + content.Message); |
| | | } |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_re", "", "3.0 "); |
| | | _unitOfWorkManage.BeginTran(); |
| | | decimal beforeQuantity = 0; |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | //Logger.Write_Log("System/test_re", "", "3.1 "); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | //Logger.Write_Log("System/test_re", "", "3.2 "); |
| | | CheckCompleted(stockInfo, locationInfo); |
| | | //Logger.Write_Log("System/test_re", "", "3.3 "); |
| | | |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | //Logger.Write_Log("System/test_re", "", "3.4 "); |
| | | |
| | | beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity); |
| | | |
| | |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false); |
| | | |
| | | //Logger.Write_Log("System/test_re", "", "3.5 "); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt(); |
| | | |
| | | //Logger.Write_Log("System/test_re", "", "3.6 "); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | |
| | | //Logger.Write_Log("System/test_re", "", "3.7 "); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | //Logger.Write_Log("System/test_re", "", "3.8 "); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.Inbound, task.TaskNum); |
| | | //Logger.Write_Log("System/test_re", "", "3.9 "); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //Logger.Write_Log("System/test_re", "", "3.10 "); |
| | | |
| | | |
| | | } |
| | |
| | | #region åä¼ é»è¾å¤ç |
| | | try |
| | | { |
| | | //Logger.Write_Log("System/test_re", "", "3.11 "); |
| | | PutAwayReturnRequest request = new PutAwayReturnRequest(); |
| | | List<PutAwayReturn> DATA = new List<PutAwayReturn>(); |
| | | request.DATA = DATA; |
| | | request.WERKS = AppSettings.Configuration["WERKS"]; |
| | | request.WH_NUMBER = AppSettings.Configuration["SYSNO"]; |
| | | request.IZLID = task.OrderNo;//è¿ä¸ªå¼ä¼å¨æ¥æ¶ä¸æ¸¸ååºç»çä¿¡æ¯æ¶ï¼åå¨åºå表ä¸ï¼ååå°ä»»å¡è¡¨ä¸ |
| | | Dt_MainReturnInventory mainReturnInventory = _mainReturnInventoryRepository.QueryFirst(x => x.IZLID == task.OrderNo); |
| | | //request.WH_NUMBER = AppSettings.Configuration["SYSNO"]; |
| | | //request.WERKS = AppSettings.Configuration["WERKS"]; |
| | | //request.IZLID = task.OrderNo;//è¿ä¸ªå¼ä¼å¨æ¥æ¶ä¸æ¸¸ååºç»çä¿¡æ¯æ¶ï¼åå¨åºå表ä¸ï¼ååå°ä»»å¡è¡¨ä¸ |
| | | |
| | | Dt_MainReturnInventory mainReturnInventory = _mainReturnInventoryRepository.QueryFirst(x => x.TPNUM == task.PalletCode && x.YLZD4 != "1"); |
| | | if (mainReturnInventory != null) |
| | | { |
| | | request.RETURN_NO = mainReturnInventory.RETURN_NO; |
| | | request.RETURN_ITEM_NO = mainReturnInventory.RETURN_ITEM_NO; |
| | | //Logger.Write_Log("System/test_re", "", "3.12 "); |
| | | request.WH_NUMBER = mainReturnInventory.WH_NUMBER; |
| | | request.BUSINESS_NAME = mainReturnInventory.BUSINESS_NAME; |
| | | request.BUSINESS_CODE = mainReturnInventory.BUSINESS_CODE; |
| | | request.TPNUM = mainReturnInventory.TPNUM; |
| | | request.WERKS = mainReturnInventory.WERKS; |
| | | request.LGORT = mainReturnInventory.LGORT; |
| | | request.MO_NO = mainReturnInventory.MO_NO; |
| | | request.TOTAL_RETURN_QTY = mainReturnInventory.TOTAL_RETURN_QTY; |
| | | request.BUSINESS_CODE = mainReturnInventory.BUSINESS_CODE; |
| | | request.RETURN_NO = mainReturnInventory.RETURN_NO; |
| | | |
| | | request.RETURN_ITEM_NO = mainReturnInventory.RETURN_ITEM_NO; |
| | | request.TPNUM = mainReturnInventory.TPNUM; |
| | | request.YLZD5 = mainReturnInventory.YLZD5; |
| | | request.IZLID = mainReturnInventory.IZLID; |
| | | request.MO_NO = mainReturnInventory.MO_NO; |
| | | request.YLZD3 = mainReturnInventory.YLZD3; |
| | | request.YLZD4 = mainReturnInventory.YLZD4; |
| | | request.YLZD1 = mainReturnInventory.YLZD1; |
| | | request.YLZD2 = mainReturnInventory.YLZD2; |
| | | request.SYSNOD = mainReturnInventory.SYSNOD; |
| | | |
| | | //Logger.Write_Log("System/test_re", "", "3.13 "); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | List<Dt_ReturnInventoryDetail> returnInventoryDetails = new List<Dt_ReturnInventoryDetail>(); |
| | | foreach (Dt_StockInfoDetail detail in stockInfo.Details) |
| | | { |
| | | Dt_ReturnInventoryDetail dt_ReturnInventoryDetail = _returnInventoryDetailRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber); |
| | | //Logger.Write_Log("System/test_re", "", "3.14 "); |
| | | Dt_ReturnInventoryDetail dt_ReturnInventoryDetail = _returnInventoryDetailRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber && x.SOBKZ == "Z"); |
| | | if (dt_ReturnInventoryDetail != null) |
| | | { |
| | | //Logger.Write_Log("System/test_re", "", "3.15 "); |
| | | PutAwayReturn putAwayReturn = new PutAwayReturn(); |
| | | putAwayReturn.LABEL_NO = dt_ReturnInventoryDetail.LABEL_NO; |
| | | putAwayReturn.SOBKZ = dt_ReturnInventoryDetail.SOBKZ; |
| | | putAwayReturn.UNIT = dt_ReturnInventoryDetail.UNIT; |
| | | putAwayReturn.SOBKZ = dt_ReturnInventoryDetail.SOBKZ; |
| | | putAwayReturn.LGORT = dt_ReturnInventoryDetail.LGORT; |
| | | putAwayReturn.TOTAL_RETURN_QTY = dt_ReturnInventoryDetail.QTY; |
| | | putAwayReturn.QTY = dt_ReturnInventoryDetail.QTY; |
| | | putAwayReturn.F_LGORT = dt_ReturnInventoryDetail.F_LGORT; |
| | | putAwayReturn.MO_NO = mainReturnInventory.MO_NO; |
| | | putAwayReturn.LIFNR = dt_ReturnInventoryDetail.LIFNR; |
| | | putAwayReturn.MO_NO = mainReturnInventory.MO_NO; |
| | | putAwayReturn.MATNR = dt_ReturnInventoryDetail.MATNR; |
| | | putAwayReturn.BATCH = ""; |
| | | DATA.Add(putAwayReturn); |
| | | //Logger.Write_Log("System/test_re", "", "3.16 "); |
| | | |
| | | returnInventoryDetails.Add(dt_ReturnInventoryDetail); |
| | | } |
| | | } |
| | | request.DATA = DATA; |
| | | if(DATA.Count>0) |
| | | { |
| | | _sys_JobService.CallPutAwayReturn(request);//使éåºåä¼ |
| | | //Logger.Write_Log("System/test_re", "", "3.17 "); |
| | | var res = _sys_JobService.CallPutAwayReturn(request);//使éåºåä¼ |
| | | if (res.Status) |
| | | { |
| | | //Logger.Write_Log("System/test_re", "", "3.18 "); |
| | | mainReturnInventory.YLZD4 = "1"; |
| | | _mainReturnInventoryRepository.UpdateData(mainReturnInventory); |
| | | |
| | | foreach (var li in returnInventoryDetails) |
| | | { |
| | | li.SOBKZ = "0"; |
| | | _returnInventoryDetailRepository.UpdateData(li); |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_re", "", "3.19 "); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | public WebResponseContent OutboundTaskCompleted(Dt_Task task) |
| | | { |
| | | //Logger.Write_Log("System/test_out", "", "3.0 "); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | Dt_StockInfo stockInfoCatch = stockInfo;//å
ç¼åèµ·æ¥ï¼ä¾åé¢çåä¼ æ¥å£è°ç¨ |
| | | //Logger.Write_Log("System/test_out", "", "3.1 "); |
| | | try |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | |
| | | |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | |
| | | //Logger.Write_Log("System/test_out", "", "3.2 "); |
| | | CheckCompleted(stockInfo, locationInfo); |
| | | //Logger.Write_Log("System/test_out", "", "3.3 "); |
| | | |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | //Logger.Write_Log("System/test_out", "", "3.4 "); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | if (locationInfo.Depth == 2) |
| | | { |
| | | //Logger.Write_Log("System/test_out", "", "3.5 "); |
| | | if (DepthTask(locationInfo) == false) |
| | | { |
| | | //Logger.Write_Log("System/test_out", "", "3.6 "); |
| | | _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Outbound.ObjToInt(), false); |
| | | |
| | | } |
| | |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | //Logger.Write_Log("System/test_out", "", "3.7 "); |
| | | task.TaskStatus = OutTaskStatusEnum.OutFinish.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | //Logger.Write_Log("System/test_out", "", "3.8 "); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | |
| | | //Logger.Write_Log("System/test_out", "", "3.9 "); |
| | | beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | //Logger.Write_Log("System/test_out", "", "3.10 "); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) - beforeQuantity, StockChangeType.Outbound, task.TaskNum); |
| | | //Logger.Write_Log("System/test_out", "", "3.11 "); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | //Logger.Write_Log("System/test_out", "", "3.12 "); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | #region åä¼ é»è¾å¤ç |
| | | try |
| | | { |
| | | //Logger.Write_Log("System/test_out", "", "3.13 "); |
| | | PickAndPostRequest request = new PickAndPostRequest(); |
| | | List<PickAndPost> itemData = new List<PickAndPost>(); |
| | | request.ITEMDATA = itemData; |
| | | request.WH_NUMBER = AppSettings.Configuration["SYSNO"]; |
| | | request.SYSNOD = AppSettings.Configuration["SYSNO"]; |
| | | request.WERKS = AppSettings.Configuration["CallMaterialID"]; |
| | | request.WERKS = AppSettings.Configuration["WERKS"]; |
| | | |
| | | Dt_OutboundOrderDetail_Hty detail = _outboundOrderDetail_HtyRepository.QueryFirst(x => x.SourceId.ToString() == task.Remark);// task.Remarkåéæ±æç»ID |
| | | if (detail != null) |
| | | { |
| | | //Logger.Write_Log("System/test_out", "", "3.14 "); |
| | | Dt_OutboundOrder_Hty outboundOrder = _outboundOrder_HtyRepository.QueryFirst(x => x.SourceId == detail.OrderId); |
| | | if (outboundOrder != null) |
| | | { |
| | | //Logger.Write_Log("System/test_out", "", "3.15 "); |
| | | Dt_OutBoundOrderBYD outboundOrderBYD = _outBoundOrderBYDRepository.QueryFirst(x => x.REQUIREMENT_NO == outboundOrder.OrderNo); |
| | | if (outboundOrderBYD != null) |
| | | { |
| | | //Logger.Write_Log("System/test_out", "", "3.16 "); |
| | | |
| | | Dt_OutboundOrderDetailBYD outboundOrderDetailBYD = _outboundOrderDetailByDRepository.QueryFirst(x => x.REQUIREMENT_NO == outboundOrderBYD.REQUIREMENT_NO && x.REQUIREMENT_ITEM_NO == detail.Remark);//detail.Remark åéæ±è¡ |
| | | //æ ¹æ®æçå·æ¥ç«åºçæ¡ç åæ¹æ¬¡è¿è¡åä¼ |
| | | foreach (var item in stockInfoCatch.Details) |
| | | { |
| | | //Logger.Write_Log("System/test_out", "", "3.17 "); |
| | | |
| | | Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == item.SerialNumber); |
| | | |
| | | PickAndPost pickpost = new PickAndPost(); |
| | | pickpost.REQUIREMENT_NO = outboundOrderDetailBYD.REQUIREMENT_NO; |
| | | pickpost.REQUIREMENT_ITEM_NO = outboundOrderDetailBYD.REQUIREMENT_ITEM_NO; |
| | | pickpost.WERKS = outboundOrderBYD.WRKS; |
| | | pickpost.ORDERCODE = request.WERKS + request.WH_NUMBER + DateTime.Now.ToString("yyyyMMdd") + outboundOrderDetailBYD.Id.ToString("D6"); |
| | | pickpost.ORDERCODE_ITEM_NO = "1"; |
| | | pickpost.SYSNOD = outboundOrderBYD.SYSNOD; |
| | | pickpost.MATNR = outboundOrderDetailBYD.MATNR; |
| | | pickpost.LIFNR = "";//没æè¿åï¼ææ¶è½¬ç©º |
| | | pickpost.QTY = outboundOrderDetailBYD.QTY; |
| | | pickpost.QTY = labMaster.BOX_QTY ?? outboundOrderDetailBYD.QTY; |
| | | pickpost.BATCH = item.BatchNo;//åç«åºå
¥åºåºåçæ¡ç |
| | | pickpost.LGORT = outboundOrderBYD.LGORT; |
| | | pickpost.BUSINESS_CODE = outboundOrderBYD.BUSINESS_CODE; |
| | |
| | | pickpost.STATION = outboundOrderBYD.STATION; |
| | | pickpost.SPLIT = outboundOrderBYD.SPLIT; |
| | | pickpost.LABEL_NO = item.SerialNumber;//åç«åºå
¥åºåºåçæ¡ç |
| | | pickpost.Pack_LABEL_NO = null; |
| | | pickpost.pallet_label_no = null; |
| | | pickpost.CREATE_DATE = outboundOrderBYD.CREATE_DATE; |
| | | pickpost.UPDATE_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | pickpost.STATUS = outboundOrderBYD.STATUS; |
| | | pickpost.MO_NO = null; |
| | | itemData.Add(pickpost); |
| | | |
| | | //Logger.Write_Log("System/test_out", "", "3.18 "); |
| | | } |
| | | _sys_JobService.CallPickAndPost(request);//åä¼ |
| | | //Logger.Write_Log("System/test_out", "", "3.19 "); |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | //Logger.Write_Log("System/test_out", "empt ", "3.0 "); |
| | | _unitOfWorkManage.BeginTran(); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | |
| | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | //Logger.Write_Log("System/test_out", "empt ", "3.1 "); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | using WIDESEA_Model.Models; |
| | | using System; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Core.LogHelper; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | |
| | | public WebResponseContent MaterielGroup([FromBody] SaveModel saveModel) |
| | | { |
| | | string PalletCode = saveModel.MainData["PalletCode"].ToString(); |
| | | string ReceviveSN = saveModel.MainData["SerialNumbers"].ToString(); |
| | | List<string> OldSerialNumbers = JsonConvert.DeserializeObject<List<string>>(ReceviveSN); |
| | | var ReceviveSN = saveModel.MainData["SerialNumbers"]; |
| | | |
| | | string str = "1.0 ReceviveSN=" + ReceviveSN; |
| | | //Logger.Write_Log("System/test", "", str); |
| | | |
| | | List<string> OldSerialNumbers = JsonConvert.DeserializeObject<List<string>>(ReceviveSN.ToString()); |
| | | List<string> SerialNumbers = new List<string>(); |
| | | string code = ""; |
| | | foreach (var number in OldSerialNumbers) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "1.0.1 "); |
| | | if (number.Contains("S:")) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "1.0.1.1 "); |
| | | List<string> nums = number.Split(';').ToList(); |
| | | foreach (var item in nums) |
| | | { |
| | | if(item.Contains("S:")) |
| | | { |
| | | //Logger.Write_Log("System/test", "", "1.0.1.2 "); |
| | | string SerialNumber = item.Replace("S:", ""); |
| | | if (!string.IsNullOrEmpty(SerialNumber)) |
| | | { |
| | | SerialNumbers.Add(SerialNumber); |
| | | code += SerialNumber; |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "1.0.2 "); |
| | | SerialNumbers.Add(number); |
| | | code += number; |
| | | } |
| | | } |
| | | |
| | | //Logger.Write_Log("System/test", "", "1.1 " + code); |
| | | |
| | | MaterielGroupDTO materielGroupDTO = new MaterielGroupDTO(); |
| | | materielGroupDTO.SerialNumbers = SerialNumbers; |
| | | materielGroupDTO.OrderNo = ""; |
| | |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_GXBYD;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=193.169.10.200;Initial Catalog=WIDESEAWMS_GXBYD;User ID=sa;Password=1qaz@WSX;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_GXBYD;User ID=sa;Password=123;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |