ソースを参照

提交

master
gwbvipvip 8ヶ月前
コミット
b3aa83ea37
7個のファイルの変更57行の追加50行の削除
  1. +28
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/BaseRequestDto.cs
  2. +0
    -22
      BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/UserAnalysis.cs
  3. +1
    -1
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Device/Services/DeviceService.cs
  4. +1
    -1
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Services/GoodsService.cs
  5. +4
    -3
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/MaterialServices.cs
  6. +4
    -3
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/IMaterialServices.cs
  7. +19
    -20
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/MaterialService.cs

+ 28
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/BaseRequestDto.cs ファイルの表示

@@ -0,0 +1,28 @@
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 BaseRequestDto<T>
{
/// <summary>
/// 是否下发
/// </summary>
public bool IsPush { get; set; }

/// <summary>
/// 回调地址
/// </summary>
public string CallbackUrl { get; set; }

public List<string> StoreIdList { get; set; }

public List<string> DeviceIdList { get; set; }

public T DataInfo { get; set; }

}
}

+ 0
- 22
BPA.SAAS.Manage.Application/AExternalPlatform/BaseDto/UserAnalysis.cs ファイルの表示

@@ -1,22 +0,0 @@
using BPA.SAAS.KitChenManage.Core;
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"];
}
}
}

+ 1
- 1
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Device/Services/DeviceService.cs ファイルの表示

