# YL106 标识 类库 新建的标识模板类继承`IDIS_Model` 就可以使用`AsTemplate`方法将其转换为模板类 ### 已注册的标识模板 #### 设备 - `88.123.99@Equipment-1.0.0` #### 物料 - `88.123.99@Material-1.0.0` #### 订单 - `88.123.99@Oder-1.0.0` #### 工序 - `88.123.99@Procedure_Assembly-1.0.0` - `88.123.99@Procedure_Transport-1.0.0` #### 产品 - `88.123.99@Product-1.0.0` ### 如何使其成为模板类? ```csharp var template = model.AsTemplate(); ``` ### 如何根据该类注册标识? ```csharp var registerData = new IDIS_Register_Data { Handle = $"88.123.99/{DateTime.Now.Ticks}", TemplateVersion = "Template-1.0.0", Value = model.AsValueInfo() }; ``` ### 如何查询包括某些标签的标识? [httpGet]`localhost:5242/api/query/by?tags=order&today=false` `tags`是标签,用`;`分隔 `today`是是否只查询当天的标识 ### 在注册标识的时候需要注意什么? 默认类的第一个值是`Tags`,用于查找 例如`oder;product;device`就是三个标签 当你在注册订单标识时,确保第一个值`Tag`中包含`order`这个标签,这样在查询订单标识时,就可以通过`order`这个标签来查找 例如: ```json { "handle": "88.123.99/638504356449571895", "templateVersion": "Oder-1.0.0", "value": [ { "auth": null, "index": 0, "data": { "format": "string", "value": "order" }, "type": "Tags" }, { "auth": null, "index": 1, "data": { "format": "String", "value": "20240164784" }, "type": "OderNumber" }, { "auth": null, "index": 2, "data": { "format": "String", "value": "DS-SDW" }, "type": "ProductCode" }, { "auth": null, "index": 3, "data": { "format": "String", "value": "签字笔" }, "type": "ProductName" }, { "auth": null, "index": 4, "data": { "format": "String", "value": "Oder_Created" }, "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" } ] } ```