|
@@ -18,6 +18,7 @@ using System.Runtime.Remoting.Metadata.W3cXsd2001;
|
|
|
using System.Text;
|
|
using System.Text;
|
|
|
using System.Text.RegularExpressions;
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
|
|
|
+using System.Windows.Forms;
|
|
|
using static JLHHJSvr.Helper.CacheHelper;
|
|
using static JLHHJSvr.Helper.CacheHelper;
|
|
|
|
|
|
|
|
namespace JLHHJSvr.Helper
|
|
namespace JLHHJSvr.Helper
|
|
@@ -114,12 +115,42 @@ namespace JLHHJSvr.Helper
|
|
|
InitMxReplaceMents(mx);
|
|
InitMxReplaceMents(mx);
|
|
|
|
|
|
|
|
// 顶替分组关键值:內布套、顶布裥棉
|
|
// 顶替分组关键值:內布套、顶布裥棉
|
|
|
- if (thicknessDict.ContainsKey(mx.chastr))
|
|
|
|
|
|
|
+ //if (thicknessDict.ContainsKey(mx.chastr))
|
|
|
|
|
+ //{
|
|
|
|
|
+ // foreach(var rp in thicknessDict[mx.chastr])
|
|
|
|
|
+ // {
|
|
|
|
|
+ // AddKeyValue(rp.Key, rp.Value);
|
|
|
|
|
+ // }
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ // 只处理 内布套(101,102)、顶布裥棉(103)
|
|
|
|
|
+ if (new List<int>() { 101, 102, 103 }.Contains(mx.formulatype.Value))
|
|
|
{
|
|
{
|
|
|
- foreach(var rp in thicknessDict[mx.chastr])
|
|
|
|
|
|
|
+ var keyStr = string.Empty;
|
|
|
|
|
+ var keyValue = 0M;
|
|
|
|
|
+ if (mx.formulatype == 101 || mx.formulatype == 102)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch (mx.formulakind.Value)
|
|
|
|
|
+ {
|
|
|
|
|
+ case 0: // 面裥绵-布料
|
|
|
|
|
+ keyStr = "内布套上覆";
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1: // 底裥绵-布料
|
|
|
|
|
+ keyStr = "内布套下覆";
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2: // 大侧裥绵-布料
|
|
|
|
|
+ keyStr = "内布套侧覆";
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ keyValue = mx.sidecover.Value;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (mx.formulatype == 103)
|
|
|
{
|
|
{
|
|
|
- AddKeyValue(rp.Key, rp.Value);
|
|
|
|
|
|
|
+ keyStr = "物料厚度";
|
|
|
|
|
+ keyValue = mx.thickness.Value;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ AddKeyValue(keyStr, keyValue);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
string expression = ConvertToEnglishSymbols(mx.formula), use_expression = ConvertToEnglishSymbols(mx.useformula);
|
|
string expression = ConvertToEnglishSymbols(mx.formula), use_expression = ConvertToEnglishSymbols(mx.useformula);
|
|
@@ -279,10 +310,10 @@ namespace JLHHJSvr.Helper
|
|
|
/// 记录明细按分组读取厚度变量
|
|
/// 记录明细按分组读取厚度变量
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
/// <param name="mxlist"></param>
|
|
/// <param name="mxlist"></param>
|
|
|
- private Dictionary<string, Dictionary<string, object>> InitMxThicknessReplaceMents(List<u_mattress_mx_mtrl> mxlist)
|
|
|
|
|
|
|
+ private Dictionary<string, Dictionary<string, decimal>> InitMxThicknessReplaceMents(List<u_mattress_mx_mtrl> mxlist)
|
|
|
{
|
|
{
|
|
|
// 明细按分组读取厚度变量
|
|
// 明细按分组读取厚度变量
|
|
|
- var thicknessDict = new Dictionary<string, Dictionary<string, object>> () { };
|
|
|
|
|
|
|
+ var thicknessDict = new Dictionary<string, Dictionary<string, decimal>> () { };
|
|
|
|
|
|
|
|
foreach (var mx in mxlist)
|
|
foreach (var mx in mxlist)
|
|
|
{
|
|
{
|
|
@@ -291,9 +322,10 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
|
|
if (mx.chastr.Contains("顶布裥棉") || mx.chastr.Contains("内布套"))
|
|
if (mx.chastr.Contains("顶布裥棉") || mx.chastr.Contains("内布套"))
|
|
|
{
|
|
{
|
|
|
|
|
+ var keyStr = $"{mx.chastr}-{mx.mtrlid}";
|
|
|
if(!thicknessDict.ContainsKey(mx.chastr))
|
|
if(!thicknessDict.ContainsKey(mx.chastr))
|
|
|
{
|
|
{
|
|
|
- thicknessDict.Add(mx.chastr, new Dictionary<string, object>() {});
|
|
|
|
|
|
|
+ thicknessDict.Add(mx.chastr, new Dictionary<string, decimal>() {});
|
|
|
}
|
|
}
|
|
|
var mxDict = thicknessDict[mx.chastr];
|
|
var mxDict = thicknessDict[mx.chastr];
|
|
|
setMxThicknessValue(mx, ref mxDict);
|
|
setMxThicknessValue(mx, ref mxDict);
|
|
@@ -303,7 +335,7 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
|
|
return thicknessDict;
|
|
return thicknessDict;
|
|
|
}
|
|
}
|
|
|
- private void setMxThicknessValue(u_mattress_mx_mtrl mx, ref Dictionary<string, object> mxDict)
|
|
|
|
|
|
|
+ private void setMxThicknessValue(u_mattress_mx_mtrl mx, ref Dictionary<string, decimal> mxDict)
|
|
|
{
|
|
{
|
|
|
var keyStr = "";
|
|
var keyStr = "";
|
|
|
if (new List<int>() { 101, 102 }.Contains(mx.formulatype.Value))
|
|
if (new List<int>() { 101, 102 }.Contains(mx.formulatype.Value))
|
|
@@ -322,7 +354,7 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
}
|
|
|
if (!string.IsNullOrEmpty(keyStr))
|
|
if (!string.IsNullOrEmpty(keyStr))
|
|
|
{
|
|
{
|
|
|
- mxDict.Add(keyStr, mx.sidecover);
|
|
|
|
|
|
|
+ mxDict.Add(keyStr, mx.sidecover.Value);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else if (new List<int>() { 103 }.Contains(mx.formulatype.Value))
|
|
else if (new List<int>() { 103 }.Contains(mx.formulatype.Value))
|
|
@@ -335,7 +367,11 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
}
|
|
|
if (!string.IsNullOrEmpty(keyStr))
|
|
if (!string.IsNullOrEmpty(keyStr))
|
|
|
{
|
|
{
|
|
|
- mxDict.Add(keyStr, mx.thickness.Value);
|
|
|
|
|
|
|
+ if (!mxDict.TryGetValue(keyStr,out decimal thickness))
|
|
|
|
|
+ {
|
|
|
|
|
+ }
|
|
|
|
|
+ thickness += mx.thickness.Value;
|
|
|
|
|
+ mxDict[keyStr] = thickness;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|