This commit is contained in:
2024-04-11 17:31:32 +08:00
parent f6eaa2f481
commit 4fbc6c0267
200 changed files with 1252 additions and 1860 deletions

View File

@@ -1,4 +1,4 @@
# Rules in this file were initially inferred by Visual Studio IntelliCode from the J:\引迈-NET 6\src codebase based on best match to current usage at 2022/3/31 # Rules in this file were initially inferred by Visual Studio IntelliCode from the J:\卡奥斯-NET 6\src codebase based on best match to current usage at 2022/3/31
# You can modify the rules from these initially generated values to suit your own policies # You can modify the rules from these initially generated values to suit your own policies
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference # You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
[*.cs] [*.cs]

View File

@@ -1,370 +0,0 @@
namespace Tnb.BasicData.Entities.Dto
{
public class ErpBasMaterialInput
{
public ErpBasMaterial bas_material { get; set; }
public List<ErpBasMaterialUnit> bas_material_units { get; set; } = new List<ErpBasMaterialUnit>();
// public List<ErpBasMaterialIntoFactorySpecifications> bas_material_into_factory_specificationses { get; set; } = new List<ErpBasMaterialIntoFactorySpecifications>();
//
// public List<ErpBasSubstitutionMaterial> bas_substitution_materials { get; set; } = new List<ErpBasSubstitutionMaterial>();
//
// public List<ErpBasMaterialSendWarehouse> bas_material_send_warehouses { get; set; } = new List<ErpBasMaterialSendWarehouse>();
//
// public List<ErpBasMaterialInboundWh> bas_material_inbound_whs { get; set; } = new List<ErpBasMaterialInboundWh>();
}
public class ErpBasMaterial
{
/// <summary>
/// 物料代码
/// </summary>
public string code { get; set; } = string.Empty;
/// <summary>
/// 物料名称
/// </summary>
public string name { get; set; } = string.Empty;
/// <summary>
/// 物料分类ID
/// </summary>
public string category_id { get; set; } = string.Empty;
/// <summary>
/// 单位ID
/// </summary>
public string unit_id { get; set; } = string.Empty;
// /// <summary>
// /// 单价
// /// </summary>
// public decimal? cost { get; set; }
//
// /// <summary>
// /// 毛重
// /// </summary>
// public decimal? grossweight { get; set; }
//
// /// <summary>
// /// 净重
// /// </summary>
// public decimal? netweight { get; set; }
//
// /// <summary>
// /// 长
// /// </summary>
// public decimal? length { get; set; }
//
// /// <summary>
// /// 宽
// /// </summary>
// public decimal? width { get; set; }
//
// /// <summary>
// /// 高
// /// </summary>
// public decimal? high { get; set; }
//
// /// <summary>
// /// 体积
// /// </summary>
// public decimal? volumn { get; set; }
//
// /// <summary>
// /// 是否免检
// /// </summary>
// public int? isexemption { get; set; }
/// <summary>
/// 安全库存
/// </summary>
public decimal? safeqty { get; set; }
/// <summary>
/// 保质期
/// </summary>
public int? qualityperiod { get; set; }
// /// <summary>
// /// 是否过期允许出库
// /// </summary>
// public string? expireout { get; set; }
/// <summary>
/// 最小包装
/// </summary>
public decimal? minpacking { get; set; }
/// <summary>
/// 是否先进先出管控
/// </summary>
public string? fifo { get; set; }
// /// <summary>
// /// 先进先出间隔天数,批次间隔天数
// /// </summary>
// public int? fifo_interval_days { get; set; }
/// <summary>
/// 物料规格型号
/// </summary>
public string? material_standard { get; set; }
// /// <summary>
// /// 海关编码
// /// </summary>
// public string? fhscode { get; set; }
// /// <summary>
// /// 附属性
// /// </summary>
// public string? attribute { get; set; }
// /// <summary>
// /// 管控类型: 批管控Lot 单管控KeyParts 非管控NoControl
// /// </summary>
// public string? controltype { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? remark { get; set; }
// /// <summary>
// /// 创建用户
// /// </summary>
// public string? create_id { get; set; }
/// <summary>
/// 创建用户
/// </summary>
public string? create_count { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? create_time { get; set; }
// /// <summary>
// /// 修改用户
// /// </summary>
// public string? modify_id { get; set; }
/// <summary>
/// 修改用户
/// </summary>
public string? modify_count { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime? modify_time { get; set; }
// /// <summary>
// /// 扩展字段
// /// </summary>
// public string? extras { get; set; }
/// <summary>
/// 状态
/// </summary>
public string? state { get; set; }
/// <summary>
/// 物料属性
/// </summary>
public string? material_property { get; set; }
/// <summary>
/// 标签
/// </summary>
public string? label { get; set; }
/// <summary>
/// 描述
/// </summary>
public string? descrip { get; set; }
/// <summary>
/// 批次管理
/// </summary>
public int? is_batch_enabled { get; set; }
/// <summary>
/// 标签管理
/// </summary>
public int? is_label_enabled { get; set; }
// /// <summary>
// /// 附件
// /// </summary>
// public string? attachment { get; set; }
/// <summary>
/// 先进先出 0否 1是
/// </summary>
public int? first_in_out { get; set; }
/// <summary>
/// 存储有效期(天)
/// </summary>
public int? storage_valid_day { get; set; }
/// <summary>
/// 预警提前期(天)
/// </summary>
public int? early_warn_day { get; set; }
/// <summary>
/// 安全库存
/// </summary>
public int? safe_stock { get; set; }
/// <summary>
/// 安全库存包含状态
/// </summary>
public string? safe_stock_stauts { get; set; }
/// <summary>
/// 发料仓库id
/// </summary>
public string? send_warehouse_id { get; set; }
/// <summary>
/// 入厂单位id
/// </summary>
public string? into_factory_unit_id { get; set; }
/// <summary>
/// 投料单位
/// </summary>
public string? material_in_unit_id { get; set; }
/// <summary>
/// 产出单位
/// </summary>
public string? material_out_unit_id { get; set; }
/// <summary>
/// 请料方式 1按计划排程请料 2自行管控
/// </summary>
public string? material_request_method { get; set; }
/// <summary>
/// 是否包含入库数
/// </summary>
public int? is_contain_into_num { get; set; }
/// <summary>
/// 是否创建子工单
/// </summary>
public string? is_create_sub_work_order { get; set; }
/// <summary>
/// 保质期
/// </summary>
public int? quality_guarantee_period { get; set; }
/// <summary>
/// DI编码
/// </summary>
public string? di { get; set; }
}
public class ErpBasMaterialUnit
{
/// <summary>
/// 主单位数量
/// </summary>
public string? number_of_primary_unit { get; set; }
/// <summary>
/// 辅助单位数量
/// </summary>
public string? number_of_auxiliary_unit { get; set; }
/// <summary>
/// 辅助单位
/// </summary>
public string auxiliary_unit_id { get; set; } = string.Empty;
}
public class ErpBasMaterialIntoFactorySpecifications
{
/// <summary>
/// 单位id
/// </summary>
public string unit_id { get; set; } = string.Empty;
/// <summary>
/// 数量
/// </summary>
public decimal num { get; set; }
}
public class ErpBasSubstitutionMaterial
{
/// <summary>
/// 替代料编号
/// </summary>
public string sub_material_code { get; set; } = string.Empty;
/// <summary>
/// 替代比例如1一个物料可以用一个替代料代替
/// </summary>
public decimal proportion { get; set; }
}
public class ErpBasMaterialSendWarehouse
{
/// <summary>
/// 仓库编号
/// </summary>
public string? wh_code { get; set; }
/// <summary>
/// 最大库存
/// </summary>
public int? max_stock { get; set; }
/// <summary>
/// 最小库存
/// </summary>
public int? min_stock { get; set; }
/// <summary>
/// 安全库存
/// </summary>
public int? safe_stock { get; set; }
}
public class ErpBasMaterialInboundWh
{
/// <summary>
/// 仓库编号
/// </summary>
public string? wh_code { get; set; }
/// <summary>
/// 最大库存
/// </summary>
public int? max_stock { get; set; }
/// <summary>
/// 最小库存
/// </summary>
public int? min_stock { get; set; }
/// <summary>
/// 安全库存
/// </summary>
public int? safe_stock { get; set; }
}
}

View File

@@ -125,5 +125,5 @@ public partial class BasLocation : BaseEntity<string>
/// <summary> /// <summary>
/// 是否超配(1不超配 2超配) /// 是否超配(1不超配 2超配)
/// </summary> /// </summary>
public string is_overmatch { get; set; } = "1"; public string is_overmatch { get; set; }
} }

View File

@@ -263,10 +263,5 @@ public partial class BasMaterial : BaseEntity<string>
/// DI编码 /// DI编码
/// </summary> /// </summary>
public string? di { get; set; } public string? di { get; set; }
/// <summary>
/// 删除标志
/// </summary>
public int? deleted { get; set; }
} }

View File

@@ -5,7 +5,7 @@ using SqlSugar;
namespace Tnb.BasicData.Entities; namespace Tnb.BasicData.Entities;
/// <summary> /// <summary>
/// 物料入规格 /// 物料入规格
/// </summary> /// </summary>
[SugarTable("bas_material_into_factory_specifications")] [SugarTable("bas_material_into_factory_specifications")]
public partial class BasMaterialIntoFactorySpecifications : BaseEntity<string> public partial class BasMaterialIntoFactorySpecifications : BaseEntity<string>

View File

@@ -6,13 +6,10 @@ 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.Entitys.Permission;
using JNPF.Systems.Entitys.System; using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.System; using JNPF.Systems.Interfaces.System;
using Mapster;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json; using Newtonsoft.Json;
using SQLitePCL;
using SqlSugar; using SqlSugar;
using Tnb.BasicData.Entities; using Tnb.BasicData.Entities;
using Tnb.BasicData.Entities.Dto; using Tnb.BasicData.Entities.Dto;
@@ -278,185 +275,5 @@ namespace Tnb.BasicData
return ids; return ids;
} }
/// <summary>
/// 物料新增修改接口
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<dynamic> CreateCreateOrUpdateMaterial(ErpBasMaterialInput input)
{
var db = _repository.AsSugarClient();
if (input == null)
{
throw Oops.Bah("参数为空");
}
if (input.bas_material == null)
{
throw Oops.Bah("物料信息为空");
}
if (!string.IsNullOrEmpty(input.bas_material.code))
{
throw Oops.Bah("物料编号为空");
}
if (!string.IsNullOrEmpty(input.bas_material.name))
{
throw Oops.Bah("物料名称为空");
}
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
{
BasMaterial basMaterial = input.bas_material.Adapt<BasMaterial>();
if (!await db.Queryable<BasMaterial>().AnyAsync(x => x.code == input.bas_material.code))
{
basMaterial.id = SnowflakeIdHelper.NextId();
}
if (!string.IsNullOrEmpty(input.bas_material.create_count))
{
UserEntity userEntity = await db.Queryable<UserEntity>().FirstAsync(x=>x.Account==input.bas_material.create_count);
if (userEntity == null)
{
throw Oops.Bah($"未找到用户{input.bas_material.create_count}");
}
basMaterial.create_id = userEntity?.Id;
}
if (!string.IsNullOrEmpty(input.bas_material.modify_count))
{
UserEntity userEntity = await db.Queryable<UserEntity>().FirstAsync(x=>x.Account==input.bas_material.modify_count);
if (userEntity == null)
{
throw Oops.Bah($"未找到用户{input.bas_material.modify_count}");
}
basMaterial.modify_id = userEntity?.Id;
}
List<BasMaterialUnit> basMaterialUnits = new List<BasMaterialUnit>();
// List<BasMaterialIntoFactorySpecifications> basMaterialIntoFactorySpecificationsList = new List<BasMaterialIntoFactorySpecifications>();
// List<BasSubstitutionMaterial> basSubstitutionMaterials = new List<BasSubstitutionMaterial>();
// List<BasMaterialSendWarehouse> basMaterialSendWarehouses = new List<BasMaterialSendWarehouse>();
// List<BasMaterialInboundWh> basMaterialInboundWhs = new List<BasMaterialInboundWh>();
if (input.bas_material_units != null && input.bas_material_units.Count > 0)
{
foreach(var item in input.bas_material_units)
{
BasMaterialUnit basMaterialUnit = item.Adapt<BasMaterialUnit>();
basMaterialUnit.id = SnowflakeIdHelper.NextId();
basMaterialUnit.material_id = basMaterial.id;
basMaterialUnits.Add(basMaterialUnit);
}
}
// if (input.bas_material_into_factory_specificationses != null && input.bas_material_into_factory_specificationses.Count > 0)
// {
// foreach(var item in input.bas_material_into_factory_specificationses)
// {
// BasMaterialIntoFactorySpecifications basMaterialIntoFactorySpecifications = item.Adapt<BasMaterialIntoFactorySpecifications>();
// basMaterialIntoFactorySpecifications.id = SnowflakeIdHelper.NextId();
// basMaterialIntoFactorySpecifications.material_id = basMaterial.id;
// basMaterialIntoFactorySpecificationsList.Add(basMaterialIntoFactorySpecifications);
// }
// }
//
// if (input.bas_substitution_materials != null && input.bas_substitution_materials.Count > 0)
// {
// foreach(var item in input.bas_substitution_materials)
// {
// BasSubstitutionMaterial basSubstitutionMaterial = item.Adapt<BasSubstitutionMaterial>();
// basSubstitutionMaterial.id = SnowflakeIdHelper.NextId();
// basSubstitutionMaterial.material_id = basMaterial.id;
// BasMaterial subBasMaterial = await db.Queryable<BasMaterial>().FirstAsync(x=>x.code==item.sub_material_code);
// if (subBasMaterial == null)
// {
// throw Oops.Bah($"未找到替代物料{item.sub_material_code}");
// }
// basSubstitutionMaterial.sub_material_id = subBasMaterial?.id ?? item.sub_material_code;
// basSubstitutionMaterials.Add(basSubstitutionMaterial);
// }
// }
//
// if (input.bas_material_send_warehouses != null && input.bas_material_send_warehouses.Count > 0)
// {
// foreach(var item in input.bas_material_send_warehouses)
// {
// BasMaterialSendWarehouse basMaterialSendWarehouse = item.Adapt<BasMaterialSendWarehouse>();
// basMaterialSendWarehouse.id = SnowflakeIdHelper.NextId();
// basMaterialSendWarehouse.material_id = basMaterial.id;
// BasWarehouse basWarehouse = await db.Queryable<BasWarehouse>().FirstAsync(x=>x.whcode==item.wh_code);
// if (basWarehouse == null)
// {
// throw Oops.Bah($"发料仓库未找到仓库{item.wh_code}");
// }
// basMaterialSendWarehouse.wh_id = basWarehouse?.id ?? item.wh_code;
// basMaterialSendWarehouses.Add(basMaterialSendWarehouse);
// }
// }
//
// if (input.bas_material_inbound_whs != null && input.bas_material_inbound_whs.Count > 0)
// {
// foreach(var item in input.bas_material_inbound_whs)
// {
// BasMaterialInboundWh basMaterialInboundWh = item.Adapt<BasMaterialInboundWh>();
// basMaterialInboundWh.id = SnowflakeIdHelper.NextId();
// basMaterialInboundWh.material_id = basMaterial.id;
// BasWarehouse basWarehouse = await db.Queryable<BasWarehouse>().FirstAsync(x=>x.whcode==item.wh_code);
// if (basWarehouse == null)
// {
// throw Oops.Bah($"入库仓库未找到仓库{item.wh_code}");
// }
// basMaterialInboundWh.wh_id = basWarehouse?.id ?? item.wh_code;
// basMaterialInboundWhs.Add(basMaterialInboundWh);
// }
// }
if (!await db.Queryable<BasMaterial>().AnyAsync(x => x.code == input.bas_material.code))
{
await db.Insertable<BasMaterial>(basMaterial).ExecuteCommandAsync();
}
else
{
await db.Updateable<BasMaterial>(basMaterial).ExecuteCommandAsync();
}
// var x= await db.Storageable(basMaterial).ToStorageAsync();
// await x.AsInsertable.ExecuteCommandAsync();//不存在插入
// await x.AsUpdateable.ExecuteCommandAsync();//存在更新
if (basMaterialUnits.Count > 0)
{
await db.Deleteable<BasMaterialUnit>().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync();
await db.Insertable<BasMaterialUnit>(basMaterialUnits).ExecuteCommandAsync();
}
// if (basMaterialIntoFactorySpecificationsList.Count > 0)
// {
// await db.Deleteable<BasMaterialIntoFactorySpecifications>().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync();
// await db.Insertable<BasMaterialIntoFactorySpecifications>(basMaterialIntoFactorySpecificationsList).ExecuteCommandAsync();
// }
//
// if (basSubstitutionMaterials.Count > 0)
// {
// await db.Deleteable<BasSubstitutionMaterial>().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync();
// await db.Insertable<BasSubstitutionMaterial>(basSubstitutionMaterials).ExecuteCommandAsync();
// }
//
// if (basMaterialSendWarehouses.Count > 0)
// {
// await db.Deleteable<BasMaterialSendWarehouse>().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync();
// await db.Insertable<BasMaterialSendWarehouse>(basMaterialSendWarehouses).ExecuteCommandAsync();
// }
//
// if (basMaterialInboundWhs.Count > 0)
// {
// await db.Deleteable<BasMaterialInboundWh>().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync();
// await db.Insertable<BasMaterialInboundWh>(basMaterialInboundWhs).ExecuteCommandAsync();
// }
});
return !result.IsSuccess ? throw Oops.Oh(result.ErrorMessage) : "保存成功";
}
} }
} }

View File

@@ -15,4 +15,12 @@
<ProjectReference Include="..\Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj" /> <ProjectReference Include="..\Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="nacos-sdk-csharp" Version="1.3.5" />
<PackageReference Include="nacos-sdk-csharp.AspNetCore" Version="1.3.5" />
<PackageReference Include="nacos-sdk-csharp.Extensions.Configuration" Version="1.3.5" />
<PackageReference Include="nacos-sdk-csharp.IniParser" Version="1.3.5" />
<PackageReference Include="nacos-sdk-csharp.YamlParser" Version="1.3.5" />
</ItemGroup>
</Project> </Project>

View File

