From 9f5f3f3309827ce6ad816482d1a60b8cea29761e Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期一, 01 七月 2024 17:23:14 +0800 Subject: [PATCH] 报工台点击异常跳转获取,物料,代码,数量,规格型号,登录人的上级,不良采集增加批量保存方法 --- WebAPI/Controllers/生产管理/质量汇报单/Sc_QualityReportBillController.cs | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 deletions(-) diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" index 9c85b94..c938585 100644 --- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" +++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" @@ -744,6 +744,104 @@ } #endregion + #region 涓嶈壇閲囬泦鎵归噺姹囨姤 鏂板 + [Route("Sc_QualityReportBill/SaveSc_QualityReportBillSub")] + [HttpPost] + public object SaveSc_QualityReportBillSub([FromBody] JObject msg) + { + var _value = msg["msg"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); //琛ㄥご鏁版嵁 + string msg3 = sArray[1].ToString(); //瀛愯〃1鏁版嵁 + string refSav = sArray[2].ToString(); //鎿嶄綔鏂瑰紡 + string msg4 = sArray[3].ToString(); //鐢ㄦ埛 + + DBUtility.ClsPub.CurUserName = msg4; + ListModels oListModels = new ListModels(); + try + { + DAL.ClsSc_QualityReportBill oBill = new DAL.ClsSc_QualityReportBill(); + //琛ㄤ綋鏁版嵁 + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + + List<Model.ClsSc_QualityReportBillSub> ls = new List<Model.ClsSc_QualityReportBillSub>(); + ls = oListModels.getObjectByJson_Sc_QualityReportBillSub(msg3); + int i = 0; + foreach (Model.ClsSc_QualityReportBillSub oSub in ls) + { + + + oSub.HMakeDate = DateTime.Now; + int qty = Convert.ToInt32(oSub.HQty); + for (int j = 0; j < qty; j++) + { + i++; + oSub.HEntryID = i; + string subSql = "Insert into Sc_QualityReportBillSub " + + " (HInterID,HEntryID,HBillNo_bak,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HUnitID,HQty,HResult,HEmpID,HSourceID,HBadReasonID" + + ",HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchInterID,HProcExchEntryID,HProcExchBillNo" + + ",HBarCode,HReportType" + + ",HAddr,HMaker,HMakeDate" + + ") values(" + + "" + oSub.HInterID.ToString() + "" + + "," + oSub.HEntryID.ToString() + "" + + ",'" + oSub.HBillNo_bak + "'" + + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "" + + "," + oSub.HSourceEntryID.ToString() + "" + + ",'" + oSub.HSourceBillNo + "'" + + ",'" + oSub.HSourceBillType + "'" + + "," + oSub.HRelationQty.ToString() + "" + + "," + oSub.HRelationMoney.ToString() + + + "," + oSub.HMaterID.ToString() + "" + + "," + oSub.HUnitID.ToString() + "" + + ",'" + 1 + + "','" + oSub.HResult + "'" + + "," + oSub.HEmpID.ToString() + "" + + "," + oSub.HSourceID.ToString() + "" + + "," + oSub.HBadReasonID.ToString() + "" + + + "," + oSub.HICMOInterID.ToString() + "" + + "," + oSub.HICMOEntryID.ToString() + "" + + ",'" + oSub.HICMOBillNo + "'" + + "," + oSub.HProcExchInterID + "" + + "," + oSub.HProcExchEntryID + "" + + ",'" + oSub.HProcExchBillNo + "'" + + ",'" + oSub.HBarCode + "'" + + + ",'" + 3 + + "','" + oSub.HAddr + "'" + + ",'" + msg4 + "'" + + ",'" + oSub.HMakeDate.ToShortDateString() + "'" + + ") "; + oCN.RunProc(subSql); + } + + } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + #endregion + -- Gitblit v1.9.1