Compare commits

...

48 次程式碼提交
master ... tmp

作者 SHA1 備註 提交日期
  zhaoy 95a9552a6b z 8 月之前
  gwbvipvip d00f60e46c Merge branch 'kitchenmanage' of http://10.2.1.24:10244/zhaoy/BPA.SAAS.Manage into kitchenmanage 8 月之前
  gwbvipvip 9f2c238e70 提交 8 月之前
  zhaoy 28f9dc02ff Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 131bd576dc Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 58f1d61b7e z 8 月之前
  zhaoy e06609b13e Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 086d8fddda z 8 月之前
  zhaoy 843a2d9d8e Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy e9beef72fb Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 0131b42373 Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 63abfb732c z 8 月之前
  zhaoy 9e518de5f8 Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 66799b8f5a Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 77e98316a0 Merge branch 'kitchenmanage' of http://10.2.1.24:10244/zhaoy/BPA.NewKitChen.Manage into kitchenmanage 8 月之前
  zhaoy 2ada86f3f1 Merge branch 'master' into kitchenmanage 8 月之前
  gwbvipvip 4b4bdc15a4 Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 81e472e11e Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy a0c78622d5 Merge branch 'kitchenmanage' of http://10.2.1.24:10244/zhaoy/BPA.NewKitChen.Manage into kitchenmanage 8 月之前
  zhaoy aca8a272cd Merge branch 'master' into kitchenmanage 8 月之前
  gwbvipvip 56301cc43b Merge branch 'kitchenmanage' of http://10.2.1.24:10244/zhaoy/BPA.SAAS.Manage into kitchenmanage 8 月之前
  gwbvipvip 6976b4a35a Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 20ab3ab0d8 Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 31ac712cb3 Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 3f76fd1cab Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy a450aa28b2 Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 90a503345b Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 343554359f Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy ec6c51708d Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy 0ff84da211 Merge branch 'master' into kitchenmanage 8 月之前
  zhaoy ad84178845 Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy ca458d5ee1 Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 62e08d4257 Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy cd573b0861 Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 9d0f63086e Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 6c9baa4ede Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 47ff3d8f3c Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 46b32ed6c0 Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 0aa1ae5357 Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 49c3a374e7 Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 9120605f33 z 9 月之前
  zhaoy 47f2fae372 商品删除 9 月之前
  zhaoy ef968f685e Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 93de85a900 Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 0e642f722d Merge branch 'master' into kitchenmanage 9 月之前
  zhaoy 6d168347d1 合并 9 月之前
  zhaoy db3cfb9aff z 9 月之前
  zhaoy 6ac72c2dbb zy 9 月之前
共有 31 個文件被更改,包括 1258 次插入35 次删除
分割檢視
  1. 二進制
     
  2. 二進制
     
  3. +17
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/BaseEPDto.cs
  4. +63
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/DtoValidator.cs
  5. +55
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/ResultSAASManageDto.cs
  6. +21
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/UserAnalysis.cs
  7. +59
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Enum/ErrorCodeEnum.cs
  8. +11
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Authorization/AuthServices.cs
  9. +38
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/CheckServices.cs
  10. +107
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/CheckServices.cs
  11. +22
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/ICheckServices.cs
  12. +158
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Dtos/MaterialDto.cs
  13. +72
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/MaterialServices.cs
  14. +47
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/IMaterialServices.cs
  15. +236
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/MaterialService.cs
  16. +76
    -1
      BPA.SAAS.Manage.Application/Auth/AuthService.cs
  17. +14
    -0
      BPA.SAAS.Manage.Application/Auth/Dtos/PlatformAuthorizationDto.cs
  18. +25
    -0
      BPA.SAAS.Manage.Application/Auth/IAuthService.cs
  19. +6
    -0
      BPA.SAAS.Manage.Application/BPA.SAAS.Manage.Application.csproj
  20. +2
    -0
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs
  21. +3
    -1
      BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs
  22. +36
    -0
      BPA.SAAS.Manage.Application/StoreServers.cs
  23. +2
    -31
      BPA.SAAS.Manage.Application/System/Services/MenuService.cs
  24. +14
    -0
      BPA.SAAS.Manage.Core/Base/PageUtil.cs
  25. +15
    -0
      BPA.SAAS.Manage.Core/CurrentUser.cs
  26. +24
    -0
      BPA.SAAS.Manage.Core/DataBase/BPA_FoodMenuGoods.cs
  27. +21
    -0
      BPA.SAAS.Manage.Core/DataBase/BPA_PlatformAuthorization.cs
  28. +2
    -0
      BPA.SAAS.Manage.Core/DbContext.cs
  29. +108
    -0
      BPA.SAAS.Manage.Core/SqlSugarDb.cs
  30. +3
    -1
      BPA.SAAS.Manage.Web.Core/Startup.cs
  31. +1
    -1
      BPA.SAAS.Manage.Web.Entry/appsettings.json

二進制
查看文件


二進制
查看文件


+ 17
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/BaseEPDto.cs 查看文件

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto
{
public class BaseEPDto
{
public string Sign { get; set; }

public string Key { get; set; }

}

}

