隨筆-71  評論-5  文章-0  trackbacks-0

                public static interface NUMBER{
          public static String STR_FORMAT = "00000"; 
                  static String TOKEN = null; 
          }


          //配資單號格式
              public static String AddOne(String code){
             Integer intHao = Integer.parseInt(code);
             intHao++;
             DecimalFormat df = new DecimalFormat(NUMBER.STR_FORMAT);
             return df.format(intHao);
              }
              
              public static void main(String[] args) {
              String code = "ASD0034252345234500001";
                 String  xlh = code.substring(code.length()-5, code.length());
                 System.out.println("數據庫原有的最大序列號:"+xlh);
                 if(xlh!=null){
                System.out.println("累加的新生成的序列號:"+AddOne(xlh));
                 }else{
                System.out.println("最新的新生成的序列號:"+"00001"); //如果沒有手動生成一條最小的
                 }
            }
              
          posted on 2015-08-03 11:50 藤本薔薇 閱讀(452) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。

          網站導航:
           
          主站蜘蛛池模板: 藁城市| 吴桥县| 苍南县| 宿迁市| 三原县| 东辽县| 牡丹江市| 绍兴市| 玉山县| 宝山区| 辽宁省| 高尔夫| 南华县| 内江市| 承德市| 兰坪| 修文县| 连城县| 翼城县| 玛多县| 宁国市| 抚顺县| 雷州市| 红桥区| 郑州市| 麻江县| 永靖县| 循化| 正安县| 沙田区| 太仓市| 蒙自县| 九龙县| 新乐市| 金平| 永登县| 中方县| 成武县| 平乡县| 台中县| 双牌县|