@@ -0,0 +1,54 @@
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Tnb.BasicData;
[Route("api/[controller]")]
[ApiController]
// public class ValuesController : ControllerBase
public class ValuesController : IDynamicApiController, ITransient
{
private readonly Nacos.V2.INacosNamingService _nacosNamingService;
public ValuesController(Nacos.V2.INacosNamingService nacosNamingService)
{
_nacosNamingService = nacosNamingService;
}
[HttpGet]
[AllowAnonymous]
public string Get()
{
return "Ok~" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff");
}
[HttpGet("test")]
[AllowAnonymous]
public async Task<string> Test()
{
// 被调用方的服务名称
var instance = await _nacosNamingService.SelectOneHealthyInstance("tnb-core", "DEFAULT_GROUP");
var host = $"{instance.Ip}:{instance.Port}";
var baseUrl = instance.Metadata.TryGetValue("secure", out _)
? $"https://{host}"
: $"http://{host}";
if(string.IsNullOrWhiteSpace(baseUrl))
{
return "empty";
}
var url = $"{baseUrl}/api/values";
using (HttpClient client = new HttpClient())
{
var result = await client.GetAsync(url);
return await result.Content.ReadAsStringAsync();
}
}
}

View File

@@ -5,7 +5,7 @@ using SqlSugar;
namespace Tnb.ProductionMgr.Entities; namespace Tnb.ProductionMgr.Entities;
/// <summary> /// <summary>
/// /// 自检报废记录表
/// </summary> /// </summary>
[SugarTable("prd_mo_task_defect_record")] [SugarTable("prd_mo_task_defect_record")]
public partial class PrdMoTaskDefectRecord : BaseEntity<string> public partial class PrdMoTaskDefectRecord : BaseEntity<string>

View File

@@ -21,15 +21,14 @@ using Tnb.BasicData;
using Tnb.BasicData.Entities; using Tnb.BasicData.Entities;
using Tnb.BasicData.Entities.Dto; using Tnb.BasicData.Entities.Dto;
using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities;
using Tnb.PerMgr.Entities;
using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities;
using Tnb.ProductionMgr.Entities.Dto; using Tnb.ProductionMgr.Entities.Dto;
using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Entities.Dto.PrdManage;
using Tnb.ProductionMgr.Entities.Enums; using Tnb.ProductionMgr.Entities.Enums;
using Tnb.ProductionMgr.Interfaces; using Tnb.ProductionMgr.Interfaces;
using Tnb.QcMgr.Entities; // using Tnb.QcMgr.Entities;
using Tnb.QcMgr.Entities.Enums; // using Tnb.QcMgr.Entities.Enums;
using Tnb.QcMgr.Interfaces; // using Tnb.QcMgr.Interfaces;
// using Tnb.PerMgr.Entities; // using Tnb.PerMgr.Entities;
@@ -54,7 +53,7 @@ namespace Tnb.ProductionMgr
private readonly ISqlSugarClient _db; private readonly ISqlSugarClient _db;
private readonly IBillRullService _billRuleService; private readonly IBillRullService _billRuleService;
private readonly IPrdInstockService _prdInstockService; private readonly IPrdInstockService _prdInstockService;
private readonly IQcCheckPlanService _qcCheckPlanService; // private readonly IQcCheckPlanService _qcCheckPlanService;
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
public PrdMoTaskService( public PrdMoTaskService(
@@ -64,8 +63,8 @@ namespace Tnb.ProductionMgr
IRunService runService, IRunService runService,
IBillRullService billRullService, IBillRullService billRullService,
IPrdInstockService prdInstockService, IPrdInstockService prdInstockService,
IVisualDevService visualDevService, // IQcCheckPlanService qcCheckPlanService,
IQcCheckPlanService qcCheckPlanService IVisualDevService visualDevService
) )
{ {
_repository = repository; _repository = repository;
@@ -78,7 +77,7 @@ namespace Tnb.ProductionMgr
OverideFuncs.GetListAsync = GetList; OverideFuncs.GetListAsync = GetList;
_billRuleService = billRullService; _billRuleService = billRullService;
_prdInstockService = prdInstockService; _prdInstockService = prdInstockService;
_qcCheckPlanService = qcCheckPlanService; // _qcCheckPlanService = qcCheckPlanService;
} }
#region Get #region Get
@@ -384,7 +383,7 @@ namespace Tnb.ProductionMgr
estimated_end_date = a.estimated_end_date == null ? null : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), estimated_end_date = a.estimated_end_date == null ? null : a.estimated_end_date.Value.ToString(DbTimeFormat.SS),
bom_id = d.id, bom_id = d.id,
bom_version = d.version, bom_version = d.version,
create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS) create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS)
}) })
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "") .Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "")
.ToListAsync(); .ToListAsync();
@@ -702,14 +701,14 @@ namespace Tnb.ProductionMgr
row = await db.Insertable(moTask).ExecuteCommandAsync(); row = await db.Insertable(moTask).ExecuteCommandAsync();
#region #region
//质检 //质检
TriggerPlanEntity entity = new() // TriggerPlanEntity entity = new()
{ // {
materialid = moTask.material_id, // materialid = moTask.material_id,
processid = moTask.process_id, // processid = moTask.process_id,
workid = moTask.workstation_id, // workid = moTask.workstation_id,
triggerevent = EnumTriggerEvent. // triggerevent = EnumTriggerEvent.首件检新的生产任
}; // };
await _qcCheckPlanService.CreateTask(entity); // await _qcCheckPlanService.CreateTask(entity);
#endregion #endregion
//根据工单号获取当前工单包含的已排产数 //根据工单号获取当前工单包含的已排产数
int? schedQty = db.Queryable<PrdMoTask>().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty); int? schedQty = db.Queryable<PrdMoTask>().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty);
@@ -843,14 +842,14 @@ namespace Tnb.ProductionMgr
row = await _db.Insertable(moTask).ExecuteCommandAsync(); row = await _db.Insertable(moTask).ExecuteCommandAsync();
#region #region
//质检 //质检
TriggerPlanEntity entity = new() // TriggerPlanEntity entity = new()
{ // {
materialid = moTask.material_id, // materialid = moTask.material_id,
processid = moTask.process_id, // processid = moTask.process_id,
workid = moTask.workstation_id, // workid = moTask.workstation_id,
triggerevent = EnumTriggerEvent. // triggerevent = EnumTriggerEvent.首件检新的生产任
}; // };
await _qcCheckPlanService.CreateTask(entity); // await _qcCheckPlanService.CreateTask(entity);
#endregion #endregion
@@ -1087,20 +1086,20 @@ namespace Tnb.ProductionMgr
{ {
#region #region
//质检 //质检
if (prdTaskList.Where(p => p.mo_task_status == "Pause").Count() > 0 && status == "InProgress") // if (prdTaskList.Where(p => p.mo_task_status == "Pause").Count() > 0 && status == "InProgress")
{ // {
foreach (PrdMoTask? task in prdTaskList.Where(p => p.mo_task_status == "Pause").ToList()) // foreach (PrdMoTask? task in prdTaskList.Where(p => p.mo_task_status == "Pause").ToList())
{ // {
TriggerPlanEntity entity = new() // TriggerPlanEntity entity = new()
{ // {
materialid = task.material_id, // materialid = task.material_id,
processid = task.process_id, // processid = task.process_id,
workid = task.workstation_id, // workid = task.workstation_id,
triggerevent = EnumTriggerEvent. // triggerevent = EnumTriggerEvent.首件检生产任务暂
}; // };
await _qcCheckPlanService.CreateTask(entity); // await _qcCheckPlanService.CreateTask(entity);
} // }
} // }
#endregion #endregion
foreach (PrdMoTask item in prdTaskList) foreach (PrdMoTask item in prdTaskList)
@@ -1503,13 +1502,13 @@ namespace Tnb.ProductionMgr
{ {
throw Oops.Bah("载具不能为空"); throw Oops.Bah("载具不能为空");
} }
if (string.IsNullOrEmpty((input.location_code))) if (string.IsNullOrEmpty((input.location_code)))
{ {
throw Oops.Bah("入库库位不能为空"); throw Oops.Bah("入库库位不能为空");
} }
if (input.reported_qty<=0) if (input.reported_qty <= 0)
{ {
throw Oops.Bah("提报数量为正数"); throw Oops.Bah("提报数量为正数");
} }
@@ -1536,18 +1535,18 @@ namespace Tnb.ProductionMgr
#region #region
//质检模块 //质检模块
TriggerPlanEntity entity = new() // TriggerPlanEntity entity = new()
{ // {
materialid = prdMoTask.material_id, // materialid = prdMoTask.material_id,
processid = prdMoTask.process_id, // processid = prdMoTask.process_id,
workid = prdMoTask.workstation_id // workid = prdMoTask.workstation_id
}; // };
int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; // int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty;
int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; // int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty;
entity.oldpronum = reported + scrap; // entity.oldpronum = reported + scrap;
entity.newpronum = input.reported_qty; // entity.newpronum = input.reported_qty;
entity.triggerevent = EnumTriggerEvent.; // entity.triggerevent = EnumTriggerEvent.生产检定量;
await _qcCheckPlanService.CreateTask(entity); // await _qcCheckPlanService.CreateTask(entity);
#endregion #endregion
_ = prdMoTask.reported_work_qty == null _ = prdMoTask.reported_work_qty == null
? await db.Updateable<PrdMoTask>() ? await db.Updateable<PrdMoTask>()
@@ -1579,24 +1578,24 @@ namespace Tnb.ProductionMgr
.SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty) .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty)
.Where(x => x.id == prdMo.id).ExecuteCommandAsync(); .Where(x => x.id == prdMo.id).ExecuteCommandAsync();
PerProcessStandardsH processStandardsH = await db.Queryable<PerProcessStandardsH>() // PerProcessStandardsH processStandardsH = await db.Queryable<PerProcessStandardsH>()
.Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id && // .Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id &&
x.output_material_id == prdMoTask.material_id && x.enabled == 1) // x.output_material_id == prdMoTask.material_id && x.enabled == 1)
.OrderByDescending(x => x.create_time).FirstAsync(); // .OrderByDescending(x => x.create_time).FirstAsync();
ToolMolds toolMolds = await db.Queryable<ToolMolds>().SingleAsync(x => x.id == prdMoTask.mold_id); // ToolMolds toolMolds = await db.Queryable<ToolMolds>().SingleAsync(x => x.id == prdMoTask.mold_id);
if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null && // if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null &&
processStandardsH?.moulding_cycle > 0) // processStandardsH?.moulding_cycle > 0)
{ // {
decimal? addTime = ((((prdMoTask.scheduled_qty - input.reported_qty - (prdMoTask.scrap_qty ?? 0)) * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1; // decimal? addTime = ((((prdMoTask.scheduled_qty - input.reported_qty - (prdMoTask.scrap_qty ?? 0)) * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1;
if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) // if (prdMoTask.act_start_date != null && addTime != null && addTime > 0)
{ // {
DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); // DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime);
_ = await db.Updateable<PrdMoTask>() // _ = await db.Updateable<PrdMoTask>()
.SetColumns(x => x.plan_end_date == cal_plan_end_date) // .SetColumns(x => x.plan_end_date == cal_plan_end_date)
.Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); // .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync();
} // }
} // }
} }
if (prdMoTask.schedule_type == 2 && !string.IsNullOrEmpty(prdMoTask.mbom_process_id)) if (prdMoTask.schedule_type == 2 && !string.IsNullOrEmpty(prdMoTask.mbom_process_id))
@@ -1752,7 +1751,7 @@ namespace Tnb.ProductionMgr
// return resultMsg == "true" ? (dynamic)true : throw Oops.Bah(resultMsg); // return resultMsg == "true" ? (dynamic)true : throw Oops.Bah(resultMsg);
return true; return true;
} }
if (arr.Length > 0 && arr.Contains("CGJCJ"))//短管挤出件入库申请 if (arr.Length > 0 && arr.Contains("CGJCJ"))//短管挤出件入库申请
{ {
string resultMsg = await _prdInstockService.InstockTubeThree(report); string resultMsg = await _prdInstockService.InstockTubeThree(report);
@@ -1831,18 +1830,18 @@ namespace Tnb.ProductionMgr
#region #region
//质检模块 //质检模块
TriggerPlanEntity entity = new() // TriggerPlanEntity entity = new()
{ // {
materialid = prdMoTask.material_id, // materialid = prdMoTask.material_id,
processid = prdMoTask.process_id, // processid = prdMoTask.process_id,
workid = prdMoTask.workstation_id // workid = prdMoTask.workstation_id
}; // };
int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; // int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty;
int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; // int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty;
entity.oldpronum = reported + scrap; // entity.oldpronum = reported + scrap;
entity.newpronum = input.scrap_qty; // entity.newpronum = input.scrap_qty;
entity.triggerevent = EnumTriggerEvent.; // entity.triggerevent = EnumTriggerEvent.生产检定量;
await _qcCheckPlanService.CreateTask(entity); // await _qcCheckPlanService.CreateTask(entity);
#endregion #endregion
_ = await db.Updateable<PrdMoTask>().SetColumns(it => new PrdMoTask { scrap_qty = scrapQty.Value }).Where(it => it.id == input.mo_task_id).ExecuteCommandAsync(); _ = await db.Updateable<PrdMoTask>().SetColumns(it => new PrdMoTask { scrap_qty = scrapQty.Value }).Where(it => it.id == input.mo_task_id).ExecuteCommandAsync();
} }
@@ -1879,24 +1878,24 @@ namespace Tnb.ProductionMgr
if (prdMoTask.schedule_type == 1) if (prdMoTask.schedule_type == 1)
{ {
PerProcessStandardsH processStandardsH = await db.Queryable<PerProcessStandardsH>() // PerProcessStandardsH processStandardsH = await db.Queryable<PerProcessStandardsH>()
.Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id && // .Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id &&
x.output_material_id == prdMoTask.material_id && x.enabled == 1) // x.output_material_id == prdMoTask.material_id && x.enabled == 1)
.OrderByDescending(x => x.create_time).FirstAsync(); // .OrderByDescending(x => x.create_time).FirstAsync();
//
ToolMolds toolMolds = await db.Queryable<ToolMolds>().SingleAsync(x => x.id == prdMoTask.mold_id); // ToolMolds toolMolds = await db.Queryable<ToolMolds>().SingleAsync(x => x.id == prdMoTask.mold_id);
if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null && // if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null &&
processStandardsH?.moulding_cycle > 0) // processStandardsH?.moulding_cycle > 0)
{ // {
decimal? addTime = ((((prdMoTask.scheduled_qty - prdMoTask.reported_work_qty - input.scrap_qty) * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1; // decimal? addTime = ((((prdMoTask.scheduled_qty - prdMoTask.reported_work_qty - input.scrap_qty) * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1;
if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) // if (prdMoTask.act_start_date != null && addTime != null && addTime > 0)
{ // {
DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); // DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime);
_ = await db.Updateable<PrdMoTask>() // _ = await db.Updateable<PrdMoTask>()
.SetColumns(x => x.plan_end_date == cal_plan_end_date) // .SetColumns(x => x.plan_end_date == cal_plan_end_date)
.Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); // .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync();
} // }
} // }
} }
else else
{ {
@@ -2179,53 +2178,53 @@ namespace Tnb.ProductionMgr
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="AppFriendlyException"></exception> /// <exception cref="AppFriendlyException"></exception>
[HttpPost] // [HttpPost]
public async Task<dynamic> GetEstimatedEndTime(CountEstimatedEndTimeInput input) // public async Task<dynamic> GetEstimatedEndTime(CountEstimatedEndTimeInput input)
{ // {
ISqlSugarClient db = _repository.AsSugarClient(); // ISqlSugarClient db = _repository.AsSugarClient();
if (input.type == 1) // if (input.type == 1)
{ // {
PerProcessStandardsH processStandardsH = await db.Queryable<PerProcessStandardsH>() // PerProcessStandardsH processStandardsH = await db.Queryable<PerProcessStandardsH>()
.Where(x => x.equip_id == input.equip_id && x.molds_id == input.molds_id && // .Where(x => x.equip_id == input.equip_id && x.molds_id == input.molds_id &&
x.output_material_id == input.material_id && x.enabled == 1) // x.output_material_id == input.material_id && x.enabled == 1)
.OrderByDescending(x => x.create_time).FirstAsync(); // .OrderByDescending(x => x.create_time).FirstAsync();
//
ToolMolds toolMolds = await db.Queryable<ToolMolds>().SingleAsync(x => x.id == input.molds_id); // ToolMolds toolMolds = await db.Queryable<ToolMolds>().SingleAsync(x => x.id == input.molds_id);
if (toolMolds == null) // if (toolMolds == null)
{ // {
throw Oops.Bah("没找到模具"); // throw Oops.Bah("没找到模具");
} // }
//
if (toolMolds?.mold_cavity <= 0) // if (toolMolds?.mold_cavity <= 0)
{ // {
throw Oops.Bah("模穴数错误"); // throw Oops.Bah("模穴数错误");
} // }
//
if (processStandardsH == null) // if (processStandardsH == null)
{ // {
throw Oops.Bah("工艺标准成型周期错误"); // throw Oops.Bah("工艺标准成型周期错误");
} // }
//
if (processStandardsH?.moulding_cycle <= 0) // if (processStandardsH?.moulding_cycle <= 0)
{ // {
throw Oops.Bah("工艺标准成型周期错误"); // throw Oops.Bah("工艺标准成型周期错误");
} // }
//
decimal? addTime = (((input.scheduled_qty * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1; // decimal? addTime = (((input.scheduled_qty * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1;
return input.estimated_start_date.AddSeconds((double)addTime.Value).ToString("yyyy-MM-dd HH:mm:ss"); // return input.estimated_start_date.AddSeconds((double)addTime.Value).ToString("yyyy-MM-dd HH:mm:ss");
} // }
else // else
{ // {
List<BasStandardTime> list = await db.Queryable<BasMbomProcess>() // List<BasStandardTime> list = await db.Queryable<BasMbomProcess>()
.LeftJoin<BasStandardTime>((a, b) => a.process_id == b.process_id && b.enabled == 1) // .LeftJoin<BasStandardTime>((a, b) => a.process_id == b.process_id && b.enabled == 1)
.Where((a, b) => a.mbom_id == input.mbom_id).Select((a, b) => b).ToListAsync(); // .Where((a, b) => a.mbom_id == input.mbom_id).Select((a, b) => b).ToListAsync();
//
decimal max = list.Select(x => Convert.ToDecimal(x.standard_time)).Max(x => x); // decimal max = list.Select(x => Convert.ToDecimal(x.standard_time)).Max(x => x);
decimal? addTime = input.scheduled_qty * max; // decimal? addTime = input.scheduled_qty * max;
return input.estimated_start_date.AddSeconds((double)addTime.Value).ToString("yyyy-MM-dd HH:mm:ss"); // return input.estimated_start_date.AddSeconds((double)addTime.Value).ToString("yyyy-MM-dd HH:mm:ss");
} // }
//
} // }
/// <summary> /// <summary>
@@ -2766,7 +2765,7 @@ namespace Tnb.ProductionMgr
return prdMoTask; return prdMoTask;
} }
/// <summary> /// <summary>
/// 根据工位获取进行中待开工暂停的任务单信息 /// 根据工位获取进行中待开工暂停的任务单信息
/// </summary> /// </summary>
@@ -2781,8 +2780,8 @@ namespace Tnb.ProductionMgr
throw Oops.Bah("工位错误"); throw Oops.Bah("工位错误");
} }
List<PrdMoTask> list = await _db.Queryable<PrdMoTask>().Where(x => x.workstation_id == station_id && x.parent_id != null && (x.mo_task_status == DictConst.InProgressEnCode || x.mo_task_status == DictConst.ToBeStartedEnCode || x.mo_task_status == DictConst.MoStatusPauseCode )).ToListAsync(); List<PrdMoTask> list = await _db.Queryable<PrdMoTask>().Where(x => x.workstation_id == station_id && x.parent_id != null && (x.mo_task_status == DictConst.InProgressEnCode || x.mo_task_status == DictConst.ToBeStartedEnCode || x.mo_task_status == DictConst.MoStatusPauseCode)).ToListAsync();
if (list != null && list.Count>0) if (list != null && list.Count > 0)
{ {
foreach (var prdMoTask in list) foreach (var prdMoTask in list)
{ {
@@ -2793,7 +2792,7 @@ namespace Tnb.ProductionMgr
return list; return list;
} }
/// <summary> /// <summary>
/// 外包装根据工位id获取喷码数据 /// 外包装根据工位id获取喷码数据
/// </summary> /// </summary>
@@ -2809,7 +2808,7 @@ namespace Tnb.ProductionMgr
if (prdMoTask == null) throw Oops.Bah("没找到对应任务单"); if (prdMoTask == null) throw Oops.Bah("没找到对应任务单");
if (await _db.Queryable<PrdOutPackMarkLabel>().Where(x => if (await _db.Queryable<PrdOutPackMarkLabel>().Where(x =>
x.mo_task_code == prdMoTask.mo_task_code && x.status == "0" && x.is_label == 0 && x.is_mark==null).AnyAsync()) x.mo_task_code == prdMoTask.mo_task_code && x.status == "0" && x.is_label == 0 && x.is_mark == null).AnyAsync())
{ {
await _db.Updateable<PrdOutPackMarkLabel>() await _db.Updateable<PrdOutPackMarkLabel>()
.SetColumns(x => x.is_mark == 0) .SetColumns(x => x.is_mark == 0)
@@ -2832,10 +2831,10 @@ namespace Tnb.ProductionMgr
} }
PrdMoTask parent = await _db.Queryable<PrdMoTask>().SingleAsync(x => x.id == prdMoTask.parent_id); PrdMoTask parent = await _db.Queryable<PrdMoTask>().SingleAsync(x => x.id == prdMoTask.parent_id);
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().SingleAsync(x=>x.id==parent.material_id); BasMaterial basMaterial = await _db.Queryable<BasMaterial>().SingleAsync(x => x.id == parent.material_id);
string code = $"(01){basMaterial.di ?? ""}\\n(11){DateTime.Now.ToString("yyMMdd")}\\n(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}\\n(10){parent.batch ?? ""}";
string code = $"(01){basMaterial.di ?? ""}\\n(11){DateTime.Now.ToString("yyMMdd")}\\n(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}\\n(10){parent.batch??""}";
return code; return code;
} }
@@ -2852,9 +2851,9 @@ namespace Tnb.ProductionMgr
{ "station_id", input.station_id } { "station_id", input.station_id }
}); });
if (prdMoTask == null) throw Oops.Bah("没找到对应任务单"); if (prdMoTask == null) throw Oops.Bah("没找到对应任务单");
if (await _db.Queryable<PrdOutPackMarkLabel>().Where(x => if (await _db.Queryable<PrdOutPackMarkLabel>().Where(x =>
x.mo_task_code == prdMoTask.mo_task_code && x.status == "0" && x.is_label == null && x.is_mark==0).AnyAsync()) x.mo_task_code == prdMoTask.mo_task_code && x.status == "0" && x.is_label == null && x.is_mark == 0).AnyAsync())
{ {
await _db.Updateable<PrdOutPackMarkLabel>() await _db.Updateable<PrdOutPackMarkLabel>()
.SetColumns(x => x.is_label == 0) .SetColumns(x => x.is_label == 0)
@@ -2875,12 +2874,12 @@ namespace Tnb.ProductionMgr
await _db.Insertable<PrdOutPackMarkLabel>(prdOutPackMarkLabel).ExecuteCommandAsync(); await _db.Insertable<PrdOutPackMarkLabel>(prdOutPackMarkLabel).ExecuteCommandAsync();
} }
PrdMoTask parent = await _db.Queryable<PrdMoTask>().SingleAsync(x => x.id == prdMoTask.parent_id);
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().SingleAsync(x=>x.id==parent.material_id);
string code = $"(01){basMaterial.di ?? ""}\\n(11){DateTime.Now.ToString("yyMMdd")}\\n(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}\\n(10){parent.batch??""}"; PrdMoTask parent = await _db.Queryable<PrdMoTask>().SingleAsync(x => x.id == prdMoTask.parent_id);
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().SingleAsync(x => x.id == parent.material_id);
string code = $"(01){basMaterial.di ?? ""}\\n(11){DateTime.Now.ToString("yyMMdd")}\\n(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}\\n(10){parent.batch ?? ""}";
return code; return code;
} }
} }

