Browse Source

客供料到货、自购料到货

master
姜鹏 3 weeks ago
parent
commit
53d4e6a21a
  1. 84
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs
  2. 1038
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  3. 181
      ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
  4. 4
      ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Web.config

84
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs

@ -2037,6 +2037,88 @@ IF EXISTS(SELECT b.id FROM ICSPurchaseReceive b where rcvcode in
Result result = new Result(); Result result = new Result();
result = JsonConvert.DeserializeObject<Result>(resultStr); result = JsonConvert.DeserializeObject<Result>(resultStr);
if (result.Success) if (result.Success)
{
//try
//{
// JArray res = (JArray)JsonConvert.DeserializeObject(result.Data.ToString());
// foreach (var item in res)
// {
// JObject jo = (JObject)item;
// JArray resdetail = (JArray)JsonConvert.DeserializeObject(jo["details"].ToString());
// foreach (var detail in resdetail)
// {
// JObject det = (JObject)detail;
// string ERPupdate = @"update ICSDeliveryNotice set DNCode='{0}',Sequence='{1}',DNID='{2}',DNDetailID='{3}'
// where PODetailID='{4}' AND DNType='1' AND DNCode='{5}' and Sequence='{1}'";
// ERPupdate = string.Format(ERPupdate, jo["DNCode"], det["Sequence"], jo["ID"], det["DetailID"], det["PODetailID"], DNCode);
// if (!DBHelper.ExecuteNonQuery(ERPupdate, cmd))
// {
// throw new Exception(language.GetNameByCode("WMSAPIInfo079"));//"到货单更新失败!");
// }
// }
// }
//}
//catch (Exception ex)
//{
// log.Debug(ex.ToString());
// log.Debug(resultStr);
//}
}
else
{
throw new Exception(language.GetNameByCode("WMSAPIInfo080") + result.Message);
}
#endregion
}
catch (Exception)
{
throw;
}
}
#endregion
#region YS到货单创建
public static void YSDeliveryNoticeERP(string DNCode, string WorkPoint, SqlCommand cmd, Dictionary<string, string> language)
{
try
{
#region ERP
string sql = "";
sql = @"SELECT a.VenCode+a.DepCode+a.MUSER AS Costre,a.VenCode,a.DepCode,y.POCode,a.MUSER,a.MTIME,
a.Sequence,a.InvCode,a.Quantity,CASE invBat.AmountEnable WHEN '1' THEN a.Amount ELSE '0' END AS Amount,ISNULL(a.UnitPrice,0) AS UnitPrice,a.Currency,a.PODetailID
,a.WorkPoint,ISNULL(ext.ProjectCode, '') AS ProjectCode,CASE WHEN ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END AS BatchCode,ISNULL(ext.Version, '') AS Version,ISNULL(ext.Brand, '') AS Brand,
ISNULL(ext.cFree1, '') AS cFree1,ISNULL(ext.cFree2, '') AS cFree2,ISNULL(ext.cFree3, '') AS cFree3,ISNULL(ext.cFree4, '') AS cFree4,ISNULL(ext.cFree5, '') AS cFree5,ISNULL(ext.cFree6, '') AS cFree6,ISNULL(ext.cFree7, '') AS cFree7,ISNULL(ext.cFree8, '') AS cFree8,ISNULL(ext.cFree9, '') AS cFree9,ISNULL(ext.cFree10, '') AS cFree10
INTO #TempERP
FROM ICSDeliveryNotice a
INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoint
LEFT JOIN ICSInventory invBat ON a.InvCode=invBat.InvCode AND a.WorkPoint=invBat.WorkPoint
INNER JOIN ICSPurchaseOrder y ON a.PODetailID=y.PODetailID AND a.WorkPoint=y.WorkPoint
WHERE a.DNCode='{0}' AND a.WorkPoint='{1}'
-- SELECT DISTINCT Costre,WorkPoint,VenCode,DepCode,POCode,MUSER AS [User],SYSDATETIME() AS MTime FROM #TempERP
-- SELECT Costre,Sequence,InvCode,Quantity,Amount,UnitPrice,Currency,PODetailID,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10
-- FROM #TempERP
SELECT DISTINCT Costre,WorkPoint,VenCode,DepCode
,CASE (SELECT Enable FROM ICSConfiguration WHERE Code='POCodeDisplayed' AND WorkPoint='{1}') WHEN 0 THEN '' ELSE POCode END AS POCode
,MUSER AS [User],SYSDATETIME() AS MTime FROM #TempERP
SELECT Costre,Sequence,InvCode,Quantity,Amount,UnitPrice,Currency,POCode,PODetailID,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10
FROM #TempERP
DROP TABLE #TempERP";
sql = string.Format(sql, DNCode, WorkPoint);
DataSet ds = DBHelper.SQlReturnDataSet(sql, cmd);
string Inputstr = DataToJsonHelper.DataSetToJson(ds, "details", "Costre");
string resultStr = HTTPHelper.HttpPost("采购到货", ERPUrl.CreatePOArrivURL, Inputstr);
Result result = new Result();
result = JsonConvert.DeserializeObject<Result>(resultStr);
if (result.Success)
{ {
try try
{ {
@ -2078,5 +2160,7 @@ IF EXISTS(SELECT b.id FROM ICSPurchaseReceive b where rcvcode in
} }
} }
#endregion #endregion
} }
} }

