This commit is contained in:
CortexCore
2024-05-04 17:05:47 +08:00
parent 7c33d8f8ba
commit ee95d24b2b
23 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\IDIS_Models\IDIS_Models.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Samples\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,78 @@
{
"handle": "88.123.99/638504356449571895",
"templateVersion": "Template-1.0.0",
"value": [
{
"auth": null,
"index": 0,
"data": {
"format": "string",
"value": "order"
},
"type": "Tags"
},
{
"auth": null,
"index": 1,
"data": {
"format": "String",
"value": ""
},
"type": "OderNumber"
},
{
"auth": null,
"index": 2,
"data": {
"format": "String",
"value": ""
},
"type": "ProductCode"
},
{
"auth": null,
"index": 3,
"data": {
"format": "String",
"value": ""
},
"type": "ProductName"
},
{
"auth": null,
"index": 4,
"data": {
"format": "String",
"value": ""
},
"type": "OrderState"
},
{
"auth": null,
"index": 5,
"data": {
"format": "DateTime",
"value": "0001/1/1 0:00:00"
},
"type": "CreateTime"
},
{
"auth": null,
"index": 6,
"data": {
"format": "DateTime",
"value": "0001/1/1 0:00:00"
},
"type": "UpdateTime"
},
{
"auth": null,
"index": 7,
"data": {
"format": "DateTime",
"value": "0001/1/1 0:00:00"
},
"type": "FinishTime"
}
]
}

View File

