1
zrg
8 天以前 da4b0a4e9a171b46d08beb45aa2b2ac7f7e3b12e
WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs
@@ -26,11 +26,61 @@
        {
            try
            {
                //判断是否有权限
                if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查看!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                List<object> columnNameList = new List<object>();               
                string sql1 = "select * from h_v_Sc_ProcExchSendWorkBillList where 1 = 1  ";
                string sql = sql1 + sWhere + " order by hmainid desc";
                ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcExchSendWorkBillList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 工序流转卡派工单编辑回显
        [Route("Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillEdit")]
        [HttpGet]
        public object Sc_ProcExchSendWorkBillEdit(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql1 = "select * from h_v_Sc_ProcExchSendWorkBillEdit where 1 = 1  ";
                string sql = sql1 + sWhere + " order by hmainid desc";
                ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcExchSendWorkBillEdit");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -286,7 +336,17 @@
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string msg4 = sArray[2].ToString();
            string msg5 = sArray[3].ToString();
            //判断是否有权限
            if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Edit", 1, false, msg5))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无权限保存!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            string UserName = "";
            ListModels oListModels = new ListModels();
@@ -335,10 +395,6 @@
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    //oItemSub.HRemark = "";         //备注
                    oItemSub.HSourceInterID = oItemSub.HSourceInterID;     // 源单主内码
                    oItemSub.HSourceEntryID = oItemSub.HSourceEntryID;   //源单子内码
                    oItemSub.HSourceBillNo = oItemSub.HSourceBillNo;  //源单单号
                    oItemSub.HSourceBillType = oItemSub.HSourceBillType; //源单类型
                    oItemSub.HRelationQty = 0;     //关联数量
            
                    oBill.DetailColl.Add(oItemSub);
@@ -391,6 +447,17 @@
        {
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
            //判断是否有权限
            if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Delete", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无权限删除!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
@@ -481,8 +548,8 @@
        {
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessSendWork_Check", 1, false, user))
                //判断是否有权限
                if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Check", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -647,7 +714,7 @@
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessSendWork_Close", 1, false, user))
                if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Close", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;