|
|
|
@ -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
|
|
|
|
|
/*
|
|
|
|
|
1、验证shareKey是否有效。
|
|
|
|
|
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 = "成功";
|
|
|
|
|
}
|
|
|
|
|