1038
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
File diff suppressed because it is too large
View File

181
ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs

@ -159,148 +159,7 @@ namespace ICSSoft.WebAPI.Controllers
log.Debug("获取层级返回值:" + str); log.Debug("获取层级返回值:" + str);
return result; return result;
} }
//#region 委外送货单
///// <summary>
///// 委外送货单查询
///// </summary>
///// <returns></returns>
//[HttpPost]
//[Route("api/AdvancedShipmentNotice/NoticeGet")]
//public HttpResponseMessage NoticeGET([FromBody] object JsonData)
//{
// log.Info("委外送货单信息传入值" + JsonData);
// try
// {
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
// {
// OutsourcingModel model = new OutsourcingModel();
// model = JsonConvert.DeserializeObject<OutsourcingModel>(JsonData.ToString());
// OutsourcingSevice action = new OutsourcingSevice();
// OutsourcingModelInfo resultStr = action.Get(model);
// if (resultStr == null)
// {
// res.Success = false;
// res.Message = LanguageHelper.GetNameSingle("WMSAPI003");//"未查询到相关数据!";
// }
// else
// {
// res.Success = true;
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
// 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;
//}
//#endregion
///// <summary>
///// 委外送货单添加
///// </summary>
///// <param name="JsonData"></param>
///// <returns></returns>
//[HttpPost]
//[Route("api/AdvancedShipmentNotice/NoticeCreate")]
//public HttpResponseMessage NoticeCreate([FromBody] object JsonData)
//{
// log.Info("委外送货单添加信息传入值" + JsonData);
// try
// {
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
// {
// List<NoticeCreateIModel> model = new List<NoticeCreateIModel>();
// model = JsonConvert.DeserializeObject<List<NoticeCreateIModel>>(JsonData.ToString());
// OutsourcingSevice action = new OutsourcingSevice();
// var resultStr = action.Create(model);
// if (resultStr < 0)
// {
// res.Success = false;
// res.Message = LanguageHelper.GetNameSingle("WMSAPI003");//"未查询到相关数据!";
// }
// else
// {
// res.Success = true;
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
// res.Data = null;
// }
// }
// }
// 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;
//}
///// <summary>
///// 委外送货单删除
///// </summary>
///// <param name="JsonData"></param>
///// <returns></returns>
//[HttpPost]
//[Route("api/AdvancedShipmentNotice/NoticeDelete")]
//public HttpResponseMessage NoticeDelete([FromBody] object JsonData)
//{
// log.Info("委外送货单删除信息传入值" + JsonData);
// try
// {
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
// {
// NoticeDelete model = new NoticeDelete();
// model = JsonConvert.DeserializeObject<NoticeDelete>(JsonData.ToString());
// OutsourcingSevice action = new OutsourcingSevice();
// var resultStr = action.Delete(model);
// if (resultStr == null)
// {
// res.Success = false;
// res.Message = LanguageHelper.GetNameSingle("WMSAPI003");//"未查询到相关数据!";
// }
// else
// {
// res.Success = true;
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
// 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;
//}
/// <summary> /// <summary>
/// 使用中 /// 使用中
/// 获取源头单据信息 /// 获取源头单据信息
@ -930,10 +789,6 @@ namespace ICSSoft.WebAPI.Controllers
{ {
BarCodeModel model = new BarCodeModel(); BarCodeModel model = new BarCodeModel();
model = JsonConvert.DeserializeObject<BarCodeModel>(JsonData.ToString()); model = JsonConvert.DeserializeObject<BarCodeModel>(JsonData.ToString());
//var resultStr = ICSSubmitService.BarCodeInformationGet(model);
//res.Success = true;
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
//res.Data = resultStr;
lock (key) lock (key)
{ {
res = ICSSubmitService.BarCodeInformationGet(model); res = ICSSubmitService.BarCodeInformationGet(model);
@ -6936,6 +6791,40 @@ namespace ICSSoft.WebAPI.Controllers
return result; return result;
} }
[HttpPost]
[Route("api/YSDeliveryNotice/Create")]
public HttpResponseMessage YSDeliveryNoticeCreate([FromBody] object JsonData)
{
log.Info("采购到货传入值" + JsonData);
try
{
List<ICSDeliveryNotice> model = new List<ICSDeliveryNotice>();
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
{
model = JsonConvert.DeserializeObject<List<ICSDeliveryNotice>>(JsonData.ToString());
var resultStr = ICSSubmitService.DeliveryNoticeCreate(model);
res.Success = true;
res.Message = LanguageHelper.GetNameSingle("WMSAPI001") + "到货单号:" + resultStr.Rows[0]["DNCode"];// "接口调用成功!";
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;
}
} }

4
ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Web.config

@ -8,7 +8,7 @@
<add key="ERPDB" value="UFDATA_999_2019"/> <add key="ERPDB" value="UFDATA_999_2019"/>
<!--88--> <!--88-->
<!--<add key="ConnStr" value="Data Source=192.168.1.154;Database=ICSWMS_Base_U9;Uid=sa;Password=tizi@123;" />--> <!--<add key="ConnStr" value="Data Source=192.168.1.154;Database=ICSWMS_Base_U9;Uid=sa;Password=tizi@123;" />-->
<!--<add key="ConnStr" value="Data Source=192.168.1.88;Database=ICSWMS_Base;Uid=sa;Password=aA123456;"/>-->
<add key="ConnStr" value="Data Source=192.168.1.88;Database=ICSWMS_Base;Uid=sa;Password=aA123456;"/>
<!--咖博士--> <!--咖博士-->
<!--<add key="ConnStr" value="Data Source=172.66.9.13;Database=ICSWMS_KBS;Uid=sa;Password=Drcoffee201609;" />--> <!--<add key="ConnStr" value="Data Source=172.66.9.13;Database=ICSWMS_KBS;Uid=sa;Password=Drcoffee201609;" />-->
<!--<add key="ERPUrl" value="http://172.66.9.14:80/api/" />--> <!--<add key="ERPUrl" value="http://172.66.9.14:80/api/" />-->
@ -20,7 +20,7 @@
<!--<add key="ConnStr" value="Data Source=117.80.147.228;Database=ICSWMS_Base_SJ;Uid=sa;Password=p@ssw0rd;"/>--> <!--<add key="ConnStr" value="Data Source=117.80.147.228;Database=ICSWMS_Base_SJ;Uid=sa;Password=p@ssw0rd;"/>-->
<!--<add key="ERPUrl" value="http://180.101.177.196:82/api/"/>--> <!--<add key="ERPUrl" value="http://180.101.177.196:82/api/"/>-->
<!--德易仕--> <!--德易仕-->
<add key="ConnStr" value="Data Source=192.168.10.41;Database=ICSWMS_DYS;Uid=sa;Password=aA123456;" />
<!--<add key="ConnStr" value="Data Source=192.168.10.41;Database=ICSWMS_DYS;Uid=sa;Password=aA123456;" />-->
<add key="FilePath" value="D:\\mesPics\\" /> <add key="FilePath" value="D:\\mesPics\\" />
<add key="ERPUrl" value="http://192.168.1.88:3004/api/" /> <add key="ERPUrl" value="http://192.168.1.88:3004/api/" />
<!--<add key="ERPUrl" value="http://192.168.1.155/U9WMS/api/" />--> <!--<add key="ERPUrl" value="http://192.168.1.155/U9WMS/api/" />-->

Loading…
Cancel
Save