@@ -21,7 +21,7 @@ using ResponDataBase = BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto.Res

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Device.Services
{
public class DeviceService: UserAnalysis, IDeviceService, ITransient
public class DeviceService: IDeviceService, ITransient
{
private string BaseServerUrl = App.GetConfig<string>("baseurl");
/// <summary>


+ 1
- 1
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Services/GoodsService.cs ファイルの表示

@@ -17,7 +17,7 @@ using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services
{
public class GoodsService: UserAnalysis, IGoodsService, ITransient
public class GoodsService: IGoodsService, ITransient
{
public GoodsService()
{


+ 4
- 3
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/MaterialServices.cs ファイルの表示

@@ -10,6 +10,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Forms;
using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Services
{
@@ -41,7 +42,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
/// <param name="InputDto"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Material/AddMaterial")]
public async Task<bool> AddMaterial(MaterialCreateDto InputDto)
public async Task<bool> AddMaterial(BaseRequestDto<MaterialCreateDto> InputDto)
{
return await _materialServices.AddMaterial(InputDto);
}
@@ -52,7 +53,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
/// <param name="MaterialId"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Material/DelMaterial")]
public async Task<bool> DelMaterial(DelMaterialDto inputDto)
public async Task<bool> DelMaterial(BaseRequestDto<DelMaterialDto> inputDto)
{
return await _materialServices.DelMaterial(inputDto);
}
@@ -64,7 +65,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
/// <param name="InputDto"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Material/UpdateMateria")]
public async Task<bool> UpdateMateria(MaterialUpdateDto InputDto)
public async Task<bool> UpdateMateria(BaseRequestDto<MaterialUpdateDto> InputDto)
{
return await _materialServices.UpdateMateria(InputDto);
}


+ 4
- 3
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/IMaterialServices.cs ファイルの表示

@@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Services
{
@@ -27,14 +28,14 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
Task<bool> AddMaterial(MaterialCreateDto inputDto);
Task<bool> AddMaterial(BaseRequestDto<MaterialCreateDto> inputDto);

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


/// <summary>
@@ -42,6 +43,6 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
Task<bool> UpdateMateria(MaterialUpdateDto inputDto);
Task<bool> UpdateMateria(BaseRequestDto<MaterialUpdateDto> inputDto);
}
}

+ 19
- 20
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/MaterialService.cs ファイルの表示

@@ -12,7 +12,7 @@ using Microsoft.AspNetCore.Components.Forms;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Services
{
public class MaterialService : UserAnalysis, IMaterialServices, ITransient
public class MaterialService : IMaterialServices, ITransient
{
private readonly ICheckServices _checkServices;
public MaterialService(ICheckServices checkServices)
@@ -60,15 +60,14 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
public async Task<bool> AddMaterial(MaterialCreateDto inputDto)
public async Task<bool> AddMaterial(BaseRequestDto<MaterialCreateDto> inputDto)
{

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

@@ -76,26 +75,26 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
{
GroupId = CurrentUser.GroupId,
Id = Guid.NewGuid().ToString(),
Name = string.IsNullOrEmpty(inputDto.TypeName) ? "默认分类" : inputDto.TypeName,
Name = string.IsNullOrEmpty(inputDto.DataInfo.TypeName) ? "默认分类" : inputDto.DataInfo.TypeName,
};
SqlSugarDb.Db.Insertable(typeData).ExecuteCommand();
}

//2.单位查询
var uintData = await SqlSugarDb.Db.Queryable<BPA_BatchingUint>()
.FirstAsync(x => x.Name == inputDto.UintName);
.FirstAsync(x => x.Name == inputDto.DataInfo.UintName);
if (uintData == null)
{
uintData = new BPA_BatchingUint()
{
GroupId = CurrentUser.GroupId,
Id = Guid.NewGuid().ToString(),
Name = string.IsNullOrEmpty(inputDto.UintName) ? "默认分类" : inputDto.UintName,
Name = string.IsNullOrEmpty(inputDto.DataInfo.UintName) ? "默认分类" : inputDto.DataInfo.UintName,
};
SqlSugarDb.Db.Insertable(uintData).ExecuteCommand();
}
//3.物料查询
var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Batching_Name == inputDto.Name);
var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Batching_Name == inputDto.DataInfo.Name);
if (materialData == null)
{
materialData = new BPA_Batching()
@@ -103,9 +102,9 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
Id = Guid.NewGuid().ToString(),
GroupId = CurrentUser.GroupId,
Aittribute = 0,
Batching_Name = inputDto.Name,
Batching_Name = inputDto.DataInfo.Name,
Batching_Type = typeData.Id,
Code = inputDto.Code,
Code = inputDto.DataInfo.Code,
Price = 0,
Specs = "",
outstockUint = uintData.Id,
@@ -138,11 +137,11 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
/// </summary>
/// <param name="MaterialId"></param>
/// <returns></returns>
public async Task<bool> DelMaterial(DelMaterialDto inputDto)
public async Task<bool> DelMaterial(BaseRequestDto<DelMaterialDto> inputDto)
{

var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Id == inputDto.MaterialId);
var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Id == inputDto.DataInfo.MaterialId);
if (materialData == null)
{
throw Oops.Oh(ErrorCodeEnum.Code1003);
@@ -156,7 +155,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
/// </summary>
/// <param name="InputDto"></param>
/// <returns></returns>
public async Task<bool> UpdateMateria(MaterialUpdateDto inputDto)
public async Task<bool> UpdateMateria(BaseRequestDto<MaterialUpdateDto> inputDto)
{
try
{
@@ -164,7 +163,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service

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

@@ -172,26 +171,26 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
{
GroupId = CurrentUser.GroupId,
Id = Guid.NewGuid().ToString(),
Name = string.IsNullOrEmpty(inputDto.TypeName) ? "默认分类" : inputDto.TypeName,
Name = string.IsNullOrEmpty(inputDto.DataInfo.TypeName) ? "默认分类" : inputDto.DataInfo.TypeName,
};
SqlSugarDb.Db.Insertable(typeData).ExecuteCommand();
}

//2.单位查询
var uintData = await SqlSugarDb.Db.Queryable<BPA_BatchingUint>()
.FirstAsync(x => x.Name == inputDto.UintName);
.FirstAsync(x => x.Name == inputDto.DataInfo.UintName);
if (uintData == null)
{
uintData = new BPA_BatchingUint()
{
GroupId = CurrentUser.GroupId,
Id = Guid.NewGuid().ToString(),
Name = string.IsNullOrEmpty(inputDto.UintName) ? "默认分类" : inputDto.UintName,
Name = string.IsNullOrEmpty(inputDto.DataInfo.UintName) ? "默认分类" : inputDto.DataInfo.UintName,
};
SqlSugarDb.Db.Insertable(uintData).ExecuteCommand();
}
//3.物料查询
var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Batching_Name == inputDto.Name);
var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Code == inputDto.DataInfo.Code);
if (materialData == null)
{
throw Oops.Oh(ErrorCodeEnum.Code1003);
@@ -205,9 +204,9 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
Id = Guid.NewGuid().ToString(),
GroupId = CurrentUser.GroupId,
Aittribute = 0,
Batching_Name = inputDto.Name,
Batching_Name = inputDto.DataInfo.Name,
Batching_Type = typeData.Id,
Code = inputDto.Code,
Code = inputDto.DataInfo.Code,
Price = 0,
Specs = "",
outstockUint = uintData.Id,


読み込み中…
キャンセル
保存