first commit
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In
|
||||
{
|
||||
/// <summary>
|
||||
/// 业务类型
|
||||
/// </summary>
|
||||
public enum ActionID
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷库存按条码查询(获取某卷纸的库存信息)
|
||||
/// </summary>
|
||||
ODIRollStockQueryByBarcode = 0,
|
||||
/// <summary>
|
||||
/// 纸卷领用记录新增
|
||||
/// </summary>
|
||||
ODIRollPickInsert = 1,
|
||||
/// <summary>
|
||||
/// 纸卷领用记录删除
|
||||
/// </summary>
|
||||
ODIRollPickDelete = 2,
|
||||
/// <summary>
|
||||
/// 纸卷退库记录新增
|
||||
/// </summary>
|
||||
ODIRollReturnInsert = 3,
|
||||
/// <summary>
|
||||
/// 纸卷退库记录删除
|
||||
/// </summary>
|
||||
ODIRollReturnDelete = 4,
|
||||
/// <summary>
|
||||
/// 纸卷库存按门幅、纸质编码查询(获取某卷纸的库存信息)
|
||||
/// </summary>
|
||||
ODIRollStockQuery = 5,
|
||||
/// <summary>
|
||||
/// 新卷查询(按起始时间获取新卷信息)
|
||||
/// </summary>
|
||||
ODIRollNewQueryByTime = 6
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In
|
||||
{
|
||||
/// <summary>
|
||||
/// 业务参数
|
||||
/// </summary>
|
||||
public class ActionParam<T> where T : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 业务类型
|
||||
/// </summary>
|
||||
public string ActionID { get; set; }
|
||||
/// <summary>
|
||||
/// 单厂接口时可以不传;集团版系统对接则传main
|
||||
/// </summary>
|
||||
public string GroupManagementDistributedFactoryID { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 业务参数
|
||||
/// </summary>
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto
|
||||
{
|
||||
public class BusinessParamBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 原纸库存信息查询参数
|
||||
/// </summary>
|
||||
public class PaperPreparationQueryParam : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸质编码
|
||||
/// </summary>
|
||||
public string Paper { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 门幅
|
||||
/// </summary>
|
||||
public int PaperWidth { get; set; }
|
||||
/// <summary>
|
||||
/// 系统推荐机台
|
||||
/// </summary>
|
||||
|
||||
public int MachineNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需求重量
|
||||
/// </summary>
|
||||
public double Weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PageSize
|
||||
/// </summary>
|
||||
public int PageSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PageIndex
|
||||
/// </summary>
|
||||
public int PageIndex { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
using Org.BouncyCastle.Bcpg.OpenPgp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷领用记录新增参数
|
||||
/// </summary>
|
||||
public class PaperReceiptRecordAddParam: BusinessParamBase
|
||||
{
|
||||
//企望Erp,空字符串,要传""。null的话,报错
|
||||
private static string defaultString = "";
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷条码
|
||||
/// </summary>
|
||||
public string Barcode { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 领用人
|
||||
/// </summary>
|
||||
public string PickTo { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 用途
|
||||
/// </summary>
|
||||
public string PickFor { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 领用到工单号
|
||||
/// </summary>
|
||||
public string WO { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 领用机床(如有多条瓦线,在此指定领用给哪一条瓦线)
|
||||
/// </summary>
|
||||
public string PickMachine { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 领用机位(每条瓦线有多个机位,在此指定领用给哪一个机位)
|
||||
/// </summary>
|
||||
public int WorkSection { get; set; }
|
||||
/// <summary>
|
||||
/// 出库日期
|
||||
/// </summary>
|
||||
public string PickDate { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 出库时间
|
||||
/// </summary>
|
||||
public string PickTime { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 上机时间
|
||||
/// </summary>
|
||||
public string UpLoadOn { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 产线名称
|
||||
/// </summary>
|
||||
public string ProductLineName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷领用记录删除参数
|
||||
/// </summary>
|
||||
public class PaperReceiptRecordDelParam : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷条码
|
||||
/// </summary>
|
||||
public string Barcode { get; set; }
|
||||
/// <summary>
|
||||
/// 条码出库批次号,即新增领用记录时的返回值。
|
||||
/// </summary>
|
||||
public int PickItem { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 备纸端,推荐纸卷参数
|
||||
/// </summary>
|
||||
public class PaperRecommendParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 推荐卷数
|
||||
/// </summary>
|
||||
public int Model { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需求重量
|
||||
/// </summary>
|
||||
public double WantWeigth { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷退库记录新增参数
|
||||
/// </summary>
|
||||
public class PaperReturnAddParam : BusinessParamBase
|
||||
{
|
||||
//企望Erp,空字符串,要传""。null的话,报错
|
||||
private static string defaultString = "";
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷条码
|
||||
/// </summary>
|
||||
public string Barcode { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 退库重量
|
||||
/// </summary>
|
||||
public float ReturnQty { get; set; }
|
||||
/// <summary>
|
||||
/// 退库米数
|
||||
/// </summary>
|
||||
public float ReturnMeter { get; set; }
|
||||
/// <summary>
|
||||
/// 退库直径
|
||||
/// </summary>
|
||||
public float ReturnDiameter { get; set; }
|
||||
/// <summary>
|
||||
/// 退入库区
|
||||
/// </summary>
|
||||
public string Location { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 退入库位
|
||||
/// </summary>
|
||||
public string LocSub { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 退料人
|
||||
/// </summary>
|
||||
public string ReturnFrom { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 退库机床
|
||||
/// </summary>
|
||||
public string ReturnMachine { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 退库机位
|
||||
/// </summary>
|
||||
public string WorkSection { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 退库日期
|
||||
/// </summary>
|
||||
public string ReturnDate { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 退库时间
|
||||
/// </summary>
|
||||
public string ReturnTime { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 上机时间
|
||||
/// </summary>
|
||||
public string UpLoadOn { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 下机时间
|
||||
/// </summary>
|
||||
public string DownLoadOn { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 可用状态
|
||||
/// X表示退库残卷不可使用
|
||||
/// 空、V均表示退库残卷可继续正常出库使用
|
||||
/// </summary>
|
||||
public string CanUse { get; set; } = defaultString;
|
||||
/// <summary>
|
||||
/// 产线名称
|
||||
/// </summary>
|
||||
public string ProductLineName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷退库记录删除参数
|
||||
/// </summary>
|
||||
public class PaperReturnDelParam : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷条码
|
||||
/// </summary>
|
||||
public string Barcode { get; set; }
|
||||
/// <summary>
|
||||
/// 条码退库批次号,即新增退库记录时的返回值。
|
||||
/// </summary>
|
||||
public int ReturnItem { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 原纸库存参数
|
||||
/// </summary>
|
||||
public class PaperStorageParam : BusinessParamBase
|
||||
{
|
||||
public string Barcode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 新卷入库参数
|
||||
/// </summary>
|
||||
public class PaperStorageQueryParam : BusinessParamBase
|
||||
{
|
||||
public DateTime StartTime { get; set; }
|
||||
|
||||
public DateTime EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In
|
||||
{
|
||||
/// <summary>
|
||||
/// 出库撤单参数
|
||||
/// </summary>
|
||||
public class ErpCancelOrderParam: BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 销售出库单号
|
||||
/// </summary>
|
||||
public string saleNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料类型
|
||||
/// </summary>
|
||||
public string materiaType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户名称
|
||||
/// </summary>
|
||||
public string customName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string materiaName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
public string materiaBatch { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In
|
||||
{
|
||||
/// <summary>
|
||||
/// 企望api请求参数封装类
|
||||
/// </summary>
|
||||
public class RequestParam<T> where T : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户ID,默认为空
|
||||
/// </summary>
|
||||
public string CustNo { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 时间戳
|
||||
/// </summary>
|
||||
public string Timestamp { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
/// <summary>
|
||||
/// 值为md5(CustNo+CustSecret+Timetamp)加密后的32位结果(小写);CustNo、CustSecret的值默认为空,某些接口特殊需要的请开发前电话联系我司获取。
|
||||
/// </summary>
|
||||
public string EncryptStr { get; set; }
|
||||
/// <summary>
|
||||
/// 业务参数(json)
|
||||
/// </summary>
|
||||
public ActionParam<T> JsonParam { get; set; }
|
||||
|
||||
public RequestParam()
|
||||
{
|
||||
EncryptStr= Md5EncryptionHelper.MD5Encrypt32(CustNo + string.Empty + Timestamp, true);
|
||||
}
|
||||
|
||||
|
||||
private static PropertyInfo[] PropertyInfos = typeof(RequestParam<BusinessParamBase>).GetProperties();
|
||||
/// <summary>
|
||||
/// 创建请求参数
|
||||
/// </summary>
|
||||
/// <param name="actionID"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public static Dictionary<string, object> CreateParam(ActionID actionID, T data)
|
||||
{
|
||||
RequestParam<BusinessParamBase> requestParam = new()
|
||||
{
|
||||
JsonParam = new ActionParam<BusinessParamBase>()
|
||||
{
|
||||
ActionID = actionID.ToString(),
|
||||
Data = data
|
||||
}
|
||||
};
|
||||
|
||||
Dictionary<string, object> dic = new();
|
||||
PropertyInfos.ToList().ForEach(p =>
|
||||
{
|
||||
if (p.Name == "JsonParam")
|
||||
{
|
||||
dic.Add("params", JsonConvert.SerializeObject(p.GetValue(requestParam)));
|
||||
}
|
||||
else
|
||||
{
|
||||
dic.Add(p.Name, p.GetValue(requestParam));
|
||||
}
|
||||
});
|
||||
|
||||
return dic;
|
||||
}
|
||||
|
||||
public static string CreateJsonParam(ActionID actionID, T data)
|
||||
{
|
||||
var requestParam = new ActionParam<BusinessParamBase>()
|
||||
{
|
||||
ActionID = actionID.ToString(),
|
||||
Data = data
|
||||
};
|
||||
var result = JsonConvert.SerializeObject(requestParam);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 搬运物料的Dto
|
||||
/// </summary>
|
||||
public class CarryInParam : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 起点库位编码
|
||||
/// </summary>
|
||||
public string StartStorageRackNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 终点库位编码
|
||||
/// </summary>
|
||||
public string EndStorageRackNo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产入库参数
|
||||
/// </summary>
|
||||
public class ErpProduceInParam : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 合格证号
|
||||
/// </summary>
|
||||
public string barCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
public string orderNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户名称
|
||||
/// </summary>
|
||||
public string customName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string materiaName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料类型
|
||||
/// </summary>
|
||||
public string materiaType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
public string materiaBatch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
public string materiaCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单个托盘上的物料数量
|
||||
/// </summary>
|
||||
public int materiaNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联动线出口,机械手设备唯一号
|
||||
/// </summary>
|
||||
public string equipmentNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户标识
|
||||
/// </summary>
|
||||
public string user_key { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产退库参数
|
||||
/// </summary>
|
||||
public class ErpProduceOutParam : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 合格证号
|
||||
/// </summary>
|
||||
public string barCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产退库单号
|
||||
/// </summary>
|
||||
public string saleNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产退库单号
|
||||
/// </summary>
|
||||
public string produceReturnCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料类型
|
||||
/// </summary>
|
||||
public string materiaType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户名称
|
||||
/// </summary>
|
||||
public string customName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string materiaName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
public string materiaCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
public string materiaBatch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出库总数量
|
||||
/// </summary>
|
||||
public int num { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码头位置 1:北区 2:南区 3:人工 4:退货到车间 99:其它
|
||||
/// </summary>
|
||||
public int transport { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户标识
|
||||
/// </summary>
|
||||
public string user_key { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 销售出库参数
|
||||
/// </summary>
|
||||
public class StockOutParam : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 合格证编号
|
||||
/// </summary>
|
||||
public string barCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售出库单号
|
||||
/// </summary>
|
||||
public string saleNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产退库单号
|
||||
/// </summary>
|
||||
public string produceReturnCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料类型
|
||||
/// </summary>
|
||||
public string materiaType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户名称
|
||||
/// </summary>
|
||||
public string customName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string materiaName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
public string materiaCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
public string materiaBatch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Erp出库总数量
|
||||
/// </summary>
|
||||
public int num { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码头位置 1:南区(出库区) 2:北区(出库区) 3:人工 4:退货到车间 5-中区(出库区) 99:其它
|
||||
/// </summary>
|
||||
public int transport { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户标识
|
||||
/// </summary>
|
||||
public string user_key { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using JSMachine.WMS.App.Dto.Enum;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// PDA申请入库参数
|
||||
/// </summary>
|
||||
public class PDAInParam : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 合格证号
|
||||
/// </summary>
|
||||
public string BarCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库位编号
|
||||
/// </summary>
|
||||
public string StorageRackNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务类型
|
||||
/// </summary>
|
||||
public TaskTypeEnum TaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货物要入库的楼层
|
||||
/// </summary>
|
||||
public FloorEnum Floor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料数量(仅尾拖入库需要传递此值)
|
||||
/// </summary>
|
||||
public int MertialNum { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out
|
||||
{
|
||||
/// <summary>
|
||||
/// API返回结果
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class ApiResult<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 200表示成功,其他数值表示失败
|
||||
/// </summary>
|
||||
public string ResultCode { get; set; }
|
||||
/// <summary>
|
||||
/// 指接口框架级别的错误提示信息
|
||||
/// </summary>
|
||||
public string ErrorMsg { get; set; }
|
||||
/// <summary>
|
||||
/// 返回业务处理结果数据,详情参考具体API说明;(Data数据结构固定, 具体数据部分放置在 "ALL" 中)
|
||||
/// </summary>
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out
|
||||
{
|
||||
/// <summary>
|
||||
/// API返回结果
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class ApiReturnResult<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 200表示成功,其他数值表示失败
|
||||
/// </summary>
|
||||
public string ResultCode { get; set; }
|
||||
/// <summary>
|
||||
/// 指接口框架级别的错误提示信息
|
||||
/// </summary>
|
||||
public string ErrorMsg { get; set; }
|
||||
/// <summary>
|
||||
/// 返回业务处理结果数据,详情参考具体API说明;(Data数据结构固定, 具体数据部分放置在 "ALL" 中)
|
||||
/// </summary>
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷领用记录返回结果
|
||||
/// </summary>
|
||||
public class PaperReceiptRecordAddResult: ResultDataBase
|
||||
{
|
||||
public int PickItem { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷领用记录删除结果
|
||||
/// </summary>
|
||||
public class PaperReceiptRecordDelResult : ResultDataBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 纸卷退库记录新增返回
|
||||
/// </summary>
|
||||
public class PaperReturnAddResult : ResultDataBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 条码本次退库的批次号
|
||||
/// 记录此返回值,在后续调用删除接口时需传入
|
||||
/// </summary>
|
||||
public int ReturnItem { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
internal class PaperReturnDelResult : ResultDataBase
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
public class PaperStockQueryResult : ResultDataBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 此条码入库重量
|
||||
/// </summary>
|
||||
public int ReceiveQty { get; set; }
|
||||
/// <summary>
|
||||
/// 材质
|
||||
/// </summary>
|
||||
public string Paper { get; set; }
|
||||
/// <summary>
|
||||
/// 供应商编号
|
||||
/// </summary>
|
||||
public string SuppID { get; set; }
|
||||
/// <summary>
|
||||
/// 条码
|
||||
/// </summary>
|
||||
public string Barcode { get; set; }
|
||||
/// <summary>
|
||||
/// 幅宽
|
||||
/// </summary>
|
||||
public string PaperWidth { get; set; }
|
||||
/// <summary>
|
||||
/// 米数(米)
|
||||
/// </summary>
|
||||
public string StockMeter { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库
|
||||
/// </summary>
|
||||
public string WorkingGroup { get; set; }
|
||||
/// <summary>
|
||||
/// 入库单号
|
||||
/// </summary>
|
||||
public string ReceiveNote { get; set; }
|
||||
/// <summary>
|
||||
/// 规格型号说明
|
||||
/// </summary>
|
||||
public string StockDescription { get; set; }
|
||||
/// <summary>
|
||||
/// 克重
|
||||
/// </summary>
|
||||
public string GPerM2 { get; set; }
|
||||
/// <summary>
|
||||
/// 库区
|
||||
/// </summary>
|
||||
public string Location { get; set; }
|
||||
/// <summary>
|
||||
/// 单价
|
||||
/// </summary>
|
||||
public float UnitPrice { get; set; }
|
||||
/// <summary>
|
||||
/// 可用状态
|
||||
/// X表示不可使用
|
||||
/// NULL、空、V均表示可用
|
||||
/// </summary>
|
||||
public string CanUse { get; set; }
|
||||
/// <summary>
|
||||
/// 物料号
|
||||
/// </summary>
|
||||
public string StockItem { get; set; }
|
||||
/// <summary>
|
||||
/// 残卷标志
|
||||
/// </summary>
|
||||
public string StockMark { get; set; }
|
||||
/// <summary>
|
||||
/// 物料号
|
||||
/// </summary>
|
||||
public string StockType { get; set; }
|
||||
/// <summary>
|
||||
/// 该纸卷库存的唯一身份标记
|
||||
/// </summary>
|
||||
public string ObjID { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string GroupManagementDistributedFactoryID { get; set; }
|
||||
/// <summary>
|
||||
/// 重量(公斤)
|
||||
/// </summary>
|
||||
public string ActualQty { get; set; }
|
||||
/// <summary>
|
||||
/// 供应商简称
|
||||
/// </summary>
|
||||
public string SuppShortName { get; set; }
|
||||
/// <summary>
|
||||
/// 制造商
|
||||
/// </summary>
|
||||
public string Maker { get; set; }
|
||||
/// <summary>
|
||||
/// 库位
|
||||
/// </summary>
|
||||
public string LocSub { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int ReceiveDiameter { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
public class PaperStockResult
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 原纸库存返回信息
|
||||
/// </summary>
|
||||
public class PaperStorageResult : ResultDataBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 条码
|
||||
/// </summary>
|
||||
public string Barcode { get; set; }
|
||||
/// <summary>
|
||||
/// 物料号
|
||||
/// </summary>
|
||||
public string StockItem { get; set; }
|
||||
/// <summary>
|
||||
/// 规格型号说明
|
||||
/// </summary>
|
||||
public string StockDescription { get; set; }
|
||||
/// <summary>
|
||||
/// 库区
|
||||
/// </summary>
|
||||
public string Location { get; set; }
|
||||
/// <summary>
|
||||
/// 库位
|
||||
/// </summary>
|
||||
public string LocSub { get; set; }
|
||||
/// <summary>
|
||||
/// 残卷标志
|
||||
/// </summary>
|
||||
public string StockMark { get; set; }
|
||||
/// <summary>
|
||||
/// 材质
|
||||
/// </summary>
|
||||
public string Paper { get; set; }
|
||||
/// <summary>
|
||||
/// 幅宽
|
||||
/// </summary>
|
||||
public string PaperWidth { get; set; }
|
||||
/// <summary>
|
||||
/// 克重
|
||||
/// </summary>
|
||||
public string GPerM2 { get; set; }
|
||||
/// <summary>
|
||||
/// 重量(公斤)
|
||||
/// </summary>
|
||||
public string ActualQty { get; set; }
|
||||
/// <summary>
|
||||
/// 直径(毫米)
|
||||
/// </summary>
|
||||
public string Diameter { get; set; }
|
||||
/// <summary>
|
||||
/// 米数(米)
|
||||
/// </summary>
|
||||
public string StockMeter { get; set; }
|
||||
/// <summary>
|
||||
/// 制造商
|
||||
/// </summary>
|
||||
public string Maker { get; set; }
|
||||
/// <summary>
|
||||
/// 供应商编号
|
||||
/// </summary>
|
||||
public string SuppID { get; set; }
|
||||
/// <summary>
|
||||
/// 供应商简称
|
||||
/// </summary>
|
||||
public string SuppShortName { get; set; }
|
||||
/// <summary>
|
||||
/// 入库单号
|
||||
/// </summary>
|
||||
public string ReceiveNote { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 来料客户编号
|
||||
/// 客户来料加工的,纸卷在ERP系统办理入库时会记录该客户编号;
|
||||
/// 此字段不为空的,表示该纸卷仅能用于指定客户的订单生产
|
||||
/// </summary>
|
||||
public string ReservedCustID { get; set; }
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// NULL、空、New表示未审核
|
||||
/// Confirmed表示已审核
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
/// <summary>
|
||||
/// 可用状态
|
||||
/// X表示不可使用
|
||||
/// NULL、空、V均表示可用
|
||||
/// </summary>
|
||||
public string CanUse { get; set; }
|
||||
/// <summary>
|
||||
/// 盘点状态
|
||||
/// V表示正在盘点
|
||||
/// NULL、空均表示未在盘点
|
||||
/// </summary>
|
||||
public string StockChecking { get; set; }
|
||||
/// <summary>
|
||||
/// 该纸卷库存的唯一身份标记
|
||||
/// </summary>
|
||||
public string ObjID { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
public class ResultDataBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.IBSBusinessResult
|
||||
{
|
||||
public class IbsApiResult<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Success
|
||||
/// </summary>
|
||||
public bool Success { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Message
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Exception
|
||||
/// </summary>
|
||||
public string Exception { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data
|
||||
/// </summary>
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.IBSBusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// IBS post结果返回
|
||||
/// </summary>
|
||||
public class IbsResultDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回 true/false 成功或者失败
|
||||
/// </summary>
|
||||
public virtual bool State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成功/失败的内容,可以用在tip显示
|
||||
/// </summary>
|
||||
public virtual string Messages { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.IBSBusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 原纸基础信息
|
||||
/// </summary>
|
||||
public class PaperBaseInfoDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 原纸卷标
|
||||
/// </summary>
|
||||
public virtual string PaperLabel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 原纸编码
|
||||
/// </summary>
|
||||
public virtual string PaperCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商
|
||||
/// </summary>
|
||||
public virtual string Phonetic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 制造商
|
||||
/// </summary>
|
||||
public virtual string MakerName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 原纸材质
|
||||
/// </summary>
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 米长
|
||||
/// </summary>
|
||||
public virtual decimal Meters { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 克重
|
||||
/// </summary>
|
||||
public virtual int? PaperUnitWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 幅宽
|
||||
/// </summary>
|
||||
public virtual int PaperWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重量
|
||||
/// </summary>
|
||||
public virtual int InWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重量
|
||||
/// </summary>
|
||||
public virtual Guid ID { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// 是否含税
|
||||
///</summary>
|
||||
public virtual int IsTax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 仓库
|
||||
/// </summary>
|
||||
public virtual string StockHouseCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库位
|
||||
/// </summary>
|
||||
public virtual string LocationMark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out
|
||||
{
|
||||
public class ResultData<T> where T : ResultDataBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 暂无意义
|
||||
/// </summary>
|
||||
public object CHANGE { get; set; }
|
||||
/// <summary>
|
||||
/// 具体的数据
|
||||
/// </summary>
|
||||
public T ALL { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out
|
||||
{
|
||||
public class ResultItem<T>
|
||||
{
|
||||
//public ResultData<T>[] Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料信息
|
||||
/// </summary>
|
||||
public class MateriaInfoDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 合格证号
|
||||
/// </summary>
|
||||
public string BarCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
public string OrderNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string MateriaName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料类型
|
||||
/// </summary>
|
||||
public string MateriaType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料数量
|
||||
/// </summary>
|
||||
public string MateriaNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
public string MateriaBatch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
public string MateriaCode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 销售出库库存信息
|
||||
/// </summary>
|
||||
public class SaleOutStockDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 扣减数量
|
||||
/// </summary>
|
||||
public int SumReulstNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 撤单数量
|
||||
/// </summary>
|
||||
public int SumCancelNum { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult
|
||||
{
|
||||
public class XRApiResult<T>
|
||||
{
|
||||
public string jsonrpc { get; set; }
|
||||
public string id { get; set; }
|
||||
public string result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult
|
||||
{
|
||||
public class XRNewResultDto<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否成功
|
||||
/// </summary>
|
||||
public bool success { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成功后的提示信息
|
||||
/// </summary>
|
||||
public string message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 200 表示成功,其他参考HTTP标准状态码
|
||||
/// </summary>
|
||||
public int status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public T data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误后提示信息
|
||||
/// </summary>
|
||||
public string errors { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult
|
||||
{
|
||||
public class XRResultDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否成功
|
||||
/// </summary>
|
||||
public bool success { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成功后的提示信息
|
||||
/// </summary>
|
||||
public string message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 200 表示成功,其他参考HTTP标准状态码
|
||||
/// </summary>
|
||||
public int status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public MateriaInfoDto data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误后提示信息
|
||||
/// </summary>
|
||||
public string errors { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out;
|
||||
using System.ComponentModel.Composition;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult;
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
using System.Security.Policy;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// Erp接口服务
|
||||
/// </summary>
|
||||
[InheritedExport("Erp")]
|
||||
public interface IPaperStorageService
|
||||
{
|
||||
/// <summary>
|
||||
/// PDA扫合格证码获取物料信息
|
||||
/// </summary>
|
||||
/// <param name="barCode"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRResultDto> GetMateriaInfo(string barCode);
|
||||
|
||||
/// <summary>
|
||||
/// 生产入库
|
||||
/// </summary>
|
||||
/// <param name="erpProduceInParam"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRResultDto> AddProduceIn(ErpProduceInParam erpMateriaInDto);
|
||||
|
||||
/// <summary>
|
||||
/// 生产退库
|
||||
/// </summary>
|
||||
/// <param name="erpProduceOutParam"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRResultDto> AddProduceOut(ErpProduceOutParam erpProduceOutParam);
|
||||
|
||||
/// <summary>
|
||||
/// 销售出库
|
||||
/// </summary>
|
||||
/// <param name="erpSaleOutParam"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRResultDto> AddSaleOut(StockOutParam erpSaleOutParam);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,468 @@
|
||||
using JSMachine.WMS.Common;
|
||||
using JSMachine.WMS.Infrastructure.Attributes;
|
||||
using JSMachine.WMS.Infrastructure.Enums;
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.IService;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Service.IBS
|
||||
{
|
||||
[ErpTypeAttribute(ErpType.ChenLong)]
|
||||
public class ChenLongPaperStorageService : IPaperStorageService
|
||||
{
|
||||
private static string url = $"{Global.AppSettings.ErpConfig.ErpUrl}/";
|
||||
/// <summary>
|
||||
/// 纸卷领用记录新增
|
||||
/// </summary>
|
||||
/// <param name="paperReceiptRecordParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PaperReceiptRecordAddResult> AddPaperReceiptRecord(PaperReceiptRecordAddParam paperReceiptRecordParam)
|
||||
{
|
||||
var result = await AddPaperReceiptRecordSource(paperReceiptRecordParam);
|
||||
return result
|
||||
?.Data
|
||||
?.Data
|
||||
?.FirstOrDefault()
|
||||
?.ALL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷领用记录新增
|
||||
/// 返回原生的接口调用信息
|
||||
/// </summary>
|
||||
/// <param name="paperReceiptRecordParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult<PaperReceiptRecordAddResult>> AddPaperReceiptRecordSource(PaperReceiptRecordAddParam paperReceiptRecordParam)
|
||||
{
|
||||
var apiResultDto = new ApiResult<PaperReceiptRecordAddResult>();
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByJson(
|
||||
url + "ODIRollPickInsert",
|
||||
Method.POST,
|
||||
RequestParam<PaperReceiptRecordAddParam>.CreateJsonParam(ActionID.ODIRollPickInsert, paperReceiptRecordParam)
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReceiptRecordParam.Barcode}领用记录新增(ODIRollPickInsert)出错");
|
||||
return null;
|
||||
}
|
||||
|
||||
apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperReceiptRecordAddResult>>(resStr);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReceiptRecordParam.Barcode}领用记录新增(ODIRollPickInsert)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷退库记录新增
|
||||
/// </summary>
|
||||
/// <param name="paperReturnAddParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PaperReturnAddResult> AddPaperReturn(PaperReturnAddParam paperReturnAddParam)
|
||||
{
|
||||
var result = await AddPaperReturnSource(paperReturnAddParam);
|
||||
return result
|
||||
?.Data
|
||||
?.Data
|
||||
?.FirstOrDefault()
|
||||
?.ALL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷退库记录新增
|
||||
/// 返回原生的接口调用信息
|
||||
/// </summary>
|
||||
/// <param name="paperReturnAddParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult<PaperReturnAddResult>> AddPaperReturnSource(PaperReturnAddParam paperReturnAddParam)
|
||||
{
|
||||
ApiResult<PaperReturnAddResult> apiResultDto = new ApiResult<PaperReturnAddResult>();
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByJson(
|
||||
url + "ODIRollReturnInsert",
|
||||
Method.POST,
|
||||
RequestParam<PaperReturnAddParam>.CreateJsonParam(ActionID.ODIRollReturnInsert, paperReturnAddParam)
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReturnAddParam.Barcode}退库记录新增(ODIRollReturnInsert)出错");
|
||||
return null;
|
||||
}
|
||||
apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperReturnAddResult>>(resStr);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReturnAddParam.Barcode}退库记录新增(ODIRollReturnInsert)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷领用记录删除
|
||||
/// </summary>
|
||||
/// <param name="paperReceiptRecordDelParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DelPaperReceiptRecord(PaperReceiptRecordDelParam paperReceiptRecordDelParam)
|
||||
{
|
||||
var result = false;
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperReceiptRecordDelParam>.CreateParam(ActionID.ODIRollPickDelete, paperReceiptRecordDelParam)
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReceiptRecordDelParam.Barcode}领用记录删除(ODIRollPickDelete)出错");
|
||||
return result;
|
||||
}
|
||||
ApiResult<PaperReceiptRecordDelResult> apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperReceiptRecordDelResult>>(resStr);
|
||||
result = apiResultDto.ResultCode == "200";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReceiptRecordDelParam.Barcode}领用记录删除(ODIRollPickDelete)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷库存按条码查询(获取某卷纸的库存信息)
|
||||
/// </summary>
|
||||
/// <param name="barcode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PaperStorageResult> QueryByBarcode(string barcode)
|
||||
{
|
||||
ApiReturnResult<PaperStorageResult> apiResultDto = new();
|
||||
try
|
||||
{
|
||||
var resStr = await HttpRequestHelper.RequestByJson(
|
||||
url + "ODIRollStockQueryByBarcode",
|
||||
Method.POST,
|
||||
RequestParam<PaperStorageParam>.CreateJsonParam(
|
||||
ActionID.ODIRollStockQueryByBarcode,
|
||||
new PaperStorageParam
|
||||
{
|
||||
Barcode = barcode
|
||||
})
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{barcode}库存按条码查询(ODIRollStockQueryByBarcode)出错");
|
||||
return null;
|
||||
}
|
||||
|
||||
apiResultDto = JsonConvert.DeserializeObject<ApiReturnResult<PaperStorageResult>>(resStr);
|
||||
if (apiResultDto != null)
|
||||
{
|
||||
var item = apiResultDto.Data;
|
||||
//ActualQty
|
||||
if (item.ActualQty == "0" || string.IsNullOrEmpty(item.ActualQty))
|
||||
{
|
||||
item.ActualQty = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.ActualQty.Contains("."))
|
||||
{
|
||||
item.ActualQty = item.ActualQty.Substring(0, item.ActualQty.LastIndexOf("."));
|
||||
}
|
||||
else
|
||||
{
|
||||
item.ActualQty = item.ActualQty;
|
||||
}
|
||||
}
|
||||
//StockMeter
|
||||
if (item.StockMeter == "0" || string.IsNullOrEmpty(item.StockMeter))
|
||||
{
|
||||
item.StockMeter = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.StockMeter.Contains("."))
|
||||
{
|
||||
item.StockMeter = item.StockMeter.Substring(0, item.StockMeter.LastIndexOf("."));
|
||||
}
|
||||
else
|
||||
{
|
||||
item.StockMeter = item.StockMeter;
|
||||
}
|
||||
}
|
||||
//GPerM2
|
||||
if (item.GPerM2 == "0" || string.IsNullOrEmpty(item.GPerM2))
|
||||
{
|
||||
item.GPerM2 = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.GPerM2.Contains("."))
|
||||
{
|
||||
item.GPerM2 = item.GPerM2.Substring(0, item.GPerM2.LastIndexOf("."));
|
||||
}
|
||||
else
|
||||
{
|
||||
item.GPerM2 = item.GPerM2;
|
||||
}
|
||||
}
|
||||
//PaperWidth
|
||||
if (item.PaperWidth == "0" || string.IsNullOrEmpty(item.PaperWidth))
|
||||
{
|
||||
item.PaperWidth = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.PaperWidth.Contains("."))
|
||||
{
|
||||
item.PaperWidth = item.PaperWidth.Substring(0, item.PaperWidth.LastIndexOf("."));
|
||||
}
|
||||
else
|
||||
{
|
||||
item.PaperWidth = item.PaperWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{barcode}库存按条码查询(ODIRollStockQueryByBarcode)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto?.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 原纸退纸记录删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DelPaperReturn(PaperReturnDelParam paperReturnDelParam)
|
||||
{
|
||||
var result = false;
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperReturnDelParam>.CreateParam(ActionID.ODIRollReturnDelete, paperReturnDelParam)
|
||||
);
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp原纸{paperReturnDelParam.Barcode}退纸记录删除(ODIRollReturnDelete)出错");
|
||||
return result;
|
||||
}
|
||||
ApiResult<PaperReturnDelResult> apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperReturnDelResult>>(resStr);
|
||||
result = apiResultDto.ResultCode == "200";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp原纸{paperReturnDelParam.Barcode}退纸记录删除(ODIRollReturnDelete)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 原纸库存,按门幅、纸质编码查询
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<PaperStockQueryResult>> QueryByPaperWidthAndCode(PaperPreparationQueryParam param)
|
||||
{
|
||||
ApiReturnResult<List<PaperStockQueryResult>> apiResultDto = new();
|
||||
try
|
||||
{
|
||||
if (param.Paper.Contains("-"))
|
||||
{
|
||||
param.Paper = param.Paper.Replace("-", "");
|
||||
}
|
||||
string resStr = await HttpRequestHelper.RequestByJson(
|
||||
url+ "ODIRollStockQuery",
|
||||
Method.POST,
|
||||
RequestParam<PaperPreparationQueryParam>.CreateJsonParam(
|
||||
ActionID.ODIRollStockQuery,
|
||||
new PaperPreparationQueryParam
|
||||
{
|
||||
Paper = param.Paper,
|
||||
PaperWidth = param.PaperWidth
|
||||
})
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷库存,按门幅、纸质编码查询(ODIRollStockQuery)出错");
|
||||
return null;
|
||||
}
|
||||
|
||||
apiResultDto = JsonConvert.DeserializeObject<ApiReturnResult<List<PaperStockQueryResult>>>(resStr);
|
||||
if (apiResultDto != null)
|
||||
{
|
||||
foreach (var item in apiResultDto?.Data)
|
||||
{
|
||||
//ActualQty
|
||||
if (item.ActualQty == "0" || string.IsNullOrEmpty(item.ActualQty))
|
||||
{
|
||||
item.ActualQty = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.ActualQty.Contains("."))
|
||||
{
|
||||
item.ActualQty = item.ActualQty.Substring(0, item.ActualQty.LastIndexOf("."));
|
||||
}
|
||||
else
|
||||
{
|
||||
item.ActualQty = item.ActualQty;
|
||||
}
|
||||
}
|
||||
//StockMeter
|
||||
if (item.StockMeter == "0" || string.IsNullOrEmpty(item.StockMeter))
|
||||
{
|
||||
item.StockMeter = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.StockMeter.Contains("."))
|
||||
{
|
||||
item.StockMeter = item.StockMeter.Substring(0, item.StockMeter.LastIndexOf("."));
|
||||
}
|
||||
else
|
||||
{
|
||||
item.StockMeter = item.StockMeter;
|
||||
}
|
||||
}
|
||||
//GPerM2
|
||||
if (item.GPerM2 == "0" || string.IsNullOrEmpty(item.GPerM2))
|
||||
{
|
||||
item.GPerM2 = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.GPerM2.Contains("."))
|
||||
{
|
||||
item.GPerM2 = item.GPerM2.Substring(0, item.GPerM2.LastIndexOf("."));
|
||||
}
|
||||
else
|
||||
{
|
||||
item.GPerM2 = item.GPerM2;
|
||||
}
|
||||
}
|
||||
//PaperWidth
|
||||
if (item.PaperWidth == "0" || string.IsNullOrEmpty(item.PaperWidth))
|
||||
{
|
||||
item.PaperWidth = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.PaperWidth.Contains("."))
|
||||
{
|
||||
item.PaperWidth = item.PaperWidth.Substring(0, item.PaperWidth.LastIndexOf("."));
|
||||
}
|
||||
else
|
||||
{
|
||||
item.PaperWidth = item.PaperWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷库存,按门幅、纸质编码查询(ODIRollStockQuery)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto?.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新卷入库信息查询(按起始时间)
|
||||
/// </summary>
|
||||
/// <param name="barcode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<PaperStorageResult>> RollNewQueryByTime(PaperStorageQueryParam param)
|
||||
{
|
||||
List<PaperStorageResult> apiResultDto = new List<PaperStorageResult>();
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperStorageQueryParam>.CreateParam(
|
||||
ActionID.ODIRollNewQueryByTime,
|
||||
new PaperStorageQueryParam
|
||||
{
|
||||
StartTime = param.StartTime,
|
||||
EndTime = param.EndTime
|
||||
})
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"新卷入库信息查询(按起始时间)(ODIRollNewQueryByTime)出错");
|
||||
return null;
|
||||
}
|
||||
|
||||
apiResultDto = JsonConvert.DeserializeObject<List<PaperStorageResult>>(resStr);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"新卷入库信息查询(按起始时间)(ODIRollNewQueryByTime)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PDA扫合格证码获取物料信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<XRResultDto> GetMateriaInfo(string barCode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产入库
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddProduceIn(ErpProduceInParam erpMateriaInDto)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产退库
|
||||
/// </summary>
|
||||
/// <param name="erpProduceOutParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddProduceOut(ErpProduceOutParam erpProduceOutParam)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售出库
|
||||
/// </summary>
|
||||
/// <param name="erpSaleOutParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddSaleOut(ErpSaleOutParam erpSaleOutParam)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
using JSMachine.WMS.Common;
|
||||
using JSMachine.WMS.Infrastructure.Attributes;
|
||||
using JSMachine.WMS.Infrastructure.Enums;
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.IBSBusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.IService;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Service.IBS
|
||||
{
|
||||
[ErpTypeAttribute(ErpType.IBS)]
|
||||
public class IBSPaperStorageService : IPaperStorageService
|
||||
{
|
||||
private static readonly string IbsUrl = Global.AppSettings.ErpConfig.ErpUrl;
|
||||
private static readonly string QueryByPaperLabelUrl = Global.AppSettings.ErpConfig.QueryByPaperLabelUrl;
|
||||
private static readonly string PaperStockOutUrl = Global.AppSettings.ErpConfig.PaperStockOutUrl;
|
||||
private static readonly string QueryByPaperWidthAndCodeUrl = Global.AppSettings.ErpConfig.QueryByPaperWidthAndCodeUrl;
|
||||
private static readonly string RePaperStockInUrl = Global.AppSettings.ErpConfig.RePaperStockInUrl;
|
||||
private static readonly Dictionary<string, string> header = new Dictionary<string, string>
|
||||
{
|
||||
{ "AppId", Global.AppSettings.ErpConfig.AppId },
|
||||
{ "AppKey", Global.AppSettings.ErpConfig.AppKey }
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 新增纸卷领用记录(原纸出库)
|
||||
/// </summary>
|
||||
/// <param name="paperReceiptRecordParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PaperReceiptRecordAddResult> AddPaperReceiptRecord(PaperReceiptRecordAddParam paperReceiptRecordParam)
|
||||
{
|
||||
try
|
||||
{
|
||||
var url = IbsUrl + PaperStockOutUrl;
|
||||
var parameters = new Dictionary<string, string>
|
||||
{
|
||||
{ "PaperLabel", paperReceiptRecordParam.Barcode }
|
||||
};
|
||||
var resStr = await HttpRequestHelper.Post(url, parameters, header);
|
||||
if (resStr == null)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸出库(PaperStockOut)失败");
|
||||
return null;
|
||||
}
|
||||
var ibsResult = JsonConvert.DeserializeObject<IbsApiResult<IbsResultDto>>(resStr);
|
||||
if (ibsResult == null || !ibsResult.Data.State)
|
||||
return null;
|
||||
|
||||
return new PaperReceiptRecordAddResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸出库(PaperStockOut)失败: {ex.Message} \n {ex.StackTrace}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增纸卷领用记录(原纸出库)
|
||||
/// </summary>
|
||||
/// <param name="paperReceiptRecordParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult<PaperReceiptRecordAddResult>> AddPaperReceiptRecordSource(PaperReceiptRecordAddParam paperReceiptRecordParam)
|
||||
{
|
||||
var ibsResult = new IbsApiResult<IbsResultDto>();
|
||||
try
|
||||
{
|
||||
var url = IbsUrl + PaperStockOutUrl;
|
||||
var parameters = new Dictionary<string, string>
|
||||
{
|
||||
{ "PaperLabel", paperReceiptRecordParam.Barcode }
|
||||
};
|
||||
var resStr = await HttpRequestHelper.Post(url, parameters, header);
|
||||
if (resStr == null)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸出库(PaperStockOut)失败");
|
||||
return null;
|
||||
}
|
||||
ibsResult = JsonConvert.DeserializeObject<IbsApiResult<IbsResultDto>>(resStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸出库(PaperStockOut)失败: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
|
||||
ApiResult<PaperReceiptRecordAddResult> apiResult = new()
|
||||
{
|
||||
ResultCode = ibsResult != null && ibsResult.Data.State ? "200" : "500",
|
||||
ErrorMsg = ibsResult == null ? "" : ibsResult.Data.Messages
|
||||
};
|
||||
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增纸卷退库记录(入库)
|
||||
/// </summary>
|
||||
/// <param name="paperReturnAddParam"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<PaperReturnAddResult> AddPaperReturn(PaperReturnAddParam paperReturnAddParam)
|
||||
{
|
||||
try
|
||||
{
|
||||
var url = IbsUrl + RePaperStockInUrl;
|
||||
var parameters = new Dictionary<string, string>
|
||||
{
|
||||
{ "PaperLabel", paperReturnAddParam.Barcode },
|
||||
{ "Weight", paperReturnAddParam.ReturnQty.ToString() },
|
||||
{ "Meters", paperReturnAddParam.ReturnMeter.ToString() }
|
||||
};
|
||||
var resStr = await HttpRequestHelper.Post(url, parameters, header);
|
||||
if (resStr == null)
|
||||
{
|
||||
LogHelper.Error($"IBS残卷回库(RePaperStockIn)失败");
|
||||
return null;
|
||||
}
|
||||
var ibsResult = JsonConvert.DeserializeObject<IbsApiResult<IbsResultDto>>(resStr);
|
||||
return ibsResult == null || !ibsResult.Data.State ? null : new PaperReturnAddResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"IBS残卷回库(RePaperStockIn)失败: {ex.Message} \n {ex.StackTrace}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷退库记录新增
|
||||
/// 返回原生的接口调用信息
|
||||
/// </summary>
|
||||
/// <param name="paperReturnAddParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult<PaperReturnAddResult>> AddPaperReturnSource(PaperReturnAddParam paperReturnAddParam)
|
||||
{
|
||||
var ibsResult = new IbsApiResult<IbsResultDto>();
|
||||
try
|
||||
{
|
||||
var url = IbsUrl + RePaperStockInUrl;
|
||||
var parameters = new Dictionary<string, string>
|
||||
{
|
||||
{ "PaperLabel", paperReturnAddParam.Barcode },
|
||||
{ "Weight", paperReturnAddParam.ReturnQty.ToString() },
|
||||
{ "Meters", paperReturnAddParam.ReturnMeter.ToString() }
|
||||
};
|
||||
var resStr = await HttpRequestHelper.Post(url, parameters, header);
|
||||
if (resStr == null)
|
||||
{
|
||||
LogHelper.Error($"IBS残卷回库(RePaperStockIn)失败");
|
||||
return null;
|
||||
}
|
||||
ibsResult = JsonConvert.DeserializeObject<IbsApiResult<IbsResultDto>>(resStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"IBS残卷回库(RePaperStockIn)失败: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
|
||||
ApiResult<PaperReturnAddResult> apiResult = new()
|
||||
{
|
||||
ResultCode = ibsResult != null && ibsResult.Data != null && ibsResult.Data.State ? "200" : "500",
|
||||
ErrorMsg = ibsResult != null && ibsResult.Data != null ? ibsResult.Data.Messages : ""
|
||||
};
|
||||
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
public Task<bool> DelPaperReceiptRecord(PaperReceiptRecordDelParam paperReceiptRecordDelParam)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> DelPaperReturn(PaperReturnDelParam paperReturnDelParam)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷库存按条码查询(获取某卷纸的库存信息)
|
||||
/// </summary>
|
||||
/// <param name="barcode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PaperStorageResult> QueryByBarcode(string barcode)
|
||||
{
|
||||
var ibsResult = new IbsApiResult<PaperBaseInfoDto>();
|
||||
try
|
||||
{
|
||||
var url = IbsUrl + QueryByPaperLabelUrl + barcode;
|
||||
var resStr = await HttpRequestHelper.Get(url, header);
|
||||
if (resStr == null)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸信息,按原纸卷标查询(GetPaperMessage)出错");
|
||||
return null;
|
||||
}
|
||||
ibsResult = JsonConvert.DeserializeObject<IbsApiResult<PaperBaseInfoDto>>(resStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸信息,按原纸卷标查询(GetPaperMessage)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
|
||||
if (ibsResult?.Data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
PaperStorageResult paperStorageResult = new()
|
||||
{
|
||||
Maker = ibsResult.Data.MakerName,
|
||||
ActualQty = ibsResult.Data.InWeight.ToString(),
|
||||
StockMeter = ibsResult.Data.Meters.ToString(),
|
||||
Paper = ibsResult.Data.PaperCode,
|
||||
GPerM2 = ibsResult.Data.PaperUnitWeight?.ToString(),
|
||||
PaperWidth = ibsResult.Data.PaperWidth.ToString(),
|
||||
Barcode = ibsResult.Data.PaperLabel,
|
||||
SuppShortName = ibsResult.Data.Phonetic,
|
||||
Location = ibsResult.Data.StockHouseCode,
|
||||
LocSub = ibsResult.Data.LocationMark,
|
||||
ObjID = ibsResult.Data.ID.ToString("N"),
|
||||
};
|
||||
|
||||
return paperStorageResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// 原纸库存,按门幅、纸质编码查询
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<List<PaperStockQueryResult>> QueryByPaperWidthAndCode(PaperPreparationQueryParam param)
|
||||
{
|
||||
var ibsResult = new IbsApiResult<List<PaperBaseInfoDto>>();
|
||||
try
|
||||
{
|
||||
var url = IbsUrl + QueryByPaperWidthAndCodeUrl + "?paperWidth=" + param.PaperWidth + "&paperCode=" + param.Paper.Replace("-", "");
|
||||
var resStr = await HttpRequestHelper.Get(url, header);
|
||||
if (resStr == null)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸库存,按门幅、纸质编码查询(GetPaperMessage)出错");
|
||||
return null;
|
||||
}
|
||||
ibsResult = JsonConvert.DeserializeObject<IbsApiResult<List<PaperBaseInfoDto>>>(resStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸库存,按门幅、纸质编码查询(GetPaperMessage)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
|
||||
if (ibsResult?.Data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var paperStorageResultList = new List<PaperStockQueryResult>();
|
||||
foreach (PaperBaseInfoDto item in ibsResult.Data)
|
||||
{
|
||||
paperStorageResultList.Add(new PaperStockQueryResult
|
||||
{
|
||||
Paper = item.PaperCode,
|
||||
Barcode = item.PaperLabel,
|
||||
PaperWidth = item.PaperWidth.ToString(),
|
||||
StockMeter = item.Meters == 0m ? "" : Math.Round(item.Meters, 2).ToString(),
|
||||
ActualQty = item.InWeight == 0 ? "" : item.InWeight.ToString(),
|
||||
Location = item.StockHouseCode,
|
||||
LocSub = item.LocationMark,
|
||||
GPerM2 = item.PaperUnitWeight?.ToString(),
|
||||
SuppShortName = item.Phonetic,
|
||||
Maker = item.Phonetic,
|
||||
ObjID = item.ID.ToString("N"),
|
||||
});
|
||||
}
|
||||
return paperStorageResultList;
|
||||
}
|
||||
|
||||
public Task<List<PaperStorageResult>> RollNewQueryByTime(PaperStorageQueryParam param)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PDA扫合格证码获取物料信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<XRResultDto> GetMateriaInfo(string barCode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产入库
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddProduceIn(ErpProduceInParam erpMateriaInDto)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产退库
|
||||
/// </summary>
|
||||
/// <param name="erpProduceOutParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddProduceOut(ErpProduceOutParam erpProduceOutParam)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售出库
|
||||
/// </summary>
|
||||
/// <param name="erpSaleOutParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddSaleOut(ErpSaleOutParam erpSaleOutParam)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,336 @@
|
||||
using JSMachine.WMS.Common;
|
||||
using JSMachine.WMS.Infrastructure.Attributes;
|
||||
using JSMachine.WMS.Infrastructure.Enums;
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.PaperMESServerRPC.Bo;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessParam;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.BusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.IService;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult;
|
||||
using System.Security.Policy;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Service.WantitErp
|
||||
{
|
||||
[ErpTypeAttribute(ErpType.Wantit)]
|
||||
public class WantitPaperStorageService : IPaperStorageService
|
||||
{
|
||||
private static string url = $"{Global.AppSettings.ErpConfig.ErpUrl}/DI/DIExecute.action";
|
||||
/// <summary>
|
||||
/// 纸卷领用记录新增
|
||||
/// </summary>
|
||||
/// <param name="paperReceiptRecordParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PaperReceiptRecordAddResult> AddPaperReceiptRecord(PaperReceiptRecordAddParam paperReceiptRecordParam)
|
||||
{
|
||||
var result = await AddPaperReceiptRecordSource(paperReceiptRecordParam);
|
||||
return result
|
||||
?.Data
|
||||
?.Data
|
||||
?.FirstOrDefault()
|
||||
?.ALL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷领用记录新增
|
||||
/// 返回原生的接口调用信息
|
||||
/// </summary>
|
||||
/// <param name="paperReceiptRecordParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult<PaperReceiptRecordAddResult>> AddPaperReceiptRecordSource(PaperReceiptRecordAddParam paperReceiptRecordParam)
|
||||
{
|
||||
var apiResultDto = new ApiResult<PaperReceiptRecordAddResult>();
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperReceiptRecordAddParam>.CreateParam(ActionID.ODIRollPickInsert, paperReceiptRecordParam)
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReceiptRecordParam.Barcode}领用记录新增(ODIRollPickInsert)出错");
|
||||
return null;
|
||||
}
|
||||
|
||||
apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperReceiptRecordAddResult>>(resStr);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReceiptRecordParam.Barcode}领用记录新增(ODIRollPickInsert)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷退库记录新增
|
||||
/// </summary>
|
||||
/// <param name="paperReturnAddParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PaperReturnAddResult> AddPaperReturn(PaperReturnAddParam paperReturnAddParam)
|
||||
{
|
||||
var result = await AddPaperReturnSource(paperReturnAddParam);
|
||||
return result
|
||||
?.Data
|
||||
?.Data
|
||||
?.FirstOrDefault()
|
||||
?.ALL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷退库记录新增
|
||||
/// 返回原生的接口调用信息
|
||||
/// </summary>
|
||||
/// <param name="paperReturnAddParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult<PaperReturnAddResult>> AddPaperReturnSource(PaperReturnAddParam paperReturnAddParam)
|
||||
{
|
||||
ApiResult<PaperReturnAddResult> apiResultDto = new ApiResult<PaperReturnAddResult>();
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperReturnAddParam>.CreateParam(ActionID.ODIRollReturnInsert, paperReturnAddParam)
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReturnAddParam.Barcode}退库记录新增(ODIRollReturnInsert)出错");
|
||||
return null;
|
||||
}
|
||||
apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperReturnAddResult>>(resStr);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReturnAddParam.Barcode}退库记录新增(ODIRollReturnInsert)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷领用记录删除
|
||||
/// </summary>
|
||||
/// <param name="paperReceiptRecordDelParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DelPaperReceiptRecord(PaperReceiptRecordDelParam paperReceiptRecordDelParam)
|
||||
{
|
||||
var result = false;
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperReceiptRecordDelParam>.CreateParam(ActionID.ODIRollPickDelete, paperReceiptRecordDelParam)
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReceiptRecordDelParam.Barcode}领用记录删除(ODIRollPickDelete)出错");
|
||||
return result;
|
||||
}
|
||||
ApiResult<PaperReceiptRecordDelResult> apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperReceiptRecordDelResult>>(resStr);
|
||||
result = apiResultDto.ResultCode == "200";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{paperReceiptRecordDelParam.Barcode}领用记录删除(ODIRollPickDelete)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷库存按条码查询(获取某卷纸的库存信息)
|
||||
/// </summary>
|
||||
/// <param name="barcode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PaperStorageResult> QueryByBarcode(string barcode)
|
||||
{
|
||||
ApiResult<PaperStorageResult> apiResultDto = new();
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperStorageParam>.CreateParam(
|
||||
ActionID.ODIRollStockQueryByBarcode,
|
||||
new PaperStorageParam
|
||||
{
|
||||
Barcode = barcode
|
||||
})
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{barcode}库存按条码查询(ODIRollStockQueryByBarcode)出错");
|
||||
return null;
|
||||
}
|
||||
|
||||
apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperStorageResult>>(resStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷{barcode}库存按条码查询(ODIRollStockQueryByBarcode)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto
|
||||
?.Data
|
||||
?.Data
|
||||
?.FirstOrDefault()
|
||||
?.ALL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 原纸退纸记录删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DelPaperReturn(PaperReturnDelParam paperReturnDelParam)
|
||||
{
|
||||
var result = false;
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperReturnDelParam>.CreateParam(ActionID.ODIRollReturnDelete, paperReturnDelParam)
|
||||
);
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp原纸{paperReturnDelParam.Barcode}退纸记录删除(ODIRollReturnDelete)出错");
|
||||
return result;
|
||||
}
|
||||
ApiResult<PaperReturnDelResult> apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperReturnDelResult>>(resStr);
|
||||
result = apiResultDto.ResultCode == "200";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp原纸{paperReturnDelParam.Barcode}退纸记录删除(ODIRollReturnDelete)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 原纸库存,按门幅、纸质编码查询
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<PaperStockQueryResult>> QueryByPaperWidthAndCode(PaperPreparationQueryParam param)
|
||||
{
|
||||
ApiResult<PaperStockQueryResult> apiResultDto = new();
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperPreparationQueryParam>.CreateParam(
|
||||
ActionID.ODIRollStockQuery,
|
||||
new PaperPreparationQueryParam
|
||||
{
|
||||
Paper = param.Paper,
|
||||
PaperWidth = param.PaperWidth
|
||||
})
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷库存,按门幅、纸质编码查询(ODIRollStockQuery)出错");
|
||||
return null;
|
||||
}
|
||||
|
||||
apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperStockQueryResult>>(resStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"Erp纸卷库存,按门幅、纸质编码查询(ODIRollStockQuery)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto
|
||||
?.Data
|
||||
?.Data
|
||||
?.Select(p => p.ALL)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新卷入库信息查询(按起始时间)
|
||||
/// </summary>
|
||||
/// <param name="barcode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<PaperStorageResult>> RollNewQueryByTime(PaperStorageQueryParam param)
|
||||
{
|
||||
List<PaperStorageResult> apiResultDto = new List<PaperStorageResult>();
|
||||
try
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(
|
||||
url,
|
||||
Method.POST,
|
||||
RequestParam<PaperStorageQueryParam>.CreateParam(
|
||||
ActionID.ODIRollNewQueryByTime,
|
||||
new PaperStorageQueryParam
|
||||
{
|
||||
StartTime = param.StartTime,
|
||||
EndTime = param.EndTime
|
||||
})
|
||||
);
|
||||
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"新卷入库信息查询(按起始时间)(ODIRollNewQueryByTime)出错");
|
||||
return null;
|
||||
}
|
||||
|
||||
apiResultDto = JsonConvert.DeserializeObject<List<PaperStorageResult>>(resStr);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"新卷入库信息查询(按起始时间)(ODIRollNewQueryByTime)出错: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return apiResultDto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PDA扫合格证码获取物料信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<XRResultDto> GetMateriaInfo(string barCode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产入库
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddProduceIn(ErpProduceInParam erpMateriaInDto)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产退库
|
||||
/// </summary>
|
||||
/// <param name="erpProduceOutParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddProduceOut(ErpProduceOutParam erpProduceOutParam)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售出库
|
||||
/// </summary>
|
||||
/// <param name="erpSaleOutParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddSaleOut(ErpSaleOutParam erpSaleOutParam)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
using JSMachine.WMS.Common;
|
||||
using JSMachine.WMS.Infrastructure.Attributes;
|
||||
using JSMachine.WMS.Infrastructure.Enums;
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.XRBusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out.XRBusinessResult;
|
||||
using JSMachine.WMS.RPC.ErpRPC.IService;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
|
||||
namespace JSMachine.WMS.RPC.ErpRPC.Service.XinRong
|
||||
{
|
||||
[ErpTypeAttribute(ErpType.XinRong)]
|
||||
public class XinRongPaperStorageService : IPaperStorageService
|
||||
{
|
||||
private static readonly string xrUrl = Global.AppSettings.ErpConfig.ErpUrl;
|
||||
private static readonly string userkey = Global.AppSettings.ErpConfig.Userkey;
|
||||
private static readonly string queryMateriaInforUrl = Global.AppSettings.ErpConfig.QueryMateriaInforUrl;
|
||||
private static readonly string produceInUrl = Global.AppSettings.ErpConfig.ProduceInUrl;
|
||||
private static readonly string produceOutUrl = Global.AppSettings.ErpConfig.ProduceOutUrl;
|
||||
private static readonly string saleOutUrl = Global.AppSettings.ErpConfig.SaleOutUrl;
|
||||
|
||||
/// <summary>
|
||||
/// PDA扫合格证码获取物料信息
|
||||
/// </summary>
|
||||
/// <param name="barCode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XRResultDto> GetMateriaInfo(string barCode)
|
||||
{
|
||||
var result = new XRResultDto();
|
||||
try
|
||||
{
|
||||
string url = xrUrl + queryMateriaInforUrl;
|
||||
var jsonParam = new
|
||||
{
|
||||
barCode = barCode,
|
||||
user_key = userkey
|
||||
};
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, Method.POST, JsonConvert.SerializeObject(jsonParam), 15000);
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
LogHelper.Error($"PDA扫合格证码获取物料信息(GetMateriaInfo)失败");
|
||||
return null;
|
||||
}
|
||||
var apiResultDto = JsonConvert.DeserializeObject<XRApiResult<XRResultDto>>(resStr);
|
||||
result = JsonConvert.DeserializeObject<XRResultDto>(apiResultDto.result);
|
||||
if (!result.success)
|
||||
{
|
||||
LogHelper.Error($"PDA扫合格证码获取物料信息(GetMateriaInfo)失败: {result.errors}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"PDA扫合格证码获取物料信息(GetMateriaInfo)失败: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产入库
|
||||
/// </summary>
|
||||
/// <param name="erpProduceInParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XRResultDto> AddProduceIn(ErpProduceInParam erpProduceInParam)
|
||||
{
|
||||
var result = new XRResultDto { success = false, status = 500 };
|
||||
try
|
||||
{
|
||||
string url = xrUrl + produceInUrl;
|
||||
var jsonParam = new ErpProduceInParam
|
||||
{
|
||||
barCode = erpProduceInParam.barCode,
|
||||
materiaName = erpProduceInParam.materiaName,
|
||||
materiaBatch = erpProduceInParam.materiaBatch,
|
||||
materiaCode = erpProduceInParam.materiaCode,
|
||||
materiaNum = erpProduceInParam.materiaNum,
|
||||
user_key = userkey
|
||||
};
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, Method.POST, JsonConvert.SerializeObject(jsonParam), 30000);
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
result.errors = $"调用Erp生产入库(AddProduceIn)接口失败:{url}";
|
||||
return result;
|
||||
}
|
||||
var apiResultDto = JsonConvert.DeserializeObject<XRApiResult<XRResultDto>>(resStr);
|
||||
result = JsonConvert.DeserializeObject<XRResultDto>(apiResultDto.result);
|
||||
|
||||
if (result.success)
|
||||
{
|
||||
result.status = 200;
|
||||
result.success = true;
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.errors = $"生产入库(AddProduceIn)接口返回失败:" + result.errors;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.errors = $"生产入库(AddProduceIn)异常: {ex.Message} \n {ex.StackTrace}";
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产退库
|
||||
/// </summary>
|
||||
/// <param name="erpProduceOutParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XRResultDto> AddProduceOut(ErpProduceOutParam erpProduceOutParam)
|
||||
{
|
||||
var result = new XRResultDto { success = false, status = 500 };
|
||||
|
||||
try
|
||||
{
|
||||
string url = xrUrl + produceOutUrl;
|
||||
var jsonParam = new ErpProduceOutParam
|
||||
{
|
||||
produceReturnCode = erpProduceOutParam.produceReturnCode,
|
||||
barCode = erpProduceOutParam.barCode,
|
||||
materiaName = erpProduceOutParam.materiaName,
|
||||
materiaBatch = erpProduceOutParam.materiaBatch,
|
||||
materiaCode = erpProduceOutParam.materiaCode,
|
||||
num = erpProduceOutParam.num,
|
||||
user_key = userkey
|
||||
};
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, Method.POST, JsonConvert.SerializeObject(jsonParam), 30000);
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
result.errors = $"调用Erp生产退库(AddProduceOut)接口失败:{url}";
|
||||
return result;
|
||||
}
|
||||
result = JsonConvert.DeserializeObject<XRResultDto>(resStr);
|
||||
if (result.success)
|
||||
{
|
||||
result.status = 200;
|
||||
result.success = true;
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.errors = $"生产退库(AddProduceOut)接口返回失败:" + result.errors;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.errors = $"生产退库(AddProduceOut)异常: {ex.Message} \n {ex.StackTrace}";
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售出库
|
||||
/// </summary>
|
||||
/// <param name="erpSaleOutParam"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XRResultDto> AddSaleOut(StockOutParam erpSaleOutParam)
|
||||
{
|
||||
var result = new XRResultDto { success = false, status = 500 };
|
||||
|
||||
try
|
||||
{
|
||||
string url = xrUrl + saleOutUrl;
|
||||
var jsonParam = new StockOutParam
|
||||
{
|
||||
saleNo = erpSaleOutParam.saleNo,
|
||||
barCode = erpSaleOutParam.barCode,
|
||||
materiaCode = erpSaleOutParam.materiaCode,
|
||||
num = erpSaleOutParam.num,
|
||||
materiaBatch = erpSaleOutParam.materiaBatch,
|
||||
user_key = userkey
|
||||
|
||||
};
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, Method.POST, JsonConvert.SerializeObject(jsonParam), 30000);
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
result.errors = $"调用Erp销售出库(AddSaleOut)接口失败:{url}";
|
||||
return result;
|
||||
}
|
||||
var apiResultDto = JsonConvert.DeserializeObject<XRApiResult<XRResultDto>>(resStr);
|
||||
result = JsonConvert.DeserializeObject<XRResultDto>(apiResultDto.result);
|
||||
if (result.success)
|
||||
{
|
||||
result.status = 200;
|
||||
result.success = true;
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.errors = $"销售出库(AddSaleOut)接口返回失败:" + result.errors;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.errors = $"销售出库(AddSaleOut)异常: {ex.Message} \n {ex.StackTrace}";
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user