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 objjson = new json();
|
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();
|
|
|
#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 根据单据类型获取单据子类型
|
|
/// <summary>
|
/// 根据单据类型获取单据子类型
|
/// </summary>
|
/// <returns></returns>
|
[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 已上传查询界面,根据单据号、源单号查询已上传单据信息
|
|
/// <summary>
|
/// 已上传查询界面,根据单据号、源单号查询已上传单据信息
|
/// </summary>
|
/// <returns></returns>
|
[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<object> columnNameList = new List<object>();
|
//添加列名
|
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
|
|
/// <summary>
|
/// 已上传列表界面,撤销功能,删除WMS表和本地出入库单记录,并更新TEMP表中的上传字段 HRelationInterID=0
|
/// </summary>
|
/// <returns></returns>
|
[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 删除条码出入库临时表记录
|
|
/// <summary>
|
/// 扫码模块,删除选中行条码出入库临时表记录
|
/// </summary>
|
/// <returns></returns>
|
[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;
|
}
|
}
|
|
/// <summary>
|
/// 根据单据ID,删除条码出入库临时表记录
|
/// </summary>
|
/// <returns></returns>
|
[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)
|
|
/// <summary>
|
/// 删除先进先出临时表(更新 HlineStatus =1)
|
/// </summary>
|
/// <returns></returns>
|
[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 销售出库 校验模式
|
|
/// <summary>
|
/// 销售出库校验上传
|
/// </summary>
|
/// <returns></returns>
|
[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<Model.ClsKf_SellOutBillMain> lsmain = new List<Model.ClsKf_SellOutBillMain>();
|
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 委外领料 校验模式
|
|
/// <summary>
|
/// 委外领料校验上传
|
/// </summary>
|
/// <returns></returns>
|
[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<Model.ClsKf_EntrustOutBillMain> lsmain = new List<Model.ClsKf_EntrustOutBillMain>();
|
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 生产补料 校验模式
|
|
/// <summary>
|
/// 生产补料校验上传
|
/// </summary>
|
/// <returns></returns>
|
[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<Model.ClsKf_MateReplenishOutBillMain> lsmain = new List<Model.ClsKf_MateReplenishOutBillMain>();
|
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 委外补料 校验模式
|
|
/// <summary>
|
/// 委外补料校验上传
|
/// </summary>
|
/// <returns></returns>
|
[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<Model.ClsKf_EntrustReplenishOutBillMain> lsmain = new List<Model.ClsKf_EntrustReplenishOutBillMain>();
|
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
|
|
|
#endregion
|
|
|
#region 源单条码处理方法
|
|
#region 生产入库 扫描源单条码
|
|
/// <summary>
|
/// 生产入库 扫描源单条码
|
/// </summary>
|
/// <returns></returns>
|
[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 生产领料 扫描源单条码
|
|
|
#endregion
|
|
#region 销售出库 扫描源单条码
|
|
/// <summary>
|
/// 销售出库 扫描源单条码
|
/// </summary>
|
/// <returns></returns>
|
[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 委外出库 扫描源单条码
|
|
|
#endregion
|
|
#region 其他出库 扫描源单条码
|
|
/// <summary>
|
/// 其他出库 扫描源单条码
|
/// </summary>
|
/// <returns></returns>
|
[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 直接调拨 扫描源单条码
|
|
/// <summary>
|
/// 直接调拨 扫描源单条码
|
/// </summary>
|
/// <returns></returns>
|
[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 分步式调出 扫描源单条码
|
|
|
#endregion
|
|
#region 分步式调入 扫描源单条码
|
|
|
#endregion
|
|
#endregion
|
|
|
#region 物料条码处理方法 其他出库库模块
|
|
/// <summary>
|
/// 物料条码文本框 扫码调用
|
/// </summary>
|
/// <returns></returns>
|
[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 物料条码处理方法 调拨模块
|
|
/// <summary>
|
/// 物料条码文本框 扫码调用
|
/// </summary>
|
/// <returns></returns>
|
[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)
|
{
|
try
|
{
|
WebSoBar = oWebs.get_BarCode_MoveStock(sBarCode, 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 单据新增模块 获取单据列表信息处理方法
|
|
/// <summary>
|
/// 获取单据列表信息
|
/// </summary>
|
/// <returns></returns>
|
[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<object> columnNameList = new List<object>();
|
//添加列名
|
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
|
|
|
#region 校验模式 模块调用方法
|
|
#region 从缓存列表编辑功能跳转至单据扫码模块,获取单据信息
|
|
/// <summary>
|
/// 从缓存列表编辑功能跳转至单据扫码模块,获取单据信息 校验模式
|
/// </summary>
|
/// <returns></returns>
|
[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 扫描单据条码 出入库模块
|
|
/// <summary>
|
/// 扫描单据条码 出入库模块 校验模式
|
/// </summary>
|
/// <returns></returns>
|
[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 扫描物料条码 出入库模块
|
|
/// <summary>
|
/// 物料条码文本框 校验扫码调用 校验模式
|
/// </summary>
|
/// <returns></returns>
|
[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)
|
{
|
if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数 客户定制化名称 空白为通用
|
{
|
sJXCode = POStockInBillController.JX_Json(sBarCode, HBillID, HBillType, HStockOrgID, HBillNo, HMaker);
|
}
|
else
|
{
|
sJXCode = sBarCode;
|
}
|
try
|
{
|
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 返回单据列表信息
|
|
/// <summary>
|
/// 返回单据列表信息 校验模式
|
/// </summary>
|
/// <returns></returns>
|
[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<object> columnNameList = new List<object>();
|
//添加列名
|
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 返回缓存列表信息
|
|
/// <summary>
|
/// 返回缓存列表信息 校验模式
|
/// </summary>
|
/// <returns></returns>
|
[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<object> columnNameList = new List<object>();
|
//添加列名
|
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
|
|
|
}
|
}
|