Browse Source

修改PDA

集成Redis
郑勃旭 2 years ago
parent
commit
e8720d4e1a
  1. 2
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Accounts/AccountController.cs
  2. 58
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/TestController.cs
  3. 48
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/PdaHttpApiHostModule.cs
  4. 30
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.Development.json
  5. 13
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.Production.json
  6. 47
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.json
  7. 2
      be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs
  8. 8
      be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs
  9. 11
      be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageService.cs
  10. 11
      build/src/docker/publish/settings/appsettings.Development.json

2
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Accounts/AccountController.cs

@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Account; using Volo.Abp.Account;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
@ -15,6 +16,7 @@ namespace Win_in.Sfs.Wms.Pda.Controllers.Accounts;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[AllowAnonymous]
[ApiController] [ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}account")] [Route($"{PdaHostConst.ROOT_ROUTE}account")]

58
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/TestController.cs

@ -0,0 +1,58 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Account;
using Volo.Abp.Application.Services;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Auth.Application.Contracts;
using Win_in.Sfs.Wms.Pda.Authenticaitons;
using Win_in.Sfs.Wms.Pda.Models;
using PdaMenuDto = Win_in.Sfs.Wms.Pda.Models.PdaMenuDto;
using PdaMenuGroupDto = Win_in.Sfs.Wms.Pda.Models.PdaMenuGroupDto;
namespace Win_in.Sfs.Wms.Pda.Controllers.Accounts;
/// <summary>
///
/// </summary>
[AllowAnonymous]
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}asfasf")]
public class TestController: AbpController
{
//private readonly IProfileAppService _profileAppService;
//private readonly ITokenService _tokenService;
private readonly IUserMenuAppService _userMenuAppService;
//private readonly IUserWorkGroupAppService _userWorkGroupAppService;
/// <summary>
///
/// </summary>
/// <param name="profileAppService"></param>
/// <param name="tokenService"></param>
/// <param name="userMenuAppService"></param>
/// <param name="userWorkGroupAppService"></param>
public TestController(
IUserMenuAppService userMenuAppService
, IUserWorkGroupAppService userWorkGroupAppService
)
{
//_profileAppService = profileAppService;
//_tokenService = tokenService;
_userMenuAppService = userMenuAppService;
//_userWorkGroupAppService = userWorkGroupAppService;
}
/// <summary>
/// Test
/// </summary>
/// <returns></returns>
[HttpGet("Test")]
public virtual async Task<List<string>> Test()
{
return new List<string>() { "sdfsdf'" };
}
}

48
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/PdaHttpApiHostModule.cs

@ -8,8 +8,10 @@ using Microsoft.AspNetCore.Cors;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.OpenApi.Models;
using Polly; using Polly;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.AspNetCore.Mvc.AntiForgery; using Volo.Abp.AspNetCore.Mvc.AntiForgery;
using Volo.Abp.AspNetCore.Mvc.Client; using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
@ -149,6 +151,10 @@ public class PdaHttpApiHostModule : AbpModule
typeof(AuthApplicationContractsModule).Assembly, typeof(AuthApplicationContractsModule).Assembly,
"Auth" "Auth"
); );
context.Services.AddHttpClientProxies(
typeof(AbpAccountApplicationContractsModule).Assembly,
"Auth"
);
context.Services.AddHttpClientProxies( context.Services.AddHttpClientProxies(
typeof(MessageApplicationContractsModule).Assembly, typeof(MessageApplicationContractsModule).Assembly,
"Message" "Message"
@ -274,22 +280,32 @@ public class PdaHttpApiHostModule : AbpModule
private void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) private void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration)
{ {
//context.Services.AddAbpSwaggerGenWithOAuth( context.Services.AddAbpSwaggerGenWithOAuth(
// configuration["IdentityClients:Default:Authority"], configuration["IdentityClients:Default:Authority"],
// new Dictionary<string, string> new Dictionary<string, string>
// { {
// {"Pda", "Pda API"} {"Pda", "Pda API"}
// }, },
// options => options =>
// { {
// options.SwaggerDoc("v1", new OpenApiInfo { Title = "Pda API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "Pda API", Version = "v1" });
// options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
// options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
// GetXmlFiles().ForEach(file => GetXmlFiles().ForEach(file =>
// { {
// options.IncludeXmlComments(file); options.IncludeXmlComments(file);
// }); });
// }); });
}
/// <summary>
/// 获取当前目录下的xml文档
/// </summary>
/// <returns></returns>
private List<string> GetXmlFiles()
{
var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location);
var docXmlFiles = Directory.GetFiles(basePath, "*.xml");
return docXmlFiles.ToList();
} }
} }