View File

@@ -45,7 +45,7 @@ namespace Tnb.ProductionMgr
private readonly IBillRullService _billRullService; private readonly IBillRullService _billRullService;
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
public PrdOutstockService(ISqlSugarRepository<PrdOutstockH> repository, IOrganizeService organizeService, IBillRullService billRullService, IRunService runService, IUserManager userManager, IVisualDevService visualDevService, IDictionaryDataService dictionaryDataService) public PrdOutstockService(ISqlSugarRepository<PrdOutstockH> repository, IOrganizeService organizeService, IBillRullService billRullService,IRunService runService, IUserManager userManager, IVisualDevService visualDevService, IDictionaryDataService dictionaryDataService)
{ {
_db = repository.AsSugarClient(); _db = repository.AsSugarClient();
_runService = runService; _runService = runService;
@@ -98,7 +98,7 @@ namespace Tnb.ProductionMgr
string domain = _userManager.Domain; string domain = _userManager.Domain;
Dictionary<string, object> header = new() Dictionary<string, object> header = new()
{ {
["Authorization"] = App.HttpContext != null ? App.HttpContext.Request.Headers["Authorization"] : "" ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
}; };
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header); string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header);
Log.Information(sendResult); Log.Information(sendResult);
@@ -190,7 +190,7 @@ namespace Tnb.ProductionMgr
string domain = _userManager.Domain; string domain = _userManager.Domain;
Dictionary<string, object> header = new() Dictionary<string, object> header = new()
{ {
["Authorization"] = App.HttpContext != null ? App.HttpContext.Request.Headers["Authorization"] : "" ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
}; };
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header); string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header);
Log.Information(sendResult); Log.Information(sendResult);
@@ -266,12 +266,12 @@ namespace Tnb.ProductionMgr
MESCreateOutstockInput input = new MESCreateOutstockInput(); MESCreateOutstockInput input = new MESCreateOutstockInput();
input.outstock = new MESWmsOutstockHInput(); input.outstock = new MESWmsOutstockHInput();
input.outstockDs = new List<MESWmsOutstockDInput>(); input.outstockDs = new List<MESWmsOutstockDInput>();
PrdMoTask prdMoTask = await db.Queryable<PrdMoTask>().SingleAsync(x => x.id == materialOutstockInput.mo_task_id); PrdMoTask prdMoTask = await db.Queryable<PrdMoTask>().SingleAsync(x=>x.id==materialOutstockInput.mo_task_id);
BasLocation location = await db.Queryable<BasLocation>().Where(x => x.location_code == materialOutstockInput.location_code).FirstAsync(); BasLocation location = await db.Queryable<BasLocation>().Where(x=>x.location_code==materialOutstockInput.location_code).FirstAsync();
if (location == null) throw Oops.Bah("未找到库位"); if (location == null) throw Oops.Bah("未找到库位");
string locationId = location.id; string locationId = location.id;
PrdOutstockH prdOutstockH = new() PrdOutstockH prdOutstockH = new()
{ {
bill_code = await _billRullService.GetBillNumber(CodeTemplateConst.PRDOUTSTOCK_CODE), bill_code = await _billRullService.GetBillNumber(CodeTemplateConst.PRDOUTSTOCK_CODE),
@@ -287,17 +287,17 @@ namespace Tnb.ProductionMgr
input.outstock.source_code = prdOutstockH.bill_code; input.outstock.source_code = prdOutstockH.bill_code;
input.outstock.source_id = prdOutstockH.id; input.outstock.source_id = prdOutstockH.id;
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(materialOutstockInput.workstation_id, DictConst.RegionCategoryWorklineCode); OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(materialOutstockInput.workstation_id, DictConst.RegionCategoryWorklineCode);
List<string> materialIds = materialOutstockInput.details.Select(x => x.material_id).ToList(); List<string> materialIds = materialOutstockInput.details.Select(x => x.material_id).ToList();
List<BasMaterial> basMaterials = await db.Queryable<BasMaterial>().Where(x => materialIds.Contains(x.id)).ToListAsync(); List<BasMaterial> basMaterials = await db.Queryable<BasMaterial>().Where(x=>materialIds.Contains(x.id)).ToListAsync();
Dictionary<string, object> unitIdDic = await db.Queryable<BasMaterial>() Dictionary<string,object> unitIdDic = await db.Queryable<BasMaterial>()
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit) .LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit)
.LeftJoin<DictionaryDataEntity>((a, b, c) => b.Id == c.DictionaryTypeId && a.unit_id == c.EnCode) .LeftJoin<DictionaryDataEntity>((a, b, c) => b.Id == c.DictionaryTypeId && a.unit_id == c.EnCode)
.Where((a, b, c) => materialIds.Contains(a.id)) .Where((a,b,c)=>materialIds.Contains(a.id))
.Select((a, b, c) => new .Select((a, b, c) => new
{ {
key = a.id, key = a.id,
value = c.Id value = c.Id
}) })
.ToDictionaryAsync(x => x.key, x => x.value); .ToDictionaryAsync(x => x.key, x => x.value);
@@ -306,18 +306,18 @@ namespace Tnb.ProductionMgr
input.outstockDs.Add(new MESWmsOutstockDInput() input.outstockDs.Add(new MESWmsOutstockDInput()
{ {
material_id = item.material_id, material_id = item.material_id,
material_code = basMaterials.First(x => x.id == item.material_id).code, material_code = basMaterials.First(x=>x.id==item.material_id).code,
pr_qty = item.num, pr_qty = item.num,
unit_id = unitIdDic[item.material_id].ToString() unit_id = unitIdDic[item.material_id].ToString()
}); });
} }
string domain = _userManager.Domain; string domain = _userManager.Domain;
Dictionary<string, object> header = new Dictionary<string, object>() Dictionary<string, object> header = new Dictionary<string, object>()
{ {
["Authorization"] = App.HttpContext != null ? App.HttpContext.Request.Headers["Authorization"] : "" ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
}; };
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header); var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK,JsonConvert.SerializeObject(input),header);
Log.Information(sendResult); Log.Information(sendResult);
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
@@ -346,16 +346,16 @@ namespace Tnb.ProductionMgr
prdOutstockDs.Add(new PrdOutstockD() prdOutstockDs.Add(new PrdOutstockD()
{ {
material_id = item.material_id, material_id = item.material_id,
material_code = basMaterials.First(x => x.id == item.material_id).code, material_code = basMaterials.First(x=>x.id==item.material_id).code,
material_name = basMaterials.First(x => x.id == item.material_id).name, material_name = basMaterials.First(x=>x.id==item.material_id).name,
pr_qty = item.num, pr_qty = item.num,
unit_id = unitIdDic[item.material_id].ToString(), unit_id = unitIdDic[item.material_id].ToString(),
outstock_id = prdOutstockH.id, outstock_id = prdOutstockH.id,
source_id = prdMoTask.mo_task_code source_id = prdMoTask.mo_task_code
}); });
} }
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
{ {
await _repository.InsertAsync(prdOutstockH); await _repository.InsertAsync(prdOutstockH);
if (prdOutstockDs.Count > 0) if (prdOutstockDs.Count > 0)
@@ -379,132 +379,5 @@ namespace Tnb.ProductionMgr
throw Oops.Bah(e.Message); throw Oops.Bah(e.Message);
} }
} }
[HttpPost]
public async Task<dynamic> MaterialOutstockTest(MaterialOutstockInput materialOutstockInput)
{
try
{
var db = _repository.AsSugarClient();
string warehouse_id = "1";//一楼原材料仓
MESCreateOutstockInput input = new MESCreateOutstockInput();
input.outstock = new MESWmsOutstockHInput();
input.outstockDs = new List<MESWmsOutstockDInput>();
BasLocation location = await db.Queryable<BasLocation>().Where(x => x.location_code == materialOutstockInput.location_code).FirstAsync();
if (location == null) throw new AppFriendlyException("未找到库位", 500);
string locationId = location.id;
PrdOutstockH prdOutstockH = new()
{
bill_code = await _billRullService.GetBillNumber(CodeTemplateConst.PRDOUTSTOCK_CODE),
};
input.outstock.bill_type = DictConst.SHENGCHANLINGLIAO;
// input.outstock.bill_date = visualDevModelDataCrInput.data.ContainsKey("bill_date") ? Convert.ToDateTime(visualDevModelDataCrInput.data["bill_date"].ToString()) : DateTime.Now;
input.outstock.bill_date = DateTime.Now;
input.outstock.org_id = _userManager.GetUserInfo().Result.organizeId;
input.outstock.warehouse_id = warehouse_id;
input.outstock.create_id = _userManager.UserId;
input.outstock.location_code = location?.location_code ?? "";
input.outstock.source_code = prdOutstockH.bill_code;
input.outstock.source_id = prdOutstockH.id;
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(materialOutstockInput.workstation_id, DictConst.RegionCategoryWorklineCode);
List<string> materialIds = materialOutstockInput.details.Select(x => x.material_id).ToList();
List<BasMaterial> basMaterials = await db.Queryable<BasMaterial>().Where(x => materialIds.Contains(x.id)).ToListAsync();
Dictionary<string, object> unitIdDic = await db.Queryable<BasMaterial>()
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit)
.LeftJoin<DictionaryDataEntity>((a, b, c) => b.Id == c.DictionaryTypeId && a.unit_id == c.EnCode)
.Where((a, b, c) => materialIds.Contains(a.id))
.Select((a, b, c) => new
{
key = a.id,
value = c.Id
})
.ToDictionaryAsync(x => x.key, x => x.value);
foreach (var item in materialOutstockInput.details)
{
input.outstockDs.Add(new MESWmsOutstockDInput()
{
material_id = item.material_id,
material_code = basMaterials.First(x => x.id == item.material_id).code,
pr_qty = item.num,
unit_id = unitIdDic[item.material_id].ToString()
});
}
string domain = _userManager.Domain;
Dictionary<string, object> header = new Dictionary<string, object>()
{
["Authorization"] = App.HttpContext != null ? App.HttpContext.Request.Headers["Authorization"] : ""
};
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header);
Log.Information(sendResult);
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
if (authResponse.code != 200)
{
throw new AppFriendlyException(authResponse.msg, 500);
}
else
{
prdOutstockH.bill_type = DictConst.SHENGCHANLINGLIAO;
prdOutstockH.type = "2";
prdOutstockH.warehouse_id = warehouse_id;
prdOutstockH.location_code = materialOutstockInput.location_code;
prdOutstockH.create_id = _userManager.UserId;
prdOutstockH.org_id = _userManager.GetUserInfo().Result.organizeId;
prdOutstockH.bill_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
prdOutstockH.create_time = DateTime.Now;
prdOutstockH.workstation_id = materialOutstockInput.workstation_id;
prdOutstockH.workline = workline?.Id ?? "";
prdOutstockH.status = DictConst.OUTSTOCKSTATUSADD;
prdOutstockH.mo_task_id = "";
List<PrdOutstockD> prdOutstockDs = new List<PrdOutstockD>();
foreach (var item in materialOutstockInput.details)
{
prdOutstockDs.Add(new PrdOutstockD()
{
material_id = item.material_id,
material_code = basMaterials.First(x => x.id == item.material_id).code,
material_name = basMaterials.First(x => x.id == item.material_id).name,
pr_qty = item.num,
unit_id = unitIdDic[item.material_id].ToString(),
outstock_id = prdOutstockH.id,
source_id = ""
});
}
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
{
await _repository.InsertAsync(prdOutstockH);
if (prdOutstockDs.Count > 0)
{
await db.Insertable<PrdOutstockD>(prdOutstockDs).ExecuteCommandAsync();
}
});
if (!result.IsSuccess)
{
throw new AppFriendlyException(result.ErrorMessage, 500);
}
}
return await Task.FromResult(true);
}
catch (Exception e)
{
Log.Error(e.Message);
throw new AppFriendlyException(e.Message, 500);
}
}
} }
} }

View File

