| | |
| | | sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2); |
| | | string sDay = "0" + ClsPub.isDate(sDate).Day.ToString(); |
| | | sDay = sDay.Substring(sDay.Length - 2, 2); |
| | | string sTMNumber ="ZX"+ sYear + sPeriod + sDay; |
| | | string sTMNumber = "ZX" + sYear + sPeriod + sDay; |
| | | ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | int LSH = ClsPub.isInt(ds.Tables[0].Rows[0][0])+1; //æµæ°´å·å 1 |
| | | int LSH = ClsPub.isInt(ds.Tables[0].Rows[0][0]) + 1; //æµæ°´å·å 1 |
| | | string TM = sTMNumber + LSH; |
| | | jsn.packagebarcode = TM; |
| | | oCN.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | |
| | | } |
| | | objJsonResult.status = 0; |
| | | objJsonResult.msg = "æ¥è¯¢æ°æ®æåï¼"; |
| | | objJsonResult.data =objJsonResult.data; |
| | | objJsonResult.data = objJsonResult.data; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.status =-1; |
| | | LogService.Write("é误ï¼" + e.Message.ToString()); |
| | | objJsonResult.status = -1; |
| | | objJsonResult.msg = "çæç®±æ¡ç 失败ï¼"; |
| | | objJsonResult.data =null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | ScanLineCode list = js.Deserialize<ScanLineCode>(msg.ToString()); //å°jsonæ°æ®è½¬å为对象类åå¹¶èµå¼ç»list |
| | | if (list.billno != "" && list.billno != null) //ä»»å¡åå·ï¼éå¿
é¡»ï¼éç©ºåæ ¡éªbarcodesébarcodeæ¯å¦ç±æ¤ä»»å¡åå¶ä½çæç |
| | | { |
| | | ds = oCN.RunProcReturn("Select HBarCode barcode,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim()+"' Order by HItemID ", "Gy_BarCodeBill"); |
| | | ds = oCN.RunProcReturn("Select HBarCode barcode,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim() + "' Order by HItemID ", "Gy_BarCodeBill"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.status = -1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | List<string> NameList = (from r in ds.Tables[0].AsEnumerable() select r.Field<string>("barcode")).ToList(); |
| | | List<string> NameList1= list.barcodes.Select(t => t.barcode).ToList(); |
| | | List<string> NameList1 = list.barcodes.Select(t => t.barcode).ToList(); |
| | | var strList = NameList1.Except(NameList).ToList(); //夿æäº¤æ°æ®ä¸æ¡ç æ¯å¦åå¨äºè®¢åä¸ |
| | | if (strList.Count > 0) |
| | | if (strList.Count > 0) |
| | | { |
| | | string Str=String.Join(",", strList.ToArray()); |
| | | string Str = String.Join(",", strList.ToArray()); |
| | | objJsonResult.status = -1; |
| | | objJsonResult.msg = "æ¡ç :"+ Str.ToString()+" ä¸å
å«å¨è®¢å:"+list.billno+"ä¸!"; |
| | | objJsonResult.msg = "æ¡ç :" + Str.ToString() + " ä¸å
å«å¨è®¢å:" + list.billno + "ä¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | DLL.ClsSc_PackUnionBill oBill = new DLL.ClsSc_PackUnionBill(); |
| | | //å¤æç®±ç æ¯å¦åå¨ |
| | | bool IsBarCodePack = oBill.IsBarCodePack(list.packagebarcode); |
| | | if (IsBarCodePack == false) |
| | | if (IsBarCodePack == false) |
| | | { |
| | | objJsonResult.status = -1; |
| | | objJsonResult.msg = "ç®±ç å·²åå¨,ä¸è½éå¤ç»å®ï¼"; |
| | |
| | | oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | oItem.HBillType = "3783"; |
| | | oItem.HBillSubType = "3783"; |
| | | oItem.HDate= DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | oItem.HDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | oItem.HBillNo = DBUtility.ClsPub.CreateBillCode(oItem.HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | oItem.HBillStatus = 1; |
| | | oItem.HCheckItemNowID = 0; |
| | |
| | | oItem.HDeleteDate = ""; |
| | | oItem.HICMOInterID = 0; |
| | | oItem.HICMOBillNo = ""; |
| | | oItem.HBarCode_Pack= list.packagebarcode; |
| | | oItem.HBarCode_Pack = list.packagebarcode; |
| | | oItem.HMaterID = 0; |
| | | oItem.HUnitID = 0; |
| | | oItem.HUseFlag =false; //ææç¶æ |
| | | oItem.HUseFlag = false; //ææç¶æ |
| | | oBill.omodel = oItem; |
| | | for (int i = 0; i < list.barcodes.Count; i++) |
| | | { |
| | |
| | | } |
| | | Models.ClsSc_PackUnionBillSub oItemSub = new ClsSc_PackUnionBillSub(); |
| | | ds0 = oCN.RunProcReturn("Select HBarCode,HMaterID,HUnitID,HQty,HSourceID,HGroupID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim() + "' and HBarCode='" + list.barcodes[i].barcode + "' Order by HItemID ", "Gy_BarCodeBill"); |
| | | oItemSub.HEntryID = i+1; |
| | | oItemSub.HEntryID = i + 1; |
| | | oItemSub.HMaterID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HMaterID"].ToString()); |
| | | oItemSub.HUnitID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HUnitID"].ToString()); |
| | | oItemSub.HQty = DBUtility.ClsPub.isDoule(ds0.Tables[0].Rows[0]["HQty"].ToString()); |
| | | oItemSub.HSourceID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HSourceID"].ToString()); |
| | | oItemSub.HEquipID = 0; |
| | | oItemSub.HGroupID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HGroupID"].ToString()); |
| | | oItemSub.HWorkerID = 0; |
| | | oItemSub.HWorkerID = 0; |
| | | oItemSub.HBarCode = list.barcodes[i].barcode; |
| | | oItemSub.HBarCode_Pack = list.packagebarcode; |
| | | oItemSub.HCloseMan = ""; |
| | |
| | | objJsonResult.status = 0; |
| | | objJsonResult.msg = "success"; |
| | | objJsonResult.data = null; |
| | | Log.LogSaveInfo("æäº¤æåç®±æ¡ç ï¼"+ list.packagebarcode); //è®°å½æäº¤æ°æ® |
| | | Log.LogSaveInfo("æäº¤æåç®±æ¡ç ï¼" + list.packagebarcode); //è®°å½æäº¤æ°æ® |
| | | return objJsonResult; |
| | | } |
| | | else |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.status =-1; |
| | | objJsonResult.status = -1; |
| | | objJsonResult.msg = e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | |
| | | { |
| | | //夿æ¯å¦å
¥åº |
| | | ds = oCN.RunProcReturn("select * from Sc_ScanLineInStock where HBarCode_Pack='" + packagebarcode + "'", "Sc_ScanLineInStock"); |
| | | if (ds!= null && ds.Tables[0].Rows.Count>0) |
| | | if (ds != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.status = -1; |
| | | objJsonResult.msg = "该箱æ¡ç å·²å
¥åºä¸å
è®¸åæ¶!"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("Select 1 from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill"); |
| | | if (ds != null && ds.Tables[0].Rows.Count>0) |
| | | if (ds != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.status = -1; |
| | | objJsonResult.msg = "æ¤ç®±æ¡ç å·²ä½åº"; |
| | |
| | | //å é¤SUM主表 |
| | | oCN.RunProc("Delete From Sc_PackUnionBillSub_Sum where HBarCode_Pack='" + packagebarcode.ToString() + "'"); |
| | | //å é¤å表 |
| | | oCN.RunProc("Delete From Sc_PackUnionBillSub where HBarCode_Pack='"+ packagebarcode.ToString() + "'"); |
| | | oCN.RunProc("Delete From Sc_PackUnionBillSub where HBarCode_Pack='" + packagebarcode.ToString() + "'"); |
| | | //å é¤ä¸»è¡¨ |
| | | oCN.RunProc("Delete From Sc_PackUnionBillMain where HBarCode_Pack='" + packagebarcode.ToString() + "'"); |
| | | //ä½åºæ¡ç æ¡£æ¡è¡¨ |
| | | oCN.RunProc("Update Gy_BarCodeBill set HStopflag='1' where HBarCode='"+ packagebarcode.ToString()+ "'"); |
| | | oCN.RunProc("Update Gy_BarCodeBill set HStopflag='1' where HBarCode='" + packagebarcode.ToString() + "'"); |
| | | |
| | | oCN.Commit(); |
| | | |
| | |
| | | //string aa=list.getWeek(Convert.ToDateTime(tim)); |
| | | string aa = list.GetCodeDateStr(Convert.ToDateTime(tim)); |
| | | objJsonResult.status = 0; |
| | | objJsonResult.msg =aa.ToString(); |
| | | objJsonResult.msg = aa.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |