| | |
| | | #region æäº¤ä¿åï¼å主å表åæç»è¡¨ |
| | | [Route("Sc_QualityReportBill/set_SaveBill")] |
| | | [HttpGet] |
| | | public object set_SaveBill(long HInterID,string HBillNo, string HChecker,string HBadReasonHQty) |
| | | public object set_SaveBill(long HInterID,string HBillNo, string HChecker) |
| | | { |
| | | try |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | //ä¿å |
| | | oCN.RunProc("exec h_p_save_Sc_QualityReportBill " + HInterID+",'"+ HBadReasonHQty +"'"); |
| | | //ä¿å æ¹éä¿åå
çå表æ¯å¦ææ°æ®,ææ°æ®å°±è¿ åå
¥ä¸»è¡¨ æç»è¡¨ 没æå°±åå¨ä¸»åæç»è¡¨ |
| | | string sql = "select * from Sc_QualityReportBillSub where HInterID = '" + HInterID + "'"; |
| | | ds = oCN.RunProcReturn(sql, "Sc_QualityReportBillSub"); |
| | | if (ds.Tables[0].Rows.Count>0) |
| | | { |
| | | oCN.RunProc("exec h_p_save_Sc_QualityReportBillSum " + HInterID + ""); |
| | | } |
| | | else |
| | | { |
| | | oCN.RunProc("exec h_p_save_Sc_QualityReportBill " + HInterID + ""); |
| | | } |
| | | |
| | | //夿æ¯å¦å
许ä¿åï¼ä¸å
许ååæ» |
| | | ds = oCN.RunProcReturn("exec h_p_JIT_ICMOBillQualityStatus_SaveCtrl", "h_p_JIT_ICMOBillQualityStatus_SaveCtrl"); |
| | | if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #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) |
| | | { |
| | | |
| | | i++; |
| | | oSub.HMakeDate = DateTime.Now; |
| | | 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,HBadReasonNumber,HGroupID" + |
| | | ",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() + "" + |
| | | ",'" + oSub.HQty.ToString() + |
| | | "','" + oSub.HResult + "'" + |
| | | "," + oSub.HEmpID.ToString() + "" + |
| | | "," + oSub.HSourceID.ToString() + "" + |
| | | "," + oSub.HBadReasonID.ToString() + "" + |
| | | ",'" + oSub.HBadReasonNumber.ToString() + "'" + |
| | | ",'" + oSub.HGroupID.ToString() + "'" + |
| | | |
| | | "," + oSub.HICMOInterID.ToString() + "" + |
| | | "," + oSub.HICMOEntryID.ToString() + "" + |
| | | ",'" + oSub.HICMOBillNo + "'" + |
| | | "," + oSub.HProcExchInterID + "" + |
| | | "," + oSub.HProcExchEntryID + "" + |
| | | ",'" + oSub.HProcExchBillNo + "'" + |
| | | ",'" + oSub.HBadReasonNumber.ToString() + "'" + |
| | | |
| | | ",'" + 1 + |
| | | "','" + 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 |
| | | |
| | | #region çäº§è´¨éææ±æ¥åå表 æ¥è¯¢ |
| | | public class ReportWorkDemandPlanBill1 |
| | | { |
| | | public string HYear; |
| | | public string HWorkCenter; |
| | | public string HName; |
| | | |
| | | } |
| | | [Route("Sc_QualityReportBill/getSc_QualityReportBillMonth")] |
| | | [HttpGet] |
| | | public object getSc_QualityReportBillMonth(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ReportWorkDemandPlanBill1 Report = JsonConvert.DeserializeObject<ReportWorkDemandPlanBill1>(sWhere); |
| | | ds = oCN.RunProcReturn($"exec h_p_Sc_StationOutBillMonth '{Report.HYear}','{Report.HWorkCenter}','{Report.HName}'", "h_p_Sc_StationOutBillMonth"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |