baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)

This commit is contained in:
Gaussian committed 2026-11-06 18:38:38 +08:00
commit c2b0e7be0d
6522 files changed
+3530643

No files matched your search

+3550
View File
File diff suppressed because it is too large. Load diff
+99
View File
@@ -0,0 +1,99 @@
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json.Linq;
using Opsoft.NetCore.O3App.Domain;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Opsoft.NetCore.O3App.Services.WMS
{
[MapTo(typeof(IBillHandleService), ServiceLifetime.Transient)]
public class BillHandleService : ServiceBase<BaseEntity, IBillHandleRepository>, IBillHandleService
{
public BillHandleService(IBillHandleRepository repository) : base(repository)
{
Init(repository);
}
/// <summary>
/// 查询出入库流程配置
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<List<TRAN_INFO>> QuerySelBill()
{
return await (repository as IBillHandleRepository).QuerySelBill();
}
/// <summary>
/// 查询单据信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> QueryBillInfo(JObject data)
{
if (data.Property("tranType") == null ||
data.Property("billNO") == null ||
data.Property("orgID") == null)
{
throw new O3AppException("传参信息错误,未定义", 400);
}
return await (repository as IBillHandleRepository).QueryBillInfo(data);
}
/// <summary>
/// 单据复核查询条码信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> QueryBarCode(JObject data)
{
if (data.Property("tranType") == null ||
data.Property("barCode") == null ||
data.Property("billNO") == null ||
data.Property("isExit") == null ||
data.Property("orgID") == null)
{
throw new O3AppException("传参信息错误,未定义", 400);
}
return await (repository as IBillHandleRepository).QueryBarCode(data);
}
/// <summary>
/// 出入库复核提交
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> CheckSubmit(string orgID, string tranType, string fbillNo, List<BarCodeMsg<BD_BARCODERS2>> barcodeList)
{
if (orgID == null || orgID.IsNullOrEmpty())
{
throw new O3AppException("组织信息为空");
}
if (tranType == null || tranType.IsNullOrEmpty())
{
throw new O3AppException("复核单据类型为空");
}
if (fbillNo == null || fbillNo.IsNullOrEmpty())
{
throw new O3AppException("复核单据编号为空");
}
if (barcodeList == null || barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
return await (repository as IBillHandleRepository).CheckSubmit(orgID, tranType, fbillNo, barcodeList);
}
}
}
File diff suppressed because it is too large. Load diff
+81
View File
@@ -0,0 +1,81 @@
using Microsoft.Extensions.DependencyInjection;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Opsoft.NetCore.O3App.Services.WMS
{
[MapTo(typeof(IInStockService), ServiceLifetime.Transient)]
public class InStockService : ServiceBase<BaseEntity, IInStockRepository>, IInStockService
{
private readonly ISelBillRepository _selBillRepository;
public InStockService(IInStockRepository repository, ISelBillRepository selBillRepository) : base(repository)
{
Init(repository);
Init(selBillRepository);
_selBillRepository = selBillRepository;
}
/// <summary>
/// 提交入库信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> InStockSubmit(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count<=0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "PRD_InStock";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "生产入库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IInStockRepository).InStockSubmit(request, selBillList);
}
/// <summary>
/// 提交退库信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> RetStockSubmit(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "PRD_ReStock";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "生产退库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IInStockRepository).RetStockSubmit(request, selBillList);
}
}
}
+86
View File
@@ -0,0 +1,86 @@
using Microsoft.Extensions.DependencyInjection;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Opsoft.NetCore.O3App.Services.WMS
{
/// <summary>
/// 其他入库、出库
/// </summary>
[MapTo(typeof(IMisInStockService), ServiceLifetime.Transient)]
public class MisInStockService : ServiceBase<BaseEntity, IMisInStockRepository>, IMisInStockService
{
private readonly ISelBillRepository _selBillRepository;
public MisInStockService(IMisInStockRepository repository, ISelBillRepository selBillRepository) : base(repository)
{
Init(repository);
Init(selBillRepository);
_selBillRepository = selBillRepository;
}
/// <summary>
/// 提交入库信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> MisInStockSubmit(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "STK_MISCELLANEOUS";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "其他入库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IMisInStockRepository).MisInStockSubmit(request, selBillList);
}
/// <summary>
/// 提交出库信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> MisRetStockSubmit(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "STK_MISDELIVERY";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "其他出库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IMisInStockRepository).MisRetStockSubmit(request, selBillList);
}
}
}
+81
View File
@@ -0,0 +1,81 @@
using Microsoft.Extensions.DependencyInjection;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Opsoft.NetCore.O3App.Services.WMS
{
[MapTo(typeof(IOEMInStockService), ServiceLifetime.Transient)]
public class OEMInStockService : ServiceBase<BaseEntity, IOEMInStockRepository>, IOEMInStockService
{
private readonly ISelBillRepository _selBillRepository;
public OEMInStockService(IOEMInStockRepository repository, ISelBillRepository selBillRepository) : base(repository)
{
Init(repository);
Init(selBillRepository);
_selBillRepository = selBillRepository;
}
/// <summary>
/// 提交入库信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> InStockSubmit(InputBarCode<BD_BARCODERS5> request)
{
if (request.barcodeList==null || request.barcodeList.Count<=0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "STK_OEMInStock";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "受托入库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IOEMInStockRepository).InStockSubmit(request, selBillList);
}
/// <summary>
/// 提交出库信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> RetStockSubmit(InputBarCode<BD_BARCODERS5> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "STK_OEMOutStock";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "受托加工材料出库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IOEMInStockRepository).RetStockSubmit(request,selBillList);
}
}
}
+224
View File
@@ -0,0 +1,224 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json.Linq;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
namespace Opsoft.NetCore.O3App.Services.WMS
{
/// <summary>
/// 销售出库
/// </summary>
[MapTo(typeof(IOutStockService), ServiceLifetime.Transient)]
public class OutStockService : ServiceBase<BaseEntity, IOutStockRepository>, IOutStockService
{
private readonly ISelBillRepository _selBillRepository;
public OutStockService(IOutStockRepository repository, ISelBillRepository selBillRepository) : base(repository)
{
Init(repository);
Init(selBillRepository);
_selBillRepository = selBillRepository;
}
/// <summary>
/// 销售出库信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SaleOutStockSubmit(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "SAL_OUTSTOCK";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "销售出库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IOutStockRepository).SaleOutStockSubmit(request, selBillList);
}
/// <summary>
/// 销售退货信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SaleInStockSubmit(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "SAL_RETURNSTOCK";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "销售退货对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IOutStockRepository).SaleInStockSubmit(request,selBillList);
}
/// <summary>
/// 销售出库(套件)信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SaleOutStockSuitSubmit(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "SAL_OUTSTOCK_SUIT";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID,tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "销售出库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IOutStockRepository).SaleOutStockSuitSubmit(request,selBillList);
}
/// <summary>
/// 销售退库(套件)信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SaleInStockSuitSubmit(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "SAL_RETURNSTOCK_SUIT";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "销售退库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as IOutStockRepository).SaleInStockSuitSubmit(request,selBillList);
}
/// <summary>
/// 销售复核(扫源单)
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SaleCheckScanSourceBill(JObject request)
{
if (request == null)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
return await (repository as IOutStockRepository).SaleCheckScanSourceBill(request);
}
/// <summary>
/// 销售复核(扫源单)
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SaleCheckScanCode(JObject request)
{
if (request == null)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
return await (repository as IOutStockRepository).SaleCheckScanCode(request);
}
/// <summary>
/// 销售复核(暂存)
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SaleCheckTemporaryStorage(string FBILLNO, string orgID, List<BarCodeMsg<BD_BARCODERS2>> barcodeList)
{
if (barcodeList == null)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
return await (repository as IOutStockRepository).SaleCheckTemporaryStorage(FBILLNO, orgID,barcodeList);
}
/// <summary>
/// 销售复核(提交)
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SaleCheckSubmit(string FBILLNO, string orgID, List<BarCodeMsg<BD_BARCODERS2>> barcodeList)
{
if (barcodeList == null)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
return await (repository as IOutStockRepository).SaleCheckSubmit(FBILLNO, orgID, barcodeList);
}
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+67
View File
@@ -0,0 +1,67 @@
using Microsoft.Extensions.DependencyInjection;
using Opsoft.NetCore.O3App.Domain;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Opsoft.Data;
namespace Opsoft.NetCore.O3App.Services.WMS
{
[MapTo(typeof(IProductBarcodeCheckService), ServiceLifetime.Transient)]
public class ProductBarcodeCheckService : ServiceBase<BaseEntity, IProductBarcodeCheckRepository>, IProductBarcodeCheckService
{
private readonly IProductBarcodeCheckRepository productBarcodeCheckRepository;
public ProductBarcodeCheckService(IProductBarcodeCheckRepository repository) : base(repository)
{
Init(repository);
productBarcodeCheckRepository = repository;
}
public async Task<bool> SubmitSave(List<ProductBarcodeCheckRequest> input)
{
Dictionary<string, string> sqls = new Dictionary<string, string>();
DateTime now = DateTime.Now;
foreach (var barcodeGroup in input)
{
sqls.Add($"{barcodeGroup.Inner}/{barcodeGroup.Middle}/{barcodeGroup.Outer}",
$@" INSERT INTO T_PRD_BARCODECHECK
(
UID,
FINTERID,
FBILLNO,
FBARCODEINNER,
FBARCODEMIDDLE,
FBARCODEOUTER,
C_YMD,
C_USER,
FSTATUS,
FDELETED
) VALUES (
'{Guid.NewGuid().ToStringEx()}',
'{Guid.NewGuid().ToStringEx()}',
'{Guid.NewGuid().ToStringEx()}',
'{barcodeGroup.Inner}',
'{barcodeGroup.Middle}',
'{barcodeGroup.Outer}',
'{now.ToShortDateString()}',
'{LoginInfo.UserID}',
40,
0
); ");
}
List<string> errorBarcode = await productBarcodeCheckRepository.ExecuteAsync(sqls);
if (errorBarcode.Count > 0)
{
throw new O3AppException($"数据【{string.Join("】,【", errorBarcode)}】保存失败。");
}
return true;
}
}
}
File diff suppressed because it is too large. Load diff
+84
View File
@@ -0,0 +1,84 @@
using Microsoft.Extensions.DependencyInjection;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Opsoft.NetCore.O3App.Services.WMS
{
/// <summary>
/// 外购入库
/// </summary>
[MapTo(typeof(ISTKInStockService), ServiceLifetime.Transient)]
public class STKInStockService : ServiceBase<BaseEntity, ISTKInStockRepository>, ISTKInStockService
{
private readonly ISelBillRepository _selBillRepository;
public STKInStockService(ISTKInStockRepository repository, ISelBillRepository selBillRepository) : base(repository)
{
Init(repository);
Init(selBillRepository);
_selBillRepository = selBillRepository;
}
/// <summary>
/// 提交入库信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> STKInStockSubmit(InputBarCode<BD_BARCODERS1> request)
{
if (request.barcodeList == null || request.barcodeList.Count<=0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "STK_INSTOCK";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "外购入库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as ISTKInStockRepository).STKInStockSubmit(request, selBillList);
}
/// <summary>
/// 提交退料信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> PURRetStockSubmit(InputBarCode<BD_BARCODERS1> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "PUR_MRB";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "外购退料对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as ISTKInStockRepository).PURRetStockSubmit(request, selBillList);
}
}
}
+70
View File
@@ -0,0 +1,70 @@
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json.Linq;
using Opsoft.Data;
using Opsoft.NetCore.O3App.Domain;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Shared;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Opsoft.NetCore.O3App.Services.WMS
{
[MapTo(typeof(ISTKInventoryService), ServiceLifetime.Transient)]
public class STKInventoryService : ServiceBase<BaseEntity, ISTKInventoryRepository>, ISTKInventoryService
{
//private readonly ISelBillRepository _selBillRepository;
public STKInventoryService(ISTKInventoryRepository repository) : base(repository)
{
Init(repository);
}
/// <summary>
/// 库存信息查询
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<Dictionary<string, object>> QueryInventory(JObject paramaters)
{
#region 参数验证
if (!paramaters.ContainsKey("scanType"))
{
throw new O3AppException("【查询类型】传参类型错误,未定义", 400);
}
//判断查询类型
if (!int.TryParse(paramaters["scanType"].ToStringEx(), out int scanType))
{
throw new O3AppException("【查询类型】传参类型错误,值设定有误", 400);
}
//scanType:1=条码 2=库存
if (scanType == 1)
{
if (!paramaters.ContainsKey("barCodeNum"))
{
throw new O3AppException("【条码】传参类型错误,未定义", 400);
}
if (string.IsNullOrEmpty(paramaters["barCodeNum"].ToStringEx()))
{
throw new O3AppException("【条码】传参类型错误,值不能为空", 400);
}
}
else
{
//判断库存参数是否有误
if (!paramaters.ContainsKey("count") ||
!paramaters.ContainsKey("itemNumber") ||
!paramaters.ContainsKey("itemName") ||
!paramaters.ContainsKey("stockData") ||
!paramaters.ContainsKey("lot"))
{
throw new O3AppException("传参信息错误,存在未定义的参数", 400);
}
}
#endregion
return await (repository as ISTKInventoryRepository).QueryInventory(paramaters);
}
}
}
+59
View File
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Opsoft.NetCore.O3App.Domain;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Repositories.WMS;
using Opsoft.NetCore.O3App.Shared;
namespace Opsoft.NetCore.O3App.Services.WMS
{
[MapTo(typeof(ISTKStockSchemeService), ServiceLifetime.Transient)]
public class STKStockSchemeService : ServiceBase<BaseEntity, ISTKStockSchemeRepository>, ISTKStockSchemeService
{
public STKStockSchemeService(ISTKStockSchemeRepository repository, IBarcodeRepository barcodeRepository) : base(repository)
{
Init(repository);
(repository as STKStockSchemeRepository).Init(barcodeRepository);
}
/// <summary>
/// 查询盘点方案
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<QuerySourceInvPrgReturnDto> QuerySourceInvPrg(STKStockScheme SData)
{
if (SData.sourceBillNO == "")
{
throw new O3AppException("传参信息错误,盘点方案编码为空", 400);
}
return await (repository as ISTKStockSchemeRepository).QuerySourceInvPrg(SData);
}
/// <summary>
/// 盘点方案提交
/// </summary>
/// <param name="SData"></param>
/// <returns></returns>
public async Task<string> SubmitBill(Barcode_Inv SData)
{
if (SData.sourceBillNO == null || SData.sourceBillNO.ToString() == "")
{
throw new O3AppException("传参信息错误,盘点方案编号未定义!!", 400);
}
if (SData.submitData == null || SData.submitData.Count <= 0)
{
throw new O3AppException("提交信息为空!!", 400);
}
return await (repository as ISTKStockSchemeRepository).SubmitBill(SData);
}
}
}
+52
View File
@@ -0,0 +1,52 @@
using Microsoft.Extensions.DependencyInjection;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Opsoft.NetCore.O3App.Services.WMS
{
[MapTo(typeof(ISTKTransferService), ServiceLifetime.Transient)]
public class STKTransferService : ServiceBase<BaseEntity, ISTKTransferRepository>, ISTKTransferService
{
private readonly ISelBillRepository _selBillRepository;
public STKTransferService(ISTKTransferRepository repository, ISelBillRepository selBillRepository) : base(repository)
{
Init(repository);
Init(selBillRepository);
_selBillRepository = selBillRepository;
}
/// <summary>
/// 调拨管理
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> STKTransferSubmit(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "STK_TransferManage";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "调拨管理对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as ISTKTransferRepository).STKTransferSubmit(request, selBillList);
}
}
}
+87
View File
@@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
namespace Opsoft.NetCore.O3App.Services.WMS
{
/// <summary>
/// 委外入库/委外退货
/// </summary>
[MapTo(typeof(ISUBInStkPickmtlService), ServiceLifetime.Transient)]
public class SUBInStkPickmtlService : ServiceBase<BaseEntity, ISUBInStkPickmtlRepository>, ISUBInStkPickmtlService
{
private readonly ISelBillRepository _selBillRepository;
public SUBInStkPickmtlService(ISUBInStkPickmtlRepository repository, ISelBillRepository selBillRepository) : base(repository)
{
Init(repository);
Init(selBillRepository);
_selBillRepository = selBillRepository;
}
/// <summary>
/// 委外入库
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SUBInStkPickmtl(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "SUB_INSTKPICKMTL";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "委外入库对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as ISUBInStkPickmtlRepository).SUBInStkPickmtl(request, selBillList);
}
/// <summary>
/// 委外退货
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SUBOutStkPickmtl(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "SUB_OUTSTKPICKMTL";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "委外退货对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as ISUBInStkPickmtlRepository).SUBOutStkPickmtl(request, selBillList);
}
}
}
+87
View File
@@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
namespace Opsoft.NetCore.O3App.Services.WMS
{
/// <summary>
/// 委外领料/委外退料
/// </summary>
[MapTo(typeof(ISUBPICKMTRLService), ServiceLifetime.Transient)]
public class SUBPICKMTRLService : ServiceBase<BaseEntity, ISUBPICKMTRLRepository>, ISUBPICKMTRLService
{
private readonly ISelBillRepository _selBillRepository;
public SUBPICKMTRLService(ISUBPICKMTRLRepository repository, ISelBillRepository selBillRepository) : base(repository)
{
Init(repository);
Init(selBillRepository);
_selBillRepository = selBillRepository;
}
/// <summary>
/// 委外领料
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SUBPICKMTRL(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "SUB_PICKMTRL";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "委外领料对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as ISUBPICKMTRLRepository).SUBPICKMTRL(request, selBillList);
}
/// <summary>
/// 委外退料
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> SUBRETURNMTRL(InputBarCode<BD_BARCODERS2> request)
{
if (request.barcodeList == null || request.barcodeList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "提交信息为空"
};
}
string tranType = "SUB_RETURNMTRL";
List<BOS_SELBILL> selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType);
if (selBillList == null || selBillList.Count <= 0)
{
return new RetMessage
{
Status = 0,
Message = "委外退料对应的出入库流程信息未找到"
};
}
request.TranType = tranType;
return await (repository as ISUBPICKMTRLRepository).SUBRETURNMTRL(request, selBillList);
}
}
}
+126
View File
@@ -0,0 +1,126 @@
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json.Linq;
using ODK.WPF.Helper;
using Opsoft.NetCore.O3App.Domain;
using Opsoft.NetCore.O3App.Domain.Interface;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
using Opsoft.NetCore.O3App.Shared;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Opsoft.NetCore.O3App.Services.WMS
{
[MapTo(typeof(ISelBillService), ServiceLifetime.Transient)]
public class SelBillService : ServiceBase<BaseEntity, ISelBillRepository>, ISelBillService
{
public SelBillService(ISelBillRepository repository) : base(repository)
{
Init(repository);
}
/// <summary>
/// 查询出入库流程配置
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<List<BOS_SELBILL>> QuerySelBill(string orgID, string data)
{
return await (repository as ISelBillRepository).QuerySelBill(orgID, data);
}
/// <summary>
/// 扫描源单编号,查询源单信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> QuerySourceBillInfo(JObject data)
{
if (data.Property("tranType") == null ||
data.Property("sourceTranType") == null ||
data.Property("sourceBillNO") == null ||
data.Property("orgID") == null)
{
throw new O3AppException("传参信息错误,未定义", 400);
}
return await (repository as ISelBillRepository).QuerySourceBillInfo(data);
}
/// <summary>
/// 扫描条码信息,验证条码状态
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> QueryBarCode(JObject data)
{
if (data.Property("barCodeNum") == null ||
data.Property("isExit") == null ||
data.Property("isHaveSource") == null ||
data.Property("sourceTranType") == null ||
data.Property("sourceEntryID") == null ||
data.Property("sourceBillNO") == null ||
data.Property("tranType") == null ||
data.Property("orgID") == null
)
{
return new RetMessage
{
Status = 0,
Message = "传参信息错误,存在未定义的参数"
};
}
else
{
return await (repository as ISelBillRepository).QueryBarCode(data);
}
}
/// <summary>
/// 扫描位置信息,查询仓库仓位
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> QueryStockData(JObject data)
{
if (data.Property("tranType") == null ||
data.Property("stockData") == null ||
data.Property("sourceTranType") == null ||
data.Property("sourceBillNO") == null ||
data.Property("orgID") == null
)
{
if (data.Property("tranType").Value.ToString() == "SP_InStock" ||
data.Property("tranType").Value.ToString() == "SP_OUTSTOCK" ||
data.Property("tranType").Value.ToString().ToUpperEx() == "QM_STKAPPCHANGE"
)
{
return await (repository as ISelBillRepository).QueryStockData(data);
}
else
{
return new RetMessage
{
Status = 0,
Message = "传参信息错误,存在未定义的参数"
};
}
}
else
{
return await (repository as ISelBillRepository).QueryStockData(data);
}
}
/// <summary>
/// 查询仓库库存状态
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<RetMessage> QueryStockStatus(JObject data)
{
return await (repository as ISelBillRepository).QueryStockStatus(data);
}
}
}
File diff suppressed because it is too large. Load diff