Browse Source

第三方接口

master
zhaoy 6 months ago
parent
commit
a8535e994a
13 changed files with 74 additions and 36 deletions
  1. +3
    -3
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Bom/BomServices.cs
  2. +13
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Bom/Dtos/DeleteBomDto.cs
  3. +4
    -3
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Bom/Services/BomService.cs
  4. +2
    -2
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Bom/Services/IBomService.cs
  5. +1
    -1
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Device/Dtos/DeviceInfoDelDto.cs
  6. +13
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Dtos/DeleteGoodsDto.cs
  7. +2
    -7
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Dtos/GoodsTechnologyActionListViewDto.cs
  8. +4
    -4
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/GoodsServices.cs
  9. +13
    -6
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Services/GoodsService.cs
  10. +2
    -2
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Services/IGoodsService.cs
  11. +2
    -2
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/WarehouseTemplate/Dtos/WarehouseTemplatInsertDto.cs
  12. +10
    -2
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/WarehouseTemplate/Dtos/WarehouseTemplateView.cs
  13. +5
    -4
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/WarehouseTemplate/Services/WarehouseTemplateService.cs

+ 3
- 3
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Bom/BomServices.cs View File

@@ -50,9 +50,9 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Bom
/// <param name="ids"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Bom/DeleteBom")]
public async Task<bool> DeleteBom(string[] ids)
public async Task<bool> DeleteBom(DeleteBomDto dto)
{
return await _bomService.DeleteBom(ids);
return await _bomService.DeleteBom(dto);
}
/// <summary>
/// 根据配方id查询配方详情
@@ -60,7 +60,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Bom
/// <param name="bomId"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Bom/GetBomEntry")]
public async Task<BomEntryDto> GetBomEntry(BomIdDto dto)
public async Task<List<BomEntryDto>> GetBomEntry(BomIdDto dto)
{
return await _bomService.GetBomEntry(dto);
}


+ 13
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Bom/Dtos/DeleteBomDto.cs View File

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

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Bom.Dtos
{
public class DeleteBomDto
{
public List<string> Ids { get; set; }
}
}

+ 4
- 3
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Bom/Services/BomService.cs View File

@@ -138,11 +138,12 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Bom.Services
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public async Task<bool> DeleteBom(string[] ids)
public async Task<bool> DeleteBom(DeleteBomDto dto)
{
try
{
SqlSugarDb.Db.BeginTran();
var ids= dto.Ids;
var goods = SqlSugarDb.Db.Queryable<BPA_Bom>().Where(x => ids.Contains(x.Id)).ToList();
if (goods == null) throw Oops.Oh(ErrorCodeEnum.Code10015);
var goodsbom = SqlSugarDb.Db.Queryable<BPA_BomEntry>().Where(x => ids.Contains(x.BomId)).ToList();
@@ -163,7 +164,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Bom.Services
/// </summary>
/// <param name="bomId"></param>
/// <returns></returns>
public async Task<BomEntryDto> GetBomEntry(BomIdDto dto)
public async Task<List<BomEntryDto>> GetBomEntry(BomIdDto dto)
{
try
{
@@ -178,7 +179,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Bom.Services
BatchingName=c.Batching_Name,
BomId = a.BomId,
BomName=b.Name
}).FirstAsync();
}).ToListAsync();
return resEntity;
}


+ 2
- 2
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Bom/Services/IBomService.cs View File

@@ -35,13 +35,13 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Bom.Services
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
Task<bool> DeleteBom(string[] ids);
Task<bool> DeleteBom(DeleteBomDto dto);
/// <summary>
/// 根据配方id查询配方详情
/// </summary>
/// <param name="bomId"></param>
/// <returns></returns>
Task<BomEntryDto> GetBomEntry(BomIdDto dto);
Task<List<BomEntryDto>> GetBomEntry(BomIdDto dto);
/// <summary>
/// 添加配方详情
/// </summary>


+ 1
- 1
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Device/Dtos/DeviceInfoDelDto.cs View File

@@ -8,6 +8,6 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Device.Dtos
{
public class DeviceInfoDelDto
{
public string[] Ids { get; set; }
public List<string> Ids { get; set; }
}
}

+ 13
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Dtos/DeleteGoodsDto.cs View File

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

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Dtos
{
public class DeleteGoodsDto
{
public List<string> Ids { get; set; }
}
}

+ 2
- 7
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Dtos/GoodsTechnologyActionListViewDto.cs View File