30
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.Development.json

@ -1,10 +1,10 @@
{ {
"AgileConfig": { //"AgileConfig": {
"appId": "sfs", // "appId": "sfs",
"secret": "sfs", // "secret": "sfs",
"nodes": "http://localhost:21092", // "nodes": "http://localhost:21092",
"env": "dev" // "env": "dev"
}, //},
"Urls": "http://localhost:59096", "Urls": "http://localhost:59096",
//"IdentityClients": { //"IdentityClients": {
// "Default": { // "Default": {
@ -32,14 +32,14 @@
// //"Auth": { "BaseUrl": "http://dev.ccwin-in.com:59093/" } // //"Auth": { "BaseUrl": "http://dev.ccwin-in.com:59093/" }
//} //}
"RemoteServices": { "RemoteServices": {
"Default": { "BaseUrl": "http://dev.ccwin-in.com:59093" }, "Default": { "BaseUrl": "http://dev.ccwin-in.com:21293/" },
"BaseData": { "BaseUrl": "http://localhost:59094/" }, "BaseData": { "BaseUrl": "http://dev.ccwin-in.com:21294/" },
"Store": { "BaseUrl": "http://localhost:59096/" }, "Store": { "BaseUrl": "http://dev.ccwin-in.com:21295/" },
"Job": { "BaseUrl": "http://localhost:59096/" }, "Job": { "BaseUrl": "http://dev.ccwin-in.com:21295/" },
"Inventory": { "BaseUrl": "http://localhost:59096/" }, "Inventory": { "BaseUrl": "http://dev.ccwin-in.com:21295/" },
"FileStorage": { "BaseUrl": "http://dev.ccwin-in.com:59092/" }, "FileStorage": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
"Message": { "BaseUrl": "http://dev.ccwin-in.com:59092/" }, "Message": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
"Label": { "BaseUrl": "http://dev.ccwin-in.com:59092/" }, "Label": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
"Auth": { "BaseUrl": "http://dev.ccwin-in.com:59093/" } "Auth": { "BaseUrl": "http://dev.ccwin-in.com:21293/" }
} }
} }

13
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.Production.json

@ -1,13 +0,0 @@
//{} -----
{
"IdentityClients": {
"Default": {
"GrantType": "client_credentials",
"ClientId": "Auth_App",
"ClientSecret": "1q2w3e*",
"RequireHttps": "false",
"Authority": "http://{发布域名}:59093",
"Scope": "Auth"
}
}
}

47
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.json

@ -1,8 +1,45 @@
{ {
"AgileConfig": { //"AgileConfig": {
"appId": "sfs", // "appId": "sfs",
"secret": "sfs", // "secret": "sfs",
"nodes": "http://config:8848", // "nodes": "http://localhost:21092",
"env": "prod" // "env": "dev"
//},
"Urls": "http://localhost:59096",
//"IdentityClients": {
// "Default": {
// "GrantType": "client_credentials",
// "ClientId": "Auth_App",
// "ClientSecret": "1q2w3e*",
// "RequireHttps": "false",
// "Authority": "http://dev.ccwin-in.com:59093",
// "Scope": "Auth"
// }
//},
//"RemoteServices": {
// "Default": { "BaseUrl": "http://localhost:59093" },
// "Auth": { "BaseUrl": "http://localhost:59093/" }
//}
//"RemoteServices": {
// //"Default": { "BaseUrl": "http://dev.ccwin-in.com:59093" },
// //"BaseData": { "BaseUrl": "http://localhost:59094/" },
// "Store": { "BaseUrl": "http://localhost:59096/" },
// "Job": { "BaseUrl": "http://localhost:59096/" },
// "Inventory": { "BaseUrl": "http://localhost:59096/" }
// //"FileStorage": { "BaseUrl": "http://dev.ccwin-in.com:59092/" },
// //"Message": { "BaseUrl": "http://dev.ccwin-in.com:59092/" },
// // "Label": { "BaseUrl": "http://dev.ccwin-in.com:59092/" },
// //"Auth": { "BaseUrl": "http://dev.ccwin-in.com:59093/" }
//}
"RemoteServices": {
"Default": { "BaseUrl": "http://dev.ccwin-in.com:21293/" },
"BaseData": { "BaseUrl": "http://dev.ccwin-in.com:21294/" },
"Store": { "BaseUrl": "http://dev.ccwin-in.com:21295/" },
"Job": { "BaseUrl": "http://dev.ccwin-in.com:21295/" },
"Inventory": { "BaseUrl": "http://dev.ccwin-in.com:21295/" },
"FileStorage": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
"Message": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
"Label": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
"Auth": { "BaseUrl": "http://dev.ccwin-in.com:21293/" }
} }
} }

