jeecgBoot开发学习文档地址:
jeecgBoot官网地址:
从官网下载源码之后,依据学习文档中的指示,完成前后端分离项目启动。
记录问题一:win7只支持nodejs的v10及之前的版本。
记录问题二:我使用得是mysql数据库表,执行db中的mysql文件生成的表需要手动调整,才能把数据库表全部完成。
记录问题三:开发文档中前端项目是webstrom工具,启动项目就是根据文档提示选择show npm scrips,选择application.json中的serve启动项目,如下图:
我使用的是VSCode工具,启动jeecgBoot前端项目参考开发文档,使用命令:npm run serve启动成功。
推荐使用yarn启动
安装淘宝镜像
npm install -g cnpm -registry=https://registry.npm.taobao.org
安装yarn启动项目
yarn install
yarn run serve
列表页面字典不管用解决方法:
自动生成的代码是
{
title: '订单状态',
align: "center",
dataIndex: 'orderState_dictText'
},
修改为:
{
title: '订单状态',
align: "center",
// dataIndex: 'orderState_dictText',
dataIndex: 'orderState',
customRender: (text) => (text == 0 ? '待支付' : text == 1 ? '待使用' : text == 2 ? '已完成' : text),
},
后端mybatis-plus编写复杂查询条件语句:
<select id="selectAll" parameterType="com.zz.TaskIntegralDTO" resultMap="com.zz.model.TaskIntegral">
select
*
from t_task_integral
<where>
<if test="param.Id != null and param.Id != '' ">
and t_task_integral.id = #{param.id}
</if>
<if test="param.taskId != null and param.taskId != '' ">
and t_task_integral.task_id = #{param.task_id}
</if>
<if test="param.taskType != null and param.taskId != '' ">
and t_task_integral.task_type = #{param.taskType}
</if>
<if test="param.departs != null and param.departs >0 ">
and(
<foreach collection="param.departs" index="index" open="(" separator="or" close=")" item="item">
<if test="item.departmentName != null and item.departmentName != '' and item.taskDepartmentRole != null and item.taskDepartmentRole != '' ">
(
t_task_integral.department_name like concat('%',#{item.departmentName},'%')
and t_task_integral.task_department_role = #{item.taskDepartmentRole}
)
</if>
</foreach>
)
</if>
</where>
order by t_task_integral.create_time desc
</select>
Page查询结果类型转换 LambdaQueryWrapper<ObjectTask> wrapper = new LambdaQueryWrapper(); wrapper.eq(ObjectTask::getDeleteFlag, DeleteFlagEnum.NO.getCode()); Page<ObjectTask> page = new Page<>(pageNo, pageSize); Page<ObjectTask> resultPage = objectTaskMapper.selectPage(page, wrapper); // 类型转换 Page<ObjectTaskViewDTO> result = new Page<>(resultPage.getCurrent(), resultPage.getSize(), resultPage.getTotal()); List<ObjectTaskViewDTO> list = new ArrayList<>(); for (ObjectTask task : resultPage.getRecords()) { list.add(task.toViewDTO(ObjectTaskViewDTO.class)); } result.setRecords(list); return result;