From c25310aa177f9cb73990c577273939799414ac85 Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Thu, 29 Jun 2023 08:56:31 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E4=B8=9A=E5=8A=A1=E6=9B=B4=E6=96=B0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr/WmsInStockService.cs | 6 +++- .../Tnb.WarehouseMgr/WmsOutStockService.cs | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs index ff57cc39..126a72ec 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs @@ -151,7 +151,7 @@ namespace Tnb.WarehouseMgr barCode.codeqty = detail.pr_qty!.Value; barCode.unit_id = detail.unit_id; barCode.is_lock = 0; - barCode.is_end = "0"; + barCode.is_end = 0; barCode.require_id = detail.bill_id; barCode.require_code = _dicBillCodes.ContainsKey(detail.bill_id) ? _dicBillCodes[detail.bill_id]?.ToString() : ""; barCode.create_id = _userManager.UserId; @@ -199,6 +199,10 @@ namespace Tnb.WarehouseMgr await _db.Updateable().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync(); //如果是自动单据,需要回更上层系统 } + else { + //任务没有结束,更新状态为工作中 + await _db.Updateable().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync(); + } } await _db.Ado.CommitTranAsync(); diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index 1641dc39..bb11970a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Aop.Api.Domain; using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Extension; @@ -337,6 +338,10 @@ namespace Tnb.WarehouseMgr await _db.Updateable().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync(); //如果是自动单据,需要回更上层系统 } + else { + //如果没有完成,修改为工作中 + await _db.Updateable().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync(); + } await _wareCarryService.UpdateNullCarry(carry); } else if (outStatus == EnumOutStatus.分拣出) @@ -359,6 +364,32 @@ namespace Tnb.WarehouseMgr x.create_time = DateTime.Now; }); await _db.Insertable(osCodes).ExecuteCommandAsync(); + // 更新主表 + var detailIds = osCodes.Select(x => x.bill_d_id).ToList(); + var curOutstockDetails = otds.FindAll(x => detailIds.Contains(x.id)); + var dic = osCodes.GroupBy(g => g.bill_d_id).ToDictionary(x => x.Key, x => x.Select(x => x.codeqty).ToList()); + foreach (var osd in curOutstockDetails) + { + if (dic.ContainsKey(osd.id)) + { + osd.qty += dic[osd.id].Sum(d => d); + if (osd.qty >= osd.pr_qty) + { + osd.line_status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID; + } + } + } + await _db.Updateable(curOutstockDetails).ExecuteCommandAsync(); + if (otds.All(x => x.line_status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID)) + { + await _db.Updateable().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync(); + //如果是自动单据,需要回更上层系统 + } + else + { + //如果没有完成,修改为工作中 + await _db.Updateable().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync(); + } var carryCodes = await _db.Queryable().Where(it => input.carryIds.Contains(it.carry_id)).ToListAsync(); var dicCodeQty = carryCodes.GroupBy(g => g.barcode).ToDictionary(x => x.Key, x => x.First().codeqty); From fd7b2deaaded8b6c56b082e9d64fed008e685c25 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 09:22:07 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E6=9B=B4=E8=BD=BD=E5=85=B7=E6=9D=A1=E7=A0=81?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index bb11970a..bde47097 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -338,7 +338,8 @@ namespace Tnb.WarehouseMgr await _db.Updateable().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync(); //如果是自动单据,需要回更上层系统 } - else { + else + { //如果没有完成,修改为工作中 await _db.Updateable().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync(); } @@ -411,11 +412,15 @@ namespace Tnb.WarehouseMgr } if (dicUpdate.Count > 0) { + //var dicCarryCodes = carryCodes.FindAll(x => dicUpdate.Keys.Contains(x.barcode)).GroupBy(g => g.barcode).ToDictionary(x => x.Key, x => x.FirstOrDefault()); foreach (var pair in dicUpdate) { - WmsCarryCode carryCode = new(); - carryCode.codeqty = pair.Value; - await _db.Updateable(carryCode).UpdateColumns(it => it.codeqty).Where(it => it.barcode == pair.Key).ExecuteCommandAsync(); + WmsCarryCode carryCode = carryCodes.Find(x => x.barcode == pair.Key); + if (carryCode != null) + { + carryCode.codeqty = pair.Value; + await _db.Updateable(carryCode).UpdateColumns(it => it.codeqty).ExecuteCommandAsync(); + } } await _db.Updateable().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.正常).ToString() }).Where(it => input.carryIds.Contains(it.id)).ExecuteCommandAsync(); await _db.Deleteable().Where(it => input.carryIds.Contains(it.carry_id)).ExecuteCommandAsync(); From 835e16a47f1ad395bf9d173bb5c29370f9ae3daf Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 09:22:19 +0800 Subject: [PATCH 03/18] 1 --- WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index bde47097..cb297a26 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -412,10 +412,9 @@ namespace Tnb.WarehouseMgr } if (dicUpdate.Count > 0) { - //var dicCarryCodes = carryCodes.FindAll(x => dicUpdate.Keys.Contains(x.barcode)).GroupBy(g => g.barcode).ToDictionary(x => x.Key, x => x.FirstOrDefault()); foreach (var pair in dicUpdate) { - WmsCarryCode carryCode = carryCodes.Find(x => x.barcode == pair.Key); + WmsCarryCode? carryCode = carryCodes.Find(x => x.barcode == pair.Key); if (carryCode != null) { carryCode.codeqty = pair.Value; From d47c4f80ed6afd92649d47da0c76ba85723979a7 Mon Sep 17 00:00:00 2001 From: FanLian Date: Thu, 29 Jun 2023 10:24:07 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E5=88=A0=E9=99=A4WmsCarryCode=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E8=A1=8C=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs index f9e9fd96..07d58f64 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs @@ -49,11 +49,6 @@ public partial class WmsCarryCode : BaseEntity, IWmsCarryEntity /// public decimal codeqty { get; set; } - /// - /// 行号 - /// - public int no { get; set; } - /// /// 是否出库 /// From 195dfa73aad4fe3a98792f58aa708e237ef9f5d2 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 13:56:08 +0800 Subject: [PATCH 05/18] 1 --- WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs index d71a69a9..0a8b4a4c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs @@ -36,7 +36,7 @@ namespace Tnb.WarehouseMgr } } } - + [NonAction] protected async Task DoUpdate(WareHouseUpInput input) { if (_stroageMap.ContainsKey(input.loginType)) @@ -44,7 +44,7 @@ namespace Tnb.WarehouseMgr await _stroageMap[input.loginType].Do(input); } } - + [NonAction] public virtual Task ModifyAsync(WareHouseUpInput input) { return Task.CompletedTask; From aaee68302597e7bf22d200062f7c787b836af292 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Thu, 29 Jun 2023 14:04:04 +0800 Subject: [PATCH 06/18] bug --- system/Tnb.Systems/System/PrintDevService.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/system/Tnb.Systems/System/PrintDevService.cs b/system/Tnb.Systems/System/PrintDevService.cs index 9af13070..98c3d510 100644 --- a/system/Tnb.Systems/System/PrintDevService.cs +++ b/system/Tnb.Systems/System/PrintDevService.cs @@ -90,9 +90,10 @@ public class PrintDevService : IDynamicApiController, ITransient [HttpGet("")] public async Task GetList_Api([FromQuery] PrintDevListInput input) { - var list = await _repository.AsSugarClient().Queryable((a, b, c, d) => - new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId, JoinType.Left, a.Category == d.EnCode)) - .Where((a, b, c, d) => a.DeleteMark == null && d.DictionaryTypeId == "202931027482510597").WhereIF(input.category.IsNotEmptyOrNull(), a => a.Category == input.category) + var list = await _repository.AsSugarClient().Queryable((a, b, c, d,e) => + new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId,JoinType.Left,d.EnCode=="printDev", JoinType.Left, a.Category == e.EnCode && d.Id==e.DictionaryTypeId)) + .Where((a, b, c, d,e) => a.DeleteMark == null ) + .WhereIF(input.category.IsNotEmptyOrNull(), a => a.Category == input.category) .WhereIF(input.keyword.IsNotEmptyOrNull(), a => a.FullName.Contains(input.keyword) || a.EnCode.Contains(input.keyword)) .OrderBy(a => a.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc) .Select((a, b, c, d) => new PrintDevListOutput @@ -119,10 +120,10 @@ public class PrintDevService : IDynamicApiController, ITransient [HttpGet("Selector")] public async Task GetList_Api([FromQuery] string type) { - var list = await _repository.AsSugarClient().Queryable((a, b, c, d) => new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId, JoinType.Left, a.Category == d.EnCode)) - .Where((a, b, c, d) => a.DeleteMark == null && d.DictionaryTypeId == "202931027482510597" && a.EnabledMark == 1).OrderBy(a => a.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc) + var list = await _repository.AsSugarClient().Queryable((a, b, c, d,e) => new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId, JoinType.Left, d.EnCode=="printDev", JoinType.Left, a.Category == e.EnCode && d.Id==e.DictionaryTypeId)) + .Where((a, b, c, d) => a.DeleteMark == null && a.EnabledMark == 1).OrderBy(a => a.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc) .WhereIF(type.IsNotEmptyOrNull(), (a) => a.Type == type.ParseToInt()) - .Select((a, b, c, d) => new PrintDevListOutput + .Select((a, b, c, d,e) => new PrintDevListOutput { category = a.Category, id = a.Id, @@ -135,7 +136,7 @@ public class PrintDevService : IDynamicApiController, ITransient lastModifyUser = SqlFunc.MergeString(c.RealName, "/", c.Account), sortCode = a.SortCode, type = a.Type, - parentId = d.Id, + parentId = e.Id, }).ToListAsync(); // 数据库分类 From 31c464a195c1fa688ccf50921658fb0a9ab26432 Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Thu, 29 Jun 2023 14:10:29 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E6=89=AB=E6=8F=8F=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E6=9B=B4=E6=96=B0=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E4=B8=BB=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs index 0dd6eebc..4936c01d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs @@ -247,6 +247,7 @@ namespace Tnb.WarehouseMgr if (instockCOdes?.Count > 0) { await _db.Updateable().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCOdes.Select(x => x.bill_d_id).Contains(it.id)).ExecuteCommandAsync(); + await _db.Updateable().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.data[nameof(WmsHandleH.require_id)].ToString()).ExecuteCommandAsync(); } } } From 124d491baf64abff79c279b505d3af2056276d1d Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Thu, 29 Jun 2023 14:47:53 +0800 Subject: [PATCH 08/18] bug --- BasicData/Tnb.BasicData/BasDefectService.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/BasicData/Tnb.BasicData/BasDefectService.cs b/BasicData/Tnb.BasicData/BasDefectService.cs index 2ee6d6ba..b9fcd432 100644 --- a/BasicData/Tnb.BasicData/BasDefectService.cs +++ b/BasicData/Tnb.BasicData/BasDefectService.cs @@ -36,8 +36,16 @@ namespace Tnb.BasicData return await _repository.AsSugarClient().Queryable() .LeftJoin((a, b) => a.process_id == b.id) .LeftJoin((a, b, c) => a.defective_id == c.id) - .Where((a, b, c) => a.process_id == processId) - .Select((a, b, c) => c).ToListAsync(); + .LeftJoin((a,b,c,d)=>c.defect_type_id==d.id) + .Where((a, b, c) => a.process_id == processId && c.enabled==1) + .Select((a, b, c,d) => new + { + id = c.id, + defect_code = c.defect_code, + defect_name = c.defect_name, + defect_type_id = d.defect_type_name, + defect_type_id_id = d.id + }).ToListAsync(); } } } \ No newline at end of file From 209cfe58c76efb9bf64277ba0777fbecf95d5fc3 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 15:11:42 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr/WmsOutStockService.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index cb297a26..e33e2811 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -224,7 +224,21 @@ namespace Tnb.WarehouseMgr } } } - var isOk = await _wareHouseService.GenPreTask(preTasks, null); + List pretaskCodes = new(); + foreach (var pt in preTasks) + { + var partCodes = carryCodes.FindAll(x => x.carry_id == pt.carry_id).Distinct().ToList(); + var curPreTaskCodes = partCodes.Adapt>(); + curPreTaskCodes.ForEach(x => + { + x.id=SnowflakeIdHelper.NextId(); + x.bill_id = pt.id; + x.create_time = DateTime.Now; + }); + pretaskCodes.AddRange(curPreTaskCodes); + } + + var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes); GenPreTaskUpInput genPreTaskAfterUpInput = new(); genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList(); genPreTaskAfterUpInput.LocationIds = new HashSet(locIds).ToList(); From 4f30009a240e98d6451b405fd3cfe22fd25d0d8d Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Thu, 29 Jun 2023 15:16:33 +0800 Subject: [PATCH 10/18] bug --- .../Dto/BasDefect/DefectOutput.cs | 9 +++++++ BasicData/Tnb.BasicData/BasDefectService.cs | 26 +++++++++++-------- 2 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 BasicData/Tnb.BasicData.Entities/Dto/BasDefect/DefectOutput.cs diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasDefect/DefectOutput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasDefect/DefectOutput.cs new file mode 100644 index 00000000..dcf2811c --- /dev/null +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasDefect/DefectOutput.cs @@ -0,0 +1,9 @@ +namespace Tnb.BasicData.Entities.Dto +{ + public class DefectOutput + { + public string id { get; set; } + public string defect_code { get; set; } + public string defect_name { get; set; } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData/BasDefectService.cs b/BasicData/Tnb.BasicData/BasDefectService.cs index b9fcd432..01cd4c26 100644 --- a/BasicData/Tnb.BasicData/BasDefectService.cs +++ b/BasicData/Tnb.BasicData/BasDefectService.cs @@ -5,6 +5,7 @@ using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using Microsoft.AspNetCore.Mvc; using SqlSugar; +using Tnb.BasicData.Entities.Dto; using Tnb.BasicData.Entities; using Tnb.BasicData.Interfaces; @@ -33,18 +34,21 @@ namespace Tnb.BasicData public async Task GetDefectListByProcessId(Dictionary dic) { string processId = dic["processId"]; - return await _repository.AsSugarClient().Queryable() - .LeftJoin((a, b) => a.process_id == b.id) - .LeftJoin((a, b, c) => a.defective_id == c.id) - .LeftJoin((a,b,c,d)=>c.defect_type_id==d.id) - .Where((a, b, c) => a.process_id == processId && c.enabled==1) - .Select((a, b, c,d) => new + var db = _repository.AsSugarClient(); + List defectIds = await db.Queryable().Where(x=>x.process_id==processId).Select(x=>x.defective_id).ToListAsync(); + List defectTypeIds = await db.Queryable().Where(x=>defectIds.Contains(x.id) && x.enabled==1).Select(x=>x.defect_type_id).ToListAsync(); + return await _repository.AsSugarClient().Queryable() + .Where((a) => defectTypeIds.Contains(a.id)) + .Select(a => new { - id = c.id, - defect_code = c.defect_code, - defect_name = c.defect_name, - defect_type_id = d.defect_type_name, - defect_type_id_id = d.id + defect_type_id = a.id, + defect_type_name = a.defect_type_name, + children = SqlFunc.Subqueryable().Where(x=>x.defect_type_id==a.id && defectIds.Contains(x.id)).ToList(x=>new DefectOutput() + { + id = x.id, + defect_code = x.defect_code, + defect_name = x.defect_name, + }) }).ToListAsync(); } } From 2cb5fedeeda793b60157f875d47407d9f1204442 Mon Sep 17 00:00:00 2001 From: taomin0419 <865692298@qq.com> Date: Thu, 29 Jun 2023 15:31:01 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=AD=BE=E6=94=B6?= =?UTF-8?q?=EF=BC=8C=E4=B8=9A=E5=8A=A1=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs index 34cccb55..fefc872c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs @@ -86,15 +86,16 @@ namespace Tnb.WarehouseMgr case "齐套出库": case "一般出库": { - WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId } }; + + WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId }, distaskCodes = input.distaskCodes }; await DoUpdate(upInput); //回更业务 - + } break; case "载具移出": { - WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId } }; + WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId }, distaskCodes = input.distaskCodes }; await DoUpdate(upInput); //回更业务 } break; From 7b825c3345a64adfe3f2bbb111cdd4d2a7b55ba6 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 15:32:21 +0800 Subject: [PATCH 12/18] 1 --- WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index e33e2811..609c1d26 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -237,7 +237,6 @@ namespace Tnb.WarehouseMgr }); pretaskCodes.AddRange(curPreTaskCodes); } - var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes); GenPreTaskUpInput genPreTaskAfterUpInput = new(); genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList(); From 3c270ce8f5b8ec3b99fd22d81c314b48874f9a50 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 15:33:39 +0800 Subject: [PATCH 13/18] 1 --- .../WmsSignForDeliveryService.cs | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs index fefc872c..1806caf7 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs @@ -79,28 +79,35 @@ namespace Tnb.WarehouseMgr { if (_dicBizType.ContainsKey(disTask.biz_type)) { - switch (_dicBizType[disTask.biz_type]) - { - case "空载具出库": - case "寄存出库": - case "齐套出库": - case "一般出库": - { + WareHouseUpInput upInput = new() { + loginType = "web", + bizTypeId = disTask.biz_type, + requireId = disTask.require_id, + carryIds = new List { input.carryId }, + distaskCodes = input.distaskCodes }; + await DoUpdate(upInput); //回更业务 + //switch (_dicBizType[disTask.biz_type]) + //{ + // case "空载具出库": + // case "寄存出库": + // case "齐套出库": + // case "一般出库": + // { - WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId }, distaskCodes = input.distaskCodes }; - await DoUpdate(upInput); //回更业务 + // WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId }, distaskCodes = input.distaskCodes }; + // await DoUpdate(upInput); //回更业务 - } - break; - case "载具移出": - { - WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId }, distaskCodes = input.distaskCodes }; - await DoUpdate(upInput); //回更业务 - } - break; + // } + // break; + // case "载具移出": + // { + // WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId }, distaskCodes = input.distaskCodes }; + // await DoUpdate(upInput); //回更业务 + // } + // break; - } + //} } disTask.is_sign = 1; await _db.Updateable(disTask).UpdateColumns(it => it.is_sign).ExecuteCommandAsync(); From b5440eb27a715eb2b0abc4b5cf406b951f3555bc Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Thu, 29 Jun 2023 15:35:11 +0800 Subject: [PATCH 14/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=97=B6=EF=BC=8C=E5=BA=93=E4=BD=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index 812656cc..1c97bda6 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -485,7 +485,7 @@ namespace Tnb.WarehouseMgr var carryStatus = multis[i].carry_status; if (multis[i].carry_status == ((int)EnumCarryStatus.空闲).ToString()) { - carryStatus = ((int)EnumCarryStatus.空闲).ToString(); + carryStatus = ((int)EnumCarryStatus.占用).ToString(); } var cStatus = carryStatus.ParseToInt(); await _db.Updateable().SetColumns(it => new BasLocation { is_use = cStatus, is_lock = 0 }).Where(it => it.id == multis[i].endlocation_id).ExecuteCommandAsync(); From 1afa52359f955736a5bc585e2682c3711e08954e Mon Sep 17 00:00:00 2001 From: taomin0419 <865692298@qq.com> Date: Thu, 29 Jun 2023 16:03:30 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=AD=BE=E6=94=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=9B=9E=E6=9B=B4=EF=BC=8C=E8=BD=BD=E5=85=B7?= =?UTF-8?q?=E7=A7=BB=E5=85=A5=E5=8F=82=E6=95=B0=E7=BB=84=E8=A3=85=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index 609c1d26..af08b0df 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -450,7 +450,11 @@ namespace Tnb.WarehouseMgr [nameof(InStockStrategyQuery.warehouse_id)] = outStockH.warehouse_id, [nameof(WmsPointH.location_id)] = outStockH.location_id, [nameof(WmsCarryD.carry_id)] = input.carryIds.First(), + [nameof(WmsCarryH.carry_code)] = carry.carry_code, [nameof(WmsHandleH.biz_type)] = input.bizTypeId, + [nameof(WmsHandleH.create_id)] = _userManager.UserId, + [nameof(WmsHandleH.create_time)] = DateTime.Now, + [nameof(WmsMoveInstock.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID, [nameof(WmsHandleH.bill_code)] = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_CARRYMOINSTK_ENCODE).GetAwaiter().GetResult(), }; await _wmsCarryMoveInStockService.CarryMoveIn(visulDevInput); From 5035721c6abac9741b44630d5cd70d743f1a89f8 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 16:06:17 +0800 Subject: [PATCH 16/18] 1 --- WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index af08b0df..9fe837d3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -391,6 +391,10 @@ namespace Tnb.WarehouseMgr { osd.line_status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID; } + else + { + osd.line_status = WmsWareHouseConst.BILLSTATUS_ON_ID; + } } } await _db.Updateable(curOutstockDetails).ExecuteCommandAsync(); From 1daf25d87bea949e67e5e29071bfc7b92a386029 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 16:08:57 +0800 Subject: [PATCH 17/18] 1 --- WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index 9fe837d3..bea1e56b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -343,6 +343,10 @@ namespace Tnb.WarehouseMgr { osd.line_status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID; } + else + { + osd.line_status = WmsWareHouseConst.BILLSTATUS_ON_ID; + } } } await _db.Updateable(curOutstockDetails).ExecuteCommandAsync(); From 3a1c2ad1f01ed3d0b07a1fe1409211ad12dd5a30 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 16:37:03 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E9=BD=90=E5=A5=97=E5=88=86=E6=8B=A3?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=8F=92=E5=85=A5=E9=A2=84=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=9D=A1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr/WmsSetSortingService.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs index ecc671a9..3a9df542 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs @@ -124,7 +124,20 @@ namespace Tnb.WarehouseMgr { await _genPreTask(carrys, locIds, firstLocationId, singleSorting.id, singleSorting.bill_code, preTasks); } - var isOk = await _wareHouseService.GenPreTask(preTasks, null); + List pretaskCodes = new(); + foreach (var pt in preTasks) + { + var partCodes = carryCodes.FindAll(x => x.carry_id == pt.carry_id).Distinct().ToList(); + var curPreTaskCodes = partCodes.Adapt>(); + curPreTaskCodes.ForEach(x => + { + x.id = SnowflakeIdHelper.NextId(); + x.bill_id = pt.id; + x.create_time = DateTime.Now; + }); + pretaskCodes.AddRange(curPreTaskCodes); + } + var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes); GenPreTaskUpInput genPreTaskAfterUpInput = new(); genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList(); genPreTaskAfterUpInput.LocationIds = new HashSet(locIds).ToList();