月度阶段计划与工作周总结,编辑回显,审核反审核,关闭,反关闭,查询数据
2个文件已修改
294 ■■■■ 已修改文件
DAL/ClsPM_WorkPlanMonthBillMain.cs 129 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/项目管理/工程项目/PM_ProjectBillController.cs 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/ClsPM_WorkPlanMonthBillMain.cs
@@ -33,75 +33,70 @@
        #endregion
        //#region ä¿®æ”¹å•据
        //public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        //{
        //    try
        //    {
        //        oCn.BeginTran();
        //        //更新主表
        //        string mainSql = "update PM_WorkPlanMonthBillMain set " +
        //            " HBillNo = '" + omodel.HBillNo +
        //            "', HDate = '" + omodel.HDate +
        //            "', HYear = " + omodel.HYear +
        //            ", HPeriod = " + omodel.HPeriod +
        //            ", HRemark = '" + omodel.HRemark +
        //            "', HUpDater = '" + omodel.HUpDater +
        //            "', HUpDateDate = getdate()" +
        //            //===============================================================
        //            ", HOrgID = " + omodel.HOrgID +
        //            ", HYear = " + omodel.HYear +
        //            ", HWeek = " + omodel.HWeek +
        //            ", HBeginDate = '" + omodel.HBeginDate +
        //            "', HEndDate = '" + omodel.HEndDate +
        //            "', HPlanEmpID = " + omodel.HReportEmpID +
        //            " where HInterID = " + omodel.HInterID;
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                oCn.BeginTran();
                //更新主表
                string mainSql = "update PM_WorkPlanMonthBillMain set " +
                    " HBillNo = '" + omodel.HBillNo +
                    "', HDate = '" + omodel.HDate +
                    "', HYear = " + omodel.HYear +
                    ", HMonth = " + omodel.HMonth +
                    ", HRemark = '" + omodel.HRemark +
                    "', HUpDater = '" + omodel.HUpDater +
                    "', HUpDateDate = getdate()" +
                    //===============================================================
                    ", HBeginDate = '" + omodel.HBeginDate +
                    "', HEndDate = '" + omodel.HEndDate +
                    "', HPlanEmpID = " + omodel.HPlanEmpID +
                    " where HInterID = " + omodel.HInterID;
        //        //删除关联
        //        DeleteRelation(ref sReturn, lngBillKey);
        //        //删除子表
        //        DeleteBillSub(lngBillKey);
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
        //        ////插入子表
        //        //omodel.HInterID = lngBillKey;
        //        //foreach (Model.ClsPM_WorkTaskWeekBillSub oSub in DetailColl)
        //        //{
        //        //    string subSql = "insert into PM_WorkTaskWeekBillSub" +
        //        //       "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
        //        //       ",HWeekDay,HSno,HProjectID,HProjectStageID,HTaskNote,HPlanTimes) " +
        //        //       " values(" +
        //        //       "" + omodel.HInterID.ToString() +
        //        //       "," + oSub.HEntryID.ToString() +
        //        //       ",'" + oSub.HCloseMan +
        //        //       "','" + oSub.HEntryCloseDate +
        //        //       "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) +
        //        //       ",'" + oSub.HRemark +
        //        //       "'," + oSub.HSourceInterID +
        //        //       "," + oSub.HSourceEntryID +
        //        //       ",'" + oSub.HSourceBillNo +
        //        //       "','" + oSub.HSourceBillType +
        //        //       "'," + oSub.HRelationQty +
        //        //       "," + oSub.HRelationMoney +
        //        //       "," + oSub.HWeekDay +
        //        //       "," + oSub.HSno +
        //        //       "," + oSub.HProjectID +
        //        //       "," + oSub.HProjectStageID +
        //        //       ",'" + oSub.HTaskNote +
        //        //       "'," + oSub.HPlanTimes +
        //        //       ")";
        //        //    oCn.RunProc(subSql);
        //        //}
        //        sReturn = "修改单据成功!";
        //        oCn.Commit();
        //        return true;
        //    }
        //    catch (Exception e)
        //    {
        //        sReturn = e.Message;
        //        oCn.RollBack();
        //        throw (e);
        //    }
        //}
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsPM_WorkPlanMonthBillSub oSub in DetailColl)
                {
                    string subSql = "insert into PM_WorkPlanMonthBillSub" +
                         "" +
                         "" +
                         "" +
                         "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                         ",HProNumber,HProjectStageID,HRate,HAvgMoney,HCountMoney) " +
                         " values(" +
                         "" + omodel.HInterID.ToString() +
                         "," + oSub.HEntryID.ToString() +
                         "," + oSub.HSourceInterID +
                         "," + oSub.HSourceEntryID +
                         ",'" + oSub.HSourceBillNo +
                         "','" + oSub.HSourceBillType +
                         "','" + oSub.HProNumber +
                         "'," + oSub.HProjectStageID +
                         "," + oSub.HRate +
                         ",'" + oSub.HAvgMoney +
                         "','" + oSub.HCountMoney +
                         "')";
                    oCn.RunProc(subSql);
                }
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //#endregion
        #region  æ–°å¢žå•据
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/¹¤³ÌÏîÄ¿/PM_ProjectBillController.cs
@@ -1610,5 +1610,170 @@
        }
        #endregion
        #region æœˆåº¦é˜¶æ®µè®¡åˆ’列表 æŸ¥è¯¢
        /// <summary>
        /// è¿”回项目阶段列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("PM_ProjectBill/getPM_WorkPlanMonthBillMainLists")]
        [HttpGet]
        public object getPM_WorkPlanMonthBillMainLists(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_PM_WorkPlanMonthBillMainList order by å•据号 desc", "h_v_PM_WorkPlanMonthBillMainList");
                }
                else
                {
                    string sql1 = "select * from h_v_PM_WorkPlanMonthBillMainList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_PM_WorkPlanMonthBillMainList");
                }
                //添加列名
                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 e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æœˆåº¦é˜¶æ®µè®¡åˆ’列表 åˆ é™¤
        /// <summary>
        ///参数:string HInterID。
        ///返回值:object。
        /// </summary>
        [Route("PM_ProjectBill/PM_WorkPlanMonthBillMainDelete")]
        [HttpGet]
        public object PM_WorkReportWeekBillMainDelete(string HInterID, string user)
        {
            try
            {
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID == null || HInterID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                oCN.RunProc("delete from PM_WorkPlanMonthBillMain  where HInterID = " + HInterID);
                oCN.RunProc("delete from PM_WorkPlanMonthBillSub  where HInterID='" + HInterID + "'");
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æœˆåº¦é˜¶æ®µè®¡åˆ’列表 èŽ·å–ç¼–è¾‘åˆ—è¡¨æ•°æ®
        [Route("PM_ProjectBill/PM_WorkPlanMonthBillMainEditList")]
        [HttpGet]
        public object PM_WorkPlanMonthBillMainEditList(string HInterID,string User)
        {
            try
            {
                List<DataTable> tableList = new List<DataTable>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_Edit", 1, false, User))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID == null || HInterID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("exec h_p_PM_WorkPlanMonthBillMain_EditInit  " + HInterID, "h_p_PM_WorkPlanMonthBillMain_EditInit");
                tableList.Add(ds.Tables[0]);
                tableList.Add(ds.Tables[1]);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = tableList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}