Browse Source

添加基础配置表和打印提醒服务

HQ
lvzb 10 months ago
parent
commit
2887117563
  1. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Interfaces/IImportRecordAppService.cs
  2. 26
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigCreateDto.cs
  3. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigDto.cs
  4. 27
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/QueryBaseConfigDto.cs
  5. 14
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Interfaces/IBaseGonfigService.cs
  6. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.csproj
  7. 40
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml
  8. 37
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/EdiReceive/ImportRecordAppService.cs
  9. 175
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/BaseConfig/BaseGonfigService.cs
  10. 3
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/NewJitApplicationAutoMapperProfile.cs
  11. 11
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs
  12. 33
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml
  13. 17
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/BaseConfig.cs
  14. 23
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/BaseGonfigDomainService.cs
  15. 1
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContextModelCreatingExtensions.cs

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Interfaces/IImportRecordAppService.cs

@ -6,7 +6,9 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using WY.NewJit.EdiReceive.Dtos; using WY.NewJit.EdiReceive.Dtos;
using WY.NewJit.MsgCheck;
namespace WY.NewJit.EdiReceive.Interfaces namespace WY.NewJit.EdiReceive.Interfaces
{ {
@ -63,6 +65,8 @@ namespace WY.NewJit.EdiReceive.Interfaces
/// <param name="input">导入文件流</param> /// <param name="input">导入文件流</param>
/// <returns>执行成功返回真</returns> /// <returns>执行成功返回真</returns>
Task<ObjectResultDto> ImportAsync([FromForm] IFormFileCollection files); Task<ObjectResultDto> ImportAsync([FromForm] IFormFileCollection files);
[HttpPost, Route("print-timeout-remind"), UnitOfWork]
Task<TimeOutRemindResultDto> PrintTimeoutRemind(TimeOutRemindInputDto input);
#endregion #endregion
} }

26
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigCreateDto.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WY.NewJit.MsgBaseData
{
public class BaseConfigCreateDto
{
/// <summary>
/// 参数名称
/// </summary>
public virtual string ParamName { get; set; }
/// <summary>
/// 参数值
/// </summary>
public virtual string ParamValue { get; set; }
/// <summary>
/// 状态
/// </summary>
public virtual bool State { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
}

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigDto.cs

@ -22,10 +22,10 @@ namespace WY.NewJit.MsgBaseData
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>
public virtual int State { get; set; } public virtual bool State { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
public virtual int Remark { get; set; } public virtual string Remark { get; set; }
} }
} }