+ 63
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/DtoValidator.cs 查看文件

@@ -0,0 +1,63 @@

using BPA.SAAS.Manage.Application.AExternalPlatform.Enum;
using BPA.SAAS.Manage.Core;
using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core.Org;
using Furion.JsonSerialization;
using Newtonsoft.Json;
using NPOI.Util.ArrayExtensions;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Reflection;
using System.Text;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto
{



/// <summary>
/// Dto参数验证
/// </summary>
public static class DtoValidator
{

/// <summary>
/// 获取签名
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="t"></param>
/// <param name="otype">0-不排序 1-按名称ASCII排序</param>
/// <returns></returns>
public static string GetSign<T>(T t, int otype = 1)
{
string retstr = "";
//定义PropertyInfo的List
List<PropertyInfo> proplist = new List<PropertyInfo>();
//遍历泛型类的每个属性加入到List里面
Array.ForEach<PropertyInfo>(typeof(T).GetProperties(),
p => proplist.Add(p));
//根据参数进行排序 0-不排序 1-按名称ASCII码排序
if (otype == 1)
proplist = proplist.OrderBy(k => k.Name).ToList();

//遍历List泛型生成我们要签名的字符串
proplist.ForEach(p =>
{
if (p.Name.ToLower() != "sign".ToLower())
{
if (p.GetValue(t, null) != null && p.GetValue(t, null).ToString() != "")
{
retstr = retstr + p.Name + "=" + p.GetValue(t, null) + "&";
}
}
});
//把字符串最后一位截断
retstr = retstr.Substring(0, retstr.Length - 1);
//输出字符串
return retstr;
}
}
}

+ 55
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/ResultSAASManageDto.cs 查看文件

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto
{
public class ResultSAASManageDto<T>
{
public int statusCode { get; set; }

public ResultSAASManageDataDto<T> data { get; set; }

public string succeeded { get; set; }

public string errors { get; set; }

public string extras { get; set; }

public int timestamp { get; set; }
}

public class ResultSAASManageDataDto<T>
{
public List<T> data { get; set; }

public int total { get; set; }
}
public class ResultTenantDataItemDto
{
public string id { get; set; }

public string name { get; set; }

public string adminName { get; set; }

public string email { get; set; }

public string phone { get; set; }

public string remark { get; set; }

public string logo { get; set; }

public string createAt { get; set; }

public int status { get; set; }

public string sysRoleId { get; set; }

public int type { get; set; }
}

}

+ 21
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/UserAnalysis.cs 查看文件

@@ -0,0 +1,21 @@
using BPA.SAAS.Manage.Core;
using Furion;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto
{
public class UserAnalysis
{
public UserAnalysis()
{

CurrentUser.GroupId = App.HttpContext.Request.Headers["TenantId"];
// CurrentUser.Sign = App.HttpContext.Request.Headers["Sign"];
}
}
}

+ 59
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Enum/ErrorCodeEnum.cs 查看文件

@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Enum
{
/// <summary>
/// 系统错误码
/// </summary>
[ErrorCodeType]
[Description("系统错误码")]
public enum ErrorCodeEnum
{
/// <summary>
/// 用户没有注册
/// </summary>
[ErrorCodeItemMetadata("用户没有注册")]
Code1000,

/// <summary>
/// 操作错误
/// </summary>
[ErrorCodeItemMetadata("操作错误")]
Code1001,

/// <summary>
/// 重复添加
/// </summary>
[ErrorCodeItemMetadata("重复添加")]
Code1002,

/// <summary>
/// 操作数据不存在
/// </summary>
[ErrorCodeItemMetadata("操作数据不存在")]
Code1003,

/// <summary>
/// key不正确
/// </summary>
[ErrorCodeItemMetadata("key不正确")]
Code1004,

/// <summary>
/// 签名错误
/// </summary>
[ErrorCodeItemMetadata("签名错误")]
Code1005,

/// <summary>
/// 签名错误
/// </summary>
[ErrorCodeItemMetadata("签名过期")]
Code1006,
}
}

+ 11
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Authorization/AuthServices.cs 查看文件

@@ -0,0 +1,11 @@

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Authorization
{


[ApiDescriptionSettings("开放平台", Tag = "授权管理"), AllowAnonymous, NonUnify]
public class AuthServices : IDynamicApiController
{
}
}

+ 38
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/CheckServices.cs 查看文件

@@ -0,0 +1,38 @@
using BPA.SAAS.Manage.Application.AExternalPlatform.Enum;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos;
using BPA.SAAS.Manage.Comm.Enum;
using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Forms;
using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Services;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService
{
[ApiDescriptionSettings("开放平台", Tag = "检查"), AllowAnonymous]
public class CheckServices : IDynamicApiController
{
private readonly ICheckServices _checkServices;
public CheckServices(ICheckServices checkServices)
{
_checkServices = checkServices;
}

/// <summary>
///检查Sign
/// </summary>
public async Task CheckSign<T>(T dto)
{
await _checkServices.CheckSign(dto);
}


}
}

