diff --git a/BasicData/Tnb.BasicData.Entities/Consts/FactoryConfigConst.cs b/BasicData/Tnb.BasicData.Entities/Consts/FactoryConfigConst.cs
new file mode 100644
index 00000000..9b46621b
--- /dev/null
+++ b/BasicData/Tnb.BasicData.Entities/Consts/FactoryConfigConst.cs
@@ -0,0 +1,18 @@
+namespace Tnb.BasicData
+{
+ ///
+ /// 工厂基础数据
+ ///
+ public static class FactoryConfigConst
+ {
+ ///
+ /// 报工是否允许超过工单计划数 是:1 否 :0
+ ///
+ public const string IS_SURPASS = "is_surpass";
+
+ ///
+ /// 报工允许超过工单计划数百分比 例:填写10就是10%
+ ///
+ public const string IS_SURPASS_PERCENTAGE = "is_surpass_percentage";
+ }
+}
\ No newline at end of file
diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasFactoryConfig.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasFactoryConfig.cs
new file mode 100644
index 00000000..96972c47
--- /dev/null
+++ b/BasicData/Tnb.BasicData.Entities/Entity/BasFactoryConfig.cs
@@ -0,0 +1,87 @@
+using JNPF.Common.Contracts;
+using JNPF.Common.Security;
+using SqlSugar;
+
+namespace Tnb.BasicData.Entities;
+
+///
+/// 工厂基础数据
+///
+[SugarTable("bas_factory_config")]
+public partial class BasFactoryConfig : BaseEntity
+{
+ public BasFactoryConfig()
+ {
+ id = SnowflakeIdHelper.NextId();
+ }
+ ///
+ /// 名称
+ ///
+ public string name { get; set; } = string.Empty;
+
+ ///
+ /// key
+ ///
+ public string key { get; set; } = string.Empty;
+
+ ///
+ /// 值
+ ///
+ public string value { get; set; } = string.Empty;
+
+ ///
+ /// 是否启用
+ ///
+ public int enabled { get; set; }
+
+ ///
+ /// 备注
+ ///
+ public string? remark { get; set; }
+
+ ///
+ /// 创建用户
+ ///
+ public string? create_id { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public DateTime? create_time { get; set; }
+
+ ///
+ /// 修改用户
+ ///
+ public string? modify_id { get; set; }
+
+ ///
+ /// 修改时间
+ ///
+ public DateTime? modify_time { get; set; }
+
+ ///
+ /// 所属组织
+ ///
+ public string? org_id { get; set; }
+
+ ///
+ /// 排序
+ ///
+ public long? ordinal { get; set; }
+
+ ///
+ /// 是否系统
+ ///
+ public int? is_system { get; set; }
+
+ ///
+ /// 流程任务Id
+ ///
+ public string? f_flowtaskid { get; set; }
+
+ ///
+ /// 流程引擎Id
+ ///
+ public string? f_flowid { get; set; }
+
+}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockD.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockD.cs
index 04c6db66..dcbe0c55 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockD.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockD.cs
@@ -53,5 +53,10 @@ public partial class PrdInstockD : BaseEntity
/// 生产提报id
///
public string report_id { get; set; } = string.Empty;
+
+ ///
+ /// 生产任务单号
+ ///
+ public string mo_task_code { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs
index 165b087b..02c93dd0 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs
@@ -1361,6 +1361,26 @@ namespace Tnb.ProductionMgr
throw Oops.Bah("暂停的任务单无法提报");
}
+ if ((prdMoTask.reported_work_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty)
+ {
+ var config1 = await db.Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.IS_SURPASS);
+ if (config1?.value == "1")
+ {
+ var config2 = await db.Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.IS_SURPASS_PERCENTAGE);
+ if (!string.IsNullOrEmpty(config2?.value))
+ {
+ if ((prdMoTask.reported_work_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty*(100+Convert.ToDecimal(config2?.value ?? "1"))/100)
+ {
+ throw Oops.Bah($"提报数量不能大于{100+Convert.ToDecimal(config2?.value ?? "0")}%排产数量");
+ }
+ }
+ }
+ else
+ {
+ throw Oops.Bah("提报数量不能大于排产数量");
+ }
+ }
+
// bool flag = (prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty == prdMoTask.scheduled_qty;
// if ((prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty)
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs
index 9122cf9b..3dfa04c8 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs
@@ -562,11 +562,11 @@ namespace Tnb.WarehouseMgr
if (curEleDs?.Count > 0)
{
//当前电梯
- var curEle = await _db.Queryable().SingleAsync(it => it.id == curEleDs.First().bill_id);
+ var curEle = await _db.Queryable().SingleAsync(it => it.id == curEleDs.First().bill_id && it.status == 1) ?? throw new AppFriendlyException("电梯被禁用", 500);
//同电梯组电梯
- var sGpEle = await _db.Queryable().Where(it => it.elevator_group == curEle.elevator_group && it.id != curEle.id).ToListAsync();
+ var sGpEle = await _db.Queryable().Where(it => it.elevator_group == curEle.elevator_group && it.id != curEle.id && it.status == 1).ToListAsync();
//判断电梯组中各电梯任务数
- if (sGpEle.FindAll(x => x.task_nums < curEle.task_nums)?.Count > 0)
+ if (sGpEle.FindAll(x => Math.Abs(x.task_nums - curEle.task_nums) % 2 == 1)?.Count > 0)
{
var sGpDs = await _db.Queryable().Where(it => it.bill_id == sGpEle.First().id).ToListAsync();
if (sGpDs?.Count > 0)