yusijie
2024-04-12 d26a4d0fe65398e478390e6013f48ec818ec8cc0
PDA异常反馈单
3个文件已修改
350 ■■■■■ 已修改文件
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs 342 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsOA_ErrMsgBackBill.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsOA_ErrMsgBackBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -172,9 +172,8 @@
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.omodel.HInterID == 0)
                if (refSav == "Add")
                {
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    if (bResult)
                    {
@@ -423,7 +422,7 @@
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        }
        public static DataSet Get_TransFerBillList(string sWhere)
        {
@@ -440,6 +439,63 @@
            return new SQLHelper.ClsCN().RunProcReturn(sql, "OA_ErrMsgBackBillMain");
        }
        #endregion
        #region 异常反馈列表PDA
        [Route("Sc_MESTransFerWorkBill/Get_TransFerBillList_PDA")]
        [HttpGet]
        public object Get_TransFerBillList_PDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    string sql = "select * from h_v_OA_ErrMsgBackBillList_PDA order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackBillList_PDA");
                }
                else
                {
                    string sql1 = "select * from h_v_OA_ErrMsgBackBillList_PDA where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackBillList_PDA");
                }
                //添加列名
                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.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 异常反馈列表编辑获取数据
@@ -751,7 +807,7 @@
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackList")]
        [HttpGet]
        public object Get_OA_ErrMsgBackList(string HInterID,string HEntryID, string user,int num)
        public object Get_OA_ErrMsgBackList(string HInterID,string HEntryID, string user,Int64 num)
        {
            try
            {
@@ -766,22 +822,46 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (num == 1)       //异常反馈单
                string sql = "";
                string HViewName = "";
                switch (num)
                {
                    string sql = "select * from h_v_OA_ErrMsgBackBillList where HInterID = '" + HInterID + "' and HEntryID = '" + HEntryID + "'";
                    ds = oCN.RunProcReturn(sql, "p_v_OA_ErrMsgBackBillList");
                    case 1: //异常反馈单
                        sql = "select * from h_v_OA_ErrMsgBackBillList where HInterID = '" + HInterID + "' and HEntryID = '" + HEntryID + "'";
                        HViewName = "h_v_OA_ErrMsgBackBillList";
                        break;
                    case 2://异常反馈接收单
                        sql = "select * from h_v_OA_ErrMsgBackReceiveBillMainList  where hmainid = '" + HInterID + "'";
                        HViewName = "h_v_OA_ErrMsgBackReceiveBillMainList";
                        break;
                    case 3://异常反馈处理单
                        sql = "select * from h_v_OA_ErrMsgBackHandleBillMainList   where hmainid = '" + HInterID + "'";
                        HViewName = "h_v_OA_ErrMsgBackHandleBillMainList";
                        break;
                    case 10: //异常反馈单PDA
                        sql = "select * from h_v_OA_ErrMsgBackBillList_PDA where HInterID = '" + HInterID + "' and HEntryID = '" + HEntryID + "'";
                        HViewName = "h_v_OA_ErrMsgBackBillList_PDA";
                        break;
                    case 11://异常反馈接收单PDA
                        sql = "select * from h_v_OA_ErrMsgBackReceiveBillList_PDA  where hmainid = '" + HInterID + "'";
                        HViewName = "h_v_OA_ErrMsgBackReceiveBillList_PDA";
                        break;
                    case 12://异常反馈处理单PDA
                        sql = "select * from h_v_OA_ErrMsgBackHandleBillList_PDA   where hmainid = '" + HInterID + "'";
                        HViewName = "h_v_OA_ErrMsgBackHandleBillList_PDA";
                        break;
                }
                else if (num==2)    //异常反馈接收单
                if(sql == "")
                {
                    string sql = "select * from h_v_OA_ErrMsgBackReceiveBillMainList  where hmainid = '" + HInterID + "'";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainList");
                }
                else if (num == 3)    //异常反馈处理单
                {
                    string sql = "select * from h_v_OA_ErrMsgBackHandleBillMainList   where hmainid = '" + HInterID + "'";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList ");
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查询数据异常,递入源单类型num不正确!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn(sql, HViewName);
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
@@ -1030,6 +1110,64 @@
                    string sql1 = "select * from h_v_OA_ErrMsgBackReceiveBillMainList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainList");
                }
                //添加列名
                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.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 异常反馈接收单列表PDA
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackReceiveBillList_PDA")]
        [HttpGet]
        public object Get_OA_ErrMsgBackReceiveBillList_PDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackReceiveBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    string sql = "select * from h_v_OA_ErrMsgBackReceiveBillList_PDA order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillList_PDA");
                }
                else
                {
                    string sql1 = "select * from h_v_OA_ErrMsgBackReceiveBillList_PDA where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillList_PDA");
                }
                //添加列名