+ 107
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/CheckServices.cs 查看文件

@@ -0,0 +1,107 @@
using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto;
using BPA.SAAS.Manage.Application.AExternalPlatform.Enum;
using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core.Org;
using BPA.SAAS.Manage.Core;
using NPOI.Util.ArrayExtensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Services
{
public class CheckServices : ICheckServices, ITransient
{
/// <summary>
///检查Sign
/// </summary>
public async Task CheckSign<T>(T dto)
{

var key = GetModelValue(dto, "Key");
var sign = GetModelValue(dto, "Sign");
var timestamp = GetModelValue(dto, "TimeStamp");


//检查租户
await CheckTenant(CurrentUser.GroupId);

//检查key
await CheckKey(key);

var thisSign = DtoValidator.GetSign(dto);


if (MD5Encryption.Encrypt(thisSign).ToUpper() != sign.ToUpper())
{
throw Oops.Oh(ErrorCodeEnum.Code1005);
}
}



/// <summary>
/// 获取模型值
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="t"></param>
/// <returns></returns>
public string GetModelValue<T>(T t, string name)
{
string retstr = "";
//定义PropertyInfo的List
List<PropertyInfo> proplist = new List<PropertyInfo>();
//遍历泛型类的每个属性加入到List里面
Array.ForEach<PropertyInfo>(typeof(T).GetProperties(),
p => proplist.Add(p));

foreach (PropertyInfo prop in proplist)
{
if (prop.Name.ToLower() == name.ToLower())
{
var data = prop.GetValue(t, null);
if (data != null)
{
return data.ToString();
}
}
}

return "";
}

/// <summary>
/// 检查平key验证
/// </summary>
/// <param name="key"></param>
public async Task CheckKey(string key)
{
var data = await SqlSugarDb.Db.Queryable<BPA_PlatformAuthorization>()
.FirstAsync(x => x.Key == key);
if (data == null)
{
throw Oops.Oh(ErrorCodeEnum.Code1004);
}

}

/// <summary>
/// 检查租户
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task CheckTenant(string tenantId)
{
var data = await SqlSugarDb.Db.Queryable<BPA_Company>().FirstAsync(x => x.Id == tenantId);

if (data == null)
{
throw Oops.Oh(ErrorCodeEnum.Code1000);
}

}
}
}

+ 22
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/ICheckServices.cs 查看文件

@@ -0,0 +1,22 @@
using BPA.SAAS.Manage.Application.AExternalPlatform.Enum;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos;
using BPA.SAAS.Manage.Comm.Enum;
using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Services
{
public interface ICheckServices
{
/// <summary>
///检查Sign
/// </summary>
Task CheckSign<T>(T dto);
}
}

+ 158
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Dtos/MaterialDto.cs 查看文件

@@ -0,0 +1,158 @@
using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto;
using BPA.SAAS.Manage.Comm.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos
{
public class MaterialPageInputDto: BaseEPDto
{
/// <summary>
/// 当前页码
/// </summary>
private int current;
public virtual int Current
{
get
{
return current;
}
set
{

current = value;
if (current <= 0)
{
current = 1;
}
}
}

/// <summary>
/// 页码容量
/// </summary>
private int pagesize;
public virtual int PageSize
{
get
{
return pagesize;
}
set
{

pagesize = value;
if (pagesize <= 0)
{
pagesize = 10;
}
}
}

public string Name { get; set; }
}
public class MaterialDto
{
public string Id { get; set; }
/// <summary>
/// 原料编码
/// </summary>
public string Code { get; set; }

/// <summary>
/// 原料名称
/// </summary>
public string Name { get; set; }

///// <summary>
///// 原料类型
///// </summary>
//public string TypeId { get; set; }

/// <summary>
/// 原料类型名称
/// </summary>
public string TypeName { get; set; }

///// <summary>
///// 物料单位
///// </summary>
//public string UintId { get; set; }


/// <summary>
/// 物料单位名称
/// </summary>
public string UintName { get; set; }

}

public class DelMaterialDto : BaseEPDto
{
public string MaterialId { get; set; }

}

public class MaterialCreateDto : BaseEPDto
{
/// <summary>
/// 原料编码
/// </summary>
public string Code { get; set; }

/// <summary>
/// 原料名称
/// </summary>
public string Name { get; set; }


/// <summary>
/// 原料类型名称
/// </summary>
public string TypeName { get; set; }



/// <summary>
/// 物料单位名称
/// </summary>
public string UintName { get; set; }

}

public class MaterialUpdateDto : BaseEPDto
{
public string Id { get; set; }

/// <summary>
/// 原料编码
/// </summary>
public string Code { get; set; }

/// <summary>
/// 原料名称
/// </summary>
public string Name { get; set; }


/// <summary>
/// 原料类型名称
/// </summary>
public string TypeName { get; set; }


/// <summary>
/// 物料单位名称
/// </summary>
public string UintName { get; set; }

}

}

+ 72
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/MaterialServices.cs 查看文件

