From 4210fdce014886374193400e485edce170c05f78 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期六, 04 三月 2023 11:29:07 +0800
Subject: [PATCH] 1.工单派发选择工艺路线或选择生产车间时判断绑定条件接口开发
2.组织架构删除update改为delete
3.工艺路线新增else if改为if
4.节拍工价根据工序线编码查找关联设备集合
---
VueWebApi/DLL/DAL/ProductionManagementDAL.cs | 101 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 99 insertions(+), 2 deletions(-)
diff --git a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
index fd8112f..c2741d5 100644
--- a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
+++ b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
@@ -475,6 +475,69 @@
}
#endregion
+ #region[宸ュ崟娲惧彂閫夋嫨宸ヨ壓璺嚎鎴栭�夋嫨鐢熶骇杞﹂棿鏃跺垽鏂粦瀹氭潯浠禲
+ public static ToMessage SelectRouteOrWkshop(string partcode, string routecode, string wkshopcode)
+ {
+ string sql = "";
+ var dynamicParams = new DynamicParameters();
+ try
+ {
+ mes.code = "200";
+ mes.Message = "";
+ mes.data = null;
+ //鍒ゆ柇宸ヨ壓璺嚎瀵瑰簲宸ュ簭鏄惁閮芥湁鍏宠仈宸ヤ綔绔�
+ sql = @"select B.step_code,C.eqp_code from TFlw_Rout A
+ inner join TFlw_Rtdt B on A.code=B.rout_code
+ left join TFlw_Rteqp C on B.step_code=C.step_code
+ where A.code=@routecode";
+ dynamicParams.Add("@routecode", routecode);
+ var dtck = DapperHelper.selectdata(sql, dynamicParams);
+ for (int i = 0; i < dtck.Rows.Count; i++)
+ {
+ if (dtck.Rows[i].IsNull("eqp_code"))
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = "褰撳墠宸ヨ壓璺嚎瀵瑰簲宸ュ簭銆�" + dtck.Rows[i]["step_code"].ToString() + "銆戯紝鏈叧鑱旇澶囷紝璇峰叧鑱旀墍鏈夊伐搴忓搴旇澶�!";
+ mes.data = null;
+ return mes;
+ }
+ }
+ //鍒ゆ柇宸ヨ壓璺嚎瀵瑰簲宸ュ簭鍏宠仈鐨勫伐浣滅珯鏄惁鏈夎缃妭鎷嶅伐浠�
+ sql = @"select AA.step_code,AA.eqp_code,S.unprice from (
+ select A.code,B.step_code,C.eqp_code from TFlw_Rout A
+ inner join TFlw_Rtdt B on A.code=B.rout_code
+ left join TFlw_Rteqp C on B.step_code=C.step_code
+ where A.code=@route_code
+ ) as AA
+ left join (select * from TPrteEqp_Stad where materiel_code=@partcode and route_code=@route_code) as S on
+ AA.code=S.route_code and AA.step_code=S.step_code and AA.eqp_code=S.eqp_code";
+ dynamicParams.Add("@partcode", partcode);
+ dynamicParams.Add("@route_code", routecode);
+ var dtc = DapperHelper.selectdata(sql, dynamicParams);
+ for (int i = 0; i < dtc.Rows.Count; i++)
+ {
+ if (dtc.Rows[i].IsNull("unprice") || decimal.Parse(dtc.Rows[i]["unprice"].ToString()) == 0)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = "鑺傛媿宸ヤ环涓細褰撳墠浜у搧銆�" + partcode + "銆戯紝瀵瑰簲宸ヨ壓璺嚎銆�" + routecode + "銆戞湭璁剧疆(鎴栨湭璁剧疆鍏�)鎴栧伐浠峰皬浜庣瓑浜�0!";
+ mes.data = null;
+ return mes;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
+
#region[MES宸ュ崟鏂板銆佺紪杈戞彁浜
public static ToMessage AddUpdateMesOrder(string mesorderstus, string sourceorder, string ordertype, string mesordercode, string partcode, string mesqty, string routecode, string wkshopcode, string planstartdate, string planenddate, string orderlev, string username, string opertype)
{
@@ -760,6 +823,40 @@
left join TMateriel_Info P on M.materiel_code=P.partcode
where A.wo_code=@wo_code order by A.seq";
dynamicParams.Add("@wo_code", wo_code);
+ var data = DapperHelper.selectdata(sql, dynamicParams);
+ mes.code = "200";
+ mes.Message = "鏌ヨ鎴愬姛!";
+ mes.data = data;
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
+
+ #region[MES宸ュ崟宸ュ簭浠诲姟鏌ョ湅SOP,鑾峰彇SOP鏂囦欢涓嬫媺鍒楄〃]
+ public static ToMessage SearchWorkStepSopList(string partcode, string routecode,string stepcode)
+ {
+ string sql = "";
+ var dynamicParams = new DynamicParameters();
+ try
+ {
+ //鑾峰彇SOP鏂囦欢淇℃伅
+ sql = @"select id,define_name,file_path from TK_Sop_Matfile where materiel_code=@partcode and eqptype_code in(
+ select distinct T.code from TMateriel_Route A
+ inner join TFlw_Rtdt B on A.route_code=B.rout_code
+ inner join TFlw_Rteqp E on B.step_code=E.step_code
+ inner join TEqpInfo Q on E.eqp_code=Q.code
+ inner join TEqpType T on Q.eqptype_code=T.code
+ where A.materiel_code=@partcode and A.route_code=@routecode and B.step_code=@stepcode) order by file_version desc";
+ dynamicParams.Add("@partcode", partcode);
+ dynamicParams.Add("@routecode", routecode);
+ dynamicParams.Add("@stepcode", stepcode);
var data = DapperHelper.selectdata(sql, dynamicParams);
mes.code = "200";
mes.Message = "鏌ヨ鎴愬姛!";
@@ -2521,7 +2618,7 @@
}
//鏄惁鏈亾
- if (json[i].last_choke == "Y")
+ else if (json[i].last_choke == "Y")
{
decimal this_reportqty = decimal.Parse(json[i].report_qty.ToString()); //鎶ュ伐鏁伴噺(鍚堟牸)
decimal this_ngqty = decimal.Parse(json[i].ng_qty.ToString()); //涓嶈壇鏁伴噺
@@ -3033,7 +3130,7 @@
wo_code=json[i].wo_code.ToString(),
step_seq=json[i].step_seq.ToString(),
step_code=json[i].step_code.ToString(),
- repair_qty = decimal.Parse(json[i].report_qty),
+ report_qty = decimal.Parse(json[i].report_qty),
ng_qty = decimal.Parse(json[i].ng_qty),
bad_qty = decimal.Parse(json[i].bad_qty),
}
--
Gitblit v1.9.3