快乐的昕的电脑
2025-10-21 7a994e2b72e7cfa1e6afcea7ff6f38daba749b88
Services/MesOrderStaManager.cs
@@ -192,11 +192,13 @@
            OrderId = womdaa.Id,
            OrderNo = womdaa.Daa001,
            EditDate = editDate,
            Qty = mesReporting == null ? 0 : Int64.Parse(mesReporting.DyQty),
            Qty = mesReporting == null ? 0 : (long?)(mesReporting.DyQty ?? 0),
            InitialValue = mesNumerical == null ? 0 : mesNumerical.CjNum
        };
        Db.Insertable<MesAnchors>(eAnchors)
            .ExecuteCommand();
        // 新增逻辑:送检时间有值时,判断最新首检单是否合格,合格则写入调机完成时间为当前时间
        if (!string.IsNullOrEmpty(entity.MaShoutTime))
@@ -214,6 +216,13 @@
                    if (sjRecord != null && sjRecord.FcheckResu == "合格")
                    {
                        // 使用QualifiedInspection方法更新工单状态
                        QualifiedInspection(new OrderMachineDto
                        {
                            OrderId = entity.OrderId,
                            orderNo = entity.OrderNo,
                            machineNo = entity.MachineNo
                        });
                        //将送检时间写入开工时间
                        entity.StartTime = entity.MaShoutTime;
                        entity.MaEndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
@@ -233,6 +242,9 @@
            // 如果有调机完成时间则更新
            .SetColumnsIF(entity.MaEndTime != null,
                s => s.MaEndTime == entity.MaEndTime)
            // 如果有开工时间则更新
            .SetColumnsIF(entity.StartTime != null,
                s => s.StartTime == entity.StartTime)
            // 如果标记为1则更新备注信息
            .SetColumnsIF(entity.Flag == 1,
                s => s.remark == "于" + entity.MaShoutTime + "时间有一次送检")
@@ -496,12 +508,12 @@
                            MachineNo = womdaa.MachineNo,
                            // BfQty = reportingOkQty,
                            BfQty = 0,
                            BlQty = reportingOkQty.ToString(),
                            BlQty = reportingOkQty,
                            OkQty = 0,
                            ItemNo = womdaa.Daa002,
                            BillNo = womdaa.Daa001,
                            CjQty = CjQty.ToString(),
                            DyQty = reporting.OkQty.ToString()
                            CjQty = CjQty,
                            DyQty = reporting.OkQty
                        };
                        
                        // 插入报工记录