jianghaiqing 6 months ago
commit f2d49379b6

@ -201,5 +201,15 @@ namespace Myshipping.Application.Entity
/// 大简云用户Id
/// </summary>
public string DJYUserId { get; set; }
}
/// <summary>
/// 平台代码
/// </summary>
public string SYSTEM_CODE { get; set; }
/// <summary>
/// 平台名称
/// </summary>
public string SYSTEM_NAME { get; set; }
}
}

@ -1670,9 +1670,9 @@ namespace Myshipping.Application
}
else
{
custOrder.PORTDISCHARGEID = portLoad.EdiCode;
custOrder.PORTDISCHARGE = portLoad.EnName;
custOrder.PORTDISCHARGECODE = portLoad.Code;
custOrder.PORTDISCHARGEID = portDest.EdiCode;
custOrder.PORTDISCHARGE = portDest.EnName;
custOrder.PORTDISCHARGECODE = portDest.Code;
}
var destina = data.Rows[idx]["交货地"].ToString();
@ -1683,9 +1683,9 @@ namespace Myshipping.Application
}
else
{
custOrder.DESTINATIONID = portLoad.EdiCode;
custOrder.DESTINATION = portLoad.EnName;
custOrder.DESTINATIONCODE = portLoad.Code;
custOrder.DESTINATIONID = destinaFind.EdiCode;
custOrder.DESTINATION = destinaFind.EnName;
custOrder.DESTINATIONCODE = destinaFind.Code;
}
//var cargoId = data.Rows[idx]["货物类型"].ToString();

@ -0,0 +1,60 @@
using Myshipping.Application.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Service.TaskManagePlat.Dtos
{
public class GetTaskBaseOutModel: TaskBaseInfoDto
{
/// <summary>
/// 任务BC
/// </summary>
public TaskBCInfo BCModel { get; set; }
/// <summary>
/// 任务截单回执
/// </summary>
public TaskSISubmitted TaskSISubmitted { get; set; }
/// <summary>
/// 任务单票账单
/// </summary>
public TaskPerBillBaseInfo TaskPerBillBaseInfo { get; set; }
/// <summary>
/// 派车任务
/// </summary>
public TaskTruckInfo TaskTruckInfo { get; set; }
/// <summary>
/// 任务截止时间变更通知
/// </summary>
public TaskCutDateChangeInfo TaskCutDateChangeInfo { get; set; }
/// <summary>
/// 任务预甩货通知
/// </summary>
public TaskRollingNominationInfo TaskRollingNominationInfo { get; set; }
/// <summary>
/// 任务格式单
/// </summary>
public TaskDraftInfo TaskDraftInfo { get; set; }
/// <summary>
/// 任务目的港未提货未返箱
/// </summary>
public TaskPODDischargeGateoutFullInfo TaskPODDischargeGateoutFullInfo { get; set; }
/// <summary>
/// 重要任务提醒
/// </summary>
public TaskCautionNoticeInfo TaskCautionNoticeInfo { get; set; }
/// <summary>
/// 航线船舶截止时间调整的通知
/// </summary>
public TaskRouteChangeAdvisoryInfo TaskRouteChangeAdvisoryInfo { get; set; }
}
}

