@@ -0,0 +1,85 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Application.DataBase.Dtos | |||||
{ | |||||
public class GoodsTypeResultDto | |||||
{ | |||||
public string GoodsTypeId { get; set; } | |||||
public string GoodsTypeName { get; set; } | |||||
public List<GoodsAttributeResultDto> GoodsAttributeList { get; set; } | |||||
public List<GoodsInfoResultDto> GoodsInfoList{ get; set; } | |||||
} | |||||
public class GoodsAttributeResultDto | |||||
{ | |||||
public string GoodsAttributeId { get; set; } | |||||
public string GoodsAttributeName { get; set; } | |||||
public List<GoodsAttributeValueResultDto> GoodsAttributeValueList { get; set; } | |||||
} | |||||
public class GoodsAttributeValueResultDto | |||||
{ | |||||
public string GoodsAttributeId { get; set; } | |||||
public string GoodsAttributeValueId { get; set; } | |||||
public string AttributeValue { get; set; } | |||||
} | |||||
public class GoodsResultDto | |||||
{ | |||||
public string TypeId { get; set; } | |||||
public string TypeName { get; set; } | |||||
} | |||||
public class GoodsInfoResultDto | |||||
{ | |||||
public string GoodsId { get; set; } | |||||
public string GoodsName { get; set; } | |||||
public List<GoodsTechnologyActionResultDto> GoodsTechnologyActionList { get; set; } | |||||
} | |||||
public class GoodsTechnologyActionResultDto | |||||
{ | |||||
/// <summary> | |||||
/// 步骤名称 | |||||
/// </summary> | |||||
public string StepName { get; set; } | |||||
/// <summary> | |||||
/// 动作json | |||||
/// </summary> | |||||
public string ActionJson { get; set; } | |||||
/// <summary> | |||||
/// 商品属性id集合 | |||||
/// </summary> | |||||
public string GoodsAttributeId { get; set; } | |||||
/// <summary> | |||||
/// 是否物料 | |||||
/// </summary> | |||||
public bool IsBatch { get; set; } | |||||
/// <summary> | |||||
/// 动作value | |||||
/// </summary> | |||||
public string ChnologyId { get; set; } | |||||
public string GroupId { get; set; } | |||||
public int Sort { get; set; } | |||||
public string GoodsId { get; set; } | |||||
public string DeviceId { get; set; } | |||||
/// <summary> | |||||
/// 仓位模板 | |||||
/// </summary> | |||||
public string WarehousrTemplateId { get; set; } | |||||
} | |||||
} |
@@ -1,4 +1,5 @@ | |||||
using BPA.Franchisee.Application.FranchiseeCenter.GoodsServices; | using BPA.Franchisee.Application.FranchiseeCenter.GoodsServices; | ||||
using BPA.SAAS.Manage.Application.DataBase.Dtos; | |||||
using BPA.SAAS.Manage.Application.DataBase.Dtos.Goods; | using BPA.SAAS.Manage.Application.DataBase.Dtos.Goods; | ||||
using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttribute; | using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttribute; | ||||
using BPA.SAAS.Manage.Application.DataBase.Interface; | using BPA.SAAS.Manage.Application.DataBase.Interface; | ||||
@@ -30,6 +31,18 @@ namespace BPA.SAAS.Manage.Application.DataBase | |||||
{ | { | ||||
return await _goodsService.GetGoodsPage(dto); | return await _goodsService.GetGoodsPage(dto); | ||||
} | } | ||||
/// <summary> | |||||
/// 获取商品信息(更具商品id) | |||||
/// </summary> | |||||
/// <param name="GoodsIds"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/goods/GetGoodsListByIds")] | |||||
public async Task<object> GetGoodsListByIds(List<string> goodsIds) | |||||
{ | |||||
return await _goodsService.GetGoodsListByIds(goodsIds); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 添加商品 | /// 添加商品 | ||||
/// </summary> | /// </summary> | ||||
@@ -1,4 +1,5 @@ | |||||
using BPA.SAAS.Manage.Application.DataBase.Dtos.Goods; | |||||
using BPA.SAAS.Manage.Application.DataBase.Dtos; | |||||
using BPA.SAAS.Manage.Application.DataBase.Dtos.Goods; | |||||
using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttribute; | using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttribute; | ||||
using BPA.SAAS.Manage.Core.Base; | using BPA.SAAS.Manage.Core.Base; | ||||
using BPA.SAAS.Manage.Core.DataBase; | using BPA.SAAS.Manage.Core.DataBase; | ||||
@@ -18,6 +19,15 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface | |||||
/// <param name="dto"></param> | /// <param name="dto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<PageUtil> GetGoodsPage(GoodsQueryDto dto); | Task<PageUtil> GetGoodsPage(GoodsQueryDto dto); | ||||
/// <summary> | |||||
/// 获取商品信息(更具商品id) | |||||
/// </summary> | |||||
/// <param name="GoodsIds"></param> | |||||
/// <returns></returns> | |||||
Task<object> GetGoodsListByIds(List<string> GoodsIds); | |||||
/// <summary> | /// <summary> | ||||
/// 添加商品 | /// 添加商品 | ||||
/// </summary> | /// </summary> | ||||
@@ -1,4 +1,5 @@ | |||||
using BPA.Franchisee.Application.FranchiseeCenter.GoodsServices; | using BPA.Franchisee.Application.FranchiseeCenter.GoodsServices; | ||||
using BPA.SAAS.Manage.Application.DataBase.Dtos; | |||||
using BPA.SAAS.Manage.Application.DataBase.Dtos.Batching; | using BPA.SAAS.Manage.Application.DataBase.Dtos.Batching; | ||||
using BPA.SAAS.Manage.Application.DataBase.Dtos.Bom; | using BPA.SAAS.Manage.Application.DataBase.Dtos.Bom; | ||||
using BPA.SAAS.Manage.Application.DataBase.Dtos.Goods; | using BPA.SAAS.Manage.Application.DataBase.Dtos.Goods; | ||||
@@ -115,7 +116,127 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
}; | }; | ||||
return util; | return util; | ||||
} | } | ||||
/// <summary> | |||||
/// 获取商品信息(更具商品id) | |||||
/// </summary> | |||||
/// <param name="GoodsIds"></param> | |||||
/// <returns></returns> | |||||
public async Task<object> GetGoodsListByIds(List<string> GoodsIds) | |||||
{ | |||||
var result = new List<GoodsTypeResultDto>(); | |||||
//商品信息 | |||||
var goodsList=await _db.Queryable<BPA_GoodsInfo>().Where(x=> GoodsIds.Contains(x.Id)).ToListAsync(); | |||||
var typeIds= goodsList.Select(x => x.GoodsTypeId).ToList(); | |||||
//商品分类 | |||||
var typeList =await _db.Queryable<BPA_GoodsType>().Where(x => typeIds.Contains(x.Id)).ToListAsync(); | |||||
//商品分类属性 | |||||
var goodsAttribute = await _db.Queryable<BPA_GoodsAttribute>() | |||||
.Where(x=> typeIds.Contains(x.GoodsTypeId)).ToListAsync(); | |||||
var goodsAttributeIds= await _db.Queryable<BPA_GoodsAttribute>().Select(x=>x.Id).ToListAsync(); | |||||
var goodsAttributeValue = await _db.Queryable<BPA_GoodsAttributeValue>() | |||||
.Where(x => goodsAttributeIds.Contains(x.GoodsAttributeId)) | |||||
.Select(x => new GoodsAttributeValueResultDto() | |||||
{ | |||||
GoodsAttributeValueId = x.Id, | |||||
AttributeValue =x.AttributeValue, | |||||
GoodsAttributeId =x.GoodsAttributeId | |||||
}) | |||||
.ToListAsync(); | |||||
var goodsInfos = await _db.Queryable<BPA_GoodsInfo>().Where(x => typeIds.Contains(x.GoodsTypeId)).ToListAsync(); | |||||
var goodsTechnologyAction = await _db.Queryable<BPA_GoodsTechnologyAction>().ToListAsync(); | |||||
foreach (var type in typeList) | |||||
{ | |||||
var value1 = goodsAttribute.Where(x => x.GoodsTypeId == type.Id) | |||||
.Select(x=>new BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttributeResultDto() | |||||
{ | |||||
GoodsAttributeId=x.Id, | |||||
GoodsAttributeName=x.AttributeName | |||||
}).ToList(); | |||||
foreach (var item in value1) | |||||
{ | |||||
var value2= goodsAttributeValue.Where(x=>x.GoodsAttributeId==item.GoodsAttributeId) | |||||
.Select(x=>new GoodsAttributeValueResultDto() | |||||
{ | |||||
AttributeValue=x.AttributeValue, | |||||
GoodsAttributeId=x.GoodsAttributeId, | |||||
GoodsAttributeValueId=x.GoodsAttributeValueId, | |||||
}) | |||||
.ToList(); | |||||
item.GoodsAttributeValueList= value2; | |||||
} | |||||
var value3 = goodsInfos.Where(x => x.GoodsTypeId == type.Id) | |||||
.Select(x => new GoodsInfoResultDto() | |||||
{ | |||||
GoodsId=x.Id, | |||||
GoodsName=x.Name, | |||||
}) | |||||
.ToList(); | |||||
foreach (var item in value3) | |||||
{ | |||||
var value4= goodsTechnologyAction | |||||
.Where(x=>x.GoodsId==item.GoodsId) | |||||
.Select(x=>new GoodsTechnologyActionResultDto() | |||||
{ | |||||
GroupId=x.GroupId, | |||||
ActionJson=x.ActionJson, | |||||
ChnologyId=x.ChnologyId, | |||||
DeviceId=x.DeviceId, | |||||
GoodsAttributeId=x.GoodsAttributeId, | |||||
GoodsId=x.GoodsId, | |||||
IsBatch=x.IsBatch, | |||||
Sort=x.Sort, | |||||
StepName=x.StepName, | |||||
WarehousrTemplateId=x.WarehousrTemplateId, | |||||
}).ToList(); | |||||
item.GoodsTechnologyActionList= value4; | |||||
} | |||||
result.Add(new GoodsTypeResultDto() | |||||
{ | |||||
GoodsTypeId = type.Id, | |||||
GoodsTypeName = type.Name, | |||||
GoodsAttributeList = value1, | |||||
GoodsInfoList= value3 | |||||
}); | |||||
} | |||||
return result; | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 查询所有商品 | /// 查询所有商品 | ||||
/// </summary> | /// </summary> | ||||
@@ -75,7 +75,7 @@ pipeline{ | |||||
if(params.operation=='develop') | if(params.operation=='develop') | ||||
{ | { | ||||
sh "docker build -t 10.2.1.24:10242/bpa/saasbase:${build_tag} ." | |||||
sh "docker build -t 10.2.1.24:10242/bpa/kitchenmanage:${build_tag} ." | |||||
} | } | ||||
} | } | ||||
@@ -91,7 +91,7 @@ pipeline{ | |||||
sh "docker login -u ${harborUser} -p ${harborPassword} 10.2.1.24:10242" | sh "docker login -u ${harborUser} -p ${harborPassword} 10.2.1.24:10242" | ||||
if(params.operation=='develop') | if(params.operation=='develop') | ||||
{ | { | ||||
sh "docker push 10.2.1.24:10242/bpa/saasbase:${build_tag}" | |||||
sh "docker push 10.2.1.24:10242/bpa/kitchenmanage:${build_tag}" | |||||
} | } | ||||
} | } | ||||
@@ -112,13 +112,10 @@ pipeline{ | |||||
// input "确认要部署线上环境吗?" | // input "确认要部署线上环境吗?" | ||||
// } | // } | ||||
sh "sed -i 's/<BUILD_TAG>/${build_tag}/' k8s_saasbase.yaml" | |||||
sh "sed -i 's/<BRANCH_NAME>/${env.BRANCH_NAME}/' k8s_saasbase.yaml" | |||||
sh "sed -i 's/<NAMESPACES>/${params.environment}/' k8s_saasbase.yaml" | |||||
sh "kubectl apply -f k8s_saasbase.yaml --record" | |||||
//sh "sed -i 's/<BUILD_TAG>/${build_tag}/' k8s_kitchenmanage.yaml" | |||||
// sh "sed -i 's/<BRANCH_NAME>/${env.BRANCH_NAME}/' k8s_kitchenmanage.yaml" | |||||
// sh "sed -i 's/<NAMESPACES>/${params.environment}/' k8s_kitchenmanage.yaml" | |||||
// sh "kubectl apply -f k8s_kitchenmanage.yaml --record" | |||||
} | } | ||||
} | } | ||||
} | } | ||||