| | |
| | | |
| | | public class LljService |
| | | { |
| | | public List<LtsLlj> GetPage(XJPageResult queryObj) |
| | | public (List<LtsLlj> item, int TotalCount) GetPage(XJPageResult queryObj) |
| | | { |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | var id = Convert.ToDecimal(queryObj.id); |
| | | |
| | | return db.Queryable<LtsLlj>() |
| | | var totalCount = 0; |
| | | |
| | | var pageList = db.Queryable<LtsLlj>() |
| | | .WhereIF( |
| | | StringUtil.IsNotNullOrEmpty(queryObj.result) && |
| | | "未完成".Equals(queryObj.result), |
| | |
| | | !"未完成".Equals(queryObj.result), |
| | | a => a.FcheckResu != null) |
| | | .WhereIF(id > 0, a => a.Id == id) |
| | | //加筛选条件,根据供应商,物料编码,物料名称搜索 |
| | | //.WhereIF(queryObj.SearchValue!=null && queryObj.SearchValue!="", (a) => a.SuppName == queryObj.SearchValue|| a.ItemName == queryObj.SearchValue || a.ItemNo == queryObj.SearchValue ) |
| | | .WhereIF(queryObj.SearchValue != null && queryObj.SearchValue != "", |
| | | (a) => (a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower()) |
| | | || a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower()) |
| | | || a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower()))) |
| | | .OrderByDescending(a => a.Id) |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit); |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount); |
| | | |
| | | return (pageList, totalCount); |
| | | } |
| | | |
| | | //根据检验标准来计算检验个数 |
| | |
| | | string LEV = null; |
| | | switch (item.FcheckLevel) |
| | | { |
| | | case string s when s.Contains("S1"): |
| | | case null: |
| | | LEV = ""; // 默认值 |
| | | break; |
| | | case { } s when s.Contains("S1"): |
| | | LEV = "B.FLEVEL_S1"; |
| | | break; |
| | | case string s when s.Contains("S2"): |
| | | case { } s when s.Contains("S2"): |
| | | LEV = "B.FLEVEL_S2"; |
| | | break; |
| | | case string s when s.Contains("S3"): |
| | | case { } s when s.Contains("S3"): |
| | | LEV = "B.FLEVEL_S3"; |
| | | break; |
| | | case string s when s.Contains("S4"): |
| | | case { } s when s.Contains("S4"): |
| | | LEV = "B.FLEVEL_S4"; |
| | | break; |
| | | case string s when s.Contains("(I)"): |
| | | case { } s when s.Contains("(I)"): |
| | | LEV = "B.FLEVEL_I"; |
| | | break; |
| | | case string s when s.Contains("(II)"): |
| | | case { } s when s.Contains("(II)"): |
| | | LEV = "B.FLEVEL_II"; |
| | | break; |
| | | case string s when s.Contains("(III)"): |
| | | case { } s when s.Contains("(III)"): |
| | | LEV = "B.FLEVEL_III"; |
| | | break; |
| | | default: |
| | | LEV = ""; // 默认值 |
| | | break; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(LEV)) |
| | | throw new Exception(item.SampleSizeNo + "的检验水平不正确"); |
| | | |
| | | var sql = |
| | | "SELECT " + LEV + |
| | |
| | | |
| | | var maxBillNo = db.Ado.SqlQuerySingle<string>(sql); |
| | | |
| | | if (string.IsNullOrEmpty(maxBillNo)) |
| | | throw new Exception(item.SampleSizeNo + "下的" + quantity + |
| | | "这个范围下没有匹配到检验项目"); |
| | | |
| | | var result = ExtractSubstring(item.FacLevel, '(', ')'); |
| | | |
| | | if (string.IsNullOrEmpty(result)) |
| | | throw new Exception(item.SampleSizeNo + "下的" + quantity + |
| | | "拒收水平不正确"); |
| | | |
| | | sql = "SELECT FSAMPLE_SIZE_WORD, " + result + |
| | | " Result FROM MES_QM_AQL1 A LEFT JOIN MES_QM_AQL3 C ON C.AQL1_ID=A.ID WHERE A.SAMPLE_SIZE_NO= '" + |