Commit 33f09d7747df2d45736999e8e6a367a98840e3bc
Committed by
Gitee
1 parent
7afc5acc
生成domain 如果是浮点型 统一用BigDecimal
Showing
1 changed file
with
2 additions
and
2 deletions
ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java
| ... | ... | @@ -58,11 +58,11 @@ public class GenUtils |
| 58 | 58 | { |
| 59 | 59 | column.setHtmlType(GenConstants.HTML_INPUT); |
| 60 | 60 | |
| 61 | - // 如果是浮点型 | |
| 61 | + // 如果是浮点型 统一用BigDecimal | |
| 62 | 62 | String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); |
| 63 | 63 | if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) |
| 64 | 64 | { |
| 65 | - column.setJavaType(GenConstants.TYPE_DOUBLE); | |
| 65 | + column.setJavaType(GenConstants.TYPE_BIGDECIMAL); | |
| 66 | 66 | } |
| 67 | 67 | // 如果是整形 |
| 68 | 68 | else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) | ... | ... |