diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs index 6203d9f..093fd54 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs @@ -521,12 +521,12 @@ IF EXISTS(SELECT b.ID FROM ICSWareHouseLotInfoLog a // BEGIN // RAISERROR('" + language.GetNameByCode("WMSAPIInfo193") + @"',16,1); // END"; - sql = @"IF EXISTS(select * from ICSOApplyNegDetail where Quantity>'{2}' and c.OApplyNegCode='{5}' and c.Sequence='{6}') + sql = @"IF EXISTS(select * from ICSOApplyNegDetail where Quantity>='{2}' and OApplyNegCode='{5}' and Sequence='{6}') BEGIN UPDATE c SET IssueNegQuantity=ISNULL(IssueNegQuantity,0)+'{2}' FROM ICSOApplyNegDetail c INNER JOIN ICSOApplyNeg d ON c.OApplyNegCode=d.OApplyNegCode AND c.WorkPoint=d.WorkPoint - WHERE a.WorkPoint='{1}' and c.OApplyNegCode='{5}' and c.Sequence='{6}' + WHERE c.WorkPoint='{1}' and c.OApplyNegCode='{5}' and c.Sequence='{6}' END"; sql = string.Format(sql, LotNo, WorkPoint, Quantity, table, LogID, TransCode, TransSequence); #endregion diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index 09e3d94..45f8418 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -1880,7 +1880,7 @@ a.ExtensionID tableName = @"ICSOApplyNegDetail a INNER JOIN ICSOApplyNeg d ON a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.WorkPoint"; - where = @" a.WorkPoint='{1}' AND d.Status='1' AND a.Quantity>a.IssueNegQuantity AND d.Type='1'"; + where = @" a.WorkPoint='{1}' AND d.Status='2' AND a.Quantity>a.IssueNegQuantity AND d.Type='1'"; } #endregion #region 生产发料(合并发料) @@ -2815,6 +2815,10 @@ a.ExtensionID zlqty = zlltable.Rows[0]["Quantity"].ToString(); iszl = true; } + else + { + throw new Exception("该单据条码未拣配,请确认!"); + } } } } @@ -2847,7 +2851,7 @@ a.ExtensionID columns = string.Format(columns, zlqty); tableName = @"ICSWareHouseLotInfoLog a - INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint + INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint and a.TransType='15' INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint INNER JOIN ICSWarehouse wh ON a.FromWarehouseCode=wh.WarehouseCode AND a.WorkPoint=wh.WorkPoint INNER JOIN ICSLocation loc ON a.FromLocationCode=loc.LocationCode AND a.WorkPoint=loc.WorkPoint @@ -4128,6 +4132,19 @@ a.ExtensionID || TransType == TransTypeEnum.ICSOutsourcingIssueDoNegativeIssue.GetDescription()) { //更新源头单据数量 + string chekksql = @"select c.EATTRIBUTE1 FROM ICSOApplyNegDetail a + INNER JOIN ICSOApplyNeg d ON a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.WorkPoint + INNER JOIN ICSInventory c on a.InvCode=c.InvCode and a.WorkPoint=c.WorkPoint + WHERE a.OApplyNegCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}' and c.AmountEnable='1'"; + chekksql = string.Format(chekksql, itemInfo.TransCode, item.WorkPoint, itemInfo.Quantity, itemInfo.TransSequence); + DataTable dta = DBHelper.SQlReturnData(chekksql, cmd); + if (dta.Rows.Count > 0) + { + itemInfo.Quantity = (decimal.Parse(itemInfo.Quantity) * decimal.Parse(dta.Rows[0]["EATTRIBUTE1"].ToString())).ToString(); + } + + log.Debug("数量:"+itemInfo.Quantity); + ICSOutsourcingService.OutsourcingIssueDoNegative(TransType, itemInfo.LogID, itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, itemInfo.TransCode, itemInfo.TransSequence, cmd, language); BusinessCode = TransTypeEnum.ICSOutsourcingIssueDoNegative.GetDescription(); } @@ -4181,6 +4198,7 @@ a.ExtensionID // throw new Exception("当前扫描的条码物料和单据子件物料没有匹配的行,请确认!"); //} string seq = itemInfo.TransSequence + "~" + drs[0]["Sequence"].ToString(); + itemInfo.TransSequence = seq; log.Debug("工单子件行号:" + seq); string chekksql = @"select c.EATTRIBUTE1 FROM ICSMOPick a INNER JOIN ICSMO b ON a.MODetailID=b.MODetailID AND a.WorkPoint=b.WorkPoint @@ -4492,6 +4510,106 @@ a.ExtensionID } + /// + /// 库存调整(奥美专用) + /// BusinessCode,TransType 两个类型 + /// + /// + public static DataTable LOTUpdateAM(List JsonData) + { + var language = LanguageHelper.GetName("WMSAPIInfo"); + if (JsonData.Count <= 0) + { + throw new Exception(language.GetNameByCode("WMSAPIInfo007"));//"传送数据为空!" + } + + using (SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString)) + { + conn.Open(); + SqlTransaction sqlTran = conn.BeginTransaction(); + SqlCommand cmd = new SqlCommand(); + cmd.Transaction = sqlTran; + cmd.Connection = conn; + cmd.CommandTimeout = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["TimeOut"]); + string BusinessCode = string.Empty; + try + { + string TransType = string.Empty; + string sql = string.Empty; + DataTable dtable = new DataTable(); + string TransTypeOriginal = string.Empty;//记录不合格入库条码的原条码的类型 + string Identification = Guid.NewGuid().ToString(); + foreach (var item in JsonData) + { + TransType = "2"; + BusinessCode = TransTypeEnum.LocationSeatch.GetDescription(); + if (!EnumHelper.HasDescriptions(typeof(TransTypeEnum), TransType)) + { + throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!" + } + + + foreach (var itemInfo in item.detail) + { + sql = @"UPDATE ICSWareHouseLotInfo set Quantity='{2}' WHERE lotno='{0}' AND WorkPoint='{1}'"; + sql = string.Format(sql, itemInfo.LotNo, item.WorkPoint, itemInfo.Quantity); + if (!DBHelper.ExecuteNonQuery(sql, cmd)) + { + throw new Exception("库存调整失败!"); + } + + ///添加日志 + sql = @"INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode, + FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity, + Memo,Lock,TransType,BusinessCode,ERPUpload,ERPID, + ERPDetailID,ERPCode,ERPSequence,MUSER,MUSERName, + MTIME,WorkPoint,EATTRIBUTE1,LogID) + SELECT NEWID(),'{3}','','',a.LotNo ,a.InvCode , + '','','','','{6}', + '','0','{4}','{5}','0','', + '','','',f.F_Account ,f.F_RealName , + SYSDATETIME() ,a.WorkPoint ,'','' + FROM ICSInventoryLot a + INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint + INNER JOIN ICSWareHouseLotInfo c ON a.LotNo=c.LotNo AND a.WorkPoint=c.WorkPoint + INNER JOIN Sys_SRM_User f ON f.F_Account='{2}' AND a.WorkPoint=f.F_Location + WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' + "; + sql = string.Format(sql, itemInfo.LotNo, item.WorkPoint, item.User, Identification, TransType, BusinessCode, itemInfo.Quantity); + + if (!DBHelper.ExecuteNonQuery(sql, cmd)) + { + throw new Exception(language.GetNameByCode("WMSAPIInfo166")); + } + } + + + } + + + DataTable table = GetData(Identification, 1, cmd); + cmd.Transaction.Commit(); + return table; + + } + catch (Exception ex) + { + if (cmd.Transaction != null) + cmd.Transaction.Rollback(); + log.Error(ex.Message); + throw new Exception(ex.Message); + } + finally + { + if (conn.State == ConnectionState.Open) + { + conn.Close(); + } + conn.Dispose(); + } + } + } + /// /// 下架 /// @@ -7387,6 +7505,8 @@ END"; foreach (var item in JsonData) { + + //获取单号 sql = @"DECLARE @MaxNO INT,@date varchar(20)='OOIA'+SUBSTRING(CONVERT(varchar(8), GETDATE(), 112), 1, 8) SELECT @MaxNO=SUBSTRING(MAX(OApplyNegCode),LEN(@date)+1,LEN(MAX(OApplyNegCode))-LEN(@date))+1 FROM ICSOApplyNeg @@ -7428,6 +7548,16 @@ END"; uniqueItems.Add(key); + + string chekksql = @"select c.EATTRIBUTE1 ICSInventory c + WHERE c.InvCode='{0}'AND c.WorkPoint='{1}' and c.AmountEnable='1'"; + chekksql = string.Format(chekksql, itemInfo.InvCode, itemInfo.WorkPoint); + DataTable dta = DBHelper.SQlReturnData(chekksql, cmd); + if (dta.Rows.Count > 0) + { + itemInfo.Quantity = (itemInfo.Quantity * decimal.Parse(dta.Rows[0]["EATTRIBUTE1"].ToString())); + } + // 创建子表 sql = @"INSERT INTO ICSOApplyNegDetail(ID,OApplyNegCode,Sequence,SourceDetailID,InvCode, Quantity,Amount,IssueNegQuantity,ExtensionID,MUSER, @@ -7570,15 +7700,17 @@ END"; foreach (var itemInfo in item.detail) { - string chekksql = @"select c.EATTRIBUTE1 ICSInventory c + string chekksql = @"select c.EATTRIBUTE1 from ICSInventory c WHERE c.InvCode='{0}'AND c.WorkPoint='{1}' and c.AmountEnable='1'"; - chekksql = string.Format(chekksql, itemInfo.InvCode, itemInfo.WorkPoint); + chekksql = string.Format(chekksql, itemInfo.InvCode, item.WorkPoint); DataTable dta = DBHelper.SQlReturnData(chekksql, cmd); if (dta.Rows.Count > 0) { itemInfo.Quantity = (itemInfo.Quantity * decimal.Parse(dta.Rows[0]["EATTRIBUTE1"].ToString())); } + log.Debug("退料数量"+itemInfo.Quantity); + string key = itemInfo.Sequence + "~" + itemInfo.InvCode; if (uniqueItems.Contains(key)) @@ -7981,7 +8113,7 @@ END"; Code = DBHelper.ExecuteScalar(sql, cmd).ToString(); foreach (var itemInfo in item.detail) { - string chekksql = @"select c.EATTRIBUTE1 ICSInventory c + string chekksql = @"select c.EATTRIBUTE1 from ICSInventory c WHERE c.InvCode='{0}'AND c.WorkPoint='{1}' and c.AmountEnable='1'"; chekksql = string.Format(chekksql, itemInfo.InvCode, itemInfo.WorkPoint); DataTable dta = DBHelper.SQlReturnData(chekksql, cmd); @@ -11753,18 +11885,26 @@ END"; //1 - 不管控 //2 - 提醒 //3 - 限制 - if (dttt.Rows[0]["F_ItemName"].ToString() == "失效日期") + if (dttt.Rows.Count > 0&& dttt!=null) { - sql = string.Format(sql, LotNo, WorkPoitCode, "ISNULL(b.ExpirationDate,b.ProductDate)", "ISNULL(y.ExpirationDate,y.ProductDate)"); - } - else if (dttt.Rows[0]["F_ItemName"].ToString() == "生产日期") - { - sql = string.Format(sql, LotNo, WorkPoitCode, "b.ProductDate", "y.ProductDate"); + if (dttt.Rows[0]["F_ItemName"].ToString() == "失效日期") + { + sql = string.Format(sql, LotNo, WorkPoitCode, "ISNULL(b.ExpirationDate,b.ProductDate)", "ISNULL(y.ExpirationDate,y.ProductDate)"); + } + else if (dttt.Rows[0]["F_ItemName"].ToString() == "生产日期") + { + sql = string.Format(sql, LotNo, WorkPoitCode, "b.ProductDate", "y.ProductDate"); + } + else + { + sql = string.Format(sql, LotNo, WorkPoitCode, "a.InDate", "x.InDate"); + } } else { sql = string.Format(sql, LotNo, WorkPoitCode, "a.InDate", "x.InDate"); } + if (!string.IsNullOrWhiteSpace(ScanLotCode)) { @@ -16244,7 +16384,7 @@ a.ExtensionID #region 原条码 if (ScanType == "LOTNO") { - sql = sql + @" AND log.BusinessCode IN('" + type + @"') GROUP BY inv.AmountEnable,inv.LotEnable,log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,a.WarehouseCode, + sql = sql + @" AND log.BusinessCode IN('" + type + @"') and log.TransCode='{6}' GROUP BY inv.AmountEnable,inv.LotEnable,log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,a.WarehouseCode, wh.WarehouseName,a.LocationCode,loc.LocationName,CASE WHEN(invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')= '1') OR ISNULL(invBat.BatchEnable, '0')= '1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,inv.AmountUnit, ext.ID,ext.ProjectCode,ext.Version,ext.Brand,ext.cFree1,ext.cFree2,ext.cFree3,ext.cFree4,ext.cFree5,ext.cFree6,ext.cFree7,ext.cFree8,ext.cFree9,ext.cFree10,a.MUSER,a.MTIME "; @@ -16285,7 +16425,7 @@ a.ExtensionID } else { - sql = sql + @" AND log.BusinessCode IN('" + type + @"') GROUP BY inv.AmountEnable,inv.LotEnable,log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,a.WarehouseCode, + sql = sql + @" AND log.BusinessCode IN('" + type + @"') and log.TransCode='{6}' GROUP BY inv.AmountEnable,inv.LotEnable,log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,a.WarehouseCode, wh.WarehouseName,a.LocationCode,loc.LocationName,CASE WHEN(invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')= '1') OR ISNULL(invBat.BatchEnable, '0')= '1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,inv.AmountUnit, ext.ID,ext.ProjectCode,ext.Version,ext.Brand,ext.cFree1,ext.cFree2,ext.cFree3,ext.cFree4,ext.cFree5,ext.cFree6,ext.cFree7,ext.cFree8,ext.cFree9,ext.cFree10,a.MUSER,a.MTIME "; @@ -16549,7 +16689,7 @@ a.ExtensionID columns = string.Format(columns, zlqty); tableName = @"ICSWareHouseLotInfoLog a - INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint + INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint and a.TransType='15' INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint INNER JOIN ICSWarehouse wh ON a.FromWarehouseCode=wh.WarehouseCode AND a.WorkPoint=wh.WorkPoint INNER JOIN ICSLocation loc ON a.FromLocationCode=loc.LocationCode AND a.WorkPoint=loc.WorkPoint @@ -17507,7 +17647,7 @@ a.ExtensionID /// - /// 回撤拣配 + /// 一键回撤拣配 /// /// /// @@ -17601,6 +17741,107 @@ a.ExtensionID } + /// + /// 单个条码回撤拣配 + /// + /// + /// + public static DataTable BackPickMergeOne(BarCodeModel JsonData) + { + String PrintEnable = ""; + var language = LanguageHelper.GetName("WMSAPIInfo"); + //if (JsonData.Count <= 0) + //{ + // throw new Exception(language.GetNameByCode("WMSAPIInfo007"));//"传送数据为空!" + //} + List model = new List(); + DataTable printTable = new DataTable(); + using (SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString)) + { + conn.Open(); + SqlTransaction sqlTran = conn.BeginTransaction(); + SqlCommand cmd = new SqlCommand(); + cmd.Transaction = sqlTran; + cmd.Connection = conn; + cmd.CommandTimeout = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["TimeOut"]); + string BusinessCode = string.Empty; + try + { + string TransType = string.Empty; + string pikTbLogsql = ""; + string Identification = Guid.NewGuid().ToString(); + //foreach (var item in JsonData) + //{ + //TransType = item.TransType; + if (!EnumHelper.HasDescriptions(typeof(TransTypeEnum), JsonData.TransType)) + { + throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!" + } + else if (string.IsNullOrEmpty(JsonData.TransCode)) + { + throw new Exception(language.GetNameByCode("WMSAPIInfo001"));//"单据号不能为空!" + } + //string[] trans = item.TransCode.Split('~'); + //string MergeID = ""; + //if (trans.Length == 2) + //{ + // MergeID = trans[0]; + // item.TransCode = trans[1]; + //} + + #region 销售出库 + else if (JsonData.TransType == TransTypeEnum.SalesShipmentDoc.GetDescription() + || JsonData.TransType == TransTypeEnum.MOIssueDoc.GetDescription() + || JsonData.TransType == TransTypeEnum.OutsourcingIssueDoc.GetDescription()) + { + BusinessCode = TransTypeEnum.SalesShipmentDoc.GetDescription(); + pikTbLogsql = @"IF NOT EXISTS(SELECT id FROM ICSWareHouseLotInfoLog where TransCode ='{0}' and lotno='{2}' and TransType='15' and WorkPoint='{1}') + BEGIN + RAISERROR('当前条码单据未查询到拣配记录,请确认!',16,1); + RETURN + END"; + //更新源头单据数量 + pikTbLogsql += @" update b set b.LockQuantity=convert(decimal(18,6),b.LockQuantity)-convert(decimal(18,6),c.Quantity ) + from dbo.ICSWareHouseLotInfo b + inner join (select sum(Quantity) as Quantity, LotNo from ICSWareHouseLotInfolog where TransCode ='{0}' and lotno='{2}' and TransType='15' and WorkPoint='{1}' group by LotNo) c + on c.LotNo =b.LotNo "; + + pikTbLogsql += @" delete dbo.ICSWareHouseLotInfoLog where TransCode ='{0}' and lotno='{2}' and TransType='15' and WorkPoint='{1}'"; + pikTbLogsql = string.Format(pikTbLogsql, JsonData.TransCode,JsonData.WorkPoint,JsonData.Code); + if (!DBHelper.ExecuteNonQuery(pikTbLogsql, cmd)) + { + throw new Exception("回撤拣料失败!"); + } + } + #endregion + else + { + throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!" + } + //} + DataTable table = null; + cmd.Transaction.Commit(); + return table; + } + catch (Exception ex) + { + if (cmd.Transaction != null) + cmd.Transaction.Rollback(); + log.Error(ex.Message); + throw new Exception(ex.Message); + } + finally + { + if (conn.State == ConnectionState.Open) + { + conn.Close(); + } + conn.Dispose(); + } + } + } + + /// /// 回撤拣配 /// diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs index 9342e93..26f7c44 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs @@ -749,7 +749,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSWarehouse e ON d.WHID=e.ID AND d.WorkPoint=e.WorkPoint WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' END - ELSE IF EXISTS(SELECT a.LotNO FROM ICSWareHouseLotInfo a WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND a.LocationCode=(select a.FromLocationCode FROM ICSWareHouseLotInfoLog a WHERE a.LotNo='CP-41100212' AND a.WorkPoint='UFDATA_999_2021' AND a.id='{5}' + ELSE IF EXISTS(SELECT a.LotNO FROM ICSWareHouseLotInfo a WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND a.LocationCode=(select a.FromLocationCode FROM ICSWareHouseLotInfoLog a WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND a.id='{5}' AND a.FromLocationCode='" + locationcode + @"')) BEGIN UPDATE ICSWareHouseLotInfo SET Quantity=ISNULL(Quantity,0)+'{3}' diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs index 7d19fdc..2d472b2 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs @@ -758,6 +758,54 @@ namespace ICSSoft.WebAPI.Controllers return result; } + + /// + /// 库存调整(奥美专用) + /// + /// + /// + [HttpPost] + [Route("api/LOTUpdate/Update")] + public HttpResponseMessage LOTUpdateAM([FromBody] object JsonData) + { + log.Info("奥美库存调整传入值" + JsonData); + try + { + if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]") + { + lock (key) + { + List model = new List(); + model = JsonConvert.DeserializeObject>(JsonData.ToString()); + //WMSBarCoreService action = new WMSBarCoreService(); + //var resultStr = action.LOTStockCreate(model); + var resultStr = ICSSubmitService.LOTUpdateAM(model); + res.Success = true; + res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!"; + if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]") + { + res.Data = resultStr; + } + } + + + } + } + catch (Exception ex) + { + log.Error("转换失败:" + ex.ToString()); + res.Success = false; + res.Message = ex.Message; + } + finally + { + str = JsonConvert.SerializeObject(res); + result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json"); + } + log.Debug("库存调整返回值:" + str); + return result; + } + /* /// /// 测试获取管控方式 @@ -1047,7 +1095,7 @@ namespace ICSSoft.WebAPI.Controllers /// - /// 回撤拣配 + /// 一键回撤拣配 /// /// /// @@ -1097,6 +1145,57 @@ namespace ICSSoft.WebAPI.Controllers } + /// + /// 单个条码回撤拣配 + /// + /// + /// + [HttpPost] + [Route("api/PickMergeOne/Update")] + public HttpResponseMessage BackPickMergeOne([FromBody] object JsonData) + { + log.Info("下架传入值" + JsonData); + try + { + if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]") + { + BarCodeModel model = new BarCodeModel(); + model = JsonConvert.DeserializeObject(JsonData.ToString()); + //WMSBarCoreService action = new WMSBarCoreService(); + //var resultStr = action.LOTStockDownCreate(model); + var resultStr = ICSSubmitService.BackPickMergeOne(model); + res.Success = true; + //if (resultStr.Columns.Contains("OLDLotNo")) + //{ + // res.PrintStr = DBHelper.ReadFileStream(); + //}else + //{a + res.PrintStr = ""; + //} + + res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!"; + if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]") + { + res.Data = resultStr; + } + } + } + catch (Exception ex) + { + log.Error("转换失败:" + ex.ToString()); + res.Success = false; + res.Message = ex.Message; + } + finally + { + str = JsonConvert.SerializeObject(res); + result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json"); + } + log.Debug("下架返回值:" + str); + return result; + } + + /// /// 回撤拣配/all ///