| | |
| | | public static string BuildDynamicQueryJson(string materialNumber = null, long FHStockId=0, long HOWNERID = 0) |
| | | { |
| | | // 创建动态过滤条件列表 |
| | | var filterList = new List<object>(); |
| | | var queryParams; |
| | | var filterList = new List<object>(); |
| | | if (HOWNERID!= 100038) |
| | | { |
| | | // 如果有物料编码,添加物料条件 |
| | |
| | | } |
| | | |
| | | // 构建完整的查询参数 |
| | | queryParams = new |
| | | var queryParams = new |
| | | { |
| | | FormId = "STK_Inventory", |
| | | FieldKeys = "FMaterialId,FMaterialName,FModel,FStockUnitId,FBaseQty,FStockId,FStockLocId,FLot,FAuxPropId,FProduceDate,FExpiryDate,FStockOrgId", |
| | | FilterString = filterList |
| | | }; |
| | | return JsonConvert.SerializeObject(queryParams); |
| | | } |
| | | else |
| | | { |
| | | |
| | | |
| | | //47 不支持上面的动态过滤条件 构建完整的查询参数 |
| | | queryParams = new |
| | | var queryParams1 = new |
| | | { |
| | | FormId = "STK_Inventory", |
| | | FieldKeys = "FMaterialId,FMaterialName,FModel,FStockUnitId,FBaseQty,FStockId,FStockLocId,FLot,FAuxPropId,FProduceDate,FExpiryDate,FStockOrgId", |
| | | FilterString = "" |
| | | }; |
| | | return JsonConvert.SerializeObject(queryParams1); |
| | | } |
| | | |
| | | |
| | | return JsonConvert.SerializeObject(queryParams); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | |
| | | |
| | | #endregion |
| | | |
| | | //车间定位 车间上下架时间查询 |
| | | #region 车间定位 车间上下架时间查询 |
| | | [Route("Kf_WorkShopICStockBill/List")] |
| | | [HttpGet] |
| | | public object Kf_WorkShopICStockBillList(string HBillType, string HCarBarCode, string HProcExBillNo, string HMaterNumber, long HWHID, long HSPID, string sWhere) |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | [Route("MateOutBill/Delete_Json")] |
| | | [HttpGet] |
| | | public object Delete_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string sHBillType) |
| | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region 车间定位 车间上下架时间查询 |
| | | [Route("KF_ICInventory_WorkShop/KF_ICInventory_WorkShopList")] |
| | | [HttpGet] |
| | | public object KF_ICInventory_WorkShopList(string sWhere) |
| | | {// string HBarCode, string HMaterNumber, long HWHID, long HSPID, |
| | | try |
| | | { |
| | | DataSet ds; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | List<object> columnNameList = new List<object>(); |
| | | if (sWhere != null) |
| | | { |
| | | //sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("select * from h_v_KF_ICInventory_WorkShop_WMS where 1=1 "+ sWhere, "h_v_KF_ICInventory_WorkShop_WMS"); |
| | | } |
| | | else |
| | | ds = oCN.RunProcReturn("select * from h_v_KF_ICInventory_WorkShop_WMS where 1=1", "h_v_KF_ICInventory_WorkShop_WMS"); |
| | | //添加列名 |
| | | 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列对象的列名 |
| | | } |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |