|
|
@@ -29,6 +29,7 @@ using Volo.Abp.Domain.Repositories;
|
|
|
using Volo.Abp.MultiTenancy;
|
|
|
using Volo.Abp.ObjectMapping;
|
|
|
using ZstdSharp.Unsafe;
|
|
|
+using static Spire.Pdf.General.Render.Decode.Jpeg2000.j2k.codestream.HeaderInfo;
|
|
|
|
|
|
namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
@@ -1279,16 +1280,28 @@ namespace Business.ResourceExamineManagement
|
|
|
var result = await OrderKittingCheck(input);
|
|
|
OrderResourceViewDto rtn = DataPackage(result);
|
|
|
rtn.DayBulletinBoardList = rtn.DayBulletinBoardList.OrderByDescending(d => d.day).ToList();
|
|
|
+ //保存检查结果
|
|
|
+ SaveExamineResult(rtn.KittingCheckResultList, rtn.DayBulletinBoardList, 1);
|
|
|
+ return JsonConvert.SerializeObject(rtn);
|
|
|
+ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 工单齐套检查/替代料齐套检查结果保存
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="KittingCheckResultList"></param>
|
|
|
+ /// <param name="DayBulletinBoardList"></param>
|
|
|
+ public async void SaveExamineResult(List<OrderResourceDto> KittingCheckResultList, List<DayBulletinBoard> DayBulletinBoardList,int type)
|
|
|
+ {
|
|
|
//检查结果写入数据库
|
|
|
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)
|
|
|
+ foreach (var ex in KittingCheckResultList)
|
|
|
{
|
|
|
var examine = ObjectMapper.Map<OrderResourceDto, b_order_examine_result>(ex);
|
|
|
examine.GenerateNewId(help.NextId());
|
|
|
+ examine.type = type;
|
|
|
examine.create_time = DateTime.Now;
|
|
|
examine.tenant_id = param.tenantId;
|
|
|
examine.factory_id = param.factoryId;
|
|
|
@@ -1306,10 +1319,11 @@ namespace Business.ResourceExamineManagement
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- foreach (var item in rtn.DayBulletinBoardList)
|
|
|
+ foreach (var item in DayBulletinBoardList)
|
|
|
{
|
|
|
var detail = ObjectMapper.Map<DayBulletinBoard, b_day_bulletin_board>(item);
|
|
|
detail.GenerateNewId(help.NextId());
|
|
|
+ detail.type = type;
|
|
|
detail.create_time = DateTime.Now.Date;
|
|
|
detail.tenant_id = param.tenantId;
|
|
|
detail.factory_id = param.factoryId;
|
|
|
@@ -1321,14 +1335,12 @@ namespace Business.ResourceExamineManagement
|
|
|
}
|
|
|
if (orderDetails.Any())
|
|
|
{
|
|
|
- await _businessBangDbContext.b_order_detail.BulkInsertAsync(orderDetails, options=> options.InsertKeepIdentity = true);
|
|
|
+ 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);
|
|
|
+ await _businessBangDbContext.b_day_bulletin_board.BulkInsertAsync(daybulletinboards, options => options.InsertKeepIdentity = true);
|
|
|
}
|
|
|
-
|
|
|
- return JsonConvert.SerializeObject(rtn);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -1341,6 +1353,8 @@ namespace Business.ResourceExamineManagement
|
|
|
var result = await OrderKittingCheck(input);
|
|
|
OrderResourceViewDto rtn = DataPackage(result, true);
|
|
|
rtn.DayBulletinBoardList = rtn.DayBulletinBoardList.OrderByDescending(d => d.day).ToList();
|
|
|
+ //保存检查结果
|
|
|
+ SaveExamineResult(rtn.KittingCheckResultList, rtn.DayBulletinBoardList, 2);
|
|
|
return JsonConvert.SerializeObject(rtn);
|
|
|
}
|
|
|
|