DAL/DAL.csproj
@@ -664,6 +664,7 @@ <Compile Include="è´¨æ£ç®¡ç\ClsQC_ProcessCheckBill.cs" /> <Compile Include="è´¨æ£ç®¡ç\ClsQC_ProdReportCheckBill.cs" /> <Compile Include="è´¨æ£ç®¡ç\ClsCrm_CustomerAppealBill.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_WorkBeginDotCheckBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_ProcExchRecordBackBill.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_ProcExchSendWorkBill.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_ProcExchWorkBackBill.cs" /> DAL/³µ¼ä¹ÜÀí/ClsSc_WorkBeginDotCheckBillMain.cs
New file @@ -0,0 +1,270 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsSc_WorkBeginDotCheckBillMain : DBUtility.ClsXt_BaseBill { public Model.ClsSc_WorkBeginDotCheckBillMain omodel = new Model.ClsSc_WorkBeginDotCheckBillMain(); public List<Model.ClsSc_WorkBeginDotCheckBillSub> DetailColl = new List<Model.ClsSc_WorkBeginDotCheckBillSub>(); public ClsSc_WorkBeginDotCheckBillMain() { base.MvarItemKeySub = "Sc_WorkBeginDotCheckBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey= "Sc_WorkBeginDotCheckBillMain"; base.MvarReportTitle="å¯å¨ç¹æ£å"; base.BillType = "3744"; base.HBillSubType = "3744"; } #region åºå®ä»£ç ~ClsSc_WorkBeginDotCheckBillMain() { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { oCn.BeginTran(); //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sc_WorkBeginDotCheckBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + ",HYear='" + omodel.HYear.ToString() + "'" + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + ",HRemark='" + omodel.HRemark + "'" + ",HUpDater='" + omodel.HMaker + "'" + ",HUpDateDate=getdate()" + //======================================== ",HICMOInterID =" + omodel.HICMOInterID.ToString() + ",HICMOEntryID ='" + omodel.HICMOEntryID.ToString() + "'" + ",HICMOBillNo ='" + omodel.HICMOBillNo+ "'" + ",HProcExchInterID =" + omodel.HProcExchInterID.ToString() + ",HProcExchEntryID ='" + omodel.HProcExchEntryID.ToString() + "'" + ",HProcExchBillNo ='" + omodel.HProcExchBillNo + "'" + ",HMaterID =" + omodel.HMaterID.ToString() + ",HSourceID ='" + omodel.HSourceID.ToString() + "'" + ",HCheckEmpID ='" + omodel.HCheckEmpID.ToString() + "'" + ",HGroupID =" + omodel.HGroupID.ToString() + ",HGroupLeaderID ='" + omodel.HGroupLeaderID.ToString() + "'" + ",HNote ='" + omodel.HNote + "'" + ",HLastResult ='" + omodel.HLastResult + "'" + " where HInterID=" + lngBillKey.ToString()); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 DeleteBillSub(lngBillKey); //æå ¥å表 omodel.HInterID = lngBillKey; foreach (Model.ClsSc_WorkBeginDotCheckBillSub oSub in DetailColl) { string subSql = "insert into Sc_WorkBeginDotCheckBillSub " + "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRemark" + ",HCheckNoteItemID,HCheckPostID,HCheckResult) " + " values(" + "" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HSourceInterID + "," + oSub.HSourceEntryID + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "','" + oSub.HRemark + "','" + oSub.HCheckNoteItemID + "','" + oSub.HCheckPostID + "','" + oSub.HCheckResult + "')"; oCn.RunProc(subSql); } sReturn = "ä¿®æ¹åæ®æåï¼"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw (e); } } //æ°å¢åæ® public override bool AddBill(ref string sReturn) { try { DataSet ds; oCn.BeginTran(); //æ£æ¥ä¸»è¡¨å ç æ¯å¦éå¤ï¼è¥éå¤åéæ°çæå¹¶ç»§ç»æ£æ¥ï¼ç´å°ä¸åéå¤ while (true) { ds = oCn.RunProcReturn("select * from Sc_WorkBeginDotCheckBillMain where HInterID = " + omodel.HInterID, "Sc_WorkBeginDotCheckBillMain"); if (ds != null && ds.Tables[0].Rows.Count > 0) { omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); } else { break; } } //主表 string mainSql = "insert into Sc_WorkBeginDotCheckBillMain" + "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HRemark,HMaker,HMakeDate" + ",HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HMaterID,HSourceID,HCheckEmpID,HGroupID,HGroupLeaderID,HNote,HLastResult) " + "values(" + "" + (omodel.HYear.ToString() != "0" ? omodel.HYear.ToString() : DateTime.Now.Year.ToString()) + "," + omodel.HPeriod.ToString() + ",'" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID + ",'" + omodel.HDate + "','" + omodel.HBillNo + "','" + omodel.HRemark + "','" + omodel.HMaker + "','" + omodel.HMakeDate + "','" + omodel.HICMOInterID + "','" + omodel.HICMOEntryID + "','" + omodel.HICMOBillNo + "','" + omodel.HProcExchInterID + "','" + omodel.HProcExchEntryID + "','" + omodel.HProcExchBillNo + "','" + omodel.HMaterID + "','" + omodel.HSourceID + "','" + omodel.HCheckEmpID + "','" + omodel.HGroupID + "','" + omodel.HGroupLeaderID + "','" + omodel.HNote + "','" + omodel.HLastResult + "')"; oCn.RunProc(mainSql); //æå ¥å表 foreach (Model.ClsSc_WorkBeginDotCheckBillSub oSub in DetailColl) { string subSql = "insert into Sc_WorkBeginDotCheckBillSub " + "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRemark" + ",HCheckNoteItemID,HCheckPostID,HCheckResult) " + " values(" + "" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HSourceInterID + "," + oSub.HSourceEntryID + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "','" + oSub.HRemark + "','" + oSub.HCheckNoteItemID + "','" + oSub.HCheckPostID + "','" + oSub.HCheckResult + "')"; oCn.RunProc(subSql); } sReturn = "æ°å¢åæ®æåï¼"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw (e); } } //æ¾ç¤ºåæ® public override bool ShowBill(Int64 lngBillKey, ref string sReturn) { try { //æ¥è¯¢ä¸»è¡¨ DataSet Ds ; Ds = oCn.RunProcReturn("Select * from Sc_WorkBeginDotCheckBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_WorkBeginDotCheckBillMain"); if(Ds.Tables[0].Rows.Count==0) { sReturn = "åæ®æªæ¾å°ï¼"; return false; } //åºå®èµå¼=========================================== omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); //======================================================== // //å¾ªç¯ DataSet DsSub ; DsSub = oCn.RunProcReturn("Select * from Sc_WorkBeginDotCheckBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_WorkBeginDotCheckBillSub"); DetailColl.Clear();//æ¸ ç©º for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Model.ClsSc_WorkBeginDotCheckBillSub oSub = new Model.ClsSc_WorkBeginDotCheckBillSub(); // åºå®èµå¼=============================================== oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); //=================================================== DetailColl.Add(oSub); } sReturn = "æ¾ç¤ºåæ®æåï¼"; return true; } catch (Exception e) { sReturn = e.Message; throw (e); } } } } Model/Model.csproj
@@ -364,6 +364,7 @@ <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_DotCheckItemMethod_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_DotCheckItemClass_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_ErrMsgBackType_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CheckNoteItem_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_MaintainLev_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_PreventErrMould_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_TaskClass_Model.cs" /> @@ -666,6 +667,8 @@ <Compile Include="è´¨æ£ç®¡ç\ClsQC_ProcessCheckBillSub_ValueGrid.cs" /> <Compile Include="è´¨æ£ç®¡ç\ClsCrm_CustomerAppealBillSub.cs" /> <Compile Include="è´¨æ£ç®¡ç\ClsCrm_CustomerAppealBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_WorkBeginDotCheckBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_WorkBeginDotCheckBillSub.cs" /> <Compile Include="车é´ç®¡ç\Sc_AssemblyBill_BindSourceTemp.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_ProcExchRecordBackBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_ProcExchRecordBackBillSub.cs" /> Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_CheckNoteItem_Model.cs
New file @@ -0,0 +1,11 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_CheckNoteItem_Model : DBUtility.ClsGy_Base_Model { public Int64 HCheckPostID; //int --确认è è§è²ï¼gy_Postï¼ } } Model/³µ¼ä¹ÜÀí/ClsSc_WorkBeginDotCheckBillMain.cs
New file @@ -0,0 +1,23 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsSc_WorkBeginDotCheckBillMain : DBUtility.ClsXt_BaseBillMain { public Int64 HICMOInterID; //int --ç产订å主å ç ï¼å ç 䏿¾ç¤ºåºæ¥ï¼éèï¼ public Int64 HICMOEntryID; // int --ç产订ååå ç ï¼å ç 䏿¾ç¤ºåºæ¥ï¼éèï¼ public string HICMOBillNo; // varchar(100) --ç产订å public Int64 HProcExchInterID; //int -æµè½¬å¡ä¸»å ç ï¼å ç 䏿¾ç¤ºåºæ¥ï¼éèï¼ public Int64 HProcExchEntryID; // int --æµè½¬å¡åå ç ï¼å ç 䏿¾ç¤ºåºæ¥ï¼éèï¼ public string HProcExchBillNo; //varchar(100) --æµè½¬å¡ public Int64 HMaterID; //int ---ç©æï¼gy_Materialï¼ public Int64 HSourceID; // int --çäº§èµæºï¼gy_Sourceï¼ public Int64 HCheckEmpID; // int --ç¹æ£ä½ä¸åï¼gy_Employeeï¼ public Int64 HGroupID; // int ç产çç»ï¼gy_Groupï¼ public Int64 HGroupLeaderID; //int --çç»é¿ï¼gy_Employeeï¼ public string HNote; // varchar(500) --è®°å½äºé¡¹ public string HLastResult; //varchar(20) --æç»ç»è®ºï¼OKï¼NGï¼ } } Model/³µ¼ä¹ÜÀí/ClsSc_WorkBeginDotCheckBillSub.cs
New file @@ -0,0 +1,14 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsSc_WorkBeginDotCheckBillSub : DBUtility.ClsXt_BaseBillSub { public Int64 HCheckNoteItemID; // int --æ£æ¥é¡¹ç® (Gy_CheckNoteItem) public Int64 HCheckPostID; //int --确认è è§è²ï¼gy_Postï¼ public string HCheckResult; // varchar(20) --ç»æï¼OKï¼Xï¼ } } WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
@@ -6566,5 +6566,247 @@ } } #endregion #region å¯å¨æ£æ¥é¡¹ç® æ¥è¯¢,å®¡æ ¸ï¼åå®¡æ ¸ï¼ç¦ç¨ï¼åç¦ç¨ /// <summary> /// å¯å¨æ£æ¥é¡¹ç® æ¥è¯¢ /// </summary> /// <param name="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_CheckNoteItemList")] [HttpGet] public object Gy_CheckNoteItemList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_CheckNoteItem_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_CheckNoteItem where 1 = 1"; string sql = sql1 + sWhere + " order by å¯å¨æ£æ¥é¡¹ç®ä»£ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_CheckNoteItem"); //æ·»å åå 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; } } /// <summary> /// å¯å¨æ£æ¥é¡¹ç® å®¡æ ¸ãåå®¡æ ¸ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_BadReason/AuditGy_CheckNoteItem")] [HttpGet] public object AuditGy_CheckNoteItem(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_CheckNoteItem_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_CheckNoteItem where HItemID=" + HInterID, "Gy_CheckNoteItem"); if (ds.Tables[0].Rows.Count > 0) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); if (IsAudit == 0) //å®¡æ ¸å¤æ { oCN.RunProc("update Gy_CheckNoteItem set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_CheckNoteItem set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸æå"; objJsonResult.data = null; } oCN.Commit(); return objJsonResult; } catch (Exception e) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// <summary> /// å¯å¨æ£æ¥é¡¹ç® ç¦ç¨ãåç¦ç¨ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsStop">ç¦ç¨(0),åç¦ç¨(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_BadReason/StopGy_CheckNoteItem")] [HttpGet] public object StopGy_CheckNoteItem(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_CheckNoteItem_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_CheckNoteItem where HItemID=" + HInterID, "Gy_SupType"); if (ds.Tables[0].Rows.Count > 0) { if (IsStop == 0) //ç¦ç¨å¤æ { if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsStop == 1) //åç¦ç¨å¤æ { if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªç¦ç¨!ä¸éè¦åç¦ç¨!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); if (IsStop == 0) //ç¦ç¨å¤æ { oCN.RunProc("update Gy_CheckNoteItem set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { oCN.RunProc("update Gy_CheckNoteItem set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åç¦ç¨æå"; objJsonResult.data = null; } oCN.Commit(); return objJsonResult; } catch (Exception e) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥æè åç¦ç¨å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } } WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -685,6 +685,21 @@ //ååå·¥åºåºç«åçåæ ¼æ°é oCN.RunProc("update Sc_StationOutBillMain set HQty+=1 where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID+ " and HInterID=" + HInterID); ds = oCN.RunProcReturn($@"select (b.HQty -sum(isnull(ou.HQty,0))-sum(isnull(ou.HBadCount,0))) HQty from Sc_ProcessExchangeBillSub b WITH(NOLOCK) left join Sc_StationOutBillMain ou WITH(NOLOCK) on b.HInterID=ou.HProcExchInterID and b.HEntryID=ou.HProcExchEntryID where b.HInterID={HProcExchInterID} and b.HEntryID={HProcExchEntryID} group by b.HInterID,b.HEntryID,b.HQty", "Sc_ProcessExchangeBill_Out"); if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åºç«æ°éè¶ è¿æµè½¬å¡æ°é!"; objJsonResult.data = null; return objJsonResult; } oCN.Commit(); objJsonResult.code = "1"; @@ -1502,9 +1517,28 @@ // } oCN.RunProc("update Gy_BarCodeBill set HStatus='' where HBarCode='" + model.HBarCode + "'"); DataSet dataSet = oCN.RunProcReturn($"select top 1 HInterID from Sc_StationOutBillMain where HProcExchInterID={subLsit[0].HProcExchInterID} and HProcExchEntryID={subLsit[0].HProcExchEntryID} and HBadCount>0", "Sc_StationOutBillMain"); if (dataSet.Tables[0].Rows.Count > 0) { string HOutInterID = dataSet.Tables[0].Rows[0][0].ToString(); oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1 where HInterID='" + HOutInterID + "'"); } else { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败,å½åæµè½¬å¡å½åå·¥åºçåºç«å没æä¸è¯æ°é!"; objJsonResult.data = null; return objJsonResult; } } } else { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败,æ ç»æï¼"; WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs
New file @@ -0,0 +1,763 @@ using DBUtility; using Model; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.Http; using System.Windows.Forms; using WebAPI.Models; namespace WebAPI.Controllers.CJGL { public class Sc_WorkBeginDotCheckBillController : ApiController { public DBUtility.ClsPub.Enum_BillStatus BillStatus;//åæ®ç¶æï¼æ°å¢ï¼ä¿®æ¹ï¼æµè§ï¼æ´æ°åä»·ï¼åæ´ï¼ private json objJsonResult = new json(); public DataSet ds = new DataSet(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); public DAL.ClsSc_WorkBeginDotCheckBillMain OBill = new DAL.ClsSc_WorkBeginDotCheckBillMain(); public DAL.ClsSc_WorkBeginDotCheckBillMain BillOld = new DAL.ClsSc_WorkBeginDotCheckBillMain(); #region å¯å¨ç¹æ£å表 æ¥è¯¢ [Route("Sc_WorkBeginDotCheckBill/getSc_WorkBeginDotCheckBillMainList")] [HttpGet] public object getSc_WorkBeginDotCheckBillMainList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log_second("Sc_WorkBeginDotCheckBillMain_Check", 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_Sc_WorkBeginDotCheckBillMainList order by åæ®å· desc", "h_v_Sc_WorkBeginDotCheckBillMainList"); } else { string sql1 = "select * from h_v_Sc_WorkBeginDotCheckBillMainList where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_Sc_WorkBeginDotCheckBillMainList"); } //æ·»å åå 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 å¯å¨ç¹æ£å表 è·åç¼è¾åè¡¨æ°æ® [Route("Sc_WorkBeginDotCheckBill/Sc_WorkBeginDotCheckBillMainEditList")] [HttpGet] public object Sc_WorkBeginDotCheckBillMainEditList(string HInterID, string User) { try { List<DataTable> tableList = new List<DataTable>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Sc_WorkBeginDotCheckBillMain_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("select * from h_v_Sc_WorkBeginDotCheckBillMainList where HInterID = " + HInterID, " h_v_Sc_WorkBeginDotCheckBillMainList"); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "æ¥è¯¢æåï¼"; objJsonResult.data = ds.Tables[0]; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å¯å¨ç¹æ£å ä¿å/ç¼è¾ [Route("Sc_WorkBeginDotCheckBill/SaveSc_WorkBeginDotCheckBillMain")] [HttpPost] public object SaveSc_WorkBeginDotCheckBillMain([FromBody] JObject sMainSub) { var _value = sMainSub["sMainSub"].ToString(); string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); string refSav = sArray[2].ToString();//æä½æ¹å¼æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ string user = sArray[3].ToString();//ç¨æ·å string UserName = ""; string s = ""; ListModels oListModels = new ListModels(); try { //ä¿åæé if (!DBUtility.ClsPub.Security_Log_second("Sc_WorkBeginDotCheckBillMain_Edit", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsSc_WorkBeginDotCheckBillMain oBill = new DAL.ClsSc_WorkBeginDotCheckBillMain(); List<Model.ClsSc_WorkBeginDotCheckBillMain> lsmain = new List<Model.ClsSc_WorkBeginDotCheckBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Sc_WorkBeginDotCheckBillMain(msg2); foreach (Model.ClsSc_WorkBeginDotCheckBillMain oItem in lsmain) { if (refSav == "Add") { //忮巿¯å¦éå¤ if (OBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, OBill.omodel.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } } if (refSav == "Update") { if (OBill.ShowBill(oItem.HInterID, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; objJsonResult.data = 1; return objJsonResult; } //夿æ¯å¦å¯ç¼è¾ if (OBill.omodel.HChecker != "" && OBill.omodel.HChecker != null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (OBill.omodel.HBillStatus > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } } UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3744"; oItem.HBillSubType = "3744"; 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")); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } oBill.omodel = oItem; } // è¡¨ä½æ°æ® //æ },{æ¥æåæ°ç» //廿ãåã msg3 = msg3.Substring(1, msg3.Length - 2); msg3 = msg3.Replace("\\", ""); msg3 = msg3.Replace("\n", ""); //\n List<Model.ClsSc_WorkBeginDotCheckBillSub> ls = new List<Model.ClsSc_WorkBeginDotCheckBillSub>(); ls = oListModels.getObjectByJson_Sc_WorkBeginDotCheckBillSub(msg3); int i = 0; foreach (Model.ClsSc_WorkBeginDotCheckBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (refSav == "Add") { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else if (refSav == "Update") { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); } else { bResult = false; } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } #endregion #region å¯å¨ç¹æ£å å é¤ [Route("Sc_WorkBeginDotCheckBill/DeleteSc_WorkBeginDotCheckBill")] [HttpGet] public object DeleteSc_WorkBeginDotCheckBill(string HInterID, string user) { try { //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Sc_WorkBeginDotCheckBillMain_Delete", 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 Sc_WorkBeginDotCheckBillMain where HInterID = " + HInterID); oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; 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("Sc_WorkBeginDotCheckBill/AuditSc_WorkBeginDotCheckBill")] [HttpGet] public object AuditSc_WorkBeginDotCheckBill(string HInterID, int Type, string user) { try { //夿æ¯å¦æå®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log("Sc_WorkBeginDotCheckBillMain_Check", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "Sc_WorkBeginDotCheckBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ if (Type == 1) { //夿忮æ¯å¦å·²ç»å®¡æ ¸ DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); 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) { if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } //å®¡æ ¸åæ® if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åå®¡æ ¸ DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½è¿è¡åå®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡åå®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } //åå®¡æ ¸åæ® if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } 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 å¯å¨ç¹æ£å å ³é/åå ³éåè½ [Route("Sc_WorkBeginDotCheckBill/CloseSc_WorkBeginDotCheckBill")] [HttpGet] public object CloseSc_WorkBeginDotCheckBill(string HInterID, int Type, string user) { try { //夿æ¯å¦æå 餿é if (!DBUtility.ClsPub.Security_Log("Sc_WorkBeginDotCheckBillMain_Close", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå ³é!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "Sc_WorkBeginDotCheckBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å ³é 2 åå ³é if (Type == 1) { //夿忮æ¯å¦å·²ç»å ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); 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) { if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å ³é!"; objJsonResult.data = null; return objJsonResult; } //å ³éåæ® if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åå ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå ³é!ä¸éè¦ååå ³é!"; objJsonResult.data = null; return objJsonResult; } //åå ³éåæ® if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } 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 å¯å¨ç¹æ£å ä½åº/åä½åºåè½ [Route("Sc_WorkBeginDotCheckBill/DropSc_WorkBeginDotCheckBill")] [HttpGet] public object DropSc_WorkBeginDotCheckBill(string HInterID, int Type, string user) { try { //夿æ¯å¦æä½åºæé if (!DBUtility.ClsPub.Security_Log("Sc_WorkBeginDotCheckBillMain_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéä½åº!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "Sc_WorkBeginDotCheckBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 ä½åº 2 åä½åº if (Type == 1) { //夿忮æ¯å¦å·²ç»ä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); 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) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸éè¦åä½åº!"; objJsonResult.data = null; return objJsonResult; } //ä½åºåæ® if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦ååä½åº!"; objJsonResult.data = null; return objJsonResult; } //åä½åºåæ® if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } 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 } } WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
@@ -49,22 +49,12 @@ ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipFileMainList"); } //if (ds.Tables[0].Rows.Count != 0 || ds != null) //{ objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; return objJsonResult; //} //else //{ //objJsonResult.code = "0"; //objJsonResult.count = 0; //objJsonResult.Message = "æ æ°æ®"; //objJsonResult.data = null; //return objJsonResult; //} } catch (Exception e) { @@ -104,8 +94,18 @@ return objJsonResult; } DLL.ClsGy_EquipFileMain oBill = new DLL.ClsGy_EquipFileMain(); if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) ds = oCN.RunProcReturn("select * from Gy_EquipFileBillMain where HInterID=" + HItemID, "Gy_EquipFileBillMain"); if (ds.Tables[0].Rows.Count > 0) { if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æï¼"; objJsonResult.data = null; return objJsonResult; } oCN.RunProc("Delete From Gy_EquipFileBillMain where HInterID=" + lngBillKey); objJsonResult.code = "1"; objJsonResult.count = 1; WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs
@@ -37,24 +37,14 @@ // objJsonResult.data = null; // return objJsonResult; //} ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_EquipFileType where 1=1 " + sWhere+ " order by HItemID ", "Gy_EquipFileType"); ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag,HMakeEmp,HMakeTime,HCheckEmp,HCheckTime,HModifyEmp,HModifyTime,HCloseEmp,HCloseTime from Gy_EquipFileType where 1=1 " + sWhere+ " order by HItemID ", "Gy_EquipFileType"); //if (ds.Tables[0].Rows.Count != 0 || ds != null) //{ objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; return objJsonResult; //} //else //{ //objJsonResult.code = "0"; //objJsonResult.count = 0; //objJsonResult.Message = "æ æ°æ®"; //objJsonResult.data = null; //return objJsonResult; //} } catch (Exception ex) { @@ -94,8 +84,18 @@ return objJsonResult; } DLL.ClsGy_EquipTypeBill oBill = new DLL.ClsGy_EquipTypeBill(); if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) ds = oCN.RunProcReturn("select * from Gy_EquipFileType where HItemID=" + HItemID, "Gy_EquipFileType"); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HCloseEmp"].ToString() != "" || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æï¼"; objJsonResult.data = null; return objJsonResult; } oCN.RunProc("Delete From Gy_EquipFileType where HItemID=" + lngBillKey); objJsonResult.code = "1"; objJsonResult.count = 1; @@ -174,9 +174,9 @@ //主表 oCN.RunProc("Insert into Gy_EquipFileType " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime) " + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HMakeEmp) " + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID + "," + HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); "," + HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate(),'" + msg4 + "')", ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç oCN.RunProc("Update Gy_EquipFileType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCN.Commit(); @@ -269,6 +269,8 @@ ",HShortNumber='" + HShortNumber + "'" + ",HHelpCode='" + HHelpCode + "'" + ",HParentID=" + HParentID + ",HModifyTime=getdate()" + ",HModifyEmp='" + msg4 + "'" + ",HStopflag='" + HStopflag + "'" + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹å项ç®ä»£ç WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
@@ -110,9 +110,10 @@ return objJsonResult; } DLL.ClsSb_EquipDotCheckRuleBill oBill = new DLL.ClsSb_EquipDotCheckRuleBill(); if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) ds = oCN.RunProcReturn("select * from Sb_EquipDotCheckRuleBillMain where HInterID=" + HInterID, "Sb_EquipDotCheckRuleBillMain"); if (ds.Tables[0].Rows.Count>0) { if (oBill.omodel.HBillStatus > 1) if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
@@ -99,9 +99,10 @@ return objJsonResult; } DLL.ClsSb_EquipMaintainRuleBill oBill = new DLL.ClsSb_EquipMaintainRuleBill(); if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) ds = oCN.RunProcReturn("select * from Sb_EquipMaintainRuleBillMain where HItemID=" + HInterID, "Sb_EquipMaintainRuleBillMain"); if (ds.Tables[0].Rows.Count > 0) { if (oBill.omodel.HBillStatus > 1) if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -109,7 +110,7 @@ objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HChecker != ""&& oBill.omodel.HChecker != null) if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_Cg_PODemandPlanBillController.cs
@@ -7,6 +7,7 @@ using System.Web.Http; using WebAPI.Models; using Newtonsoft.Json; using DBUtility; namespace WebAPI.Controllers.SCGL { @@ -18,6 +19,7 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); JIT_Cg_PODemandPlanBillMain omdelMian = new JIT_Cg_PODemandPlanBillMain(); List<JIT_Cg_PODemandPlanBillSub> omodelsub = new List<JIT_Cg_PODemandPlanBillSub>(); public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill(); #region ææè®¡åå å表 [Route("JIT_Cg_PODemandPlanBill/JIT_Cg_PODemandPlanBillList")] @@ -260,6 +262,117 @@ } #endregion #region ææè®¡åå å®¡æ ¸/åå®¡æ ¸åè½ [Route("JIT_Cg_PODemandPlanBill/CheckPODemandPlanBillList")] [HttpGet] public object CheckPODemandPlanBillList(string HInterID, int Type, string user) { try { //夿æ¯å¦æå 餿é if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Check", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ææè®¡ååæ æéå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "JIT_Cg_PODemandPlanBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ if (Type == 1) { //夿忮æ¯å¦å·²ç»å®¡æ ¸ DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } //å®¡æ ¸åæ® if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { //夿忮æ¯å¦å·²ç»åå®¡æ ¸ DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已åå®¡æ ¸!ä¸éè¦ååå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } //åå®¡æ ¸åæ® if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } 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 ææè®¡åå å ³é [Route("JIT_Cg_PODemandPlanBill/ClosePODemandPlanBillList")] [HttpGet] WebAPI/Controllers/WebAPIController.cs
@@ -10109,6 +10109,274 @@ } #endregion #region å¯å¨æ£æ¥é¡¹ç® 设置å表/ä¿å/ç¼è¾/å 餿¹æ³ /// <summary> /// å¯å¨æ£æ¥é¡¹ç® ä¿å /// </summary> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_CheckNoteItemList")] [HttpPost] public object SaveGy_CheckNoteItemList([FromBody] JObject msg) { DataSet ds; var _value = msg["msg"].ToString(); string msg3 = _value.ToString(); string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg1 = sArray[0].ToString(); string msg2 = sArray[1].ToString(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_CheckNoteItem_Edit", 1, false, msg2)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } Int64 HItemID = 0; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); //è·åæå¤§IDå¼èµå¼ DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_CheckNoteItem ", "Gy_CheckNoteItem"); if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) { var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); maxid += 1; HItemID = maxid; } ListModels oListModels = new ListModels(); try { WebAPI.DLL.ClsGy_CheckNoteItem_Ctl oBill = new WebAPI.DLL.ClsGy_CheckNoteItem_Ctl(); List<Model.ClsGy_CheckNoteItem_Model> lsmain = new List<Model.ClsGy_CheckNoteItem_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_CheckNoteItem(msg1); foreach (Model.ClsGy_CheckNoteItem_Model oItem in lsmain) { if (oItem.HNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸è½ä¸ºç©ºï¼"; objJsonResult.data = 1; return objJsonResult; } if (oItem.HName.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼åç§°ä¸è½ä¸ºç©ºï¼"; objJsonResult.data = 1; return objJsonResult; } if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; objJsonResult.data = 1; return objJsonResult; } //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç ds = oCN.RunProcReturn("select * from Gy_CheckNoteItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CheckNoteItem"); if (oItem.HNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç 为空ï¼"; objJsonResult.data = 1; return objJsonResult; } //æ°å¢æ¶å¤æ if (oItem.HItemID == 0) { if (ds == null || ds.Tables[0].Rows.Count == 0) { } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; objJsonResult.data = 1; return objJsonResult; } //æ£æ¥ç¶çº§æ¯å¦åå¨ string sParent; sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); if (sParent.Trim() == "") { oBill.oModel.HParentID = 0; } else { if (oBill.HavParentCode(sParent.Trim(), HItemID)) { oBill.oModel.HParentID = oBill.oModel.HItemID; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; objJsonResult.data = 1; return objJsonResult; } } } else//ç¼è¾æ¶å¤æ { //æ£æ¥ç¶çº§æ¯å¦åå¨ string sParent; sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); if (sParent.Trim() == "") { oBill.oModel.HParentID = 0; } else { if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) { oBill.oModel.HParentID = oBill.oModel.HItemID; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; objJsonResult.data = 1; return objJsonResult; } } } //å¾å°ç代ç string sShortNumber; sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); if (sShortNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; objJsonResult.data = 1; return objJsonResult; } oItem.HShortNumber = sShortNumber;//ç代ç oItem.HEndFlag = true;//æ«çº§æ å¿ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //ç级 oItem.HMakeEmp = msg2; //å建人 oBill.oModel = oItem; } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.oModel.HItemID == 0) { bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } /// <summary> ///å¯å¨æ£æ¥é¡¹ç® è·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_CheckNoteItemDetail")] [HttpGet] public ApiResult<DataSet> GetGy_CheckNoteItemDetail(string HID) { var model = LuBaoSevice.GetGy_CheckNoteItemDetail(HID); return model; } /// <summary> ///å¯å¨æ£æ¥é¡¹ç® å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_CheckNoteItem")] [HttpGet] public object DeltetGy_CheckNoteItem(string HItemID, string user) { DataSet ds; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_CheckNoteItem_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (string.IsNullOrWhiteSpace(HItemID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HItemID为空ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran();//å¼å§äºå¡ oCN.RunProc("delete Gy_CheckNoteItem where HItemID=" + HItemID); 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 /// <summary> /// ç¨å ³èå·¥åºè·åä¿¡æ¯ /// </summary> WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillController.cs
@@ -327,12 +327,12 @@ //主表 oCN.RunProc(@"Insert Into Sc_ICMOBillMain (HBillType,HInterID,HBillNo,HDate,HPRDORGID ,HYear,HPeriod,HRemark,HMaker,HMakeDate ,HYear,HPeriod,HRemark,HMaker,HMakeDate,HChecker,HCheckDate ,HSeOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HEmpID,HCusID ,HCenterID,HPlanQty,HDeptID,HMaterID,HUnitID,HBomID,HPlanBeginDate,HPlanEndDate,HBillStatus ,HOWNERID,HOWNERTYPEID) values('3710'," + mainList[0].HInterID + ",'" + mainList[0].HBillNo + "','" + mainList[0].HDate + "'," + mainList[0].HPRDORGID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + mainList[0].HRemark + "','" + mainList[0].HMaker + "',getdate()" + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + mainList[0].HRemark + "','" + mainList[0].HMaker + "',getdate(),'" + mainList[0].HMaker + "',getdate()" + ",'" + mainList[0].HSeOrderBillNo + "'," + mainList[0].HSeOrderInterID + "," + mainList[0].HSeOrderEntryID + "," + mainList[0].HEmpID + "," + mainList[0].HCusID + "," + mainList[0].HCenterID + "," + mainList[0].HPlanQty + ",0,0,0,0,'','',2" + ","+ mainList[0].HOWNERID + ",'"+ mainList[0].HOWNERTYPEID + "') "); WebAPI/DLL/ClsGy_CheckNoteItem_Ctl.cs
New file @@ -0,0 +1,103 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_CheckNoteItem_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_CheckNoteItem_Model oModel = new Model.ClsGy_CheckNoteItem_Model(); //æ°å¢ public override bool AddNew() { // try { oCn.BeginTran(); oCn.RunProc("Insert into " + MvarItemKey + " " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID,HCheckPostID) " + " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "','" + oModel.HCheckPostID + "')", ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCn.Commit(); return true; } catch (Exception e) { oCn.RollBack(); throw (e); } } //ä¿®æ¹ public override bool ModifyByID(Int64 sItemID) { try { oCn.BeginTran(); oCn.RunProc("Update " + MvarItemKey + " set " + " HNumber='" + oModel.HNumber + "'" + ",HName='" + oModel.HName + "'" + ",HShortNumber='" + oModel.HShortNumber + "'" + ",HHelpCode='" + oModel.HHelpCode + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",HUseFlag='" + oModel.HUseFlag + "'" + ",HCheckPostID='" + oModel.HCheckPostID + "'" + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹å项ç®ä»£ç oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); //å°ä¸çº§ ä¸ºéæ«çº§ oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); // oCn.Commit(); return true; } catch (Exception e) { oCn.RollBack(); throw (e); } } //æ ¹æ®ä»£ç å¤æä¿¡æ¯ public override bool HavParentCode(string sCode, Int64 sItemID) { DataSet DS; try { DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo); if (DS.Tables[0].Rows.Count == 0) return false; else { oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); return true; } } catch (Exception e) { throw (e); } } //æé 彿° public ClsGy_CheckNoteItem_Ctl() { MvarItemKey = "Gy_CheckNoteItem"; MvarReportTitle = "å¯å¨æ£æµé¡¹ç®è®¾ç½®"; oModel = new Model.ClsGy_CheckNoteItem_Model(); } } } WebAPI/DLL/ClsGy_MaintainLev_Ctl.cs
@@ -92,7 +92,7 @@ public ClsGy_MaintainLev_Ctl() { MvarItemKey = "Gy_MaintainLev"; MvarReportTitle = "é²éè£ ç½®è®¾ç½®"; MvarReportTitle = "ä¿å »çº§å«è®¾ç½®"; oModel = new Model.ClsGy_MaintainLev_Model(); } WebAPI/ListModels.cs
@@ -1148,6 +1148,18 @@ } /// <summary> /// å¤çæ°å¢å¯å¨æ£æ¥é¡¹ç®è¡¨çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_CheckNoteItem_Model> getObjectByJson_Gy_CheckNoteItem(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_CheckNoteItem_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_CheckNoteItem_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢é¡¹ç®ç±»å«è¡¨çjson /// </summary> /// <param name="jsonString"></param> @@ -2793,6 +2805,33 @@ List<Model.ClsSc_MouldProdMoveBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdMoveBillSub>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢ç´æ¥è°æ¨å主表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsSc_WorkBeginDotCheckBillMain> getObjectByJson_Sc_WorkBeginDotCheckBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsSc_WorkBeginDotCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_WorkBeginDotCheckBillMain>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢ç´æ¥è°æ¨åå表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsSc_WorkBeginDotCheckBillSub> getObjectByJson_Sc_WorkBeginDotCheckBillSub(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsSc_WorkBeginDotCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_WorkBeginDotCheckBillSub>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å¨å ·åå¸å¼è°å ¥å主表çjson /// </summary> WebAPI/Service/LuBaoSevice.cs
@@ -680,6 +680,25 @@ return dataSet; } /// <summary> /// å¯å¨æ£æ¥é¡¹ç®æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_CheckNoteItemDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_CheckNoteItemDb(HID); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) return new ApiResult<DataSet> { code = -1, msg = "ä¸åå¨å¯å¨æ£æ¥é¡¹ç®æ°æ®" }; return new ApiResult<DataSet> { code = 1, msg = "æ¥è¯¢æå", data = dataSet }; } public static DataSet GetGy_CheckNoteItemDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_CheckNoteItem where HItemID= " + HID + " ", "h_v_Gy_CheckNoteItem"); return dataSet; } /// <summary> /// 项ç®ç±»å«æ ¹æ®idè·åä¿¡æ¯ WebAPI/WebAPI.csproj
@@ -396,6 +396,7 @@ <Compile Include="Controllers\CJGL\Cj_NoPassProcController.cs" /> <Compile Include="Controllers\CJGL\Cj_SendGoodsBillController.cs" /> <Compile Include="Controllers\CJGL\Mes_OrderProcFlowAllReportController.cs" /> <Compile Include="Controllers\CJGL\Sc_WorkBeginDotCheckBillController.cs" /> <Compile Include="Controllers\CJGL\ProductionPlanReportController.cs" /> <Compile Include="Controllers\CJGL\Sc_ProcessExchangeBillController.cs" /> <Compile Include="Controllers\CJGL\Cj_StationOutBillController.cs" /> @@ -657,6 +658,7 @@ <Compile Include="DLL\ClsGy_BadPhenomena_Ctl.cs" /> <Compile Include="DLL\ClsGy_InspectInstruMent_Ctl.cs" /> <Compile Include="DLL\ClsGy_InspectBasis_Ctl.cs" /> <Compile Include="DLL\ClsGy_CheckNoteItem_Ctl.cs" /> <Compile Include="DLL\ClsGy_PoStockStyle_Ctl.cs" /> <Compile Include="DLL\ClsGy_AreaSet_Ctl.cs" /> <Compile Include="DLL\ClsGy_CusType_Ctl.cs" />