| | |
| | | } |
| | | #endregion |
| | | |
| | | #region æå¼å¡æ«ç è·åä¿¡æ¯ |
| | | [Route("MES_SampleRecordBill_PDA/SampleRecordBillHBarCode_KeyDown")] |
| | | [HttpGet] |
| | | public object SampleRecordBillHBarCode_KeyDown(string HBarCode, string HInterID, string UserID, string HBillType) |
| | | { |
| | | try |
| | | { |
| | | if (HBarCode == null || HBarCode.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "空ç½ç ,æ¡å½¢ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //æåæ¡å½¢ç |
| | | string sBillBarCode = HBarCode.Trim(); |
| | | string[] NewBarCode; |
| | | if (sBillBarCode.CompareTo("#") > 0) |
| | | { |
| | | NewBarCode = sBillBarCode.Split(Convert.ToChar("#")); |
| | | sBillBarCode = NewBarCode[0]; |
| | | } |
| | | string sBillNo = sBillBarCode; //æ¡å½¢ç |
| | | |
| | | string[] arr = sBillNo.Split('&'); //以符å·â&âå岿¡å½¢ç |
| | | string BillNo_PGD = arr[0]; //åæ®å· |
| | | string entryid_PGD = "";//åid |
| | | if (arr.Length > 1) |
| | | { |
| | | entryid_PGD = arr[1]; |
| | | } |
| | | |
| | | |
| | | //æªåæ¡ç ç±»å2 ååä½ |
| | | string BillNoType2 = BillNo_PGD.Substring(0, Math.Min(4, BillNo_PGD.Length)); |
| | | |
| | | switch (BillNoType2) |
| | | { |
| | | case "GXLX"://æµè½¬å¡ |
| | | string sErr = ""; |
| | | if (oSystemParameter.ShowBill(ref sErr)) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "ä¹ä¸") |
| | | { //ç³»ç»åæ°æ¯å¦ä¸ºåªæ¾ç¤ºå½åç»å½ç¨æ·å
³èçå·¥åºä¿¡æ¯,N为å¦ï¼Yä¸ºæ¯ |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList where åæ®å·= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList where åæ®å·= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList"); |
| | | } |
| | | } |
| | | break; |
| | | default: |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¡ç é误!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region è¯æ ·è®°å½æ°å¢ä¿å |
| | | [Route("MES_SampleRecordBill_PDA/SampleRecordAddBill")] |
| | | [HttpPost] |
| | | public object ColorRecordAddBill([FromBody] JObject oMain) |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | try |
| | | { |
| | | //ååºåå |
| | | string msg2 = "[" + sArray[0].ToString() + "]"; |
| | | string user = sArray[1].ToString();//ç¨æ·å |
| | | string OperationType = sArray[2].ToString();//ç±»å |
| | | |
| | | //夿æ¯å¦æç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log("QC_TestSampleCheckBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ç¼è¾æé!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | List<Model.ClsQC_TestSampleCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_TestSampleCheckBillMain>>(msg2); |
| | | string BillType = "7510"; |
| | | string HBillSubType = "7510"; |
| | | string eventType = list[0].eventType; |
| | | long HInterID = list[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = list[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | int HBillStatus = 1; |
| | | string HMaker = user;//å¶å人 |
| | | int HYear = DateTime.Now.Year; |
| | | double HPeriod = DateTime.Now.Month; |
| | | long HSourceID = list[0].HSourceID;//çäº§èµæº |
| | | long HICMOInterID = list[0].HICMOInterID;//ä»»å¡åID |
| | | string HICMOBillNo = list[0].HICMOBillNo;//ä»»å¡å |
| | | string HProcExchBillNo = list[0].HProcExchBillNo;//æå¼å¡ |
| | | long HMaterID = list[0].HMaterID;//产åID |
| | | long HUnitID = list[0].HUnitID;//计éåä½ |
| | | long HProcID = list[0].HProcID;//å·¥åºID |
| | | long HPRDORGID = list[0].HPRDORGID;//ç»ç»ID |
| | | long HLastResult = list[0].HLastResult;//è¯æ ·ç»è®º |
| | | |
| | | //忮宿´æ§å¤æ |
| | | if (HProcExchBillNo =="") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æµè½¬å¡æ²¡æéæ©ï¼è¯·æ«ææ¡å½¢ç æè¾å
¥æ¡å½¢ç åå车"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var num = 0; |
| | | |
| | | oCN.BeginTran(); |
| | | if ("Add".Equals(eventType)) |
| | | { |
| | | num = 1; |
| | | |
| | | ds = oCN.RunProcReturn("select * from QC_TestSampleCheckBillMain where HBillNo='" + HBillNo + "'", "QC_TestSampleCheckBillMain"); |
| | | if (ds.Tables[0].Rows.Count == 1) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("Insert Into QC_TestSampleCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo,HUnitID" + |
| | | ",HPRDORGID,HLastResult)" + |
| | | " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + |
| | | "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'," + HUnitID + |
| | | "," + HPRDORGID + ",'" + HLastResult + "') "); |
| | | } |
| | | else |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æä½ç±»åæ æï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢åæ®æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 对è²è®°å½æ°å¢ä¿å |
| | | [Route("MES_SampleRecordBill_PDA/ColorRecordAddBill")] |
| | | [HttpPost] |
| | | public object SampleRecordAddBill([FromBody] JObject oMain) |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | try |
| | | { |
| | | //ååºåå |
| | | string msg2 = "[" + sArray[0].ToString() + "]"; |
| | | string user = sArray[1].ToString();//ç¨æ·å |
| | | string OperationType = sArray[2].ToString();//ç±»å |
| | | |
| | | //夿æ¯å¦æç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ç¼è¾æé!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | List<Model.ClsQC_FirstPieceCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillMain>>(msg2); |
| | | string BillType = "7505"; |
| | | string HBillSubType = "7505"; |
| | | long HInterID = list[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = list[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | int HBillStatus = 1; |
| | | string HMaker = user;//å¶å人 |
| | | int HYear = DateTime.Now.Year; |
| | | double HPeriod = DateTime.Now.Month; |
| | | long HSourceID = list[0].HSourceID;//çäº§èµæº |
| | | long HICMOInterID = list[0].HICMOInterID;//ä»»å¡åID |
| | | string HICMOBillNo = list[0].HICMOBillNo;//ä»»å¡å |
| | | string HProcExchBillNo = list[0].HProcExchBillNo;//æå¼å¡ |
| | | long HMaterID = list[0].HMaterID;//产åID |
| | | //long HUnitID = list[0].HUnitID;//计éåä½ |
| | | long HProcID = list[0].HProcID;//å·¥åºID |
| | | long HPRDORGID = list[0].HPRDORGID;//ç»ç»ID |
| | | bool HLastResult = list[0].HLastResult;//è¯æ ·ç»è®º |
| | | |
| | | //忮宿´æ§å¤æ |
| | | if (HProcExchBillNo == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æµè½¬å¡æ²¡æéæ©ï¼è¯·æ«ææ¡å½¢ç æè¾å
¥æ¡å½¢ç åå车"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var num = 0; |
| | | |
| | | oCN.BeginTran(); |
| | | if (OperationType=="1") |
| | | { |
| | | num = 1; |
| | | |
| | | ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillMain where HBillNo='" + HBillNo + "'", "QC_FirstPieceCheckBillMain"); |
| | | if (ds.Tables[0].Rows.Count == 1) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("Insert Into QC_FirstPieceCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo" + |
| | | ",HPRDORGID,HLastResult)" + |
| | | " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + |
| | | "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + |
| | | "," + HPRDORGID + ",'" + HLastResult + "') "); |
| | | } |
| | | else |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æä½ç±»åæ æï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢åæ®æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æ ¹æ®ç»å½ç¨æ·è·åå·¥åº |
| | | [Route("Sc_StationInBill/autoGetProcNo")] |
| | | [HttpGet] |