baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
+298
@@ -0,0 +1,298 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.Data;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
[Authorize]
|
||||
public class BarcodeController : BaseApiController<BarcodeController>
|
||||
{
|
||||
private readonly IBarcodeService _barcodeService;
|
||||
public BarcodeController(IMapper mapper, ILogger<BarcodeController> logger,IBarcodeService barcodeService)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
_barcodeService = barcodeService;
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="barcode"></param>
|
||||
/// <param name="orgId"></param>
|
||||
/// <param name="billType">哪个功能调用</param>
|
||||
/// <returns></returns>
|
||||
public async Task<BaseResponse<BarCodeMsg>> GetBarcodeMsg([FromQuery] string barcode, [FromQuery] string orgId,
|
||||
[FromQuery] string billType)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await _barcodeService.GetBarCodeMsg(barcode, orgId,billType);
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES扫描随工单二维码获取信息
|
||||
/// </summary>
|
||||
/// <param name="barcode">条码</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<object>> GetMESWorkOrderInfo([FromQuery] string barcode)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.GetMESWorkOrderInfo(barcode);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 盘点扫描条码获取信息
|
||||
/// </summary>
|
||||
/// <param name="barcode">条码</param>
|
||||
/// <param name="billType">单据类型</param>
|
||||
/// <param name="orgId">组织ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<object>> GetStockTakingBarcodeInfo([FromQuery] string barcode, [FromQuery] string orgId)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.GetStockTakingBarcodeInfo(barcode, orgId);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 盘点条码录入
|
||||
/// </summary>
|
||||
/// <param name="inputDto">参数实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> ImportStockTakingBarCode([FromBody] ImportBarcodeDto inputDto)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.ImportStockTakingBarCode(inputDto);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫描条码获取信息
|
||||
/// </summary>
|
||||
/// <param name="barcode">条码</param>
|
||||
/// <param name="billType">单据类型</param>
|
||||
/// <param name="orgId">组织ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<object>> GetBarcodeInfo([FromQuery] string barcode, [FromQuery] int billType, [FromQuery] string orgId, [FromQuery] bool isMix=false)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.GetBarcodeInfo(barcode, billType, orgId, isMix);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫描条码获取信息(追加装箱箱码扫描用)
|
||||
/// </summary>
|
||||
/// <param name="barcode">条码</param>
|
||||
/// <param name="billType">单据类型</param>
|
||||
/// <param name="orgId">组织ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<RetMessage>> GetBarcodeInfoIsAdd([FromQuery] string barcode,[FromQuery] string orgId, [FromQuery] bool isMix = false)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.GetBarcodeInfoIsAdd(barcode,orgId, isMix);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg;
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 条码拆分
|
||||
/// </summary>
|
||||
/// <param name="inputDto">参数实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> SplitBarcode([FromBody] SplitInputDto inputDto)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.SplitBarcode(inputDto);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(inputDto.TranType.ToStringEx().ToUpperEx()== "STK_BARCODESPLIT")
|
||||
{
|
||||
return retMsg.Data["datainfo"];
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 条码合并
|
||||
/// </summary>
|
||||
/// <param name="inputDto">参数实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> MergeBarcode([FromBody] MergeInputDto inputDto)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.MergeBarcode(inputDto);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 条码变更
|
||||
/// </summary>
|
||||
/// <param name="inputDto">参数实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> UpBarcodeInfo([FromBody] UpBarCodeInfoDto inputDto)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.UpBarcodeInfo(inputDto);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 外部条码导入
|
||||
/// </summary>
|
||||
/// <param name="inputDto">参数实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> ImportBarCode([FromBody] ImportBarcodeDto inputDto)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.ImportBarCode(inputDto);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 条码装箱
|
||||
/// </summary>
|
||||
/// <param name="inputDto">参数实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> InBox([FromBody] InBoxInputDto inputDto)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.InBox(inputDto);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 条码拆箱
|
||||
/// </summary>
|
||||
/// <param name="inputDto">参数实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> OutBox([FromBody] OutBoxInputDto inputDto)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.OutBox(inputDto);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
[Authorize]
|
||||
public class BillHandleController : BaseApiController<BillHandleController>
|
||||
{
|
||||
private readonly IBillHandleService _Service;
|
||||
public BillHandleController(IMapper mapper, ILogger<BillHandleController> logger, IBillHandleService Service)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
_Service = Service;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询需要进行复核的单据信息
|
||||
/// </summary>
|
||||
/// <param name="fNO"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<List<TRAN_INFO>>> QuerySelBill()
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await _Service.QuerySelBill();
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫描单据编号,查询单据信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> QueryBillInfo([FromBody] JObject data)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await _Service.QueryBillInfo(data);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 扫描条码,查询条码信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> QueryBarCode([FromBody] JObject data)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await _Service.QueryBarCode(data);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 出入库复核提交
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> CheckSubmit([FromBody] CheckBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await _Service.CheckSubmit(request.orgID, request.tranType, request.fbillNo, request.barcodeList);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
public class CallMaterialController : BaseApiController<CallMaterialController>
|
||||
{
|
||||
private ICallMaterialService _callMaterialService;
|
||||
public CallMaterialController(IMapper mapper, ILogger<CallMaterialController> logger, ICallMaterialService callMaterialService) : base(mapper, logger)
|
||||
{
|
||||
_callMaterialService = callMaterialService;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse> GetCallBillInfo([FromBody] GetCallMaterialBillInfoPara para)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg =
|
||||
await _callMaterialService.GetCallBillInfo(para);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse> CallMaterialSubmit([FromBody] List<CallMaterialSubmitHead> callBills)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg =
|
||||
await _callMaterialService.CallMaterialSubmit(callBills);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse> CallMaterialQueryBarcode([FromQuery] string barcode)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg =
|
||||
await _callMaterialService.CallMaterialQueryBarcode(barcode);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse> StartSend([FromQuery] string billNo)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg =
|
||||
await _callMaterialService.StartSend(billNo);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse> SendTo([FromBody] List<string> billNo)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg =
|
||||
await _callMaterialService.SendTo(billNo);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Filters;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产入库,退库
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class InStockController : BaseApiController<SelBillController>
|
||||
{
|
||||
private readonly IInStockService service;
|
||||
public InStockController(IMapper mapper, ILogger<SelBillController> logger, IInStockService Service)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = Service;
|
||||
}
|
||||
/// <summary>
|
||||
/// 生产入库信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> InStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.InStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
/// <summary>
|
||||
/// 生产退库信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> RetStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.RetStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Filters;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 其他入库、出库
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class MisInStockController : BaseApiController<MisInStockController>
|
||||
{
|
||||
private readonly IMisInStockService service;
|
||||
public MisInStockController(IMapper mapper, ILogger<MisInStockController> logger, IMisInStockService Service)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = Service;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 其他入库信息
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> MisInStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.MisInStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 其他出库信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<Dictionary<string, object>>> MisRetStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.MisRetStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data;
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Filters;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 受托加工入库、出库
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class OEMInStockController : BaseApiController<OEMInStockController>
|
||||
{
|
||||
private readonly IOEMInStockService service;
|
||||
public OEMInStockController(IMapper mapper, ILogger<OEMInStockController> logger, IOEMInStockService Service)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = Service;
|
||||
}
|
||||
/// <summary>
|
||||
/// 受托入库信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> InStockSubmit([FromBody] InputBarCode<BD_BARCODERS5> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.InStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
/// <summary>
|
||||
/// 受托出库信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> RetStockSubmit([FromBody] InputBarCode<BD_BARCODERS5> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.RetStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Filters;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 销售出库
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class OutStockController : BaseApiController<SelBillController>
|
||||
{
|
||||
private readonly IOutStockService service;
|
||||
public OutStockController(IMapper mapper, ILogger<SelBillController> logger, IOutStockService spotcheckService)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = spotcheckService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售出库信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SaleOutStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SaleOutStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售退货信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SaleInStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SaleInStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售出库(套件)信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SaleOutStockSuitSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SaleOutStockSuitSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售退库(套件)信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SaleInStockSuitSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SaleInStockSuitSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售复核(扫源单)
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> SaleCheckScanSourceBill([FromBody] JObject request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SaleCheckScanSourceBill(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售复核(暂存)
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> SaleCheckScanCode([FromBody] JObject request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SaleCheckScanCode(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售复核(暂存)
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> SaleCheckTemporaryStorage([FromBody] InputSalCheck<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SaleCheckTemporaryStorage(request.FBILLNO, request.orgID, request.barcodeList);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售复核(提交)
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> SaleCheckSubmit([FromBody] InputSalCheck<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SaleCheckSubmit(request.FBILLNO,request.orgID,request.barcodeList);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+276
@@ -0,0 +1,276 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 销售拣货
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class PickInventoryController : BaseApiController<PickInventoryController>
|
||||
{
|
||||
private readonly IPickInventoryService _pickInventoryService;
|
||||
private readonly IBarcodeService _barcodeService;
|
||||
|
||||
public PickInventoryController(
|
||||
IMapper mapper, ILogger<PickInventoryController> logger,
|
||||
IPickInventoryService pickInventoryService,
|
||||
IBarcodeService barcodeService)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
_pickInventoryService = pickInventoryService;
|
||||
_barcodeService = barcodeService;
|
||||
}
|
||||
|
||||
#region 旧销售拣货接口
|
||||
|
||||
/// <summary>
|
||||
/// 获取拣货信息
|
||||
/// </summary>
|
||||
/// <param name="para"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> GetPickInventoryDetail([FromBody] PickInventoryParameter para)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickInventoryService.GetPickInventoryDetail(para);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 条码操作(扫码/删除)
|
||||
/// </summary>
|
||||
/// <param name="para"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> BarcodeOperate([FromBody] PickInventoryBarcodeParameter para)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickInventoryService.ScanOrRemoveBarcode(para);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 条码拆分
|
||||
/// </summary>
|
||||
/// <param name="para"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> SplitBarcode([FromBody] SplitInputDto para)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _barcodeService.SplitBarcode(para);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 新拣货
|
||||
|
||||
/// <summary>
|
||||
/// 获取拣货任务列表
|
||||
/// </summary>
|
||||
/// <param name="companyId">组织</param>
|
||||
/// <param name="type">拣货类型</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<object>> GetPickTaskList(string companyId, int type)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickInventoryService.GetPickTaskList(companyId, type);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 认领拣货任务
|
||||
/// </summary>
|
||||
/// <param name="companyId">组织</param>
|
||||
/// <param name="billNo">单号</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<object>> TakePickTask(string companyId, string billNo)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickInventoryService.TakePickTask(companyId, billNo);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取容器信息
|
||||
/// </summary>
|
||||
/// <param name="companyId">组织</param>
|
||||
/// <param name="containerNo">容器号</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<object>> GetContainerInfo(string companyId, string containerNo)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickInventoryService.GetContainerInfo(companyId, containerNo);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取库存信息
|
||||
/// </summary>
|
||||
/// <param name="taskSubRowDetailId">当前任务单明细行detailId</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<object>> PickTaskGetInventoryInfo(string taskSubRowDetailId)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickInventoryService.GetInventoryInfo(taskSubRowDetailId);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫码获取条码信息
|
||||
/// </summary>
|
||||
/// <param name="companyId">组织</param>
|
||||
/// <param name="barcode">条码</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<object>> PickTaskQueryBarcode(string companyId, string barcode)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickInventoryService.QueryBarcode(companyId, barcode);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫码回车
|
||||
/// </summary>
|
||||
/// <param name="para">参数</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> PickTaskScanBarcode([FromBody] PickTaskScanBarcodePara para)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickInventoryService.ScanBarcode(para);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异常上报
|
||||
/// </summary>
|
||||
/// <param name="para">参数</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> PickTaskErrorReport([FromBody] PickTaskErrorReportPara para)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickInventoryService.ErrorReport(para);
|
||||
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Filters;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产领料,生产退料
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class PickMtrlController : BaseApiController<SelBillController>
|
||||
{
|
||||
private readonly IPickMtrlService _pickMtrlService;
|
||||
public PickMtrlController(IMapper mapper, ILogger<SelBillController> logger,IPickMtrlService pickMtrlService)
|
||||
:base(mapper, logger)
|
||||
{
|
||||
_pickMtrlService = pickMtrlService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产领料提交
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> PickMtrlSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickMtrlService.PickMtrlSubmit(request);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产退料提交
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> ReturnMtrlSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickMtrlService.ReturnMtrlSubmit(request);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 生产补料提交
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> FeedMtrlSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _pickMtrlService.FeedMtrlSubmit(request);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+556
@@ -0,0 +1,556 @@
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.Data;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
[EnableCors("any")]
|
||||
public class PrintServicesController : BaseApiController<PrintServicesController>
|
||||
{
|
||||
public PrintServicesController(IMapper mapper, ILogger<PrintServicesController> logger) : base(mapper, logger)
|
||||
{
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult GetPrintTemplateInfo([FromBody] PrintModel data)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (APPServerContext DBContext = new APPServerContext(data.DBAias, data.UserID))
|
||||
{
|
||||
string sql = @$" SELECT
|
||||
t2.FNUMBER as FPRGKEY,
|
||||
t2.FNAME as FPRGNAME,
|
||||
t1.FNUMBER as FPRINTKEY,
|
||||
t1.FCAPTION,
|
||||
t1.FDETAILID,
|
||||
t1.FTEMPLATE
|
||||
FROM SYS_BILLTEMPLATEENTRY5 t1
|
||||
LEFT JOIN SYS_BILLTEMPLATE t2 ON t1.FINTERID = t2.FINTERID
|
||||
WHERE t2.FNUMBER='MATERIAL_MODEL' AND t1.FNUMBER='{data.FMOULD}'";
|
||||
var retData = DBContext.Database.SqlQuery(sql);
|
||||
return Ok(new { ErrCode = 0, Data = retData });
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
return Ok(new
|
||||
{
|
||||
ErrCode = 400,
|
||||
Data = ex.Message
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult GetPrintBarcodeInfo([FromBody] PrintModel data)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (APPServerContext DBContext = new APPServerContext(data.DBAias, data.UserID))
|
||||
{
|
||||
//string sql = @" SELECT
|
||||
// T01.*,
|
||||
// T03.FNUMBER AS FMANUMBER
|
||||
// ,T03.FNAME AS FMANAME
|
||||
// ,T03.FSPECIFICATION
|
||||
// ,T05.FNAME AS FUNITNAME
|
||||
// FROM T_BD_BARCODERS T01
|
||||
// LEFT JOIN T_BD_MATERIAL T03 ON T01.FMATERIALID = T03.FINTERID
|
||||
// LEFT JOIN T_BD_UNIT T05 ON T01.FUNITID = T05.FINTERID
|
||||
// WHERE T01.FBARCODE IN ('" + string.Join("','", data.FBarcode) + "')";
|
||||
|
||||
string sql = @" select T01.*,
|
||||
T03.FNUMBER as FMANUMBER , T03.FNAME as FMANAME , T03.FSPECIFICATION as FSPECIFICATION , T03.FPICTURE as FPICTURE , T03.FDESCEN as FDESCEN ,
|
||||
T05.FNAME as FUNITNAME ,
|
||||
T04.FPURBILLNO as FPURBILLNO , T04.FPOBILLNO as FPOBILLNO ,
|
||||
T07.FNUMBER as FSUPNUMBER , T07.FNAME as FSUPNAME ,
|
||||
T06.FMOBILLNO as FMOBILLNO , T06.FMODELNO as FMODELNO , T06.FSN as FSN
|
||||
from T_BD_BARCODERS T01
|
||||
LEFT JOIN T_BD_MATERIAL T03 on T01.FMATERIALID = T03.FINTERID
|
||||
LEFT JOIN T_BD_UNIT T05 on T01.FUNITID = T05.FINTERID
|
||||
LEFT JOIN T_BD_BARCODERS1 T04 on T01.FBARCODE = T04.FBARCODE
|
||||
LEFT JOIN T_BD_SUPPLIER T07 on T04.FSUPPLIERID = T07.FINTERID
|
||||
LEFT JOIN T_BD_BARCODERS2 T06 on T01.FBARCODE = T06.FBARCODE
|
||||
WHERE T01.FBARCODE IN ('" + string.Join("','", data.FBarcode) + "')";
|
||||
var retData = DBContext.Database.SqlQuery(sql);
|
||||
return Ok(new { ErrCode = 0, Data = retData });
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
return Ok(new
|
||||
{
|
||||
ErrCode = 400,
|
||||
Data = ex.Message
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<DataTable>> QueryBluetooth([FromQuery] string orgId, [FromQuery] string printerBrand = "")
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
await using APPServerContext dbContext = new APPServerContext(LoginInfo.DBAias, LoginInfo.UserID);
|
||||
string sql =
|
||||
$@"SELECT
|
||||
FINTERID
|
||||
, FNUMBER
|
||||
, FNAME
|
||||
, FCOMPANYID
|
||||
FROM dbo.T_BAS_BTPRINTER
|
||||
WHERE FTYPE='{printerBrand}' ";
|
||||
if (!orgId.IsNullOrEmpty())
|
||||
{
|
||||
sql += $" AND FCOMPANYID='{orgId}'";
|
||||
}
|
||||
DataTable configDataTable = dbContext.Database.SqlQuery(sql);
|
||||
if (configDataTable.Rows.Count <= 0)
|
||||
{
|
||||
throw new O3AppException("未取得蓝牙打印机配置");
|
||||
}
|
||||
return configDataTable;
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> QueryBluetoothByBill([FromBody] QueryPrintConfigModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
await using APPServerContext dbContext = new APPServerContext(LoginInfo.DBAias, LoginInfo.UserID);
|
||||
var queryBarcodeInfoSql =
|
||||
$@"SELECT
|
||||
T01.FCOMPANYID
|
||||
, T01.FBARCODE
|
||||
, T02.FNUMBER AS FMATERIALNUMBER
|
||||
, T02.FNAME AS FMATERIALNAME
|
||||
, T02.FSPECIFICATION
|
||||
, T02.FISBATCHMANAGE
|
||||
, T01.FLOT
|
||||
, T08.FNAME AS FAUXPROPNAME
|
||||
, T01.FQTY
|
||||
, T03.FNAME AS FUNITNAME
|
||||
, T01.FBASEQTY
|
||||
, T04.FNAME AS FBASEUNITNAME
|
||||
, T01.FSECUNITQTY
|
||||
, T05.FNAME AS FSECUNITNAME
|
||||
, T06.FNAME AS FSTOCKNAME
|
||||
, T06.FISOPENLOCATION
|
||||
, T07.FNAME AS FSTOCKLOCNAME
|
||||
, T01.FKFDATE
|
||||
, T02.FISKFPERIOD
|
||||
, T01.FDELETED
|
||||
, CASE T02.FISKFPERIOD
|
||||
WHEN 1 THEN
|
||||
CASE T02.FKFUNIT
|
||||
WHEN 0 THEN
|
||||
DATEADD(DAY, T02.FKFPERIOD, T01.FKFDATE)
|
||||
WHEN 1 THEN
|
||||
DATEADD(MONTH, T02.FKFPERIOD, T01.FKFDATE)
|
||||
WHEN 2 THEN
|
||||
DATEADD(YEAR, T02.FKFPERIOD, T01.FKFDATE)
|
||||
END
|
||||
ELSE
|
||||
NULL
|
||||
END AS FEXPIREDATE
|
||||
, T09.FNAME AS FCOMPANYNAME
|
||||
FROM dbo.T_BD_BARCODERS T01
|
||||
LEFT JOIN dbo.T_BD_MATERIAL T02
|
||||
ON T02.FINTERID = T01.FMATERIALID
|
||||
LEFT JOIN dbo.T_BD_UNIT T03
|
||||
ON T03.FINTERID = T01.FUNITID
|
||||
LEFT JOIN dbo.T_BD_UNIT T04
|
||||
ON T04.FINTERID = T01.FBASEUNITID
|
||||
LEFT JOIN dbo.T_BD_UNIT T05
|
||||
ON T05.FINTERID = T01.FSECUNITID
|
||||
LEFT JOIN dbo.T_BD_STOCK T06
|
||||
ON T06.FINTERID = T01.FSTOCKID
|
||||
LEFT JOIN dbo.T_BAS_FLEXVALUESDETAIL T07
|
||||
ON T07.FINTERID = T01.FSTOCKLOCID
|
||||
LEFT JOIN dbo.T_BD_FLEXSITEMDETAILV T08
|
||||
ON T08.FINTERID = T01.FAUXPROPID
|
||||
LEFT JOIN dbo.SYS_ORGSTRUCTURE T09
|
||||
ON T09.FINTERID = T01.FCOMPANYID
|
||||
WHERE T01.FBARCODE IN ({string.Join(",", model.BarcodeList.Select(o => "'" + o + "'").ToList())})";
|
||||
DataTable barcodeInfoTable = dbContext.Database.SqlQuery(queryBarcodeInfoSql);
|
||||
if (barcodeInfoTable.Rows.Count <= 0)
|
||||
{
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = null,
|
||||
Message = "获取蓝牙打印配置失败:未查询任条码信息!",
|
||||
StatusCode = 400,
|
||||
Success = false
|
||||
};
|
||||
}
|
||||
|
||||
foreach (var barcode in model.BarcodeList)
|
||||
{
|
||||
var barcodeCount = barcodeInfoTable
|
||||
.AsEnumerable()
|
||||
.Count(o => o["FBARCODE"].ToStringEx() == barcode);
|
||||
if (barcodeCount <= 0)
|
||||
{
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = null,
|
||||
Message = $"获取蓝牙打印配置失败:条码[{barcode}]信息未找到!",
|
||||
StatusCode = 400,
|
||||
Success = false
|
||||
};
|
||||
}
|
||||
|
||||
if (barcodeCount > 1)
|
||||
{
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = null,
|
||||
Message = $"获取蓝牙打印配置失败:条码[{barcode}]在条码主档中有多条记录!",
|
||||
StatusCode = 500,
|
||||
Success = false
|
||||
};
|
||||
}
|
||||
|
||||
var barcodeInfo = barcodeInfoTable
|
||||
.AsEnumerable()
|
||||
.FirstOrDefault(o => o["FBARCODE"].ToStringEx() == barcode);
|
||||
if (!model.OrgId.IsNullOrEmpty() && barcodeInfo["FCOMPANYID"].ToStringEx() != model.OrgId)
|
||||
{
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = null,
|
||||
Message = $"获取蓝牙打印配置失败:条码[{barcode}]的组织[{barcodeInfo["FCOMPANYNAME"].ToStringEx()}]与当前组织不同!",
|
||||
StatusCode = 500,
|
||||
Success = false
|
||||
};
|
||||
}
|
||||
if (barcodeInfo["FDELETED"].ToBoolean())
|
||||
{
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = null,
|
||||
Message = $"获取蓝牙打印配置失败:条码[{barcode}]已被禁用!",
|
||||
StatusCode = 500,
|
||||
Success = false
|
||||
};
|
||||
}
|
||||
}
|
||||
switch (model.PrinterBrand)
|
||||
{
|
||||
case "DT":
|
||||
{
|
||||
string queryConfigSql =
|
||||
$@"SELECT
|
||||
T1.FNAME AS FCONFIGNAME
|
||||
, T1.FNUMBER AS FCONFIGNUMBER
|
||||
, T1.FPRINTCOUNT
|
||||
, T1.FWIDTH AS FLABELWIDTH
|
||||
, T1.FHEIGHT AS FLABELHEIGHT
|
||||
, T1.FORIENTATION AS FLAYOUTORIENTATION
|
||||
, T2.FELEMENTTYPE
|
||||
, T2.FX
|
||||
, T2.FY
|
||||
, T2.FHEIGHT AS FELEMENTHEIGHT
|
||||
, T2.FWIDTH AS FELEMENTWIDTH
|
||||
, T2.FORIENTATION AS FELEMENTORIENTATION
|
||||
, T2.FBINDINGFIELD
|
||||
, T2.FFONTSTYLE
|
||||
, T2.FFONTHEIGHT
|
||||
, T2.FLINEWIDTH
|
||||
, T2.FTEXTHEIGHT
|
||||
, T2.FAUTORETURN
|
||||
, T2.FISDEFAULTVALUE
|
||||
, T2.FFIELDVALUE
|
||||
, T2.FNOTE
|
||||
, T2.FISINTERCEPTTEXT
|
||||
, T2.FINTERCEPTLENTH
|
||||
FROM dbo.T_BAS_BTPRINTER T1
|
||||
LEFT JOIN dbo.T_BAS_BTPRINTER_ENTRY_DT T2
|
||||
ON T2.FINTERID = T1.FINTERID
|
||||
WHERE T1.FSTATUS=40 AND T1.FDELETED=0 AND T1.FNUMBER='{model.ConfigNumber}' ";
|
||||
if (!model.OrgId.IsNullOrEmpty())
|
||||
{
|
||||
queryConfigSql += $" AND T1.FCOMPANYID='{model.OrgId}'";
|
||||
}
|
||||
DataTable configDataTable = dbContext.Database.SqlQuery(queryConfigSql);
|
||||
if (configDataTable.Rows.Count <= 0)
|
||||
{
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = null,
|
||||
Message = "获取蓝牙打印配置失败:未找到指定的蓝牙打印机配置!",
|
||||
StatusCode = 400,
|
||||
Success = false
|
||||
};
|
||||
}
|
||||
|
||||
var configGroups = configDataTable.AsEnumerable().GroupBy(o => new
|
||||
{
|
||||
ConfigName = o["FCONFIGNAME"].ToStringEx(),
|
||||
ConfigNumber = o["FCONFIGNUMBER"].ToStringEx(),
|
||||
PrintCount = o["FPRINTCOUNT"].ToInt(),
|
||||
LabelWidth = o["FLABELWIDTH"].ToDecimal(),
|
||||
LabelHeight = o["FLABELHEIGHT"].ToDecimal(),
|
||||
Orientation = o["FLAYOUTORIENTATION"].ToDecimal()
|
||||
});
|
||||
var configGroup = configGroups.FirstOrDefault();
|
||||
if (configGroup == null)
|
||||
{
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = null,
|
||||
Message = "获取蓝牙打印配置失败:未找到指定的蓝牙打印机配置!",
|
||||
StatusCode = 400,
|
||||
Success = false
|
||||
};
|
||||
}
|
||||
IBluetoothPrintConfig config = new BluetoothPrintConfig_DT
|
||||
{
|
||||
ConfigName = configGroup.Key.ConfigName,
|
||||
ConfigNumber = configGroup.Key.ConfigNumber,
|
||||
LabelWidth = configGroup.Key.LabelWidth,
|
||||
LabelHeight = configGroup.Key.LabelHeight,
|
||||
PrintCount = configGroup.Key.PrintCount,
|
||||
Orientation = configGroup.Key.Orientation,
|
||||
};
|
||||
config.ConfigDetails = new List<IBluetoothPrintDetailConfig>();
|
||||
|
||||
List<string> noInfoBarcodeList = new List<string>();
|
||||
foreach (var barcode in model.BarcodeList)
|
||||
{
|
||||
var barcodeInfo = barcodeInfoTable
|
||||
.AsEnumerable()
|
||||
.FirstOrDefault(o => o["FBARCODE"].ToStringEx() == barcode);
|
||||
if (barcodeInfo != null)
|
||||
{
|
||||
BluetoothPrintDetailConfig_DT detailConfig = new BluetoothPrintDetailConfig_DT
|
||||
{
|
||||
Barcode = barcode
|
||||
};
|
||||
foreach (var configRow in configGroup)
|
||||
{
|
||||
switch (configRow["FELEMENTTYPE"].ToInt())
|
||||
{
|
||||
case 2:
|
||||
BoxConfig boxConfig = new BoxConfig
|
||||
{
|
||||
ElementType = 2,
|
||||
X = configRow["FX"].ToDecimal(),
|
||||
Y = configRow["FY"].ToDecimal(),
|
||||
Width = configRow["FELEMENTWIDTH"].ToDecimal(),
|
||||
Height = configRow["FELEMENTHEIGHT"].ToDecimal(),
|
||||
LineWidth = configRow["FLINEWIDTH"].ToDecimal(),
|
||||
Note = configRow["FNOTE"].ToStringEx()
|
||||
};
|
||||
detailConfig.ElementConfigs.Add(boxConfig);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
TextConfig textConfig = new TextConfig
|
||||
{
|
||||
ElementType = 3,
|
||||
X = configRow["FX"].ToDecimal(),
|
||||
Y = configRow["FY"].ToDecimal(),
|
||||
Width = configRow["FELEMENTWIDTH"].ToDecimal(),
|
||||
Height = configRow["FELEMENTHEIGHT"].ToDecimal(),
|
||||
FontStyle = configRow["FFONTSTYLE"].ToStringEx(),
|
||||
FontHeight = configRow["FFONTHEIGHT"].ToDecimal(),
|
||||
Orientation = configRow["FELEMENTORIENTATION"].ToDecimal(),
|
||||
BindingField = configRow["FBINDINGFIELD"].ToStringEx(),
|
||||
AutoReturn = configRow["FAUTORETURN"].ToBoolean(),
|
||||
IsInterceptText = configRow["FISINTERCEPTTEXT"].ToBoolean(),
|
||||
InterceptLength = configRow["FINTERCEPTLENTH"].ToInt(),
|
||||
Note = configRow["FNOTE"].ToStringEx()
|
||||
};
|
||||
SetFieldValue(textConfig, configRow, barcodeInfo);
|
||||
detailConfig.ElementConfigs.Add(textConfig);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
BarcodeConfig barcodeConfig = new BarcodeConfig
|
||||
{
|
||||
ElementType = 4,
|
||||
X = configRow["FX"].ToDecimal(),
|
||||
Y = configRow["FY"].ToDecimal(),
|
||||
Width = configRow["FELEMENTWIDTH"].ToDecimal(),
|
||||
Height = configRow["FELEMENTHEIGHT"].ToDecimal(),
|
||||
TextHeight = configRow["FTEXTHEIGHT"].ToDecimal(),
|
||||
Orientation = configRow["FELEMENTORIENTATION"].ToDecimal(),
|
||||
BindingField = configRow["FBINDINGFIELD"].ToStringEx(),
|
||||
Note = configRow["FNOTE"].ToStringEx()
|
||||
};
|
||||
SetFieldValue(barcodeConfig, configRow, barcodeInfo);
|
||||
detailConfig.ElementConfigs.Add(barcodeConfig);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
QRCodeConfig qrCodeConfig = new QRCodeConfig
|
||||
{
|
||||
ElementType = 5,
|
||||
X = configRow["FX"].ToDecimal(),
|
||||
Y = configRow["FY"].ToDecimal(),
|
||||
Width = configRow["FELEMENTWIDTH"].ToDecimal(),
|
||||
Orientation = configRow["FELEMENTORIENTATION"].ToDecimal(),
|
||||
BindingField = configRow["FBINDINGFIELD"].ToStringEx(),
|
||||
Note = configRow["FNOTE"].ToStringEx()
|
||||
};
|
||||
SetFieldValue(qrCodeConfig, configRow, barcodeInfo);
|
||||
detailConfig.ElementConfigs.Add(qrCodeConfig);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
LineConfig lineConfig = new LineConfig
|
||||
{
|
||||
ElementType = 6,
|
||||
X1 = configRow["FX"].ToDecimal(),
|
||||
Y1 = configRow["FY"].ToDecimal(),
|
||||
X2 = configRow["FELEMENTWIDTH"].ToDecimal(),
|
||||
Y2 = configRow["FELEMENTHEIGHT"].ToDecimal(),
|
||||
LineWidth = configRow["FLINEWIDTH"].ToDecimal(),
|
||||
Note = configRow["FNOTE"].ToStringEx()
|
||||
};
|
||||
detailConfig.ElementConfigs.Add(lineConfig);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
config.ConfigDetails.Add(detailConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
noInfoBarcodeList.Add(barcode);
|
||||
}
|
||||
}
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = new
|
||||
{
|
||||
PrintConfig = config,
|
||||
NoConfigBarcodes = noInfoBarcodeList
|
||||
},
|
||||
Message = "获取蓝牙打印配置成功",
|
||||
StatusCode = 200,
|
||||
Success = true
|
||||
};
|
||||
}
|
||||
default:
|
||||
{
|
||||
IBluetoothPrintConfig config = null;
|
||||
string queryConfigSql =
|
||||
$@"SELECT
|
||||
T1.FNAME AS FCONFIGNAME
|
||||
, T1.FNUMBER AS FCONFIGNUMBER
|
||||
, T1.FPRINTCOUNT
|
||||
, T1.FWIDTH AS FLABELWIDTH
|
||||
, T1.FHEIGHT AS FLABELHEIGHT
|
||||
, T2.FBINDNAME
|
||||
, T2.FXDATA
|
||||
, T2.FYDATA
|
||||
, T2.FHEIGHT AS FBARCODEHEIGHT
|
||||
, T2.FWIDTH AS FBARCODEWIDTH
|
||||
, T2.FROTATION
|
||||
, T2.FNARROW
|
||||
, T2.FWIDE
|
||||
, T2.FTYPE
|
||||
, T2.FXMULTIPLICATION
|
||||
, T2.FYMULTIPLICATION
|
||||
, T2.FMODE
|
||||
FROM dbo.T_BAS_BTPRINTER T1
|
||||
LEFT JOIN dbo.T_BAS_BTPRINTER_ENTRY T2
|
||||
ON T2.FINTERID = T1.FINTERID
|
||||
WHERE T1.FSTATUS=40 AND T1.FDELETED=0 AND T1.FNUMBER='{model.ConfigNumber}' AND T1.FCOMPANYID='{model.OrgId}'";
|
||||
DataTable configDataTable = dbContext.Database.SqlQuery(queryConfigSql);
|
||||
if (configDataTable.Rows.Count <= 0)
|
||||
{
|
||||
throw new O3AppException("未找到对应的蓝牙打印机配置");
|
||||
}
|
||||
|
||||
var configGroups = configDataTable.AsEnumerable().GroupBy(o => new
|
||||
{
|
||||
ConfigName = o["FCONFIGNAME"].ToStringEx(),
|
||||
ConfigNumber = o["FCONFIGNUMBER"].ToStringEx(),
|
||||
PrintCount = o["FPRINTCOUNT"].ToInt(),
|
||||
LabelWidth = o["FLABELWIDTH"].ToDecimal(),
|
||||
LabelHeight = o["FLABELHEIGHT"].ToDecimal()
|
||||
});
|
||||
var configGroup = configGroups.FirstOrDefault();
|
||||
config = new BluetoothPrintConfig
|
||||
{
|
||||
ConfigName = configGroup.Key.ConfigName,
|
||||
ConfigNumber = configGroup.Key.ConfigNumber,
|
||||
LabelWidth = configGroup.Key.LabelWidth,
|
||||
LabelHeight = configGroup.Key.LabelHeight,
|
||||
PrintCount = configGroup.Key.PrintCount
|
||||
};
|
||||
List<IBluetoothPrintConfig> configList = new List<IBluetoothPrintConfig>();
|
||||
foreach (var row in configGroup)
|
||||
{
|
||||
config.ConfigDetails.Add(new BluetoothPrintDetailConfig
|
||||
{
|
||||
ElementType = row["FTYPE"].ToInt(),
|
||||
BindingFieldName = row["FBINDNAME"].ToStringEx(),
|
||||
EncodeMode = row["FMODE"].ToBoolean(),
|
||||
XAxisLeftBeginPosition = row["FXDATA"].ToDecimal(),
|
||||
YAxisTopBeginPosition = row["FYDATA"].ToDecimal(),
|
||||
XAxisMultiplication = row["FXMULTIPLICATION"].ToDecimal(),
|
||||
YAxisMultiplication = row["FYMULTIPLICATION"].ToDecimal(),
|
||||
BarcodeHeight = row["FBARCODEHEIGHT"].ToDecimal(),
|
||||
BarcodeWidth = row["FBARCODEWIDTH"].ToDecimal(),
|
||||
NarrowBarcodeLineHeight = row["FNARROW"].ToDecimal(),
|
||||
NarrowBarcodeLineWidth = row["FWIDE"].ToDecimal(),
|
||||
BarcodeRotationAngle = row["FROTATION"].ToDecimal()
|
||||
});
|
||||
}
|
||||
|
||||
configList.Add(config);
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = configList,
|
||||
Message = "获取蓝牙打印配置成功",
|
||||
StatusCode = 200,
|
||||
Success = true
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return new BaseResponse<object>
|
||||
{
|
||||
Data = null,
|
||||
Message = $"获取蓝牙打印配置失败:{e.Message}",
|
||||
StatusCode = 500,
|
||||
Success = false
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void SetFieldValue(BluetoothPrintElementConfigBase_DT elementConfig, DataRow configRow, DataRow barcodeInfo)
|
||||
{
|
||||
if (configRow["FISDEFAULTVALUE"].ToBoolean())
|
||||
{
|
||||
elementConfig.IsDefaultValue = true;
|
||||
elementConfig.FieldValue = configRow["FFIELDVALUE"].ToStringEx();
|
||||
}
|
||||
else
|
||||
{
|
||||
elementConfig.IsDefaultValue = false;
|
||||
if (!configRow["FBINDINGFIELD"].ToStringEx().IsNullOrEmpty())
|
||||
{
|
||||
elementConfig.FieldValue = barcodeInfo[configRow["FBINDINGFIELD"].ToStringEx()].ToStringEx();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
[Authorize]
|
||||
public class ProductBarcodeCheckController : BaseApiController<ProductBarcodeCheckController>
|
||||
{
|
||||
private readonly IProductBarcodeCheckService productBarcodeCheckService;
|
||||
public ProductBarcodeCheckController(IMapper mapper,
|
||||
ILogger<ProductBarcodeCheckController> logger,
|
||||
IProductBarcodeCheckService productBarcodeCheckService) : base(mapper, logger)
|
||||
{
|
||||
this.productBarcodeCheckService = productBarcodeCheckService;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<bool>> CheckBarcode([FromBody] ProductBarcodeCheckRequest request)
|
||||
{
|
||||
return await TryProcess(input =>
|
||||
{
|
||||
if (input.Inner.IsNullOrWhiteSpace() || input.Outer.IsNullOrWhiteSpace())
|
||||
{
|
||||
throw new O3AppException("内屏条码/外包装条码必录,不能为空");
|
||||
}
|
||||
if (request.Middle.IsNullOrWhiteSpace())
|
||||
{
|
||||
if (!(input.Inner.Equals(input.Outer)))
|
||||
{
|
||||
throw new O3AppException("内屏条码和外包装条码为不同条码!!");
|
||||
}
|
||||
return Task.FromResult(input.Inner.Equals(input.Outer));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(input.Inner.Equals(input.Outer) && input.Inner.Equals(input.Middle) && input.Middle.Equals(input.Outer)))
|
||||
{
|
||||
throw new O3AppException("内屏条码、中包装条码和外包装条码为不同条码!!");
|
||||
}
|
||||
return Task.FromResult(input.Inner.Equals(input.Outer) && input.Inner.Equals(input.Middle) && input.Middle.Equals(input.Outer));
|
||||
}
|
||||
}, request);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<bool>> SubmitSave([FromBody] List<ProductBarcodeCheckRequest> barcodes)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await productBarcodeCheckService.SubmitSave(input);
|
||||
}, barcodes);
|
||||
}
|
||||
}
|
||||
}
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using System.Data;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 在库检验单
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class STKAPPINSPECTController : BaseApiController<STKAPPINSPECTController>
|
||||
{
|
||||
private readonly ISTKAPPINSPECTService service;
|
||||
public STKAPPINSPECTController(IMapper mapper, ILogger<STKAPPINSPECTController> logger, ISTKAPPINSPECTService spotcheckService)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = spotcheckService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取AQL
|
||||
/// </summary>
|
||||
/// <param name="SData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<object>> GetAQL(getAQL SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.GetAQL(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取检验项目
|
||||
/// </summary>
|
||||
/// <param name="SData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<DataTable>> GetTestItems(GetTestItems SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.GetTestItems(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测试值是否合格
|
||||
/// </summary>
|
||||
/// <param name="SData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<Boolean>> ValueIsQualified(ValueIsQualified SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.ValueIsQualified(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取检验单列表
|
||||
/// </summary>
|
||||
/// <param name="SData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<DataTable>> InStockInspectionList(InStockInspectionListRequest SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.InStockInspectionList(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取抽样数量、AC、RE
|
||||
/// </summary>
|
||||
/// <param name="SData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<FSampleQtyACRE>> GetACRE(GetACRE SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.GetACRE(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取基本资料列表
|
||||
/// </summary>
|
||||
/// <param name="SData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<List<GetBDInformation>>> GetBDInformation(GetBDInformationParameter SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.GetBDInformation(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证条码
|
||||
/// </summary>
|
||||
/// <param name="SData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<Boolean>> TestBarcode(TestBarcode SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.TestBarcode(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取检验项目详细信息
|
||||
/// </summary>
|
||||
/// <param name="SData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<List<InspectionItemsDetails>>> InspectionItems(InspectionItems SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.InspectionItems(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检验单提交
|
||||
/// </summary>
|
||||
/// <param name="SData"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<string>> InspectionItemsSubmit([FromBody] InspectionItemsSubmit SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.InspectionItemsSubmit(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 请检单提交
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse> SubmitSTKAPPInspect([FromBody] StkAppInspectSubmitRequest request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
await service.SubmitSTKAPPInspect(input);
|
||||
}, request);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 上传图片
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<string>> UploadTestFile([FromForm] UploadTestFile SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.UploadTestFile(SData);
|
||||
}, SData);
|
||||
}
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Filters;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 外购入库、退料
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class STKInStockController : BaseApiController<STKInStockController>
|
||||
{
|
||||
private readonly ISTKInStockService service;
|
||||
public STKInStockController(IMapper mapper, ILogger<STKInStockController> logger, ISTKInStockService Service)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = Service;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 外购入库信息
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> STKInStockSubmit([FromBody] InputBarCode<BD_BARCODERS1> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.STKInStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 外购退料信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> PURRetStockSubmit([FromBody] InputBarCode<BD_BARCODERS1> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.PURRetStockSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.BaseData.Model;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 库存查询
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class STKInventoryController : BaseApiController<SelBillController>
|
||||
{
|
||||
private readonly ISTKInventoryService service;
|
||||
public STKInventoryController(IMapper mapper, ILogger<SelBillController> logger, ISTKInventoryService Service)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = Service;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<Dictionary<string, object>>> QueryInventory([FromBody] JObject request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.QueryInventory(request);
|
||||
}, request);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 盘点方案
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class STKStockSchemeController : BaseApiController<STKStockSchemeController>
|
||||
{
|
||||
private readonly ISTKStockSchemeService service;
|
||||
public STKStockSchemeController(IMapper mapper, ILogger<STKStockSchemeController> logger, ISTKStockSchemeService STKStockSchemeService)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = STKStockSchemeService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询盘点方案
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<QuerySourceInvPrgReturnDto>> QuerySourceInvPrg(STKStockScheme SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.QuerySourceInvPrg(SData);
|
||||
}, SData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 盘点方案提交
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<string>> SubmitBill([FromBody] Barcode_Inv SData)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.SubmitBill(SData);
|
||||
}, SData);
|
||||
}
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 调拨管理
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class STKTransferController : BaseApiController<STKTransferController>
|
||||
{
|
||||
private readonly ISTKTransferService service;
|
||||
public STKTransferController(IMapper mapper, ILogger<STKTransferController> logger, ISTKTransferService Service)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = Service;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> STKTransferSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.STKTransferSubmit(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Filters;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 委外入库/委外退货
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class SUBInStkPickmtlController : BaseApiController<SelBillController>
|
||||
{
|
||||
private readonly ISUBInStkPickmtlService service;
|
||||
public SUBInStkPickmtlController(IMapper mapper, ILogger<SelBillController> logger, ISUBInStkPickmtlService spotcheckService)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = spotcheckService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 委外入库
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SUBInStkPickmtl([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SUBInStkPickmtl(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 委外退货
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SUBOutStkPickmtl([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SUBOutStkPickmtl(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Filters;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 委外领料/委外退料
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class SUBPICKMTRLController : BaseApiController<SelBillController>
|
||||
{
|
||||
private readonly ISUBPICKMTRLService service;
|
||||
public SUBPICKMTRLController(IMapper mapper, ILogger<SelBillController> logger, ISUBPICKMTRLService SUBPICKMTRLService)
|
||||
: base(mapper, logger)
|
||||
{
|
||||
service = SUBPICKMTRLService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 委外领料
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SUBPICKMTRL([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SUBPICKMTRL(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 委外退料
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SUBRETURNMTRL([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.SUBRETURNMTRL(request);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// WMS基本资料信息
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class SelBillController : BaseApiController<SelBillController>
|
||||
{
|
||||
private readonly ISelBillService service;
|
||||
public SelBillController(IMapper mapper, ILogger<SelBillController> logger, ISelBillService Service)
|
||||
:base(mapper, logger)
|
||||
{
|
||||
service = Service;
|
||||
}
|
||||
/// <summary>
|
||||
/// 查询出入库流程配置
|
||||
/// </summary>
|
||||
/// <param name="fNO"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<List<BOS_SELBILL>>> QuerySelBill(string orgID,string fNO)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
return await service.QuerySelBill(orgID, fNO);
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫描源单编号,查询源单信息
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<List<object>>> QuerySourceBillInfo([FromBody]JObject data)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess= await service.QuerySourceBillInfo(data);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<object> { retMess.Data["data1"], retMess.Data["data2"] };
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫描条码信息,验证条码状态
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> QueryBarCode([FromBody]JObject data)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.QueryBarCode(data);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫描位置信息,查询仓库仓位
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> QueryStockData([FromBody] JObject data)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.QueryStockData(data);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询仓库库存状态
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<object>> QueryStockStatus([FromBody] JObject data)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMess = await service.QueryStockStatus(data);
|
||||
if (retMess == null || retMess.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMess.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMess.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
||||
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Opsoft.NetCore.O3App.WebApi.Filters;
|
||||
using Opsoft.NetCore.O3App.WebApi.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
||||
{
|
||||
/// <summary>
|
||||
/// 简单生产领料,退料,入库
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class SimpleProductionController : BaseApiController<SimpleProductionController>
|
||||
{
|
||||
private readonly ISimpleProductionService _service;
|
||||
|
||||
public SimpleProductionController(IMapper mapper, ILogger<SimpleProductionController> logger, ISimpleProductionService service) : base(mapper, logger)
|
||||
{
|
||||
_service = service;
|
||||
}
|
||||
/// <summary>
|
||||
/// 简单生产领料
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<Dictionary<string, object>>> SimplePickMtrl([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _service.SimplePickMtrlSubmit(request);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data;
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
/// <summary>
|
||||
/// 简单生产退料
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SimpleReturnMtrl([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _service.SimpleReturnMtrlSubmit(request);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
/// <summary>
|
||||
/// 简单生产入库
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SimpleInStock([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _service.SimpleInStockSubmit(request);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 简单生产退库
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Idempotent]
|
||||
public async Task<BaseResponse<object>> SimpleOutStock([FromBody] InputBarCode<BD_BARCODERS2> request)
|
||||
{
|
||||
return await TryProcess(async input =>
|
||||
{
|
||||
RetMessage retMsg = await _service.SimpleOutStockSubmit(request);
|
||||
if (retMsg == null || retMsg.Status == 0)
|
||||
{
|
||||
throw new O3AppException(retMsg.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return retMsg.Data["data"];
|
||||
}
|
||||
}, LoginInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user