27
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/QueryBaseConfigDto.cs

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
using WY.NewJit.Common;
namespace WY.NewJit.MsgBaseData
{
public class QueryBaseConfigDto : PagedAndSortedBase
{
/// <summary>
/// 参数名称
/// </summary>
public virtual string ParamName { get; set; }
/// <summary>
/// 参数值
/// </summary>
public virtual string ParamValue { get; set; }
/// <summary>
/// 状态
/// </summary>
public virtual List<bool> State { get; set; } = new List<bool>();
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
}

14
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Interfaces/IBaseGonfigService.cs

@ -0,0 +1,14 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace WY.NewJit.MsgBaseData
{
public interface IBaseGonfigService
{
Task<ObjectResultDto<Guid>> CreateAsync(BaseConfigCreateDto input);
Task<ObjectResultDto> DeleteAsync(string id);
Task<PagedResultDto<BaseConfigDto>> GetListAsync(QueryBaseConfigDto input);
Task<ObjectResultDto> UpdateAsync(Guid id, BaseConfigCreateDto input);
}
}

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.csproj

@ -32,8 +32,4 @@
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="4.3.3" /> <PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="4.3.3" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="MsgBaseData\BaseConfig\Interfaces\" />
</ItemGroup>
</Project> </Project>

40
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml

@ -1504,6 +1504,26 @@
<param name="vehicleAssemblyId">整车总成Id</param> <param name="vehicleAssemblyId">整车总成Id</param>
<returns>Erp总成列表</returns> <returns>Erp总成列表</returns>
</member> </member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigCreateDto.ParamName">
<summary>
参数名称
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigCreateDto.ParamValue">
<summary>
参数值
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigCreateDto.State">
<summary>
状态
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigCreateDto.Remark">
<summary>
备注
</summary>
</member>
<member name="T:WY.NewJit.MsgBaseData.BaseConfigDto"> <member name="T:WY.NewJit.MsgBaseData.BaseConfigDto">
<summary> <summary>
基础参数配置表 基础参数配置表
@ -1529,6 +1549,26 @@
备注 备注
</summary> </summary>
</member> </member>
<member name="P:WY.NewJit.MsgBaseData.QueryBaseConfigDto.ParamName">
<summary>
参数名称
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryBaseConfigDto.ParamValue">
<summary>
参数值
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryBaseConfigDto.State">
<summary>
状态
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryBaseConfigDto.Remark">
<summary>
备注
</summary>
</member>
<member name="T:WY.NewJit.MsgBaseData.DicItemDto"> <member name="T:WY.NewJit.MsgBaseData.DicItemDto">
<summary> <summary>
通用字典信息DTO 通用字典信息DTO

37
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/EdiReceive/ImportRecordAppService.cs

@ -22,6 +22,7 @@ using WY.NewJit.EdiReceive.Entitys;
using WY.NewJit.EdiReceive.Interfaces; using WY.NewJit.EdiReceive.Interfaces;
using WY.NewJit.EntityFrameworkCore; using WY.NewJit.EntityFrameworkCore;
using WY.NewJit.MsgBaseData; using WY.NewJit.MsgBaseData;
using WY.NewJit.MsgCheck;
namespace WY.NewJit.EdiReceive namespace WY.NewJit.EdiReceive
{ {
@ -57,6 +58,10 @@ namespace WY.NewJit.EdiReceive
/// 字典领域服务 /// 字典领域服务
/// </summary> /// </summary>
private readonly DicDomainService _dicDomainService; private readonly DicDomainService _dicDomainService;
/// <summary>
/// 配置
/// </summary>
private readonly Microsoft.Extensions.Configuration.IConfiguration _configuration;
/// <summary> /// <summary>
/// 错误信息前缀 /// 错误信息前缀
@ -80,7 +85,8 @@ namespace WY.NewJit.EdiReceive
ILogger<ImportRecordAppService> logger, ILogger<ImportRecordAppService> logger,
NewJitDapperRepository newJitDapperRepository, NewJitDapperRepository newJitDapperRepository,
IBlobContainer<OurFileContainer> blobContainer, IBlobContainer<OurFileContainer> blobContainer,
DicDomainService dicDomainService DicDomainService dicDomainService,
Microsoft.Extensions.Configuration.IConfiguration configuration
) )
{ {
_importRecordRepository = importRecordRepository; _importRecordRepository = importRecordRepository;
@ -88,6 +94,7 @@ namespace WY.NewJit.EdiReceive
_newJitDapperRepository = newJitDapperRepository; _newJitDapperRepository = newJitDapperRepository;
_blobContainer = blobContainer; _blobContainer = blobContainer;
_dicDomainService = dicDomainService; _dicDomainService = dicDomainService;
_configuration = configuration;
} }
#region 私有方法 #region 私有方法
@ -472,5 +479,33 @@ namespace WY.NewJit.EdiReceive
} }
} }
#endregion #endregion
/// <summary>
/// 打印时间提醒
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[UnitOfWork]
[HttpPost]
[Route("print-timeout-remind")]
public virtual async Task<TimeOutRemindResultDto> PrintTimeoutRemind(TimeOutRemindInputDto input)
{
TimeOutRemindResultDto retObj = new TimeOutRemindResultDto();
retObj.ConfigMinutes = _configuration[$"ConfigDic:ProductLineTimeoutRemind_New:{"Record"}"].TryToInt() ?? 40;
var qry =await _importRecordRepository.MaxAsync(itm => itm.CreateTime);
retObj.LastReceiveTime = qry != null ? Convert.ToDateTime(qry) : ServerHelper.CurrentDateTime;
retObj.TimeoutMinutes = MinuteDiff(retObj.LastReceiveTime, ServerHelper.CurrentDateTime);
return retObj;
}
private int MinuteDiff(DateTime beginTime, DateTime endTime)
{
TimeSpan beginSpan = new TimeSpan(beginTime.Ticks);
TimeSpan endSpan = new TimeSpan(endTime.Ticks);
TimeSpan diffSpan = endSpan.Subtract(beginSpan).Duration();
return (int)(diffSpan.TotalMinutes);
}
} }
} }

