Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Tnb.BasicData.Entities;
|
||||
|
||||
@@ -42,7 +43,8 @@ public partial class BasLocation : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 是否使用
|
||||
/// </summary>
|
||||
public string is_use { get; set; } = string.Empty;
|
||||
[SugarColumn(ColumnDataType = "varchar(1)", SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public int is_use { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否最小
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipRepairRefuseInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string reason { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
52
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairRefuse.cs
Normal file
52
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairRefuse.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备维修拒绝表
|
||||
/// </summary>
|
||||
[SugarTable("eqp_repair_refuse")]
|
||||
public partial class EqpRepairRefuse : BaseEntity<string>
|
||||
{
|
||||
public EqpRepairRefuse()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId();
|
||||
}
|
||||
/// <summary>
|
||||
/// 拒绝理由
|
||||
/// </summary>
|
||||
public string reason { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 报修id
|
||||
/// </summary>
|
||||
public string repair_apply_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// </summary>
|
||||
public string? create_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? create_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属组织
|
||||
/// </summary>
|
||||
public string? org_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 流程任务Id
|
||||
/// </summary>
|
||||
public string? f_flowtaskid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 流程引擎Id
|
||||
/// </summary>
|
||||
public string? f_flowid { get; set; }
|
||||
|
||||
}
|
||||
15
EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairRefuseService.cs
Normal file
15
EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairRefuseService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Tnb.EquipMgr.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 维修拒绝服务
|
||||
/// </summary>
|
||||
public interface IEqpRepairRefuseService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据维修id获取拒绝列表
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
/// <returns></returns>
|
||||
public Task<dynamic> GetRepairRefuseByRepairApplyId(Dictionary<string, string> dic);
|
||||
}
|
||||
}
|
||||
@@ -82,10 +82,25 @@ namespace Tnb.EquipMgr
|
||||
public async Task<string> Refuse(Dictionary<string, string> dic)
|
||||
{
|
||||
string id = dic["id"];
|
||||
await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
string reason = dic["reason"];
|
||||
var db = _repository.AsSugarClient();
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
status = RepairApplyStatus.REFUSE,
|
||||
}, x => x.id == id);
|
||||
await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
{
|
||||
status = RepairApplyStatus.REFUSE,
|
||||
}, x => x.id == id);
|
||||
EqpRepairRefuse eqpRepairRefuse = new EqpRepairRefuse()
|
||||
{
|
||||
repair_apply_id = id,
|
||||
reason = reason,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
org_id = _userManager.GetUserInfo().Result.organizeId
|
||||
};
|
||||
await db.Insertable<EqpRepairRefuse>(eqpRepairRefuse).ExecuteCommandAsync();
|
||||
});
|
||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
return "拒绝成功";
|
||||
}
|
||||
|
||||
|
||||
36
EquipMgr/Tnb.EquipMgr/EqpRepairRefuseService.cs
Normal file
36
EquipMgr/Tnb.EquipMgr/EqpRepairRefuseService.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备维修拒绝
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
public class EqpRepairRefuseService : IEqpRepairRefuseService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<EqpRepairRefuse> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
public EqpRepairRefuseService(ISqlSugarRepository<EqpRepairRefuse> repository,
|
||||
IUserManager userManager)
|
||||
{
|
||||
_repository = repository;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetRepairRefuseByRepairApplyId(Dictionary<string, string> dic)
|
||||
{
|
||||
string repairApplyId = dic["repairApplyId"];
|
||||
return await _repository.GetListAsync(x => x.repair_apply_id == repairApplyId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器人回调操作输入参数s
|
||||
/// </summary>
|
||||
public class RobotCallBackInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主载具Id
|
||||
/// </summary>
|
||||
public string carry_id { get; set; }
|
||||
/// <summary>
|
||||
/// 主载具编号
|
||||
/// </summary>
|
||||
public string carry_code { get; set; }
|
||||
/// <summary>
|
||||
/// 子载具ID
|
||||
/// </summary>
|
||||
public string membercarry_id { get; set; }
|
||||
/// <summary>
|
||||
/// 子载具编号
|
||||
/// </summary>
|
||||
public string membercarry_code { get; set; }
|
||||
/// <summary>
|
||||
/// 方向
|
||||
/// </summary>
|
||||
public int direction { get; set; }
|
||||
/// <summary>
|
||||
/// 是否最后一个
|
||||
/// </summary>
|
||||
public bool isLast { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -210,7 +210,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpGet]
|
||||
public async Task<List<BasLocation>> InStockStrategy([FromQuery] InStockStrategyQuery input)
|
||||
{
|
||||
var items = await _db.Queryable<BasLocation>().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_use == "0" && it.is_type == "0").OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
|
||||
var items = await _db.Queryable<BasLocation>().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_use == (int)EnumCarryStatus.空闲 && it.is_type == "0").OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
|
||||
return items.Take(input.Size).ToList();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -399,7 +399,7 @@ namespace Tnb.WarehouseMgr
|
||||
//更新起始库位,状态改为空闲、锁定状态,未锁定
|
||||
if (startLocationIds?.Count > 0)
|
||||
{
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = "0", is_lock = 0 }).Where(it => startLocationIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = (int)EnumCarryStatus.空闲, is_lock = 0 }).Where(it => startLocationIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
@@ -450,7 +450,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
carryStatus = (int)EnumCarryStatus.空闲;
|
||||
}
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = carryStatus.ToString(), is_lock = 0 }).Where(it => it.id == multis[i].endlocation_id).ExecuteCommandAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = carryStatus, is_lock = 0 }).Where(it => it.id == multis[i].endlocation_id).ExecuteCommandAsync();
|
||||
}
|
||||
//更新业务主表的单据状态
|
||||
if (disTasks?.Count > 0)
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Tnb.WarehouseMgr
|
||||
_billRullService = billRullService;
|
||||
OverideFuncs.CreateAsync = CarryBind;
|
||||
}
|
||||
|
||||
|
||||
private async Task<dynamic> CarryBind(VisualDevModelDataCrInput input)
|
||||
{
|
||||
var isOk = false;
|
||||
@@ -127,6 +127,19 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 机器人回调操作
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task RobotCallBack()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* public override async Task ModifyAsync(WareHouseUpInput input)
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Tnb.WarehouseMgr
|
||||
})
|
||||
.Mapper(it => it.material_name = dicMaterial.ContainsKey(it.material_id) ? dicMaterial[it.material_id].ToString()! : "")
|
||||
.ToListAsync();
|
||||
return items;
|
||||
return items ?? Enumerable.Empty<dynamic>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ namespace Tnb.WarehouseMgr
|
||||
/// 空载具出库
|
||||
/// </summary>
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSEMPTYOUTSTKPDA_ID)]
|
||||
|
||||
[ServiceModule(BizTypeId)]
|
||||
public class WmsPDAEmptyOutstockService : BaseWareHouseService, IPdaStroage
|
||||
{
|
||||
private const string BizTypeId = "26121986416677";
|
||||
private const string BizTypeId = "26475845405733";
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create(orgId)).ExecuteCommandAsync();
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { carry_code = input.data[nameof(WmsCarryH.carry_code)].ToString()!, is_lock = 1, carry_status = (int)EnumCarryStatus.占用, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1, is_use = "1" });
|
||||
it => new BasLocation { is_lock = 1, is_use = (int)EnumCarryStatus.占用 });
|
||||
if (instockCOdes?.Count > 0)
|
||||
{
|
||||
await _db.Updateable<WmsInstockD>().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCOdes.Select(x => x.bill_d_id).Contains(it.id)).ExecuteCommandAsync();
|
||||
|
||||
@@ -4,6 +4,7 @@ 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.Common.Security;
|
||||
using JNPF.FriendlyException;
|
||||
@@ -14,6 +15,7 @@ using NPOI.SS.Formula;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
@@ -24,12 +26,14 @@ namespace Tnb.WarehouseMgr
|
||||
/// <summary>
|
||||
/// 齐套分拣服务类
|
||||
/// </summary>
|
||||
[ServiceModule(BizTypeId)]
|
||||
public class WmsSetSortingService : BaseWareHouseService
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IUserManager _userManager;
|
||||
private const string BizTypeId = "26172520979237";
|
||||
|
||||
public WmsSetSortingService(ISqlSugarRepository<WmsSetsortingH> repository, IWareHouseService wareHouseService, IUserManager userManager, IBillRullService billRullService)
|
||||
{
|
||||
@@ -124,7 +128,7 @@ namespace Tnb.WarehouseMgr
|
||||
GenPreTaskUpInput genPreTaskAfterUpInput = new();
|
||||
genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList();
|
||||
genPreTaskAfterUpInput.LocationIds = new HashSet<string>(locIds).ToList();
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1, carry_status = (int)EnumCarryStatus.齐套分拣 }, it => new BasLocation { is_use = ((int)EnumCarryStatus.齐套分拣).ToString() });
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1, carry_status = (int)EnumCarryStatus.齐套分拣 }, it => new BasLocation { is_use = (int)EnumCarryStatus.齐套分拣 });
|
||||
}
|
||||
|
||||
}
|
||||
@@ -186,10 +190,25 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
|
||||
|
||||
public override Task ModifyAsync(WareHouseUpInput input)
|
||||
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
//根据载具更新明细表状态
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { carry_status = (int)EnumCarryStatus.齐套, location_id = "", location_code = "" }).ExecuteCommandAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = (int)EnumCarryStatus.空闲 }).ExecuteCommandAsync();
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
@@ -80,10 +81,12 @@ namespace Tnb.WarehouseMgr
|
||||
break;
|
||||
}
|
||||
}
|
||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
|
||||
loc.is_use = (int)EnumCarryStatus.空闲;
|
||||
await _db.Updateable(loc).UpdateColumns(it => it.is_use).ExecuteCommandAsync();
|
||||
WareHouseUpInput upInput = new() { bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List<string> { input.carryId } };
|
||||
await DoUpdate(upInput); //回更业务
|
||||
}
|
||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
|
||||
loc.is_use = "0";
|
||||
await _db.Updateable(loc).UpdateColumns(it => it.is_use).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Tnb.WarehouseMgr
|
||||
var grpList = kittingOuts.GroupBy(g => g.location_id).ToList();
|
||||
foreach (var koGrp in grpList)
|
||||
{
|
||||
var locs = await _db.Queryable<BasLocation>().Where(it => it.id == koGrp.Key && it.is_use == "0" && it.is_lock == 0).ToListAsync();
|
||||
var locs = await _db.Queryable<BasLocation>().Where(it => it.id == koGrp.Key && it.is_use == (int)EnumCarryStatus.空闲 && it.is_lock == 0).ToListAsync();
|
||||
if (locs?.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user