904 Star 9.5K Fork 4K

guchengwuyue / yshop意象商城系统

 / 详情

代码生成报错

已完成
创建于  
2020-12-14 15:58

下面是生成模板时 java的报错信息,错误指向ftl模板中pkColumnType解析错误:
2020-12-14 15:55:28.000 DEBUG 38589 --- [http-nio-8001-exec-5] .m.m.a.ExceptionHandlerExceptionResolver : Using @TwistZz public org.springframework.http.ResponseEntity<co.yixiang.handler.ApiError> co.yixiang.handler.GlobalExceptionHandler.handleException(java.lang.Throwable)
2020-12-14 15:55:28.000 ERROR 38589 --- [http-nio-8001-exec-5] c.y.handler.GlobalExceptionHandler : java.lang.RuntimeException: cn.hutool.extra.template.TemplateException: InvalidReferenceException: The following has evaluated to null or missing:
==> pkColumnType [in template "generator/admin/DtoP.ftl" at line 19, column 15]


Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??


FTL stack trace ("~" means nesting-related):
- Failed at: #if !auto && pkColumnType == "Long" [in template "generator/admin/DtoP.ftl" at line 19, column 1]

附表结构
create table yshopb2c.b_auction_product
(
id bigint(32) auto_increment
primary key,
name varchar(100) null comment '商品名称',
type int not null comment '所属分类 1-房产,2-机动车,3-土地,4-股权债券,5-文物艺术品,6-生活品,7-其他资产',
price_start decimal(30, 2) not null comment '起拍价',
method int not null comment '拍卖方式 1-线下,2-加价,3-降价',
auction_id bigint(32) null comment '拍卖会id',
price_bail decimal(30, 2) not null comment '保证金',
price_range decimal(30, 2) not null comment '价格幅度 根据method,1线下-加价,2加价,3降价',
is_qualify int not null comment '资质要求 1-需要,0不需要',
start_time datetime not null comment '起拍时间',
detail text null comment '拍品详情',
document text null comment '文件资料 url,多个用“,”隔开',
code varchar(100) not null comment '拍品编号',
state int null comment '状态 0-暂未拍卖,1-已被拍卖,-1-流拍',
shot_uid bigint(32) null comment '获得者uid',
create_time datetime null,
update_time datetime null,
is_del int null,
province varchar(100) null comment '省',
city varchar(100) null comment '市',
district varchar(100) null comment '区',
bidding_cycle int null comment '竞标周期(单位:分钟)加价拍,降价拍才有',
price_reserve decimal(30, 2) not null comment '底价 降价拍才有'
)
comment '拍品';

评论 (1)

Hui 创建了任务
Hui 修改了描述
taozihk 任务状态待办的 修改为进行中
展开全部操作日志

输入图片说明
代码生成没问题,好好看看文档配置了再生成

taozihk 任务状态进行中 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
Java
1
https://gitee.com/guchengwuyue/yshopmall.git
git@gitee.com:guchengwuyue/yshopmall.git
guchengwuyue
yshopmall
yshop意象商城系统

搜索帮助