出入库调整

This commit is contained in:
2026-01-24 13:47:02 +08:00
parent 3d5ad78fad
commit 1e7d768489
2 changed files with 88 additions and 67 deletions

View File

@@ -1,3 +1,4 @@
using Azure;
using DOAN.Model.Mobile.ReportFlow.Dto;
using DOAN.Service.Mobile.IService;
using Infrastructure.Converter;
@@ -93,21 +94,30 @@ public class ReportFlowController : BaseController
string process_operator
)
{
if (string.IsNullOrEmpty(workorder))
try
{
throw new CustomException("workorder or process is null");
if (string.IsNullOrEmpty(workorder))
{
throw new CustomException("workorder or process is null");
}
return SUCCESS(
_reportFlowService.FeedProcessReportwork(
workorder,
processId,
finish_num,
stove_code,
feed_order,
process_operator
)
);
}
catch (Exception e)
{
return ToResponse(new ApiResult(500, e.Message));
}
return SUCCESS(
_reportFlowService.FeedProcessReportwork(
workorder,
processId,
finish_num,
stove_code,
feed_order,
process_operator
)
);
}
//TODO 工序报工
@@ -123,20 +133,29 @@ public class ReportFlowController : BaseController
[HttpGet("process_reportwork")]
public IActionResult ProcessReportWork([FromQuery] ProReportWorkDto proReportWorkDto)
{
if (string.IsNullOrEmpty(proReportWorkDto.workorder))
try
{
throw new CustomException("workorder or process is null");
if (string.IsNullOrEmpty(proReportWorkDto.workorder))
{
throw new CustomException("workorder or process is null");
}
return SUCCESS(
_reportFlowService.ProcessReportWork(
proReportWorkDto.workorder,
proReportWorkDto.processId,
proReportWorkDto.finish_num,
proReportWorkDto.bad_num,
proReportWorkDto.process_operator
)
);
}
catch (Exception e)
{
return ToResponse(new ApiResult(500, e.Message));
}
return SUCCESS(
_reportFlowService.ProcessReportWork(
proReportWorkDto.workorder,
proReportWorkDto.processId,
proReportWorkDto.finish_num,
proReportWorkDto.bad_num,
proReportWorkDto.process_operator
)
);
}
//TODO 出货工序
@@ -150,44 +169,52 @@ public class ReportFlowController : BaseController
string process_operator
)
{
if (string.IsNullOrEmpty(workorder))
try
{
throw new CustomException("workorder or process is null");
if (string.IsNullOrEmpty(workorder))
{
throw new CustomException("workorder or process is null");
}
int ret = _reportFlowService.ShipmentProcessReportwork(
workorder,
processId,
finish_num,
bad_num,
customer_order,
process_operator
);
string data = "";
if (ret == 0)
{
data = "系统操作失败!";
}
if (ret == 1)
{
data = "成功";
}
if (ret == 2)
{
data = "采购订单不存在,请检查订单号!";
}
if (ret == 3)
{
data = "出货数量超额!";
}
if (ret == 4)
{
data = "工单异常,该工单不存在!";
}
if (ret == 5)
{
data = "采购订单主体型号与工单不符合!";
}
return SUCCESS(data);
}
int ret = _reportFlowService.ShipmentProcessReportwork(
workorder,
processId,
finish_num,
bad_num,
customer_order,
process_operator
);
string data = "";
if (ret == 0)
catch (Exception e)
{
data = "系统操作失败!";
return ToResponse(new ApiResult(500, e.Message));
}
if (ret == 1)
{
data = "成功";
}
if (ret == 2)
{
data = "采购订单不存在,请检查订单号!";
}
if (ret == 3)
{
data = "出货数量超额!";
}
if (ret == 4)
{
data = "工单异常,该工单不存在!";
}
if (ret == 5)
{
data = "采购订单主体型号与工单不符合!";
}
return SUCCESS(data);
}
//TODO 获取工单下的报工列表

View File

@@ -305,11 +305,8 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
}
else
{
if (inboundRecord.Quantity != finish_num)
{
Context.Ado.RollbackTran();
throw new Exception("修改数量前请先撤销已有生产入库记录!");
}
Context.Ado.RollbackTran();
throw new Exception("重新成品入库前请先撤销已有物料生产入库记录!");
}
}
Context.Ado.CommitTran();
@@ -451,11 +448,8 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
}
else
{
if (outboundDto.Quantity != finish_num)
{
Context.Ado.RollbackTran();
throw new Exception("修改数量前请先撤销出货出库记录");
}
Context.Ado.RollbackTran();
throw new Exception("重新出货前请先撤销物料出货出库记录");
}
// 修改工单信息