refactor(入库服务): 优化入库单创建逻辑和工单号解析
- 修改ProFinishedProductReceiptService的插入逻辑,简化返回值处理 - 在QcBackEndService和QcGp12Service中增加工单号解析功能 - 统一入库单标签生成格式,包含更完整的信息
This commit is contained in:
@@ -66,26 +66,19 @@ namespace ZR.Service.Business
|
||||
try
|
||||
{
|
||||
model.CreatedTime = DateTime.Now;
|
||||
var insertedModel = Context.Insertable(model).ExecuteReturnEntity();
|
||||
|
||||
if (insertedModel != null && !string.IsNullOrEmpty(insertedModel.ReceiptNo))
|
||||
int result = Context.Insertable(model).ExecuteCommand();
|
||||
_receiptLogService.AddProFinishedProductReceiptLog(
|
||||
new ProFinishedProductReceiptLog
|
||||
{
|
||||
_receiptLogService.AddProFinishedProductReceiptLog(
|
||||
new ProFinishedProductReceiptLog
|
||||
{
|
||||
ReceiptNo = model.ReceiptNo,
|
||||
OperatedBy = "",
|
||||
OperatedTime = DateTime.Now,
|
||||
OperationType = "CREATE",
|
||||
OperationContent = "入库单创建成功",
|
||||
OperationResult = "SUCCESS",
|
||||
Remark = ""
|
||||
});
|
||||
return insertedModel;
|
||||
} else
|
||||
{
|
||||
throw new Exception("入库单插入失败");
|
||||
}
|
||||
ReceiptNo = model.ReceiptNo,
|
||||
OperatedBy = "系统",
|
||||
OperatedTime = DateTime.Now,
|
||||
OperationType = "CREATE",
|
||||
OperationContent = result > 0 ? "入库单创建成功": "入库单创建失败",
|
||||
OperationResult = result > 0 ? "SUCCESS": "FAIL",
|
||||
Remark = ""
|
||||
});
|
||||
return model;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user