@ -1182,6 +1182,48 @@ namespace Myshipping.Application
.Map(dest => dest.CY_CUT_DATE, src => src.CYCutDate)
.Map(dest => dest.ROUTE_CODE, src => src.RouteCode)
.Map(dest => dest.EMAIL_SUBJECT, src => src.MailSubject);
config.ForType<TaskBaseInfo, GetTaskBaseOutModel>()
.Map(dest => dest.PKId, src => src.PK_ID??"")
.Map(dest => dest.TaskNo, src => src.TASK_NO??"")
.Map(dest => dest.TaskType, src => src.TASK_TYPE??"")
.Map(dest => dest.TaskSource, src => src.TASK_SOURCE??"")
.Map(dest => dest.Status, src => src.STATUS??"")
.Map(dest => dest.StatusName, src => src.STATUS_NAME??"")
.Map(dest => dest.TaskTitle, src => src.TASK_TITLE??"")
.Map(dest => dest.TaskDesp, src => src.TASK_DESP??"")
.Map(dest => dest.OutBusiNo, src => src.OUT_BUSI_NO??"")
.Map(dest => dest.OutBusiType, src => src.OUT_BUSI_TYPE??"")
.Map(dest => dest.CarrierId, src => src.CARRIER_ID??"")
.Map(dest => dest.MblNo, src => src.MBL_NO??"")
.Map(dest => dest.Remark, src => src.REMARK??"")
.Map(dest => dest.IsExcept, src => src.IS_EXCEPT)
.Map(dest => dest.IsPublic, src => src.IS_PUBLIC)
.Map(dest => dest.IsComplete, src => src.IS_COMPLETE)
.Map(dest => dest.BeginDate, src => src.BEGIN_DATE)
.Map(dest => dest.CompleteDate, src => src.COMPLETE_DATE)
.Map(dest => dest.BookOrderNo, src => src.BOOK_ORDER_NO??"")
.Map(dest => dest.ResultNote, src => src.RESULT_NOTE??"")
.Map(dest => dest.ETD, src => src.ETD.HasValue ? src.ETD.Value.ToString("yyyy-MM-dd"??"") : ""??"")
.Map(dest => dest.CreatedTime, src => src.CreatedTime)
.Map(dest => dest.UpdatedTime, src => src.UpdatedTime.HasValue ? src.UpdatedTime.Value.ToString("yyyy-MM-dd HH:mm:ss"??"") : ""??"")
.Map(dest => dest.CreatedUserId, src => src.CreatedUserId)
.Map(dest => dest.CreatedUserName, src => src.CreatedUserName??"")
.Map(dest => dest.UpdatedUserId, src => src.UpdatedUserId)
.Map(dest => dest.UpdatedUserName, src => src.UpdatedUserName??"")
.Map(dest => dest.ComplateDeal, src => src.COMPLETE_DEAL??"")
.Map(dest => dest.ComplateDealName, src => src.COMPLETE_DEAL_NAME??"")
.Map(dest => dest.IssueType, src => src.ISSUE_TYPE??"")
.Map(dest => dest.IssueTypeName, src => src.ISSUE_TYPE_NAME??"")
.Map(dest => dest.TaskReqUserId, src => src.TASK_REQ_USERID)
.Map(dest => dest.TaskReqUserName, src => src.TASK_REQ_USERNAME??"")
.Map(dest => dest.YardName, src => src.YARD_NAME??"")
.Map(dest => dest.VesselVoyno, src => src.VESSEL_VOYNO??"")
.Map(dest => dest.ContaInfo, src => src.CONTA_INFO??"")
.Map(dest => dest.TruckName, src => src.TRUCK_NAME??"")
.Map(dest => dest.CustomerName, src => src.CUSTOMER_NAME??"")
.Map(dest => dest.NeedArriveTime, src => src.NeedArriveTime);
}
}
}

@ -165,6 +165,16 @@ namespace Myshipping.Application
/// </summary>
public string BatchStatic { get; set; }
/// <summary>
/// 平台代码
/// </summary>
public string SYSTEM_CODE { get; set; }
/// <summary>
/// 平台名称
/// </summary>
public string SYSTEM_NAME { get; set; }
/// <summary>
/// 费用明细当业务类型是INVOICE_BILL_MAIL-航次账单
/// </summary>

@ -51,7 +51,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="QuerySearch">任务台账查询请求</param>
/// <returns>返回结果</returns>
Task<SqlSugarPagedList<TaskBaseInfoDto>> GetPageAsync(QueryTaskManageDto QuerySearch);
Task<SqlSugarPagedList<dynamic>> GetPageAsync(QueryTaskManageDto QuerySearch);
/// <summary>

