jianghaiqing 1 month ago
commit 44fa80b5b4

@ -47,9 +47,16 @@ public class CodeFormSetService : IFormSetService
public DataResult<List<CodeFormSetRes>> GetListByPage(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<CodeFormSet>()
var data = query
.Where(whereList)
.Select<CodeFormSetRes>().ToQueryPage(request.PageCondition);
return data;
@ -63,15 +70,20 @@ public class CodeFormSetService : IFormSetService
public DataResult EditFormSet(CodeFormSetReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//var orgId = user.GetOrgId();
if (req.Id == 0)
{
if (tenantDb.Queryable<CodeFormSet>()
.Where(x => x.OrgId == user.OrgId && x.PermissionId == req.PermissionId && x.FormNo == req.FormNo &&x.TaskStatus == req.TaskStatus).Any())
{
return DataResult.Failed("表单设置已存在!", MultiLanguageConst.FormSetExist);
}
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
if (query
.Where(x => x.PermissionId == req.PermissionId && x.FormNo == req.FormNo && x.TaskStatus == req.TaskStatus && x.Id != req.Id).Any())
{
return DataResult.Failed("表单设置已存在!", MultiLanguageConst.FormSetExist);
}
if (req.Id == 0)
{
var data = req.Adapt<CodeFormSet>();
data.DefaultContent = req.Content;
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
@ -80,7 +92,7 @@ public class CodeFormSetService : IFormSetService
}
else
{
var info = tenantDb.Queryable<CodeFormSet>().Where(x => x.Id == req.Id).First();
var info = query.Where(x => x.Id == req.Id).First();
info = req.Adapt(info);
@ -97,7 +109,14 @@ public class CodeFormSetService : IFormSetService
public DataResult<CodeFormSetRes> GetFormSetInfo(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodeFormSet>()
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var data = query
.Where(x => x.Id == long.Parse(id) && x.Status == StatusEnum.Enable)
.Select<CodeFormSetRes>()
.First();
@ -157,7 +176,14 @@ public class CodeFormSetService : IFormSetService
public async Task<DataResult<List<CodeFormSetRes>>> GetFormSetListByModule(string permissionId)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = await tenantDb.Queryable<CodeFormSet>()
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var data = await query
.Where(x => x.PermissionId == long.Parse(permissionId) && x.Status == StatusEnum.Enable)
.Select<CodeFormSetRes>()
.ToListAsync();
@ -167,7 +193,14 @@ public class CodeFormSetService : IFormSetService
public DataResult BatchDelFormSet(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<CodeFormSet>().Where(x => req.Ids.Contains(x.Id)).ToList();
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var list = query.Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
@ -182,7 +215,14 @@ public class CodeFormSetService : IFormSetService
public DataResult SetPublicFormSet(CodeFormSetPublicStatusReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = tenantDb.Queryable<CodeFormSet>().Where(x => x.Id == req.Id).First();
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var info = query.Where(x => x.Id == req.Id).First();
if (info.IsNull())
{
@ -204,7 +244,14 @@ public class CodeFormSetService : IFormSetService
public async Task<DataResult> FormSetCopy(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = await tenantDb.Queryable<CodeFormSet>().Where(x => x.Id == long.Parse(id)).FirstAsync();
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var info = await query.Where(x => x.Id == long.Parse(id)).FirstAsync();
var data = info.Adapt<CodeFormSet>();
data.Id = 0;

@ -7,6 +7,7 @@ using DS.Module.UserModule;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.Cargoo;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Sys.Entity;
@ -610,6 +611,14 @@ namespace DS.WMS.Core.Op.Method
if (!res.Succeeded)
return await Task.FromResult(DataResult.Failed(res.Message));
// 订舱完成推送Cargoo
var cargooService = _serviceProvider.GetRequiredService<ICargooService>();
await cargooService.SendCargoo(new CargooShipmentReqDto()
{
bookingId = task.BusinessId,
cargooStatusEnum = CargooStatusEnum.Confirmed
});
return DataResult.Success;
}

@ -50,7 +50,7 @@ public partial class SeaExportService : ISeaExportService
private readonly ISysCacheService _sysCacheService;
private readonly IRabbitMQService _rabbitMQService;
private readonly IRedisService _redisBaseService;
private readonly IBookingSlotService _bookingSlotService;
//private readonly IBookingSlotService _bookingSlotService;
private readonly Lazy<ITaskManageBaseService> _taskManageBaseService;
@ -88,7 +88,7 @@ public partial class SeaExportService : ISeaExportService
_configService = _serviceProvider.GetRequiredService<IConfigService>();
_rabbitMQService = _serviceProvider.GetRequiredService<IRabbitMQService>();
_redisBaseService = _serviceProvider.GetRequiredService<IRedisService>();
_bookingSlotService = _serviceProvider.GetRequiredService<IBookingSlotService>();
//_bookingSlotService = _serviceProvider.GetRequiredService<IBookingSlotService>();
_taskManageBaseService = _serviceProvider.GetRequiredService<Lazy<ITaskManageBaseService>>();
@ -503,19 +503,19 @@ public partial class SeaExportService : ISeaExportService
//return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
await tenantDb.Ado.CommitTranAsync();
//保存会同步舱位
await _bookingSlotService.SyncBookingOrderToSlot(new BookingOrderToSlotDto {
BookingId = info.Id,
CustomerId = info.CustomerId,
CustomerName = info.CustomerName,
CustomerNo = info.CustomerNo,
DocId = info.Doc,
DocName = info.DocName,
SaleId = info.SaleId,
SaleName = info.Sale,
OpId = info.OperatorId,
OpName = info.OperatorName
});
////保存会同步舱位
//await _bookingSlotService.SyncBookingOrderToSlot(new BookingOrderToSlotDto {
// BookingId = info.Id,
// CustomerId = info.CustomerId,
// CustomerName = info.CustomerName,
// CustomerNo = info.CustomerNo,
// DocId = info.Doc,
// DocName = info.DocName,
// SaleId = info.SaleId,
// SaleName = info.Sale,
// OpId = info.OperatorId,
// OpName = info.OperatorName
//});
return await Task.FromResult(DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess));
}

@ -1,5 +1,6 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.Cargoo;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.TaskInteraction.Dtos;
using Microsoft.Extensions.DependencyInjection;
@ -49,6 +50,14 @@ namespace DS.WMS.Core.TaskInteraction.Method.ActionExecutor.Booking
var task = context.TaskInfo;
task.TaskType = TaskBaseTypeEnum.WAIT_BOOKING;
await SetTaskCompleteAsync(task, TaskService, LogService);
// 订舱完成推送Cargoo
var cargooService = context.ServiceProvider.GetRequiredService<ICargooService>();
await cargooService.SendCargoo(new CargooShipmentReqDto()
{
bookingId = task.BusinessId,
cargooStatusEnum = CargooStatusEnum.Confirmed
});
}
}
}

@ -1,4 +1,6 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos.Cargoo;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.TaskInteraction.Dtos;
using DS.WMS.Core.TaskInteraction.Entity;
using DS.WMS.Core.TaskInteraction.Interface;
@ -77,6 +79,14 @@ namespace DS.WMS.Core.TaskInteraction.Method.ActionExecutor.Booking
var task = context.TaskInfo;
task.TaskType = TaskBaseTypeEnum.WAIT_BOOKING;
await SetTaskCompleteAsync(task, TaskService, LogService);
// 订舱完成推送Cargoo
var cargooService = context.ServiceProvider.GetRequiredService<ICargooService>();
await cargooService.SendCargoo(new CargooShipmentReqDto()
{
bookingId = task.BusinessId,
cargooStatusEnum = CargooStatusEnum.Confirmed
});
}
}

Loading…
Cancel
Save