diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Consts/SpotInsRecordExecutionStatus.cs b/EquipMgr/Tnb.EquipMgr.Entities/Consts/SpotInsRecordExecutionStatus.cs
new file mode 100644
index 00000000..f847477a
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Consts/SpotInsRecordExecutionStatus.cs
@@ -0,0 +1,23 @@
+namespace Tnb.EquipMgr
+{
+ ///
+ /// 点巡检记录执行状态
+ ///
+ public static class SpotInsRecordExecutionStatus
+ {
+ ///
+ /// 待执行
+ ///
+ public const string TOBEEXECUTED = "1";
+
+ ///
+ /// 待复核
+ ///
+ public const string TOBECHECK = "1";
+
+ ///
+ /// 已完成
+ ///
+ public const string COMPLETED = "1";
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipType.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipType.cs
new file mode 100644
index 00000000..adc81cbb
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipType.cs
@@ -0,0 +1,100 @@
+using SqlSugar;
+using Tnb.Common.Contracts;
+
+namespace Tnb.EquipMgr.Entities
+{
+ ///
+ ///设备类型
+ ///
+ [SugarTable("eqp_equip_type")]
+ public partial class EqpEquipType : BaseEntity
+ {
+ public EqpEquipType()
+ {
+ }
+
+ ///
+ /// Desc:修改时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? modify_time { get; set; }
+
+ ///
+ /// Desc:名称
+ /// Default:
+ /// Nullable:False
+ ///
+ public string name { get; set; }
+
+ ///
+ /// Desc:编码
+ /// Default:
+ /// Nullable:False
+ ///
+ public string code { get; set; }
+
+ ///
+ /// Desc:创建时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? create_time { get; set; }
+
+ ///
+ /// Desc:是否是特种设备0否1是
+ /// Default:
+ /// Nullable:False
+ ///
+ public int is_special_equipment { get; set; }
+
+ ///
+ /// Desc:排序
+ /// Default:
+ /// Nullable:False
+ ///
+ public int ordinal { get; set; }
+
+ ///
+ /// Desc:状态0 禁用 1 启用
+ /// Default:
+ /// Nullable:False
+ ///
+ public int status { get; set; }
+
+ ///
+ /// Desc:是否是实验设备0否1是
+ /// Default:
+ /// Nullable:False
+ ///
+ public int is_lab { get; set; }
+
+ ///
+ /// Desc:创建用户
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string create_id { get; set; }
+
+ ///
+ /// Desc:修改用户
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string modify_id { get; set; }
+
+ ///
+ /// Desc:备注
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string remark { get; set; }
+
+ ///
+ /// Desc:所属组织
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string org_id { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordD.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordD.cs
new file mode 100644
index 00000000..7ac2a892
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordD.cs
@@ -0,0 +1,134 @@
+using SqlSugar;
+using Tnb.Common.Contracts;
+
+namespace Tnb.EquipMgr.Entities;
+
+///
+///点巡检执行记录子表
+///
+[SugarTable("eqp_spot_ins_record_d")]
+public partial class EqpSpotInsRecordD : BaseEntity
+{
+ public EqpSpotInsRecordD()
+ {
+ }
+
+ ///
+ /// Desc:点巡检执行记录id
+ /// Default:
+ /// Nullable:False
+ ///
+ public string spot_ins_record_id { get; set; }
+
+ ///
+ /// Desc:点巡检项id
+ /// Default:
+ /// Nullable:False
+ ///
+ public string spot_ins_item_id { get; set; }
+
+ ///
+ /// Desc:判断类型
+ /// Default:
+ /// Nullable:False
+ ///
+ public string judge_type { get; set; }
+
+ ///
+ /// Desc:上限值
+ /// Default:
+ /// Nullable:True
+ ///
+ public decimal? high_value { get; set; }
+
+ ///
+ /// Desc:是否包含上限值
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? high_value_is_include { get; set; }
+
+ ///
+ /// Desc:下限值
+ /// Default:
+ /// Nullable:True
+ ///
+ public decimal? low_value { get; set; }
+
+ ///
+ /// Desc:是否包含下限值
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? low_value_is_include { get; set; }
+
+ ///
+ /// Desc:标准值
+ /// Default:
+ /// Nullable:True
+ ///
+ public double? standard_value { get; set; }
+
+ ///
+ /// Desc:单位id
+ /// Default:
+ /// Nullable:False
+ ///
+ public string unit_id { get; set; }
+
+ ///
+ /// Desc:结果 1 通过 2 不通过
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? result { get; set; }
+
+ ///
+ /// Desc:实际测量值
+ /// Default:
+ /// Nullable:True
+ ///
+ public double? real_value { get; set; }
+
+ ///
+ /// Desc:排序
+ /// Default:
+ /// Nullable:False
+ ///
+ public long ordinal { get; set; }
+
+ ///
+ /// Desc:编码
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string code { get; set; }
+
+ ///
+ /// Desc:名称
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string name { get; set; }
+
+ ///
+ /// Desc:判断内容
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string judge_content { get; set; }
+
+ ///
+ /// Desc:点巡检方法
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string inspection_method { get; set; }
+
+ ///
+ /// Desc:备注
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string remark { get; set; }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordH.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordH.cs
new file mode 100644
index 00000000..94a35273
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordH.cs
@@ -0,0 +1,135 @@
+using SqlSugar;
+using Tnb.Common.Contracts;
+
+namespace Tnb.EquipMgr.Entities
+{
+ ///
+ ///点巡检执行记录表
+ ///
+ [SugarTable("eqp_spot_ins_record_h")]
+ public partial class EqpSpotInsRecordH : BaseEntity
+ {
+ public EqpSpotInsRecordH()
+ {
+ }
+
+ ///
+ /// Desc:创建时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? create_time { get; set; }
+
+ ///
+ /// Desc:修改时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? modify_time { get; set; }
+
+ ///
+ /// Desc:设备id
+ /// Default:
+ /// Nullable:False
+ ///
+ public string equip_id { get; set; }
+
+ ///
+ /// Desc:点巡检设备模板id
+ /// Default:
+ /// Nullable:False
+ ///
+ public string spot_ins_tem_equip_id { get; set; }
+
+ ///
+ /// Desc:结果1 合格2不合格
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? result { get; set; }
+
+ ///
+ /// Desc:执行时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? spot_record_date_time { get; set; }
+
+ ///
+ /// Desc:不合格推送
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? is_send { get; set; }
+
+ ///
+ /// Desc:推送时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? send_date_time { get; set; }
+
+ ///
+ /// Desc:滞后推送时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? after_send_date_time { get; set; }
+
+ ///
+ /// Desc:是否滞后推送
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? is_after_send { get; set; }
+
+ ///
+ /// Desc:创建用户
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string create_id { get; set; }
+
+ ///
+ /// Desc:修改用户
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string modify_id { get; set; }
+
+ ///
+ /// Desc:点巡检结果备注
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string result_remark { get; set; }
+
+ ///
+ /// Desc:状态 1待执行 2 待复核 3 已完成
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string status { get; set; }
+
+ ///
+ /// Desc:执行人id
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string spot_record_user_id { get; set; }
+
+ ///
+ /// Desc:设备类型id
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string equip_type_id { get; set; }
+
+ ///
+ /// Desc:推送人id
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string send_id { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsTemEquipH.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsTemEquipH.cs
new file mode 100644
index 00000000..e0d39d81
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsTemEquipH.cs
@@ -0,0 +1,177 @@
+using SqlSugar;
+using Tnb.Common.Contracts;
+
+namespace Tnb.EquipMgr.Entities
+{
+ ///
+ ///点巡检设备模板表
+ ///
+ [SugarTable("eqp_spot_ins_tem_equip_h")]
+ public partial class EqpSpotInsTemEquipH : BaseEntity
+ {
+ public EqpSpotInsTemEquipH()
+ {
+ }
+
+ ///
+ /// Desc:创建时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? create_time { get; set; }
+
+ ///
+ /// Desc:修改时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? modify_time { get; set; }
+
+ ///
+ /// Desc:编码
+ /// Default:
+ /// Nullable:False
+ ///
+ public string code { get; set; }
+
+ ///
+ /// Desc:名称
+ /// Default:
+ /// Nullable:False
+ ///
+ public string name { get; set; }
+
+ ///
+ /// Desc:周期
+ /// Default:
+ /// Nullable:False
+ ///
+ public decimal plan_cycle { get; set; }
+
+ ///
+ /// Desc:周期方式 1 单次 2 循环
+ /// Default:
+ /// Nullable:False
+ ///
+ public string plan_cycle_unit { get; set; }
+
+ ///
+ /// Desc:计划执行通知提前量
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? plan_run_notice { get; set; }
+
+ ///
+ /// Desc:创建用户
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string create_id { get; set; }
+
+ ///
+ /// Desc:修改用户
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string modify_id { get; set; }
+
+ ///
+ /// Desc:执行滞后推送时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? plan_delay { get; set; }
+
+ ///
+ /// Desc:启用时间
+ /// Default:
+ /// Nullable:False
+ ///
+ public DateTime start_time { get; set; }
+
+ ///
+ /// Desc:是否启用
+ /// Default:
+ /// Nullable:False
+ ///
+ public string is_start { get; set; }
+
+ ///
+ /// Desc:是否复核
+ /// Default:
+ /// Nullable:False
+ ///
+ public string is_repeat { get; set; }
+
+ ///
+ /// Desc:不合格推送 0 不推送 1 推送
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? is_send { get; set; }
+
+ ///
+ /// Desc:点巡检模板id
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string spot_ins_tem_id { get; set; }
+
+ ///
+ /// Desc:TODO
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string equip_id { get; set; }
+
+ ///
+ /// Desc:TODO
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string remark { get; set; }
+
+ ///
+ /// Desc:计划执行通知提前量单位 1 小时 2 天 3 周
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string plan_run_notice_unit { get; set; }
+
+ ///
+ /// Desc:执行滞后推送时间单位 1 小时 2 天 3 周
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string plan_delay_unit { get; set; }
+
+ ///
+ /// Desc:复核岗位id
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string repeat_post_info_user_id { get; set; }
+
+ ///
+ /// Desc:责任岗位id
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string send_post_info_user_id { get; set; }
+
+ ///
+ /// Desc:推送人id
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string send_post_id { get; set; }
+
+ ///
+ /// Desc:所属组织
+ /// Default:NULL::character varying
+ /// Nullable:True
+ ///
+ public string org_id { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEquSpotInsTemEquipService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEquSpotInsTemEquipService.cs
new file mode 100644
index 00000000..48b4b400
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEquSpotInsTemEquipService.cs
@@ -0,0 +1,19 @@
+namespace Tnb.EquipMgr.Interfaces
+{
+ public interface IEquSpotInsTemEquipService
+ {
+ // ///
+ // /// 获取数
+ // ///
+ // ///
+ // ///
+ // public Task GetTree();
+
+ ///
+ /// 停止计划
+ ///
+ ///
+ ///
+ public Task Stop(Dictionary parameters);
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr/EquSpotInsTemEquipService.cs b/EquipMgr/Tnb.EquipMgr/EquSpotInsTemEquipService.cs
new file mode 100644
index 00000000..f866e77c
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr/EquSpotInsTemEquipService.cs
@@ -0,0 +1,70 @@
+using JNPF.Common.Enums;
+using JNPF.Common.Security;
+using JNPF.DependencyInjection;
+using JNPF.DynamicApiController;
+using JNPF.FriendlyException;
+using Microsoft.AspNetCore.Mvc;
+using SqlSugar;
+using Tnb.EquipMgr.Interfaces;
+using Tnb.EquipMgr.Entities;
+
+namespace Tnb.EquipMgr
+{
+ ///
+ /// 设备管理
+ ///
+ [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
+ [Route("api/[area]/[controller]/[action]")]
+ public class EquSpotInsTemEquipService : IEquSpotInsTemEquipService, IDynamicApiController, ITransient
+ {
+ private readonly ISqlSugarRepository _repository;
+
+ public EquSpotInsTemEquipService(ISqlSugarRepository repository)
+ {
+ _repository = repository;
+ }
+
+ // public async Task GetTree()
+ // {
+ // List eqpEquipments =
+ // var data = _repository.AsSugarClient().Queryable()
+ // .Where(x => x.status == 1)
+ // .Select((x) => new TreeModel
+ // {
+ // id = x.id,
+ // parentId = "-1",
+ // hasChildren = SqlFunc.Subqueryable().Where(y=>y.eqp_type_id==x.id).Any(),
+ // isLeaf = false,
+ // num = SqlFunc.Subqueryable().Where(y=>y.eqp_type_id==x.id).Count(),
+ // children = SqlFunc.Subqueryable().Where(y=>y.eqp_type_id==x.id).Select(y=>new TreeModel()
+ // {
+ //
+ // }).ToList(model => ),
+ // });
+ // return new { list = 1 };
+ // }
+
+ public async Task Stop(Dictionary parameters)
+ {
+ string id = parameters["id"];
+ DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
+ {
+ await _repository.UpdateAsync(x => new EqpSpotInsTemEquipH()
+ {
+ is_start = "0"
+ }, x => x.id == id);
+ List ids = await _repository.AsSugarClient().Queryable()
+ .Where(x => x.spot_ins_tem_equip_id == id && x.status == SpotInsRecordExecutionStatus.TOBEEXECUTED)
+ .Select(x => x.id).ToListAsync();
+ await _repository.AsSugarClient().Deleteable()
+ .Where(x => x.spot_ins_tem_equip_id == id && x.status == SpotInsRecordExecutionStatus.TOBEEXECUTED).ExecuteCommandAsync();
+
+ await _repository.AsSugarClient().Deleteable()
+ .Where(x => ids.Contains(x.spot_ins_record_id)).ExecuteCommandAsync();
+
+ });
+
+ if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdWorklineState.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdWorklineState.cs
new file mode 100644
index 00000000..52e9c4e3
--- /dev/null
+++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdWorklineState.cs
@@ -0,0 +1,165 @@
+using SqlSugar;
+
+namespace Tnb.ProductionMgr.Entities;
+
+///
+///产线状态
+///
+[SugarTable("prd_workline_state")]
+public partial class PrdWorklineState
+{
+ public PrdWorklineState()
+ {
+
+
+ }
+ ///
+ /// Desc:工序id
+ /// Default:
+ /// Nullable:False
+ ///
+ public string process_id { get; set; }
+
+ ///
+ /// Desc:当前产品序列号
+ /// Default:
+ /// Nullable:False
+ ///
+ public string lot_no { get; set; }
+
+ ///
+ /// Desc:工单id
+ /// Default:
+ /// Nullable:True
+ ///
+ public string mo_id { get; set; }
+
+ ///
+ /// Desc:更新时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? update_time { get; set; }
+
+ ///
+ /// Desc:需要的物料
+ /// Default:
+ /// Nullable:False
+ ///
+ public string require_material_spec { get; set; }
+
+ ///
+ /// Desc:扩展
+ /// Default:
+ /// Nullable:True
+ ///
+ public string extras { get; set; }
+
+ ///
+ /// Desc:当前产品
+ /// Default:
+ /// Nullable:True
+ ///
+ public string product_code { get; set; }
+
+ ///
+ /// Desc:当前产品
+ /// Default:
+ /// Nullable:True
+ ///
+ public string product_name { get; set; }
+
+ ///
+ /// Desc:当前产品
+ /// Default:
+ /// Nullable:True
+ ///
+ public string product_spec { get; set; }
+
+ ///
+ /// Desc:产线id
+ /// Default:
+ /// Nullable:False
+ ///
+ [SugarColumn(IsPrimaryKey = true)]
+ public string id { get; set; }
+
+ ///
+ /// Desc:产线代码
+ /// Default:
+ /// Nullable:True
+ ///
+ public string workline_code { get; set; }
+
+ ///
+ /// Desc:工单代码
+ /// Default:
+ /// Nullable:True
+ ///
+ public string mo_code { get; set; }
+
+ ///
+ /// Desc:模具id
+ /// Default:
+ /// Nullable:True
+ ///
+ [SugarColumn(IsPrimaryKey = true)]
+ public string mold_id { get; set; }
+
+ ///
+ /// Desc:工艺路线id
+ /// Default:
+ /// Nullable:True
+ ///
+ public string route_id { get; set; }
+
+ ///
+ /// Desc:工艺路线代码
+ /// Default:
+ /// Nullable:False
+ ///
+ public string route_code { get; set; }
+
+ ///
+ /// Desc:工序代码
+ /// Default:
+ /// Nullable:False
+ ///
+ public string process_code { get; set; }
+
+ ///
+ /// Desc:工位id
+ /// Default:
+ /// Nullable:False
+ ///
+ public string station_id { get; set; }
+
+ ///
+ /// Desc:工位代码
+ /// Default:
+ /// Nullable:False
+ ///
+ public string station_code { get; set; }
+
+ ///
+ /// Desc:需要的物料
+ /// Default:
+ /// Nullable:False
+ ///
+ public string require_material_id { get; set; }
+
+ ///
+ /// Desc:需要的物料
+ /// Default:
+ /// Nullable:False
+ ///
+ public string require_material_code { get; set; }
+
+ ///
+ /// Desc:需要的物料
+ /// Default:
+ /// Nullable:True
+ ///
+ public string require_material_name { get; set; }
+
+}
diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs
new file mode 100644
index 00000000..a32b2420
--- /dev/null
+++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs
@@ -0,0 +1,12 @@
+using Tnb.ProductionMgr.Entities.Dto;
+
+namespace Tnb.ProductionMgr.Interfaces
+{
+ ///
+ /// 工单生成
+ ///
+ public interface IWorklineCommService
+ {
+ Task GetCartonQrcode(string workline);
+ }
+}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr/WorklineCommService.cs b/ProductionMgr/Tnb.ProductionMgr/WorklineCommService.cs
new file mode 100644
index 00000000..ac7ba7c1
--- /dev/null
+++ b/ProductionMgr/Tnb.ProductionMgr/WorklineCommService.cs
@@ -0,0 +1,86 @@
+using System.Dynamic;
+using System.Reflection.Emit;
+using Aop.Api.Domain;
+using JNPF.Common.Core.Manager;
+using JNPF.Common.Enums;
+using JNPF.Common.Extension;
+using JNPF.Common.Security;
+using JNPF.DependencyInjection;
+using JNPF.DynamicApiController;
+using JNPF.Extensitions.EventBus;
+using JNPF.FriendlyException;
+using JNPF.Logging;
+using JNPF.Systems.Interfaces.System;
+using JNPF.VisualDev;
+using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
+using Mapster;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Senparc.Weixin.Work.AdvancedAPIs.MailList;
+using SqlSugar;
+using Tnb.BasicData;
+using Tnb.BasicData.Entitys.Entity;
+using Tnb.EquipMgr.Entities;
+using Tnb.ProductionMgr.Entities;
+using Tnb.ProductionMgr.Entities.Dto;
+using Tnb.ProductionMgr.Entities.Enums;
+using Tnb.ProductionMgr.Interfaces;
+
+namespace Tnb.ProductionMgr;
+
+///
+/// 产线自动化通信接口
+///
+[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 704)]
+[Route("api/produce")]
+public class WorklineCommService : IWorklineCommService, IDynamicApiController, ITransient
+{
+ private readonly ISqlSugarRepository _repository;
+ private readonly IDataBaseManager _dataBaseManager;
+ private readonly IUserManager _userManager;
+ private readonly IDictionaryDataService _dictionaryDataService;
+
+ public WorklineCommService(
+ ISqlSugarRepository repository,
+ IDataBaseManager dataBaseManager,
+ IUserManager userManager,
+ IDictionaryDataService dictionaryDataService
+ )
+ {
+ _repository = repository;
+ _dataBaseManager = dataBaseManager;
+ _userManager = userManager;
+ _dictionaryDataService = dictionaryDataService;
+ }
+
+
+
+ #region 外包装条码打印接口
+
+ ///
+ /// 获取产线当前生产的箱号条码
+ ///
+ /// 所属产线
+ ///
+ [HttpGet("get-carton-qrcode")]
+ [AllowAnonymous]
+ public async Task GetCartonQrcode(string workline)
+ {
+ var line = await _repository.GetFirstAsync(a => a.id == workline);
+ var productNo = line?.product_code;
+ //TODO 仅测试接口用
+ if (string.IsNullOrEmpty(productNo))
+ {
+ productNo = "16945" + Random.Shared.Next(0, 999999999).ToString(); //"16945155732431";
+ }
+ var pd = DateTime.Now;
+ var exp = pd.AddYears(3);
+ var lotNo = pd.ToString("yyMMddHH");
+ string tpl = "(01){0}\n(11){1}\n(17){2}\n(10){3}";
+ string qrcode = string.Format(tpl, productNo, pd.ToString("yyMM00"), exp.ToString("yyMM00"), lotNo);
+ return new { qrcode };
+ }
+
+ #endregion
+}
+
diff --git a/system/Tnb.Systems/Common/SampleService.cs b/system/Tnb.Systems/Common/SampleService.cs
index d86e1db2..1a0a5523 100644
--- a/system/Tnb.Systems/Common/SampleService.cs
+++ b/system/Tnb.Systems/Common/SampleService.cs
@@ -24,7 +24,7 @@ namespace Tnb.BasicData
///
/// 自定义开发服务示例
///
- [ApiDescriptionSettings(Tag = "ProductionMgr", Area = "production", Order = 503)]
+ [ApiDescriptionSettings(Tag = "ProductionManager", Area = "production", Order = 503)]
[Route("api/[area]/[controller]/[action]")]
[OverideVisualDev(ModelId)]
public partial class SampleService : IOverideVisualDevService, IDynamicApiController, ITransient
diff --git a/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs b/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs
index b838c767..90b5c930 100644
--- a/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs
+++ b/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs
@@ -119,7 +119,8 @@ public class FormDataParsing : ITransient
{
var len = data.ToString().Split('.').Last().Length;
if (fieldsModel.precision > len) fieldsModel.precision = len;
- conversionData = data.ToString().Substring(0, data.ToString().IndexOf(".") + (int)fieldsModel.precision);
+ conversionData = data.ToString().Substring(0, data.ToString().IndexOf(".") + (int)fieldsModel.precision + 1);//modifyby zhoukeda 20230512 增加+1
+ conversionData = data.ParseToDouble();//modifyby zhoukeda 20230512
}
else conversionData = data;
break;