diff --git a/.gitignore b/.gitignore
index 93439c4d..a9a3b011 100644
--- a/.gitignore
+++ b/.gitignore
@@ -83,3 +83,4 @@ LinkAttach
/ds-wms-service/DS.WMS.CheckApi/Logs/internal-nlog.txt
/ds-wms-service/DS.WMS.FinanceApi/.config/dotnet-tools.json
/ds-wms-service/DS.WMS.FinanceApi/Properties/PublishProfiles/FolderProfile.pubxml
+/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user
diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeReimbursementService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeReimbursementService.cs
index 164d5712..925866b8 100644
--- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeReimbursementService.cs
+++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeReimbursementService.cs
@@ -485,7 +485,7 @@ namespace DS.WMS.Core.Fee.Method
/// 为null时引发
public virtual async Task MarkerChangedAsync(MarkerChangedCallback callback)
{
- await MarkerChangedAsync(callback);
+ await taskService.MarkerChangedAsync(callback);
//同步到钉钉
diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs
index a00582fc..53b61c43 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs
@@ -663,13 +663,13 @@ namespace DS.WMS.Core.Op.Method
{
var checkIds = model.bookids.Where(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)).Select(a => a.bookid).ToArray();
#region 主单处理
+
+
var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId))
- .LeftJoin((l, r) => l.BusinessId == r.Id)
- .Select((l,r) => new { m = r, h=l })
- .MergeTable()
- .LeftJoin((l, r) => l.h.Id == r.BookingId)
- .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false)
- .Select((l, r) => new { order = l, bl = r })
+ .InnerJoin((l, r) => l.BusinessId == r.Id)
+ .LeftJoin((l, r, t) => l.Id == t.BookingId)
+ .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false)
+ .Select((l, r, t) => new { order = r, sub = l,bl = t })
.ToList();
//if (orderList.Count != model.bookids.Length)
@@ -685,7 +685,7 @@ namespace DS.WMS.Core.Op.Method
if (blModel == null || blModel.Id == 0)
{
- var dto = GetReadSaveInfo(data.order.m, data.order.h);
+ var dto = GetReadSaveInfo(data.order, data.sub);
var saveRlt = await Save(dto);
@@ -940,14 +940,13 @@ namespace DS.WMS.Core.Op.Method
if (model.bookids.Any(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)))
{
var checkIds = model.bookids.Where(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)).Select(a => a.bookid).ToArray();
+
#region 主单处理
var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId))
- .LeftJoin((l, r) => l.BusinessId == r.Id)
- .Select((l, r) => new { m = r, h = l })
- .MergeTable()
- .LeftJoin((l, r) => l.h.Id == r.BookingId)
- .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false)
- .Select((l, r) => new { order = l, bl = r })
+ .InnerJoin((l, r) => l.BusinessId == r.Id)
+ .LeftJoin((l, r, t) => l.Id == t.BookingId)
+ .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false)
+ .Select((l, r, t) => new { order = r, sub = l, bl = t })
.ToList();
foreach (var data in orderList)
@@ -956,7 +955,7 @@ namespace DS.WMS.Core.Op.Method
if (blModel == null || blModel.Id == 0)
{
- var dto = GetReadSaveInfo(data.order.m, data.order.h);
+ var dto = GetReadSaveInfo(data.order, data.sub);
var saveRlt = await Save(dto);
@@ -1174,12 +1173,10 @@ namespace DS.WMS.Core.Op.Method
var checkIds = model.bookids.Where(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)).Select(a => a.bookid).ToArray();
#region 主单处理
var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId))
- .LeftJoin((l, r) => l.BusinessId == r.Id)
- .Select((l, r) => new { m = r, h = l })
- .MergeTable()
- .LeftJoin((l, r) => l.h.Id == r.BookingId)
- .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false)
- .Select((l, r) => new { order = l, bl = r })
+ .InnerJoin((l, r) => l.BusinessId == r.Id)
+ .LeftJoin((l, r, t) => l.Id == t.BookingId)
+ .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false)
+ .Select((l, r, t) => new { order = r, sub = l, bl = t })
.ToList();
foreach (var data in orderList)
@@ -1188,7 +1185,7 @@ namespace DS.WMS.Core.Op.Method
if (blModel == null || blModel.Id == 0)
{
- var dto = GetReadSaveInfo(data.order.m, data.order.h);
+ var dto = GetReadSaveInfo(data.order, data.sub);
var saveRlt = await Save(dto);
@@ -1397,15 +1394,13 @@ namespace DS.WMS.Core.Op.Method
if (model.bookids.Any(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)))
{
var checkIds = model.bookids.Where(a => a.MHBillType.Equals("H", StringComparison.OrdinalIgnoreCase)).Select(a => a.bookid).ToArray();
-
+
#region 主单处理
var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId))
- .LeftJoin((l, r) => l.BusinessId == r.Id)
- .Select((l, r) => new { m = r, h = l })
- .MergeTable()
- .LeftJoin((l, r) => l.h.Id == r.BookingId)
- .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false)
- .Select((l, r) => new { order = l, bl = r })
+ .InnerJoin((l, r) => l.BusinessId == r.Id)
+ .LeftJoin((l, r, t) => l.Id == t.BookingId)
+ .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false)
+ .Select((l, r, t) => new { order = r, sub = l, bl = t })
.ToList();
foreach (var data in orderList)
@@ -1414,7 +1409,7 @@ namespace DS.WMS.Core.Op.Method
if (blModel == null || blModel.Id == 0)
{
- var dto = GetReadSaveInfo(data.order.m, data.order.h);
+ var dto = GetReadSaveInfo(data.order, data.sub);
var saveRlt = await Save(dto);
@@ -1631,12 +1626,10 @@ namespace DS.WMS.Core.Op.Method
#region 主单处理
var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId))
- .LeftJoin((l, r) => l.BusinessId == r.Id)
- .Select((l, r) => new { m = r, h = l })
- .MergeTable()
- .LeftJoin((l, r) => l.h.Id == r.BookingId)
- .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false)
- .Select((l, r) => new { order = l, bl = r })
+ .InnerJoin((l, r) => l.BusinessId == r.Id)
+ .LeftJoin((l, r, t) => l.Id == t.BookingId)
+ .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false)
+ .Select((l, r, t) => new { order = r, sub = l, bl = t })
.ToList();
foreach (var data in orderList)
@@ -1645,7 +1638,7 @@ namespace DS.WMS.Core.Op.Method
if (blModel == null || blModel.Id == 0)
{
- var dto = GetReadSaveInfo(data.order.m, data.order.h);
+ var dto = GetReadSaveInfo(data.order, data.sub);
var saveRlt = await Save(dto);
@@ -1653,7 +1646,7 @@ namespace DS.WMS.Core.Op.Method
blModel = saveRlt.Data;
}
- if (blModel.IsCheckIn)
+ if (blModel.IsCheckIn || !blModel.IsChangeEndorse)
{
blModel.Status = BLIssueStatusEnum.ChangeEndorse.ToString();
blModel.StatusName = BLIssueStatusEnum.ChangeEndorse.GetDescription();
@@ -1893,12 +1886,10 @@ namespace DS.WMS.Core.Op.Method
#region 主单处理
var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId))
- .LeftJoin((l, r) => l.BusinessId == r.Id)
- .Select((l, r) => new { m = r, h = l })
- .MergeTable()
- .LeftJoin((l, r) => l.h.Id == r.BookingId)
- .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false)
- .Select((l, r) => new { order = l, bl = r })
+ .InnerJoin((l, r) => l.BusinessId == r.Id)
+ .LeftJoin((l, r, t) => l.Id == t.BookingId)
+ .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false)
+ .Select((l, r, t) => new { order = r, sub = l, bl = t })
.ToList();
foreach (var data in orderList)
@@ -1907,7 +1898,7 @@ namespace DS.WMS.Core.Op.Method
if (blModel == null || blModel.Id == 0)
{
- var dto = GetReadSaveInfo(data.order.m, data.order.h);
+ var dto = GetReadSaveInfo(data.order, data.sub);
var saveRlt = await Save(dto);
@@ -1919,7 +1910,7 @@ namespace DS.WMS.Core.Op.Method
{
blModel.Status = BLIssueStatusEnum.RejectReleaeNotice.ToString();
blModel.StatusName = BLIssueStatusEnum.RejectReleaeNotice.GetDescription();
- blModel.IsChangeEndorse = true;
+ //blModel.Isrej = true;
await tenantDb.Updateable(blModel)
.UpdateColumns(x => new
@@ -2042,12 +2033,10 @@ namespace DS.WMS.Core.Op.Method
#region 主单处理
var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId))
- .LeftJoin((l, r) => l.BusinessId == r.Id)
- .Select((l, r) => new { m = r, h = l })
- .MergeTable()
- .LeftJoin((l, r) => l.h.Id == r.BookingId)
- .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false)
- .Select((l, r) => new { order = l, bl = r })
+ .InnerJoin((l, r) => l.BusinessId == r.Id)
+ .LeftJoin((l, r, t) => l.Id == t.BookingId)
+ .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false)
+ .Select((l, r, t) => new { order = r, sub = l, bl = t })
.ToList();
foreach (var data in orderList)
@@ -2056,7 +2045,7 @@ namespace DS.WMS.Core.Op.Method
if (blModel == null || blModel.Id == 0)
{
- var dto = GetReadSaveInfo(data.order.m, data.order.h);
+ var dto = GetReadSaveInfo(data.order, data.sub);
var saveRlt = await Save(dto);
@@ -2080,8 +2069,8 @@ namespace DS.WMS.Core.Op.Method
var log = new BLIssueManageLog
{
Pid = blModel.Id,
- ActionCode = BLIssueActionEnum.RejectReleaeNotice.ToString(),
- ActionName = BLIssueActionEnum.RejectReleaeNotice.GetDescription(),
+ ActionCode = BLIssueActionEnum.BLModify.ToString(),
+ ActionName = BLIssueActionEnum.BLModify.GetDescription(),
Note = model.Notes,
Result = "成功",
CreateBy = long.Parse(user.UserId),
@@ -2187,12 +2176,10 @@ namespace DS.WMS.Core.Op.Method
#region 主单处理
var orderList = tenantDb.Queryable().ClearFilter(typeof(IOrgId))
- .LeftJoin((l, r) => l.BusinessId == r.Id)
- .Select((l, r) => new { m = r, h = l })
- .MergeTable()
- .LeftJoin((l, r) => l.h.Id == r.BookingId)
- .Where((l, r) => checkIds.Contains(l.h.Id) && l.h.Deleted == false)
- .Select((l, r) => new { order = l, bl = r })
+ .InnerJoin((l, r) => l.BusinessId == r.Id)
+ .LeftJoin((l, r, t) => l.Id == t.BookingId)
+ .Where((l, r, t) => checkIds.Contains(l.Id) && l.Deleted == false)
+ .Select((l, r, t) => new { order = r, sub = l, bl = t })
.ToList();
foreach (var data in orderList)
@@ -2201,7 +2188,7 @@ namespace DS.WMS.Core.Op.Method
if (blModel == null || blModel.Id == 0)
{
- var dto = GetReadSaveInfo(data.order.m, data.order.h);
+ var dto = GetReadSaveInfo(data.order, data.sub);
var saveRlt = await Save(dto);
@@ -2353,7 +2340,6 @@ namespace DS.WMS.Core.Op.Method
{
var model = new BLIssueManageBaseInputDto
{
- BookingId = order.Id,
BLNo = order.MBLNO,
CustomerId = order.CustomerId,
CustomerName = order.CustomerName,
@@ -2375,6 +2361,7 @@ namespace DS.WMS.Core.Op.Method
if (hOrder != null && hOrder.Id > 0)
{
+ model.BookingId = hOrder.Id;
model.IssueType = hOrder.IssueType;
//model.IssueTypeCode = hOrder.IssueTypeCode;
//model.IssuePlaceCode = hOrder.IssuePlaceCode;
@@ -2388,6 +2375,7 @@ namespace DS.WMS.Core.Op.Method
}
else
{
+ model.BookingId = order.Id;
model.IssueType = order.IssueType;
model.IssueTypeCode = order.IssueTypeCode;
model.IssuePlaceCode = order.IssuePlaceCode;
@@ -2409,6 +2397,10 @@ namespace DS.WMS.Core.Op.Method
model.AgreementDays = (Int16)Math.Ceiling(timeDiff / (24 * 60m));
}
+ model.UpdateBy = long.Parse(user.UserId);
+ model.UpdateUserName = user.UserName;
+ model.UpdateTime = DateTime.Now;
+
return model;
}
#endregion
diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/ArgumentExceptionHandler.cs b/ds-wms-service/DS.WMS.FeeBillRecvService/ArgumentExceptionHandler.cs
new file mode 100644
index 00000000..b04475e7
--- /dev/null
+++ b/ds-wms-service/DS.WMS.FeeBillRecvService/ArgumentExceptionHandler.cs
@@ -0,0 +1,28 @@
+using Microsoft.AspNetCore.Http;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc.Filters;
+using Microsoft.AspNetCore.Mvc;
+
+namespace DS.WMS.FeeBillRecvService
+{
+ //public sealed class ArgumentExceptionHandler : IExceptionHandler
+ //{
+ // public async ValueTask TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken)
+ // {
+ // httpContext.RequestServices.GetRequiredService>()
+ // .LogError(exception, "Exception handled");
+ // if (exception is not ArgumentException) return false;
+
+ // httpContext.Response.StatusCode = 400;
+ // await httpContext.Response.WriteAsJsonAsync(new
+ // {
+ // exception.Message
+ // }, cancellationToken);
+ // return true;
+ // }
+ //}
+}
diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj b/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj
new file mode 100644
index 00000000..befc2135
--- /dev/null
+++ b/ds-wms-service/DS.WMS.FeeBillRecvService/DS.WMS.FeeBillRecvService.csproj
@@ -0,0 +1,23 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionFilter .cs b/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionFilter .cs
new file mode 100644
index 00000000..c9b0bd75
--- /dev/null
+++ b/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionFilter .cs
@@ -0,0 +1,35 @@
+using Hangfire.Server;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DS.WMS.FeeBillRecvService
+{
+ public class GlobalExceptionFilter : IServerFilter
+ {
+ public void OnPerforming(PerformingContext context)
+ {
+ // 不需要在这里做任何事情
+ }
+
+ public void OnPerformed(PerformedContext context)
+ {
+
+ Console.WriteLine(context.BackgroundJob);
+ // 当job执行完毕后,检查是否有异常
+ //if (context.BackgroundJob.State == JobState.Failed)
+ //{
+ // // 获取异常信息
+ // var exception = context.Exception;
+ // if (exception != null)
+ // {
+ // // 处理异常,例如发送邮件、记录日志等
+ // // 这里可以使用依赖注入来处理异常,如记录日志到Logging Service
+ // Console.WriteLine($"Job failed with exception: {exception.Message}");
+ // }
+ //}
+ }
+ }
+}
diff --git a/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionsFilter.cs b/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionsFilter.cs
new file mode 100644
index 00000000..8dc8670b
--- /dev/null
+++ b/ds-wms-service/DS.WMS.FeeBillRecvService/GlobalExceptionsFilter.cs
@@ -0,0 +1,129 @@
+using DS.Module.Core.Log;
+using DS.Module.Core;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc.Filters;
+using Microsoft.AspNetCore.Mvc;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Hosting;
+
+namespace DS.WMS.FeeBillRecvService
+{
+ ///
+ /// 全局异常错误日志
+ ///
+ public class GlobalExceptionsFilter : IExceptionFilter
+ {
+ private readonly IHostingEnvironment _env;
+ private readonly IServiceProvider _serviceProvider;
+ public GlobalExceptionsFilter(IHostingEnvironment env, IServiceProvider serviceProvider)
+ {
+ _env = env;
+ _serviceProvider = serviceProvider;
+ }
+
+ public void OnException(ExceptionContext context)
+ {
+ var json = new JsonErrorResponse();
+
+ json.Message = context.Exception.Message; //错误信息
+ if (_env.IsDevelopment())
+ {
+ json.DevelopmentMessage = context.Exception.StackTrace; //堆栈信息
+ }
+
+ var result = DataResult