@@ -0,0 +1,72 @@
using BPA.SAAS.Manage.Application.AExternalPlatform.Enum;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos;
using BPA.SAAS.Manage.Comm.Enum;
using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Forms;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Services
{
[ApiDescriptionSettings("开放平台", Tag = "物料管理"), AllowAnonymous]
public class Material11Services : IDynamicApiController
{
private readonly IMaterialServices _materialServices;
public Material11Services(IMaterialServices materialServices)
{
_materialServices=materialServices;
}

/// <summary>
/// 分页查询物料
/// </summary>
/// <param name="inputDto"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Material/GetMaterialPageList")]
public async Task<PageUtil<List<MaterialDto>>> GetMaterialPageList(MaterialPageInputDto inputDto)
{
return await _materialServices.GetMaterialPageList(inputDto);
}


/// <summary>
/// 添加物料
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Material/AddMaterial")]
public async Task<bool> AddMaterial(MaterialCreateDto InputDto)
{
return await _materialServices.AddMaterial(InputDto);
}

/// <summary>
/// 删除物料
/// </summary>
/// <param name="MaterialId"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Material/DelMaterial")]
public async Task<bool> DelMaterial(DelMaterialDto inputDto)
{
return await _materialServices.DelMaterial(inputDto);
}


/// <summary>
/// 修改物料
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Material/UpdateMateria")]
public async Task<bool> UpdateMateria(MaterialUpdateDto InputDto)
{
return await _materialServices.UpdateMateria(InputDto);
}
}
}

+ 47
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/IMaterialServices.cs 查看文件

@@ -0,0 +1,47 @@
using BPA.SAAS.Manage.Application.AExternalPlatform.Enum;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos;
using BPA.SAAS.Manage.Comm.Enum;
using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Services
{
public interface IMaterialServices
{
/// <summary>
/// 分页查询物料
/// </summary>
/// <param name="inputDto"></param>
/// <returns></returns>
Task<PageUtil<List<MaterialDto>>> GetMaterialPageList(MaterialPageInputDto inputDto);


/// <summary>
/// 添加物料
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
Task<bool> AddMaterial(MaterialCreateDto inputDto);

/// <summary>
/// 删除物料
/// </summary>
/// <param name="MaterialId"></param>
/// <returns></returns>
Task<bool> DelMaterial(DelMaterialDto inputDto);


/// <summary>
/// 修改物料
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
Task<bool> UpdateMateria(MaterialUpdateDto inputDto);
}
}

+ 236
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/MaterialService.cs 查看文件

@@ -0,0 +1,236 @@
using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto;
using BPA.SAAS.Manage.Application.AExternalPlatform.Enum;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Services;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos;
using BPA.SAAS.Manage.Comm.Enum;
using BPA.SAAS.Manage.Core;
using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
using Microsoft.AspNetCore.Components.Forms;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Services
{
public class MaterialService : UserAnalysis, IMaterialServices, ITransient
{
private readonly ICheckServices _checkServices;
public MaterialService(ICheckServices checkServices)
{
_checkServices = checkServices;
}

/// <summary>
/// 分页查询物料
/// </summary>
/// <param name="inputDto"></param>
/// <returns></returns>
public async Task<PageUtil<List<MaterialDto>>> GetMaterialPageList(MaterialPageInputDto inputDto)
{
//验签
await _checkServices.CheckSign(inputDto);

int total = new RefAsync<int>();
var data = SqlSugarDb.Db.Queryable<BPA_Batching, BPA_BatchingType, BPA_BatchingUint>((a, b, c) =>
new JoinQueryInfos(JoinType.Left, a.Batching_Type == b.Id,
JoinType.Left, a.StockUint == c.Id))
.Where((a, b, c) => a.IsDeleted == 0)
.WhereIF(!string.IsNullOrEmpty(inputDto.Name), (a, b, c) => a.Batching_Name.Contains(inputDto.Name))
.Select((a, b, c) => new MaterialDto()
{
Id= a.Id,
Code = a.Code,
Name = a.Batching_Name,
//TypeId = b.Id,
TypeName = b.Name,
// UintId = c.Id,
UintName = c.Name,

}).ToPageList(inputDto.Current, inputDto.PageSize, ref total);

return new PageUtil<List<MaterialDto>>()
{
Total = total,
Data = data
};
}


/// <summary>
/// 添加物料
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
public async Task<bool> AddMaterial(MaterialCreateDto inputDto)
{

try
{
//验签
await _checkServices.CheckSign(inputDto);

SqlSugarDb.Db.Ado.BeginTran();
//1.物料单位查询
var typeData = await SqlSugarDb.Db.Queryable<BPA_BatchingType>().FirstAsync(x => x.Name == inputDto.TypeName);
if (typeData == null)
{

typeData = new BPA_BatchingType()
{
GroupId = CurrentUser.GroupId,
Id = Guid.NewGuid().ToString(),
Name = string.IsNullOrEmpty(inputDto.TypeName) ? "默认分类" : inputDto.TypeName,
};
SqlSugarDb.Db.Insertable(typeData).ExecuteCommand();
}

//2.单位查询
var uintData = await SqlSugarDb.Db.Queryable<BPA_BatchingUint>()
.FirstAsync(x => x.Name == inputDto.UintName);
if (uintData == null)
{
uintData = new BPA_BatchingUint()
{
GroupId = CurrentUser.GroupId,
Id = Guid.NewGuid().ToString(),
Name = string.IsNullOrEmpty(inputDto.UintName) ? "默认分类" : inputDto.UintName,
};
SqlSugarDb.Db.Insertable(uintData).ExecuteCommand();
}
//3.物料查询
var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Batching_Name == inputDto.Name);
if (materialData == null)
{
materialData = new BPA_Batching()
{
Id = Guid.NewGuid().ToString(),
GroupId = CurrentUser.GroupId,
Aittribute = 0,
Batching_Name = inputDto.Name,
Batching_Type = typeData.Id,
Code = inputDto.Code,
Price = 0,
Specs = "",
outstockUint = uintData.Id,
Status = CommonStatus.ENABLE,
StockUint = uintData.Id,
TypeID = typeData.Id,
IsDeleted = 0,
};

SqlSugarDb.Db.Insertable(materialData).ExecuteCommand();
}
else
{
throw Oops.Oh(ErrorCodeEnum.Code1002);
}


SqlSugarDb.Db.Ado.CommitTran();
return true;
}
catch (Exception e)
{
SqlSugarDb.Db.Ado.RollbackTran();
throw Oops.Oh(ErrorCodeEnum.Code1001);
}
}

/// <summary>
/// 删除物料
/// </summary>
/// <param name="MaterialId"></param>
/// <returns></returns>
public async Task<bool> DelMaterial(DelMaterialDto inputDto)
{
//验签
await _checkServices.CheckSign(inputDto);

var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Id == inputDto.MaterialId);
if (materialData == null)
{
throw Oops.Oh(ErrorCodeEnum.Code1003);
}
var res = await SqlSugarDb.Db.Deleteable(materialData).ExecuteCommandAsync();
return res > 0;
}