@@ -0,0 +1,79 @@
{
"prefix": "88.123.99",
"version": "1.0.0",
"description": "This is a template",
"items": [
{
"name": "标签",
"idType": "tags",
"metaData": {
"type": "string",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "订单编号",
"idType": "OderNumber",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "产品编码",
"idType": "ProductCode",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "产品名称",
"idType": "ProductName",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "订单状态",
"idType": "OrderState",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "下单时间",
"idType": "CreateTime",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "更新时间",
"idType": "UpdateTime",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "完成时间",
"idType": "FinishTime",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
}
]
}

View File

@@ -0,0 +1,87 @@
{
"handle": "88.123.99/638504356450474051",
"templateVersion": "Template-1.0.0",
"value": [
{
"auth": null,
"index": 0,
"data": {
"format": "string",
"value": ""
},
"type": "Tags"
},
{
"auth": null,
"index": 1,
"data": {
"format": "String",
"value": ""
},
"type": "Number"
},
{
"auth": null,
"index": 2,
"data": {
"format": "String",
"value": ""
},
"type": "Name"
},
{
"auth": null,
"index": 3,
"data": {
"format": "String",
"value": ""
},
"type": "Model"
},
{
"auth": null,
"index": 4,
"data": {
"format": "String",
"value": ""
},
"type": "Type"
},
{
"auth": null,
"index": 5,
"data": {
"format": "String",
"value": ""
},
"type": "Description"
},
{
"auth": null,
"index": 6,
"data": {
"format": "String",
"value": ""
},
"type": "Trace"
},
{
"auth": null,
"index": 7,
"data": {
"format": "String",
"value": ""
},
"type": "Manufacturer"
},
{
"auth": null,
"index": 8,
"data": {
"format": "DateTime",
"value": "0001/1/1 0:00:00"
},
"type": "ManufactureDate"
}
]
}

View File

@@ -0,0 +1,88 @@
{
"prefix": "88.123.99",
"version": "1.0.0",
"description": "This is a template",
"items": [
{
"name": "标签",
"idType": "tags",
"metaData": {
"type": "string",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "编号",
"idType": "Number",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "名称",
"idType": "Name",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "型号",
"idType": "Model",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "类型",
"idType": "Type",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "描述",
"idType": "Description",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "来源",
"idType": "Trace",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "生产厂家",
"idType": "Manufacturer",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "生产日期",
"idType": "ManufactureDate",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
}
]
}

View File

@@ -0,0 +1,42 @@
{
"handle": "88.123.99/638504356450486389",
"templateVersion": "Template-1.0.0",
"value": [
{
"auth": null,
"index": 0,
"data": {
"format": "string",
"value": ""
},
"type": "Tags"
},
{
"auth": null,
"index": 1,
"data": {
"format": "String",
"value": ""
},
"type": "MaterialName"
},
{
"auth": null,
"index": 2,
"data": {
"format": "String",
"value": ""
},
"type": "MaterialType"
},
{
"auth": null,
"index": 3,
"data": {
"format": "String",
"value": ""
},
"type": "ManufactureDate"
}
]
}

View File

@@ -0,0 +1,43 @@
{
"prefix": "88.123.99",
"version": "1.0.0",
"description": "This is a template",
"items": [
{
"name": "标签",
"idType": "tags",
"metaData": {
"type": "string",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "物料名称",
"idType": "MaterialName",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "物料类型",
"idType": "MaterialType",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "生产日期",
"idType": "ManufactureDate",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
}
]
}

View File

@@ -0,0 +1,69 @@
{
"handle": "88.123.99/638504356450495496",
"templateVersion": "Template-1.0.0",
"value": [
{
"auth": null,
"index": 0,
"data": {
"format": "string",
"value": ""
},
"type": "Tags"
},
{
"auth": null,
"index": 1,
"data": {
"format": "String",
"value": ""
},
"type": "ProductName"
},
{
"auth": null,
"index": 2,
"data": {
"format": "String",
"value": ""
},
"type": "ProductType"
},
{
"auth": null,
"index": 3,
"data": {
"format": "String",
"value": ""
},
"type": "OrderHandle"
},
{
"auth": null,
"index": 4,
"data": {
"format": "DateTime",
"value": "0001/1/1 0:00:00"
},
"type": "ManufactureDate"
},
{
"auth": null,
"index": 5,
"data": {
"format": "String",
"value": ""
},
"type": "BatchNumber"
},
{
"auth": null,
"index": 6,
"data": {
"format": "String",
"value": "请不要在用力弯曲或者误食笔芯"
},
"type": "Note"
}
]
}

View File

@@ -0,0 +1,70 @@
{
"prefix": "88.123.99",
"version": "1.0.0",
"description": "This is a template",
"items": [
{
"name": "标签",
"idType": "tags",
"metaData": {
"type": "string",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "产品名称",
"idType": "ProductName",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "产品类型",
"idType": "ProductType",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "订单标识",
"idType": "OrderHandle",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "生产日期",
"idType": "ManufactureDate",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "批次号",
"idType": "BatchNumber",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "注意事项",
"idType": "Note",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
}
]
}

View File

@@ -0,0 +1,78 @@
{
"handle": "88.123.99/638504356450505177",
"templateVersion": "Template-1.0.0",
"value": [
{
"auth": null,
"index": 0,
"data": {
"format": "string",
"value": ""
},
"type": "Tags"
},
{
"auth": null,
"index": 1,
"data": {
"format": "String",
"value": ""
},
"type": "MaterialName"
},
{
"auth": null,
"index": 2,
"data": {
"format": "String",
"value": ""
},
"type": "Name"
},
{
"auth": null,
"index": 3,
"data": {
"format": "String",
"value": ""
},
"type": "AssignmentCode"
},
{
"auth": null,
"index": 4,
"data": {
"format": "String",
"value": ""
},
"type": "MainObject"
},
{
"auth": null,
"index": 5,
"data": {
"format": "DateTime",
"value": "2024/5/4 16:07:24"
},
"type": "CreateTime"
},
{
"auth": null,
"index": 6,
"data": {
"format": "DateTime",
"value": "2024/5/4 16:07:24"
},
"type": "CompleteTime"
},
{
"auth": null,
"index": 7,
"data": {
"format": "DateTime",
"value": "2024/5/4 16:07:24"
},
"type": "LastUpdateTime"
}
]
}

View File

@@ -0,0 +1,79 @@
{
"prefix": "88.123.99",
"version": "1.0.0",
"description": "This is a template",
"items": [
{
"name": "标签",
"idType": "tags",
"metaData": {
"type": "string",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "",
"idType": "MaterialName",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "工序名称",
"idType": "Name",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "业务任务编码",
"idType": "AssignmentCode",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "主要物体",
"idType": "MainObject",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "创建时间",
"idType": "CreateTime",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "完成时间",
"idType": "CompleteTime",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "最后更新时间",
"idType": "LastUpdateTime",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
}
]
}

View File

@@ -0,0 +1,96 @@
{
"handle": "88.123.99/638504356450514755",
"templateVersion": "Template-1.0.0",
"value": [
{
"auth": null,
"index": 0,
"data": {
"format": "string",
"value": ""
},
"type": "Tags"
},
{
"auth": null,
"index": 1,
"data": {
"format": "String",
"value": ""
},
"type": "ContainerHandle"
},
{
"auth": null,
"index": 2,
"data": {
"format": "String",
"value": ""
},
"type": "OriginalDestination"
},
{
"auth": null,
"index": 3,
"data": {
"format": "String",
"value": ""
},
"type": "TargetDestination"
},
{
"auth": null,
"index": 4,
"data": {
"format": "String",
"value": ""
},
"type": "Name"
},
{
"auth": null,
"index": 5,
"data": {
"format": "String",
"value": ""
},
"type": "AssignmentCode"
},
{
"auth": null,
"index": 6,
"data": {
"format": "String",
"value": ""
},
"type": "MainObject"
},
{
"auth": null,
"index": 7,
"data": {
"format": "DateTime",
"value": "2024/5/4 16:07:24"
},
"type": "CreateTime"
},
{
"auth": null,
"index": 8,
"data": {
"format": "DateTime",
"value": "2024/5/4 16:07:24"
},
"type": "CompleteTime"
},
{
"auth": null,
"index": 9,
"data": {
"format": "DateTime",
"value": "2024/5/4 16:07:24"
},
"type": "LastUpdateTime"
}
]
}

View File

@@ -0,0 +1,97 @@
{
"prefix": "88.123.99",
"version": "1.0.0",
"description": "This is a template",
"items": [
{
"name": "标签",
"idType": "tags",
"metaData": {
"type": "string",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "指定容器",
"idType": "ContainerHandle",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "原位置",
"idType": "OriginalDestination",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "目标位置",
"idType": "TargetDestination",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "工序名称",
"idType": "Name",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "业务任务编码",
"idType": "AssignmentCode",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "主要物体",
"idType": "MainObject",
"metaData": {
"type": "String",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "创建时间",
"idType": "CreateTime",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "完成时间",
"idType": "CompleteTime",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
},
{
"name": "最后更新时间",
"idType": "LastUpdateTime",
"metaData": {
"type": "DateTime",
"minLength": 0,
"maxLength": 255
}
}
]
}

View File

@@ -0,0 +1,50 @@
using System.ComponentModel;
using IDIS.Model;
using Newtonsoft.Json;
namespace IDIS.YL106.Model;
public record Data_Oder : IDIS_Model
{
public override string[] Tags { get; set; } = new string[] { "order" };
/// <summary>
/// 订单编号
/// </summary>
[DisplayName("订单编号")]
[JsonProperty("order_number")]
public string OderNumber { get; set; } = string.Empty;
/// <summary>
/// 产品编码
/// </summary>
[DisplayName("产品编码")]
[JsonProperty("product_code")]
public string ProductCode { get; set; } = string.Empty;
/// <summary>
/// 产品名称
/// </summary>
[DisplayName("产品名称")]
[JsonProperty("product_name")]
public string ProductName { get; set; } = string.Empty;
/// <summary>
/// 订单状态
/// </summary>
[DisplayName("订单状态")]
public string OrderState { get; set; } = string.Empty;
/// <summary>
/// 下单时间
/// </summary>
[DisplayName("下单时间")]
public DateTime CreateTime { get; set; } = DateTime.MinValue;
/// <summary>
/// 更新时间
/// </summary>
[DisplayName("更新时间")]
public DateTime UpdateTime { get; set; } = DateTime.MinValue;
/// <summary>
/// 完成时间
/// </summary>
[DisplayName("完成时间")]
public DateTime FinishTime { get; set; } = DateTime.MinValue;
}

View File

@@ -0,0 +1,67 @@
using System.ComponentModel;
using IDIS.Model;
using Newtonsoft.Json;
namespace IDIS.YL106.Model;
/// <summary>
/// 设备模型,用于描述例如机器人、传送带等设备的信息
/// </summary>
public record Object_Equipment : IDIS_Model
{
/// <summary>
/// 编号
/// </summary>
[DisplayName("编号")]
[JsonProperty("number")]
public string Number { get; set; } = string.Empty;
/// <summary>
/// 名称
/// </summary>
[DisplayName("名称")]
[JsonProperty("name")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 型号
/// </summary>
[DisplayName("型号")]
[JsonProperty("model")]
public string Model { get; set; } = string.Empty;
/// <summary>
/// 类型
/// </summary>
[DisplayName("类型")]
[JsonProperty("type")]
public string Type { get; set; } = string.Empty;
/// <summary>
/// 描述,用于介绍该设备的用途
/// </summary>
[DisplayName("描述")]
[JsonProperty("description")]
public string Description { get; set; } = string.Empty;
/// <summary>
/// 设备来源
/// </summary>
[DisplayName("来源")]
[JsonProperty("source")]
public string Trace { get; set; } = string.Empty;
/// <summary>
/// 生产厂家
/// </summary>
[DisplayName("生产厂家")]
[JsonProperty("manufacturer")]
public string Manufacturer { get; set; } = string.Empty;
/// <summary>
/// 生产日期
/// </summary>
[DisplayName("生产日期")]
[JsonProperty("manufacture_date")]
public DateTime ManufactureDate { get; set; } =DateTime.MinValue;
}

View File

@@ -0,0 +1,29 @@
using System.ComponentModel;
using IDIS.Model;
using Newtonsoft.Json;
namespace IDIS.YL106.Model;
public record Object_Material: IDIS_Model
{
/// <summary>
/// 物料名称
/// </summary>
[DisplayName("物料名称")]
[JsonProperty("material_name")]
public string MaterialName { get; set; } = string.Empty;
/// <summary>
/// 物料类型
/// </summary>
[DisplayName("物料类型")]
[JsonProperty("material_type")]
public string MaterialType { get; set; } = string.Empty;
/// <summary>
/// 生产日期
/// </summary>
[DisplayName("生产日期")]
[JsonProperty("manufacture_date")]
public string ManufactureDate { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,51 @@
using System.ComponentModel;
using IDIS.Model;
using Newtonsoft.Json;
namespace IDIS.YL106.Model;
public record Object_Product:IDIS_Model
{
/// <summary>
/// 产品名称
/// </summary>
[DisplayName("产品名称")]
[JsonProperty("product_name")]
public string ProductName { get; set; } = string.Empty;
/// <summary>
/// 产品类型
/// </summary>
[DisplayName("产品类型")]
[JsonProperty("product_type")]
public string ProductType { get; set; }= string.Empty;
/// <summary>
/// 订单标识
/// </summary>
[DisplayName("订单标识")]
[JsonProperty("order_handle")]
public string OrderHandle { get; set; }= string.Empty;
/// <summary>
/// 生产日期
/// </summary>
[DisplayName("生产日期")]
[JsonProperty("manufacture_date")]
public DateTime ManufactureDate { get; set; } = DateTime.MinValue;
/// <summary>
/// 批次号
/// </summary>
[DisplayName("批次号")]
[JsonProperty("batch_number")]
public string BatchNumber { get; set; }= string.Empty;
/// <summary>
/// 注意事项 (默认值: "请勿将移动电源放入水中")
/// </summary>
[DisplayName("注意事项")]
[JsonProperty("note")]
public string Note { get; set; } = "请不要在用力弯曲或者误食笔芯";
}

View File

@@ -0,0 +1,9 @@
namespace IDIS.YL106.Model;
public record Procedure_Assembly:Procedure_Base
{
/// <summary>
/// 物料名称
/// </summary>
public string MaterialName { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,45 @@
using System.ComponentModel;
using IDIS.Model;
using Newtonsoft.Json;
namespace IDIS.YL106.Model;
public record Procedure_Base:IDIS_Model
{
/// <summary>
/// 工序名称
/// </summary>
[DisplayName("工序名称")]
[JsonProperty("name")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 业务任务编码
/// </summary>
[DisplayName("业务任务编码")]
[JsonProperty("assignment_code")]
public string AssignmentCode { get; set; } = string.Empty;
/// <summary>
/// 主要物体
/// </summary>
[DisplayName("主要物体")]
[JsonProperty("main_object")]
public string MainObject { get; set; } = string.Empty;
/// <summary>
/// 创建时间
/// </summary>
[DisplayName("创建时间")]
[JsonProperty("create_time")]
public DateTime CreateTime { get; set; } = DateTime.Now;
/// <summary>
/// 完成时间(未完成时为DateTime.Min)
/// </summary>
[DisplayName("完成时间")]
[JsonProperty("complete_time")]
public DateTime CompleteTime { get; set; } = DateTime.Now;
/// <summary>
/// 最后更新时间
/// </summary>
[DisplayName("最后更新时间")]
[JsonProperty("last_updateTime")]
public DateTime LastUpdateTime { get; set; } = DateTime.Now;
}

View File

@@ -0,0 +1,29 @@
using System.ComponentModel;
using IDIS.Model;
using Newtonsoft.Json;
namespace IDIS.YL106.Model;
public record Procedure_Transport:Procedure_Base
{
/// <summary>
/// 指定容器
/// </summary>
[DisplayName("指定容器")]
[JsonProperty("container_handle")]
public string ContainerHandle { get; set; } = string.Empty;
/// <summary>
/// 原位置
/// </summary>
[DisplayName("原位置")]
[JsonProperty("original_destination")]
public string OriginalDestination { get; set; } = string.Empty;
/// <summary>
/// 目标位置
/// </summary>
[DisplayName("目标位置")]
[JsonProperty("target_destination")]
public string TargetDestination { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,47 @@
using IDIS.Model;
using IDIS.Models;
using Newtonsoft.Json;
namespace IDIS.YL106.Model;
public class Program
{
public static void Main()
{
var list = new List<IDIS_Model>
{
new Data_Oder(),
new Object_Equipment(),
new Object_Material(),
new Object_Product(),
new Procedure_Assembly(),
new Procedure_Transport()
};
var currentDirectory = Environment.CurrentDirectory;
#if DEBUG
currentDirectory = new DirectoryInfo(currentDirectory).Parent!.Parent!.Parent?.FullName!;
#endif
currentDirectory = Path.Combine(currentDirectory, "Samples");
Console.WriteLine("生成的样本将保存于: " + currentDirectory);
new DirectoryInfo(currentDirectory).Create();
foreach (var x in list)
{
var templatePath = Path.Combine(currentDirectory, $"{x.GetType().Name}_Template.json");
var registerPath = Path.Combine(currentDirectory, $"{x.GetType().Name}_Register.json");
var registerData = new IDIS_Register_Data
{
Handle = $"88.123.99/{DateTime.Now.Ticks}",
TemplateVersion = "Template-1.0.0",
Value = x.AsValueInfo()
};
File.WriteAllText(templatePath,JsonConvert.SerializeObject(x.AsTemplate(),Formatting.Indented));
File.WriteAllText(registerPath,JsonConvert.SerializeObject(registerData,Formatting.Indented));
Console.WriteLine();
Console.WriteLine($"生成了{x.GetType().Name}的样本,模板保存于\n{templatePath},注册数据保存于\n{registerPath}");
}
}
}