1
zrg
2024-10-15 a1e3e548ea03ceb32d07bf9f73f4719dd14f7f2e
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -1,6 +1,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using SyntacticSugar.constant;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -1911,6 +1912,59 @@
        }
        #endregion
        #region 工序流转卡分页列表
        [Route("Sc_ProcessExchangeBillList/page")]
        [HttpGet]
        public json page(string sWhere, string user, int page, int size)
        {
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessExchangeBill_SubQuery", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_ProcessExchangeBillList_Query " + page + "," + size + ",''", "h_p_Sc_ProcessExchangeBillList_Query");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_ProcessExchangeBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_ProcessExchangeBillList_Query");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 工序流转卡列表
        /// <summary>
        /// 获取工序流转卡列表信息
@@ -2103,7 +2157,7 @@
                    HProQty = oItemSub.HProQty;
                    sql = "select * from h_v_Sc_ProcessExchangeBill_BatchSplit where hmainid = " + oItemSub.HICMOInterID + " and hentryid = " 
                         + oItemSub.HICMOEntryID;
                         + oItemSub.HICMOEntryID + " and HRoutingID = " + oItemSub.HRoutingInterID.ToString();
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeBill_BatchSplit");
                    //主表赋值
                    if (ds.Tables[0].Rows.Count > 0 && ds != null)
@@ -2242,7 +2296,7 @@
                        oItemSubs.HDeptID = Pub_Class.ClsPub.isLong(ds.Tables[0].Rows[i]["HDeptID"]);
                        oItemSubs.HDeptNumber = ds.Tables[0].Rows[i]["HDeptNumber"].ToString();
                        oItemSubs.HGroupID = 0;
                        oItemSubs.HGroupNumber = "";
                        oItemSubs.HGroupNumber = oItemSub.HGroupNumber;
                        oItemSubs.HWorkerID = 0;
                        oItemSubs.HWorkerNumber = "";
                        oItemSubs.HSourceID = 0;
@@ -2287,6 +2341,8 @@
                        oItemSubs.HSeOrderInterID = 0;
                        oItemSubs.HSeOrderEntryID = 0;
                        oItemSubs.HSNCtrl = false;
                        oItemSubs.HRoutingBillMainID = Pub_Class.ClsPub.isLong(ds.Tables[0].Rows[i]["HRoutingID"]);
                        oItemSubs.HRoutingBillEntryID = Pub_Class.ClsPub.isLong(ds.Tables[0].Rows[i]["HRoutingEntryID"]);
                        oBill.DetailColl.Add(oItemSubs);//添加明细行值                
                    }