@@ -1916,6 +2054,64 @@
        }
        #endregion
        #region 异常反馈签到单列表PDA
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackSignBillList_PDA")]
        [HttpGet]
        public object Get_OA_ErrMsgBackSignBillList_PDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackSignBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    string sql = "select * from h_v_OA_ErrMsgBackSignBillList_PDA order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackSignBillList_PDA");
                }
                else
                {
                    string sql1 = "select * from h_v_OA_ErrMsgBackSignBillList_PDA where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackSignBillList_PDA");
                }
                //添加列名
                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.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 异常反馈签到单 删除
        /// <summary>
        ///参数:string HInterID。
@@ -2773,6 +2969,64 @@
            }
        }
        #endregion
        #region 异常反馈处理单列表PDA
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackHandleBillList_PDA")]
        [HttpGet]
        public object Get_OA_ErrMsgBackHandleBillList_PDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackHandleBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    string sql = "select * from h_v_OA_ErrMsgBackHandleBillList_PDA order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillList_PDA");
                }
                else
                {
                    string sql1 = "select * from h_v_OA_ErrMsgBackHandleBillList_PDA where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillList_PDA");
                }
                //添加列名
                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.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 异常反馈处理单 删除
@@ -3629,6 +3883,64 @@
        }
        #endregion
        #region 异常反馈验收单列表PDA
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackCheckBillList_PDA")]
        [HttpGet]
        public object Get_OA_ErrMsgBackCheckBillList_PDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackCheckBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    string sql = "select * from h_v_OA_ErrMsgBackCheckBillList_PDA order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillList_PDA");
                }
                else
                {
                    string sql1 = "select * from h_v_OA_ErrMsgBackCheckBillList_PDA where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillList_PDA");
                }
                //添加列名
                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.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 异常反馈验收单 删除
        [Route("Sc_MESTransFerWorkBill/DeleteOA_ErrMsgBackCheckBill")]
WebAPI/DLL/ClsOA_ErrMsgBackBill.cs
@@ -127,7 +127,7 @@
            try
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
@@ -137,7 +137,7 @@
                ",HContext,HDeptID,HDescription,HSendMan,HReceiveMan" +
                ",HCopyMan,HHasten,HLevel,HReTransmitMan,HBillTypeName"+
                ",HPlanBillNo,HMaterName,HMaterModel,HQty,HSendType"+
                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRecDeptID,HMaterNumber" +
                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRecDeptID,HMaterNumber,HErrMsgBackTypeID" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
@@ -145,7 +145,7 @@
                ",'" + omodel.HCopyMan + "'," + omodel.HHasten.ToString() + ",'" + omodel.HLevel + "','" + omodel.HReTransmitMan + "','" + omodel.HBillTypeName + "'" +
                ",'" + omodel.HPlanBillNo + "','" + omodel.HMaterName + "','" + omodel.HMaterModel + "'," + omodel.HQty.ToString() + ",'" + omodel.HSendType + "'" +
                ",'" + omodel.HMainSourceInterID + "','" + omodel.HMainSourceEntryID + "','" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'" +
                "," + omodel.HRecDeptID + ",'" + omodel.HMaterNumber + "'" +
                "," + omodel.HRecDeptID + ",'" + omodel.HMaterNumber + "'," + omodel.HErrMsgBackTypeID +
                ") ");
                //插入子表
                //foreach (Models.ClsOA_ErrMsgBackBillSub oSub in DetailColl)
WebAPI/Models/ClsOA_ErrMsgBackBillMain.cs
@@ -25,5 +25,7 @@
        public string HMaterNumber;//    varchar(100)    物料编码      
        public Int64 HRecDeptID;//     int      --接收部门
        public Int64 HErrMsgBackTypeID; //异常类型
    }
}