Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

业务开发

步骤
1、后台创建规则并配置好规则
2、调用编码规则 IDUtil.getId("规则名称","序号",Map)

Tip

规则配置自定义变量 需要在业务代码中通过参数传递,自定义变量的值 必须是自定义变量的key值

例如:a:100,自定义变量 必须填写 a ,序号会自动补全

例如需要填写3,业务数据id为1,最终生成的序号为 001

范例

员工代码片段

    public ResultData save(@ModelAttribute @ApiIgnore EmployeeEntity employee, HttpServletResponse response, HttpServletRequest request) {

         ...
         employee.setEmployeeCode(IDUtil.getId("员工编号", Long.parseLong(employee.getId()));
         ...

    }