Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using Mapster;
|
||||
using Mapster;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entitys.Dto.ProcessManage;
|
||||
using Tnb.BasicData.Entitys.Entity;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@@ -7,9 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\common\Tnb.Common.Core\Tnb.Common.Core.csproj" />
|
||||
<ProjectReference Include="..\common\Tnb.Common\Tnb.Common.csproj" />
|
||||
<ProjectReference Include="..\common\Tnb.SqlSugar\Tnb.SqlSugar.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
@@ -25,7 +26,7 @@ namespace Tnb.BasicData
|
||||
|
||||
[ApiDescriptionSettings(Tag = "BasicData", Name = "ProcessManage", Order = 700)]
|
||||
[Route("api/basic/[controller]")]
|
||||
public class ProcessManageService : IDynamicApiController, ITransient
|
||||
public class ProcessManageService : IOverideVisualDevService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<BasRoute> _repository;
|
||||
private readonly DataBaseManager _dbManager;
|
||||
@@ -42,6 +43,9 @@ namespace Tnb.BasicData
|
||||
_dbManager = dbManager;
|
||||
_dictionaryTypeId = "24950639717653";
|
||||
}
|
||||
|
||||
public OverideVisualDevFunc OverideFuncs => new OverideVisualDevFunc();
|
||||
|
||||
/// <summary>
|
||||
/// 获取工艺路线树形结构
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@@ -8,10 +9,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\common\Tnb.Common.Core\Tnb.Common.Core.csproj" />
|
||||
<ProjectReference Include="..\system\Tnb.Systems.Interfaces\Tnb.Systems.Interfaces.csproj" />
|
||||
<ProjectReference Include="..\Tnb.BasicData.Entitys\Tnb.BasicData.Entitys.csproj" />
|
||||
<ProjectReference Include="..\Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj" />
|
||||
<ProjectReference Include="..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Dto.WorkOrder
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产工单排产输入参数
|
||||
/// </summary>
|
||||
public class ProductionSchedulingCrInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产任务主键Id
|
||||
/// </summary>
|
||||
public string? Id { get; set; }
|
||||
/// <summary>
|
||||
/// 工单类型 1、注塑/挤出 2、组装/包装
|
||||
/// </summary>
|
||||
public int MoType { get; set; }
|
||||
/// <summary>
|
||||
/// 工单Id
|
||||
/// </summary>
|
||||
public int MoId { get; set; }
|
||||
/// <summary>
|
||||
/// 产品编号
|
||||
/// </summary>
|
||||
public string ItemId { get; set; }
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// </summary>
|
||||
public string ItemName { get; set; }
|
||||
|
||||
#region 注塑工单
|
||||
/// <summary>
|
||||
/// 模具Id
|
||||
/// </summary>
|
||||
public string MoldId { get; set; }
|
||||
/// <summary>
|
||||
/// 模具名称
|
||||
/// </summary>
|
||||
public string MoldName { get; set; }
|
||||
/// <summary>
|
||||
/// 设备Id
|
||||
/// </summary>
|
||||
public string EqpId { get; set; }
|
||||
/// <summary>
|
||||
/// 设备名称
|
||||
/// </summary>
|
||||
public string EqpName { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 组装包装工单
|
||||
/// <summary>
|
||||
/// 产线编号
|
||||
/// </summary>
|
||||
public string LineId { get; set; }
|
||||
/// <summary>
|
||||
/// 产线名称
|
||||
/// </summary>
|
||||
public string LineName { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr.Entitys.Dto.WorkOrder
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产工单下发输入参数
|
||||
/// </summary>
|
||||
public class WorkOrderIssueCrInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产工单Id列表
|
||||
/// </summary>
|
||||
public List<string> WorkOrderIds { get; set; }
|
||||
}
|
||||
}
|
||||
142
Tnb.ProductionPlanMgr.Entitys/Entity/MoldsEntity.cs
Normal file
142
Tnb.ProductionPlanMgr.Entitys/Entity/MoldsEntity.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Contracts;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 模具信息表
|
||||
///</summary>
|
||||
[SugarTable("tool_molds")]
|
||||
public class MoldsEntity : BaseEntity<string>
|
||||
{
|
||||
///// <summary>
|
||||
///// 主键
|
||||
/////</summary>
|
||||
// [SugarColumn(ColumnName="id" ,IsPrimaryKey = true )]
|
||||
// public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 磨具编号
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_code")]
|
||||
public string MoldCode { get; set; }
|
||||
/// <summary>
|
||||
/// 磨具名称
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_name")]
|
||||
public string MoldName { get; set; }
|
||||
/// <summary>
|
||||
/// 产品代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "item_id")]
|
||||
public string ItemId { get; set; }
|
||||
/// <summary>
|
||||
/// 设备Id
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "eqp_id")]
|
||||
public string EqpId { get; set; }
|
||||
/// <summary>
|
||||
/// 设备代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "eqp_code")]
|
||||
public string EqpCode { get; set; }
|
||||
/// <summary>
|
||||
/// 生产模数
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "production_modulus")]
|
||||
public int? ProductionModulus { get; set; }
|
||||
/// <summary>
|
||||
/// 保养模次
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "maintain_num")]
|
||||
public int? MaintainNum { get; set; }
|
||||
/// <summary>
|
||||
/// 磨具使用状态
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_status")]
|
||||
public string MoldStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 日定额
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "daily_rate")]
|
||||
public decimal? DailyRate { get; set; }
|
||||
/// <summary>
|
||||
/// 工时定额(H/PCS)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "hour_norm")]
|
||||
public decimal? HourNorm { get; set; }
|
||||
/// <summary>
|
||||
/// 成长周期
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "growth_cycle")]
|
||||
public int? GrowthCycle { get; set; }
|
||||
/// <summary>
|
||||
/// 型腔数
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "cavity_num")]
|
||||
public int? CavityNum { get; set; }
|
||||
/// <summary>
|
||||
/// 模具寿命
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_life")]
|
||||
public int? MoldLife { get; set; }
|
||||
/// <summary>
|
||||
/// 模具剩余寿命
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_remaining_life")]
|
||||
public string MoldRemainingLife { get; set; }
|
||||
/// <summary>
|
||||
/// 库房编号
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "warehosue_id")]
|
||||
public string WarehosueId { get; set; }
|
||||
/// <summary>
|
||||
/// 库位编号
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "location_id")]
|
||||
public string LocationId { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "remark")]
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "create_id")]
|
||||
public string CreateId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "create_time")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "modify_id")]
|
||||
public string ModifyId { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "modify_time")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 扩展字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "extras")]
|
||||
public string Extras { get; set; }
|
||||
}
|
||||
}
|
||||
239
Tnb.ProductionPlanMgr.Entitys/Entity/PrdMoEntity.cs
Normal file
239
Tnb.ProductionPlanMgr.Entitys/Entity/PrdMoEntity.cs
Normal file
@@ -0,0 +1,239 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Contracts;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// MES生产工单
|
||||
///</summary>
|
||||
[SugarTable("prd_mo")]
|
||||
public class PrdMoEntity : BaseEntity<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户ID
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "tenant_id")]
|
||||
public string TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 所属组织ID
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "org_id")]
|
||||
public string OrgId { get; set; }
|
||||
/// <summary>
|
||||
/// 工单代码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_code")]
|
||||
public string MoCode { get; set; }
|
||||
/// <summary>
|
||||
/// 产品代码, BAS_MATERIA.MATERIALCODE BAS_ITEM.ITEMCODE
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "item_code")]
|
||||
public string ItemCode { get; set; }
|
||||
/// <summary>
|
||||
/// 产品附属信息
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "item_attribute")]
|
||||
public string ItemAttribute { get; set; }
|
||||
/// <summary>
|
||||
/// 工单类型:1-正常工单、2-返工工单、3-试制工单
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_type")]
|
||||
public string MoType { get; set; }
|
||||
/// <summary>
|
||||
/// 生产状态 Initial: 初始, Confirm:确认 Release: 下发, Open: 生产中, Close: 关单, Pending: 暂停
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_status")]
|
||||
public string MoStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 生产数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "plan_qty")]
|
||||
public decimal PlanQty { get; set; }
|
||||
/// <summary>
|
||||
/// 已投入数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "input_qty")]
|
||||
public decimal? InputQty { get; set; }
|
||||
/// <summary>
|
||||
/// 已完工数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "complete_qty")]
|
||||
public decimal? CompleteQty { get; set; }
|
||||
/// <summary>
|
||||
/// 报废数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "scrap_qty")]
|
||||
public decimal? ScrapQty { get; set; }
|
||||
/// <summary>
|
||||
/// 计划开始时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "plan_start_date")]
|
||||
public DateTime PlanStartDate { get; set; }
|
||||
/// <summary>
|
||||
/// 计划结束时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "plan_end_date")]
|
||||
public DateTime PlanEndDate { get; set; }
|
||||
/// <summary>
|
||||
/// 实际开工日期
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "act_start_date")]
|
||||
public DateTime? ActStartDate { get; set; }
|
||||
/// <summary>
|
||||
/// 实际完工日期
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "act_end_date")]
|
||||
public DateTime? ActEndDate { get; set; }
|
||||
/// <summary>
|
||||
/// 生产部门ID
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "dept_id")]
|
||||
public string DeptId { get; set; }
|
||||
/// <summary>
|
||||
/// 客户代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "customer_code")]
|
||||
public string CustomerCode { get; set; }
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "order_no")]
|
||||
public string OrderNo { get; set; }
|
||||
/// <summary>
|
||||
/// 订单行号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "order_seq")]
|
||||
public int? OrderSeq { get; set; }
|
||||
/// <summary>
|
||||
/// BOM版本
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "bom_version")]
|
||||
public string BomVersion { get; set; }
|
||||
/// <summary>
|
||||
/// 关联比例
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "relation_ratio")]
|
||||
public decimal? RelationRatio { get; set; }
|
||||
/// <summary>
|
||||
/// 下发人员ID
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_down_user_id")]
|
||||
public string MoDownUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 下发人员名称
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_down_user_name")]
|
||||
public string MoDownUserName { get; set; }
|
||||
/// <summary>
|
||||
/// 下发日期
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_down_date")]
|
||||
public DateTime? MoDownDate { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "remark")]
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 工作中心代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "work_center_code")]
|
||||
public string WorkCenterCode { get; set; }
|
||||
/// <summary>
|
||||
/// 主工单代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "parent_mo_code")]
|
||||
public string ParentMoCode { get; set; }
|
||||
/// <summary>
|
||||
/// 排程开始时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "seduling_start_date")]
|
||||
public DateTime? SedulingStartDate { get; set; }
|
||||
/// <summary>
|
||||
/// 排程结束时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "seduling_end_date")]
|
||||
public DateTime? SedulingEndDate { get; set; }
|
||||
/// <summary>
|
||||
/// 是否生派工单
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "is_create_dispatch")]
|
||||
public int? IsCreateDispatch { get; set; }
|
||||
/// <summary>
|
||||
/// 子工单序号(1开始,最大+1,不强制连续)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "seq")]
|
||||
public int? Seq { get; set; }
|
||||
/// <summary>
|
||||
/// 数据来源 10-计划,20-插入,30-导入
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "data_sources")]
|
||||
public string DataSources { get; set; }
|
||||
/// <summary>
|
||||
/// 产线代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "production_linecode")]
|
||||
public string ProductionLinecode { get; set; }
|
||||
/// <summary>
|
||||
/// ismerge
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "is_merge")]
|
||||
public int? IsMerge { get; set; }
|
||||
/// <summary>
|
||||
/// 组合工单
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "combine_mo_code")]
|
||||
public string CombineMoCode { get; set; }
|
||||
/// <summary>
|
||||
/// 时间戳
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "time_stamp")]
|
||||
public string TimeStamp { get; set; }
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "create_id")]
|
||||
public string CreateId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "create_time")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "modify_id")]
|
||||
public string ModifyId { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "modify_time")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 扩展字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "extras")]
|
||||
public string Extras { get; set; }
|
||||
}
|
||||
}
|
||||
203
Tnb.ProductionPlanMgr.Entitys/Entity/PrdTask.cs
Normal file
203
Tnb.ProductionPlanMgr.Entitys/Entity/PrdTask.cs
Normal file
@@ -0,0 +1,203 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Entity
|
||||
{
|
||||
///<summary>
|
||||
///生产任务信息
|
||||
///</summary>
|
||||
[SugarTable("prd_task")]
|
||||
public partial class PrdTask
|
||||
{
|
||||
public PrdTask(){
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:主键
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true,ColumnName="id")]
|
||||
public string Id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:工单类型 1、注塑/挤出工单 2、组装/包装工单
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mo_type")]
|
||||
public int? MoType {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:计划开始时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="plan_start_date")]
|
||||
public DateTime? PlanStartDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:计划结束时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="plan_end_date")]
|
||||
public DateTime? PlanEndDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:预计开始时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="estimated_start_date")]
|
||||
public DateTime? EstimatedStartDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:预计结束时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="estimated_end_date")]
|
||||
public DateTime? EstimatedEndDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:实际开工时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="start_date")]
|
||||
public DateTime? StartDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:实际完工时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="end_date")]
|
||||
public DateTime? EndDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="create_time")]
|
||||
public DateTime? CreateTime {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="modify_time")]
|
||||
public DateTime? ModifyTime {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:扩展字段
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="extras")]
|
||||
public string Extras {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:工单Id
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mo_id")]
|
||||
public string MoId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:工单代码
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mo_code")]
|
||||
public string MoCode {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:模具Id
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mold_id")]
|
||||
public string MoldId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:模具名称
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mold_name")]
|
||||
public string MoldName {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:设备Id
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="eqp_id")]
|
||||
public string EqpId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:设备名称
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="eqp_name")]
|
||||
public string EqpName {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:产线编号
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="line_id")]
|
||||
public string LineId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:产线名称
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="line_name")]
|
||||
public string LineName {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:产品Id
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="item_id")]
|
||||
public string ItemId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:产品名称
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="item_name")]
|
||||
public string ItemName {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建用户
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="create_id")]
|
||||
public string CreateId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改用户
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="modify_id")]
|
||||
public string ModifyId {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
14
Tnb.ProductionPlanMgr.Entitys/Mapper/Mapper.cs
Normal file
14
Tnb.ProductionPlanMgr.Entitys/Mapper/Mapper.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Mapster;
|
||||
using Tnb.ProductionMgr.Entitys.Dto.WorkOrder;
|
||||
using Tnb.ProductionMgr.Entitys.Entity;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Mapper
|
||||
{
|
||||
public class Mapper : IRegister
|
||||
{
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
config.ForType<ProductionSchedulingCrInput, PrdTask>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\common\Tnb.Common\Tnb.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
12
Tnb.ProductionPlanMgr.Interfaces/IPrdMoService.cs
Normal file
12
Tnb.ProductionPlanMgr.Interfaces/IPrdMoService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Tnb.ProductionPlanMgr.Entitys.Dto.WorkOrder;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 工单生成
|
||||
/// </summary>
|
||||
public interface IPrdMoService
|
||||
{
|
||||
Task<dynamic> WorkOrderIssue(WorkOrderIssueCrInput input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Tnb.ProductionPlanMgr.Entitys\Tnb.ProductionMgr.Entitys.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
77
Tnb.ProductionPlanMgr/PrdMoService.cs
Normal file
77
Tnb.ProductionPlanMgr/PrdMoService.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.OpenXmlFormats.Shared;
|
||||
using SqlSugar;
|
||||
using Tnb.ProductionMgr.Entitys.Dto.WorkOrder;
|
||||
using Tnb.ProductionMgr.Entitys.Entity;
|
||||
using Tnb.ProductionPlanMgr.Entitys.Dto.WorkOrder;
|
||||
using Tnb.ProductionPlanMgr.Interfaces;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产计划管理
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = "ProductionMgr", Name = "WorkOrderCreate", Order = 700)]
|
||||
[Route("api/production/[controller]")]
|
||||
public class PrdMoService : IPrdMoService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<PrdMoEntity> _repository;
|
||||
private readonly IDataBaseManager _dataBaseManager;
|
||||
public PrdMoService(ISqlSugarRepository<PrdMoEntity> repository, IDataBaseManager dataBaseManager)
|
||||
{
|
||||
_repository = repository;
|
||||
_dataBaseManager = dataBaseManager;
|
||||
}
|
||||
/// <summary>
|
||||
/// 生产工单创建-生产工单下发
|
||||
/// </summary>
|
||||
/// <param name="input">生产工单下发输入参数</param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("workorder-issue")]
|
||||
public async Task<dynamic> WorkOrderIssue(WorkOrderIssueCrInput input)
|
||||
{
|
||||
if (input is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
var db = await GetDbContext();
|
||||
var row = await db.Updateable<PrdMoEntity>()
|
||||
.SetColumns(it => new PrdMoEntity { MoStatus = "25019232867093" })
|
||||
.Where(it => input.WorkOrderIds.Contains(it.Id))
|
||||
.ExecuteCommandAsync();
|
||||
return (row > 0);
|
||||
}
|
||||
/// <summary>
|
||||
/// 生产工单-生产排产
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("scheduling")]
|
||||
public async Task<dynamic> ProductionScheduling(ProductionSchedulingCrInput input)
|
||||
{
|
||||
var entity = input.Adapt<PrdTask>();
|
||||
entity.Id = input.Id ?? SnowflakeIdHelper.NextId();
|
||||
var db = await GetDbContext();
|
||||
var row = await db.Storageable(entity).ExecuteCommandAsync();
|
||||
return (row > 0);
|
||||
}
|
||||
|
||||
private async Task<ISqlSugarClient> GetDbContext()
|
||||
{
|
||||
var link = await _repository.AsSugarClient().Queryable<DbLinkEntity>().FirstAsync(x => x.FullName == "tnb_mes");
|
||||
var db = _dataBaseManager.ChangeDataBase(link);
|
||||
return db;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
18
Tnb.ProductionPlanMgr/Tnb.ProductionMgr.csproj
Normal file
18
Tnb.ProductionPlanMgr/Tnb.ProductionMgr.csproj
Normal file
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\common\Tnb.Common.Core\Tnb.Common.Core.csproj" />
|
||||
<ProjectReference Include="..\common\Tnb.Common\Tnb.Common.csproj" />
|
||||
<ProjectReference Include="..\Tnb.ProductionPlanMgr.Entitys\Tnb.ProductionMgr.Entitys.csproj" />
|
||||
<ProjectReference Include="..\Tnb.ProductionPlanMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
83
Tnb.ProductionPlanMgr/WorkOrderSchedulingService.cs
Normal file
83
Tnb.ProductionPlanMgr/WorkOrderSchedulingService.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aspose.Cells;
|
||||
using DingTalk.Api.Request;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.UserModel;
|
||||
using SqlSugar;
|
||||
using Tnb.ProductionMgr.Entitys.Entity;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产排产
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = "ProductMgr", Name = "WorkOrderScheduling", Order = 700)]
|
||||
[Route("api/production/[controller]")]
|
||||
public class WorkOrderSchedulingService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IDataBaseManager _dataBaseManager;
|
||||
private readonly ISqlSugarRepository<DbLinkEntity> _repository;
|
||||
public WorkOrderSchedulingService(IDataBaseManager dataBaseManager, ISqlSugarRepository<DbLinkEntity> repository)
|
||||
{
|
||||
_dataBaseManager = dataBaseManager;
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测试数据导入
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("data")]
|
||||
[AllowAnonymous]
|
||||
public async Task ImportMoldsData()
|
||||
{
|
||||
List<(string pId, string eqpId)> multi = new()
|
||||
{
|
||||
("25546268026149","25530823999765"),
|
||||
("25546256076325","25530834099477"),
|
||||
};
|
||||
List<MoldsEntity> list = new();
|
||||
var index = 1;
|
||||
foreach (var item in multi)
|
||||
{
|
||||
MoldsEntity entity = new();
|
||||
entity.Id = SnowflakeIdHelper.NextId();
|
||||
entity.MoldCode = $"m00{index}";
|
||||
entity.MoldName = "磨具" + index;
|
||||
entity.ItemId = item.pId;
|
||||
entity.EqpId = item.eqpId;
|
||||
list.Add(entity);
|
||||
index++;
|
||||
}
|
||||
var link = await _repository.GetFirstAsync(x => x.FullName == "tnb_eqp");
|
||||
var db = _dataBaseManager.ChangeDataBase(link);
|
||||
var row = await db.Insertable(list).ExecuteCommandAsync();
|
||||
if (row > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
var dic = new Dictionary<string, object>
|
||||
{
|
||||
{"id",item.EqpId },
|
||||
{ "mold_id", item.Id}
|
||||
};
|
||||
var row2 = await db.Updateable(dic).AS("eqp_equipment")
|
||||
.WhereColumns("id").
|
||||
ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Tnb.ProductionPlanMgr/internals/BaseService.cs
Normal file
23
Tnb.ProductionPlanMgr/internals/BaseService.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr
|
||||
{
|
||||
public class BaseService : ITransient
|
||||
{
|
||||
private readonly Dictionary<string, ISqlSugarClient> _dbContextDic = new(StringComparer.OrdinalIgnoreCase);
|
||||
static BaseService()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -91,11 +91,19 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.SqlSugar", "common\Tnb.
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "09-BasicData", "09-BasicData", "{52B19E13-6B04-444C-A38A-B9955B199A98}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.BasicData.Entitys", "Tnb.BasicData.Entitys\Tnb.BasicData.Entitys.csproj", "{1E09E797-7DFF-49B1-ABB8-290660DB4451}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData.Entitys", "Tnb.BasicData.Entitys\Tnb.BasicData.Entitys.csproj", "{1E09E797-7DFF-49B1-ABB8-290660DB4451}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.BasicData.Interfaces", "Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj", "{12A5A0D3-C608-46AB-AC4C-5D5EF729AF8E}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData.Interfaces", "Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj", "{12A5A0D3-C608-46AB-AC4C-5D5EF729AF8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.BasicData", "Tnb.BasicData\Tnb.BasicData.csproj", "{C37798AB-AF09-4260-BEF5-92F7D373A4EA}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData", "Tnb.BasicData\Tnb.BasicData.csproj", "{C37798AB-AF09-4260-BEF5-92F7D373A4EA}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "10-ProductionPlanMgr", "10-ProductionPlanMgr", "{ABE58B5E-610B-4159-BFF0-8B04BF700B3C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr", "Tnb.ProductionPlanMgr\Tnb.ProductionMgr.csproj", "{1E8D442B-D136-4D1A-A265-16E2DE19D938}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Entitys", "Tnb.ProductionPlanMgr.Entitys\Tnb.ProductionMgr.Entitys.csproj", "{CE77DCAE-5210-4876-8C52-443823FF886F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Interfaces", "Tnb.ProductionPlanMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj", "{BCC64BB9-B22C-475E-BF6C-BF22B644C359}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -235,6 +243,18 @@ Global
|
||||
{C37798AB-AF09-4260-BEF5-92F7D373A4EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C37798AB-AF09-4260-BEF5-92F7D373A4EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C37798AB-AF09-4260-BEF5-92F7D373A4EA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1E8D442B-D136-4D1A-A265-16E2DE19D938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1E8D442B-D136-4D1A-A265-16E2DE19D938}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1E8D442B-D136-4D1A-A265-16E2DE19D938}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1E8D442B-D136-4D1A-A265-16E2DE19D938}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CE77DCAE-5210-4876-8C52-443823FF886F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CE77DCAE-5210-4876-8C52-443823FF886F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CE77DCAE-5210-4876-8C52-443823FF886F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CE77DCAE-5210-4876-8C52-443823FF886F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BCC64BB9-B22C-475E-BF6C-BF22B644C359}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BCC64BB9-B22C-475E-BF6C-BF22B644C359}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BCC64BB9-B22C-475E-BF6C-BF22B644C359}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BCC64BB9-B22C-475E-BF6C-BF22B644C359}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -272,6 +292,9 @@ Global
|
||||
{1E09E797-7DFF-49B1-ABB8-290660DB4451} = {52B19E13-6B04-444C-A38A-B9955B199A98}
|
||||
{12A5A0D3-C608-46AB-AC4C-5D5EF729AF8E} = {52B19E13-6B04-444C-A38A-B9955B199A98}
|
||||
{C37798AB-AF09-4260-BEF5-92F7D373A4EA} = {52B19E13-6B04-444C-A38A-B9955B199A98}
|
||||
{1E8D442B-D136-4D1A-A265-16E2DE19D938} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
||||
{CE77DCAE-5210-4876-8C52-443823FF886F} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
||||
{BCC64BB9-B22C-475E-BF6C-BF22B644C359} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {646DDD1C-F143-42C2-894F-F5C7B3A0CE74}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<ProjectReference Include="..\..\system\Tnb.Systems\Tnb.Systems.csproj" />
|
||||
<ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" />
|
||||
<ProjectReference Include="..\..\Tnb.BasicData\Tnb.BasicData.csproj" />
|
||||
<ProjectReference Include="..\..\Tnb.ProductionPlanMgr\Tnb.ProductionMgr.csproj" />
|
||||
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev\Tnb.VisualDev.csproj" />
|
||||
<ProjectReference Include="..\..\workflow\Tnb.WorkFlow\Tnb.WorkFlow.csproj" />
|
||||
<ProjectReference Include="..\..\extend\Tnb.Extend\Tnb.Extend.csproj" />
|
||||
|
||||
@@ -316,7 +316,7 @@ public class DataBaseManager : IDataBaseManager, ITransient
|
||||
if (pageInput.superQueryJson.IsNotEmptyOrNull()) superQueryJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.superQueryJson);
|
||||
// var sql = _sqlSugarClient.SqlQueryable<object>(strSql)
|
||||
// .Where(querJson).Where(superQueryJson).Where(dataPermissions).ToSqlString();
|
||||
DataTable dt = _sqlSugarClient.SqlQueryable<object>(strSql)
|
||||
DataTable dt = _sqlSugarClient.CopyNew().SqlQueryable<object>(strSql)
|
||||
.Where(querJson).Where(superQueryJson).Where(dataPermissions)
|
||||
.OrderByIF(sidx, pageInput.sidx + " " + pageInput.sort).OrderByIF(!sidx && defaultSidx, columnDesign.defaultSidx + " " + columnDesign.sort)
|
||||
.ToDataTablePage(pageInput.currentPage, pageInput.pageSize, ref total);
|
||||
|
||||
@@ -42,4 +42,8 @@ public class DepartmentCrInput
|
||||
/// 排序码.
|
||||
/// </summary>
|
||||
public long? sortCode { get; set; }
|
||||
/// <summary>
|
||||
/// 组织类型
|
||||
/// </summary>
|
||||
public string category { get; set; }
|
||||
}
|
||||
@@ -52,4 +52,9 @@ public class DepartmentInfoOutput
|
||||
/// 所属组织 组织树.
|
||||
/// </summary>
|
||||
public List<string> organizeIdTree { get; set; }
|
||||
/// <summary>
|
||||
/// 机构类型
|
||||
/// added by ly on 20230420
|
||||
/// </summary>
|
||||
public string category { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.Systems.Entitys.Dto.DictionaryData;
|
||||
|
||||
namespace JNPF.Systems.Entitys.Dto.DictionaryType;
|
||||
|
||||
@@ -42,4 +43,7 @@ public class DictionaryTypeInfoOutput
|
||||
/// 排序.
|
||||
/// </summary>
|
||||
public long? sortCode { get; set; }
|
||||
|
||||
public List<DictionaryDataInfoOutput> items { get; set; }
|
||||
|
||||
}
|
||||
26
system/Tnb.Systems.Entitys/Enum/AreaType.cs
Normal file
26
system/Tnb.Systems.Entitys/Enum/AreaType.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace JNPF.Systems.Entitys.Enum;
|
||||
|
||||
/// <summary>
|
||||
/// 区域类型.
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public enum AreaType
|
||||
{
|
||||
[Description("公司")]
|
||||
company,
|
||||
[Description("工厂")]
|
||||
factory,
|
||||
[Description("部门")]
|
||||
department,
|
||||
[Description("车间")]
|
||||
workshop,
|
||||
[Description("工作中心")]
|
||||
workgroup,
|
||||
[Description("工位")]
|
||||
workstation,
|
||||
[Description("产线")]
|
||||
workline
|
||||
}
|
||||
@@ -36,8 +36,12 @@ public class PermissionMapper : IRegister
|
||||
config.ForType<OrganizeAdminIsTratorCrInput, OrganizeAdministratorEntity>()
|
||||
.Ignore(dest => dest.UserId);
|
||||
config.ForType<OrganizeEntity, DepartmentInfoOutput>()
|
||||
.Ignore(dest => dest.organizeIdTree);
|
||||
.Ignore(dest => dest.organizeIdTree)
|
||||
.NameMatchingStrategy(NameMatchingStrategy.IgnoreCase); //modified by ly on 20230420
|
||||
config.ForType<OrganizeEntity, OrganizeInfoOutput>()
|
||||
.Ignore(dest => dest.organizeIdTree);
|
||||
//modified by ly on 20230420
|
||||
config.ForType<DepartmentUpInput, OrganizeEntity>()
|
||||
.NameMatchingStrategy(NameMatchingStrategy.IgnoreCase); //忽略字段大小写
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using JNPF.Systems.Entitys.Dto.Organize;
|
||||
using System.Linq.Expressions;
|
||||
using JNPF.Systems.Entitys.Dto.Organize;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
|
||||
namespace JNPF.Systems.Interfaces.Permission;
|
||||
@@ -21,14 +22,12 @@ public interface IOrganizeService
|
||||
|
||||
/// <summary>
|
||||
/// 获取机构列表
|
||||
/// 提供给其他服务使用.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<OrganizeEntity>> GetListAsync();
|
||||
Task<List<OrganizeEntity>> GetListAsync(Expression<Func<OrganizeEntity, bool>> expression = null);
|
||||
|
||||
/// <summary>
|
||||
/// 获取公司列表
|
||||
/// 提供给其他服务使用.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<OrganizeEntity>> GetCompanyListAsync();
|
||||
|
||||
@@ -70,6 +70,13 @@ public class TestService : IDynamicApiController, ITransient
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task ImportMoldData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void xx(UserEntity user)
|
||||
{
|
||||
user.Account = "2312321";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using System.Linq.Expressions;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Filter;
|
||||
@@ -626,9 +627,10 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task<List<OrganizeEntity>> GetListAsync()
|
||||
public async Task<List<OrganizeEntity>> GetListAsync(Expression<Func<OrganizeEntity, bool>> expression = null)
|
||||
{
|
||||
return await _repository.AsQueryable().Where(t => t.EnabledMark == 1 && t.DeleteMark == null).OrderBy(o => o.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc).ToListAsync();
|
||||
var query = _repository.AsQueryable().Where(t => t.EnabledMark == 1 && t.DeleteMark == null).WhereIF(expression!=null, expression);
|
||||
return await query.OrderBy(o => o.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Core.Manager.Files;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Manager;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DatabaseAccessor;
|
||||
using JNPF.DependencyInjection;
|
||||
@@ -46,6 +47,8 @@ public class DictionaryDataService : IDictionaryDataService, IDynamicApiControll
|
||||
/// </summary>
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
private readonly ICacheManager _cache;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化一个<see cref="DictionaryDataService"/>类型的新实例.
|
||||
/// </summary>
|
||||
@@ -53,12 +56,14 @@ public class DictionaryDataService : IDictionaryDataService, IDynamicApiControll
|
||||
ISqlSugarRepository<DictionaryDataEntity> repository,
|
||||
IDictionaryTypeService dictionaryTypeService,
|
||||
IFileManager fileManager,
|
||||
IUserManager userManager)
|
||||
IUserManager userManager,
|
||||
ICacheManager cache)
|
||||
{
|
||||
_repository = repository;
|
||||
_dictionaryTypeService = dictionaryTypeService;
|
||||
_fileManager = fileManager;
|
||||
_userManager = userManager;
|
||||
_cache = cache;
|
||||
}
|
||||
|
||||
#region GET
|
||||
|
||||
@@ -208,7 +208,7 @@ public class RunService : IRunService, ITransient
|
||||
if (templateInfo.SingleFormData.Any(x => x.__config__.templateJson != null && x.__config__.templateJson.Any()))
|
||||
realList.list = await _formDataParsing.GetKeyData(templateInfo.SingleFormData.Where(x => x.__config__.templateJson != null && x.__config__.templateJson.Any()).ToList(), realList.list, templateInfo.ColumnData, actionType, templateInfo.WebType, primaryKey);
|
||||
else //modified by ly on 20230407
|
||||
realList.list = await _formDataParsing.GetKeyData(templateInfo.SingleFormData.Where(x => x.__config__.templateJson == null|| !x.__config__.templateJson.Any()).ToList(), realList.list, templateInfo.ColumnData, actionType, templateInfo.WebType, primaryKey);
|
||||
realList.list = await _formDataParsing.GetKeyData(templateInfo.SingleFormData.Where(x => x.__config__.templateJson == null || !x.__config__.templateJson.Any()).ToList(), realList.list, templateInfo.ColumnData, actionType, templateInfo.WebType, primaryKey);
|
||||
|
||||
// 如果是无表数据并且排序字段不为空,再进行数据排序
|
||||
if (!templateInfo.IsHasTable && input.sidx.IsNotEmptyOrNull())
|
||||
@@ -1558,6 +1558,7 @@ public class RunService : IRunService, ITransient
|
||||
{
|
||||
List<FieldsModel> childFieldsModelList = model.__config__.children;
|
||||
object? objectData = allDataMap[strKey[i]];
|
||||
|
||||
List<Dictionary<string, object>> childAllDataMapList = objectData.ToJsonString().ToObject<List<Dictionary<string, object>>>();
|
||||
if (childAllDataMapList != null && childAllDataMapList.Count > 0)
|
||||
{
|
||||
|
||||
@@ -349,6 +349,7 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
||||
_db.BeginTran(); // 开启事务
|
||||
|
||||
// 修改功能
|
||||
|
||||
await _visualDevRepository.AsSugarClient().Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).CallEntityMethod(m => m.LastModify()).ExecuteCommandAsync();
|
||||
|
||||
// 修改流程表单
|
||||
|
||||
Reference in New Issue
Block a user