去除引用common.props
This commit is contained in:
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.BasicData;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData;
|
|
||||||
|
|
||||||
public class ModuleConst
|
public class ModuleConst
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.BasicData.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities.Dto
|
|
||||||
{
|
{
|
||||||
public class CalendarInput
|
public class CalendarInput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.BasicData.Entities.Dto.BasCalendar
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities.Dto.BasCalendar
|
|
||||||
{
|
{
|
||||||
public class CalendarOut
|
public class CalendarOut
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using Tnb.BasicData.Entities;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities.Dto
|
namespace Tnb.BasicData.Entities.Dto
|
||||||
{
|
{
|
||||||
public class MbomDataOutput
|
public class MbomDataOutput
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using Tnb.BasicData.Entities;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities.Dto
|
namespace Tnb.BasicData.Entities.Dto
|
||||||
{
|
{
|
||||||
public class MbomSaveDataInput
|
public class MbomSaveDataInput
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.BasicData.Entitys.Dto.BasProcess
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entitys.Dto.BasProcess
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工序列表输出类
|
/// 工序列表输出类
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using JNPF.Common.Security;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JNPF.Common.Security;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities.Dto
|
namespace Tnb.BasicData.Entities.Dto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.BasicData.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 子工单列表
|
/// 子工单列表
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using JNPF.Common.Contracts;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JNPF.Common.Contracts;
|
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using JNPF.Common.Contracts;
|
using JNPF.Common.Contracts;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities;
|
namespace Tnb.BasicData.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using JNPF.Common.Contracts;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JNPF.Common.Contracts;
|
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.BasicData.Entities.Enums
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities.Enums
|
|
||||||
{
|
{
|
||||||
public enum EnumCalendarType
|
public enum EnumCalendarType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.BasicData.Entities.Enums
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities.Enums
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 库位类型
|
/// 库位类型
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Mapster;
|
using Mapster;
|
||||||
using SqlSugar;
|
|
||||||
using Tnb.BasicData.Entities.Dto;
|
using Tnb.BasicData.Entities.Dto;
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities
|
namespace Tnb.BasicData.Entities
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.BasicData.Entitys.Model
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entitys.Model
|
|
||||||
{
|
{
|
||||||
public class RouteTree
|
public class RouteTree
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Import Project="$(SolutionDir)\common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using Tnb.BasicData.Entities.Dto;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Tnb.BasicData.Entities.Dto;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Interfaces
|
namespace Tnb.BasicData.Interfaces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using Tnb.BasicData.Entities;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Tnb.BasicData.Entities;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Interfaces
|
namespace Tnb.BasicData.Interfaces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
using JNPF.Common.Dtos.VisualDev;
|
|
||||||
using JNPF.VisualDev;
|
|
||||||
using Tnb.BasicData.Entities.Dto;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Interfaces
|
namespace Tnb.BasicData.Interfaces
|
||||||
{
|
{
|
||||||
public interface IBasProcessService
|
public interface IBasProcessService
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using JNPF.Common.Dtos.VisualDev;
|
using JNPF.Common.Dtos.VisualDev;
|
||||||
using JNPF.Common.Filter;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData.Interfaces
|
namespace Tnb.BasicData.Interfaces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Import Project="$(SolutionDir)\common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
|||||||
@@ -1,19 +1,8 @@
|
|||||||
using System;
|
using JNPF.Common.Core.Manager;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Aop.Api.Domain;
|
|
||||||
using Aspose.Cells.Drawing;
|
|
||||||
using JNPF.Common.Core.Manager;
|
|
||||||
using JNPF.Common.Models.VisualDev;
|
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.JsonSerialization;
|
using JNPF.JsonSerialization;
|
||||||
using JNPF.Systems.Interfaces.System;
|
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NPOI.SS.Formula.Functions;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.BasicData.Entities.Dto;
|
using Tnb.BasicData.Entities.Dto;
|
||||||
@@ -38,6 +27,7 @@ namespace Tnb.BasicData
|
|||||||
_repository = repository;
|
_repository = repository;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存工作日历
|
/// 保存工作日历
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -46,17 +36,20 @@ namespace Tnb.BasicData
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task SaveData(CalendarInput CalendarInput)
|
public async Task SaveData(CalendarInput CalendarInput)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
await db.Deleteable<BasCalendar>(p=>p.datetext== CalendarInput.datetext).ExecuteCommandAsync();
|
_ = await db.Deleteable<BasCalendar>(p => p.datetext == CalendarInput.datetext).ExecuteCommandAsync();
|
||||||
BasCalendar BasCalendar = new BasCalendar();
|
BasCalendar BasCalendar = new()
|
||||||
BasCalendar.datetext = CalendarInput.datetext;
|
{
|
||||||
BasCalendar.datetype = CalendarInput.datetype;
|
datetext = CalendarInput.datetext,
|
||||||
BasCalendar.workhour = CalendarInput.workhour;
|
datetype = CalendarInput.datetype,
|
||||||
BasCalendar.worktype = CalendarInput.worktype;
|
workhour = CalendarInput.workhour,
|
||||||
BasCalendar.create_id = _userManager.UserId;
|
worktype = CalendarInput.worktype,
|
||||||
BasCalendar.create_time = DateTime.Now;
|
create_id = _userManager.UserId,
|
||||||
await db.Insertable(BasCalendar).ExecuteCommandAsync();
|
create_time = DateTime.Now
|
||||||
|
};
|
||||||
|
_ = await db.Insertable(BasCalendar).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取工作日历
|
/// 获取工作日历
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -64,29 +57,31 @@ namespace Tnb.BasicData
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetWorkData(CalendarInput CalendarInput)
|
public async Task<dynamic> GetWorkData(CalendarInput CalendarInput)
|
||||||
{
|
{
|
||||||
List<CalendarOut> CalendarOuts = new List<CalendarOut>();
|
List<CalendarOut> CalendarOuts = new();
|
||||||
if (CalendarInput.calendartype == (int)EnumCalendarType.分类)
|
if (CalendarInput.calendartype == (int)EnumCalendarType.分类)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
var lists = await db.Queryable<BasCalendar>().Where(p => p.worktype == CalendarInput.content).ToListAsync();
|
List<BasCalendar> lists = await db.Queryable<BasCalendar>().Where(p => p.worktype == CalendarInput.content).ToListAsync();
|
||||||
|
|
||||||
foreach (var list in lists)
|
foreach (BasCalendar list in lists)
|
||||||
{
|
{
|
||||||
CalendarOut CalendarOut = new CalendarOut();
|
CalendarOut CalendarOut = new()
|
||||||
CalendarOut.datetext = list.datetext;
|
{
|
||||||
CalendarOut.datetype = list.datetype;
|
datetext = list.datetext,
|
||||||
CalendarOut.workhour = JSON.Deserialize<List<WorkHour>>(list.workhour);
|
datetype = list.datetype,
|
||||||
CalendarOut.worktype = list.worktype;
|
workhour = JSON.Deserialize<List<WorkHour>>(list.workhour),
|
||||||
|
worktype = list.worktype
|
||||||
|
};
|
||||||
CalendarOuts.Add(CalendarOut);
|
CalendarOuts.Add(CalendarOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (CalendarInput.calendartype == (int)EnumCalendarType.班组)
|
else if (CalendarInput.calendartype == (int)EnumCalendarType.班组)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
var Shifts = await db.Queryable<BasShiftWorkgroup>().Where(p => p.workgroup_id == CalendarInput.content).Select(p=>p.shift_id).ToListAsync();
|
List<string> Shifts = await db.Queryable<BasShiftWorkgroup>().Where(p => p.workgroup_id == CalendarInput.content).Select(p => p.shift_id).ToListAsync();
|
||||||
if (Shifts != null && Shifts.Count > 0)
|
if (Shifts != null && Shifts.Count > 0)
|
||||||
{
|
{
|
||||||
var BasTimePeriods = await db.Queryable<BasTimePeriod, BasShift>((a, b) => new object[] { JoinType.Inner, a.shifttype_id == b.id })
|
List<Shift> BasTimePeriods = await db.Queryable<BasTimePeriod, BasShift>((a, b) => new object[] { JoinType.Inner, a.shifttype_id == b.id })
|
||||||
.Where((a, b) => Shifts.Contains(a.shifttype_id!))
|
.Where((a, b) => Shifts.Contains(a.shifttype_id!))
|
||||||
.Select((a, b) =>
|
.Select((a, b) =>
|
||||||
new Shift
|
new Shift
|
||||||
@@ -97,8 +92,7 @@ namespace Tnb.BasicData
|
|||||||
}
|
}
|
||||||
).ToListAsync();
|
).ToListAsync();
|
||||||
|
|
||||||
|
List<Shift> BasTimePeriodRests = await db.Queryable<BasTimePeriodRest, BasShift>((a, b) => new object[] { JoinType.Inner, a.shift_type_id == b.id })
|
||||||
var BasTimePeriodRests = await db.Queryable<BasTimePeriodRest, BasShift>((a, b) => new object[] { JoinType.Inner, a.shift_type_id == b.id })
|
|
||||||
.Where((a, b) => Shifts.Contains(a.shift_type_id!))
|
.Where((a, b) => Shifts.Contains(a.shift_type_id!))
|
||||||
.Select((a, b) =>
|
.Select((a, b) =>
|
||||||
new Shift
|
new Shift
|
||||||
@@ -107,38 +101,46 @@ namespace Tnb.BasicData
|
|||||||
endday = b.shifte_time,
|
endday = b.shifte_time,
|
||||||
workhour = new WorkHour { start = a.tp_b_time, end = a.tp_e_time },
|
workhour = new WorkHour { start = a.tp_b_time, end = a.tp_e_time },
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
foreach (var BasTimePeriod in BasTimePeriods)
|
foreach (Shift? BasTimePeriod in BasTimePeriods)
|
||||||
{
|
{
|
||||||
var start = DateTime.Parse(BasTimePeriod.startday!);
|
DateTime start = DateTime.Parse(BasTimePeriod.startday!);
|
||||||
var end = DateTime.Parse(BasTimePeriod.endday!);
|
DateTime end = DateTime.Parse(BasTimePeriod.endday!);
|
||||||
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
||||||
{
|
{
|
||||||
if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
||||||
|
{
|
||||||
CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriod.workhour!);
|
CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriod.workhour!);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CalendarOut CalendarOut = new CalendarOut();
|
CalendarOut CalendarOut = new()
|
||||||
CalendarOut.datetext = date.ToString("yyyy-MM-dd");
|
{
|
||||||
CalendarOut.datetype = "workDay";
|
datetext = date.ToString("yyyy-MM-dd"),
|
||||||
CalendarOut.workhour = new List<WorkHour> { BasTimePeriod.workhour! };
|
datetype = "workDay",
|
||||||
|
workhour = new List<WorkHour> { BasTimePeriod.workhour! }
|
||||||
|
};
|
||||||
CalendarOuts.Add(CalendarOut);
|
CalendarOuts.Add(CalendarOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (var BasTimePeriodRest in BasTimePeriodRests)
|
foreach (Shift? BasTimePeriodRest in BasTimePeriodRests)
|
||||||
{
|
{
|
||||||
var start = DateTime.Parse(BasTimePeriodRest.startday!);
|
DateTime start = DateTime.Parse(BasTimePeriodRest.startday!);
|
||||||
var end = DateTime.Parse(BasTimePeriodRest.endday!);
|
DateTime end = DateTime.Parse(BasTimePeriodRest.endday!);
|
||||||
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
||||||
{
|
{
|
||||||
if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
||||||
|
{
|
||||||
CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriodRest.workhour!);
|
CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriodRest.workhour!);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CalendarOut CalendarOut = new CalendarOut();
|
CalendarOut CalendarOut = new()
|
||||||
CalendarOut.datetext = date.ToString("yyyy-MM-dd");
|
{
|
||||||
CalendarOut.datetype = "dayOff";
|
datetext = date.ToString("yyyy-MM-dd"),
|
||||||
CalendarOut.workhour = new List<WorkHour> { BasTimePeriodRest.workhour! };
|
datetype = "dayOff",
|
||||||
|
workhour = new List<WorkHour> { BasTimePeriodRest.workhour! }
|
||||||
|
};
|
||||||
CalendarOuts.Add(CalendarOut);
|
CalendarOuts.Add(CalendarOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,12 +149,12 @@ namespace Tnb.BasicData
|
|||||||
}
|
}
|
||||||
else if (CalendarInput.calendartype == (int)EnumCalendarType.个人)
|
else if (CalendarInput.calendartype == (int)EnumCalendarType.个人)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
var groups = await db.Queryable<BasWorkgroupEmployee>().Where(p => p.employee_id == CalendarInput.content).Select(p => p.group_id).ToListAsync();
|
List<string> groups = await db.Queryable<BasWorkgroupEmployee>().Where(p => p.employee_id == CalendarInput.content).Select(p => p.group_id).ToListAsync();
|
||||||
var Shifts = await db.Queryable<BasShiftWorkgroup>().Where(p => groups.Contains(p.workgroup_id)).Select(p => p.shift_id).ToListAsync();
|
List<string> Shifts = await db.Queryable<BasShiftWorkgroup>().Where(p => groups.Contains(p.workgroup_id)).Select(p => p.shift_id).ToListAsync();
|
||||||
if (Shifts != null && Shifts.Count > 0)
|
if (Shifts != null && Shifts.Count > 0)
|
||||||
{
|
{
|
||||||
var BasTimePeriods = await db.Queryable<BasTimePeriod, BasShift>((a, b) => new object[] { JoinType.Inner, a.shifttype_id == b.id })
|
List<Shift> BasTimePeriods = await db.Queryable<BasTimePeriod, BasShift>((a, b) => new object[] { JoinType.Inner, a.shifttype_id == b.id })
|
||||||
.Where((a, b) => Shifts.Contains(a.shifttype_id!))
|
.Where((a, b) => Shifts.Contains(a.shifttype_id!))
|
||||||
.Select((a, b) =>
|
.Select((a, b) =>
|
||||||
new Shift
|
new Shift
|
||||||
@@ -163,8 +165,7 @@ namespace Tnb.BasicData
|
|||||||
}
|
}
|
||||||
).ToListAsync();
|
).ToListAsync();
|
||||||
|
|
||||||
|
List<Shift> BasTimePeriodRests = await db.Queryable<BasTimePeriodRest, BasShift>((a, b) => new object[] { JoinType.Inner, a.shift_type_id == b.id })
|
||||||
var BasTimePeriodRests = await db.Queryable<BasTimePeriodRest, BasShift>((a, b) => new object[] { JoinType.Inner, a.shift_type_id == b.id })
|
|
||||||
.Where((a, b) => Shifts.Contains(a.shift_type_id!))
|
.Where((a, b) => Shifts.Contains(a.shift_type_id!))
|
||||||
.Select((a, b) =>
|
.Select((a, b) =>
|
||||||
new Shift
|
new Shift
|
||||||
@@ -173,38 +174,46 @@ namespace Tnb.BasicData
|
|||||||
endday = b.shifte_time,
|
endday = b.shifte_time,
|
||||||
workhour = new WorkHour { start = a.tp_b_time, end = a.tp_e_time },
|
workhour = new WorkHour { start = a.tp_b_time, end = a.tp_e_time },
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
foreach (var BasTimePeriod in BasTimePeriods)
|
foreach (Shift? BasTimePeriod in BasTimePeriods)
|
||||||
{
|
{
|
||||||
var start = DateTime.Parse(BasTimePeriod.startday!);
|
DateTime start = DateTime.Parse(BasTimePeriod.startday!);
|
||||||
var end = DateTime.Parse(BasTimePeriod.endday!);
|
DateTime end = DateTime.Parse(BasTimePeriod.endday!);
|
||||||
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
||||||
{
|
{
|
||||||
if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
||||||
|
{
|
||||||
CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriod.workhour!);
|
CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriod.workhour!);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CalendarOut CalendarOut = new CalendarOut();
|
CalendarOut CalendarOut = new()
|
||||||
CalendarOut.datetext = date.ToString("yyyy-MM-dd");
|
{
|
||||||
CalendarOut.datetype = "workDay";
|
datetext = date.ToString("yyyy-MM-dd"),
|
||||||
CalendarOut.workhour = new List<WorkHour> { BasTimePeriod.workhour! };
|
datetype = "workDay",
|
||||||
|
workhour = new List<WorkHour> { BasTimePeriod.workhour! }
|
||||||
|
};
|
||||||
CalendarOuts.Add(CalendarOut);
|
CalendarOuts.Add(CalendarOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (var BasTimePeriodRest in BasTimePeriodRests)
|
foreach (Shift? BasTimePeriodRest in BasTimePeriodRests)
|
||||||
{
|
{
|
||||||
var start = DateTime.Parse(BasTimePeriodRest.startday!);
|
DateTime start = DateTime.Parse(BasTimePeriodRest.startday!);
|
||||||
var end = DateTime.Parse(BasTimePeriodRest.endday!);
|
DateTime end = DateTime.Parse(BasTimePeriodRest.endday!);
|
||||||
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
||||||
{
|
{
|
||||||
if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
||||||
|
{
|
||||||
CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriodRest.workhour!);
|
CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriodRest.workhour!);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CalendarOut CalendarOut = new CalendarOut();
|
CalendarOut CalendarOut = new()
|
||||||
CalendarOut.datetext = date.ToString("yyyy-MM-dd");
|
{
|
||||||
CalendarOut.datetype = "dayOff";
|
datetext = date.ToString("yyyy-MM-dd"),
|
||||||
CalendarOut.workhour = new List<WorkHour> { BasTimePeriodRest.workhour! };
|
datetype = "dayOff",
|
||||||
|
workhour = new List<WorkHour> { BasTimePeriodRest.workhour! }
|
||||||
|
};
|
||||||
CalendarOuts.Add(CalendarOut);
|
CalendarOuts.Add(CalendarOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,6 +222,7 @@ namespace Tnb.BasicData
|
|||||||
}
|
}
|
||||||
return CalendarOuts;
|
return CalendarOuts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 批量保存工作日历
|
/// 批量保存工作日历
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -220,37 +230,39 @@ namespace Tnb.BasicData
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task SaveBatchData(CalendarBatchInput CalendarBatchInput)
|
public async Task SaveBatchData(CalendarBatchInput CalendarBatchInput)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
DateTime start = DateTime.Parse(CalendarBatchInput.startenday![0]);
|
DateTime start = DateTime.Parse(CalendarBatchInput.startenday![0]);
|
||||||
DateTime end = DateTime.Parse(CalendarBatchInput.startenday![1]);
|
DateTime end = DateTime.Parse(CalendarBatchInput.startenday![1]);
|
||||||
List<BasCalendar> BasCalendars = new List<BasCalendar>();
|
List<BasCalendar> BasCalendars = new();
|
||||||
var lists=await db.Queryable<BasCalendar>().Where(p=>start<=DateTime.Parse(p.datetext!)&&end>= DateTime.Parse(p.datetext!)&& p.worktype== CalendarBatchInput.worktype).ToListAsync();
|
List<BasCalendar> lists = await db.Queryable<BasCalendar>().Where(p => start <= DateTime.Parse(p.datetext!) && end >= DateTime.Parse(p.datetext!) && p.worktype == CalendarBatchInput.worktype).ToListAsync();
|
||||||
var updatelist=new List<BasCalendar>();
|
List<BasCalendar> updatelist = new();
|
||||||
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
for (DateTime date = start; date <= end; date = date.AddDays(1))
|
||||||
{
|
{
|
||||||
if (CalendarBatchInput.weekday!.Contains((int)date.DayOfWeek))
|
if (CalendarBatchInput.weekday!.Contains((int)date.DayOfWeek))
|
||||||
{
|
{
|
||||||
if (lists.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
if (lists.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any())
|
||||||
{
|
{
|
||||||
var BasCalendar = lists.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First();
|
BasCalendar BasCalendar = lists.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First();
|
||||||
BasCalendar.datetype = CalendarBatchInput.datetype;
|
BasCalendar.datetype = CalendarBatchInput.datetype;
|
||||||
updatelist.Add(BasCalendar);
|
updatelist.Add(BasCalendar);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BasCalendar BasCalendar = new BasCalendar();
|
BasCalendar BasCalendar = new()
|
||||||
BasCalendar.datetext = date.ToString("yyyy-MM-dd");
|
{
|
||||||
BasCalendar.datetype = CalendarBatchInput.datetype;
|
datetext = date.ToString("yyyy-MM-dd"),
|
||||||
BasCalendar.workhour = CalendarBatchInput.workhour;
|
datetype = CalendarBatchInput.datetype,
|
||||||
BasCalendar.worktype = CalendarBatchInput.worktype;
|
workhour = CalendarBatchInput.workhour,
|
||||||
BasCalendar.create_id = _userManager.UserId;
|
worktype = CalendarBatchInput.worktype,
|
||||||
BasCalendar.create_time = DateTime.Now;
|
create_id = _userManager.UserId,
|
||||||
|
create_time = DateTime.Now
|
||||||
|
};
|
||||||
BasCalendars.Add(BasCalendar);
|
BasCalendars.Add(BasCalendar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await db.Updateable(updatelist).ExecuteCommandAsync();
|
_ = await db.Updateable(updatelist).ExecuteCommandAsync();
|
||||||
await db.Insertable(BasCalendars).ExecuteCommandAsync();
|
_ = await db.Insertable(BasCalendars).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,11 +2,10 @@ using JNPF.Common.Core.Manager;
|
|||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.Systems.Interfaces.System;
|
using JNPF.Systems.Interfaces.System;
|
||||||
using JNPF.VisualDev;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities.Dto;
|
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
|
using Tnb.BasicData.Entities.Dto;
|
||||||
using Tnb.BasicData.Interfaces;
|
using Tnb.BasicData.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.BasicData
|
namespace Tnb.BasicData
|
||||||
@@ -34,7 +33,7 @@ namespace Tnb.BasicData
|
|||||||
public async Task<dynamic> GetDefectListByProcessId(Dictionary<string, string> dic)
|
public async Task<dynamic> GetDefectListByProcessId(Dictionary<string, string> dic)
|
||||||
{
|
{
|
||||||
string processId = dic["processId"];
|
string processId = dic["processId"];
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
List<string> defectIds = await db.Queryable<BasProcessDefective>().Where(x => x.process_id == processId).Select(x => x.defective_id).ToListAsync();
|
List<string> defectIds = await db.Queryable<BasProcessDefective>().Where(x => x.process_id == processId).Select(x => x.defective_id).ToListAsync();
|
||||||
List<string?> defectTypeIds = await db.Queryable<BasDefect>().Where(x => defectIds.Contains(x.id) && x.enabled == 1).Select(x => x.defect_type_id).ToListAsync();
|
List<string?> defectTypeIds = await db.Queryable<BasDefect>().Where(x => defectIds.Contains(x.id) && x.enabled == 1).Select(x => x.defect_type_id).ToListAsync();
|
||||||
return await _repository.AsSugarClient().Queryable<BasDefectType>()
|
return await _repository.AsSugarClient().Queryable<BasDefectType>()
|
||||||
@@ -42,7 +41,7 @@ namespace Tnb.BasicData
|
|||||||
.Select(a => new
|
.Select(a => new
|
||||||
{
|
{
|
||||||
defect_type_id = a.id,
|
defect_type_id = a.id,
|
||||||
defect_type_name = a.defect_type_name,
|
a.defect_type_name,
|
||||||
children = SqlFunc.Subqueryable<BasDefect>().Where(x => x.defect_type_id == a.id && defectIds.Contains(x.id)).ToList(x => new DefectOutput()
|
children = SqlFunc.Subqueryable<BasDefect>().Where(x => x.defect_type_id == a.id && defectIds.Contains(x.id)).ToList(x => new DefectOutput()
|
||||||
{
|
{
|
||||||
id = x.id,
|
id = x.id,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using JNPF.DependencyInjection;
|
|||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
using JNPF.Systems.Interfaces.System;
|
|
||||||
using JNPF.VisualDev;
|
using JNPF.VisualDev;
|
||||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -48,12 +47,12 @@ namespace Tnb.BasicData
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
public async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
Dictionary<string, object>? queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
Dictionary<string, object>? queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||||
string? code = queryJson != null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : "";
|
string? code = queryJson != null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : "";
|
||||||
string? name = queryJson != null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : "";
|
string? name = queryJson != null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : "";
|
||||||
string? version = queryJson != null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : "";
|
string? version = queryJson != null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : "";
|
||||||
var list = await db.Queryable<BasESop, BasMbom, BasMbomProcess, UserEntity,BasProcess>((a, b, c, d,e) => new object[]
|
SqlSugarPagedList<ESopListOutput> list = await db.Queryable<BasESop, BasMbom, BasMbomProcess, UserEntity, BasProcess>((a, b, c, d, e) => new object[]
|
||||||
{
|
{
|
||||||
JoinType.Left, a.mbom_id == b.id,
|
JoinType.Left, a.mbom_id == b.id,
|
||||||
JoinType.Left, a.mbom_process_id == c.id,
|
JoinType.Left, a.mbom_process_id == c.id,
|
||||||
@@ -79,7 +78,7 @@ namespace Tnb.BasicData
|
|||||||
create_time = a.create_time == null ? "" : a.create_time.Value.ToString("yyyy-MM-dd"),
|
create_time = a.create_time == null ? "" : a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||||
mbom_id_id = a.mbom_id,
|
mbom_id_id = a.mbom_id,
|
||||||
mbom_process_id_id = a.mbom_process_id
|
mbom_process_id_id = a.mbom_process_id
|
||||||
}).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50));
|
}).ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
||||||
|
|
||||||
return PageResult<ESopListOutput>.SqlSugarPageResult(list);
|
return PageResult<ESopListOutput>.SqlSugarPageResult(list);
|
||||||
}
|
}
|
||||||
@@ -87,8 +86,8 @@ namespace Tnb.BasicData
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetHistoryList(EsopHistoryListQueryInput input)
|
public async Task<dynamic> GetHistoryList(EsopHistoryListQueryInput input)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
Dictionary<string, string>? queryJson = new();
|
||||||
if (input != null && !string.IsNullOrEmpty(input.queryJson))
|
if (input != null && !string.IsNullOrEmpty(input.queryJson))
|
||||||
{
|
{
|
||||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input?.queryJson ?? "");
|
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input?.queryJson ?? "");
|
||||||
@@ -96,7 +95,7 @@ namespace Tnb.BasicData
|
|||||||
string code = queryJson != null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : "";
|
string code = queryJson != null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : "";
|
||||||
string name = queryJson != null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : "";
|
string name = queryJson != null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : "";
|
||||||
string version = queryJson != null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : "";
|
string version = queryJson != null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : "";
|
||||||
var list = await db.Queryable<BasESop, BasMbom, BasMbomProcess, UserEntity,BasProcess>((a, b, c, d,e) => new object[]
|
SqlSugarPagedList<ESopListOutput> list = await db.Queryable<BasESop, BasMbom, BasMbomProcess, UserEntity, BasProcess>((a, b, c, d, e) => new object[]
|
||||||
{
|
{
|
||||||
JoinType.Left, a.mbom_id == b.id,
|
JoinType.Left, a.mbom_id == b.id,
|
||||||
JoinType.Left, a.mbom_process_id == c.id,
|
JoinType.Left, a.mbom_process_id == c.id,
|
||||||
@@ -121,21 +120,18 @@ namespace Tnb.BasicData
|
|||||||
create_id = d.RealName,
|
create_id = d.RealName,
|
||||||
create_time = a.create_time == null ? "" : a.create_time.Value.ToString("yyyy-MM-dd"),
|
create_time = a.create_time == null ? "" : a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||||
mbom_id_id = a.mbom_id
|
mbom_id_id = a.mbom_id
|
||||||
}).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50));
|
}).ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
||||||
|
|
||||||
return PageResult<ESopListOutput>.SqlSugarPageResult(list);
|
return PageResult<ESopListOutput>.SqlSugarPageResult(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetEntityByMbomProcessId(Dictionary<string, string> dic)
|
public async Task<dynamic?> GetEntityByMbomProcessId(Dictionary<string, string> dic)
|
||||||
{
|
{
|
||||||
string mbomProcessId = dic["mbomProcessId"];
|
string mbomProcessId = dic["mbomProcessId"];
|
||||||
if (!string.IsNullOrEmpty(mbomProcessId))
|
return !string.IsNullOrEmpty(mbomProcessId)
|
||||||
{
|
? await _repository.GetFirstAsync(x => x.mbom_process_id == mbomProcessId && x.enabled == 1)
|
||||||
return await _repository.GetFirstAsync(x => x.mbom_process_id == mbomProcessId && x.enabled == 1);
|
: (dynamic)null;
|
||||||
}
|
|
||||||
|
|
||||||
return null!;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -146,15 +142,15 @@ namespace Tnb.BasicData
|
|||||||
throw Oops.Bah("已存在该版本");
|
throw Oops.Bah("已存在该版本");
|
||||||
}
|
}
|
||||||
|
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||||
{
|
{
|
||||||
await _repository.UpdateAsync(x => new BasESop()
|
_ = await _repository.UpdateAsync(x => new BasESop()
|
||||||
{
|
{
|
||||||
enabled = 0,
|
enabled = 0,
|
||||||
}, x => x.mbom_id == input.mbom_id && x.mbom_process_id == input.mbom_process_id);
|
}, x => x.mbom_id == input.mbom_id && x.mbom_process_id == input.mbom_process_id);
|
||||||
|
|
||||||
BasESop basESop = new BasESop()
|
BasESop basESop = new()
|
||||||
{
|
{
|
||||||
code = input.code,
|
code = input.code,
|
||||||
name = input.name,
|
name = input.name,
|
||||||
@@ -169,13 +165,9 @@ namespace Tnb.BasicData
|
|||||||
enabled = 1,
|
enabled = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
await _repository.InsertAsync(basESop);
|
_ = await _repository.InsertAsync(basESop);
|
||||||
|
|
||||||
});
|
});
|
||||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "上传成功" : result.ErrorMessage);
|
||||||
|
|
||||||
return result.IsSuccess ? "上传成功" : result.ErrorMessage;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,6 @@ using JNPF.Common.Filter;
|
|||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.Systems.Entitys.Permission;
|
|
||||||
using JNPF.Systems.Interfaces.System;
|
using JNPF.Systems.Interfaces.System;
|
||||||
using JNPF.VisualDev;
|
using JNPF.VisualDev;
|
||||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||||
@@ -11,7 +10,6 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.BasicData.Entities.Dto;
|
using Tnb.BasicData.Entities.Dto;
|
||||||
using Tnb.BasicData.Entitys.Dto.BasProcess;
|
|
||||||
using Tnb.BasicData.Interfaces;
|
using Tnb.BasicData.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.BasicData
|
namespace Tnb.BasicData
|
||||||
@@ -39,7 +37,6 @@ namespace Tnb.BasicData
|
|||||||
OverideFuncs.GetListAsync = GetList;
|
OverideFuncs.GetListAsync = GetList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料清单列表
|
/// 物料清单列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -47,10 +44,10 @@ namespace Tnb.BasicData
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
public async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
Dictionary<string, object>? queryJson = (input == null || string.IsNullOrEmpty(input.queryJson)) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
Dictionary<string, object>? queryJson = (input == null || string.IsNullOrEmpty(input.queryJson)) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||||
string materialInfo = queryJson?["query_info"]?.ToString() ?? "";
|
string materialInfo = queryJson?["query_info"]?.ToString() ?? "";
|
||||||
var list = await db.Queryable<BasEbomH, BasMaterial, BasRouteH>((a, b, c) => new object[]
|
SqlSugarPagedList<EbomListOutput> list = await db.Queryable<BasEbomH, BasMaterial, BasRouteH>((a, b, c) => new object[]
|
||||||
{
|
{
|
||||||
JoinType.Left, a.material_id == b.id,
|
JoinType.Left, a.material_id == b.id,
|
||||||
JoinType.Left, a.route_id == c.id,
|
JoinType.Left, a.route_id == c.id,
|
||||||
@@ -67,8 +64,7 @@ namespace Tnb.BasicData
|
|||||||
version = a.version,
|
version = a.version,
|
||||||
route_id = c.name,
|
route_id = c.name,
|
||||||
route_id_id = c.id,
|
route_id_id = c.id,
|
||||||
|
}).ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
||||||
}).ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50));
|
|
||||||
|
|
||||||
return PageResult<EbomListOutput>.SqlSugarPageResult(list);
|
return PageResult<EbomListOutput>.SqlSugarPageResult(list);
|
||||||
}
|
}
|
||||||
@@ -80,8 +76,8 @@ namespace Tnb.BasicData
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetTree(EbomTreeQueryInput queryInput)
|
public async Task<dynamic> GetTree(EbomTreeQueryInput queryInput)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
var dic = await _dictionaryDataService.GetDicByKey(DictConst.MeasurementUnit);
|
Dictionary<string, object> dic = await _dictionaryDataService.GetDicByKey(DictConst.MeasurementUnit);
|
||||||
|
|
||||||
// var momDbLink = await _repository.AsSugarClient().Queryable<DbLinkEntity>().FirstAsync(x => x.FullName == DbName.TNBMON);
|
// var momDbLink = await _repository.AsSugarClient().Queryable<DbLinkEntity>().FirstAsync(x => x.FullName == DbName.TNBMON);
|
||||||
// if (momDbLink != null)
|
// if (momDbLink != null)
|
||||||
@@ -91,7 +87,7 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
if (string.IsNullOrEmpty(queryInput.materialId))
|
if (string.IsNullOrEmpty(queryInput.materialId))
|
||||||
{
|
{
|
||||||
var data = await db.Queryable<BasEbomD>()
|
List<EbomTreeOutput> data = await db.Queryable<BasEbomD>()
|
||||||
.LeftJoin<BasEbomH>((a, b) => a.ebom_id == b.id)
|
.LeftJoin<BasEbomH>((a, b) => a.ebom_id == b.id)
|
||||||
.LeftJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
|
.LeftJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
|
||||||
.LeftJoin<BasEbomH>((a, b, c, d) => a.material_id == d.material_id)
|
.LeftJoin<BasEbomH>((a, b, c, d) => a.material_id == d.material_id)
|
||||||
@@ -121,7 +117,7 @@ namespace Tnb.BasicData
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var data = await db.Queryable<BasEbomD>()
|
List<EbomTreeOutput> data = await db.Queryable<BasEbomD>()
|
||||||
.LeftJoin<BasEbomH>((a, b) => a.ebom_id == b.id)
|
.LeftJoin<BasEbomH>((a, b) => a.ebom_id == b.id)
|
||||||
.LeftJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
|
.LeftJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
|
||||||
.LeftJoin<BasEbomH>((a, b, c, d) => a.material_id == d.material_id)
|
.LeftJoin<BasEbomH>((a, b, c, d) => a.material_id == d.material_id)
|
||||||
@@ -149,8 +145,6 @@ namespace Tnb.BasicData
|
|||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -162,7 +156,7 @@ namespace Tnb.BasicData
|
|||||||
public async Task<Dictionary<string, string>> GetEbomVersionAndRouteName(Dictionary<string, string> parameters)
|
public async Task<Dictionary<string, string>> GetEbomVersionAndRouteName(Dictionary<string, string> parameters)
|
||||||
{
|
{
|
||||||
string materialId = parameters["materialId"];
|
string materialId = parameters["materialId"];
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
|
|
||||||
// var momDbLink = await _repository.AsSugarClient().Queryable<DbLinkEntity>().FirstAsync(x => x.FullName == DbName.TNBMON);
|
// var momDbLink = await _repository.AsSugarClient().Queryable<DbLinkEntity>().FirstAsync(x => x.FullName == DbName.TNBMON);
|
||||||
// if (momDbLink != null)
|
// if (momDbLink != null)
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
using System;
|
using JNPF.DependencyInjection;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Aspose.Cells.Drawing;
|
|
||||||
using JNPF.DependencyInjection;
|
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.BasicData.Entities.Enums;
|
|
||||||
using Tnb.BasicData.Interfaces;
|
using Tnb.BasicData.Interfaces;
|
||||||
using Tnb.WarehouseMgr.Entities.Enums;
|
using Tnb.WarehouseMgr.Entities.Enums;
|
||||||
|
|
||||||
@@ -35,16 +28,24 @@ namespace Tnb.BasicData
|
|||||||
public async Task<dynamic> GetUnStoreLocationListByCarryId([FromRoute] string carryId)
|
public async Task<dynamic> GetUnStoreLocationListByCarryId([FromRoute] string carryId)
|
||||||
{
|
{
|
||||||
|
|
||||||
var items = await _db.Queryable<BasLocation>().Where(it => !string.IsNullOrEmpty(it.is_type) && Convert.ToInt32(it.is_type) != (int)EnumLocationType.存储库位).ToListAsync();
|
List<BasLocation> items = await _db.Queryable<BasLocation>().Where(it => !string.IsNullOrEmpty(it.is_type) && Convert.ToInt32(it.is_type) != (int)EnumLocationType.存储库位).ToListAsync();
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<List<BasLocation>> GetLocationInfobyIds(IEnumerable<string> locIds)
|
public async Task<List<BasLocation>> GetLocationInfobyIds(IEnumerable<string> locIds)
|
||||||
{
|
{
|
||||||
if (locIds == null) throw new ArgumentNullException(nameof(locIds));
|
if (locIds == null)
|
||||||
if (!locIds.Any()) throw new ArithmeticException($"parameter locIds.Count is not be empty");
|
{
|
||||||
var items = await _db.Queryable<BasLocation>().Where(it => locIds.Contains(it.id)).ToListAsync();
|
throw new ArgumentNullException(nameof(locIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!locIds.Any())
|
||||||
|
{
|
||||||
|
throw new ArithmeticException($"parameter locIds.Count is not be empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<BasLocation> items = await _db.Queryable<BasLocation>().Where(it => locIds.Contains(it.id)).ToListAsync();
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
||||||
{
|
{
|
||||||
await _repository.InsertAsync(basMaterial);
|
_ = await _repository.InsertAsync(basMaterial);
|
||||||
foreach (BasMaterialUnit basMaterialUnit in materialUnits)
|
foreach (BasMaterialUnit basMaterialUnit in materialUnits)
|
||||||
{
|
{
|
||||||
basMaterialUnit.id = SnowflakeIdHelper.NextId();
|
basMaterialUnit.id = SnowflakeIdHelper.NextId();
|
||||||
@@ -68,12 +68,11 @@ namespace Tnb.BasicData
|
|||||||
basMaterialIntoFactorySpecification.material_id = newId;
|
basMaterialIntoFactorySpecification.material_id = newId;
|
||||||
}
|
}
|
||||||
|
|
||||||
await _repository.AsSugarClient().Insertable<BasMaterialUnit>(materialUnits).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Insertable<BasMaterialUnit>(materialUnits).ExecuteCommandAsync();
|
||||||
await _repository.AsSugarClient().Insertable<BasMaterialIntoFactorySpecifications>(materialIntoFactorySpecifications).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Insertable<BasMaterialIntoFactorySpecifications>(materialIntoFactorySpecifications).ExecuteCommandAsync();
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : result.IsSuccess ? "复制成功" : result.ErrorMessage;
|
||||||
return result.IsSuccess ? "复制成功" : result.ErrorMessage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -84,14 +83,17 @@ namespace Tnb.BasicData
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetMaterialSelectInfo(MaterialSelectQueryInput queryInput)
|
public async Task<dynamic> GetMaterialSelectInfo(MaterialSelectQueryInput queryInput)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
if (!string.IsNullOrEmpty(queryInput.ebom_id))
|
if (!string.IsNullOrEmpty(queryInput.ebom_id))
|
||||||
{
|
{
|
||||||
List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id, 0);
|
List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id, 0);
|
||||||
BasEbomH ebom = await db.Queryable<BasEbomH>().Where(x => x.id == queryInput.ebom_id).SingleAsync();
|
BasEbomH ebom = await db.Queryable<BasEbomH>().Where(x => x.id == queryInput.ebom_id).SingleAsync();
|
||||||
if (ebom != null && !string.IsNullOrEmpty(ebom.material_id))
|
if (ebom != null && !string.IsNullOrEmpty(ebom.material_id))
|
||||||
|
{
|
||||||
ids.Add(ebom.material_id);
|
ids.Add(ebom.material_id);
|
||||||
var result = await db.Queryable<BasMaterial>()
|
}
|
||||||
|
|
||||||
|
SqlSugarPagedList<MaterialSelectOutput> result = await db.Queryable<BasMaterial>()
|
||||||
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null)
|
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null)
|
||||||
.LeftJoin<DictionaryDataEntity>((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode)
|
.LeftJoin<DictionaryDataEntity>((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode)
|
||||||
.WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info))
|
.WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info))
|
||||||
@@ -111,7 +113,7 @@ namespace Tnb.BasicData
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var result = await db.Queryable<BasMaterial>()
|
SqlSugarPagedList<MaterialSelectOutput> result = await db.Queryable<BasMaterial>()
|
||||||
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null)
|
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null)
|
||||||
.LeftJoin<DictionaryDataEntity>((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode)
|
.LeftJoin<DictionaryDataEntity>((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode)
|
||||||
.WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info))
|
.WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info))
|
||||||
@@ -132,11 +134,11 @@ namespace Tnb.BasicData
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetCanCreateSubWorkOrderMaterial(MaterialSelectQueryInput queryInput)
|
public async Task<dynamic> GetCanCreateSubWorkOrderMaterial(MaterialSelectQueryInput queryInput)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
if (!string.IsNullOrEmpty(queryInput.ebom_id))
|
if (!string.IsNullOrEmpty(queryInput.ebom_id))
|
||||||
{
|
{
|
||||||
List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id, 0);
|
List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id, 0);
|
||||||
var result = await db.Queryable<BasMaterial>()
|
SqlSugarPagedList<MaterialSelectOutput> result = await db.Queryable<BasMaterial>()
|
||||||
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null)
|
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null)
|
||||||
.LeftJoin<DictionaryDataEntity>((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode)
|
.LeftJoin<DictionaryDataEntity>((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode)
|
||||||
.WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info))
|
.WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info))
|
||||||
@@ -167,8 +169,8 @@ namespace Tnb.BasicData
|
|||||||
string types = dic["types"];
|
string types = dic["types"];
|
||||||
string[] typeArr = types.Split(",");
|
string[] typeArr = types.Split(",");
|
||||||
List<BasMaterial> list = await _repository.AsSugarClient().Queryable<BasMaterial>().Where(x => x.state == "1").ToListAsync();
|
List<BasMaterial> list = await _repository.AsSugarClient().Queryable<BasMaterial>().Where(x => x.state == "1").ToListAsync();
|
||||||
List<BasMaterial> result = new List<BasMaterial>();
|
List<BasMaterial> result = new();
|
||||||
foreach (var type in typeArr)
|
foreach (string type in typeArr)
|
||||||
{
|
{
|
||||||
result.AddRange(list.Where(x => x.category_id.Contains(type)));
|
result.AddRange(list.Where(x => x.category_id.Contains(type)));
|
||||||
}
|
}
|
||||||
@@ -179,19 +181,19 @@ namespace Tnb.BasicData
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetMaterialByQueryJson(MaterialQueryInput input)
|
public async Task<dynamic> GetMaterialByQueryJson(MaterialQueryInput input)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
Dictionary<string, string>? queryJson = new();
|
||||||
if (input != null && !string.IsNullOrEmpty(input.queryJson))
|
if (input != null && !string.IsNullOrEmpty(input.queryJson))
|
||||||
{
|
{
|
||||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input?.queryJson ?? "");
|
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input?.queryJson ?? "");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> typeList = new List<string>();
|
List<string> typeList = new();
|
||||||
if (!string.IsNullOrEmpty(input!.types))
|
if (!string.IsNullOrEmpty(input!.types))
|
||||||
{
|
{
|
||||||
typeList = JsonConvert.DeserializeObject<List<string>>((input?.types??"")) ?? new List<string>();
|
typeList = JsonConvert.DeserializeObject<List<string>>(input?.types ?? "") ?? new List<string>();
|
||||||
}
|
}
|
||||||
var query = db.Queryable<BasMaterial>()
|
ISugarQueryable<BasMaterial> query = db.Queryable<BasMaterial>()
|
||||||
.Where(x => x.state == "1")
|
.Where(x => x.state == "1")
|
||||||
.WhereIF(queryJson != null && queryJson.ContainsKey("name"), x => x.name.Contains(queryJson!["name"]))
|
.WhereIF(queryJson != null && queryJson.ContainsKey("name"), x => x.name.Contains(queryJson!["name"]))
|
||||||
.WhereIF(queryJson != null && queryJson.ContainsKey("code"), x => x.code.Contains(queryJson!["code"]))
|
.WhereIF(queryJson != null && queryJson.ContainsKey("code"), x => x.code.Contains(queryJson!["code"]))
|
||||||
@@ -199,20 +201,20 @@ namespace Tnb.BasicData
|
|||||||
x => x.material_standard!.Contains(queryJson!["material_standard"]))
|
x => x.material_standard!.Contains(queryJson!["material_standard"]))
|
||||||
.Select(x => x);
|
.Select(x => x);
|
||||||
|
|
||||||
var list = new List<ISugarQueryable<BasMaterial>>();
|
List<ISugarQueryable<BasMaterial>> list = new();
|
||||||
foreach (var type in typeList)
|
foreach (string type in typeList)
|
||||||
{
|
{
|
||||||
list.Add(query.Clone().Where(x => x.category_id.Contains(type)));
|
list.Add(query.Clone().Where(x => x.category_id.Contains(type)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list.Count <= 0)
|
if (list.Count <= 0)
|
||||||
{
|
{
|
||||||
var result = await query.ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50));
|
SqlSugarPagedList<BasMaterial> result = await query.ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
||||||
return PageResult<BasMaterial>.SqlSugarPageResult(result);
|
return PageResult<BasMaterial>.SqlSugarPageResult(result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var result = await db.UnionAll(list).Select<BasMaterial>().ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50));
|
SqlSugarPagedList<BasMaterial> result = await db.UnionAll(list).Select<BasMaterial>().ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
||||||
return PageResult<BasMaterial>.SqlSugarPageResult(result);
|
return PageResult<BasMaterial>.SqlSugarPageResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,17 +226,25 @@ namespace Tnb.BasicData
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<List<string>> GetAllChildrenMaterialId(string ebomId, int index)
|
private async Task<List<string>> GetAllChildrenMaterialId(string ebomId, int index)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(ebomId)) return new List<string>();
|
if (string.IsNullOrEmpty(ebomId))
|
||||||
List<string> ids = new List<string>();
|
{
|
||||||
if (index++ > 10) return ids;
|
return new List<string>();
|
||||||
var list = await _repository.AsSugarClient().Queryable<BasEbomD>().Where(x => x.ebom_id == ebomId)
|
}
|
||||||
|
|
||||||
|
List<string> ids = new();
|
||||||
|
if (index++ > 10)
|
||||||
|
{
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> list = await _repository.AsSugarClient().Queryable<BasEbomD>().Where(x => x.ebom_id == ebomId)
|
||||||
.Select<string>(x => x.material_id).ToListAsync();
|
.Select<string>(x => x.material_id).ToListAsync();
|
||||||
if (list != null && list.Count > 0)
|
if (list != null && list.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var id in list)
|
foreach (string id in list)
|
||||||
{
|
{
|
||||||
//获取最新创建的物料清单
|
//获取最新创建的物料清单
|
||||||
var ebom = await _repository.AsSugarClient().Queryable<BasEbomH>().Where(x=>x.material_id==id).OrderByDescending(x=>x.create_time).FirstAsync();
|
BasEbomH ebom = await _repository.AsSugarClient().Queryable<BasEbomH>().Where(x => x.material_id == id).OrderByDescending(x => x.create_time).FirstAsync();
|
||||||
ids.AddRange(await GetAllChildrenMaterialId(ebom?.id ?? "", index));
|
ids.AddRange(await GetAllChildrenMaterialId(ebom?.id ?? "", index));
|
||||||
}
|
}
|
||||||
ids.AddRange(list);
|
ids.AddRange(list);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
|
using JNPF.Common.Extension;
|
||||||
using JNPF.Common.Filter;
|
using JNPF.Common.Filter;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
@@ -11,10 +12,8 @@ using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.BasicData.Interfaces;
|
|
||||||
using Tnb.BasicData.Entities.Dto;
|
using Tnb.BasicData.Entities.Dto;
|
||||||
using NPOI.OpenXmlFormats.Dml;
|
using Tnb.BasicData.Interfaces;
|
||||||
using JNPF.Common.Extension;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData
|
namespace Tnb.BasicData
|
||||||
{
|
{
|
||||||
@@ -56,10 +55,10 @@ namespace Tnb.BasicData
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
public async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
Dictionary<string, object>? queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
Dictionary<string, object>? queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||||
string materialInfo = queryJson?["query_info"]?.ToString() ?? "";
|
string materialInfo = queryJson?["query_info"]?.ToString() ?? "";
|
||||||
var list = await db.Queryable<BasMbom, BasMaterial, BasEbomH, BasRouteH>((a, b, c, d) => new object[]
|
SqlSugarPagedList<MbomListOutput> list = await db.Queryable<BasMbom, BasMaterial, BasEbomH, BasRouteH>((a, b, c, d) => new object[]
|
||||||
{
|
{
|
||||||
JoinType.Left, a.material_id == b.id,
|
JoinType.Left, a.material_id == b.id,
|
||||||
JoinType.Left, a.ebom_id == c.id,
|
JoinType.Left, a.ebom_id == c.id,
|
||||||
@@ -90,13 +89,13 @@ namespace Tnb.BasicData
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<dynamic> GetInfo(string id)
|
public async Task<dynamic> GetInfo(string id)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
BasMbom mbom = await _repository.GetSingleAsync(x => x.id == id);
|
BasMbom mbom = await _repository.GetSingleAsync(x => x.id == id);
|
||||||
List<BasMbomProcess> processes = await db.Queryable<BasMbomProcess>().Where(x => x.mbom_id == id).OrderBy(x => x.ordinal).ToListAsync();
|
List<BasMbomProcess> processes = await db.Queryable<BasMbomProcess>().Where(x => x.mbom_id == id).OrderBy(x => x.ordinal).ToListAsync();
|
||||||
List<BasMbomInput> inputs = await db.Queryable<BasMbomInput>().Where(x => x.mbom_id == id).ToListAsync();
|
List<BasMbomInput> inputs = await db.Queryable<BasMbomInput>().Where(x => x.mbom_id == id).ToListAsync();
|
||||||
List<BasMbomOutput> outputs = await db.Queryable<BasMbomOutput>().Where(x => x.mbom_id == id).ToListAsync();
|
List<BasMbomOutput> outputs = await db.Queryable<BasMbomOutput>().Where(x => x.mbom_id == id).ToListAsync();
|
||||||
MbomDataOutput mbomDataOutput = new MbomDataOutput();
|
MbomDataOutput mbomDataOutput = new();
|
||||||
List<MbomProcessOutDto> mbomProcessOutDtos = new List<MbomProcessOutDto>();
|
List<MbomProcessOutDto> mbomProcessOutDtos = new();
|
||||||
|
|
||||||
mbomDataOutput.id = mbom.id;
|
mbomDataOutput.id = mbom.id;
|
||||||
mbomDataOutput.ebom_id = mbom.ebom_id;
|
mbomDataOutput.ebom_id = mbom.ebom_id;
|
||||||
@@ -158,9 +157,12 @@ namespace Tnb.BasicData
|
|||||||
public async Task<dynamic> GetSubMoListByBomId([FromRoute] string bomId)
|
public async Task<dynamic> GetSubMoListByBomId([FromRoute] string bomId)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(bomId)) throw new ArgumentException($"parameter {nameof(bomId)} not be null or empty");
|
if (string.IsNullOrEmpty(bomId))
|
||||||
|
{
|
||||||
|
throw new ArgumentException($"parameter {nameof(bomId)} not be null or empty");
|
||||||
|
}
|
||||||
|
|
||||||
var result = await _db.Queryable<BasMbom>()
|
List<SubBomListOutput> result = await _db.Queryable<BasMbom>()
|
||||||
.LeftJoin<BasMbomProcess>((a, b) => a.id == b.mbom_id)
|
.LeftJoin<BasMbomProcess>((a, b) => a.id == b.mbom_id)
|
||||||
.LeftJoin<BasRouteH>((a, b, c) => a.route_id == c.id)
|
.LeftJoin<BasRouteH>((a, b, c) => a.route_id == c.id)
|
||||||
// .LeftJoin<BasRouteD>((a, b, c, d) => b.process_id == d.process_id && c.id == d.route_id)
|
// .LeftJoin<BasRouteD>((a, b, c, d) => b.process_id == d.process_id && c.id == d.route_id)
|
||||||
@@ -194,7 +196,7 @@ namespace Tnb.BasicData
|
|||||||
.Where(x => x.mbom_process_id == id)
|
.Where(x => x.mbom_process_id == id)
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
material_id = x.material_id,
|
x.material_id,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
@@ -231,7 +233,7 @@ namespace Tnb.BasicData
|
|||||||
material_name = b.name,
|
material_name = b.name,
|
||||||
start_time = a.start_time.HasValue ? a.start_time.Value.ToString(DbTimeFormat.SS) : null,
|
start_time = a.start_time.HasValue ? a.start_time.Value.ToString(DbTimeFormat.SS) : null,
|
||||||
end_time = a.end_time.HasValue ? a.end_time.Value.ToString(DbTimeFormat.SS) : null,
|
end_time = a.end_time.HasValue ? a.end_time.Value.ToString(DbTimeFormat.SS) : null,
|
||||||
version = a.version,
|
a.version,
|
||||||
route_id = c.id,
|
route_id = c.id,
|
||||||
route_name = c.name,
|
route_name = c.name,
|
||||||
})
|
})
|
||||||
@@ -529,7 +531,7 @@ namespace Tnb.BasicData
|
|||||||
{
|
{
|
||||||
string mbomId = SnowflakeIdHelper.NextId();
|
string mbomId = SnowflakeIdHelper.NextId();
|
||||||
string orgId = _userManager.GetUserInfo().Result.organizeId;
|
string orgId = _userManager.GetUserInfo().Result.organizeId;
|
||||||
BasMbom mbom = new BasMbom()
|
BasMbom mbom = new()
|
||||||
{
|
{
|
||||||
id = mbomId,
|
id = mbomId,
|
||||||
org_id = orgId,
|
org_id = orgId,
|
||||||
@@ -554,15 +556,15 @@ namespace Tnb.BasicData
|
|||||||
errorCode = ErrorCode.COM1004;
|
errorCode = ErrorCode.COM1004;
|
||||||
throw Oops.Oh(ErrorCode.COM1004);
|
throw Oops.Oh(ErrorCode.COM1004);
|
||||||
}
|
}
|
||||||
await _repository.InsertAsync(mbom);
|
_ = await _repository.InsertAsync(mbom);
|
||||||
List<BasMbomProcess> processes = new List<BasMbomProcess>();
|
List<BasMbomProcess> processes = new();
|
||||||
List<BasMbomInput> inputs = new List<BasMbomInput>();
|
List<BasMbomInput> inputs = new();
|
||||||
List<BasMbomOutput> outputs = new List<BasMbomOutput>();
|
List<BasMbomOutput> outputs = new();
|
||||||
|
|
||||||
if (mbomSaveDataInput != null && mbomSaveDataInput.processes != null)
|
if (mbomSaveDataInput != null && mbomSaveDataInput.processes != null)
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
foreach (var process in mbomSaveDataInput.processes)
|
foreach (MbomProcessDto? process in mbomSaveDataInput.processes)
|
||||||
{
|
{
|
||||||
string mbomProcessId = SnowflakeIdHelper.NextId();
|
string mbomProcessId = SnowflakeIdHelper.NextId();
|
||||||
processes.Add(new BasMbomProcess()
|
processes.Add(new BasMbomProcess()
|
||||||
@@ -586,7 +588,7 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
if (process.inputs != null)
|
if (process.inputs != null)
|
||||||
{
|
{
|
||||||
foreach (var input in process.inputs)
|
foreach (BasMbomInput input in process.inputs)
|
||||||
{
|
{
|
||||||
string inputId = SnowflakeIdHelper.NextId();
|
string inputId = SnowflakeIdHelper.NextId();
|
||||||
inputs.Add(new BasMbomInput()
|
inputs.Add(new BasMbomInput()
|
||||||
@@ -605,7 +607,7 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
if (process.outputs != null)
|
if (process.outputs != null)
|
||||||
{
|
{
|
||||||
foreach (var output in process.outputs)
|
foreach (BasMbomOutput output in process.outputs)
|
||||||
{
|
{
|
||||||
string outputId = SnowflakeIdHelper.NextId();
|
string outputId = SnowflakeIdHelper.NextId();
|
||||||
outputs.Add(new BasMbomOutput()
|
outputs.Add(new BasMbomOutput()
|
||||||
@@ -626,17 +628,17 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
if (processes.Count > 0)
|
if (processes.Count > 0)
|
||||||
{
|
{
|
||||||
await _repository.AsSugarClient().Insertable<BasMbomProcess>(processes).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Insertable<BasMbomProcess>(processes).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputs.Count > 0)
|
if (inputs.Count > 0)
|
||||||
{
|
{
|
||||||
await _repository.AsSugarClient().Insertable<BasMbomInput>(inputs).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Insertable<BasMbomInput>(inputs).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputs.Count > 0)
|
if (outputs.Count > 0)
|
||||||
{
|
{
|
||||||
await _repository.AsSugarClient().Insertable<BasMbomOutput>(outputs).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Insertable<BasMbomOutput>(outputs).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else//修改
|
else//修改
|
||||||
@@ -651,7 +653,7 @@ namespace Tnb.BasicData
|
|||||||
string orgId = _userManager.GetUserInfo().Result.organizeId;
|
string orgId = _userManager.GetUserInfo().Result.organizeId;
|
||||||
if (mbomSaveDataInput != null)
|
if (mbomSaveDataInput != null)
|
||||||
{
|
{
|
||||||
await _repository.UpdateAsync(x => new BasMbom()
|
_ = await _repository.UpdateAsync(x => new BasMbom()
|
||||||
{
|
{
|
||||||
// org_id = orgId,
|
// org_id = orgId,
|
||||||
material_id = mbomSaveDataInput.material_id,
|
material_id = mbomSaveDataInput.material_id,
|
||||||
@@ -670,12 +672,12 @@ namespace Tnb.BasicData
|
|||||||
}, x => x.id == mbomSaveDataInput.id);
|
}, x => x.id == mbomSaveDataInput.id);
|
||||||
}
|
}
|
||||||
// List<BasMbomProcess> processes = new List<BasMbomProcess>();
|
// List<BasMbomProcess> processes = new List<BasMbomProcess>();
|
||||||
List<BasMbomInput> inputs = new List<BasMbomInput>();
|
List<BasMbomInput> inputs = new();
|
||||||
List<BasMbomOutput> outputs = new List<BasMbomOutput>();
|
List<BasMbomOutput> outputs = new();
|
||||||
|
|
||||||
if (mbomSaveDataInput != null && mbomSaveDataInput.processes != null)
|
if (mbomSaveDataInput != null && mbomSaveDataInput.processes != null)
|
||||||
{
|
{
|
||||||
foreach (var process in mbomSaveDataInput.processes)
|
foreach (MbomProcessDto? process in mbomSaveDataInput.processes)
|
||||||
{
|
{
|
||||||
string mbomProcessId = process.id;
|
string mbomProcessId = process.id;
|
||||||
// string mbomProcessId = SnowflakeIdHelper.NextId();
|
// string mbomProcessId = SnowflakeIdHelper.NextId();
|
||||||
@@ -694,7 +696,7 @@ namespace Tnb.BasicData
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
decimal preparation_time = process?.preparation_time ?? 0;
|
decimal preparation_time = process?.preparation_time ?? 0;
|
||||||
await _repository.AsSugarClient().Updateable<BasMbomProcess>()
|
_ = await _repository.AsSugarClient().Updateable<BasMbomProcess>()
|
||||||
.SetColumns(x => x.preparation_time == preparation_time)
|
.SetColumns(x => x.preparation_time == preparation_time)
|
||||||
.SetColumns(x => x.station == process!.station)
|
.SetColumns(x => x.station == process!.station)
|
||||||
.SetColumns(x => x.byproduct_status == process!.byproduct_status)
|
.SetColumns(x => x.byproduct_status == process!.byproduct_status)
|
||||||
@@ -703,7 +705,7 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
if (process!.inputs != null)
|
if (process!.inputs != null)
|
||||||
{
|
{
|
||||||
foreach (var input in process.inputs)
|
foreach (BasMbomInput input in process.inputs)
|
||||||
{
|
{
|
||||||
string inputId = SnowflakeIdHelper.NextId();
|
string inputId = SnowflakeIdHelper.NextId();
|
||||||
inputs.Add(new BasMbomInput()
|
inputs.Add(new BasMbomInput()
|
||||||
@@ -722,7 +724,7 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
if (process.outputs != null)
|
if (process.outputs != null)
|
||||||
{
|
{
|
||||||
foreach (var output in process.outputs)
|
foreach (BasMbomOutput output in process.outputs)
|
||||||
{
|
{
|
||||||
string outputId = SnowflakeIdHelper.NextId();
|
string outputId = SnowflakeIdHelper.NextId();
|
||||||
outputs.Add(new BasMbomOutput()
|
outputs.Add(new BasMbomOutput()
|
||||||
@@ -745,8 +747,8 @@ namespace Tnb.BasicData
|
|||||||
if (mbomSaveDataInput != null && !string.IsNullOrEmpty(mbomSaveDataInput.id))
|
if (mbomSaveDataInput != null && !string.IsNullOrEmpty(mbomSaveDataInput.id))
|
||||||
{
|
{
|
||||||
// await _repository.AsSugarClient().Deleteable<BasMbomProcess>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
// await _repository.AsSugarClient().Deleteable<BasMbomProcess>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
||||||
await _repository.AsSugarClient().Deleteable<BasMbomInput>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Deleteable<BasMbomInput>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
||||||
await _repository.AsSugarClient().Deleteable<BasMbomOutput>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Deleteable<BasMbomOutput>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
// if (processes.Count > 0)
|
// if (processes.Count > 0)
|
||||||
// {
|
// {
|
||||||
@@ -755,12 +757,12 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
if (inputs.Count > 0)
|
if (inputs.Count > 0)
|
||||||
{
|
{
|
||||||
await _repository.AsSugarClient().Insertable<BasMbomInput>(inputs).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Insertable<BasMbomInput>(inputs).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputs.Count > 0)
|
if (outputs.Count > 0)
|
||||||
{
|
{
|
||||||
await _repository.AsSugarClient().Insertable<BasMbomOutput>(outputs).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Insertable<BasMbomOutput>(outputs).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using Aop.Api.Domain;
|
|
||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
using JNPF.Common.Dtos.VisualDev;
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
@@ -7,20 +6,15 @@ using JNPF.DependencyInjection;
|
|||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
using JNPF.Systems.Entitys.System;
|
|
||||||
using JNPF.Systems.Interfaces.System;
|
|
||||||
using JNPF.VisualDev;
|
using JNPF.VisualDev;
|
||||||
using JNPF.VisualDev.Entitys;
|
using JNPF.VisualDev.Entitys;
|
||||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||||
using JNPF.VisualDev.Interfaces;
|
using JNPF.VisualDev.Interfaces;
|
||||||
using Mapster;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData;
|
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.BasicData.Entitys.Dto.BasProcess;
|
using Tnb.BasicData.Entitys.Dto.BasProcess;
|
||||||
using Tnb.BasicData.Interfaces;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData
|
namespace Tnb.BasicData
|
||||||
{
|
{
|
||||||
@@ -64,21 +58,16 @@ namespace Tnb.BasicData
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||||
{
|
{
|
||||||
var result = new SqlSugarPagedList<ProcessListOutput>();
|
SqlSugarPagedList<ProcessListOutput> result = new();
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
var organize = await db.Queryable<OrganizeEntity>().FirstAsync(it => it.EnCode == input.station_code && it.Category == DictConst.RegionCategoryStationCode);
|
OrganizeEntity organize = await db.Queryable<OrganizeEntity>().FirstAsync(it => it.EnCode == input.station_code && it.Category == DictConst.RegionCategoryStationCode);
|
||||||
if (organize != null)
|
if (organize != null)
|
||||||
{
|
{
|
||||||
var whereExpr = Expressionable.Create<BasProcess, BasProcessStation>();
|
Expressionable<BasProcess, BasProcessStation> whereExpr = Expressionable.Create<BasProcess, BasProcessStation>();
|
||||||
var curProcessIds = await db.Queryable<BasProcessStation>().Where(it => it.station_id == organize.Id).Select(it => it.process_id).Distinct().ToListAsync();
|
List<string> curProcessIds = await db.Queryable<BasProcessStation>().Where(it => it.station_id == organize.Id).Select(it => it.process_id).Distinct().ToListAsync();
|
||||||
if (curProcessIds?.Count > 0)
|
whereExpr = curProcessIds?.Count > 0
|
||||||
{
|
? whereExpr.And((a, b) => curProcessIds.Contains(a.id)).Or((a, b) => string.IsNullOrEmpty(b.process_id))
|
||||||
whereExpr = whereExpr.And((a, b) => curProcessIds.Contains(a.id)).Or((a, b) => string.IsNullOrEmpty(b.process_id));
|
: whereExpr.And((a, b) => string.IsNullOrEmpty(b.process_id));
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
whereExpr = whereExpr.And((a, b) => string.IsNullOrEmpty(b.process_id));
|
|
||||||
}
|
|
||||||
result = await db.Queryable<BasProcess>().LeftJoin<BasProcessStation>((a, b) => a.id == b.process_id).Where(whereExpr.ToExpression()).Select(a => new ProcessListOutput
|
result = await db.Queryable<BasProcess>().LeftJoin<BasProcessStation>((a, b) => a.id == b.process_id).Where(whereExpr.ToExpression()).Select(a => new ProcessListOutput
|
||||||
{
|
{
|
||||||
id = a.id,
|
id = a.id,
|
||||||
@@ -118,8 +107,8 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
string processId = visualDevModelDataCrInput.data["ReturnIdentity"].ToString() ?? "";
|
string processId = visualDevModelDataCrInput.data["ReturnIdentity"].ToString() ?? "";
|
||||||
|
|
||||||
List<BasProcessStation> list = new List<BasProcessStation>();
|
List<BasProcessStation> list = new();
|
||||||
foreach (var item in (JArray)visualDevModelDataCrInput.data["station"])
|
foreach (JToken item in (JArray)visualDevModelDataCrInput.data["station"])
|
||||||
{
|
{
|
||||||
|
|
||||||
string processStationId = SnowflakeIdHelper.NextId();
|
string processStationId = SnowflakeIdHelper.NextId();
|
||||||
@@ -134,11 +123,10 @@ namespace Tnb.BasicData
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await _repository.AsSugarClient().Insertable<BasProcessStation>(list).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Insertable<BasProcessStation>(list).ExecuteCommandAsync();
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "保存成功" : result.ErrorMessage);
|
||||||
return result.IsSuccess ? "保存成功" : result.ErrorMessage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.VisualDev.Interfaces;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
@@ -28,7 +26,7 @@ namespace Tnb.BasicData
|
|||||||
public async Task<dynamic> Stop(Dictionary<string, string> dic)
|
public async Task<dynamic> Stop(Dictionary<string, string> dic)
|
||||||
{
|
{
|
||||||
string id = dic["id"];
|
string id = dic["id"];
|
||||||
await _repository.UpdateAsync(x => new BasPushRuleLog()
|
_ = await _repository.UpdateAsync(x => new BasPushRuleLog()
|
||||||
{
|
{
|
||||||
is_push = 0,
|
is_push = 0,
|
||||||
}, x => x.biz_id == id);
|
}, x => x.biz_id == id);
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ using JNPF.Systems.Interfaces.System;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.BasicData.Entities.Dto;
|
|
||||||
using Tnb.BasicData.Entitys.Dto.BasProcess;
|
|
||||||
using Tnb.BasicData.Interfaces;
|
using Tnb.BasicData.Interfaces;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.WarehouseMgr.Entities;
|
using Tnb.WarehouseMgr.Entities;
|
||||||
@@ -34,10 +32,14 @@ namespace Tnb.BasicData
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetQrcodeByCode(Dictionary<string, string> dic)
|
public async Task<dynamic?> GetQrcodeByCode(Dictionary<string, string> dic)
|
||||||
{
|
{
|
||||||
string code = dic.ContainsKey("code") ? dic["code"] : "";
|
string code = dic.ContainsKey("code") ? dic["code"] : "";
|
||||||
if (string.IsNullOrEmpty(code)) return null;
|
if (string.IsNullOrEmpty(code))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var result = await _repository.AsSugarClient().Queryable<BasQrcode>()
|
var result = await _repository.AsSugarClient().Queryable<BasQrcode>()
|
||||||
.LeftJoin<OrganizeEntity>((a, b) => a.source_id == b.Id)
|
.LeftJoin<OrganizeEntity>((a, b) => a.source_id == b.Id)
|
||||||
.LeftJoin<EqpEquipment>((a, b, c) => a.source_id == c.id)
|
.LeftJoin<EqpEquipment>((a, b, c) => a.source_id == c.id)
|
||||||
@@ -47,9 +49,9 @@ namespace Tnb.BasicData
|
|||||||
.Where((a, b, c, d) => a.code == code)
|
.Where((a, b, c, d) => a.code == code)
|
||||||
.Select((a, b, c, d, e, f) => new
|
.Select((a, b, c, d, e, f) => new
|
||||||
{
|
{
|
||||||
id = a.id,
|
a.id,
|
||||||
source_id = a.source_id,
|
a.source_id,
|
||||||
source_name = a.source_name,
|
a.source_name,
|
||||||
org_code = b.EnCode,
|
org_code = b.EnCode,
|
||||||
org_name = b.FullName,
|
org_name = b.FullName,
|
||||||
equip_code = a.code,
|
equip_code = a.code,
|
||||||
@@ -57,17 +59,21 @@ namespace Tnb.BasicData
|
|||||||
tool_location_code = d.location_code,
|
tool_location_code = d.location_code,
|
||||||
bas_location_name = e.location_name,
|
bas_location_name = e.location_name,
|
||||||
bas_location_code = e.location_code,
|
bas_location_code = e.location_code,
|
||||||
carry_name = f.carry_name,
|
f.carry_name,
|
||||||
carry_code = f.carry_code,
|
f.carry_code,
|
||||||
}).FirstAsync();
|
}).FirstAsync();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetWorkStationByCode(Dictionary<string, string> dic)
|
public async Task<dynamic?> GetWorkStationByCode(Dictionary<string, string> dic)
|
||||||
{
|
{
|
||||||
string code = dic.ContainsKey("code") ? dic["code"] : "";
|
string code = dic.ContainsKey("code") ? dic["code"] : "";
|
||||||
if (string.IsNullOrEmpty(code)) return null;
|
if (string.IsNullOrEmpty(code))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var result = await _repository.AsSugarClient().Queryable<BasQrcode>()
|
var result = await _repository.AsSugarClient().Queryable<BasQrcode>()
|
||||||
.LeftJoin<OrganizeEntity>((a, b) => a.source_id == b.Id)
|
.LeftJoin<OrganizeEntity>((a, b) => a.source_id == b.Id)
|
||||||
.LeftJoin<OrganizeRelationEntity>((a, b, c) => a.source_id == c.ObjectId && c.ObjectType == "Eqp")
|
.LeftJoin<OrganizeRelationEntity>((a, b, c) => a.source_id == c.ObjectId && c.ObjectType == "Eqp")
|
||||||
@@ -75,9 +81,9 @@ namespace Tnb.BasicData
|
|||||||
.Where((a, b, c) => a.code == code)
|
.Where((a, b, c) => a.code == code)
|
||||||
.Select((a, b, c, d) => new
|
.Select((a, b, c, d) => new
|
||||||
{
|
{
|
||||||
id = a.id,
|
a.id,
|
||||||
source_id = a.source_id,
|
a.source_id,
|
||||||
source_name = a.source_name,
|
a.source_name,
|
||||||
org_id = b.Id,
|
org_id = b.Id,
|
||||||
org_code = b.EnCode,
|
org_code = b.EnCode,
|
||||||
org_name = b.FullName,
|
org_name = b.FullName,
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ using JNPF.FriendlyException;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.BasicData.Interfaces;
|
|
||||||
using Tnb.BasicData.Entities.Dto;
|
using Tnb.BasicData.Entities.Dto;
|
||||||
|
using Tnb.BasicData.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.BasicData
|
namespace Tnb.BasicData
|
||||||
{
|
{
|
||||||
@@ -40,7 +40,7 @@ namespace Tnb.BasicData
|
|||||||
{
|
{
|
||||||
string id = parameters["id"];
|
string id = parameters["id"];
|
||||||
|
|
||||||
await _repository.UpdateAsync(x => new BasRouteH()
|
_ = await _repository.UpdateAsync(x => new BasRouteH()
|
||||||
{
|
{
|
||||||
status = "1",
|
status = "1",
|
||||||
}, x => x.id == id);
|
}, x => x.id == id);
|
||||||
@@ -66,18 +66,17 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
||||||
{
|
{
|
||||||
await _repository.InsertAsync(basRouteH);
|
_ = await _repository.InsertAsync(basRouteH);
|
||||||
foreach (BasRouteD basRouteD in basRouteDs)
|
foreach (BasRouteD basRouteD in basRouteDs)
|
||||||
{
|
{
|
||||||
basRouteD.id = SnowflakeIdHelper.NextId();
|
basRouteD.id = SnowflakeIdHelper.NextId();
|
||||||
basRouteD.route_id = newId;
|
basRouteD.route_id = newId;
|
||||||
}
|
}
|
||||||
|
|
||||||
await _repository.AsSugarClient().Insertable<BasRouteD>(basRouteDs).ExecuteCommandAsync();
|
_ = await _repository.AsSugarClient().Insertable<BasRouteD>(basRouteDs).ExecuteCommandAsync();
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : result.IsSuccess ? "复制成功" : result.ErrorMessage;
|
||||||
return result.IsSuccess ? "复制成功" : result.ErrorMessage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -86,8 +85,8 @@ namespace Tnb.BasicData
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetValidRouteList([FromBody] VisualDevDataFieldDataListInput pageInput)
|
public async Task<dynamic> GetValidRouteList([FromBody] VisualDevDataFieldDataListInput pageInput)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
var result = await db.Queryable<BasRouteH>()
|
SqlSugarPagedList<VaildRouteOutput> result = await db.Queryable<BasRouteH>()
|
||||||
.Where(x => x.status == "1"
|
.Where(x => x.status == "1"
|
||||||
&& ((x.start_time != null && x.start_time.Value <= DateTime.Now && x.end_time != null && x.end_time.Value >= DateTime.Now)
|
&& ((x.start_time != null && x.start_time.Value <= DateTime.Now && x.end_time != null && x.end_time.Value >= DateTime.Now)
|
||||||
|| (x.start_time == null && x.end_time >= DateTime.Now)
|
|| (x.start_time == null && x.end_time >= DateTime.Now)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Import Project="$(SolutionDir)\common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Consts
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Consts
|
|
||||||
{
|
{
|
||||||
public class MoldPlanMaintainStatus
|
public class MoldPlanMaintainStatus
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Consts
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Consts
|
|
||||||
{
|
{
|
||||||
public class MoldUseStatus
|
public class MoldUseStatus
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
public class BaseMoldMaintainInput
|
public class BaseMoldMaintainInput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
public class CheckItemOutput
|
public class CheckItemOutput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据模具ID、计划ID获取,保养组及项目信息
|
/// 根据模具ID、计划ID获取,保养组及项目信息
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
public class ClosedownEndListOutput
|
public class ClosedownEndListOutput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备列表输出类
|
/// 设备列表输出类
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
public class MaintainInfoQueryinput
|
public class MaintainInfoQueryinput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成保养计划输入参数
|
/// 生成保养计划输入参数
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using NPOI.HSSF.Record.Chart;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保养计划模具列表输出参数
|
/// 保养计划模具列表输出参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保养规则关联模具列表输出参数
|
/// 保养规则关联模具列表输出参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修改维修单任务状态输入参数
|
/// 修改维修单任务状态输入参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料列表输出类
|
/// 物料列表输出类
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
public class RelevanceMoldListOutput
|
public class RelevanceMoldListOutput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具保养删除参数
|
/// 模具保养删除参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关联保养组与模具输入参数
|
/// 关联保养组与模具输入参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具保养项输入参数
|
/// 模具保养项输入参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具保养项列表输出
|
/// 模具保养项列表输出
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具保养计划执行查询输出参数
|
/// 模具保养计划执行查询输出参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具保养执行输入参数
|
/// 模具保养执行输入参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
public class MoldMaintainUpInput
|
public class MoldMaintainUpInput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具规则选择列表输出类
|
/// 模具规则选择列表输出类
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Numerics;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
public class PadMainListOutput
|
public class PadMainListOutput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using JNPF.Common.Filter;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JNPF.Common.Filter;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具保养计划制定-计划关联模具输入参数
|
/// 模具保养计划制定-计划关联模具输入参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具规则定义,关键模具输入参数
|
/// 模具规则定义,关键模具输入参数
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities
|
|
||||||
{
|
{
|
||||||
public class ToolInput
|
public class ToolInput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Dto
|
|
||||||
{
|
{
|
||||||
public class ToolMoldInput
|
public class ToolMoldInput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using JNPF.Common.Contracts;
|
using JNPF.Common.Contracts;
|
||||||
using JNPF.Common.Security;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities;
|
namespace Tnb.EquipMgr.Entities;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using JNPF.Common.Contracts;
|
using JNPF.Common.Contracts;
|
||||||
using JNPF.Common.Security;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities;
|
namespace Tnb.EquipMgr.Entities;
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using SqlSugar;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities
|
namespace Tnb.EquipMgr.Entities
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using JNPF.Common.Contracts;
|
using JNPF.Common.Contracts;
|
||||||
using JNPF.Common.Security;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Yitter.IdGenerator;
|
using Yitter.IdGenerator;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using JNPF.Common.Contracts;
|
using JNPF.Common.Contracts;
|
||||||
using JNPF.Common.Security;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities;
|
namespace Tnb.EquipMgr.Entities;
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using JNPF.Common.Contracts;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JNPF.Common.Contracts;
|
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using JNPF.Common.Contracts;
|
|
||||||
using JNPF.Common.Security;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities;
|
namespace Tnb.EquipMgr.Entities;
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Entities.Enums
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Enums
|
|
||||||
{
|
{
|
||||||
public enum MaintainStatus
|
public enum MaintainStatus
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using Mapster;
|
using Mapster;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
using Tnb.EquipMgr.Entities;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Entities.Mapper
|
namespace Tnb.EquipMgr.Entities.Mapper
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Import Project="$(SolutionDir)\common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using JNPF.Common.Dtos.VisualDev;
|
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using JNPF.Common.Dtos.VisualDev;
|
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 目录库房服务接口
|
/// 目录库房服务接口
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具库位服务接口
|
/// 模具库位服务接口
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模具保养项目组接口
|
/// 模具保养项目组接口
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
|
||||||
{
|
{
|
||||||
public interface IToolMoldMaintainPlanRunService
|
public interface IToolMoldMaintainPlanRunService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
|
||||||
{
|
{
|
||||||
public interface IToolMoldMaintainPlanService
|
public interface IToolMoldMaintainPlanService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备保养规则定义
|
/// 设备保养规则定义
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using Tnb.EquipMgr.Entities;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Tnb.EquipMgr.Entities;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
using System;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
using Tnb.ProductionMgr.Entities.Dto;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr.Interfaces
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Import Project="$(SolutionDir)\common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Enums;
|
|
||||||
using JNPF.Common.Filter;
|
using JNPF.Common.Filter;
|
||||||
using JNPF.Common.Security;
|
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
|
||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
using JNPF.Systems.Entitys.System;
|
using JNPF.Systems.Entitys.System;
|
||||||
using JNPF.VisualDev;
|
using JNPF.VisualDev;
|
||||||
@@ -16,7 +13,6 @@ using SqlSugar;
|
|||||||
using Tnb.BasicData;
|
using Tnb.BasicData;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
using Tnb.EquipMgr.Interfaces;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr
|
namespace Tnb.EquipMgr
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,18 +1,11 @@
|
|||||||
using System;
|
using System.Linq.Expressions;
|
||||||
using System.Collections.Generic;
|
using JNPF.Common.Contracts;
|
||||||
using System.Linq;
|
|
||||||
using System.Linq.Expressions;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Extension;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
using Tnb.EquipMgr.Entities;
|
|
||||||
using Mapster;
|
|
||||||
using JNPF.Common.Contracts;
|
|
||||||
using JNPF.Common.Extension;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr
|
namespace Tnb.EquipMgr
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ using JNPF.Systems.Entitys.Permission;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using Tnb.BasicData;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
using Tnb.EquipMgr.Interfaces;
|
using Tnb.EquipMgr.Interfaces;
|
||||||
using Tnb.BasicData;
|
|
||||||
|
|
||||||
namespace Tnb.EquipMgr
|
namespace Tnb.EquipMgr
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Filter;
|
using JNPF.Common.Filter;
|
||||||
using JNPF.Common.Models;
|
using JNPF.Common.Models;
|
||||||
@@ -9,12 +8,6 @@ using JNPF.FriendlyException;
|
|||||||
using JNPF.Logging;
|
using JNPF.Logging;
|
||||||
using JNPF.Systems.Common;
|
using JNPF.Systems.Common;
|
||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
using JNPF.Systems.Interfaces.Common;
|
|
||||||
using JNPF.VisualDev;
|
|
||||||
using JNPF.VisualDev.Entitys;
|
|
||||||
using JNPF.VisualDev.Interfaces;
|
|
||||||
using Microsoft.AspNetCore.Components.Forms;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|||||||
@@ -1,18 +1,12 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using JNPF.VisualDev;
|
|
||||||
using JNPF.VisualDev.Entitys;
|
|
||||||
using JNPF.VisualDev.Interfaces;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
|
||||||
using Tnb.EquipMgr.Interfaces;
|
using Tnb.EquipMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr
|
namespace Tnb.EquipMgr
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using JNPF.Common.Filter;
|
|||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.Systems.Entitys.Permission;
|
|
||||||
using JNPF.Systems.Entitys.System;
|
using JNPF.Systems.Entitys.System;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Security;
|
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.EquipMgr.Interfaces;
|
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
|
using Tnb.EquipMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr
|
namespace Tnb.EquipMgr
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
using JNPF.Common.Dtos.VisualDev;
|
||||||
using JNPF.Common.Enums;
|
|
||||||
using JNPF.Common.Filter;
|
using JNPF.Common.Filter;
|
||||||
using JNPF.Common.Security;
|
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
@@ -10,9 +8,7 @@ using JNPF.Systems.Entitys.Permission;
|
|||||||
using JNPF.Systems.Entitys.System;
|
using JNPF.Systems.Entitys.System;
|
||||||
using JNPF.Systems.Interfaces.System;
|
using JNPF.Systems.Interfaces.System;
|
||||||
using JNPF.VisualDev;
|
using JNPF.VisualDev;
|
||||||
using JNPF.VisualDev.Entitys;
|
|
||||||
using JNPF.VisualDev.Interfaces;
|
using JNPF.VisualDev.Interfaces;
|
||||||
using Mapster;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
@@ -59,7 +55,8 @@ namespace Tnb.EquipMgr
|
|||||||
if (!input.data.ContainsKey("create_time"))
|
if (!input.data.ContainsKey("create_time"))
|
||||||
{
|
{
|
||||||
input.data.Add("create_time", DateTime.Now);
|
input.data.Add("create_time", DateTime.Now);
|
||||||
}else if ( string.IsNullOrEmpty((string)input.data["create_time"]))
|
}
|
||||||
|
else if (string.IsNullOrEmpty((string)input.data["create_time"]))
|
||||||
{
|
{
|
||||||
input.data["create_time"] = DateTime.Now;
|
input.data["create_time"] = DateTime.Now;
|
||||||
}
|
}
|
||||||
@@ -67,7 +64,8 @@ namespace Tnb.EquipMgr
|
|||||||
if (!input.data.ContainsKey("create_id"))
|
if (!input.data.ContainsKey("create_id"))
|
||||||
{
|
{
|
||||||
input.data.Add("create_id", _userManager.UserId);
|
input.data.Add("create_id", _userManager.UserId);
|
||||||
}else if ( string.IsNullOrEmpty((string)input.data["create_id"]))
|
}
|
||||||
|
else if (string.IsNullOrEmpty((string)input.data["create_id"]))
|
||||||
{
|
{
|
||||||
input.data["create_id"] = _userManager.UserId;
|
input.data["create_id"] = _userManager.UserId;
|
||||||
}
|
}
|
||||||
@@ -75,7 +73,8 @@ namespace Tnb.EquipMgr
|
|||||||
if (!input.data.ContainsKey("apply_user_id"))
|
if (!input.data.ContainsKey("apply_user_id"))
|
||||||
{
|
{
|
||||||
input.data.Add("apply_user_id", _userManager.UserId);
|
input.data.Add("apply_user_id", _userManager.UserId);
|
||||||
}else if ( string.IsNullOrEmpty((string)input.data["apply_user_id"]))
|
}
|
||||||
|
else if (string.IsNullOrEmpty((string)input.data["apply_user_id"]))
|
||||||
{
|
{
|
||||||
input.data["apply_user_id"] = _userManager.UserId;
|
input.data["apply_user_id"] = _userManager.UserId;
|
||||||
}
|
}
|
||||||
@@ -83,7 +82,8 @@ namespace Tnb.EquipMgr
|
|||||||
if (!input.data.ContainsKey("org_id"))
|
if (!input.data.ContainsKey("org_id"))
|
||||||
{
|
{
|
||||||
input.data.Add("org_id", _userManager.GetUserInfo().Result.organizeId);
|
input.data.Add("org_id", _userManager.GetUserInfo().Result.organizeId);
|
||||||
}else if ( string.IsNullOrEmpty((string)input.data["org_id"]))
|
}
|
||||||
|
else if (string.IsNullOrEmpty((string)input.data["org_id"]))
|
||||||
{
|
{
|
||||||
input.data["org_id"] = _userManager.GetUserInfo().Result.organizeId;
|
input.data["org_id"] = _userManager.GetUserInfo().Result.organizeId;
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,8 @@ namespace Tnb.EquipMgr
|
|||||||
if (!input.data.ContainsKey("code"))
|
if (!input.data.ContainsKey("code"))
|
||||||
{
|
{
|
||||||
input.data.Add("code", await _billRuleService.GetBillNumber(CodeTemplateConst.EQPREPAIR_CODE));
|
input.data.Add("code", await _billRuleService.GetBillNumber(CodeTemplateConst.EQPREPAIR_CODE));
|
||||||
}else if (string.IsNullOrEmpty((string)input.data["code"]))
|
}
|
||||||
|
else if (string.IsNullOrEmpty((string)input.data["code"]))
|
||||||
{
|
{
|
||||||
input.data["code"] = await _billRuleService.GetBillNumber(CodeTemplateConst.EQPREPAIR_CODE);
|
input.data["code"] = await _billRuleService.GetBillNumber(CodeTemplateConst.EQPREPAIR_CODE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using JNPF.Common.Security;
|
|||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using JNPF.WorkFlow.Interfaces.Service;
|
|
||||||
using JNPF.WorkFlow.Service;
|
using JNPF.WorkFlow.Service;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using JNPF.DynamicApiController;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
|
||||||
using Tnb.EquipMgr.Interfaces;
|
using Tnb.EquipMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr
|
namespace Tnb.EquipMgr
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Enums;
|
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
@@ -7,7 +6,6 @@ using JNPF.FriendlyException;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
|
||||||
using Tnb.EquipMgr.Interfaces;
|
using Tnb.EquipMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr
|
namespace Tnb.EquipMgr
|
||||||
@@ -42,7 +40,8 @@ namespace Tnb.EquipMgr
|
|||||||
if (entity.warn_unit == "1")//月
|
if (entity.warn_unit == "1")//月
|
||||||
{
|
{
|
||||||
entity.next_check_time = entity.end_time?.AddMonths(-entity.warm_time.Value);
|
entity.next_check_time = entity.end_time?.AddMonths(-entity.warm_time.Value);
|
||||||
}else if (entity.warn_unit == "2")//天
|
}
|
||||||
|
else if (entity.warn_unit == "2")//天
|
||||||
{
|
{
|
||||||
entity.next_check_time = entity.end_time?.AddDays(-entity.warm_time.Value);
|
entity.next_check_time = entity.end_time?.AddDays(-entity.warm_time.Value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,15 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
using JNPF.Common.Dtos.VisualDev;
|
||||||
using JNPF.Common.Enums;
|
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using JNPF.Systems.Interfaces.System;
|
using JNPF.Systems.Interfaces.System;
|
||||||
using JNPF.VisualDev;
|
using JNPF.VisualDev;
|
||||||
using JNPF.VisualDev.Entitys;
|
|
||||||
using JNPF.VisualDev.Interfaces;
|
using JNPF.VisualDev.Interfaces;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.ClearScript.Util.Web;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
|
||||||
using Tnb.EquipMgr.Interfaces;
|
using Tnb.EquipMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr
|
namespace Tnb.EquipMgr
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ using JNPF.Common.Security;
|
|||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using JNPF.VisualDev.Interfaces;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Interfaces;
|
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
|
using Tnb.EquipMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.EquipMgr
|
namespace Tnb.EquipMgr
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using JNPF.DynamicApiController;
|
|||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Filter;
|
using JNPF.Common.Filter;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
@@ -9,7 +8,6 @@ using JNPF.FriendlyException;
|
|||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
using JNPF.Systems.Entitys.System;
|
using JNPF.Systems.Entitys.System;
|
||||||
using JNPF.VisualDev;
|
using JNPF.VisualDev;
|
||||||
using JNPF.VisualDev.Entitys;
|
|
||||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||||
using JNPF.VisualDev.Interfaces;
|
using JNPF.VisualDev.Interfaces;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -63,7 +61,8 @@ namespace Tnb.EquipMgr
|
|||||||
{
|
{
|
||||||
input.sidx = "a.create_time";
|
input.sidx = "a.create_time";
|
||||||
input.sort = "desc";
|
input.sort = "desc";
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
input.sidx = "a." + input.sidx;
|
input.sidx = "a." + input.sidx;
|
||||||
}
|
}
|
||||||
@@ -176,7 +175,8 @@ namespace Tnb.EquipMgr
|
|||||||
.Where((a, b) => a.EnCode == DictConst.EqpMaintainType)
|
.Where((a, b) => a.EnCode == DictConst.EqpMaintainType)
|
||||||
.Select((a, b) => new
|
.Select((a, b) => new
|
||||||
{
|
{
|
||||||
b.EnCode, b.FullName
|
b.EnCode,
|
||||||
|
b.FullName
|
||||||
})
|
})
|
||||||
.MergeTable()
|
.MergeTable()
|
||||||
.ToDictionaryAsync(it => it.EnCode, it => it.FullName);
|
.ToDictionaryAsync(it => it.EnCode, it => it.FullName);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user