|
@@ -2,6 +2,7 @@ using Business.Core.Enum;
|
|
|
using Business.Core.MongoDBHelper;
|
|
using Business.Core.MongoDBHelper;
|
|
|
using Business.Core.Utilities;
|
|
using Business.Core.Utilities;
|
|
|
using Business.ResourceExamineManagement.Dto;
|
|
using Business.ResourceExamineManagement.Dto;
|
|
|
|
|
+using Bussiness.Model.Bang;
|
|
|
using Bussiness.Model.MES.IC;
|
|
using Bussiness.Model.MES.IC;
|
|
|
using Bussiness.Model.Production;
|
|
using Bussiness.Model.Production;
|
|
|
using Bussiness.Model.Sale;
|
|
using Bussiness.Model.Sale;
|
|
@@ -25,6 +26,7 @@ using Volo.Abp.Application.Services;
|
|
|
using Volo.Abp.DependencyInjection;
|
|
using Volo.Abp.DependencyInjection;
|
|
|
using Volo.Abp.Domain.Repositories;
|
|
using Volo.Abp.Domain.Repositories;
|
|
|
using Volo.Abp.MultiTenancy;
|
|
using Volo.Abp.MultiTenancy;
|
|
|
|
|
+using Volo.Abp.ObjectMapping;
|
|
|
|
|
|
|
|
namespace Business.ResourceExamineManagement
|
|
namespace Business.ResourceExamineManagement
|
|
|
{
|
|
{
|
|
@@ -475,7 +477,9 @@ namespace Business.ResourceExamineManagement
|
|
|
//工单资源检查信息
|
|
//工单资源检查信息
|
|
|
dtl = new ExamineResult();
|
|
dtl = new ExamineResult();
|
|
|
dtl.sorderid = rtn.sorderid;
|
|
dtl.sorderid = rtn.sorderid;
|
|
|
|
|
+ dtl.bill_no = sorder.bill_no;
|
|
|
dtl.sentry_id = item.Id;
|
|
dtl.sentry_id = item.Id;
|
|
|
|
|
+ dtl.entry_seq = item.entry_seq;
|
|
|
//TODO:最早开始时间默认3天后(后期调整)
|
|
//TODO:最早开始时间默认3天后(后期调整)
|
|
|
dtl.earliest_times = DateTime.Now.Date.AddDays(3);
|
|
dtl.earliest_times = DateTime.Now.Date.AddDays(3);
|
|
|
|
|
|
|
@@ -538,10 +542,87 @@ namespace Business.ResourceExamineManagement
|
|
|
await _srm_pr_main.InsertMany(prlist);
|
|
await _srm_pr_main.InsertMany(prlist);
|
|
|
rtn.srm_pr_list = _CalcBomViewAppService.SRMPRDtoList;
|
|
rtn.srm_pr_list = _CalcBomViewAppService.SRMPRDtoList;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
rtn.examines = examines;
|
|
rtn.examines = examines;
|
|
|
rtn.item_stockoccupy_list = sklist;
|
|
rtn.item_stockoccupy_list = sklist;
|
|
|
|
|
|
|
|
|
|
+ //检查结果写入数据库
|
|
|
|
|
+ var b_Examine_Results = ObjectMapper.Map<List<ExamineResult>, List<b_examine_result>>(rtn.examines);
|
|
|
|
|
+ List<b_examine_result> examineList = new List<b_examine_result>();
|
|
|
|
|
+ List<b_bom_child_examine> bomExamineList = new List<b_bom_child_examine>();
|
|
|
|
|
+ List<b_mo_occupy> mooccupyList = new List<b_mo_occupy>();
|
|
|
|
|
+ List<b_mo_order> moorderList = new List<b_mo_order>();
|
|
|
|
|
+ List<b_ooder> ooderList = new List<b_ooder>();
|
|
|
|
|
+ List<b_purchase> purchaseList = new List<b_purchase>();
|
|
|
|
|
+ List<b_purchase_occupy> purchaseoccupyList = new List<b_purchase_occupy>();
|
|
|
|
|
+
|
|
|
|
|
+ foreach (var ex in rtn.examines)
|
|
|
|
|
+ {
|
|
|
|
|
+ var b_ex = ObjectMapper.Map<ExamineResult, b_examine_result>(ex);
|
|
|
|
|
+ examineList.Add(b_ex);
|
|
|
|
|
+ ex.BomChildExamineList.ForEach(s => {
|
|
|
|
|
+ var bc_ex = ObjectMapper.Map<BomChildExamineDto, b_bom_child_examine>(s);
|
|
|
|
|
+ b_ex.GenerateNewId();// = help.NextId();
|
|
|
|
|
+ bc_ex.examine_id = b_ex.Id;
|
|
|
|
|
+ bomExamineList.Add(bc_ex);
|
|
|
|
|
+
|
|
|
|
|
+ if(s.mo_occupy_list != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ var olist = ObjectMapper.Map<List<mo_occupy>, List<b_mo_occupy>>(s.mo_occupy_list);
|
|
|
|
|
+ olist.ForEach(o => { o.bom_child_examine_id = bc_ex.Id; });
|
|
|
|
|
+ mooccupyList.AddRange(olist);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (s.make_list != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ var mlist = ObjectMapper.Map<List<moorder>, List<b_mo_order>>(s.make_list);
|
|
|
|
|
+ mlist.ForEach(o => { o.bom_child_examine_id = bc_ex.Id; });
|
|
|
|
|
+ moorderList.AddRange(mlist);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (s.subcontracting_list != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ var slist = ObjectMapper.Map<List<ooder>, List<b_ooder>>(s.subcontracting_list);
|
|
|
|
|
+ slist.ForEach(o => { o.bom_child_examine_id = bc_ex.Id; });
|
|
|
|
|
+ ooderList.AddRange(slist);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (s.purchase_list != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ var plist = ObjectMapper.Map<List<purchase>, List<b_purchase>>(s.purchase_list);
|
|
|
|
|
+ plist.ForEach(o => { o.bom_child_examine_id = bc_ex.Id; });
|
|
|
|
|
+ purchaseList.AddRange(plist);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (s.purchase_occupy_list != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ var purlist = ObjectMapper.Map<List<purchase_occupy>, List<b_purchase_occupy>>(s.purchase_occupy_list);
|
|
|
|
|
+ purlist.ForEach(o => { o.bom_child_examine_id = bc_ex.Id; });
|
|
|
|
|
+ purchaseoccupyList.AddRange(purlist);
|
|
|
|
|
+ }
|
|
|
|
|
+ /*s.mo_occupy_list.ForEach(o => {
|
|
|
|
|
+ var occupy = ObjectMapper.Map<mo_occupy, b_mo_occupy>(o);
|
|
|
|
|
+ occupy.bom_child_examine_id = bc_ex.Id;
|
|
|
|
|
+ mooccupyList.Add(occupy);
|
|
|
|
|
+ });
|
|
|
|
|
+ s.make_list.ForEach(m => {
|
|
|
|
|
+ var order = ObjectMapper.Map<moorder, b_mo_order>(m);
|
|
|
|
|
+ order.bom_child_examine_id = bc_ex.Id;
|
|
|
|
|
+ moorderList.Add(order);
|
|
|
|
|
+ });
|
|
|
|
|
+ s.subcontracting_list.ForEach(sub => {
|
|
|
|
|
+ var oo = ObjectMapper.Map<ooder, b_ooder>(sub);
|
|
|
|
|
+ oo.bom_child_examine_id = bc_ex.Id;
|
|
|
|
|
+ ooderList.Add(oo);
|
|
|
|
|
+ });
|
|
|
|
|
+ s.purchase_list.ForEach(p => {
|
|
|
|
|
+ var pur = ObjectMapper.Map<purchase, b_purchase>(p);
|
|
|
|
|
+ pur.bom_child_examine_id = bc_ex.Id;
|
|
|
|
|
+ purchaseList.Add(pur);
|
|
|
|
|
+ });
|
|
|
|
|
+ s.purchase_occupy_list.ForEach(n => {
|
|
|
|
|
+ var pur_occupy = ObjectMapper.Map<purchase_occupy, b_purchase_occupy>(n);
|
|
|
|
|
+ pur_occupy.bom_child_examine_id = bc_ex.Id;
|
|
|
|
|
+ purchaseoccupyList.Add(pur_occupy);
|
|
|
|
|
+ });*/
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//清空快照数据
|
|
//清空快照数据
|
|
|
await ClearSnapShot(bangid);
|
|
await ClearSnapShot(bangid);
|
|
|
return JsonConvert.SerializeObject(rtn);
|
|
return JsonConvert.SerializeObject(rtn);
|