@ -8,8 +8,10 @@ using Furion.JsonSerialization;
using Furion.Localization;
using Furion.RemoteRequest;
using Furion.RemoteRequest.Extensions;
using HtmlAgilityPack;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
@ -21,6 +23,7 @@ using Myshipping.Application.Entity.TaskManagePlat;
using Myshipping.Application.Helper;
using Myshipping.Application.Service.BookingOrder;
using Myshipping.Application.Service.BookingSlot.Dto;
using Myshipping.Application.Service.ExpressDelivery.Dto.SF;
using Myshipping.Application.Service.TaskManagePlat.Interface;
using Myshipping.Core;
using Myshipping.Core.Const;
@ -35,6 +38,7 @@ using Npoi.Mapper;
using NPOI.HPSF;
using NPOI.HSSF.UserModel;
using NPOI.OpenXmlFormats;
using NPOI.OpenXmlFormats.Dml.Diagram;
using NPOI.OpenXmlFormats.Wordprocessing;
using NPOI.POIFS.Crypt.Dsig;
using NPOI.SS.Formula.Atp;
@ -63,6 +67,7 @@ using System.Runtime.InteropServices;
using System.Security.Policy;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Linq;
using static Aliyun.OSS.Model.CreateSelectObjectMetaInputFormatModel;
@ -347,9 +352,11 @@ namespace Myshipping.Application
CUSTOMER_ID = info.Main.CustomerId,
CUSTOMER_NAME = info.Main.CustomerName,
BATCH_STATIC = info.Main.BatchStatic,
DJYUserId = info.Head.DJYUserId
};
DJYUserId = info.Head.DJYUserId,
SYSTEM_CODE = info.Main.SYSTEM_CODE,
SYSTEM_NAME = info.Main.SYSTEM_NAME,
};
long taskReqUserId = 0;
@ -1972,7 +1979,7 @@ namespace Myshipping.Application
/// <param name="QuerySearch">任务台账查询请求</param>
/// <returns>返回结果</returns>
[HttpPost("/TaskManage/GetPage")]
public async Task<SqlSugarPagedList<TaskBaseInfoDto>> GetPageAsync(QueryTaskManageDto QuerySearch)
public async Task<SqlSugarPagedList<dynamic>> GetPageAsync(QueryTaskManageDto QuerySearch)
{
List<string> mblList = new List<string>();
@ -2053,27 +2060,556 @@ namespace Myshipping.Application
}
var entities = await _taskBaseInfoRepository.AsQueryable()
.Where(t=> userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value) ) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), t => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), t => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, t => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, t => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), t => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), t => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), t => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), t => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), t => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), t => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), t => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0,t=>userIds.Contains( t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return entities.Adapt<SqlSugarPagedList<TaskBaseInfoDto>>();
switch (QuerySearch.TaskType)
{
case "BC":
var bc = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskBCInfo>((t, bc) => t.PK_ID==bc.TASK_ID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.BUSI_TYPE,
bc.SHIPPER,
bc.CONSIGNEE,
bc.NOTIFYPARTY,
bc.BC_MODIFY_TIMES,
bc.BC_MODIFY_DATE,
//bc.MBL_NO,
bc.VESSEL,
bc.VOYNO,
bc.CARRIER,
bc.PLACERECEIPT,
bc.PORTLOAD,
bc.CLOSING_DATE,
bc.VGM_CUTOFF_TIME,
bc.ETA,
//bc.ETD,
bc.POD_ETA,
bc.CUT_SINGLE_TIME,
bc.PORTDISCHARGE,
bc.PLACEDELIVERY,
bc.SHIPPING_METHOD,
bc.SERVICE,
bc.PRETRANS_MODE,
bc.DESCRIPTION,
bc.ISSUEPLACE,
bc.COLLECTION_TERMINAL,
bc.CONTRACTNO,
bc.PREPARDAT,
bc.SHIP_AGENT,
bc.YARD,
bc.YARD_CONTACT_USR,
bc.YARD_CONTACT_TEL,
bc.FST_CUSTOMER_SER_USRNAME,
bc.FST_CUSTOMER_SER_TEL,
bc.FST_CUSTOMER_SER_EMAIL,
bc.REMARK1,
bc.CY_CUTOFF_TIME,
bc.CARRIERID,
bc.LANECODE,
bc.LANENAME,
bc.CARRIAGE_TYPE,
bc.CARRIAGE_TYPE_NAME,
bc.BOOKING_SLOT_TYPE,
bc.BOOKING_SLOT_TYPE_NAME,
bc.CTN_STAT,
bc.WEEK_AT,
bc.DETENSION_FREE_DAYS,
bc.SI_CUT_DATE,
bc.MANIFEST_CUT_DATE,
bc.MDGF_CUT_DATE,
bc.TRANSFER_PORT_1,
bc.TRANSFER_PORT_2,
bc.SECOND_VESSEL,
bc.SECOND_VOYNO,
bc.SECOND_ETD,
bc.SECOND_ETA,
//bc.STATUS,
bc.FILE_MD5,
bc.LAST_TOBOOKING_DATE,
bc.FROM_EMAIL,
bc.RECV_EMAIL,
bc.BOOKING_ORDER_ID,
bc.BOOKING_SLOT_ID,
bc.BOOKING_COMFIRM_DATE,
bc.BATCH_NO,
bc.CUSTOM_SI_CUT_DATE,
bc.IS_SET_AUTO_EMAIL,
bc.IS_SEND_EMAIL,
bc.DIFF_NUM,
bc.AUTO_SEND_USER,
bc.PROCESS_STATUS,
bc.PROCESS_RESULT,
bc.PROCESS_DATE,
bc.PRICE_CALCULATION_DATE
})
.ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return bc.Adapt<SqlSugarPagedList<dynamic>>();
case "SI_FEEDBACK":
var SI_FEEDBACK = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskSISubmitted>((t, bc) => t.PK_ID==bc.TASK_ID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.CARRIER,
bc.MBL_NO,
bc.TAKE_ISSUETYPE_NAME,
bc.ISSUETYPE,
bc.NOTICE_DATE,
bc.BOOKING_ID,
bc.SUBMITTED_DATE,
bc.BILLOF_NUM,
bc.RELEASE_INSTRUCTION,
bc.SI_SUBTYPE,
bc.SHIPPER,
bc.CONSIGNEE,
bc.NOTIFYPARTY,
bc.NOTIFYPARTY2,
bc.TRANSPORT_RECEIVER,
bc.MARKS,
bc.HSCODE,
bc.DESCRIPTION,
bc.PKGS,
bc.KINDPKGS,
bc.KGS,
bc.CBM,
bc.VESSEL,
bc.VOYNO,
bc.COMMODITY,
bc.PLACERECEIPTID,
bc.PLACERECEIPT,
bc.PORTLOADID,
bc.PORTLOAD,
bc.PORTDISCHARGEID,
bc.PORTDISCHARGE,
bc.PLACEDELIVERYID,
bc.PLACEDELIVERY,
bc.PROCESS_STATUS,
bc.IS_SET_AUTO_UPD_BOOKING,
bc.PROCESS_RESULT,
bc.PROCESS_DATE,
bc.DIFF_NUM,
bc.IS_UPDATE_BOOKING,
bc.UPDATE_BOOKING_DATE
}) .ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return SI_FEEDBACK.Adapt<SqlSugarPagedList<dynamic>>();
case "INVOICE_BILL_MAIL":
var INVOICE_BILL_MAIL = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskPerBillBaseInfo>((t, bc) => t.PK_ID==bc.TASK_PKID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.TASK_PKID,
bc.MBL_NO,
bc.INVOICE_NO,
bc.CANCEL_NO,
bc.TOTAL_AMOUNT,
bc.IS_DONGSH_RECV,
bc.IS_DONGSH_RESULT,
bc.DONGSH_RECV_TIME,
bc.DONGSH_RESULT_TIME,
bc.DONGSH_RECV_REASON
}).ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return INVOICE_BILL_MAIL.Adapt<SqlSugarPagedList<dynamic>>();
case "TRUCK_DISPATCH":
var TRUCK_DISPATCH = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskTruckInfo>((t, bc) => t.PK_ID==bc.TASK_ID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.TASK_ID,
bc.BookingTruckId,
bc.BookingId,
bc.TruckId,
bc.TruckCode,
bc.TruckName,
bc.ToName,
bc.Attn,
bc.AttnTel,
bc.AttnMail,
bc.AttnFax,
bc.FromName,
bc.FromTel,
bc.FromMail,
bc.FromMobile,
bc.FromFax,
bc.KGS,
bc.Fee,
bc.PayMethod,
bc.PayMethodName,
bc.TruckTime,
bc.YARDID,
bc.YARD,
bc.YARDCONTRACT,
bc.YARDCONTRACTTEL,
bc.FactoryId,
bc.FactoryCode,
bc.FactoryName,
bc.FactoryContact,
bc.FactoryTel,
bc.ReturnTime,
bc.InYardID,
bc.InYard,
bc.InYardContact,
bc.InYardContractTel,
bc.NeedArriveTime,
bc.ClosingTime,
bc.PickUpTime,
bc.IsGuaJi,
bc.Status,
bc.Attention,
bc.Remark,
bc.DispatcherId,
bc.DispatcherName,
bc.TruckFlowNo,
bc.TaskNo,
bc.Vessel,
bc.VoyNo,
bc.MBLNo,
bc.CntrTotal,
bc.FactoryAddr
}).ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return TRUCK_DISPATCH.Adapt<SqlSugarPagedList<dynamic>>();
case "CUT_MODIFY":
var CUT_MODIFY = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskCutDateChangeInfo>((t, bc) => t.PK_ID==bc.TASK_ID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.TASK_ID,
bc.CARRIER,
bc.VESSEL,
bc.VOYNO,
bc.NOTICE_DATE
}).ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return CUT_MODIFY.Adapt<SqlSugarPagedList<dynamic>>();
case "ROLLING_NOMINATION":
case "TRANSFER_NOMINATION":
var ysh = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskRollingNominationInfo>((t, bc) => t.PK_ID==bc.TASK_ID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.TASK_ID,
bc.PLAN_TYPE,
bc.BATCH_NO,
bc.CARRIERID,
bc.CARRIER,
bc.CONFIRM_DEAD_LINE,
bc.READ_CREATE_TIME,
bc.ROLL_DOUBLE_REMARK,
bc.PLAN_TXT,
bc.REMARK,
bc.TASK_BATCH_TOTAL,
bc.TASK_BATCH_PER_TOTAL
}).ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return ysh.Adapt<SqlSugarPagedList<dynamic>>();
case "DRAFT":
var DRAFT = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskDraftInfo>((t, bc) => t.PK_ID==bc.TASK_ID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.TASK_ID,
bc.CARRIER,
bc.MBL_NO,
bc.BOOKING_ID,
bc.IS_CHANGE,
bc.IS_EMAIL_SEND,
bc.SEND_EMAIL_DATE,
bc.NOTICE_DATE,
}).ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return DRAFT.Adapt<SqlSugarPagedList<dynamic>>();
case "POD_DISCHARGE_FULL":
case "POD_GATEOUT_FULL":
var POD = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskPODDischargeGateoutFullInfo>((t, bc) => t.PK_ID==bc.TASK_ID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.TASK_ID,
bc.CARRIER,
bc.NOTICE_TYPE,
bc.NOTICE_TYPE_NAME,
bc.MBL_NO,
bc.NOTICE_DATE
}).ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return POD.Adapt<SqlSugarPagedList<dynamic>>();
case "CAUTION_NOTICE":
var CAUTION_NOTICE = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskCautionNoticeInfo>((t, bc) => t.PK_ID==bc.TASK_ID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.TASK_ID,
bc.SOURCE_SYSTEM,
bc.SOURCE_BUSI_TYPE,
bc.SOURCE_BUSI_TYPENAME,
bc.NOTIFY_CONTENT,
bc.MBL_NO,
bc.CARRIER,
bc.CAUTION_NOTICE_TYPE,
bc.IS_WEEK_DIFF,
bc.IS_PRICE_DATE_DIFF,
bc.IS_TRANSFER,
bc.IS_VESSEL_CHANGE,
bc.IS_CUT_DATE_ADVANCED,
bc.BOOKING_ID,
bc.BOOKING_SLOT_ID,
bc.SOURCE_TASK_ID,
bc.OLD_VAL,
bc.NEW_VAL,
}).ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return CAUTION_NOTICE.Adapt<SqlSugarPagedList<dynamic>>();
case "ROUTE_CUT_CHANGE":
var ROUTE_CUT_CHANGE = await _taskBaseInfoRepository.AsQueryable().LeftJoin<TaskRouteChangeAdvisoryInfo>((t, bc) => t.PK_ID==bc.TASK_ID)
.Where((t, bc) => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), (t, bc) => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), (t, bc) => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, (t, bc) => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, (t, bc) => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, (t, bc) => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), (t, bc) => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), (t, bc) => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), (t, bc) => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), (t, bc) => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), (t, bc) => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), (t, bc) => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), (t, bc) => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, (t, bc) => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>((t, bc) => new
{
PK_ID = t.PK_ID.SelectAll(),
bc.TASK_ID,
bc.VESSEL,
bc.VOYNO,
bc.CARRIER,
bc.READ_PORTLOAD,
bc.ORIG_ETD,
bc.MDGF_CUT_DATE,
bc.ETA,
bc.ETD,
bc.SI_CUT_DATE,
bc.TM_SHIFT_CUT_DATE,
bc.VGM_CUTOFF_TIME,
bc.CY_CUT_DATE,
bc.ROUTE_CODE,
bc.EMAIL_SUBJECT,
bc.WEEK,
bc.PORTLOADID,
bc.PORTLOAD
}).ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return ROUTE_CUT_CHANGE.Adapt<SqlSugarPagedList<dynamic>>();
default:
var entities = await _taskBaseInfoRepository.AsQueryable()
.Where(t => userlist.Contains(t.CreatedUserId) || (t.RealUserId != null && userlist.Contains(t.RealUserId.Value)) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), t => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), t => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, t => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, t => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), t => t.TASK_TYPE.Equals(QuerySearch.TaskType))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), t => t.TASK_SOURCE.Equals(QuerySearch.TaskSource))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), t => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), t => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), t => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), t => t.STATUS.Equals(QuerySearch.Status))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PKId), t => t.PK_ID.Equals(QuerySearch.PKId))
.WhereIF(userIds.Count>0, t => userIds.Contains(t.DJYUserId))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc "))
.Select<dynamic>(t => new
{
PK_ID = t.PK_ID.SelectAll()
})
.ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return entities.Adapt<SqlSugarPagedList<dynamic>>();
break;
}
}
#endregion

