| | |
| | | { |
| | | omodel.Sc_ProcessExchangeBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]); |
| | | } |
| | | if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ProcessExchangeBill_SaveDeptIsNull") |
| | | { |
| | | omodel.Sc_ProcessExchangeBill_SaveDeptIsNull = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]); |
| | | } |
| | | |
| | | |
| | | ////=========å·¥åºè¿ç«å |
| | |
| | | { |
| | | omodel.Sc_ProcessExchangeBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]); |
| | | } |
| | | |
| | | if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ProcessExchangeBill_SaveDeptIsNull") |
| | | { |
| | | omodel.Sc_ProcessExchangeBill_SaveDeptIsNull = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]); |
| | | } |
| | | |
| | | //-======å·¥åºè¿ç«æ¥æ¶å |
| | | //èªå¨æ°å¢ |
| | |
| | | public string Sc_ProcessExchangeBill_SaveAutoAddnew; //ä¿ååå为æ°å¢ç¶æ |
| | | public string Sc_ProcessExchangeBill_AutoBarCode; //å·¥åºæµè½¬å¡ä¿åèªå¨åæ¥æ¡ç æ¡£æ¡ |
| | | public string Sc_ProcessExchangeBill_DeleterAndMakerMustSame; //å·¥åºæµè½¬å¡å é¤äººå¿
é¡»æ¯å¶å人 |
| | | public string Sc_ProcessExchangeBill_SaveDeptIsNull; //å·¥åºæµè½¬å¡ æ ¹æ®è½¦é´å¤æ åæ®µæ¯å¦ä¸ºç©º |
| | | |
| | | //å·¥åºè¿ç«æ¥æ¶å |
| | | public string MES_StationInBill_AutoCheck; //ä¿å忝å¦èªå¨å®¡æ ¸ |
| | |
| | | double HWasterQty_Mater = list[0].HWasterQty_Mater;//æåºæ°é |
| | | double HBackWorkQty = list[0].HBackWorkQty;//è¿å·¥æ°é |
| | | Int64 HShiftsID = list[0].HShiftsID;//çäº§çæ¬¡ |
| | | double HToCheckQty = list[0].HToCheckQty;//åæ ·æ°é |
| | | double HLossQty = list[0].HLossQty;//é失æ°é |
| | | |
| | | LogService.Write($"1.åæ®µèµå¼ï¼ç¨æ¶" + sw.Elapsed ); |
| | | |
| | |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //夿客æ·ä¸ä¸ºé¾å±±æ±½é
|
| | | if (oSystemParameter.omodel.WMS_CampanyName != "é¾å±±æ±½é
"&& oSystemParameter.omodel.WMS_CampanyName != "çä¸ç¥º") //ç³»ç»åæ° |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "é¾å±±æ±½é
" && oSystemParameter.omodel.WMS_CampanyName != "çä¸ç¥º") //ç³»ç»åæ° |
| | | { |
| | | if (HSourceID == 0) |
| | | { |
| | |
| | | objJsonResult.Message = "çäº§èµæºæ²¡æéæ©ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | //夿客æ·ä¸ºé¾å±±æ±½é
|
| | | else if (oSystemParameter.omodel.WMS_CampanyName == "é¾å±±æ±½é
") |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //夿客æ·ä¸ºæ¯è«å° |
| | | else if (oSystemParameter.omodel.WMS_CampanyName == "æå·æ¯è«å°") |
| | | { |
| | | if (HQty + HWasterQty + HBadCount <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ ¼æ°éå æ¥åºæ°éå ä¸è¯æ°éä¸è½ä¸º0ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else { |
| | | if (HQty + HWasterQty <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ ¼æ°éå æ¥åºæ°éä¸è½ä¸º0ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //if (HCenterID == 0) |
| | |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | if (HQty + HWasterQty <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ ¼æ°éå æ¥åºæ°éä¸è½ä¸º0ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //if (HWorkTimes <= 0) |
| | | //{ |
| | |
| | | ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" + |
| | | ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID" + |
| | | ",HmaterOutqty,HProcPriceRate,HTemporaryAreaID,HWasterQty_Work,HWasterQty_Mater,HBackWorkQty,HShiftsID" + |
| | | ",HToCheckQty,HLossQty" + |
| | | ") " + |
| | | " values('" + BillType + "','" + (OperationType == "5" ? "SUB" : HBillSubType) + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate(),'" + HMouldNum + "'" + |
| | | "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL + |
| | |
| | | "," + 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 + |
| | | ","+ HmaterOutqty + "," + HProcPriceRate + ","+ HTemporaryAreaID + "," + HWasterQty_Work + "," + HWasterQty_Mater + "," + HBackWorkQty + |
| | | "," + HShiftsID + ") "); |
| | | "," + HmaterOutqty + "," + HProcPriceRate + "," + HTemporaryAreaID + "," + HWasterQty_Work + "," + HWasterQty_Mater + "," + HBackWorkQty + |
| | | "," + HShiftsID + "," + HToCheckQty + "," + HLossQty + ") "); |
| | | |
| | | LogService.Write($"4.æ°å¢ç»æï¼ç¨æ¶" + sw.Elapsed); |
| | | LogService.Write("ç¨æ·:" + user + ",æ¥æ:" + DateTime.Now + ",æ°å¢å·¥åºåºç«åæ®:" + HBillNo); |
| | |
| | | ",HWorkTimes=" + HWorkTimes + |
| | | ",HSaveBillFlag=0 " + |
| | | ",HPieceQty=" + HPieceQty + |
| | | ",HToCheckQty=" + HToCheckQty + |
| | | ",HLossQty=" + HLossQty + |
| | | ",HQty=" + HQty + |
| | | ",HDSQty=" + HDSQty + |
| | | ",HChongQty=" + HChongQty + |
| | |
| | | //----------å建è表------------------------ |
| | | DataTable dt_Main = new DataTable("Json"); |
| | | dt_Main.Columns.Add("HBillNo", typeof(string)); |
| | | dt_Main.Columns.Add("HInterID", typeof(int)); |
| | | dt_Main.Columns.Add("HInterID", typeof(Int64)); |
| | | //---------å建æ°è¡------------------------ |
| | | DataRow dr_main = dt_Main.NewRow();//å建æ°è¡ |
| | | dt_Main.Rows.Add(dr_main);//å°æ°è¡å å
¥å°è¡¨ä¸ |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select b.HItemID,b.HNumber,b.HName from Gy_DotCheck a left join gy_DotCheckItemClass b on a.HDotCheckItemClassID=b.HItemID", "Gy_DotCheck"); |
| | | ds = oCN.RunProcReturn("select HItemID,HNumber,HName from gy_DotCheckItemClass", "gy_DotCheckItemClass"); |
| | | |
| | | List<TreeModel> treeModels = new List<TreeModel>(); |
| | | TreeModel first = new TreeModel(); |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("select * from Gy_BarCodeBill where HBarcode='" + HBarCode + "'", "Gy_BarCodeBill"); |
| | | if (ds.Tables[0].Rows.Count == 0) { |
| | | DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View(); |
| | | string sErrMsg = ""; |
| | | oSystemParameter.ShowBill(ref sErrMsg); |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "æå·æ¯è«å°") |
| | | { |
| | | if (!dal.GetInfoByNumber(HBarCode)) |
| | | { |
| | | //æ¡ç è§£æ |
| | | string[] str = HBarCode.Split('@'); |
| | | |
| | | if (str[0] != "CMR" && str[0] != "SRM") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¡ç è§£æå¤±è´¥,请确认æ¡ç æ¯å¦æ£ç¡®!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | int HOrgIDs = 0; |
| | | //æ¥è¯¢ç»ç» |
| | | DataSet ds = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS where HNumber='" + str[1] + "' ", "Xt_ORGANIZATIONS"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¡ç è§£æå¤±è´¥,请确认æ¡ç ç»ç»æ¯å¦æ£ç¡®!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | HOrgIDs = int.Parse(ds.Tables[0].Rows[0]["HItemID"].ToString()); |
| | | } |
| | | |
| | | string HMaterNames = ""; |
| | | string HMaterModels = ""; |
| | | string HMaterIDs = "0"; |
| | | //æ¥è¯¢ç©æ |
| | | ds = oCn.RunProcReturn("select * from Gy_Material where HNumber='" + str[4] + "' and HUSEORGID=" + HOrgIDs, "Gy_Material"); |
| | | |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¡ç è§£æå¤±è´¥,请确认æ¡ç ç©ææ¯å¦æ£ç¡®!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | HMaterIDs = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | HMaterNames = ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | HMaterModels = ds.Tables[0].Rows[0]["HModel"].ToString(); |
| | | |
| | | } |
| | | string HSupIDs = "0"; |
| | | //æ¥è¯¢ä¾åºå |
| | | ds = oCn.RunProcReturn("select * from Gy_Supplier where HNumber='" + str[2] + "' and HUSEORGID=" + HOrgIDs, "Gy_Supplier"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | //sErrMsg = "æ¡ç è§£æå¤±è´¥,请确认æ¡ç ä¾åºåæ¯å¦æ£ç¡®!"; |
| | | //return null; |
| | | } |
| | | else |
| | | { |
| | | HSupIDs = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | |
| | | string HSourceInterIDs = "0"; |
| | | string HSourceEntryIDs = "0"; |
| | | string HSourceBillNos = "0"; |
| | | string HUnitIDs = "0"; |
| | | //æ¥è¯¢éè´è®¢å |
| | | ds = oCn.RunProcReturn(@"select a.HInterID,b.HEntryID,a.HBillNo,b.HUnitID from Cg_POOrderBillMain a |
| | | inner join Cg_POOrderBillSub b on a.HInterID = b.HInterID where HBillNo='" + str[3] + "' and b.HMaterID=" + HMaterIDs, "Cg_POOrderBillMain"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | //sErrMsg = "æ¡ç è§£æå¤±è´¥,请确认æ¡ç éè´è®¢åæ¯å¦æ£ç¡®!"; |
| | | //return null; |
| | | } |
| | | else |
| | | { |
| | | HSourceInterIDs = ds.Tables[0].Rows[0]["HInterID"].ToString(); |
| | | HSourceEntryIDs = ds.Tables[0].Rows[0]["HEntryID"].ToString(); |
| | | HSourceBillNos = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | HUnitIDs = ds.Tables[0].Rows[0]["HUnitID"].ToString(); |
| | | } |
| | | |
| | | string HInnerBillNos = ""; |
| | | //æ¥è¯¢å
é¨éè´è®¢åå· |
| | | ds = oCn.RunProcReturn(@" select * from h_v_IF_POInStockList where éè´è®¢åå·= '" + str[3] + "' ", "h_v_IF_POInStockList"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | //sErrMsg = "æ¡ç è§£æå¤±è´¥,请确认æ¡ç å
é¨éè´è®¢åå·æ¯å¦æ£ç¡®!"; |
| | | //return null; |
| | | HInnerBillNos = str[3]; |
| | | } |
| | | else |
| | | { |
| | | HInnerBillNos = ds.Tables[0].Rows[0]["å
é¨éè´è®¢åå·"].ToString(); |
| | | } |
| | | double HQty = double.Parse(str[6]); |
| | | |
| | | //æ¥æè·åæ¹å¼ |
| | | string sDate = DateTime.Now.ToString(); |
| | | string HWei = "0"; //å°¾æ° |
| | | string HBarCodeType = "æ¹æ¬¡æ¡ç "; |
| | | Int64 HMaterID = int.Parse(HMaterIDs); |
| | | Int64 HAuxPropID = 0; |
| | | Int64 HUnitID = int.Parse(HUnitIDs); |
| | | double HQty2 = HQty; |
| | | string HBatchNo2 = str[5]; |
| | | Int64 HSupID = int.Parse(HSupIDs); |
| | | Int64 HGroupID = 0; |
| | | int HPrintQty = 0; |
| | | Int64 HSourceInterID = int.Parse(HSourceInterIDs); |
| | | Int64 HSourceEntryID = int.Parse(HSourceEntryIDs); |
| | | string HSourceBillNo = HSourceBillNos; |
| | | //HSourceBillType = "1102"; |
| | | Int64 HBarcodeNo = 0; //æå· |
| | | Int64 HBarcodeQtys = 0; //æ»ææ° |
| | | Int64 HDeptID = 0; |
| | | //Int64 HWhID = 0; |
| | | //Int64 HSPID = 0; |
| | | string HRemark = "æ¡ç è§£æ"; |
| | | string HMaterName = HMaterNames; |
| | | string HMaterModel = HMaterModels; |
| | | string HPinfan = ""; |
| | | string HMTONo = ""; |
| | | Int64 HCusID = 0; |
| | | string HCusType = ""; |
| | | DateTime HEndDate = DateTime.Now; |
| | | string HWorkLineName = ""; |
| | | string HSeOrderBillNo = ""; |
| | | string HInnerBillNo = HInnerBillNos; |
| | | bool HGiveAwayFlag = false; |
| | | Int64 HEntryID = 1; |
| | | Int64 HInterIDs = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | int HOrgID = HOrgIDs; |
| | | string HSourceBillType = ""; |
| | | |
| | | |
| | | oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" + |
| | | ",HProduceDate,HExpiryDate " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | | + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString() |
| | | + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'" |
| | | + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + ",0,0,'" + HRemark + "'" |
| | | + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'" |
| | | + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterIDs.ToString() + "," + HEntryID.ToString() + "" |
| | | + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "','','')"); |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_MaterToSource " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "','" + HMaker + "'", "h_p_WMS_AddBarCode_MaterToSource"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | public double HWasterQty_Work { get; set; } |
| | | public double HWasterQty_Mater { get; set; } |
| | | public double HBackWorkQty { get; set; } |
| | | public double HToCheckQty { get; set; } |
| | | public double HLossQty { get; set; } |
| | | public Int64 HShiftsID { get; set; } |
| | | } |
| | | } |