Compare commits
2 Commits
72cbffd477
...
75144dc8e4
Author | SHA1 | Date | |
---|---|---|---|
|
75144dc8e4 | ||
|
235823f460 |
@ -19,14 +19,13 @@ namespace ARW.Model.Dto.Api.ProductsInvolveds
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 涉及产品详情输入对象Api
|
/// 订阅涉及产品
|
||||||
///
|
|
||||||
/// @author lwh
|
/// @author lwh
|
||||||
/// @date 2023-11-23
|
/// @date 2023-11-23
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ProductsInvolvedDtoApi
|
public class ProductsInvolvedDtoApi
|
||||||
{
|
{
|
||||||
[Required(ErrorMessage = "ProductsInvolvedGuid不能为空")]
|
[Required(ErrorMessage = "涉及产品不能为空")]
|
||||||
public long ProductsInvolvedGuid { get; set; }
|
public long ProductsInvolvedGuid { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using ARW.Model.Models.Business.TableDataManage.TableDatas;
|
||||||
|
|
||||||
|
namespace ARW.Model.Dto.Api.TableDataManage.TableDatas
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表格数据查询对象Api
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-11-23
|
||||||
|
/// </summary>
|
||||||
|
public class TableDataQueryDtoApi : PagerInfo
|
||||||
|
{
|
||||||
|
public string Search { get; set; }
|
||||||
|
public string TableDataProcurementContent { get; set; }
|
||||||
|
public string TableDataProcurementUnit { get; set; }
|
||||||
|
public DateTime? BeginTableDataDate { get; set; }
|
||||||
|
public DateTime? EndTableDataDate { get; set; }
|
||||||
|
public DateTime? BeginTableDataDeadline { get; set; }
|
||||||
|
public DateTime? EndTableDataDeadline { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表格数据详情输入对象Api
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-11-23
|
||||||
|
/// </summary>
|
||||||
|
public class TableDataDtoApi
|
||||||
|
{
|
||||||
|
[Required(ErrorMessage = "TableDataId不能为空")]
|
||||||
|
public int TableDataId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -13,15 +13,6 @@ namespace ARW.Model.Vo.Api.ProductsInvolveds
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ProductsInvolvedVoApi
|
public class ProductsInvolvedVoApi
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 描述 :
|
|
||||||
/// </summary>
|
|
||||||
[EpplusIgnore]
|
|
||||||
public int ProductsInvolvedId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述 :
|
/// 描述 :
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -38,11 +29,10 @@ namespace ARW.Model.Vo.Api.ProductsInvolveds
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述 :排序
|
/// 描述 :是否订阅
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[EpplusTableColumn(Header = "排序")]
|
[EpplusTableColumn(Header = "是否订阅")]
|
||||||
public int ProductsInvolvedSort { get; set; }
|
public bool IsSubscribe { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
111
ARW.Model/Vo/Api/TableDataManage/TableDatas/TableDataApiVo.cs
Normal file
111
ARW.Model/Vo/Api/TableDataManage/TableDatas/TableDataApiVo.cs
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using OfficeOpenXml.Attributes;
|
||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace ARW.Model.Vo.Api.TableDataManage.TableDatas
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表格数据展示对象Api
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-11-23
|
||||||
|
/// </summary>
|
||||||
|
public class TableDataVoApi
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :
|
||||||
|
/// </summary>
|
||||||
|
[EpplusIgnore]
|
||||||
|
public int TableDataId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
[EpplusIgnore]
|
||||||
|
public long TableDataGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :采购内容
|
||||||
|
/// </summary>
|
||||||
|
public string TableDataProcurementContent { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :日期
|
||||||
|
/// </summary>
|
||||||
|
public string TableDataDate { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :截至日期
|
||||||
|
/// </summary>
|
||||||
|
public string TableDataDeadline { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :中标金额
|
||||||
|
/// </summary>
|
||||||
|
public decimal TableDataBidWinningPrice { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 涉及产品名称
|
||||||
|
/// </summary>
|
||||||
|
public List<string> ProductsInvolvedName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表格数据详情展示对象Api
|
||||||
|
/// </summary>
|
||||||
|
public class TableDataApiDetailsVo
|
||||||
|
{
|
||||||
|
[EpplusIgnore]
|
||||||
|
public int TableDataId { get; set; }
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
[EpplusIgnore]
|
||||||
|
public long TableDataGuid { get; set; }
|
||||||
|
public string ProductsInvolvedName { get; set; }
|
||||||
|
[EpplusTableColumn(Header = "采购内容")]
|
||||||
|
public string TableDataProcurementContent { get; set; }
|
||||||
|
[EpplusTableColumn(Header = "采购单位名称")]
|
||||||
|
public string TableDataProcurementUnit { get; set; }
|
||||||
|
[EpplusIgnore]
|
||||||
|
public string TableDataProcurementMethod { get; set; }
|
||||||
|
[EpplusIgnore]
|
||||||
|
public string TableDataSupplierName { get; set; }
|
||||||
|
[EpplusIgnore]
|
||||||
|
public string TableDataProjectPricingForm { get; set; }
|
||||||
|
[EpplusIgnore]
|
||||||
|
public string TableDataLink { get; set; }
|
||||||
|
[EpplusTableColumn(Header = "日期", NumberFormat = "yyyy-MM-dd HH:mm:ss")]
|
||||||
|
public string TableDataDate { get; set; }
|
||||||
|
[EpplusIgnore]
|
||||||
|
public string TableDataDeadline { get; set; }
|
||||||
|
[EpplusIgnore]
|
||||||
|
public string TableDataWinningBidde { get; set; }
|
||||||
|
[EpplusIgnore]
|
||||||
|
public decimal TableDataBidWinningPrice { get; set; }
|
||||||
|
[EpplusTableColumn(Header = "是否为中标公告")]
|
||||||
|
public string TableDataIsBidAnnouncement { get; set; }
|
||||||
|
[EpplusTableColumn(Header = "是否是人力资源池或框架协议")]
|
||||||
|
public string TableDataIsHumanResourcePoolOrFrameworkAgreement { get; set; }
|
||||||
|
[EpplusTableColumn(Header = "公告中是否包含多个包/标段/采购内容")]
|
||||||
|
public string TableDataIsMultiple { get; set; }
|
||||||
|
[EpplusTableColumn(Header = "是否仅有一个中标人")]
|
||||||
|
public string TableDataIsOnlyBidder { get; set; }
|
||||||
|
[EpplusIgnore]
|
||||||
|
public string TableDataSingleSource { get; set; }
|
||||||
|
[EpplusIgnore]
|
||||||
|
public string TableDataDetails { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -13,6 +13,7 @@ using ARW.Service.Api.IBusinessService.ProductsInvolveds;
|
|||||||
using ARW.Model.Dto.Api.ProductsInvolveds;
|
using ARW.Model.Dto.Api.ProductsInvolveds;
|
||||||
using ARW.Model.Models.Business.ProductsInvolveds;
|
using ARW.Model.Models.Business.ProductsInvolveds;
|
||||||
using ARW.Model.Vo.Api.ProductsInvolveds;
|
using ARW.Model.Vo.Api.ProductsInvolveds;
|
||||||
|
using ARW.Repository.Business.SubscribeTasks;
|
||||||
|
|
||||||
namespace ARW.Service.Api.BusinessService.ProductsInvolveds
|
namespace ARW.Service.Api.BusinessService.ProductsInvolveds
|
||||||
{
|
{
|
||||||
@ -26,21 +27,23 @@ namespace ARW.Service.Api.BusinessService.ProductsInvolveds
|
|||||||
public class ProductsInvolvedServiceImplApi : BaseService<ProductsInvolved>, IProductsInvolvedServiceApi
|
public class ProductsInvolvedServiceImplApi : BaseService<ProductsInvolved>, IProductsInvolvedServiceApi
|
||||||
{
|
{
|
||||||
private readonly ProductsInvolvedRepository _ProductsInvolvedRepository;
|
private readonly ProductsInvolvedRepository _ProductsInvolvedRepository;
|
||||||
|
private readonly SubscribeTaskRepository _SubscribeTaskRepository;
|
||||||
|
|
||||||
public ProductsInvolvedServiceImplApi(ProductsInvolvedRepository ProductsInvolvedRepository)
|
public ProductsInvolvedServiceImplApi(ProductsInvolvedRepository ProductsInvolvedRepository, SubscribeTaskRepository subscribeTaskRepository)
|
||||||
{
|
{
|
||||||
this._ProductsInvolvedRepository = ProductsInvolvedRepository;
|
this._ProductsInvolvedRepository = ProductsInvolvedRepository;
|
||||||
|
_SubscribeTaskRepository = subscribeTaskRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Api接口代码
|
#region Api接口代码
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询涉及产品列表(Api)
|
/// 查询涉及产品列表(Api)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parm"></param>
|
/// <param name="parm"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<PagedInfo<ProductsInvolvedVoApi>> GetProductsInvolvedListApi(ProductsInvolvedQueryDtoApi parm)
|
public async Task<PagedInfo<ProductsInvolvedVoApi>> GetProductsInvolvedListApi(ProductsInvolvedQueryDtoApi parm, long userId)
|
||||||
{
|
{
|
||||||
//开始拼装查询条件d
|
//开始拼装查询条件d
|
||||||
var predicate = Expressionable.Create<ProductsInvolved>();
|
var predicate = Expressionable.Create<ProductsInvolved>();
|
||||||
@ -49,44 +52,30 @@ namespace ARW.Service.Api.BusinessService.ProductsInvolveds
|
|||||||
var query = _ProductsInvolvedRepository
|
var query = _ProductsInvolvedRepository
|
||||||
.Queryable()
|
.Queryable()
|
||||||
.Where(predicate.ToExpression())
|
.Where(predicate.ToExpression())
|
||||||
.OrderBy(s => s.ProductsInvolvedSort,OrderByType.Desc)
|
.OrderBy(s => s.ProductsInvolvedSort, OrderByType.Asc)
|
||||||
.Select(s => new ProductsInvolvedVoApi
|
.Select(s => new ProductsInvolvedVoApi
|
||||||
{
|
{
|
||||||
ProductsInvolvedId = s.ProductsInvolvedId,
|
ProductsInvolvedGuid = s.ProductsInvolvedGuid,
|
||||||
ProductsInvolvedGuid = s.ProductsInvolvedGuid,
|
ProductsInvolvedName = s.ProductsInvolvedName
|
||||||
ProductsInvolvedName = s.ProductsInvolvedName,
|
});
|
||||||
ProductsInvolvedSort = s.ProductsInvolvedSort,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
return await query.ToPageAsync(parm);
|
|
||||||
|
var list = await query.ToPageAsync(parm);
|
||||||
|
|
||||||
|
foreach (var item in list.Result)
|
||||||
|
{
|
||||||
|
var task = await _SubscribeTaskRepository.GetFirstAsync(s => s.SubscribeTaskBusinessGuid == item.ProductsInvolvedGuid && s.CustomerGuid == userId);
|
||||||
|
if (task != null)
|
||||||
|
{
|
||||||
|
item.IsSubscribe = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查询涉及产品详情(Api)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="parm"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetProductsInvolvedDetails(ProductsInvolvedDtoApi parm)
|
|
||||||
{
|
|
||||||
|
|
||||||
var query = _ProductsInvolvedRepository
|
#endregion
|
||||||
.Queryable()
|
|
||||||
.Where(s => s.ProductsInvolvedGuid == parm.ProductsInvolvedGuid)
|
|
||||||
.Select(s => new ProductsInvolvedApiDetailsVo
|
|
||||||
{
|
|
||||||
ProductsInvolvedId = s.ProductsInvolvedId,
|
|
||||||
ProductsInvolvedGuid = s.ProductsInvolvedGuid,
|
|
||||||
ProductsInvolvedName = s.ProductsInvolvedName,
|
|
||||||
ProductsInvolvedSort = s.ProductsInvolvedSort,
|
|
||||||
}).Take(1);
|
|
||||||
|
|
||||||
|
|
||||||
return await query.ToJsonAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,179 @@
|
|||||||
|
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 ARW.Model;
|
||||||
|
using ARW.Repository;
|
||||||
|
using ARW.Repository.Business.TableDataManage.TableDatas;
|
||||||
|
using ARW.Service.Api.IBusinessService.TableDataManage.TableDatas;
|
||||||
|
using ARW.Model.Dto.Api.TableDataManage.TableDatas;
|
||||||
|
using ARW.Model.Models.Business.TableDataManage.TableDatas;
|
||||||
|
using ARW.Model.Vo.Api.TableDataManage.TableDatas;
|
||||||
|
using ARW.Model.Models.Business.ProductsInvolveds;
|
||||||
|
using ARW.Repository.Business.ProductsInvolveds;
|
||||||
|
using ARW.Repository.Business.TableDataManage.TableDataProductsInvolves;
|
||||||
|
using ARW.Model.Vo.Api.Custom.Customers;
|
||||||
|
using ARW.Repository.Business.Custom.GoodsBrowsingHistorys;
|
||||||
|
using ARW.Repository.Business.Custom.GoodsCollections;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Senparc.CO2NET.Extensions;
|
||||||
|
using Senparc.Weixin.WxOpen.AdvancedAPIs.WxApp.WxAppJson;
|
||||||
|
|
||||||
|
namespace ARW.Service.Api.BusinessService.TableDataManage.TableDatas
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表格数据接口实现类Api
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-11-23
|
||||||
|
/// </summary>
|
||||||
|
[AppService(ServiceType = typeof(ITableDataServiceApi), ServiceLifetime = LifeTime.Transient)]
|
||||||
|
public class TableDataServiceImplApi : BaseService<TableData>, ITableDataServiceApi
|
||||||
|
{
|
||||||
|
private readonly TableDataRepository _TableDataRepository;
|
||||||
|
private readonly TableDataProductsInvolveRepository _TableDataProductsInvolveRepository;
|
||||||
|
private readonly ProductsInvolvedRepository _ProductsInvolvedRepository;
|
||||||
|
|
||||||
|
public TableDataServiceImplApi(TableDataRepository TableDataRepository, TableDataProductsInvolveRepository tableDataProductsInvolveRepository, ProductsInvolvedRepository productsInvolveRepository)
|
||||||
|
{
|
||||||
|
this._TableDataRepository = TableDataRepository;
|
||||||
|
_TableDataProductsInvolveRepository = tableDataProductsInvolveRepository;
|
||||||
|
_ProductsInvolvedRepository = productsInvolveRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Api接口代码
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询表格数据列表(Api)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<PagedInfo<TableDataVoApi>> GetTableDataListApi(TableDataQueryDtoApi parm)
|
||||||
|
{
|
||||||
|
//开始拼装查询条件d
|
||||||
|
var predicate = Expressionable.Create<TableData>();
|
||||||
|
|
||||||
|
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.Search), s => s.TableDataProcurementContent.Contains(parm.TableDataProcurementContent));
|
||||||
|
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.Search), s => s.TableDataProcurementUnit.Contains(parm.TableDataProcurementUnit));
|
||||||
|
//predicate = predicate.AndIF(parm.BeginTableDataDeadline == null, it => it.TableDataDeadline >= DateTime.Now.AddDays(-1));
|
||||||
|
//predicate = predicate.AndIF(parm.BeginTableDataDeadline != null, it => it.TableDataDeadline >= parm.BeginTableDataDeadline && it.TableDataDeadline <= parm.EndTableDataDeadline);
|
||||||
|
var query = _TableDataRepository
|
||||||
|
.Queryable()
|
||||||
|
.Where(predicate.ToExpression())
|
||||||
|
.OrderBy(s => s.TableDataSort, OrderByType.Desc)
|
||||||
|
.Select(s => new TableDataVoApi
|
||||||
|
{
|
||||||
|
TableDataId = s.TableDataId,
|
||||||
|
TableDataGuid = s.TableDataGuid,
|
||||||
|
TableDataProcurementContent = s.TableDataProcurementContent,
|
||||||
|
TableDataDate = s.TableDataDate.ToString("yyyy-MM-dd"),
|
||||||
|
TableDataDeadline = s.TableDataDeadline.ToString("yyyy-MM-dd"),
|
||||||
|
TableDataBidWinningPrice = s.TableDataBidWinningPrice,
|
||||||
|
});
|
||||||
|
var list = await query.ToPageAsync(parm);
|
||||||
|
|
||||||
|
foreach (var item in list.Result)
|
||||||
|
{
|
||||||
|
var productsInvolvedList = await _TableDataProductsInvolveRepository.GetListAsync(s => s.TableGuid == item.TableDataGuid);
|
||||||
|
if (productsInvolvedList.Count > 0)
|
||||||
|
{
|
||||||
|
List<string> stringName = new List<string>();
|
||||||
|
foreach (var item1 in productsInvolvedList)
|
||||||
|
{
|
||||||
|
var productsInvolved = await _ProductsInvolvedRepository.GetFirstAsync(s => s.ProductsInvolvedId == item1.ProductsInvolvedId);
|
||||||
|
if (productsInvolved != null)
|
||||||
|
{
|
||||||
|
stringName.Add(productsInvolved.ProductsInvolvedName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
item.ProductsInvolvedName = stringName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询表格数据详情(Api)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<string> GetTableDataDetails(TableDataDtoApi parm)
|
||||||
|
{
|
||||||
|
|
||||||
|
var query = _TableDataRepository
|
||||||
|
.Queryable()
|
||||||
|
.Where(s => s.TableDataId == parm.TableDataId)
|
||||||
|
.Select(s => new TableDataApiDetailsVo
|
||||||
|
{
|
||||||
|
TableDataId = s.TableDataId,
|
||||||
|
TableDataGuid = s.TableDataGuid,
|
||||||
|
TableDataProcurementContent = s.TableDataProcurementContent,
|
||||||
|
TableDataProcurementUnit = s.TableDataProcurementUnit,
|
||||||
|
TableDataProcurementMethod = s.TableDataProcurementMethod,
|
||||||
|
TableDataSupplierName = s.TableDataSupplierName,
|
||||||
|
TableDataProjectPricingForm = s.TableDataProjectPricingForm,
|
||||||
|
TableDataLink = s.TableDataLink,
|
||||||
|
TableDataDate = s.TableDataDate.ToString("yyyy-MM-dd"),
|
||||||
|
TableDataDeadline = s.TableDataDeadline.ToString("yyyy-MM-dd"),
|
||||||
|
TableDataWinningBidde = s.TableDataWinningBidde,
|
||||||
|
TableDataBidWinningPrice = s.TableDataBidWinningPrice,
|
||||||
|
TableDataIsBidAnnouncement = s.TableDataIsBidAnnouncement == 1 ? "是" : "否",
|
||||||
|
TableDataIsHumanResourcePoolOrFrameworkAgreement = s.TableDataIsHumanResourcePoolOrFrameworkAgreement == 1 ? "是" : "否",
|
||||||
|
TableDataIsMultiple = s.TableDataIsMultiple == 1 ? "是" : "否",
|
||||||
|
TableDataIsOnlyBidder = s.TableDataIsOnlyBidder == 1 ? "是" : "否",
|
||||||
|
TableDataSingleSource = s.TableDataSingleSource,
|
||||||
|
TableDataDetails = s.TableDataDetails,
|
||||||
|
}).Take(1);
|
||||||
|
|
||||||
|
|
||||||
|
var json = await query.ToJsonAsync();
|
||||||
|
|
||||||
|
if (json != "[]")
|
||||||
|
{
|
||||||
|
json = json.Remove(0, 1);
|
||||||
|
json = json.Substring(0, json.Length - 1);
|
||||||
|
var data = JsonConvert.DeserializeObject<TableDataApiDetailsVo>(json);
|
||||||
|
|
||||||
|
var productsInvolvedList = await _TableDataProductsInvolveRepository.GetListAsync(s => s.TableGuid == data.TableDataGuid);
|
||||||
|
if (productsInvolvedList.Count > 0)
|
||||||
|
{
|
||||||
|
var str = "";
|
||||||
|
List<int> stringId = new List<int>();
|
||||||
|
foreach (var item1 in productsInvolvedList)
|
||||||
|
{
|
||||||
|
var productsInvolved = await _ProductsInvolvedRepository.GetFirstAsync(s => s.ProductsInvolvedId == item1.ProductsInvolvedId);
|
||||||
|
if (productsInvolved != null)
|
||||||
|
{
|
||||||
|
str += productsInvolved.ProductsInvolvedName + ",";
|
||||||
|
stringId.Add(item1.ProductsInvolvedId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 检查字符串是否以逗号结尾
|
||||||
|
if (str.EndsWith(","))
|
||||||
|
{
|
||||||
|
// 去掉字符串末尾的逗号
|
||||||
|
str = str.TrimEnd(',');
|
||||||
|
}
|
||||||
|
data.ProductsInvolvedName = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
json = data.ToJson();
|
||||||
|
}
|
||||||
|
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -23,14 +23,7 @@ namespace ARW.Service.Api.IBusinessService.ProductsInvolveds
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parm"></param>
|
/// <param name="parm"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<PagedInfo<ProductsInvolvedVoApi>> GetProductsInvolvedListApi(ProductsInvolvedQueryDtoApi parm);
|
Task<PagedInfo<ProductsInvolvedVoApi>> GetProductsInvolvedListApi(ProductsInvolvedQueryDtoApi parm,long userId);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取涉及产品详情(Api)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="parm"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<string> GetProductsInvolvedDetails(ProductsInvolvedDtoApi parm);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ARW.Model;
|
||||||
|
using ARW.Model.Dto.Api.TableDataManage.TableDatas;
|
||||||
|
using ARW.Model.Models.Business.TableDataManage.TableDatas;
|
||||||
|
using ARW.Model.Vo.Api.TableDataManage.TableDatas;
|
||||||
|
|
||||||
|
namespace ARW.Service.Api.IBusinessService.TableDataManage.TableDatas
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表格数据接口类Api
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-11-23
|
||||||
|
/// </summary>
|
||||||
|
public interface ITableDataServiceApi : IBaseService<TableData>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取表格数据分页列表(Api)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<PagedInfo<TableDataVoApi>> GetTableDataListApi(TableDataQueryDtoApi parm);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取表格数据详情(Api)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> GetTableDataDetails(TableDataDtoApi parm);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -46,9 +46,9 @@ namespace ARW.Service.Business.BusinessService.SubscribeTasks
|
|||||||
.Queryable()
|
.Queryable()
|
||||||
.Where(predicate.ToExpression())
|
.Where(predicate.ToExpression())
|
||||||
.Where(s => s.SubscribeTaskStatus == 0)
|
.Where(s => s.SubscribeTaskStatus == 0)
|
||||||
.LeftJoin<Customer>((s,f) => s.CustomerGuid == f.CustomerGuid)
|
.LeftJoin<Customer>((s, f) => s.CustomerGuid == f.CustomerGuid)
|
||||||
.OrderBy(s => s.Create_time, OrderByType.Desc)
|
.OrderBy(s => s.Create_time, OrderByType.Desc)
|
||||||
.Select((s,f) => new SubscribeTaskVo
|
.Select((s, f) => new SubscribeTaskVo
|
||||||
{
|
{
|
||||||
SubscribeTaskId = s.SubscribeTaskId,
|
SubscribeTaskId = s.SubscribeTaskId,
|
||||||
SubscribeTaskGuid = s.SubscribeTaskGuid,
|
SubscribeTaskGuid = s.SubscribeTaskGuid,
|
||||||
@ -62,6 +62,24 @@ namespace ARW.Service.Business.BusinessService.SubscribeTasks
|
|||||||
return query.ToList();
|
return query.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<string> AddSubscribeTask(long customerGuid, long businessGuid, int templateId)
|
||||||
|
{
|
||||||
|
var model = new SubscribeTask
|
||||||
|
{
|
||||||
|
CustomerGuid = customerGuid,
|
||||||
|
SubscribeTaskBusinessGuid = businessGuid,
|
||||||
|
SubscribeTaskType = 1,
|
||||||
|
SubscribeTaskId = templateId,
|
||||||
|
SubscribeTaskStatus = 0
|
||||||
|
};
|
||||||
|
var res = await _SubscribeTaskRepository.InsertReturnSnowflakeIdAsync(model);
|
||||||
|
|
||||||
|
return "添加成功";
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,17 @@ namespace ARW.Service.Business.IBusinessService.SubscribeTasks
|
|||||||
/// <param name="parm"></param>
|
/// <param name="parm"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
List<SubscribeTaskVo> GetSubscribeTaskList();
|
List<SubscribeTaskVo> GetSubscribeTaskList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加订阅任务
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="customerGuid">客户guid</param>
|
||||||
|
/// <param name="businessGuid">业务guid</param>
|
||||||
|
/// <param name="templateId">模板id</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> AddSubscribeTask(long customerGuid,long businessGuid,int templateId);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,9 @@ using ARW.Model.Models.Business.ProductsInvolveds;
|
|||||||
using ARW.Model.Vo.Api.ProductsInvolveds;
|
using ARW.Model.Vo.Api.ProductsInvolveds;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Geocoding;
|
using Geocoding;
|
||||||
|
using ARW.Admin.WebApi.Framework;
|
||||||
|
using ARW.Service.Business.IBusinessService.SubscribeTasks;
|
||||||
|
using Senparc.Weixin.Open.WxOpenAPIs;
|
||||||
|
|
||||||
namespace ARW.WebApi.Controllers.Api.ProductsInvolveds
|
namespace ARW.WebApi.Controllers.Api.ProductsInvolveds
|
||||||
{
|
{
|
||||||
@ -29,14 +32,16 @@ namespace ARW.WebApi.Controllers.Api.ProductsInvolveds
|
|||||||
public class ProductsInvolvedApiController : BaseController
|
public class ProductsInvolvedApiController : BaseController
|
||||||
{
|
{
|
||||||
private readonly IProductsInvolvedServiceApi _ProductsInvolvedServiceApi;
|
private readonly IProductsInvolvedServiceApi _ProductsInvolvedServiceApi;
|
||||||
|
private readonly ISubscribeTaskService _SubscribeTaskService;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 依赖注入
|
/// 依赖注入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProductsInvolvedServiceApi">涉及产品涉及产品Api服务</param>
|
/// <param name="ProductsInvolvedServiceApi">涉及产品涉及产品Api服务</param>
|
||||||
public ProductsInvolvedApiController(IProductsInvolvedServiceApi ProductsInvolvedServiceApi)
|
public ProductsInvolvedApiController(IProductsInvolvedServiceApi ProductsInvolvedServiceApi, ISubscribeTaskService subscribeTaskService)
|
||||||
{
|
{
|
||||||
_ProductsInvolvedServiceApi = ProductsInvolvedServiceApi;
|
_ProductsInvolvedServiceApi = ProductsInvolvedServiceApi;
|
||||||
|
_SubscribeTaskService = subscribeTaskService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -48,33 +53,39 @@ namespace ARW.WebApi.Controllers.Api.ProductsInvolveds
|
|||||||
[HttpGet("getProductsInvolvedList")]
|
[HttpGet("getProductsInvolvedList")]
|
||||||
public async Task<IActionResult> GetProductsInvolvedListApi([FromQuery] ProductsInvolvedQueryDtoApi parm)
|
public async Task<IActionResult> GetProductsInvolvedListApi([FromQuery] ProductsInvolvedQueryDtoApi parm)
|
||||||
{
|
{
|
||||||
var res = await _ProductsInvolvedServiceApi.GetProductsInvolvedListApi(parm);
|
var user = JwtUtil.GetLoginUser(App.HttpContext).UserId;
|
||||||
|
var res = await _ProductsInvolvedServiceApi.GetProductsInvolvedListApi(parm, user);
|
||||||
return SUCCESS(res);
|
return SUCCESS(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取ProductsInvolved详情(Api)
|
/// 订阅涉及产品
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parm">查询参数</param>
|
/// <param name="parm">查询参数</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("getProductsInvolvedDetails")]
|
[HttpPost("subscribe")]
|
||||||
public async Task<IActionResult> GetProductsInvolvedDetails([FromQuery] ProductsInvolvedDtoApi parm)
|
public async Task<IActionResult> Subscribe([FromBody] ProductsInvolvedDtoApi parm)
|
||||||
{
|
{
|
||||||
//if (parm == null) throw new CustomException("参数错误!");
|
// 微信通知模板Id
|
||||||
|
var templateId = 1;
|
||||||
|
var user = JwtUtil.GetLoginUser(App.HttpContext).UserId;
|
||||||
|
var res = await _SubscribeTaskService.AddSubscribeTask(user, parm.ProductsInvolvedGuid, templateId);
|
||||||
|
return SUCCESS(res);
|
||||||
|
}
|
||||||
|
|
||||||
var res = await _ProductsInvolvedServiceApi.GetProductsInvolvedDetails(parm);
|
/// <summary>
|
||||||
|
/// 取消订阅涉及产品
|
||||||
if (res != "[]")
|
/// </summary>
|
||||||
{
|
/// <param name="parm">查询参数</param>
|
||||||
res = res.Remove(0, 1);
|
/// <returns></returns>
|
||||||
res = res.Substring(0, res.Length - 1);
|
[HttpPost("cancelSubscribe")]
|
||||||
var data = res.FromJSON<ProductsInvolvedApiDetailsVo>();
|
public async Task<IActionResult> CancelSubscribe([FromBody] ProductsInvolvedDtoApi parm)
|
||||||
return SUCCESS(data);
|
{
|
||||||
}
|
// 微信通知模板Id
|
||||||
else
|
var templateId = 1;
|
||||||
{
|
var userId = JwtUtil.GetLoginUser(App.HttpContext).UserId;
|
||||||
return SUCCESS(res);
|
var res = await _SubscribeTaskService.DeleteAsync(s => s.SubscribeTaskBusinessGuid == parm.ProductsInvolvedGuid && s.CustomerGuid == userId);
|
||||||
}
|
return SUCCESS("取消成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,79 @@
|
|||||||
|
using Infrastructure;
|
||||||
|
using Infrastructure.Attribute;
|
||||||
|
using Infrastructure.Enums;
|
||||||
|
using Infrastructure.Model;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using ARW.Admin.WebApi.Extensions;
|
||||||
|
using ARW.Admin.WebApi.Filters;
|
||||||
|
using ARW.Common;
|
||||||
|
using ARW.Admin.WebApi.Controllers;
|
||||||
|
using ARW.Model.Dto.Api.TableDataManage.TableDatas;
|
||||||
|
using ARW.Service.Api.IBusinessService.TableDataManage.TableDatas;
|
||||||
|
using ARW.Model.Models.Business.TableDataManage.TableDatas;
|
||||||
|
using ARW.Model.Vo.Api.TableDataManage.TableDatas;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Geocoding;
|
||||||
|
|
||||||
|
namespace ARW.WebApi.Controllers.Api.TableDataManage.TableDatas
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表格数据控制器Api
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-11-23
|
||||||
|
/// </summary>
|
||||||
|
[Verify]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
public class TableDataApiController : BaseController
|
||||||
|
{
|
||||||
|
private readonly ITableDataServiceApi _TableDataServiceApi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 依赖注入
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="TableDataServiceApi">表格数据表格数据Api服务</param>
|
||||||
|
public TableDataApiController(ITableDataServiceApi TableDataServiceApi)
|
||||||
|
{
|
||||||
|
_TableDataServiceApi = TableDataServiceApi;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取表格数据列表(Api)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm">查询参数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("getTableDataList")]
|
||||||
|
public async Task<IActionResult> GetTableDataListApi([FromQuery] TableDataQueryDtoApi parm)
|
||||||
|
{
|
||||||
|
var res = await _TableDataServiceApi.GetTableDataListApi(parm);
|
||||||
|
return SUCCESS(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取TableData详情(Api)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm">查询参数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("getTableDataDetails")]
|
||||||
|
public async Task<IActionResult> GetTableDataDetails([FromQuery] TableDataDtoApi parm)
|
||||||
|
{
|
||||||
|
//if (parm == null) throw new CustomException("参数错误!");
|
||||||
|
|
||||||
|
var res = await _TableDataServiceApi.GetTableDataDetails(parm);
|
||||||
|
|
||||||
|
if (res != "[]")
|
||||||
|
{
|
||||||
|
var data = res.FromJSON<TableDataApiDetailsVo>();
|
||||||
|
return SUCCESS(data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return SUCCESS(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -17,7 +17,7 @@
|
|||||||
"Issuer": "ARWAdmin.NET",
|
"Issuer": "ARWAdmin.NET",
|
||||||
"Audience": "ARWAdmin.NET",
|
"Audience": "ARWAdmin.NET",
|
||||||
"SecretKey": "SecretKey-ARWADMIN.NET-20210101",
|
"SecretKey": "SecretKey-ARWADMIN.NET-20210101",
|
||||||
"Expire": 1440 //jwt登录过期时间(分)
|
"Expire": 43200 //jwt登录过期时间(分)
|
||||||
},
|
},
|
||||||
"InitDb": false, //是否初始化db
|
"InitDb": false, //是否初始化db
|
||||||
"DemoMode": false, //是否演示模式
|
"DemoMode": false, //是否演示模式
|
||||||
|
Loading…
Reference in New Issue
Block a user