@@ -14,7 +14,6 @@ using SqlSugar;
using Tnb.BasicData; using Tnb.BasicData;
using Tnb.BasicData.Entities; using Tnb.BasicData.Entities;
using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities;
using Tnb.PerMgr.Entities;
using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities;
using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Entities.Dto.PrdManage;
using Tnb.ProductionMgr.Entities.Entity; using Tnb.ProductionMgr.Entities.Entity;
@@ -362,122 +361,122 @@ namespace Tnb.ProductionMgr
return PageResult<PADPackageTaskPageOutput>.SqlSugarPageResult(result); return PageResult<PADPackageTaskPageOutput>.SqlSugarPageResult(result);
} }
/// <summary> // /// <summary>
/// pda端根据工位获取任务单列表 // /// pda端根据工位获取任务单列表
/// </summary> // /// </summary>
/// <returns></returns> // /// <returns></returns>
[HttpPost] // [HttpPost]
public async Task<dynamic> GetPadPrdMoTaskList(PrdMoTaskListOutput input) // public async Task<dynamic> GetPadPrdMoTaskList(PrdMoTaskListOutput input)
{ // {
if (string.IsNullOrEmpty(input.stationId)) // if (string.IsNullOrEmpty(input.stationId))
{ // {
return new // return new
{ // {
pagination = new PageResult(), // pagination = new PageResult(),
list = Array.Empty<string>() // list = Array.Empty<string>()
}; // };
} // }
//
Dictionary<string, object> queryJson = string.IsNullOrEmpty(input.queryJson) ? new Dictionary<string, object>() : input.queryJson.ToObject<Dictionary<string, object>>(); // Dictionary<string, object> queryJson = string.IsNullOrEmpty(input.queryJson) ? new Dictionary<string, object>() : input.queryJson.ToObject<Dictionary<string, object>>();
string? mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : ""; // string? mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : "";
string? status = queryJson.ContainsKey("status") ? queryJson["status"].ToString() : ""; // string? status = queryJson.ContainsKey("status") ? queryJson["status"].ToString() : "";
DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; // DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["start_time"]) : null;
DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; // DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["end_time"]) : null;
List<string> statusList = new(); // List<string> statusList = new();
if (!string.IsNullOrEmpty(status)) // if (!string.IsNullOrEmpty(status))
{ // {
switch (status) // switch (status)
{ // {
case "1": // case "1":
statusList.Add(DictConst.InProgressEnCode); // statusList.Add(DictConst.InProgressEnCode);
statusList.Add(DictConst.MoStatusPauseCode); // statusList.Add(DictConst.MoStatusPauseCode);
break; // break;
case "2": // case "2":
statusList.Add(DictConst.ToBeScheduledEncode); // statusList.Add(DictConst.ToBeScheduledEncode);
statusList.Add(DictConst.ToBeStartedEnCode); // statusList.Add(DictConst.ToBeStartedEnCode);
break; // break;
case "3": // case "3":
statusList.Add(DictConst.ComplatedEnCode); // statusList.Add(DictConst.ComplatedEnCode);
statusList.Add(DictConst.ClosedEnCode); // statusList.Add(DictConst.ClosedEnCode);
break; // break;
} // }
} // }
// string mo_task_status = queryJson.ContainsKey("mo_task_status") ? queryJson["mo_task_status"].ToString() : ""; // // string mo_task_status = queryJson.ContainsKey("mo_task_status") ? queryJson["mo_task_status"].ToString() : "";
if (string.IsNullOrEmpty(input.sidx)) // if (string.IsNullOrEmpty(input.sidx))
{ // {
input.sidx = "create_time"; // input.sidx = "create_time";
input.sort = "desc"; // input.sort = "desc";
} // }
//
SqlSugarPagedList<PADPackageTaskPageOutput> result = await _db.Queryable<PrdMoTask>() // SqlSugarPagedList<PADPackageTaskPageOutput> result = await _db.Queryable<PrdMoTask>()
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id) // .LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
.LeftJoin<BasProcess>((a, b, c) => a.process_id == c.id) // .LeftJoin<BasProcess>((a, b, c) => a.process_id == c.id)
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workline_id == d.Id) // .LeftJoin<OrganizeEntity>((a, b, c, d) => a.workline_id == d.Id)
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode) // .LeftJoin<DictionaryDataEntity>((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode)
.LeftJoin<EqpEquipment>((a, b, c, d, e, f) => a.eqp_id == f.id) // .LeftJoin<EqpEquipment>((a, b, c, d, e, f) => a.eqp_id == f.id)
.LeftJoin<ToolMolds>((a, b, c, d, e, f, g) => a.mold_id == g.id) // .LeftJoin<ToolMolds>((a, b, c, d, e, f, g) => a.mold_id == g.id)
.LeftJoin<PerProcessStandardsH>((a, b, c, d, e, f, g, h) => a.material_id == h.output_material_id && a.eqp_id == h.equip_id && a.mold_id == h.molds_id && h.enabled == 1) // .LeftJoin<PerProcessStandardsH>((a, b, c, d, e, f, g, h) => a.material_id == h.output_material_id && a.eqp_id == h.equip_id && a.mold_id == h.molds_id && h.enabled == 1)
.LeftJoin<BasStandardTime>((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1) // .LeftJoin<BasStandardTime>((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1)
.LeftJoin<PrdMo>((a, b, c, d, e, f, g, h, i, j) => a.mo_id == j.id) // .LeftJoin<PrdMo>((a, b, c, d, e, f, g, h, i, j) => a.mo_id == j.id)
.LeftJoin<BasMaterialUnit>((a, b, c, d, e, f, g, h, i, j, k) => a.material_id == k.material_id && k.auxiliary_unit_id == "kg") // .LeftJoin<BasMaterialUnit>((a, b, c, d, e, f, g, h, i, j, k) => a.material_id == k.material_id && k.auxiliary_unit_id == "kg")
.LeftJoin<EqpDaq>((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_point == "注塑空满箱请求") // .LeftJoin<EqpDaq>((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_point == "注塑空满箱请求")
.Where((a, b) => a.workstation_id == input.stationId) // .Where((a, b) => a.workstation_id == input.stationId)
.WhereIF(!string.IsNullOrEmpty(mo_task_code), a => a.mo_task_code.Contains(mo_task_code)) // .WhereIF(!string.IsNullOrEmpty(mo_task_code), a => a.mo_task_code.Contains(mo_task_code))
//.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status==mo_task_status) // //.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status==mo_task_status)
.WhereIF(statusList.Count > 0, a => statusList.Contains(a.mo_task_status)) // .WhereIF(statusList.Count > 0, a => statusList.Contains(a.mo_task_status))
.WhereIF(status == "3" && start_time != null, a => a.act_end_date >= start_time) // .WhereIF(status == "3" && start_time != null, a => a.act_end_date >= start_time)
.WhereIF(status == "3" && end_time != null, a => a.act_end_date <= end_time) // .WhereIF(status == "3" && end_time != null, a => a.act_end_date <= end_time)
.Select((a, b, c, d, e, f, g, h, i, j, k, l) => new PADPackageTaskPageOutput // .Select((a, b, c, d, e, f, g, h, i, j, k, l) => new PADPackageTaskPageOutput
{ // {
id = a.id, // id = a.id,
mo_task_code = a.mo_task_code, // mo_task_code = a.mo_task_code,
mo_id = a.mo_id, // mo_id = a.mo_id,
mo_code = j.mo_code, // mo_code = j.mo_code,
material_id = a.material_id, // material_id = a.material_id,
material_code = b.code, // material_code = b.code,
material_name = b.name, // material_name = b.name,
workline_id = a.workline_id, // workline_id = a.workline_id,
workline_name = d.FullName, // workline_name = d.FullName,
bom_id = a.bom_id, // bom_id = a.bom_id,
mo_task_status = e.FullName, // mo_task_status = e.FullName,
complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), // complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0),
scrap_qty = a.scrap_qty, // scrap_qty = a.scrap_qty,
scheduled_qty = a.scheduled_qty, // scheduled_qty = a.scheduled_qty,
reported_work_qty = a.reported_work_qty, // reported_work_qty = a.reported_work_qty,
estimated_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS), // estimated_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS),
estimated_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), // estimated_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS),
parent_id = a.parent_id, // parent_id = a.parent_id,
process_id = a.process_id, // process_id = a.process_id,
process_name = c.process_name, // process_name = c.process_name,
mbom_process_id = a.mbom_process_id, // mbom_process_id = a.mbom_process_id,
create_time = a.create_time, // create_time = a.create_time,
equip_id = a.eqp_id, // equip_id = a.eqp_id,
equip_code = f.code, // equip_code = f.code,
equip_name = f.name, // equip_name = f.name,
mold_id = a.mold_id, // mold_id = a.mold_id,
mold_code = g.mold_code, // mold_code = g.mold_code,
mold_name = g.mold_name, // mold_name = g.mold_name,
schedule_type = a.schedule_type, // schedule_type = a.schedule_type,
mold_cavity = g.mold_cavity, // mold_cavity = g.mold_cavity,
moulding_cycle = h.moulding_cycle, // moulding_cycle = h.moulding_cycle,
standard_time = i.standard_time, // standard_time = i.standard_time,
act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS), // act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS), // act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS),
plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString(DbTimeFormat.SS), // plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString(DbTimeFormat.SS),
minpacking = b.minpacking, // minpacking = b.minpacking,
main_num = k.number_of_primary_unit, // main_num = k.number_of_primary_unit,
deputy_num = k.number_of_auxiliary_unit, // deputy_num = k.number_of_auxiliary_unit,
third_equip_code = l.equip_code, // third_equip_code = l.equip_code,
weight_name = l.label_name, // weight_name = l.label_name,
category_id = b.category_id // category_id = b.category_id
}) // })
.MergeTable() // .MergeTable()
.OrderBy($"{input.sidx} {input.sort}") // .OrderBy($"{input.sidx} {input.sort}")
.ToPagedListAsync(input.currentPage, input.pageSize); // .ToPagedListAsync(input.currentPage, input.pageSize);
//
return PageResult<PADPackageTaskPageOutput>.SqlSugarPageResult(result); // return PageResult<PADPackageTaskPageOutput>.SqlSugarPageResult(result);
//
} // }
/// <summary> /// <summary>
/// 上模校验 /// 上模校验

View File

