From 9c60b98594f1e685f4d8f99efb4e84d21b3847f3 Mon Sep 17 00:00:00 2001 From: 仲国强 <519541279@qq.com> Date: 星期五, 15 十月 2021 11:29:55 +0800 Subject: [PATCH] 批量委外接收显示明细 --- WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs | 71 +++++++++++++++++++++++++++++------ 1 files changed, 59 insertions(+), 12 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs index 0020535..3016d45 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs @@ -78,6 +78,8 @@ //閮ㄩ棬鍩虹璧勬枡鍙嶅簭鍒楀寲 msg1 = "[" + msg1.ToString() + "]"; List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg1); + long HMainInterID = 0; + HMainInterID = list[0].HMainInterID; string eventType = list[0].eventType; long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D int HYear = 2021; @@ -240,7 +242,7 @@ ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationOutTime,HSourceID" + ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" + ",HSupID,HTaxRate,HQty,HPrice,HMoney,HPrice_BHS,HMoney_BHS,HBadCount" + - ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HProcNo,HOrderProcNO,HLastSubProc,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID" + + ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HProcNo,HOrderProcNO,HLastSubProc,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID,HMainInterID" + ") " + " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HInnerBillNo + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL + @@ -248,7 +250,7 @@ ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID + "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" + "," + HSupID + "," + HTaxRate + "," + HQty + "," + HPrice + "," + HMoney + "," + HPrice_BHS + "," + HMoney_BHS + "," + HBadCount + - "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + HProcNo + ",'" + HOrderProcNO + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + ",'" + HWWWorkOrderBillNo + "'," + HWWWorkOrderInterID + "," + HWWWorkOrderEntryID + + "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + HProcNo + ",'" + HOrderProcNO + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + ",'" + HWWWorkOrderBillNo + "'," + HWWWorkOrderInterID + "," + HWWWorkOrderEntryID + "," + HMainInterID + ") "); } else if ("Modify".Equals(eventType)) @@ -306,15 +308,15 @@ objJsonResult.data = null; return objJsonResult; } - if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") - { - oCN.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); - objJsonResult.data = null; - return objJsonResult; - } + //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") + //{ + // oCN.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + // objJsonResult.data = null; + // return objJsonResult; + //} oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Out " + HInterID.ToString() + ",1"); oCN.RunProc("exec h_p_WW_EntrustWorkOrderRelationQty_Out " + HInterID.ToString() + ",1"); oCN.Commit(); @@ -823,6 +825,51 @@ } } #endregion - // + + //鎵归噺 + #region 鎵归噺濮斿鎺ユ敹妯″潡杩斿洖鏄庣粏淇℃伅鍒楄〃 + [Route("Cj_StationEntrustOutBill/get_BarCodeDetail")] + [HttpGet] + public object get_BarCodeDetail(string HMainInterID) + { + try + { + ds = oCN.RunProcReturn( + "select a.HBillNo,a.HInterID,a.HQty,a.HProcExchBillNo,a.HICMOBillNo" + + ",b.HNumber HMaterNumber,b.HName HMaterName,b.HModel HMaterModel,c.HName HSourceName,d.HName HGroupName" + + ",e.HName HEmpName,a.HMaker,a.HMakeDate " + + " from Sc_StationOutBillMain a " + + " left join Gy_Material b on a.HMaterID = b.HItemID " + + " left join Gy_Source c on a.HSourceID = c.HItemID " + + " left join Gy_Group d on a.HGroupID = d.HItemID " + + " left join Gy_Employee e on a.HEmpID = e.HItemID " + + " where HMainInterID = " + HMainInterID + " order by a.HMakeDate desc", "Sc_StationOutBillMain"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犺繑鍥炶褰曪紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion } } \ No newline at end of file -- Gitblit v1.9.1