隨筆-71  評(píng)論-5  文章-0  trackbacks-0

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


          //配資單號(hào)格式
              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("數(shù)據(jù)庫原有的最大序列號(hào):"+xlh);
                 if(xlh!=null){
                System.out.println("累加的新生成的序列號(hào):"+AddOne(xlh));
                 }else{
                System.out.println("最新的新生成的序列號(hào):"+"00001"); //如果沒有手動(dòng)生成一條最小的
                 }
            }
              
          posted on 2015-08-03 11:50 藤本薔薇 閱讀(453) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。

          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 盐津县| 洛南县| 通化市| 怀宁县| 西乌珠穆沁旗| 镇雄县| 霍邱县| 叶城县| 新野县| 红桥区| 朔州市| 修水县| 徐闻县| 渝中区| 乌兰察布市| 盐源县| 新闻| 沙河市| 东光县| 泾川县| 平罗县| 昆明市| 镇平县| 平顺县| 台北县| 吉木乃县| 合水县| 吉安县| 平遥县| 若尔盖县| 瑞金市| 抚宁县| 湘乡市| 高邑县| 芦溪县| 阿拉善盟| 剑川县| 耿马| 沈阳市| 泗水县| 揭西县|