@@ -1,62 +1,39 @@
using System; using Aop.Api.Domain;
using System.Data;
using System.Dynamic;
using System.Security.Policy;
using System.Text;
using Aop.Api.Domain;
using JNPF;
using JNPF.Common.Cache; using JNPF.Common.Cache;
using JNPF.Common.Dtos.VisualDev;
using JNPF.FriendlyException;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using NetTaste;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Qiniu.Util;
using SqlSugar; using SqlSugar;
using Tnb.Common.Extension;
using Tnb.Common.Redis; using Tnb.Common.Redis;
using Tnb.Common.Utils;
using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities;
using Tnb.ProductionMgr.Entities.Dto; using Tnb.ProductionMgr.Entities.Dto;
using Tnb.ProductionMgr.Entities.Enums; using Tnb.ProductionMgr.Entities.Enums;
using Tnb.ProductionMgr.Interfaces; using Tnb.ProductionMgr.Interfaces;
using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Configs;
using Tnb.WarehouseMgr.Entities.Consts;
using Tnb.WarehouseMgr.Interfaces;
namespace Tnb.ProductionMgr namespace Tnb.ProductionMgr
{ {
//redis定时获取数采数据 //redis定时获取数采数据
public class RedisBackGround : IHostedService, IDisposable public class RedisBackGround : IHostedService, IDisposable
{ {
private Timer? Readtimer; private Timer? Readtimer;
private Timer? CheckGettimer;
private Timer? Scantimer;
private Timer? SSXcodetimer;
private readonly RedisData _redisData; private readonly RedisData _redisData;
private readonly IPrdInstockService _prdInstockService; private readonly IPrdInstockService _prdInstockService;
private readonly ISqlSugarRepository<RedisReadConfig> _repository; private readonly ISqlSugarRepository<RedisReadConfig> _repository;
private readonly IWmsPDAScanInStockService _wmsPDAScanInStock; public RedisBackGround(RedisData redisData, IPrdInstockService prdInstockService, ISqlSugarRepository<RedisReadConfig> repository)
private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build<ElevatorControlConfiguration>();
public RedisBackGround(RedisData redisData, IPrdInstockService prdInstockService, ISqlSugarRepository<RedisReadConfig> repository, IWmsPDAScanInStockService wmsPDAScanInStock)
{ {
_redisData = redisData; _redisData = redisData;
_prdInstockService = prdInstockService; _prdInstockService = prdInstockService;
_repository = repository; _repository = repository;
_wmsPDAScanInStock = wmsPDAScanInStock;
} }
//获取redis数据 //获取redis数据
private void GetRedisData(object state) private void GetRedisData(object state)
{ {
var _redisReadConfigs = _repository.AsQueryable().Where(p => p.enabled == 1).ToList(); var _redisReadConfigs = _repository.AsQueryable().Where(p => p.enabled == 1).ToList();
foreach (var config in _redisReadConfigs) foreach (var config in _redisReadConfigs)
{ {
try try
{ {
var json = _redisData.GetHash(config.dev_name!, config.tag_name!).Result; var json= _redisData.GetHash(config.dev_name!, config.tag_name!).Result;
JObject? res = JsonConvert.DeserializeObject<JObject>(json); JObject? res = JsonConvert.DeserializeObject<JObject>(json);
if (config.data_type == (int)DataType.INT) if (config.data_type == (int)DataType.INT)
{ {
@@ -74,7 +51,7 @@ namespace Tnb.ProductionMgr
} }
else if (config.check_type == (int)CheckType.) else if (config.check_type == (int)CheckType.)
{ {
int[] ints = Array.ConvertAll(config.data!.Replace("[", "").Replace("]", "").Split(",", StringSplitOptions.RemoveEmptyEntries), int.Parse); int[] ints= Array.ConvertAll(config.data!.Replace("[","").Replace("]","").Split(",",StringSplitOptions.RemoveEmptyEntries),int.Parse);
if (ints.Contains(res.Value<int>("Value"))) if (ints.Contains(res.Value<int>("Value")))
{ {
InstockInput instockInput = new() InstockInput instockInput = new()
@@ -124,258 +101,126 @@ namespace Tnb.ProductionMgr
break; break;
} }
} }
//ctu取货 //获取注塑装箱状态
private void CheckGet(object state) private void GetZSPackStatus(object state)
{ {
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>(); try
getdic.Add("SSX-021-005", new string[] { "YTCS", "AllowFullOut_CS05", "LiftCode" });
getdic.Add("SSX-011-002", new string[] { "YTCS", "AllowAgvFullIn_CS02", "Code_CS02" });
getdic.Add("SSX-011-004", new string[] { "YTCS", "AllowCtuFullOut_CS04", "Code_CS04" });
getdic.Add("SSX-011-008", new string[] { "东面提升机输送线", "入库输送线8允许出箱", "入库输送线7条码" });
getdic.Add("SSX-111-011", new string[] { "东面提升机输送线", "下升降机11允许出箱", "下升降机11条码" });
getdic.Add("SSX-111-012", new string[] { "东面提升机输送线", "下升降机12允许出箱", "下升降机12条码" });
getdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AllowAgvEmptyOut_CS03", "" });
getdic.Add("ZSSSXCTU01", new string[] { "YTCS", "AllowAgvEmptyOut_CS01", "" });
foreach (var key in getdic.Keys)
{ {
try string[] strs = new string[1] { "TY4C-ZHUSU1" };
string sign = "agvMode";
foreach (string s in strs)
{ {
var strs = getdic.Where(p => p.Key == key).First().Value; Dictionary<string, string> dic = _redisData.HGetAll(s).Result;
bool flag = _redisData.HashExist(strs[0], strs[1]).Result; foreach (KeyValuePair<string, string> kv in dic)
string data = _redisData.GetHash(strs[0], strs[1]).Result;
JObject? res = JsonConvert.DeserializeObject<JObject>(data);
bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false;
if (result)
{ {
if (!string.IsNullOrEmpty(strs[2])) if (!kv.Key.Contains(sign))
{ {
string codedata = _redisData.GetHash(strs[0], strs[2]).Result; continue;
JObject? coderes = JsonConvert.DeserializeObject<JObject>(codedata);
string coderesult = coderes != null && coderes["Value"] != null ? coderes.Value<string>("Value")! : "";
coderesult = coderesult.Replace("\r", "");
var DistaskH = _repository.AsSugarClient().Queryable<WmsDistaskH>().Where(p => p.carry_code == coderesult && p.status == WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID && string.IsNullOrEmpty(p.extras)).First();
if (DistaskH != null)
{
dynamic reqBody = new ExpandoObject();
reqBody.taskCode = DistaskH.bill_code;
reqBody.slotCode = key;
reqBody.containerCode = coderesult;
CancellationTokenSource Ctu = new();
dynamic respBody = HttpClientHelper.PostStreamAsync("http://192.168.11.104:1880/wcs/notify/cargo", reqBody, Ctu.Token).Result;
DistaskH.extras = respBody;
_repository.AsSugarClient().Updateable(DistaskH).ExecuteCommand();
Ctu.Dispose();
}
} }
else { JObject? res = JsonConvert.DeserializeObject<JObject>(kv.Value);
var DistaskH = _repository.AsSugarClient().Queryable<WmsDistaskH>().Where(p => p.startlocation_code == key && p.status == WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID && string.IsNullOrEmpty(p.extras)).First(); if (res != null && res["Value"] != null)
if (DistaskH != null) {
if (int.Parse(res["Value"]!.ToString()) is not ((int)Eagvmode.) and not ((int)Eagvmode.))
{ {
dynamic reqBody = new ExpandoObject(); InstockInput instockInput = new()
reqBody.taskCode = DistaskH.bill_code; {
reqBody.slotCode = key; equip_code = res["DevName"]!.ToString(),
reqBody.containerCode = DistaskH.carry_code; label_code = res["TagName"]!.ToString()
CancellationTokenSource Ctu = new(); };
dynamic respBody = HttpClientHelper.PostStreamAsync("http://192.168.11.104:1880/wcs/notify/cargo", reqBody, Ctu.Token).Result; _prdInstockService.InstockTypeOne(instockInput);
DistaskH.extras = respBody;
_repository.AsSugarClient().Updateable(DistaskH).ExecuteCommand();
Ctu.Dispose();
} }
} }
} }
} }
catch (Exception) }
{ catch (Exception)
{
}
} }
} }
//获取挤出装箱状态
private static readonly Dictionary<LogLevel, string> s_logLevelMap = new() private void GetJCPackStatus(object state)
{ {
[LogLevel.Debug] = "DBG", try
[LogLevel.Information] = "INF",
[LogLevel.Warning] = "WRN",
[LogLevel.Error] = "ERR",
};
protected ILogger Logger => LoggerFactory.Create(builder => builder.AddFile($"{AppContext.BaseDirectory}/logs/custom{DateTime.Now:yyyyMMdd}.log", cfgOpts =>
{
//cfgOpts.DateFormat = "yyyy-MM-dd HH:mm:ss.fff";
cfgOpts.MessageFormat = (logMsg) =>
{ {
var logLevel = s_logLevelMap[logMsg.LogLevel]; string[] strs = new string[1] { "TY4C-SHUSONG-JC" };
var sb = new StringBuilder(); string sign = "AGVFullCall";
_ = sb.Append($"[{logLevel}] "); foreach (string s in strs)
_ = sb.Append($"{logMsg.LogName} ");
_ = sb.Append($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} ");
_ = sb.Append($"#{logMsg.EventId.Id} ");
_ = sb.Append(logMsg.Message + " ");
_ = sb.Append(logMsg.Exception?.ToString());
return sb.ToString();
};
})).CreateLogger(this.GetType());
//扫码入库
private void ScanInStock(object state)
{
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
getdic.Add("BGWRKYCL02", new string[] { "CP8", "AllowGetFullBox1", "code1", "PutDoneEmptyBox", "false" });
getdic.Add("BGWRKYCL01", new string[] { "CP8", "AllowGetFullBox2", "code2", "PutDoneEmptyBox", "false" });
foreach (var key in getdic.Keys)
{
try
{ {
var strs = getdic.Where(p => p.Key == key).First().Value; Dictionary<string, string> dic = _redisData.HGetAll(s).Result;
bool flag = _redisData.HashExist(strs[0], strs[1]).Result; foreach (KeyValuePair<string, string> kv in dic)
string data = _redisData.GetHash(strs[0], strs[1]).Result;
JObject? res = JsonConvert.DeserializeObject<JObject>(data);
bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false;
if (result)
{ {
Logger.LogInformation($"八工位扫到码发送入库请求:{res}"); if (!kv.Key.Contains(sign))
Dictionary<string, string> dicCommand = new(StringComparer.OrdinalIgnoreCase)
{ {
["DevName"] = strs[0], continue;
["token"] = _eleCtlCfg.token, }
["TagName"] = strs[3], JObject? res = JsonConvert.DeserializeObject<JObject>(kv.Value);
["Value"] = strs[4], if (res != null && res["Value"] != null)
};
HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand).Wait();
string codedata = _redisData.GetHash(strs[0], strs[2]).Result;
JObject? coderes = JsonConvert.DeserializeObject<JObject>(codedata);
string coderesult = coderes != null && coderes["Value"] != null ? coderes.Value<string>("Value")! : "";
WmsCarryH? carry = _repository.AsSugarClient().Queryable<WmsCarryH>().Single(it => it.carry_code == coderesult);
if (carry != null)
{ {
if (_repository.AsSugarClient().Queryable<WmsPretaskH>().Where(p => p.carry_id == carry.id && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID ).Any()) if (res.Value<bool>("Value"))
continue;
var WmsCarryCode = _repository.AsSugarClient().Queryable<WmsCarryCode>().Single(it => it.carry_id == carry.id);
if (WmsCarryCode != null)
{ {
VisualDevModelDataCrInput input = new VisualDevModelDataCrInput(); InstockInput instockInput = new()
input.data = new Dictionary<string, object>(); {
input.data.Add("barcode", coderesult); equip_code = res["DevName"]!.ToString(),
input.data.Add("codeqty", WmsCarryCode.codeqty);//条码数量 label_code = res["TagName"]!.ToString()
input.data.Add("material_code", WmsCarryCode.material_code); };
input.data.Add("extras", key);//location_code _prdInstockService.InstockTypeOne(instockInput);
input.data.Add("warehouse_id", "1");//TEST
input.data.Add("bill_code", "");//采购收货单号
input.data.Add("code_batch", WmsCarryCode.code_batch!);//批次
input.data.Add("material_specification", WmsCarryCode.material_specification!);//规格型号
input.data.Add("container_no", WmsCarryCode.container_no!);//箱号
input.data.Add("material_id", WmsCarryCode.material_id);
input.data.Add("id", null);
_wmsPDAScanInStock.ScanInStockByRedis(input).Wait();
} }
} }
} }
} }
catch (Exception) }
{ catch (Exception)
{
}
} }
} }
//获取限位状态
private void SSXcode(object state) private void GetLimitStatus(object state)
{ {
Dictionary<string, string[]> dic = new Dictionary<string, string[]>(); /*
//有问题 Console.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss}");
dic.Add("东面提升机输送线", new string[] { "下升降机判断请求", "下升降机判断条码", "下升降机判断完毕", "下升降机判断结果" }); Console.WriteLine($"获取挤出装箱状态");
Dictionary<string, int> putdic = new Dictionary<string, int>(); string data = _redisData.GetHash("TY4C-SHUSONG-JC", "AGVFullCall").Result;
putdic.Add("SSX-111-011", 11); Console.WriteLine(data);*/
putdic.Add("SSX-111-012", 12); try
foreach (var key in dic.Keys)
{ {
try string[] strs = new string[1] { "TY4C-WAIBAO" };
string sign = "AGVCall";
foreach (string s in strs)
{ {
var strs = dic.Where(p => p.Key == key).First().Value; Dictionary<string, string> dic = _redisData.HGetAll(s).Result;
string dataflag = _redisData.GetHash(key, strs[0]).Result; foreach (KeyValuePair<string, string> kv in dic)
JObject? resflag = JsonConvert.DeserializeObject<JObject>(dataflag);
bool re = resflag != null && resflag["Value"] != null ? resflag.Value<bool>("Value") : false;
if (!re)
continue;
string data = _redisData.GetHash(key, strs[1]).Result;
JObject? res = JsonConvert.DeserializeObject<JObject>(data);
string? result = res != null && res["Value"] != null ? res.Value<string>("Value") : "";
if (!string.IsNullOrEmpty(result))
{ {
if (result.Length < 5) if (!kv.Key.Contains(sign))
{ {
result = "LX" + result.Replace("\r", ""); continue;
} }
var DistaskH = _repository.AsSugarClient().Queryable<WmsDistaskH>().Where(p => p.carry_code == result && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).OrderByDescending(p => p.create_time).First(); JObject? res = JsonConvert.DeserializeObject<JObject>(kv.Value);
if (DistaskH != null) if (res != null && res["Value"] != null)
{ {
Dictionary<string, string> dicCommand2 = new(StringComparer.OrdinalIgnoreCase) if (res.Value<bool>("Value"))
{ {
["DevName"] = key, InstockInput instockInput = new()
["token"] = _eleCtlCfg.token, {
["TagName"] = strs[3], equip_code = res["DevName"]!.ToString(),
["Value"] = putdic.Keys.Contains(DistaskH.startlocation_code) ? putdic.Where(p => p.Key == DistaskH.startlocation_code).First().Value.ToString() : "13", label_code = res["TagName"]!.ToString()
}; };
HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand2).Wait(); _prdInstockService.InstockOutPack(instockInput);
Dictionary<string, string> dicCommand = new(StringComparer.OrdinalIgnoreCase) }
{
["DevName"] = key,
["token"] = _eleCtlCfg.token,
["TagName"] = strs[2],
["Value"] = "true",
};
HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand).Wait();
}
else
{
Dictionary<string, string> dicCommand2 = new(StringComparer.OrdinalIgnoreCase)
{
["DevName"] = key,
["token"] = _eleCtlCfg.token,
["TagName"] = strs[3],
["Value"] = "13",
};
HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand2).Wait();
Dictionary<string, string> dicCommand = new(StringComparer.OrdinalIgnoreCase)
{
["DevName"] = key,
["token"] = _eleCtlCfg.token,
["TagName"] = strs[2],
["Value"] = "true",
};
HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand).Wait();
} }
} }
} }
catch (Exception) }
{ catch (Exception)
{
}
} }
} }
public void Dispose() public void Dispose()
{ {
Readtimer?.Dispose(); Readtimer?.Dispose();
CheckGettimer?.Dispose();
Scantimer?.Dispose();
SSXcodetimer?.Dispose();
} }
public Task StartAsync(CancellationToken cancellationToken) public Task StartAsync(CancellationToken cancellationToken)
{ {
Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromSeconds(300)); Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromSeconds(300));
CheckGettimer = new Timer(CheckGet, null, TimeSpan.Zero, TimeSpan.FromSeconds(10));
Scantimer = new Timer(ScanInStock, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
SSXcodetimer= new Timer(SSXcode, null, TimeSpan.Zero, TimeSpan.FromSeconds(10));
return Task.CompletedTask; return Task.CompletedTask;
} }
public Task StopAsync(CancellationToken cancellationToken) public Task StopAsync(CancellationToken cancellationToken)

View File

@@ -12,11 +12,9 @@
<ProjectReference Include="..\..\BasicData\Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj" /> <ProjectReference Include="..\..\BasicData\Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj" />
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr.Interfaces\Tnb.EquipMgr.Interfaces.csproj" /> <ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr.Interfaces\Tnb.EquipMgr.Interfaces.csproj" />
<ProjectReference Include="..\..\message\Tnb.Message\Tnb.Message.csproj" /> <ProjectReference Include="..\..\message\Tnb.Message\Tnb.Message.csproj" />
<ProjectReference Include="..\..\PerMgr\Tnb.PerMgr.Entities\Tnb.PerMgr.Entities.csproj" />
<ProjectReference Include="..\..\QcMgr\Tnb.QcMgr.Interfaces\Tnb.QcMgr.Interfaces.csproj" />
<ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" /> <ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" />
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" /> <ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
<ProjectReference Include="..\..\WarehouseMgr\Tnb.WarehouseMgr.Interfaces\Tnb.WarehouseMgr.Interfaces.csproj" /> <ProjectReference Include="..\..\WarehouseMgr\Tnb.WarehouseMgr.Entities\Tnb.WarehouseMgr.Entities.csproj" />
<ProjectReference Include="..\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" /> <ProjectReference Include="..\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" />
</ItemGroup> </ItemGroup>

View File

@@ -1,119 +0,0 @@
using System.Text;
using JNPF;
using JNPF.Common.Extension;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using SqlSugar;
using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Dto.Queries;
using Tnb.WarehouseMgr.Entities.Entity;
namespace Tnb.WarehouseMgr
{
public class DevServBase<TService> : BaseWareHouseService
{
protected static Dictionary<string, object> s_elevatorMap = new();
private static readonly Lazy<Task> initializationTask;
private static SqlSugarScope context;
private readonly ISqlSugarClient _db;
public static Dictionary<string, int> s_eleUseStatusDic = new();
public static Dictionary<string, int> s_loadedStatusDic = new();
static DevServBase()
{
//initializationTask = new Lazy<Task>(InitializeAsync);
_ = Task.Run(() => InitializeAsync());
}
public DevServBase(ISqlSugarClient db)
{
_db = db;
}
private static async Task InitializeAsync()
{
ConnectionStringsOptions connectionOpts = App.GetConfig<ConnectionStringsOptions>("ConnectionStrings", true);
ConnectionConfig cfg = new()
{
ConfigId = connectionOpts.ConfigId,
ConnectionString = connectionOpts.ConnectString,
DbType = DbType.PostgreSQL,
IsAutoCloseConnection = true,
};
context = new(cfg);
s_elevatorMap = await context.Queryable<WmsElevatorH>().ToDictionaryAsync(x => x.elevator_id, x => x.elevator_code);
}
//public static Task InitializationTask => initializationTask.Value;
/// <summary>
/// 获取电梯根据任务单号
/// </summary>
/// <param name="input">
/// taskCode:子任务编号
/// endlocation_id:目标库位ID
/// </param>
/// <returns></returns>
protected async Task<WmsElevatorH> FindElevatorFromPars(ElevagorInfoQuery input)
{
var whereExpable = Expressionable.Create<WmsElevatorH, WmsElevatorD, WmsDistaskH>()
.And((a, b, c) => a.enabled == 1);
if (!input.taskCode.IsNullOrEmpty())
{
whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.taskCode), (a, b, c) => c.bill_code == input.taskCode);
}
if (!input.endlocation_id.IsNullOrEmpty())
{
whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.endlocation_id), (a, b, c) => b.location_id == input.endlocation_id);
}
if (!input.startlocation_id.IsNullOrEmpty())
{
whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.startlocation_id), (a, b, c) => b.location_id == input.startlocation_id);
}
var ele = await _db.CopyNew().Queryable<WmsElevatorH>().InnerJoin<WmsElevatorD>((a, b) => a.id == b.bill_id)
.InnerJoin<WmsDistaskH>((a, b, c) => b.location_code == c.endlocation_code || b.location_code == c.startlocation_code)
.Where(whereExpable.ToExpression())
.WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-R", input.sourceName), (a, b, c) => c.startpoint_code == input.sourceName)
.WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-C", input.sourceName), (a, b, c) => c.endpoint_code == input.sourceName)
.Select((a, b, c) => new WmsElevatorH
{
bill_code = c.bill_code,
device_id = a.elevator_id,
end_floor = c.end_floor
}, true)
.FirstAsync();
return ele;
}
}
public static class CustomLoggerExtenstions
{
public static void Debug(this ILogger logger, string message, params object[] parameters)
{
logger.Debug(message, parameters);
}
public static void Information(this ILogger logger, string message, params object[] parameters)
{
logger.LogInformation(message, parameters);
}
public static void Error(this ILogger logger, string message, Exception ex, params object[] parameters)
{
logger.LogError(ex, message, parameters);
}
public static void Error(this ILogger logger, string message, params object[] parameters)
{
logger.LogError(message, parameters);
}
}
}

View File

@@ -1,5 +1,4 @@
using Aop.Api.Domain; using JNPF;
using JNPF;
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.Extension;
@@ -35,7 +34,7 @@ namespace Tnb.WarehouseMgr
/// Wms设备接口提供程序服务类 /// Wms设备接口提供程序服务类
/// </summary> /// </summary>
public class DeviceProviderService : DevServBase<DeviceProviderService> public class DeviceProviderService : ServiceLoggerBase<DeviceProviderService>
{ {
private readonly ISqlSugarClient _db; private readonly ISqlSugarClient _db;
private readonly IWareHouseService _wareHouseService; private readonly IWareHouseService _wareHouseService;
@@ -46,6 +45,7 @@ namespace Tnb.WarehouseMgr
private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build<ElevatorControlConfiguration>(); private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build<ElevatorControlConfiguration>();
private readonly ILoggerFactory _loggerFactory; private readonly ILoggerFactory _loggerFactory;
public static Dictionary<string, int> s_eleUseStatusDic = new(); public static Dictionary<string, int> s_eleUseStatusDic = new();
public static Dictionary<string, int> s_loadedStatusDic = new();
@@ -54,7 +54,7 @@ namespace Tnb.WarehouseMgr
IEventPublisher eventPublisher, IEventPublisher eventPublisher,
IUserManager userManger, IUserManager userManger,
IElevatorControlService elevatorControlService IElevatorControlService elevatorControlService
) : base(repository.AsSugarClient()) ) //: base(repository.AsSugarClient())
{ {
_db = repository.AsSugarClient(); _db = repository.AsSugarClient();
_wareHouseService = wareHouseService; _wareHouseService = wareHouseService;
@@ -187,6 +187,49 @@ namespace Tnb.WarehouseMgr
return await ToApiResult(HttpStatusCode.InternalServerError, "请重试!"); return await ToApiResult(HttpStatusCode.InternalServerError, "请重试!");
} }
/// <summary>
/// 获取电梯根据任务单号
/// </summary>
/// <param name="input">
/// taskCode:子任务编号
/// endlocation_id:目标库位ID
/// </param>
/// <returns></returns>
protected async Task<WmsElevatorH> FindElevatorFromPars(ElevagorInfoQuery input)
{
var whereExpable = Expressionable.Create<WmsElevatorH, WmsElevatorD, WmsDistaskH>()
.And((a, b, c) => a.enabled == 1);
if (!input.taskCode.IsNullOrEmpty())
{
whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.taskCode), (a, b, c) => c.bill_code == input.taskCode);
}
if (!input.endlocation_id.IsNullOrEmpty())
{
whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.endlocation_id), (a, b, c) => b.location_id == input.endlocation_id);
}
if (!input.startlocation_id.IsNullOrEmpty())
{
whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.startlocation_id), (a, b, c) => b.location_id == input.startlocation_id);
}
var ele = await _db.CopyNew().Queryable<WmsElevatorH>().InnerJoin<WmsElevatorD>((a, b) => a.id == b.bill_id)
.InnerJoin<WmsDistaskH>((a, b, c) => b.location_code == c.endlocation_code || b.location_code == c.startlocation_code)
.Where(whereExpable.ToExpression())
.WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-R", input.sourceName), (a, b, c) => c.startpoint_code == input.sourceName)
.WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-C", input.sourceName), (a, b, c) => c.endpoint_code == input.sourceName)
.Select((a, b, c) => new WmsElevatorH
{
bill_code = c.bill_code,
device_id = a.elevator_id,
end_floor = c.end_floor
}, true)
.FirstAsync();
return ele;
}
/// <summary> /// <summary>
/// 放货确认/申请放货 /// 放货确认/申请放货
/// </summary> /// </summary>

View File

@@ -0,0 +1,84 @@
using System.Text;
using JNPF;
using Microsoft.Extensions.Logging;
using SqlSugar;
using Tnb.WarehouseMgr.Entities;
namespace Tnb.WarehouseMgr
{
public class ServiceLoggerBase<TService> : BaseWareHouseService
{
protected static Dictionary<string, object> s_elevatorMap = new();
private static readonly Lazy<Task> initializationTask;
static ServiceLoggerBase()
{
initializationTask = new Lazy<Task>(InitializeAsync);
}
private static async Task InitializeAsync()
{
ConnectionStringsOptions connectionOpts = App.GetConfig<ConnectionStringsOptions>("ConnectionStrings", true);
ConnectionConfig cfg = new()
{
ConfigId = connectionOpts.ConfigId,
ConnectionString = connectionOpts.ConnectString,
DbType = DbType.PostgreSQL,
IsAutoCloseConnection = true,
};
SqlSugarScope context = new(cfg);
s_elevatorMap = await context.Queryable<WmsElevatorH>().ToDictionaryAsync(x => x.elevator_id, x => x.elevator_code);
}
public static Task InitializationTask => initializationTask.Value;
//protected ILogger Logger => LoggerFactory.Create(builder => builder.AddFile($"{AppContext.BaseDirectory}/logs/{this.GetType().Name}{DateTime.Now:yyyyMMdd}.log", cfgOpts =>
//{
// //cfgOpts.DateFormat = "yyyy-MM-dd HH:mm:ss.fff";
// cfgOpts.MessageFormat = (logMsg) =>
// {
// Span<char> span = logMsg.LogLevel.ToString().ToCharArray();
// StringBuilder sb = new();
// _ = sb.Append($"{span[..4]} ");
// _ = sb.Append($"{logMsg.LogName} ");
// _ = sb.Append($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} ");
// _ = sb.Append($"#{logMsg.EventId.Id} ");
// _ = sb.Append(logMsg.Message + " ");
// _ = sb.Append(logMsg.Exception?.ToString());
// return sb.ToString();
// };
//})).CreateLogger(this.GetType());
}
public static class CustomLoggerExtenstions
{
public static void Debug(this ILogger logger, string message, params object[] parameters)
{
logger.Debug(message, parameters);
}
public static void Information(this ILogger logger, string message, params object[] parameters)
{
logger.LogInformation(message, parameters);
}
public static void Error(this ILogger logger, string message, Exception ex, params object[] parameters)
{
logger.LogError(ex, message, parameters);
}
public static void Error(this ILogger logger, string message, params object[] parameters)
{
logger.LogError(message, parameters);
}
}
}