/// <summary>
/// 修改物料
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
public async Task<bool> UpdateMateria(MaterialUpdateDto inputDto)
{
try
{
//验签
await _checkServices.CheckSign(inputDto);

SqlSugarDb.Db.Ado.BeginTran();
//1.物料单位查询
var typeData = await SqlSugarDb.Db.Queryable<BPA_BatchingType>().FirstAsync(x => x.Name == inputDto.TypeName);
if (typeData == null)
{

typeData = new BPA_BatchingType()
{
GroupId = CurrentUser.GroupId,
Id = Guid.NewGuid().ToString(),
Name = string.IsNullOrEmpty(inputDto.TypeName) ? "默认分类" : inputDto.TypeName,
};
SqlSugarDb.Db.Insertable(typeData).ExecuteCommand();
}

//2.单位查询
var uintData = await SqlSugarDb.Db.Queryable<BPA_BatchingUint>()
.FirstAsync(x => x.Name == inputDto.UintName);
if (uintData == null)
{
uintData = new BPA_BatchingUint()
{
GroupId = CurrentUser.GroupId,
Id = Guid.NewGuid().ToString(),
Name = string.IsNullOrEmpty(inputDto.UintName) ? "默认分类" : inputDto.UintName,
};
SqlSugarDb.Db.Insertable(uintData).ExecuteCommand();
}
//3.物料查询
var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Batching_Name == inputDto.Name);
if (materialData == null)
{
throw Oops.Oh(ErrorCodeEnum.Code1003);


}
else
{
materialData = new BPA_Batching()
{
Id = Guid.NewGuid().ToString(),
GroupId = CurrentUser.GroupId,
Aittribute = 0,
Batching_Name = inputDto.Name,
Batching_Type = typeData.Id,
Code = inputDto.Code,
Price = 0,
Specs = "",
outstockUint = uintData.Id,
Status = CommonStatus.ENABLE,
StockUint = uintData.Id,
TypeID = typeData.Id,
IsDeleted = 0,
};
SqlSugarDb.Db.Updateable(materialData).ExecuteCommand();
}


SqlSugarDb.Db.Ado.CommitTran();
return true;
}
catch (Exception e)
{
SqlSugarDb.Db.Ado.RollbackTran();
throw Oops.Oh(ErrorCodeEnum.Code1001);
}
}
}
}

+ 76
- 1
BPA.SAAS.Manage.Application/Auth/AuthService.cs 查看文件

