From ae98cb9811d48e916adf26a21208e503b8456fa8 Mon Sep 17 00:00:00 2001
From: zhangxiaofeng <1939543722@qq.com>
Date: Tue, 6 Aug 2024 10:07:00 +0800
Subject: [PATCH 1/8] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=B1=BB=E5=9E=8B?=
=?UTF-8?q?=E6=9E=9A=E4=B8=BE=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Enums/TaskPlat/TaskBaseTypeEnum.cs | 97 +++++++++----------
.../Sys/Interface/ICommonService.cs | 2 +-
.../DS.WMS.Core/Sys/Method/CommonService.cs | 2 +-
.../Controllers/CommonController.cs | 2 +-
.../DS.WMS.MainApi/DS.WMS.MainApi.csproj.user | 2 +-
5 files changed, 52 insertions(+), 53 deletions(-)
diff --git a/ds-wms-service/DS.Module.Core/Enums/TaskPlat/TaskBaseTypeEnum.cs b/ds-wms-service/DS.Module.Core/Enums/TaskPlat/TaskBaseTypeEnum.cs
index b2cfeda8..942e00c0 100644
--- a/ds-wms-service/DS.Module.Core/Enums/TaskPlat/TaskBaseTypeEnum.cs
+++ b/ds-wms-service/DS.Module.Core/Enums/TaskPlat/TaskBaseTypeEnum.cs
@@ -191,46 +191,45 @@ namespace DS.Module.Core
#region 工作流--主要流程
///
- /// 待审单
+ /// 审单
///
- [Description("待审单")]
+ [Description("审单")]
WAIT_ORDER_AUDIT = 201,
///
- /// 待订舱
+ /// 订舱
///
- [Description("待订舱")]
+ [Description("订舱")]
WAIT_BOOKING = 202,
///
- /// 待收BC
+ /// 收BC
///
- [Description("待收BC")]
+ [Description("收BC")]
WAIT_BC = 203,
///
- /// 待放舱
+ /// 放舱
///
- [Description("待放舱")]
+ [Description("放舱")]
WAIT_SPACE_RELEASE = 204,
///
- /// 待提单确认
+ /// 提单确认
///
- [Description("待提单确认")]
+ [Description("提单确认")]
WAIT_BILL_CONFIRM = 205,
///
- /// 待提交SI
+ /// 提交SI
///
- [Description("待提交SI")]
+ [Description("提交SI")]
WAIT_SI = 206,
///
- /// 待处理Draft
+ /// 处理Draft
///
- [Description("待处理Draft")]
+ [Description("处理Draft")]
WAIT_DRAFT = 207,
///
- /// 待放单
+ /// 放单
///
- [Description("待放单")]
+ [Description("放单")]
WAIT_CHECKOUT_BILL = 208,
-
///
/// 审单驳回
///
@@ -240,84 +239,84 @@ namespace DS.Module.Core
#region 工作流--可选服务项目
///
- /// 待报关
+ /// 报关
///
- [Description("待报关")]
+ [Description("报关")]
WAIT_BAOGUAN = 301,
///
- /// 待发舱单
+ /// 发舱单
///
- [Description("待发舱单")]
+ [Description("发舱单")]
WAIT_CANGDAN = 302,
///
- /// 待提交VGM
+ /// 提交VGM
///
- [Description("待提交VGM")]
+ [Description("提交VGM")]
WAIT_VGM = 303,
///
- /// 待发AFR
+ /// 发AFR
///
- [Description("待发AFR")]
+ [Description("发AFR")]
WAIT_AFR = 304,
///
- /// 待发AMS
+ /// 发AMS
///
- [Description("待发AMS")]
+ [Description("发AMS")]
WAIT_AMS = 305,
///
- /// 待发ISF
+ /// 发ISF
///
- [Description("待发ISF")]
+ [Description("发ISF")]
WAIT_ISF = 306,
///
- /// 待熏蒸
+ /// 熏蒸
///
- [Description("待熏蒸")]
+ [Description("熏蒸")]
WAIT_XUNZHENG = 307,
///
- /// 待报商检
+ /// 报商检
///
- [Description("待报商检")]
+ [Description("报商检")]
WAIT_SHANGJIAN = 308,
///
- /// 待报COA
+ /// 报COA
///
- [Description("待报COA")]
+ [Description("报COA")]
WAIT_COA = 309,
///
- /// 待出产地证
+ /// 出产地证
///
- [Description("待出产地证")]
+ [Description("出产地证")]
WAIT_CHANDIZHENG = 310,
///
- /// 待拖车
+ /// 拖车
///
- [Description("待拖车")]
+ [Description("拖车")]
WAIT_TUOCHE = 311,
///
- /// 待办保险
+ /// 办保险
///
- [Description("待办保险")]
+ [Description("办保险")]
WAIT_Insurance = 312,
///
- /// 待出号
+ /// 出号
///
- [Description("待出号")]
+ [Description("出号")]
WAIT_CHUHAO = 313,
///
- /// 待内点入货
+ /// 内点入货
///
- [Description("待内点入货")]
+ [Description("内点入货")]
WAIT_NDRH = 314,
///
- /// 待发快递
+ /// 发快递
///
- [Description("待发快递")]
+ [Description("发快递")]
WAIT_DELIVERY = 315,
///
- /// 待箱使
+ /// 箱使
///
- [Description("待箱使")]
+ [Description("箱使")]
WAIT_XIANGSHI = 316,
#endregion
}
diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs
index d1038abc..feaa85e4 100644
--- a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs
+++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs
@@ -283,7 +283,7 @@ public interface ICommonService
/// 批量获取任务台用户字段设置
///
///
- /// 是否获取默认配置 false:仅获取默认配置 true:如果存在个人配置优先获取个人配置,否则获取默认配置
+ /// 是否获取默认配置 false:如果存在个人配置优先获取个人配置,否则获取默认配置 true:仅获取默认配置
/// 任务类型Code
Task>> GetUserTaskPlatFieldSet(string permissionId, bool isGetDefault, string[] taskTypeCodeArray);
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs
index 0a09fcb0..821cb83b 100644
--- a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs
+++ b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs
@@ -1428,7 +1428,7 @@ public class CommonService : ICommonService
/// 批量获取任务台用户字段设置
///
///
- /// 是否获取默认配置 false:仅获取默认配置 true:如果存在个人配置优先获取个人配置,否则获取默认配置
+ /// 是否获取默认配置 false:如果存在个人配置优先获取个人配置,否则获取默认配置 true:仅获取默认配置
/// 任务类型Code
///
public async Task>> GetUserTaskPlatFieldSet(string permissionId, bool isGetDefault, string[] taskTypeCodeArray)
diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs
index caf21d0b..2c975df8 100644
--- a/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs
+++ b/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs
@@ -431,7 +431,7 @@ public class CommonController : ApiController
/// 批量获取任务台用户字段设置
///
///
- /// 是否获取默认配置 false:仅获取默认配置 true:如果存在个人配置优先获取个人配置,否则获取默认配置
+ /// 是否获取默认配置 false:如果存在个人配置优先获取个人配置,否则获取默认配置 true:仅获取默认配置
/// 任务类型Code
[HttpGet]
[Route("GetUserTaskPlatFieldSet")]
diff --git a/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user b/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user
index f2a959bf..0ab25a41 100644
--- a/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user
+++ b/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user
@@ -1,6 +1,6 @@
- D:\Code\ds8-solution-pro\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml
+ FolderProfile
\ No newline at end of file
From f3876ae583724be201797702a06f9b173ddf74f9 Mon Sep 17 00:00:00 2001
From: zhangxiaofeng <1939543722@qq.com>
Date: Tue, 6 Aug 2024 10:52:27 +0800
Subject: [PATCH 2/8] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=87=AA=E5=AE=9A?=
=?UTF-8?q?=E4=B9=89=E5=88=97=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DS.WMS.Core/Sys/Dtos/SysFieldSetDtos.cs | 22 +++++++++++++++-
.../Sys/Interface/ICommonService.cs | 5 +---
.../DS.WMS.Core/Sys/Method/CommonService.cs | 25 ++++++++-----------
.../Controllers/CommonController.cs | 9 +++----
4 files changed, 36 insertions(+), 25 deletions(-)
diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/SysFieldSetDtos.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/SysFieldSetDtos.cs
index c82f746a..23a14626 100644
--- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/SysFieldSetDtos.cs
+++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/SysFieldSetDtos.cs
@@ -2,10 +2,30 @@
namespace DS.WMS.Core.Sys.Dtos
{
+ ///
+ /// 任务台字段自定义列查询接口的入参Dto
+ ///
+ public class SysFieldSetTaskPlatQueryDto
+ {
+ ///
+ ///
+ ///
+ public string PermissionId { get; set; }
+
+ ///
+ /// 是否获取默认配置 false:如果存在个人配置优先获取个人配置,否则获取默认配置 true:仅获取默认配置
+ ///
+ public bool IsGetDefault { get; set; }
+
+ ///
+ /// 任务类型Code数组
+ ///
+ public string[] TaskTypeCodeArray { get; set; }
+ }
///
/// 任务台字段自定义列查询接口的返回Dto
///
- public class SysFieldSetTaskPlatQueryDtos: SysFieldSet
+ public class SysFieldSetTaskPlatResultDto: SysFieldSet
{
///
/// 任务类型Code
diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs
index feaa85e4..e7b6223c 100644
--- a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs
+++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs
@@ -282,8 +282,5 @@ public interface ICommonService
///
/// 批量获取任务台用户字段设置
///
- ///
- /// 是否获取默认配置 false:如果存在个人配置优先获取个人配置,否则获取默认配置 true:仅获取默认配置
- /// 任务类型Code
- Task>> GetUserTaskPlatFieldSet(string permissionId, bool isGetDefault, string[] taskTypeCodeArray);
+ Task>> GetUserTaskPlatFieldSet(SysFieldSetTaskPlatQueryDto query);
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs
index 821cb83b..fc343903 100644
--- a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs
+++ b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs
@@ -1427,21 +1427,18 @@ public class CommonService : ICommonService
///
/// 批量获取任务台用户字段设置
///
- ///
- /// 是否获取默认配置 false:如果存在个人配置优先获取个人配置,否则获取默认配置 true:仅获取默认配置
- /// 任务类型Code
///
- public async Task>> GetUserTaskPlatFieldSet(string permissionId, bool isGetDefault, string[] taskTypeCodeArray)
+ public async Task>> GetUserTaskPlatFieldSet(SysFieldSetTaskPlatQueryDto query)
{
- if (taskTypeCodeArray == null || taskTypeCodeArray.Length == 0)
+ if (query.TaskTypeCodeArray == null || query.TaskTypeCodeArray.Length == 0)
{
- return DataResult>.Success(null);
+ return DataResult>.Success(null);
}
long userId = long.Parse(user.UserId);
- Dictionary tagNoDic = new(taskTypeCodeArray.Length);
+ Dictionary tagNoDic = new(query.TaskTypeCodeArray.Length);
- foreach (var item in taskTypeCodeArray)
+ foreach (var item in query.TaskTypeCodeArray)
{
if (item.ToUpper() == TASK_PLAT_BASIC_CODE)
{
@@ -1465,13 +1462,13 @@ public class CommonService : ICommonService
}
var tagNoList = tagNoDic.Select(x => x.Key);
var infoList = await db.Queryable()
- .Where(x => x.PermissionId == long.Parse(permissionId) && tagNoList.Contains(x.TagNo))
- .WhereIF(isGetDefault, x => x.UserId == 0)
- .WhereIF(!isGetDefault, x => (x.UserId == userId || x.UserId == 0))
- .Select(x => new SysFieldSetTaskPlatQueryDtos(), true)
+ .Where(x => x.PermissionId == long.Parse(query.PermissionId) && tagNoList.Contains(x.TagNo))
+ .WhereIF(query.IsGetDefault, x => x.UserId == 0)
+ .WhereIF(!query.IsGetDefault, x => (x.UserId == userId || x.UserId == 0))
+ .Select(x => new SysFieldSetTaskPlatResultDto(), true)
.ToListAsync();
- var result = new List();
+ var result = new List();
foreach (var item in tagNoDic)
{
var temp = infoList.FirstOrDefault(x => x.TagNo == item.Key && x.UserId == userId);
@@ -1494,7 +1491,7 @@ public class CommonService : ICommonService
}
}
- return DataResult>.Success(result);
+ return DataResult>.Success(result);
}
///
diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs
index 2c975df8..44207321 100644
--- a/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs
+++ b/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs
@@ -430,14 +430,11 @@ public class CommonController : ApiController
///
/// 批量获取任务台用户字段设置
///
- ///
- /// 是否获取默认配置 false:如果存在个人配置优先获取个人配置,否则获取默认配置 true:仅获取默认配置
- /// 任务类型Code
- [HttpGet]
+ [HttpPost]
[Route("GetUserTaskPlatFieldSet")]
- public async Task>> GetUserTaskPlatFieldSet([FromQuery] string permissionId, [FromQuery] bool isGetDefault, [FromQuery] string[] taskTypeCodeArray)
+ public async Task>> GetUserTaskPlatFieldSet([FromBody] SysFieldSetTaskPlatQueryDto query)
{
- var res = await _invokeService.GetUserTaskPlatFieldSet(permissionId, isGetDefault, taskTypeCodeArray);
+ var res = await _invokeService.GetUserTaskPlatFieldSet(query);
return res;
}
From d5113c317170e5089fe06662f9047a3c3d77c4ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?=
Date: Tue, 6 Aug 2024 10:12:24 +0800
Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=80=E6=9D=A5?=
=?UTF-8?q?=E5=8D=95=E4=BD=8D=E6=89=80=E5=B1=9E=E5=88=86=E9=83=A8=E4=B8=BA?=
=?UTF-8?q?=E5=A4=9A=E9=80=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DS.WMS.Core/Info/Dtos/ClientInfoReq.cs | 31 ++---
.../DS.WMS.Core/Info/Dtos/ClientInfoRes.cs | 40 ++++---
.../DS.WMS.Core/Info/Entity/InfoClient.cs | 113 ++++++++----------
.../Info/Method/ClientInfoService.cs | 26 +++-
4 files changed, 112 insertions(+), 98 deletions(-)
diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoReq.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoReq.cs
index 6ceedbf9..ca451a69 100644
--- a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoReq.cs
+++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoReq.cs
@@ -16,7 +16,6 @@ public class ClientInfoReq
///
public long Id { get; set; }
-
///
/// Desc:客户代码
///
@@ -103,7 +102,6 @@ public class ClientInfoReq
///
public string City { get; set; }
-
///
/// Desc:提单信息
///
@@ -112,7 +110,7 @@ public class ClientInfoReq
///
/// Desc:是否停用
///
- public bool? IsStop { get; set; } = false;
+ public bool IsStop { get; set; }
/////
///// Desc:发票抬头1
@@ -306,7 +304,7 @@ public class ClientInfoReq
///
/// 审批状态
///
- public AuditStatusEnum? AuditStatus { get; set; } = AuditStatusEnum.Approve;
+ public AuditStatusEnum AuditStatus { get; set; } = AuditStatusEnum.Approve;
///
/// 审批时间
@@ -341,19 +339,25 @@ public class ClientInfoReq
public string InvoiceAddrTel { get; set; }
///
- /// Desc:所属分部
+ /// 所属分部
+ ///
+ public long[]? SaleOrgIdList { get; set; }
+
+ ///
+ /// 所属分部值
///
- public long? SaleOrgId { get; set; }
+ [IgnoreDataMember]
+ public string? SaleOrgId => SaleOrgIdList == null ? null : string.Join(",", SaleOrgIdList);
///
/// Desc:提成比例
///
- public decimal? CommissionRate { get; set; } = 0;
+ public decimal CommissionRate { get; set; }
///
/// Desc:分成比例
///
- public decimal? ProportionRate { get; set; } = 0;
+ public decimal ProportionRate { get; set; }
///
/// Desc:提成参与人
@@ -374,7 +378,7 @@ public class ClientInfoReq
///
/// Desc: 客服
///
- public long CustomerService { get; set; } = 0;
+ public long CustomerService { get; set; }
///
/// Desc:英文简称
@@ -386,16 +390,15 @@ public class ClientInfoReq
///
public string WMSFeeRateType { get; set; }
-
///
/// 状态 0 启用 1 禁用
///
- public StatusEnum? Status { get; set; } = StatusEnum.Enable;
+ public StatusEnum Status { get; set; } = StatusEnum.Enable;
///
/// 备注
///
- public string Note { get; set; } = "";
+ public string Note { get; set; }
///
/// 客户标识
@@ -426,9 +429,9 @@ public class ClientInfoReq
return PushNotification.None;
PushNotification flags = PushNotification.None;
- for (int i = 0; i < Notifications.Length; i++)
+ for (int i = 0; i < Notifications.Length; i++)
flags |= Notifications[i];
-
+
return flags;
}
}
diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoRes.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoRes.cs
index ab20db13..240b0d97 100644
--- a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoRes.cs
+++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoRes.cs
@@ -1,6 +1,7 @@
using System.Runtime.Serialization;
using DS.Module.Core;
using DS.Module.Core.Enums;
+using DS.Module.Core.Extensions;
using DS.WMS.Core.Info.Entity;
using Masuit.Tools.Systems;
@@ -86,7 +87,6 @@ public class ClientInfoRes
///
public long Doc { get; set; }
-
///
/// Desc:国家
///
@@ -102,7 +102,6 @@ public class ClientInfoRes
///
public string City { get; set; }
-
///
/// Desc:提单信息
///
@@ -111,7 +110,7 @@ public class ClientInfoRes
///
/// Desc:是否停用
///
- public bool? IsStop { get; set; } = false;
+ public bool IsStop { get; set; }
/////
///// Desc:发票抬头1
@@ -224,7 +223,6 @@ public class ClientInfoRes
///
public string Level { get; set; }
-
///
/// Desc:QQ
///
@@ -235,7 +233,6 @@ public class ClientInfoRes
///
public string MSN { get; set; }
-
///
/// Desc:财务应收账款代码
///
@@ -305,7 +302,7 @@ public class ClientInfoRes
///
/// 审批状态
///
- public AuditStatusEnum? AuditStatus { get; set; } = AuditStatusEnum.Approve;
+ public AuditStatusEnum AuditStatus { get; set; } = AuditStatusEnum.Approve;
///
/// 审批时间
@@ -317,14 +314,11 @@ public class ClientInfoRes
///
public string AuditNote { get; set; }
-
///
/// Desc:默认付费方式
///
public string FeeFRT { get; set; }
-
-
///
/// Desc:业务来源Id
///
@@ -341,19 +335,31 @@ public class ClientInfoRes
public string InvoiceAddrTel { get; set; }
///
- /// Desc:所属分部
+ /// 所属分部值
+ ///
+ [IgnoreDataMember]
+ public string? SaleOrgId { get; set; }
+
+ ///
+ /// 所属分部
+ ///
+ public long[] SaleOrgIdList => SaleOrgId.IsNullOrEmpty() ? [] :
+ SaleOrgId.Split([','], StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
+
+ ///
+ /// 所属分部名称
///
- public long? SaleOrgId { get; set; }
+ public string? SaleOrgNames { get; set; }
///
/// Desc:提成比例
///
- public decimal? CommissionRate { get; set; } = 0;
+ public decimal CommissionRate { get; set; }
///
/// Desc:分成比例
///
- public decimal? ProportionRate { get; set; } = 0;
+ public decimal ProportionRate { get; set; }
///
/// Desc:提成参与人
@@ -370,11 +376,10 @@ public class ClientInfoRes
///
public string CtnType { get; set; }
-
///
/// Desc: 客服
///
- public long CustomerService { get; set; } = 0;
+ public long CustomerService { get; set; }
///
/// Desc:英文简称
@@ -389,13 +394,12 @@ public class ClientInfoRes
///
/// 状态 0 启用 1 禁用
///
- public StatusEnum? Status { get; set; } = StatusEnum.Enable;
+ public StatusEnum Status { get; set; } = StatusEnum.Enable;
///
/// 备注
///
- public string Note { get; set; } = "";
-
+ public string Note { get; set; }
///
/// 创建时间
diff --git a/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClient.cs b/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClient.cs
index 3ccb33f1..2fa4c1fb 100644
--- a/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClient.cs
+++ b/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClient.cs
@@ -12,7 +12,7 @@ namespace DS.WMS.Core.Info.Entity;
public class InfoClient : BaseModelV2
{
///
- /// Desc:客户代码
+ /// 客户代码(助记码)
///
[SugarColumn(ColumnDescription = "客户代码", IsNullable = false, Length = 20)]
public string CodeName { get; set; }
@@ -27,19 +27,19 @@ public class InfoClient : BaseModelV2
/// Desc:客户中文名称或描述信息
///
[SugarColumn(ColumnDescription = "客户中文名称或描述信息", IsNullable = true, Length = 50)]
- public string Description { get; set; }
+ public string? Description { get; set; }
///
/// Desc:客户英文简称
///
[SugarColumn(ColumnDescription = "客户英文简称", IsNullable = true, Length = 50)]
- public string Name { get; set; }
+ public string? Name { get; set; }
///
/// Desc:客户英文全称
///
[SugarColumn(ColumnDescription = "客户英文全称", IsNullable = true, Length = 50)]
- public string EnFullName { get; set; }
+ public string? EnFullName { get; set; }
///
/// Desc:客户状态
@@ -51,7 +51,7 @@ public class InfoClient : BaseModelV2
/// Desc:通讯地址
///
[SugarColumn(ColumnDescription = "通讯地址", IsNullable = true, Length = 1000)]
- public string Address { get; set; }
+ public string? Address { get; set; }
///
/// Desc:邮箱
@@ -63,75 +63,74 @@ public class InfoClient : BaseModelV2
/// Desc:网页
///
[SugarColumn(ColumnDescription = "网页", IsNullable = true, Length = 50)]
- public string Web { get; set; }
+ public string? Web { get; set; }
///
/// Desc:电话
///
[SugarColumn(ColumnDescription = "电话", IsNullable = true, Length = 50)]
- public string Tel { get; set; }
+ public string? Tel { get; set; }
///
/// Desc:传真
///
[SugarColumn(ColumnDescription = "传真", IsNullable = true, Length = 50)]
- public string Fax { get; set; }
+ public string? Fax { get; set; }
///
/// Desc:负责人
///
[SugarColumn(ColumnDescription = "负责人", IsNullable = true, Length = 20)]
- public string Chief { get; set; }
+ public string? Chief { get; set; }
///
/// Desc:所属揽货人
///
[SugarColumn(ColumnDescription = "所属揽货人", IsNullable = true)]
- public long SaleId { get; set; }
+ public long? SaleId { get; set; }
///
/// Desc:所属操作人
///
[SugarColumn(ColumnDescription = "所属操作人", IsNullable = true)]
- public long Op { get; set; }
+ public long? Op { get; set; }
///
/// Desc:所属单证
///
[SugarColumn(ColumnDescription = "所属单证", IsNullable = true)]
- public long Doc { get; set; }
-
+ public long? Doc { get; set; }
///
/// Desc:国家
///
[SugarColumn(ColumnDescription = "国家", Length = 50, IsNullable = true)]
- public string Country { get; set; }
+ public string? Country { get; set; }
///
/// Desc:省或州
///
[SugarColumn(ColumnDescription = "省或州", Length = 50, IsNullable = true)]
- public string Province { get; set; }
+ public string? Province { get; set; }
///
/// Desc:城市
///
[SugarColumn(ColumnDescription = "城市", Length = 50, IsNullable = true)]
- public string City { get; set; }
+ public string? City { get; set; }
///
/// Desc:提单信息
///
[SugarColumn(ColumnDescription = "提单信息", Length = 600, IsNullable = true)]
- public string BLContent { get; set; }
+ public string? BLContent { get; set; }
///
/// Desc:是否停用该客户信息
///
[SugarColumn(ColumnDescription = "是否停用该客户信息", DefaultValue = "0")]
- public bool? IsStop { get; set; } = false;
+ public bool IsStop { get; set; }
/////
///// Desc:发票抬头1
@@ -264,84 +263,79 @@ public class InfoClient : BaseModelV2
/// Desc:等级
///
[SugarColumn(ColumnDescription = "等级", Length = 1, IsNullable = true)]
- public string Level { get; set; }
-
-
+ public string? Level { get; set; }
///
/// Desc:QQ
///
[SugarColumn(ColumnDescription = "QQ", Length = 50, IsNullable = true)]
- public string QQ { get; set; }
+ public string? QQ { get; set; }
///
/// Desc:MSN
///
[SugarColumn(ColumnDescription = "MSN", Length = 50, IsNullable = true)]
- public string MSN { get; set; }
-
+ public string? MSN { get; set; }
///
/// Desc:财务应收账款代码
///
[SugarColumn(ColumnDescription = "财务应收账款代码", Length = 50, IsNullable = true)]
- public string FARCode { get; set; }
+ public string? FARCode { get; set; }
///
/// Desc:财务应付账款代码
///
[SugarColumn(ColumnDescription = "财务应付账款代码", Length = 50, IsNullable = true)]
- public string FAPCode { get; set; }
+ public string? FAPCode { get; set; }
///
/// Desc:冷藏费率
///
[SugarColumn(ColumnDescription = "冷藏费率", Length = 50, DefaultValue = "0", IsNullable = true)]
- public string UnitPrice { get; set; }
+ public string? UnitPrice { get; set; }
///
/// Desc:企业备案号
///
[SugarColumn(ColumnDescription = "企业备案号", Length = 50, IsNullable = true)]
- public string RegistrationNo { get; set; }
+ public string? RegistrationNo { get; set; }
///
/// Desc:财务序号
///
[SugarColumn(ColumnDescription = "财务序号", Length = 50, IsNullable = true)]
- public string OrderNo { get; set; }
-
-
+ public string? OrderNo { get; set; }
///
/// Desc:纳税人识别号
///
[SugarColumn(ColumnDescription = "纳税人识别号", Length = 30, IsNullable = true)]
- public string TaxNo { get; set; }
+ public string? TaxNo { get; set; }
///
/// Desc:EDI代码
///
[SugarColumn(ColumnDescription = "EDI代码", Length = 20, IsNullable = true)]
- public string EDICode { get; set; }
+ public string? EDICode { get; set; }
///
/// Desc:EDI代码2
///
[SugarColumn(ColumnDescription = "EDI代码2", Length = 20, IsNullable = true)]
- public string EDICode2 { get; set; }
+ public string? EDICode2 { get; set; }
///
/// Desc:EDI代码3
///
[SugarColumn(ColumnDescription = "EDI代码3", Length = 20, IsNullable = true)]
- public string EDICode3 { get; set; }
+ public string? EDICode3 { get; set; }
///
/// Desc:组织机构代码
///
[SugarColumn(ColumnDescription = "组织机构代码", Length = 50, IsNullable = true)]
- public string OrganizationCode { get; set; }
+ public string? OrganizationCode { get; set; }
///
/// 所属集团ID
@@ -359,32 +353,32 @@ public class InfoClient : BaseModelV2
/// Desc:企业商检备案号
///
[SugarColumn(ColumnDescription = "商检备案号", Length = 50, IsNullable = true)]
- public string InspectionNo { get; set; }
+ public string? InspectionNo { get; set; }
///
/// 审批状态
///
[SugarColumn(ColumnDescription = "审批状态", DefaultValue = "0")]
- public AuditStatusEnum? AuditStatus { get; set; } = AuditStatusEnum.Approve;
+ public AuditStatusEnum AuditStatus { get; set; } = AuditStatusEnum.Approve;
///
/// 审批时间
///
[SugarColumn(ColumnDescription = "审批时间", IsNullable = true)]
public DateTime? AuditTime { get; set; }
+
///
/// 审批意见
///
[SugarColumn(ColumnDescription = "审批意见", Length = 100, IsNullable = true)]
- public string AuditNote { get; set; }
-
-
+ public string? AuditNote { get; set; }
///
/// Desc:默认付费方式
///
[SugarColumn(ColumnDescription = "默认付费方式", Length = 20, IsNullable = true)]
- public string FeeFRT { get; set; }
+ public string? FeeFRT { get; set; }
+
///
/// Desc:业务来源Id
///
@@ -395,92 +389,91 @@ public class InfoClient : BaseModelV2
/// Desc:发票银行
///
[SugarColumn(ColumnDescription = "发票银行", Length = 150, IsNullable = true)]
- public string InvoiceBank { get; set; }
+ public string? InvoiceBank { get; set; }
///
/// Desc:发票地址电话
///
[SugarColumn(ColumnDescription = "发票地址电话", Length = 200, IsNullable = true)]
- public string InvoiceAddrTel { get; set; }
+ public string? InvoiceAddrTel { get; set; }
///
- /// Desc:所属分部
+ /// 所属分部
///
- [SugarColumn(ColumnDescription = "所属分部")]
- public long? SaleOrgId { get; set; }
+ [SugarColumn(ColumnDescription = "所属分部", IsNullable = true)]
+ public string? SaleOrgId { get; set; }
///
/// Desc:提成比例
///
[SugarColumn(ColumnDescription = "提成比例", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
- public decimal? CommissionRate { get; set; } = 0;
+ public decimal CommissionRate { get; set; } = 0;
///
/// Desc:分成比例
///
[SugarColumn(ColumnDescription = "分成比例", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
- public decimal? ProportionRate { get; set; } = 0;
+ public decimal ProportionRate { get; set; } = 0;
///
/// Desc:提成参与人
///
[SugarColumn(ColumnDescription = "提成参与人", IsNullable = true)]
- public long CommissionUserId { get; set; }
+ public long? CommissionUserId { get; set; }
///
/// Desc:运输公司列表
///
[SugarColumn(ColumnDescription = "运输公司列表", Length = 200, IsNullable = true)]
- public string CarrierList { get; set; }
+ public string? CarrierList { get; set; }
///
/// Desc:集装箱尺寸
///
[SugarColumn(ColumnDescription = "集装箱尺寸", Length = 50, IsNullable = true)]
- public string CtnType { get; set; }
-
+ public string? CtnType { get; set; }
///
/// Desc: 客服
///
[SugarColumn(ColumnDescription = "客服")]
- public long CustomerService { get; set; } = 0;
+ public long CustomerService { get; set; }
///
/// Desc:英文简称
///
[SugarColumn(ColumnDescription = "英文简称", Length = 50, IsNullable = true)]
- public string EnShortName { get; set; }
+ public string? EnShortName { get; set; }
///
/// Desc:仓储费开始日期模式
///
[SugarColumn(ColumnDescription = "仓储费开始日期模式", Length = 50, IsNullable = true)]
- public string WMSFeeRateType { get; set; }
+ public string? WMSFeeRateType { get; set; }
///
/// 揽货人名字
///
[SugarColumn(ColumnDescription = "揽货人名字", Length = 50, IsNullable = true)]
- public string SaleName { get; set; }
+ public string? SaleName { get; set; }
///
/// 操作名字
///
[SugarColumn(ColumnDescription = "操作名字", Length = 50, IsNullable = true)]
- public string OpName { get; set; }
+ public string? OpName { get; set; }
///
/// 单证名字
///
[SugarColumn(ColumnDescription = "单证名字", Length = 50, IsNullable = true)]
- public string DocName { get; set; }
+ public string? DocName { get; set; }
///
/// 客服名字
///
[SugarColumn(ColumnDescription = "客服名字", Length = 50, IsNullable = true)]
- public string CustomerServiceName { get; set; }
+ public string? CustomerServiceName { get; set; }
///
/// 是否共享
diff --git a/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs b/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs
index b99d1206..6e30e969 100644
--- a/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs
+++ b/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs
@@ -7,6 +7,7 @@ using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Info.Interface;
using DS.WMS.Core.Op.Entity;
+using DS.WMS.Core.Sys.Entity;
using Mapster;
namespace DS.WMS.Core.Info.Method;
@@ -34,11 +35,24 @@ public class ClientInfoService : ServiceBase, IClientInfoService
long orgId = User.OrgId;
//序列化查询条件
var whereList = request.GetConditionalModels(Db);
- var data = TenantDb.Queryable()
+ var result = TenantDb.Queryable()
.Where(x => x.OrgId == orgId || x.IsShared)
.Where(whereList)
.Select().ToQueryPage(request.PageCondition);
- return data;
+
+ if (result.Data?.Count > 0)
+ {
+ var ids = result.Data.SelectMany(x => x.SaleOrgIdList).Distinct();
+ var orgs = Db.Queryable().Where(x => ids.Contains(x.Id)).Select(x => new { x.Id, x.OrgName }).ToList();
+
+ foreach (var item in result.Data)
+ {
+ var list = orgs.FindAll(x => item.SaleOrgIdList.Contains(x.Id));
+ item.SaleOrgNames = string.Join(",", list.Select(x => x.OrgName));
+ }
+ }
+
+ return result;
}
///
@@ -50,10 +64,10 @@ public class ClientInfoService : ServiceBase, IClientInfoService
{
if (req.Id == 0)
{
- if (TenantDb.Queryable().Where(x => x.CodeName == req.CodeName).Any())
- {
- return DataResult.Failed("客户信息已存在!", MultiLanguageConst.ClientInfoExist);
- }
+ //if (TenantDb.Queryable().Where(x => x.CodeName == req.CodeName).Any())
+ //{
+ // return DataResult.Failed("客户信息已存在!", MultiLanguageConst.ClientInfoExist);
+ //}
var data = req.Adapt();
var tag = req.ClientTag.Adapt();
From f2be20e91b23e6f0209338ca49f31ac8d0ec8279 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?=
Date: Tue, 6 Aug 2024 11:35:09 +0800
Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=81=94=E7=B3=BB?=
=?UTF-8?q?=E4=BA=BA=E5=A7=93=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DS.WMS.Core/Info/Dtos/ClientContactReq.cs | 70 ++++++++-------
.../DS.WMS.Core/Info/Dtos/ClientContactRes.cs | 63 ++++++++------
.../Info/Entity/InfoClientContact.cs | 87 +++++++++----------
.../Info/Method/ClientContactService.cs | 8 +-
.../Method/BookingSlot/BookingSlotService.cs | 4 +-
.../DS.WMS.Core/Op/Method/SeaExportService.cs | 16 ++--
.../TaskPlat/Method/TaskManageBCService.cs | 4 +-
7 files changed, 132 insertions(+), 120 deletions(-)
diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientContactReq.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientContactReq.cs
index 0c0e7534..80c8dc69 100644
--- a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientContactReq.cs
+++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientContactReq.cs
@@ -1,6 +1,7 @@
+using System.Runtime.Serialization;
using DS.Module.Core;
+using DS.Module.Core.Extensions;
using FluentValidation;
-using SqlSugar;
namespace DS.WMS.Core.Info.Dtos;
@@ -20,20 +21,25 @@ public class ClientContactReq
public long ClientId { get; set; }
///
- /// Desc:联系人代码
+ /// Desc:联系人姓名
///
- public string CodeName { get; set; }
+ public string Name { get; set; }
///
- /// Desc:联系人简称
+ /// Desc:联系人英文名
///
- public string ShortName { get; set; }
-
+ public string? EnName { get; set; }
///
/// Desc:职务
///
- public string Job { get; set; }
+ [IgnoreDataMember]
+ public string? Job => Jobs == null ? null : string.Join(",", Jobs);
+
+ ///
+ /// 职务
+ ///
+ public string[]? Jobs { get; set; }
///
/// Desc:通讯地址
@@ -68,72 +74,72 @@ public class ClientContactReq
///
/// Desc:是否为操作
///
- public bool? IsOperator { get; set; } = false;
+ public bool IsOperator { get; set; }
///
/// Desc:是否为财务
///
- public bool? IsFinancialStaff { get; set; } = false;
+ public bool IsFinancialStaff { get; set; }
///
/// Desc:是否为销售
///
- public bool? IsSaleMan { get; set; } = false;
+ public bool IsSaleMan { get; set; }
///
/// Desc:是否为其他
///
- public bool? IsOther { get; set; } = false;
+ public bool IsOther { get; set; }
///
/// Desc:是否保险联系人
///
- public bool? IsInsurance { get; set; } = false;
+ public bool IsInsurance { get; set; }
///
/// Desc:是否对账联系人
///
- public bool? IsCheckAccount { get; set; } = false;
+ public bool IsCheckAccount { get; set; }
///
/// 提醒日期1
///
- public DateTime Anniversary1 { get; set; }
+ public DateTime? Anniversary1 { get; set; }
///
/// 提醒日期2
///
- public DateTime Anniversary2 { get; set; }
+ public DateTime? Anniversary2 { get; set; }
///
/// 提醒备注1
///
- public string AnniversaryNote1 { get; set; }
+ public string? AnniversaryNote1 { get; set; }
///
/// 提醒备注2
///
- public string AnniversaryNote2 { get; set; }
+ public string? AnniversaryNote2 { get; set; }
+
+ /////
+ ///// 船公司Id
+ /////
+ //public long? CarrierId { get; set; }
+
+ /////
+ ///// 船公司
+ /////
+ //public string? Carrier { get; set; }
- ///
- /// 船公司Id
- ///
- public long CarrierId { get; set; } = 0;
- ///
- /// 船公司
- ///
- public string Carrier { get; set; }
///
/// 状态 0 启用 1 禁用
///
- public StatusEnum? Status { get; set; } = StatusEnum.Enable;
+ public StatusEnum Status { get; set; } = StatusEnum.Enable;
///
/// 备注
///
- public string Note { get; set; } = "";
-
-
+ public string? Note { get; set; }
}
///
@@ -146,9 +152,7 @@ public class ClientContactReqValidator : AbstractValidator
///
public ClientContactReqValidator()
{
- this.RuleFor(o => o.CodeName)
- .NotEmpty().WithName("联系人代码");
- this.RuleFor(o => o.ShortName)
- .NotEmpty().WithName("联系人简称");
+ this.RuleFor(o => o.Name)
+ .NotEmpty().WithName("联系人姓名");
}
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientContactRes.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientContactRes.cs
index 16507e04..5ceab362 100644
--- a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientContactRes.cs
+++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientContactRes.cs
@@ -1,4 +1,6 @@
+using System.Runtime.Serialization;
using DS.Module.Core;
+using DS.Module.Core.Extensions;
namespace DS.WMS.Core.Info.Dtos;
@@ -18,20 +20,25 @@ public class ClientContactRes
public long ClientId { get; set; }
///
- /// Desc:联系人代码
+ /// Desc:联系人姓名
///
- public string CodeName { get; set; }
+ public string Name { get; set; }
///
- /// Desc:联系人简称
+ /// Desc:联系人英文名
///
- public string ShortName { get; set; }
-
+ public string? EnName { get; set; }
///
/// Desc:职务
///
- public string Job { get; set; }
+ [IgnoreDataMember]
+ public string? Job { get; set; }
+
+ ///
+ /// 职务
+ ///
+ public string[]? Jobs => Job.IsNullOrEmpty() ? [] : Job.Split([','], StringSplitOptions.RemoveEmptyEntries);
///
/// Desc:通讯地址
@@ -66,71 +73,73 @@ public class ClientContactRes
///
/// Desc:是否为操作
///
- public bool? IsOperator { get; set; } = false;
+ public bool IsOperator { get; set; }
///
/// Desc:是否为财务
///
- public bool? IsFinancialStaff { get; set; } = false;
+ public bool IsFinancialStaff { get; set; }
///
/// Desc:是否为销售
///
- public bool? IsSaleMan { get; set; } = false;
+ public bool IsSaleMan { get; set; }
///
/// Desc:是否为其他
///
- public bool? IsOther { get; set; } = false;
+ public bool IsOther { get; set; }
///
/// Desc:是否保险联系人
///
- public bool? IsInsurance { get; set; } = false;
+ public bool IsInsurance { get; set; }
///
/// Desc:是否对账联系人
///
- public bool? IsCheckAccount { get; set; } = false;
+ public bool IsCheckAccount { get; set; }
///
/// 提醒日期1
///
- public DateTime Anniversary1 { get; set; }
+ public DateTime? Anniversary1 { get; set; }
///
/// 提醒日期2
///
- public DateTime Anniversary2 { get; set; }
+ public DateTime? Anniversary2 { get; set; }
///
/// 提醒备注1
///
- public string AnniversaryNote1 { get; set; }
+ public string? AnniversaryNote1 { get; set; }
///
/// 提醒备注2
///
- public string AnniversaryNote2 { get; set; }
- ///
- /// 船公司Id
- ///
- public long CarrierId { get; set; }
- ///
- /// 船公司
- ///
- public string Carrier { get; set; }
+ public string? AnniversaryNote2 { get; set; }
+
+ /////
+ ///// 船公司Id
+ /////
+ //public long? CarrierId { get; set; }
+
+ /////
+ ///// 船公司
+ /////
+ //public string? Carrier { get; set; }
+
///
/// 状态 0 启用 1 禁用
///
- public StatusEnum? Status { get; set; } = StatusEnum.Enable;
+ public StatusEnum Status { get; set; } = StatusEnum.Enable;
///
/// 备注
///
- public string Note { get; set; } = "";
+ public string? Note { get; set; }
-
///
/// 创建时间
///
diff --git a/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClientContact.cs b/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClientContact.cs
index 0b9a38d8..a2dadd58 100644
--- a/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClientContact.cs
+++ b/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClientContact.cs
@@ -16,137 +16,136 @@ public class InfoClientContact : BaseModelV2
public long ClientId { get; set; }
///
- /// Desc:联系人代码
+ /// 姓名
///
- [SugarColumn(ColumnDescription = "联系人代码", Length = 6)]
- public string CodeName { get; set; }
+ [SugarColumn(ColumnDescription = "姓名", Length = 20)]
+ public string Name { get; set; }
///
- /// Desc:联系人简称
+ /// 英文名
///
- [SugarColumn(ColumnDescription = "联系人简称", Length = 20)]
- public string ShortName { get; set; }
-
+ [SugarColumn(ColumnDescription = "英文名", Length = 50, IsNullable = true)]
+ public string? EnName { get; set; }
///
/// Desc:职务
///
- [SugarColumn(ColumnDescription = "职务", Length = 50, IsNullable = true)]
- public string Job { get; set; }
+ [SugarColumn(ColumnDescription = "职务", Length = 500, IsNullable = true)]
+ public string? Job { get; set; }
///
/// Desc:通讯地址
///
[SugarColumn(ColumnDescription = "通讯地址", Length = 100, IsNullable = true)]
- public string Address { get; set; }
+ public string? Address { get; set; }
///
/// Desc:邮箱
///
[SugarColumn(ColumnDescription = "邮箱", Length = 50, IsNullable = true)]
- public string Email { get; set; }
+ public string? Email { get; set; }
///
/// Desc:手机
///
[SugarColumn(ColumnDescription = "手机", Length = 50, IsNullable = true)]
- public string Mobile { get; set; }
+ public string? Mobile { get; set; }
///
/// Desc:电话
///
[SugarColumn(ColumnDescription = "电话", Length = 50, IsNullable = true)]
- public string Tel { get; set; }
+ public string? Tel { get; set; }
///
/// Desc:传真
///
[SugarColumn(ColumnDescription = "传真", Length = 50, IsNullable = true)]
- public string Fax { get; set; }
+ public string? Fax { get; set; }
///
/// Desc:QQ
///
[SugarColumn(ColumnDescription = "QQ", Length = 50, IsNullable = true)]
- public string QQ { get; set; }
+ public string? QQ { get; set; }
///
/// Desc:是否为操作
///
- [SugarColumn(ColumnDescription = "是否为操作",DefaultValue = "0")]
- public bool? IsOperator { get; set; } = false;
+ [SugarColumn(ColumnDescription = "是否为操作", DefaultValue = "0")]
+ public bool IsOperator { get; set; }
///
/// Desc:是否为财务
///
- [SugarColumn(ColumnDescription = "是否为财务",DefaultValue = "0")]
- public bool? IsFinancialStaff { get; set; } = false;
+ [SugarColumn(ColumnDescription = "是否为财务", DefaultValue = "0")]
+ public bool IsFinancialStaff { get; set; }
///
/// Desc:是否为销售
///
- [SugarColumn(ColumnDescription = "是否为销售",DefaultValue = "0")]
- public bool? IsSaleMan { get; set; } = false;
+ [SugarColumn(ColumnDescription = "是否为销售", DefaultValue = "0")]
+ public bool IsSaleMan { get; set; }
///
/// Desc:是否为其他
///
- [SugarColumn(ColumnDescription = "是否为其他",DefaultValue = "0")]
- public bool? IsOther { get; set; } = false;
+ [SugarColumn(ColumnDescription = "是否为其他", DefaultValue = "0")]
+ public bool IsOther { get; set; }
///
/// Desc:是否保险联系人
///
- [SugarColumn(ColumnDescription = "是否保险联系人",DefaultValue = "0")]
- public bool? IsInsurance { get; set; } = false;
+ [SugarColumn(ColumnDescription = "是否保险联系人", DefaultValue = "0")]
+ public bool IsInsurance { get; set; }
///
/// Desc:是否对账联系人
///
- [SugarColumn(ColumnDescription = "是否对账联系人",DefaultValue = "0")]
- public bool? IsCheckAccount { get; set; } = false;
+ [SugarColumn(ColumnDescription = "是否对账联系人", DefaultValue = "0")]
+ public bool IsCheckAccount { get; set; }
///
/// 提醒日期1
///
[SugarColumn(ColumnDescription = "提醒日期1", IsNullable = true)]
- public DateTime Anniversary1 { get; set; }
+ public DateTime? Anniversary1 { get; set; }
///
/// 提醒日期2
///
[SugarColumn(ColumnDescription = "提醒日期2", IsNullable = true)]
- public DateTime Anniversary2 { get; set; }
+ public DateTime? Anniversary2 { get; set; }
///
/// 提醒备注1
///
[SugarColumn(ColumnDescription = "提醒备注1", Length = 200, IsNullable = true)]
- public string AnniversaryNote1 { get; set; }
+ public string? AnniversaryNote1 { get; set; }
///
/// 提醒备注2
///
[SugarColumn(ColumnDescription = "提醒备注2", Length = 200, IsNullable = true)]
- public string AnniversaryNote2 { get; set; }
-
+ public string? AnniversaryNote2 { get; set; }
+
///
/// 状态 0启用 1禁用
///
- [SugarColumn(ColumnDescription = "状态",DefaultValue = "0")]
- public StatusEnum? Status { get; set; } = StatusEnum.Enable;
+ [SugarColumn(ColumnDescription = "状态", DefaultValue = "0")]
+ public StatusEnum Status { get; set; } = StatusEnum.Enable;
+ /////
+ ///// 船公司Id
+ /////
+ //[SugarColumn(ColumnDescription = "船公司Id", IsNullable = true)]
+ //public long? CarrierId { get; set; }
- ///
- /// 船公司Id
- ///
- [SugarColumn(ColumnDescription = "船公司Id", IsNullable = true, DefaultValue = "0")]
- public long CarrierId { get; set; }
- ///
- /// 船公司
- ///
- [SugarColumn(ColumnDescription = "船公司", IsNullable = true, Length = 100)]
- public string Carrier { get; set; }
+ /////
+ ///// 船公司
+ /////
+ //[SugarColumn(ColumnDescription = "船公司", IsNullable = true, Length = 100)]
+ //public string? Carrier { get; set; }
///
/// 机构Id
diff --git a/ds-wms-service/DS.WMS.Core/Info/Method/ClientContactService.cs b/ds-wms-service/DS.WMS.Core/Info/Method/ClientContactService.cs
index f74a6836..fbeca850 100644
--- a/ds-wms-service/DS.WMS.Core/Info/Method/ClientContactService.cs
+++ b/ds-wms-service/DS.WMS.Core/Info/Method/ClientContactService.cs
@@ -45,10 +45,10 @@ public class ClientContactService : ServiceBase, IClientContactService
{
if (req.Id == 0)
{
- if (TenantDb.Queryable().Where(x => x.CodeName == req.CodeName).Any())
- {
- return DataResult.Failed("客户联系人信息已存在!", MultiLanguageConst.ClientContactExist);
- }
+ //if (TenantDb.Queryable().Where(x => x.Name == req.Name).Any())
+ //{
+ // return DataResult.Failed("客户联系人信息已存在!", MultiLanguageConst.ClientContactExist);
+ //}
var data = req.Adapt();
diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs
index 391710f1..8494ba87 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs
@@ -2502,7 +2502,7 @@ namespace DS.WMS.Core.Op.Method
{
bookingContact = new BusinessOrderContact
{
- Name = djyCustomerContactMan.ShortName,
+ Name = djyCustomerContactMan.Name,
BusinessId = id,
Email = djyCustomerContactMan.Email,
Note = djyCustomerContactMan.Note,
@@ -2516,7 +2516,7 @@ namespace DS.WMS.Core.Op.Method
}
else
{
- bookingContact.Name = djyCustomerContactMan.ShortName;
+ bookingContact.Name = djyCustomerContactMan.Name;
bookingContact.Email = djyCustomerContactMan.Email;
bookingContact.Note = djyCustomerContactMan.Note;
bookingContact.UpdateTime = DateTime.Now;
diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs
index 8b21bef9..27bc0fc5 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs
@@ -638,7 +638,7 @@ public partial class SeaExportService : ISeaExportService
var defaultContact = sqlSugarScope.Queryable().Where(x => x.ClientId == seaExport.CustomerId && x.IsOperator == true).First();
if (defaultContact.IsNotNull())
{
- if (!contactLists.Where(x=>x.BusinessType == BusinessType.OceanShippingExport &&x.CustomerType == "controller"&& x.Name == defaultContact.ShortName).Any())
+ if (!contactLists.Where(x=>x.BusinessType == BusinessType.OceanShippingExport &&x.CustomerType == "controller"&& x.Name == defaultContact.Name).Any())
{
addList.Add(new BusinessOrderContact()
{
@@ -647,7 +647,7 @@ public partial class SeaExportService : ISeaExportService
CustomerName = seaExport.CustomerName,
CustomerType = "controller",
CustomerTypeName="委托单位",
- Name = defaultContact.ShortName,
+ Name = defaultContact.Name,
Tel = defaultContact.Tel,
Email = defaultContact.Email,
CustomerContactId = defaultContact.Id
@@ -660,7 +660,7 @@ public partial class SeaExportService : ISeaExportService
var defaultContact = sqlSugarScope.Queryable().Where(x => x.ClientId == seaExport.TruckerId && x.IsOperator == true).First();
if (defaultContact.IsNotNull())
{
- if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "truck" && x.Name == defaultContact.ShortName).Any())
+ if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "truck" && x.Name == defaultContact.Name).Any())
{
addList.Add(new BusinessOrderContact()
{
@@ -669,7 +669,7 @@ public partial class SeaExportService : ISeaExportService
CustomerName = seaExport.Trucker,
CustomerType = "truck",
CustomerTypeName = "车队",
- Name = defaultContact.ShortName,
+ Name = defaultContact.Name,
Tel = defaultContact.Tel,
Email = defaultContact.Email,
CustomerContactId = defaultContact.Id
@@ -682,7 +682,7 @@ public partial class SeaExportService : ISeaExportService
var defaultContact = sqlSugarScope.Queryable().Where(x => x.ClientId == seaExport.YardId && x.IsOperator == true).First();
if (defaultContact.IsNotNull())
{
- if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "yard" && x.Name == defaultContact.ShortName).Any())
+ if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "yard" && x.Name == defaultContact.Name).Any())
{
addList.Add(new BusinessOrderContact()
{
@@ -691,7 +691,7 @@ public partial class SeaExportService : ISeaExportService
CustomerName = seaExport.Yard,
CustomerType = "yard",
CustomerTypeName = "场站",
- Name = defaultContact.ShortName,
+ Name = defaultContact.Name,
Tel = defaultContact.Tel,
Email = defaultContact.Email,
CustomerContactId = defaultContact.Id
@@ -704,7 +704,7 @@ public partial class SeaExportService : ISeaExportService
var defaultContact = sqlSugarScope.Queryable().Where(x => x.ClientId == seaExport.ForwarderId && x.IsOperator == true).First();
if (defaultContact.IsNotNull())
{
- if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "booking" && x.Name == defaultContact.ShortName).Any())
+ if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "booking" && x.Name == defaultContact.Name).Any())
{
addList.Add(new BusinessOrderContact()
{
@@ -713,7 +713,7 @@ public partial class SeaExportService : ISeaExportService
CustomerName = seaExport.Forwarder,
CustomerType = "booking",
CustomerTypeName = "订舱公司",
- Name = defaultContact.ShortName,
+ Name = defaultContact.Name,
Tel = defaultContact.Tel,
Email = defaultContact.Email,
CustomerContactId = defaultContact.Id
diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs
index f01e6527..b243a1f8 100644
--- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs
+++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs
@@ -1157,7 +1157,7 @@ namespace DS.WMS.Core.TaskPlat.Method
{
bookingContact = new BusinessOrderContact
{
- Name = djyCustomerContactMan.ShortName,
+ Name = djyCustomerContactMan.Name,
BusinessId = id,
Email = djyCustomerContactMan.Email,
Note = djyCustomerContactMan.Note,
@@ -1171,7 +1171,7 @@ namespace DS.WMS.Core.TaskPlat.Method
}
else
{
- bookingContact.Name = djyCustomerContactMan.ShortName;
+ bookingContact.Name = djyCustomerContactMan.Name;
bookingContact.Email = djyCustomerContactMan.Email;
bookingContact.Note = djyCustomerContactMan.Note;
bookingContact.UpdateTime = DateTime.Now;
From 491e2a8dfb9c6d41cf845c6e362e8c6903030eac Mon Sep 17 00:00:00 2001
From: zhangxiaofeng <1939543722@qq.com>
Date: Tue, 6 Aug 2024 14:44:03 +0800
Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=B9=E6=8D=AEBC?=
=?UTF-8?q?=E7=94=9F=E6=88=90=E8=AE=A2=E5=8D=95=E4=BA=A7=E7=94=9F=E6=8B=86?=
=?UTF-8?q?=E7=A5=A8=E7=9A=84bug=E3=80=81=E5=8E=BB=E6=8E=89=E7=94=9F?=
=?UTF-8?q?=E6=88=90=E5=90=8E=E6=9B=B4=E6=96=B0=E4=BB=BB=E5=8A=A1=E7=9A=84?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../TaskPlat/Method/TaskManageBCService.cs | 297 +++++-------------
.../DS.WMS.MainApi/DS.WMS.MainApi.csproj.user | 2 +-
2 files changed, 79 insertions(+), 220 deletions(-)
diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs
index f01e6527..be96eaa1 100644
--- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs
+++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs
@@ -68,7 +68,7 @@ namespace DS.WMS.Core.TaskPlat.Method
//自动转发是否默认抄送操作
const string CONST_AUTO_TRANS_EMAIL_OP_CCTO = "AUTO_TRANS_EMAIL_OP_CCTO";
-
+
public TaskManageBCService(IUser user,
ILogger logger,
@@ -192,6 +192,7 @@ namespace DS.WMS.Core.TaskPlat.Method
//}
//推送订舱订单
+ model.SlotId = bookingSlot.Id;
var bookingOrderId = await bookingSlotService.Value.GenerateBookingOrder(bookingSlot, slotFileList, model, null);
logger.LogInformation($"生成订舱订单完成,bookingOrderId={bookingOrderId} taskid={bcOrder.TASK_ID}");
@@ -256,59 +257,7 @@ namespace DS.WMS.Core.TaskPlat.Method
throw new Exception($"未获取有效任务记录,更新失败");
}
- #region 更新任务
- //如果是公共任务,需要变成个人任务 RealUserId = 当前操作人
- if (taskEntity.IS_PUBLIC == 1)
- {
- taskEntity.IS_PUBLIC = 0;
- taskEntity.RealUserId = long.Parse(user.UserId);
- taskEntity.RealUserName = user.UserName;
- taskEntity.UpdateTime = DateTime.Now;
- taskEntity.UpdateBy = taskEntity.RealUserId ?? 0;
- taskEntity.UpdateUserName = user.UserName;
- taskEntity.IS_COMPLETE = 1;
- taskEntity.COMPLETE_DATE = DateTime.Now;
- taskEntity.COMPLETE_DEAL = "MANUAL";
- taskEntity.COMPLETE_DEAL = "手工";
-
- await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
- {
- it.IS_PUBLIC,
- it.UpdateTime,
- it.UpdateBy,
- it.UpdateUserName,
- it.RealUserId,
- it.RealUserName,
- it.IS_COMPLETE,
- it.COMPLETE_DATE,
- it.COMPLETE_DEAL,
- it.COMPLETE_DEAL_NAME
-
- }).ExecuteCommandAsync();
- }
- else
- {
- taskEntity.UpdateTime = DateTime.Now;
- taskEntity.UpdateBy = long.Parse(user.UserId);
- taskEntity.UpdateUserName = user.UserName;
- taskEntity.IS_COMPLETE = 1;
- taskEntity.COMPLETE_DATE = DateTime.Now;
- taskEntity.COMPLETE_DEAL = "MANUAL";
- taskEntity.COMPLETE_DEAL = "手工";
-
- await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
- {
- it.UpdateTime,
- it.UpdateBy,
- it.UpdateUserName,
- it.IS_COMPLETE,
- it.COMPLETE_DATE,
- it.COMPLETE_DEAL,
- it.COMPLETE_DEAL_NAME
-
- }).ExecuteCommandAsync();
- }
- #endregion
+
//var currBCOrder = await tenantDb.Queryable().Where(a => a.Id == bcEntity.Id).FirstAsync();
//if (currBCOrder != null && model.IsDirectSend)
@@ -357,6 +306,7 @@ namespace DS.WMS.Core.TaskPlat.Method
//{
// bookingSlotService = serviceProvider.GetRequiredService();
//}
+ model.SlotId = bookingSlot.Id;
var bookingOrderId = await bookingSlotService.Value.GenerateBookingOrder(bookingSlot, slotFileList, model, null);
logger.LogInformation($"生成订舱订单完成,bookingOrderId={bookingOrderId} taskid={bcOrder.TASK_ID}");
@@ -421,60 +371,6 @@ namespace DS.WMS.Core.TaskPlat.Method
throw new Exception($"未获取有效任务记录,更新失败");
}
- #region 更新任务
- //如果是公共任务,需要变成个人任务 RealUserId = 当前操作人
- if (taskEntity.IS_PUBLIC == 1)
- {
- taskEntity.IS_PUBLIC = 0;
- taskEntity.RealUserId = long.Parse(user.UserId);
- taskEntity.RealUserName = user.UserName;
- taskEntity.UpdateTime = DateTime.Now;
- taskEntity.UpdateBy = taskEntity.RealUserId ?? 0;
- taskEntity.UpdateUserName = user.UserName;
- taskEntity.IS_COMPLETE = 1;
- taskEntity.COMPLETE_DATE = DateTime.Now;
- taskEntity.COMPLETE_DEAL = "MANUAL";
- taskEntity.COMPLETE_DEAL = "手工";
-
- await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
- {
- it.IS_PUBLIC,
- it.UpdateTime,
- it.UpdateBy,
- it.UpdateUserName,
- it.RealUserId,
- it.RealUserName,
- it.IS_COMPLETE,
- it.COMPLETE_DATE,
- it.COMPLETE_DEAL,
- it.COMPLETE_DEAL_NAME
-
- }).ExecuteCommandAsync();
- }
- else
- {
- taskEntity.UpdateTime = DateTime.Now;
- taskEntity.UpdateBy = long.Parse(user.UserId);
- taskEntity.UpdateUserName = user.UserName;
- taskEntity.IS_COMPLETE = 1;
- taskEntity.COMPLETE_DATE = DateTime.Now;
- taskEntity.COMPLETE_DEAL = "MANUAL";
- taskEntity.COMPLETE_DEAL = "手工";
-
- await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
- {
- it.UpdateTime,
- it.UpdateBy,
- it.UpdateUserName,
- it.IS_COMPLETE,
- it.COMPLETE_DATE,
- it.COMPLETE_DEAL,
- it.COMPLETE_DEAL_NAME
-
- }).ExecuteCommandAsync();
- }
- #endregion
-
//var currBCOrder = _taskBCInfoRepository.AsQueryable().First(a => a.PK_ID == bcEntity.PK_ID);
//if (currBCOrder != null && model.IsDirectSend)
@@ -530,51 +426,6 @@ namespace DS.WMS.Core.TaskPlat.Method
}).ExecuteCommandAsync();
- var taskEntity = await tenantDb.Queryable().FirstAsync(u => u.Id == bcEntity.TASK_ID);
-
- if (taskEntity == null)
- {
- throw new Exception($"未获取有效任务记录,更新失败");
- }
-
- #region 更新任务
- //如果是公共任务,需要变成个人任务 RealUserId = 当前操作人
- if (taskEntity.IS_PUBLIC == 1)
- {
- taskEntity.IS_PUBLIC = 0;
- taskEntity.RealUserId = long.Parse(user.UserId);
- taskEntity.RealUserName = user.UserName;
- taskEntity.UpdateTime = DateTime.Now;
- taskEntity.UpdateBy = taskEntity.RealUserId ?? 0;
- taskEntity.UpdateUserName = user.UserName;
-
- await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
- {
- it.IS_PUBLIC,
- it.UpdateTime,
- it.UpdateBy,
- it.UpdateUserName,
- it.RealUserId,
- it.RealUserName,
-
- }).ExecuteCommandAsync();
- }
- else
- {
- taskEntity.UpdateTime = DateTime.Now;
- taskEntity.UpdateBy = long.Parse(user.UserId);
- taskEntity.UpdateUserName = user.UserName;
-
- await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
- {
- it.UpdateTime,
- it.UpdateBy,
- it.UpdateUserName,
-
- }).ExecuteCommandAsync();
- }
- #endregion
-
#endregion
}
else if (model.GenerateMethod == "UPD_BOOKING")
@@ -611,59 +462,6 @@ namespace DS.WMS.Core.TaskPlat.Method
throw new Exception($"未获取有效任务记录,更新失败");
}
- #region 更新任务
- //如果是公共任务,需要变成个人任务 RealUserId = 当前操作人
- if (taskEntity.IS_PUBLIC == 1)
- {
- taskEntity.IS_PUBLIC = 0;
- taskEntity.RealUserId = long.Parse(user.UserId);
- taskEntity.RealUserName = user.UserName;
- taskEntity.UpdateTime = DateTime.Now;
- taskEntity.UpdateBy = taskEntity.RealUserId ?? 0;
- taskEntity.UpdateUserName = user.UserName;
- taskEntity.IS_COMPLETE = 1;
- taskEntity.COMPLETE_DATE = DateTime.Now;
- taskEntity.COMPLETE_DEAL = "MANUAL";
- taskEntity.COMPLETE_DEAL = "手工";
-
- await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
- {
- it.IS_PUBLIC,
- it.UpdateTime,
- it.UpdateBy,
- it.UpdateUserName,
- it.RealUserId,
- it.RealUserName,
- it.IS_COMPLETE,
- it.COMPLETE_DATE,
- it.COMPLETE_DEAL,
- it.COMPLETE_DEAL_NAME
-
- }).ExecuteCommandAsync();
- }
- else
- {
- taskEntity.UpdateTime = DateTime.Now;
- taskEntity.UpdateBy = long.Parse(user.UserId);
- taskEntity.UpdateUserName = user.UserName;
- taskEntity.IS_COMPLETE = 1;
- taskEntity.COMPLETE_DATE = DateTime.Now;
- taskEntity.COMPLETE_DEAL = "MANUAL";
- taskEntity.COMPLETE_DEAL = "手工";
-
- await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
- {
- it.UpdateTime,
- it.UpdateBy,
- it.UpdateUserName,
- it.IS_COMPLETE,
- it.COMPLETE_DATE,
- it.COMPLETE_DEAL,
- it.COMPLETE_DEAL_NAME
-
- }).ExecuteCommandAsync();
- }
- #endregion
//var currBCOrder = await tenantDb.Queryable().Where(a => a.Id == bcEntity.Id).FirstAsync();
//if (currBCOrder != null && model.IsDirectSend)
@@ -679,6 +477,64 @@ namespace DS.WMS.Core.TaskPlat.Method
#endregion
}
+ #region 更新任务
+ //var taskEntity = await tenantDb.Queryable().FirstAsync(u => u.Id == bcEntity.TASK_ID);
+ //if (taskEntity == null)
+ //{
+ // throw new Exception($"未获取有效任务记录,更新失败");
+ //}
+ ////如果是公共任务,需要变成个人任务 RealUserId = 当前操作人
+ //if (taskEntity.IS_PUBLIC == 1)
+ //{
+ // taskEntity.IS_PUBLIC = 0;
+ // taskEntity.RealUserId = long.Parse(user.UserId);
+ // taskEntity.RealUserName = user.UserName;
+ // taskEntity.UpdateTime = DateTime.Now;
+ // taskEntity.UpdateBy = taskEntity.RealUserId ?? 0;
+ // taskEntity.UpdateUserName = user.UserName;
+ // taskEntity.IS_COMPLETE = 1;
+ // taskEntity.COMPLETE_DATE = DateTime.Now;
+ // taskEntity.COMPLETE_DEAL = "MANUAL";
+ // taskEntity.COMPLETE_DEAL = "手工";
+
+ // await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
+ // {
+ // it.IS_PUBLIC,
+ // it.UpdateTime,
+ // it.UpdateBy,
+ // it.UpdateUserName,
+ // it.RealUserId,
+ // it.RealUserName,
+ // it.IS_COMPLETE,
+ // it.COMPLETE_DATE,
+ // it.COMPLETE_DEAL,
+ // it.COMPLETE_DEAL_NAME
+
+ // }).ExecuteCommandAsync();
+ //}
+ //else
+ //{
+ // taskEntity.UpdateTime = DateTime.Now;
+ // taskEntity.UpdateBy = long.Parse(user.UserId);
+ // taskEntity.UpdateUserName = user.UserName;
+ // taskEntity.IS_COMPLETE = 1;
+ // taskEntity.COMPLETE_DATE = DateTime.Now;
+ // taskEntity.COMPLETE_DEAL = "MANUAL";
+ // taskEntity.COMPLETE_DEAL = "手工";
+
+ // await tenantDb.Updateable(taskEntity).UpdateColumns(it => new
+ // {
+ // it.UpdateTime,
+ // it.UpdateBy,
+ // it.UpdateUserName,
+ // it.IS_COMPLETE,
+ // it.COMPLETE_DATE,
+ // it.COMPLETE_DEAL,
+ // it.COMPLETE_DEAL_NAME
+
+ // }).ExecuteCommandAsync();
+ //}
+ #endregion
result.succ = true;
result.msg = "成功";
@@ -1021,7 +877,7 @@ namespace DS.WMS.Core.TaskPlat.Method
BookingOrSlotGenerateDto generateModel,
SqlSugarScopeProvider? tenantDb = null)
{
- long id = 0;
+ //long id = 0;
if (tenantDb == null)
{
@@ -1110,7 +966,10 @@ namespace DS.WMS.Core.TaskPlat.Method
var bkRlt = await seaExportService.Value.EditSeaExport(bkModel);
- id = long.Parse(bkRlt.Data.ToString());
+ if (!bkRlt.Succeeded)
+ {
+ throw new Exception(MultiLanguageConst.GetDescription(MultiLanguageConst.DataUpdateFailed) + "," + bkRlt.Message);
+ }
string batchNo = Guid.NewGuid().ToString();
@@ -1133,7 +992,7 @@ namespace DS.WMS.Core.TaskPlat.Method
if (generateModel.CustomerContactList != null && generateModel.CustomerContactList.Count > 0)
{
var bookingContactList = await tenantDb.Queryable()
- .Where(a => a.BusinessId == id && a.Deleted == false).ToListAsync();
+ .Where(a => a.BusinessId == bookingOrderId && a.Deleted == false).ToListAsync();
var djyCustomerInfo = clientInfoService.GetClientInfoWithContact(new Info.Dtos.QueryClientInfo { ClientId = generateModel.CustomerId.Value, IsController = true })
.GetAwaiter().GetResult().Data;
@@ -1158,7 +1017,7 @@ namespace DS.WMS.Core.TaskPlat.Method
bookingContact = new BusinessOrderContact
{
Name = djyCustomerContactMan.ShortName,
- BusinessId = id,
+ BusinessId = bookingOrderId,
Email = djyCustomerContactMan.Email,
Note = djyCustomerContactMan.Note,
CreateTime = DateTime.Now,
@@ -1198,14 +1057,14 @@ namespace DS.WMS.Core.TaskPlat.Method
//写入服务项目
var prjRlt = djyServiceStatusService.Value.SaveServiceProject(new EmbedServiceProjectDto
{
- BusinessId = id.ToString(),
+ BusinessId = bookingOrderId.ToString(),
ProjectCodes = generateModel.ProjectList.Distinct().ToArray(),
});
- logger.LogInformation($"推送订舱的服务项目完成 id={id} rlt={JsonConvert.SerializeObject(prjRlt)}");
+ logger.LogInformation($"推送订舱的服务项目完成 id={bookingOrderId} rlt={JsonConvert.SerializeObject(prjRlt)}");
}
- logger.LogInformation($"任务BC MBLNO:{bookingSlotBase.SlotBookingNo} 生成订舱成功 id={id}");
+ logger.LogInformation($"任务BC MBLNO:{bookingSlotBase.SlotBookingNo} 生成订舱成功 id={bookingOrderId}");
}
catch (Exception ex)
@@ -1214,7 +1073,7 @@ namespace DS.WMS.Core.TaskPlat.Method
}
- return id;
+ return bookingOrderId;
}
#endregion
@@ -1303,7 +1162,7 @@ namespace DS.WMS.Core.TaskPlat.Method
throw new Exception($"订舱的委托客户不能为空");
}
- var djyCustomerInfo = clientInfoService.GetClientInfoWithContact(new Info.Dtos.QueryClientInfo { ClientId = bookingOrderEntity.CustomerId})
+ var djyCustomerInfo = clientInfoService.GetClientInfoWithContact(new Info.Dtos.QueryClientInfo { ClientId = bookingOrderEntity.CustomerId })
.GetAwaiter().GetResult().Data;
if (djyCustomerInfo == null)
@@ -1350,7 +1209,7 @@ namespace DS.WMS.Core.TaskPlat.Method
if (usePersonalEmailSend)
{
publicMailAccount = _userEmailService.GetEmailSettings().GetAwaiter().GetResult().Data;
- //&& x.SmtpPort > 0 && x.SmtpServer != null && x.SmtpServer != "");
+ //&& x.SmtpPort > 0 && x.SmtpServer != null && x.SmtpServer != "");
}
else
{
@@ -1490,7 +1349,7 @@ namespace DS.WMS.Core.TaskPlat.Method
//new EmailNoticeHelper().SendEmailNotice($"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败", $"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败,原因:{ex.Message}", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList());
}
- if(!result)
+ if (!result)
return DataResult.Failed(msg);
return DataResult.Successed(msg);
@@ -2094,7 +1953,7 @@ namespace DS.WMS.Core.TaskPlat.Method
{
//更新订舱相关内容
- if(paramConfig.Equals("ENABLE", StringComparison.OrdinalIgnoreCase))
+ if (paramConfig.Equals("ENABLE", StringComparison.OrdinalIgnoreCase))
{
await GenerateSendEmail(taskBcInfo, taskBaseInfo, orderInfo);
}
@@ -2105,7 +1964,7 @@ namespace DS.WMS.Core.TaskPlat.Method
}
}
catch (Exception ex)
- {
+ {
}
return DataResult.Successed("");
diff --git a/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user b/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user
index 0ab25a41..f2a959bf 100644
--- a/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user
+++ b/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user
@@ -1,6 +1,6 @@
- FolderProfile
+ D:\Code\ds8-solution-pro\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml
\ No newline at end of file
From b554bde49b7fc06a6ad5c65b7450165cb550ef49 Mon Sep 17 00:00:00 2001
From: cjy
Date: Tue, 6 Aug 2024 15:16:07 +0800
Subject: [PATCH 6/8] =?UTF-8?q?=E6=B5=B7=E8=BF=90=E5=87=BA=E5=8F=A3?=
=?UTF-8?q?=E6=97=A5=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DS.WMS.Core/Op/Dtos/OpBusinessLogRes.cs | 63 +++++++++++
.../Op/Interface/ISeaExportCommonService.cs | 2 +-
.../Op/Interface/ISeaExportService.cs | 9 +-
.../Op/Method/DataCallBackService.cs | 80 ++++++++++---
.../Op/Method/SeaExportCommonService.cs | 107 +++++++++---------
.../DS.WMS.Core/Op/Method/SeaExportService.cs | 39 +++++--
.../Controllers/SeaExportController.cs | 18 ++-
.../DS.WMS.Test/SaasDBUpdateTest.cs | 2 +-
8 files changed, 241 insertions(+), 79 deletions(-)
create mode 100644 ds-wms-service/DS.WMS.Core/Op/Dtos/OpBusinessLogRes.cs
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/OpBusinessLogRes.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/OpBusinessLogRes.cs
new file mode 100644
index 00000000..c0bceb84
--- /dev/null
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/OpBusinessLogRes.cs
@@ -0,0 +1,63 @@
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DS.WMS.Core.Op.Dtos
+{
+ public class OpBusinessLogRes
+ {
+ ///
+ /// 主键Id
+ ///
+ public long Id { get; set; }
+ ///
+ /// 业务id
+ ///
+ public long? BusinessId { get; set; }
+ ///
+ /// 操作方式:新增(Create)、更新(Update)、删除(Delete)
+ ///
+
+ public string OperateType { get; set; }
+ ///
+ /// 旧值
+ ///
+ public string OldValue { get; set; }
+ ///
+ /// 新值
+ ///
+ public string NewValue { get; set; }
+ ///
+ /// 差异数据
+ ///
+ public string DiffData { get; set; }
+
+ ///
+ /// 业务来源代码
+ ///
+
+ public string SourceCode { get; set; }
+ ///
+ /// 业务来源
+ ///
+
+ public string SourceName { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [Description("创建时间")]
+ public DateTime CreateTime { get; set; }
+
+
+ ///
+ /// 创建人名称
+ ///
+ [Description("创建人名称")]
+ public string CreateUserName { get; set; }
+ }
+}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportCommonService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportCommonService.cs
index 9d119902..235a79ba 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportCommonService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportCommonService.cs
@@ -19,7 +19,7 @@ namespace DS.WMS.Core.Op.Interface
///
///
///
- public Task SaveSeaExportLog(SeaExportSaveLog req);
+ public Task SaveSeaExportLogAsync(SeaExportSaveLog req, SqlSugarScopeProvider tenantDb);
///
/// 获取第三方账户
///
diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs
index cddc794e..f8ee51d4 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs
@@ -43,7 +43,7 @@ public interface ISeaExportService
///
///
///
- DataResult SeaExportBatchEdit(SeaExportBatchEditReq req);
+ Task SeaExportBatchEdit(SeaExportBatchEditReq req);
///
/// 业务单据删除
@@ -219,4 +219,11 @@ public interface ISeaExportService
///
///
public Task PrintShippingOrderLetterPDF(string id);
+
+ ///
+ /// 获取海运出口日志
+ ///
+ /// 业务Id
+ ///
+ public Task>> GetSeaExportLogList(string id);
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/DataCallBackService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/DataCallBackService.cs
index 7796de50..5b7505bc 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Method/DataCallBackService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Method/DataCallBackService.cs
@@ -366,6 +366,7 @@ namespace DS.WMS.Core.Op.Method
if (config.IsNotNull() && config.Value == "YES")
{
var order = await tenantDb.Queryable().Where(x => x.Id == businessId && x.MBLNO == item.MBLNO).FirstAsync();
+ var oldOrder = order.Adapt();
if (item.Status == "ATD")
{
//2023-8-31,排查单号为177GZHZHQ5711V的数据,原来录入的船已开船,运踪港前不再查询,而因订阅港后数据会继续回推数据,所以导致ATD被改
@@ -377,12 +378,20 @@ namespace DS.WMS.Core.Op.Method
if (order != null && item.OpTime != null && order.ATD != item.OpTime)
{
order.ATD = item.OpTime;
- order.Note = "运踪回调更新ATD";
+ //order.Note = "运踪回调更新ATD";
await tenantDb.Updateable(order).UpdateColumns(x => new
{
- x.ATD,
- x.Note
+ x.ATD
}).EnableDiffLogEvent().ExecuteCommandAsync();
+ // 记录日志
+ await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog()
+ {
+ OperateType = "Update",
+ OldOrder = oldOrder,
+ NewOrder = order,
+ SourceCode = "TraceUpdteATD",
+ SourceName = "运踪回调更新ATD",
+ }, tenantDb);
//sendDsList.Add(item.BookingId);
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
@@ -416,11 +425,20 @@ namespace DS.WMS.Core.Op.Method
if (order != null && item.OpTime != null && order.YgtETD != item.OpTime)
{
order.YgtETD = item.OpTime;
- order.Note = "运踪回调更新YgtETD";
+ //order.Note = "运踪回调更新YgtETD";
await tenantDb.Updateable(order).UpdateColumns(x => new
{
x.YgtETD,x.Note
}).EnableDiffLogEvent().ExecuteCommandAsync();
+ // 记录日志
+ await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog()
+ {
+ OperateType = "Update",
+ OldOrder = oldOrder,
+ NewOrder = order,
+ SourceCode = "TraceUpdteYgtETD",
+ SourceName = "运踪回调更新YgtETD",
+ }, tenantDb);
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
}
@@ -429,11 +447,20 @@ namespace DS.WMS.Core.Op.Method
if (order != null && item.OpTime != null && order.StartATA != item.OpTime)
{
order.StartATA = item.OpTime;
- order.Note = "运踪回调更新StartATA";
+ //order.Note = "运踪回调更新StartATA";
await tenantDb.Updateable(order).UpdateColumns(x => new
{
- x.StartATA, x.Note
+ x.StartATA
}).EnableDiffLogEvent().ExecuteCommandAsync();
+ // 记录日志
+ await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog()
+ {
+ OperateType = "Update",
+ OldOrder = oldOrder,
+ NewOrder = order,
+ SourceCode = "TraceUpdteStartATA",
+ SourceName = "运踪回调更新StartATA",
+ }, tenantDb);
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
}
@@ -442,11 +469,20 @@ namespace DS.WMS.Core.Op.Method
if (order != null && item.OpTime != null && order.StartETA != item.OpTime)
{
order.StartETA = item.OpTime;
- order.Note = "运踪回调更新StartETA";
+ //order.Note = "运踪回调更新StartETA";
await tenantDb.Updateable(order).UpdateColumns(x => new
{
- x.StartETA,x.Note
+ x.StartETA
}).EnableDiffLogEvent().ExecuteCommandAsync();
+ // 记录日志
+ await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog()
+ {
+ OperateType = "Update",
+ OldOrder = oldOrder,
+ NewOrder = order,
+ SourceCode = "TraceUpdteStartETA",
+ SourceName = "运踪回调更新StartETA",
+ }, tenantDb);
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
}
@@ -455,11 +491,20 @@ namespace DS.WMS.Core.Op.Method
if (order != null && item.OpTime != null && order.ETA != item.OpTime)
{
order.ETA = item.OpTime;
- order.Note = "运踪回调更新ETA";
+ //order.Note = "运踪回调更新ETA";
await tenantDb.Updateable(order).UpdateColumns(x => new
{
- x.ETA,x.Note
+ x.ETA
}).EnableDiffLogEvent().ExecuteCommandAsync();
+ // 记录日志
+ await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog()
+ {
+ OperateType = "Update",
+ OldOrder = oldOrder,
+ NewOrder = order,
+ SourceCode = "TraceUpdteMDGETA",
+ SourceName = "运踪回调更新ETA",
+ }, tenantDb);
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
@@ -467,13 +512,22 @@ namespace DS.WMS.Core.Op.Method
else if (item.Status == "MDGATA")
{
if (order != null && item.OpTime != null && order.ATA != item.OpTime)
- {
+ {
order.ATA = item.OpTime;
- order.Note = "运踪回调更新ATA";
+ //order.Note = "运踪回调更新ATA";
await tenantDb.Updateable(order).UpdateColumns(x => new
{
- x.ATA,x.Note
+ x.ATA
}).EnableDiffLogEvent().ExecuteCommandAsync();
+ // 记录日志
+ await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog()
+ {
+ OperateType = "Update",
+ OldOrder = oldOrder,
+ NewOrder = order,
+ SourceCode = "TraceUpdteMDGATA",
+ SourceName = "运踪更新船期ATA",
+ }, tenantDb);
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportCommonService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportCommonService.cs
index 53355381..491ea81d 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportCommonService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportCommonService.cs
@@ -26,6 +26,9 @@ using System.Text;
using System.Text.RegularExpressions;
using Logger = NLog.Logger;
using AnyDiff.Extensions;
+using static AnyDiff.DifferenceLines;
+using Newtonsoft.Json;
+using Masuit.Tools.Hardware;
namespace DS.WMS.Core.Op.Method
{
@@ -53,6 +56,7 @@ namespace DS.WMS.Core.Op.Method
_environment = _serviceProvider.GetRequiredService();
}
+ #region 海运出口差异日志
///
/// 忽略的字段
///
@@ -70,63 +74,42 @@ namespace DS.WMS.Core.Op.Method
"TenantId",
"TenantName",
};
- public async Task SaveSeaExportLog(SeaExportSaveLog req) {
-
-
- bool flag = true;
- long bid = 0;
+ public async Task SaveSeaExportLogAsync(SeaExportSaveLog req, SqlSugarScopeProvider tenantDb)
+ {
var diff = req.NewOrder.Diff(req.OldOrder);
- //var obj1 = new { Name = "Tom", Age = 20 };
- //var obj2 = new { Name = "Jerry", Age = 21 };
- //var diff = obj1.Diff(obj2).ToList();
- foreach (var change in diff)
- {
- Console.WriteLine($"{change.PropertyType} - {change.Property}: {change.LeftValue} => {change.RightValue}");
- }
-
- //foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(req.NewOrder))
- //{
- // //基础字段不记录
- // string name = descriptor.Name;
- // if (IgnoreColumns.Contains(name))
- // {
- // continue;
- // }
- // // 如果已经明确了被修改的字段,且当前字段不在其中,则跳过
- // if (req.UpdateFields.IsNotNull() && !req.UpdateFields.Contains(name))
- // {
- // continue;
- // }
- // object value = descriptor.GetValue(req.NewOrder);
- // var oldvalue = req.OldOrder.GetType().GetProperty(name).GetValue(req.OldOrder, null);
- // //数值类型转换比较
- // if (name == "KGS" || name == "CBM")
- // {
- // if (Convert.ToDecimal(value) == Convert.ToDecimal(oldvalue))
- // {
- // continue;
- // }
- // }
- // string _oldvalue = oldvalue != null ? oldvalue.ToString() : "";
- // string _value = value != null ? value.ToString() : "";
-
- // if (_oldvalue != _value && !string.IsNullOrWhiteSpace(descriptor.Description))
- // {
- // var data = new OpBusinessLog()
- // {
- // BusinessId = req.OldOrder.Id,
- // OldValue = JsonConvert.SerializeObject(req.OldOrder),
- // NewValue= JsonConvert.SerializeObject(req.NewOrder),
-
- // };
- // }
- //}
+ StringBuilder sb = new StringBuilder();
+ foreach (var item in diff)
+ {
+ Console.WriteLine($"{item.PropertyType} - {item.Property}: {item.LeftValue} => {item.RightValue}");
+ if (item.LeftValue.IsNotNull() && item.RightValue.IsNotNull())
+ {
+ if (IgnoreColumns.Contains(item.Property))
+ continue;
+ if (!item.LeftValue.Equals(item.RightValue))
+ {
+ sb.Append($"[字段:{item.Property},修改前:{item.LeftValue},修改后:{item.RightValue}]");
+ }
+ }
+ }
- }
+ var log = new OpBusinessLog()
+ {
+ BusinessId = req.NewOrder.Id,
+ OperateType = "Update",
+ OldValue = JsonConvert.SerializeObject(req.OldOrder),
+ NewValue = JsonConvert.SerializeObject(req.NewOrder),
+ DiffData = sb.ToString(),
+ SourceCode = req.SourceCode,
+ SourceName = req.SourceName,
+ };
+ await tenantDb.Insertable(log).ExecuteCommandAsync();
+ }
+ #endregion
+
#region 获取客户结算方式及结算日期
public DataResult GetCustomerStlInfo(CustomerStlReq req)
@@ -928,10 +911,19 @@ namespace DS.WMS.Core.Op.Method
{
StatusName = "";
}
+ var oldOrder = order.Adapt();
order.BusinessStatusName = StatusName;
- order.Note = "更新主单货物状态";
+ //order.Note = "更新主单货物状态";
await tenantDb.Updateable(order).EnableDiffLogEvent().ExecuteCommandAsync();
// 记录日志
+ await SaveSeaExportLogAsync(new SeaExportSaveLog()
+ {
+ OperateType = "Update",
+ OldOrder = oldOrder,
+ NewOrder = order,
+ SourceCode = "UpdteBusinessStatusName",
+ SourceName = "自动更新货物状态",
+ }, tenantDb);
//var newOrder = order.Adapt();
//newOrder.BSSTATUSNAME = StatusName;
//await SaveLog(newOrder, order, "自动更新货物状态");
@@ -2066,7 +2058,7 @@ namespace DS.WMS.Core.Op.Method
{
return await Task.FromResult(DataResult.Failed("海运出口信息业务已锁定!", MultiLanguageConst.SeaExportBusinessLock));
}
-
+ var oldOrder = order.Adapt();
var dic = req.GetPropertiesArray();
var info = req.Adapt(order);
info.Note = "对外开放更新接口";
@@ -2097,7 +2089,14 @@ namespace DS.WMS.Core.Op.Method
}
#endregion
await tenantDb.Updateable(info).UpdateColumns(dic).EnableDiffLogEvent().ExecuteCommandAsync();
-
+ await SaveSeaExportLogAsync(new SeaExportSaveLog()
+ {
+ OperateType = "Update",
+ OldOrder = oldOrder,
+ NewOrder = info,
+ SourceCode = "OpenEdit",
+ SourceName = "开放对接更新",
+ }, tenantDb);
return await Task.FromResult(DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess));
}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs
index 8b21bef9..8f202dc9 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs
@@ -415,6 +415,21 @@ public partial class SeaExportService : ISeaExportService
return result;
}
+
+ ///
+ /// 获取海运出口日志
+ ///
+ /// 业务Id
+ ///
+ public async Task>> GetSeaExportLogList(string id) {
+
+ var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
+ var data = await tenantDb.Queryable()
+ .Where(a => a.BusinessId == long.Parse(id))
+ .Select()
+ .ToListAsync();
+ return await Task.FromResult(DataResult>.Success(data, MultiLanguageConst.DataQuerySuccess));
+ }
///
/// 编辑
///
@@ -514,14 +529,14 @@ public partial class SeaExportService : ISeaExportService
//添加操作权限
var operationRule = commonService.GetOperationRuleConditional();
var info = await tenantDb.Queryable().Where(x => x.Id == req.Id).WhereFilterOperationRule(operationRule).FirstAsync();
+ var oldOrder = info.Adapt();
var feeStatus = await tenantDb.Queryable().Where(x => x.BusinessId == req.Id).FirstAsync();
if (feeStatus.IsNotNull() && (bool)feeStatus.IsBusinessLocking)
{
return await Task.FromResult(DataResult.Failed("海运出口信息业务已锁定!", MultiLanguageConst.SeaExportBusinessLock));
}
- var oldOrder = info;
- info = req.Adapt(info);
+ info= req.Adapt(info);
//TODO 会计期间不允许小于已结转期间
if (info.CloseDocDate.IsNotNull() && info.CloseDocDate > info.ETD)
{
@@ -556,14 +571,14 @@ public partial class SeaExportService : ISeaExportService
info.Note = "正常编辑";
await tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommandAsync();
- await seaComService.SaveSeaExportLog(new SeaExportSaveLog()
+ await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog()
{
OperateType = "Update",
OldOrder = oldOrder,
NewOrder = info,
SourceCode = "NormalEdit",
SourceName = "正常编辑",
- });
+ },tenantDb);
//处理订单联系人信息
DealBusinessOrderContact(info, tenantDb);
@@ -752,7 +767,7 @@ public partial class SeaExportService : ISeaExportService
///
///
///
- public DataResult SeaExportBatchEdit(SeaExportBatchEditReq req)
+ public async Task SeaExportBatchEdit(SeaExportBatchEditReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (req.Ids.Count == 0)
@@ -775,15 +790,25 @@ public partial class SeaExportService : ISeaExportService
return DataResult.Failed("海运出口信息费用已锁定!", MultiLanguageConst.SeaExportFeeLock);
}
}
- var orderList = tenantDb.Queryable().Where(x => req.Ids.Contains(x.Id)).ToList();
+ var orderList = await tenantDb.Queryable().Where(x => req.Ids.Contains(x.Id)).ToListAsync();
var dic = req.GetPropertiesArray();
foreach (var item in orderList)
{
+ var oldOrder = item.Adapt();
var info = req.Adapt(item);
info.Note = "批量更新";
- tenantDb.Updateable(info).UpdateColumns(dic).EnableDiffLogEvent().ExecuteCommand();
+ await tenantDb.Updateable(info).UpdateColumns(dic).EnableDiffLogEvent().ExecuteCommandAsync();
+
+ await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog()
+ {
+ OperateType = "Update",
+ OldOrder = oldOrder,
+ NewOrder = info,
+ SourceCode = "BatchEdit",
+ SourceName = "批量更新",
+ }, tenantDb);
}
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs
index e38e0946..24a67eda 100644
--- a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs
+++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs
@@ -59,6 +59,20 @@ public class SeaExportController : ApiController
var res = await _invokeService.GetSeaExportPartList(request);
return res;
}
+
+
+ ///
+ /// 海运出口日志列表
+ ///
+ /// 主单id
+ ///
+ [HttpGet]
+ [Route("GetSeaExportLogList")]
+ public async Task>> GetSeaExportLogList([FromQuery] string id)
+ {
+ var res = await _invokeService.GetSeaExportLogList(id);
+ return res;
+ }
///
/// 编辑
///
@@ -92,9 +106,9 @@ public class SeaExportController : ApiController
///
[HttpPost]
[Route("SeaExportBatchEdit")]
- public DataResult SeaExportBatchEdit([FromBody] SeaExportBatchEditReq req)
+ public async Task SeaExportBatchEdit([FromBody] SeaExportBatchEditReq req)
{
- var res = _invokeService.SeaExportBatchEdit(req);
+ var res = await _invokeService.SeaExportBatchEdit(req);
return res;
}
diff --git a/ds-wms-service/DS.WMS.Test/SaasDBUpdateTest.cs b/ds-wms-service/DS.WMS.Test/SaasDBUpdateTest.cs
index ea63fdd0..0b3bbc3e 100644
--- a/ds-wms-service/DS.WMS.Test/SaasDBUpdateTest.cs
+++ b/ds-wms-service/DS.WMS.Test/SaasDBUpdateTest.cs
@@ -60,7 +60,7 @@ public class SaasDBUpdateTest
var tenantDb = saasService.GetBizDbScopeById(item.TenantId).CopyNew();
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci"; //较高版本支持
//tenantDb.CodeFirst.InitTables(types); //指定表空间下的实体
- tenantDb.CodeFirst.InitTables(typeof(OpLetterYard));//指定更新特定实体
+ tenantDb.CodeFirst.InitTables(typeof(OpBusinessLog));//指定更新特定实体
}
Assert.True(true);
From 6be6a8e4843f9395881053e9ed518ac6370bd8c9 Mon Sep 17 00:00:00 2001
From: cjy
Date: Tue, 6 Aug 2024 15:35:30 +0800
Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DS.WMS.Core/Op/Dtos/ShippingBillTemplateReq.cs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/ShippingBillTemplateReq.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/ShippingBillTemplateReq.cs
index 98b19834..3aeb3cd8 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Dtos/ShippingBillTemplateReq.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/ShippingBillTemplateReq.cs
@@ -50,6 +50,11 @@ namespace DS.WMS.Core.Op.Dtos
/// 类型 1 收 2 发 3 通
///
public string Type { get; set; }
+
+ ///
+ /// 模板内容
+ ///
+ public string Content { get; set; }
///
/// 备注
///
From 85a10ce9b46de8009403b35df1ca91416d4e9659 Mon Sep 17 00:00:00 2001
From: cjy
Date: Tue, 6 Aug 2024 17:24:14 +0800
Subject: [PATCH 8/8] =?UTF-8?q?=E6=B5=B7=E8=BF=90=E5=87=BA=E5=8F=A3?=
=?UTF-8?q?=E7=BC=96=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DS.WMS.Core/Op/Dtos/SeaExportEdiReq.cs | 34 ----------------
.../DS.WMS.Core/Op/Dtos/SeaExportEdiRes.cs | 40 +------------------
.../DS.WMS.Core/Op/Dtos/SeaExportReq.cs | 36 +++++++++++++++++
.../DS.WMS.Core/Op/Dtos/SeaExportRes.cs | 40 +++++++++++++++++++
.../DS.WMS.PrintApi/Model/OpenSqlPrintReq.cs | 4 ++
5 files changed, 81 insertions(+), 73 deletions(-)
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportEdiReq.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportEdiReq.cs
index d9535dda..88765146 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportEdiReq.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportEdiReq.cs
@@ -195,39 +195,5 @@ namespace DS.WMS.Core.Op.Dtos
public string CNPTNo { get; set; }
- ///
- /// 装运方式代码 整箱、拼箱单票、拼箱主票、拼箱分票代码
- ///
- public string BLTypeCode { get; set; }
-
- ///
- /// Desc:结算方式代码
- ///
- public string StlCode { get; set; }
-
-
- ///
- /// Desc:贸易方式代码
- ///
- public string TermDeliveryCdoe { get; set; }
-
- ///
- /// Desc:贸易条款代码
- ///
- public string TradeTermCode { get; set; }
-
- ///
- /// 签单方式代码 t_code_issutype
- ///
- public string IssueTypeCode { get; set; }
-
- ///
- /// Desc:MBL付费方式代码 t_code_frt
- ///
- public string MBLFrtCode { get; set; }
- ///
- /// 运输条款代码 CY-CY t_code_service
- ///
- public string ServiceCode { get; set; }
}
}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportEdiRes.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportEdiRes.cs
index 175860d4..dc0a5baa 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportEdiRes.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportEdiRes.cs
@@ -189,44 +189,6 @@ namespace DS.WMS.Core.Op.Dtos
///
public string EmcNameAccount { get; set; }
- ///
- /// CNPTNo
- ///
- public string CNPTNo { get; set; }
-
- ///
- /// 装运方式代码 整箱、拼箱单票、拼箱主票、拼箱分票代码
- ///
- public string BLTypeCode { get; set; }
-
- ///
- /// Desc:结算方式代码
- ///
- public string StlCode { get; set; }
-
-
- ///
- /// Desc:贸易方式代码
- ///
- public string TermDeliveryCdoe { get; set; }
-
- ///
- /// Desc:贸易条款代码
- ///
- public string TradeTermCode { get; set; }
-
- ///
- /// 签单方式代码 t_code_issutype
- ///
- public string IssueTypeCode { get; set; }
-
- ///
- /// Desc:MBL付费方式代码 t_code_frt
- ///
- public string MBLFrtCode { get; set; }
- ///
- /// 运输条款代码 CY-CY t_code_service
- ///
- public string ServiceCode { get; set; }
+
}
}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs
index da0c03b9..d27671ef 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs
@@ -1079,6 +1079,42 @@ public class SeaExportReq
/// 国内发货人 t_info_client CUSTNAME
///
public string ShipperCn { get; set; }
+
+
+ ///
+ /// 装运方式代码 整箱、拼箱单票、拼箱主票、拼箱分票代码
+ ///
+ public string BLTypeCode { get; set; }
+
+ ///
+ /// Desc:结算方式代码
+ ///
+ public string StlCode { get; set; }
+
+
+ ///
+ /// Desc:贸易方式代码
+ ///
+ public string TermDeliveryCdoe { get; set; }
+
+ ///
+ /// Desc:贸易条款代码
+ ///
+ public string TradeTermCode { get; set; }
+
+ ///
+ /// 签单方式代码 t_code_issutype
+ ///
+ public string IssueTypeCode { get; set; }
+
+ ///
+ /// Desc:MBL付费方式代码 t_code_frt
+ ///
+ public string MBLFrtCode { get; set; }
+ ///
+ /// 运输条款代码 CY-CY t_code_service
+ ///
+ public string ServiceCode { get; set; }
}
///
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs
index 2bcb0ca2..ed4f5aab 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs
@@ -1271,4 +1271,44 @@ public class SeaExportRes
/// 最后格式单比对时间
///
public Nullable LstDraftCompareDate { get; set; }
+
+ ///
+ /// CNPTNo
+ ///
+ public string CNPTNo { get; set; }
+
+ ///
+ /// 装运方式代码 整箱、拼箱单票、拼箱主票、拼箱分票代码
+ ///
+ public string BLTypeCode { get; set; }
+
+ ///
+ /// Desc:结算方式代码
+ ///
+ public string StlCode { get; set; }
+
+
+ ///
+ /// Desc:贸易方式代码
+ ///
+ public string TermDeliveryCdoe { get; set; }
+
+ ///
+ /// Desc:贸易条款代码
+ ///
+ public string TradeTermCode { get; set; }
+
+ ///
+ /// 签单方式代码 t_code_issutype
+ ///
+ public string IssueTypeCode { get; set; }
+
+ ///
+ /// Desc:MBL付费方式代码 t_code_frt
+ ///
+ public string MBLFrtCode { get; set; }
+ ///
+ /// 运输条款代码 CY-CY t_code_service
+ ///
+ public string ServiceCode { get; set; }
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.WMS.PrintApi/Model/OpenSqlPrintReq.cs b/ds-wms-service/DS.WMS.PrintApi/Model/OpenSqlPrintReq.cs
index 7d43c14b..e88d497c 100644
--- a/ds-wms-service/DS.WMS.PrintApi/Model/OpenSqlPrintReq.cs
+++ b/ds-wms-service/DS.WMS.PrintApi/Model/OpenSqlPrintReq.cs
@@ -19,6 +19,10 @@
///
public string TemplateCode { get; set; }
///
+ /// 主键id
+ ///
+ public long Id { get; set; }
+ ///
/// 主键ids
///
public long[] Ids { get; set; }