View File

@@ -18,6 +18,7 @@
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr.Entities\Tnb.EquipMgr.Entities.csproj" /> <ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr.Entities\Tnb.EquipMgr.Entities.csproj" />
<ProjectReference Include="..\..\message\Tnb.Message.Interfaces\Tnb.Message.Interfaces.csproj" /> <ProjectReference Include="..\..\message\Tnb.Message.Interfaces\Tnb.Message.Interfaces.csproj" />
<ProjectReference Include="..\..\ProductionMgr\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" /> <ProjectReference Include="..\..\ProductionMgr\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" />
<!--<ProjectReference Include="..\..\ProductionMgr\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" />-->
<ProjectReference Include="..\..\QcMgr\Tnb.QcMgr.Interfaces\Tnb.QcMgr.Interfaces.csproj" /> <ProjectReference Include="..\..\QcMgr\Tnb.QcMgr.Interfaces\Tnb.QcMgr.Interfaces.csproj" />
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" /> <ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
<ProjectReference Include="..\Tnb.WarehouseMgr.Interfaces\Tnb.WarehouseMgr.Interfaces.csproj" /> <ProjectReference Include="..\Tnb.WarehouseMgr.Interfaces\Tnb.WarehouseMgr.Interfaces.csproj" />

View File

@@ -28,7 +28,6 @@ using Tnb.BasicData.Entities;
using Tnb.Common.Extension; using Tnb.Common.Extension;
using Tnb.Common.Redis; using Tnb.Common.Redis;
using Tnb.Common.Utils; using Tnb.Common.Utils;
using Tnb.ProductionMgr.Entities;
using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Configs; using Tnb.WarehouseMgr.Entities.Configs;
using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Consts;
@@ -44,7 +43,7 @@ namespace Tnb.WarehouseMgr
/// <summary> /// <summary>
/// 库房业务类(出入库) /// 库房业务类(出入库)
/// </summary> /// </summary>
public class WareHouseService : DevServBase<WareHouseService>, IWareHouseService public class WareHouseService : ServiceLoggerBase<WareHouseService>, IWareHouseService
{ {
private readonly ISqlSugarClient _db; private readonly ISqlSugarClient _db;
private readonly IDictionaryDataService _dictionaryDataService; private readonly IDictionaryDataService _dictionaryDataService;
@@ -64,7 +63,7 @@ namespace Tnb.WarehouseMgr
public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService, RedisData redisData, public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService, RedisData redisData,
IBillRullService billRullService, IUserManager userManager, ICacheManager cacheManager, IElevatorControlService elevatorControlService IBillRullService billRullService, IUserManager userManager, ICacheManager cacheManager, IElevatorControlService elevatorControlService
//IConfiguration configuration //IConfiguration configuration
) : base(repository.AsSugarClient()) )// : base(repository.AsSugarClient())
{ {
_db = repository.AsSugarClient(); _db = repository.AsSugarClient();
_dictionaryDataService = dictionaryDataService; _dictionaryDataService = dictionaryDataService;
@@ -663,6 +662,49 @@ namespace Tnb.WarehouseMgr
agvCts.Dispose(); agvCts.Dispose();
} }
} }
/// <summary>
/// 获取电梯根据任务单号
/// </summary>
/// <param name="input">
/// taskCode:子任务编号
/// endlocation_id:目标库位ID
/// </param>
/// <returns></returns>
protected async Task<WmsElevatorH> FindElevatorFromPars(ElevagorInfoQuery input)
{
var whereExpable = Expressionable.Create<WmsElevatorH, WmsElevatorD, WmsDistaskH>()
.And((a, b, c) => a.enabled == 1);
if (!input.taskCode.IsNullOrEmpty())
{
whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.taskCode), (a, b, c) => c.bill_code == input.taskCode);
}
if (!input.endlocation_id.IsNullOrEmpty())
{
whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.endlocation_id), (a, b, c) => b.location_id == input.endlocation_id);
}
if (!input.startlocation_id.IsNullOrEmpty())
{
whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.startlocation_id), (a, b, c) => b.location_id == input.startlocation_id);
}
var ele = await _db.CopyNew().Queryable<WmsElevatorH>().InnerJoin<WmsElevatorD>((a, b) => a.id == b.bill_id)
.InnerJoin<WmsDistaskH>((a, b, c) => b.location_code == c.endlocation_code || b.location_code == c.startlocation_code)
.Where(whereExpable.ToExpression())
.WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-R", input.sourceName), (a, b, c) => c.startpoint_code == input.sourceName)
.WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-C", input.sourceName), (a, b, c) => c.endpoint_code == input.sourceName)
.Select((a, b, c) => new WmsElevatorH
{
bill_code = c.bill_code,
device_id = a.elevator_id,
end_floor = c.end_floor
}, true)
.FirstAsync();
return ele;
}
#region CTU #region CTU
/// <summary> /// <summary>
/// 生成CTU任务执行 /// 生成CTU任务执行

View File