@@ -1,6 +1,8 @@
using BPA.SAAS.Manage.Application.Auth.Dtos;
using BPA.SAAS.Manage.Comm.Const;
using BPA.SAAS.Manage.Comm.Enum;
using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core.Org;
using Mapster;
using Newtonsoft.Json;
@@ -46,7 +48,10 @@ namespace BPA.SAAS.Manage.Application.Auth
conModels.Add(new ConditionalModel() { FieldName = "Id", ConditionalType = ConditionalType.Equal, FieldValue = user.GroupId });
conModels.Add(new ConditionalModel() { FieldName = "Status", ConditionalType = ConditionalType.Equal, FieldValue = CommonStatus.ENABLE.ToString() });
conModels.Add(new ConditionalModel() { FieldName = "IsDeleted", ConditionalType = ConditionalType.Equal, FieldValue ="0" });
//if (user.AdminType != 1)
//{
// conModels.Add(new ConditionalModel() { FieldName = "Type", ConditionalType = ConditionalType.Equal, FieldValue = input.Type.ToString() });
//}
var company = _db.Queryable<BPA_Company>().Where(conModels).First();
string CLAINM_SUPERADMIN = "Customer";
@@ -116,5 +121,75 @@ namespace BPA.SAAS.Manage.Application.Auth
// _httpContextAccessor.SignoutToSwagger();
await Task.CompletedTask;
}


#region 添加平台授权

/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/api/authorization/pageauthorization")]
public async Task<PageUtil> PageAuthorization(PageInputBase input)
{
RefAsync<int> total = 0;
var res = await _db.Queryable<BPA_PlatformAuthorization>()
.OrderBy(x => x.CreateAt, OrderByType.Desc)
.Select(x => new PlatformAuthorizationDto()
{
Id = x.Id.SelectAll(),
})
.ToPageListAsync(input.Current, input.PageSize, total);
PageUtil util = new PageUtil()
{
Total = total,
Data = res
};
return util;
}

/// <summary>
/// 添加授权码
/// </summary>
/// <returns></returns>
[HttpPost("/api/authorization/addauthorization")]
public async Task<bool> AddAuthorization()
{
var data = _db.Queryable<BPA_PlatformAuthorization>().ToList();
if (data.Count > 0)
{
throw Oops.Oh("授权码已存在");
}

var res = await _db.Insertable(new BPA_PlatformAuthorization()
{
Key = Guid.NewGuid().ToString(),

}).CallEntityMethod(t => t.Create()).ExecuteCommandAsync();

return res > 0;
}

/// <summary>
/// 修改授权码
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("/api/authorization/updateauthorization")]
public async Task<bool> UpdateAuthorization(string id)
{
var data = await _db.Queryable<BPA_PlatformAuthorization>().FirstAsync(x => x.Id == id);
if (data == null)
{
throw Oops.Oh("授权信息不存在");
}
data.Key = Guid.NewGuid().ToString();

return await _db.Updateable(data).ExecuteCommandHasChangeAsync();
}


#endregion
}
}

+ 14
- 0
BPA.SAAS.Manage.Application/Auth/Dtos/PlatformAuthorizationDto.cs 查看文件

@@ -0,0 +1,14 @@
using BPA.SAAS.Manage.Core.DataBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.Auth.Dtos
{
public class PlatformAuthorizationDto: BPA_PlatformAuthorization
{

}
}

+ 25
- 0
BPA.SAAS.Manage.Application/Auth/IAuthService.cs 查看文件

@@ -1,4 +1,5 @@
using BPA.SAAS.Manage.Application.Auth.Dtos;
using BPA.SAAS.Manage.Core.Base;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -12,5 +13,29 @@ namespace BPA.SAAS.Manage.Application.Auth
Task<LoginOutInfo> Login([FromHeader] string logintype, [Required] LoginInput input);
Task<LoginOutput> GetLoginUserAsync();
Task LogoutAsync();

#region 添加平台授权

/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<PageUtil> PageAuthorization(PageInputBase input);

/// <summary>
/// 添加授权码
/// </summary>
/// <returns></returns>
Task<bool> AddAuthorization();

/// <summary>
/// 修改授权码
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<bool> UpdateAuthorization(string id);

#endregion
}
}

+ 6
- 0
BPA.SAAS.Manage.Application/BPA.SAAS.Manage.Application.csproj 查看文件

@@ -30,4 +30,10 @@
<ProjectReference Include="..\BPA.SAAS.Manage.Core\BPA.SAAS.Manage.Core.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="AExternalPlatform\Service\Authorization\Dtos\" />
<Folder Include="AExternalPlatform\Service\Authorization\Services\" />
<Folder Include="AExternalPlatform\Service\CheckService\Dtos\" />
</ItemGroup>

</Project>

+ 2
- 0
BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs 查看文件

@@ -202,8 +202,10 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
if (goods == null) throw Oops.Oh("商品不存在");
var goodsbom = _db.Queryable<BPA_GoodsBom>().Where(x => x.Goods_Id == id).ToList();
var goodsTechnology = _db.Queryable<BPA_GoodsTechnologyAction>().Where(x => x.GoodsId == id).ToList();
//var FoodMenuGoods = _db.Queryable<BPA_FoodMenuGoods>().Where(x => x.GoodsId == id).ToList();
await _db.Deleteable(goodsbom).ExecuteCommandAsync();
await _db.Deleteable(goodsTechnology).ExecuteCommandAsync();
//await _db.Deleteable(FoodMenuGoods).ExecuteCommandAsync();
var res = await _db.Deleteable(goods).ExecuteCommandAsync();
_db.Ado.CommitTran();
return res > 0;


