whm 1 year ago
commit 6ef7704220

@ -800,10 +800,11 @@ namespace Myshipping.Application
var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync(); var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync();
var rightlist = await _right.GetDataScopeList(MenuConst.MenuBookingOrder, true); var rightlist = await _right.GetDataScopeList(MenuConst.MenuBookingOrder, true);
if (!( if (!(
mlist.OPID == UserManager.UserId.ToString() || mlist.OPID == UserManager.UserId.ToString() || mlist.OP == UserManager.Name.ToString()||
mlist.DOCID == UserManager.UserId.ToString() || mlist.DOCID == UserManager.UserId.ToString() || mlist.DOC == UserManager.Name.ToString() ||
mlist.CUSTSERVICEID == UserManager.UserId.ToString() || mlist.CUSTSERVICEID == UserManager.UserId.ToString() || mlist.CUSTSERVICE == UserManager.Name.ToString() ||
mlist.ROUTEID == UserManager.UserId.ToString() || UserManager.UserId == 400234750476357 || mlist.ROUTEID == UserManager.UserId.ToString() || mlist.ROUTE == UserManager.Name.ToString() ||
UserManager.UserId == 400234750476357 ||
mlist.CreatedUserId.ToString() == UserManager.UserId.ToString() || mlist.CreatedUserId.ToString() == UserManager.UserId.ToString() ||
rightlist.Contains((long)mlist.CreatedUserId) rightlist.Contains((long)mlist.CreatedUserId)
)) ))

@ -26,8 +26,8 @@ namespace Myshipping.Application
private readonly ISysCacheService _sysCacheService; private readonly ISysCacheService _sysCacheService;
private readonly IBookingOrderService _bookingorderservice; private readonly IBookingOrderService _bookingorderservice;
private readonly SqlSugarRepository<BookingOrder> _order; private readonly SqlSugarRepository<BookingOrder> _order;
private readonly ILogger<DataSyncService> _logger; private readonly ILogger<BookingVesselInfoService> _logger;
public BookingVesselInfoService(SqlSugarRepository<DjyVesselInfo> rep, ILogger<DataSyncService> logger, SqlSugarRepository<BookingOrder> order,ISysCacheService sysCacheService,IBookingOrderService bookingorderservice) public BookingVesselInfoService(SqlSugarRepository<DjyVesselInfo> rep, ILogger<BookingVesselInfoService> logger, SqlSugarRepository<BookingOrder> order,ISysCacheService sysCacheService,IBookingOrderService bookingorderservice)
{ {
_sysCacheService = sysCacheService; _sysCacheService = sysCacheService;
_rep = rep; _rep = rep;

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 派车任务台账保存
/// </summary>
public class TruckPageDto
{
/// <summary>
/// 任务主键
/// </summary>
public string TaskPKId { get; set; }
/// <summary>
/// 车队ID
/// </summary>
public Nullable<long> TruckId { get; set; }
/// <summary>
/// 车队代码
/// </summary>
public string TruckCode { get; set; }
/// <summary>
/// 车队代码
/// </summary>
public string TruckName { get; set; }
}
}

@ -1369,5 +1369,57 @@ namespace Myshipping.Application
return rtn; return rtn;
} }
/// <summary>
/// 派车任务台账保存
/// </summary>
/// <param name="model">请求详情</param>
/// <returns>返回回执</returns>
[HttpPost("/TaskManageTruck/SaveTruckByPage")]
public async Task<TaskManageOrderResultDto> SaveTruckByPage([FromBody] TruckPageDto model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
var entity = _taskTruckRepository.AsQueryable().First(a => a.TASK_ID == model.TaskPKId);
if (model == null)
throw Oops.Oh($"派车信息获取失败,派车信息不存在或已作废");
//校验
ValidateTruck(OperateTypeEnum.Save, new TaskTruckInfo[] { entity });
entity.TruckId = model.TruckId;
entity.TruckCode = model.TruckCode;
entity.TruckName = model.TruckName;
entity.UpdatedTime = DateTime.Now;
entity.UpdatedUserId = UserManager.UserId;
entity.UpdatedUserName = UserManager.Name;
//更新
await _taskTruckRepository.AsUpdateable(entity).UpdateColumns(it => new
{
it.TruckId,
it.TruckCode,
it.TruckName,
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName
}).ExecuteCommandAsync();
result.succ = true;
result.msg = "保存成功";
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"{ex.Message}";
}
return result;
}
} }
} }

Loading…
Cancel
Save