diff --git a/ProductionMgr/Tnb.ProductionMgr.Entitys/Dto/PrdManage/PrdTaskOperInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entitys/Dto/PrdManage/PrdTaskOperInput.cs
index 5ee8f14d..96e358aa 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Entitys/Dto/PrdManage/PrdTaskOperInput.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Entitys/Dto/PrdManage/PrdTaskOperInput.cs
@@ -35,6 +35,10 @@ namespace Tnb.ProductionMgr.Entitys.Dto.PrdManage
/// 计划生产结束日期
///
public DateTime? plan_end_date { get; set; }
+ ///
+ /// 任务ID
+ ///
+ public string task_id { get; set; }
}
}
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entitys/Dto/PrdManage/ProductionSchedulingCrInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entitys/Dto/PrdManage/ProductionSchedulingCrInput.cs
index cf3e32a6..a57de08b 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Entitys/Dto/PrdManage/ProductionSchedulingCrInput.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Entitys/Dto/PrdManage/ProductionSchedulingCrInput.cs
@@ -79,6 +79,10 @@ namespace Tnb.ProductionMgr.Entitys.Dto.WorkOrder
/// Nullable:True
///
public string mold_id { get; set; }
+ ///
+ /// 模具编号
+ ///
+ public string mold_code { get; set; }
///
/// Desc:模具名称
@@ -93,6 +97,10 @@ namespace Tnb.ProductionMgr.Entitys.Dto.WorkOrder
/// Nullable:True
///
public string eqp_id { get; set; }
+ ///
+ /// 设备编号
+ ///
+ public string eqp_code { get; set; }
///
/// Desc:设备名称
@@ -121,6 +129,10 @@ namespace Tnb.ProductionMgr.Entitys.Dto.WorkOrder
/// Nullable:True
///
public string item_id { get; set; }
+ ///
+ /// 产品编号
+ ///
+ public string item_code { get; set; }
///
/// Desc:产品名称
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdMo.cs b/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdMo.cs
index ab91c1ef..fe118fcb 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdMo.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdMo.cs
@@ -33,7 +33,7 @@ namespace Tnb.ProductionMgr.Entitys.Entity
///
/// 产品ID
///
- public string item_id { get; set; }
+ //public string item_id { get; set; }
///
/// Desc:产品代码, BAS_MATERIA.MATERIALCODE BAS_ITEM.ITEMCODE
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs
index fbacba4b..7720a362 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs
@@ -137,29 +137,46 @@ namespace Tnb.ProductionPlanMgr
try
{
await db.Ado.BeginTranAsync();
+
row = await db.Storageable(entity).ExecuteCommandAsync();
var taskLogEntity = input.Adapt();
taskLogEntity.id ??= SnowflakeIdHelper.NextId();
+ taskLogEntity.task_id = input.id;
taskLogEntity.status ??= "ToBeStarted";
taskLogEntity.create_id = _userManager.UserId;
taskLogEntity.create_time = DateTime.Now;
taskLogEntity.operator_name = _userManager.RealName;
-
+
//任务状态变更时插入操作记录
if (!db.Queryable().Where(it => it.task_id == input.id && it.status == taskLogEntity.status).Any())
{
row = await db.Insertable(taskLogEntity).ExecuteCommandAsync();
}
+
if (row > 0)
{
- //修改工单状态为已排产,同事修改已排产数量
+ var obj = (await db.Queryable().FirstAsync(it => it.id == input.mo_id));
+ obj.input_qty += entity.scheduled_num;
+ var moStatus = "";
+ //判断,已排产数量>=计划数量时将状态改为 已完成
+ if (obj.input_qty >= obj.plan_qty)
+ {
+ moStatus = "25019252113685";
+
+ }
+ else
+ {
+ //修改工单状态为已排产,同事修改已排产数量
+ moStatus = "25019244276501";
+ }
row = await db.Updateable().SetColumns(it => new PrdMo
{
- mo_status = "25019252113685",
- input_qty = entity.scheduled_num
+ mo_status = moStatus,
+ input_qty = obj.input_qty
})
.Where(it => it.id == entity.mo_id).ExecuteCommandAsync();
}
+
await db.Ado.CommitTranAsync();
}
catch (Exception ex)
@@ -231,19 +248,20 @@ namespace Tnb.ProductionPlanMgr
///
/// 查看工单操作记录
///
- /// 操作记录查询输入参数
+ /// 任务ID
///
- [HttpGet("record/{moId}")]
- public async Task GetMoOperRecord(PrdTaskOperInput input)
+ [HttpGet("record/{taskId}")]
+ public async Task GetMoOperRecord(string taskId)
{
- var list = await _repository.AsSugarClient().Queryable().LeftJoin((a, b) => a.prd_task_id == b.id)
- .WhereIF(!string.IsNullOrWhiteSpace(input.mo_no), a => a.mo_id == input.mo_no)
- .WhereIF(!string.IsNullOrWhiteSpace(input.task_no), b => b.prd_task_id == input.task_no)
- .WhereIF(!string.IsNullOrWhiteSpace(input.item_code), a => a.item_code == input.item_code)
- .WhereIF(!string.IsNullOrWhiteSpace(input.eqp_code), a => a.eqp_type_code == input.eqp_code)
- .WhereIF(input.plan_start_date.HasValue, a => a.plan_start_date >= input.plan_start_date!.Value)
- .WhereIF(input.plan_end_date.HasValue, a => a.plan_end_date <= input.plan_end_date!.Value)
- .ToListAsync();
+ //var list = await _repository.AsSugarClient().Queryable().LeftJoin((a, b) => a.prd_task_id == b.id)
+ // .WhereIF(!string.IsNullOrWhiteSpace(input.mo_no),b=>b.id == input.task_no)
+ // .WhereIF(!string.IsNullOrWhiteSpace(input.task_no), b => b.prd_task_id == input.task_id)
+ // .WhereIF(!string.IsNullOrWhiteSpace(input.item_code), a => a.item_code == input.item_code)
+ // .WhereIF(!string.IsNullOrWhiteSpace(input.eqp_code), a => a.eqp_type_code == input.eqp_code)
+ // .WhereIF(input.plan_start_date.HasValue, a => a.plan_start_date >= input.plan_start_date!.Value)
+ // .WhereIF(input.plan_end_date.HasValue, a => a.plan_end_date <= input.plan_end_date!.Value)
+ // .ToListAsync();
+ var list = await _repository.AsSugarClient().Queryable().Where(it => it.id == taskId).ToListAsync();
var data = list.Adapt>();
var dic = await _dictionaryDataService.GetDicByTypeId("25572555259157");
_repository.AsSugarClient().ThenMapper(data, x => x.statusName = dic.ContainsKey(x.status) ? dic[x.status].ToString() : "");
diff --git a/system/Tnb.Systems/System/DictionaryDataService.cs b/system/Tnb.Systems/System/DictionaryDataService.cs
index 080fd651..6840545f 100644
--- a/system/Tnb.Systems/System/DictionaryDataService.cs
+++ b/system/Tnb.Systems/System/DictionaryDataService.cs
@@ -343,7 +343,7 @@ public class DictionaryDataService : IDictionaryDataService, IDynamicApiControll
}
public async Task> GetDicByTypeId(string typeId) =>
- await _repository.AsQueryable().Where(x => x.DictionaryTypeId == typeId).ToDictionaryAsync(x => x.EnCode, x => x.FullName);
+ await _repository.AsQueryable().Where(x => x.DictionaryTypeId == typeId && x.DeleteMark == null).ToDictionaryAsync(x => x.EnCode, x => x.FullName);
diff --git a/visualdev/Tnb.VisualDev/RunService.cs b/visualdev/Tnb.VisualDev/RunService.cs
index 65f351e4..73ee49bc 100644
--- a/visualdev/Tnb.VisualDev/RunService.cs
+++ b/visualdev/Tnb.VisualDev/RunService.cs
@@ -2919,8 +2919,12 @@ public class RunService : IRunService, ITransient
else
{
//modified by ly on 20230407
- itemValue = Regex.Match(itemValue, @"\[(.+)\]").Groups[1].Value;
- itemValue = itemValue.Trim('"');
+ if (itemValue.IsMatch(@"\[(.+)\]"))
+ {
+ itemValue = Regex.Match(itemValue, @"\[(.+)\]").Groups[1].Value;
+ itemValue = itemValue.Trim('"');
+ }
+
conModels.Add(new ConditionalCollections()
{
ConditionalList = new List>()
@@ -2939,6 +2943,7 @@ public class RunService : IRunService, ITransient
break;
default:
{
+ if (item.Value.IsNullOrEmpty()) continue;
var itemValue = item.Value.ToString().Contains("[") ? item.Value.ToJsonString() : item.Value.ToString();
if (model.searchType == 1)