zrg
2024-02-04 94c1fd6b7540d574d19234f21c10d6517d9a6423
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/¹¤×÷ÈÎÎñ/PM_WorkTaskBillController.cs
@@ -65,7 +65,6 @@
            public string HMainSourceBillNo;
            public string HMainSourceBillType;
            public int HOrderLevID;
            public int HHasten;
        }
        #endregion
@@ -183,8 +182,8 @@
                int HMainSourceEntryID = mainList[0].HMainSourceEntryID;
                string HMainSourceBillNo = mainList[0].HMainSourceBillNo;
                string HMainSourceBillType = mainList[0].HMainSourceBillType;
                int HOrderLevID = mainList[0].HOrderLevID == null ? 0 : mainList[0].HOrderLevID;
                int HHasten = mainList[0].HHasten == null ? 0 : mainList[0].HHasten;
                int HOrderLevID = mainList[0].HOrderLevID;
                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 +
@@ -236,7 +235,6 @@
                        ",'" + HMainSourceBillNo +
                        "','" + HMainSourceBillType +
                        "','" + HOrderLevID  +
                        "','" +  HHasten  +
                        "')";
                    //主表
@@ -274,7 +272,6 @@
                        ",HMainSourceBillNo = '" + HMainSourceBillNo +
                        "',HMainSourceBillType = '" + HMainSourceBillType +
                        "',HOrderLevID  = '" + HOrderLevID  +
                        "',HHasten  = '" + HHasten +
                        "' 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