zrg
2026-02-26 e4726b306b10dc68d01fdb5d2760e671be815129
WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs
@@ -326,7 +326,7 @@
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //获取保养项目编辑数据
                string sql = "select 保养项目ID HMaintainItemID,保养项目代码 HMaintainItemNumber,保养项目 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,负责人ID HManagerID,负责人代码 HManagerNumber,负责人名称 HManagerName,子备注2 HRemark from h_v_Sc_MouldMaintainRuleBillSub_Item where 1 = 1 " + Swhere + "";
                string sql = "select 保养项目ID HMaintainItemID,保养项目代码 HMaintainItemNumber,保养项目 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,负责人ID HManagerID,负责人代码 HManagerNumber,负责人名称 HManagerName,子备注2 HRemark, 保养结果 HStdMaintainResult from h_v_Sc_MouldMaintainRuleBillSub_Item where 1 = 1 " + Swhere + "";
                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillSub_Item");
                //获取配件项目编辑数据
                string sql1 = "select 配件ID HMaterID,配件代码 HMaterNumber,配件名称 HMaterName,单位ID HUnitID,计量单位代码 HUnitNumber,计量单位名称 HUnitName,用量 HQty,子备注1 HRemark from h_v_Sc_MouldMaintainRuleBillSub where 1 = 1 " + Swhere + "";
@@ -367,6 +367,7 @@
            string msg3 = sArray[1].ToString();
            string msg4 = sArray[2].ToString();
            string msg5 = sArray[3].ToString();
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            ListModels oListModels = new ListModels();
            try
@@ -385,6 +386,8 @@
                List<Model.ClsSc_MouldMaintainRuleBillMain> lsmain = new List<Model.ClsSc_MouldMaintainRuleBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                //主表
                lsmain = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillMain(msg2);
                foreach (Model.ClsSc_MouldMaintainRuleBillMain oItem in lsmain)
@@ -406,7 +409,23 @@
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                    if (oItem.HInterID == 0)
                    {
                        // 判断新增的表单与表格中的表单是否有重复
                        DataSet ds = oCN.RunProcReturn("select * from h_v_Sc_MouldMaintainRuleBillList where 单据号 = '" + oItem.HBillNo + "'", "h_v_Sc_MouldMaintainRuleBillList");
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!单据号不得有重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                }
                //保养项表体数据
                //按 },{来拆分数组 //去掉【和】
@@ -419,7 +438,6 @@
                int i = 0;
                foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item item in ls)
                {
                    i++;
                    item.HEntryID = i;
                    item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
@@ -462,7 +480,7 @@
                //保存完毕后处理
                bool bResult;
                if (oBill.omodel.HInterID == 0)
                {
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }