cwjbxqmz
2024-02-06 0a56001e1b8e9ae7d2f39c982912cd6d10c22032
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
7个文件已修改
592 ■■■■■ 已修改文件
DAL/销售管理/ClsXs_SeOutStockBackBillForLayUI.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/项目管理/ClsPM_WorkReportWeekBillMain.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/XSGL/Xs_SeOutStockBackBillController.cs 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/条码管理/WEBSController.cs 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/项目管理/工作任务/PM_WorkTaskBillController.cs 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/项目管理/工作周计划/PM_WorkTaskWeekBillController.cs 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/ÏúÊÛ¹ÜÀí/ClsXs_SeOutStockBackBillForLayUI.cs
@@ -131,8 +131,23 @@
            try
            {
                //得到mainid
                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Xs_SeOutStockBackBill_BeforeSaveCtrl  " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOutStockBackBill_BeforeSaveCtrl ");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //若MAINDI重复则重新获取
                if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID))
                {
@@ -174,7 +189,23 @@
                //
                //更新订单关联数量
                //AddNewRelation(ref sReturn, omodel.HInterID);
                //
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Xs_SeOutStockBackBill_AfterSaveCtr " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Xs_SeOutStockBackBill_AfterSaveCtr");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
DAL/ÏîÄ¿¹ÜÀí/ClsPM_WorkReportWeekBillMain.cs
@@ -43,19 +43,20 @@
                    " HBillNo = '" + omodel.HBillNo +
                    "', HDate = '" + omodel.HDate +
                    "', HYear = " + omodel.HYear +
                    ", HPeriod = " + omodel.HPeriod +
                    ", HWeek  = " + omodel.HWeek +
                    ", HRemark = '" + omodel.HRemark +
                    "', HUpDater = '" + omodel.HUpDater +
                    "', HUpDateDate = getdate()" +
                    //===============================================================
                    ", HOrgID = " + omodel.HOrgID +
                    ", HYear = " + omodel.HYear +
                    ", HWeek = " + omodel.HWeek +
                    ", HBeginDate = '" + omodel.HBeginDate +
                    ", HWorkReport  = '" + omodel.HWorkReport +
                    "', HNextPlan   = '" + omodel.HNextPlan +
                    "', HWorkGain   = '" + omodel.HWorkGain +
                    "', HBeginDate = '" + omodel.HBeginDate +
                    "', HEndDate = '" + omodel.HEndDate +
                    "', HPlanEmpID = " + omodel.HReportEmpID +
                    "', HReportEmpID  = " + omodel.HReportEmpID +
                    " where HInterID = " + omodel.HInterID;
                oCn.RunProc(mainSql);
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
WebAPI/Controllers/XSGL/Xs_SeOutStockBackBillController.cs
@@ -480,7 +480,29 @@
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    //审核前控制
                    DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBackBill_BeforeCheckCtrl  " + HInterID.ToString() + ",'" + user + "'", "h_p_Xs_SeOutStockBackBill_BeforeCheckCtrl");
                    if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "审核失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (!BillOld.CheckBill(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBackBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -491,7 +513,30 @@
                }
                else
                {
                    if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    //反审核前控制
                    DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBackBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Xs_SeOutStockBackBill_BeforeUnCheckCtrl");
                    if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反审核失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (BillOld.AbandonCheck(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBackBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                        //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl");
WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs
@@ -265,31 +265,33 @@
                ds = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList where hmainid=" + HInterID + " and å•据号='" + HBillNo + "'", "h_v_IF_SeOutStockBillList");
                //保存前控制=========================================
                string HBillNote = "";
                 ds = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOutStockBill_BeforeSaveCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存失败!原因:保存前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //=========================================================
                if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//新增
                {
                    //保存前控制=========================================
                    string HBillNote = "";
                    ds = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOutStockBill_BeforeSaveCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:保存前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //=========================================================
                    //主表
                    string sql = $@"Insert Into Xs_SeOutStockBillMain   
                        (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus
@@ -887,7 +889,28 @@
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    //审核前控制
                    DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeCheckCtrl  " + HInterID.ToString() + ",'" + user + "'", "h_p_Xs_SeOutStockBill_BeforeCheckCtrl");
                    if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "审核失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (!BillOld.CheckBill(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -898,7 +921,29 @@
                }
                else
                {
                    if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    //反审核前控制
                    DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Xs_SeOutStockBill_BeforeUnCheckCtrl");
                    if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反审核失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (BillOld.AbandonCheck(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                        //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl");
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -1371,6 +1371,175 @@
        #region é‡‡è´­å…¥åº“    ä¸Šä¼ ç”Ÿå•
        #region é‡‡è´­å…¥åº“    æ–°å¢žæ¨¡å¼
        /// <summary>
        /// é‡‡è´­å…¥åº“新增上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SavePOStockInBill_Json")]
        [HttpPost]
        public object set_SavePOStockInBill_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_POStockInBillMain> lsmain = new List<Model.ClsKf_POStockInBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getPOStockInBillMainByJson(msg1);
                WebS.ClsKf_POStockInBillMain websLsmain = new WebS.ClsKf_POStockInBillMain();
                string sSourceType = lsmain[0].HMainSourceBillType;
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = lsmain[0].HBillType;
                websLsmain.HDate = lsmain[0].HDate;
                websLsmain.HDeptID = lsmain[0].HDeptID;
                websLsmain.HWHID = lsmain[0].HWHID;
                websLsmain.HSCWHID = lsmain[0].HSCWHID;
                websLsmain.HSupID = lsmain[0].HSupID;
                websLsmain.HKeeperID = lsmain[0].HKeeperID;
                websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
                websLsmain.HEmpID = lsmain[0].HEmpID;
                websLsmain.HManagerID = lsmain[0].HManagerID;
                websLsmain.HRemark = lsmain[0].HRemark;
                websLsmain.HExplanation = lsmain[0].HExplanation;
                websLsmain.HInnerBillNo = lsmain[0].HInnerBillNo;
                websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag;
                websLsmain.HBillSubType = lsmain[0].HBillSubType;
                if (lsmain[0].HMainSourceBillType == "1102")
                {
                    websLsmain.HMainSourceBillType = "采购订单";
                }
                else if (lsmain[0].HMainSourceBillType == "1103")
                {
                    websLsmain.HMainSourceBillType = "收料通知单";
                }
                else
                {
                    websLsmain.HMainSourceBillType = "手工录入";
                }
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HBillerID = lsmain[0].HBillerID;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SavePOStockInBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "采购入库单上传失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region å§”外入库    ä¸Šä¼ ç”Ÿå•
        #region å§”外入库    æ–°å¢žæ¨¡å¼
        /// <summary>
        /// å§”外入库新增上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveEntrustInBill_Json")]
        [HttpPost]
        public object set_SaveEntrustInBill_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_EntrustInBillMain> lsmain = new List<Model.ClsKf_EntrustInBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getEntrustInBillMainByJson(msg1);
                WebS.ClsKf_EntrustInBillMain websLsmain = new WebS.ClsKf_EntrustInBillMain();
                string sSourceType = lsmain[0].HMainSourceBillType;
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = lsmain[0].HBillType;
                websLsmain.HDate = lsmain[0].HDate;
                websLsmain.HDeptID = lsmain[0].HDeptID;
                websLsmain.HWHID = lsmain[0].HWHID;
                websLsmain.HSCWHID = lsmain[0].HSCWHID;
                websLsmain.HSupID = lsmain[0].HSupID;
                websLsmain.HKeeperID = lsmain[0].HKeeperID;
                websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
                websLsmain.HEmpID = lsmain[0].HEmpID;
                websLsmain.HMangerID = lsmain[0].HMangerID;
                websLsmain.HRemark = lsmain[0].HRemark;
                websLsmain.HExplanation = lsmain[0].HExplanation;
                websLsmain.HInnerBillNo = lsmain[0].HInnerBillNo;
                websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag;
                websLsmain.HBillSubType = lsmain[0].HBillSubType;
                if (lsmain[0].HMainSourceBillType == "1601")
                {
                    websLsmain.HMainSourceBillType = "委外订单";
                }
                else if (lsmain[0].HMainSourceBillType == "1103")
                {
                    websLsmain.HMainSourceBillType = "收料通知单";
                }
                else
                {
                    websLsmain.HMainSourceBillType = "手工录入";
                }
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HBillerID = lsmain[0].HBillerID;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveEntrustInBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "委外入库单上传失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/¹¤×÷ÈÎÎñ/PM_WorkTaskBillController.cs
@@ -65,7 +65,6 @@
            public string HMainSourceBillNo;
            public string HMainSourceBillType;
            public int HOrderLevID;
            public int HHasten;
        }
        #endregion
@@ -184,7 +183,7 @@
                string HMainSourceBillNo = mainList[0].HMainSourceBillNo;
                string HMainSourceBillType = mainList[0].HMainSourceBillType;
                int HOrderLevID = mainList[0].HOrderLevID;
                int HHasten = mainList[0].HHasten;
                if (OperationType == 2)
@@ -206,7 +205,7 @@
                {
                    string sql = "insert into PM_WorkTaskBillMain" +
                        "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" +
                        ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID,HHasten)" +
                        ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID)" +
                        "values(" +
                        "" + HYear +
                        "," + HPeriod +
@@ -227,7 +226,7 @@
                        "','" + HReceiveEmp +
                        "','" + HType +
                        "','" + HCopyEmp +
                        "','" + HRemark +
                        "','" + HRemark +
                        "'," + HOrgID +
                        ",'" + HMaker +
                        "','" + HMakerDate +
@@ -235,8 +234,7 @@
                        "," + HMainSourceEntryID +
                        ",'" + HMainSourceBillNo +
                        "','" + HMainSourceBillType +
                        "','" + HOrderLevID +
                        "','" + HHasten +
                        "','" + HOrderLevID  +
                        "')";
                    //主表
@@ -273,8 +271,7 @@
                        ",HMainSourceEntryID = " + HMainSourceEntryID +
                        ",HMainSourceBillNo = '" + HMainSourceBillNo +
                        "',HMainSourceBillType = '" + HMainSourceBillType +
                        "',HOrderLevID  = '" + HOrderLevID +
                        "',HHasten  = '" + HHasten +
                        "',HOrderLevID  = '" + HOrderLevID  +
                        "' where HInterID = " + HInterID;
                    oCN.RunProc(sql);
@@ -288,7 +285,7 @@
                {
                    string sql = "insert into PM_WorkTaskBillMain" +
                        "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" +
                        ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID,HHasten )" +
                        ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID )" +
                        "values(" +
                        "" + HYear +
                        "," + HPeriod +
@@ -318,7 +315,6 @@
                        ",'" + HMainSourceBillNo +
                        "','" + HMainSourceBillType +
                        "','" + HOrderLevID +
                        "','" + HHasten +
                        "')";
                    //主表
                    oCN.RunProc(sql);
@@ -1170,6 +1166,64 @@
        }
        #endregion
        #region å·¥ä½œä»»åŠ¡  å‚¬ä¿ƒæ¬¡æ•°åŠŸèƒ½
        [Route("PM_WorkTaskBill/UpdateHHasten")]
        [HttpGet]
        public object UpdateHHasten(string HInterID, int HHasten, string user)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "PM_WorkTaskBillMain";
                oCN.BeginTran();//开始事务
                DataSet ds;
                string sql = "select * from PM_WorkTaskBillMain  where HinterID = " + HInterID;
                ds = oCN.RunProcReturn(sql, "PM_WorkTaskBillMain");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                {
                    string sql1 = "update PM_WorkTaskBillMain  set   HHasten='"+ HHasten+ "' where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain");
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "执行失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ä»»åŠ¡æ±‡æŠ¥ æ–°å¢ž/编辑-保存
        #region ä»»åŠ¡æ±‡æŠ¥ è¡¨å¤´æ•°æ®
        public class PM_WorkTaskReportBill_Main
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/¹¤×÷Öܼƻ®/PM_WorkTaskWeekBillController.cs
@@ -883,6 +883,105 @@
        }
        #endregion
        #region å·¥ä½œå‘¨æ€»ç»“ èŽ·å–åˆ—è¡¨æ•°æ®
        [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillList")]
        [HttpGet]
        public object PM_WorkReportWeekBillList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCn.RunProcReturn("select * from h_v_PM_WorkReportWeekBillMainList order by å•据号 desc", "h_v_PM_WorkReportWeekBillMainList");
                }
                else
                {
                    string sql1 = "select * from h_v_PM_WorkReportWeekBillMainList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCn.RunProcReturn(sql, "h_v_PM_WorkReportWeekBillMainList");
                }
                //添加列名
                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列对象的列名
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未获取到周总结相关数据!";
                    objJsonResult.data = null;
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "查询成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
        #region å·¥ä½œå‘¨æ€»ç»“ èŽ·å–ç¼–è¾‘åˆ—è¡¨æ•°æ®
        [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainEditList")]
        [HttpGet]
        public object PM_WorkReportWeekBillMainEditList(string HInterID)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCn.RunProcReturn("select * from h_v_PM_WorkReportWeekBillMainList where HInterID='" + HInterID + "'", "h_v_PM_WorkReportWeekBillMainList");
                //添加列名
                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列对象的列名
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未获取到周总结相关数据!";
                    objJsonResult.data = null;
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "查询成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
        #region å·¥ä½œå‘¨æ€»ç»“ é€‰æ‹©æ€»ç»“人带出工时
        [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainList")]
        [HttpGet]
@@ -944,7 +1043,7 @@
        #region å·¥ä½œå‘¨æ€»ç»“保存/编辑
        /// <summary>
        /// ä¿å­˜ç”Ÿäº§é¢†æ–™å•
        /// ä¿å­˜å·¥ä½œå‘¨æ€»ç»“
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
@@ -1033,7 +1132,7 @@
                    oItem.HBillType = "4757";
                    oItem.HBillSubType = "4757";
                    //oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
@@ -1270,5 +1369,59 @@
            }
        }
        #endregion
        #region å·¥ä½œå‘¨æ€»ç»“ åˆ é™¤
        /// <summary>
        ///参数:string HInterID。
        ///返回值:object。
        /// </summary>
        [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainDelete")]
        [HttpGet]
        public object PM_WorkReportWeekBillMainDelete(string HInterID, string user)
        {
            try
            {
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("PM_WorkReportWeekBillMain_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_WorkReportWeekBillMain where HInterID = " + HInterID);
                //oCn.RunProc("delete from PM_WorkTaskWeekBillSub 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
    }
}