| | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "çä¸ç¥º") |
| | | { |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select top 1000 * from h_v_IF_POInStockBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select * from(select top 1000 row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_POInStockBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | sql = string.Format(@"select * from(select top 1000 row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_POInStockBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | } |
| | | else |
| | | { |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POInStockBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POInStockBillList_Source " + sWhere + " order by åæ®å· desc,hsubid ", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_POInStockBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | } |
| | | break; |
| | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region [éè¿æºåç±»åæ¥æ¾ä¸ååæ®ä¿¡æ¯] ä½¿ç¨æ°çå页æ¹å¼ |
| | | [Route("Sc_BarCode/ReportFromBillList_New")] |
| | | [HttpGet] |
| | | public object ReportFromBillList_New(int page, int limit, string sWhere, string HSouceBillType, string HOrgID) |
| | | { |
| | | oSystemParameter.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | List<object> columnNameList = new List<object>(); |
| | | try |
| | | { |
| | | int count = 0; |
| | | int pageNum = page; |
| | | int pageSize = limit; |
| | | string sql = ""; |
| | | string tabname = ""; |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | sWhere = " where 1=1 and HOrgID='" + HOrgID + "' "; |
| | | } |
| | | else |
| | | { |
| | | sWhere = " where 1=1 and HOrgID='" + HOrgID + "' " + sWhere; |
| | | } |
| | | switch (HSouceBillType) |
| | | { |
| | | case "ç产订å": |
| | | tabname = "h_v_IFCLD_ICMOBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IFCLD_ICMOBillList_Source " + sWhere + " and 任塿°é>isnull(å
¥åºæ°é,0) and ç¶æ<>'ç»æ¡' order by åæ®å·", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format($@"select * from h_v_IFCLD_ICMOBillList_Source {sWhere} and 任塿°é>isnull(å
¥åºæ°é,0) and ç¶æ<>'ç»æ¡' order by åæ®å· offset {(pageNum - 1)*pageSize} rows fetch next {pageSize} rows only;"); |
| | | break; |
| | | case "çäº§æ±æ¥å": |
| | | tabname = "h_v_IF_ICMOReportBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_ICMOReportBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_ICMOReportBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | break; |
| | | case "éè´è®¢å": |
| | | tabname = "h_v_IF_POOrderBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POOrderBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format($@"select * from h_v_IF_POOrderBillList_Source {sWhere} order by åæ®å· offset {(pageNum - 1)*pageSize} rows fetch next {pageSize} rows only;"); |
| | | break; |
| | | case "æ¶æéç¥å": |
| | | tabname = "h_v_IF_POInStockBillList_Source"; |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "çä¸ç¥º") |
| | | { |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select top 1000 * from h_v_IF_POInStockBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select * from(select top 1000 row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_POInStockBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | } |
| | | else |
| | | { |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POInStockBillList_Source " + sWhere + " order by åæ®å· desc,hsubid ", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format($@"select * from h_v_IF_POInStockBillList_Source {sWhere} order by åæ®å· offset {(pageNum - 1) * pageSize} rows fetch next {pageSize} rows only; "); |
| | | } |
| | | break; |
| | | case "å§å¤è®¢å": |
| | | tabname = "h_v_IF_EntrustOrderBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_EntrustOrderBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_EntrustOrderBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | break; |
| | | case "ç产å
¥åºå": |
| | | tabname = "h_v_IF_ProductInBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_ProductInBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_ProductInBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | break; |
| | | case "éè´å
¥åºå": |
| | | tabname = "h_v_IF_POStockInBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POStockInBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_POStockInBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | break; |
| | | case "éå®éè´§å": |
| | | tabname = "h_v_IF_SellOutBackBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_SellOutBackBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_SellOutBackBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | break; |
| | | case "ç产éæå": |
| | | tabname = "h_v_IF_MateOutBackBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_MateOutBackBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_MateOutBackBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | break; |
| | | case "å·¥åºæµè½¬å¡": |
| | | tabname = "h_v_IF_ProcessExchangeBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_ProcessExchangeBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_ProcessExchangeBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | break; |
| | | case "éå®åºåºå": |
| | | tabname = "h_v_IF_SellOutBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_SellOutBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_SellOutBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | break; |
| | | case "颿åºåºå": |
| | | tabname = "h_v_IF_MateOutBillList_Source"; |
| | | count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_MateOutBillList_Source " + sWhere + " order by åæ®å· desc,hsubid", tabname).Tables[0].Rows.Count; |
| | | sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by åæ®å· desc,hsubid) as HRowNumber,* from h_v_IF_MateOutBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | ds = new SQLHelper.ClsCN().RunProcReturn(sql, tabname); |
| | | string aa = ds.Tables[0].Columns[0].ToString(); |
| | | //ds.Tables[0].Columns["hmainid"].ColumnName.ToUpper(); |
| | | //ds.Tables[0].Columns["hsubid"].ColumnName.ToUpper(); |
| | | ds.Tables[0].Columns["hmainid"].ColumnName = "HMainID"; |
| | | ds.Tables[0].Columns["hsubid"].ColumnName = "HSubID"; |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = count; |
| | | objJsonResult.Message = "è·åèµæºç»å®æ°æ®æåï¼"; |
| | | objJsonResult.data = JsonConvert.DeserializeObject<DataTable>(JsonConvert.SerializeObject(ds.Tables[0], new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" })); //åºååDataSetä¸çæ¶é´æ ¼å¼ï¼ç¶ååååºåå忥 |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ææ èµæºç»å®ï¼"; |
| | | objJsonResult.data = null; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = e.Message.ToString(); |
| | | objJsonResult.data = null; |
| | | objJsonResult.list = columnNameList; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region [éè¿æ¡ç ç¼å·è·åHItemId] |
| | | [Route("Sc_BarCode/Get_HItemId")] |
| | |
| | | string HPOInStockBillNo = ""; // æ¶æéç¥åå· |
| | | |
| | | string HPOOrderBillNo = ""; // éè´è®¢åå· |
| | | |
| | | DataSet Ds; |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | |
| | | if (ClsPub.isLong(ordrlist[j].HMaterID) != 0) |
| | | { |
| | | HNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HMaterID); |
| | | HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HSupNumber);//ä¾åºå |
| | | HMaterNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HMaterNumber); |
| | | HBatchNo = ClsPub.isStrNull(ordrlist[j].HBatchNo); |
| | | |
| | |
| | | } |
| | | else if (CampanyName.Contains("å°å«")) |
| | | { |
| | | // å°å«çµå¨ |
| | | // æ¡ç åç¼ = åæ®å· + ç©æç¼ç + æ¹æ¬¡å· |
| | | sTMNumber = HPOOrderBillNo + "@" + HMaterNumber + "@" + HBatchNo; |
| | | Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | if(HSourceBillTypeName== "éè´è®¢å") |
| | | { |
| | | |
| | | //æ¡ç è§å为ï¼ç©æç¼ç -ä¾åºåç¼ç -æ¥ææ¹å·-æ¥ææ°é-éè´è®¢åç¼ç |
| | | sTMNumber = HMaterNumber + "-" + HSupNumber + "-" + HBatchNo + "-" + HBQty + "-" + HPOInStockBillNo; |
| | | |
| | | Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else |
| | | { |
| | | // å°å«çµå¨ |
| | | // æ¡ç åç¼ = åæ®å· + ç©æç¼ç + æ¹æ¬¡å· |
| | | sTMNumber = HPOOrderBillNo + "@" + HMaterNumber + "@" + HBatchNo; |
| | | Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | |
| | | } |
| | | else //éç¨æ¹æ³ |
| | | { |
| | |
| | | TM = HNumber + "@" + sHMTONo.Replace(" ","") + "@" + HBatchNo.Replace(" ","") + "@" + sHQty; |
| | | } |
| | | } |
| | | |
| | | |
| | | barcode.HBarCode2 = TM; |
| | | barcode.HEntryID2 = ClsPub.isStrNull(j + 1); |
| | | barcode.HMaterID2 = ordrlist[j].HMaterID; |
| | |
| | | { |
| | | HBarCode = HBarCode + ClsPub.isStrNull(ListRows[i].HMTONo2); |
| | | } |
| | | |
| | | // |
| | | HMaterID = ClsPub.isLong(ListRows[i].HMaterID2); |
| | | HEntryID = ClsPub.isLong(ListRows[i].HEntryID2); |
| | |
| | | string HMaterNumber_BarCode = DBUtility.ClsPub.isStrNull(ordrlist[i].HMaterNumber); |
| | | string HInspectionDate_BarCode = DBUtility.ClsPub.isStrNull(ordrlist[i].HInspectionDate).Replace("-", "/"); |
| | | string HQty_BarCode = ClsPub.isStrNull(HMinQty); |
| | | HBarCode_Temp = HPOOrderBillMTO_TMN + HMaterNumber_BarCode + HInspectionDate_BarCode + HQty_BarCode + LSH; |
| | | HBarCode_Temp = HPOOrderBillMTO_TMN + "|" + HMaterNumber_BarCode + "|" + HInspectionDate_BarCode + "|" + HQty_BarCode + "|" + LSH; |
| | | |
| | | HBarCodeList barcode = new HBarCodeList(); |
| | | barcode.HBarCode2 = HBarCode_Temp; |
| | |
| | | barcode.HCusMaterName2 = ordrlist[i].HCusMaterName; |
| | | barcode.HCheckEmpName2 = ordrlist[i].HCheckEmpName; |
| | | barcode.HReInspectionFlag = ordrlist[i].HReInspectionFlag ? 1 : 0; |
| | | barcode.HInspectionDate = ordrlist[i].HReInspectionFlag? ordrlist[i].HInspectionDate:null; |
| | | barcode.HInspectionDate = ordrlist[i].HInspectionDate; |
| | | barcode.HInspectionCycle = ordrlist[i].HReInspectionFlag ? ordrlist[i].HInspectionCycle : 0; |
| | | barcode.HReInspectionDate = ordrlist[i].HReInspectionFlag ? ordrlist[i].HReInspectionDate : null; |
| | | barcode.HPOOrderBillMTO = DBUtility.ClsPub.isStrNull(ordrlist[i].HPOOrderBillMTO); |
| | | barcode.HSeOrderBillNo2 = DBUtility.ClsPub.isStrNull(ordrlist[i].HSeOrderBillNo); |
| | | barcode.HCusModel2 = DBUtility.ClsPub.isStrNull(ordrlist[i].HCusModel); |
| | | ListRows.Add(barcode); |
| | | |
| | | n += 1; //æ´æ°åæ¹çæçæ¡ç æ° |
| | |
| | | string HReInspectionDate = ListRows[i].HInspectionDate; |
| | | string HCustomBatchNo = ClsPub.isStrNull(ListRows[i].HInspectionDate).Replace("-",""); |
| | | string HBarCodeStatus = "æ£å¸¸"; |
| | | string HPOOrderBillNoMTO = ClsPub.isStrNull(ListRows[i].HPOOrderBillMTO); |
| | | |
| | | string sql_produceBarCode = "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HBarCodeSubType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" + |
| | | ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName,HCustomBatchNo,HBarCodeStatus" + |
| | | ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName,HCustomBatchNo,HBarCodeStatus,HOrderBillNo" + |
| | | ",HReInspectionFlag,HInspectionDate,HInspectionCycle,HReInspectionDate " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "','" + HBarCodeSubType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | |
| | | + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + "" |
| | | + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "'" |
| | | + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "','" + HCustomBatchNo + "','" + HBarCodeStatus + "'" + |
| | | + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "','" + HCustomBatchNo + "','" + HBarCodeStatus + "','" + HPOOrderBillNoMTO + "'" + |
| | | "," + HReInspectionFlag + "," + (HInspectionDate == null ? "null" : "'" + HInspectionDate + "'") + "," + HInspectionCycle + "," + (HReInspectionDate == null ? "null" : "'" + HReInspectionDate + "'") + |
| | | ")"; |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | if(oWebs.GetWebAPIToLocal_ICMO(HBillNo, "3710", "admin", ref DBUtility.ClsPub.sErrInfo)==false) |
| | | //if(oWebs.GetWebAPIToLocal_ICMO(HBillNo, "3710", "admin", ref DBUtility.ClsPub.sErrInfo)==false) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "[0000-2-020]åæ®åæ¥å¤±è´¥è¯·è系管çå,"+ DBUtility.ClsPub.sErrInfo; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | ds = oCN.RunProcReturn("exec h_p_WMS_SaveSNByICMO_XW '" + @HBillNo + "','" + HSN +"',"+HBeginNo+","+HEndNo+","+HCount+",'"+HMachineCode+"'", "h_p_WMS_SaveSNByICMO_XW"); |
| | | |
| | | if (ds == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-2-020]åæ®åæ¥å¤±è´¥è¯·è系管çå,"+ DBUtility.ClsPub.sErrInfo; |
| | | objJsonResult.Message = "[0000-2-020]没æè¿åä»»ä½ç»æ,æ¡ç ä¿å失败ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_WMS_SaveSNByICMO_XW '" + @HBillNo + "', " + HSN +","+HBeginNo+","+HEndNo+","+HCount+",'"+HMachineCode+"'", "h_p_WMS_SaveSNByICMO_XW"); |
| | | |
| | | if (ds == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-2-020]没æè¿åä»»ä½ç»æ,æ¡ç ä¿å失败ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-2-020]æ¡ç ç»å®å¤±è´¥ï¼"+ ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-2-020]æ¡ç ç»å®å¤±è´¥ï¼"+ ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //} |
| | | |
| | | |
| | | |
| | |
| | | string HSelectBarCodeType = "æçæ¡ç "; |
| | | string CampanyName = "å°å«"; |
| | | string UserName = sArray[2].ToString();//ç¨æ· |
| | | string barCode_middle = sArray[3].ToString();//ä¸ç®±ç |
| | | ClsPub.CurUserName = UserName; |
| | | |
| | | //è·åå
ç |
| | |
| | | else |
| | | { |
| | | //çææ¡ç |
| | | SaveBarCode_xiaowei(msg2, HSelectBarCodeType, CampanyName, HSourceBillTypeName); |
| | | SaveBarCode_xiaowei(msg2, HSelectBarCodeType, CampanyName, HSourceBillTypeName, barCode_middle); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | #endregion |
| | | |
| | | #region[æ¡ç çææ¹æ³_xiaowei] |
| | | private object SaveBarCode_xiaowei(string msg2, string HSelectBarCodeType, string CampanyName, string HSourceBillTypeName) |
| | | private object SaveBarCode_xiaowei(string msg2, string HSelectBarCodeType, string CampanyName, string HSourceBillTypeName,string barCode_middle) |
| | | { |
| | | DateTime sDate = DateTime.Now; //æ¥æ |
| | | string HSourceBillType_Temp = ""; //æºåç±»å |
| | |
| | | List<HBarCodeList> ListRows = new List<HBarCodeList>(); |
| | | |
| | | DataSet Ds; |
| | | DataSet Ds2; |
| | | for (int i = 0; i < 1; i++) |
| | | { |
| | | HSourceBillType_Temp = ordrlist.HBillType; |
| | |
| | | string sTMNumber = ""; //æ¡ç åç¼ |
| | | string LSH = ""; //æå¤§æµæ°´å· |
| | | int HLen = 6; //æµæ°´å·é¿åº¦ |
| | | |
| | | |
| | | //æ¡ç æ¼æ¥æéåæ®µ |
| | | string HMaterialName = DBUtility.ClsPub.isStrNull(ordrlist.HMaterName); |
| | | string HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist.HSupNumber).Replace(".", ""); //ä¾åºå代ç ï¼å»æåéç¬¦ï¼ |
| | | int lastDigit = int.Parse(DateTime.Today.Year.ToString().Last().ToString()); |
| | | char productionMonth = DateTime.Today.Month <= 9 |
| | | ? (char)(DateTime.Today.Month + '0') |
| | | : (char)('A' + DateTime.Today.Month - 10); |
| | | if (HMaterialName.Trim() == "") |
| | | |
| | | DataSet dds= oCN.RunProcReturn("exec h_p_rule_BarCodePack_xiaowei "+ ordrlist.HMaterID+",'"+ barCode_middle+"'", "h_p_rule_BarCodePack_xiaowei"); |
| | | //todo |
| | | if (dds.Tables[0].Rows[0]["HBack"]=="1") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç©æä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"; |
| | | objJsonResult.Message = "çææ¡ç 失败ï¼" + dds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //todo |
| | | else if(dds == null || dds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "çææ¡ç å¤±è´¥ï¼æªæ¾å°æ¡ç ï¼" ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //æ¡ç åç¼ = p+ååSKU+ç产年份+ç产æä»½+6使µæ°´å·+ç产工å代ç |
| | | sTMNumber = "P" + HMaterialName + lastDigit+ productionMonth; |
| | | |
| | | //æ ¹æ®æ¡ç åç¼è·åæå¤§æµæ°´å· |
| | | Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); |
| | | LSH = String.Format("{0:D" + HLen + "}", ClsPub.isInt(Ds.Tables[0].Rows[0][0]) + 1); |
| | | |
| | | //æ¼æ¥æ¡ç |
| | | HBarCode_Temp = sTMNumber + LSH+"XXX"; |
| | | |
| | | HBarCode_Temp = dds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | |
| | | if (HSumQty - HMinQty > 0) |
| | | { |