using DAL; using DBUtility; using Model; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using SQLHelper; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using WebAPI; using WebAPI.Models; using WebAPI.Service; namespace WebAPI.Controllers { public class WEBSController : ApiController { public string sWhere = ""; public WebServer webserver = new WebServer(); public DataSet ds = new DataSet(); private json objJsonResult = new json(); SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); public ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS(); public WebS.WebService1 oWebs = new WebS.WebService1(); public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain(); #region 公用方法 #region 获取最大单据ID、单据号 /// /// 获取最大单据ID、单据号 /// /// [Route("WEBSController/GetMaxBillNoAndID_Json")] [HttpGet] public object GetMaxBillNoAndID_Json(string HBillType) { try { string sErrMsg = ""; Int64 HInterID = 0; string HBillNo = ""; HInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref sErrMsg); HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref sErrMsg, true); //----------创建虚表------------------------ DataTable dt_Main = new DataTable("Json"); dt_Main.Columns.Add("HBillNo", typeof(string)); dt_Main.Columns.Add("HInterID", typeof(int)); //---------创建新行------------------------ DataRow dr_main = dt_Main.NewRow(); //创建新行 dt_Main.Rows.Add(dr_main); //将新行加入到表中 dr_main["HBillNo"] = DBUtility.ClsPub.isStrNull(HBillNo); dr_main["HInterID"] = DBUtility.ClsPub.isLong(HInterID); //返回数据 if (HBillNo == "" || HInterID == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "最大单据ID、单据号获取失败"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "获取成功"; objJsonResult.data = dt_Main; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "获取最大单据ID、单据号失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 基础资料 #region 仓库资料 //根据仓库ID、组织ID,返回仓库信息 public Model.ClsGy_Warehouse_Model GetWhInfoByIDandOrg(long sHWhID, long HUSEORGID, ref string sErr) { DAL.ClsIF_Warehouse_View dal = new DAL.ClsIF_Warehouse_View(); if (dal.GetInfoByIDandOrgID(sHWhID, HUSEORGID)) { return dal.omodel; } else { return null; } } #endregion #region 仓位资料 #endregion #endregion #region 界面控件功能调用方法 #region 根据单据类型获取单据子类型 /// /// 根据单据类型获取单据子类型 /// /// [Route("WEBSController/GetBillSubType_Json")] [HttpGet] public Object GetBillSubType_Json(string HBillType, Int64 HStockOrgID) { try { ds = oWebs.get_BillSubType(HBillType, HStockOrgID); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "查询不到单据子类型信息!"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = ds.Tables[0]; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "根据单据类型获取单据子类型信息失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 缓存列表 编辑功能调用 /// /// 缓存列表选择编辑时,判断所选单据是否已存在上传记录,启用先进先出功能的,回填先进先出临时表状态(更新 HlineStatus =0) /// /// [Route("WEBSController/TempList_Modify_Json")] [HttpGet] public object TempList_Modify_Json(long HInterID, string HBillNo, string HBillType) { try { if (oWebs.TempList_Modify(HInterID, HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! 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 已上传查询界面,根据单据号、源单号查询已上传单据信息 /// /// 已上传查询界面,根据单据号、源单号查询已上传单据信息 /// /// [Route("WEBSController/GetKf_ICStockBillQueryList_Json")] [HttpGet] public object GetKf_ICStockBillQueryList_Json(string HBillType, string HBillNo, string HSourceBillNo) { try { ds = oWebs.GetKf_ICStockBillQueryList(HBillType, HBillNo, HSourceBillNo); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "查询不到该单据记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; 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 #region 已上传列表界面,撤销功能,删除WMS表和本地出入库单记录,并更新TEMP表中的上传字段 HRelationInterID=0 /// /// 已上传列表界面,撤销功能,删除WMS表和本地出入库单记录,并更新TEMP表中的上传字段 HRelationInterID=0 /// /// [Route("WEBSController/DeleteICStockBillAndWMS_Json")] [HttpGet] public object DeleteICStockBillAndWMS_Json(Int64 HInterID, string HBillNo, string HBillType) { try { if (oWebs.DeleteICStockBillAndWMS(HInterID, HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! 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 条码出入库缓存列表模块 删除缓存列表单据 /// /// 删除缓存列表单据 /// /// [Route("WEBSController/set_DelPonderationBillMain_Temp_Json")] [HttpGet] public object set_DelPonderationBillMain_Temp_Json(long HInterID, string HBillType) { try { oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo); objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "删除成功"; 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 删除条码出入库临时表记录 /// /// 扫码模块,删除选中行条码出入库临时表记录 /// /// [Route("WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json")] [HttpGet] public object set_DelPonderationBillMain_Temp_InterIDAndSource_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string HBillType) { try { if (oWebs.set_DelPonderationBillMain_Temp_InterIDAndSource(HInterID, HMaterID, HAuxPropID, HMTONo, HSourceInterID, HSourceEntryID, HBillType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "删除所选行条码出入库临时表记录失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// /// 根据单据ID,删除条码出入库临时表记录 /// /// [Route("WEBSController/DeleteBillList_Json")] [HttpGet] public object DeleteBillList_Json(long HInterID) { try { if (oWebs.DeleteBillList(HInterID, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! 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 删除先进先出临时表(更新 HlineStatus =1) /// /// 删除先进先出临时表(更新 HlineStatus =1) /// /// [Route("WEBSController/set_DelPonderationBillMain_Temp_FIFO_Json")] [HttpGet] public object set_DelPonderationBillMain_Temp_FIFO_Json(long HInterID, string HBillType) { try { if (oWebs.set_DelPonderationBillMain_Temp_FIFO(HInterID, HBillType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "更新先进先出临时表HlineStatus值失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 提交生单处理方法 #region 销售出库 上传生单 #region 销售出库 校验模式 /// /// 销售出库校验上传 /// /// [Route("WEBSController/set_SaveSellOutBill_BillCheck_Json")] [HttpPost] public object set_SaveSellOutBill_BillCheck_Json([FromBody] JObject oMain) { var _value = oMain["oMain"].ToString(); string msg1 = _value.ToString(); try { List lsmain = new List(); ListModels oListModels = new ListModels(); lsmain = oListModels.getSellOutBillMainByJson(msg1); WebAPI.WebS.ClsKf_SellOutBillMain websLsmain = new WebS.ClsKf_SellOutBillMain(); websLsmain.HInterID = lsmain[0].HInterID; websLsmain.HBillNo = lsmain[0].HBillNo; websLsmain.HBillType = "1205"; websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; if (oWebs.set_SaveSellOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "销售出库校验失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 委外领料 上传生单 #region 委外领料 校验模式 /// /// 委外领料校验上传 /// /// [Route("WEBSController/set_SaveEntrustOutBill_BillCheck_Json")] [HttpPost] public object set_SaveEntrustOutBill_BillCheck_Json([FromBody] JObject oMain) { var _value = oMain["oMain"].ToString(); string msg1 = _value.ToString(); try { List lsmain = new List(); ListModels oListModels = new ListModels(); lsmain = oListModels.getEntrustOutBillMainByJson(msg1); WebAPI.WebS.ClsKf_EntrustOutBillMain websLsmain = new WebS.ClsKf_EntrustOutBillMain(); websLsmain.HInterID = lsmain[0].HInterID; websLsmain.HBillNo = lsmain[0].HBillNo; websLsmain.HBillType = "1211"; websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; if (oWebs.set_SaveEntrustOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "委外领料校验失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 生产补料 上传生单 #region 生产补料 校验模式 /// /// 生产补料校验上传 /// /// [Route("WEBSController/set_SaveMateReplenishOutBill_BillCheck_Json")] [HttpPost] public object set_SaveMateReplenishOutBill_BillCheck_Json([FromBody] JObject oMain) { var _value = oMain["oMain"].ToString(); string msg1 = _value.ToString(); try { List lsmain = new List(); ListModels oListModels = new ListModels(); lsmain = oListModels.getMateReplenishOutBillMainByJson(msg1); WebAPI.WebS.ClsKf_MateReplenishOutBillMain websLsmain = new WebS.ClsKf_MateReplenishOutBillMain(); websLsmain.HInterID = lsmain[0].HInterID; websLsmain.HBillNo = lsmain[0].HBillNo; websLsmain.HBillType = "1254"; websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; if (oWebs.set_SaveMateReplenishOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "生产补料校验失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 委外补料 上传生单 #region 委外补料 校验模式 /// /// 委外补料校验上传 /// /// [Route("WEBSController/set_SaveEntrustReplenishOutBill_BillCheck_Json")] [HttpPost] public object set_SaveEntrustReplenishOutBill_BillCheck_Json([FromBody] JObject oMain) { var _value = oMain["oMain"].ToString(); string msg1 = _value.ToString(); try { List lsmain = new List(); ListModels oListModels = new ListModels(); lsmain = oListModels.getEntrustReplenishOutBillMainByJson(msg1); WebAPI.WebS.ClsKf_EntrustReplenishOutBillMain websLsmain = new WebS.ClsKf_EntrustReplenishOutBillMain(); websLsmain.HInterID = lsmain[0].HInterID; websLsmain.HBillNo = lsmain[0].HBillNo; websLsmain.HBillType = "1255"; websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; if (oWebs.set_SaveEntrustReplenishOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "委外补料校验失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 直接调拨 上传生单 #region 换托调拨单 /// /// 上传生成换托调拨单 /// /// [Route("WEBSController/set_SaveMoveStockBill_HuanTuo_Json")] [HttpGet] public object set_SaveMoveStockBill_HuanTuo_Json(Int64 HInterID, string HBillType, string HBillNo, string HBarCode_Pack, string HMaker, Int64 HStockOrgID) { try { if (oWebs.set_SaveMoveStockBill_HuanTuo(HInterID, HBillType, HBillNo, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "生成换托调拨单失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 生产组托单 上传生单 /// /// 上传生成生产组托单 /// /// [Route("WEBSController/set_SavePackUnionBill_Json")] [HttpGet] public object set_SavePackUnionBill_Json(Int64 HInterID, string HBillType, string HBillNo, string HBarCode_Pack, string HMaker, Int64 HStockOrgID) { try { if (oWebs.set_SavePackUnionBill_Add(HInterID, HBillType, HBillNo, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "生成生产组托单失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 源单条码处理方法 #region 生产入库 扫描源单条码 /// /// 生产入库 扫描源单条码 /// /// [Route("WEBSController/Get_SourceBarCode_ProductIn_Json")] [HttpGet] public object get_SourceBarCode_ProductIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) { try { WebSoBar = oWebs.get_SourceBarCode_ProductIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 采购入库 扫描源单条码 /// /// 采购入库 扫描源单条码 /// /// [Route("WEBSController/Get_SourceBarCode_POStockIn_Json")] [HttpGet] public object get_SourceBarCode_POStockIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) { try { WebSoBar = oWebs.get_SourceBarCode_POStockIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 其他入库 扫描源单条码 /// /// 其他入库 扫描源单条码 /// /// [Route("WEBSController/Get_SourceBarCode_OtherIn_Json")] [HttpGet] public object get_SourceBarCode_OtherIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) { try { WebSoBar = oWebs.get_SourceBarCode_OtherIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 生产领料 扫描源单条码 /// /// 领料出库 扫描源单条码 /// /// [Route("WEBSController/Get_SourceBarCode_MateOut_Json")] [HttpGet] public object get_SourceBarCode_MateOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Double HPTQty, Int64 HPlanMode, Int64 HFIFOWhID, Int64 HStockOrgID) { try { WebSoBar = oWebs.get_SourceBarCode_MateOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HPTQty, HPlanMode, HFIFOWhID, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 销售出库 扫描源单条码 /// /// 销售出库 扫描源单条码 /// /// [Route("WEBSController/Get_SourceBarCode_SellOut_Json")] [HttpGet] public object get_SourceBarCode_SellOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HOWNERID) { try { WebSoBar = oWebs.get_SourceBarCode_SellOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HOWNERID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 委外出库 扫描源单条码 /// /// 委外出库 扫描源单条码 /// /// [Route("WEBSController/Get_SourceBarCode_EntrustOut_Json")] [HttpGet] public object get_SourceBarCode_EntrustOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HStockOrgID) { try { WebSoBar = oWebs.get_SourceBarCode_EntrustOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 其他出库 扫描源单条码 /// /// 其他出库 扫描源单条码 /// /// [Route("WEBSController/get_SourceBarCode_OtherOut_Json")] [HttpGet] public object get_SourceBarCode_OtherOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HOWNERID) { try { WebSoBar = oWebs.get_SourceBarCode_OtherOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HOWNERID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 直接调拨 扫描源单条码 /// /// 直接调拨 扫描源单条码 /// /// [Route("WEBSController/get_SourceBarCode_MoveStock_Json")] [HttpGet] public object get_SourceBarCode_MoveStock_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HOWNERID) { try { WebSoBar = oWebs.get_SourceBarCode_MoveStock(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HOWNERID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 分步式调出 扫描源单条码 /// /// 分步式调出 扫描源单条码 /// /// [Route("WEBSController/Get_SourceBarCode_MoveStockStepOut_Json")] [HttpGet] public object get_SourceBarCode_MoveStockStepOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HStockInOrgID, Int64 HStockOutOrgID) { try { WebSoBar = oWebs.get_SourceBarCode_MoveStockStepOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HStockInOrgID, HStockOutOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 分步式调入 扫描源单条码 /// /// 分步式调入 扫描源单条码 /// /// [Route("WEBSController/Get_SourceBarCode_MoveStockStepIn_Json")] [HttpGet] public object get_SourceBarCode_MoveStockStepIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockInOrgID, Int64 HStockOutOrgID) { try { WebSoBar = oWebs.get_SourceBarCode_MoveStockStepIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockInOrgID, HStockOutOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描源单条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 物料条码处理方法 其他出库库模块 /// /// 物料条码文本框 扫码调用 /// /// [Route("WEBSController/Get_BarCode_Json")] [HttpGet] public Object get_BarCode_Json(string sBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockOrgID, string HScanStyle, string HCustom1, string HCustom2) { //获取系统参数 string sErrMsg = ""; string sJXCode = ""; if (oSystemParameter.ShowBill(ref sErrMsg) == true) { if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数 客户定制化名称 空白为通用 { sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOrgID, HBillNo, HMaker); SourceFlag = true; } else { sJXCode = sBarCode; } try { WebSoBar = oWebs.get_BarCode(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HStockOrgID, HScanStyle, HCustom1, HCustom2, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "获取系统参数失败! " + sErrMsg; objJsonResult.data = null; return objJsonResult; } } #endregion #region 物料条码处理方法 调拨模块 /// /// 物料条码文本框 扫码调用 /// /// [Route("WEBSController/get_BarCode_MoveStock_Json")] [HttpGet] public Object get_BarCode_MoveStock_Json(string sBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWHID, Int64 HSCSPID, Double HQty, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockInOrgID, Int64 HStockOutOrgID, string HScanStyle) { string sErrMsg = ""; string sJXCode = ""; if (oSystemParameter.ShowBill(ref sErrMsg) == true) { if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数 客户定制化名称 空白为通用 { sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker); SourceFlag = true; } else { sJXCode = sBarCode; } try { string HCustom1 = "", HCustom2 = ""; WebSoBar = oWebs.get_BarCode_MoveStock(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, ref DBUtility.ClsPub.sErrInfo, HCustom1, HCustom2); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "获取系统参数失败! " + sErrMsg; objJsonResult.data = null; return objJsonResult; } //try //{ // var sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker); // WebSoBar = oWebs.get_BarCode_MoveStock(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, ref DBUtility.ClsPub.sErrInfo); // if (WebSoBar == null) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = DBUtility.ClsPub.sErrInfo; // objJsonResult.data = null; // return objJsonResult; // } // else // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "成功"; // objJsonResult.data = WebSoBar; // return objJsonResult; // } //} //catch (Exception e) //{ // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "扫描条码失败!" + e.ToString(); // objJsonResult.data = null; // return objJsonResult; //} } #endregion #region 物料条码处理方法 调拨盘点模块 /// /// 物料条码文本框 扫码调用 /// /// //[Route("WEBSController/get_BarCode_MoveStock_PD")] //[HttpGet] //public Object get_BarCode_MoveStock_PD(string sBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWHID, Int64 HSCSPID, Double HQty, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockInOrgID, Int64 HStockOutOrgID, string HScanStyle) //{ // string sErrMsg = ""; // string sJXCode = ""; // if (oSystemParameter.ShowBill(ref sErrMsg) == true) // { // if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数 客户定制化名称 空白为通用 // { // sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker); // SourceFlag = true; // } // else // { // sJXCode = sBarCode; // } // try // { // WebSoBar = oWebs.get_BarCode_MoveStock_PD(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, ref DBUtility.ClsPub.sErrInfo); // if (WebSoBar == null) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = DBUtility.ClsPub.sErrInfo; // objJsonResult.data = null; // return objJsonResult; // } // else // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "成功"; // objJsonResult.data = WebSoBar; // return objJsonResult; // } // } // catch (Exception e) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "扫描条码失败!" + e.ToString(); // objJsonResult.data = null; // return objJsonResult; // } // } // else // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "获取系统参数失败! " + sErrMsg; // objJsonResult.data = null; // return objJsonResult; // } //} #endregion #region 扫码模块调用方法 #region 从缓存列表页面返回信息 /// /// 从缓存列表页面返回信息 /// /// [Route("WEBSController/GetSourceBill_Temp_Json")] [HttpGet] public object GetSourceBill_Temp_Json(Int64 HInterID, string HBillType) { try { ds = oCn.RunProcReturn("exec h_p_WMS_SourceBill_Temp " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_WMS_SourceBill_Temp"); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "从缓存列表返回时,没有返回任何记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; 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 #region 单据新增模块 获取单据列表信息处理方法 /// /// 获取单据列表信息 /// /// [Route("WEBSController/GetBillEntryTmpList_Json")] [HttpGet] public object GetBillEntryTmpList(long HInterID, string HBillNo, string HBillType, Int64 HStockOrgID) { try { string sMouldManagerCtl = "N"; //是否启用器具管理 string sFIFOCtl = "N"; //是否启用先进先出管理 ds = oWebs.GetBillEntryTmpList(HInterID, HBillNo, HBillType, HStockOrgID, ref sMouldManagerCtl, ref sFIFOCtl, ref DBUtility.ClsPub.sErrInfo); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没有返回任何记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; objJsonResult.count = 1; objJsonResult.Message = "获取信息成功!"; objJsonResult.data = ds.Tables[0]; objJsonResult.data = new { Materlist = ds.Tables[0], //返回物料明细列表信息(0) Mouldlist = ds.Tables[1], //返回模治具列表信息(1) FIFOlist = ds.Tables[2], //返回先进先出列表信息(2) BarCodelist = ds.Tables[3], //返回条码明细列表信息(3) ICMOReportlist = ds.Tables[4], //返回源单生产汇报单条码明细列表信息(4) BarCodeDetailslist = ds.Tables[5] //返回当前所扫描条码明细信息(5) }; objJsonResult.list = columnNameList; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "获取列表信息失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 校验模式 模块调用方法 #region 从缓存列表编辑功能跳转至单据扫码模块,获取单据信息 /// /// 从缓存列表编辑功能跳转至单据扫码模块,获取单据信息 校验模式 /// /// [Route("WEBSController/GetSourceBillList_BillCheck_Json")] [HttpGet] public Object GetSourceBillList_BillCheck_Json(string HBillNo, string HBillType) { try { WebSoBar = oWebs.GetSourceBillList_BillCheck(HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "从缓存列表编辑功能跳转至单据扫码模块,获取单据信息失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 扫描单据条码 出入库模块 /// /// 扫描单据条码 出入库模块 校验模式 /// /// [Route("WEBSController/get_BillBarCode_BillCheck_Json")] [HttpGet] public Object get_BillBarCode_BillCheck_Json(string HBillNo, string HBillType, string HMaker, Int64 HStockOrgID) { try { WebSoBar = oWebs.get_BillBarCode_BillCheck(HBillNo, HBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描单据条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 扫描物料条码 出入库模块 /// /// 物料条码文本框 校验扫码调用 校验模式 /// /// [Route("WEBSController/get_CheckTypeByBarCode_BillCheck_Json")] [HttpGet] public Object get_CheckTypeByBarCode_BillCheck_Json(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, Int64 HStockOrgID) { //获取系统参数 string sErrMsg = ""; string sJXCode = ""; if (oSystemParameter.ShowBill(ref sErrMsg) == true) { string sSourceBarCodeCtl = "N"; //校验-是否进行源单对应条码核对('Y'为核对) if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") { //销售出库单 sSourceBarCodeCtl = "Y"; } if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数 客户定制化名称 空白为通用 { sJXCode = POStockInBillController.JX_Json(sBarCode, HBillID, HBillType, HStockOrgID, HBillNo, HMaker); } else { sJXCode = sBarCode; } try { //原单据为扫码生成,校验时不生成条码记录,只对原扫描的条码进行核对 if (sSourceBarCodeCtl == "Y") { WebSoBar = oWebs.get_BillBarCode_Verify(HBillID, HBillNo, HBillType, sJXCode, HQty, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } //原单据非扫码生成,校验时生成条码记录 else { WebSoBar = oWebs.get_CheckTypeByBarCode_BillCheck(sJXCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "校验模式,扫描条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "获取系统参数失败! " + sErrMsg; objJsonResult.data = null; return objJsonResult; } } #endregion #region 返回单据列表信息 /// /// 返回单据列表信息 校验模式 /// /// [Route("WEBSController/GetKf_PonderationBillMain_Temp_BillCheck_Json")] [HttpGet] public object GetKf_PonderationBillMain_Temp_BillCheck_Json(long HInterID, string HBillType, string sWhere) { try { ds = oWebs.GetKf_PonderationBillMain_Temp_BillCheck(HInterID, HBillType, sWhere); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没有返回任何记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; 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 #region 扫码模块,删除选中行条码出入库临时表记录 /// /// 扫码模块,删除选中行条码出入库临时表记录 /// /// [Route("WEBSController/set_DeleteBarCodeByEntryID_BillCheck_Json")] [HttpGet] public object set_DeleteBarCodeByEntryID_BillCheck_Json(long HInterID, string HBillType, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, Int64 HStockOrgID) { //获取系统参数 string sErrMsg = ""; if (oSystemParameter.ShowBillByOrgID(HStockOrgID,ref sErrMsg) == true) { string sSourceBarCodeCtl = "N"; //校验-是否进行源单对应条码核对('Y'为核对) if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") { //销售出库单 sSourceBarCodeCtl = "Y"; } //原单据为扫码生成,对原扫描的条码进行核对 if (sSourceBarCodeCtl == "Y") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "校验条码,删除功能不可用! "; objJsonResult.data = null; return objJsonResult; } //原单据非扫码生成 else { try { oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HMaterID=" + HMaterID.ToString() + " and HAuxPropID=" + HAuxPropID.ToString() + " and HMTONo='" + HMTONo + "' and HSourceInterID=" + HSourceInterID.ToString() + " and HSourceEntryID=" + HSourceEntryID.ToString() + " and HQty<>0 ", ref DBUtility.ClsPub.sExeReturnInfo); objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "删除成功"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "删除所选行条码出入库临时表记录失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "获取系统参数失败! " + sErrMsg; objJsonResult.data = null; return objJsonResult; } } #endregion #region 缓存模块 返回缓存列表信息 /// /// 返回缓存列表信息 校验模式 /// /// [Route("WEBSController/GetKf_PonderationBillMain_TempList_BillCheck_Json")] [HttpGet] public object GetKf_PonderationBillMain_TempList_BillCheck_Json(string HBillType, string HMaker, Int64 HStockOrgID) { try { ds = oWebs.GetKf_PonderationBillMain_TempList_BillCheck(HBillType, HMaker, HStockOrgID); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "单据无缓存记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; 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 #region 缓存模块 根据单据ID,删除临时表记录 /// /// 根据单据ID,删除临时表记录 /// /// [Route("WEBSController/DeleteBillList_BillCheck_Json")] [HttpGet] public object DeleteBillList_BillCheck_Json(long HInterID, string HBillType, Int64 HStockOrgID) { //获取系统参数 string sErrMsg = ""; if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) { string sSourceBarCodeCtl = "N"; //校验-是否进行源单对应条码核对('Y'为核对) if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") { //销售出库单 sSourceBarCodeCtl = "Y"; } //原单据为扫码生成,对原扫描的条码进行核对,删除条码出入库校验缓存记录 if (sSourceBarCodeCtl == "Y") { try { oCn.RunProc("Delete from KF_PonderationBillMain_Temp_Verify where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo); objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "删除成功"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "删除所选单据条码出入库临时表记录失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } //原单据非扫码生成,删除条码出入库缓存列表记录 else { try { oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo); objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "删除成功"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "删除所选单据条码出入库临时表记录失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "获取系统参数失败! " + sErrMsg; objJsonResult.data = null; return objJsonResult; } } #endregion #region 缓存模块 已上传列表界面,撤销功能 /// /// 已上传列表界面,撤销功能,删除WMS表和本地出入库单记录,并更新TEMP表中的上传字段 HRelationInterID=0 /// /// [Route("WEBSController/DeleteICStockBillAndWMS_BillCheck_Json")] [HttpGet] public object DeleteICStockBillAndWMS_BillCheck_Json(Int64 HInterID, string HBillNo, string HBillType, Int64 HStockOrgID) { //获取系统参数 string sErrMsg = ""; if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) { string sSourceBarCodeCtl = "N"; //校验-是否进行源单对应条码核对('Y'为核对) if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") { //销售出库单 sSourceBarCodeCtl = "Y"; } //原单据为扫码生成,对原扫描的条码进行核对 if (sSourceBarCodeCtl == "Y") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "校验条码,撤销功能不可用! "; objJsonResult.data = null; return objJsonResult; } //原单据非扫码生成 else { try { if (oWebs.DeleteICStockBillAndWMS(HInterID, HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "撤销单据已上传记录失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "获取系统参数失败! " + sErrMsg; objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 生产组托单模块调用方法 #region 生产组托单模块 扫描托条码 /// /// 生产组托单模块 扫描托条码 /// /// [Route("WEBSController/Get_PackBarCode_PackUnionBill_Json")] [HttpGet] public object get_PackBarCode_PackUnionBill_Json(Int64 HInterID, string HBillNo, string HBillType, string HBarCode_Pack, string HMaker, Int64 HStockOrgID) { try { WebS.ClsGy_BarCodeBill_WMS_Model WebSoBarModel = new WebS.ClsGy_BarCodeBill_WMS_Model(); WebSoBarModel = oWebs.get_PackBarCode_PackUnionBill(HInterID, HBillNo, HBillType, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBarModel == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBarModel; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描托条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 生产组托单模块 扫描托条码对应单个条码 /// /// 生产组托单模块 扫描托条码对应单个条码 /// /// [Route("WEBSController/Get_BarCode_PackUnionBill_Json")] [HttpGet] public object get_BarCode_PackUnionBill_Json(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HBarCode_Pack, string HMaker, Int64 HStockOrgID) { try { if (oWebs.get_BarCode_PackUnionBill(HBarCode, HInterID, HBillType, HBillNo, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! 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 返回组托列表信息 /// /// 返回组托列表信息 /// /// [Route("WEBSController/GetBillEntry_Tmp_Pack_Json")] [HttpGet] public object GetBillEntry_Tmp_Pack_Json(long HInterID, string HBillNo, string HBillType) { try { ds = oWebs.GetBillEntry_Tmp_Pack(HInterID, HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没有返回任何记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; 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 #region 删除明细表体选中行记录 /// /// 删除明细表体选中行记录 /// /// [Route("WEBSController/set_DelPackUnionBill_Temp_Pack_Json")] [HttpGet] public object set_DelPackUnionBill_Temp_Pack_Json(Int64 HInterID, string HBarCode, string HBillType) { try { if (oWebs.set_DelPackUnionBill_Temp_Pack(HInterID, HBarCode, HBillType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! 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 组托缓存列表模块调用方法 #region 返回组托缓存列表信息 /// /// 返回组托缓存列表信息 /// /// [Route("WEBSController/GetSc_PackUnionBill_TempList_Json")] [HttpGet] public object GetSc_PackUnionBill_TempList_Json(string HBillType, string HMaker, long HStockOrgID) { try { ds = oWebs.GetSc_PackUnionBill_TempList(HBillType, HMaker, HStockOrgID); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "单据无缓存记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; 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 #region 删除组托缓存列表单据 /// /// 删除组托缓存列表单据 /// /// [Route("WEBSController/DeleteTemp_PackUnionBill_Json")] [HttpGet] public object DeleteTemp_PackUnionBill_Json(Int64 HInterID) { try { if (oWebs.DeleteTemp_PackUnionBill(HInterID, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "删除缓存信息失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #endregion #region 删托模块调用方法 #region 删托模块 扫描托条码 /// /// 删托模块 扫描托条码 /// /// [Route("WEBSController/Get_PackBarCode_DeletePackUnionBill_Json")] [HttpGet] public object Get_PackBarCode_DeletePackUnionBill_Json(string HBarCode_Pack, string HMaker, Int64 HStockOrgID) { try { ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_DeletePackUnionBill '" + HBarCode_Pack + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddPackBarCode_DeletePackUnionBill"); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描托条码判断失败!"; objJsonResult.data = null; return objJsonResult; } else { if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 0) { List columnNameList = new List(); //添加列名 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 = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功!"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描托条码失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); 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 删托模块 上传 删除组托单信息 /// /// 上传 删除组托单信息 /// /// [Route("WEBSController/GetDeletePackUnionBill_Json")] [HttpGet] public object GetDeletePackUnionBill_Json(long HInterID, string HBillType, string HMaker) { try { oCn.RunProc("exec h_p_WMS_PackUnionBill_Delete " + HInterID.ToString() + ",'" + HBillType + "','" + HMaker + "'", ref DBUtility.ClsPub.sExeReturnInfo); objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "删托成功"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "删托失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #endregion #region 换托调拨单模块调用方法 #region 换托调拨单模块 扫描调入托条码 /// /// 换托调拨单模块 扫描调入托条码 /// /// [Route("WEBSController/Get_BarCodePack_In_MoveStockBill_HuanTuo_Json")] [HttpGet] public object get_BarCodePack_In_MoveStockBill_HuanTuo_Json(Int64 HInterID, string HBillNo, string HBarCode_Pack, Int64 HStockOrgID) { try { WebSoBar = oWebs.get_BarCodePack_In_MoveStockBill_HuanTuo(HInterID, HBillNo, HBarCode_Pack, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "成功"; objJsonResult.data = WebSoBar; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "扫描调入托条码失败!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 换托调拨单模块 扫描调出条码 /// /// 换托调拨单模块 扫描调出条码 /// /// [Route("WEBSController/Get_BarCode_MoveStockBill_HuanTuo_Json")] [HttpGet] public object get_BarCode_MoveStockBill_HuanTuo_Json(Int64 HInterID, string HBillNo, string HBillType, string HBarCode, string HBarCode_Pack, Int64 HPackUnionInterID_In, Int64 HWhID, Int64 HSPID, string HMaker, Int64 HStockOrgID) { try { if (oWebs.get_BarCode_MoveStockBill_HuanTuo(HInterID, HBillNo, HBillType, HBarCode, HBarCode_Pack, HPackUnionInterID_In, HWhID, HSPID, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! 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 换托调拨单模块 返回列表信息 /// /// 换托调拨单模块 返回列表信息 /// /// [Route("WEBSController/GetBillEntry_Temp_MoveStockBill_HuanTuo_Json")] [HttpGet] public object GetBillEntry_Temp_MoveStockBill_HuanTuo_Json(long HInterID, string HBillNo, string HBillType, Int64 HStockOrgID) { try { ds = oWebs.GetBillEntry_Temp_MoveStockBill_HuanTuo(HInterID, HBillNo, HBillType, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没有返回任何记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; 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 #region 换托调拨单模块 扫描删除明细表体行记录 /// /// 换托调拨单模块 扫描删除明细表体行记录 /// /// [Route("WEBSController/set_DelPackUnionBill_Temp_MoveStockBill_HuanTuo_Json")] [HttpGet] public object set_DelPackUnionBill_Temp_MoveStockBill_HuanTuo_Json(Int64 HInterID, string HBarCode, string HBillType) { try { if (oWebs.set_DelPackUnionBill_Temp_MoveStockBill_HuanTuo(HInterID, HBarCode, HBillType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! 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 换托调拨单模块 从缓存列表页面返回信息 /// /// 从缓存列表页面返回信息 /// /// [Route("WEBSController/GetKF_MoveStockBill_TempList_HuanTuo_Json")] [HttpGet] public object GetKF_MoveStockBill_TempList_HuanTuo_Json(Int64 HInterID, string HBillType) { try { ds = oCn.RunProcReturn("exec h_p_KF_MoveStockBill_TempList_HuanTuo " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_KF_MoveStockBill_TempList_HuanTuo"); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "从缓存列表返回时,没有返回任何记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; 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 #region 换托调拨单缓存列表模块 返回缓存列表信息 /// /// 返回换托调拨单缓存列表信息 /// /// [Route("WEBSController/GetPonderationBillMain_TempList_HuanTuo_Json")] [HttpGet] public object GetPonderationBillMain_TempList_HuanTuo_Json(string HBillType, string HMaker, long HStockOrgID) { try { ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_TempList_HuanTuo '" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_KF_PonderationBillMain_TempList_HuanTuo"); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "单据无缓存记录!"; objJsonResult.data = null; return objJsonResult; } else { List columnNameList = new List(); //添加列名 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 = "0"; 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 #endregion #region 处理方法 #endregion } }