修改预甩任务

master
jianghaiqing 7 months ago
parent 4b29e2f84c
commit 91f8ed1410

@ -34,6 +34,12 @@ namespace Myshipping.Application
/// 重复KEY被取消
/// </summary>
[Description("重复KEY被取消")]
REPEAT_KEY
REPEAT_KEY,
/// <summary>
/// 已完结
/// </summary>
[Description("已完结")]
COMPLETE,
}
}

@ -51,12 +51,12 @@ namespace Myshipping.Application
/// <summary>
/// 原船记录
/// </summary>
public TaskRollingNominationShipDto From { get; set; }
public List<TaskRollingNominationShipDto> From { get; set; }
/// <summary>
/// 换船记录
/// </summary>
public TaskRollingNominationShipDto To { get; set; }
public List<TaskRollingNominationShipDto> To { get; set; }
/// <summary>
/// 单票汇总列表

@ -25,5 +25,10 @@ namespace Myshipping.Application
/// 用户意见内容
/// </summary>
public string userOpinionTxt { get; set; }
/// <summary>
/// 是否人工触发默认true true-人工触发 false-定时触发
/// </summary>
public bool isManual { get; set; } = true;
}
}

@ -174,17 +174,17 @@ namespace Myshipping.Application
shipList = _taskRollingNominationShipInfoRepository.AsQueryable()
.Where(a => a.NOM_ID == rollModel.PK_ID && a.GROUP_INDX == 0 && !a.IsDeleted).ToList();
var fromEntity = shipList.FirstOrDefault(a =>
a.SHIP_TYPE.Equals("From", StringComparison.OrdinalIgnoreCase));
var fromEntity = shipList.Where(a =>
a.SHIP_TYPE.Equals("From", StringComparison.OrdinalIgnoreCase)).ToList();
if (fromEntity != null)
model.From = fromEntity.Adapt<TaskRollingNominationShipDto>();
if (fromEntity.Count > 0)
model.From = fromEntity.Select(p=>p.Adapt<TaskRollingNominationShipDto>()).ToList();
var toEntity = shipList.FirstOrDefault(a =>
a.SHIP_TYPE.Equals("To", StringComparison.OrdinalIgnoreCase));
var toEntity = shipList.Where(a =>
a.SHIP_TYPE.Equals("To", StringComparison.OrdinalIgnoreCase)).ToList();
if (toEntity != null)
model.To = toEntity.Adapt<TaskRollingNominationShipDto>();
if (toEntity.Count > 0)
model.To = toEntity.Select(p => p.Adapt<TaskRollingNominationShipDto>()).ToList();
var withDispatchList = _taskRollingNominationDetailInfoRepository.AsQueryable().Filter(null, true)
@ -193,6 +193,20 @@ namespace Myshipping.Application
&& (string.IsNullOrWhiteSpace(dispatch.PK_ID) || (!string.IsNullOrWhiteSpace(dispatch.PK_ID) && dispatch.IsDeleted == false)))
.Select((detail, dispatch) => new { Detail = detail, Dispatch = dispatch }).ToList();
if (withDispatchList.Any(p => p.Detail != null))
{
var detailList =
withDispatchList.Where(p => p.Detail != null)
.Select(p => p.Detail).ToList();
var portList = detailList.Where(p => !string.IsNullOrWhiteSpace(p.PLACEOF_RECEIPT))
.Select(p => p.PLACEOF_RECEIPT?.Trim()).Distinct().ToList();
model.From = model.From.Where(p=> portList.Any(p2=>p2.Equals(p.Port?.Trim()))).ToList();
model.To = model.To.Where(p => portList.Any(p2 => p2.Equals(p.Port?.Trim()))).ToList();
}
List<Tuple<string,int>> tuples = new List<Tuple<string,int>>();
if (withDispatchList.Any(a =>

@ -7,11 +7,13 @@ using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles.Infrastructure;
using Microsoft.Extensions.Logging;
using Myshipping.Application.ConfigOption;
using Myshipping.Application.Entity;
using Myshipping.Core;
using Myshipping.Core.Service;
using NPOI.Util;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
@ -503,19 +505,23 @@ namespace Myshipping.Application.Service.TaskManagePlat
};
var shipList = _taskRollingNominationShipInfoRepository.AsQueryable().Filter(null, true)
.Where(a => a.NOM_ID == rollModel.PK_ID && a.GROUP_INDX == 1 && !a.IsDeleted).ToList();
.Where(a => a.NOM_ID == rollModel.PK_ID && a.GROUP_INDX == 1 && a.IsDeleted == false).ToList();
var fromEntity = shipList.FirstOrDefault(a =>
a.SHIP_TYPE.Equals("From", StringComparison.OrdinalIgnoreCase));
if (shipList.Count == 0)
shipList = _taskRollingNominationShipInfoRepository.AsQueryable().Filter(null, true)
.Where(a => a.NOM_ID == rollModel.PK_ID && a.GROUP_INDX == 0 && a.IsDeleted == false).ToList();
if (fromEntity != null)
model.From = fromEntity.Adapt<TaskRollingNominationShipDto>();
var fromEntity = shipList.Where(a =>
a.SHIP_TYPE.Equals("From", StringComparison.OrdinalIgnoreCase)).ToList();
var toEntity = shipList.FirstOrDefault(a =>
a.SHIP_TYPE.Equals("To", StringComparison.OrdinalIgnoreCase));
if (fromEntity.Count > 0)
model.From = fromEntity.Select(p => p.Adapt<TaskRollingNominationShipDto>()).ToList();
if (toEntity != null)
model.To = toEntity.Adapt<TaskRollingNominationShipDto>();
var toEntity = shipList.Where(a =>
a.SHIP_TYPE.Equals("To", StringComparison.OrdinalIgnoreCase)).ToList();
if (toEntity.Count > 0)
model.To = toEntity.Select(p => p.Adapt<TaskRollingNominationShipDto>()).ToList();
List<Tuple<string, int>> tuples = new List<Tuple<string, int>>();
@ -526,6 +532,13 @@ namespace Myshipping.Application.Service.TaskManagePlat
model.TotalLoadCtnStat = string.Join(",", model.LoadDetailList.GroupBy(x => x.CtnAll)
.Select(x =>
$"{x.Key}*{x.Sum(t => t.CtnNum)}").ToArray());
var portList = model.LoadDetailList.Where(p => !string.IsNullOrWhiteSpace(p.PlaceOfReceipt))
.Select(p => p.PlaceOfReceipt?.Trim()).Distinct().ToList();
model.From = model.From.Where(p => portList.Any(p2 => p2.Equals(p.Port?.Trim()))).ToList();
model.To = model.To.Where(p => portList.Any(p2 => p2.Equals(p.Port?.Trim()))).ToList();
}
}
catch (Exception ex)
@ -551,6 +564,7 @@ namespace Myshipping.Application.Service.TaskManagePlat
/*
1shareKey
2
3
3
4
*/
@ -568,9 +582,18 @@ namespace Myshipping.Application.Service.TaskManagePlat
if (shareEntity == null)
throw Oops.Oh($"链接分享不存在");
if(shareEntity.STATUS != TaskShareLinkStatusEnum.ACTIVE.ToString())
{
if(shareEntity.STATUS != TaskShareLinkStatusEnum.COMPLETE.ToString())
throw Oops.Oh($"预甩通知用户已反馈,不能重复提交");
throw Oops.Oh($"分享链接已失效,请咨询操作重新获取");
}
shareEntity.USER_OPINION = model.userOpinion;
shareEntity.USER_OPINION_TXT = model.userOpinionTxt;
shareEntity.CONFIRM_DATE = DateTime.Now;
shareEntity.IS_MANUAL = model.isManual;
await _taskShareLinkInfoRepository.AsUpdateable(shareEntity)
.UpdateColumns(it => new
@ -578,8 +601,11 @@ namespace Myshipping.Application.Service.TaskManagePlat
it.USER_OPINION,
it.USER_OPINION_TXT,
it.CONFIRM_DATE,
it.IS_MANUAL,
}).ExecuteCommandAsync();
//需要回写预甩任务的
result.succ = true;
result.msg = "成功";
}

Loading…
Cancel
Save