diff --git a/ZR.Admin.WebApi/Properties/PublishProfiles/FolderProfile.pubxml b/ZR.Admin.WebApi/Properties/PublishProfiles/FolderProfile.pubxml index a61e32c3..68a5a2d9 100644 --- a/ZR.Admin.WebApi/Properties/PublishProfiles/FolderProfile.pubxml +++ b/ZR.Admin.WebApi/Properties/PublishProfiles/FolderProfile.pubxml @@ -7,17 +7,17 @@ https://go.microsoft.com/fwlink/?LinkID=208121. true false true - Release + Debug Any CPU FileSystem - bin\Release\net7.0\publish\ + bin\Debug\net7.0\publish\ FileSystem <_TargetId>Folder net7.0 e5497bb4-b0c1-4794-9fae-163f626ec399 - true + false win-x64 - production + production \ No newline at end of file diff --git a/ZR.Admin.WebApi/appsettings.production.json b/ZR.Admin.WebApi/appsettings.production.json index 4edb71a5..f17cac53 100644 --- a/ZR.Admin.WebApi/appsettings.production.json +++ b/ZR.Admin.WebApi/appsettings.production.json @@ -10,6 +10,7 @@ "dbConfigs": [ { //"Conn": "Data Source=147.116.122.230;User ID=root;Password=123456;Initial Catalog=ZrAdmin;", + //"Conn": "Data Source=47.116.122.230;Port=3307;User ID=root;Password=123456;Initial Catalog=ZrAdmin;", "Conn": "Data Source=127.0.0.1;Port=3306;User ID=root;Password=123456;Initial Catalog=ZrAdmin;", "DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4 "ConfigId": "0", //多租户唯一标识 diff --git a/ZR.Model/MES/wm/DTO/WmMaterialReceiptDTO.cs b/ZR.Model/MES/wm/DTO/WmMaterialReceiptDTO.cs index 5c588c17..ece29bad 100644 --- a/ZR.Model/MES/wm/DTO/WmMaterialReceiptDTO.cs +++ b/ZR.Model/MES/wm/DTO/WmMaterialReceiptDTO.cs @@ -19,6 +19,21 @@ namespace ZR.Model.MES.wm.DTO /// public string FkWorkorderId { get; set; } + /// + /// 产品描述 + /// + public string ProductDescription { get; set; } + + /// + /// 颜色 + /// + public string Colour { get; set; } + + /// + /// 规格 + /// + public string Specifications { get; set; } + /// /// 工单号排序 /// diff --git a/ZR.Service/mes/qc/FirstFQCService.cs b/ZR.Service/mes/qc/FirstFQCService.cs index b945874d..6a398bc3 100644 --- a/ZR.Service/mes/qc/FirstFQCService.cs +++ b/ZR.Service/mes/qc/FirstFQCService.cs @@ -1392,7 +1392,8 @@ namespace ZR.Service.mes.qc first.Remark = "抛光"; first.Remark2 = 1; int paoguang_total = 0; //抛光总数 - + //XXX20240223:记录首检后的抛光数 + int paoguang_by_first = 0; List firstrecordList = Context.Queryable().Where(it => it.FKWorkorderId == workorderID).Where(it => SqlFunc.Contains(it.FKInpectionId, "_1_")).ToList(); if (firstrecordList != null && firstrecordList.Count > 0) { @@ -1570,16 +1571,14 @@ namespace ZR.Service.mes.qc } } - + // XXX20240223: 记录首检时抛光数 + paoguang_by_first = paoguang_total; first.CreatedTime = DateTime.Now; first.UpdatedTime = DateTime.Now; - - - - - - #endregion + + + #region 打磨 QcQualityStatisticsFirst first2 = new QcQualityStatisticsFirst(); first2.Id = SnowFlakeSingle.Instance.NextId().ToString(); @@ -1785,16 +1784,11 @@ namespace ZR.Service.mes.qc } } - first2.CreatedTime = DateTime.Now; first2.UpdatedTime = DateTime.Now; - - - - - - #endregion + + #region 报废 QcQualityStatisticsFirst first3 = new QcQualityStatisticsFirst(); first3.Id = SnowFlakeSingle.Instance.NextId().ToString(); @@ -1810,18 +1804,11 @@ namespace ZR.Service.mes.qc } - - - - first3.Team = team; - - first3.EndTime = DateTime.Now; first3.Remark = "报废"; first3.Remark2 = 3; int baofei_total = 0; - List firstrecordList3 = Context.Queryable().Where(it => it.FKWorkorderId == workorderID).Where(it => SqlFunc.Contains(it.FKInpectionId, "_3_")).ToList(); if (firstrecordList3 != null && firstrecordList3.Count > 0) { @@ -2002,13 +1989,9 @@ namespace ZR.Service.mes.qc first3.CreatedTime = DateTime.Now; first3.UpdatedTime = DateTime.Now; - - - - - - #endregion + + #region 计算汇总 int qualifiedNumber_No_all = paoguang_total + damo_total + baofei_total; @@ -2022,7 +2005,6 @@ namespace ZR.Service.mes.qc var x = Context.Storageable(first).WhereColumns(it => new { it.WorkorderId, it.Remark2 }).ToStorage(); x.AsInsertable.ExecuteCommand();//不存在插入 x.AsUpdateable.IgnoreColumns(z => z.CreatedTime).ExecuteCommand();//存在更新 - first2.QualifiedNumber = first2.RequireNumber - qualifiedNumber_No_all; first2.QualifiedRate = Math.Round(((decimal)first2.QualifiedNumber / (decimal)first2.RequireNumber) * 100, 3); first2.PaoguangTotal = paoguang_total; @@ -2061,10 +2043,10 @@ namespace ZR.Service.mes.qc { again2.FinishedPartNumber = workorder_again2.FinishedPartNumber; again2.ProductDescription = workorder_again2.ProductDescription; - again2.RequireNumber = workorder_again2.PreviousNumber; + // XXX:二检入参修改为一检抛光记录值 + //again2.RequireNumber = workorder_again2.PreviousNumber; + again2.RequireNumber = paoguang_total; again2.StartTime = workorder_again2.CreatedTime;//这地方是不妥的 - - } @@ -2276,7 +2258,9 @@ namespace ZR.Service.mes.qc { again3.FinishedPartNumber = workorder_again3.FinishedPartNumber; again3.ProductDescription = workorder_again3.ProductDescription; - again3.RequireNumber = workorder_again3.PreviousNumber; + // XXX:二检(抛光)报废分数据上件数为首检抛光数 + again3.RequireNumber = paoguang_total; + // again3.RequireNumber = workorder_again3.PreviousNumber; again3.StartTime = workorder_again3.CreatedTime;//这地方是不妥的 @@ -2519,7 +2503,9 @@ namespace ZR.Service.mes.qc { final2.FinishedPartNumber = workorder_final2.FinishedPartNumber; final2.ProductDescription = workorder_final2.ProductDescription; - final2.RequireNumber = workorder_final2.PreviousNumber; + + // XXX:三检(包装),生产投入数为(一检投入数 - (一检报废数 + 二检报废数)) + final2.RequireNumber = workorder_final2.PreviousNumber - (baofei_total + baofei_total_again3); final2.StartTime = workorder_final2.CreatedTime;//这地方是不妥的 @@ -2734,7 +2720,9 @@ namespace ZR.Service.mes.qc { final3.FinishedPartNumber = workorder_final3.FinishedPartNumber; final3.ProductDescription = workorder_final3.ProductDescription; - final3.RequireNumber = workorder_final3.PreviousNumber; + // XXX:三检(包装-投入数) + final3.RequireNumber = workorder_final3.PreviousNumber - (baofei_total + baofei_total_again3); + //final3.RequireNumber = workorder_final3.PreviousNumber; final3.StartTime = workorder_final3.CreatedTime;//这地方是不妥的 diff --git a/ZR.Service/mes/qc/QCStatisticsService.cs b/ZR.Service/mes/qc/QCStatisticsService.cs index 40c30baf..8a59de61 100644 --- a/ZR.Service/mes/qc/QCStatisticsService.cs +++ b/ZR.Service/mes/qc/QCStatisticsService.cs @@ -34,6 +34,7 @@ namespace ZR.Service.mes.qc int totalNum = 0; var predicate = Expressionable.Create() .AndIF(starttime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.StartTime >= starttime) + //XXX:修改查询日期查询的字段 .AndIF(endTime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.EndTime <= endTime) .AndIF(!string.IsNullOrEmpty(workorderid), it => it.WorkorderId.Equals(workorderid)) .AndIF(!string.IsNullOrEmpty(partnumber), it => it.FinishedPartNumber.Equals(partnumber)) diff --git a/ZR.Service/mes/wm/MaterialReceiptService.cs b/ZR.Service/mes/wm/MaterialReceiptService.cs index d4d81980..3ddd3899 100644 --- a/ZR.Service/mes/wm/MaterialReceiptService.cs +++ b/ZR.Service/mes/wm/MaterialReceiptService.cs @@ -26,6 +26,7 @@ namespace ZR.Service.mes.wm .AndIF(year > 0, pw2 => pw2.Year == year) .AndIF(week > 0, pw2 => pw2.Week == week) .AndIF(date > 0, pw2 => pw2.Date == date) + //.And(pw2=>pw2.Status == 2) .ToExpression(); int totalCount = 0; @@ -35,9 +36,12 @@ namespace ZR.Service.mes.wm pw2.Id == wmr.FkWorkorder2Id }) .Where(predicate) - .Select((pw2,wmr) => new WmMaterialReceiptDTO + .Select((pw2, wmr) => new WmMaterialReceiptDTO { FkWorkorderId = pw2.Id, + ProductDescription = pw2.ProductDescription, + Colour = pw2.Colour, + Specifications = pw2.Specifications, BlankNumber = pw2.BlankNumber, PreviousNumber = pw2.PreviousNumber, Sort = pw2.Sort, @@ -46,7 +50,7 @@ namespace ZR.Service.mes.wm SampleNumber = wmr.SampleNumber, QualifiedNumber = wmr.QualifiedNumber, PassRate = wmr.PassRate, - Status=wmr.Status + Status = wmr.Status }) .OrderBy(pw2 => pw2.Sort) .ToPageList(pageNum, pageSize, ref totalCount); @@ -97,7 +101,7 @@ namespace ZR.Service.mes.wm wmMaterialReceipt.Id = wmMaterialReceiptDTO.Id; wmMaterialReceipt.UpdatedBy = wmMaterialReceiptDTO.Operator; wmMaterialReceipt.UpdatedTime = DateTime.Now; - int effectId = Context.Updateable(wmMaterialReceipt).ExecuteCommand(); + int effectId = Context.Updateable(wmMaterialReceipt).IgnoreColumns(ignoreAllNullColumns:true).ExecuteCommand(); return effectId; } } @@ -106,15 +110,16 @@ namespace ZR.Service.mes.wm /// public string SavePageMaterialReceipts(List list) { - int successCount = 0; - int totalCount = list.Count; - if(list == null || list.Count == 0) + if (list == null || list.Count == 0) { return $"保存成功:无数据变动!"; } + int successCount = 0; + int totalCount = list.Count; + for(int index = 1; index <= list.Count; index++) { - int effectId = SaveOneMaterialReceipt(list[index]); + int effectId = SaveOneMaterialReceipt(list[index-1]); if (effectId < 1) { return $"保存异常:总共{totalCount}条数据已成功保存{successCount}条数据,异常行数{index}";