@@ -12,7 +12,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Dtos
public string DeviceId { get; set; }
public string WarehousrTemplateId { get; set; }
public string GoodsAttributeId { get; set; }
public string DeviceName { get; set; }
public string TechnologyName { get; set; }
public List<GoodsTechnologyActionViewDto> Data { get; set; }
}
public class GoodsTechnologyActionViewDto
@@ -30,17 +30,12 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Dtos
/// 商品属性id集合
/// </summary>
public string GoodsAttributeId { get; set; }
/// <summary>
/// 是否物料
/// </summary>
public bool IsBatch { get; set; }

/// <summary>
/// 动作value
/// </summary>
public string ChnologyId { get; set; }
public DateTime CreateAt { get; set; }
public string GroupId { get; set; }
public int IsDeleted { get; set; }
public int Sort { get; set; }
public string GoodsId { get; set; }
public string DeviceId { get; set; }


+ 4
- 4
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/GoodsServices.cs View File

@@ -58,9 +58,9 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods
/// <param name="ids"></param>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Goods/DeleteGoods")]
public async Task<bool> DeleteGoods(string[] ids)
public async Task<bool> DeleteGoods(DeleteGoodsDto dto)
{
return await _goodsService.DeleteGoods(ids);
return await _goodsService.DeleteGoods(dto);
}
/// <summary>
///添加商品属性
@@ -77,9 +77,9 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods
/// </summary>
/// <returns></returns>
[HttpPost("/api/ExternalPlatform/Goods/GetGoodsAttributeList")]
public async Task<List<GoodsAttributeVewDto>> GetGoodsAttributeList()
public async Task<List<GoodsAttributeVewDto>> GetGoodsAttributeList(GoodsIdDto dto)
{
return await _goodsService.GetGoodsAttributeList();
return await _goodsService.GetGoodsAttributeList(dto);
}
/// <summary>
/// 查询商品工艺


+ 13
- 6
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Services/GoodsService.cs View File

