first commit
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.PaperMESServerRPC.Bo;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
|
||||
namespace JSMachine.WMS.RPC.Common.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// RPC 通用 HTTP 服务基类,封装 JSON 请求、响应反序列化和错误日志记录。
|
||||
/// </summary>
|
||||
/// <typeparam name="T">远程接口使用的业务数据类型。</typeparam>
|
||||
public class BaseService<T> where T : class, new()
|
||||
{
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="method"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddAsync(T t, string url, Method method)
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, method, JsonConvert.SerializeObject(t));
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
ApiResultBo<bool> apiResultDto = JsonConvert.DeserializeObject<ApiResultBo<bool>>(resStr);
|
||||
return apiResultDto.Data;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"HTTP请求 {url} 返回结果错误,原始返回信息 {resStr}");
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="method"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> EditAsync(T t, string url, Method method)
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, method, JsonConvert.SerializeObject(t));
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
ApiResultBo<bool> apiResultDto = JsonConvert.DeserializeObject<ApiResultBo<bool>>(resStr);
|
||||
return apiResultDto.Data;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"HTTP请求 {url} 返回结果错误,原始返回信息 {resStr}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除单个
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="method"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DelteOneAsync(Guid id,string url, Method method)
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(url, method, new Dictionary<string, object> { { "id", id } });
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
ApiResultBo<bool> apiResultDto = JsonConvert.DeserializeObject<ApiResultBo<bool>>(resStr);
|
||||
return apiResultDto.Data;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
LogHelper.Error($"HTTP请求 {url} 返回结果错误,原始返回信息 {resStr}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除多个
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="method"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DelteManyAsync(List<Guid> ids, string url, Method method)
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, method, JsonConvert.SerializeObject(ids));
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
ApiResultBo<bool> apiResultDto = JsonConvert.DeserializeObject<ApiResultBo<bool>>(resStr);
|
||||
return apiResultDto.Data;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
LogHelper.Error($"HTTP请求 {url} 返回结果错误,原始返回信息 {resStr}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<T>> GetAllAsync(string url)
|
||||
{
|
||||
string resStr = await HttpRequestHelper.RequestByDic(url, Method.GET);
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
return null;
|
||||
|
||||
try
|
||||
{
|
||||
ApiResultBo<List<T>> apiResultDto = JsonConvert.DeserializeObject<ApiResultBo<List<T>>>(resStr);
|
||||
return apiResultDto.Data;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
LogHelper.Error($"HTTP请求 {url} 返回结果错误,原始返回信息 {resStr}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace JSMachine.WMS.RPC.PaperMESServerRPC.Bo
|
||||
{
|
||||
/// <summary>
|
||||
/// 后台接口统一返回参数封装类型
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class ApiResultBo<T>
|
||||
{
|
||||
public ApiResultCode Code { get; set; }
|
||||
public string Message { get; set; }
|
||||
public T Data { get; set; }
|
||||
}
|
||||
|
||||
public enum ApiResultCode
|
||||
{
|
||||
OK=0,
|
||||
ERROR=1
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.IBSRPC.Dto.In.BusinessParam
|
||||
{
|
||||
public class BusinessParamBase
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.IBSRPC.Dto.In.BusinessParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 原纸库存信息查询参数
|
||||
/// </summary>
|
||||
public class PaperInfoQueryParam : 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>
|
||||
/// 原纸卷标
|
||||
/// </summary>
|
||||
public string PaperLabel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 米长
|
||||
/// </summary>
|
||||
public decimal Meters { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
using NPOI.SS.Formula.Functions;
|
||||
|
||||
namespace JSMachine.WMS.RPC.IBSRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础IbsApiResult
|
||||
/// </summary>
|
||||
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.IBSRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
/// <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,62 @@
|
||||
|
||||
using NPOI.SS.Formula.Functions;
|
||||
|
||||
namespace JSMachine.WMS.RPC.IBSRPC.Dto.Out.BusinessResult
|
||||
{
|
||||
/// <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 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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using JSMachine.WMS.RPC.IBSRPC.Dto.In.BusinessParam;
|
||||
using JSMachine.WMS.RPC.IBSRPC.Dto.Out.BusinessResult;
|
||||
|
||||
namespace JSMachine.WMS.RPC.IBSRPC.IService
|
||||
{
|
||||
public interface IPaperStockOperator
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取原纸信息
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
Task<PaperBaseInfoDto> QueryByPaperLabel(PaperInfoQueryParam param);
|
||||
|
||||
/// <summary>
|
||||
/// 原纸出库
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
Task<IbsResultDto> PaperStockOut(PaperInfoQueryParam param);
|
||||
|
||||
/// <summary>
|
||||
/// 残卷入库
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
Task<IbsResultDto> RePaperStockIn(PaperInfoQueryParam param);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using JSMachine.WMS.Common;
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.IBSRPC.Dto.In.BusinessParam;
|
||||
using JSMachine.WMS.RPC.IBSRPC.Dto.Out.BusinessResult;
|
||||
using JSMachine.WMS.RPC.IBSRPC.IService;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace JSMachine.WMS.RPC.IBSRPC.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// IBS接口
|
||||
/// </summary>
|
||||
public class PaperStockOperator: IPaperStockOperator
|
||||
{
|
||||
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 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="param"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PaperBaseInfoDto> QueryByPaperLabel(PaperInfoQueryParam param)
|
||||
{
|
||||
IbsApiResult<PaperBaseInfoDto> ibsResult = new();
|
||||
try
|
||||
{
|
||||
var url = IbsUrl + QueryByPaperLabelUrl + param.PaperLabel;
|
||||
var resStr = 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}");
|
||||
}
|
||||
return ibsResult?.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 原纸出库
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IbsResultDto> PaperStockOut(PaperInfoQueryParam param)
|
||||
{
|
||||
var ibsResult = new IbsResultDto();
|
||||
try
|
||||
{
|
||||
var url = IbsUrl + PaperStockOutUrl;
|
||||
var parameters = new Dictionary<string, string>
|
||||
{
|
||||
{ "PaperLabel", param.PaperLabel }
|
||||
};
|
||||
var resStr = HttpRequestHelper.Post(url, parameters, header);
|
||||
if (resStr == null)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸出库(PaperStockOut)失败");
|
||||
return null;
|
||||
}
|
||||
//ibsResult = JsonConvert.DeserializeObject<IbsResultDto>(resStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"IBS原纸出库(PaperStockOut)失败: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return ibsResult ?? new IbsResultDto();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 残卷入库
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IbsResultDto> RePaperStockIn(PaperInfoQueryParam param)
|
||||
{
|
||||
var ibsResult = new IbsResultDto();
|
||||
try
|
||||
{
|
||||
var url = IbsUrl + RePaperStockInUrl;
|
||||
var parameters = new Dictionary<string, string>
|
||||
{
|
||||
{ "PaperLabel", param.PaperLabel },
|
||||
{ "Weight", param.Weight.ToString() },
|
||||
{ "Meters", param.Meters.ToString() }
|
||||
};
|
||||
var resStr = HttpRequestHelper.Post(url, parameters, header);
|
||||
if (resStr == null)
|
||||
{
|
||||
LogHelper.Error($"IBS残卷回库(RePaperStockIn)失败");
|
||||
return null;
|
||||
}
|
||||
//ibsResult = JsonConvert.DeserializeObject<IbsResultDto>(resStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"IBS残卷回库(RePaperStockIn)失败: {ex.Message} \n {ex.StackTrace}");
|
||||
}
|
||||
return ibsResult ?? new IbsResultDto();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Library</OutputType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="ErpRPC\Service\ChenLong\**" />
|
||||
<Compile Remove="ErpRPC\Service\IBS\**" />
|
||||
<Compile Remove="ErpRPC\Service\WantitErp\**" />
|
||||
<Compile Remove="IBSRPC\**" />
|
||||
<Compile Remove="WmsRPC\**" />
|
||||
<EmbeddedResource Remove="ErpRPC\Service\ChenLong\**" />
|
||||
<EmbeddedResource Remove="ErpRPC\Service\IBS\**" />
|
||||
<EmbeddedResource Remove="ErpRPC\Service\WantitErp\**" />
|
||||
<EmbeddedResource Remove="IBSRPC\**" />
|
||||
<EmbeddedResource Remove="WmsRPC\**" />
|
||||
<None Remove="ErpRPC\Service\ChenLong\**" />
|
||||
<None Remove="ErpRPC\Service\IBS\**" />
|
||||
<None Remove="ErpRPC\Service\WantitErp\**" />
|
||||
<None Remove="IBSRPC\**" />
|
||||
<None Remove="WmsRPC\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="AccessControlRPC\Dto\SysRoleDto.cs" />
|
||||
<Compile Remove="AccessControlRPC\Dto\SysUserDto.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Prism.Core" Version="8.1.97" />
|
||||
<PackageReference Include="System.ComponentModel.Composition" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\JSMachine.WMS.Application\JSMachine.WMS.App.csproj" />
|
||||
<ProjectReference Include="..\JSMachine.WMS.Infrastructure\JSMachine.WMS.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="RcsRPC\Enums\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,298 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.PmsRPC.Dto.In
|
||||
{
|
||||
/// <summary>
|
||||
/// Dcs备纸信息
|
||||
/// </summary>
|
||||
public class DcsPaperPreparDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int Sn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 门幅
|
||||
/// </summary>
|
||||
public int Web { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string FluteGUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 楞型
|
||||
/// </summary>
|
||||
public string FluteCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PaperMassGUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 材质
|
||||
/// </summary>
|
||||
public string Mass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 长度
|
||||
/// </summary>
|
||||
public double ProdLen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double ProdLenCM { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Lines { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Dc 面纸
|
||||
/// </summary>
|
||||
public string DC_PaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DC长
|
||||
/// </summary>
|
||||
public double DC_PaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double DcWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Dc 面纸+DC长
|
||||
/// </summary>
|
||||
|
||||
public string Str_DC_PaperMass_Meters { get { return DC_PaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", DC_PaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SC1W 瓦纸
|
||||
/// </summary>
|
||||
public string SC1_CorrPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC1W 长
|
||||
/// </summary>
|
||||
public double SC1_CorrPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC1CorrWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC1W 瓦纸+SC1W 长
|
||||
/// </summary>
|
||||
|
||||
public string Str_SC1_CorrPaperMass_Meters { get { return SC1_CorrPaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", SC1_CorrPaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SC1X 芯纸
|
||||
/// </summary>
|
||||
public string SC1_SurfPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC1X长
|
||||
/// </summary>
|
||||
public double SC1_SurfPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC1SurfWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///SC1X 芯纸 + SC1X长
|
||||
/// </summary>
|
||||
|
||||
public string Str_SC1_SurfPaperMass_Meters { get { return SC1_SurfPaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", SC1_SurfPaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SC2W
|
||||
/// </summary>
|
||||
public string SC2_CorrPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC2W长
|
||||
/// </summary>
|
||||
public double SC2_CorrPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC2CorrWeight
|
||||
/// </summary>
|
||||
public double SC2CorrWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///SC2W + SC2W长
|
||||
/// </summary>
|
||||
|
||||
public string Str_SC2_CorrPaperMass_Meters { get { return SC2_CorrPaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", SC2_CorrPaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SC2X
|
||||
/// </summary>
|
||||
public string SC2_SurfPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC2X长
|
||||
/// </summary>
|
||||
public double SC2_SurfPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC2SurfWeight
|
||||
/// </summary>
|
||||
public double SC2SurfWeight { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///SC2X + SC2X长
|
||||
/// </summary>
|
||||
|
||||
public string Str_SC2_SurfPaperMass_Meters { get { return SC2_SurfPaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", SC2_SurfPaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SF3W
|
||||
/// </summary>
|
||||
public string SC3_CorrPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SF3W 长
|
||||
/// </summary>
|
||||
public int SC3_CorrPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC3CorrWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SF3X
|
||||
/// </summary>
|
||||
public string SC3_SurfPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SF3X长
|
||||
/// </summary>
|
||||
public int SC3_SurfPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC3SurfWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PaperMassFlute1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PaperMassFlute2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PaperMassFlute3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double Sc1_Rate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double Sc2_Rate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double Sc3_Rate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double DC_PaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC1_CorrPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC1_SurfPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC2_CorrPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC2_SurfPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC3_CorrPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC3_SurfPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string DC_Meters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC1_CorrMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC1_SurfMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC2_CorrMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC2_SurfMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC3_CorrMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC3_SurfMeters_display { get; set; }
|
||||
|
||||
public string StockDescription { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
using JSMachine.WMS.RPC.PmsRPC.Enum;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace JSMachine.WMS.RPC.PmsRPC.Dto.In
|
||||
{
|
||||
/// <summary>
|
||||
/// 机台备纸信息
|
||||
/// </summary>
|
||||
public class MachinePaperNeedDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 机台
|
||||
/// </summary>
|
||||
public PlateType PlateType { get; set; }
|
||||
/// <summary>
|
||||
/// 纸卷需求
|
||||
/// </summary>
|
||||
public List<PaperNeed> PaperNeeds { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纸卷需求
|
||||
/// </summary>
|
||||
public class PaperNeed
|
||||
{
|
||||
/// <summary>
|
||||
/// AcsId
|
||||
/// </summary>
|
||||
public Guid AcsId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 材质
|
||||
/// </summary>
|
||||
public string PaperMassCode { get; set; }
|
||||
/// <summary>
|
||||
/// 幅宽
|
||||
/// </summary>
|
||||
public int Web { get; set; }
|
||||
/// <summary>
|
||||
/// 已分配次数
|
||||
/// </summary>
|
||||
public int DistributedCount { get; set; }
|
||||
|
||||
public string DisPlaySelected
|
||||
{
|
||||
get
|
||||
{
|
||||
return PaperMassCode + "*" + Web;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 卷 (1:A卷 2:B卷)
|
||||
/// </summary>
|
||||
public int RollNum { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 值比较器(先看两个对象GetHashCode的值是否相等,是则继续执行Equals)
|
||||
/// </summary>
|
||||
public class PaperNeedEquality : IEqualityComparer<PaperNeed>
|
||||
{
|
||||
public bool Equals(PaperNeed? x, PaperNeed? y)
|
||||
{
|
||||
return x.PaperMassCode == y.PaperMassCode && x.Web == y.Web;
|
||||
}
|
||||
|
||||
public int GetHashCode([DisallowNull] PaperNeed obj)
|
||||
{
|
||||
return obj.PaperMassCode.GetHashCode() + obj.Web.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,371 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.PmsRPC.Dto.In
|
||||
{
|
||||
/// <summary>
|
||||
/// 备纸信息
|
||||
/// </summary>
|
||||
public class PaperPreparDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 0:蓝色 1:绿色 2:红色
|
||||
/// </summary>
|
||||
public int Plate1 { get; set; }
|
||||
public int Plate2 { get; set; }
|
||||
public int Plate3 { get; set; }
|
||||
public int Plate4 { get; set; }
|
||||
public int Plate5 { get; set; }
|
||||
/// <summary>
|
||||
/// 0:黄色未备 1:紫色 未备足 2:绿色 备足 3、已备足 被使用 红色
|
||||
/// </summary>
|
||||
public int WeightPlate1 { get; set; }
|
||||
public int WeightPlate2 { get; set; }
|
||||
public int WeightPlate3 { get; set; }
|
||||
public int WeightPlate4 { get; set; }
|
||||
public int WeightPlate5 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int Sn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 门幅
|
||||
/// </summary>
|
||||
public int Web { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string FluteGUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 楞型
|
||||
/// </summary>
|
||||
public string FluteCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PaperMassGUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 材质
|
||||
/// </summary>
|
||||
public string PaperMassCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 长度
|
||||
/// </summary>
|
||||
public double ProdLen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double ProdLenCM { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Lines { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Dc 面纸
|
||||
/// </summary>
|
||||
public string DC_PaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DC长
|
||||
/// </summary>
|
||||
public double DC_PaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Dc 面纸+DC长
|
||||
/// </summary>
|
||||
|
||||
public string Str_DC_PaperMass_Meters { get { return DC_PaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", DC_PaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SC1W 瓦纸
|
||||
/// </summary>
|
||||
public string SC1_CorrPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC1W 长
|
||||
/// </summary>
|
||||
public double SC1_CorrPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC1W 瓦纸+SC1W 长
|
||||
/// </summary>
|
||||
|
||||
public string Str_SC1_CorrPaperMass_Meters { get { return SC1_CorrPaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", SC1_CorrPaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SC1X 芯纸
|
||||
/// </summary>
|
||||
public string SC1_SurfPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC1X长
|
||||
/// </summary>
|
||||
public double SC1_SurfPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///SC1X 芯纸 + SC1X长
|
||||
/// </summary>
|
||||
|
||||
public string Str_SC1_SurfPaperMass_Meters { get { return SC1_SurfPaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", SC1_SurfPaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SC2W
|
||||
/// </summary>
|
||||
public string SC2_CorrPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC2W长
|
||||
/// </summary>
|
||||
public double SC2_CorrPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///SC2W + SC2W长
|
||||
/// </summary>
|
||||
|
||||
public string Str_SC2_CorrPaperMass_Meters { get { return SC2_CorrPaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", SC2_CorrPaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SC2X
|
||||
/// </summary>
|
||||
public string SC2_SurfPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SC2X长
|
||||
/// </summary>
|
||||
public double SC2_SurfPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///SC2X + SC2X长
|
||||
/// </summary>
|
||||
|
||||
public string Str_SC2_SurfPaperMass_Meters { get { return SC2_SurfPaperMass.Replace("-", "") + "/" + string.Format("{0:N1}", SC2_SurfPaperMass_Meters); } }
|
||||
|
||||
/// <summary>
|
||||
/// SF3W
|
||||
/// </summary>
|
||||
public string SC3_CorrPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SF3W 长
|
||||
/// </summary>
|
||||
public int SC3_CorrPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SF3X
|
||||
/// </summary>
|
||||
public string SC3_SurfPaperMass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SF3X长
|
||||
/// </summary>
|
||||
public int SC3_SurfPaperMass_Meters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PaperMassFlute1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PaperMassFlute2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PaperMassFlute3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double Sc1_Rate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double Sc2_Rate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double Sc3_Rate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double DC_PaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC1_CorrPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC1_SurfPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC2_CorrPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC2_SurfPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC3_CorrPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC3_SurfPaperMass_Centimeters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string DC_Meters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC1_CorrMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC1_SurfMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC2_CorrMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC2_SurfMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC3_CorrMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string SC3_SurfMeters_display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double DcWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC1CorrWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC1SurfWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC2CorrWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC2SurfWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC3CorrWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public double SC3SurfWeight { get; set; }
|
||||
|
||||
public string StockDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总重量
|
||||
/// </summary>
|
||||
public double DCTotalWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Web * DC_PaperMass_Meters * DcWeight * 0.001) / 1000;
|
||||
}
|
||||
}
|
||||
public double SC1CorrTotalWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Web * SC1_CorrPaperMass_Meters * SC1CorrWeight * 0.001) / 1000;
|
||||
}
|
||||
}
|
||||
public double SC1SurfTotalWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Web * SC1_SurfPaperMass_Meters * SC1SurfWeight * 0.001) / 1000;
|
||||
}
|
||||
}
|
||||
public double SC2CorrTotalWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Web * SC2_CorrPaperMass_Meters * SC2CorrWeight * 0.001) / 1000;
|
||||
}
|
||||
}
|
||||
public double SC2SurfTotalWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Web * SC2_SurfPaperMass_Meters * SC2SurfWeight * 0.001) / 1000;
|
||||
}
|
||||
}
|
||||
public double SC3CorrTotalWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Web * SC3_CorrPaperMass_Meters * SC3CorrWeight * 0.001) / 1000;
|
||||
}
|
||||
}
|
||||
public double SC3SurfTotalWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Web * SC3_SurfPaperMass_Meters * SC3SurfWeight * 0.001) / 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.PmsRPC.Dto.Out
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回信息体
|
||||
/// </summary>
|
||||
public class ApiResult<T>
|
||||
{
|
||||
public bool IsSucc { get; set; }
|
||||
public int Code { get; set; }
|
||||
public string OtherInfo { get; set; }
|
||||
public string Message { get; set; }
|
||||
public int TotalRecord { get; set; }
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.PmsRPC.Dto.Out
|
||||
{
|
||||
public class DcsApiResult<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 1:成功 非1失败
|
||||
/// </summary>
|
||||
public int ResultCode { get; set; }
|
||||
public string ResultMessage { get; set; }
|
||||
public int TotalRecord { get; set; }
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace JSMachine.WMS.RPC.PmsRPC.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 机台序号
|
||||
/// </summary>
|
||||
public enum PlateType
|
||||
{
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 糊车
|
||||
/// </summary>
|
||||
HC = 1,
|
||||
|
||||
/// <summary>
|
||||
/// SC1瓦
|
||||
/// </summary>
|
||||
SC1W = 2,
|
||||
|
||||
/// <summary>
|
||||
/// SC1芯
|
||||
/// </summary>
|
||||
SC1X = 3,
|
||||
|
||||
/// <summary>
|
||||
/// SC2瓦
|
||||
/// </summary>
|
||||
SC2W = 4,
|
||||
|
||||
/// <summary>
|
||||
/// SC2芯
|
||||
/// </summary>
|
||||
SC2X = 5,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using JSMachine.WMS.RPC.PmsRPC.Dto.In;
|
||||
using JSMachine.WMS.RPC.PmsRPC.Dto.Out;
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace JSMachine.WMS.RPC.PmsRPC.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 生管系统接口服务
|
||||
/// </summary>
|
||||
[InheritedExport("Pms")]
|
||||
public interface IPaperPreparService
|
||||
{
|
||||
Task<List<MachinePaperNeedDto>> GetMachinePaperNeeds();
|
||||
|
||||
Task<string> GetACSToken();
|
||||
|
||||
Task<ApiResult<PaperPreparDto[]>> GetPaperPrepars(int pageIndex, int pageSize);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using JSMachine.WMS.Common;
|
||||
using JSMachine.WMS.Infrastructure.Attributes;
|
||||
using JSMachine.WMS.Infrastructure.Enums;
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.PmsRPC.Dto.In;
|
||||
using JSMachine.WMS.RPC.PmsRPC.Dto.Out;
|
||||
using JSMachine.WMS.RPC.PmsRPC.Enum;
|
||||
using JSMachine.WMS.RPC.PmsRPC.IService;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
|
||||
namespace JSMachine.WMS.RPC.PmsRPC.Service.ACS
|
||||
{
|
||||
[PmsTypeAttribute(PmsType.ACS)]
|
||||
/// <summary>
|
||||
/// ACS 系统备纸需求接口实现,将外部响应转换为按机台分类的备纸需求。
|
||||
/// </summary>
|
||||
public class AcsPaperPreparService : IPaperPreparService
|
||||
{
|
||||
private static readonly string acsUrl = "Global.AppSettings.PmsConfig.PmsUrl";
|
||||
private static readonly string queryPmsOrdersUrl = "throw new NotImplementedException();";
|
||||
|
||||
/// <summary>
|
||||
/// 处理后的备纸需求
|
||||
/// </summary>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<MachinePaperNeedDto>> GetMachinePaperNeeds()
|
||||
{
|
||||
ApiResult<PaperPreparDto[]> apiResult = await this.GetPaperPrepars(1, 10000);
|
||||
PaperPreparDto[] paperPrepars = apiResult?.Data;
|
||||
|
||||
if (paperPrepars == null)
|
||||
return null;
|
||||
|
||||
IEnumerable<PaperNeed> hc = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.DC_PaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.DC_PaperMass, Web = p.Web });
|
||||
IEnumerable<PaperNeed> sc1W = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.SC1_CorrPaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.SC1_CorrPaperMass, Web = p.Web });
|
||||
IEnumerable<PaperNeed> sc1X = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.SC1_SurfPaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.SC1_SurfPaperMass, Web = p.Web });
|
||||
IEnumerable<PaperNeed> sc2W = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.SC2_CorrPaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.SC2_CorrPaperMass, Web = p.Web });
|
||||
IEnumerable<PaperNeed> sc2X = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.SC2_SurfPaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.SC2_SurfPaperMass, Web = p.Web });
|
||||
|
||||
|
||||
List<MachinePaperNeedDto> machinePaperNeeds = new(5)
|
||||
{
|
||||
new MachinePaperNeedDto {PlateType=PlateType.HC,PaperNeeds=hc.ToList()},
|
||||
new MachinePaperNeedDto {PlateType=PlateType.SC1W,PaperNeeds=sc1W.ToList()},
|
||||
new MachinePaperNeedDto {PlateType=PlateType.SC1X,PaperNeeds=sc1X.ToList()},
|
||||
new MachinePaperNeedDto {PlateType=PlateType.SC2W,PaperNeeds=sc2W.ToList()},
|
||||
new MachinePaperNeedDto {PlateType=PlateType.SC2X,PaperNeeds=sc2X.ToList()}
|
||||
};
|
||||
|
||||
return machinePaperNeeds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取ACS,Token
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetACSToken()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取ACS湿段+干段备注
|
||||
/// </summary>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult<PaperPreparDto[]>> GetPaperPrepars(int pageIndex, int pageSize)
|
||||
{
|
||||
string url = acsUrl + queryPmsOrdersUrl;
|
||||
var jsonParam = new
|
||||
{
|
||||
PageIndex = pageIndex,
|
||||
PageSize = pageSize,
|
||||
};
|
||||
// 先获取访问令牌,再携带令牌调用 ACS 接口;空响应直接转换为空结果。
|
||||
var token = await GetACSToken();
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, Method.POST, JsonConvert.SerializeObject(jsonParam), token);
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
return null;
|
||||
|
||||
var apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperPreparDto[]>>(resStr);
|
||||
return apiResultDto;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
using AutoMapper;
|
||||
using JSMachine.WMS.Common;
|
||||
using JSMachine.WMS.Infrastructure.Attributes;
|
||||
using JSMachine.WMS.Infrastructure.Enums;
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.PmsRPC.Dto.In;
|
||||
using JSMachine.WMS.RPC.PmsRPC.Dto.Out;
|
||||
using JSMachine.WMS.RPC.PmsRPC.Enum;
|
||||
using JSMachine.WMS.RPC.PmsRPC.IService;
|
||||
using Newtonsoft.Json;
|
||||
using Prism.Ioc;
|
||||
using RestSharp;
|
||||
|
||||
namespace JSMachine.WMS.RPC.PmsRPC.Service.DCS
|
||||
{
|
||||
|
||||
[PmsTypeAttribute(PmsType.DCS)]
|
||||
public class DcsPaperPreparService : IPaperPreparService
|
||||
{
|
||||
private static readonly string dcsUrl = "throw new NotImplementedException();";
|
||||
private static readonly string queryPmsOrdersUrl = "Global.AppSettings.PmsConfig.QueryPmsOrdersUrl;";
|
||||
private static IMapper mapper = ContainerLocator.Container.Resolve<IMapper>();
|
||||
|
||||
/// <summary>
|
||||
/// 获取Dcs,Token
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public Task<string> GetACSToken()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理后的备纸需求
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<List<MachinePaperNeedDto>> GetMachinePaperNeeds()
|
||||
{
|
||||
ApiResult<PaperPreparDto[]> apiResult = await this.GetPaperPrepars(1, 10000);
|
||||
PaperPreparDto[] paperPrepars = apiResult?.Data;
|
||||
|
||||
if (paperPrepars == null)
|
||||
return null;
|
||||
|
||||
IEnumerable<PaperNeed> hc = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.DC_PaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.DC_PaperMass, Web = p.Web });
|
||||
IEnumerable<PaperNeed> sc1W = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.SC1_CorrPaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.SC1_CorrPaperMass, Web = p.Web });
|
||||
IEnumerable<PaperNeed> sc1X = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.SC1_SurfPaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.SC1_SurfPaperMass, Web = p.Web });
|
||||
IEnumerable<PaperNeed> sc2W = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.SC2_CorrPaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.SC2_CorrPaperMass, Web = p.Web });
|
||||
IEnumerable<PaperNeed> sc2X = paperPrepars
|
||||
.Where(p => !string.IsNullOrEmpty(p.SC2_SurfPaperMass))
|
||||
.Select(p => new PaperNeed { PaperMassCode = p.SC2_SurfPaperMass, Web = p.Web });
|
||||
|
||||
|
||||
List<MachinePaperNeedDto> machinePaperNeeds = new(5)
|
||||
{
|
||||
new MachinePaperNeedDto {PlateType=PlateType.HC,PaperNeeds=hc.ToList()},
|
||||
new MachinePaperNeedDto {PlateType=PlateType.SC1W,PaperNeeds=sc1W.ToList()},
|
||||
new MachinePaperNeedDto {PlateType=PlateType.SC1X,PaperNeeds=sc1X.ToList()},
|
||||
new MachinePaperNeedDto {PlateType=PlateType.SC2W,PaperNeeds=sc2W.ToList()},
|
||||
new MachinePaperNeedDto {PlateType=PlateType.SC2X,PaperNeeds=sc2X.ToList()}
|
||||
};
|
||||
|
||||
return machinePaperNeeds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取DCS湿段+干段备注
|
||||
/// </summary>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<ApiResult<PaperPreparDto[]>> GetPaperPrepars(int pageIndex, int pageSize)
|
||||
{
|
||||
var apiResultDto = new ApiResult<PaperPreparDto[]> { };
|
||||
string url = dcsUrl + queryPmsOrdersUrl;
|
||||
var jsonParam = new
|
||||
{
|
||||
num = pageSize,
|
||||
page = pageIndex
|
||||
};
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, Method.POST, JsonConvert.SerializeObject(jsonParam));
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var tempResultDto = JsonConvert.DeserializeObject<DcsApiResult<DcsPaperPreparDto[]>>(resStr);
|
||||
if (pageSize > tempResultDto.Data.Count())
|
||||
{
|
||||
apiResultDto.Data = new PaperPreparDto[tempResultDto.Data.Count()];
|
||||
}
|
||||
else
|
||||
{
|
||||
apiResultDto.Data = new PaperPreparDto[pageSize];
|
||||
}
|
||||
for (int i = 0; i < tempResultDto.Data.Count(); i++)
|
||||
{
|
||||
var item = tempResultDto.Data[i];
|
||||
var resultItem = new PaperPreparDto();
|
||||
|
||||
resultItem.PaperMassCode = item.Mass;
|
||||
mapper.Map(item, resultItem);
|
||||
resultItem.DC_PaperMass = item.DC_PaperMass ?? "";
|
||||
resultItem.SC1_CorrPaperMass = item.SC1_CorrPaperMass ?? "";
|
||||
resultItem.SC1_SurfPaperMass = item.SC1_SurfPaperMass ?? "";
|
||||
resultItem.SC2_CorrPaperMass = item.SC2_CorrPaperMass ?? "";
|
||||
resultItem.SC2_SurfPaperMass = item.SC2_SurfPaperMass ?? "";
|
||||
|
||||
apiResultDto.Data[i] = resultItem;
|
||||
}
|
||||
apiResultDto.Code = tempResultDto.ResultCode;
|
||||
apiResultDto.TotalRecord = tempResultDto.TotalRecord;
|
||||
apiResultDto.IsSucc = tempResultDto.ResultCode == 1 ? true : false;
|
||||
//var apiResultDto = JsonConvert.DeserializeObject<ApiResult<PaperPreparDto[]>>(resStr);
|
||||
return apiResultDto;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.RcsRPC.Dto.In
|
||||
{
|
||||
/// <summary>
|
||||
/// Agv作业执行信息
|
||||
/// </summary>
|
||||
public class AgvExcutionInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 立体库编号,对应立体库位置
|
||||
/// </summary>
|
||||
public string StorageNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RCS任务模版中的AGV执行到的动作状态,扩展字段:
|
||||
///1:未开始
|
||||
///2:运行中*
|
||||
///3:完成中*
|
||||
///4:失败
|
||||
///5:取消
|
||||
/// </summary>
|
||||
public string SubTaskStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 第三方系统任务id
|
||||
/// 必须
|
||||
/// </summary>
|
||||
public string OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// AGV序列号
|
||||
/// 否
|
||||
/// </summary>
|
||||
public string DeviceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务流程模版编号
|
||||
/// 必须
|
||||
/// </summary>
|
||||
public string ModelProcessCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// AGV动作类型,扩展字段
|
||||
/// 必须
|
||||
/// </summary>
|
||||
public string SubTaskTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RCS子任务编号,备用字段
|
||||
/// 必须
|
||||
/// </summary>
|
||||
public string SubTaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// AGV编号
|
||||
/// 否
|
||||
/// </summary>
|
||||
public string DeviceNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前子任务预到达目标点,对应任务下发时下发的点位
|
||||
/// 否
|
||||
/// </summary>
|
||||
public string QrContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 第几个动作,从0开始,扩展字段
|
||||
/// 必须
|
||||
/// </summary>
|
||||
public string SubTaskSeq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ICS记录的此任务的id值,扩展字段
|
||||
/// 必须
|
||||
/// </summary>
|
||||
public string IcsTaskOrderDetailId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务状态
|
||||
/// 3:已取消
|
||||
/// 5:发送失败
|
||||
/// 6:运行中
|
||||
///7:执行失败
|
||||
///8:已完成
|
||||
///9:已下发
|
||||
///10:等待确认
|
||||
///20:取货中
|
||||
///21:取货完成
|
||||
///22:放货中
|
||||
///23:放货完成
|
||||
/// 必须
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务执行失败,或者发送给AGV时失败的失败原因
|
||||
/// 否
|
||||
/// </summary>
|
||||
public string ErrorDesc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架当前位置
|
||||
/// 否
|
||||
/// </summary>
|
||||
public string ShelfCurrPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架编号
|
||||
/// 否
|
||||
/// </summary>
|
||||
public string ShelfNumber { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.RcsRPC.Dto.In
|
||||
{
|
||||
public class CancelTaskParam : BusinessParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 第三方系统任务单号,支持批量取消任务,传入数据格式为数组
|
||||
/// </summary>
|
||||
public string orderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备编号,同第三方系统任务单号选填其一,仅支持对第三方系统任务订单进行取消操作
|
||||
/// </summary>
|
||||
public string deviceNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 取消任务后,货架放置的目标位置,只有在货架举升起来之后才会放置到指定位置,否则会直接取消。不传该值,任务会在取消后将货架放到原地,或者搬回到起始位置
|
||||
/// </summary>
|
||||
public string destPosition { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.In.BusinessDto;
|
||||
|
||||
namespace JSMachine.WMS.RPC.RcsRPC.Dto.In
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建Rcs任务,请求参数
|
||||
/// </summary>
|
||||
public class CreateTaskParam: BusinessParamBase
|
||||
{
|
||||
public CreateTaskParam()
|
||||
{
|
||||
modelProcessCode = "cattleCarry4";
|
||||
fromSystem = "WMS";
|
||||
priority = 6;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 业务流程名称编号
|
||||
/// </summary>
|
||||
public string modelProcessCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 优先级:
|
||||
///4:高
|
||||
///6:中
|
||||
///8:低
|
||||
///高优先级的任务将会被优先调度,默认为6
|
||||
/// </summary>
|
||||
public int priority { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源系统:下发任务的第三方系统,由第三方系统自定义。如:MES、WMS等
|
||||
/// </summary>
|
||||
public string fromSystem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务单号:需要第三方系统下发任务时指定且保证每次的任务单号唯一且和之前不重复
|
||||
/// </summary>
|
||||
public string orderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public TaskOrderDetailDto taskOrderDetail;
|
||||
}
|
||||
|
||||
public partial class TaskOrderDetailDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务路径点集
|
||||
/// </summary>
|
||||
public string taskPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架编号
|
||||
/// </summary>
|
||||
public string shelfNumber { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
namespace JSMachine.WMS.RPC.RcsRPC.Dto
|
||||
{
|
||||
public class RcsApiResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 状态码
|
||||
/// 1000:请求成功
|
||||
/// 1001:请求失败
|
||||
/// 7201:请求参数错误
|
||||
/// 2103:任务流程模板编号不存在
|
||||
/// 2107:需要传路径点时,路径集合为空
|
||||
/// 2108:路径集合有误
|
||||
/// 2111:请勿重复下发任务
|
||||
/// 2115:任务已完成
|
||||
/// 其他:其他错误
|
||||
/// </summary>
|
||||
public int code { get; set; }
|
||||
/// <summary>
|
||||
/// 状态码描述
|
||||
/// </summary>
|
||||
public string desc { get; set; }
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
public string data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using JSMachine.WMS.RPC.RcsRPC.Dto.In;
|
||||
using JSMachine.WMS.RPC.RcsRPC.Dto;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out;
|
||||
|
||||
namespace JSMachine.WMS.RPC.RcsRPC.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// RCS 任务接口,封装任务创建和批量取消操作。
|
||||
/// </summary>
|
||||
public interface IRcsService
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建任务
|
||||
/// </summary>
|
||||
/// <param name="createTaskParam"></param>
|
||||
/// <returns></returns>
|
||||
Task<ApiReturnResult<bool>> CreateTask(CreateTaskParam createTaskParam);
|
||||
|
||||
/// <summary>
|
||||
/// 取消任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ApiReturnResult<bool>> CancelTask(List<CancelTaskParam> cancelTaskParams);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using JSMachine.WMS.Common;
|
||||
using JSMachine.WMS.Infrastructure.Helper;
|
||||
using JSMachine.WMS.RPC.ErpRPC.Dto.Out;
|
||||
using JSMachine.WMS.RPC.RcsRPC.Dto;
|
||||
using JSMachine.WMS.RPC.RcsRPC.Dto.In;
|
||||
using JSMachine.WMS.RPC.RcsRPC.IService;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
|
||||
namespace JSMachine.WMS.RPC.RcsRPC.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// RCS HTTP RPC 客户端,封装任务创建和取消接口调用及统一错误转换。
|
||||
/// </summary>
|
||||
public class RcsService: IRcsService
|
||||
{
|
||||
private static readonly string rcsUrl = Global.AppSettings.RcsConfig.RcsUrl;
|
||||
private static readonly string createTaskUrl = Global.AppSettings.RcsConfig.CreateTaskUrl;
|
||||
private static readonly string cancelTaskUrl = Global.AppSettings.RcsConfig.CancelTaskUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 创建任务
|
||||
/// </summary>
|
||||
/// <param name="createTaskParam"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>外部接口返回码为 1000 时转换为本地成功码 200。</remarks>
|
||||
public async Task<ApiReturnResult<bool>> CreateTask(CreateTaskParam createTaskParam)
|
||||
{
|
||||
var result = new ApiReturnResult<bool>();
|
||||
try
|
||||
{
|
||||
var url = rcsUrl + createTaskUrl;
|
||||
var jsonParam = new CreateTaskParam
|
||||
{
|
||||
modelProcessCode = createTaskParam.modelProcessCode,
|
||||
priority = createTaskParam.priority,
|
||||
fromSystem = createTaskParam.fromSystem,
|
||||
orderId = createTaskParam.orderId,
|
||||
};
|
||||
jsonParam.taskOrderDetail = new TaskOrderDetailDto
|
||||
{
|
||||
taskPath = createTaskParam.taskOrderDetail.taskPath,
|
||||
shelfNumber = createTaskParam.taskOrderDetail.shelfNumber,
|
||||
};
|
||||
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, Method.POST, JsonConvert.SerializeObject(jsonParam));
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
var msg = $"调用Rcs创建任务接口失败(CreateTask)";
|
||||
LogHelper.Error(msg);
|
||||
result.ErrorMsg = msg;
|
||||
|
||||
return result;
|
||||
}
|
||||
var apiResult = JsonConvert.DeserializeObject<RcsApiResult>(resStr);
|
||||
if (apiResult.code != 1000)
|
||||
{
|
||||
var msg = $"创建任务失败(CreateTask): {apiResult.desc}";
|
||||
LogHelper.Error(msg);
|
||||
result.ErrorMsg = msg;
|
||||
|
||||
return result;
|
||||
}
|
||||
result.ResultCode = "200";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var msg = $"创建任务异常(CreateTask):: {ex.Message} \n {ex.StackTrace}";
|
||||
LogHelper.Error(msg);
|
||||
result.ErrorMsg = msg;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向 RCS 批量提交任务取消请求。
|
||||
/// </summary>
|
||||
/// <param name="cancelTaskParams">待取消的 RCS 任务参数。</param>
|
||||
/// <returns>外部接口成功时返回本地成功码,否则携带错误信息。</returns>
|
||||
public async Task<ApiReturnResult<bool>> CancelTask(List<CancelTaskParam> cancelTaskParams)
|
||||
{
|
||||
var result = new ApiReturnResult<bool>();
|
||||
try
|
||||
{
|
||||
var url = rcsUrl + cancelTaskUrl;
|
||||
var jsonParam = new List<CancelTaskParam>();
|
||||
foreach (var item in cancelTaskParams)
|
||||
{
|
||||
jsonParam.Add(item);
|
||||
}
|
||||
string resStr = await HttpRequestHelper.RequestByJson(url, Method.POST, JsonConvert.SerializeObject(jsonParam));
|
||||
if (string.IsNullOrEmpty(resStr))
|
||||
{
|
||||
var msg = $"调用Rcs取消任务接口失败(CancelTask)";
|
||||
LogHelper.Error(msg);
|
||||
result.ErrorMsg = msg;
|
||||
|
||||
return result;
|
||||
}
|
||||
var apiResult = JsonConvert.DeserializeObject<RcsApiResult>(resStr);
|
||||
if (apiResult.code != 1000)
|
||||
{
|
||||
var msg = $"取消任务失败(CancelTask): {apiResult.desc}";
|
||||
LogHelper.Error(msg);
|
||||
result.ErrorMsg = msg;
|
||||
|
||||
return result;
|
||||
}
|
||||
result.ResultCode = "200";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var msg = $"取消任务异常(CancelTask):: {ex.Message} \n {ex.StackTrace}";
|
||||
LogHelper.Error(msg);
|
||||
result.ErrorMsg = msg;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user