Browse Source

Merge branch 'kitchenmanage' of http://10.2.1.24:10244/zhaoy/BPA.NewKitChen.Manage into kitchenmanage

ingredientmanage
zhaoy 7 months ago
parent
commit
5bbdc8d7e6
7 changed files with 237 additions and 11 deletions
  1. BIN
     
  2. BIN
     
  3. +85
    -0
      BPA.SAAS.Manage.Application/DataBase/Dtos/GoodsResultDto.cs
  4. +13
    -0
      BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs
  5. +11
    -1
      BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs
  6. +122
    -1
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs
  7. +6
    -9
      Jenkinsfile

BIN
View File


BIN
View File


+ 85
- 0
BPA.SAAS.Manage.Application/DataBase/Dtos/GoodsResultDto.cs View File

@@ -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; }
}
}

+ 13
- 0
BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs View File

@@ -1,4 +1,5 @@
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.GoodsAttribute;
using BPA.SAAS.Manage.Application.DataBase.Interface;
@@ -30,6 +31,18 @@ namespace BPA.SAAS.Manage.Application.DataBase
{
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>


+ 11
- 1
BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs View File

@@ -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.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
@@ -18,6 +19,15 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface
/// <param name="dto"></param>
/// <returns></returns>
Task<PageUtil> GetGoodsPage(GoodsQueryDto dto);


/// <summary>
/// 获取商品信息(更具商品id)
/// </summary>
/// <param name="GoodsIds"></param>
/// <returns></returns>
Task<object> GetGoodsListByIds(List<string> GoodsIds);

/// <summary>
/// 添加商品
/// </summary>


+ 122
- 1
BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs View File

@@ -1,4 +1,5 @@
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.Bom;
using BPA.SAAS.Manage.Application.DataBase.Dtos.Goods;
@@ -115,7 +116,127 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
};
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>


+ 6
- 9
Jenkinsfile View File

@@ -75,7 +75,7 @@ pipeline{
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"
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 "确认要部署线上环境吗?"
// }
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"
}
}
}


Loading…
Cancel
Save