+ 3
- 1
BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs 查看文件

@@ -23,6 +23,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
{
public class DeviceService: IDeviceService, ITransient
{
StoreServers storeServer = new();
ISqlSugarClient _db;
public DeviceService(ISqlSugarClient db)
{
@@ -35,6 +36,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
/// <returns></returns>
public async Task<PageUtil> GetDeviceInfoPage(DeviceQueryInputDto inputDto)
{
var dataStore =await storeServer.GetStop();
RefAsync<int> total =0;
var data = await _db.Queryable<BPA_DeviceInfo, BPA_Product>((a, b) => new JoinQueryInfos(JoinType.Left, a.ProductId == b.Id))

@@ -54,7 +56,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
{
var Vesion = _db.Queryable<BPA_ProductVesion>().Where(c => c.Id == x.ProductVersionId).First();
x.ProductVersionName = Vesion?.Vesion;
//x.StopName= dataStore?.Where(f=>f.Id==x.StopId).First()?.Name;
x.StopName= dataStore?.Where(f=>f.Id==x.StopId).FirstOrDefault()?.Name;
})
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total);
return new PageUtil()


+ 36
- 0
BPA.SAAS.Manage.Application/StoreServers.cs 查看文件

@@ -0,0 +1,36 @@
using BPA.SAAS.Manage.Application.Device.Dtos.Device;
using BPA.SAAS.Manage.Comm.Const;
using BPA.SAAS.Manage.Core.Base;
using Furion.RemoteRequest.Extensions;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application
{
[ApiDescriptionSettings("Stop", Tag = "获取场景")]
public class StoreServers: IDynamicApiController
{
public StoreServers()
{

}
private string BaseServerUrl = App.GetConfig<string>("baseurl");
[HttpGet("/api/stop/getstop")]
public async Task<List<StoreDto>> GetStop()
{
var getStoreurl = BaseServerUrl + "api/store/getstorelist_alm";//获取商品属性
var responseGoodsAttribute = await getStoreurl.SetHeaders(new
{
groupId = App.User?.FindFirst(ClaimConst.GroupId)?.Value
}).SetHttpMethod(HttpMethod.Get).GetAsStringAsync();
var resStore = JsonConvert.DeserializeObject<ResponDataBase>(responseGoodsAttribute);
if (resStore?.statusCode != "200") throw Oops.Oh("获取场景数据失败");
var dataStore = JsonConvert.DeserializeObject<List<StoreDto>>(resStore.data.ToString());
return dataStore;
}
}
}

+ 2
- 31
BPA.SAAS.Manage.Application/System/Services/MenuService.cs 查看文件

@@ -57,7 +57,7 @@ namespace BPA.SAAS.Manage.Application.System.Services
Status = t.Status,
IsAdmin=t.IsAdmin,
Type= t.Type,
//TypeName= GetTypeName(t.Type),
// TypeName= GetTypeName(t.Type),
Children = AllMenus.Where(x => x.Pid == t.Id).Select(x => new MenuTreeDtoOutput
{
Id = x.Id,
@@ -87,42 +87,13 @@ namespace BPA.SAAS.Manage.Application.System.Services
Status = y.Status,
IsAdmin=y.IsAdmin,
Type = y.Type,
// TypeName = GetTypeName(y.Type),
//TypeName = GetTypeName(y.Type),
}).ToList()
}).ToList()
}).ToList();

return data;
}
public string GetTypeName(string type)
{
var ary = type.Split(',');
var name = "";
for (int i = 0; i < ary.Length; i++)
{
if (ary[i] == "0")
{
name += "团餐";
}
if (ary[i] == "1")
{
name += "门店";
}
if (ary[i] == "2")
{
name += "后厨";
}
if (ary[i] == "3")
{
name += "公共";
}
if(i< ary.Length - 1)
{
name += ",";
}
}
return name;
}
/// <summary>
/// 新增菜单
/// </summary>


+ 14
- 0
BPA.SAAS.Manage.Core/Base/PageUtil.cs 查看文件

@@ -22,4 +22,18 @@ namespace BPA.SAAS.Manage.Core.Base

public int Total { get; set; }
}

public class PageUtil<T>
{
/// <summary>
/// Data
/// </summary>

public T Data { get; set; }
/// <summary>
/// Total
/// </summary>

public int Total { get; set; }
}
}

+ 15
- 0
BPA.SAAS.Manage.Core/CurrentUser.cs 查看文件

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Core
{
public static class CurrentUser
{
public static string GroupId { get; set; }

public static string Sign { get; set; }
}
}

+ 24
- 0
BPA.SAAS.Manage.Core/DataBase/BPA_FoodMenuGoods.cs 查看文件

