|
|
@@ -294,7 +294,8 @@ namespace Business.ResourceExamineManagement
|
|
|
CalcBomViewAppService calcbomviewAppService,
|
|
|
PurchaseOrderAppService purchaseOrderAppService,
|
|
|
ICurrentTenant currentTenant,
|
|
|
- MorderAppService morderAppService
|
|
|
+ MorderAppService morderAppService,
|
|
|
+ BusinessBangDbContext businessBangDbContext
|
|
|
)
|
|
|
{
|
|
|
_mes_technique = mes_technique;
|
|
|
@@ -350,6 +351,7 @@ namespace Business.ResourceExamineManagement
|
|
|
_purchaseOrderAppService = purchaseOrderAppService;
|
|
|
_currentTenant = currentTenant;
|
|
|
_morderAppService = morderAppService;
|
|
|
+ _businessBangDbContext = businessBangDbContext;
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
@@ -1281,32 +1283,49 @@ namespace Business.ResourceExamineManagement
|
|
|
//检查结果写入数据库
|
|
|
List<b_order_examine_result> examineList = new List<b_order_examine_result>();
|
|
|
List<b_order_detail> orderDetails = new List<b_order_detail>();
|
|
|
+ List<b_day_bulletin_board> daybulletinboards = new List<b_day_bulletin_board>();
|
|
|
|
|
|
foreach (var ex in rtn.KittingCheckResultList)
|
|
|
{
|
|
|
var examine = ObjectMapper.Map<OrderResourceDto, b_order_examine_result>(ex);
|
|
|
- examine.GenerateNewId();
|
|
|
+ examine.GenerateNewId(help.NextId());
|
|
|
examine.create_time = DateTime.Now;
|
|
|
examine.tenant_id = param.tenantId;
|
|
|
examine.factory_id = param.factoryId;
|
|
|
+ examine.create_time = DateTime.Now;
|
|
|
examineList.Add(examine);
|
|
|
|
|
|
ex.order_item_list.ForEach(s => {
|
|
|
var detail = ObjectMapper.Map<OrderItemDto, b_order_detail>(s);
|
|
|
- detail.GenerateNewId();
|
|
|
+ detail.GenerateNewId(help.NextId());
|
|
|
detail.order_examine_id = examine.Id;
|
|
|
detail.tenant_id = param.tenantId;
|
|
|
detail.factory_id = param.factoryId;
|
|
|
+ detail.create_time = DateTime.Now;
|
|
|
orderDetails.Add(detail);
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ foreach (var item in rtn.DayBulletinBoardList)
|
|
|
+ {
|
|
|
+ var detail = ObjectMapper.Map<DayBulletinBoard, b_day_bulletin_board>(item);
|
|
|
+ detail.GenerateNewId(help.NextId());
|
|
|
+ detail.create_time = DateTime.Now.Date;
|
|
|
+ detail.tenant_id = param.tenantId;
|
|
|
+ detail.factory_id = param.factoryId;
|
|
|
+ daybulletinboards.Add(detail);
|
|
|
+ }
|
|
|
if (examineList.Any())
|
|
|
{
|
|
|
- await _businessBangDbContext.b_order_examine_result.BulkInsertAsync(examineList,options=>options.AutoMapOutputDirection = false);
|
|
|
+ await _businessBangDbContext.b_order_examine_result.BulkInsertAsync(examineList, options => options.InsertKeepIdentity = true);
|
|
|
}
|
|
|
if (orderDetails.Any())
|
|
|
{
|
|
|
- await _businessBangDbContext.b_order_detail.BulkInsertAsync(orderDetails, options => options.AutoMapOutputDirection = false);
|
|
|
+ await _businessBangDbContext.b_order_detail.BulkInsertAsync(orderDetails, options=> options.InsertKeepIdentity = true);
|
|
|
+ }
|
|
|
+ if (daybulletinboards.Any())
|
|
|
+ {
|
|
|
+ //await _businessBangDbContext.b_day_bulletin_board.BulkInsertAsync(daybulletinboards, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
|
|
|
return JsonConvert.SerializeObject(rtn);
|