DAL/DAL.csproj
@@ -83,6 +83,7 @@ <Compile Include="ClsGy_MaterialPackingRelation.cs" /> <Compile Include="MES\ClsSc_MESStopRestoreWorkBill.cs" /> <Compile Include="ä»åºç®¡ç\å°è½¦éå®\ClsKf_TrolleyPositionBill.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_Driver_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_PatrolCheckItemMethod_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_PatrolCheckItemClass_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_MaintainClass_Ctl.cs" /> @@ -109,6 +110,7 @@ <Compile Include="ç产管ç\å®¢æ·æ ç¾\ClsSc_CustomerTagInfo.cs" /> <Compile Include="ç产管ç\æäº§è§£éç³è¯·å\ClsJIT_UnLockRequestBill.cs" /> <Compile Include="ç产管ç\æäº§éå®ç³è¯·å\ClsJIT_LockRequestBill.cs" /> <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsGy_QCVerificationBillMain.cs" /> <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsSc_MouldMoveStockRequestBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipPatrolCheckPlanBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipPatrolCheckBill.cs" /> DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_Driver_Ctl.cs
New file @@ -0,0 +1,100 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsGy_Driver_Ctl: DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_Driver_Model oModel = new Model.ClsGy_Driver_Model(); //æ°å¢ public override bool AddNew() { try { oCn.BeginTran(); oCn.RunProc("Insert into " + MvarItemKey + " " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HEmpID,) " + " 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 + "'," + oModel.HEmpID + "," + ")", 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 + "'" + ",HLevel=" + oModel.HLevel + ",HParentID=" + oModel.HParentID + ",HEmpID=" + oModel.HEmpID + ",HBarCodeForBase='" + oModel.HBarCode + "'" + ",HEntityID=" + oModel.HEntityID + ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + ",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_Driver_Ctl() { MvarItemKey = "Gy_Driver"; MvarReportTitle = "驾驶å设置"; oModel = new Model.ClsGy_Driver_Model(); } } } DAL/»ù´¡×ÊÁÏ/ÆäËû»ù´¡×ÊÁÏ/ClsGy_QCCheckProjectMain.cs
@@ -83,6 +83,7 @@ ",HDeptID=" + omodel.HDeptID.ToString() + ",HSampleSchemeID=" + omodel.HSampleSchemeID.ToString() + ",HSourceID=" + omodel.HSourceID.ToString() + ",HCheckBillType='" + omodel.HCheckBillType.ToString() +"'"+ " where HInterID=" + lngBillKey.ToString()); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); @@ -186,13 +187,13 @@ "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + ",HYear,HPeriod,HRemark" + ",HMaterID,HName,HMaterNumber,HMaterTypeID,HUnitID" + ",HUnitNumber,HStandard,HProcID,HDeptID,HSampleSchemeID,HSourceID,HOrgID" + ",HUnitNumber,HStandard,HProcID,HDeptID,HSampleSchemeID,HSourceID,HOrgID,HCheckBillType" + ") " + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+ "," + omodel.HMaterID.ToString() + ",'" + omodel.HName + "','" + omodel.HMaterNumber + "'," + omodel.HMaterTypeID.ToString() + "," + omodel.HUnitID.ToString() + ",'" + omodel.HUnitNumber + "', " + Convert.ToString(omodel.HStandard ? 1 : 0) + "," + omodel.HProcID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HSampleSchemeID + ",'" + omodel.HSourceID + "','" + omodel.HOrgID + "') "); "," + omodel.HSampleSchemeID + ",'" + omodel.HSourceID + "','" + omodel.HOrgID+"','"+ omodel.HCheckBillType + "') "); //æå ¥å表 foreach (Model.ClsGy_QCCheckProjectSub oSub in DetailColl) { DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsGy_QCVerificationBillMain.cs
New file @@ -0,0 +1,274 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsGy_QCVerificationBillMain : DBUtility.ClsXt_BaseBill { public Model.ClsGy_QCVerificationBillMain omodel = new Model.ClsGy_QCVerificationBillMain(); public List<Model.ClsGy_QCVerificationBillSub> DetailColl = new List<Model.ClsGy_QCVerificationBillSub>(); public ClsGy_QCVerificationBillMain() { base.MvarItemKeySub = "Gy_QCVerificationBillMain"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey= "Gy_QCVerificationBillMain"; base.MvarReportTitle = "å¨å ·æ ¡åè®°å½å"; base.BillType = "3321"; base.HBillSubType = "3321"; } #region åºå®ä»£ç ~ClsGy_QCVerificationBillMain() { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { // oCn.BeginTran(); //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Gy_QCVerificationBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== ",HDate='" + omodel.HDate + "'" + ",HYear='" + omodel.HYear.ToString() + "'" + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + ",HRemark='" + omodel.HRemark + "'" + ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + ",HUpDateDate=getdate()" + //======================================== ",HCheckEmp=" + omodel.HCheckEmp.ToString() + ",HDeptID=" + omodel.HDeptID.ToString() + ",HMainSourceBillType='"+ omodel.HMainSourceBillType+"'"+ ",HMainSourceBillNo='" + omodel.HMainSourceBillNo + "'" + ",HMainSourceInterID=" + omodel.HMainSourceInterID.ToString()+ ",HMainSourceEntryID="+ omodel.HMainSourceEntryID.ToString()+ " where HInterID=" + lngBillKey.ToString()); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); oCn.RunProc("delete from Gy_QCVerificationBillSub where HInterID=" + lngBillKey); //æå ¥å表 omodel.HInterID = lngBillKey; foreach (Model.ClsGy_QCVerificationBillSub oSub in DetailColl) { oCn.RunProc("Insert into Gy_QCVerificationBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ",HInspectInstruMentID,HBeginDate,HEndDate,HHCalibrationStatus" + ") values(" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HInspectInstruMentID.ToString() + ",'" + oSub.HBeginDate + "','" + oSub.HEndDate.ToString() + "','" + oSub.HHCalibrationStatus.ToString() + "'" + ") "); } sReturn = "ä¿®æ¹åæ®æåï¼"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw (e); } } //æ°å¢åæ® public override bool AddBill(ref string sReturn) { try { //å¾å°mainid omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿ååæ§å¶========================================= string HBillNote = ""; DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldRepairWorkBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1,1 ", "h_p_Sc_MouldRepairWorkBill_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éå¤åéæ°è·å oCn.BeginTran(); oCn.RunProc("Insert Into Gy_QCVerificationBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + ",HYear,HPeriod,HRemark,HMaker,HMakeDate," + "HMainSourceBillType,HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID," + "HCheckEmp,HDeptID) " + "values('" + (this.BillType ?? "") + "','" + (this.HBillSubType ?? "") + "'," + (omodel.HInterID.ToString() ?? "0") + ",'" + (omodel.HBillNo ?? "") + "','" + (omodel.HDate) + "'" + "," + (omodel.HYear.ToString() ?? "0") + "," + (omodel.HPeriod.ToString() ?? "0") + ",'" + (omodel.HRemark ?? "") + "','" + (omodel.HMaker ?? "") + "',getdate(),'" + (omodel.HMainSourceBillType ?? "") + "','" + (omodel.HMainSourceBillNo ?? "") + "'," + (omodel.HMainSourceInterID.ToString() ?? "0") + "," + (omodel.HMainSourceEntryID.ToString() ?? "0") + "," + (omodel.HCheckEmp.ToString() ?? "0") + "," + (omodel.HDeptID.ToString() ?? "0") + ")"); //主表 //oCn.RunProc("Insert Into Gy_QCVerificationBillMain " + //"(HBillType,HBillSubType,HInterID,HBillNo,HDate" + //",HYear,HPeriod,HRemark,HMaker,HMakeDate," + //"HMainSourceBillType,HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID," //+ "HCheckEmp,HDeptID" + //") " + //" values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + //"," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + ",'" + omodel.HMainSourceBillType + "','" + omodel.HMainSourceBillNo + "'," + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + "," + omodel.HCheckEmp.ToString() + "," + omodel.HDeptID.ToString() + "') "); //æå ¥å表 foreach (Model.ClsGy_QCVerificationBillSub oSub in DetailColl) { if (oSub.HBeginDate.Trim()==""|| oSub.HBeginDate.Trim() == null) { oSub.HBeginDate = DateTime.Now.ToString(); oSub.HEndDate = DateTime.Now.AddYears(10).ToString(); } if(oSub.HHCalibrationStatus==""|| oSub.HHCalibrationStatus==null) { oSub.HHCalibrationStatus = "åæ ¼"; } oCn.RunProc("Insert into Gy_QCVerificationBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ",HInspectInstruMentID,HBeginDate,HEndDate,HHCalibrationStatus" + ") values(" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HInspectInstruMentID.ToString() + ",'" + oSub.HBeginDate + "','" + oSub.HEndDate.ToString() + "','" + oSub.HHCalibrationStatus.ToString() +"'"+ ") "); } //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldRepairWorkBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1,1 ", "h_p_Sc_MouldRepairWorkBill_AfterSaveCtrl"); 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; } 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 Gy_QCVerificationBillMain Where HInterID=" + lngBillKey.ToString(), "Gy_QCVerificationBillMain"); if(Ds.Tables[0].Rows.Count==0) { sReturn = "åæ®æªæ¾å°ï¼"; return false; } //åºå®èµå¼=========================================== omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); 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.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.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.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); //======================================================== omodel.HCheckEmp = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckEmp"]); omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); // //å¾ªç¯ DataSet DsSub ; DsSub = oCn.RunProcReturn("Select * from Gy_QCVerificationBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MouldRepairWorkBillSub"); DetailColl.Clear();//æ¸ ç©º for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Model.ClsGy_QCVerificationBillSub oSub = new Model.ClsGy_QCVerificationBillSub(); // åºå®èµå¼=============================================== 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(); //=================================================== oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInspectInstruMentID"]); oSub.HBeginDate = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBeginDate"]); oSub.HEndDate = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HEndDate"]); oSub.HHCalibrationStatus = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HHCalibrationStatus"]); DetailColl.Add(oSub); } sReturn = "æ¾ç¤ºåæ®æåï¼"; return true; } catch (Exception e) { sReturn = e.Message; throw (e); } } } } Model/Model.csproj
@@ -105,6 +105,7 @@ <Compile Include="åºç¡èµæ\å ¶ä»åºç¡èµæ\ClsGy_MatePrice_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_AssistantData.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_AssistantDataEntry.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Driver_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_DiscountList.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_OperatorGroup.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsSc_PackUnionBillBarCode_temp_Model.cs" /> @@ -179,6 +180,8 @@ <Compile Include="ç产管ç\æäº§è§£éç³è¯·å\ClsJIT_UnLockRequestBillSub.cs" /> <Compile Include="ç产管ç\æäº§éå®ç³è¯·å\ClsJIT_LockRequestBillMain.cs" /> <Compile Include="ç产管ç\æäº§éå®ç³è¯·å\ClsJIT_LockRequestBillSub.cs" /> <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsGy_QCVerificationBillMain.cs" /> <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsGy_QCVerificationBillSub.cs" /> <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsSc_MouldMaintainPlanBillSub_Plan.cs" /> <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsSc_MouldMoveStockRequestBillMain.cs" /> <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsSc_MouldMoveStockRequestBillSub.cs" /> Model/»ù´¡×ÊÁÏ/ÆäËû»ù´¡×ÊÁÏ/ClsGy_QCCheckProjectMain.cs
@@ -19,5 +19,6 @@ public Int64 HSampleSchemeID; public Int64 HSourceID; public Int64 HOrgID; public string HCheckBillType; } } Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_Driver_Model.cs
New file @@ -0,0 +1,22 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_Driver_Model : DBUtility.ClsGy_Base_Model { // public Int64 HEmpID; public string HBarCode; public Int64 HEntityID; public string HIDCard; public string HPhone; public string HDriverCardPic; public string HDriverCardType; public string HIDCardPic; public string HEmpType; public int HCompID; } } Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsGy_QCVerificationBillMain.cs
New file @@ -0,0 +1,14 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_QCVerificationBillMain : DBUtility.ClsXt_BaseBillMain { public Int64 HCheckEmp;// public Int64 HDeptID;// public Int64 HEmpID;// } } Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsGy_QCVerificationBillSub.cs
New file @@ -0,0 +1,15 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_QCVerificationBillSub : DBUtility.ClsXt_BaseBillSub { public Int64 HInspectInstruMentID;// public string HBeginDate;// public string HEndDate;// public string HHCalibrationStatus; } } WebAPI/Controllers/BaseSet/Gy_DriverController.cs
New file @@ -0,0 +1,1407 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Pub_Class; using SyntacticSugar.constant; using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.IO; using System.Web; using System.Web.Http; using WebAPI.Controllers.SCGL.æ¥è®¡å管ç; using WebAPI.Models; namespace WebAPI.Controllers { public class Gy_DriverController : ApiController { //è·åç³»ç»åæ° Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DBUtility.ClsPub.Enum_BillStatus BillStatus; private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; /// <summary> /// è¿åå表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Gy_DriverController/list")] [HttpGet] public object list(string sWhere, string user, string Organization) { try { List<object> columnNameList = new List<object>(); ////æ¥çæé //if (!DBUtility.ClsPub.Security_Log("Gy_Department", 1, false, user)) //{ // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "æ æ¥çæé"; // objJsonResult.data = null; // return objJsonResult; //} //string sql1 = string.Format(@"select * from h_v_IF_DepartmentList where ç»ç»åç§°='" + Organization + "'"); string sql1 = string.Format(@"select * from h_v_Gy_driver where 1=1 "); if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn(sql1 + sWhere , "h_v_Gy_driver"); } else { string sql = sql1 + sWhere ; ds = oCN.RunProcReturn(sql, "h_v_Gy_driver"); } //æ·»å åå 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.Tables[0].Rows.Count > 0 && ds != null) //{ objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; //} //else //{ // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "æ²¡ææ¥è¯¢å°é¨é¨æ°æ®ï¼è¯·è系系ç»ç®¡çåè¿è¡æ ¸å¯¹"; // 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; } } #region é¨é¨ æ å½¢å¾ public class TreeModel { public string id { get; set; } public string title { get; set; } public List<TreeModel> children = new List<TreeModel>(); } [Route("Gy_Department/Gy_DepartmentTreeList")] [HttpGet] public object Gy_DepartmentTreeList(string sWhere) { try { string sql1 = string.Format("select hitemid,hnumber,hname from Gy_Department where 1=1 " + sWhere + " order by hnumber"); ds = oCN.RunProcReturn(sql1, "Gy_Department"); List<TreeModel> treeModels = new List<TreeModel>(); TreeModel first = new TreeModel(); first.id = "0"; first.title = "é¨é¨è®¾ç½®"; treeModels.Add(first); foreach (DataRow row in ds.Tables[0].Rows) { var strLen = row["hitemid"].ToString().Split('.'); if (strLen.Length == 1) { TreeModel tree = new TreeModel(); tree.id = row["hitemid"].ToString(); tree.title = row["hname"].ToString(); treeModels[0].children.Add(tree); } } digui(ds.Tables[0], treeModels[0].children, 2); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels); return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// <summary> /// éå½å½æ° /// </summary> public void digui(DataTable dt, List<TreeModel> tree, int num) { for (int m = 0; m < tree.Count; m++) { tree[m].children = new List<TreeModel>(); for (int i = 0; i < dt.Rows.Count; i++)//ç¬¬ä¸æ¬¡å¾ªç¯ï¼å¾å°æææ ¹èç¹çåé { var strLen = dt.Rows[i]["hnumber"].ToString().Split('.'); if (strLen.Length == num && dt.Rows[i]["hnumber"].ToString().Contains(tree[m].id + ".")) { TreeModel tbjson = new TreeModel(); tbjson.id = dt.Rows[i]["hitemid"].ToString(); tbjson.title = dt.Rows[i]["hname"].ToString(); tree[m].children.Add(tbjson); } } var strLens = tree[m].id.Split('.'); for (int i = 0; i < tree[m].children.Count; i++) { digui(dt, tree[m].children, strLens.Length + 2);//忬¡ç¨åéå»å¾ªç¯ï¼æ¿åºåéçåé } } } #endregion /// <summary> /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Gy_Driver/cx")] [HttpGet] public object cx(long HInterID) { try { ds = oCN.RunProcReturn("select * from h_v_Gy_driver where HitemID = " + HInterID, "h_v_Gy_driver"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "falseï¼"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; 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; } } /// <summary> /// å表å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_Driver")] [HttpGet] public object DeltetGy_Driver(string HItemID, string user) { DataSet ds; DataSet ds1; try { ////å 餿é //if (!DBUtility.ClsPub.Security_Log("Gy_Department_Delete", 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();//å¼å§äºå¡ ds = oCN.RunProcReturn("select * from gy_driver where HItemID=" + HItemID, "gy_driver"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } ds1 = oCN.RunProcReturn("Select HItemID from gy_driver Where HParentID='" + HItemID + "'", "gy_driver"); if (ds1.Tables[0].Rows.Count != 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤é¡¹ç®åå¨å项ç®ï¼ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]); if (HUseFlag == "已使ç¨") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤é¡¹ç®å·²ä½¿ç¨ï¼ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.RunProc("delete from gy_driver 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; } } //[Route("Gy_Department/LoadTree")] //[HttpGet] //public object LoadTree_Json() //{ // DBUtility.Gy_BaseFun.LoadTree(tv, imageList1, this.Text, BillName); //} /// <summary> /// é¨é¨å表ç¦ç¨æé® ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Gy_Department/JY_Json")] [HttpGet] public object JY_Json(long HItemID) { try { ds = oCN.RunProcReturn("update Gy_Department set HStopFlag = 1 where HItemID = " + HItemID, "Gy_Department"); 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; } } /// <summary> /// é¨é¨å表åç¦ç¨æé® ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Gy_Department/FJY_Json")] [HttpGet] public object FJY_Json(long HItemID) { try { ds = oCN.RunProcReturn("update Gy_Department set HStopFlag = 0 where HItemID = " + HItemID, "Gy_Department"); 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; } } /// <summary> /// æ°å¢åæ®-ä¿åæé® ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Gy_Department/AddBill")] [HttpPost] public object AddBill([FromBody] JObject oMain) { try { var _value = oMain["oMain"].ToString(); string msg1 = _value.ToString(); //ååºåå msg1 = "[" + msg1.ToString() + "]"; DAL.ClsGy_Department_Ctl oDept = new DAL.ClsGy_Department_Ctl(); DAL.ClsGy_Department_View oDeptHlp = new DAL.ClsGy_Department_View(); List<Department> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Department>>(msg1); long HItemID = list[0].HItemID; string HNumber = list[0].HNumber; string HName = list[0].HName; string HShortNumber = list[0].HShortNumber; string HRemark = list[0].HRemark; string HUseFlag = list[0].HUseFlag; long HParentID = list[0].HParentID; string HBarCode = list[0].HBarCode; string HHelpCode = list[0].HHelpCode; long HSecManagerID = list[0].HSecManagerID; string HCreator = list[0].HCreator; long HCreateOrgID = list[0].HCreateOrgID; //DateTime HCreateDate = list[0].HCreateDate; long HUseOrgID = list[0].HUseOrgID; string HUpdater = list[0].HUpDater; //DateTime HUpdateDate = list[0].HUpDateDate; string HChecker = list[0].HChecker; //DateTime HCheckDate = list[0].HCheckDate; string HDeleteMan = list[0].HDeleteMan; //DateTime HDeleteDate = list[0].HDeleteDate; if (!DBUtility.ClsPub.AllowNumber(HNumber)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; objJsonResult.data = null; return objJsonResult; } //è¥MAINDIéå¤åéæ°è·å oCN.BeginTran(); //主表 oCN.RunProc("Insert Into Gy_Department " + "(HNumber,HShortNumber,HName,HParentID" + ",HLevel,HEndFlag,HRemark,HStopFlag,HUseFlag" + ",HCREATEORGID,HUSEORGID" + ") " + " values('" + HNumber + "','" + HShortNumber + "','" + HName + "',0" + ",'',0,'" + HRemark + "',0,''" + "," + HCreateOrgID + "," + HUseOrgID + "" + ") "); //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "æ°å¢åæ®æåï¼"; //objJsonResult.data = null; return objJsonResult; } catch (Exception e) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } /// <summary> /// ä¿åæé® ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Gy_Driver/AddBill1")] [HttpPost] public object AddBill1([FromBody] JObject oMain) { try { DAL.ClsGy_Driver_Ctl oDept = new DAL.ClsGy_Driver_Ctl(); DAL.ClsGy_Department_View oDeptHlp = new DAL.ClsGy_Department_View(); var _value = oMain["oMain"].ToString(); string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); string msg4 = sArray[2].ToString(); //string msg4 = sArray[2].ToString(); //string msg5 = sArray[3].ToString(); //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Gy_Department_Edit", 1, false, msg3)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } //ååºåå msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); msg2 = "[" + msg2.ToString() + "]"; List<Driver> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Driver>>(msg2); long HItemID = list[0].HItemID; string HNumber = list[0].HNumber; string HName = list[0].HName; string HRemark = list[0].HRemark; string HUseFlag = list[0].HUseFlag; string HHelpCode = list[0].HHelpCode; string HModifyEmp = msg3; string HMakeEmp = msg3; bool HStopflag = list[0].HStopflag==null?false:true; long HCREATEORGID = list[0].HCREATEORGID; long HUSEORGID = list[0].HUSEORGID; long HCompID = list[0].HCompID; //zidingyi string HIDCard = list[0].HIDCard; string HPhone = list[0].HPhone; string HDriverCardPic = list[0].HDriverCardPic; string HDriverCardType = list[0].HDriverCardType; string HIDCardPic = list[0].HIDCardPic; string HEmpType = list[0].HEmpType; //æ«çº§æ å¿ bool HEndFlag = true; long HEntityID = 1; //å¾å°ç代ç string HShortNumber = DBUtility.ClsPub.GetShortNumber(HNumber); if (HShortNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; objJsonResult.data = 1; return objJsonResult; } //ç级 int HLevel = DBUtility.ClsPub.GetLevel(HNumber); //æ£æ¥ç¶çº§æ¯å¦åå¨ long HParentID = 0; string sParent = DBUtility.ClsPub.GetParentCode(HNumber); if (sParent.Trim() == "") { HParentID = 0; } else { ds = oCN.RunProcReturn("select * from Gy_Driver where HNumber='" + sParent + "' and HStopFlag=0 ", "Gy_Driver"); if (ds.Tables[0].Rows.Count > 0) { HParentID = long.Parse(ds.Tables[0].Rows[0]["HItemID"].ToString()); } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; objJsonResult.data = 1; return objJsonResult; } } //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç ds = oCN.RunProcReturn("Select HItemID from gy_driver Where HItemID<>" + HItemID + " and HNumber='" + HNumber + "' and HUSEORGID=" + HUSEORGID, "Gy_Warehouse"); if (ds.Tables[0].Rows.Count > 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; objJsonResult.data = 1; return objJsonResult; } //ä¿å //ä¿å宿¯åå¤ç if (HItemID == 0) { //æ°å¢ oCN.BeginTran(); oCN.RunProc("Insert into Gy_Driver " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HUSEORGID,HCREATEORGID,HMakeEmp,HMakeTime,HIDCard,HPhone,HDriverCardPic,HDriverCardType,HIDCardPic,HEmpType,HCompID) " + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'" + "," + HUSEORGID + "," + HCREATEORGID + ",'" + msg3 + "',getdate()," +"'"+ HIDCard +"',"+ "'"+ HPhone+"','"+ HDriverCardPic+"','"+ HDriverCardType + "','"+ HIDCardPic +"','"+ HEmpType+"',"+ HCompID+ ")", ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç oCN.RunProc("Update Gy_Driver set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCN.Commit(); } else { oCN.BeginTran(); //å·²å®¡æ ¸ä¸å è®¸ä¿®æ¹ DataSet dss; dss = oCN.RunProcReturn("select * from Gy_Driver where HItemID=" + HItemID, "Gy_Driver"); //夿æ¯å¦å¯ç¼è¾ if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®ç¶æå·²ç»å®¡æ ¸ï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = null; return objJsonResult; } //主表 oCN.RunProc("Update Gy_Driver set " + " HNumber='" + HNumber + "'" + ",HName='" + HName + "'" + ",HHelpCode='" + HHelpCode + "'" + ",HLevel='" + HLevel + "'" + ",HShortNumber='" + HShortNumber + "'" + ",HParentID=" + HParentID + ",HUSEORGID=" + HUSEORGID.ToString() + ",HCREATEORGID=" + HCREATEORGID.ToString() + ",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) + ",HModifyEmp='" + HModifyEmp + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HIDCard='" + HIDCard + "'" + ",HPhone='" + HPhone + "'" + ",HDriverCardPic='" + HDriverCardPic + "'" + ",HDriverCardType='" + HDriverCardType + "'" + ",HIDCardPic='" + HIDCardPic + "'" + ",HEmpType='" + HEmpType + "'" + ",HCompID=" + HCompID + "" + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹å项ç®ä»£ç //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); //å°ä¸çº§ ä¸ºéæ«çº§ oCN.RunProc("Update Gy_Driver set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCN.Commit(); } objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; return objJsonResult; } catch (Exception e) { //oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } /// <summary> /// è·åæå¤§åºç¡èµæID ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Gy_Department/GetMAXBillID")] [HttpGet] public object GetMAXBillID() { try { ds = oCN.RunProcReturn("select max(hitemid)+1 hitemid from Gy_Department", "Gy_Department"); 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; } } /// <summary> /// é¨é¨åè¡¨ä¿®æ¹æé®æ¹æ³ ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Gy_Department/xg")] [HttpGet] public object xg(long HInterID) { try { ds = oCN.RunProcReturn("select * from Gy_Department where HItemID=" + HInterID, "Gy_Department"); 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; } } [Route("Gy_Department/LoadTree")] [HttpGet] public object LoadTree_Json(string sWhere) { SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); ds = oCN.RunProcReturn("select * from h_v_DepartmentLoadTree", "h_v_DepartmentLoadTree"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "falseï¼"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; return objJsonResult; } } [Route("Gy_Department/SaveGy_DepartmentListApi")] [HttpPost] public object SaveGy_DepartmentListApi([FromBody] JObject oMain) { try { var model = oMain["model"].ToString(); //ååºåå model = "[" + model + "]"; List<Department> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Department>>(model); string sql = string.Empty; oCN.BeginTran(); sql = $"delete Gy_Department where HItemID = {lsmain[0].HItemID}"; oCN.RunProc(sql); sql = "set identity_insert Gy_Department on"; oCN.RunProc(sql); //主表 oCN.RunProc("Insert Into Gy_Department " + "(HItemID,HNumber,HShortNumber,HName,HParentID" + ",HLevel,HEndFlag,HRemark,HStopFlag,HUseFlag" + ",HCREATEORGID,HUSEORGID,HERPItemID" + ") " + " values('" + lsmain[0].HItemID + "','" + lsmain[0].HNumber + "','" + lsmain[0].HShortNumber + "','" + lsmain[0].HName + "',0" + ",'',0,'" + lsmain[0].HRemark + "',0,''" + "," + lsmain[0].HCreateOrgID + "," + lsmain[0].HUseOrgID + "," + lsmain[0].HItemID + ") "); sql = "set identity_insert Gy_Department off"; oCN.RunProc(sql); oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "æ°å¢åæ®æåï¼"; //objJsonResult.data = null; return objJsonResult; } catch (Exception e) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } #region [忥åºç¡èµæ] [Route("Gy_Department/Gy_DepartmentViewApi")] [HttpGet] public json Gy_DepartmentViewApi(string Number, string Type, string HUseOrgID) { string sql = string.Empty; string sReturn = ""; if (oSystemParameter.ShowBill(ref sReturn) == true) { //ç³»ç»åæ°æ¯å¦ä¸ºç§æäºæ¨¡å¼,Nä¸ºå ¬æäºæ¨¡å¼ï¼Yä¸ºç§æäºæ¨¡å¼ if (oSystemParameter.omodel.WMS_CloudMode == "Y") { #region [ç§æäºæ¨¡å¼ï¼ç´æ¥è°ç¨æ°æ®åºåå¨è¿ç¨æ´æ°] try { oCN.BeginTran(); SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); DataSet DS = oCn.RunProcReturn("exec h_p_WMS_ERPBasicInfoToLocal '" + Number + "','" + Type + "'", "h_p_WMS_ERPBasicInfoToLocal"); if (DS == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åºç¡èµæåæ¥å¤±è´¥"; objJsonResult.data = null; return objJsonResult; } else { if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HBack"]) == "2") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ERPä¸ä¸åå¨è¯¥ä»£ç "; objJsonResult.data = null; return objJsonResult; } else { 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 } else { #region [å ¬æäºæ¨¡å¼ï¼è°ç¨WEBAPIçæ¹å¼è¿è¡æ´æ°] var json = new //{ // CreateOrgId = 0, // Number = Number, // Id = "" //}; { FormId = "BD_Department", FieldKeys = "FMASTERID, FNUMBER, FNAME, FFORBIDSTATUS, FCREATEDATE, FCREATEORGID, FUSEORGID", FilterString = $@"FNUMBER = '{Number}' AND FUSEORGID = {HUseOrgID}", OrderString = "", TopRowCount = 0, StartRow = 0, Limit = 0 }; #region [éè¶é¨å] //ç»å½éè¶ var loginRet = InvokeHelper.Login(); var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); //夿æ¯å¦ç»å½æå if (isSuccess < 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = loginRet; objJsonResult.data = null; return objJsonResult; } //æ¥ç è·åæ°æ® var _result = InvokeHelper.Query("BD_Department", JsonConvert.SerializeObject(json)); var _saveObj = JArray.Parse(_result); //å¤ææ°æ®æ¯å¦è·åæå // if (_saveObj["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "éè¶é¨é¨åæ¥å¤±è´¥jsonRootï¼" + _result; // objJsonResult.data = null; // return objJsonResult; // } if (_saveObj.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "éè¶å®¢æ·åæ¥å¤±è´¥ï¼ä½¿ç¨ç»ç»å¯¹åºçé¨é¨ä»£ç æ 对åºçé¨é¨"; objJsonResult.data = null; return objJsonResult; } #endregion //è·åæ°æ® DataSet Ds; Ds = oCN.RunProcReturn("select * from Gy_Department where HNumber = '" + Number + "'", "Gy_Department"); if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HItemID"].ToString()) != 0) { } #region [è¡¨æ°æ®èµå¼] var jsonData = new // { // HItemID = _saveObj["Result"]["Result"]["Id"], // HERPItemID = _saveObj["Result"]["Result"]["Id"], // HNumber = _saveObj["Result"]["Result"]["Number"], // HName = _saveObj["Result"]["Result"]["Name"][0]["Value"], // HShortNumber = _saveObj["Result"]["Result"]["Number"], // HParentID = 0, // HLevel = 1, // HEndFlag = 1, // HStopflag = _saveObj["Result"]["Result"]["ForbidStatus"].ToString() == "A" ? 0 : 1, // HRemark = "CLD-ERPå¯¼å ¥", // HUseFlag = "已使ç¨", // HMakeTime = _saveObj["Result"]["Result"]["CreateDate"], // HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"], // HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"], // }; { HItemID = _saveObj[0][0], HERPItemID = _saveObj[0][0], HNumber = _saveObj[0][1], HName = _saveObj[0][2], HShortNumber = _saveObj[0][1], HParentID = 0, HLevel = 1, HEndFlag = 1, HStopflag = _saveObj[0][3].ToString() == "A" ? 0 : 1, HRemark = "CLD-ERPå¯¼å ¥", HUseFlag = "已使ç¨", HMakeTime = _saveObj[0][4], HCREATEORGID = _saveObj[0][5], HUSEORGID = _saveObj[0][6], }; #endregion // å é¤ä¸»è¡¨å¯¹åºæ°æ® sql = $"delete from Gy_Department where HItemID = " + jsonData.HItemID + " and HNumber = '" + Number + "'"; oCN.RunProc(sql); sql = "set identity_insert Gy_Department on"; oCN.RunProc(sql); //æå ¥è¡¨ sql = $@" insert into Gy_Department (HItemID,HERPItemID,HNumber,HName,HShortNumber,HParentID ,HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HCREATEORGID,HUSEORGID ) values ({jsonData.HItemID},{jsonData.HItemID},'{jsonData.HNumber}','{jsonData.HName}', '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}','{jsonData.HUseFlag}','{jsonData.HMakeTime}',{jsonData.HCREATEORGID},{jsonData.HUSEORGID})"; oCN.RunProc(sql); sql = "set identity_insert Gy_Department off"; oCN.RunProc(sql); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "é¨é¨åæ¥æåï¼"; objJsonResult.data = null; return objJsonResult; #endregion } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åºç¡èµæè¯»å失败ï¼"; objJsonResult.data = null; return objJsonResult; } } #endregion #region å®¡æ ¸ãåå®¡æ ¸ /// <summary> /// /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_Driver/AuditGy_Driver")] [HttpGet] public object AuditGy_Driver(int HInterID, int IsAudit, string CurUserName) { try { ////å®¡æ ¸æé //if (!DBUtility.ClsPub.Security_Log_second("Gy_Department_Check", 1, false, CurUserName)) //{ // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; // objJsonResult.data = null; // return objJsonResult; //} var ds = oCN.RunProcReturn("select * from Gy_Driver where HItemID=" + HInterID, "Gy_Driver"); 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_Driver 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_Driver 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; } } #endregion #region ç¦ç¨ãåç¦ç¨ /// <summary> /// /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsStop">ç¦ç¨(0),åç¦ç¨(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_Driver/StopGy_Driver")] [HttpGet] public object StopGy_Driver(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé //if (!DBUtility.ClsPub.Security_Log_second("Gy_Department_Stop", 1, false, CurUserName)) //{ // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; // objJsonResult.data = null; // return objJsonResult; //} var ds = oCN.RunProcReturn("select * from Gy_Driver where HItemID=" + HInterID, "Gy_Driver"); 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_Driver 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_Driver 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 #region é¨é¨å表 æä»¶ä¸ä¼ //[Route("Gy_Department/Gy_Process_Excel")] //[HttpPost] //public json Gy_Department_Excel() //{ // json res = new json(); // try // { // //è·åæä»¶åç§° // var file = HttpContext.Current.Request.Files[0]; // //è·åæä»¶ç©çè·¯å¾ // string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName); // //ä¿åæä»¶ // file.SaveAs(ExcelPath); // NpoiHelper np = new NpoiHelper(); // DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0"); // //å 餿件 // File.Delete(ExcelPath); // //å建临æ¶è¡¨ // DataTable provisional = new DataTable("dt2"); // //æ·»å åå // for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++) // { // provisional.Columns.Add(ExcelDs.Tables[0].Rows[0][i].ToString()); // } // //æ·»å æ°æ® // for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++) // { // DataRow row = provisional.NewRow(); // for (int j = 0; j < ExcelDs.Tables[0].Columns.Count; j++) // { // row[j] = ExcelDs.Tables[0].Rows[i][j].ToString(); // } // provisional.Rows.Add(row); // } // //夿å // string error = JudgmentColumns(provisional); // if (error.Length > 0) // { // res.code = "0"; // res.count = 0; // res.Message = $"Excel模æ¿åå¨é误,{error}\r\n"; // res.data = null; // return res; // } // for (int i = 0; i <= provisional.Rows.Count - 1; i++) // { // string HNumber = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["é¨é¨ä»£ç "].ToString()); // string HName = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["é¨é¨åç§°"].ToString()); // string HEmpNumber = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["è´è´£äººä»£ç "].ToString()); // string HEmpName = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["è´è´£äººåç§°"].ToString()); // string HBarCode = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["æ¡å½¢ç "].ToString()); // string HHelpCode = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["å©è®°ç "]); // string HRemark = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["夿³¨"].ToString()); // //夿è´è´£äººæ¯å¦åå¨ // if (JudgeEmp(HEmpNumber, HEmpName)) // { // res.code = CodeConstant.FAIL; // res.count = CountConstant.FAIL; // res.Message = "å½åèåä¸åå¨"; // res.data = null; // return res; // } // //è·åçå®è¡æ° // int line = i + 1; // } // res.code = "1"; // res.count = 1; // res.Message = error; // res.data = provisional; // return res; // } // catch (Exception e) // { // res.code = "0"; // res.count = 0; // res.Message = "Exceptionï¼" + e.ToString(); // res.data = null; // return res; // } //} /// <summary> /// 夿å½åè忝å¦åå¨ /// </summary> /// <param name="HEmpNumber"></param> /// <param name="HEmpName"></param> /// <returns></returns> //private bool JudgeEmp(string HEmpNumber, string HEmpName) //{ // if (!String.IsNullOrEmpty(HEmpNumber) && !String.IsNullOrEmpty(HEmpName)) // { // DataSet emp = oCN.RunProcReturn("select * from Gy_Employee where HNumber = '" + HEmpNumber + "' and HName = '" + HEmpName + "'", "Gy_Employee"); // return emp.Tables[0].Rows.Count <= EmptyConstant.EMPTY ? true : false; // } // return false; //} /// <summary> /// 夿å /// </summary> /// <param name="provisional"></param> /// <returns></returns> private static string JudgmentColumns(DataTable provisional) { var error = ""; //æ¥è¯¢æ²¡æçå if (!provisional.Columns.Contains("é¨é¨ä»£ç ")) error += "æ²¡ææ¾å°ãé¨é¨ä»£ç ãçæ é¢,"; if (!provisional.Columns.Contains("é¨é¨åç§°")) error += "æ²¡ææ¾å°ãé¨é¨åç§°ãçæ é¢,"; return error; } #endregion #region é¨é¨å表 å¯¼å ¥(ä¿å) [Route("Gy_Department/Gy_Process_btnSave")] [HttpPost] public object Gy_InspectBasis_btnSave([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 user = sArray[1].ToString(); string organ = sArray[2].ToString(); json res = new json(); try { if (!DBUtility.ClsPub.Security_Log("Gy_Group_Edit", 1, false, user)) { res.code = "0"; res.count = 0; res.Message = "æ ä¿åæéï¼"; res.data = null; return res; } List<object> Excel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(msg2); List<Dictionary<string, string>> list = new List<Dictionary<string, string>>(); foreach (JObject item in Excel) { Dictionary<string, string> dic = new Dictionary<string, string>(); foreach (var itm in item.Properties()) { dic.Add(itm.Name, itm.Value.ToString()); } list.Add(dic); } oCN.BeginTran(); int i = 1; foreach (Dictionary<string, string> item in list) { string HNumber = item["é¨é¨ä»£ç "].ToString(); string HName = item["é¨é¨åç§°"].ToString(); string HEmpNumber = item["è´è´£äººä»£ç "].ToString(); string HEmpName = item["è´è´£äººåç§°"].ToString(); string HBarCode = item["æ¡å½¢ç "].ToString(); string HHelpCode = item["å©è®°ç "].ToString(); string HRemark = item["夿³¨"].ToString(); int HEmpID = 0; if (!String.IsNullOrEmpty(HEmpName) && !String.IsNullOrEmpty(HEmpNumber)) { DataSet emp = oCN.RunProcReturn("select HItemID from Gy_Employee where HNumber = '" + HEmpNumber + "' and HName = '" + HEmpName + "'", "Gy_Employee"); HEmpID = (int)emp.Tables[0].Rows[0]["HItemID"]; } string sShortNumber; sShortNumber = DBUtility.ClsPub.GetShortNumber(HNumber);//ç代ç if (sShortNumber.Trim() == "") { res.code = "0"; res.count = 0; res.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; res.data = 1; return res; } int HEndFlag = 1;//æ«çº§æ å¿ int HLevel = DBUtility.ClsPub.GetLevel(HNumber); //ç级 if (!DBUtility.ClsPub.AllowNumber(HNumber.Trim())) { res.code = "0"; res.count = 0; res.Message = "ä¿å失败ï¼ä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; res.data = 1; return res; } ds = oCN.RunProcReturn("select * from Gy_Department where HNumber='" + HNumber + "'", "Gy_InspectInstruMent"); if (ds.Tables[0].Rows.Count == 0) { string sql = "insert into Gy_Department (HName,HNumber,HShortNumber,HLevel,HHelpCode,HParentID,HStopflag,HEndFlag,HRemark,HUseFlag, HUSEORGID, HCREATEORGID, HEmpID, HBarCodeForBase)" + $"values('{HName}', '{HNumber}', '{sShortNumber}',{HLevel},'',0,'0','0','{HRemark}', 'æªä½¿ç¨', '{organ}', '{organ}', '{HEmpID}', '{HBarCode}')"; oCN.RunProc(sql); } else { oCN.RunProc("update Gy_Department set HName ='" + HName + "' , HHelpCode = '" + HHelpCode + " ', HBarCodeForBase = '" + HBarCode + "', HEmpID = '" + HEmpID + "', HModifyEmp = '" + user + "', HModifyTime = '" + System.DateTime.Now.ToString("G") + "' where HNumber= '" + HNumber + "'"); } i++; } oCN.Commit(); res.code = "1"; res.count = 1; res.Message = "å¯¼å ¥æå!"; res.data = null; return res; } catch (Exception e) { LogService.Write(e); res.code = "0"; res.count = 0; res.Message = "Exceptionï¼" + e.ToString(); res.data = null; return res; } } #endregion } } WebAPI/Controllers/QC_ManagementController.cs
@@ -1083,6 +1083,7 @@ msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_QCCheckProjectMain(msg2); string ts; foreach (Model.ClsGy_QCCheckProjectMain oItem in lsmain) { //oItem.HMaker = ""; @@ -1107,6 +1108,7 @@ return objJsonResult; } oBill.omodel = oItem; ts = oItem.HCheckBillType; } //è¡¨ä½æ°æ® //æ },{æ¥æåæ°ç» //廿ãåã WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -14989,5 +14989,526 @@ #endregion #region å¨å ·æ ¡åè®°å½å #region æ¨¡å ·æ ¡åè®°å½å表å页å表 [Route("Gy_QCVerificationBillMain/GetListPage")] [HttpGet] public object GetListPage(string sWhere, string user, int page, int size) { try { List<object> columnNameList = new List<object>(); if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBillList", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("exec h_p_Gy_QCVerificationBillMainList " + page + "," + size + ",'" + sWhere + "'", "h_p_Gy_QCVerificationBillMainList"); } else { sWhere = sWhere.Replace("'", "''"); ds = oCN.RunProcReturn("exec h_p_Gy_QCVerificationBillMainList " + page + "," + size + ",'" + sWhere + "'", "h_p_Gy_QCVerificationBillMainList"); } //æ·»å åå 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 = CodeConstant.SUCCEED; objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception ex) { objJsonResult.code = CodeConstant.FAIL; objJsonResult.count = CountConstant.FAIL; objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + ex.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region [å¨å ·æ ¡ååå é¤åè½] /// <summary> /// æ¨¡å ·ç»´ä¿®åå é¤åè½ /// </summary> /// <returns></returns> [Route("Gy_QCVerificationBillMain/DeltetGy_QCVerificationBillMain")] [HttpGet] public object DeltetGy_QCVerificationBillMain(string HInterID, string user) { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); if (lngBillKey == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ID为空ï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsGy_QCVerificationBillMain oBill = new DAL.ClsGy_QCVerificationBillMain(); if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) { if (oBill.omodel.HBillStatus > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æ,ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HChecker != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç»å®¡æ ¸,ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } //å é¤åæ§å¶========================================= string sql1 = "exec h_p_Sb_MouldRepairWorkBill_BeforeDelCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Sb_MouldRepairWorkBill_BeforeDelCtrl"); 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]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } //================================================================================== bool IsDete = oBill.DeleteBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sb_MouldRepairWorkBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); if (IsDete) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªæ¾å°"; objJsonResult.data = null; return objJsonResult; } } #endregion #region [æ¨¡å ·ç»´ä¿®åå®¡æ ¸ãåå®¡æ ¸] /// <summary> /// /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_QCVerificationBillMain/AuditQCVerificationBillMain")] [HttpGet] public object AuditQCVerificationBillMain(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "Sb_MouldRepairWorkBill_Check"; DBUtility.ClsPub.CurUserName = CurUserName; try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); DAL.ClsGy_QCVerificationBillMain oBill = new DAL.ClsGy_QCVerificationBillMain(); //æ¥çæ¯å¦å·²å®¡æ ¸,å ³é,ä½åº if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) { if (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0) //å®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0) //å®¡æ ¸æäº¤ { //å®¡æ ¸åæ§å¶========================================= string sql1 = "exec h_p_Sb_MouldRepairWorkBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Sb_MouldRepairWorkBill_BeforeCheckCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :å®¡æ ¸åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; objJsonResult.data = null; oCN.RollBack(); return objJsonResult; } if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; oCN.RollBack(); return objJsonResult; } //================================================================================== if (!oBill.CheckBill(HInterID, oBill.omodel.HBillNo, "h_p_Sb_MouldRepairWorkBill_AfterCheckCtrl", CurUserName, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸æäº¤ { //åå®¡æ ¸åæ§å¶========================================= string sql1 = "exec h_p_Sb_MouldRepairWorkBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Sb_MouldRepairWorkBill_BeforeUnCheckCtrl"); 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]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } //=========================================================== if (!oBill.AbandonCheck(HInterID, oBill.omodel.HBillNo, "h_p_Sb_MouldRepairWorkBill_AfterUnCheckCtrl", CurUserName, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } objJsonResult.code = "1"; 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("Gy_QCVerificationBillMain/Gy_QCVerificationBillMainCheckDetai")] [HttpGet] public ApiResult<DataSet> Gy_QCVerificationBillMainCheckDetai(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCVerificationBillMain where hmainid= " + HID + " ", "h_v_Gy_QCVerificationBillMain"); 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 }; } #endregion #region[ç¼è¾æ¶è·åè¡¨ä½æ°æ®] [Route("Gy_QCVerificationBillMain/SGy_QCVerificationBillMainListProjectDetai")] [HttpGet] public object SGy_QCVerificationBillMainListProjectDetai(string sqlWhere) { DataSet ds, ds1; List<object> list = new List<object>(); try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); string sql = "select HInspectInstruMentID,æ£éªä»ªå¨ä»£ç HInspectInstruMentNumber,æ£éªä»ªå¨åç§° HInspectInstruMentName,çææ¥æ HBeginDate,å¤±ææ¥æ HEndDate,æ ¡åç¶æ HHCalibrationStatus from h_v_Gy_QCVerificationBillMain where 1 = 1 " + sqlWhere; ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit"); list.Add(ds.Tables[0]); objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; objJsonResult.data = null; objJsonResult.list = list; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); objJsonResult.data = null; } return objJsonResult; } #endregion #region æ¨¡å ·ç»´ä¿®è®°å½åä¿å/ç¼è¾ /// <summary> /// ä¿åæ¨¡å ·ç»´ä¿®å /// </summary> /// <param name="msg"></param> /// <returns></returns> [Route("Gy_QCVerificationBillMain/SaveGetMQCVerificationBillList")] [HttpPost] public object SaveGetMQCVerificationBillList([FromBody] JObject msg) { var _value = msg["msg"].ToString(); string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); string msg4 = sArray[2].ToString(); //string msg5 = sArray[3].ToString(); string UserName = ""; ListModels oListModels = new ListModels(); try { if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsGy_QCVerificationBillMain oBill = new DAL.ClsGy_QCVerificationBillMain(); List<Model.ClsGy_QCVerificationBillMain> lsmain = new List<Model.ClsGy_QCVerificationBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_QCVerificationBillMain(msg2); foreach (Model.ClsGy_QCVerificationBillMain oItem in lsmain) { oItem.HMaker = msg4; UserName = msg4; //å¶å人 oItem.HBillType = "3321"; oItem.HBillSubType = "3321"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; oItem.HCheckEmp = oItem.HEmpID; //维修人(Gy_Employee) //oItem.HDeptID = 0; //ç»´ä¿®é¨é¨(Gy_Department) //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); 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 //msg2 = msg2.Replace("'", "â"); List<Model.ClsGy_QCVerificationBillSub> ls = new List<Model.ClsGy_QCVerificationBillSub>(); ls = oListModels.getObjectByJson_Gy_QCVerificationBillSub(msg3); int i = 0; foreach (Model.ClsGy_QCVerificationBillSub oItem in ls) { i++; oItem.HEntryID = i; //oItemSub.HCloseMan = ""; //è¡å ³é oItem.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItem.HCloseType = false; //å ³éç±»å //oItem.HInspectInstruMentID =1; //夿³¨ //oItem.HRelationQty = 0; //å ³èæ°é //oItem.HBeginDate = DateTime.Now.ToString(); //å ³èæ°é //oItem.HEndDate = DateTime.Now.AddYears(1).ToString(); //å ³èæ°é //oItem.HHCalibrationStatus = "åæ ¼"; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItem); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); 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 #endregion } } WebAPI/ListModels.cs
@@ -699,7 +699,17 @@ return list; } /// <summary> /// å¤çæ£éªä»ªå¨è®°å½åçjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_QCVerificationBillMain> getObjectByJson_Gy_QCVerificationBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_QCVerificationBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_QCVerificationBillMain>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢æ¨¡å ·ç»´ä¿®å表ä¿å »ä¿¡æ¯çjson /// </summary> @@ -723,6 +733,18 @@ List<Model.ClsSb_MouldRepairWorkBillSub_Item> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_MouldRepairWorkBillSub_Item>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢æ¨¡å ·ç»´ä¿®å表é ä»¶ä¿¡æ¯çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_QCVerificationBillSub> getObjectByJson_Gy_QCVerificationBillSub(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_QCVerificationBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_QCVerificationBillSub>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢æ¨¡å ·ç»´ä¿®éªæ¶å主表çjson WebAPI/Models/Driver.cs
New file @@ -0,0 +1,40 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebAPI.Models { public class Driver { public long HItemID { get; set; } public string HNumber { get; set; } public string HName { get; set; } public string HShortNumber { get; set; } public string HRemark { get; set; } public string HUseFlag { get; set; } public long HParentID { get; set; } public long HCREATEORGID { get; set; } public long HUSEORGID { get; set; } public string HHelpCode { get; set; } public int? HStopflag { get; set; } public string HModifyEmp { get; set; } public string HStopEmp { get; set; } public string HStopTime { get; set; } public string HModifyTime { get; set; } public string HCheckTime { get; set; } public string HMakeTime { get; set; } public string HMakeEmp { get; set; } //zidingyi public string HIDCard { get; set; } public string HPhone { get; set; } public string HDriverCardPic { get; set; } public string HDriverCardType { get; set; } public string HIDCardPic { get; set; } public string HEmpType { get; set; } public int HCompID { get; set; } } } WebAPI/WebAPI.csproj
@@ -374,6 +374,7 @@ <Compile Include="Controllers\BaseSet\Gy_BarCodeBillController.cs" /> <Compile Include="Controllers\BaseSet\Gy_ConkTypeController.cs" /> <Compile Include="Controllers\BaseSet\Gy_ColorClassController.cs" /> <Compile Include="Controllers\BaseSet\Gy_DriverController.cs" /> <Compile Include="Controllers\BaseSet\Gy_ICBomBillController.cs" /> <Compile Include="Controllers\BaseSet\Gy_WorkDayController.cs" /> <Compile Include="Controllers\BaseSet\Gy_PackTypeController.cs" /> @@ -659,6 +660,7 @@ <Compile Include="Models\ClsWW_EntrustOrderBillMainSub.cs" /> <Compile Include="Models\ClsWW_PPBomBill.cs" /> <Compile Include="Models\ClsWW_EntrustOrderBillMain_1.cs" /> <Compile Include="Models\Driver.cs" /> <Compile Include="Models\GroupOrderBill.cs" /> <Compile Include="Models\ClsGy_PNLInfoSub.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_ProcMulController.cs" /> @@ -1234,6 +1236,7 @@ <Folder Include="Views\Gy_COMMONCONTACTBill\" /> <Folder Include="Views\Gy_ConkType\" /> <Folder Include="Views\Gy_CustLocation\" /> <Folder Include="Views\Gy_Driver\" /> <Folder Include="Views\Gy_DutyBill\" /> <Folder Include="Views\Gy_EquipStatus\" /> <Folder Include="Views\Gy_EquipType\" />