Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
| | |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipRepairRequestBillSub.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipRepairSendWorkBillMain.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipRepairSendWorkBillSub.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipRepairWorkBillSub_Mater.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSc_EquipMaintainBillSub_Item.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSc_EquipMaintainPlanBillSub_Item.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSc_ICMOBillMain.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSb_EquipRepairWorkBillSub_Mater : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public Int64 HMaterID { get; set; } |
| | | public string HMaterNumber { get; set; } |
| | | public string HMaterName{ get; set; } |
| | | public string HMaterModel{ get; set; } |
| | | public double HQty{ get; set; } |
| | | public double HQtyMust{ get; set; } |
| | | public Int64 HUnitID{ get; set; } |
| | | public string HUnitNumber{ get; set; } |
| | | public string HUnitName{ get; set; } |
| | | public Int64 HManagerID{ get; set; } |
| | | public string HManagerNumber{ get; set; } |
| | | public string HManagerName{ get; set; } |
| | | } |
| | | } |
| | |
| | | { |
| | | public string HAddress;// varchar(200) --交货å°ç¹ |
| | | public Int64 HSSID;// int --ç»ç®æ¹å¼ (Gy_SettleStyle) |
| | | public Int64 HSellSID;// int --éè´æ¹å¼ (Gy_PoStockStyle) new |
| | | public Int64 HSellSID;// int --é宿¹å¼ (Gy_SellStyle) new |
| | | public Int64 HCusID;// int --ä¾åºå ï¼Gy_Supplierï¼ |
| | | public Int64 HCurID;// int --å¸å« (Gy_Currency) |
| | | public Single HExRate;// money --æ±ç (éæ©å®å¸å«å¸¦åº) |
| | |
| | | public DateTime HSSDate;// datetime --ç»ç®æ¥æ --addnew |
| | | public string HChangeMan;// varchar(50) --åæ´äººï¼ä¸å¯ç¼è¾,ç°è²æ¾ç¤ºç±»ä¼¼å®¡æ ¸äººï¼ --addnew |
| | | public DateTime HChangeDate;// datetime --åæ´æ¥æï¼ä¸å¯ç¼è¾,ç°è²æ¾ç¤ºï¼ --addnew |
| | | |
| | | |
| | | public Int64 HInterID; |
| | | public long HYear; |
| | | public long HPeriod; |
| | | public string HBillType; |
| | | public string HBillSubType; |
| | | public DateTime HDate; |
| | | public string HBillNo; |
| | | public int HBillStatus; |
| | | public string HRemark; |
| | | public string HChecker; |
| | | public string HCheckDate; |
| | | public string HMaker; |
| | | public string HMakeDate; |
| | | public string HCloseMan; |
| | | public string HCloseDate; |
| | | public Int64 HERPInterID; |
| | | public string HERPBillType; |
| | | public Int64 HSALEORGID; |
| | | } |
| | | } |
| | |
| | | public string HRemark;// varchar(200) --夿³¨ |
| | | public Int64 HMaterID;// int --ç©æID (Gy_Material) |
| | | public Int64 HUnitID;// int --计éåä½ (Gy_Unit) |
| | | public double HQty;// dec(18,8) --æ°é |
| | | public double? HQty;// dec(18,8) --æ°é |
| | | public double HPrice;// dec(18,8) --åå¸åä»· |
| | | public double HMoney;// dec(18,8) --åå¸éé¢ |
| | | public Single HTaxRate;// money --ç¨ç |
| | |
| | | public double HRelTaxPrice;// dec(18,8) --å®é
å«ç¨åä»·ï¼ä¸å¯ç¼è¾ï¼ --addnew |
| | | public double HOutStockQty;// dec(18,8) --åºåºæ°éï¼ä¸å¯ç¼è¾ï¼ --addnew |
| | | public double HInvoiceQty;// dec(18,8) --å¼ç¥¨æ°éï¼ä¸å¯ç¼è¾ï¼ --addnew |
| | | |
| | | |
| | | public Int64 HInterID; |
| | | public Int64 HEntryID; |
| | | public Int64 HSourceInterID; |
| | | public Int64 HSourceEntryID; |
| | | public string HSourceBillNo; |
| | | public string HSourceBillType; |
| | | public double HRelationQty; |
| | | public Int64 HPropertyID; |
| | | public string HBatChNo; |
| | | public Int64 HAuxPropID; |
| | | public string HMTONo; |
| | | public Int64 HERPInterID; |
| | | public Int64 HERPEntryID; |
| | | public decimal HBackRelationQty; |
| | | public Int64 HWhID; |
| | | public Int64 HSPID; |
| | | |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [Route("Gy_Customer/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere,string user, string Organization) |
| | | public object list(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | [Route("Gy_Customer/SaveGy_CustomerListApi")] |
| | | [HttpPost] |
| | | public object SaveGy_CustomerListApi([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var model = oMain["model"].ToString(); |
| | | //ååºåå |
| | | model = "[" + model + "]"; |
| | | List<Customer> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Customer>>(model); |
| | | string sql = string.Empty; |
| | | oCN.BeginTran(); |
| | | sql = $"delete gy_Customer where HItemID = {lsmain[0].HItemID}"; |
| | | oCN.RunProc(sql); |
| | | sql = "set identity_insert gy_Customer on"; |
| | | oCN.RunProc(sql); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_Customer " + |
| | | " (HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark" + |
| | | ",HShortName,HAddress,HLinkMan,HLinkPhone,HMobilePhone" + |
| | | ",HFax,HPostalCode,HEmail,HBank,HBankAccount" + |
| | | ",HTaxNum,HTaxRate,HCountry,HCorMan,HEnglishName" + |
| | | ",HEnglishAddress,HCurID,HSSID,HAreaID,HCusStatus" + |
| | | ",HEmpID,HCreditDate,HCreditRatingDate,HMaxCreditRatingDate" + |
| | | ",HMonthUseQty,HForecastCreditRating,HCreditLevelID,HCountAccrualRating" + |
| | | ",HSubsidyAccrualRating,HCreditRating,HMaxCreditRating" + |
| | | ",HCusTypeID) " + |
| | | " Values('" + lsmain[0].HItemID + "','" + lsmain[0].HNumber + "','" + lsmain[0].HName + "','" + lsmain[0].HHelpCode + "','" + lsmain[0].HShortNumber + "'," + lsmain[0].HParentID + |
| | | ", " + lsmain[0].HLevel + ",0,'" + lsmain[0].HStopFlag + "','" + lsmain[0].HRemark + "'" + |
| | | ",'" + lsmain[0].HShortName + "','" + lsmain[0].HAddress + "','" + lsmain[0].HLinkMan + "','" + lsmain[0].HLinkPhone + "','" + lsmain[0].HMobilePhone + "'" + |
| | | ",'" + lsmain[0].HFax + "','" + lsmain[0].HPostalCode + "','" + lsmain[0].HEmail + "','" + lsmain[0].HBank + "','" + lsmain[0].HBankAccount + "'" + |
| | | ",'" + lsmain[0].HTaxNum + "'," + lsmain[0].HTaxRate + ",'" + lsmain[0].HCountry + "','" + lsmain[0].HCorMan + "','" + lsmain[0].HEnglishName + "'" + |
| | | ",'" + lsmain[0].HEnglishAddress + "'," + lsmain[0].HCurID + "," + lsmain[0].HSSID + "," + lsmain[0].HAreaID + ",'" + lsmain[0].HCusStatus + "'" + |
| | | "," + lsmain[0].HEmpID + "," + lsmain[0].HCreditDate + "," + lsmain[0].HCreditRatingDate + "," + lsmain[0].HMaxCreditRatingDate + |
| | | "," + lsmain[0].HMonthUseQty + "," + lsmain[0].HForecastCreditRating + "," + lsmain[0].HCreditLevelID + "," + lsmain[0].HCountAccrualRating + |
| | | "," + lsmain[0].HSubsidyAccrualRating + "," + lsmain[0].HCreditRating + "," + lsmain[0].HMaxCreditRating + |
| | | ", " + lsmain[0].HCusTypeID + ")"); |
| | | sql = "set identity_insert gy_Customer 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; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹åæ®-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | |
| | | /// </summary> |
| | | [Route("Gy_Department/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere,string user,string Organization) |
| | | public object list(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | |
| | | /// <returns></returns> |
| | | [Route("DeltetGy_Department")] |
| | | [HttpGet] |
| | | public object DeltetGy_Department(string HItemID,string user) |
| | | public object DeltetGy_Department(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | |
| | | oCN.RunProc("Insert Into Gy_Department " + |
| | | "(HNumber,HShortNumber,HName,HParentID" + |
| | | ",HLevel,HEndFlag,HRemark,HStopFlag,HUseFlag" + |
| | | ",HCREATEORGID,HUSEORGID,HBarCode,HCreator" + |
| | | ",HUpdater,HChecker,HDeleteMan" + |
| | | ",HSecManagerID,HCreateDate" + |
| | | ",HCREATEORGID,HUSEORGID" + |
| | | ") " + |
| | | " values('" + HNumber + "','" + HShortNumber + "','" + HName + "',0" + |
| | | ",'',0,'" + HRemark + "',0,''" + |
| | | "," + HCreateOrgID + "," + HUseOrgID + ",'" + HBarCode + "','" + HCreator + "'" + |
| | | ",'" + HUpdater + "','" + HChecker + "','" + HDeleteMan + "'" + |
| | | "," + HSecManagerID + ", getdate()" + |
| | | "," + HCreateOrgID + "," + HUseOrgID + "" + |
| | | ") "); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | } |
| | | //ååºåå |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Department> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Department>>(msg2); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | [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"+ |
| | | ") " + |
| | | " 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 + "" + |
| | | ") "); |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | |
| | | // |
| | | } |
| | | } |
| | |
| | | [HttpPost] |
| | | public object SaveGy_MaterialListApi([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | var _value = msg["model"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | |
| | | } |
| | | } |
| | | |
| | | [Route("Gy_Supplier/SaveGy_SupplierListApi")] |
| | | [HttpPost] |
| | | public object SaveGy_SupplierListApi([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | var _value = msg["model"].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //ååºåå |
| | | _value = "[" + _value.ToString() + "]"; |
| | | List<Supplier> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Supplier>>(_value); |
| | | string sql = string.Empty; |
| | | //ä¿å |
| | | oCN.BeginTran(); |
| | | sql = $"delete Gy_Supplier where HItemID = {lsmain[0].HItemID}"; |
| | | oCN.RunProc(sql); |
| | | sql = "set identity_insert Gy_Supplier on"; |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc("Insert Into Gy_Supplier " + |
| | | "(HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark" + |
| | | ",HShortName,HAddress,HLinkMan,HLinkPhone,HMobilePhone" + |
| | | ",HFax,HPostalCode,HEmail,HBank,HBankAccount" + |
| | | ",HTaxNum,HTaxRate,HCountry,HCorMan,HEnglishName" + |
| | | ",HEnglishAddress,HCurID,HSSID,HAreaID) " + |
| | | " values('" + lsmain[0].HItemID + "','" + lsmain[0].HNumber + "','" + lsmain[0].HName + "','" + lsmain[0].HHelpCode + "','" + lsmain[0].HShortNumber + "','" + lsmain[0].HParentID + "'" + |
| | | "," + lsmain[0].HLevel + ",0,'" + lsmain[0].HStopflag + "','" + lsmain[0].HRemark + "'" + |
| | | ",'" + lsmain[0].HShortName + "','" + lsmain[0].HAddress + "','" + lsmain[0].HLinkMan + "','" + lsmain[0].HLinkPhone + "','" + lsmain[0].HMobilePhone + "'" + |
| | | ",'" + lsmain[0].HFax + "','" + lsmain[0].HPostalCode + "','" + lsmain[0].HEmail + "','" + lsmain[0].HBank + "','" + lsmain[0].HBankAccount + "'" + |
| | | ",'" + lsmain[0].HTaxNum + "','" + lsmain[0].HTaxRate + "','" + lsmain[0].HCountry + "','" + lsmain[0].HCorMan + "','" + lsmain[0].HEnglishName + "'" + |
| | | ",'" + lsmain[0].HEnglishAddress + "'," + lsmain[0].HCurID + "," + lsmain[0].HSSID + "," + lsmain[0].HAreaID + |
| | | ") "); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | sql = "set identity_insert Gy_Supplier off"; |
| | | oCN.RunProc(sql); |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹åæ®-ä¿åæé® |
| | |
| | | /// </summary> |
| | | [Route("Gy_Unit/list1")] |
| | | [HttpGet] |
| | | public object list(string sWhere,string user,string Organization) |
| | | public object list(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | |
| | | oItem.HShortNumber = sShortNumber;//ç代ç |
| | | oItem.HEndFlag = true;//æ«çº§æ å¿ |
| | | oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //ç级 |
| | | oItem.HRate= msg_HRate;//æ¢ç®æ¯ä¾ |
| | | oItem.HRate = msg_HRate;//æ¢ç®æ¯ä¾ |
| | | oBill.oModel = oItem; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | [Route("Gy_Unit/SaveGy_UnitListApi")] |
| | | [HttpPost] |
| | | public object SaveGy_UnitListApi([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | var _value = msg["model"].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ListModels oListModels = new ListModels(); |
| | | List<Model.ClsGy_Unit_Model> lsmain = new List<Model.ClsGy_Unit_Model>(); |
| | | lsmain = oListModels.getObjectByJson_Gy_Unit(_value); |
| | | string sql = string.Empty; |
| | | //ä¿å |
| | | oCN.BeginTran(); |
| | | sql = $"delete Gy_Unit where HItemID = {lsmain[0].HItemID}"; |
| | | oCN.RunProc(sql); |
| | | sql = "set identity_insert Gy_Unit on"; |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc("Insert into Gy_Unit" + |
| | | " (HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HRate,HStandard,HUSEORGID) " + |
| | | " Values('" + lsmain[0].HItemID + "','" + lsmain[0].HNumber + "','" + lsmain[0].HName + "','" + lsmain[0].HHelpCode + "','" + lsmain[0].HShortNumber + "'," + lsmain[0].HParentID.ToString() + |
| | | "," + lsmain[0].HLevel.ToString() + "," + Convert.ToString(lsmain[0].HEndFlag ? 1 : 0) + "," + Convert.ToString(lsmain[0].HStopflag ? 1 : 0) + ",'" + lsmain[0].HRemark + |
| | | "'," + lsmain[0].HRate.ToString() + "," + DBUtility.ClsPub.BoolToString(lsmain[0].HStandard) + "," + lsmain[0].HUSEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | sql = "set identity_insert Gy_Unit off"; |
| | | oCN.RunProc(sql); |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 计éåä½è·åä¿¡æ¯ |
| | | /// </summary> |
| | |
| | | /// <returns></returns> |
| | | [Route("DeltetGy_Unit")] |
| | | [HttpGet] |
| | | public object DeltetGy_Unit(string HItemID,string user) |
| | | public object DeltetGy_Unit(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | //string ModRightNameCheck = "Sc_ProcessReport_check"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | [Route("Gy_Warehouse/SaveGy_WarehouseListApi")] |
| | | [HttpPost] |
| | | public object SaveGy_WarehouseListApi([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | var _value = msg["model"].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //ååºåå |
| | | _value = "[" + _value.ToString() + "]"; |
| | | List<Warehouse> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Warehouse>>(_value); |
| | | string sql = string.Empty; |
| | | //ä¿å |
| | | oCN.BeginTran(); |
| | | sql = $"delete Gy_Warehouse where HItemID = {list[0].HItemID}"; |
| | | oCN.RunProc(sql); |
| | | sql = "set identity_insert Gy_Warehouse on"; |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc("Insert into Gy_Warehouse " + |
| | | " (HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HEmpID,HAddress,HPhone,HUSEORGID) " + |
| | | " Values('" + list[0].HItemID + "','" + list[0].HNumber + "','" +list[0].HName + "','" + list[0].HHelpCode + "','" + list[0].HShortNumber + "'," + list[0].HParentID.ToString() + |
| | | "," + list[0].HLevel.ToString() + "," + Convert.ToString(list[0].HEndFlag ? 1 : 0) + "," + Convert.ToString(list[0].HStopflag ? 1 : 0) + ",'" + list[0].HRemark + "'," + list[0].HEmpID.ToString() + ",'" + list[0].HAddress + "','" + list[0].HPhone + "','" + list[0].HUSEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | sql = "set identity_insert Gy_Warehouse off"; |
| | | oCN.RunProc(sql); |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ä»åºå表å é¤åè½ |
| | | /// </summary> |
| | |
| | | { |
| | | |
| | | //å¾å°ä¿¡æ¯ |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillQuerySub_Mould where hmainid= " + HProcExchHinteID , "h_v_Sc_ProcessExchangeBillQuerySub_Mould"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuerySub_Mould where hmainid= " + HProcExchHinteID , "h_v_Sc_ProcessExchangeBillQuerySub_Mould"); |
| | | //åå
¥ä¿¡æ¯ |
| | | //if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | } |
| | |
| | | string FCusName = oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo);//客æ·åç§° |
| | | string sql = string.Empty; |
| | | if (FCusName.Contains("å®ç")) |
| | | sql = $"select HItemID,HSourceBillNo,HQty,HSourceInterID,HSourceEntryID from Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode}' and HBarCodeType ='ç®±å·å
æ¡ç '"; |
| | | sql = $"select top 1 HItemID,HSourceBillNo,HQty,HSourceInterID,HSourceEntryID from Gy_BarCodeBill where HSourceInterID =(select distinct HSourceInterID from Cg_POInStockBillSub where HInterID ={HInterID}) and HBarCode = '{HBarcode}' and HBarCodeType ='ç®±å·å
æ¡ç '"; |
| | | else |
| | | sql = $"select HItemID,HSourceBillNo,HQty,HSourceInterID,HSourceEntryID from Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode.Split('#')[0]}' and HQty = {HBarcode.Split('#')[1]}"; |
| | | DataSet ds = oCn.RunProcReturn(sql, "H_v_SRM_POOrderBillList"); |
| | |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_EquipMaintainPlan"); |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "æ æ°æ®"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string msg5 = sArray[3].ToString(); |
| | | |
| | | |
| | | //string UserName = ""; |
| | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | |
| | | //é
ä»¶è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | //msg5 = msg5.Substring(1, msg5.Length - 2); |
| | | msg5 = msg5.Replace("\\", ""); |
| | | msg5 = msg5.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Model.ClsSb_EquipRepairWorkBillSub_Mater> ls1 = new List<Model.ClsSb_EquipRepairWorkBillSub_Mater>(); |
| | | ls1 = JsonConvert.DeserializeObject<List<Model.ClsSb_EquipRepairWorkBillSub_Mater>>(msg5); |
| | | int j = 0; |
| | | foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oItemSub in ls1) |
| | | { |
| | | |
| | | j++; |
| | | oItemSub.HEntryID = i; |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | oItemSub.HSourceInterID = 0; // æºå主å
ç |
| | | oItemSub.HSourceEntryID = 0; //æºååå
ç |
| | | oItemSub.HRelationQty = 0; //å
³èæ°é |
| | | oBill.DetailColl_Mater.Add(oItemSub); |
| | | |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[设å¤ç»´ä¿®å表ç¼è¾æ¶è·åè¡¨ä½æ°æ®] |
| | | #region[设å¤ç»´ä¿®å表ç¼è¾æ¶è·åè¡¨ä½æ°æ®(ç»´ä¿®å表ãé
ä»¶å表)] |
| | | [Route("Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillListProjectDetai")] |
| | | [HttpGet] |
| | | public object Sb_EqpRepairWorkBillListProjectDetai(string sqlWhere) |
| | | public object Sb_EqpRepairWorkBillListProjectDetai(string HInterID) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds, ds1; |
| | | List<object> list = new List<object>(); |
| | | string sqlWhere = ""; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sqlWhere == null || sqlWhere.Equals("")) |
| | | if (HInterID != "" || HInterID != null) |
| | | { |
| | | //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); |
| | | ds = oCN.RunProcReturn("select HRepairID,维修项ç®ä»£ç HRepairCode,ç»´ä¿®é¡¹ç® HRepairName,HManagerID1 HManagerID,表ä½è´è´£äººä»£ç HManagerCode,表ä½è´è´£äºº HManagerName,HRepairID1 HRepairID, 表ä½ç»´ä¿®é¡¹ç®ä»£ç HRepairCode,表ä½ç»´ä¿®é¡¹ç® HRepairName,表ä½ç»´ä¿®è¦æ± HRepairExplanation,表ä½å¤æ³¨ HRemark,æºå主å
ç HSourceInterID,æºååå
ç HSourceEntryID,æºååå· HSourceBillNo,æºåç±»å HSourceBillType from h_v_Sc_EquipRepairWorkBillList_Edit", "h_v_Sc_EquipRepairWorkBillList_Edit"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | sqlWhere = " and hmainid='" + HInterID + "'"; |
| | | } |
| | | else |
| | | { |
| | | //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub where 1 = 1 "; |
| | | string sql1 = "select HRepairID,维修项ç®ä»£ç HRepairCode,ç»´ä¿®é¡¹ç® HRepairName,HManagerID1 HManagerID,表ä½è´è´£äººä»£ç HManagerCode,表ä½è´è´£äºº HManagerName,HRepairID1 HRepairID, 表ä½ç»´ä¿®é¡¹ç®ä»£ç HRepairCode,表ä½ç»´ä¿®é¡¹ç® HRepairName,表ä½ç»´ä¿®è¦æ± HRepairExplanation,表ä½å¤æ³¨ HRemark ,æºå主å
ç HSourceInterID,æºååå
ç HSourceEntryID,æºååå· HSourceBillNo,æºåç±»å HSourceBillType from h_v_Sc_EquipRepairWorkBillList_Edit where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_EquipRepairWorkBillList_Edit"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | sqlWhere = HInterID; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | ds = oCN.RunProcReturn("select HRepairID,维修项ç®ä»£ç HRepairCode,ç»´ä¿®é¡¹ç® HRepairName,HManagerID1 HManagerID,表ä½è´è´£äººä»£ç HManagerCode,表ä½è´è´£äºº HManagerName,HRepairID1 HRepairID, 表ä½ç»´ä¿®é¡¹ç®ä»£ç HRepairCode,表ä½ç»´ä¿®é¡¹ç® HRepairName,表ä½ç»´ä¿®è¦æ± HRepairExplanation,表ä½å¤æ³¨ HRemark,æºå主å
ç HSourceInterID,æºååå
ç HSourceEntryID,æºååå· HSourceBillNo,æºåç±»å HSourceBillType from h_v_Sc_EquipRepairWorkBillList_Edit where 1 = 1 " + sqlWhere , "h_v_Sc_EquipRepairWorkBillList_Edit"); |
| | | string sql1 = "select * from h_v_Sb_EquipRepairWorkBillSub_Mater where 1 = 1 " + sqlWhere; |
| | | ds1 = oCN.RunProcReturn(sql1, "h_v_Sb_EquipRepairWorkBillSub_Mater"); |
| | | list.Add(ds.Tables[0]); |
| | | list.Add(ds1.Tables[0]); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.list = list; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | |
| | | ds = Sc_MouldDotCheckPlanBillList_s(sWhere); |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "æ æ°æ®"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åé宿¹å¼å表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Web/GetSellStyleList_Json")] |
| | | [HttpGet] |
| | | public object GetSellStyleList_Json(string SellStyle) |
| | | { |
| | | if (SellStyle != "") |
| | | { |
| | | sWhere = sWhere + " and ( HNumber like '%" + SellStyle + "%' or HName like '%" + SellStyle + "%' ) "; |
| | | } |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_SellStyle where HStopflag=0 Order by HItemID ", "Gy_SellStyle"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HNumber ,HName from Gy_SellStyle where HStopflag=0 and HEndFlag=1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_SellStyle"); |
| | | } |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "è·å失败" + DBUtility.ClsPub.sErrInfo; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | else |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "è·åæå!"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "è·å失败" + ex.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åç»ç®æ¹å¼å表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Web/GetSettleStyleList_Json")] |
| | | [HttpGet] |
| | | public object GetSettleStyleList_Json(string SettleStyle) |
| | | { |
| | | if (SettleStyle != "") |
| | | { |
| | | sWhere = sWhere + " and ( HNumber like '%" + SettleStyle + "%' or HName like '%" + SettleStyle + "%' ) "; |
| | | } |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_SettleStyle where HStopflag=0 Order by HItemID ", "Gy_SettleStyle"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HNumber ,HName from Gy_SettleStyle where HStopflag=0 and HEndFlag=1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_SettleStyle"); |
| | | } |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "è·å失败" + DBUtility.ClsPub.sErrInfo; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | else |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "è·åæå!"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "è·å失败" + ex.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å客æ·å表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | /// <returns></returns> |
| | | [Route("Web/GetMaintainItemtemByEquipProjectID")] |
| | | [HttpGet] |
| | | public object GetMaintainItemtemByEquipProjectID(int EquipProjectID) |
| | | public object GetMaintainItemtemByEquipProjectID(string EquipProjectID) |
| | | { |
| | | if (EquipProjectID <= 0) |
| | | if (EquipProjectID == null) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | |
| | | using Newtonsoft.Json; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | |
| | | } |
| | | } |
| | | |
| | | #region éå®è®¢å ä¿å/ç¼è¾åè½ |
| | | [Route("Xs_SeOrder/SeOrderBillEdit")] |
| | | [HttpPost] |
| | | public object SeOrderBillEdit([FromBody] JObject sMainSub) |
| | | { |
| | | try |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | oCN.BeginTran(); |
| | | //ä¿å主表 |
| | | objJsonResult = AddBillMain(msg1); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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 = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillMain(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //ä¸»è¡¨æ°æ® |
| | | string msg3 = sArray[1].ToString(); //åè¡¨æ°æ® |
| | | int OperationType = int.Parse(sArray[2].ToString()); // æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ |
| | | string user = sArray[3].ToString(); |
| | | string msg_allVal = sArray[4].ToString(); //主表+åè¡¨æææ°æ® |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsXs_SeOrderBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsXs_SeOrderBillMain>>(msg2); |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HPRDORGID = mainList[0].HPRDORGID;//ç»ç» |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HCusID = mainList[0].HCusID;//å®¢æ· |
| | | long HEmpID = mainList[0].HEmpID;//ä¸å¡å |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | long HCurID = mainList[0].HCurID;//å¸å« |
| | | Single HExRate = mainList[0].HExRate;//æ±ç |
| | | long HManagerID = mainList[0].HManagerID;//主管 |
| | | long HSellSID = mainList[0].HSellSID;//é宿¹å¼ |
| | | long HSSID = mainList[0].HSSID;//ç»ç®æ¹å¼ |
| | | DateTime HSSDate = mainList[0].HSSDate;//ç»ç®æ¥æ |
| | | string HMaker = user;//å¶å人 |
| | | string HAddress = mainList[0].HAddress;//å°å |
| | | |
| | | List<ClsXs_SeOrderBillMain> mainList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsXs_SeOrderBillMain>>(msg2); |
| | | DateTime dt = DateTime.Now; |
| | | long HYear = mainList2[0].HYear == null ? 0 : mainList2[0].HYear; |
| | | long HPeriod = mainList2[0].HPeriod == null ? 0 : mainList2[0].HPeriod; |
| | | string HBillType = mainList2[0].HBillType == null ? "''" : mainList2[0].HBillType; |
| | | string HBillSubType = mainList2[0].HBillSubType == null ? "''" : mainList2[0].HBillSubType; |
| | | int HBillStatus = mainList2[0].HBillStatus == null ? 0 : mainList2[0].HBillStatus; |
| | | string HChecker = mainList2[0].HChecker == null ? "''" : mainList2[0].HChecker; |
| | | string HCheckDate = mainList2[0].HCheckDate == null ? "''" : mainList2[0].HCheckDate; |
| | | string HMakeDate = mainList2[0].HMakeDate == null ? "''" : mainList2[0].HMakeDate; |
| | | string HCloseMan = mainList2[0].HCloseMan == null ? "''" : mainList2[0].HCloseMan; |
| | | string HCloseDate = mainList2[0].HCloseDate == null ? "''" : mainList2[0].HCloseDate; |
| | | long HERPInterID = mainList2[0].HERPInterID == null ? 0 : mainList2[0].HERPInterID; |
| | | string HERPBillType = mainList2[0].HERPBillType == null ? "''" : mainList2[0].HERPBillType; |
| | | long HSALEORGID = mainList2[0].HSALEORGID == null ? 0 : mainList2[0].HSALEORGID; |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_SeOrderBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | DataSet Ds; |
| | | Int64 NewHInterID = 1; |
| | | Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Xs_SeOrderBillMain", "Xs_SeOrderBillMain"); |
| | | if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0) |
| | | { |
| | | NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()); |
| | | NewHInterID += 1; |
| | | } |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Xs_SeOrderBillMain |
| | | (HBillType,HInterID,HBillNo,HDate |
| | | ,HYear,HPeriod,HRemark,HMaker,HMakeDate |
| | | ,HEmpID,HCusID |
| | | ,HBillSubType,HAddress,HSSDate,HSSID,HSellSID,HCurID,HExRate, HManagerID,HDeptID |
| | | ,HExplanation,HCheckFlow,HBillStatus,HInnerBillNo |
| | | ,HICMOFlag,HChangeMan,HSALEORGID,HERPInterID,HERPBillType |
| | | ,HCloseDate,HCloseMan) |
| | | values(" + "1401," + HInterID + ",'" + HBillNo + "','" + HDate + "','" + |
| | | DateTime.Now.Year + "','" + DateTime.Now.Month + "','" + HRemark + "','" + HMaker + "','" + HMakeDate + |
| | | "'," + HEmpID + "," + HCusID + ",'" + HBillType + "','" + HAddress + "','" + HSSDate + |
| | | "'," + HSSID + "," + HSellSID + "," + HCurID + "," + HExRate + "," + HManagerID + "," + HDeptID + ",'" + "''" + "'," + "0," + HBillStatus + ",'" + "''" + "'," + |
| | | 0 + ",'" + "''" + "'," + HSALEORGID + "," + HERPInterID + ",'" + HERPBillType + "','" + HCloseDate + "','" + HCloseMan + "')"); |
| | | } |
| | | else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Xs_SeOrderBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + |
| | | ", HEmpID=" + HEmpID + ", HCusID=" + HCusID + ",HAddress='" + HAddress + "',HDeptID=" + HDeptID |
| | | + ",HCurID=" + HCurID + ",HExRate=" + HExRate + ",HManagerID=" + HManagerID + ",HSellSID=" + HSellSID |
| | | + ",HSSID=" + HSSID + ",HSSDate='" + HSSDate + "' where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Xs_SeOrderBillSub where HInterID='" + HInterID + "'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID, int OperationType) |
| | | { |
| | | List<ClsXs_SeOrderBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsXs_SeOrderBillSub>>(msg3); |
| | | |
| | | List<ClsXs_SeOrderBillSub> DetailColl2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsXs_SeOrderBillSub>>(msg3); |
| | | |
| | | long HSourceInterID = DetailColl2[0].HSourceInterID == null ? 0 : DetailColl2[0].HSourceInterID; |
| | | long HSourceEntryID = DetailColl2[0].HSourceEntryID == null ? 0 : DetailColl2[0].HSourceEntryID; |
| | | string HSourceBillNo = DetailColl2[0].HSourceBillNo == null ? "''" : DetailColl2[0].HSourceBillNo; |
| | | string HSourceBillType = DetailColl2[0].HSourceBillType == null ? "''" : DetailColl2[0].HSourceBillType; |
| | | double HRelationQty = DetailColl2[0].HRelationQty == null ? 0 : DetailColl2[0].HRelationQty; |
| | | long HPropertyID = DetailColl2[0].HPropertyID == null ? 0 : DetailColl2[0].HPropertyID; |
| | | string HBatChNo = DetailColl2[0].HBatChNo == null ? "''" : DetailColl2[0].HBatChNo; |
| | | long HAuxPropID = DetailColl2[0].HAuxPropID == null ? 0 : DetailColl2[0].HAuxPropID; |
| | | string HMTONo = DetailColl2[0].HMTONo == null ? "''" : DetailColl2[0].HMTONo; |
| | | long HERPInterID = DetailColl2[0].HERPInterID == null ? 0 : DetailColl2[0].HERPInterID; |
| | | long HERPEntryID = DetailColl2[0].HERPEntryID == null ? 0 : DetailColl2[0].HERPEntryID; |
| | | decimal HBackRelationQty = DetailColl2[0].HBackRelationQty == null ? 0 : DetailColl2[0].HBackRelationQty; |
| | | long HWhID = DetailColl2[0].HWhID == null ? 0 : DetailColl2[0].HWhID; |
| | | long HSPID = DetailColl2[0].HSPID == null ? 0 : DetailColl2[0].HSPID; |
| | | |
| | | int i = 0; |
| | | foreach (ClsXs_SeOrderBillSub oSub in DetailColl) |
| | | { |
| | | i++; |
| | | if (oSub.HQty <= 0 || oSub.HQty == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼æ°éä¸è½ä¸º0æè
å°äº0"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oSub.HMaterID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼ç©æä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if (oSub.HSourceID == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + i + "è¡ï¼çäº§èµæºä¸è½ä¸ºç©º"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (oSub.HUnitID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼è®¡éåä½ä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Xs_SeOrderBillSub", "Xs_SeOrderBillSub"); |
| | | if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0) |
| | | { |
| | | NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()); |
| | | NewHEntryID += 1; |
| | | } |
| | | |
| | | oCN.RunProc($@"Insert into Xs_SeOrderBillSub |
| | | (HInterID,HENTRYID,HQty,HMaterID,HUnitID,HRemark |
| | | ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType |
| | | ,HRelationQty,HRelationMoney,HPrice,HTaxPrice,HMoney,HDiscountRate |
| | | ,HRelTaxPrice,HTaxRate,HTaxMoney,HlineTotal,HlineTotalBB,HDate,HOutStockQty,HInvoiceQty |
| | | ,HPropertyID,HBatChNo,HAuxPropID,HMTONo,HERPInterID,HERPEntryID,HBackRelationQty,HWhID,HSPID) |
| | | values({HInterID},{NewHEntryID},{(oSub.HQty == null ? 0 : oSub.HQty)} |
| | | ,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{HSourceInterID},{HSourceEntryID},{HSourceBillNo},{HSourceBillType},{HRelationQty},0,{oSub.HPrice},{oSub.HTaxPrice},{oSub.HMoney},{oSub.HDiscountRate},{oSub.HRelTaxPrice},{oSub.HTaxRate},{oSub.HTaxMoney},{oSub.HlineTotal},{oSub.HlineTotalBB},getdate(),{oSub.HOutStockQty},{oSub.HInvoiceQty},{HPropertyID},{HBatChNo},{HAuxPropID}, |
| | | {HMTONo},{HERPInterID},{HERPEntryID},{HBackRelationQty},{HWhID},{HSPID})"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | ///å é¤åè½ |
| | | /// </summary> |
| | |
| | | { |
| | | public Models.ClsSb_EquipRepairWorkBillMain omodel = new Models.ClsSb_EquipRepairWorkBillMain(); |
| | | public List<Models.ClsSb_EquipRepairWorkBillSub> DetailColl = new List<Models.ClsSb_EquipRepairWorkBillSub>(); |
| | | public List<Model.ClsSb_EquipRepairWorkBillSub_Mater> DetailColl_Mater = new List<Model.ClsSb_EquipRepairWorkBillSub_Mater>(); |
| | | |
| | | public ClsSb_EquipRepairWorkBill() |
| | | { |
| | |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //å é¤å表 |
| | | DeleteBillSub(lngBillKey); |
| | | //å é¤é
ä»¶æ°æ® |
| | | oCn.RunProc("delete from Sb_EquipRepairWorkBillSub_Mater where HInterID="+ lngBillKey); |
| | | //æå
¥å表 |
| | | omodel.HInterID = lngBillKey; |
| | | foreach (Models.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) |
| | |
| | | "," + oSub.HRepairID.ToString() + ",'"+ oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + |
| | | ") "); |
| | | } |
| | | |
| | | foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oSub in DetailColl_Mater) |
| | | { |
| | | oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub_Mater " + |
| | | " (HInterID,HEntryID," + |
| | | "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + |
| | | "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + |
| | | "HQty,HMaterID,HUnitID,HQtyMust," + |
| | | "HManagerID ) values(" + |
| | | omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + |
| | | ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + 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.HQty.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + |
| | | "," + oSub.HManagerID.ToString() + ") "); |
| | | } |
| | | |
| | | // |
| | | //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) |
| | | //{ |
| | |
| | | "," + oSub.HRepairID.ToString() + ",'"+ oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + |
| | | ") "); |
| | | } |
| | | |
| | | foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oSub in DetailColl_Mater) |
| | | { |
| | | oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub_Mater " + |
| | | " (HInterID,HEntryID," + |
| | | "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + |
| | | "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + |
| | | "HQty,HMaterID,HUnitID,HQtyMust," + |
| | | "HManagerID ) values(" + |
| | | omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + |
| | | ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + 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.HQty.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + |
| | | "," + oSub.HManagerID.ToString() + ") "); |
| | | } |
| | | // |
| | | //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) |
| | | //{ |
| | |
| | | public class Supplier |
| | | { |
| | | public long HInterID { get; set; } |
| | | public long HItemID { get; set; } |
| | | public string HNumber { get; set; } |
| | | public string HShortNumber { get; set; } |
| | | public string HName { get; set; } |