| | |
| | | } |
| | | } |
| | | |
| | | //刷新表体 车间定位 返回车间即时库存库存信息网页PDA版 |
| | | [Route("KF_ICInventory_WorkShopByMaterID/GetWorkShopICInventory")] |
| | | [HttpGet] |
| | | public object GetWorkShopICInventory(string HBarCode, long sHWHID, long sHSPID, long HOWNERID, string sWhere) |
| | | { |
| | | try |
| | | { |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | List<object> columnNameList = new List<object>(); |
| | | DataSet ds = oCN.RunProcReturn("exec h_p_KF_ICInventory_WorkShopByMaterIDList '" + HBarCode + "'," + sHWHID + "," + sHSPID + "," + HOWNERID + ",'" + sWhere + "'", "h_p_KF_ICInventory_WorkShopByMaterIDList"); |
| | | //添加列名 |
| | | 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 = null; |
| | | return objJsonResult; |
| | | //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning); |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | //车间定位 车间下架库存信息查询 |
| | | [Route("KF_ICInventory_WorkShop/GetWorkShopXJICInventory")] |
| | | [HttpGet] |
| | | public object GetWorkShopXJICInventory(string HCarBarCode, string HEquipBarCode, string HProcExBillNo,string HMaterNumber, long HWHID, long HSPID,string sWhere) |
| | | { |
| | | try |
| | | { |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | List<object> columnNameList = new List<object>(); |
| | | DataSet ds = oCN.RunProcReturn("exec h_p_KF_ICInventory_WorkShopByXJList '" + HCarBarCode + "','" + HEquipBarCode + "','" + HProcExBillNo + "','" + HMaterNumber + "'," + HWHID + "," + HSPID + ",'" + sWhere + "'", "h_p_KF_ICInventory_WorkShopByXJList"); |
| | | //添加列名 |
| | | 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 = null; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | #region 车间定位 车间查询条码是否存在 |
| | | [Route("KF_ICInventory_WorkShop/SearchHBarCode")] |
| | | [HttpGet] |
| | | public object checkHBarCode_Batch(string HBarCode, string user, int HOrgID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn(@"select * from h_v_Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "h_v_Gy_BarCodeBill"); |
| | | |
| | | //判断条码是否存在条码档案 |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "[0000-1-037]校验成功"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-010]没有返回任何记录!当前批次码无入库信息请检查是否扫错"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-010]没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 车间定位 删除条码库存记录 |
| | | [Route("KF_ICInventory_WorkShop/ClearHBarCode")] |
| | | [HttpGet] |
| | | public object ClearHBarCode(string HBarCode, long HWHID, long HSPID, string user, int HOrgID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | //保存后控制========================================= |
| | | ds = oCN.RunProcReturn($"exec h_p_KF_MaterialUpper_Clear '{HBarCode}','{HWHID}',{HSPID},'{user}',{HOrgID}", "h_p_KF_ICInventory_Clear"); |
| | | |
| | | //写入日志 |
| | | ClsPub.Add_Log("", "删除项目,物料代码:" + HBarCode + ",仓位id:" + HSPID, user); |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-010]没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | //车间定位 车间上下架时间查询 |
| | | [Route("Kf_WorkShopICStockBill/List")] |
| | | [HttpGet] |
| | | public object Kf_WorkShopICStockBillList(string HBillType, string HCarBarCode, string HProcExBillNo, string HMaterNumber, long HWHID, long HSPID, string sWhere) |
| | | { |
| | | try |
| | | { |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | List<object> columnNameList = new List<object>(); |
| | | if(sWhere!=null) |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | } |
| | | DataSet ds = oCN.RunProcReturn("exec h_p_KF_WorkShopICStockBillList '" + HBillType + "','" + HCarBarCode + "','" + HProcExBillNo + "','" + HMaterNumber + "'," + HWHID + "," + HSPID + ",'" + sWhere + "'", "h_p_KF_WorkShopICStockBillList"); |
| | | //添加列名 |
| | | 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 = null; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | [Route("MateOutBill/Delete_Json")] |
| | | [HttpGet] |
| | | public object Delete_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string sHBillType) |