| | |
| | | using System.Data; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using NewPdaSqlServer.DB; |
| | | using NewPdaSqlServer.Dto.service; |
| | | using NewPdaSqlServer.entity; |
| | | using NewPdaSqlServer.util; |
| | | using SqlSugar; |
| | | using DbType = System.Data.DbType; |
| | | |
| | | |
| | | namespace NewPdaSqlServer.service.QC; |
| | | |
| | |
| | | var parsedGuid = Guid.Empty; |
| | | if (!queryObj.id.IsNullOrEmpty()) |
| | | { |
| | | bool isValid = Guid.TryParse(queryObj.id, out parsedGuid); |
| | | var isValid = Guid.TryParse(queryObj.id, out parsedGuid); |
| | | if (!isValid) |
| | | throw new ApplicationException("GUID转换错误"); |
| | | } |
| | |
| | | |
| | | mesQaIqcItem.ForEach(item => |
| | | { |
| | | string LEV = item.FcheckLevel switch |
| | | var LEV = item.FcheckLevel switch |
| | | { |
| | | null => "" // 默认值 |
| | | , |
| | |
| | | { |
| | | var rkjDto = new LLJDto(); |
| | | |
| | | bool isValid = Guid.TryParse(id, out var parsedGuid); |
| | | var isValid = Guid.TryParse(id, out var parsedGuid); |
| | | |
| | | if (!isValid) |
| | | { |
| | | throw new Exception("GUID转换错误"); |
| | | } |
| | | if (!isValid) throw new Exception("GUID转换错误"); |
| | | |
| | | var qsItemOqcItem = |
| | | Db.Queryable<MesQaItemsDetectDetail5>() |
| | |
| | | //子表修改备注字段 |
| | | public int saveRemarksPid(LLJDto dto) |
| | | { |
| | | bool isValid = Guid.TryParse(dto.pid, out var parsedGuid); |
| | | var isValid = Guid.TryParse(dto.pid, out var parsedGuid); |
| | | |
| | | if (isValid) |
| | | { |
| | | return UseTransaction(db => |
| | | { |
| | | return db.Updateable<MesQaItemsDetectDetail5>() |
| | |
| | | .Where(it => it.Guid == parsedGuid) |
| | | .ExecuteCommand(); |
| | | }); |
| | | } |
| | | |
| | | throw new Exception("GUID转换错误"); |
| | | } |
| | |
| | | { |
| | | mesQaItemsDetectDetail5.FenterQty ??= 0; |
| | | if (mesQaItemsDetectDetail5.FenterQty == 0) |
| | | { |
| | | throw new Exception("检验项目:" + |
| | | mesQaItemsDetectDetail5.FcheckItem + |
| | | " 已录入数量为0,请确认。"); |
| | | } |
| | | } |
| | | |
| | | var com = UseTransaction(db => |
| | |
| | | TotalOkRkQty = SqlFunc.AggregateSum(b.OkRkqty) |
| | | }) |
| | | .First(); |
| | | |
| | | |
| | | var totalQuantity = first.TotalQuantity ?? 0; |
| | | var totalOkRkQty = first.TotalOkRkQty ?? 0; |
| | | |
| | |
| | | executeCommand += db.Updateable<MesInvItemArnDetail>() |
| | | .SetColumns(s => s.CheckStates == "不合格待审批") |
| | | .SetColumns(s => s.Ischeck == 1) |
| | | .SetColumns(s => s.CheckRes == mesQaItemsDetect01.FcheckResu) |
| | | .SetColumns( |
| | | s => s.CheckRes == mesQaItemsDetect01.FcheckResu) |
| | | .SetColumns(s => s.CheckDate == DateTime.Now) |
| | | .Where(s => s.ParentGuid == mesInvItemArn.Guid |
| | | && s.ItemId == mesQaItemsDetect01.ItemId) |
| | | .ExecuteCommand(); |
| | | |
| | | |
| | | executeCommand += db.Updateable<MesQaItemsDetect01>() |
| | | .SetColumns(s => s.IqcDate == DateTime.Now) |
| | | .SetColumns(s => s.FcheckDate == DateTime.Now) |
| | |
| | | .ExecuteCommand(); |
| | | } |
| | | |
| | | if (executeCommand >=3) |
| | | if (executeCommand >= 3) |
| | | return executeCommand; |
| | | |
| | | throw new Exception("更新失败"); |