1
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
namespace Tnb.BasicData.Entitys.Const
|
|
||||||
{
|
|
||||||
public static class DicTypeKey
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 计量单位
|
|
||||||
/// </summary>
|
|
||||||
public const string MeasurementUnit = "MeasurementUnit";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
40
BasicData/Tnb.BasicData.Entitys/Consts/DictConst.cs
Normal file
40
BasicData/Tnb.BasicData.Entitys/Consts/DictConst.cs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
namespace Tnb.BasicData.Entitys;
|
||||||
|
|
||||||
|
public static class DictConst
|
||||||
|
{
|
||||||
|
#region BasicData
|
||||||
|
/// <summary>
|
||||||
|
/// 计量单位
|
||||||
|
/// </summary>
|
||||||
|
public const string MeasurementUnit = "MeasurementUnit";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ProductionMgr
|
||||||
|
/// <summary>
|
||||||
|
/// 生产任务状态TypeId
|
||||||
|
/// </summary>
|
||||||
|
public const string PrdTaskStatusTypeId = "25572555259157";
|
||||||
|
/// <summary>
|
||||||
|
/// 工单状态 已下发字典Id
|
||||||
|
/// </summary>
|
||||||
|
public const string IssueId = "25019232867093";
|
||||||
|
/// <summary>
|
||||||
|
/// 任务单状态-待开工编码
|
||||||
|
/// </summary>
|
||||||
|
public const string ToBeStartedEnCode = "ToBeStarted";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region WarehouseMgr
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region QcMgr
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region EqpMgr
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
13
BasicData/Tnb.BasicData.Entitys/Consts/ModuleConst.cs
Normal file
13
BasicData/Tnb.BasicData.Entitys/Consts/ModuleConst.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.BasicData;
|
||||||
|
|
||||||
|
public class ModuleConst
|
||||||
|
{
|
||||||
|
public const string Tag = "BasicData";
|
||||||
|
public const string Area = "basic";
|
||||||
|
}
|
||||||
@@ -6,15 +6,16 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entitys.Entity;
|
using Tnb.BasicData.Entitys.Entity;
|
||||||
using Tnb.BasicData.Entitys.Dto;
|
using Tnb.BasicData.Entitys.Dto;
|
||||||
using Tnb.BasicData.Entitys.Const;
|
using Tnb.BasicData.Entitys;
|
||||||
|
using JNPF.Common.Const;
|
||||||
|
|
||||||
namespace Tnb.BasicData
|
namespace Tnb.BasicData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料清单
|
/// 物料清单
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiDescriptionSettings(Tag = "BasicData", Name = "Ebom", Order = 701)]
|
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)]
|
||||||
[Route("api/basic/[controller]")]
|
[Route("api/[area]/[controller]/[action]")]
|
||||||
public class EbomService : IDynamicApiController, ITransient
|
public class EbomService : IDynamicApiController, ITransient
|
||||||
{
|
{
|
||||||
private readonly ISqlSugarRepository<BasMaterial> _repository;
|
private readonly ISqlSugarRepository<BasMaterial> _repository;
|
||||||
@@ -34,11 +35,11 @@ namespace Tnb.BasicData
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input">获取物料清单树.</param>
|
/// <param name="input">获取物料清单树.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("[action]")]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetTree(EbomTreeQueryInput queryInput)
|
public async Task<dynamic> GetTree(EbomTreeQueryInput queryInput)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
var db = _repository.AsSugarClient();
|
||||||
var dic = await _dictionaryDataService.GetDicByKey(DicTypeKey.MeasurementUnit);
|
var 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)
|
||||||
@@ -108,7 +109,7 @@ namespace Tnb.BasicData
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("[action]")]
|
[HttpPost]
|
||||||
public async Task<Dictionary<string,string>> GetEbomVersionAndRouteName(string materialId)
|
public async Task<Dictionary<string,string>> GetEbomVersionAndRouteName(string materialId)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
var db = _repository.AsSugarClient();
|
||||||
|
|||||||
@@ -7,15 +7,14 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entitys;
|
using Tnb.BasicData.Entitys;
|
||||||
using Tnb.BasicData.Entitys.Entity;
|
using Tnb.BasicData.Entitys.Entity;
|
||||||
using Tnb.BasicData.Entitys.Const;
|
|
||||||
|
|
||||||
namespace Tnb.BasicData
|
namespace Tnb.BasicData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料档案
|
/// 物料档案
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiDescriptionSettings(Tag = "BasicData", Name = "Material", Order = 700)]
|
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)]
|
||||||
[Route("api/basic/[controller]")]
|
[Route("api/[area]/[controller]/[action]")]
|
||||||
public class MaterialService : IDynamicApiController, ITransient
|
public class MaterialService : IDynamicApiController, ITransient
|
||||||
{
|
{
|
||||||
private readonly ISqlSugarRepository<BasMaterial> _repository;
|
private readonly ISqlSugarRepository<BasMaterial> _repository;
|
||||||
@@ -30,11 +29,11 @@ namespace Tnb.BasicData
|
|||||||
_dictionaryDataService = dictionaryDataService;
|
_dictionaryDataService = dictionaryDataService;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("[action]")]
|
[HttpPost]
|
||||||
public async Task<Dictionary<string,string>> GetEbomVersionAndRouteName(string materialId)
|
public async Task<Dictionary<string,string>> GetEbomVersionAndRouteName(string materialId)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
var db = _repository.AsSugarClient();
|
||||||
var dic = await _dictionaryDataService.GetDicByKey(DicTypeKey.MeasurementUnit);
|
var 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)
|
||||||
// {
|
// {
|
||||||
@@ -58,12 +57,12 @@ namespace Tnb.BasicData
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("[action]")]
|
[HttpPost]
|
||||||
public async Task<List<ElementSelectDto>> GetMaterialUnits(string materialId)
|
public async Task<List<ElementSelectDto>> GetMaterialUnits(string materialId)
|
||||||
{
|
{
|
||||||
var db = _repository.AsSugarClient();
|
var db = _repository.AsSugarClient();
|
||||||
|
|
||||||
var type = await db.Queryable<DictionaryTypeEntity>().Where(x => x.EnCode == DicTypeKey.MeasurementUnit)
|
var type = await db.Queryable<DictionaryTypeEntity>().Where(x => x.EnCode == DictConst.MeasurementUnit)
|
||||||
.SingleAsync();
|
.SingleAsync();
|
||||||
string typeId = type?.Id;
|
string typeId = type?.Id;
|
||||||
var queryable1 = db.Queryable<BasMaterial>()
|
var queryable1 = db.Queryable<BasMaterial>()
|
||||||
|
|||||||
@@ -6,22 +6,6 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Tnb.ProductionMgr.Entitys.Consts
|
namespace Tnb.ProductionMgr.Entitys.Consts
|
||||||
{
|
{
|
||||||
public class DictionaryConstants
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 生产任务状态TypeId
|
|
||||||
/// </summary>
|
|
||||||
public const string PrdTaskStatusTypeId = "25572555259157";
|
|
||||||
/// <summary>
|
|
||||||
/// 工单状态 已下发字典Id
|
|
||||||
/// </summary>
|
|
||||||
public const string IssueId = "25019232867093";
|
|
||||||
/// <summary>
|
|
||||||
/// 任务单状态-待开工编码
|
|
||||||
/// </summary>
|
|
||||||
public const string ToBeStartedEnCode = "ToBeStarted";
|
|
||||||
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工单状态
|
/// 工单状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.ProductionMgr;
|
||||||
|
|
||||||
|
public class ModuleConst
|
||||||
|
{
|
||||||
|
public const string Tag = "ProductionManager";
|
||||||
|
public const string Area = "production";
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\BasicData\Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj" />
|
||||||
<ProjectReference Include="..\..\common\Tnb.Common\Tnb.Common.csproj" />
|
<ProjectReference Include="..\..\common\Tnb.Common\Tnb.Common.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -8,17 +8,19 @@ using JNPF.Systems.Interfaces.System;
|
|||||||
using Mapster;
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.ProductionMgr.Entitys.Consts;
|
using Tnb.BasicData.Entitys;
|
||||||
using Tnb.ProductionMgr.Entitys.Dto;
|
using Tnb.ProductionMgr.Entitys;
|
||||||
|
using Tnb.ProductionMgr.Entitys.Dto.PrdManage;
|
||||||
|
using Tnb.ProductionMgr.Entitys.Dto.WorkOrder;
|
||||||
using Tnb.ProductionMgr.Entitys.Entity;
|
using Tnb.ProductionMgr.Entitys.Entity;
|
||||||
using Tnb.ProductionMgr.Interfaces;
|
using Tnb.ProductionMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.ProductionPlanMgr
|
namespace Tnb.ProductionMgr
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生产计划管理
|
/// 生产计划管理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiDescriptionSettings(Tag = "ProductionMgr", Area = "production", Order = 700)]
|
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
|
||||||
[Route("api/[area]/[controller]/[action]")]
|
[Route("api/[area]/[controller]/[action]")]
|
||||||
public class PrdMoService : IPrdMoService, IDynamicApiController, ITransient
|
public class PrdMoService : IPrdMoService, IDynamicApiController, ITransient
|
||||||
{
|
{
|
||||||
@@ -125,7 +127,7 @@ namespace Tnb.ProductionPlanMgr
|
|||||||
[HttpGet("{eqpId}")]
|
[HttpGet("{eqpId}")]
|
||||||
public async Task<dynamic> PrdTaskSort(string eqpId)
|
public async Task<dynamic> PrdTaskSort(string eqpId)
|
||||||
{
|
{
|
||||||
var taskStatusDic = await _dictionaryDataService.GetDicByTypeId(DictionaryConstants.PrdTaskStatusTypeId);
|
var taskStatusDic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId);
|
||||||
var list = await _repository.AsSugarClient().Queryable<PrdTask>()
|
var list = await _repository.AsSugarClient().Queryable<PrdTask>()
|
||||||
.Where(it => it.eqp_id == eqpId)
|
.Where(it => it.eqp_id == eqpId)
|
||||||
.OrderBy(o => o.estimated_start_date)
|
.OrderBy(o => o.estimated_start_date)
|
||||||
@@ -153,7 +155,7 @@ namespace Tnb.ProductionPlanMgr
|
|||||||
{
|
{
|
||||||
var list = await _repository.AsSugarClient().Queryable<PrdTaskLog>().Where(it => it.id == taskId).ToListAsync();
|
var list = await _repository.AsSugarClient().Queryable<PrdTaskLog>().Where(it => it.id == taskId).ToListAsync();
|
||||||
var data = list.Adapt<List<PrdTaskOperOutput>>();
|
var data = list.Adapt<List<PrdTaskOperOutput>>();
|
||||||
var dic = await _dictionaryDataService.GetDicByTypeId(DictionaryConstants.PrdTaskStatusTypeId);
|
var dic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId);
|
||||||
_repository.AsSugarClient().ThenMapper(data, x => x.statusName = dic.ContainsKey(x.status) ? dic[x.status].ToString() : "");
|
_repository.AsSugarClient().ThenMapper(data, x => x.statusName = dic.ContainsKey(x.status) ? dic[x.status].ToString() : "");
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -185,7 +187,7 @@ namespace Tnb.ProductionPlanMgr
|
|||||||
}
|
}
|
||||||
|
|
||||||
var row = await db.Updateable<PrdMo>()
|
var row = await db.Updateable<PrdMo>()
|
||||||
.SetColumns(it => new PrdMo { mo_status = DictionaryConstants.IssueId })
|
.SetColumns(it => new PrdMo { mo_status = DictConst.IssueId })
|
||||||
.Where(it => input.WorkOrderIds.Contains(it.id))
|
.Where(it => input.WorkOrderIds.Contains(it.id))
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
return (row > 0);
|
return (row > 0);
|
||||||
@@ -432,7 +434,7 @@ namespace Tnb.ProductionPlanMgr
|
|||||||
}
|
}
|
||||||
var db = _repository.AsSugarClient();
|
var db = _repository.AsSugarClient();
|
||||||
var row = await db.Updateable<PrdTask>()
|
var row = await db.Updateable<PrdTask>()
|
||||||
.SetColumns(it => new PrdTask { status = DictionaryConstants.ToBeStartedEnCode })
|
.SetColumns(it => new PrdTask { status = DictConst.ToBeStartedEnCode })
|
||||||
.Where(it => input.TaskIds.Contains(it.id))
|
.Where(it => input.TaskIds.Contains(it.id))
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
return (row > 0);
|
return (row > 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user