|
|
@@ -0,0 +1,281 @@
|
|
|
+using Microsoft.EntityFrameworkCore;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Linq.Dynamic.Core;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using Volo.Abp.Application.Dtos;
|
|
|
+using Volo.Abp.Domain.Repositories;
|
|
|
+using Business.Models;
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
+using Business.Permissions;
|
|
|
+using XCZ;
|
|
|
+using Business.ResourceExamineManagement.Dto;
|
|
|
+using Bussiness.Model.MES.IC;
|
|
|
+using AutoMapper.Internal.Mappers;
|
|
|
+using Bussiness.Model.Tech;
|
|
|
+using Bussiness.Model.Production;
|
|
|
+using Business.Core.MongoDBHelper;
|
|
|
+using Business.Core.Utilities;
|
|
|
+using Hangfire.Storage.Monitoring;
|
|
|
+using Business.BookManagement.Dto;
|
|
|
+using Volo.Abp.ObjectMapping;
|
|
|
+using Volo.Abp.Application.Services;
|
|
|
+using ZstdSharp.Unsafe;
|
|
|
+using System.Transactions;
|
|
|
+using NUglify.JavaScript.Syntax;
|
|
|
+using System.Linq.Expressions;
|
|
|
+using XCZ.Extensions;
|
|
|
+using System.ComponentModel;
|
|
|
+using System.Reflection.Emit;
|
|
|
+using NUglify.Helpers;
|
|
|
+using Microsoft.AspNetCore.SignalR.Protocol;
|
|
|
+using System.ComponentModel.Design;
|
|
|
+using Volo.Abp.Validation.StringValues;
|
|
|
+using System.Runtime.CompilerServices;
|
|
|
+using MongoDB.Driver;
|
|
|
+using Volo.Abp.Validation.Localization;
|
|
|
+using Hangfire.Annotations;
|
|
|
+using System.Globalization;
|
|
|
+using MongoDB.Driver.Linq;
|
|
|
+using Bussiness.Model.SRM;
|
|
|
+using System.ComponentModel.DataAnnotations;
|
|
|
+using Bussiness.Model.Sale;
|
|
|
+using Amazon.Runtime.Internal.Transform;
|
|
|
+using System.IO.Compression;
|
|
|
+using System.Collections;
|
|
|
+using System.Data.SqlTypes;
|
|
|
+
|
|
|
+namespace Business.ScheduleTaskManagement
|
|
|
+{
|
|
|
+ /// <summary>
|
|
|
+ /// 资源检查
|
|
|
+ /// </summary>
|
|
|
+ public class ScheduleTaskAppService : ApplicationService, IScheduleTaskAppService
|
|
|
+ {
|
|
|
+ #region 服务
|
|
|
+ /// <summary>
|
|
|
+ /// 工艺路径
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_technique> _mes_technique;
|
|
|
+ private IRepository<mes_technique, long> _mysql_mes_technique;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工序
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_process> _mes_process;
|
|
|
+ private IRepository<mes_process, long> _mysql_mes_process;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工艺关联工序
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_tech_process> _mes_tech_process;
|
|
|
+ private IRepository<mes_tech_process, long> _mysql_mes_tech_process;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工作日历
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_work_calendar> _mes_work_calendar;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工作日历明细
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_work_calendar_list> _mes_work_calendar_list;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工艺工序关联工位
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_tech_proc_workshop> _mes_tech_proc_workshop;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 排程占用记录
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_schedule_occupy> _mes_schedule_occupy;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 物料占用记录
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_item_stockoccupy> _ic_item_stockoccupy;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 物料详情
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_item> _ic_item;
|
|
|
+ private IRepository<ic_item, long> _mysql_ic_item;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 物料BOM
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_bom> _ic_bom;
|
|
|
+ private IRepository<ic_bom, long> _mysql_ic_bom;
|
|
|
+ /// <summary>
|
|
|
+ /// 物料BOM明细
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_bom_child> _ic_bom_child;
|
|
|
+ private IRepository<ic_bom_child, long> _mysql_ic_bom_child;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 物料库存表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_item_stock> _ic_item_stock;
|
|
|
+ private IRepository<ic_item_stock, long> _mysql_ic_item_stock;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 物料工厂明细表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_factory_details> _ic_factory_details;
|
|
|
+ private IRepository<ic_factory_details, long> _mysql_ic_factory_details;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 采购申请单
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<srm_pr_main> _srm_pr_main;
|
|
|
+ private IRepository<srm_pr_main, long> _mysql_srm_pr_main;
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 委外工单
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_oorder> _mes_oorder;
|
|
|
+ private IRepository<mes_oorder, long> _mysql_mes_oorder;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 物料质检表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_check> _ic_check;
|
|
|
+ /// <summary>
|
|
|
+ /// 替代群组
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_substitute> _ic_substitute;
|
|
|
+ /// <summary>
|
|
|
+ /// 替代群组
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_substitute_all> _ic_substitute_all;
|
|
|
+ /// <summary>
|
|
|
+ /// 替代群组
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_substitute_all_dtl> _ic_substitute_all_dtl;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 生产工单主表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_morder> _mes_morder;
|
|
|
+ /// <summary>
|
|
|
+ /// 生产工单子表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_moentry> _mes_moentry;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 在制工单占用记录表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<mes_mooccupy> _mes_mooccupy;
|
|
|
+ /// <summary>
|
|
|
+ /// mysql在制工单占用表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IRepository<mes_mooccupy, long> _mysql_mes_mooccupy;
|
|
|
+ /// <summary>
|
|
|
+ /// 销售工单
|
|
|
+ /// </summary>
|
|
|
+ private readonly IRepository<crm_seorder, long> _mysql_crm_seorder;
|
|
|
+ /// <summary>
|
|
|
+ /// 销售工单
|
|
|
+ /// </summary>
|
|
|
+ private readonly IRepository<crm_seorderentry, long> _mysql_crm_seorderentry;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 生产工单主表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IRepository<mes_morder, long> _mysql_mes_morder;
|
|
|
+ /// <summary>
|
|
|
+ /// 生产工单子表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IRepository<mes_moentry, long> _mysql_mes_moentry;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 构造函数
|
|
|
+ /// </summary>
|
|
|
+ public ScheduleTaskAppService(
|
|
|
+ IMongoDB<mes_technique> mes_technique,
|
|
|
+ IMongoDB<mes_process> mes_process,
|
|
|
+ IMongoDB<mes_tech_process> mes_tech_process,
|
|
|
+ IMongoDB<mes_tech_proc_workshop> mes_tech_proc_workshop,
|
|
|
+ IMongoDB<ic_item> ic_item,
|
|
|
+ IMongoDB<ic_bom> ic_bom,
|
|
|
+ IMongoDB<ic_bom_child> ic_bom_child,
|
|
|
+ IMongoDB<ic_item_stock> ic_item_stock,
|
|
|
+ IMongoDB<ic_check> ic_check,
|
|
|
+ IMongoDB<ic_factory_details> ic_factory_details,
|
|
|
+ IMongoDB<mes_oorder> mes_oorder,
|
|
|
+ IMongoDB<srm_pr_main> srm_pr_main,
|
|
|
+ //IMongoDB<ic_substitute> ic_substitute,
|
|
|
+ //IMongoDB<ic_substitute_all> ic_substitute_all,
|
|
|
+ //IMongoDB<ic_substitute_all_dtl> ic_substitute_all_dtl,
|
|
|
+ IMongoDB<mes_morder> mes_morder,
|
|
|
+ IMongoDB<mes_moentry> mes_moentry,
|
|
|
+ IMongoDB<mes_mooccupy> mes_mooccupy,
|
|
|
+ IMongoDB<ic_item_stockoccupy> ic_item_stockoccupy,
|
|
|
+ IRepository<ic_item, long> mysql_ic_item,
|
|
|
+ IRepository<ic_bom, long> mysql_ic_bom,
|
|
|
+ IRepository<ic_bom_child, long> mysql_ic_bom_child,
|
|
|
+ IRepository<mes_technique, long> mysql_mes_technique,
|
|
|
+ IRepository<crm_seorder, long> mysql_crm_seorder,
|
|
|
+ IRepository<crm_seorderentry, long> mysql_crm_seorderentry,
|
|
|
+ IRepository<ic_item_stock, long> mysql_ic_item_stock,
|
|
|
+ IRepository<ic_factory_details, long> mysql_ic_factory_details,
|
|
|
+ IRepository<mes_oorder, long> mysql_mes_oorder,
|
|
|
+ IRepository<srm_pr_main, long> mysql_srm_pr_main,
|
|
|
+ IRepository<mes_mooccupy, long> mysql_mes_mooccupy,
|
|
|
+ IRepository<mes_morder, long> mysql_mes_morder,
|
|
|
+ IRepository<mes_moentry, long> mysql_mes_moentry,
|
|
|
+ IRepository<mes_process, long> mysql_mes_process,
|
|
|
+ IRepository<mes_tech_process, long> mysql_mes_tech_process
|
|
|
+ )
|
|
|
+ {
|
|
|
+ _mes_technique = mes_technique;
|
|
|
+ _mes_process = mes_process;
|
|
|
+ _mes_tech_process = mes_tech_process;
|
|
|
+ _mes_tech_proc_workshop = mes_tech_proc_workshop;
|
|
|
+ _ic_item = ic_item;
|
|
|
+ _ic_bom = ic_bom;
|
|
|
+ _ic_bom_child = ic_bom_child;
|
|
|
+ _ic_item_stock = ic_item_stock;
|
|
|
+ _ic_check = ic_check;
|
|
|
+ _ic_factory_details = ic_factory_details;
|
|
|
+ _mes_oorder = mes_oorder;
|
|
|
+ _srm_pr_main = srm_pr_main;
|
|
|
+ //_ic_substitute = ic_substitute;
|
|
|
+ //_ic_substitute_all = ic_substitute_all;
|
|
|
+ //_ic_substitute_all_dtl = ic_substitute_all_dtl;
|
|
|
+ _mes_morder = mes_morder;
|
|
|
+ _mes_moentry = mes_moentry;
|
|
|
+ _mes_mooccupy = mes_mooccupy;
|
|
|
+ _ic_item_stockoccupy = ic_item_stockoccupy;
|
|
|
+ _mysql_ic_item = mysql_ic_item;
|
|
|
+ _mysql_ic_bom = mysql_ic_bom;
|
|
|
+ _mysql_ic_bom_child = mysql_ic_bom_child;
|
|
|
+ _mysql_crm_seorder = mysql_crm_seorder;
|
|
|
+ _mysql_crm_seorderentry = mysql_crm_seorderentry;
|
|
|
+ _mysql_mes_technique = mysql_mes_technique;
|
|
|
+ _mysql_ic_item_stock = mysql_ic_item_stock;
|
|
|
+ _mysql_ic_factory_details = mysql_ic_factory_details;
|
|
|
+ _mysql_mes_oorder = mysql_mes_oorder;
|
|
|
+ _mysql_srm_pr_main = mysql_srm_pr_main;
|
|
|
+ _mysql_mes_mooccupy = mysql_mes_mooccupy;
|
|
|
+ _mysql_mes_morder = mysql_mes_morder;
|
|
|
+ _mysql_mes_moentry = mysql_mes_moentry;
|
|
|
+ _mysql_mes_process = mysql_mes_process;
|
|
|
+ _mysql_mes_tech_process = mysql_mes_tech_process;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 同步基础数据到mongodb
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ /// <exception cref="NotImplementedException"></exception>
|
|
|
+ public async Task SyncBaseDataToMongoDB()
|
|
|
+ {
|
|
|
+ throw new NotImplementedException();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|