| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | private json objJsonResult = new json(); |
| | | public DataSet ds = new DataSet(); |
| | | public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public DLL.ClsKf_MateOutBill BillNew0 = new DLL.ClsKf_MateOutBill(); //模å
·æ¥åºå
¥åºå¯¹åºåæ®ç±» |
| | | public DLL.ClsKf_MateOutBill BillOld0 = new DLL.ClsKf_MateOutBill(); //模å
·æ¥åºå
¥åºå¯¹åºåæ®ç±» |
| | | |
| | | #region çäº§é¢æåå表 |
| | | |
| | | |
| | | [Route("Kf_MateOutBill/GetMateOutBillList")] |
| | | [HttpGet] |
| | | public object GetMateOutBillList(string sWhere,string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); //å®ä¹å£°æåé ï¼æéè¿ new List<object>()å建ç å®ä¾ï¼èµå¼ç»åé |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_MateOutBillQuery", 1, false, user)) |
| | | { |
| | |
| | | } |
| | | |
| | | ds = oCn.RunProcReturn("select * from h_v_IF_MateOutBillList_Search " + sWhere + " order by æ¥æ desc, hmainid desc", "h_v_IF_MateOutBillList_Search"); |
| | | |
| | | foreach (DataColumn col in ds.Tables[0].Columns)//éådsä¸ç¬¬ä¸ä¸ªè¡¨ï¼Tables[0]ï¼çææåï¼Columnsï¼æ¯æ¬¡å¾ªç¯ä¸ï¼colåé伿æå½ååçå¼ç¨ |
| | | { |
| | | Type dataType = col.DataType; //è·åå½åæ°æ®ç±»åä¼ å
¥ èªå®ä¹åédatadataType |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //åç¬¦ä¸²æ¼æ¥ // å°åååæ°æ®ç±»åä¿¡æ¯æ¼æ¥æä¸ä¸ªJSONæ ¼å¼çå符串 |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | |
| | | //è¿è¡éè¦è¿è¡çå®¡æ ¸/åå®¡æ ¸æä½ |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | { |
| | | //å®¡æ ¸æäº¤ |
| | | if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | { |
| | | //åå®¡æ ¸æäº¤AbandonCheck |
| | | if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æ ¹æ®åæ®å·ï¼åæ¥çäº§é¢æå |
| | | [Route("Kf_MateOutBillController/GetKf_MateOutBill_Sync_Json")] |
| | | [HttpGet] |
| | | public json GetKf_MateOutBill_Sync_Json(string HBillNo, string HBillType) |
| | | { |
| | | try |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | string sql = string.Empty; |
| | | string sErrMsg = ""; |
| | | if (oSystemParameter.ShowBill(ref sErrMsg) == true) |
| | | { |
| | | //ç³»ç»åæ°æ¯å¦ä¸ºç§æäºæ¨¡å¼,N为å
¬æäºæ¨¡å¼ï¼Yä¸ºç§æäºæ¨¡å¼ |
| | | //ç§æäºæ¨¡å¼ï¼éè¿è°ç¨åå¨è¿ç¨è¿è¡åæ¥ |
| | | if (oSystemParameter.omodel.WMS_CloudMode.ToUpper() == "Y") |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_IFCLD_ERPSourceBillToLocal_MateOut '" + HBillNo + "'", "h_p_IFCLD_ERPSourceBillToLocal_MateOut"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮忥åçé误ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 2) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "忮忥æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | //å
¬æäºæ¨¡å¼ï¼éè¿è°ç¨WEBAPIæ¹å¼è¿è¡åæ¥ |
| | | else if (oSystemParameter.omodel.WMS_CloudMode.ToUpper() == "N") |
| | | { |
| | | //夿éè¶äºæ¯å¦ç»å½æå |
| | | var loginRet = InvokeHelper.Login(); |
| | | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); |
| | | //夿æ¯å¦ç»å½æå |
| | | if (isSuccess <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ¥å¤±è´¥ï¼éè¶äºç»å
¥ä¸æåï¼è¯·ç¡®è®¤Cçé
ç½®æä»¶æè®¾ç½®éè¶äºå¯¹åºç½åãè´¦å¥ãç»å½ç¨æ·ãç»å½å¯ç æ¯å¦æ£ç¡®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var json = new |
| | | { |
| | | CreateOrgId = 0, |
| | | Number = HBillNo, |
| | | Id = "" |
| | | }; |
| | | //æ¥ç è·åæ°æ® |
| | | var _result = InvokeHelper.View("PRD_PickMtrl", JsonConvert.SerializeObject(json)); |
| | | var _saveObj = JObject.Parse(_result); |
| | | //夿éè¶äºæ°æ®æ¯å¦è·åæå |
| | | if (_saveObj["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶äºçäº§é¢æåè·å失败ï¼" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCn.BeginTran(); |
| | | //æ¥æ¾æ¬å°çäº§é¢æåè¡¨ä¸æ¯å¦åå¨è¯¥åæ®ï¼åå¨è·åæ¬ååæ®IDï¼ä¸åå¨åè·åæå¤§åæ®ID |
| | | Int64 HNewInterID = 0; |
| | | ds = oCn.RunProcReturn("select HInterID from Kf_ICStockBillMain with(nolock) where HBillNo = '" + HBillNo + "' and HBillType='1204'", "Kf_ICStockBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | HNewInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref sErrMsg); |
| | | } |
| | | else |
| | | { |
| | | HNewInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HInterID"]); |
| | | } |
| | | |
| | | //æ ¹æ®åæ®å·å 餿¬å°çäº§é¢æåä¸å¯¹åºåæ® |
| | | oCn.RunProc("Delete b from Kf_ICStockBillMain a inner join Kf_ICStockBillSub b on a.HInterID=b.HInterID where a.HBillNo = '" + HBillNo + "' and a.HBillType='1204'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.RunProc("Delete from Kf_ICStockBillMain where HBillNo = '" + HBillNo + "' and HBillType='1204'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //ä¸»è¡¨æ°æ®èµå¼ |
| | | var MainData = new |
| | | { |
| | | HInterID = HNewInterID, |
| | | HBillNo = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["BillNo"]), |
| | | HBillType = "1204", |
| | | HBillSubType = "1204", |
| | | HMainSourceBillType = "", |
| | | HDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["Date"]), |
| | | HSupID = 0, |
| | | HWHID = 0, |
| | | HSCWHID = 0, |
| | | HEmpID = 0, |
| | | HManagerID = 0, |
| | | HSecManagerID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["PickerId_Id"]), |
| | | HKeeperID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["FSTOCKERID_Id"]), |
| | | HDeptID = 0, |
| | | HCurID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["CurrId_Id"]), |
| | | HSeOrderBillNo = "", |
| | | HExplanation = "CLD导å
¥", |
| | | HRemark = "", |
| | | HInnerBillNo = "", |
| | | HRedBlueFlag = 0, |
| | | HBillStatus = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["ApproverId_Id"]) == 0 ? 1 : 2, |
| | | HMaker = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["CreatorId"]["Name"]), |
| | | HMakeDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["CreateDate"]), |
| | | HChecker = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["ApproverId_Id"]) == 0 ? "" : DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["ApproverId"]["Name"]), |
| | | HCheckDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["ApproveDate"]), |
| | | HUpDater = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["ModifierId_Id"]) == 0 ? "" : DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["ModifierId"]["Name"]), |
| | | HUpDateDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["ModifyDate"]), |
| | | HDeleteMan = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["CANCELER_Id"]) == 0 ? "" : DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["CANCELER"]["Name"]), |
| | | HDeleteDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["CancelDate"]), |
| | | HOWNERID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["OwnerId_Id"]), |
| | | HOWNERTYPEID = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["OwnerTypeId"]), |
| | | HERPInterID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["Id"]), |
| | | HERPBillType = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["BillType_Id"]), |
| | | HERPBillNo = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["BillNo"]), |
| | | HPRDORGID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["PrdOrgId_Id"]), |
| | | HSTOCKORGID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["StockOrgId_Id"]), |
| | | }; |
| | | //åå
¥ä¸»è¡¨ |
| | | sql = $@"Insert into Kf_ICStockBillMain |
| | | (HInterID,HYear,HPeriod,HBillNo,HBillType,HBillSubType,HMainSourceBillType,HDate |
| | | ,HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HCurID |
| | | ,HSeOrderBillNo,HExplanation,HRemark,HInnerBillNo,HRedBlueFlag,HBillStatus |
| | | ,HMaker,HMakeDate |
| | | ,HChecker,HCheckDate |
| | | ,HUpDater,HUpDateDate |
| | | ,HDeleteMan,HDeleteDate |
| | | ,HOWNERID,HOWNERTYPEID,HERPInterID,HERPBillType,HERPBillNo |
| | | ,HPRDORGID,HSTOCKORGID) |
| | | Values({MainData.HInterID},year('{MainData.HDate}'),month('{MainData.HDate}'),'{MainData.HBillNo}','{MainData.HBillType}','{MainData.HBillSubType}','{MainData.HMainSourceBillType}','{MainData.HDate}' |
| | | , {MainData.HSupID},{MainData.HWHID},{MainData.HSCWHID},{MainData.HEmpID},{MainData.HManagerID},{MainData.HSecManagerID},{MainData.HKeeperID},{MainData.HDeptID},{MainData.HCurID} |
| | | ,'{MainData.HSeOrderBillNo}','{MainData.HExplanation}','{MainData.HRemark}','{MainData.HInnerBillNo}',{MainData.HRedBlueFlag},{MainData.HBillStatus} |
| | | ,'{MainData.HMaker}','{MainData.HMakeDate}' |
| | | ,'{MainData.HChecker}',case when '{MainData.HCheckDate}' = '1900/1/1 0:00:00' then NULL else '{MainData.HCheckDate}' end |
| | | ,'{MainData.HUpDater}',case when '{MainData.HUpDateDate}' = '1900/1/1 0:00:00' then NULL else '{MainData.HUpDateDate}' end |
| | | ,'{MainData.HDeleteMan}',case when '{MainData.HDeleteDate}' = '1900/1/1 0:00:00' then NULL else '{MainData.HDeleteDate}' end |
| | | , {MainData.HOWNERID},'{MainData.HOWNERTYPEID}',{MainData.HERPInterID},'{MainData.HERPBillType}','{MainData.HERPBillNo}' |
| | | , {MainData.HPRDORGID},{MainData.HSTOCKORGID})"; |
| | | oCn.RunProc(sql.Replace("\r\n", "")); |
| | | |
| | | //åè¡¨æ°æ®èµå¼ |
| | | var dataArr = _saveObj["Result"]["Result"]["Entity"]; |
| | | foreach (var oSub in dataArr) |
| | | { |
| | | var subData = new |
| | | { |
| | | HInterID = HNewInterID, |
| | | HEntryID = DBUtility.ClsPub.isLong(oSub["Id"]), |
| | | HMTONo = DBUtility.ClsPub.isStrNull(oSub["MTONO"]), |
| | | HPlanMode = 0, |
| | | HRemark = "", |
| | | HExpressNumber = "", |
| | | HMaterID = DBUtility.ClsPub.isLong(oSub["MaterialId_Id"]), |
| | | HUnitID = DBUtility.ClsPub.isLong(oSub["UnitId_Id"]), |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(oSub["Lot_Text"]), |
| | | HPropertyID = DBUtility.ClsPub.isLong(oSub["AuxPropId_Id"]), |
| | | HWHID = DBUtility.ClsPub.isLong(oSub["StockId_Id"]), |
| | | HSPID = DBUtility.ClsPub.isLong(oSub["StockLocId_Id"]), |
| | | HSCWHID = 0, |
| | | HSCSPID = 0, |
| | | HQtyMust = DBUtility.ClsPub.isDoule(oSub["AppQty"]), |
| | | HQty = DBUtility.ClsPub.isDoule(oSub["ActualQty"]), |
| | | HPrice = DBUtility.ClsPub.isDoule(oSub["FPrice"]), |
| | | HMoney = DBUtility.ClsPub.isDoule(oSub["FAmount"]), |
| | | HTaxPrice = DBUtility.ClsPub.isDoule(oSub["FPrice"]), |
| | | HTaxRate = 1, |
| | | HTaxMoney = DBUtility.ClsPub.isDoule(oSub["FAmount"]), |
| | | HRelationQty = DBUtility.ClsPub.isDoule(oSub["SelPrcdReturnQty"]), |
| | | HRelationMoney = 0, |
| | | HSourceInterID = DBUtility.ClsPub.isLong(oSub["SrcInterId"]), |
| | | HSourceEntryID = DBUtility.ClsPub.isLong(oSub["SrcEnteryId"]), |
| | | HSourceBillNo = DBUtility.ClsPub.isStrNull(oSub["SrcBillNo"]), |
| | | HSourceBillType = DBUtility.ClsPub.isStrNull(oSub["SrcBillType"]), |
| | | HERPInterID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["Id"]), |
| | | HERPEntryID = DBUtility.ClsPub.isLong(oSub["Id"]), |
| | | HERPBillNo_Sub = "", |
| | | HPOOrderInterID = 0, |
| | | HPOOrderEntryID = 0, |
| | | HPOOrderBillNo = "", |
| | | HSeOrderInterID = 0, |
| | | HSeOrderEntryID = 0, |
| | | HSeOrderBillNo = "", |
| | | HICMOInterID = DBUtility.ClsPub.isLong(oSub["MoId"]), |
| | | HICMOEntryID = DBUtility.ClsPub.isLong(oSub["MoEntryId"]), |
| | | HICMOBillNo = DBUtility.ClsPub.isStrNull(oSub["MoBillNo"]), |
| | | HWWOrderInterID = 0, |
| | | HWWOrderEntryID = 0, |
| | | HWWOrderBillNo = "", |
| | | HProduceDate = DBUtility.ClsPub.isDate(oSub["ProduceDate"]), |
| | | HExpiryDate = DBUtility.ClsPub.isDate(oSub["ExpiryDate"]), |
| | | HOWNERID = DBUtility.ClsPub.isLong(oSub["OwnerId_Id"]), |
| | | HOWNERTYPEID = DBUtility.ClsPub.isStrNull(oSub["OwnerTypeId"]), |
| | | HKEEPERID = DBUtility.ClsPub.isLong(oSub["KeeperId_Id"]), |
| | | HKEEPERTYPEID = DBUtility.ClsPub.isStrNull(oSub["KeeperTypeId"]), |
| | | }; |
| | | |
| | | //åå
¥å表 |
| | | sql = $@"Insert into Kf_ICStockBillSub |
| | | (HInterID,HEntryID,HMTONo,HPlanMode,HRemark,HExpressNumber |
| | | ,HMaterID,HUnitID,HBatchNo,HPropertyID,HWHID,HSPID,HSCWHID,HSCSPID |
| | | ,HQtyMust,HQty,HPrice,HMoney,HTaxPrice,HTaxRate,HTaxMoney,HRelationQty,HRelationMoney |
| | | ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HERPInterID,HERPEntryID,HERPBillNo_Sub |
| | | ,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo |
| | | ,HICMOInterID,HICMOEntryID,HICMOBillNo,HWWOrderInterID,HWWOrderEntryID,HWWOrderBillNo |
| | | ,HProduceDate |
| | | ,HExpiryDate |
| | | ,HOWNERID,HOWNERTYPEID,HKEEPERID,HKEEPERTYPEID) |
| | | Values ({subData.HInterID},{subData.HEntryID},'{subData.HMTONo}',{subData.HPlanMode},'{subData.HRemark}','{subData.HExpressNumber}' |
| | | ,{subData.HMaterID},{subData.HUnitID},'{subData.HBatchNo}',{subData.HPropertyID},{subData.HWHID},{subData.HSPID},{subData.HSCWHID},{subData.HSCSPID} |
| | | ,{subData.HQtyMust},{subData.HQty},{subData.HPrice},{subData.HMoney},{subData.HTaxPrice},{subData.HTaxRate},{subData.HTaxMoney},{subData.HRelationQty},{subData.HRelationMoney} |
| | | ,{subData.HSourceInterID},{subData.HSourceEntryID},'{subData.HSourceBillNo}','{subData.HSourceBillType}',{subData.HERPInterID},{subData.HERPEntryID},'{subData.HERPBillNo_Sub}' |
| | | ,{subData.HPOOrderInterID},{subData.HPOOrderEntryID},'{subData.HPOOrderBillNo}',{subData.HSeOrderInterID},{subData.HSeOrderEntryID},'{subData.HSeOrderBillNo}' |
| | | ,{subData.HICMOInterID},{subData.HICMOEntryID},'{subData.HICMOBillNo}',{subData.HWWOrderInterID},{subData.HWWOrderEntryID},'{subData.HWWOrderBillNo}' |
| | | ,case when '{subData.HProduceDate}' = '1900/1/1 0:00:00' then NULL else '{subData.HProduceDate}' end |
| | | ,case when '{subData.HExpiryDate}' = '1900/1/1 0:00:00' then NULL else '{subData.HExpiryDate}' end |
| | | ,{subData.HOWNERID},'{subData.HOWNERTYPEID}',{subData.HKEEPERID},'{subData.HKEEPERTYPEID}')"; |
| | | oCn.RunProc(sql.Replace("\r\n", "")); |
| | | } |
| | | |
| | | oCn.Commit(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "忮忥æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "䏿¯æåæ¥åè½ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; |
| | | 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 æ¡ç æç» |
| | | /// <summary> |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <returns></returns> |
| | | [Route("Kf_MateOutBillController/BarCodeNote")] |
| | | [HttpGet] |
| | | public object SellOutBill_BarCodeNote(int HInterID) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameListSum = new List<object>(); |
| | | List<object> columnNameList0 = new List<object>(); |
| | | List<object> columnNameList1 = new List<object>(); |
| | | List<object> columnNameList2 = new List<object>(); |
| | | |
| | | string sql = "exec h_p_IFCLD_ERPSourceBillToLocal_MateOut " + HInterID; |
| | | ds = oCn.RunProcReturn(sql, " h_p_IFCLD_ERPSourceBillToLocal_MateOut"); |
| | | |
| | | //æ·»å åºæ¬ä¿¡æ¯ åå |
| | | foreach (DataColumn col in ds.Tables[1].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList0.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | //æ·»å ç åä¿¡æ¯ åå |
| | | foreach (DataColumn col in ds.Tables[2].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList1.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | //æ·»å æ¡ç æç» åå |
| | | foreach (DataColumn col in ds.Tables[3].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList2.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | columnNameListSum.Add(columnNameList0); |
| | | columnNameListSum.Add(columnNameList1); |
| | | columnNameListSum.Add(columnNameList2); |
| | | |
| | | List<DataTable> tableList = new List<DataTable>(); |
| | | tableList.Add(ds.Tables[1]); |
| | | tableList.Add(ds.Tables[2]); |
| | | tableList.Add(ds.Tables[3]); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = tableList; |
| | | objJsonResult.list = columnNameListSum; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |