From ffbcbb6ac13d3e700e51ea37063c9a5f4a8a3455 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期二, 16 一月 2024 16:15:17 +0800 Subject: [PATCH] 1.收料通知单编辑功能完善, 保存方法中,增加 反写关联数量至 采购订单的 存储过程增加超过关闭,反关闭 2.首件检验单保存方法,增加 调用 保存前控制 h_p_QC_FirstPieceCheckBill_BeforeSaveCtrl 和保存后控制 h_p_QC_FirstPieceCheckBill_AfterSaveCtrl的 存储过程。 巡检单保存方法,增加 调用 保存前控制 h_p_QC_PatrolProcCheckBill_BeforeSaveCtrl 和保存后控制 h_p_QC_PatrolProcCheckBill_AfterSaveCtrl的 存储过程。 工序检验单保存方法,增加 调用 保存前控制 h_p_QC_ProcessCheckBill_BeforeSaveCtrl 和保存后控制 h_p_QC_ProcessCheckBill_AfterSaveCtrl的 存储过程。设备保养记录单保存方法,增加 调用 保存前控制 h_p_Sb_EquipMaintainBill_BeforeSaveCtrl 和保存后控制 h_p_Sb_EquipMaintainBill_AfterSaveCtrl的 存储过程。 设备点检记录单保存方法,增加 调用 保存前控制 h_p_Sb_EquipDotCheckBill_BeforeSaveCtrl 和保存后控制 h_p_Sb_EquipDotCheckBill_AfterSaveCtrl的 存储过程。 设备故障登记单保存方法,增加 调用 保存前控制 h_p_Sb_EquipConkBookBill_BeforeSaveCtrl 和保存后控制 h_p_Sb_EquipConkBookBill_AfterSaveCtrl的 存储过程。 设备维修记录单保存方法,增加 调用 保存前控制 h_p_Sb_EquipRepairWorkBill_BeforeSaveCtrl 和保存后控制 h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl的 存储过程。 --- WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs | 42 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 36 insertions(+), 6 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs b/WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs index 446a3ac..a34dd50 100644 --- a/WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs @@ -121,7 +121,7 @@ #region 杞﹂棿鏀舵枡鍒楄〃 鎾ら攢纭鏀舵枡 [Route("Cj_SendGoodsBill/DeptCheckGoodsBillList_revoke")] [HttpGet] - public object DeptCheckGoodsBillList_revoke(string HInterID, string User) + public object DeptCheckGoodsBillList_revoke(string HInterID, string HEntryID, string User) { try { @@ -161,17 +161,47 @@ { try { + DataSet dataset = new DataSet(); //鑾峰彇杞﹂棿閰嶉�佸崟鎹暟鎹� - ds = oCN.RunProcReturn($"select * from JIT_SendGoodsBillMain a inner join JIT_SendGoodsBillSub b on a.HInterID = b.HInterID where a.HInterID={HInterID} and HEntryID={HEntryID} ", "JIT_SendGoodsBillMain"); + dataset = oCN.RunProcReturn($"select * from JIT_SendGoodsBillMain a inner join JIT_SendGoodsBillSub b on a.HInterID = b.HInterID where a.HInterID={HInterID} and HEntryID={HEntryID} ", "JIT_SendGoodsBillMain"); + + var HQty = double.Parse(dataset.Tables[0].Rows[0]["HQty"].ToString()); //鑾峰彇鎷f枡閰嶉�佸崟鐨勬暟鎹� - ds = oCN.RunProcReturn($"select * from JIT_ComplementGoodsBillMain a inner join JIT_ComplementGoodsBillSub b on a.HInterID = b.HInterID where a.HInterID={(ds.Tables[0].Rows[0]["HMainSourceInterID"].ToString())} and b.HMaterID={(ds.Tables[0].Rows[0]["HMaterID"].ToString())} and b.HWHID={(ds.Tables[0].Rows[0]["HWHID"].ToString())} ", "JIT_ComplementGoodsBillMain"); + ds = oCN.RunProcReturn($"select * from JIT_ComplementGoodsBillMain a inner join JIT_ComplementGoodsBillSub b on a.HInterID = b.HInterID where a.HInterID={(dataset.Tables[0].Rows[0]["HMainSourceInterID"].ToString())} and b.HMaterID={(dataset.Tables[0].Rows[0]["HMaterID"].ToString())} and b.HWHID={(dataset.Tables[0].Rows[0]["HWHID"].ToString())} ", "JIT_ComplementGoodsBillMain"); //鑾峰彇鎷f枡閰嶉�佸崟_LK琛� 鏁版嵁 - ds = oCN.RunProcReturn($"select * from from JIT_ComplementGoodsBillSub_LK where HInterID={(ds.Tables[0].Rows[0]["HInterID"].ToString())} ", "JIT_SendGoodsBillMain"); + ds = oCN.RunProcReturn($"select * from JIT_ComplementGoodsBillSub_LK where HInterID={(ds.Tables[0].Rows[0]["HInterID"].ToString())} and HSendQTY<>0 order by HSendQTY", "JIT_SendGoodsBillMain"); - //oCN.RunProc($"delete from JIT_SendGoodsBillMain where HInterID='{HInterID}'"); - //oCN.RunProc($"delete from JIT_SendGoodsBillSub where HInterID='{HInterID}' and HEntryID={HEntryID} "); + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + var HSendQTY = double.Parse(ds.Tables[0].Rows[i]["HSendQTY"].ToString()); + + //淇敼璋冩嫧鏁伴噺 + oCN.RunProc($"update JIT_ComplementGoodsBillSub_LK set HSendQTY=HSendQTY-{(HSendQTY > HQty ? HQty : HSendQTY)} where HInterID={ds.Tables[0].Rows[i]["HInterID"].ToString()} and HEntryID={ds.Tables[0].Rows[i]["HEntryID"].ToString()} "); + + HQty -= HSendQTY; + if (HQty <= 0) + { + break; + } + } + + dataset = oCN.RunProcReturn($"select * from JIT_SendGoodsBillMain a inner join JIT_SendGoodsBillSub b on a.HInterID = b.HInterID where a.HInterID={HInterID} ", "JIT_SendGoodsBillMain"); + + //鍒犻櫎鏁版嵁 + if (dataset.Tables[0].Rows.Count != 1) + { + oCN.RunProc($"delete from JIT_SendGoodsBillSub where HInterID='{HInterID}' and HEntryID={HEntryID} "); + } + else + { + + oCN.RunProc($"delete from JIT_SendGoodsBillMain where HInterID='{HInterID}'"); + oCN.RunProc($"delete from JIT_SendGoodsBillSub where HInterID='{HInterID}' and HEntryID={HEntryID} "); + } + + objJsonResult.code = "1"; objJsonResult.count = 1; -- Gitblit v1.9.1