@@ -206,15 +206,15 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public async Task<bool> DeleteGoods(string[] ids)
public async Task<bool> DeleteGoods(DeleteGoodsDto dto)
{
try
{
SqlSugarDb.Db.BeginTran();
var goods = SqlSugarDb.Db.Queryable<BPA_GoodsInfo>().Where(x => ids.Contains(x.Id)).ToList();
var goods = SqlSugarDb.Db.Queryable<BPA_GoodsInfo>().Where(x => dto.Ids.Contains(x.Id)).ToList();
if (goods == null) throw Oops.Oh(ErrorCodeEnum.Code1008);
var goodsbom = SqlSugarDb.Db.Queryable<BPA_GoodsBom>().Where(x => ids.Contains( x.Goods_Id)).ToList();
var goodsTechnology = SqlSugarDb.Db.Queryable<BPA_GoodsTechnologyAction>().Where(x => ids.Contains(x.GoodsId)).ToList();
var goodsbom = SqlSugarDb.Db.Queryable<BPA_GoodsBom>().Where(x => dto.Ids.Contains( x.Goods_Id)).ToList();
var goodsTechnology = SqlSugarDb.Db.Queryable<BPA_GoodsTechnologyAction>().Where(x => dto.Ids.Contains(x.GoodsId)).ToList();
await SqlSugarDb.Db.Deleteable(goodsbom).ExecuteCommandAsync();
await SqlSugarDb.Db.Deleteable(goodsTechnology).ExecuteCommandAsync();
var res = await SqlSugarDb.Db.Deleteable(goods).ExecuteCommandAsync();
@@ -281,9 +281,16 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services
/// 查询商品属性
/// </summary>
/// <returns></returns>
public async Task<List<GoodsAttributeVewDto>> GetGoodsAttributeList()
public async Task<List<GoodsAttributeVewDto>> GetGoodsAttributeList(GoodsIdDto dto)
{
var goodstypeid = "";
var goods=SqlSugarDb.Db.Queryable<BPA_GoodsInfo>().WhereIF(!string.IsNullOrWhiteSpace(dto.GoodsId), x => x.Id == dto.GoodsId).First();
if (goods != null)
{
goodstypeid = goods.GoodsTypeId;
}
var res = await SqlSugarDb.Db.Queryable<BPA_GoodsAttribute>()
.WhereIF(!string.IsNullOrEmpty(goodstypeid),x=>x.GoodsTypeId== goodstypeid)
.OrderBy(a => a.CreateAt, OrderByType.Desc)
.Select(a => new GoodsAttributeVewDto
{
@@ -330,7 +337,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services
DeviceId = s[t].Key,
WarehousrTemplateId = sf1[t].Key,
GoodsAttributeId = string.Join(',', sdw),
DeviceName = Devicelist?.FirstOrDefault(x => x.Id == s[t].Key).DeviceName + "【" + nane + "】",
TechnologyName = Devicelist?.FirstOrDefault(x => x.Id == s[t].Key).DeviceName + "【" + nane + "】",
Data = s[t].AsQueryable().ToList(),
};
goodsTechnologyActionListViews.Add(item);


+ 2
- 2
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Services/IGoodsService.cs View File

@@ -34,7 +34,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
Task<bool> DeleteGoods(string[] ids);
Task<bool> DeleteGoods(DeleteGoodsDto dto);
/// <summary>
///添加商品属性
/// </summary>
@@ -45,7 +45,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services
/// 查询商品属性
/// </summary>
/// <returns></returns>
Task<List<GoodsAttributeVewDto>> GetGoodsAttributeList();
Task<List<GoodsAttributeVewDto>> GetGoodsAttributeList(GoodsIdDto dto);
/// <summary>
/// 查询商品工艺
/// </summary>


+ 2
- 2
BPA.SAAS.Manage.Application/AExternalPlatform/Service/WarehouseTemplate/Dtos/WarehouseTemplatInsertDto.cs View File

@@ -16,8 +16,8 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WarehouseTemplat
}
public class WarehousePostionInsert
{
public string Id { get; set; }
public string TemplateId { get; set; }
//public string Id { get; set; }
//public string TemplateId { get; set; }
public string Code { get; set; }
public string BatchingId { get; set; }
}


+ 10
- 2
BPA.SAAS.Manage.Application/AExternalPlatform/Service/WarehouseTemplate/Dtos/WarehouseTemplateView.cs View File

@@ -14,8 +14,16 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WarehouseTemplat
public string DeviceName { get; set; }
public string TemplateName { get; set; }
public DateTime CreateAt { get; set; }
public int ProductNumber { get; set; }
public int Count { get; set; }
public string ProductUrl { get; set; }
public List<BPA_WarehousePostion> WarehousePostion { get; set; }
public List<WarehousePostionVewDto> WarehousePostion { get; set; }
}
public class WarehousePostionVewDto
{
public string Id { get; set; }
public string TemplateId { get; set; }
public string Code { get; set; }
public string BatchingId { get; set; }
public string BatchingName { get; set; }
}
}

+ 5
- 4
BPA.SAAS.Manage.Application/AExternalPlatform/Service/WarehouseTemplate/Services/WarehouseTemplateService.cs View File

@@ -3,6 +3,7 @@ using BPA.SAAS.Manage.Application.AExternalPlatform.Enum;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.WarehouseTemplate.Dtos;
using BPA.SAAS.Manage.Application.Device.Interface;
using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core.Device;
using BPA.SAAS.Manage.Core.Product;
using LogicExtensions;
@@ -30,12 +31,12 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WarehouseTemplat
DeviceName = b.DeviceName,
TemplateName = a.TemplateName,
CreateAt = a.CreateAt,
ProductNumber = c.ProductNumber,
Count = c.ProductNumber,
ProductUrl = c.ProductUrl
})
.Mapper(x =>
{
x.WarehousePostion = SqlSugarDb.Db.Queryable<BPA_WarehousePostion>().Where(t => t.TemplateId == x.Id).ToList();
x.WarehousePostion = SqlSugarDb.Db.Queryable<BPA_WarehousePostion,BPA_Batching>((a, b) => new JoinQueryInfos(JoinType.Left,a.BatchingId==b.Id)).Where((a, b) => a.TemplateId == x.Id).Select((a, b) => new WarehousePostionVewDto() { Id=a.Id.SelectAll(),BatchingName=b.Batching_Name}).ToList();
})
.OrderBy(a => a.CreateAt, OrderByType.Desc)
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total);
@@ -59,12 +60,12 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WarehouseTemplat
DeviceName = b.DeviceName,
TemplateName = a.TemplateName,
CreateAt = a.CreateAt,
ProductNumber = c.ProductNumber,
Count = c.ProductNumber,
ProductUrl = c.ProductUrl
})
.Mapper(x =>
{
x.WarehousePostion = SqlSugarDb.Db.Queryable<BPA_WarehousePostion>().Where(t => t.TemplateId == x.Id).ToList();
x.WarehousePostion = SqlSugarDb.Db.Queryable<BPA_WarehousePostion, BPA_Batching>((a, b) => new JoinQueryInfos(JoinType.Left, a.BatchingId == b.Id)).Where((a, b) => a.TemplateId == x.Id).Select((a, b) => new WarehousePostionVewDto() { Id = a.Id.SelectAll(), BatchingName = b.Batching_Name }).ToList();
})
.OrderBy(a => a.CreateAt, OrderByType.Desc)
.ToListAsync();


Loading…
Cancel
Save