|
@@ -2950,13 +2950,12 @@ namespace JLHHJSvr.Helper
|
|
|
public void InitMattressSubSpecs(u_mattress parent, u_mattress child)
|
|
|
{
|
|
|
var bedNetHelper = GetHelper<BedNetHelper>(cmd, context);
|
|
|
+ var bednetIndex = 0; // 床网索引
|
|
|
+ var cushionsIndex = 0; // 垫层主副规格物料索引
|
|
|
+ var accessoriesIndex = 0; // 辅料主副规格物料索引
|
|
|
// 处理副规格的明细内容
|
|
|
foreach (var childMx in child.mxList)
|
|
|
{
|
|
|
- var bednetIndex = 0; // 床网索引
|
|
|
- var cushionsIndex = 0; // 垫层主副规格物料索引
|
|
|
- var accessoriesIndex = 0; // 辅料主副规格物料索引
|
|
|
-
|
|
|
// 副规格床网自动匹配/新增逻辑
|
|
|
if (childMx.formulatype == 99 && childMx.mtrlid > 0)
|
|
|
{
|
|
@@ -3067,36 +3066,8 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
foreach (var child in toUpdate)
|
|
|
{
|
|
|
- var _child = GetMattress(child.mattressid);
|
|
|
- _child.mattress_width = child.mattress_width;
|
|
|
- _child.mattress_length = child.mattress_length;
|
|
|
- _child.mattress_height = child.mattress_height;
|
|
|
- _child.mattressrelcode = child.mattressrelcode;
|
|
|
- _child.mattressname = child.mattressname;
|
|
|
- _child.DynamicFields = child.DynamicFields;
|
|
|
- _child.mxList = mattress.mxList?.Select(mx =>
|
|
|
- {
|
|
|
- var mxClone = ObjectHelper.DeepCopy(mx);
|
|
|
- mxClone.mattressid = 0;
|
|
|
- mxClone.mattressmxid = 0;
|
|
|
- return mxClone;
|
|
|
- }).ToList();
|
|
|
- _child.extraList = mattress.extraList?.Select(mx =>
|
|
|
- {
|
|
|
- var mxClone = ObjectHelper.DeepCopy(mx);
|
|
|
- mxClone.mattressid = 0;
|
|
|
- mxClone.mattressmxid = 0;
|
|
|
- return mxClone;
|
|
|
- }).ToList();
|
|
|
- _child.extraCostList = mattress.extraCostList?.Select(mx =>
|
|
|
- {
|
|
|
- var mxClone = ObjectHelper.DeepCopy(mx);
|
|
|
- mxClone.mattressid = 0;
|
|
|
- mxClone.mattressmxid = 0;
|
|
|
- return mxClone;
|
|
|
- }).ToList();
|
|
|
-
|
|
|
- subspecsList.Add(_child);
|
|
|
+ var copy = CreateSubSpecClone(mattress, child);
|
|
|
+ subspecsList.Add(copy);
|
|
|
}
|
|
|
|
|
|
subspecsList.Sort((a, b) =>
|