yangle
2024-05-15 95f65190334bd1baaebe0e6a7312a06b660cd4d1
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -132,16 +132,32 @@
            string user = sArray[3].ToString();//用户名
            string HComputerName = SystemInformation.ComputerName; //设备名称
            user_LongShan = sArray[3].ToString();//用户名
            string HBillSubType = sArray[4].ToString();//单据子类型
            try
            {
                //判断是否有编辑权限
                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Edit", 1, false, user))
                if (HBillSubType == "3301")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限编辑!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    //判断是否有编辑权限
                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Edit", 1, false, user))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "工艺路线无权限编辑!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                else {
                    //判断是否有编辑权限
                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Edit", 1, false, user))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "子工艺路线无权限编辑!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                msg2 = "[" + msg2.ToString() + "]";
@@ -241,7 +257,7 @@
                ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where hmainid=" + HInterID + " and 单据号='" + HBillNo + "'", "h_v_Gy_RoutingBillList");
                if ((OperationType == 1 || OperationType == 2|| OperationType == 4) && ds.Tables[0].Rows.Count == 0)//新增
                if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//新增
                {
                    //主表
                    oCN.RunProc("Insert Into Gy_RoutingBillMain   " +
@@ -251,7 +267,7 @@
                    ",HMainGroupID,HMainProcID,HMainCenterID,HMainTimeUnit,HMainUnitTime,HMainWorkQty" +
                    ",HMainPrice,HStdSourceQty,HAddSourceRate,HPRDORGID,HDelSourceRate" +
                    ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HOrgID) " + 
                    " values('" + BillType + "','"+(OperationType==4?"SUB":"") +"'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                    " values('" + BillType + "','"+ HBillSubType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                    "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()," + HMaterID + ",'" + HName + "'," + HMaterTypeID +
                    "," + HRoutingGroupID + "," + HUnitID + ",'" + HMaterNumber + "','" + HUnitNumber + "'," + Convert.ToString(HStandard ? 1 : 0) +
                    "," + HMainGroupID + "," + HMainProcID + "," + HMainCenterID + ",'" + HMainTimeUnit + "'," + HMainUnitTime + "," + HMainWorkQty +
@@ -310,7 +326,7 @@
                        oCN.RunProc("exec Gy_RoutingBill_LastProNo " + HInterID);
                    }
                }
                else if (IsProNo == 1 && (OperationType == 1 || OperationType == 4))
                else if (IsProNo == 1 && (OperationType == 1))
                {
                    ds = oCN.RunProcReturn("select * from Gy_Process Where HTProcessFlag = 1 and HNumber='9999' ", "Gy_Process");
@@ -414,6 +430,7 @@
                    ",HPackStd,HPack,HPutArea,HMyWorkDays,HMyFixWorkDays,HPassRate" +
                    ",HTechnologyParameter,HPicNum,HProcCheckNote" +
                    ",HOverRate,HProcWorkNum,HBadWHID,HWasterWHID, HWHID,HIsTime,HEstimate " +
                    ",HWorkTimes_S,HSortProcFlag " +
                    ") values("
                    + HInterID + "," + i + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNo + "'," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "" +
                    "," + oSub.HWorkQty.ToString() + "," + oSub.HCenterID.ToString() + ",'" + oSub.HTimeUnit.ToString() + "'," + oSub.HUnitTime.ToString() +
@@ -426,6 +443,7 @@
                   ",'" + oSub.HPackStd + "','" + oSub.HPack + "','" + oSub.HPutArea + "'," + oSub.HMyWorkDays.ToString() + "," + oSub.HMyFixWorkDays.ToString() + "," + oSub.HPassRate.ToString() +
                   ",'" + oSub.HTechnologyParameter.ToString() + "','" + oSub.HPicNum.ToString() + "','" + oSub.HProcCheckNote.ToString() +
                   "', " + oSub.HOverRate.ToString() + ",'" + oSub.HProcWorkNum.ToString() + "'," + oSub.HBadWHID.ToString() + "," + oSub.HWasterWHID.ToString() + "," + oSub.HWHID.ToString() + "," + Convert.ToString(oSub.HIsTime ? 1 : 0) + "," + oSub.HEstimate.ToString() +
                   ", " + oSub.HWorkTimes_S.ToString() + "," + Convert.ToString(oSub.HSortProcFlag ? 1 : 0) +
                    ") ");
                    //计价方式不为计时,则把计时暂估字段更新为空
                    if (oSub.HIsTime == false)
@@ -455,6 +473,7 @@
                    ",HTechnologyParameter,HPicNum,HProcCheckNote" +
                    ",HOverRate,HProcWorkNum,HBadWHID,HWasterWHID, HWHID,HEstimate,HIsTime" +
                    ",HQCSchemeID_Fst,HQCSchemeID_Proc,HQCSchemeID_Patrol" +
                    ",HWorkTimes_S,HSortProcFlag " +
                    ") values("
                    + HInterID + "," + i + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNo + "'," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "" +
                    "," + oSub.HWorkQty.ToString() + "," + oSub.HCenterID.ToString() + ",'" + oSub.HTimeUnit.ToString() + "'," + oSub.HUnitTime.ToString() +
@@ -468,6 +487,7 @@
                   ",'" + oSub.HTechnologyParameter.ToString() + "','" + oSub.HPicNum.ToString() + "','" + oSub.HProcCheckNote.ToString() +
                   "', " + oSub.HOverRate.ToString() + ",'" + oSub.HProcWorkNum.ToString() + "'," + oSub.HBadWHID.ToString() + "," + oSub.HWasterWHID.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HEstimate.ToString() + "," + Convert.ToString(oSub.HIsTime ? 1 : 0) + "," + oSub.HQCSchemeID_Fst + "," +
                     oSub.HQCSchemeID_Proc + "," + oSub.HQCSchemeID_Patrol +
                   ", " + oSub.HWorkTimes_S.ToString() + "," + Convert.ToString(oSub.HSortProcFlag ? 1 : 0) +
                    ") ");
                    //计价方式不为计时,则把计时暂估字段更新为空
                    if (oSub.HIsTime == false)
@@ -1223,14 +1243,14 @@
            try
            {
                //判断是否有查询权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无权限查询!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql1 = "select  top 1000 * from h_v_Gy_RoutingBillQuery where 1 = 1 ";
@@ -1263,7 +1283,7 @@
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql1 = "select  top 1000 * from h_v_Gy_RoutingBillQuerySub where 1 = 1 and hmainid=" + sWhere;
                string sql = sql1  + " order by hmainid desc,cast(工序号 as int)";