|
@@ -8,9 +8,11 @@ using Business.MongoModel.Production;
|
|
|
using Business.MongoModel.SRM;
|
|
using Business.MongoModel.SRM;
|
|
|
using Business.MongoModel.Tech;
|
|
using Business.MongoModel.Tech;
|
|
|
using Business.ResourceExamineManagement.Dto;
|
|
using Business.ResourceExamineManagement.Dto;
|
|
|
|
|
+using MongoDB.Driver.Linq;
|
|
|
using System;
|
|
using System;
|
|
|
using System.Collections;
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
|
+using System.Globalization;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
using Volo.Abp.Application.Services;
|
|
using Volo.Abp.Application.Services;
|
|
|
using static Spire.Pdf.General.Render.Decode.Jpeg2000.j2k.codestream.HeaderInfo;
|
|
using static Spire.Pdf.General.Render.Decode.Jpeg2000.j2k.codestream.HeaderInfo;
|
|
@@ -362,12 +364,13 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
{
|
|
|
if (!string.IsNullOrEmpty(mes_Morders.bom_number))
|
|
if (!string.IsNullOrEmpty(mes_Morders.bom_number))
|
|
|
{
|
|
{
|
|
|
|
|
+ mes_Morders.moentry_sys_stime = childList.Max(s => s.kitting_time.GetValueOrDefault()).AddDays(1).Date;//数据齐套完成后隔天开始生产;
|
|
|
//var ProductiveDate = ProductiveExamine(mes_Morders.bom_number, level1Dto.version, (int)mes_Morders.morder_production_number.Value);
|
|
//var ProductiveDate = ProductiveExamine(mes_Morders.bom_number, level1Dto.version, (int)mes_Morders.morder_production_number.Value);
|
|
|
ProdExamineParamDto prodExamine = new ProdExamineParamDto()
|
|
ProdExamineParamDto prodExamine = new ProdExamineParamDto()
|
|
|
{
|
|
{
|
|
|
- bom_number = mes_Morders.bom_number,
|
|
|
|
|
- version = level1Dto.version,
|
|
|
|
|
- packages = (int)mes_Morders.morder_production_number.Value
|
|
|
|
|
|
|
+ ItemNum = mes_Morders.bom_number,
|
|
|
|
|
+ PlanStart = mes_Morders.moentry_sys_stime.Value,
|
|
|
|
|
+ QtyOrd = (int)mes_Morders.morder_production_number.Value
|
|
|
};
|
|
};
|
|
|
_productExamineAppService.prodLines = prodLines;
|
|
_productExamineAppService.prodLines = prodLines;
|
|
|
_productExamineAppService.routingOps = routingOps;
|
|
_productExamineAppService.routingOps = routingOps;
|
|
@@ -378,23 +381,25 @@ namespace Business.ResourceExamineManagement
|
|
|
|
|
|
|
|
var plan = planList.Find(x => x.icitem_id == level1Dto.item_id);
|
|
var plan = planList.Find(x => x.icitem_id == level1Dto.item_id);
|
|
|
var ProductiveDate = _productExamineAppService.ProductiveExamine(prodExamine);
|
|
var ProductiveDate = _productExamineAppService.ProductiveExamine(prodExamine);
|
|
|
- var Day = ProductiveDate / (60 * 10); //返回的分钟除以十个小时得出工作天数;
|
|
|
|
|
- mes_Morders.moentry_sys_stime = childList.Max(s => s.kitting_time.GetValueOrDefault()).AddDays(1);//数据齐套完成后隔天开始生产;
|
|
|
|
|
|
|
+ //var Day = ProductiveDate / (60 * 10); //返回的分钟除以十个小时得出工作天数;
|
|
|
|
|
+
|
|
|
//结束日期=开始时间+生产时长+自检提前期+入库提前期+发运提前期;
|
|
//结束日期=开始时间+生产时长+自检提前期+入库提前期+发运提前期;
|
|
|
- var LeadTime = 0.00m;
|
|
|
|
|
|
|
+ DateTime LeadTime;
|
|
|
if (plan != null)
|
|
if (plan != null)
|
|
|
{
|
|
{
|
|
|
- LeadTime = Day + plan.self_inspection_date.GetValueOrDefault() + plan.Warehousing_date.GetValueOrDefault();
|
|
|
|
|
|
|
+ var TQdate = plan.self_inspection_date.GetValueOrDefault() + plan.Warehousing_date.GetValueOrDefault();
|
|
|
|
|
+ LeadTime = ProductiveDate.AddDays((double)TQdate);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- LeadTime = Day;
|
|
|
|
|
|
|
+ LeadTime = ProductiveDate;
|
|
|
}
|
|
}
|
|
|
- ProductionTimeDay = LeadTime;
|
|
|
|
|
- mes_Morders.moentry_sys_etime = mes_Morders.moentry_sys_stime.Value.AddDays((double)Day);
|
|
|
|
|
- mes_Morders.morder_need_time = ProductiveDate;
|
|
|
|
|
|
|
+ //ProductionTimeDay = LeadTime;
|
|
|
|
|
+ mes_Morders.moentry_sys_etime = LeadTime;
|
|
|
|
|
+ mes_Morders.morder_need_time = Convert.ToInt32(DateTime.ParseExact(ProductiveDate.ToString("yyyyMMddHHmmss"), "yyyyMMddHHmmss", CultureInfo.CurrentCulture) -
|
|
|
|
|
+ DateTime.ParseExact(mes_Morders.moentry_sys_stime.Value.ToString("yyyyMMddHHmmss"), "yyyyMMddHHmmss", CultureInfo.CurrentCulture));
|
|
|
//满足资源检查的时间需加上提前期
|
|
//满足资源检查的时间需加上提前期
|
|
|
- level1Dto.satisfy_time = mes_Morders.moentry_sys_stime.Value.AddDays((double)LeadTime);
|
|
|
|
|
|
|
+ level1Dto.satisfy_time = LeadTime;
|
|
|
if (sentrys != null)
|
|
if (sentrys != null)
|
|
|
{
|
|
{
|
|
|
sentrys.sys_capacity_date = level1Dto.satisfy_time;
|
|
sentrys.sys_capacity_date = level1Dto.satisfy_time;
|