@@ -34,7 +34,7 @@ namespace Tnb.WarehouseMgr
/// 盘点任务 /// 盘点任务
/// </summary> /// </summary>
[OverideVisualDev(ModuleConsts.MODULE_WMSCHECKTASK_ID)] [OverideVisualDev(ModuleConsts.MODULE_WMSCHECKTASK_ID)]
public class WmsCheckTaskService : BaseWareHouseService public class WmsCheckTaskService : ServiceLoggerBase<WmsCheckTaskService>
{ {
private readonly ISqlSugarClient _db; private readonly ISqlSugarClient _db;
private readonly IWareHouseService _warehouseService; private readonly IWareHouseService _warehouseService;

View File

@@ -6,11 +6,11 @@ using Tnb.WarehouseMgr.Entities.Consts;
namespace Tnb.WarehouseMgr namespace Tnb.WarehouseMgr
{ {
[OverideVisualDev(ModuleConsts.MODULE_WMSDISTASK_ID)] [OverideVisualDev(ModuleConsts.MODULE_WMSDISTASK_ID)]
public class WmsDistaskService : TaskManagerDelBase<WmsDistaskH> public class WmsDistaskService : BaseWareHouseService
{ {
private readonly ISqlSugarClient _db; private readonly ISqlSugarClient _db;
public WmsDistaskService(ISqlSugarRepository<WmsDistaskH> repository):base(repository.AsSugarClient()) public WmsDistaskService(ISqlSugarRepository<WmsDistaskH> repository)
{ {
_db = repository.AsSugarClient(); _db = repository.AsSugarClient();
OverideFuncs.DeleteAsync = Delete; OverideFuncs.DeleteAsync = Delete;

View File

@@ -35,7 +35,7 @@ namespace Tnb.WarehouseMgr
/// </summary> /// </summary>
[OverideVisualDev(ModuleConsts.MODULE_WMSOUTSTOCK_ID)] [OverideVisualDev(ModuleConsts.MODULE_WMSOUTSTOCK_ID)]
[ServiceModule(BizTypeId)] [ServiceModule(BizTypeId)]
public class WmsOutStockService : DevServBase<WmsOutStockService>, IWmsOutStockService public class WmsOutStockService : ServiceLoggerBase<WmsOutStockService>, IWmsOutStockService
{ {
private const string BizTypeId = "26191522660645"; private const string BizTypeId = "26191522660645";
private readonly ISqlSugarClient _db; private readonly ISqlSugarClient _db;
@@ -59,7 +59,7 @@ namespace Tnb.WarehouseMgr
IBillRullService billRullService, IBillRullService billRullService,
IWmsCarryMoveInStockService wmsCarryMoveInStockService, IWmsCarryMoveInStockService wmsCarryMoveInStockService,
IWmsCarryService wareCarryService, IWmsCarryService wareCarryService,
IEventPublisher eventPublisher) : base(repository.AsSugarClient()) IEventPublisher eventPublisher)
{ {
_db = repository.AsSugarClient(); _db = repository.AsSugarClient();
_dictionaryDataService = dictionaryDataService; _dictionaryDataService = dictionaryDataService;
@@ -72,6 +72,7 @@ namespace Tnb.WarehouseMgr
_wareCarryService = wareCarryService; _wareCarryService = wareCarryService;
OverideFuncs.CreateAsync = OutStockApplyFor; OverideFuncs.CreateAsync = OutStockApplyFor;
_ = InitializationTask;
} }
public async Task<dynamic> OutStockApplyFor(VisualDevModelDataCrInput input) public async Task<dynamic> OutStockApplyFor(VisualDevModelDataCrInput input)
@@ -114,7 +115,7 @@ namespace Tnb.WarehouseMgr
List<string?> freeLocIds = fLocIds.Except(minTaskNumLocs.Select(x => x.endlocation_id)).ToList(); List<string?> freeLocIds = fLocIds.Except(minTaskNumLocs.Select(x => x.endlocation_id)).ToList();
if (freeLocIds?.Count > 0) if (freeLocIds?.Count > 0)
{ {
int rIdx = Random.Shared.Next(0, freeLocIds.Count); int rIdx = Random.Shared.Next(0, freeLocIds.Count);
loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == freeLocIds[rIdx]); loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == freeLocIds[rIdx]);
} }
else else
@@ -711,7 +712,6 @@ namespace Tnb.WarehouseMgr
List<WmsPointH> points = new List<WmsPointH>(); List<WmsPointH> points = new List<WmsPointH>();
if (sPoint.area_code != ePoint.area_code) if (sPoint.area_code != ePoint.area_code)
{ {
points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
if (points.Count <= 2) if (points.Count <= 2)
{ {
throw new AppFriendlyException("该路径不存在", 500); throw new AppFriendlyException("该路径不存在", 500);
@@ -739,11 +739,6 @@ namespace Tnb.WarehouseMgr
startlocation_code = sPoint?.location_code ?? string.Empty, startlocation_code = sPoint?.location_code ?? string.Empty,
endlocation_id = ePoint?.location_id ?? string.Empty, endlocation_id = ePoint?.location_id ?? string.Empty,
endlocation_code = ePoint?.location_code ?? string.Empty, endlocation_code = ePoint?.location_code ?? string.Empty,
startpoint_id = sPoint.id,
startpoint_code = sPoint.point_code,
endpoint_id = ePoint.id,
endpoint_code = ePoint.point_code,
start_floor = sPoint?.floor.ToString(), start_floor = sPoint?.floor.ToString(),
end_floor = ePoint?.floor.ToString(), end_floor = ePoint?.floor.ToString(),
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(), bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),

View File

@@ -2,7 +2,7 @@
"JNPF_App": { "JNPF_App": {
"CodeAreasName": [ "SubDev" ], "CodeAreasName": [ "SubDev" ],
//系统文件路径 //系统文件路径
"SystemPath": "D:\\ToTong\\tnb\\Resources", "SystemPath": "D:\\cosmoplat\\tnb\\Resources",
//微信公众号允许上传文件类型 //微信公众号允许上传文件类型
"MPUploadFileType": [ "MPUploadFileType": [
"bmp", "bmp",
@@ -102,7 +102,7 @@
// 软件的错误报告 // 软件的错误报告
"ErrorReport": false, "ErrorReport": false,
//软件的错误报告发给谁 //软件的错误报告发给谁
"ErrorReportTo": "tuotong_tech@163.com" "ErrorReportTo": ""
}, },
// ================== 单点登录配置(和其他登录方式 只能二选一) ============================== --> // ================== 单点登录配置(和其他登录方式 只能二选一) ============================== -->
"OAuth": { "OAuth": {

View File

@@ -1,21 +0,0 @@
{
"AppSettings": {
"InjectMiniProfiler": true,
"SupportPackageNamePrefixs": [ "Tnb" ]
},
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:9231"
}
}
},
"YitId": {
"WorkerId": 1, //必须 全局唯一,必须 程序设定,理论最大值 2^WorkerIdBitLength-1
"WorkerIdBitLength": 4, //机器码位长,决定 WorkerId 的最大值,默认值6,取值范围 [1, 16]
"SeqBitLength": 4 //序列数位长,默认值6,取值范围 [3, 21](建议不小于4),决定每毫秒基础生成的ID个数
},
"UnifyResultSettings": {
"ShowExceptionDetail": true
}
}

View File

@@ -4,7 +4,7 @@
"ip": "localhost", "ip": "localhost",
"port": 6379, "port": 6379,
"password": "05jWEoJa8v", "password": "05jWEoJa8v",
"RedisConnectionString": "{0}:{1},password={2}, poolsize=500,ssl=false,defaultDatabase=0" "RedisConnectionString": "{0}:{1},password={2}, poolsize=500,ssl=false,defaultDatabase=7"
}, },
"Redis": { "Redis": {
"ip": "localhost", "ip": "localhost",

View File

@@ -1,16 +1,24 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"ConfigId": "default", "ConfigId": "default",
"DBType": "PostgreSQL", //MySql;SqlServer;Oracle;PostgreSQL;Dm;Kdbndp;Sqlite; "DBType": "MySql", //MySql;SqlServer;Oracle;PostgreSQL;Dm;Kdbndp;Sqlite;
<<<<<<< HEAD
"Host": "127.0.0.1",//"10.67.53.241",
=======
"Host": "localhost", "Host": "localhost",
//"Host": "127.0.0.1", >>>>>>> aec1d3b15533e5faafe3b2294830b095cff93f2d
"Port": "5432", "Port": "3306",
//"DBName": "tianyi_db", //"DBName": "tianyi_db",
//"UserName": "postgres", //"UserName": "postgres",
//"Password": "pass@word123", //"Password": "pass@word123",
"DBName": "tianyi", "DBName": "xinte_cloud",
"UserName": "postgres", <<<<<<< HEAD
"Password": "pass@word123", "UserName": "root",//"totong",
"Password": "root",//"+vKyHUbtxQ",
=======
"UserName": "totong",
"Password": "+vKyHUbtxQ",
>>>>>>> aec1d3b15533e5faafe3b2294830b095cff93f2d
//SqlServer //SqlServer
//"DefaultConnection": "server={0},{1};database={2};uid={3};pwd={4};MultipleActiveResultSets=true" //"DefaultConnection": "server={0},{1};database={2};uid={3};pwd={4};MultipleActiveResultSets=true"
//Kdbndp //Kdbndp

View File

@@ -2,10 +2,9 @@
"DevName3": "Elevator3", "DevName3": "Elevator3",
"DevName4": "Elevator4", "DevName4": "Elevator4",
"HeartbeatDevNames": [ "Elevator3", "Elevator4" ], "HeartbeatDevNames": [ "Elevator3", "Elevator4" ],
"tags": [ "SysStatus", "RunStatus", "FloorNo", "DoorStatus", "AGVStatus" ],
"token": "780BE4144636CF47DDF3920B0F1D069B", "token": "780BE4144636CF47DDF3920B0F1D069B",
"GetTagListUrl": "http://192.168.11.110:9100/Dev/GetTagList", "GetTagListUrl": "http://192.168.11.110:9100/Dev/GetTagList",
"GetTagUrl": "http://192.168.11.110:9100/Dev/GetTag", "GetTagUrl": "http://192.168.11.110:9100/Dev/GetTag",
"WriteTagUrl": "http://192.168.11.110:9100/Dev/writeTag", "WriteTagUrl": "http://192.168.11.110:9100/Dev/writeTag",
"Environment": "tianyi" "Environment": ""
} }

View File

@@ -3,9 +3,9 @@
"ValidateIssuerSigningKey": true, // 是否验证密钥bool 类型默认true "ValidateIssuerSigningKey": true, // 是否验证密钥bool 类型默认true
"IssuerSigningKey": "RkayGi4ltkMWrSQKsQTWic1VnakqsQfaJOmJIBUWE1gxGaS0IrJHxa9anjVAwuew", // 密钥string 类型必须是复杂密钥长度大于16 "IssuerSigningKey": "RkayGi4ltkMWrSQKsQTWic1VnakqsQfaJOmJIBUWE1gxGaS0IrJHxa9anjVAwuew", // 密钥string 类型必须是复杂密钥长度大于16
"ValidateIssuer": true, // 是否验证签发方bool 类型默认true "ValidateIssuer": true, // 是否验证签发方bool 类型默认true
"ValidIssuer": "tuotong", // 签发方string 类型 "ValidIssuer": "cosmoplat", // 签发方string 类型
"ValidateAudience": true, // 是否验证签收方bool 类型默认true "ValidateAudience": true, // 是否验证签收方bool 类型默认true
"ValidAudience": "tuotong", // 签收方string 类型 "ValidAudience": "cosmoplat", // 签收方string 类型
"ValidateLifetime": true, // 是否验证过期时间bool 类型默认true建议true "ValidateLifetime": true, // 是否验证过期时间bool 类型默认true建议true
"ExpiredTime": 1440, // 过期时间long 类型单位分钟默认20分钟 "ExpiredTime": 1440, // 过期时间long 类型单位分钟默认20分钟
"ClockSkew": 5 // 过期时间容错值long 类型单位秒默认5秒 "ClockSkew": 5 // 过期时间容错值long 类型单位秒默认5秒

View File

@@ -1,3 +0,0 @@
{
"TestLocation": "CP-A08-47"
}

View File

@@ -0,0 +1,29 @@
{
"Nacos": {
"EndPoint": "",
"ServerAddresses": [ "http://localhost:8848/" ], // nacos服务端地址
"DefaultTimeOut": 15000,
"Namespace": "dev", // 服务注册到的命名空间id
"ListenInterval": 1000,
"ServiceName": "tnb-core", //服务名称
"GroupName": "DEFAULT_GROUP", //服务分组
"ClusterName": "DEFAULT",
"Ip": "",
"PreferredNetworks": "", // select an IP that matches the prefix as the service registration IP
"Port": 9212,
"Weight": 100, // 权重
"RegisterEnabled": true,
"InstanceEnabled": true,
"Ephemeral": true,
"Secure": false,
"AccessKey": "",
"SecretKey": "",
"UserName": "nacos",
"Password": "nacos",
"ConfigUseRpc": true, // 为true时通过 gRPC 去和 nacos server 交互nacos 2.x版本要设置为true": null,
"NamingUseRpc": true, // 为true时通过 gRPC 去和 nacos server 交互, nacos 2.x版本要设置为true": null,
"NamingLoadCacheAtStart": "",
"LBStrategy": "WeightRandom", // WeightRandom WeightRoundRobin
"Metadata": {}
}
}

View File

@@ -1,6 +1,6 @@
{ {
"OSS": { "OSS": {
"BucketName": "jnpfsoftoss", "BucketName": "cosmoplatoss",
//文件存储类型(Invalid(本地),MinIo,Aliyun,QCloud,Qiniu) //文件存储类型(Invalid(本地),MinIo,Aliyun,QCloud,Qiniu)
"Provider": "Invalid", "Provider": "Invalid",
"Endpoint": "192.168.0.60:9000", "Endpoint": "192.168.0.60:9000",

View File

@@ -1,12 +1,12 @@
{ {
"SpecificationDocumentSettings": { "SpecificationDocumentSettings": {
"DocumentTitle": "ToTong Next Builder", "DocumentTitle": "Cosmoplat Next Builder",
"DocExpansionState": "None", "DocExpansionState": "None",
"RoutePrefix": "swagger", "RoutePrefix": "swagger",
"GroupOpenApiInfos": [ "GroupOpenApiInfos": [
{ {
"Group": "Default", "Group": "Default",
"Title": "ToTong Next Builder", "Title": "Cosmoplat Next Builder",
"Description": "", "Description": "",
"Version": "3.4.6" "Version": "3.4.6"
} }

View File

@@ -1,7 +1,7 @@
{ {
"Tenant": { "Tenant": {
"MultiTenancy": false, "MultiTenancy": false,
"MultiTenancyDBInterFace": "http://www.tuotong-tech.com/api/Saas/Tenant/DbContent/", "MultiTenancyDBInterFace": "",
"MultiTenancyType": "" "MultiTenancyType": ""
} }
} }

View File

@@ -6,8 +6,6 @@ public class WebComponent : IWebComponent
public void Load(WebApplicationBuilder builder, ComponentContext componentContext) public void Load(WebApplicationBuilder builder, ComponentContext componentContext)
{ {
builder.Host.UseWindowsService(); builder.Host.UseWindowsService();
builder.Configuration.AddJsonFile("Location.json", optional: true, reloadOnChange: true);
//// 日志过滤 //// 日志过滤
//builder.Logging.AddFilter((provider, category, logLevel) => //builder.Logging.AddFilter((provider, category, logLevel) =>
//{ //{

View File

@@ -4,7 +4,7 @@
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": true, "dotnetRunMessages": true,
"launchBrowser": false, "launchBrowser": false,
"applicationUrl": "http://localhost:5000", "applicationUrl": "http://0.0.0.0:9212",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production" "ASPNETCORE_ENVIRONMENT": "Production"
} }

View File

@@ -7,6 +7,7 @@ using JNPF.SpecificationDocument;
using JNPF.TaskScheduler.Interfaces.TaskScheduler; using JNPF.TaskScheduler.Interfaces.TaskScheduler;
using JNPF.VisualDev; using JNPF.VisualDev;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Nacos.AspNetCore.V2;
using Senparc.CO2NET; using Senparc.CO2NET;
using Senparc.CO2NET.RegisterServices; using Senparc.CO2NET.RegisterServices;
using Senparc.Weixin; using Senparc.Weixin;
@@ -49,7 +50,7 @@ public class Startup : AppStartup
services.AddMemoryCache(); // 使用本地缓存必须添加 services.AddMemoryCache(); // 使用本地缓存必须添加
services.AddConfigurableOptions<CacheOptions>(); services.AddConfigurableOptions<CacheOptions>();
services.AddSingleton(typeof(ISingleton), typeof(RedisData)); // services.AddSingleton(typeof(ISingleton), typeof(RedisData));
// 微信 // 微信
services.AddSenparcGlobalServices(App.Configuration) // Senparc.CO2NET 全局注册 services.AddSenparcGlobalServices(App.Configuration) // Senparc.CO2NET 全局注册
.AddSenparcWeixinServices(App.Configuration); // Senparc.Weixin 注册如果使用Senparc.Weixin SDK则添加 .AddSenparcWeixinServices(App.Configuration); // Senparc.Weixin 注册如果使用Senparc.Weixin SDK则添加
@@ -57,14 +58,14 @@ public class Startup : AppStartup
services.AddOverideVisualDev(); services.AddOverideVisualDev();
//定时任务 //定时任务
SnowflakeIdHelper.InitYitIdWorker();
services.AddHostedService<TimedTaskBackgroundService>(); //services.AddHostedService<TimedTaskBackgroundService>();
services.AddSingleton<BackgroundService, TimedTaskBackgroundService>(sp => new TimedTaskBackgroundService()); //services.AddSingleton<BackgroundService, TimedTaskBackgroundService>(sp => new TimedTaskBackgroundService());
//var bgSvc = App.GetRequiredService<BackgroundService>(); //var bgSvc = App.GetRequiredService<BackgroundService>();
//bgSvc.StartAsync(CancellationToken.None); //bgSvc.StartAsync(CancellationToken.None);
services.AddHostedService<RedisBackGround>(); //services.AddHostedService<RedisBackGround>();
services.AddNacosAspNet(App.Configuration, "Nacos");
} }
@@ -113,6 +114,7 @@ public class Startup : AppStartup
endpoints.MapControllerRoute(name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); endpoints.MapControllerRoute(name: "default", pattern: "{controller=Home}/{action=Index}/{id?}");
}); });
SnowflakeIdHelper.InitYitIdWorker();
bool isStartTimeJob = App.GetConfig<bool>("IsStartTimeJob"); bool isStartTimeJob = App.GetConfig<bool>("IsStartTimeJob");
if (isStartTimeJob) if (isStartTimeJob)

View File

@@ -44,9 +44,7 @@
<ProjectReference Include="..\..\BasicData\Tnb.BasicData\Tnb.BasicData.csproj" /> <ProjectReference Include="..\..\BasicData\Tnb.BasicData\Tnb.BasicData.csproj" />
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr\Tnb.EquipMgr.csproj" /> <ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr\Tnb.EquipMgr.csproj" />
<ProjectReference Include="..\..\message\Tnb.Message\Tnb.Message.csproj" /> <ProjectReference Include="..\..\message\Tnb.Message\Tnb.Message.csproj" />
<ProjectReference Include="..\..\PerMgr\Tnb.PerMgr\Tnb.PerMgr.csproj" />
<ProjectReference Include="..\..\ProductionMgr\Tnb.ProductionMgr\Tnb.ProductionMgr.csproj" /> <ProjectReference Include="..\..\ProductionMgr\Tnb.ProductionMgr\Tnb.ProductionMgr.csproj" />
<ProjectReference Include="..\..\QcMgr\Tnb.QcMgr\Tnb.QcMgr.csproj" />
<ProjectReference Include="..\..\system\Tnb.OAuth\Tnb.OAuth.csproj" /> <ProjectReference Include="..\..\system\Tnb.OAuth\Tnb.OAuth.csproj" />
<ProjectReference Include="..\..\system\Tnb.Systems\Tnb.Systems.csproj" /> <ProjectReference Include="..\..\system\Tnb.Systems\Tnb.Systems.csproj" />
<ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" /> <ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" />

View File

@@ -1,4 +1,9 @@
{ {
"AllowedHosts": "*", "AllowedHosts": "*",
"ConfigurationScanDirectories": [ "Configurations" ] "ConfigurationScanDirectories": [ "Configurations" ],
"YitId": {
"WorkerId": 1, //必须 全局唯一,必须 程序设定,理论最大值 2^WorkerIdBitLength-1
"WorkerIdBitLength": 4, //机器码位长,决定 WorkerId 的最大值,默认值6,取值范围 [1, 16]
"SeqBitLength": 4 //序列数位长,默认值6,取值范围 [3, 21](建议不小于4),决定每毫秒基础生成的ID个数
}
} }

View File

@@ -1,8 +1,4 @@
///////////////////////////////////////////////////////////////////////////////// 
// 宁波拓通e智造平台 ToTong Next Builder //
// https://git.tuotong-tech.com/tnb/tnb-server //
/////////////////////////////////////////////////////////////////////////////////
@using Tnb.Core; @using Tnb.Core;
@using Tnb.Vengine; @using Tnb.Vengine;
@using Tnb.Vengine.Domain; @using Tnb.Vengine.Domain;

View File

@@ -1,8 +1,4 @@
///////////////////////////////////////////////////////////////////////////////// 
// 宁波拓通e智造平台 ToTong Next Builder //
// https://git.tuotong-tech.com/tnb/tnb-server //
/////////////////////////////////////////////////////////////////////////////////
@using Tnb.Core; @using Tnb.Core;
@using Tnb.Vengine; @using Tnb.Vengine;
@using Tnb.Vengine.Domain; @using Tnb.Vengine.Domain;

View File

@@ -1,11 +1,5 @@
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
// 本文件由拓通低代码开发平台自动生成,请不要修改 // // 本文件由卡奥斯低代码开发平台自动生成,请不要修改 //
// ________ ___ ________ //
// /__ __/ / \ /__ __/ //
// / / / / / / //
// / / / / / / //
// /__/ \___/ /__/ //
// //
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
@using Tnb.Core; @using Tnb.Core;

View File

@@ -1,8 +1,4 @@
///////////////////////////////////////////////////////////////////////////////// 
// 宁波拓通e智造平台 ToTong Next Builder //
// https://git.tuotong-tech.com/tnb/tnb-server //
/////////////////////////////////////////////////////////////////////////////////
@using Tnb.Core; @using Tnb.Core;
@using Tnb.Vengine; @using Tnb.Vengine;
@using Tnb.Vengine.Domain; @using Tnb.Vengine.Domain;

View File

@@ -1,11 +1,5 @@
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
// 本文件由拓通低代码开发平台自动生成,请不要修改 // // 本文件由卡奥斯低代码开发平台自动生成,请不要修改 //
// ________ ___ ________ //
// /__ __/ / \ /__ __/ //
// / / / / / / //
// / / / / / / //
// /__/ \___/ /__/ //
// //
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
@using JNPF.Common.Extension; @using JNPF.Common.Extension;

View File

@@ -6,7 +6,7 @@ namespace JNPF.Apps.Entitys;
/// <summary> /// <summary>
/// App常用数据 /// App常用数据
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_APPDATA")] [SugarTable("BASE_APPDATA")]

View File

@@ -5,7 +5,7 @@ namespace JNPF.Apps.Interfaces;
/// <summary> /// <summary>
/// App常用数据 /// App常用数据
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01 . /// 日 期2021-06-01 .
/// </summary> /// </summary>
public interface IAppDataService public interface IAppDataService

View File

@@ -23,7 +23,7 @@ namespace JNPF.Apps;
/// <summary> /// <summary>
/// App常用数据 /// App常用数据
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01 . /// 日 期2021-06-01 .
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "App", Name = "Data", Order = 800)] [ApiDescriptionSettings(Tag = "App", Name = "Data", Order = 800)]

View File

@@ -11,7 +11,7 @@ namespace JNPF.Apps;
/// <summary> /// <summary>
/// App菜单 /// App菜单
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01 . /// 日 期2021-06-01 .
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "App", Name = "Menu", Order = 800)] [ApiDescriptionSettings(Tag = "App", Name = "Menu", Order = 800)]

View File

@@ -12,7 +12,7 @@ namespace JNPF.Apps;
/// <summary> /// <summary>
/// App用户信息 /// App用户信息
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "App", Name = "User", Order = 800)] [ApiDescriptionSettings(Tag = "App", Name = "User", Order = 800)]

View File

@@ -10,7 +10,7 @@ namespace JNPF.Apps;
/// <summary> /// <summary>
/// App版本信息 /// App版本信息
/// 版 本V3.3 /// 版 本V3.3
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2022-04-07. /// 日 期2022-04-07.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "App", Name = "Version", Order = 806)] [ApiDescriptionSettings(Tag = "App", Name = "Version", Order = 806)]

View File

@@ -1,6 +1,8 @@
using JNPF.Common.Configuration; using System.Text.RegularExpressions;
using JNPF.Common.Configuration;
using JNPF.DependencyInjection; using JNPF.DependencyInjection;
using JNPF.EventBus; using JNPF.EventBus;
using JNPF.VisualDev.Entitys;
using SqlSugar; using SqlSugar;
namespace JNPF.EventHandler; namespace JNPF.EventHandler;
@@ -42,7 +44,18 @@ public class LogEventSubscriber : IEventSubscriber, ISingleton
_sqlSugarClient.ChangeDatabase(log.ConnectionConfig.ConfigId); _sqlSugarClient.ChangeDatabase(log.ConnectionConfig.ConfigId);
} }
await _sqlSugarClient.CopyNew().Insertable(log.Entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); string pattern = @"^[0-9]*$";
var db = _sqlSugarClient.CopyNew();
if (!string.IsNullOrEmpty(log.Entity.ModuleId) && new Regex(pattern).IsMatch(log.Entity.ModuleId))
{
var module = await db.Queryable<VisualDevEntity>().Where(x => x.Id == log.Entity.ModuleId).FirstAsync();
if (module != null)
{
log.Entity.ModuleName = module.FullName;
}
}
await db.Insertable(log.Entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync();
} }
/// <summary> /// <summary>

View File

@@ -107,7 +107,77 @@ public class RequestActionFilter : IAsyncActionFilter
ModuleName = module.ModuleName, ModuleName = module.ModuleName,
Json = string.Format("{0}应用【{1}】【{2}】", module.Action, args, result?.ToJsonString()) Json = string.Format("{0}应用【{1}】【{2}】", module.Action, args, result?.ToJsonString())
})); }));
}else if (actionName == "JNPF.VisualDev.VisualDevModelDataService.Create")
{
var args = context.ActionArguments.ToJsonString();
var result = (actionContext.Result as JsonResult)?.Value;
string moduleId = httpRequest.Path.Value.Substring(httpRequest.Path.Value.LastIndexOf("/")+1);
await _eventPublisher.PublishAsync(new LogEventSource("Log:CreateOpLog", options, new SysLogEntity
{
Id = SnowflakeIdHelper.NextId(),
UserId = userId,
UserName = userName,
Category = 3,
IPAddress = NetHelper.Ip,
RequestURL = httpRequest.Path,
RequestDuration = (int)sw.ElapsedMilliseconds,
RequestMethod = "新增",
PlatForm = string.Format("{0}-{1}", userAgent.OS.ToString(), userAgent.RawValue),
CreatorTime = DateTime.Now,
ModuleName = moduleId,
ModuleId = moduleId,
Json = string.Format("{0}应用【{1}】【{2}】", "新增", args, result?.ToJsonString())
}));
}else if (actionName == "JNPF.VisualDev.VisualDevModelDataService.Update")
{
var args = context.ActionArguments.ToJsonString();
var result = (actionContext.Result as JsonResult)?.Value;
string[] arr = httpRequest.Path.Value.Split("/");
string moduleId = arr[arr.Length - 2];
await _eventPublisher.PublishAsync(new LogEventSource("Log:CreateOpLog", options, new SysLogEntity
{
Id = SnowflakeIdHelper.NextId(),
UserId = userId,
UserName = userName,
Category = 3,
IPAddress = NetHelper.Ip,
RequestURL = httpRequest.Path,
RequestDuration = (int)sw.ElapsedMilliseconds,
RequestMethod = "编辑",
PlatForm = string.Format("{0}-{1}", userAgent.OS.ToString(), userAgent.RawValue),
CreatorTime = DateTime.Now,
ModuleName = moduleId,
ModuleId = moduleId,
Json = string.Format("{0}应用【{1}】【{2}】", "编辑", args, result?.ToJsonString())
}));
}else if (actionName == "JNPF.VisualDev.VisualDevModelDataService.Delete")
{
var args = context.ActionArguments.ToJsonString();
var result = (actionContext.Result as JsonResult)?.Value;
string[] arr = httpRequest.Path.Value.Split("/");
string moduleId = arr[arr.Length - 2];
await _eventPublisher.PublishAsync(new LogEventSource("Log:CreateOpLog", options, new SysLogEntity
{
Id = SnowflakeIdHelper.NextId(),
UserId = userId,
UserName = userName,
Category = 3,
IPAddress = NetHelper.Ip,
RequestURL = httpRequest.Path,
RequestDuration = (int)sw.ElapsedMilliseconds,
RequestMethod = "删除",
PlatForm = string.Format("{0}-{1}", userAgent.OS.ToString(), userAgent.RawValue),
CreatorTime = DateTime.Now,
ModuleName = moduleId,
ModuleId = moduleId,
Json = string.Format("{0}应用【{1}】【{2}】", "删除", args, result?.ToJsonString())
}));
} }
} }
} }
} }

View File

@@ -1,7 +1,3 @@
/////////////////////////////////////////////////////////////////////////////////
// 宁波拓通e智造平台 ToTong Next Builder //
// https://git.tuotong-tech.com/tnb/tnb.server //
/////////////////////////////////////////////////////////////////////////////////
using JNPF.Common.Contracts; using JNPF.Common.Contracts;

View File

@@ -5,7 +5,7 @@ namespace JNPF.Common.Models
/// <summary> /// <summary>
/// 附件模型 /// 附件模型
/// 版 本V3.3.3 /// 版 本V3.3.3
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 作 者JNPF开发平台组. /// 作 者JNPF开发平台组.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Common.Models;
/// <summary> /// <summary>
/// 文件分片模型 /// 文件分片模型
/// 版 本V3.3.3 /// 版 本V3.3.3
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 作 者JNPF开发平台组. /// 作 者JNPF开发平台组.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -6,8 +6,6 @@ namespace JNPF.Common.Models.NPOI;
/// <summary> /// <summary>
/// Excel导出列名 /// Excel导出列名
/// 版 本V3.0.0 /// 版 本V3.0.0
/// 版 权引迈信息技术有限公司https://www.jnpfsoft.com
/// 作 者JNPF开发平台组
/// 日 期2017.03.09. /// 日 期2017.03.09.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -6,8 +6,6 @@ namespace JNPF.Common.Models.NPOI;
/// <summary> /// <summary>
/// Excel导出配置 /// Excel导出配置
/// 版 本V3.0.0 /// 版 本V3.0.0
/// 版 权引迈信息技术有限公司https://www.jnpfsoft.com
/// 作 者JNPF开发平台组
/// 日 期2017.03.09. /// 日 期2017.03.09.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -5,8 +5,6 @@ namespace JNPF.Common.Models.NPOI;
/// <summary> /// <summary>
/// Excel导出模板 /// Excel导出模板
/// 版 本V3.0.0 /// 版 本V3.0.0
/// 版 权引迈信息技术有限公司https://www.jnpfsoft.com
/// 作 者JNPF开发平台组
/// 日 期2017.03.09. /// 日 期2017.03.09.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -5,8 +5,6 @@ namespace JNPF.Common.Models.User
/// <summary> /// <summary>
/// 登录者信息 /// 登录者信息
/// 版 本V3.2.0 /// 版 本V3.2.0
/// 版 权引迈信息技术有限公司https://www.jnpfsoft.com
/// 作 者JNPF开发平台组.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]
public class UserInfoModel public class UserInfoModel

