|
@@ -321,56 +321,23 @@ namespace JLHHJSvr.Helper
|
|
}
|
|
}
|
|
public void MattressInterfaceFindERPPz(u_mattress mattress,List<u_mattress_interface> interfaceList)
|
|
public void MattressInterfaceFindERPPz(u_mattress mattress,List<u_mattress_interface> interfaceList)
|
|
{
|
|
{
|
|
- for (var i = 0; i < interfaceList.Count; i++)
|
|
|
|
|
|
+ var typeList = new List<erp_configure_code>();
|
|
|
|
+ foreach(var item in interfaceList)
|
|
{
|
|
{
|
|
- interfaceList[i].printid = i + 1;
|
|
|
|
-
|
|
|
|
- //erp_cmd.CommandText = @"SELECT u_configure_code.pzid
|
|
|
|
- // ,u_configure_code.pzcode
|
|
|
|
- // ,u_configure_code.name
|
|
|
|
- // ,u_configure_code.inputtype
|
|
|
|
- // FROM u_configure_code
|
|
|
|
- // WHERE u_configure_code.typeid = @configcodetype
|
|
|
|
- // AND u_configure_code.name = @pzname";
|
|
|
|
- //erp_cmd.Parameters.Clear();
|
|
|
|
- //erp_cmd.Parameters.AddWithValue("@configcodetype", mattress.erp_configcodetype);
|
|
|
|
- //erp_cmd.Parameters.AddWithValue("@pzname", interfaceList[i].bj_pzname);
|
|
|
|
- //using (var reader = erp_cmd.ExecuteReader())
|
|
|
|
- //{
|
|
|
|
- // if (reader.Read())
|
|
|
|
- // {
|
|
|
|
- // var pzid = Convert.ToInt32(reader["pzid"]);
|
|
|
|
- // var pzname = Convert.ToString(reader["name"]);
|
|
|
|
- // var pzcode = Convert.ToString(reader["pzcode"]);
|
|
|
|
- // var inputtype = Convert.ToByte(reader["inputtype"]);
|
|
|
|
- // if (pzid > 0)
|
|
|
|
- // {
|
|
|
|
- // interfaceList[i].erp_pzid = pzid;
|
|
|
|
- // interfaceList[i].erp_pzcode = pzcode;
|
|
|
|
- // interfaceList[i].erp_pzname = pzname;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // if (interfaceList[i].bj_inputtype != 2) interfaceList[i].bj_inputtype = inputtype;
|
|
|
|
- // }
|
|
|
|
- //}
|
|
|
|
-
|
|
|
|
- var erpHelper = HelperBase.GetHelper<ERPHelper>(null);
|
|
|
|
|
|
+ typeList.Add(new erp_configure_code() { typeid = mattress.erp_configcodetype,name = item.bj_pzname });
|
|
|
|
+ }
|
|
|
|
|
|
- var parameters = new JObject();
|
|
|
|
- parameters.Add("dsname", "web_configure_code_list");
|
|
|
|
- var queryparams = new JObject();
|
|
|
|
- queryparams.Add("arg_configcodetype", mattress.erp_configcodetype);
|
|
|
|
- queryparams.Add("arg_pzname", interfaceList[i].bj_pzname);
|
|
|
|
- parameters.Add("queryparams", queryparams);
|
|
|
|
|
|
+ var erpHelper = HelperBase.GetHelper<ERPHelper>(null);
|
|
|
|
+ var parameters = new JObject();
|
|
|
|
+ parameters.Add("typeList", JToken.FromObject(typeList));
|
|
|
|
+ var resultList = erpHelper.GetERPList<erp_configure_code>("GetL1ConfigureCode", parameters);
|
|
|
|
|
|
- var resultList = erpHelper.GetERPList<erp_configure_code>("CommonDynamicSelect", parameters);
|
|
|
|
|
|
+ for (var i = 0; i < interfaceList.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ interfaceList[i].printid = i + 1;
|
|
|
|
|
|
foreach (var result in resultList)
|
|
foreach (var result in resultList)
|
|
{
|
|
{
|
|
- //var pzid = Convert.ToInt32(result["pzid"]);
|
|
|
|
- //var pzname = Convert.ToString(result["name"]);
|
|
|
|
- //var pzcode = Convert.ToString(result["pzcode"]);
|
|
|
|
- //var inputtype = Convert.ToByte(result["inputtype"]);
|
|
|
|
if (result.pzid > 0)
|
|
if (result.pzid > 0)
|
|
{
|
|
{
|
|
interfaceList[i].erp_pzid = result.pzid;
|
|
interfaceList[i].erp_pzid = result.pzid;
|
|
@@ -1043,7 +1010,8 @@ namespace JLHHJSvr.Helper
|
|
/// <param name="interfaceList"></param>
|
|
/// <param name="interfaceList"></param>
|
|
public void MattressInterfaceFindERPPrdPf(List<u_mattress_interface_qd> qdList,List<u_mattress_interface> interfaceList)
|
|
public void MattressInterfaceFindERPPrdPf(List<u_mattress_interface_qd> qdList,List<u_mattress_interface> interfaceList)
|
|
{
|
|
{
|
|
- foreach(var mx in qdList)
|
|
|
|
|
|
+ var mtrlidList = new List<int>();
|
|
|
|
+ foreach (var mx in qdList)
|
|
{
|
|
{
|
|
// 带出有设置 的erp_mtrlid
|
|
// 带出有设置 的erp_mtrlid
|
|
if (mx.erp_mtrlid == 0 && mx.mtrlid != null && mx.mtrlid > 0)
|
|
if (mx.erp_mtrlid == 0 && mx.mtrlid != null && mx.mtrlid > 0)
|
|
@@ -1054,60 +1022,35 @@ namespace JLHHJSvr.Helper
|
|
mx.erp_mtrlid = mtrldef.erp_mtrlid;
|
|
mx.erp_mtrlid = mtrldef.erp_mtrlid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //
|
|
|
|
+ if (mx.erp_mtrlid > 0)
|
|
|
|
+ {
|
|
|
|
+ mtrlidList.Add(mx.erp_mtrlid.Value);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- foreach(var mx in qdList)
|
|
|
|
|
|
+ var erpHelper = HelperBase.GetHelper<ERPHelper>(null);
|
|
|
|
+ var parameters = new JObject();
|
|
|
|
+ parameters.Add("mtrlids", JToken.FromObject(mtrlidList));
|
|
|
|
+ var resultList = erpHelper.GetERPList<erp_mtrldef>("GetL1Mtrldef", parameters);
|
|
|
|
+ foreach (var mx in qdList)
|
|
{
|
|
{
|
|
- if(mx.erp_mtrlid > 0)
|
|
|
|
|
|
+ if (resultList != null && resultList.Any())
|
|
{
|
|
{
|
|
- //erp_cmd.CommandText = @"SELECT mtrlid
|
|
|
|
- // ,mtrlcode
|
|
|
|
- // ,mtrlname
|
|
|
|
- // ,mtrlmode
|
|
|
|
- // ,unit
|
|
|
|
- // ,dftwrkgrpid
|
|
|
|
- // ,mtrlengname
|
|
|
|
- // ,zxmtrlmode
|
|
|
|
- // FROM u_mtrldef
|
|
|
|
- // WHERE mtrlid = @mtrlid";
|
|
|
|
- //erp_cmd.Parameters.Clear();
|
|
|
|
- //erp_cmd.Parameters.AddWithValue("@mtrlid", mx.erp_mtrlid);
|
|
|
|
- //using (var reader = erp_cmd.ExecuteReader())
|
|
|
|
- //{
|
|
|
|
- // if (reader.Read())
|
|
|
|
- // {
|
|
|
|
- // mx.erp_mtrlcode = Convert.ToString(reader["mtrlcode"]);
|
|
|
|
- // mx.erp_mtrlname = Convert.ToString(reader["mtrlname"]);
|
|
|
|
- // mx.erp_mtrlmode = Convert.ToString(reader["mtrlmode"]);
|
|
|
|
- // mx.erp_unit = Convert.ToString(reader["unit"]);
|
|
|
|
- // mx.erp_mtrlengname = Convert.ToString(reader["zxmtrlmode"]);
|
|
|
|
- // }
|
|
|
|
- //}
|
|
|
|
-
|
|
|
|
- var erpHelper = HelperBase.GetHelper<ERPHelper>(null);
|
|
|
|
-
|
|
|
|
- var parameters = new JObject();
|
|
|
|
- parameters.Add("mtrlid", mx.erp_mtrlid);
|
|
|
|
-
|
|
|
|
- var resultList = erpHelper.GetERPList<erp_mtrldef>("GetL1Mtrldef", parameters);
|
|
|
|
-
|
|
|
|
- if(resultList != null && resultList.Any())
|
|
|
|
|
|
+ foreach (var result in resultList)
|
|
{
|
|
{
|
|
- foreach(var result in resultList)
|
|
|
|
- {
|
|
|
|
- mx.erp_mtrlcode = result.mtrlcode;
|
|
|
|
- mx.erp_mtrlname = result.mtrlname;
|
|
|
|
- mx.erp_mtrlmode = result.mtrlmode;
|
|
|
|
- mx.erp_unit = result.unit;
|
|
|
|
- mx.erp_mtrlengname = result.zxmtrlmode;
|
|
|
|
- }
|
|
|
|
|
|
+ mx.erp_mtrlcode = result.mtrlcode;
|
|
|
|
+ mx.erp_mtrlname = result.mtrlname;
|
|
|
|
+ mx.erp_mtrlmode = result.mtrlmode;
|
|
|
|
+ mx.erp_unit = result.unit;
|
|
|
|
+ mx.erp_mtrlengname = result.zxmtrlmode;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//更新 二级明细项目 需要产品配置列表,此部分由前端完成
|
|
//更新 二级明细项目 需要产品配置列表,此部分由前端完成
|
|
- if(interfaceList != null && interfaceList.Any())
|
|
|
|
|
|
+ if (interfaceList != null && interfaceList.Any())
|
|
{
|
|
{
|
|
Dictionary<string, u_mattress_interface> interfaceDict = interfaceList.ToDictionary(mb => mb.bj_pzname, mb => mb);
|
|
Dictionary<string, u_mattress_interface> interfaceDict = interfaceList.ToDictionary(mb => mb.bj_pzname, mb => mb);
|
|
foreach (var mx in qdList)
|
|
foreach (var mx in qdList)
|