1
duhe
2024-08-12 f331a2915eebc492e872206d9aa7e13fc7f0861f
WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
@@ -83,7 +83,7 @@
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MESBeginWorkBillList_NEW  where hmainid= " + HID + " ", "h_v_Sc_MESBeginWorkBillList_NEW");
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MESBeginWorkBillList_Edit  where hmainid= " + HID + " ", "h_v_Sc_MESBeginWorkBillList_Edit");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在开工单号" };
@@ -735,8 +735,9 @@
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string UserName = sArray[1].ToString();
            string refSav = sArray[2].ToString();
            string msg3 = sArray[1].ToString();
            string UserName = sArray[2].ToString();
            string refSav = sArray[3].ToString();
            DBUtility.ClsPub.CurUserName = UserName;
            //保存权限
            if (!DBUtility.ClsPub.Security_Log_second("MES_MESBeginWorkBill_Edit", 1, false, DBUtility.ClsPub.CurUserName))
@@ -848,13 +849,33 @@
                    oBill.omodel = oItem;
                }
                // 表体数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                List<Models.ClsSc_MESBeginWorkBillSub_RelationBill> ls = new List<Models.ClsSc_MESBeginWorkBillSub_RelationBill>();
                ls = oListModels.getObjectByJson_Sc_MESBeginWorkBillSub_RelationBill(msg3);
                int i = 0;
                foreach (Models.ClsSc_MESBeginWorkBillSub_RelationBill oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    oBill.DetailCol2.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.omodel.HInterID == 0)
                {
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                        bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    if (bResult)
                    {
                        objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //返回主ID