From 3b688a2758a44d240b9673dccb69511832116435 Mon Sep 17 00:00:00 2001
From: hao <1836460075@qq.com>
Date: 星期三, 08 十月 2025 16:25:23 +0800
Subject: [PATCH] Revert "IQC堵穴数,IQC破坏实验"
---
StandardInterface/MES.Service/service/QC/LljService.cs | 379 +++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 278 insertions(+), 101 deletions(-)
diff --git a/StandardInterface/MES.Service/service/QC/LljService.cs b/StandardInterface/MES.Service/service/QC/LljService.cs
index 78dc03b..01b0cbb 100644
--- a/StandardInterface/MES.Service/service/QC/LljService.cs
+++ b/StandardInterface/MES.Service/service/QC/LljService.cs
@@ -1,5 +1,6 @@
锘縰sing System.Data;
using System.Xml;
+using System.Linq;
using Masuit.Tools;
using MES.Service.DB;
using MES.Service.Dto.service;
@@ -24,72 +25,154 @@
var totalCount = 0;
- var pageList = db.Queryable<LtsLlj, V_LljUser>((a, v) =>
- new JoinQueryInfos(JoinType.Left, a.ItemNo == v.ItemNo))
- .WhereIF(
- StringUtil.IsNotNullOrEmpty(queryObj.result) &&
- "鏈畬鎴�".Equals(queryObj.result),
- (a, v) => a.FcheckResu == null)
- .WhereIF(
- StringUtil.IsNotNullOrEmpty(queryObj.result) &&
- !"鏈畬鎴�".Equals(queryObj.result),
- (a, v) => a.FcheckResu != null)
- .WhereIF(id > 0, (a, v) => a.Id == id)
- // 鏉冮檺鎺у埗锛歅L017銆丠MLYY銆丠MCS 鍙互鐪嬪埌鎵�鏈夊崟鎹紝鍏朵粬鐢ㄦ埛闇�瑕佹牴鎹墿鏂欑淮鎶ゆ儏鍐靛垽鏂�
- .WhereIF(queryObj.createUser != "PL017" && queryObj.createUser != "HMLYY" && queryObj.createUser != "HMCS" && queryObj.UserIndex == "0",
- (a, v) =>
- // 濡傛灉鐗╂枡琚淮鎶わ紝鍙湁缁存姢浜哄憳鍙互鐪嬪埌
- (v.Fcode != null && v.Fcode == queryObj.createUser) ||
- // 濡傛灉鐗╂枡鏈缁存姢锛屾墍鏈変汉閮藉彲浠ョ湅鍒�
- (v.Fcode == null))
-
- //鍔犵瓫閫夋潯浠�,鏍规嵁閫夋嫨鐨勬悳绱㈠瓧娈佃繘琛岀簿纭悳绱�
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 1, // 鐗╂枡缂栧彿鎼滅储
- (a, v) => a.ItemNo != null && a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 2, // 鐗╂枡鍚嶇О鎼滅储
- (a, v) => a.ItemName != null && a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 3, // 渚涘簲鍟嗘悳绱�
- (a, v) => a.SuppName != null && a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 4, // 鍒拌揣鍗曞彿鎼滅储
- (a, v) => a.LotNo != null && a.LotNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 5, // 妫�楠屽崟鍙锋悳绱�
- (a, v) => a.ReleaseNo != null && a.ReleaseNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 6, // 鐗╂枡瑙勬牸鎼滅储
- (a, v) => a.ItemModel != null && a.ItemModel.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .Select((a, v) => new LtsLlj
- {
- Id = a.Id,
- ItemNo = a.ItemNo,
- ItemId = a.ItemId,
- ItemName = a.ItemName,
- ItemModel = a.ItemModel,
- SuppName = a.SuppName,
- LotNo = a.LotNo,
- ReleaseNo = a.ReleaseNo,
- FcheckResu = a.FcheckResu,
- CreateDate = a.CreateDate,
- FcovertQty = a.FcovertQty,
- DEPARTMENTNAME = a.DEPARTMENTNAME,
- FngDesc = a.FngDesc,
- UrgentFlag = a.UrgentFlag,
- Ftype = a.Ftype,
- LotNo1 = a.LotNo1,
- EMERGENCY = a.EMERGENCY,
- Status = a.Status,
- IqcDate = a.IqcDate,
- // 娣诲姞缁存姢浜哄憳淇℃伅
- Fcode = v.Fcode,
- // 娣诲姞鐮村潖瀹為獙鏁伴噺
- PHSY = a.PHSY,
- // 娣诲姞涓嶈壇鍘熷洜
- BLYY = a.BLYY,
- // 娣诲姞鎵�灞炶溅闂�
- SSCJ = a.SSCJ,
- // 娣诲姞璇勫鐘舵��
- PSZT = a.PSZT
- })
- .OrderBy("CASE WHEN EMERGENCY = 1 THEN 0 ELSE 1 END, CASE WHEN STATUS = '宸叉彁浜�' THEN 0 ELSE 1 END, IQC_DATE desc, ID asc")
- .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount);
+ // 浣跨敤鏁版嵁搴撳垎椤垫煡璇紝涓�娆℃煡璇�50鏉★紝鎻愬崌鎬ц兘
+ // 鍒ゆ柇鏄惁涓虹鐞嗗憳璐﹀彿
+ bool isAdmin = queryObj.createUser == "PL017" || queryObj.createUser == "HMLYY" || queryObj.createUser == "HMCS";
+
+ List<LtsLlj> pageList;
+
+ if (isAdmin)
+ {
+ // 绠$悊鍛樿处鍙凤細鐩存帴鏌ヨ涓昏〃锛岄伩鍏岼OIN瀵艰嚧鐨勯噸澶嶈褰�
+ pageList = db.Queryable<LtsLlj>()
+ .WhereIF(
+ StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+ "鏈畬鎴�".Equals(queryObj.result),
+ a => a.FcheckResu == null)
+ .WhereIF(
+ StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+ !"鏈畬鎴�".Equals(queryObj.result),
+ a => a.FcheckResu != null)
+ .WhereIF(id > 0, a => a.Id == id)
+ //鍔犵瓫閫夋潯浠�,鏍规嵁閫夋嫨鐨勬悳绱㈠瓧娈佃繘琛岀簿纭悳绱�
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 1, // 鐗╂枡缂栧彿鎼滅储
+ a => a.ItemNo != null && a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 2, // 鐗╂枡鍚嶇О鎼滅储
+ a => a.ItemName != null && a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 3, // 渚涘簲鍟嗘悳绱�
+ a => a.SuppName != null && a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 4, // 鍒拌揣鍗曞彿鎼滅储
+ a => a.LotNo != null && a.LotNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 5, // 妫�楠屽崟鍙锋悳绱�
+ a => a.ReleaseNo != null && a.ReleaseNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 6, // 鐗╂枡瑙勬牸鎼滅储
+ a => a.ItemModel != null && a.ItemModel.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .Select(a => new LtsLlj
+ {
+ Id = a.Id,
+ ItemNo = a.ItemNo,
+ ItemId = a.ItemId,
+ ItemName = a.ItemName,
+ ItemModel = a.ItemModel,
+ SuppName = a.SuppName,
+ LotNo = a.LotNo,
+ ReleaseNo = a.ReleaseNo,
+ FcheckResu = a.FcheckResu,
+ CreateDate = a.CreateDate,
+ FcovertQty = a.FcovertQty,
+ DEPARTMENTNAME = a.DEPARTMENTNAME,
+ FngDesc = a.FngDesc,
+ UrgentFlag = a.UrgentFlag,
+ Ftype = a.Ftype,
+ LotNo1 = a.LotNo1,
+ EMERGENCY = a.EMERGENCY,
+ Status = a.Status,
+ IqcDate = a.IqcDate,
+ // 娣诲姞缁存姢浜哄憳淇℃伅锛堢鐞嗗憳涓嶉渶瑕佹瀛楁锛�
+ Fcode = null,
+ // 娣诲姞鐮村潖瀹為獙鏁伴噺
+ PHSY = a.PHSY,
+ // 娣诲姞涓嶈壇鍘熷洜
+ BLYY = a.BLYY,
+ // 娣诲姞鎵�灞炶溅闂�
+ SSCJ = a.SSCJ,
+ // 娣诲姞璇勫鐘舵��
+ PSZT = a.PSZT,
+ // 娣诲姞妫�楠岄」鐩淮鎶ょ姸鎬�
+ Jyxm = a.Jyxm
+ })
+ .OrderBy("IQC_DATE DESC")
+ .OrderBy("CASE WHEN EMERGENCY = 1 THEN 0 ELSE 1 END")
+ .OrderBy("CASE WHEN JYXM = 0 THEN 0 ELSE 1 END")
+ .OrderBy("CASE WHEN STATUS = '宸叉彁浜�' THEN 1 ELSE 0 END")
+ .OrderBy("CREATE_DATE")
+ .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount);
+ }
+ else
+ {
+ // 鏅�氱敤鎴凤細浣跨敤JOIN鏌ヨ锛屾牴鎹淮鎶ゆ儏鍐靛垽鏂潈闄�
+ pageList = db.Queryable<LtsLlj, V_LljUser>((a, v) =>
+ new JoinQueryInfos(JoinType.Left, a.ItemNo == v.ItemNo))
+ .WhereIF(
+ StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+ "鏈畬鎴�".Equals(queryObj.result),
+ (a, v) => a.FcheckResu == null)
+ .WhereIF(
+ StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+ !"鏈畬鎴�".Equals(queryObj.result),
+ (a, v) => a.FcheckResu != null)
+ .WhereIF(id > 0, (a, v) => a.Id == id)
+ // 鏉冮檺鎺у埗锛氭櫘閫氱敤鎴烽渶瑕佹牴鎹墿鏂欑淮鎶ゆ儏鍐靛垽鏂�
+ .WhereIF(queryObj.UserIndex == "0",
+ (a, v) =>
+ // 濡傛灉鐗╂枡琚淮鎶わ紝鍙湁缁存姢浜哄憳鍙互鐪嬪埌
+ (v.Fcode != null && v.Fcode == queryObj.createUser) ||
+ // 濡傛灉鐗╂枡鏈缁存姢锛屾墍鏈変汉閮藉彲浠ョ湅鍒�
+ (v.Fcode == null))
+ //鍔犵瓫閫夋潯浠�,鏍规嵁閫夋嫨鐨勬悳绱㈠瓧娈佃繘琛岀簿纭悳绱�
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 1, // 鐗╂枡缂栧彿鎼滅储
+ (a, v) => a.ItemNo != null && a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 2, // 鐗╂枡鍚嶇О鎼滅储
+ (a, v) => a.ItemName != null && a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 3, // 渚涘簲鍟嗘悳绱�
+ (a, v) => a.SuppName != null && a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 4, // 鍒拌揣鍗曞彿鎼滅储
+ (a, v) => a.LotNo != null && a.LotNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 5, // 妫�楠屽崟鍙锋悳绱�
+ (a, v) => a.ReleaseNo != null && a.ReleaseNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 6, // 鐗╂枡瑙勬牸鎼滅储
+ (a, v) => a.ItemModel != null && a.ItemModel.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .Select((a, v) => new LtsLlj
+ {
+ Id = a.Id,
+ ItemNo = a.ItemNo,
+ ItemId = a.ItemId,
+ ItemName = a.ItemName,
+ ItemModel = a.ItemModel,
+ SuppName = a.SuppName,
+ LotNo = a.LotNo,
+ ReleaseNo = a.ReleaseNo,
+ FcheckResu = a.FcheckResu,
+ CreateDate = a.CreateDate,
+ FcovertQty = a.FcovertQty,
+ DEPARTMENTNAME = a.DEPARTMENTNAME,
+ FngDesc = a.FngDesc,
+ UrgentFlag = a.UrgentFlag,
+ Ftype = a.Ftype,
+ LotNo1 = a.LotNo1,
+ EMERGENCY = a.EMERGENCY,
+ Status = a.Status,
+ IqcDate = a.IqcDate,
+ // 娣诲姞缁存姢浜哄憳淇℃伅
+ Fcode = v.Fcode,
+ // 娣诲姞鐮村潖瀹為獙鏁伴噺
+ PHSY = a.PHSY,
+ // 娣诲姞涓嶈壇鍘熷洜
+ BLYY = a.BLYY,
+ // 娣诲姞鎵�灞炶溅闂�
+ SSCJ = a.SSCJ,
+ // 娣诲姞璇勫鐘舵��
+ PSZT = a.PSZT,
+ // 娣诲姞妫�楠岄」鐩淮鎶ょ姸鎬�
+ Jyxm = a.Jyxm
+ })
+ .OrderBy("IQC_DATE DESC")
+ .OrderBy("CASE WHEN EMERGENCY = 1 THEN 0 ELSE 1 END")
+ .OrderBy("CASE WHEN JYXM = 0 THEN 0 ELSE 1 END")
+ .OrderBy("CASE WHEN STATUS = '宸叉彁浜�' THEN 1 ELSE 0 END")
+ .OrderBy("CREATE_DATE")
+ .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount);
+ }
// 鎵归噺鑾峰彇妫�楠岄」鐩暟閲忥紝閬垮厤N+1鏌ヨ闂
if (pageList.Any())
@@ -109,40 +192,76 @@
}
// 璁$畻鎵�鏈夋暟鎹殑鍘婚噸鎬绘暟锛堜笉鏄綋鍓嶉〉鐨勫幓閲嶆暟锛�
- var allDataQuery = db.Queryable<LtsLlj, V_LljUser>((a, v) =>
- new JoinQueryInfos(JoinType.Left, a.ItemNo == v.ItemNo))
- .WhereIF(
- StringUtil.IsNotNullOrEmpty(queryObj.result) &&
- "鏈畬鎴�".Equals(queryObj.result),
- (a, v) => a.FcheckResu == null)
- .WhereIF(
- StringUtil.IsNotNullOrEmpty(queryObj.result) &&
- !"鏈畬鎴�".Equals(queryObj.result),
- (a, v) => a.FcheckResu != null)
- .WhereIF(id > 0, (a, v) => a.Id == id)
- // 鏉冮檺鎺у埗锛歅L017銆丠MLYY銆丠MCS 鍙互鐪嬪埌鎵�鏈夊崟鎹紝鍏朵粬鐢ㄦ埛闇�瑕佹牴鎹墿鏂欑淮鎶ゆ儏鍐靛垽鏂�
- .WhereIF(queryObj.createUser != "PL017" && queryObj.createUser != "HMLYY" && queryObj.createUser != "HMCS" && queryObj.UserIndex == "0",
- (a, v) =>
- // 濡傛灉鐗╂枡琚淮鎶わ紝鍙湁缁存姢浜哄憳鍙互鐪嬪埌
- (v.Fcode != null && v.Fcode == queryObj.createUser) ||
- // 濡傛灉鐗╂枡鏈缁存姢锛屾墍鏈変汉閮藉彲浠ョ湅鍒�
- (v.Fcode == null))
- //鍔犵瓫閫夋潯浠�,鏍规嵁閫夋嫨鐨勬悳绱㈠瓧娈佃繘琛岀簿纭悳绱�
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 1, // 鐗╂枡缂栧彿鎼滅储
- (a, v) => a.ItemNo != null && a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 2, // 鐗╂枡鍚嶇О鎼滅储
- (a, v) => a.ItemName != null && a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 3, // 渚涘簲鍟嗘悳绱�
- (a, v) => a.SuppName != null && a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 4, // 鍒拌揣鍗曞彿鎼滅储
- (a, v) => a.LotNo != null && a.LotNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 5, // 妫�楠屽崟鍙锋悳绱�
- (a, v) => a.ReleaseNo != null && a.ReleaseNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 6, // 鐗╂枡瑙勬牸鎼滅储
- (a, v) => a.ItemModel != null && a.ItemModel.ToLower().Contains(queryObj.SearchValue.ToLower()))
- .Select((a, v) => a.ReleaseNo)
- .Distinct()
- .Count();
+ int allDataQuery;
+
+ if (isAdmin)
+ {
+ // 绠$悊鍛樿处鍙凤細鐩存帴鏌ヨ涓昏〃
+ allDataQuery = db.Queryable<LtsLlj>()
+ .WhereIF(
+ StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+ "鏈畬鎴�".Equals(queryObj.result),
+ a => a.FcheckResu == null)
+ .WhereIF(
+ StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+ !"鏈畬鎴�".Equals(queryObj.result),
+ a => a.FcheckResu != null)
+ .WhereIF(id > 0, a => a.Id == id)
+ //鍔犵瓫閫夋潯浠�,鏍规嵁閫夋嫨鐨勬悳绱㈠瓧娈佃繘琛岀簿纭悳绱�
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 1, // 鐗╂枡缂栧彿鎼滅储
+ a => a.ItemNo != null && a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 2, // 鐗╂枡鍚嶇О鎼滅储
+ a => a.ItemName != null && a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 3, // 渚涘簲鍟嗘悳绱�
+ a => a.SuppName != null && a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 4, // 鍒拌揣鍗曞彿鎼滅储
+ a => a.LotNo != null && a.LotNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 5, // 妫�楠屽崟鍙锋悳绱�
+ a => a.ReleaseNo != null && a.ReleaseNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 6, // 鐗╂枡瑙勬牸鎼滅储
+ a => a.ItemModel != null && a.ItemModel.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .Select(a => a.ReleaseNo)
+ .Distinct()
+ .Count();
+ }
+ else
+ {
+ // 鏅�氱敤鎴凤細浣跨敤JOIN鏌ヨ
+ allDataQuery = db.Queryable<LtsLlj, V_LljUser>((a, v) =>
+ new JoinQueryInfos(JoinType.Left, a.ItemNo == v.ItemNo))
+ .WhereIF(
+ StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+ "鏈畬鎴�".Equals(queryObj.result),
+ (a, v) => a.FcheckResu == null)
+ .WhereIF(
+ StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+ !"鏈畬鎴�".Equals(queryObj.result),
+ (a, v) => a.FcheckResu != null)
+ .WhereIF(id > 0, (a, v) => a.Id == id)
+ // 鏉冮檺鎺у埗锛氭櫘閫氱敤鎴烽渶瑕佹牴鎹墿鏂欑淮鎶ゆ儏鍐靛垽鏂�
+ .WhereIF(queryObj.UserIndex == "0",
+ (a, v) =>
+ // 濡傛灉鐗╂枡琚淮鎶わ紝鍙湁缁存姢浜哄憳鍙互鐪嬪埌
+ (v.Fcode != null && v.Fcode == queryObj.createUser) ||
+ // 濡傛灉鐗╂枡鏈缁存姢锛屾墍鏈変汉閮藉彲浠ョ湅鍒�
+ (v.Fcode == null))
+ //鍔犵瓫閫夋潯浠�,鏍规嵁閫夋嫨鐨勬悳绱㈠瓧娈佃繘琛岀簿纭悳绱�
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 1, // 鐗╂枡缂栧彿鎼滅储
+ (a, v) => a.ItemNo != null && a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 2, // 鐗╂枡鍚嶇О鎼滅储
+ (a, v) => a.ItemName != null && a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 3, // 渚涘簲鍟嗘悳绱�
+ (a, v) => a.SuppName != null && a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 4, // 鍒拌揣鍗曞彿鎼滅储
+ (a, v) => a.LotNo != null && a.LotNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 5, // 妫�楠屽崟鍙锋悳绱�
+ (a, v) => a.ReleaseNo != null && a.ReleaseNo.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .WhereIF(!string.IsNullOrEmpty(queryObj.SearchValue) && queryObj.selectedIndex == 6, // 鐗╂枡瑙勬牸鎼滅储
+ (a, v) => a.ItemModel != null && a.ItemModel.ToLower().Contains(queryObj.SearchValue.ToLower()))
+ .Select((a, v) => a.ReleaseNo)
+ .Distinct()
+ .Count();
+ }
var emergencyValues = pageList.Select(item => item.EMERGENCY).ToList();
return (pageList, allDataQuery);
@@ -682,7 +801,7 @@
FcheckItemDesc = a.FspecRequ,
Funit = a.Funit,
Meom = a.Meom,
- }).ToList();
+ }).OrderBy(a => SqlFunc.IIF(a.Fstand != null, 0, 1)).OrderBy(a => a.FcheckItem, OrderByType.Desc).ToList();
}
public int SetQSItemDetail(MesQaItemsDetectDetail12 detail)
@@ -1087,4 +1206,62 @@
throw new Exception(ex.Message);
}
}
+ public List<MesItems> GetWomdab(string daa001)
+ {
+ //if (string.IsNullOrEmpty(ItemNo))
+ //{
+ // throw new ArgumentException("妫�楠屽崟鍙蜂笉鑳戒负绌�");
+ //}
+
+ var db = SqlSugarHelper.GetInstance();
+ try
+ {
+ return db.Queryable<Womdab>()
+ .LeftJoin<MesItems>((w, m) => w.Dab003 == m.ItemId.ToString()) // 闇�瑕佹浛鎹负瀹為檯鐨勫叧鑱斿瓧娈�
+ .Where((w, m) => w.Dab001 == daa001)
+ .OrderBy((w, m) => w.Dab003, OrderByType.Desc)
+ // .ThenBy((w, m) => w.CreateDate, OrderByType.Desc)
+ .Select((w, m) => new MesItems
+ {
+ ItemNo = m.ItemNo,
+ ItemName = m.ItemName,
+ ItemModel = m.ItemModel
+ }).ToList();
+ }
+ catch (Exception ex)
+ {
+ throw new Exception($"鏌ヨ闄勪欢淇℃伅澶辫触: {ex.Message}");
+ }
+
+ }
+
+ public List<MesItems> GetWomdabById(string daa001,string ItemNo)
+ {
+ //if (string.IsNullOrEmpty(ItemNo))
+ //{
+ // throw new ArgumentException("妫�楠屽崟鍙蜂笉鑳戒负绌�");
+ //}
+
+ var db = SqlSugarHelper.GetInstance();
+ try
+ {
+ return db.Queryable<Womdab>()
+ .LeftJoin<MesItems>((w, m) => w.Dab003 == m.ItemId.ToString()) // 闇�瑕佹浛鎹负瀹為檯鐨勫叧鑱斿瓧娈�
+ .Where((w, m) => w.Dab001 == daa001 && m.ItemNo.Contains(ItemNo))
+ .OrderBy((w, m) => w.Dab003, OrderByType.Desc)
+ // .ThenBy((w, m) => w.CreateDate, OrderByType.Desc)
+ .Select((w, m) => new MesItems
+ {
+ ItemNo = m.ItemNo,
+ ItemName = m.ItemName,
+ ItemModel = m.ItemModel
+ }).ToList();
+ }
+ catch (Exception ex)
+ {
+ throw new Exception($"鏌ヨ闄勪欢淇℃伅澶辫触: {ex.Message}");
+ }
+
+ }
+
}
\ No newline at end of file
--
Gitblit v1.9.3