View File

@@ -291,7 +291,7 @@ public static class CodeGenHelper
result.Add(label, "系统自动生成"); result.Add(label, "系统自动生成");
break; break;
case JnpfKeyConst.COMSELECT: case JnpfKeyConst.COMSELECT:
result.Add(label, multiple ? "例:引迈信息/产品部,引迈信息/技术部" : "例:引迈信息/技术部"); result.Add(label, multiple ? "例:卡奥斯信息/产品部,卡奥斯信息/技术部" : "例:卡奥斯信息/技术部");
break; break;
case JnpfKeyConst.DEPSELECT: case JnpfKeyConst.DEPSELECT:
result.Add(label, multiple ? "例:产品部/部门编码,技术部/部门编码" : "例:技术部/部门编码"); result.Add(label, multiple ? "例:产品部/部门编码,技术部/部门编码" : "例:技术部/部门编码");
@@ -303,7 +303,7 @@ public static class CodeGenHelper
result.Add(label, multiple ? "例:张三/账号,李四/账号" : "例:张三/账号"); result.Add(label, multiple ? "例:张三/账号,李四/账号" : "例:张三/账号");
break; break;
case JnpfKeyConst.USERSSELECT: case JnpfKeyConst.USERSSELECT:
result.Add(label, multiple ? "例:引迈信息/产品部,产品部/部门编码,技术经理/岗位编码,研发人员/角色编码,A分组/分组编码,张三/账号" : "例:李四/账号"); result.Add(label, multiple ? "例:卡奥斯信息/产品部,产品部/部门编码,技术经理/岗位编码,研发人员/角色编码,A分组/分组编码,张三/账号" : "例:李四/账号");
break; break;
case JnpfKeyConst.ROLESELECT: case JnpfKeyConst.ROLESELECT:
result.Add(label, multiple ? "例:研发人员/角色编码,测试人员/角色编码" : "例:研发人员/角色编码"); result.Add(label, multiple ? "例:研发人员/角色编码,测试人员/角色编码" : "例:研发人员/角色编码");

View File

@@ -16,7 +16,7 @@ namespace JNPF.Common.Security;
/// <summary> /// <summary>
/// Excel导出操作类 /// Excel导出操作类
/// 版 本V3.2.0 /// 版 本V3.2.0
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2017.03.09. /// 日 期2017.03.09.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]
@@ -226,16 +226,16 @@ public class ExcelExportHelper<T>
SummaryInformation si = PropertySetFactory.CreateSummaryInformation(); SummaryInformation si = PropertySetFactory.CreateSummaryInformation();
// 填加xls文件作者信息 // 填加xls文件作者信息
si.Author = "拓通智联科技有限公司"; si.Author = "卡奥斯数字科技有限公司";
// 填加xls文件创建程序信息 // 填加xls文件创建程序信息
si.ApplicationName = "拓通智联科技有限公司"; si.ApplicationName = "卡奥斯数字科技有限公司";
// 填加xls文件最后保存者信息 // 填加xls文件最后保存者信息
si.LastAuthor = "拓通智联科技有限公司"; si.LastAuthor = "卡奥斯数字科技有限公司";
// 填加xls文件作者信息 // 填加xls文件作者信息
si.Comments = "拓通智联科技有限公司"; si.Comments = "卡奥斯数字科技有限公司";
// 填加xls文件标题信息 // 填加xls文件标题信息
si.Title = "标题信息"; si.Title = "标题信息";
@@ -487,16 +487,16 @@ public class ExcelExportHelper<T>
SummaryInformation si = PropertySetFactory.CreateSummaryInformation(); SummaryInformation si = PropertySetFactory.CreateSummaryInformation();
// 填加xls文件作者信息 // 填加xls文件作者信息
si.Author = "拓通智联科技有限公司"; si.Author = "卡奥斯数字科技有限公司";
// 填加xls文件创建程序信息 // 填加xls文件创建程序信息
si.ApplicationName = "拓通智联科技有限公司"; si.ApplicationName = "卡奥斯数字科技有限公司";
// 填加xls文件最后保存者信息 // 填加xls文件最后保存者信息
si.LastAuthor = "拓通智联科技有限公司"; si.LastAuthor = "卡奥斯数字科技有限公司";
// 填加xls文件作者信息 // 填加xls文件作者信息
si.Comments = "拓通智联科技有限公司"; si.Comments = "卡奥斯数字科技有限公司";
// 填加xls文件标题信息 // 填加xls文件标题信息
si.Title = "标题信息"; si.Title = "标题信息";
@@ -762,16 +762,16 @@ public class ExcelExportHelper<T>
SummaryInformation si = PropertySetFactory.CreateSummaryInformation(); SummaryInformation si = PropertySetFactory.CreateSummaryInformation();
// 填加xls文件作者信息 // 填加xls文件作者信息
si.Author = "拓通智联科技有限公司"; si.Author = "卡奥斯数字科技有限公司";
// 填加xls文件创建程序信息 // 填加xls文件创建程序信息
si.ApplicationName = "拓通智联科技有限公司"; si.ApplicationName = "卡奥斯数字科技有限公司";
// 填加xls文件最后保存者信息 // 填加xls文件最后保存者信息
si.LastAuthor = "拓通智联科技有限公司"; si.LastAuthor = "卡奥斯数字科技有限公司";
// 填加xls文件作者信息 // 填加xls文件作者信息
si.Comments = "拓通智联科技有限公司"; si.Comments = "卡奥斯数字科技有限公司";
// 填加xls文件标题信息 // 填加xls文件标题信息
si.Title = "标题信息"; si.Title = "标题信息";

View File

@@ -9,7 +9,7 @@ namespace JNPF.Common.Helper
/// <summary> /// <summary>
/// Excel导入操作类 /// Excel导入操作类
/// 版 本V3.2.0 /// 版 本V3.2.0
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2017.03.12. /// 日 期2017.03.12.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -12,7 +12,7 @@ namespace JNPF.Common.Security;
/// <summary> /// <summary>
/// FileHelper /// FileHelper
/// 版 本V3.2.0 /// 版 本V3.2.0
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 作 者JNPF开发平台组. /// 作 者JNPF开发平台组.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -7,7 +7,7 @@ namespace JNPF.Common.Security;
/// <summary> /// <summary>
/// JsonHelper /// JsonHelper
/// 版 本V3.4.2 /// 版 本V3.4.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 作 者JNPF开发平台组. /// 作 者JNPF开发平台组.
/// </summary> /// </summary>
public static class JsonHelper public static class JsonHelper

View File

@@ -9,7 +9,7 @@ namespace JNPF.Common.Security;
/// <summary> /// <summary>
/// 网络操作 /// 网络操作
/// 版 本V3.0.0 /// 版 本V3.0.0
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 作 者JNPF开发平台组. /// 作 者JNPF开发平台组.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Common.Security;
/// <summary> /// <summary>
/// 汉字转换拼音 /// 汉字转换拼音
/// 版 本V3.2.0 /// 版 本V3.2.0
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 作 者JNPF开发平台组. /// 作 者JNPF开发平台组.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -7,7 +7,7 @@ namespace JNPF.Common.Security;
/// <summary> /// <summary>
/// 树形结构查询 /// 树形结构查询
/// 版 本V3.2.0 /// 版 本V3.2.0
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 作 者JNPF开发平台组. /// 作 者JNPF开发平台组.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -1,8 +1,4 @@
///////////////////////////////////////////////////////////////////////////////// 
// 宁波拓通e智造平台 ToTong Next Builder //
// https://git.tuotong-tech.com/tnb/tnb.server //
/////////////////////////////////////////////////////////////////////////////////
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
namespace Mapster; namespace Mapster;

View File

@@ -73,17 +73,17 @@ where TEntity : class, new()
base.Context.Ado.CommandTimeOut = 30; base.Context.Ado.CommandTimeOut = 30;
base.Context.Aop.OnLogExecuted = (sql, pars) => base.Context.Aop.OnLogExecuted = (sql, pars) =>
{ {
var oldColor = Console.ForegroundColor; // var oldColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Green; Console.ForegroundColor = ConsoleColor.Green;
var finalSql = UtilMethods.GetSqlString(Context.CurrentConnectionConfig.DbType, sql, pars); var finalSql = UtilMethods.GetSqlString(Context.CurrentConnectionConfig.DbType, sql, pars);
Console.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss.fff")}——SQL执行完成】{Context.Ado.SqlExecutionTime.TotalMilliseconds} ms"); // Console.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss.fff")}——SQL执行完成】{Context.Ado.SqlExecutionTime.TotalMilliseconds} ms");
Console.WriteLine(finalSql); // Console.WriteLine(finalSql);
Console.ForegroundColor = oldColor; // Console.ForegroundColor = oldColor;
if (Context.Ado.SqlExecutionTime.TotalMilliseconds > 3000) if (Context.Ado.SqlExecutionTime.TotalMilliseconds > 3000)
{ {
Log.Warning($"慢查询: {Context.Ado.SqlExecutionTime.TotalMilliseconds}ms, SQL: " + finalSql); Log.Warning($"慢查询: {Context.Ado.SqlExecutionTime.TotalMilliseconds}ms, SQL: " + finalSql);
} }
Console.WriteLine(); // Console.WriteLine();
//App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\r\n" + base.Context.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value))); //App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\r\n" + base.Context.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
}; };
base.Context.Aop.OnError = (ex) => base.Context.Aop.OnError = (ex) =>

View File

@@ -5,7 +5,7 @@
<!--<VersionSuffix>$([System.DateTime]::Now.Year).$([System.DateTime]::Now.Month).$([System.DateTime]::Now.Day).$([System.DateTime]::Now.ToString(HHmm))</VersionSuffix> <!--<VersionSuffix>$([System.DateTime]::Now.Year).$([System.DateTime]::Now.Month).$([System.DateTime]::Now.Day).$([System.DateTime]::Now.ToString(HHmm))</VersionSuffix>
<AssemblyVersion>$(VersionSuffix)</AssemblyVersion> <AssemblyVersion>$(VersionSuffix)</AssemblyVersion>
<Version>$(VersionSuffix)</Version>--> <Version>$(VersionSuffix)</Version>-->
<Authors>ToTong</Authors> <Authors>cosmoplat</Authors>
<Description>TNB 数据库访问器 SqlSugar 插件</Description> <Description>TNB 数据库访问器 SqlSugar 插件</Description>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<NoWarn>$(NoWarn);CS1591;</NoWarn> <NoWarn>$(NoWarn);CS1591;</NoWarn>

View File

@@ -5,7 +5,7 @@ namespace JNPF.Message.Entitys.Dto.IM;
/// <summary> /// <summary>
/// 在线用户 /// 在线用户
/// 版 本V3.2.0 /// 版 本V3.2.0
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2017.09.20. /// 日 期2017.09.20.
/// </summary> /// </summary>
[SuppressSniffer] [SuppressSniffer]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys;
/// <summary> /// <summary>
/// 在线聊天 /// 在线聊天
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_IMCONTENT")] [SugarTable("BASE_IMCONTENT")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 消息账号配置 /// 消息账号配置
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_ACCOUNT_CONFIG")] [SugarTable("BASE_MESSAGE_ACCOUNT_CONFIG")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 消息字典配置 /// 消息字典配置
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_DATA_TYPE")] [SugarTable("BASE_MESSAGE_DATA_TYPE")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys;
/// <summary> /// <summary>
/// 消息实例 /// 消息实例
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE")] [SugarTable("BASE_MESSAGE")]

View File

@@ -6,7 +6,6 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 消息监控 /// 消息监控
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_MONITOR")] [SugarTable("BASE_MESSAGE_MONITOR")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys;
/// <summary> /// <summary>
/// 消息接收 /// 消息接收
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGERECEIVE")] [SugarTable("BASE_MESSAGERECEIVE")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 消息发送配置 /// 消息发送配置
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_SEND_CONFIG")] [SugarTable("BASE_MESSAGE_SEND_CONFIG")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 消息发送记录配置 /// 消息发送记录配置
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_SEND_RECORD")] [SugarTable("BASE_MESSAGE_SEND_RECORD")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 消息发送模板配置 /// 消息发送模板配置
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_SEND_TEMPLATE")] [SugarTable("BASE_MESSAGE_SEND_TEMPLATE")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 消息连接 /// 消息连接
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_SHORT_LINK")] [SugarTable("BASE_MESSAGE_SHORT_LINK")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 短信变量 /// 短信变量
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_SMS_FIELD")] [SugarTable("BASE_MESSAGE_SMS_FIELD")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 消息模板配置 /// 消息模板配置
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_TEMPLATE_CONFIG")] [SugarTable("BASE_MESSAGE_TEMPLATE_CONFIG")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 消息模板参数 /// 消息模板参数
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_TEMPLATE_PARAM")] [SugarTable("BASE_MESSAGE_TEMPLATE_PARAM")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 微信公众号用户 /// 微信公众号用户
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_MESSAGE_WECHAT_USER")] [SugarTable("BASE_MESSAGE_WECHAT_USER")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity;
/// <summary> /// <summary>
/// 个推用户表. /// 个推用户表.
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[SugarTable("BASE_USER_DEVICE")] [SugarTable("BASE_USER_DEVICE")]

View File

@@ -3,7 +3,7 @@
/// <summary> /// <summary>
/// 系统消息 /// 系统消息
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
public interface IMessageService public interface IMessageService

View File

@@ -5,7 +5,7 @@ namespace JNPF.Message.Interfaces.Message;
/// <summary> /// <summary>
/// 系统消息 /// 系统消息
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
public interface IShortLinkService public interface IShortLinkService

View File

@@ -20,7 +20,7 @@ namespace JNPF.Message.Service;
/// <summary> /// <summary>
/// 消息账号 /// 消息账号
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "Message", Name = "AccountConfig", Order = 240)] [ApiDescriptionSettings(Tag = "Message", Name = "AccountConfig", Order = 240)]

View File

@@ -9,7 +9,7 @@ namespace JNPF.Message.Service;
/// <summary> /// <summary>
/// 消息账号 /// 消息账号
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "Message", Name = "MessageDataType", Order = 240)] [ApiDescriptionSettings(Tag = "Message", Name = "MessageDataType", Order = 240)]

View File

@@ -15,7 +15,7 @@ namespace JNPF.Message.Service;
/// <summary> /// <summary>
/// 消息监控 /// 消息监控
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "Message", Name = "MessageMonitor", Order = 240)] [ApiDescriptionSettings(Tag = "Message", Name = "MessageMonitor", Order = 240)]

View File

@@ -26,8 +26,6 @@ namespace JNPF.Message;
/// <summary> /// <summary>
/// 系统消息 /// 系统消息
/// 版 本V3.2 /// 版 本V3.2
/// 版 权引迈信息技术有限公司https://www.jnpfsoft.com
/// 作 者JNPF开发平台组
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "Message", Name = "message", Order = 240)] [ApiDescriptionSettings(Tag = "Message", Name = "message", Order = 240)]

View File

@@ -18,7 +18,7 @@ namespace JNPF.Message.Service;
/// <summary> /// <summary>
/// 消息监控 /// 消息监控
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "Message", Name = "MessageTemplate", Order = 240)] [ApiDescriptionSettings(Tag = "Message", Name = "MessageTemplate", Order = 240)]

View File

@@ -35,7 +35,7 @@ namespace JNPF.Message.Service;
/// <summary> /// <summary>
/// 发送配置 /// 发送配置
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "Message", Name = "SendMessage", Order = 240)] [ApiDescriptionSettings(Tag = "Message", Name = "SendMessage", Order = 240)]

View File

@@ -27,7 +27,7 @@ namespace JNPF.Message.Service;
/// <summary> /// <summary>
/// 公众号. /// 公众号.
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "Message", Name = "ShortLink", Order = 240)] [ApiDescriptionSettings(Tag = "Message", Name = "ShortLink", Order = 240)]

View File

@@ -18,7 +18,7 @@ namespace JNPF.Message.Service;
/// <summary> /// <summary>
/// 公众号. /// 公众号.
/// 版 本V3.2 /// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01. /// 日 期2021-06-01.
/// </summary> /// </summary>
[ApiDescriptionSettings(Tag = "Message", Name = "WechatOpen", Order = 240)] [ApiDescriptionSettings(Tag = "Message", Name = "WechatOpen", Order = 240)]

View File

@@ -1,5 +1,5 @@
@host=http://localhost:9231 @host=http://localhost:9231
//@host=http://api.tuotong-tech.com //@host=http://api.cosmoplat-tech.com
### 用户登录 ### 用户登录
# @name login # @name login

View File

@@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.Permission;
/// <summary> /// <summary>
/// 模块列表权限 /// 模块列表权限
/// 版 本V3.3 /// 版 本V3.3
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2022-03-15. /// 日 期2022-03-15.
/// </summary> /// </summary>
[SugarTable("BASE_COLUMNSPURVIEW")] [SugarTable("BASE_COLUMNSPURVIEW")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.Permission;
/// <summary> /// <summary>
/// 分级管理 /// 分级管理
/// 版 本V3.2.0 /// 版 本V3.2.0
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021.09.27. /// 日 期2021.09.27.
/// </summary> /// </summary>
[SugarTable("BASE_ORGANIZEADMINISTRATOR")] [SugarTable("BASE_ORGANIZEADMINISTRATOR")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.Permission;
/// <summary> /// <summary>
/// 机构管理 /// 机构管理
/// 版 本V3.0.0 /// 版 本V3.0.0
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2017.09.20. /// 日 期2017.09.20.
/// </summary> /// </summary>
[SugarTable("BASE_ORGANIZE")] [SugarTable("BASE_ORGANIZE")]

View File

@@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System;
/// <summary> /// <summary>
/// 高级查询方案 /// 高级查询方案
/// 版 本V3.4 /// 版 本V3.4
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2022-06-06. /// 日 期2022-06-06.
/// </summary> /// </summary>
[SugarTable("BASE_ADVANCEDQUERYSCHEME")] [SugarTable("BASE_ADVANCEDQUERYSCHEME")]

Some files were not shown because too many files have changed in this diff Show More