| DAL/DAL.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| DAL/车间管理/ClsSc_EmployeeSignInNoteBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Model/Model.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Model/车间管理/ClsSc_EmployeeSignInNoteBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Model/车间管理/ClsSc_EmployeeSignInNoteBillSub.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/Controllers/Sc_EmployeeSignInNoteBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/ListModels.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/DAL.csproj
@@ -721,6 +721,7 @@ <Compile Include="è´¨æ£ç®¡ç\ClsCrm_CustomerAppealBill.cs" /> <Compile Include="è´¨æ£ç®¡ç\ClsGy_EnvironmentTestSchemeBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsGy_MaterPreventErrMouldBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_EmployeeSignInNoteBill.cs" /> <Compile Include="车é´ç®¡ç\ClsQc_PreventErrMouldCheckBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsGy_WorkBeginDotCheckListBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsCJ_WIPBeginStockBill.cs" /> DAL/³µ¼ä¹ÜÀí/ClsSc_EmployeeSignInNoteBill.cs
New file @@ -0,0 +1,295 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsSc_EmployeeSignInNoteBill : DBUtility.ClsXt_BaseBill { public Model.ClsSc_EmployeeSignInNoteBill omodel = new Model.ClsSc_EmployeeSignInNoteBill(); public List<Model.ClsSc_EmployeeSignInNoteBillSub> DetailColl = new List<Model.ClsSc_EmployeeSignInNoteBillSub>(); public ClsSc_EmployeeSignInNoteBill() { base.MvarItemKeySub = "Sc_EmployeeSignInNoteBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey= "Sc_EmployeeSignInNoteBillMain"; base.MvarReportTitle = "åå·¥ç¾å°è®°å½å"; base.BillType = "4616"; base.HBillSubType = "4616"; } #region åºå®ä»£ç ~ClsSc_EmployeeSignInNoteBill() { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { // oCn.BeginTran(); //ä¿ååæ§å¶========================================= string HBillNote = ""; DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Gy_QCVerificationBill_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; } //========================================================= //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sc_EmployeeSignInNoteBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== ",HDate='" + omodel.HDate + "'" + ",HYear='" + omodel.HYear.ToString() + "'" + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + ",HRemark='" + omodel.HRemark + "'" + ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + ",HUpDateDate=getdate()" + //======================================== ",HChecker=" + omodel.HCheckEmp.ToString() + ",HDeptID=" + omodel.HDeptID.ToString() + ",HMainSourceBillType='"+ omodel.HMainSourceBillType+"'"+ ",HMainSourceBillNo='" + omodel.HMainSourceBillNo + "'" + ",HMainSourceInterID=" + omodel.HMainSourceInterID.ToString()+ ",HEquipID =" + omodel.HEquipID.ToString()+ ",HMouldID =" + omodel.HMouldID.ToString()+ ",HSourceID =" + omodel.HSourceID.ToString()+ ",HProcID =" + omodel.HProcID.ToString()+ ",HGroupID =" + omodel.HGroupID.ToString()+ ",HShiftsID =" + omodel.HShiftsID.ToString()+ ",HSignInReason ='" + omodel.HSignInReason.ToString()+"'"+ ",HEmpID ='" + omodel.HEmpID.ToString()+ "'" + " where HInterID=" + lngBillKey.ToString()); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); oCn.RunProc("delete from Sc_EmployeeSignInNoteBillSub where HInterID=" + lngBillKey); //æå ¥å表 omodel.HInterID = lngBillKey; foreach (Model.ClsSc_EmployeeSignInNoteBillSub oSub in DetailColl) { oCn.RunProc("Insert into Sc_EmployeeSignInNoteBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ") 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() + ") "); } //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Gy_QCVerificationBill_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 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_Gy_QCVerificationBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_QCVerificationBill_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; } //========================================================= oCn.BeginTran(); oCn.RunProc("Insert Into Sc_EmployeeSignInNoteBillMain " + "(HBillType,HBillSubType,HBillNo,HDate" + ",HYear,HPeriod,HRemark,HMaker,HMakeDate," + "HMainSourceBillType,HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID," + "HEquipID,HMouldID,HSourceID,HProcID,HGroupID,HShiftsID,HSignInReason,HSignRemark," + "HChecker,HDeptID,HEmpID,HOrgID) " + "values('" + (this.BillType ?? "") + "','" + (this.HBillSubType ?? "") + "'," + "'" + (omodel.HBillNo ?? "") + "','" + (omodel.HDate.ToString() ?? "") + "'" + "," + (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.HEquipID.ToString() ?? "0") + "," + (omodel.HMouldID.ToString() ?? "0") + "," + (omodel.HSourceID.ToString() ?? "0") + "," + (omodel.HProcID.ToString() ?? "0") + "," + (omodel.HGroupID.ToString() ?? "0") + "," + (omodel.HShiftsID.ToString() ?? "0") + ",'" + (omodel.HSignInReason?.ToString() ?? "0") + "','" + (omodel.HSignRemark?.ToString() ?? "") + "'," + (omodel.HCheckEmp.ToString() ?? "0") + "," + (omodel.HDeptID.ToString() ?? "0") + "," + (omodel.HEmpID.ToString() ?? "0") + "," + (omodel.HOrgID.ToString() ?? "0") + ")"); //主表 //æå ¥å表 foreach (Model.ClsSc_EmployeeSignInNoteBillSub oSub in DetailColl) { oCn.RunProc("Insert into Gy_QCVerificationBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + "" + ") 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() + ") "); } //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1", "h_p_Gy_QCVerificationBill_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.ClsSc_EmployeeSignInNoteBillSub oSub = new Model.ClsSc_EmployeeSignInNoteBillSub(); // åºå®èµå¼=============================================== 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
@@ -771,6 +771,8 @@ <Compile Include="è´¨æ£ç®¡ç\ClsGy_EnvironmentTestSchemeBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsGy_MaterPreventErrMouldBillMain.cs" /> <Compile Include="è´¨æ£ç®¡ç\ClsGy_EnvironmentTestSchemeBillSub.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_EmployeeSignInNoteBillSub.cs" /> <Compile Include="车é´ç®¡ç\ClsSc_EmployeeSignInNoteBill.cs" /> <Compile Include="车é´ç®¡ç\ClsQc_PreventErrMouldCheckBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsGy_WorkBeginDotCheckListBillMain.cs" /> <Compile Include="车é´ç®¡ç\ClsCJ_WIPBeginStockBillMain.cs" /> Model/³µ¼ä¹ÜÀí/ClsSc_EmployeeSignInNoteBill.cs
New file @@ -0,0 +1,27 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsSc_EmployeeSignInNoteBill : DBUtility.ClsXt_BaseBillMain { public Int64 HCheckEmp;// public Int64 HDeptID;// public Int64 HEmpID;// public Int64 HOrgID; public Int64 HEquipID; public Int64 HMouldID; public Int64 HSourceID; public Int64 HProcID; public Int64 HGroupID; public Int64 HShiftsID; public string HSignInReason; public string HSignRemark; } } Model/³µ¼ä¹ÜÀí/ClsSc_EmployeeSignInNoteBillSub.cs
New file @@ -0,0 +1,16 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsSc_EmployeeSignInNoteBillSub : DBUtility.ClsXt_BaseBillSub { } } WebAPI/Controllers/Sc_EmployeeSignInNoteBillController.cs
New file @@ -0,0 +1,402 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Net; using System.Net.Http; using System.Web; using System.Web.Http; using WebAPI.Models; namespace WebAPI.Controllers { public class Sc_EmployeeSignInNoteBillController : ApiController { public DBUtility.ClsPub.Enum_BillStatus BillStatus;//åæ®ç¶æï¼æ°å¢ï¼ä¿®æ¹ï¼æµè§ï¼æ´æ°åä»·ï¼åæ´ï¼ private json objJsonResult = new json(); public DataSet ds = new DataSet(); public DataSet ds1 = new DataSet(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); #region å页å表 [Route("Sc_EmployeeSignInNoteBillController/GetListPage")] [HttpGet] public object GetListPage(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); if (!DBUtility.ClsPub.Security_Log("Gy_QCVerificationBillMain_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("select * from h_v_Sc_EmployeeSignInNoteBill order by åæ®å· desc", "h_v_Sc_EmployeeSignInNoteBill"); } else { string sql1 = "select * from h_v_Sc_EmployeeSignInNoteBill where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_Sc_EmployeeSignInNoteBill"); } //æ·»å åå 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 ex) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + ex.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region æ ¹æ®æºåä¼ ç©æå表 [Route("WLYayBillController/GetMesByOrginBill_1")] [HttpGet] public object GetMesByOrginBill_1(string ListMaterial) { try { if (ListMaterial.EndsWith(";")) { ListMaterial = ListMaterial.Remove(ListMaterial.Length - 1); } ListMaterial = ListMaterial.Replace(';', ','); List<object> columnNameList = new List<object>(); ds = oCN.RunProcReturn("select a.*,b.HUnitID from h_v_Gy_MaterialPackingRelationList_Edit a left JOIN Gy_Material b on a.HMaterID=b.HItemID where HDefaultSendPackFlag=1 and å®¡æ ¸äºº='' and HMaterID in (" + ListMaterial + ")", "h_v_Gy_MaterialPackingRelationList"); //æ·»å åå 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 ex) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + ex.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region ä¿å/ç¼è¾ [Route("Sc_EmployeeSignInNoteBillController/SaveBill")] [HttpPost] public object SaveBill([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(); ListModels oListModels = new ListModels(); try { if (!DBUtility.ClsPub.Security_Log("Gy_QCVerificationBillMain_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsSc_EmployeeSignInNoteBill oBill = new DAL.ClsSc_EmployeeSignInNoteBill(); List<Model.ClsSc_EmployeeSignInNoteBill> lsmain = new List<Model.ClsSc_EmployeeSignInNoteBill>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Sc_EmployeeSignInNoteBill(msg2); foreach (Model.ClsSc_EmployeeSignInNoteBill oItem in lsmain) { oItem.HMaker = msg4; DBUtility.ClsPub.CurUserName = msg4; //å¶å人 oItem.HBillType = "4616"; oItem.HBillSubType = "4616"; 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")); oItem.HCheckEmp = oItem.HEmpID; 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.ClsSc_EmployeeSignInNoteBillSub> ls = new List<Model.ClsSc_EmployeeSignInNoteBillSub>(); //ls = oListModels.getObjectByJson_Sc_EmployeeSignInNoteBillSub(msg3); //int i = 0; //foreach (Model.ClsSc_EmployeeSignInNoteBillSub oItem in ls) //{ // i++; // oItem.HEntryID = i; // oItem.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItem.HCloseType = false; //å ³éç±»å // oBill.DetailColl.Add(oItem); //} //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { 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 = "ä¿åæåï¼"; 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_EmployeeSignInNoteBillController/Sc_EmployeeSignInNoteBilldetail")] [HttpGet] public ApiResult<DataSet> Sc_EmployeeSignInNoteBilldetail(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 * from h_v_Sc_EmployeeSignInNoteBill where HInterID= " + HID + " ", "h_v_Sc_EmployeeSignInNoteBill"); 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 å®¡æ ¸ãåå®¡æ ¸ /// <summary> /// /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("WLYayBillController/AuditWLYayBill1")] [HttpGet] public object AuditWLYayBill(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_Supplier_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); if (ds.Tables[0].Rows.Count > 0) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HChecker"].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 WL_YayBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() ,HBillStatus=2 where HInterID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update WL_YayBillMain set HChecker='',HCheckDate=null,HBillStatus=1 where HInterID=" + 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("Sc_EmployeeSignInNoteBillController/APP_Edit_json")] //[HttpPost] //public object APP_Edit_json(int HInterID,string HBarCode) //{ // DataSet ds = oCN.RunProcReturn("select * from Gy_EquipFileBillMain where HBarCode='"+ HBarCode+"'", "Gy_EquipFileBillMain"); // if(ds!=null||ds.Tables.Count>0) // { // var EquipmentID = ds.Tables[0].Rows[0]["HInterID"]; // DataSet dds = oCN.RunProcReturn("exec h_p_SB_HEquipHMould_Query "+ EquipmentID, "h_p_SB_HEquipHMould_Query"); // if(dds != null || dds.Tables.Count > 0) // { // } // } //} //#endregion [Route("WLYayBillController/updateBillMEs1")] [HttpGet] public object updateBillMEs(int HInterID,int HEntryID, int ScatteredVolume, string CurUserName) { var ds = oCN.RunProcReturn("select * from WL_YayBillMain a inner join WL_YayBillSub_Material b on b.HInterID=a.HInterID where a.HInterID=" + HInterID, "WL_YayBillMain"); if (ds != null || ds.Tables[0].Rows.Count <= 0) { oCN.BeginTran(); oCN.RunProc("update WL_YayBillSub_Material set HScatteredVolume= " + ScatteredVolume + " where HInterID=" + HInterID+ "and HEntryID="+ HEntryID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "æå"; objJsonResult.data = null; oCN.Commit(); return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ´æ°å¤±è´¥ï¼"; objJsonResult.data = null; return objJsonResult; } } } } WebAPI/ListModels.cs
@@ -700,7 +700,7 @@ } /// <summary> /// å¤çæ£éªä»ªå¨è®°å½åçjson /// å¤çæ£éªä»ªå¨è®°å½åçjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> @@ -708,6 +708,17 @@ { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_QCVerificationBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_QCVerificationBillMain>>(jsonString); return list; } /// <summary> /// å¤çæ£éªä»ªå¨è®°å½åçjson ClsSc_EmployeeSignInNoteBill /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsSc_EmployeeSignInNoteBill> getObjectByJson_Sc_EmployeeSignInNoteBill(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsSc_EmployeeSignInNoteBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_EmployeeSignInNoteBill>>(jsonString); return list; } /// <summary> @@ -755,8 +766,18 @@ List<Model.ClsGy_QCVerificationBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_QCVerificationBillSub>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢æ¨¡å ·ç»´ä¿®å表é ä»¶ä¿¡æ¯çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsSc_EmployeeSignInNoteBillSub> getObjectByJson_Sc_EmployeeSignInNoteBillSub(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsSc_EmployeeSignInNoteBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_EmployeeSignInNoteBillSub>>(jsonString); return list; } public List<Model.ClsWL_YayBillMainBillSub> getObjectByJson_WL_YayBillMainBillSub(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; WebAPI/WebAPI.csproj
@@ -477,6 +477,7 @@ <Compile Include="Controllers\SCGL\æ¥è®¡å管ç\JIT_DayPlanPlatFormBill_TKController.cs" /> <Compile Include="Controllers\SCGL\æ¥è®¡å管ç\Xs_SendGoodsPlanBillController.cs" /> <Compile Include="Controllers\WLGL\Cg_CarTrajectoryBillController.cs" /> <Compile Include="Controllers\Sc_EmployeeSignInNoteBillController.cs" /> <Compile Include="Controllers\XSGL\Crm_ComplainVisitBillController.cs" /> <Compile Include="Controllers\XSGL\Xs_SellOutBillList_SecController.cs" /> <Compile Include="Controllers\XSGL\Xs_SeQuotationBillController.cs" />