feat: 销售产品对客说明字段与保存接口
支持 CustomerGuideMarkdown 存储、迁移脚本及 customer-guide/save API,完善销售产品详情输出。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
3818ce7876
commit
27e7ade388
3
db.sql
3
db.sql
@ -413,6 +413,7 @@ CREATE TABLE `t_sales_product` (
|
|||||||
`WeightRoundingId` INT NULL COMMENT '计重进位ID',
|
`WeightRoundingId` INT NULL COMMENT '计重进位ID',
|
||||||
`ProductDescription` TEXT COMMENT '产品描述',
|
`ProductDescription` TEXT COMMENT '产品描述',
|
||||||
`PreStorageScript` TEXT COMMENT '入库前脚本',
|
`PreStorageScript` TEXT COMMENT '入库前脚本',
|
||||||
|
`CustomerGuideMarkdown` MEDIUMTEXT COMMENT '对客说明 Markdown',
|
||||||
`IsActive` TINYINT NOT NULL DEFAULT 1 COMMENT '是否启用',
|
`IsActive` TINYINT NOT NULL DEFAULT 1 COMMENT '是否启用',
|
||||||
`Scheme` VARCHAR(32) NOT NULL COMMENT '排货方案:costLowest/timeFastest/overallBest',
|
`Scheme` VARCHAR(32) NOT NULL COMMENT '排货方案:costLowest/timeFastest/overallBest',
|
||||||
`IsDeleted` TINYINT NOT NULL DEFAULT 0 COMMENT '软删除:0-否,1-是',
|
`IsDeleted` TINYINT NOT NULL DEFAULT 0 COMMENT '软删除:0-否,1-是',
|
||||||
@ -871,7 +872,7 @@ CREATE TABLE `t_customer` (
|
|||||||
`UpdateUserId` INT NULL COMMENT '更新人',
|
`UpdateUserId` INT NULL COMMENT '更新人',
|
||||||
`UpdateTime` DATETIME NULL COMMENT '更新时间',
|
`UpdateTime` DATETIME NULL COMMENT '更新时间',
|
||||||
`Salesman` VARCHAR(32) NULL COMMENT '所属销售员账号',
|
`Salesman` VARCHAR(32) NULL COMMENT '所属销售员账号',
|
||||||
`CustomerService` VARCHAR(32) NULL COMMENT '所属客服账号',
|
`CustomerService` VARCHAR(32) NULL COMMENT '所属顾问',
|
||||||
`CustomerGroup` TINYINT NULL COMMENT '客户分组:0-普通客户,1-VIP1,2-VIP2,3-VIP3,4-VIP4,5-VIP5',
|
`CustomerGroup` TINYINT NULL COMMENT '客户分组:0-普通客户,1-VIP1,2-VIP2,3-VIP3,4-VIP4,5-VIP5',
|
||||||
`LastLoginIp` VARCHAR(64) NULL COMMENT '最后在线IP',
|
`LastLoginIp` VARCHAR(64) NULL COMMENT '最后在线IP',
|
||||||
`LastLoginTime` DATETIME NULL COMMENT '最后在线时间',
|
`LastLoginTime` DATETIME NULL COMMENT '最后在线时间',
|
||||||
|
|||||||
4
sql/migrate_t_sales_product_customer_guide.sql
Normal file
4
sql/migrate_t_sales_product_customer_guide.sql
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
-- 销售产品表增加对客说明 Markdown 字段
|
||||||
|
|
||||||
|
ALTER TABLE `t_sales_product`
|
||||||
|
ADD COLUMN `CustomerGuideMarkdown` MEDIUMTEXT NULL COMMENT '对客说明 Markdown' AFTER `PreStorageScript`;
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
namespace Oms.Application.Dtos.Channels;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 销售产品对客说明保存入参。
|
||||||
|
/// </summary>
|
||||||
|
public class SalesProductCustomerGuideSaveInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 销售产品主键。
|
||||||
|
/// </summary>
|
||||||
|
public int SalesProductId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对客说明 Markdown 正文。
|
||||||
|
/// </summary>
|
||||||
|
public string? CustomerGuideMarkdown { get; set; }
|
||||||
|
}
|
||||||
@ -75,6 +75,11 @@ public class SalesProductDetailOutput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? PreStorageScript { get; set; }
|
public string? PreStorageScript { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对客说明 Markdown。
|
||||||
|
/// </summary>
|
||||||
|
public string? CustomerGuideMarkdown { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用。
|
/// 是否启用。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -77,6 +77,11 @@ public class SalesProductSaveInput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? PreStorageScript { get; set; }
|
public string? PreStorageScript { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对客说明 Markdown。
|
||||||
|
/// </summary>
|
||||||
|
public string? CustomerGuideMarkdown { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用。
|
/// 是否启用。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -91,7 +91,7 @@ public class CreateCustomerInput
|
|||||||
public string? Salesman { get; set; }
|
public string? Salesman { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 客服人员。
|
/// 所属顾问。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[StringLength(32)]
|
[StringLength(32)]
|
||||||
public string? CustomerService { get; set; }
|
public string? CustomerService { get; set; }
|
||||||
|
|||||||
@ -83,7 +83,7 @@ public class CustomerOutput
|
|||||||
public string? Salesman { get; set; }
|
public string? Salesman { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 客服人员。
|
/// 所属顾问。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? CustomerService { get; set; }
|
public string? CustomerService { get; set; }
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public class CustomerPaginatedInput
|
|||||||
public string? Salesman { get; set; }
|
public string? Salesman { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 客服人员。
|
/// 所属顾问筛选。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? CustomerService { get; set; }
|
public string? CustomerService { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ public class CustomerPaginatedOutput
|
|||||||
public string? Salesman { get; set; }
|
public string? Salesman { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 客服人员。
|
/// 所属顾问。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? CustomerService { get; set; }
|
public string? CustomerService { get; set; }
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
namespace Oms.Application.Dtos.Customers;
|
namespace Oms.Application.Dtos.Customers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当前客户所属客服(专属顾问)展示信息。
|
/// 当前客户所属顾问展示信息。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CustomerServiceAdvisorOutput
|
public class CustomerServiceAdvisorOutput
|
||||||
{
|
{
|
||||||
|
|||||||
@ -90,7 +90,7 @@ public class UpdateCustomerInput
|
|||||||
public string? Salesman { get; set; }
|
public string? Salesman { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 客服人员。
|
/// 所属顾问。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[StringLength(32)]
|
[StringLength(32)]
|
||||||
public string? CustomerService { get; set; }
|
public string? CustomerService { get; set; }
|
||||||
|
|||||||
@ -214,6 +214,7 @@ public partial class SalesProductService
|
|||||||
WeightRoundingId = product.WeightRoundingId,
|
WeightRoundingId = product.WeightRoundingId,
|
||||||
ProductDescription = product.ProductDescription,
|
ProductDescription = product.ProductDescription,
|
||||||
PreStorageScript = product.PreStorageScript,
|
PreStorageScript = product.PreStorageScript,
|
||||||
|
CustomerGuideMarkdown = product.CustomerGuideMarkdown,
|
||||||
IsActive = product.IsActive,
|
IsActive = product.IsActive,
|
||||||
Scheme = product.Scheme
|
Scheme = product.Scheme
|
||||||
};
|
};
|
||||||
@ -317,6 +318,7 @@ public partial class SalesProductService
|
|||||||
entity.WeightRoundingId = input.WeightRoundingId;
|
entity.WeightRoundingId = input.WeightRoundingId;
|
||||||
entity.ProductDescription = input.ProductDescription;
|
entity.ProductDescription = input.ProductDescription;
|
||||||
entity.PreStorageScript = input.PreStorageScript;
|
entity.PreStorageScript = input.PreStorageScript;
|
||||||
|
entity.CustomerGuideMarkdown = input.CustomerGuideMarkdown;
|
||||||
entity.IsActive = input.IsActive;
|
entity.IsActive = input.IsActive;
|
||||||
entity.Scheme = string.IsNullOrWhiteSpace(input.Scheme) ? AllocationSchemeCodes.CostLowest : input.Scheme;
|
entity.Scheme = string.IsNullOrWhiteSpace(input.Scheme) ? AllocationSchemeCodes.CostLowest : input.Scheme;
|
||||||
}
|
}
|
||||||
@ -365,6 +367,7 @@ public partial class SalesProductService
|
|||||||
WeightRoundingId = entity.WeightRoundingId,
|
WeightRoundingId = entity.WeightRoundingId,
|
||||||
ProductDescription = entity.ProductDescription,
|
ProductDescription = entity.ProductDescription,
|
||||||
PreStorageScript = entity.PreStorageScript,
|
PreStorageScript = entity.PreStorageScript,
|
||||||
|
CustomerGuideMarkdown = entity.CustomerGuideMarkdown,
|
||||||
IsActive = (byte)entity.IsActive,
|
IsActive = (byte)entity.IsActive,
|
||||||
Scheme = entity.Scheme,
|
Scheme = entity.Scheme,
|
||||||
CreateTime = entity.CreateTime,
|
CreateTime = entity.CreateTime,
|
||||||
|
|||||||
@ -121,6 +121,19 @@ public partial class SalesProductService : ApplicationService
|
|||||||
await SalesProductRepository.UpdateAsync(entity);
|
await SalesProductRepository.UpdateAsync(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存销售产品对客说明。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input">入参:对客说明 Markdown。</param>
|
||||||
|
/// <returns>无返回体,仅完成保存对客说明。</returns>
|
||||||
|
[HttpPost("/channel/sales-product/customer-guide/save")]
|
||||||
|
public async Task SaveCustomerGuideAsync(SalesProductCustomerGuideSaveInput input)
|
||||||
|
{
|
||||||
|
var entity = await GetProductOrThrowAsync(input.SalesProductId);
|
||||||
|
entity.CustomerGuideMarkdown = input.CustomerGuideMarkdown;
|
||||||
|
await SalesProductRepository.UpdateAsync(entity);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询销售产品价格项列表。
|
/// 查询销售产品价格项列表。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -95,7 +95,7 @@ public class CustomerService : ApplicationService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询当前登录客户所属客服(专属顾问)信息。
|
/// 查询当前登录客户所属顾问信息。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>专属顾问姓名、微信号、微信二维码。</returns>
|
/// <returns>专属顾问姓名、微信号、微信二维码。</returns>
|
||||||
[HttpGet("/customer/service-advisor")]
|
[HttpGet("/customer/service-advisor")]
|
||||||
|
|||||||
@ -33,6 +33,8 @@ public class SalesProduct : OmsAuditedAggregateRoot
|
|||||||
|
|
||||||
public string? PreStorageScript { get; set; }
|
public string? PreStorageScript { get; set; }
|
||||||
|
|
||||||
|
public string? CustomerGuideMarkdown { get; set; }
|
||||||
|
|
||||||
public EnableStatus IsActive { get; set; }
|
public EnableStatus IsActive { get; set; }
|
||||||
|
|
||||||
public string Scheme { get; set; } = string.Empty;
|
public string Scheme { get; set; } = string.Empty;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user