DAL/DAL.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DAL/生产管理/设备管理/ClsGy_FixCardBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/Model.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/生产管理/设备管理/ClsGy_FixCardBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/生产管理/设备管理/ClsGy_FixCardBillSub_Emp.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/SBGL/Gy_FixCardBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/DLL/ClsSc_ICMOReportBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/ListModels.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/DAL.csproj
@@ -626,6 +626,7 @@ <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsSc_MouldStatusChangeBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_EquipFileMain.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_EquipTypeBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_FixCardBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipWorkBeforeCheckBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipStockInCheckBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipSparepartsBill.cs" /> DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsGy_FixCardBill.cs
New file @@ -0,0 +1,239 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsGy_FixCardBill : DBUtility.ClsXt_BaseBill { public Model.ClsGy_FixCardBillMain omodel = new Model.ClsGy_FixCardBillMain(); public List<Model.ClsGy_FixCardBillSub_Emp> DetailColl = new List<Model.ClsGy_FixCardBillSub_Emp>(); public ClsGy_FixCardBill() { base.MvarItemKeySub = "Gy_FixCardBillSub_Emp"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey= "Gy_FixCardBillMain"; base.MvarReportTitle="åºå®èµäº§å¡ç"; base.BillType = "3335"; base.HBillSubType = "3335"; } #region åºå®ä»£ç ~ClsGy_FixCardBill() { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { // oCn.BeginTran(); //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Gy_FixCardBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== ",HRemark='" + omodel.HRemark + "'" + ",HUpDater='" + omodel.HMaker + "'" + ",HUpDateDate=getdate()" + //======================================== ",HCardNumber='" + omodel.HCardNumber + "'" + ",HCardName='" + omodel.HCardName + "'" + ",HCardModel ='" + omodel.HCardModel + "'" + ",HMaterID='" + omodel.HMaterID + "'" + ",HUnitID='" + omodel.HUnitID + "'" + ",HCardQty='" + omodel.HCardQty + "'" + ",HCardForm='" + omodel.HCardForm + "'" + ",HCard='" + omodel.HCard + "'" + ",HOutComDate='" + omodel.HOutComDate + "'" + ",HOutComNo='" + omodel.HOutComNo + "'" + ",HBeginUseDate='" + omodel.HBeginUseDate + "'" + ",HCardTypeID='" + omodel.HCardTypeID + "'" + ",HCardStatusID='" + omodel.HCardStatusID + "'" + ",HCardChangeTypeID='" + omodel.HCardChangeTypeID + "'" + ",HBarCode='" + omodel.HBarCode + "'" + ",HWorkArea='" + omodel.HWorkArea + "'" + ",HLogo='" + omodel.HLogo + "'" + ",HSellSupID='" + omodel.HSellSupID + "'" + ",HMakeSupID='" + omodel.HMakeSupID + "'" + ",HOrgID='" + omodel.HOrgID + "'" + ",HOwnerID='" + omodel.HOwnerID + "'" + " where HInterID=" + lngBillKey.ToString()); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 DeleteBillSub(lngBillKey); //æå ¥å表 omodel.HInterID = lngBillKey; foreach (Model.ClsGy_FixCardBillSub_Emp oSub in DetailColl) { oCn.RunProc("Insert into Gy_FixCardBillSub_Emp " + " (HInterID,HBillNo_bak ,HEntryID,HRemark," + "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + "HDeptID,HUseEmpID,HRepairEmpID,HCardAddr,HAddress,HSetupDate,HAvgRate,HProjectMoneyID," + "HBeginDate,HEndDate" + ") values(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HDeptID + "," + oSub.HUseEmpID + "," + oSub.HRepairEmpID + ",'" + oSub.HCardAddr + "','" + oSub.HAddress + "','" + oSub.HSetupDate + "'," + oSub.HAvgRate + "," + oSub.HProjectMoneyID + ",'" + oSub.HBeginDate + "','" + oSub.HEndDate + "'" + ") "); } 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); //è¥MAINDIéå¤åéæ°è·å oCn.BeginTran(); //主表 oCn.RunProc("Insert Into Gy_FixCardBillMain" + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HYear,HPeriod,HRemark,HBillStatus," + "HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo," + "HCardNumber,HCardName,HCardModel,HMaterID,HUnitID,HCardQty,HCardForm,HCard,HOutComDate,HOutComNo,HBeginUseDate," + "HCardTypeID,HCardStatusID,HCardChangeTypeID,HBarCode,HWorkArea,HLogo,HSellSupID,HMakeSupID,HOrgID,HOwnerID" + ") "+ " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HBillStatus + ",'" + omodel.HMainSourceBillType + "','" +omodel.HMainSourceInterID + "'," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HCardNumber + "','" + omodel.HCardName + "','" + omodel.HCardModel + "'," + omodel.HMaterID + "," + omodel.HUnitID + "," + omodel.HCardQty + ",'" + omodel.HCardForm + "','" + omodel.HCard + "','" + omodel.HOutComDate + "','" + omodel.HOutComNo + "','" + omodel.HBeginUseDate + "'," + omodel.HCardTypeID + "," + omodel.HCardStatusID + "," + omodel.HCardChangeTypeID + ",'" + omodel.HBarCode + "','" + omodel.HWorkArea + "','" + omodel.HLogo + "'," + omodel.HSellSupID + "," + omodel.HMakeSupID + "," + omodel.HOrgID + "," + omodel.HOwnerID + ") "); //æå ¥å表 foreach (Model.ClsGy_FixCardBillSub_Emp oSub in DetailColl) { oCn.RunProc("Insert into Gy_FixCardBillSub_Emp " + " (HInterID,HBillNo_bak ,HEntryID,HRemark," + "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + "HDeptID,HUseEmpID,HRepairEmpID,HCardAddr,HAddress,HSetupDate,HAvgRate,HProjectMoneyID," + "HBeginDate,HEndDate" + ") values(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HDeptID + "," + oSub.HUseEmpID + "," + oSub.HRepairEmpID + ",'" + oSub.HCardAddr + "','" + oSub.HAddress + "','" + oSub.HSetupDate + "'," + oSub.HAvgRate + "," + oSub.HProjectMoneyID + ",'" + oSub.HBeginDate + "','" + oSub.HEndDate + "'" + ") "); } 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_FixCardBillMain Where HInterID=" + lngBillKey.ToString(), "Gy_FixCardBillMain"); if(Ds.Tables[0].Rows.Count==0) { sReturn = "åæ®æªæ¾å°ï¼"; return false; } //åºå®èµå¼=========================================== omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); //======================================================== //== // //å¾ªç¯ DataSet DsSub ; DsSub = oCn.RunProcReturn("Select * from Gy_FixCardBillSub_Emp Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Gy_FixCardBillSub_Emp"); DetailColl.Clear();//æ¸ ç©º for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Model.ClsGy_FixCardBillSub_Emp oSub = new Model.ClsGy_FixCardBillSub_Emp(); // åºå®èµå¼=============================================== 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
@@ -614,6 +614,8 @@ <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_EquipTypeBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipConkBookBillMain.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipConkBookBillSub.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_FixCardBillMain.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_FixCardBillSub_Emp.cs" /> <Compile Include="ç³»ç»å ¬ç¨\ClsXt_SystemParameter_Model.cs" /> <Compile Include="计å管ç\ClsGy_MaterialTechParamBillSub.cs" /> <Compile Include="计å管ç\ClsGy_MaterialTechParamBillMain.cs" /> Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsGy_FixCardBillMain.cs
New file @@ -0,0 +1,32 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_FixCardBillMain : DBUtility.ClsXt_BaseBillMain { public string HCardNumber; //å¡çç¼ç public string HCardName; //èµäº§åç§° public string HCardModel; //èµäº§è§æ ¼ public Int64 HMaterID; //对åºç©æ public Int64 HUnitID; //计éåä½ public Int64 HCardQty;//èµäº§æ°é public string HCardForm;//å¡çæ¥æº (æå·¥å»ºå¡) public string HCard;//èµäº§æ§è´¨ ï¼èªæèµäº§ï¼ public DateTime HOutComDate; //åºåæ¥æ public string HOutComNo; //åºåç¼å· public DateTime HBeginUseDate; //å¼å§ä½¿ç¨æ¥æ public Int64 HCardTypeID; //èµäº§ç±»å«(Gy_CardType) public Int64 HCardStatusID; //èµäº§ç¶æï¼Gy_CardStatusï¼ public Int64 HCardChangeTypeID; //å卿¹å¼(Gy_CardChangeType) public string HBarCode; //æ¡å½¢ç public string HWorkArea; //äº§å° public string HLogo;//åç public Int64 HSellSupID; //ä¾åºå(Gy_Supplier) public Int64 HMakeSupID; //å¶é å (Gy_Supplier) public Int64 HOrgID; //èµäº§ç»ç» public Int64 HOwnerID; //货主 } } Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsGy_FixCardBillSub_Emp.cs
New file @@ -0,0 +1,22 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_FixCardBillSub_Emp : DBUtility.ClsXt_BaseBillSub { public Int64 HDeptID; //使ç¨é¨é¨ï¼gy_Departme ntï¼ public Int64 HUseEmpID; //使ç¨äººï¼gy_Employeeï¼ public Int64 HRepairEmpID; //ç»´æ¤è´è´£äººï¼gy_Employeeï¼ public Int64 HCardAddr; //èµäº§ä½ç½®ï¼Gy_CardAddressï¼ public string HAddress; //æ¾ç½®å°ç¹ public DateTime HSetupDate; //å®è£ æ¥æ public decimal HAvgRate;// åé æ¯ä¾ public Int64 HProjectMoneyID; //è´¹ç¨é¡¹ç®ï¼Gy_ProjectMoneyï¼ public DateTime HBeginDate; //å¼å§æ¥æ public DateTime HEndDate; //ç»ææ¥æ } } WebAPI/Controllers/SBGL/Gy_FixCardBillController.cs
New file @@ -0,0 +1,542 @@ using DBUtility; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using WebAPI.Models; namespace WebAPI.Controllers.SBGL { public class Gy_FixCardBillController : 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; public DAL.ClsGy_FixCardBill BillOld = new DAL.ClsGy_FixCardBill(); #region åºå®èµäº§å¡çå表æ¥è¯¢ [Route("Gy_FixCardBill/list")] [HttpGet] public object list(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Gy_FixCardBill_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = string.Format(@"select * from h_v_Gy_FixCardBillList where 1 = 1"); if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn(sql1 + sWhere , "h_v_Gy_FixCardBillList"); } else { string sql = sql1 + sWhere; ds = oCN.RunProcReturn(sql, "h_v_Gy_FixCardBillList"); } //æ·»å åå foreach (DataColumn col in ds.Tables[0].Columns) { Type dataType = col.DataType; string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region åºå®èµäº§å¡ç ä¿å/ç¼è¾ [Route("Gy_FixCardBill/SaveFixCardBillList")] [HttpPost] public object SaveFixCardBillList([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 OperationType = sArray[3].ToString(); //æä½ç±»å string UserName = ""; ListModels oListModels = new ListModels(); try { if (!DBUtility.ClsPub.Security_Log("Gy_FixCardBill_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsGy_FixCardBill oBill = new DAL.ClsGy_FixCardBill(); List<Model.ClsGy_FixCardBillMain> lsmain = new List<Model.ClsGy_FixCardBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_FixCardBillMain(msg2); foreach (Model.ClsGy_FixCardBillMain oItem in lsmain) { //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3335"; oItem.HBillSubType = "3335"; oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); oItem.HBillStatus = 1; 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_FixCardBillSub_Emp> ls = new List<Model.ClsGy_FixCardBillSub_Emp>(); ls = oListModels.getObjectByJson_Gy_FixCardBillSub_Emp(msg3); int i = 0; foreach (Model.ClsGy_FixCardBillSub_Emp oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (OperationType == "1") { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); } if (bResult) { objJsonResult.code = "1"; 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("Gy_FixCardBill/DelFixCardBill")] [HttpGet] public object DelFixCardBill(string HInterID, string user) { 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_FixCardBill oBill = new DAL.ClsGy_FixCardBill(); if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) { ds = oCN.RunProcReturn("select * from Gy_FixCardBillMain where HInterID=" + lngBillKey, "Gy_FixCardBillMain"); if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æ,ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç»å®¡æ ¸,ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } //å é¤åæ§å¶========================================= string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); string sql1 = "exec h_p_Gy_FixCardBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Gy_FixCardBill_BeforeDelCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } //================================================================================== bool IsDete = oBill.DeleteBill(lngBillKey, HBillNo, "h_p_Gy_FixCardBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); if (IsDete) { objJsonResult.code = "1"; 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 åºå®èµäº§å¡ç å®¡æ ¸/åå®¡æ ¸åè½ [Route("Gy_FixCardBill/CheckGy_FixCardBill")] [HttpGet] public object CheckGy_FixCardBill(string HInterID, int Type, string user) { try { //夿æ¯å¦æå 餿é if (!DBUtility.ClsPub.Security_Log("Gy_FixCardBill_Check", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "Gy_FixCardBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ if (Type == 1) { //夿忮æ¯å¦å·²ç»å®¡æ ¸ DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } //å®¡æ ¸åæ§å¶ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); sql = "exec h_p_Gy_FixCardBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql, "h_p_Gy_FixCardBill_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; 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 (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_Gy_FixCardBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { //夿忮æ¯å¦å·²ç»åå®¡æ ¸ DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已åå®¡æ ¸!ä¸éè¦ååå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } //åå®¡æ ¸åæ§å¶ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); sql = "exec h_p_Gy_FixCardBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql, "h_p_Gy_FixCardBill_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 (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_Gy_FixCardBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "æ§è¡æåï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region åºå®èµäº§ å ³é/åå ³éåè½ [Route("Gy_FixCardBill/CloseGy_FixCardBill")] [HttpGet] public object CloseGy_FixCardBill(string HInterID, int Type, string user) { try { //夿æ¯å¦æå 餿é if (!DBUtility.ClsPub.Security_Log("Gy_FixCardBill_Close", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå ³é!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "Gy_FixCardBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å ³é 2 åå ³é if (Type == 1) { //夿忮æ¯å¦å·²ç»å ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸éè¦åå ³é!"; objJsonResult.data = null; return objJsonResult; } } //å ³éåæ® if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { //夿忮æ¯å¦å·²ç»åå ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已åå ³é!ä¸éè¦ååå ³é!"; objJsonResult.data = null; return objJsonResult; } } //åå ³éåæ® if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "æ§è¡æåï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } } WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -105,8 +105,8 @@ //ååäº§éæ±æ¥åï¼è´¨éæ±æ¥åå ³èåæ®µ,ç产订åå ³èæ°é Ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_ReverseWriteQty " + omodel.HInterID + "," + oSub.HEntryID + ",'" + omodel.HBillNo + "'," + DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + "," + DetailColl[0].HICMOBillNo + ",'" + DetailColl[0].HSourceID + "','" + "Edit" + "'," + HBackQty DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "','" + DetailColl[0].HSourceID + "','" + "Edit" + "'," + HBackQty + "," + DetailColl[0].HICMOTempID , "h_p_Sc_ICMOReportBill_ReverseWriteQty"); if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBack"]) == "1") { @@ -262,7 +262,7 @@ //ååäº§éæ±æ¥åï¼è´¨éæ±æ¥åå ³èåæ®µ,ç产订åå ³èæ°é ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_ReverseWriteQty " + omodel.HInterID + "," + oSub.HEntryID + ",'" + omodel.HBillNo + "'," + DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "','" + DetailColl[0].HSourceID + "','" + "Add" + "'," + 0+","+ DetailColl[0].HICMOTempID "Add" + "'," + 0 + "," + DetailColl[0].HICMOTempID , "h_p_Sc_ICMOReportBill_ReverseWriteQty"); if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") { WebAPI/ListModels.cs
@@ -3114,6 +3114,31 @@ return list; } /// <summary> /// åºå®èµäº§å¡ç 主表 /// </summary> /// <param name="jsonString"></param> /// <returns></returns> // ClsGy_FixCardBillMain public List<Model.ClsGy_FixCardBillMain> getObjectByJson_Gy_FixCardBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_FixCardBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_FixCardBillMain>>(jsonString); return list; } /// <summary> /// åºå®èµäº§å¡ç å表 /// </summary> /// <param name="jsonString"></param> /// <returns></returns> // ClsGy_FixCardBillSub_Emp public List<Model.ClsGy_FixCardBillSub_Emp> getObjectByJson_Gy_FixCardBillSub_Emp(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_FixCardBillSub_Emp> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_FixCardBillSub_Emp>>(jsonString); return list; } #region 客è¯å¤çå /// <summary> /// 客è¯å¤çå主表json WebAPI/WebAPI.csproj
@@ -416,6 +416,7 @@ <Compile Include="Controllers\MJGL\Sc_MouldScrapRequestBillController.cs" /> <Compile Include="Controllers\MJGL\Sc_MouldStatusChangeBillController.cs" /> <Compile Include="Controllers\Pay_ReportController.cs" /> <Compile Include="Controllers\SBGL\Gy_FixCardBillController.cs" /> <Compile Include="Controllers\SBGL\Sb_EquipConkBookBillController.cs" /> <Compile Include="Controllers\SBGL\Sb_EquipSparepartsBillController.cs" /> <Compile Include="Controllers\SBGL\Sb_EquipSparepartsChangeBillController.cs" />