diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
index 4a2b5ae..aa99671 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
@@ -10560,6 +10560,96 @@ END";
}
}
}
+
+ #region 盘点审核
+ ///
+ /// 多语言查询
+ ///
+ ///
+ ///
+ public static DataTable CheckApove(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"]);
+ try
+ {
+ string lots = string.Empty;
+ string sql = string.Empty;
+ int result = 0;
+ string Identification = Guid.NewGuid().ToString();
+ foreach (var item in JsonData)
+ {
+ //创建盘点单
+ foreach (var itemInfo in item.detail)
+ {
+ ICSWareHouseLotInfoService.WareHouseLotInfoUpdate(Identification, item.CheckCode, "", itemInfo.LotNo, itemInfo.ActualQuantity, item.User, item.WorkPoint, TransTypeEnum.Check.GetDescription(), item.CheckKind, cmd, language);
+
+ lots += "'" + itemInfo.LotNo + item.WorkPoint + "',";
+ }
+ if (string.IsNullOrWhiteSpace(lots))
+ {
+ throw new Exception(language.GetNameByCode("WMSAPIInfo005"));//"请传入条码信息!");
+ }
+ //sql = @"UPDATE a SET ActualQuantity=b.ActualQuantity
+ // FROM ICSCheck a
+ // INNER JOIN (SELECT x.CheckCode,x.WorkPoint,y.WarehouseCode,y.InvCode,SUM(ActualQuantity) AS ActualQuantity FROM ICSCheckDetail x INNER JOIN ICSWareHouseLotInfo y ON x.LotNo=y.LotNo AND x.WorkPoint=y.WorkPoint WHERE x.LotNo+x.WorkPoint IN ({2}) GROUP BY x.CheckCode,x.WorkPoint,y.WarehouseCode,y.InvCode) b ON a.CheckCode=b.CheckCode AND a.WorkPoint=b.WorkPoint AND a.WHCode=b.WarehouseCode AND a.InvCode=b.InvCode
+ // WHERE a.CheckCode='{0}' and a.WorkPoint='{1}'";
+ //sql = string.Format(sql, item.CheckCode, item.WorkPoint, lots.Substring(0, lots.Length - 1));
+
+ //if (!DBHelper.ExecuteNonQuery(sql, cmd))
+ //{
+ // throw new Exception(language.GetNameByCode("WMSAPIInfo034"));//"盘点扫描更新盘点单失败!");
+ //}
+ }
+ #region 查询返回数据
+ sql = @"SELECT x.ID,x.CheckID,y.WarehouseCode AS WHCode,x.LotNo,
+ y.InvCode,
+ inv.InvName,
+ inv.InvStd,
+ x.Quantity,x.PrimaryQuantity,x.PrimaryAmount,x.ReplayQuantity,x.ReplayAmount,x.CheckQuantity,x.CheckAmount,
+ inv.InvUnit,
+ x.MUSER AS [User],
+ x.MTIME AS [MTime]
+ FROM ICSCheckDetail x
+ INNER JOIN ICSWareHouseLotInfo y ON x.LotNo=y.LotNo AND x.WorkPoint=y.WorkPoint
+ INNER JOIN ICSInventory inv ON y.InvCode=inv.InvCode AND y.WorkPoint=inv.WorkPoint
+ WHERE x.LotNo+x.WorkPoint IN ({0})";
+ sql = string.Format(sql, lots.Substring(0, lots.Length - 1));
+ DataTable data = DBHelper.SQlReturnData(sql, cmd);
+ #endregion
+ cmd.Transaction.Commit();
+ return data;
+ }
+ 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();
+ }
+ }
+ }
+ #endregion
+
///
/// 容器关联查询容器
///
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
index ec449a8..848efb1 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
@@ -68,6 +68,50 @@ namespace ICSSoft.WebAPI.Controllers
return result;
}
+ ///
+ /// 多语言
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("api/CheckAppove/Get")]
+ public HttpResponseMessage CheckAppove([FromBody] object JsonData)
+ {
+ log.Info("盘点审核传入值" + JsonData);
+ try
+ {
+ if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
+ {
+ List model = JsonConvert.DeserializeObject>(JsonData.ToString());
+ //WMSBarCoreService action = new WMSBarCoreService();
+ //List resultStr = action.Get(model);
+ //res.Success = true;
+ //res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
+ //res.Data = resultStr;
+ var resultStr = ICSSubmitService.CheckApove(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;
+ }
+
//#region 委外送货单
/////
///// 委外送货单查询