fixed 修改登录的过期时间为1个月,初始化表格数据接口
This commit is contained in:
parent
235823f460
commit
75144dc8e4
@ -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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
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; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -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