175
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/BaseConfig/BaseGonfigService.cs

@ -1,10 +1,13 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow; using Volo.Abp.Uow;
@ -17,9 +20,11 @@ namespace WY.NewJit.MsgBaseData
/// </summary> /// </summary>
[Route("api/newjit/baseconfig")] [Route("api/newjit/baseconfig")]
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.基础数据)] [ApiExplorerSettings(GroupName = SwaggerGroupConsts.基础数据)]
public class BaseGonfigService : ApplicationService public class BaseGonfigService : ApplicationService, IBaseGonfigService
{ {
private readonly IRepository<BaseConfig, Guid> _repository; public readonly IRepository<BaseConfig, Guid> _repository;
private readonly BaseGonfigDomainService _baseConfigDomainService;
/// <summary> /// <summary>
/// 日志 /// 日志
/// </summary> /// </summary>
@ -41,11 +46,13 @@ namespace WY.NewJit.MsgBaseData
/// </summary> /// </summary>
public BaseGonfigService( public BaseGonfigService(
IRepository<BaseConfig, Guid> repository, IRepository<BaseConfig, Guid> repository,
ILogger<BaseGonfigService> logger ILogger<BaseGonfigService> logger,
BaseGonfigDomainService baseConfigDomainService
) )
{ {
_repository = repository; _repository = repository;
_logger = logger; _logger = logger;
_baseConfigDomainService = baseConfigDomainService;
} }
@ -57,25 +64,171 @@ namespace WY.NewJit.MsgBaseData
[HttpGet] [HttpGet]
[UnitOfWork(false)] [UnitOfWork(false)]
[Route("list")] [Route("list")]
public virtual async Task<ListResultDto<BaseConfigDto>> GetBaseConfigListAsync() public virtual async Task<PagedResultDto<BaseConfigDto>> GetListAsync(QueryBaseConfigDto input)
{ {
_logger.LogDebug(_errorMessagePrefix + "GetBaseConfigListAsync 进入"); _logger.LogDebug(_errorMessagePrefix + "GetListAsync 进入");
try try
{ {
var lst = await _repository.GetListAsync(); var page = (PagedAndSortedBase)input;
IQueryable<BaseConfig> qry1 = QueryByCondition(input);
if (string.IsNullOrEmpty(page.Sorting))
{
page.Sorting = "ParamName";
}
int totalCount = await qry1.CountAsync(); //返回总记录数而不是当前页记录数
if (totalCount == 0)
{
return new PagedResultDto<BaseConfigDto>(0, new List<BaseConfigDto>());
}
var query = qry1.OrderBy(page.Sorting).Skip(page.SkipCount).Take(page.MaxResultCount);
List<BaseConfig> lst = await query.ToListAsync();
var items = ObjectMapper.Map<List<BaseConfig>, List<BaseConfigDto>>(lst); var items = ObjectMapper.Map<List<BaseConfig>, List<BaseConfigDto>>(lst);
return new ListResultDto<BaseConfigDto>(items); return new PagedResultDto<BaseConfigDto>(totalCount, items);
} }
catch (Exception ex) catch (Exception ex)
{ {
string errMsg = _errorMessagePrefix + "GetBaseConfigListAsync 执行出错:" + ex.Message; string errMsg = _errorMessagePrefix + "GetListAsync 执行出错:" + ex.Message;
_logger.LogError(errMsg); _logger.LogError(errMsg);
return new ListResultDto<BaseConfigDto>(new List<BaseConfigDto>()); return new PagedResultDto<BaseConfigDto>(0, new List<BaseConfigDto>());
}
}
/// <summary>
/// 添加实体
/// </summary>
/// <param name="input">添加内容</param>
/// <returns>执行成功返回真</returns>
[HttpPost]
[UnitOfWork]
[Route("create")]
public async Task<ObjectResultDto<Guid>> CreateAsync(BaseConfigCreateDto input)
{
_logger.LogDebug(_errorMessagePrefix + "CreateAsync 进入");
ObjectResultDto<Guid> ret = new ObjectResultDto<Guid>();
try
{
var checkitem = await _repository.FirstOrDefaultAsync(r => r.ParamName == input.ParamName);
if (checkitem != null)
{
ret.Status = false;
ret.Message = $"参数名称【{input.ParamName}】已存,在无法添加!";
return ret;
}
BaseConfig obj = ObjectMapper.Map<BaseConfigCreateDto, BaseConfig>(input);
var obj2 = await _repository.InsertAsync(obj);
ret.Item = obj2.Id; //返回添加对象的主键
await _baseConfigDomainService.UpdateBaseConfigCache();
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "CreateAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
} }
} }
#endregion
/// <summary>
/// 修改实体
/// </summary>
/// <param name="id">更新主键</param>
/// <param name="input">修改内容</param>
/// <returns>执行成功返回真</returns>
[HttpPut]
[UnitOfWork]
[Route("update/{id}")]
public async Task<ObjectResultDto> UpdateAsync(Guid id, BaseConfigCreateDto input)
{
_logger.LogDebug(_errorMessagePrefix + "UpdateAsync 进入");
ObjectResultDto ret = new ObjectResultDto();
try
{
var checkitem = await _repository.FirstOrDefaultAsync(r => r.ParamName == input.ParamName && r.Id != id);
if (checkitem != null)
{
ret.Status = false;
ret.Message = $"参数名称【{input.ParamName}】已存,在无法添加!";
return ret;
}
var item = await _repository.GetAsync(id);
ObjectMapper.Map<BaseConfigCreateDto, BaseConfig>(input, item);
await _repository.UpdateAsync(item);
await _baseConfigDomainService.UpdateBaseConfigCache();
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "UpdateAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
/// <summary>
/// 删除实体
/// </summary>
/// <param name="id">删除主键</param>
/// <returns>执行成功返回真</returns>
[UnitOfWork]
[HttpDelete]
[Route("delete/{id}")]//delete/
public async Task<ObjectResultDto> DeleteAsync(string id)
{
_logger.LogDebug(_errorMessagePrefix + "DeleteAsync 进入");
ObjectResultDto ret = new ObjectResultDto();
try
{
Guid guid = Guid.Parse(id);
await _repository.DeleteAsync(guid);
await _baseConfigDomainService.UpdateBaseConfigCache();
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "DeleteAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
#endregion
#region 私有方法
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private IQueryable<BaseConfig> QueryByCondition(QueryBaseConfigDto input)
{
IQueryable<BaseConfig> ret = _repository.Where(itm => 1 == 1);
if (!string.IsNullOrEmpty(input.ParamName))
{
ret = ret.Where(itm => itm.ParamName.Contains(input.ParamName));
}
if (!string.IsNullOrEmpty(input.ParamValue))
{
ret = ret.Where(itm => itm.ParamValue.Contains(input.ParamValue));
}
if (input.State.Count > 0)
{
ret = ret.Where(itm => input.State.Contains(itm.State));
}
if (!string.IsNullOrEmpty(input.Remark))
{
ret = ret.Where(itm => itm.Remark.Contains(input.Remark));
}
return ret;
}
#endregion
} }
} }

3
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/NewJitApplicationAutoMapperProfile.cs

@ -46,6 +46,9 @@ namespace WY.NewJit
CreateMap<LogRemind, LogRemindDto>().ReverseMap(); CreateMap<LogRemind, LogRemindDto>().ReverseMap();
CreateMap<LogRemind, CreateUpdateLogRemindDto>().ReverseMap(); CreateMap<LogRemind, CreateUpdateLogRemindDto>().ReverseMap();
CreateMap<BaseConfig, BaseConfigCreateDto>().ReverseMap();
CreateMap<BaseConfig, BaseConfigDto>().ReverseMap();
#endregion #endregion
#region 报文解析及校验 #region 报文解析及校验

11
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs

@ -116,6 +116,9 @@ namespace WY.NewJit.PrintTable
/// BLOB存储 /// BLOB存储
/// </summary> /// </summary>
private readonly IBlobContainer<OurFileContainer> _blobContainer; private readonly IBlobContainer<OurFileContainer> _blobContainer;
private readonly BaseGonfigDomainService _baseConfigDomainService;
#endregion #endregion
public WaitPrintAppService( public WaitPrintAppService(
@ -136,7 +139,8 @@ namespace WY.NewJit.PrintTable
IRepository<PrintTemplateConfiguration, Guid> printTemplateConfigurationRepository, IRepository<PrintTemplateConfiguration, Guid> printTemplateConfigurationRepository,
M100DomainService m100DomainService, M100DomainService m100DomainService,
IBlobContainer<OurFileContainer> blobContainer, IBlobContainer<OurFileContainer> blobContainer,
IRepository<BillR100, Guid> billR100Repository IRepository<BillR100, Guid> billR100Repository,
BaseGonfigDomainService baseConfigDomainService
) )
{ {
_waitPrintRepository = waitPrintRepository; _waitPrintRepository = waitPrintRepository;
@ -157,6 +161,7 @@ namespace WY.NewJit.PrintTable
_m100DomainService = m100DomainService; _m100DomainService = m100DomainService;
_blobContainer = blobContainer; _blobContainer = blobContainer;
_billR100Repository = billR100Repository; _billR100Repository = billR100Repository;
_baseConfigDomainService = baseConfigDomainService;
} }
#region 私有方法 #region 私有方法
@ -872,12 +877,14 @@ namespace WY.NewJit.PrintTable
Stopwatch sw = new Stopwatch(); Stopwatch sw = new Stopwatch();
sw.Start(); sw.Start();
_logger.LogDebug(_errorMessagePrefix + "SaveMenBanReport 进入"); _logger.LogDebug(_errorMessagePrefix + "SaveMenBanReport 进入");
var baseConfigCache= _baseConfigDomainService.GetCachesByName("打印条数");
var printCount = baseConfigCache == null ? 10 : Convert.ToInt32(baseConfigCache.ParamValue);
MenBanPrintResultDto retObj = new MenBanPrintResultDto(); MenBanPrintResultDto retObj = new MenBanPrintResultDto();
ObjectResultDto<MenBanPrintResultDto> ret = new ObjectResultDto<MenBanPrintResultDto>(retObj); ObjectResultDto<MenBanPrintResultDto> ret = new ObjectResultDto<MenBanPrintResultDto>(retObj);
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: System.Data.IsolationLevel.Unspecified)) using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: System.Data.IsolationLevel.Unspecified))
{ {
try try
{ {
List<MenBanPackingList> reportMainLst = new List<MenBanPackingList>(); List<MenBanPackingList> reportMainLst = new List<MenBanPackingList>();

33
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml

@ -544,17 +544,46 @@
错误信息前缀 错误信息前缀
</summary> </summary>
</member> </member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.BaseConfig,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.BaseGonfigService})"> <member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.BaseConfig,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.BaseGonfigService},WY.NewJit.MsgBaseData.BaseGonfigDomainService)">
<summary> <summary>
构造函数 构造函数
</summary> </summary>
</member> </member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.GetBaseConfigListAsync"> <member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.GetListAsync(WY.NewJit.MsgBaseData.QueryBaseConfigDto)">
<summary> <summary>
获取所有基本参数数据 获取所有基本参数数据
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.CreateAsync(WY.NewJit.MsgBaseData.BaseConfigCreateDto)">
<summary>
添加实体
</summary>
<param name="input">添加内容</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.UpdateAsync(System.Guid,WY.NewJit.MsgBaseData.BaseConfigCreateDto)">
<summary>
修改实体
</summary>
<param name="id">更新主键</param>
<param name="input">修改内容</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.DeleteAsync(System.String)">
<summary>
删除实体
</summary>
<param name="id">删除主键</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.QueryByCondition(WY.NewJit.MsgBaseData.QueryBaseConfigDto)">
<summary>
根据筛选条件获取实体列表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:WY.NewJit.MsgBaseData.DicAppService"> <member name="T:WY.NewJit.MsgBaseData.DicAppService">
<summary> <summary>
通用字典应用服务实现 通用字典应用服务实现

17
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/BaseConfig.cs

@ -12,6 +12,19 @@ namespace WY.NewJit.MsgBaseData
/// </summary> /// </summary>
public class BaseConfig : AggregateRoot<Guid> public class BaseConfig : AggregateRoot<Guid>
{ {
public BaseConfig()
{
}
public BaseConfig(Guid id ,string paramName, string paramValue, bool state, string remark):base(id)
{
ParamName = paramName;
ParamValue = paramValue;
State = state;
Remark = remark;
}
/// <summary> /// <summary>
/// 参数名称 /// 参数名称
/// </summary> /// </summary>
@ -21,9 +34,9 @@ namespace WY.NewJit.MsgBaseData
/// </summary> /// </summary>
public virtual string ParamValue { get; set; } public virtual string ParamValue { get; set; }
/// <summary> /// <summary>
/// 状态 /// 是否启用
/// </summary> /// </summary>
public virtual int State { get; set; } public virtual bool State { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>

23
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/BaseGonfigDomainService.cs

@ -10,6 +10,8 @@ namespace WY.NewJit.MsgBaseData
{ {
public class BaseGonfigDomainService : DomainService public class BaseGonfigDomainService : DomainService
{ {
private static List<BaseConfig> _baseConfigdCaches = new List<BaseConfig>();//记录缓存
private readonly IRepository<BaseConfig, Guid> _repository; private readonly IRepository<BaseConfig, Guid> _repository;
public BaseGonfigDomainService(IRepository<BaseConfig, Guid> repository) public BaseGonfigDomainService(IRepository<BaseConfig, Guid> repository)
@ -17,6 +19,27 @@ namespace WY.NewJit.MsgBaseData
_repository = repository; _repository = repository;
} }
/// <summary>
/// 更新记录和内存
/// </summary>
/// <returns></returns>
public async Task<ObjectResultDto> UpdateBaseConfigCache()
{
ObjectResultDto ret = new ObjectResultDto(true, null);
_baseConfigdCaches.Clear();//清空缓存
_baseConfigdCaches = await _repository.GetListAsync();
return ret;
}
/// <summary>
/// 根据名称获取参数
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public BaseConfig GetCachesByName(string name)
{
var item = _baseConfigdCaches.FirstOrDefault(r => r.ParamName == name);
return item;
}
} }
} }

1
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContextModelCreatingExtensions.cs

@ -169,7 +169,6 @@ namespace WY.NewJit.EntityFrameworkCore
b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它 b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它
b.Property("ParamName").HasMaxLength(50); b.Property("ParamName").HasMaxLength(50);
b.Property("ParamValue").HasMaxLength(50); b.Property("ParamValue").HasMaxLength(50);
b.Property("State").HasPrecision(1);
b.Property("Remark").HasMaxLength(500); b.Property("Remark").HasMaxLength(500);
b.HasIndex(x => new { x.ParamName}).IsUnique(); b.HasIndex(x => new { x.ParamName}).IsUnique();
}); });

Loading…
Cancel
Save