| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Converters; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region å
è£
容å¨åºå
¥åºæç»æ¥è¯¢ |
| | | [Route("Kf_ICStockInOutBill/Kf_PackStockDetailQuery")] |
| | | [HttpGet] |
| | | public object Kf_PackStockDetailQuery(string sWhere) |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | try |
| | | { |
| | | string sql = "select * from h_v_Kf_PackStockDetailQuery where 1=1 " + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Kf_PackStockDetailQuery"); |
| | | |
| | | 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 = ds.Tables[0].Rows.Count; |
| | | objJsonResult.Message = "è·åèµæºç»å®æ°æ®æåï¼"; |
| | | objJsonResult.data = JsonConvert.DeserializeObject<DataTable>(JsonConvert.SerializeObject(ds.Tables[0], new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" })); //åºååDataSetä¸çæ¶é´æ ¼å¼ï¼ç¶ååååºåå忥 |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = e.Message.ToString(); |
| | | objJsonResult.data = null; |
| | | objJsonResult.list = columnNameList; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region åºå
¥åºåæ®æ¡ç æç»æ¥è¯¢ |
| | | [Route("Kf_ICStockInOutBill/Kf_BarCodeDetailQuery")] |
| | | [HttpGet] |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region åºå
¥åºåæ®æ¡ç æç» è®¾ç½®æ°æ® |
| | | class BarCodeDetailSaveData |
| | | { |
| | | public long HInterID; |
| | | public string HBillNo; |
| | | public string HBillType; |
| | | public string HBarCode; |
| | | public double HMaterialJQty; |
| | | public double HWeight_TL; |
| | | public double HWeight_CP; |
| | | } |
| | | |
| | | [Route("Kf_ICStockInOutBill/Kf_BarCodeDetailQuery_saveData")] |
| | | [HttpPost] |
| | | public json Kf_BarCodeDetailQuery_saveData([FromBody] JObject sMainSub) |
| | | { |
| | | try |
| | | { |
| | | var _value = sMainSub["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //åè¡¨æ°æ® |
| | | string user = sArray[1].ToString(); |
| | | |
| | | msg2 = msg2.ToString(); |
| | | List<BarCodeDetailSaveData> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<BarCodeDetailSaveData>>(msg2); |
| | | |
| | | oCN.BeginTran(); |
| | | foreach (BarCodeDetailSaveData oSub in mainList) |
| | | { |
| | | long HInterID = oSub.HInterID; |
| | | string HBillNo = oSub.HBillNo; |
| | | string HBillType = oSub.HBillType; |
| | | string HBarCode = oSub.HBarCode; |
| | | double HMaterialJQty = oSub.HMaterialJQty; |
| | | double HWeight_TL = oSub.HWeight_TL; |
| | | double HWeight_CP = oSub.HWeight_CP; |
| | | |
| | | string sql = "update Kf_ICStockBillSub_WMS set " + |
| | | "HMaterialJQty = " + HMaterialJQty + "" + |
| | | ",HWeight_TL = " + HWeight_TL + "" + |
| | | ",HWeight_CP = " + HWeight_CP + "" + |
| | | "where HInterID = " + HInterID + " " + |
| | | "and HBillNo = '" + HBillNo + "' " + |
| | | "and HBillType = '" + HBillType + "' " + |
| | | "and HBarCode = '" + HBarCode + "' "; |
| | | 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 = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region æ¡ç åºå
¥åºç¼å |
| | | #region æ¡ç åºå
¥åºç¼åå表 |