1
This commit is contained in:
@@ -1041,23 +1041,23 @@ namespace Tnb.ProductionMgr
|
||||
var list = await db.Queryable<PrdMoTask>().Where(it => input.TaskIds.Contains(it.id)).Select(it => it).ToListAsync();
|
||||
if (behavior == PrdTaskBehavior.Compled)
|
||||
{
|
||||
if (list?.Count > 0)
|
||||
{
|
||||
// var schedQtySum = list.Sum(x => x.scheduled_qty);
|
||||
// var planQtySum = list.Sum(x => x.plan_qty);
|
||||
// if (schedQtySum < planQtySum)
|
||||
// {
|
||||
// throw new AppFriendlyException("任务数量必须大于等于生产计划数量,才可完成", 500);
|
||||
// }
|
||||
|
||||
int reportedWorkQty = list.Sum(x => x.reported_work_qty) ?? 0;
|
||||
int scrapQty = list.Sum(x => x.scrap_qty) ?? 0;
|
||||
int scheduledQty = list.Sum(x => x.scheduled_qty) ?? 0;
|
||||
if (scheduledQty >= reportedWorkQty+scrapQty)
|
||||
{
|
||||
throw new AppFriendlyException("已完成数量大于等于任务单数量,才可完成", 500);
|
||||
}
|
||||
}
|
||||
// if (list?.Count > 0)
|
||||
// {
|
||||
// // var schedQtySum = list.Sum(x => x.scheduled_qty);
|
||||
// // var planQtySum = list.Sum(x => x.plan_qty);
|
||||
// // if (schedQtySum < planQtySum)
|
||||
// // {
|
||||
// // throw new AppFriendlyException("任务数量必须大于等于生产计划数量,才可完成", 500);
|
||||
// // }
|
||||
//
|
||||
// int reportedWorkQty = list.Sum(x => x.last_process_complete_qty) ?? 0;
|
||||
// int scrapQty = list.Sum(x => x.scrap_qty) ?? 0;
|
||||
// int scheduledQty = list.Sum(x => x.scheduled_qty) ?? 0;
|
||||
// if (scheduledQty >= reportedWorkQty+scrapQty)
|
||||
// {
|
||||
// throw new AppFriendlyException("已完成数量大于等于任务单数量,才可完成", 500);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
var taskReportLogs = new List<PrdMoTask>();
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
{
|
||||
public class ConfirmInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务链编号
|
||||
/// </summary>
|
||||
public string taskChainCode { get; set; }
|
||||
/// <summary>
|
||||
/// 子任务编号
|
||||
/// </summary>
|
||||
public string taskCode { get; set; }
|
||||
/// <summary>
|
||||
/// 起点编号
|
||||
/// </summary>
|
||||
public string sourceName { get; set; }
|
||||
/// <summary>
|
||||
/// 终点编号
|
||||
/// </summary>
|
||||
public string targetName { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
{
|
||||
public class TaskCallBackInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务链编号
|
||||
/// </summary>
|
||||
public string taskChainCode { get; set; }
|
||||
/// <summary>
|
||||
/// 任务链编号
|
||||
/// </summary>
|
||||
public string taskCode { get; set; }
|
||||
/// <summary>
|
||||
/// 起点编号
|
||||
/// </summary>
|
||||
public string sourceName { get; set; }
|
||||
/// <summary>
|
||||
/// 终点编号
|
||||
/// </summary>
|
||||
public string targetName { get; set; }
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public string status { get; set; }
|
||||
/// <summary>
|
||||
/// 取货/放货
|
||||
/// </summary>
|
||||
public string action { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
{
|
||||
public class TaskChainCallBackInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务链编号
|
||||
/// </summary>
|
||||
public string taskChainCode { get; set; }
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public string status { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -54,5 +54,18 @@ namespace Tnb.WarehouseMgr.Interfaces
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task TaskComplate(TaskCompleUpInput input);
|
||||
/// <summary>
|
||||
/// 任务执行
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task TaskExecute(TaskExecuteUpInput input);
|
||||
/// <summary>
|
||||
/// 任务执行取操作返回(后续操作)
|
||||
/// </summary>
|
||||
/// /// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task TaskExecuteAfter(TaskExecuteAfterUpInput input);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,21 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.OpenXmlFormats;
|
||||
using Senparc.NeuChar.ApiHandlers;
|
||||
using SqlSugar;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
|
||||
using Tnb.WarehouseMgr.Entities.Entity;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -16,6 +27,15 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
public class DeviceProviderService : BaseWareHouseService
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
|
||||
public DeviceProviderService(ISqlSugarRepository<WmsInstockH> repository, IWareHouseService wareHouseService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_wareHouseService = wareHouseService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 任务链状态上报
|
||||
/// </summary>
|
||||
@@ -25,6 +45,6 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
|
||||
return await Task.FromResult<Result>(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,6 +166,7 @@ namespace Tnb.WarehouseMgr
|
||||
var whereExp = Expressionable.Create<BasLocation>()
|
||||
.And(it => it.wh_id == input.warehouse_id)
|
||||
.And(it => it.is_lock == 0)
|
||||
.And(it => it.is_type == ((int)EnumLocationType.存储库位).ToString())
|
||||
.And(it => it.is_use == ((int)EnumCarryStatus.空闲).ToString())
|
||||
.ToExpression();
|
||||
items = await _db.Queryable<BasLocation>().Where(whereExp).OrderBy(policy.policy).ToListAsync();
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
WmsHandleH handleH = new();
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using Aop.Api.Domain;
|
||||
using System.Collections;
|
||||
using Aop.Api.Domain;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Entitys.Dto.Department;
|
||||
@@ -609,6 +611,61 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
|
||||
if (!(isOk > 0)) throw Oops.Oh(ErrorCode.D2016);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取组织扩展属性
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetFpropertyjsonById(Dictionary<string,string> dic)
|
||||
{
|
||||
string id = dic["id"];
|
||||
string type = dic["type"];
|
||||
var organizeEntity = await _repository.GetSingleAsync(x => x.Id == id);
|
||||
if (organizeEntity != null && !string.IsNullOrEmpty(organizeEntity.PropertyJson))
|
||||
{
|
||||
Dictionary<string, object> dictionary =
|
||||
JsonConvert.DeserializeObject<Dictionary<string, object>>(organizeEntity.PropertyJson);
|
||||
if (type == "1")
|
||||
{
|
||||
if (dictionary.TryGetValue("roweqp", out var value))
|
||||
{
|
||||
List<EqpEquipment> eqpEquipments = JsonConvert.DeserializeObject<List<EqpEquipment>>(JsonConvert.SerializeObject(value));
|
||||
return new Dictionary<string, object>()
|
||||
{
|
||||
["list"] = eqpEquipments.Select(x => new
|
||||
{
|
||||
id = x.id,
|
||||
code = x.code,
|
||||
name = x.name
|
||||
}).ToList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dictionary.TryGetValue("rowprocess", out var value))
|
||||
{
|
||||
List<BasProcess> processes = JsonConvert.DeserializeObject<List<BasProcess>>(JsonConvert.SerializeObject(value));
|
||||
return new Dictionary<string,object>()
|
||||
{
|
||||
["list"] = processes.Select(x=>new
|
||||
{
|
||||
id = x.id,
|
||||
code = x.process_code,
|
||||
name = x.process_name
|
||||
}).ToList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Dictionary<string,object>()
|
||||
{
|
||||
["list"] = Enumerable.Empty<int>()
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PublicMethod
|
||||
|
||||
Reference in New Issue
Block a user