去除引用common.props
This commit is contained in:
@@ -1,18 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Reactive.Joins;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aop.Api.Domain;
|
||||
using Aspose.Cells.Drawing;
|
||||
using Aspose.Words;
|
||||
using DingTalk.Api.Request;
|
||||
using System.Dynamic;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
@@ -21,9 +9,7 @@ using JNPF.Logging;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using StackExchange.Profiling.Internal;
|
||||
using Tnb.BasicData;
|
||||
@@ -65,13 +51,13 @@ namespace Tnb.EquipMgr
|
||||
var planMoldRelations = await _db.Queryable<ToolMoldMaintainPlanRelation>()
|
||||
.LeftJoin<ToolMoldMaintainPlan>((a, b) => a.maintain_plan_id == b.id)//ToolMoldMaintainPlan
|
||||
.LeftJoin<ToolMolds>((a, b, c) => a.mold_id == c.id)
|
||||
.LeftJoin<ToolMoldMaintainRunRecord>((a, b, c,d) => d.plan_code == b.plan_code&&d.mold_code==c.mold_code)
|
||||
.LeftJoin<ToolMoldMaintainRunRecord>((a, b, c, d) => d.plan_code == b.plan_code && d.mold_code == c.mold_code)
|
||||
.Where(a => a.maintain_plan_id == planId)
|
||||
.Select((a, b, c,d) => new
|
||||
.Select((a, b, c, d) => new
|
||||
{
|
||||
mold_id = a.mold_id,
|
||||
plan_start_time = d.plan_start_time,
|
||||
designer=d.designer
|
||||
designer = d.designer
|
||||
})
|
||||
.ToListAsync();
|
||||
var moldids = planMoldRelations.Select(x => x.mold_id).ToList();
|
||||
@@ -117,7 +103,7 @@ namespace Tnb.EquipMgr
|
||||
var dic = await _db.Queryable<DictionaryDataEntity>().Where(p => p.DictionaryTypeId == "26149299883285").ToListAsync();
|
||||
var users = await _db.Queryable<UserEntity>().ToListAsync();
|
||||
var records = _db.Queryable<ToolMoldMaintainItemRecord>().ToList();
|
||||
var runrecords = _db.Queryable<ToolMoldMaintainRunRecord>().ToList();
|
||||
var runrecords = _db.Queryable<ToolMoldMaintainRunRecord>().ToList();
|
||||
foreach (var plan in plans)
|
||||
{
|
||||
var planMoldRelations = await _db.Queryable<ToolMoldMaintainPlanRelation>()
|
||||
@@ -154,14 +140,14 @@ namespace Tnb.EquipMgr
|
||||
info.maintain_qty = mold.maintain_qty;
|
||||
info.plan_start_time = plan.plan_start_date == null ? "" : ((DateTime)plan.plan_start_date!).ToString("yyyy-MM-dd");
|
||||
info.createtime = plan.create_time == null ? "" : ((DateTime)plan.create_time).ToString("yyyy-MM-dd");
|
||||
info.status = records.Where(p=>p.mold_id== mold.id&&p.plan_id== plan.id).Any()? "已完成" : "待保养";//plan.status == "UnMaintain" ? "待保养" : "已完成";
|
||||
info.status = records.Where(p => p.mold_id == mold.id && p.plan_id == plan.id).Any() ? "已完成" : "待保养";//plan.status == "UnMaintain" ? "待保养" : "已完成";
|
||||
info.createuser = string.IsNullOrEmpty(plan.create_id) ? "" : users.Where(p => p.Id == plan.create_id).First().RealName;
|
||||
info.plan_id = plan.id;
|
||||
info.starttime = "";
|
||||
if (runrecords.Where(p => p.mold_code == mold.mold_code && p.plan_code == plan.plan_code).Any())
|
||||
{
|
||||
var run = runrecords.Where(p => p.mold_code == mold.mold_code && p.plan_code == plan.plan_code).First();
|
||||
info.starttime = run.plan_start_time!=null? ((DateTime)run.plan_start_time).ToString("yyyy-MM-dd") : "";
|
||||
info.starttime = run.plan_start_time != null ? ((DateTime)run.plan_start_time).ToString("yyyy-MM-dd") : "";
|
||||
}
|
||||
var moldEqpRelation = ToolMoldsEquipments.Where(it => it.mold_id == mold.id).FirstOrDefault();
|
||||
if (moldEqpRelation != null)
|
||||
@@ -203,13 +189,13 @@ namespace Tnb.EquipMgr
|
||||
input.sidx = "b." + input.sidx;
|
||||
}
|
||||
var records = await _db.Queryable<ToolMoldMaintainItemRecord>().Select(p => p.plan_id + p.mold_id).ToListAsync();
|
||||
var result= await _db.Queryable<ToolMoldMaintainPlanRelation>()
|
||||
var result = await _db.Queryable<ToolMoldMaintainPlanRelation>()
|
||||
.LeftJoin<ToolMoldMaintainPlan>((a, b) => a.maintain_plan_id == b.id)
|
||||
.LeftJoin<ToolMolds>((a, b, c) => a.mold_id == c.id)
|
||||
.LeftJoin<ToolMoldMaintainRunRecord>((a, b, c, d) => b.plan_code == d.plan_code && c.mold_code == d.mold_code)
|
||||
.LeftJoin<ToolMoldMaintainItemRecord>((a, b, c, d, e) => e.plan_id == b.id && e.mold_id == c.id)
|
||||
.LeftJoin<UserEntity>((a, b, c, d, e, f) => b.create_id == f.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e, f,g) => c.mold_status == g.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e, f, g) => c.mold_status == g.Id)
|
||||
.Where((a, b, c, d, e, f) => b.create_time != null)
|
||||
.WhereIF(!string.IsNullOrEmpty(input.maintain_info), (a, b, c, d, e, f, g) => c.mold_code!.Contains(input.maintain_info) || c.mold_name!.Contains(input.maintain_info))
|
||||
.WhereIF(start_time != null, (a, b, c, d, e, f, g) => b.create_time != null && b.create_time >= start_time)
|
||||
@@ -222,7 +208,7 @@ namespace Tnb.EquipMgr
|
||||
mold_id = c.id,
|
||||
mold_code = c.mold_code!,
|
||||
mold_name = c.mold_name!,
|
||||
mold_status=g.FullName!,
|
||||
mold_status = g.FullName!,
|
||||
status = input.status,
|
||||
createuser = f.RealName,
|
||||
createtime = b.create_time == null ? "" : b.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
@@ -276,7 +262,7 @@ namespace Tnb.EquipMgr
|
||||
})
|
||||
.ToListAsync();
|
||||
//新增功能
|
||||
var ToolMoldMaintainPlanRelation= _db.Queryable<ToolMoldMaintainPlanRelation>().Where((a) => a.maintain_plan_id == input.plan_id && a.mold_id == input.mold_id&& !string.IsNullOrEmpty(a.group_id)).First();
|
||||
var ToolMoldMaintainPlanRelation = _db.Queryable<ToolMoldMaintainPlanRelation>().Where((a) => a.maintain_plan_id == input.plan_id && a.mold_id == input.mold_id && !string.IsNullOrEmpty(a.group_id)).First();
|
||||
if (ToolMoldMaintainPlanRelation != null)
|
||||
items = items.Where(a => a.item_group_id == ToolMoldMaintainPlanRelation.group_id).ToList();
|
||||
var checkItems = await _db.Queryable<ToolMoldMaintainItemRecord>().Where(it => it.plan_id == input.plan_id && it.mold_id == input.mold_id).Select(it => new
|
||||
@@ -315,10 +301,10 @@ namespace Tnb.EquipMgr
|
||||
public async Task MaintainStart(MoldMaintainRunUpInput input)
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException("input");
|
||||
var flag= _db.Queryable<ToolMoldMaintainRunRecord>()
|
||||
var flag = _db.Queryable<ToolMoldMaintainRunRecord>()
|
||||
.LeftJoin<ToolMoldMaintainPlan>((a, b) => a.plan_code == b.plan_code)
|
||||
.LeftJoin<ToolMolds>((a,b,c)=>a.mold_code==c.mold_code)
|
||||
.Where((a,b,c)=>b.id== input.plan_id&&c.id==input.mold_id).Any();
|
||||
.LeftJoin<ToolMolds>((a, b, c) => a.mold_code == c.mold_code)
|
||||
.Where((a, b, c) => b.id == input.plan_id && c.id == input.mold_id).Any();
|
||||
if (flag)
|
||||
{
|
||||
return;
|
||||
@@ -348,13 +334,13 @@ namespace Tnb.EquipMgr
|
||||
record.designer_time = DateTime.Now;
|
||||
record.mold_code = mold.mold_code;
|
||||
record.mold_name = mold.mold_name;
|
||||
record.plan_start_time = string.IsNullOrEmpty(input.starttime) ? DateTime.Now :DateTime.Parse(input.starttime);
|
||||
record.plan_start_time = string.IsNullOrEmpty(input.starttime) ? DateTime.Now : DateTime.Parse(input.starttime);
|
||||
var row = await _db.Insertable(record).ExecuteCommandAsync();
|
||||
if (row < 1) throw Oops.Oh(ErrorCode.COM1001);
|
||||
|
||||
|
||||
var groupids = _db.Queryable<ToolMoldMaintainPlanRelation>().Where(a => !string.IsNullOrEmpty(a.group_id) && a.mold_id == input.mold_id && a.maintain_plan_id == input.plan_id).ToList().Select(p => p.group_id);
|
||||
|
||||
|
||||
/*
|
||||
var maintainInfos = await _db.Queryable<ToolMoldMaintainGroupRelation>()
|
||||
.LeftJoin<ToolMoldMaintainGroup>((a, b) => a.item_group_id == b.id)
|
||||
@@ -500,7 +486,7 @@ namespace Tnb.EquipMgr
|
||||
}).ToListAsync();
|
||||
var dicCheckItems = checkItems.GroupBy(g => $"{g.plan_id}{g.mold_id}{g.item_group_id}{g.item_id}").ToDictionary(x => x.Key, x => x.FirstOrDefault());
|
||||
var maintainedItems = items.Where(it => dicCheckItems.ContainsKey($"{it.plan_id}{it.mold_id}{it.item_group_id}{it.item_id}") && dicCheckItems[$"{it.plan_id}{it.mold_id}{it.item_group_id}{it.item_id}"] != null).ToList();
|
||||
if ((items?.Count > 0 && maintainedItems?.Count > 0 )|| (maintainedItems == null || maintainedItems.Count < 1))
|
||||
if ((items?.Count > 0 && maintainedItems?.Count > 0) || (maintainedItems == null || maintainedItems.Count < 1))
|
||||
{
|
||||
if (maintainedItems.Count < items.Count || (maintainedItems == null || maintainedItems.Count < 1))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user