@ -20,6 +20,7 @@ using Newtonsoft.Json.Linq;
using Microsoft.Extensions.Logging;
using Myshipping.Core.Const;
using Newtonsoft.Json;
using NPOI.POIFS.Crypt.Dsig;
namespace Myshipping.Core.Service;
@ -483,15 +484,17 @@ public class AuthService : IAuthService, IDynamicApiController, ITransient
[AllowAnonymous,ApiUser(ApiCode = "GetAuthorizationKey")]
public async Task<string> GetAuthorizationKey([Required] GetAuthorizationKeyInput input)
{
//验证用户ID有效性
var user= _sysUserRep.AsQueryable().Filter(null, true).First(u => u.DjyUserId == _cache.Get(input.UserId));
var user = _sysUserRep.AsQueryable().Filter(null, true).Where(u => u.DjyUserId == input.UserId).First();
if (user is null)
{
throw Oops.Bah("用户Id不存在");
}
//将key写入到redis 并指定五秒过期
string key = Guid.NewGuid().ToString();
await _cache.SetTimeoutAsync( key, JsonConvert.SerializeObject( input), TimeSpan.FromSeconds(5));
await _cache.SetTimeoutAsync( key, JsonConvert.SerializeObject( input), TimeSpan.FromSeconds(50));
//将key返回
return key;
}
@ -506,6 +509,8 @@ public class AuthService : IAuthService, IDynamicApiController, ITransient
[AllowAnonymous]
public async Task<string> GetTokenByAuthorizationKey([Required] GetTokenByAuthorizationKeyInput input)
{
var _repPingTaiUser = App.GetService<SqlSugarRepository<PingTaiUser>>();
//判断key有效性
if (!_cache.Exists(input.Key))
{
@ -518,9 +523,9 @@ public class AuthService : IAuthService, IDynamicApiController, ITransient
//如果类型为公司,将公司下所有用户关联出
if (data.AuthorityType == 2)
{
data.Authority = _pingtaiUser.Where(t => data.Authority.Contains(t.CompId)).Select(t => t.GID).ToList();
data.Authority = _repPingTaiUser.Where(t => data.Authority.Contains(t.CompId)).Select(t => t.GID).ToList();
}
await _cache.SetAsync(datainfo.UserCode + "Authorization", data.Authority);
await _cache.SetAsync(datainfo.DjyUserId + "Authorization", data.Authority);
//获取对应租户
var tenant = _sysTenantRep.Single(datainfo.TenantId);

Loading…
Cancel
Save