From 310ee36f3cab05913f0f6221fb4b5c28235de532 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 18 Jul 2023 17:05:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B4=BE=E8=BD=A6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8F=B0=E8=B4=A6=E4=BF=9D=E5=AD=98=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/Dtos/Truck/TruckPageDto.cs | 32 ++++++++++++ .../TaskManagePlat/TaskManageTruckService.cs | 52 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TruckPageDto.cs diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TruckPageDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TruckPageDto.cs new file mode 100644 index 00000000..100e3d50 --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TruckPageDto.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// 派车任务台账保存 + /// + public class TruckPageDto + { + /// + /// 任务主键 + /// + public string TaskPKId { get; set; } + + /// + /// 车队ID + /// + public Nullable TruckId { get; set; } + /// + /// 车队代码 + /// + public string TruckCode { get; set; } + /// + /// 车队代码 + /// + public string TruckName { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageTruckService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageTruckService.cs index d3f844fc..45c2c882 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageTruckService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageTruckService.cs @@ -1369,5 +1369,57 @@ namespace Myshipping.Application return rtn; } + /// + /// 派车任务台账保存 + /// + /// 请求详情 + /// 返回回执 + [HttpPost("/TaskManageTruck/SaveTruckByPage")] + public async Task 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; + } + } } From 635cfcf6e4c6ba961fb6a6a29444708968333e41 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 18 Jul 2023 17:35:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 9 +++++---- .../BookingVesselInfo/BookingVesselInfoService.cs | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 53262c4c..efd4a586 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -800,10 +800,11 @@ namespace Myshipping.Application var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync(); var rightlist = await _right.GetDataScopeList(MenuConst.MenuBookingOrder, true); if (!( - mlist.OPID == UserManager.UserId.ToString() || - mlist.DOCID == UserManager.UserId.ToString() || - mlist.CUSTSERVICEID == UserManager.UserId.ToString() || - mlist.ROUTEID == UserManager.UserId.ToString() || UserManager.UserId == 400234750476357 || + mlist.OPID == UserManager.UserId.ToString() || mlist.OP == UserManager.Name.ToString()|| + mlist.DOCID == UserManager.UserId.ToString() || mlist.DOC == UserManager.Name.ToString() || + mlist.CUSTSERVICEID == UserManager.UserId.ToString() || mlist.CUSTSERVICE == UserManager.Name.ToString() || + mlist.ROUTEID == UserManager.UserId.ToString() || mlist.ROUTE == UserManager.Name.ToString() || + UserManager.UserId == 400234750476357 || mlist.CreatedUserId.ToString() == UserManager.UserId.ToString() || rightlist.Contains((long)mlist.CreatedUserId) )) diff --git a/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs b/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs index 0cc5ef4d..49d3dd4f 100644 --- a/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs +++ b/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs @@ -26,8 +26,8 @@ namespace Myshipping.Application private readonly ISysCacheService _sysCacheService; private readonly IBookingOrderService _bookingorderservice; private readonly SqlSugarRepository _order; - private readonly ILogger _logger; - public BookingVesselInfoService(SqlSugarRepository rep, ILogger logger, SqlSugarRepository order,ISysCacheService sysCacheService,IBookingOrderService bookingorderservice) + private readonly ILogger _logger; + public BookingVesselInfoService(SqlSugarRepository rep, ILogger logger, SqlSugarRepository order,ISysCacheService sysCacheService,IBookingOrderService bookingorderservice) { _sysCacheService = sysCacheService; _rep = rep;