| | |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using MES.Service.Models; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using NewPdaSqlServer.DB; |
| | | using NewPdaSqlServer.Dto.service; |
| | | using NewPdaSqlServer.entity; |
| | | using NewPdaSqlServer.util; |
| | | using SqlSugar; |
| | | using static Azure.Core.HttpHeader; |
| | | |
| | | namespace NewPdaSqlServer.service.QC; |
| | | |
| | |
| | | var totalCount = 0; |
| | | |
| | | var pageList = Db.Queryable<LLJView>() |
| | | .WhereIF( |
| | | StringUtil.IsNotNullOrEmpty(queryObj.result) && |
| | | "未完成".Equals(queryObj.result), |
| | | a => (a.FcheckResu ?? "") == "") |
| | | .WhereIF( |
| | | StringUtil.IsNotNullOrEmpty(queryObj.result) && |
| | | !"未完成".Equals(queryObj.result), |
| | | a => (a.FcheckResu ?? "") != "") |
| | | //.WhereIF( |
| | | // StringUtil.IsNotNullOrEmpty(queryObj.result) && |
| | | // "未完成".Equals(queryObj.result), |
| | | // a => (a.STATUS ?? "") != "已提交") |
| | | // //a => (a.FcheckResu ?? "") == ""|| (a.FcheckResu ?? "") == "检验中") |
| | | //.WhereIF( |
| | | // StringUtil.IsNotNullOrEmpty(queryObj.result) && |
| | | // !"未完成".Equals(queryObj.result), |
| | | // a => (a.STATUS ?? "") == "已提交") |
| | | |
| | | .WhereIF(!string.IsNullOrWhiteSpace(queryObj.keyword), a => |
| | | a.ItemNo.Contains(queryObj.keyword) || |
| | | a.ItemName.Contains(queryObj.keyword) || |
| | | a.LotNo.Contains(queryObj.keyword) || |
| | | a.ReleaseNo.Contains(queryObj.keyword) || |
| | | a.SuppName.Contains(queryObj.keyword) |
| | | ) |
| | | .WhereIF(UtilityHelper.CheckGuid(parsedGuid), |
| | | a => a.guid == parsedGuid) |
| | | a => a.guid == parsedGuid ) |
| | | .Where(a => (a.fsubmit ?? 0) == 0) |
| | | .OrderByDescending(a => a.CreateDate) |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount); |
| | | |
| | |
| | | FcheckItem = b.FcheckItem, |
| | | FdownAllow = b.FdownAllow, |
| | | FcheckLevel = b.FREQUENCY, |
| | | Fstand = Convert.ToInt32(b.FSTAND), |
| | | Fstand = b.FSTAND, |
| | | FupAllow = b.FupAllow, |
| | | SampleSizeNo = b.SampleSizeNo, |
| | | FenterQty = 0, |
| | |
| | | a.FspecRequ, |
| | | a.FreQty, |
| | | a.CheckQyt, |
| | | a.FcheckResu |
| | | a.FcheckResu, |
| | | a.Order, |
| | | a.Ybsl |
| | | }).Select((a, b) => new MesQaItemsDetectDetail5 |
| | | { |
| | | Guid = a.Guid, |
| | |
| | | Factory = "1000", |
| | | Company = "1000", |
| | | FenterQty = SqlFunc.AggregateCount(b.Guid), |
| | | FcheckResu = a.FcheckResu |
| | | }).ToList(); |
| | | FcheckResu = a.FcheckResu, |
| | | Order = a.Order, |
| | | Ybsl = a.Ybsl, |
| | | }).OrderBy(a => a.Order) |
| | | .ToList(); |
| | | } |
| | | |
| | | public int SetQSItemDetail(MesQaItemsDetectDetail12 detail) |
| | |
| | | commit += db.Updateable<MesQaItemsDetectDetail5>() |
| | | .SetColumns(s => s.FcheckResu == result) |
| | | .SetColumns(s => s.FenterQty == count) |
| | | .SetColumns(s => s.FngRate == (s.CheckQyt == 0 ? (decimal?)null : (decimal?)(Convert.ToDouble(noCount) / Convert.ToDouble(count)))) |
| | | .Where(s => s.Guid == detail.ParentGuid) |
| | | .ExecuteCommand(); |
| | | |
| | |
| | | throw new Exception("该检验单已提交"); |
| | | |
| | | if (mesQaItemsDetect01.FcheckDate == null) |
| | | throw new Exception("该检测单未输入检验日期,请核对。"); |
| | | throw new Exception("该检测单没有检验完成,请核对。"); |
| | | |
| | | if (mesQaItemsDetect01.FcheckBy.IsNullOrEmpty()) |
| | | throw new Exception("该检测单未输入检验人员,请核对。"); |
| | |
| | | |
| | | return [isNullCount, isNotNullCount]; |
| | | } |
| | | |
| | | |
| | | |
| | | //删除特征值 |
| | | public int deleteDetail13(LLJDto dto) |
| | | { |
| | | var withOracle = Db.Deleteable<MesQaItemsDetectDetail13>() |
| | | .Where(s => s.Guid.ToString() == dto.id13) |
| | | .ExecuteCommand(); |
| | | |
| | | return withOracle; |
| | | } |
| | | |
| | | //更新不合格描述 |
| | | public int updateRemarks(LLJDto dto) |
| | | { |
| | | var withOracle = Db.Updateable<MesQaItemsDetect01>() |
| | | .SetColumns(s => s.FngDesc == dto.Remarks) |
| | | .Where(s => s.Guid.ToString() == dto.gid) |
| | | .ExecuteCommand(); |
| | | |
| | | return withOracle; |
| | | } |
| | | } |