我的任务-修改VGM

optimize
jianghaiqing 2 years ago
parent c4016e3cc9
commit b7880fa0e7

@ -29,7 +29,7 @@ namespace Myshipping.Application
/// <summary>
/// 上次结束编号
/// </summary>
public Int32 numberTo { get; set; }
public string numberTo { get; set; }
/// <summary>
/// 原始序号

@ -59,6 +59,16 @@ namespace Myshipping.Application
/// <summary>
/// 排序值
/// </summary>
public int SortNo { get; set; }
public decimal SortNo { get; set; }
/// <summary>
///
/// </summary>
public int DraftNum { get; set; }
/// <summary>
///
/// </summary>
public int LastNumberTo { get; set; }
}
}

@ -97,6 +97,9 @@ namespace Myshipping.Application
const string CONST_WEB_LARA_ACCOUNT_TYPE = "LaraWeb";
const string CONST_LARA_DOWN_URL_CODE = "LaraPaperPostUrl";
//LARA纸计算常量
const int LARA_PARER_DRAFT_VAR = 3;
public TaskManageService(SqlSugarRepository<TaskBaseInfo> taskBaseInfoRepository,
SqlSugarRepository<TaskSIFeedBackInfo> taskSIFeedBackInfoRepository,
SqlSugarRepository<TaskSIFeedBackContaInfo> taskSIFeedBackContaInfoRepository,
@ -3034,31 +3037,31 @@ namespace Myshipping.Application
if (currInfo != null)
{
if(!l.SEALNO.Equals(currInfo.SEAL_NO))
if(l.SEALNO != currInfo.SEAL_NO)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.SealNo));
}
if (!l.CTNCODE.Equals(currInfo.CONTA_TYPE))
if (l.CTNCODE != currInfo.CONTA_TYPE)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.ContaType));
}
if (!l.CTNALL.Equals(currInfo.CONTA_TYPE_NAME))
if (l.CTNALL != currInfo.CONTA_TYPE_NAME)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.ContaTypeName));
}
if (!l.KGS.Equals(currInfo.KGS))
if (l.KGS != currInfo.KGS)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.KGS));
}
if (!l.TAREWEIGHT.Equals(currInfo.TAREWEIGHT))
if (l.TAREWEIGHT != currInfo.TAREWEIGHT)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.TareWeight));
}
if (!l.WEIGHKGS.Equals(currInfo.WEIGHKGS))
if (l.WEIGHKGS != currInfo.WEIGHKGS)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.WeighKGs));
}
if (!l.WEIGHTYPE.Equals(currInfo.WEIGHTYPE))
if (l.WEIGHTYPE != currInfo.WEIGHTYPE)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.WeighType));
}
@ -3088,31 +3091,31 @@ namespace Myshipping.Application
if (currInfo != null)
{
if (!l.SEAL_NO.Equals(currInfo.SEALNO))
if (l.SEAL_NO != currInfo.SEALNO)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.SealNo));
}
if (!l.CONTA_TYPE.Equals(currInfo.CTNCODE))
if (l.CONTA_TYPE != currInfo.CTNCODE)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.ContaType));
}
if (!l.CONTA_TYPE_NAME.Equals(currInfo.CTNALL))
if (l.CONTA_TYPE_NAME != currInfo.CTNALL)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.ContaTypeName));
}
if (!l.KGS.Equals(currInfo.KGS))
if (l.KGS != currInfo.KGS)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.KGS));
}
if (!l.TAREWEIGHT.Equals(currInfo.TAREWEIGHT))
if (l.TAREWEIGHT != currInfo.TAREWEIGHT)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.TareWeight));
}
if (!l.WEIGHKGS.Equals(currInfo.WEIGHKGS))
if (l.WEIGHKGS != currInfo.WEIGHKGS)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.WeighKGs));
}
if (!l.WEIGHTYPE.Equals(currInfo.WEIGHTYPE))
if (l.WEIGHTYPE != currInfo.WEIGHTYPE)
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.WeighType));
}
@ -3603,9 +3606,22 @@ namespace Myshipping.Application
{
List<LaraPaperRegistPostDto> list = new List<LaraPaperRegistPostDto>();
/*
LARA
1model.moveTypeInitCalcLaraPageNumbers
2 model.moveType
*/
try
{
list = model.paperList;
if(string.IsNullOrWhiteSpace(model.moveType))
{
list = InnerCalcLaraPageNumbers(model,true);
}
else
{
list = InnerCalcLaraPageNumbers(model);
}
}
catch (Exception ex)
{
@ -3615,6 +3631,97 @@ namespace Myshipping.Application
return list;
}
#endregion
#region 计算LARA纸
/// <summary>
/// 计算LARA纸
/// </summary>
/// <param name="model">请求LARA纸详情</param>
/// <param name="isInit">是否初始化 true-初始化</param>
/// <returns></returns>
private List<LaraPaperRegistPostDto> InnerCalcLaraPageNumbers(CalcLaraPageNumbersDto model,bool isInit = false)
{
List<LaraPaperRegistPostDto> list = new List<LaraPaperRegistPostDto>();
//如果判断不是首次加载,需要将移动的行从列表移动到指定位置后,重新计算。
if(!isInit)
{
model.paperList = model.paperList.Select(t =>
{
if (t.SortNo == model.origIndex.Value)
{
//up
if(model.currIndex < model.origIndex)
{
t.SortNo = (decimal)model.currIndex.Value - 0.1m;
}
else
{
t.SortNo = (decimal)model.currIndex.Value + 0.1m;
}
}
return t;
}).OrderBy(t => t.SortNo)
.Select((t, idx) =>
{
t.SortNo = (decimal)idx + 1;
return t;
}).ToList();
}
var mNumberTo = int.Parse(model.numberTo.TrimStart('0'));
if (mNumberTo > 0)
{
int lastNumberTo = 0;
int lastNumberFrom = 0;
model.paperList.OrderBy(t => t.SortNo).ToList().ForEach(t =>
{
LaraPaperRegistPostDto info = new LaraPaperRegistPostDto();
info.SortNo = t.SortNo;
info.DraftNum = t.DraftNum;
info.TaskId = t.TaskId;
info.ORDNO = t.ORDNO;
info.MBLNO = t.MBLNO;
info.ISSUETYPE = t.ISSUETYPE;
if (t.SortNo == 1)
{
lastNumberFrom = mNumberTo + 1;
info.NumberFrom = (lastNumberFrom).ToString().PadLeft(9, '0');
var currNumberTo = (t.DraftNum * LARA_PARER_DRAFT_VAR) + mNumberTo;
info.NumberTo = currNumberTo.ToString().PadLeft(9, '0');
info.PageSum = currNumberTo - lastNumberFrom + 1;
lastNumberTo = currNumberTo;
}
else
{
lastNumberFrom = lastNumberTo + 1;
info.NumberFrom = (lastNumberFrom).ToString().PadLeft(9, '0');
var currNumberTo = (t.DraftNum * LARA_PARER_DRAFT_VAR) + lastNumberTo;
info.NumberTo = currNumberTo.ToString().PadLeft(9, '0');
info.PageSum = currNumberTo - lastNumberFrom + 1;
lastNumberTo = currNumberTo;
}
list.Add(info);
});
}
return list;
}
#endregion
}
#region 样本业务提取帮助类

Loading…
Cancel
Save