| | |
| | | public class Sc_QualityReportBillController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | private json objJsonResult = new json(); |
| | | private json objJsonResultReturn = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | DataSet ds; |
| | | |
| | | #region è¿åçäº§è´¨éæ±æ¥åå表 |
| | |
| | | { |
| | | ds = oCN.RunProcReturn |
| | | ("select a.HInterID,a.HBillType,a.HICMOBillNo,a.HICMOInterID,a.HMaterID" + |
| | | ",m.HNumber HMaterNumber,m.HName HMaterName,m.HModel HMaterModel " + |
| | | ",m.HNumber HMaterNumber,m.HName HMaterName,m.HModel HMaterModel,a.HICMOEntryID " + |
| | | " from Sc_ICMOBillStatus_Tmp a " + |
| | | " left join Gy_Material m on a.HMaterID=m.HItemID " + |
| | | " Where a.HInterID=" + HInterID + " and a.HBillType="+ HBillType, "Sc_ICMOBillStatus_Tmp"); |
| | |
| | | { |
| | | var msg1 = oMain["oMain"].ToString(); |
| | | //ä¿ååæ® |
| | | return objJsonResult = AddBillMain(msg1); |
| | | return objJsonResult = AddBillTmp(msg1); |
| | | } |
| | | |
| | | public json AddBillMain(string msg1) |
| | | public json AddBillTmp(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg = sArray[0].ToString(); |
| | | string OperationType = sArray[1].ToString().Trim(); |
| | | bool bResult; |
| | | bool bResult = false; |
| | | try |
| | | { |
| | | msg = "[" + msg.ToString() + "]"; |
| | | List<Model.ClsSc_ICMOBillQualityStatus_Tmp> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_ICMOBillQualityStatus_Tmp>>(msg); |
| | | DAL.ClsQC_FirstPieceCheckBill BillNew = new DAL.ClsQC_FirstPieceCheckBill(); |
| | | List<Sc_ICMOBillQualityStatus_Tmp> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Sc_ICMOBillQualityStatus_Tmp>>(msg); |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | BillNew.omodel.HYear = sYear; |
| | | BillNew.omodel.HPeriod = sPeriod; |
| | | //åºå®èµå¼================================= |
| | | BillNew.omodel.HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | //BillNew.omodel.HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | //BillNew.omodel.HDate = HDate; |
| | | //BillNew.omodel.HRemark = mainList[0].HRemark;//夿³¨ |
| | | //BillNew.omodel.HMaker = mainList[0].HMaker; |
| | | //BillNew.omodel.HSourceID = ClsPub.isLong(mainList[0].HSourceID); |
| | | //BillNew.omodel.HICMOInterID = ClsPub.isLong(mainList[0].HICMOInterID); |
| | | //BillNew.omodel.HICMOBillNo = ClsPub.isStrNull(mainList[0].HICMOBillNo); |
| | | //BillNew.omodel.HICMOInterID = ClsPub.isLong(mainList[0].HICMOInterID); |
| | | //BillNew.omodel.HICMOQty = ClsPub.isLong(mainList[0].HICMOQty); |
| | | //BillNew.omodel.HProcExchInterID = ClsPub.isLong(mainList[0].HProcExchInterID); |
| | | //BillNew.omodel.HProcExchEntryID = ClsPub.isLong(mainList[0].HProcExchEntryID); |
| | | //BillNew.omodel.HProcExchBillNo = ClsPub.isStrNull(mainList[0].HProcExchBillNo); |
| | | //BillNew.omodel.HProcExchQty = ClsPub.isLong(mainList[0].HProcExchQty); |
| | | //BillNew.omodel.HMaterID = ClsPub.isLong(mainList[0].HMaterID); |
| | | //BillNew.omodel.HFirstCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp); |
| | | //BillNew.omodel.HLastResult = ClsPub.isBool(mainList[0].HLastResult); |
| | | //BillNew.omodel.HMainSourceInterID = ClsPub.isLong(mainList[0].HMainSourceInterID); |
| | | //BillNew.omodel.HMainSourceEntryID = ClsPub.isLong(mainList[0].HMainSourceEntryID); |
| | | //BillNew.omodel.HMainSourceBillNo = ClsPub.isStrNull(mainList[0].HMainSourceBillNo); |
| | | //BillNew.omodel.HMainSourceBillType = ClsPub.isStrNull(mainList[0].HMainSourceBillType); |
| | | BillNew.omodel.HBillStatus = 1; |
| | | //ä¿å宿¯åå¤ç |
| | | if (OperationType.Equals("1") || OperationType.Equals("2")) |
| | | { |
| | | bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo); |
| | | //æ¯å¦ä¿å |
| | | bResult = AddBillTmpSQL(mainList, ref ClsPub.sExeReturnInfo); |
| | | } |
| | | else if (OperationType.Equals("3")) |
| | | { |
| | | bResult = BillNew.ModifyBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo); |
| | | //bResult = BillNew.ModifyBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | ClsPub.sExeReturnInfo = "æ æçæä½ç±»åï¼"; |
| | | bResult = false; |
| | | } |
| | | //æç¤º |
| | | //æ¯å¦ä¿å |
| | | if (bResult == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | //objJsonResult.Message = "åæ®åç宿¯!åæ®å·:" + mainList[0].HBillNo.Trim(); |
| | | objJsonResult.Message = ClsPub.sExeReturnInfo + "åæ®å·:" ; |
| | | objJsonResult.Message = "æ«ç ä¿åæåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //æ°å¢åæ® |
| | | public bool AddBillTmpSQL(List<Sc_ICMOBillQualityStatus_Tmp> mainList, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | Sc_ICMOBillQualityStatus_Tmp BillNew = new Sc_ICMOBillQualityStatus_Tmp(); |
| | | //åºå®èµå¼================================= |
| | | BillNew.HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | BillNew.HBillNo = mainList[0].HBillNo; |
| | | BillNew.HBillType = mainList[0].HBillType; |
| | | BillNew.HDate = mainList[0].HDate; |
| | | BillNew.HICMOBillNo = mainList[0].HICMOBillNo; |
| | | BillNew.HICMOInterID = mainList[0].HICMOInterID; |
| | | BillNew.HICMOEntryID = mainList[0].HICMOEntryID; |
| | | BillNew.HProcExchBillNo = mainList[0].HProcExchBillNo; |
| | | BillNew.HProcExchInterID = mainList[0].HProcExchInterID; |
| | | BillNew.HProcExchEntryID = mainList[0].HProcExchEntryID; |
| | | BillNew.HProcID = mainList[0].HProcID; |
| | | BillNew.HMaterID = mainList[0].HMaterID; |
| | | BillNew.HSourceID = mainList[0].HSourceID; |
| | | BillNew.HGroupID = mainList[0].HGroupID; |
| | | BillNew.HCheckManID = mainList[0].HCheckManID; |
| | | BillNew.HBadReasonID = mainList[0].HBadReasonID; |
| | | BillNew.HBarCode = mainList[0].HBarCode; |
| | | BillNew.HMaker = mainList[0].HMaker; |
| | | BillNew.HMakeDate = mainList[0].HMakeDate; |
| | | BillNew.HReportType = mainList[0].HReportType; |
| | | BillNew.HSourceBillNo = mainList[0].HICMOBillNo; |
| | | BillNew.HSourceInterID = mainList[0].HICMOInterID; |
| | | BillNew.HSourceBillType = mainList[0].HSourceBillType; |
| | | oCN.BeginTran(); |
| | | //临æ¶è¡¨ |
| | | oCN.RunProc("Insert Into Sc_ICMOBillQualityStatus_Tmp " + |
| | | " (HInterID,HBillNo,HDate,HICMOBillNo,HICMOInterID" + |
| | | ",HProcExchBillNo,HProcExchInterID,HProcExchEntryID,HProcID,HMaterID" + |
| | | ",HSourceID,HGroupID,HCheckManID,HBadReasonID,HBarCode" + |
| | | ",HMaker,HMakeDate,HBillType,HReportType,HSourceBillNo" + |
| | | ",HSourceInterID,HSourceBillType,HICMOEntryID,HSourceEntryID" + |
| | | ") " + |
| | | " values(" + BillNew.HInterID + ",'" + BillNew.HBillNo + "','" + BillNew.HDate + "','" + BillNew.HICMOBillNo + "'," + BillNew.HICMOInterID + |
| | | ",'" + BillNew.HProcExchBillNo + "'," + BillNew.HProcExchInterID + "," + BillNew.HProcExchEntryID + "," + BillNew.HProcID + "," + BillNew.HMaterID + |
| | | "," + BillNew.HSourceID + "," + BillNew.HGroupID + "," + BillNew.HCheckManID + "," + BillNew.HBadReasonID + ",'" + BillNew.HBarCode + "'" + |
| | | ",'" + BillNew.HMaker + "','" + BillNew.HMakeDate + "','" + BillNew.HBillType + "','" + +BillNew.HReportType + "','" +BillNew.HSourceBillNo + "'" + |
| | | "," + BillNew.HSourceInterID + ",'" + BillNew.HSourceBillType + "'," + BillNew.HICMOEntryID + "," + BillNew.HICMOEntryID + |
| | | ") "); |
| | | sReturn = "æ«ç æåï¼"; |
| | | oCN.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCN.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region è´¨éæ±æ¥åå表å é¤æé® |
| | | [Route("DeltetSc_QualityReportBill")] |
| | | [HttpGet] |
| | | public object DeltetSc_QualityReportBill(long HItemID) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | try |
| | | { |
| | | //å 餿é |
| | | //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (HItemID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HItemID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from Sc_QualityReportBillMain where hmainid=" + HItemID, "Sc_QualityReportBillMain"); |
| | | ds1 = oCN.RunProcReturn("select * from Sc_QualityReportBillSub where hmainid=" + HItemID, "Sc_QualityReportBillSub"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | //if (HStopflag) |
| | | //{ |
| | | // oCN.RollBack();//åæ»äºå¡ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ°æ®å·²å 餿 æ³å次å é¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //ds1 = oCN.RunProcReturn("Select HItemID from Sc_QualityReportBill Where HParentID='" + HItemID + "'", "Sc_QualityReportBill"); |
| | | //if (ds1.Tables[0].Rows.Count != 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ¤é¡¹ç®åå¨å项ç®ï¼ä¸è½å é¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]); |
| | | if (HUseFlag == "已使ç¨") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤é¡¹ç®å·²ä½¿ç¨ï¼ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("delete from Sc_QualityReportBillMain where hmainid=" + HItemID); |
| | | oCN.RunProc("delete from Sc_QualityReportBillSub where hmainid=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region è´¨éæ±æ¥åæ«ä¸è¯æ¡ç è·åä¸è¯åå id |
| | | [Route("Sc_QualityReportBill/get_HBadReasonID")] |
| | | [HttpGet] |
| | | public object get_HBadReasonID(string HBadReasonNumber) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HNumber from Gy_BadReason where HStopflag=0 and HNumber='" + HBadReasonNumber + "'", "Gy_BadReason"); |
| | | 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 = "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 å®¡æ ¸ |
| | | public object set_CheckBill(long HInterID,string HChecker, ref string sReturn) |
| | | { |
| | | SQLHelper.ClsCN oCN1 = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | oCN1.BeginTran(); |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Check", 1, true, HChecker)) |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¨æ²¡ææé,请ä¸ç®¡çåèç³»ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | // |
| | | if (HInterID == 0) |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ID为0ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DAL.ClsSc_QualityReportBill oBill = new DAL.ClsSc_QualityReportBill(); |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸ï¼ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³éï¼ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åºï¼ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å®¡æ ¸ |
| | | if (CheckBill(HInterID, HChecker, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | oCN1.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼åå :" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //å®¡æ ¸SQL |
| | | public bool CheckBill(Int64 HInterID,string HChecker, ref string sReturn) |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCN.RunProc(" Update Sc_QualityReportBillMain set HChecker='" + HChecker + "',HCheckDate=GETDATE() Where HInterID=" + HInterID.ToString()); |
| | | sReturn = ""; |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | throw (e); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region è·åæ«ç æ«æè®°å½ |
| | | [Route("Sc_QualityReportBill/get_BarCodeDetail")] |
| | | [HttpGet] |
| | | public object get_BarCodeDetail(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn( |
| | | "Select a.HItemID,a.HInterID,b.HNumber HBadReasonNumber,b.HName HBadReasonHName" + |
| | | ",c.HName HCheckMan,d.HName HGroupName,e.HName HSourceName " + |
| | | " from Sc_ICMOBillQualityStatus_Tmp a " + |
| | | " left join Gy_BadReason b on a.HBadReasonID = b.HItemID " + |
| | | " left join Gy_Employee c on a.HCheckManID = c.HItemID " + |
| | | " left join Gy_Group d on a.HGroupID = d.HItemID " + |
| | | " left join Gy_Source e on a.HSourceID = e.HItemID " + |
| | | " where HInterID=" + HInterID, "Sc_ICMOBillQualityStatus_Tmp" |
| | | ); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | 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("Sc_QualityReportBill/get_BarCodeDetailSum")] |
| | | [HttpGet] |
| | | public object get_BarCodeDetailSum(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn( |
| | | "Select count(*) HQty,a.HInterID,b.HNumber HBadReasonNumber,b.HName HBadReasonHName,c.HName HCheckMan" + |
| | | ",d.HName HGroupName,e.HName HSourceName " + |
| | | " from Sc_ICMOBillQualityStatus_Tmp a " + |
| | | " left join Gy_BadReason b on a.HBadReasonID = b.HItemID " + |
| | | " left join Gy_Employee c on a.HCheckManID = c.HItemID " + |
| | | " left join Gy_Group d on a.HGroupID = d.HItemID " + |
| | | " left join Gy_Source e on a.HSourceID = e.HItemID " + |
| | | " where a.HInterID=" + HInterID + |
| | | " group by a.HInterID,a.HBadReasonID,a.HCheckManID,a.HGroupID,a.HSourceID" + |
| | | " ,b.HNumber,b.HName,c.HName,d.HName,e.HName", "Sc_ICMOBillQualityStatus_Tmp" |
| | | ); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | 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("Sc_QualityReportBill/del_BarCodeDetail")] |
| | | [HttpGet] |
| | | public object del_BarCodeDetail(long HItemID) |
| | | { |
| | | try |
| | | { |
| | | oCN.RunProc("delete from Sc_ICMOBillQualityStatus_Tmp where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æäº¤ä¿åï¼å主å表åæç»è¡¨ |
| | | [Route("Sc_QualityReportBill/set_SaveBill")] |
| | | [HttpGet] |
| | | public object set_SaveBill(long HInterID,string HChecker) |
| | | { |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | bool bResult2 = false; |
| | | oCN.BeginTran(); |
| | | //ä¿å |
| | | 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") |
| | | { |
| | | 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.Commit(); |
| | | //è·åèªå¨å®¡æ ¸åæ° |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | | if (oSystemParameter.omodel.Sc_ICMOBillQualityStatus_AutoCheck == "Y") //ç³»ç»åæ° èªå¨å®¡æ ¸ |
| | | { |
| | | //å®¡æ ¸ |
| | | objJsonResultReturn = (json)set_CheckBill(HInterID, HChecker, ref ClsPub.sExeReturnInfo); |
| | | if (objJsonResultReturn.code == "1") |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®åç宿¯ï¼å®¡æ ¸æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®åç宿¯ï¼èªå¨å®¡æ ¸å¤±è´¥ï¼åå ï¼" + objJsonResultReturn.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®åç宿¯ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®åç宿¯ï¼è·åèªå¨å®¡æ ¸åæ°å¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |