From cfbaa8894bbdb0039de8f22d28bc248bf1b39387 Mon Sep 17 00:00:00 2001 From: gwbvipvip Date: Mon, 22 Apr 2024 10:10:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpa.saas.manage.metadata.v7.bin | Bin 375341 -> 385037 bytes .../bpa.saas.manage.projects.v7.bin | Bin 3292592 -> 4637569 bytes .../DataBase/Dtos/GoodsResultDto.cs | 85 ++++++++++++ .../DataBase/GoodsServices.cs | 13 ++ .../DataBase/Interface/IGoodsService.cs | 12 +- .../DataBase/Services/GoodsService.cs | 123 +++++++++++++++++- 6 files changed, 231 insertions(+), 2 deletions(-) create mode 100644 BPA.SAAS.Manage.Application/DataBase/Dtos/GoodsResultDto.cs diff --git a/.vs/ProjectEvaluation/bpa.saas.manage.metadata.v7.bin b/.vs/ProjectEvaluation/bpa.saas.manage.metadata.v7.bin index 01451d97be52d45aeccda6f5c742bcdd1bb6dc71..c72374b33b0783917bce6b755bcad090a0a6944a 100644 GIT binary patch delta 5037 zcma)A3se->8D@9p@)8ghc0mO3jW1yKF|)I%&CWikm?nb8q%oUVkP-GA+{K+mYkN-B zo?vq#YFZz^Cb6QaC!U^TA~h*VZL8QeNz;dzzMpE-M_M(}sMXX|`_G--onZk}&ymA_ zzwiJ5@80|0|K8!~b=$U6rCAw1TL%7vzWbSlaPBelBzS%kDcY>`D5f68+@ml(3j3-; zPL(b{YR$;V2{!mwIz+c!cnPg+Dd_g`Jm+~?HH3zs=x*TM$5ew03cQ2!d-{`3P8a7E zzD0RXzu(Te*NMCDFV?>c-aZSZ3BsA;Jb5cvwn3D34 zyrxUt9(}HZ=+vY;!HLW4baEO87a0cMyTlg4?aOSQ?FWdAUlxzXXb3r`Zt4%M(EnxD z4Vy|ydA?yme`JLVJJ`A4C8WBM`{U<1(lM2X5QDA5nDIq^a zq$?dMIzq}!KZB-^*`;clD)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dG-jJeI4dpD0qs^guAWg zJXo_IKhLk+Ve<#xe36u!Eko~$bQTQ$)GCI~0%E&yEl+J{`8_w7tbr}xB>iSn4P59W zvtaVeBollu;jRqTnh8t>HXrhO$+Thh(|nXPYDGlrM_+5ba4sJu4?^U%Pgv`j$4HxH aQDKm(%*3C!qOIWyy4G_B-Z)0ubN&YcLz2k= delta 645 zcmYk3Pe@cz7{z_>-ZN_XCm)Ryj(@66>NJi{4HOxeDMU#H)j|W4D6_&49wOMHW-@;Zblu$3;F43 z!}c__*mpqeX7adR%<+EY`OSc-1x!6)ihwDfnut2II%-L=Gw7LLYu&DfugzF@v3&V! zTCUm?zgiyrsJ4>*C>4AcK>;TQv57--ILg5Y9Gr2=?VRt_vKV(t50e*!jk^Yr&C>~0 z+#XgZuPMt|*`?W-8&cPj36uppj>+Jc#X@$xMv+#-$@mqrcqs?MHogox)I)N6gmi|N1%{z@UlPwW!<<}8K*d0ai{ zci-Tu#`|{oxYQ|gIKK^Gc1UbscTBzYwdre^b4}W~bW+c<_P<4!Zj8G;DYGo4MsM@V zI4XGSx#}p|BYnN!MY`1*$LPv%swnsI`f_*+A8?RW;lFeFmsVj2g{*z7`i@uV;6}=9 lz8pd2ax$0xL}8o7DWmH~Wy(8K>4~#-E8gYS!&#ik{0-aj>Qev! diff --git a/.vs/ProjectEvaluation/bpa.saas.manage.projects.v7.bin b/.vs/ProjectEvaluation/bpa.saas.manage.projects.v7.bin index 3b6c4634dd63d1ceb7c689fdd258cae56a459970..423746b958386c5ff4591611036d7865935e0ca2 100644 GIT binary patch delta 5238 zcmeHLYfKzf7~Oke*)4^Z*ABbGYeCpqm}P)1G!@wH(#HBq4HWQEYeF02BPsz+gV7j8 zzXsEoHki~Kp+(R?ByEwjwKqjuXlny%?FJu-#v&y#RvN?VLMjw)^q`YHVu7F8~4zVGs^xhyV*%VHrfia)^RxSOF^`24W!&;voTSAV4D6 z!2u#9K{BL3Dx`rE(jfzGf=tK)7f9fSY{&r_Jdg_tJXfVZ(aIrwTpUb&Kp7_W;VJQ*N)JTayx1M#2;k2eOFB;QbWAab25eIHb zeCg*hT2PZ#h@*V**km&C5~*lF31nziP7HC#)-Mw>NY{GdC|P-1WIPFql9RSgrnLAh zV>UK^%trl6>f>Itj~=K=9j!!8GWeCFid;GEsYc^G_P5w9^x$KzOObR#&?9B)qu&Td zILWzIdxTzSK4VKKeJ!r}!ih7sYZxNgxYr)7UsAKz?$YCmR+ps51-s)?$z-kPVbU&J z<7oLldvB56Yy2^319g7l`obKl(7;29rBSr_8`pyZvTLg)Y_+TC%(Tmo|9+{rnkBYW zfAwqcla1<9i*YC+_1n^9J#Gx*tf&TU*_?XSZg(}t##6T2+&UZxqq94u@p3v^s8k_z znD5ZHTB$}yc>JmwPiZl|xLT>i=pCLE->l3c^gU;-DN*K7j~1hMN%OEYOGZkSYU~t9 z^P~1koF2jq4XcnqMr!RUXx%JEd+^n96emj(U8Yrk^%jkoH)b+kvKX`aMPIoSBiJX!IBnp_EW);Wul z&}l6>`joOcSKo9^yW-O0$wSLTGP%a*WN=bjb!JM@ie!pjfKW5NrGg$pmHQ`|1l;~AN)7?&=bV3NhBo?t#UDm{4* z$v^APv8+`qYZskqO~-cR&|^DfX)|t!Cnx2+Z6V!W|0rrG*-)~f_MtBN`n2nm zkj}RYB#@G9zE-I7id$Ni0accPe^HiYhLL7QdKTfbkX^6+&he(zu+{%BTm6?J4e4(| pq^f)F&B*){_dH=S#9E2}gRfpgto*xh;p^HEtM*skAH@20*YDk1`X2xQ delta 111 zcmV~$#SOv$006+WxVu|%*FU>KatTAQL>~;nPJFm~zTRQ{`vwnzP(o5lT1Hk*UO`bw rSw&S%T|-k#TSr$<-@wqw*hFM%W^Q3=Wo=_?XYb(X GoodsAttributeList { get; set; } + + public List GoodsInfoList{ get; set; } + } + + + public class GoodsAttributeResultDto + { + public string GoodsAttributeId { get; set; } + + public string GoodsAttributeName { get; set; } + + public List 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 GoodsTechnologyActionList { get; set; } + } + + public class GoodsTechnologyActionResultDto + { + /// + /// 步骤名称 + /// + public string StepName { get; set; } + /// + /// 动作json + /// + public string ActionJson { get; set; } + /// + /// 商品属性id集合 + /// + public string GoodsAttributeId { get; set; } + /// + /// 是否物料 + /// + public bool IsBatch { get; set; } + /// + /// 动作value + /// + 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; } + /// + /// 仓位模板 + /// + public string WarehousrTemplateId { get; set; } + } +} diff --git a/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs b/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs index 9d7604c..fe18661 100644 --- a/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs +++ b/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs @@ -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); } + + /// + /// 获取商品信息(更具商品id) + /// + /// + /// + [HttpPost("/api/goods/GetGoodsListByIds")] + public async Task GetGoodsListByIds(List goodsIds) + { + return await _goodsService.GetGoodsListByIds(goodsIds); + } + /// /// 添加商品 /// diff --git a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs index dca4283..920fa99 100644 --- a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs +++ b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs @@ -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 /// /// Task GetGoodsPage(GoodsQueryDto dto); + + + /// + /// 获取商品信息(更具商品id) + /// + /// + /// + Task GetGoodsListByIds(List GoodsIds); + /// /// 添加商品 /// diff --git a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs index be3feb6..25ba376 100644 --- a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs +++ b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs @@ -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; } - + + + /// + /// 获取商品信息(更具商品id) + /// + /// + /// + public async Task GetGoodsListByIds(List GoodsIds) + { + + + + var result = new List(); + + //商品信息 + var goodsList=await _db.Queryable().Where(x=> GoodsIds.Contains(x.Id)).ToListAsync(); + + var typeIds= goodsList.Select(x => x.GoodsTypeId).ToList(); + + //商品分类 + var typeList =await _db.Queryable().Where(x => typeIds.Contains(x.Id)).ToListAsync(); + + //商品分类属性 + var goodsAttribute = await _db.Queryable() + .Where(x=> typeIds.Contains(x.GoodsTypeId)).ToListAsync(); + + var goodsAttributeIds= await _db.Queryable().Select(x=>x.Id).ToListAsync(); + + + var goodsAttributeValue = await _db.Queryable() + .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().Where(x => typeIds.Contains(x.GoodsTypeId)).ToListAsync(); + + + var goodsTechnologyAction = await _db.Queryable().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; + } + + + /// /// 查询所有商品 ///