forked from liweijie/education
教学楼管理功能新增
This commit is contained in:
+12
-3
@@ -36,6 +36,13 @@ public class BuildServiceImpl implements BuildService {
|
||||
String uuid = UuidUtil.getUUID();
|
||||
jxlb.setId(uuid);
|
||||
jxlb.setDelFlag(0);
|
||||
// 序号留空时按现有最大序号 +1 自动生成(与导入逻辑一致),避免空序号破坏列表排序
|
||||
String xh = jxlb.getXh();
|
||||
if (xh == null || xh.trim().isEmpty()) {
|
||||
jxlb.setXh(String.valueOf(getNextNumber()));
|
||||
} else {
|
||||
jxlb.setXh(xh.trim());
|
||||
}
|
||||
buildMapper.insert(jxlb);
|
||||
}
|
||||
|
||||
@@ -79,6 +86,8 @@ public class BuildServiceImpl implements BuildService {
|
||||
wrapper.like(JXLB::getDd, jxlb.getDd());
|
||||
}
|
||||
}
|
||||
// 只返回未删除的教学楼(与 pageList 口径一致,避免已删除数据出现在下拉/全量列表里)
|
||||
wrapper.eq(JXLB::getDelFlag, 0);
|
||||
wrapper.orderByAsc(JXLB::getXh);
|
||||
return buildMapper.selectList(wrapper);
|
||||
}
|
||||
@@ -131,14 +140,14 @@ public class BuildServiceImpl implements BuildService {
|
||||
@Override
|
||||
public void downloadTemplate(HttpServletResponse response) {
|
||||
try {
|
||||
// 从resources/template目录读取模板文件
|
||||
ClassPathResource resource = new ClassPathResource("template/template_jxcdgl.xls");
|
||||
// 模板文件位于 classpath:file/ 下(sheet 名为「教学楼表」)
|
||||
ClassPathResource resource = new ClassPathResource("file/教学场地管理模板.xls");
|
||||
InputStream is = resource.getInputStream();
|
||||
|
||||
// 设置响应头
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" +
|
||||
URLEncoder.encode("教学场地管理模板.xls", "UTF-8"));
|
||||
URLEncoder.encode("教学楼管理模板.xls", "UTF-8"));
|
||||
|
||||
// 输出文件
|
||||
OutputStream os = response.getOutputStream();
|
||||
|
||||
Reference in New Issue
Block a user