@@ -0,0 +1,24 @@
using BPA.SAAS.Manage.Core.Base;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Core.DataBase
{
[SugarTable("bpa_foodmenugoods")]
public class BPA_FoodMenuGoods : IBaseEntity, IGroupId
{
/// <summary>
/// 菜谱id
/// </summary>
public string FoodMenuId { get; set; }
/// <summary>
/// 商品id
/// </summary>
public string GoodsId { get; set; }
public string GroupId { get; set; }
}
}

+ 21
- 0
BPA.SAAS.Manage.Core/DataBase/BPA_PlatformAuthorization.cs 查看文件

@@ -0,0 +1,21 @@
using BPA.SAAS.Manage.Core.Base;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Core.DataBase
{
/// <summary>
/// 平台授权
/// </summary>
[SugarTable("bpa_platformauthorization")]
public class BPA_PlatformAuthorization : IBaseEntity, IGroupId
{
public string Key { get; set; }

public string GroupId { get; set; }
}
}

+ 2
- 0
BPA.SAAS.Manage.Core/DbContext.cs 查看文件

@@ -32,6 +32,8 @@ namespace BPA.SAAS.Manage.Core
ConfigId = "default",
};

SqlSugarDb.SqlSugarScope(configConnection);

SqlSugarScope sqlSugar = new SqlSugarScope(configConnection,
db =>
{


+ 108
- 0
BPA.SAAS.Manage.Core/SqlSugarDb.cs 查看文件

@@ -0,0 +1,108 @@
using BPA.SAAS.Manage.Core.Base;
using SqlSugar;
using System;

namespace BPA.SAAS.Manage.Core
{
public class SqlSugarDb
{



public static SqlSugarScope Db { get; set; }

public static SqlSugarScope SqlSugarScope(ConnectionConfig configConnection)
{
//全局过滤

Db = new SqlSugarScope(configConnection, db =>
{
//全局过滤
TableFilterItem(db);
db.Aop.OnLogExecuting = (sql, pars) =>
{
//sql 执行前
};
db.Aop.OnLogExecuted = (sql, pars) =>
{
//sql 执行后
};
db.Aop.OnError = ex =>
{
//sql 异常
};
});

return Db;
}

#region 全局过滤器及配置
/// <summary>
/// 全局过滤
/// </summary>
private static void TableFilterItem(SqlSugarClient db)
{

//添加默认值
DataExecuting(db);
db.QueryFilter.AddTableFilter<IGroupId>(it => it.GroupId == CurrentUser.GroupId);
}

/// <summary>
/// 附默认值
/// </summary>
/// <param name="db"></param>
private static void DataExecuting(SqlSugarClient db)
{
//全局字段赋值
db.Aop.DataExecuting = (oldValue, entityInfo) =>
{
InsertByObject(entityInfo);
UpdateByObject(oldValue, entityInfo);
};

}
/// <summary>
///插入数据时附默认值
/// </summary>
/// <param name="entityInfo"></param>
private static void InsertByObject(DataFilterModel entityInfo)
{
if (entityInfo.OperationType != DataFilterType.InsertByObject) return;
switch (entityInfo.PropertyName)
{
case "CreateAt":
entityInfo.SetValue(DateTime.Now);
break;
case "CreateBy":
entityInfo.SetValue("");
break;
case "GroupId":
entityInfo.SetValue(CurrentUser.GroupId);
break;
}
}

/// <summary>
/// 修改数据时附默认值
/// </summary>
/// <param name="oldValue"></param>
/// <param name="entityInfo"></param>
private static void UpdateByObject(object oldValue, DataFilterModel entityInfo)
{
if (entityInfo.OperationType != DataFilterType.UpdateByObject) return;

switch (entityInfo.PropertyName)
{
case "UpdateAt":
entityInfo.SetValue(DateTime.Now);
break;
case "UpdateBy":
entityInfo.SetValue("");
break;
}

}
#endregion
}
}

+ 3
- 1
BPA.SAAS.Manage.Web.Core/Startup.cs 查看文件

@@ -3,6 +3,7 @@ using BPA.SAAS.Manage.Application.System.Dtos;
using BPA.SAAS.Manage.Core;
using FluentValidation.AspNetCore;
using Furion;
using Furion.UnifyResult;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
@@ -65,9 +66,10 @@ namespace BPA.SAAS.Manage.Web.Core
});
});
services.AddCorsAccessor();
services.AddRemoteRequest();
services.AddSqlsugarSetup(App.Configuration);
services.AddControllers()
.AddInjectWithUnifyResult();
.AddInjectWithUnifyResult<RESTfulResultProvider>();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)


+ 1
- 1
BPA.SAAS.Manage.Web.Entry/appsettings.json 查看文件

@@ -8,7 +8,7 @@
}
},
"AllowedHosts": "*",
"baseurl": "http://192.168.1.19:5008/",
"baseurl": "http://localhost:5008/",
"ConnectionConfigs": [
{
"ConnectionString": "server=10.2.1.21;Database=bpa_kitchen_kitchenbasemanage;Uid=root;Pwd=cygadmin;Allow Zero Datetime=True;Convert Zero Datetime=True;",


Loading…
取消
儲存