Permalink
Browse files

Update SqlToDictionaryUtil.java

 decimal(18,2) 被分隔 bug
  • Loading branch information...
1 parent 13b4471 commit 3cac14a986ff17f005dce4058f9287d4f27b107d @EhsanTang committed on GitHub Dec 29, 2016
Showing with 14 additions and 0 deletions.
  1. +14 −0 api/src/main/java/cn/crap/utils/SqlToDictionaryUtil.java
@@ -39,6 +39,13 @@ public static Article mysqlToDictionary(String sql, String brief, String moduleI
String[] fieldsArray = fields.split(",");
for(int i=0; i<fieldsArray.length; i++){
String field = fieldsArray[i];
+ // decimal(18,2) 被分隔
+ try{
+ Integer.parseInt(fieldsArray[i+1].substring(0,1));
+ fieldsArray[i+1] = fieldsArray[i] +","+ fieldsArray[i+1];
+ continue;
+ }catch(Exception e){
+ }
try{
// 字段
DictionaryDto dto = null;
@@ -143,6 +150,13 @@ public static Article sqlserviceToDictionary(String sql, String brief, String mo
String[] fieldsArray = fields.split(",");
for(int i=0; i<fieldsArray.length; i++){
String field = fieldsArray[i];
+ // decimal(18,2) 被分隔
+ try{
+ Integer.parseInt(fieldsArray[i+1].substring(0,1));
+ fieldsArray[i+1] = fieldsArray[i] +","+ fieldsArray[i+1];
+ continue;
+ }catch(Exception e){
+ }
try{
// 字段
DictionaryDto dto = null;

0 comments on commit 3cac14a

Please sign in to comment.