|
@@ -36,8 +36,6 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
AutoSetMtrlName(mattress, mxlist);
|
|
|
|
|
|
- AutoInit.AutoInitS(cmd, mattress);
|
|
|
-
|
|
|
if (string.IsNullOrEmpty(mattress.erp_mtrlcode))
|
|
|
{
|
|
|
throw new LJCommonException("请输入物料名称!");
|
|
@@ -131,18 +129,9 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- #region 导入配置方法
|
|
|
- /// <summary>
|
|
|
- /// 刷新带出配置
|
|
|
- /// </summary>
|
|
|
- /// <param name="mattressid"></param>
|
|
|
- /// <returns></returns>
|
|
|
- public List<u_mattress_interface> RefreshMattressInterface(int mattressid)
|
|
|
+ public List<u_mattress_interface> GetMattressInterfaceList(int mattressid)
|
|
|
{
|
|
|
var interfaceList = new List<u_mattress_interface>();
|
|
|
-
|
|
|
- var copy_list = new List<u_mattress_interface>();
|
|
|
-
|
|
|
var selectStr = @"SELECT mattressid
|
|
|
,printid
|
|
|
,itemname
|
|
@@ -156,43 +145,67 @@ namespace JLHHJSvr.Helper
|
|
|
,ls_rate
|
|
|
,bj_inputtype
|
|
|
FROM u_mattress_interface";
|
|
|
- DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", "mattressid,printid,itemname,bj_pzname,bj_namemx,actual_size,sb_craft,actual_size_sb,erp_pzid,ss_rate,ls_rate,bj_inputtype", 0, 0, copy_list);
|
|
|
+ DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", "mattressid,printid,itemname,bj_pzname,bj_namemx,actual_size,sb_craft,actual_size_sb,erp_pzid,ss_rate,ls_rate,bj_inputtype", 0, 0, interfaceList);
|
|
|
|
|
|
- // 导入配置
|
|
|
- ImportMattressInterfaceList(mattressid, interfaceList);
|
|
|
+ if(interfaceList.Count <= 0)
|
|
|
+ {
|
|
|
+ interfaceList = RefreshMattressInterfaceList(mattressid);
|
|
|
+ }
|
|
|
+
|
|
|
+ MattressInterfaceFindERPPz(mattressid, interfaceList);
|
|
|
|
|
|
- var copyDict = copy_list.Where(mx2 => mx2.erp_pzid > 0)
|
|
|
- .ToDictionary(mx2 => mx2.erp_pzid, mx2 => mx2);
|
|
|
+ return interfaceList;
|
|
|
+ }
|
|
|
|
|
|
- foreach (var mx in interfaceList)
|
|
|
+ public List<u_mattress_interface_qd> GetMattressInterfaceQdList(int mattressid)
|
|
|
+ {
|
|
|
+ var qdList = new List<u_mattress_interface_qd>();
|
|
|
+ var selectStr = @"SELECT u_mattress_interface_qd.mattressid
|
|
|
+ ,u_mattress_interface_qd.printid
|
|
|
+ ,u_mattress_interface_qd.itemname
|
|
|
+ ,u_mattress_interface_qd.bj_pzname
|
|
|
+ ,u_mattress_interface_qd.bj_pzname_mx
|
|
|
+ ,u_mattress_interface_qd.bj_pzname_mx_mx
|
|
|
+ ,u_mattress_interface_qd.mtrlid
|
|
|
+ ,u_mattress_interface_qd.erp_mtrlid
|
|
|
+ ,u_mattress_interface_qd.useqty
|
|
|
+ ,u_mattress_interface_qd.dscrp
|
|
|
+ ,u_mtrl_price.name AS mtrlname
|
|
|
+ ,u_mattress_interface_qd.actual_useqty
|
|
|
+ ,u_mattress_interface_qd.qd_actual_size
|
|
|
+ ,u_mattress_interface_qd.qd_pfgroupqty
|
|
|
+ ,u_mattress_interface_qd.wrkgrpid
|
|
|
+ ,u_mattress_interface_qd.ss_rate
|
|
|
+ ,u_mattress_interface_qd.ls_rate
|
|
|
+ ,u_mattress_interface_qd.sh_rate
|
|
|
+ FROM u_mattress_interface_qd
|
|
|
+ LEFT JOIN u_mtrl_price ON u_mtrl_price.mtrlid = u_mattress_interface_qd.mtrlid";
|
|
|
+ var outputFields = "mattressid,printid,itemname,bj_pzname,bj_pzname_mx,bj_pzname_mx_mx,mtrlid,erp_mtrlid,useqty,dscrp,mtrlname,actual_useqty,qd_actual_size,qd_pfgroupqty,wrkgrpid,ss_rate,ls_rate,sh_rate";
|
|
|
+ DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", outputFields, 0, 0, qdList);
|
|
|
+
|
|
|
+ if (qdList.Count <= 0)
|
|
|
{
|
|
|
- if (mx.erp_pzid > 0 && copyDict.TryGetValue(mx.erp_pzid, out var mx2))
|
|
|
- {
|
|
|
- if (mx.bj_inputtype != 2 || (mx.bj_inputtype == 2 && mx2.bj_inputtype == 1))
|
|
|
- {
|
|
|
- mx.bj_pzname = mx2.bj_pzname;
|
|
|
- mx.actual_size = mx2.actual_size;
|
|
|
- mx.sb_craft = mx2.sb_craft;
|
|
|
- mx.actual_size_sb = mx2.actual_size_sb;
|
|
|
- mx.ss_rate = mx2.ss_rate;
|
|
|
- mx.ls_rate = mx2.ls_rate;
|
|
|
-
|
|
|
- if (mx.bj_inputtype == 2 && mx2.bj_inputtype == 1)
|
|
|
- {
|
|
|
- mx.bj_inputtype = 1;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- mx.actual_size = mx2.actual_size;
|
|
|
- mx.sb_craft = mx2.sb_craft;
|
|
|
- mx.actual_size_sb = mx2.actual_size_sb;
|
|
|
- mx.ss_rate = mx2.ss_rate;
|
|
|
- mx.ls_rate = mx2.ls_rate;
|
|
|
- }
|
|
|
- }
|
|
|
+ qdList = RefreshMattressInterfaceQdList(mattressid);
|
|
|
}
|
|
|
|
|
|
+ return qdList;
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 导入配置方法
|
|
|
+ /// <summary>
|
|
|
+ /// 刷新带出配置
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="mattressid"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public List<u_mattress_interface> RefreshMattressInterfaceList(int mattressid)
|
|
|
+ {
|
|
|
+ var interfaceList = new List<u_mattress_interface>();
|
|
|
+
|
|
|
+ // 导入配置
|
|
|
+ ImportMattressInterfaceList(mattressid, interfaceList);
|
|
|
+
|
|
|
+ MattressInterfaceFindERPPz(mattressid, interfaceList);
|
|
|
+
|
|
|
return interfaceList;
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -200,7 +213,7 @@ namespace JLHHJSvr.Helper
|
|
|
/// </summary>
|
|
|
/// <param name="mattressid"></param>
|
|
|
/// <exception cref="LJCommonException"></exception>
|
|
|
- public void ImportMattressInterfaceList(int mattressid, List<u_mattress_interface> intefaceList)
|
|
|
+ public void ImportMattressInterfaceList(int mattressid, List<u_mattress_interface> interfaceList)
|
|
|
{
|
|
|
if (mattressid <= 0)
|
|
|
{
|
|
@@ -220,17 +233,17 @@ namespace JLHHJSvr.Helper
|
|
|
var mxlist_101 = mattressHelper.GetMattressMxMtrl(mattressid, new List<string>() { "u_mattress_formula.formulatype = 101" });
|
|
|
|
|
|
// 高度
|
|
|
- intefaceList.Add(InserMattressInterfacePz("床垫", "高度", 2, new string[] { $"{mattress.mattress_height}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("床垫", "高度", 2, new string[] { $"{mattress.mattress_height}" }));
|
|
|
|
|
|
// 参考外观
|
|
|
- intefaceList.Add(InserMattressInterfacePz("床垫", "参考外观", 1, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("床垫", "参考外观", 1, new string[] { "" }));
|
|
|
|
|
|
// 尺寸
|
|
|
mattress.erp_mtrlcode = $"{mattress.mattress_width}*{mattress.mattress_length}*{mattress.mattress_height}";
|
|
|
- intefaceList.Add(InserMattressInterfacePz("床垫", "尺寸", 2, new string[] { mattress.erp_mtrlcode }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("床垫", "尺寸", 2, new string[] { mattress.erp_mtrlcode }));
|
|
|
|
|
|
// 床垫类别
|
|
|
- intefaceList.Add(InserMattressInterfacePz("床垫", "床垫类别", 2, new string[] { mattress_type.typename }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("床垫", "床垫类别", 2, new string[] { mattress_type.typename }));
|
|
|
|
|
|
// 拆装类型
|
|
|
var name_arr = new string[1];
|
|
@@ -238,69 +251,80 @@ namespace JLHHJSvr.Helper
|
|
|
if (mattress.if_m_chai == 1) name_arr[0] = AppendToString(name_arr[0], "面拆");
|
|
|
if (mattress.if_z_chai == 1) name_arr[0] = AppendToString(name_arr[0], "中拆");
|
|
|
if (mattress.if_d_chai == 1) name_arr[0] = AppendToString(name_arr[0], "底拆");
|
|
|
- intefaceList.Add(InserMattressInterfacePz("床垫", "拆装类型", 1, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("床垫", "拆装类型", 1, name_arr));
|
|
|
|
|
|
// 床垫分类
|
|
|
name_arr[0] = string.Empty;
|
|
|
if (mattress.if_haimian_type == 1) name_arr[0] = AppendToString(name_arr[0], "海绵床垫");
|
|
|
else name_arr[0] = AppendToString(name_arr[0], "弹簧床垫");
|
|
|
if (mattress.if_zhedie_type == 1) name_arr[0] = AppendToString(name_arr[0], "折叠床垫");
|
|
|
- intefaceList.Add(InserMattressInterfacePz("床垫", "拆装类型", 1, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("床垫", "床垫分类", 1, name_arr));
|
|
|
|
|
|
// 外观布套做法
|
|
|
name_arr[0] = string.Empty;
|
|
|
if (mattress.if_m_wbutao_way == 1) name_arr[0] = AppendToString(name_arr[0], $"面层向大侧覆盖{mattress.s_m_cover_qty}CM、大侧向底层覆盖{mattress.z_m_cover_qty}CM、底层向大侧覆盖{mattress.x_m_cover_qty}CM");
|
|
|
- intefaceList.Add(InserMattressInterfacePz("床垫", "外观布套做法", 1, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("床垫", "外观布套做法", 1, name_arr));
|
|
|
|
|
|
// 边带
|
|
|
name_arr[0] = string.Empty;
|
|
|
- intefaceList.Add(InserMattressInterfacePz("床垫", "边带", 2, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("床垫", "边带", 0, name_arr));
|
|
|
|
|
|
#region 面料类清单导入 AutoSetFormulaTypeZeroPz()需要优化
|
|
|
- AutoSetFormulaTypeZeroPz(mxlist, intefaceList);
|
|
|
- intefaceList.Add(InserMattressInterfacePz("车位说明", "车位说明", 1, name_arr));
|
|
|
+ AutoSetFormulaTypeZeroPz(mxlist, interfaceList);
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("车位说明", "车位说明", 1, name_arr));
|
|
|
#endregion
|
|
|
|
|
|
#region 垫层类清单导入
|
|
|
- AutoSetFormulaTypeOnePz(mxlist, intefaceList);
|
|
|
+ AutoSetFormulaTypeOnePz(mxlist, interfaceList);
|
|
|
#endregion
|
|
|
|
|
|
#region 辅料类清单导入
|
|
|
- AutoSetFormulaTypeTwoPz(mxlist, intefaceList);
|
|
|
+ AutoSetFormulaTypeTwoPz(mxlist, interfaceList);
|
|
|
#endregion
|
|
|
|
|
|
#region 包装类清单导入
|
|
|
- AutoSetFormulaTypeThreePz(mattress, mxlist, intefaceList);
|
|
|
+ AutoSetFormulaTypeThreePz(mattress, mxlist, interfaceList);
|
|
|
#endregion
|
|
|
|
|
|
#region 内布套类清单导入
|
|
|
- AutoSetFormulaType101Pz(mattress, mxlist_103, intefaceList);
|
|
|
+ AutoSetFormulaType101Pz(mattress, mxlist_103, interfaceList);
|
|
|
#endregion
|
|
|
|
|
|
#region 自定义配置导入
|
|
|
- erp_cmd.CommandText = @"SELECT u_configure_code.pzid
|
|
|
+ if(mattress.erp_configcodetype != null && mattress.erp_configcodetype > 0)
|
|
|
+ {
|
|
|
+ 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.ifpack = 1";
|
|
|
- erp_cmd.Parameters.Clear();
|
|
|
- erp_cmd.Parameters.AddWithValue("@configcodetype", mattress.erp_configcodetype);
|
|
|
- using (var reader = erp_cmd.ExecuteReader())
|
|
|
- {
|
|
|
- while (reader.Read())
|
|
|
+ erp_cmd.Parameters.Clear();
|
|
|
+ erp_cmd.Parameters.AddWithValue("@configcodetype", mattress.erp_configcodetype);
|
|
|
+ using (var reader = erp_cmd.ExecuteReader())
|
|
|
{
|
|
|
- var pzname = Convert.ToString(reader["name"]);
|
|
|
- intefaceList.Add(InserMattressInterfacePz("自定义", pzname, 1, new string[] { "" }));
|
|
|
+ while (reader.Read())
|
|
|
+ {
|
|
|
+ var pzname = Convert.ToString(reader["name"]);
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("自定义", pzname, 1, new string[] { "" }));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
+ }
|
|
|
+ public void MattressInterfaceFindERPPz(int mattressid, List<u_mattress_interface> interfaceList)
|
|
|
+ {
|
|
|
+ var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
+ DbSqlHelper.SelectOne(cmd, mattress, "erp_configcodetype");
|
|
|
|
|
|
- #region 匹配ERP配置 + 初始化printid PB代码参考:wf_fine_erp_pz
|
|
|
- for (var i = 0; i < intefaceList.Count; i++)
|
|
|
+ MattressInterfaceFindERPPz(mattress, interfaceList);
|
|
|
+ }
|
|
|
+ public void MattressInterfaceFindERPPz(u_mattress mattress,List<u_mattress_interface> interfaceList)
|
|
|
+ {
|
|
|
+ for (var i = 0; i < interfaceList.Count; i++)
|
|
|
{
|
|
|
- intefaceList[i].printid = i + 1;
|
|
|
+ interfaceList[i].printid = i + 1;
|
|
|
|
|
|
erp_cmd.CommandText = @"SELECT u_configure_code.pzid
|
|
|
,u_configure_code.pzcode
|
|
@@ -311,7 +335,7 @@ namespace JLHHJSvr.Helper
|
|
|
AND u_configure_code.name = @pzname";
|
|
|
erp_cmd.Parameters.Clear();
|
|
|
erp_cmd.Parameters.AddWithValue("@configcodetype", mattress.erp_configcodetype);
|
|
|
- erp_cmd.Parameters.AddWithValue("@pzname", intefaceList[i].bj_pzname);
|
|
|
+ erp_cmd.Parameters.AddWithValue("@pzname", interfaceList[i].bj_pzname);
|
|
|
using (var reader = erp_cmd.ExecuteReader())
|
|
|
{
|
|
|
if (reader.Read())
|
|
@@ -322,16 +346,15 @@ namespace JLHHJSvr.Helper
|
|
|
var inputtype = Convert.ToByte(reader["inputtype"]);
|
|
|
if (pzid > 0)
|
|
|
{
|
|
|
- intefaceList[i].erp_pzid = pzid;
|
|
|
- intefaceList[i].erp_pzcode = pzcode;
|
|
|
- intefaceList[i].erp_pzname = pzname;
|
|
|
+ interfaceList[i].erp_pzid = pzid;
|
|
|
+ interfaceList[i].erp_pzcode = pzcode;
|
|
|
+ interfaceList[i].erp_pzname = pzname;
|
|
|
}
|
|
|
|
|
|
- if (inputtype != 2) intefaceList[i].bj_inputtype = inputtype;
|
|
|
+ if (interfaceList[i].bj_inputtype != 2) interfaceList[i].bj_inputtype = inputtype;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- #endregion
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 初始化配置信息
|
|
@@ -365,7 +388,7 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
- private void AutoSetFormulaTypeZeroPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
|
|
|
+ private void AutoSetFormulaTypeZeroPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
|
|
|
{
|
|
|
var powerDict = new Dictionary<string, int[]>()
|
|
|
{
|
|
@@ -411,7 +434,7 @@ namespace JLHHJSvr.Helper
|
|
|
{"小侧1",new string[] { "小侧", "小侧1裥棉", "小侧1裥棉图案" } },
|
|
|
{"小侧1-上下拼侧1",new string[] { "小侧", "小侧1-上下拼侧1裥棉", "小侧1-上下拼侧1裥棉图案" } },
|
|
|
{"小侧1-上下拼侧2",new string[] { "小侧", "小侧1-上下拼侧2裥棉", "小侧1-上下拼侧2裥棉图案" } },
|
|
|
- {"小侧1-上下拼侧2",new string[] { "小侧", "小侧1-上下拼侧3裥棉", "小侧1-上下拼侧3裥棉图案" } },
|
|
|
+ {"小侧1-上下拼侧3",new string[] { "小侧", "小侧1-上下拼侧3裥棉", "小侧1-上下拼侧3裥棉图案" } },
|
|
|
{"小侧2",new string[] { "小侧", "小侧2裥棉", "小侧2裥棉图案" } },
|
|
|
{"小侧3",new string[] { "小侧", "小侧3裥棉", "小侧3裥棉图案", "小侧说明" } },
|
|
|
{"V侧1_EMPTY",new string[] { "V侧", "V侧1裥棉", "V侧1裥棉图案" } },
|
|
@@ -424,7 +447,7 @@ namespace JLHHJSvr.Helper
|
|
|
#region wf_import_qingdan + wf_import_qingdan_1 面料部分
|
|
|
foreach (var item in powerDict)
|
|
|
{
|
|
|
- SetFormulaTypeZeroPz(jianmianList, intefaceList, item.Value, item.Key, chastrArrDict[item.Key]);
|
|
|
+ SetFormulaTypeZeroPz(jianmianList, interfaceList, item.Value, item.Key, chastrArrDict[item.Key]);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -436,8 +459,8 @@ namespace JLHHJSvr.Helper
|
|
|
var mx = lashouList[i];
|
|
|
if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"拉手{i + 1}做法", 1, new string[] { $"{mx.qty.Value}只{mx.mtrlname}" }));
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"拉手{i + 1}刺绣", 0, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"拉手{i + 1}做法", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}只{mx.mtrlname}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"拉手{i + 1}刺绣", 0, new string[] { "" }));
|
|
|
}
|
|
|
}
|
|
|
// 刺绣
|
|
@@ -447,8 +470,8 @@ namespace JLHHJSvr.Helper
|
|
|
var mx = cixiuList[i];
|
|
|
if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"侧刺绣{i + 1}做法", 1, new string[] { "" }));
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"侧刺绣{i + 1}位置", 0, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"侧刺绣{i + 1}做法", 1, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"侧刺绣{i + 1}位置", 0, new string[] { "" }));
|
|
|
}
|
|
|
}
|
|
|
// 大侧压压布
|
|
@@ -458,7 +481,7 @@ namespace JLHHJSvr.Helper
|
|
|
var mx = dcyybList[i];
|
|
|
if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压压布{i + 1}", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压压布{i + 1}", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
|
|
|
}
|
|
|
}
|
|
|
// 大侧压边带
|
|
@@ -468,7 +491,7 @@ namespace JLHHJSvr.Helper
|
|
|
var mx = dcybdList[i];
|
|
|
if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压边带{i + 1}", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压边带{i + 1}", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
|
|
|
}
|
|
|
}
|
|
|
// 大侧压织带
|
|
@@ -478,7 +501,7 @@ namespace JLHHJSvr.Helper
|
|
|
var mx = dcyzdList[i];
|
|
|
if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压织带{i + 1}", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压织带{i + 1}", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
|
|
|
}
|
|
|
}
|
|
|
// 大侧压上下压线
|
|
@@ -488,7 +511,7 @@ namespace JLHHJSvr.Helper
|
|
|
var mx = dcysxyxList[i];
|
|
|
if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压上下压线{i + 1}", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压上下压线{i + 1}", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
|
|
|
}
|
|
|
}
|
|
|
// 车花边
|
|
@@ -498,7 +521,7 @@ namespace JLHHJSvr.Helper
|
|
|
var mx = chbList[i];
|
|
|
if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "车花边", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "车花边", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
|
|
|
}
|
|
|
}
|
|
|
// 防火线
|
|
@@ -508,7 +531,7 @@ namespace JLHHJSvr.Helper
|
|
|
var mx = fhxList[i];
|
|
|
if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "防火线", 1, new string[] { mx.mtrlname }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "防火线", 1, new string[] { mx.mtrlname }));
|
|
|
}
|
|
|
}
|
|
|
// 拉链
|
|
@@ -518,12 +541,12 @@ namespace JLHHJSvr.Helper
|
|
|
var mx = llList[i];
|
|
|
if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "拉链", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "拉链", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
}
|
|
|
- private void SetFormulaTypeZeroPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList, int[] powerArr, string key, string[] chastrArr)
|
|
|
+ private void SetFormulaTypeZeroPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList, int[] powerArr, string key, string[] chastrArr)
|
|
|
{
|
|
|
var mianList1 = new HashSet<string> { "面裥绵", "底裥绵" };
|
|
|
var mianList2 = new string[4] { "顶布裥棉1", "顶布裥棉2", "顶布裥棉3", "顶布裥棉4" };
|
|
@@ -539,53 +562,32 @@ namespace JLHHJSvr.Helper
|
|
|
{
|
|
|
for (int i = 0; i < mianList2.Length; i++)
|
|
|
{
|
|
|
- DingBuLianMian.SetValue(name_arr, i);
|
|
|
+ DingBuLianMian.SetValue(name_arr[i], i, 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- foreach (var name in chastrArr)
|
|
|
+ var sb = new StringBuilder();
|
|
|
+ foreach (var name2 in name_arr)
|
|
|
{
|
|
|
- if (string.IsNullOrEmpty(name)) continue;
|
|
|
-
|
|
|
- //if (mianList3.Contains(key))
|
|
|
- //{
|
|
|
- // var sb = new StringBuilder();
|
|
|
- // foreach (var name2 in name_arr)
|
|
|
- // {
|
|
|
- // sb.Append(name2);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (sb.Length > 0)
|
|
|
- // {
|
|
|
- // intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[1], 2, name_arr));
|
|
|
- // intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[2], 1, new string[] { "" }));
|
|
|
- // if (chastrArr.Length > 3) intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[3], 1, new string[] { "" }));
|
|
|
- // }
|
|
|
- //} else
|
|
|
- //{
|
|
|
- // intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[1], 2, name_arr));
|
|
|
- // // 图案
|
|
|
- // intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[2], 1, new string[] { "" }));
|
|
|
- //}
|
|
|
-
|
|
|
- var sb = new StringBuilder();
|
|
|
- foreach (var name2 in name_arr)
|
|
|
- {
|
|
|
- sb.Append(name2);
|
|
|
- }
|
|
|
+ sb.Append(name2);
|
|
|
+ }
|
|
|
|
|
|
- if (sb.Length > 0)
|
|
|
- {
|
|
|
- intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[1], 2, name_arr));
|
|
|
- intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[2], 1, new string[] { "" }));
|
|
|
- if (chastrArr.Length > 3) intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[3], 1, new string[] { "" }));
|
|
|
- }
|
|
|
+ if (sb.Length > 0)
|
|
|
+ {
|
|
|
+ if (!string.IsNullOrEmpty(chastrArr[1])) interfaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[1], 2, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[2], 1, new string[] { "" }));
|
|
|
+ if (chastrArr.Length > 3) interfaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[3], 1, new string[] { "" }));
|
|
|
+ }
|
|
|
|
|
|
+ foreach (var name in chastrArr)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(name)) continue;
|
|
|
if (name.Contains("说明"))
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz(chastrArr[0], name, 1, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz(chastrArr[0], name, 1, new string[] { "" }));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void SetFormulaTypeZeroPzName(u_mattress_mx_mtrl mx, string key, int[] powerArr, string[] name_arr)
|
|
@@ -606,7 +608,7 @@ namespace JLHHJSvr.Helper
|
|
|
var mtrlname_temp = mx.mtrlname;
|
|
|
if (!(mx.mtrlname.IndexOf("分") > -1 && mx.thickness == 0 || mx.if_inputqty == 1))
|
|
|
{
|
|
|
- mtrlname_temp = $"{mx.thickness}分{mx.mtrlname}";
|
|
|
+ mtrlname_temp = $"{mx.thickness.Value.ToString("#,##0.0#")}分{mx.mtrlname}";
|
|
|
}
|
|
|
name_arr[2] = SplitNameCount(mtrlname_temp, Convert.ToInt32(mx.qty.Value));
|
|
|
}
|
|
@@ -621,7 +623,7 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- private void AutoSetFormulaTypeOnePz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
|
|
|
+ private void AutoSetFormulaTypeOnePz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
|
|
|
{
|
|
|
var diancengList = mxlist.Where(t => t.formulatype == 1).ToList();
|
|
|
|
|
@@ -648,51 +650,49 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
foreach (var mx in diancengList)
|
|
|
{
|
|
|
- if (mx.mtrlid > 0)
|
|
|
- {
|
|
|
- var key = $"{mx.chastr}-{kindDict[mx.formulakind.Value]}";
|
|
|
+ var key = $"{mx.chastr}-{kindDict[mx.formulakind.Value]}";
|
|
|
|
|
|
- if (mx.formulakind == 999)
|
|
|
- {
|
|
|
- this.ProcessChuangWangPz(mx, intefaceList, mx.chastr, ++countDict[key]);
|
|
|
- }
|
|
|
- else if (mx.formulakind == 1201)
|
|
|
- {
|
|
|
- this.ProcessDingbuLianMianPz(mx, intefaceList, mx.chastr, ++countDict[key]);
|
|
|
- }
|
|
|
- else if (new int[] { 32, 12, 13, 14, 29 }.Contains(mx.formulakind.Value))
|
|
|
- {
|
|
|
- this.ProcessWangMianBLPz(mx, intefaceList, mx.chastr, kindDict[mx.formulakind.Value], ++countDict[key]);
|
|
|
- }
|
|
|
+ if (mx.formulakind == 999)
|
|
|
+ {
|
|
|
+ this.ProcessChuangWangPz(mx, interfaceList, mx.chastr, ++countDict[key]);
|
|
|
+ }
|
|
|
+ else if (mx.mtrlid > 0 && mx.formulakind == 1201)
|
|
|
+ {
|
|
|
+ this.ProcessDingbuLianMianPz(mx, interfaceList, mx.chastr, ++countDict[key]);
|
|
|
+ }
|
|
|
+ else if (mx.mtrlid > 0 && new int[] { 32, 12, 13, 14, 29 }.Contains(mx.formulakind.Value))
|
|
|
+ {
|
|
|
+ this.ProcessWangMianBLPz(mx, interfaceList, mx.chastr, kindDict[mx.formulakind.Value], ++countDict[key]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (countDict["大侧-垫层"] > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("垫层", "大侧垫层生产说明", 1, new string[1]));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("垫层", "大侧垫层生产说明", 1, new string[1]));
|
|
|
}
|
|
|
|
|
|
if (countDict["小侧1-垫层"] > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("垫层", "小侧垫层生产说明", 1, new string[1]));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("垫层", "小侧垫层生产说明", 1, new string[1]));
|
|
|
}
|
|
|
|
|
|
if (countDict["V侧1-垫层"] > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("垫层", "V侧垫层生产说明", 1, new string[1]));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("垫层", "V侧垫层生产说明", 1, new string[1]));
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 床网
|
|
|
/// </summary>
|
|
|
/// <param name="mx"></param>
|
|
|
- /// <param name="intefaceList"></param>
|
|
|
+ /// <param name="interfaceList"></param>
|
|
|
/// <param name="chastr"></param>
|
|
|
/// <param name="count"></param>
|
|
|
- private void ProcessChuangWangPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> intefaceList, string chastr, int count)
|
|
|
+ private void ProcessChuangWangPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> interfaceList, string chastr, int count)
|
|
|
{
|
|
|
var name_arr = new string[5];
|
|
|
int bednetid = 0;
|
|
|
+
|
|
|
cmd.CommandText = @"SELECT u_bednetmx.bednet_height,u_bednetmx.bednetid
|
|
|
FROM u_bednetmx
|
|
|
INNER JOIN (
|
|
@@ -716,40 +716,52 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
if (bednetid > 0)
|
|
|
{
|
|
|
- // 获取床网清单
|
|
|
- var bednetList = new List<u_bednetmx>();
|
|
|
- if (bednetList.Any())
|
|
|
- {
|
|
|
- var bednetHelper = HelperBase.GetHelper<BedNetHelper>(cmd);
|
|
|
- var bednetQdList = bednetHelper.GetBedNetQingDan(bednetid);
|
|
|
+ var bednetHelper = HelperBase.GetHelper<BedNetHelper>(cmd);
|
|
|
+ var bednetQdList = bednetHelper.GetBedNetQingDan(bednetid);
|
|
|
|
|
|
- if(bednetQdList.Any())
|
|
|
+ if (bednetQdList.Any())
|
|
|
+ {
|
|
|
+ name_arr[0] = bednetQdList[0].pznamemx;
|
|
|
+ name_arr[0] += "丨erp编码:";
|
|
|
+ cmd.CommandText = @"SELECT u_mattress.erp_mtrlcode
|
|
|
+ FROM u_mattress_mx_mtrl
|
|
|
+ INNER JOIN u_mattress_formula ON u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
+ INNER JOIN u_mattress ON u_mattress.mattressid = u_mattress_mx_mtrl.mattressid
|
|
|
+ WHERE u_mattress_formula.formulakind = 99
|
|
|
+ AND u_mattress.bcptypeid <> 0
|
|
|
+ AND u_mattress_mx_mtrl.mtrlid = @bednetid";
|
|
|
+ cmd.Parameters.Clear();
|
|
|
+ cmd.Parameters.AddWithValue("@bednetid", bednetid);
|
|
|
+ using(var reader = cmd.ExecuteReader())
|
|
|
{
|
|
|
- name_arr[0] = bednetQdList[0].pznamemx;
|
|
|
+ if (reader.Read())
|
|
|
+ {
|
|
|
+ name_arr[0] += Convert.ToString(reader["erp_mtrlcode"]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (FuncPowerHelper.CheckFuncPower(cmd, context.tokendata.userid, 98) && "super".Equals(context.tokendata.username.ToLower()))
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}", 2, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}", 2, name_arr));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}", 1, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}", 1, name_arr));
|
|
|
}
|
|
|
|
|
|
- intefaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}生产说明", 1, new string[] { "" }));
|
|
|
- intefaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}包边海绵条", 1, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}生产说明", 1, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}包边海绵条", 1, new string[] { "" }));
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 网面布料 / 打底无纺布 / 毡类 / 顶布 / 垫层
|
|
|
/// </summary>
|
|
|
/// <param name="mx"></param>
|
|
|
- /// <param name="intefaceList"></param>
|
|
|
+ /// <param name="interfaceList"></param>
|
|
|
/// <param name="chastr"></param>
|
|
|
/// <param name="count"></param>
|
|
|
- private void ProcessWangMianBLPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> intefaceList, string chastr, string typename, int count)
|
|
|
+ private void ProcessWangMianBLPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> interfaceList, string chastr, string typename, int count)
|
|
|
{
|
|
|
var name_arr = new string[5];
|
|
|
var mtrlname_temp = mx.mtrlname;
|
|
@@ -767,18 +779,19 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
if ((!mx.mtrlname.Contains("分") && mx.thickness > 0) || ("垫层".Equals(typename)))
|
|
|
{
|
|
|
- mtrlname_temp = $"{mx.thickness}分{mx.mtrlname}";
|
|
|
+ mtrlname_temp = $"{mx.thickness.Value.ToString("#,##0.0#")}分{mx.mtrlname}";
|
|
|
}
|
|
|
|
|
|
- intefaceList.Add(InserMattressInterfacePz("垫层", chastr_temp, 2, name_arr));
|
|
|
+ name_arr[0] = mtrlname_temp;
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("垫层", chastr_temp, 2, name_arr));
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 顶布裥棉
|
|
|
/// </summary>
|
|
|
/// <param name="mx"></param>
|
|
|
- /// <param name="intefaceList"></param>
|
|
|
+ /// <param name="interfaceList"></param>
|
|
|
/// <param name="count"></param>
|
|
|
- private void ProcessDingbuLianMianPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> intefaceList, string chastr, int count)
|
|
|
+ private void ProcessDingbuLianMianPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> interfaceList, string chastr, int count)
|
|
|
{
|
|
|
string chastr_temp = string.Empty;
|
|
|
string ls_temp = "";
|
|
@@ -817,9 +830,9 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- intefaceList.Add(InserMattressInterfacePz("垫层", chastr_temp, 2, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("垫层", chastr_temp, 2, name_arr));
|
|
|
}
|
|
|
- private void AutoSetFormulaTypeTwoPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
|
|
|
+ private void AutoSetFormulaTypeTwoPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
|
|
|
{
|
|
|
var fuliaoList = mxlist.Where(t => t.formulatype == 2).ToList();
|
|
|
|
|
@@ -840,29 +853,35 @@ namespace JLHHJSvr.Helper
|
|
|
// 处理特殊辅料
|
|
|
if (specialSet.Contains(mx.mtrlname))
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}", 1, new string[] { $"{cnt}个" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}", 1, new string[] { $"{cnt.ToString("#,##0.0#")}个" }));
|
|
|
continue; // 跳过后续的处理
|
|
|
}
|
|
|
|
|
|
// 处理其他辅料
|
|
|
- if (nameSet.Contains(mx.mtrlname) || mx.formulakind == 15 && !nameSet.Contains(mx.mtrlname))
|
|
|
+ if (nameSet.Contains(mx.mtrlname))
|
|
|
{
|
|
|
for (int i = 1; i <= cnt; i++)
|
|
|
{
|
|
|
// 添加辅料接口
|
|
|
- intefaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}", 1, new string[] { "" }));
|
|
|
-
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}", 1, new string[] { "" }));
|
|
|
// 如果是额外的辅料,添加位置接口
|
|
|
if (extraSet.Contains(mx.mtrlname))
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}位置", 0, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}位置", 0, new string[] { "" }));
|
|
|
}
|
|
|
}
|
|
|
+ }else if(mx.formulakind == 15 && !nameSet.Contains(mx.mtrlname))
|
|
|
+ {
|
|
|
+ for (int i = 1; i <= cnt; i++)
|
|
|
+ {
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}", 1, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}位置", 0, new string[] { "" }));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- private void AutoSetFormulaTypeThreePz(u_mattress mattress, List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
|
|
|
+ private void AutoSetFormulaTypeThreePz(u_mattress mattress, List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
|
|
|
{
|
|
|
// 筛选 formulatype 为 3 的物料
|
|
|
var bzList = mxlist.Where(t => t.formulatype == 3).ToList();
|
|
@@ -888,7 +907,7 @@ namespace JLHHJSvr.Helper
|
|
|
};
|
|
|
|
|
|
// 外观
|
|
|
- intefaceList.Add(InserMattressInterfacePz("包装", "包装方式", 1, new string[] { Enum.GetName(typeof(PackType), mattress.packtype) }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("包装", "包装方式", 1, new string[] { Enum.GetName(typeof(PackType), mattress.packtype) }));
|
|
|
|
|
|
foreach (var mx in bzList)
|
|
|
{
|
|
@@ -897,7 +916,7 @@ namespace JLHHJSvr.Helper
|
|
|
var name_arr = new string[1];
|
|
|
if (mx.qty.HasValue && mx.qty.Value > 1)
|
|
|
{
|
|
|
- name_arr[0] = $"{mx.qty.Value}个{mx.mtrlname}";
|
|
|
+ name_arr[0] = $"{mx.qty.Value.ToString("#,##0.0#")}个{mx.mtrlname}";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -910,20 +929,20 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
|
|
|
|
// 添加包装信息
|
|
|
- intefaceList.Add(InserMattressInterfacePz("包装", chastr, 2, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("包装", chastr, 2, name_arr));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 压包数量
|
|
|
- intefaceList.Add(InserMattressInterfacePz("包装", "压包数量", 1, new string[] { $"{mattress.packqty}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("包装", "压包数量", 1, new string[] { $"{mattress.packqty.Value.ToString("#,##0.0#")}" }));
|
|
|
// 包装说明
|
|
|
- intefaceList.Add(InserMattressInterfacePz("包装", "包装说明", 1, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("包装", "包装说明", 1, new string[] { "" }));
|
|
|
// 压包说明
|
|
|
- if (mattress.packqty.HasValue && mattress.packqty.Value > 0) intefaceList.Add(InserMattressInterfacePz("包装", "压包说明", 1, new string[] { "" }));
|
|
|
+ if (mattress.packqty.HasValue && mattress.packqty.Value > 0) interfaceList.Add(InserMattressInterfacePz("包装", "压包说明", 1, new string[] { "" }));
|
|
|
// 卷包说明
|
|
|
- if (mattress.diameter.HasValue && mattress.diameter.Value > 0) intefaceList.Add(InserMattressInterfacePz("包装", "卷包说明", 1, new string[] { "" }));
|
|
|
+ if (mattress.diameter.HasValue && mattress.diameter.Value > 0) interfaceList.Add(InserMattressInterfacePz("包装", "卷包说明", 1, new string[] { "" }));
|
|
|
}
|
|
|
- private void AutoSetFormulaType101Pz(u_mattress mattress, List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
|
|
|
+ private void AutoSetFormulaType101Pz(u_mattress mattress, List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
|
|
|
{
|
|
|
var powerDict = new Dictionary<string, int[]>()
|
|
|
{
|
|
@@ -955,8 +974,8 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
if (sb.Length > 0)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("内布套", chastrDict[item.Key][0], 2, name_arr));
|
|
|
- intefaceList.Add(InserMattressInterfacePz("内布套", chastrDict[item.Key][1], 1, new string[] { "" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("内布套", chastrDict[item.Key][0], 2, name_arr));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("内布套", chastrDict[item.Key][1], 1, new string[] { "" }));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -965,86 +984,33 @@ namespace JLHHJSvr.Helper
|
|
|
{
|
|
|
if (mx.mtrlid > 0 && "内布套".Equals(mx.chastr) && mx.formulakind == 203)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("内布套", "内布套-围边边带", 2, new string[] { $"{mx.thickness.Value}条共{mx.qty.Value}米{mx.mtrlname}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("内布套", "内布套-围边边带", 2, new string[] { $"{mx.thickness.Value.ToString("#,##0.0#")}条共{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
|
|
|
}
|
|
|
else if (mx.mtrlid > 0 && "内布套".Equals(mx.chastr) && mx.formulakind == 202)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("内布套", "内布套-拉链", 2, new string[] { $"{mx.thickness.Value}条共{mx.qty.Value}米{mx.mtrlname}" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("内布套", "内布套-拉链", 2, new string[] { $"{mx.thickness.Value.ToString("#,##0.0#")}条共{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (mattress.if_n_butao == 1)
|
|
|
{
|
|
|
- intefaceList.Add(InserMattressInterfacePz("内布套", "内布套做法说明", 1, new string[] { $"内布套面层向大侧覆盖{mattress.s_cover_qty}CM、内布套大侧向底层覆盖{mattress.z_cover_qty}CM、内布套底层向大侧覆盖{mattress.x_cover_qty}CM" }));
|
|
|
+ interfaceList.Add(InserMattressInterfacePz("内布套", "内布套做法说明", 1, new string[] { $"内布套面层向大侧覆盖{mattress.s_cover_qty.Value.ToString("#,##0.0#")}CM、内布套大侧向底层覆盖{mattress.z_cover_qty.Value.ToString("#,##0.0#")}CM、内布套底层向大侧覆盖{mattress.x_cover_qty.Value.ToString("#,##0.0#")}CM" }));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 导入清单方法
|
|
|
- public void RefreshMattressInterfaceQdList(int mattressid, List<u_mattress_interface_qd> qdList)
|
|
|
+ public List<u_mattress_interface_qd> RefreshMattressInterfaceQdList(int mattressid)
|
|
|
{
|
|
|
- var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
- DbSqlHelper.SelectOne(cmd, mattress, "js2_flag");
|
|
|
-
|
|
|
- if(mattress.js2_flag == 1)
|
|
|
- {
|
|
|
- throw new LJCommonException("床垫已技术2审核,不能重新生成!");
|
|
|
- }
|
|
|
-
|
|
|
- var copy_list = new List<u_mattress_interface_qd>();
|
|
|
-
|
|
|
- var selectStr = @"SELECT u_mattress_interface_qd.mattressid
|
|
|
- ,u_mattress_interface_qd.printid
|
|
|
- ,u_mattress_interface_qd.itemname
|
|
|
- ,u_mattress_interface_qd.bj_pzname
|
|
|
- ,u_mattress_interface_qd.bj_pzname_mx
|
|
|
- ,u_mattress_interface_qd.bj_pzname_mx_mx
|
|
|
- ,u_mattress_interface_qd.mtrlid
|
|
|
- ,u_mattress_interface_qd.erp_mtrlid
|
|
|
- ,u_mattress_interface_qd.useqty
|
|
|
- ,u_mattress_interface_qd.dscrp
|
|
|
- ,u_mtrl_price.name AS mtrlname
|
|
|
- ,u_mattress_interface_qd.actual_useqty
|
|
|
- ,u_mattress_interface_qd.qd_actual_size
|
|
|
- ,u_mattress_interface_qd.qd_pfgroupqty
|
|
|
- ,u_mattress_interface_qd.wrkgrpid
|
|
|
- ,u_mattress_interface_qd.ss_rate
|
|
|
- ,u_mattress_interface_qd.ls_rate
|
|
|
- ,u_mattress_interface_qd.sh_rate
|
|
|
- FROM u_mattress_interface_qd
|
|
|
- LEFT JOIN u_mtrl_price ON u_mtrl_price.mtrlid = u_mattress_interface_qd.mtrlid";
|
|
|
- var outputFields = "mattressid,printid,itemname,bj_pzname,bj_pzname_mx,bj_pzname_mx_mx,mtrlid,erp_mtrlid,useqty,dscrp,mtrlname,actual_useqty,qd_actual_size,qd_pfgroupqty,wrkgrpid,ss_rate,ls_rate,sh_rate";
|
|
|
- DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", outputFields, 0, 0, copy_list);
|
|
|
-
|
|
|
+ var qdList = new List<u_mattress_interface_qd>();
|
|
|
+
|
|
|
ImportMattressInterfaceQdList(mattressid, qdList);
|
|
|
|
|
|
+ MattressInterfaceFindERPPrdPf(qdList,null);
|
|
|
|
|
|
- var copyDict = copy_list.ToDictionary(mx2 => Tuple.Create(mx2.itemname, mx2.bj_pzname, mx2.bj_pzname_mx), mx2 => mx2);
|
|
|
-
|
|
|
- // 遍历qdList
|
|
|
- foreach (var mx in qdList)
|
|
|
- {
|
|
|
- var key = Tuple.Create(mx.itemname, mx.bj_pzname, mx.bj_pzname_mx); // 创建复合键
|
|
|
- if (copyDict.TryGetValue(key, out var mx2)) // 高效查找对应的mx2
|
|
|
- {
|
|
|
- // 更新mx属性
|
|
|
- mx.erp_mtrlid = mx2.erp_mtrlid;
|
|
|
- mx.erp_mtrlcode = mx2.erp_mtrlcode;
|
|
|
- mx.erp_mtrlname = mx2.erp_mtrlname;
|
|
|
- mx.erp_mtrlmode = mx2.erp_mtrlmode;
|
|
|
- mx.erp_unit = mx2.erp_unit;
|
|
|
- mx.useqty = mx2.useqty;
|
|
|
- mx.actual_useqty = mx2.actual_useqty;
|
|
|
- mx.wrkgrpid = mx2.wrkgrpid;
|
|
|
- mx.qd_actual_size = mx2.qd_actual_size;
|
|
|
- mx.qd_pfgroupqty = mx2.qd_pfgroupqty;
|
|
|
- mx.dscrp = mx2.dscrp;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- FindERPPrdPf(qdList);
|
|
|
+ return qdList;
|
|
|
}
|
|
|
- private void FindERPPrdPf(List<u_mattress_interface_qd> qdList)
|
|
|
+ public void MattressInterfaceFindERPPrdPf(List<u_mattress_interface_qd> qdList,List<u_mattress_interface> interfaceList)
|
|
|
{
|
|
|
foreach(var mx in qdList)
|
|
|
{
|
|
@@ -1086,6 +1052,20 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
|
|
|
|
//更新 二级明细项目 需要产品配置列表,此部分由前端完成
|
|
|
+ if(interfaceList != null && interfaceList.Any())
|
|
|
+ {
|
|
|
+ Dictionary<string, u_mattress_interface> interfaceDict = interfaceList.ToDictionary(mb => mb.bj_pzname, mb => mb);
|
|
|
+ foreach (var mx in qdList)
|
|
|
+ {
|
|
|
+ if (interfaceDict.TryGetValue(mx.bj_pzname, out var mb))
|
|
|
+ {
|
|
|
+ mx.bj_pzname_mx_mx = mb.bj_namemx;
|
|
|
+
|
|
|
+ if (mx.ss_rate == 0) mx.ss_rate = mb.ss_rate;
|
|
|
+ if (mx.ls_rate == 0) mx.ls_rate = mb.ls_rate;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 导入产品清单
|
|
@@ -1213,7 +1193,7 @@ namespace JLHHJSvr.Helper
|
|
|
{"小侧1",new string[] { "小侧", "小侧1裥棉"} },
|
|
|
{"小侧1-上下拼侧1",new string[] { "小侧", "小侧1-上下拼侧1裥棉" } },
|
|
|
{"小侧1-上下拼侧2",new string[] { "小侧", "小侧1-上下拼侧2裥棉" } },
|
|
|
- {"小侧1-上下拼侧2",new string[] { "小侧", "小侧1-上下拼侧3裥棉" } },
|
|
|
+ {"小侧1-上下拼侧3",new string[] { "小侧", "小侧1-上下拼侧3裥棉" } },
|
|
|
{"小侧2",new string[] { "小侧", "小侧2裥棉", "小侧2裥棉图案" } },
|
|
|
{"小侧3",new string[] { "小侧", "小侧3裥棉", "小侧3裥棉图案", "小侧说明" } },
|
|
|
{"V侧1_EMPTY",new string[] { "V侧", "V侧1裥棉", "V侧1裥棉图案" } },
|
|
@@ -1351,7 +1331,7 @@ namespace JLHHJSvr.Helper
|
|
|
/// 床网
|
|
|
/// </summary>
|
|
|
/// <param name="mx"></param>
|
|
|
- /// <param name="intefaceList"></param>
|
|
|
+ /// <param name="interfaceList"></param>
|
|
|
/// <param name="chastr"></param>
|
|
|
/// <param name="count"></param>
|
|
|
private void ProcessChuangWangPrdPf(u_mattress_mx_mtrl mx, List<u_mattress_interface_qd> qdList, string chastr, int count)
|
|
@@ -1406,7 +1386,7 @@ namespace JLHHJSvr.Helper
|
|
|
/// 网面布料 / 打底无纺布 / 毡类 / 顶布 / 垫层
|
|
|
/// </summary>
|
|
|
/// <param name="mx"></param>
|
|
|
- /// <param name="intefaceList"></param>
|
|
|
+ /// <param name="interfaceList"></param>
|
|
|
/// <param name="chastr"></param>
|
|
|
/// <param name="count"></param>
|
|
|
private void ProcessWangMianBLPrdPf(u_mattress_mx_mtrl mx, List<u_mattress_interface_qd> qdList, string chastr, string typename, int count)
|
|
@@ -1415,7 +1395,7 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
if ((!mx.mtrlname.Contains("分") && mx.thickness > 0) || ("垫层".Equals(typename)))
|
|
|
{
|
|
|
- mtrlname_temp = $"{mx.thickness}分{mx.mtrlname}";
|
|
|
+ mtrlname_temp = $"{mx.thickness.Value.ToString("#,##0.0#")}分{mx.mtrlname}";
|
|
|
}
|
|
|
|
|
|
qdList.Add(InserMattressInterfacePrdPf("垫层", $"{chastr}-{typename}{count}", "",mx.mtrlid.Value,mx.useqty.Value));
|
|
@@ -1499,7 +1479,7 @@ namespace JLHHJSvr.Helper
|
|
|
var name_arr = new string[1];
|
|
|
if (mx.qty.HasValue && mx.qty.Value > 1)
|
|
|
{
|
|
|
- name_arr[0] = $"{mx.qty.Value}个{mx.mtrlname}";
|
|
|
+ name_arr[0] = $"{mx.qty.Value.ToString("#,##0.0#")}个{mx.mtrlname}";
|
|
|
}
|
|
|
else
|
|
|
{
|