Closed zxh866 closed 1 year ago
你把完整的前端代码贴以下或者截图
你把完整的前端代码贴以下或者截图
1、data.ts中的查询数据 //查询数据 export const searchTotalFormSchema: FormSchema[] = [ { label: "收支开始时间", field: "revenueStartTime", component: 'DatePicker', componentProps: { showTime:false, valueFormat: 'YYYY-MM-DD', //defaultValue: '2022-11-03', //disabled: true, }, defaultValue: '2022-11-01', colProps: {span: 6}, }, { label: "收支结束时间", field: "revenueEndTime", component: 'DatePicker', componentProps: { showTime:false, valueFormat: 'YYYY-MM-DD', //defaultValue: '2022-11-30', }, defaultValue: '2022-11-30', colProps: {span: 6}, }, ];
2、Java实体类 /*删除标记/ //@Excel(name = "删除标记", width = 15) //@ApiModelProperty(value = "删除标记") @TableLogic private java.lang.String delFlag;
@TableField(exist = false)
@DateTimeFormat(pattern="yyyy-MM-dd")
private String revenueStartTime;
@TableField(exist = false)
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date revenueEndTime;
@Excel(name = "金额", width = 15)
@TableField(exist = false)
private java.math.BigDecimal revenueAmount;
@Excel(name = "金额", width = 15)
@TableField(exist = false)
private java.math.BigDecimal expenditureAmount;
3、controller
//@AutoLog(value = "财务收入支出-分页列表查询")
@ApiOperation(value="财务收入支出-分页列表查询", notes="财务收入支出-分页列表查询")
@GetMapping(value = "/getFinanceRevenueList")
public Result<IPage
4、mapper文件
ws
已修复
版本号:
jeecgboot-vue3 3.4.3
问题描述:
查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的。点击查询按钮时,正常,没有这个问题。 另外:通过componentProps 的defaultValue设置默认值时,控件中可以显示默认值, 但是查询条件不起作用。
截图&代码:
前台代码: field: "revenueEndTime", component: 'DatePicker', componentProps: { showTime:false, valueFormat: 'YYYY-MM-DD', //defaultValue: '2022-11-30', }, defaultValue: '2022-11-30', colProps: {span: 6},
后台代码: @TableField(exist = false) @DateTimeFormat(pattern="yyyy-MM-dd") private Date revenueEndTime;
错误信息: 操作失败,org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'financeRevenue' on field 'revenueEndTime': rejected value ["2022-11-29T16:00:00.000Z"]; codes [typeMismatch.financeRevenue.revenueEndTime,typeMismatch.revenueEndTime,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [financeRevenue.revenueEndTime,revenueEndTime]; arguments []; default message [revenueEndTime]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'revenueEndTime'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@org.springframework.format.annotation.DateTimeFormat java.util.Date] for value '"2022-11-29T16:00:00.000Z"'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value ["2022-11-29T16:00:00.000Z"]]
友情提示(为了提高issue处理效率):