Browse Source

Merge branch 'groupmealmanage' of http://10.2.1.24:10244/zhaoy/BPA.SAAS.Manage into groupmealmanage

groupmealmanage
gwbvipvip 11 months ago
parent
commit
8fe8cb195c
5 changed files with 18 additions and 14 deletions
  1. +4
    -1
      BPA.SAAS.Manage.Application/Device/Services/ProductService.cs
  2. +1
    -0
      BPA.SAAS.Manage.Application/Org/Dtos/Organize/OrgOutput.cs
  3. +7
    -7
      BPA.SAAS.Manage.Application/Org/Services/CompanyService.cs
  4. +1
    -1
      BPA.SAAS.Manage.Application/System/Services/DictDataService.cs
  5. +5
    -5
      BPA.SAAS.Manage.Application/System/Services/MenuService.cs

+ 4
- 1
BPA.SAAS.Manage.Application/Device/Services/ProductService.cs View File

@@ -61,6 +61,8 @@ namespace BPA.SAAS.Manage.Application.Device.Services
public async Task<bool> AddProduct(ProductBaseDto inputDto)
{
var count=_db.Queryable<BPA_Product>().Count();
var check=_db.Queryable<BPA_Product>().Where(x => x.Name == inputDto.Name || x.Code == inputDto.Code).Any();
if (check) throw Oops.Oh("产品名称和标识不能重复");
var res = await _db.Insertable(new BPA_Product
{
Name = inputDto.Name,
@@ -91,7 +93,8 @@ namespace BPA.SAAS.Manage.Application.Device.Services
public async Task<bool> UpdateProduct(ProductBaseDto inputDto)
{
var data = await _db.Queryable<BPA_Product>().Where(x => x.Id == inputDto.Id).FirstAsync();

var check = _db.Queryable<BPA_Product>().Where(x => x.Name == inputDto.Name || x.Code == inputDto.Code).Any();
if (check) throw Oops.Oh("产品名称和标识不能重复");
if (data != null)
{
var res = _db.Updateable<BPA_Product>()


+ 1
- 0
BPA.SAAS.Manage.Application/Org/Dtos/Organize/OrgOutput.cs View File

@@ -47,5 +47,6 @@ namespace BPA.SAAS.Manage.Application.Org.Dtos.Organize
/// </summary>
public string GroupId { get; set; }
public DateTime CreateAt { get; set; }
public int Sort { get; set; }
}
}

+ 7
- 7
BPA.SAAS.Manage.Application/Org/Services/CompanyService.cs View File

@@ -32,16 +32,16 @@ namespace BPA.SAAS.Manage.Application.Org.Services
public async Task<PageUtil> CompanyPage(CompanyDtoPageInput input)
{
RefAsync<int> total = 0;
var data =await _db.Queryable<BPA_Company, BPA_Roles>((a, b) => new JoinQueryInfos(JoinType.Inner, a.Id == b.GroupId))
.Where((a, b) => a.IsDeleted == 0)
.WhereIF(!input.Name.IsNullOrEmpty(), (a, b) => a.Name.Contains(input.Name))
.WhereIF(!input.AdminName.IsNullOrEmpty(), (a, b) => a.AdminName.Contains(input.AdminName))
.WhereIF(!input.Email.IsNullOrEmpty(), (a, b) => a.Email.Contains(input.Email))
var data =await _db.Queryable<BPA_Company>()
.Where((a) => a.IsDeleted == 0)
.WhereIF(!input.Name.IsNullOrEmpty(), (a) => a.Name.Contains(input.Name))
.WhereIF(!input.AdminName.IsNullOrEmpty(), (a) => a.AdminName.Contains(input.AdminName))
.WhereIF(!input.Email.IsNullOrEmpty(), (a) => a.Email.Contains(input.Email))
.Filter(null, true)
.Select((a, b) => new CompanyDtoInput
.Select((a) => new CompanyDtoInput
{
Id = a.Id.SelectAll(),
SysRoleId = b.Id
SysRoleId =SqlFunc.Subqueryable< BPA_Roles>().Where(x=>x.GroupId == a.Id).Select(x => x.Id),
})
.OrderBy(a => a.CreateAt, OrderByType.Desc)
.ToPageListAsync(input.Current, input.PageSize, total);


+ 1
- 1
BPA.SAAS.Manage.Application/System/Services/DictDataService.cs View File

@@ -135,7 +135,7 @@ namespace BPA.SAAS.Manage.Application
resEntity.Value = dto.Value;
resEntity.Code = dto.Code;
resEntity.Remark = dto.Remark;
resEntity.Status = (CommonStatus)Enum.ToObject(typeof(CommonStatus), int.Parse(dto.Status));
//resEntity.Status = (CommonStatus)Enum.ToObject(typeof(CommonStatus), int.Parse(dto.Status));
var res =await _db.Updateable(resEntity).ExecuteCommandAsync();
return res > 0;
}


+ 5
- 5
BPA.SAAS.Manage.Application/System/Services/MenuService.cs View File

@@ -131,10 +131,10 @@ namespace BPA.SAAS.Manage.Application.System.Services
public async Task<bool> Add(MenuDtoInput input)
{
var dicttypes = _db.Queryable<BPA_Menu>().Where(a => a.Code == input.Code).ToList();
//if (dicttypes.Count() > 0)
//{
// throw Oops.Oh("编码已存在");
//}
if (dicttypes.Count() > 0)
{
throw Oops.Oh("编码已存在");
}
if (input.Name.Length > 20)
{
throw Oops.Oh("菜单名称过长");
@@ -324,7 +324,7 @@ namespace BPA.SAAS.Manage.Application.System.Services
}
else
{
var AllMenus = _db.Queryable<BPA_Menu>().Where(t => (t.Type.Contains(type) || t.Type.Contains("3")) && t.IsAdmin == 0).OrderBy(t => t.Sort).ToList();
var AllMenus = _db.Queryable<BPA_Menu>().Where(t => t.IsAdmin == 0).OrderBy(t => t.Sort).ToList();
var data = AllMenus.Where((t => t.Pid == null || t.Pid == "")).Select(t => new MenuTreeOutput
{
Key = t.Id,


Loading…
Cancel
Save