| | |
| | | long HMaterID = listSub[i].HMaterID;//产品ID |
| | | long HProcID = listSub[i].HProcID;//当前工序ID |
| | | double HICMOQty = listSub[i].HICMOQty;//任务单数量 |
| | | double HPlanQty = list[0].HPlanQty;//移交PNL数 |
| | | double HPlanQty = listSub[i].HPlanQty;//移交PNL数 |
| | | DateTime HStationOutTime = list[0].HStationOutTime;//汇报时间 |
| | | long HSourceID = listSub[i].HSourceID;//生产资源ID |
| | | long HPayProcID = list[0].HPayProcID;//核算工序ID |
| | |
| | | string HProcNo = listSub[i].HProcNo;//流水号 |
| | | string HOrderProcNO = list[0].HOrderProcNO;//订单跟踪号 |
| | | string HSourceNameList = list[0].HSourceNameList;//设备清单 |
| | | long HMainSourceInterID = list[0].HInterID;//递入type得到的单据ID |
| | | string HMainSourceBillNo = list[0].HBillNo;//递入type得到的单据号 |
| | | long HMainSourceInterID = listSub[0].HMainSourceInterID;//递入type得到的单据ID |
| | | long HMainSourceEntryID = listSub[0].HMainSourceEntryID;//递入type得到的单据子ID |
| | | string HMainSourceBillNo = listSub[0].HMainSourceBillNo;//递入type得到的单据号 |
| | | string HMainSourceBillType = "3790"; |
| | | bool HLastSubProc = list[0].HLastSubProc;//转下工序 |
| | | bool HLastSubProc = listSub[0].HLastSubProc;//转下工序 |
| | | long HEmpID2 = list[0].HEmpID2;//操作员2ID |
| | | long HEmpID3 = list[0].HEmpID3;//操作员3ID |
| | | long HEmpID4 = list[0].HEmpID4;//操作员4ID |
| | |
| | | ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate,HSourceID2,HSourceID3,HSourceID4,HSourceID5" + |
| | | ",HSupID,HQty,HPrice,HMoney,HBadCount,HCenterID,HProcNo,HOrderProcNO,HSourceNameList" + |
| | | ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" + |
| | | ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID" + |
| | | ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID,HMainSourceEntryID" + |
| | | ") " + |
| | | " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate(),'" + HMouldNum + "'" + |
| | | "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL + |
| | |
| | | "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" + "," + HSourceID2 + "," + HSourceID3 + "," + HSourceID4 + "," + HSourceID5 + |
| | | "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HBadCount + "," + HCenterID + "," + HProcNo + ",'" + HOrderProcNO + "'" + ",'" + HSourceNameList + "'" + |
| | | "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + |
| | | "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID + |
| | | "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID + "," + HMainSourceEntryID + |
| | | ") "); |
| | | } |
| | | else |
| | |
| | | } |
| | | } |
| | | |
| | | if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | //删除前控制========================================= |
| | | string HBillNo = oBill.omodel.HBillNo; |
| | | string sql1 = "exec h_p_Sc_StationOutBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + HDeleteMan + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationOutBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, HBillNo, "h_p_Sc_StationOutBill_AfterDelCtrl", HDeleteMan, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | |
| | | |
| | | var HBillNo = HInterID.Split(','); |
| | | var HInterIDs = HInterID.Split(','); |
| | | string[] HBillNo = new string[HInterIDs.Length]; |
| | | DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill(); |
| | | |
| | | for (int i = 0; i < HBillNo.Length; i++) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | if (HBillNo[i] == "0") |
| | | if (HInterIDs[i] == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | //查看是否已审核,关闭,作废 |
| | | if (oBill.ShowBill(long.Parse(HBillNo[i]), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (oBill.ShowBill(long.Parse(HInterIDs[i]), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | HBillNo[i] = oBill.omodel.HBillNo; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | int j = 0; |
| | | for (int i = 0; i < HBillNo.Length; i++) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | //审核前控制 |
| | | string sql = "exec h_p_Sc_StationOutBill_BeforeCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //审核 |
| | | if (Cj_StationOutBillCheckBill(long.Parse(HBillNo[i]), CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (Cj_StationOutBillCheckBill(long.Parse(HInterIDs[i]), HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | j += 1; |
| | | } |
| | |
| | | } |
| | | |
| | | //审核 |
| | | public bool Cj_StationOutBillCheckBill(Int64 lngBillKey, string CurUserName,bool HLastSubProc, ref string sReturn) |
| | | public bool Cj_StationOutBillCheckBill(Int64 lngBillKey, string HBillNo, string CurUserName,bool HLastSubProc, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | |
| | | else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "是") |
| | | { |
| | | } |
| | | |
| | | //审核后控制 |
| | | string sql = "exec h_p_Sc_StationOutBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_AfterCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "审核过程中出错,请与网络管理人员联系"; |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | |
| | | sReturn = sReturn + " 审核功能!"; |
| | | oCN.Commit(); |
| | | return true; |
| | |
| | | } |
| | | |
| | | |
| | | var HBillNo = HInterID.Split(','); |
| | | var HInterIDs = HInterID.Split(','); |
| | | string[] HBillNo = new string[HInterIDs.Length]; |
| | | DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill(); |
| | | |
| | | //获取系统参数 |
| | | string Ret = ""; |
| | | oSystemParameter.ShowBill(ref Ret); |
| | | |
| | | for (int i = 0; i < HBillNo.Length; i++) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | if (long.Parse(HBillNo[i]) == 0) |
| | | if (long.Parse(HInterIDs[i]) == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | |
| | | //查看是否已审核,关闭,作废 |
| | | if (oBill.ShowBill(long.Parse(HBillNo[i]), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (oBill.ShowBill(long.Parse(HInterIDs[i]), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | HBillNo[i] = oBill.omodel.HBillNo; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | int j = 0; |
| | | for (int i = 0; i < HBillNo.Length; i++) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | //反审核前控制 |
| | | string sql = "exec h_p_Sc_StationOutBill_BeforeUnCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeUnCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //反审核 |
| | | if (Cj_StationOutBillAbandonCheckBill(long.Parse(HBillNo[i]), CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (Cj_StationOutBillAbandonCheckBill(long.Parse(HInterIDs[i]),HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | j += 1; |
| | | } |
| | |
| | | } |
| | | |
| | | //反审核 |
| | | public bool Cj_StationOutBillAbandonCheckBill(Int64 lngBillKey, string CurUserName, bool HLastSubProc, ref string sReturn) |
| | | public bool Cj_StationOutBillAbandonCheckBill(Int64 lngBillKey,string HBillNo, string CurUserName, bool HLastSubProc, ref string sReturn) |
| | | { |
| | | if (Cj_StationInBillisUse(lngBillKey, ref sReturn)) |
| | | { |
| | |
| | | else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "是") |
| | | { |
| | | } |
| | | |
| | | //反审核后控制 |
| | | string sql = "exec h_p_Sc_StationOutBill_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_AfterUnCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "反审核过程中出错,请与网络管理人员联系"; |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | |
| | | sReturn = sReturn + "反审核功能!"; |
| | | oCN.Commit(); |
| | | return true; |