2
be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs

@ -11,6 +11,6 @@ public class MessageApplicationAutoMapperProfile : Profile
* into multiple profile classes for a better organization. */ * into multiple profile classes for a better organization. */
new MessageTypeAutoMapperProfile().MessageTypeAutoMapperProfileConfig(); new MessageTypeAutoMapperProfile().MessageTypeAutoMapperProfileConfig();
new NotifyMessageAutoMapperProfile().NotifyMessageAutoMapperProfileConfig();
} }
} }

8
be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs

@ -8,7 +8,7 @@ namespace Win_in.Sfs.Message.Application;
public class NotifyMessageAutoMapperProfile : Profile public class NotifyMessageAutoMapperProfile : Profile
{ {
public NotifyMessageAutoMapperProfile() public void NotifyMessageAutoMapperProfileConfig()
{ {
CreateMap<NotifyMessage, NotifyMessageDto>() CreateMap<NotifyMessage, NotifyMessageDto>()
.IgnoreAuditedObjectProperties() .IgnoreAuditedObjectProperties()
@ -24,6 +24,12 @@ public class NotifyMessageAutoMapperProfile : Profile
.ReverseMap(); .ReverseMap();
CreateMap<NotifyMessageEditInput, NotifyMessage>() CreateMap<NotifyMessageEditInput, NotifyMessage>()
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.LastModificationTime)
.Ignore(x => x.LastModifierId)
.Ignore(x => x.CreationTime)
.Ignore(x => x.CreatorId)
; ;
} }
} }

11
be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageService.cs

@ -28,8 +28,17 @@ public class NotifyMessageService : SfsMessageCrudAppServiceBase<NotifyMessage,
public override async Task<NotifyMessageDto> CreateAsync(NotifyMessageEditInput input) public override async Task<NotifyMessageDto> CreateAsync(NotifyMessageEditInput input)
{ {
var dto = await base.CreateAsync(input).ConfigureAwait(false); var dto = await base.CreateAsync(input).ConfigureAwait(false);
var entity = ObjectMapper.Map<NotifyMessageEditInput, NotifyMessage>(input); //var entity = ObjectMapper.Map<NotifyMessageEditInput, NotifyMessage>(input);
var entity = new NotifyMessage();
entity.MessageType = input.MessageType;
entity.Content=input.Content;
entity.MessageLevel=input.MessageLevel;
entity.Remark=input.Remark;
entity.Title=input.Title;
entity.SendTime=input.SendTime;
entity.SetId(dto.Id); entity.SetId(dto.Id);
await _userNotifyMessageManager.AddManyAsync(entity).ConfigureAwait(false); await _userNotifyMessageManager.AddManyAsync(entity).ConfigureAwait(false);
return dto; return dto;
} }

11
build/src/docker/publish/settings/appsettings.Development.json

@ -108,6 +108,17 @@
"Configuration": "dev.ccwin-in.com:21194", "Configuration": "dev.ccwin-in.com:21194",
"KeyPrefix": "Wms:" "KeyPrefix": "Wms:"
}, },
// "RemoteServices": {
// "Default": { "BaseUrl": "http://dev.ccwin-in.com:21293/" },
// "BaseData": { "BaseUrl": "http://dev.ccwin-in.com:21294/" },
// "Store": { "BaseUrl": "http://dev.ccwin-in.com:21295/" },
// "Job": { "BaseUrl": "http://dev.ccwin-in.com:21295/" },
// "Inventory": { "BaseUrl": "http://dev.ccwin-in.com:21295/" },
// "FileStorage": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
// "Message": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
// "Label": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
// "Auth": { "BaseUrl": "http://dev.ccwin-in.com:21293/" }
// },
"RemoteServices": { "RemoteServices": {
"Auth": { "Auth": {
"BaseUrl": "http://dev.ccwin-in.com:21293/" "BaseUrl": "http://dev.ccwin-in.com:21293/"

Loading…
Cancel
Save