From d92eafb8580b23e69786d057d8d99397ed6d56c8 Mon Sep 17 00:00:00 2001
From: lwh <2679599887@qq.com>
Date: Sun, 18 Jun 2023 17:11:01 +0800
Subject: [PATCH] =?UTF-8?q?init=20=E5=88=9D=E5=A7=8B=E5=8C=96=E5=95=86?=
=?UTF-8?q?=E5=93=81=E6=9C=8D=E5=8A=A1=E4=B8=8E=E6=89=BF=E8=AF=BA=E5=85=B3?=
=?UTF-8?q?=E7=B3=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../GoodsServicesRels/GoodsServicesRelDto.cs | 52 +++++++++++
.../GoodsServicesRels/GoodsServicesRel.cs | 68 ++++++++++++++
.../GoodsServicesRels/GoodsServicesRelVo.cs | 52 +++++++++++
.../GoodsServicesRelRepository.cs | 20 ++++
.../GoodsServicesRelService.cs | 92 +++++++++++++++++++
.../IGoodsServicesRelService.cs | 41 +++++++++
6 files changed, 325 insertions(+)
create mode 100644 ARW.Model/Dto/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelDto.cs
create mode 100644 ARW.Model/Models/Business/GoodsManager/GoodsServicesRels/GoodsServicesRel.cs
create mode 100644 ARW.Model/Vo/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelVo.cs
create mode 100644 ARW.Repository/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelRepository.cs
create mode 100644 ARW.Service/Business/BusinessService/GoodsManager/GoodsServicesRels/GoodsServicesRelService.cs
create mode 100644 ARW.Service/Business/IBusinessService/GoodsManager/GoodsServicesRels/IGoodsServicesRelService.cs
diff --git a/ARW.Model/Dto/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelDto.cs b/ARW.Model/Dto/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelDto.cs
new file mode 100644
index 0000000..eb42c38
--- /dev/null
+++ b/ARW.Model/Dto/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelDto.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using ARW.Model.Models.Business.GoodsManager.GoodsServicesRels;
+
+namespace ARW.Model.Dto.Business.GoodsManager.GoodsServicesRels
+{
+ ///
+ /// 商品服务与承诺关系表输入对象
+ ///
+ /// @author 黎文豪
+ /// @date 2023-06-18
+ ///
+ public class GoodsServicesRelDto
+ {
+
+ public int Id { get; set; }
+
+ public long Guid { get; set; }
+
+ [Required(ErrorMessage = "店铺guid不能为空")]
+ public long ShopGuid { get; set; }
+
+ [Required(ErrorMessage = "商品guid不能为空")]
+ public long GoodsGuid { get; set; }
+
+ [Required(ErrorMessage = "服务与承诺guid不能为空")]
+ public long ServiceGuid { get; set; }
+
+
+
+
+
+ }
+
+
+ ///
+ /// 商品服务与承诺关系表查询对象
+ ///
+ /// @author 黎文豪
+ /// @date 2023-06-18
+ ///
+ public class GoodsServicesRelQueryDto : PagerInfo
+ {
+
+ public string ids { get; set; }
+ }
+
+
+
+
+}
diff --git a/ARW.Model/Models/Business/GoodsManager/GoodsServicesRels/GoodsServicesRel.cs b/ARW.Model/Models/Business/GoodsManager/GoodsServicesRels/GoodsServicesRel.cs
new file mode 100644
index 0000000..e7ff1a3
--- /dev/null
+++ b/ARW.Model/Models/Business/GoodsManager/GoodsServicesRels/GoodsServicesRel.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using SqlSugar;
+using OfficeOpenXml.Attributes;
+using Newtonsoft.Json;
+
+namespace ARW.Model.Models.Business.GoodsManager.GoodsServicesRels
+{
+ ///
+ /// 商品服务与承诺关系表,数据实体对象
+ ///
+ /// @author 黎文豪
+ /// @date 2023-06-18
+ ///
+ [SugarTable("tb_goods_services_rel")]
+ public class GoodsServicesRel : BusinessBase
+ {
+
+ ///
+ /// 描述 :
+ /// 空值 : false
+ ///
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
+ public int Id { get; set; }
+
+
+ ///
+ /// 描述 :
+ /// 空值 : false
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
+ public long Guid { get; set; }
+
+
+ ///
+ /// 描述 :店铺guid
+ /// 空值 : false
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(ColumnName = "shop_guid")]
+ public long ShopGuid { get; set; }
+
+
+ ///
+ /// 描述 :商品guid
+ /// 空值 : false
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(ColumnName = "goods_guid")]
+ public long GoodsGuid { get; set; }
+
+
+ ///
+ /// 描述 :服务与承诺guid
+ /// 空值 : false
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(ColumnName = "service_guid")]
+ public long ServiceGuid { get; set; }
+
+
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/ARW.Model/Vo/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelVo.cs b/ARW.Model/Vo/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelVo.cs
new file mode 100644
index 0000000..6ff8489
--- /dev/null
+++ b/ARW.Model/Vo/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelVo.cs
@@ -0,0 +1,52 @@
+using Newtonsoft.Json;
+using OfficeOpenXml.Attributes;
+using SqlSugar;
+using System;
+
+namespace ARW.Model.Vo.Business.GoodsManager.GoodsServicesRels
+{
+ ///
+ /// 商品服务与承诺关系表展示对象
+ ///
+ /// @author 黎文豪
+ /// @date 2023-06-18
+ ///
+ public class GoodsServicesRelVo
+ {
+
+
+ ///
+ /// 描述 :
+ ///
+ public int Id { get; set; }
+
+
+ ///
+ /// 描述 :
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ public long Guid { get; set; }
+
+
+ ///
+ /// 描述 :店铺guid
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ public long ShopGuid { get; set; }
+
+
+ ///
+ /// 描述 :商品guid
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ public long GoodsGuid { get; set; }
+
+
+ ///
+ /// 描述 :服务与承诺guid
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ public long ServiceGuid { get; set; }
+
+ }
+}
diff --git a/ARW.Repository/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelRepository.cs b/ARW.Repository/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelRepository.cs
new file mode 100644
index 0000000..7a2845b
--- /dev/null
+++ b/ARW.Repository/Business/GoodsManager/GoodsServicesRels/GoodsServicesRelRepository.cs
@@ -0,0 +1,20 @@
+using System;
+using Infrastructure.Attribute;
+using ARW.Repository.System;
+using ARW.Model.Models.Business.GoodsManager.GoodsServicesRels;
+
+namespace ARW.Repository.Business.GoodsManager.GoodsServicesRels
+{
+ ///
+ /// 商品服务与承诺关系表仓储
+ ///
+ /// @author 黎文豪
+ /// @date 2023-06-18
+ ///
+ [AppService(ServiceLifetime = LifeTime.Transient)]
+ public class GoodsServicesRelRepository : BaseRepository
+ {
+ #region 业务逻辑代码
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ARW.Service/Business/BusinessService/GoodsManager/GoodsServicesRels/GoodsServicesRelService.cs b/ARW.Service/Business/BusinessService/GoodsManager/GoodsServicesRels/GoodsServicesRelService.cs
new file mode 100644
index 0000000..950bd99
--- /dev/null
+++ b/ARW.Service/Business/BusinessService/GoodsManager/GoodsServicesRels/GoodsServicesRelService.cs
@@ -0,0 +1,92 @@
+using Infrastructure.Attribute;
+using Microsoft.AspNetCore.Http;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Infrastructure;
+using ARW.Model;
+using ARW.Repository;
+using ARW.Repository.Business.GoodsManager.GoodsServicesRels;
+using ARW.Service.Business.IBusinessService.GoodsManager.GoodsServicesRels;
+using ARW.Model.Dto.Business.GoodsManager.GoodsServicesRels;
+using ARW.Model.Models.Business.GoodsManager.GoodsServicesRels;
+using ARW.Model.Vo.Business.GoodsManager.GoodsServicesRels;
+
+namespace ARW.Service.Business.BusinessService.GoodsManager.GoodsServicesRels
+{
+ ///
+ /// 商品服务与承诺关系表接口实现类
+ ///
+ /// @author 黎文豪
+ /// @date 2023-06-18
+ ///
+ [AppService(ServiceType = typeof(IGoodsServicesRelService), ServiceLifetime = LifeTime.Transient)]
+ public class GoodsServicesRelServiceImpl : BaseService, IGoodsServicesRelService
+ {
+ private readonly GoodsServicesRelRepository _GoodsServicesRelRepository;
+
+ public GoodsServicesRelServiceImpl(GoodsServicesRelRepository GoodsServicesRelRepository)
+ {
+ this._GoodsServicesRelRepository = GoodsServicesRelRepository;
+ }
+
+ #region 业务逻辑代码
+
+
+ ///
+ /// 查询商品服务与承诺关系表分页列表
+ ///
+ public async Task> GetGoodsServicesRelList(GoodsServicesRelQueryDto parm)
+ {
+ //开始拼装查询条件d
+ var predicate = Expressionable.Create();
+
+ var query = _GoodsServicesRelRepository
+ .Queryable()
+ .Where(predicate.ToExpression())
+ .OrderBy(s => s.Create_time,OrderByType.Desc)
+ .Select(s => new GoodsServicesRelVo
+ {
+ Id = s.Id,
+ Guid = s.Guid,
+ ShopGuid = s.ShopGuid,
+ GoodsGuid = s.GoodsGuid,
+ ServiceGuid = s.ServiceGuid,
+ });
+
+
+ return await query.ToPageAsync(parm);
+ }
+
+ ///
+ /// 添加或修改商品服务与承诺关系表
+ ///
+ public async Task AddOrUpdateGoodsServicesRel(GoodsServicesRel model)
+ {
+ if (model.GoodsServicesRelId != 0)
+ {
+ var response = await _GoodsServicesRelRepository.UpdateAsync(model);
+ return "修改成功!";
+ }
+ else
+ {
+
+ var response = await _GoodsServicesRelRepository.InsertReturnSnowflakeIdAsync(model);
+ return "添加成功!";
+ }
+ }
+
+ #region Excel处理
+
+
+ #endregion
+
+
+
+#endregion
+
+ }
+}
diff --git a/ARW.Service/Business/IBusinessService/GoodsManager/GoodsServicesRels/IGoodsServicesRelService.cs b/ARW.Service/Business/IBusinessService/GoodsManager/GoodsServicesRels/IGoodsServicesRelService.cs
new file mode 100644
index 0000000..82a179d
--- /dev/null
+++ b/ARW.Service/Business/IBusinessService/GoodsManager/GoodsServicesRels/IGoodsServicesRelService.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ARW.Model;
+using ARW.Model.Dto.Business.GoodsManager.GoodsServicesRels;
+using ARW.Model.Models.Business.GoodsManager.GoodsServicesRels;
+using ARW.Model.Vo.Business.GoodsManager.GoodsServicesRels;
+
+namespace ARW.Service.Business.IBusinessService.GoodsManager.GoodsServicesRels
+{
+ ///
+ /// 商品服务与承诺关系表接口类
+ ///
+ /// @author 黎文豪
+ /// @date 2023-06-18
+ ///
+ public interface IGoodsServicesRelService : IBaseService
+ {
+ ///
+ /// 获取商品服务与承诺关系表分页列表
+ ///
+ ///
+ ///
+ Task> GetGoodsServicesRelList(GoodsServicesRelQueryDto parm);
+
+
+ ///
+ /// 添加或修改商品服务与承诺关系表
+ ///
+ ///
+ ///
+ Task AddOrUpdateGoodsServicesRel(GoodsServicesRel parm);
+
+
+
+
+
+ }
+}