调整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.Creater = "ç«åºWMS"; |
| | | 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) |
| | | if (labmaster == null) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "2.3.1 lablel=" + lablel); |
| | | //éè¿æ¡ç æ¥å£åæ¥æ¡ç ä¸»æ°æ® |
| | | var res= _sys_JobService.GetLabMaster(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 |
| | | { |
| | | return content = WebResponseContent.Instance.Error("ç»çæ¡ç å¨ä¸æ¸¸WMSç³»ç»ä¸ä¸åå¨!"); |
| | | } |
| | | } |
| | | if(labmaster!=null) |
| | | |
| | | //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") |
| | | 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") |
| | | { |
| | | return content = WebResponseContent.Instance.Error("ä¸»æ°æ®æ¡ç ç¶æä¸å
许ç»ç!æ¡ç ç¶æï¼"+ labmaster.LABEL_STATUS); |
| | | |
| | | //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); |
| | | stockInfo.Details.AddRange(stockInfoDetails); |
| | | |
| | | //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 |
| | |
| | | |
| | | foreach (var item in inventoryRequest.DATA) |
| | | { |
| | | |
| | | |
| | | Dt_StockInfoDetail dt_StockInfoDetail = new Dt_StockInfoDetail(); |
| | | dt_StockInfoDetail.Status = 0; |
| | | dt_StockInfoDetail.OrderNo = materielGroupDTO.OrderNo; |
| | |
| | | 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); |
| | |
| | | |
| | | new LogFactory().GetLog("WMSæ¥å£").InfoFormat(true, "returnInventory", "使éåä¿¡æ¯", $"{inventoryRequeststr}"); |
| | | ReturnInventoryRequest inventoryRequest = JsonConvert.DeserializeObject<ReturnInventoryRequest>(inventoryRequeststr); |
| | | ReturnInventoryResponse response= new ReturnInventoryResponse(); |
| | | ReturnInventoryResponse response = new ReturnInventoryResponse(); |
| | | MaterielGroupDTO materielGroupDTO = new MaterielGroupDTO(); |
| | | materielGroupDTO.PalletCode = inventoryRequest.TPNUM; |
| | | materielGroupDTO.OrderNo = inventoryRequest.IZLID; //éè´§å
¥åºæä»¤ |
| | | List<string> SerialNumbers = new List<string>(); |
| | | Dt_MainReturnInventory dt_MainReturnInventoryOld = _mainReturnInventoryRepository.QueryFirst(x => x.RETURN_NO == inventoryRequest.RETURN_NO && x.RETURN_ITEM_NO == inventoryRequest.RETURN_ITEM_NO); |
| | | Dt_MainReturnInventory dt_MainReturnInventoryOld = _mainReturnInventoryRepository.QueryFirst(x => x.RETURN_NO == inventoryRequest.RETURN_NO && x.RETURN_ITEM_NO == inventoryRequest.RETURN_ITEM_NO); |
| | | if (dt_MainReturnInventoryOld == null) |
| | | { |
| | | //ä¿ååéæ°æ®å°æ¬å° |
| | |
| | | try |
| | | { |
| | | Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(PalletCode); |
| | | if(stockInfo != null) |
| | | if (stockInfo != null) |
| | | { |
| | | if(stockInfo.StockStatus!= (int)StockStatusEmun.ç»çæå) |
| | | if (stockInfo.StockStatus != (int)StockStatusEmun.ç»çæå) |
| | | { |
| | | return content = WebResponseContent.Instance.Error("ç»çæåç¶ææå¯ä»¥æ¤éç»çï¼"); |
| | | } |
| | |
| | | } |
| | | content = MaterielGroupUpdateData(stockInfo); |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error("ç»çä¿¡æ¯ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | 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> |
| | | // /// éæ±è¡ |
| | |
| | | { |
| | | public class PutAwayReturnRequest |
| | | { |
| | | |
| | | |
| | | /// <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; } |
| | | |
| | | } |
| | | |
| | |
| | | public class StockInfoRepository : RepositoryBase<Dt_StockInfo>, IStockInfoRepository |
| | | { |
| | | private readonly ILabelMasterRepository _labelMasterRepository; |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage,ILabelMasterRepository labelMasterRepository) : base(unitOfWorkManage) |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage, ILabelMasterRepository labelMasterRepository) : base(unitOfWorkManage) |
| | | { |
| | | _labelMasterRepository = labelMasterRepository; |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="materielCode"></param> |
| | | /// <returns></returns> |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode,string batchNo) |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, string batchNo) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode&&v.BatchNo==batchNo)).ToList(); |
| | | return Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode && v.BatchNo == batchNo)).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, List<string> locationCodes) |
| | | { |
| | | //ä¿®æ¹åªè·å已䏿¶ç¶æçåºå |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)&&x.StockStatus== (int)StockStatusEmun.已䏿¶).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList(); |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus == (int)StockStatusEmun.已䏿¶).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList(); |
| | | |
| | | |
| | | //ISugarQueryable<Dt_LocationInfo> sugarQueryable = Db.Queryable<Dt_LocationInfo>().Where(x => locationCodes.Contains(x.LocationCode)); |
| | |
| | | { |
| | | //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode); |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == StockStatusEmun.å·²å
¥åº.ObjToInt() && SqlFunc.Subqueryable<Dt_LocationInfo>().Where(v => v.LocationCode == x.LocationCode && v.RoadwayNo == roadwayNo && v.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (EnableStatusEnum.Normal.ObjToInt() == v.EnableStatus)).Any()).OrderBy(x => x.ModifyDate).First(); |
| | | |
| | | |
| | | } |
| | | public Dt_StockInfo GetPalletStockInfo(string roadwayNo,string strayType) |
| | | public Dt_StockInfo GetPalletStockInfo(string roadwayNo, string strayType) |
| | | { |
| | | //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode); |
| | | if (strayType == "1") |
| | |
| | | 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;//ä»åºå· |
| | |
| | | /// </summary> |
| | | /// <param name="freezeByCustomerResponse"></param> |
| | | /// <returns></returns> |
| | | public freezeByCustomerResponse freezeByCustomer(string freezeRequeststr) |
| | | public freezeByCustomerResponse freezeByCustomer(string freezeRequeststr) |
| | | { |
| | | |
| | | |
| | | freezeByCustomerResponse freezeResponse = new freezeByCustomerResponse(); |
| | | 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") |
| | | { |
| | | 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", "ååº", $"åºåºåä¼ æåï¼"); |
| | |
| | | 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; |
| | |
| | | |
| | | private Dictionary<string, OrderByType> _OutLockOrderBy = new Dictionary<string, OrderByType>() |
| | | { |
| | | |
| | | |
| | | { nameof(Dt_OutStockLockInfo.CreateDate), OrderByType.Desc }, |
| | | |
| | | }; |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, ISys_JobService sys_JobService, ILabelMasterRepository labelMasterRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutBoundOrderBYDRepository outBoundOrderBYDRepository, IOutboundOrderDetailBYDRepository outboundOrderDetailByDRepository, IOutboundOrderRepository outboundOrderRepository, IOutboundOrder_HtyRepository outboundOrder_HtyRepository, IOutboundOrderDetail_HtyRepository outboundOrderDetail_HtyRepository, IReturnInventoryDetailRepository returnInventoryDetailRepository,IMainReturnInventoryRepository mainReturnInventoryRepository) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, ISys_JobService sys_JobService, ILabelMasterRepository labelMasterRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutBoundOrderBYDRepository outBoundOrderBYDRepository, IOutboundOrderDetailBYDRepository outboundOrderDetailByDRepository, IOutboundOrderRepository outboundOrderRepository, IOutboundOrder_HtyRepository outboundOrder_HtyRepository, IOutboundOrderDetail_HtyRepository outboundOrderDetail_HtyRepository, IReturnInventoryDetailRepository returnInventoryDetailRepository, IMainReturnInventoryRepository mainReturnInventoryRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _outboundOrderDetail_HtyRepository = outboundOrderDetail_HtyRepository; |
| | | _returnInventoryDetailRepository = returnInventoryDetailRepository; |
| | | _mainReturnInventoryRepository = mainReturnInventoryRepository; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | finally |
| | | { |
| | | WriteLog.GetLog("ä»»å¡å®æ").Write($"æä½äººï¼{(App.User.UserId>0? App.User.UserName: "System")}{ Environment.NewLine}ä»»å¡å·ï¼{taskNum}{Environment.NewLine}{ JsonConvert.SerializeObject(content)}", "ä»»å¡å®æ"); |
| | | WriteLog.GetLog("ä»»å¡å®æ").Write($"æä½äººï¼{(App.User.UserId > 0 ? App.User.UserName : "System")}{Environment.NewLine}ä»»å¡å·ï¼{taskNum}{Environment.NewLine}{JsonConvert.SerializeObject(content)}", "ä»»å¡å®æ"); |
| | | } |
| | | } |
| | | public WebResponseContent TaskCancel(int taskNum) |
| | |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return content=WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | MethodInfo? methodInfo = GetType().GetMethod(((TaskTypeEnum)task.TaskType) + "TaskCancel"); |
| | |
| | | if (!response.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content=WebResponseContent.Instance.Error(response.Message); |
| | | return content = WebResponseContent.Instance.Error(response.Message); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content=responseContent; |
| | | return content = responseContent; |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content=responseContent; |
| | | return content = responseContent; |
| | | } |
| | | } |
| | | } |
| | | return content=WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ç±»å对åºä¸å¡å¤çé»è¾"); |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ç±»å对åºä¸å¡å¤çé»è¾"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content=WebResponseContent.Instance.Error(ex.Message); |
| | | return content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | |
| | | task.Modifier = App.User.UserId > 0 ? App.User.UserName : "System"; |
| | | BaseDal.UpdateData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content = WebResponseContent.Instance.OK(); |
| | | return content = WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | 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); |
| | | _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.IZLID = request.WERKS + request.WH_NUMBER+ DateTime.Now.ToString("yyyyMMdd") + task.TaskNum.ToString(); |
| | | 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â æå
è®¡ä¸æ¶ |
| | | if (labMaster.QC_RESULT_CODE=="02"&&(labMaster.LABEL_STATUS=="02"|| labMaster.LABEL_STATUS == "03")) |
| | | //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) |
| | | { |
| | | WebResponseContent content= _sys_JobService.CallPutAway(request); |
| | | if (content != null&&content.Message== "䏿¶åä¼ æå") //妿䏿¶æåï¼ä¿®æ¹åºåç¶æä¸ºå·²ä¸æ¶ |
| | | //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); |
| | | } |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.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); |
| | | } |
| | | } |
| | | if(DATA.Count>0) |
| | | 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(); |
| | | decimal beforeQuantity = 0; |
| | | |
| | | |
| | | //Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | //Dt_StockInfo stockInfoCatch = stockInfo;//å
ç¼åèµ·æ¥ï¼ä¾åé¢çåä¼ æ¥å£è°ç¨ |
| | | |
| | | 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 "); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | { |
| | | 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) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public WebResponseContent OutboundTaskCancel(Dt_Task task) |
| | | { |
| | | try |
| | |
| | | |
| | | task.TaskStatus = OutTaskStatusEnum.OutCancel.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | |
| | | locationEnd.LocationStatus= LocationStatusEnum.Free.ObjToInt(); |
| | | locationEnd.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.RelocationFree(locationStart, task.TaskNum); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationEnd); |
| | | |
| | |
| | | } |
| | | public bool DepthTask(Dt_LocationInfo location) |
| | | { |
| | | if (location != null ) |
| | | if (location != null) |
| | | { |
| | | Dt_LocationInfo locations = _locationInfoService.Repository.QueryFirst(x => x.RoadwayNo == location.RoadwayNo && x.Column == location.Column && x.Layer == location.Layer && x.Depth != location.Depth && x.Row != location.Row && (SqlFunc.Abs(x.Row - location.Row) == 1)); |
| | | if (locations != null) |
| | |
| | | { |
| | | expression = x => x.Creater == App.User.UserName; |
| | | } |
| | | var task = BaseDal.Db.Queryable<Dt_Task>().OrderByDescending(x => x.CreateDate).Take(10).Select(x => new Dt_Task { TaskNum = x.TaskNum, PalletCode=x.PalletCode, TaskType=x.TaskType,SourceAddress=x.SourceAddress,TargetAddress=x.TargetAddress }).ToList(); |
| | | var task = BaseDal.Db.Queryable<Dt_Task>().OrderByDescending(x => x.CreateDate).Take(10).Select(x => new Dt_Task { TaskNum = x.TaskNum, PalletCode = x.PalletCode, TaskType = x.TaskType, SourceAddress = x.SourceAddress, TargetAddress = x.TargetAddress }).ToList(); |
| | | content = WebResponseContent.Instance.OK(data: task); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | using WIDESEA_Model.Models; |
| | | using System; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Core.LogHelper; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | |
| | | |
| | | [HttpPost, HttpGet, Route("UploadApp"), AllowAnonymous] |
| | | public async Task<WebResponseContent> UploadApk(IEnumerable<IFormFile> fileInput) |
| | | { |
| | | { |
| | | // æ£æ¥æ¯å¦ææä»¶ä¸ä¼ |
| | | if (fileInput == null || !fileInput.Any()) |
| | | { |
| | |
| | | |
| | | var formFile = fileInput.First(); |
| | | var uploadFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "Upload"); |
| | | Directory.CreateDirectory(uploadFolder); |
| | | Directory.CreateDirectory(uploadFolder); |
| | | |
| | | var fileName = $"WMS-PDA.apk"; |
| | | var filePath = Path.Combine(uploadFolder, fileName); |
| | |
| | | } |
| | | memory.Position = 0; |
| | | var ext = Path.GetExtension(filePath).ToLowerInvariant(); |
| | | return File(memory, new Dictionary<string, string>{{ ".apk", "application/vnd.android.package-archive" }}[ext], Path.GetFileName(filePath)); |
| | | return File(memory, new Dictionary<string, string> { { ".apk", "application/vnd.android.package-archive" } }[ext], Path.GetFileName(filePath)); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | [HttpPost, Route("EmptyInBound"), AllowAnonymous] |
| | | public WebResponseContent EmptyInBound(string PalletCode) |
| | | { |
| | | return _taskService.PalletInboundRequest("R01-001-023-001",PalletCode); |
| | | return _taskService.PalletInboundRequest("R01-001-023-001", PalletCode); |
| | | } |
| | | |
| | | |
| | |
| | | [HttpGet, Route("EmptyOutBound"), AllowAnonymous] |
| | | public WebResponseContent EmptyOutBound(string trayType) |
| | | { |
| | | return _taskService.PalletOutboundTask("R01", "R01-001-023-001",trayType); |
| | | return _taskService.PalletOutboundTask("R01", "R01-001-023-001", trayType); |
| | | |
| | | } |
| | | |
| | |
| | | [HttpPost, Route("MaterielGroup"), AllowAnonymous] |
| | | 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); |
| | | string PalletCode = saveModel.MainData["PalletCode"].ToString(); |
| | | 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:")) |
| | | 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; |
| | |
| | | /// <param name="PalletCode">æçå·</param> |
| | | /// <returns></returns> |
| | | [HttpGet, Route("MaterielInBoundReturnConfirm"), AllowAnonymous] |
| | | public WebResponseContent MaterielInBoundReturnConfirm( string PalletCode) |
| | | public WebResponseContent MaterielInBoundReturnConfirm(string PalletCode) |
| | | { |
| | | return _taskService.ReturnInboundRequest("R01-001-023-001", PalletCode); |
| | | } |
| | |
| | | "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", //çç¥åç§° |
| | |
| | | "WCS": "http://localhost:9291/api/Task/", |
| | | "WERKS": "GX25", //å·¥å |
| | | "SYSNO": "G30", //ç«åºç³»ç»æ è¯ï¼åææ è¯ |
| | | "CallMaterialID": "W01",//嫿æ è¯ |
| | | "CallMaterialID": "W01", //嫿æ è¯ |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | "QuartzJobAutoStart": true, |