Commit 22f2516a by 吴迪

【修改】修改bug

parent 187d39b5
...@@ -58,7 +58,7 @@ public class ClickDetailController { ...@@ -58,7 +58,7 @@ public class ClickDetailController {
@RequestMapping("/list") @RequestMapping("/list")
//@RequiresPermissions("datamanage:clickdetail:list") //@RequiresPermissions("datamanage:clickdetail:list")
public R list(@RequestBody ClickDetailDTO clickDetailDTO) { public R list(@RequestBody ClickDetailDTO clickDetailDTO) {
Page page = null; Page<ClickDetailDTO> page = new Page();
if (StrUtil.equals("1", clickDetailDTO.getTypeValue())) { if (StrUtil.equals("1", clickDetailDTO.getTypeValue())) {
page = clickDetailService.selectClickNewsList(clickDetailDTO); page = clickDetailService.selectClickNewsList(clickDetailDTO);
} else if (StrUtil.equals("2", clickDetailDTO.getTypeValue())) { } else if (StrUtil.equals("2", clickDetailDTO.getTypeValue())) {
...@@ -78,6 +78,8 @@ public class ClickDetailController { ...@@ -78,6 +78,8 @@ public class ClickDetailController {
} else if (StrUtil.equals("12", clickDetailDTO.getTypeValue())) { } else if (StrUtil.equals("12", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPageAnnounces(clickDetailDTO); page = clickDetailService.getListPageAnnounces(clickDetailDTO);
} }
PageUtils pageUtils = new PageUtils(page); PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils); return R.ok().put("page", pageUtils);
} }
...@@ -108,6 +110,7 @@ public class ClickDetailController { ...@@ -108,6 +110,7 @@ public class ClickDetailController {
clickDetailService.getListPageAnnouncesExport(clickDetailDTO,response); clickDetailService.getListPageAnnouncesExport(clickDetailDTO,response);
} }
} }
......
...@@ -86,5 +86,7 @@ public class ClickDetailDTO implements Serializable { ...@@ -86,5 +86,7 @@ public class ClickDetailDTO implements Serializable {
private String order; private String order;
private String releaseTimeStart;
private String releaseTimeEnd;
} }
...@@ -14,7 +14,6 @@ import io.office.modules.manage.entity.ClickDetailEntity; ...@@ -14,7 +14,6 @@ import io.office.modules.manage.entity.ClickDetailEntity;
import io.office.modules.manage.entity.dto.ClickDetailDTO; import io.office.modules.manage.entity.dto.ClickDetailDTO;
import io.office.modules.manage.service.ClickDetailService; import io.office.modules.manage.service.ClickDetailService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -44,12 +43,10 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -44,12 +43,10 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> selectClickNewsList(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> selectClickNewsList(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.getListPageNews(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageNews(clickDetailDTO, page);
if(CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (ClickDetailDTO detailDTO : list) { for (ClickDetailDTO detailDTO : list) {
if(StringUtils.isBlank(detailDTO.getJumpPath())) { detailDTO.setJumpPath("http://www.gs1cn.org/News/msg?id=" + detailDTO.getId());
detailDTO.setJumpPath("http://www.gs1cn.org/News/msg?id="+detailDTO.getId());
}
} }
} }
page.setRecords(list); page.setRecords(list);
...@@ -59,12 +56,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -59,12 +56,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> getListPageImages(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> getListPageImages(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.getListPageImages(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageImages(clickDetailDTO, page);
if(CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (ClickDetailDTO detailDTO : list) { for (ClickDetailDTO detailDTO : list) {
if(StringUtils.isBlank(detailDTO.getJumpPath())) {
detailDTO.setJumpPath("http://www.gs1cn.org/News/msgVideo?id="+detailDTO.getId()); detailDTO.setJumpPath("http://www.gs1cn.org/News/msgVideo?id=" + detailDTO.getId());
}
} }
} }
page.setRecords(list); page.setRecords(list);
...@@ -74,12 +71,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -74,12 +71,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> getListPageViewSubs(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> getListPageViewSubs(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.getListPageViewSubs(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageViewSubs(clickDetailDTO, page);
if(CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (ClickDetailDTO detailDTO : list) { for (ClickDetailDTO detailDTO : list) {
if(StringUtils.isBlank(detailDTO.getJumpPath())) {
detailDTO.setJumpPath("http://www.gs1cn.org/News/viewsub?id="+detailDTO.getId()); detailDTO.setJumpPath("http://www.gs1cn.org/News/viewsub?id=" + detailDTO.getId());
}
} }
} }
page.setRecords(list); page.setRecords(list);
...@@ -89,13 +86,13 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -89,13 +86,13 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> getListPageMovies(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> getListPageMovies(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.getListPageMovies(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageMovies(clickDetailDTO, page);
if(CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (ClickDetailDTO detailDTO : list) { for (ClickDetailDTO detailDTO : list) {
if(StringUtils.isBlank(detailDTO.getJumpPath())) {
detailDTO.setJumpPath("http://www.gs1cn.org/News/msgVideo?id="+detailDTO.getId()); detailDTO.setJumpPath("http://www.gs1cn.org/News/msgVideo?id=" + detailDTO.getId());
}
} }
} }
...@@ -106,12 +103,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -106,12 +103,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> getListPagePolicys(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> getListPagePolicys(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.getListPagePolicys(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPagePolicys(clickDetailDTO, page);
if(CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (ClickDetailDTO detailDTO : list) { for (ClickDetailDTO detailDTO : list) {
if(StringUtils.isBlank(detailDTO.getJumpPath())) {
detailDTO.setJumpPath("http://www.gs1cn.org/Knowledge/Statuteinfo?id="+detailDTO.getId()); detailDTO.setJumpPath("http://www.gs1cn.org/Knowledge/Statuteinfo?id=" + detailDTO.getId());
}
} }
} }
page.setRecords(list); page.setRecords(list);
...@@ -121,12 +118,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -121,12 +118,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> getListPageApplications(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> getListPageApplications(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.getListPageApplications(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageApplications(clickDetailDTO, page);
if(CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (ClickDetailDTO detailDTO : list) { for (ClickDetailDTO detailDTO : list) {
if(StringUtils.isBlank(detailDTO.getJumpPath())) {
detailDTO.setJumpPath("http://www.gs1cn.org/News/msg?id="+detailDTO.getId()); detailDTO.setJumpPath("http://www.gs1cn.org/News/msg?id=" + detailDTO.getId());
}
} }
} }
page.setRecords(list); page.setRecords(list);
...@@ -136,12 +133,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -136,12 +133,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> getListPageKnowledgeInfos(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> getListPageKnowledgeInfos(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.getListPageKnowledgeInfos(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageKnowledgeInfos(clickDetailDTO, page);
if(CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (ClickDetailDTO detailDTO : list) { for (ClickDetailDTO detailDTO : list) {
if(StringUtils.isBlank(detailDTO.getJumpPath())) {
detailDTO.setJumpPath("http://www.gs1cn.org/Knowledge/Statuteinfo?id="+detailDTO.getId()); detailDTO.setJumpPath("http://www.gs1cn.org/Knowledge/Statuteinfo?id=" + detailDTO.getId());
}
} }
} }
page.setRecords(list); page.setRecords(list);
...@@ -151,12 +148,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -151,12 +148,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> getListPageProducts(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> getListPageProducts(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.getListPageKnowledgeInfos(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageProducts(clickDetailDTO, page);
if(CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (ClickDetailDTO detailDTO : list) { for (ClickDetailDTO detailDTO : list) {
if(StringUtils.isBlank(detailDTO.getJumpPath())) {
detailDTO.setJumpPath("http://www.gs1cn.org/Service/Book?id="+detailDTO.getId()); detailDTO.setJumpPath("http://www.gs1cn.org/Service/Book?id=" + detailDTO.getId());
}
} }
} }
page.setRecords(list); page.setRecords(list);
...@@ -166,12 +163,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -166,12 +163,12 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> getListPageAnnounces(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> getListPageAnnounces(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.getListPageKnowledgeInfos(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageKnowledgeInfos(clickDetailDTO, page);
if(CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (ClickDetailDTO detailDTO : list) { for (ClickDetailDTO detailDTO : list) {
if(StringUtils.isBlank(detailDTO.getJumpPath())) {
detailDTO.setJumpPath("http://www.gs1cn.org/News/NoticeArticle?id="+detailDTO.getId()); detailDTO.setJumpPath("http://www.gs1cn.org/News/NoticeArticle?id=" + detailDTO.getId());
}
} }
} }
page.setRecords(list); page.setRecords(list);
...@@ -181,7 +178,7 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -181,7 +178,7 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public Page<ClickDetailDTO> selectClickList(ClickDetailDTO clickDetailDTO) { public Page<ClickDetailDTO> selectClickList(ClickDetailDTO clickDetailDTO) {
Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit()); Page page = new Page(clickDetailDTO.getPage(), clickDetailDTO.getLimit());
List<ClickDetailDTO> list = baseMapper.selectClickList(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.selectClickList(clickDetailDTO, page);
page.setRecords(list); page.setRecords(list);
return page; return page;
} }
...@@ -189,27 +186,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -189,27 +186,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public void selectClickNewsListExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void selectClickNewsListExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.getListPageNews(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageNews(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("文章统计统计结果", "文章统计统计结果"), entityList, list);
//写出 //写出
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("文章统计统计结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
...@@ -218,27 +215,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -218,27 +215,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public void getListPageImagesExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void getListPageImagesExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.getListPageImages(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageImages(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("图片统计结果", "图片统计结果"), entityList, list);
//写出 //写出
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("图片统计结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
...@@ -248,27 +245,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -248,27 +245,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public void getListPageViewSubsExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void getListPageViewSubsExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.getListPageViewSubs(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageViewSubs(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("专题统计结果", "专题统计结果"), entityList, list);
//写出 //写出
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("专题统计结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
...@@ -277,27 +274,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -277,27 +274,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public void getListPageMoviesExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void getListPageMoviesExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.getListPageMovies(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageMovies(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("视频统计结果", "视频统计结果"), entityList, list);
//写出 //写出
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("视频统计结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
...@@ -307,27 +304,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -307,27 +304,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
public void getListPagePolicysExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void getListPagePolicysExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.getListPagePolicys(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPagePolicys(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("政策法规结果", "政策法规结果"), entityList, list);
//写出 //写出
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("政策法规结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
...@@ -336,27 +333,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -336,27 +333,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public void getListPageApplicationsExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void getListPageApplicationsExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.getListPageApplications(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageApplications(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("应用领域结果", "应用领域结果"), entityList, list);
//写出 //写出
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("应用领域结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
...@@ -365,27 +362,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -365,27 +362,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public void getListPageKnowledgeInfosExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void getListPageKnowledgeInfosExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.getListPageKnowledgeInfos(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageKnowledgeInfos(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("知识统计结果", "知识统计结果"), entityList, list);
//写出 //写出
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("知识统计结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
...@@ -394,27 +391,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -394,27 +391,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public void getListPageProductsExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void getListPageProductsExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.getListPageProducts(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageProducts(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("图书文献结果", "图书文献结果"), entityList, list);
//写出 //写出
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("图书文献结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
...@@ -423,27 +420,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -423,27 +420,27 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public void getListPageAnnouncesExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void getListPageAnnouncesExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.getListPageAnnounces(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.getListPageAnnounces(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("公告统计结果", "公告统计结果"), entityList, list);
//写出 //写出
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("公告统计结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
...@@ -452,18 +449,18 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -452,18 +449,18 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
@Override @Override
public void selectClickListExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException { public void selectClickListExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
Page page = new Page(1, 999999); Page page = new Page(1, 999999);
List<ClickDetailDTO> list = baseMapper.selectClickList(clickDetailDTO,page); List<ClickDetailDTO> list = baseMapper.selectClickList(clickDetailDTO, page);
// 存放excel的表头 // 存放excel的表头
ArrayList<ExcelExportEntity> entityList = new ArrayList<>(); ArrayList<ExcelExportEntity> entityList = new ArrayList<>();
//表头 //表头
ExcelExportEntity title = new ExcelExportEntity("ID", "id"); ExcelExportEntity title = new ExcelExportEntity("ID", "id");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("标题","title"); title = new ExcelExportEntity("标题", "title");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("发布时间","inputDateStr"); title = new ExcelExportEntity("发布时间", "inputDateStr");
entityList.add(title); entityList.add(title);
title=new ExcelExportEntity("点击数","countNum"); title = new ExcelExportEntity("点击数", "countNum");
entityList.add(title); entityList.add(title);
Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list); Workbook result = ExcelExportUtil.exportExcel(new ExportParams("新闻统计结果", "新闻统计结果"), entityList, list);
...@@ -472,7 +469,7 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet ...@@ -472,7 +469,7 @@ public class ClickDetailServiceImpl extends ServiceImpl<ClickDetailDao, ClickDet
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
//设置请求头,解决文件名中文乱码问题 //设置请求头,解决文件名中文乱码问题
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-disposition","attachment;fileName="+ URLEncoder.encode("新闻统计结果.xlsx","utf-8") ); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("新闻统计结果.xlsx", "utf-8"));
result.write(outputStream); result.write(outputStream);
result.close(); result.close();
outputStream.close(); outputStream.close();
......
package io.office.modules.manage.service.impl; package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.netty.util.internal.StringUtil; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.MedicalDao; import io.office.modules.manage.dao.MedicalDao;
import io.office.modules.manage.entity.MedicalEntity; import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService; import io.office.modules.manage.service.MedicalService;
...@@ -11,11 +14,6 @@ import org.springframework.stereotype.Service; ...@@ -11,11 +14,6 @@ import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
...@@ -39,14 +37,14 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i ...@@ -39,14 +37,14 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
} else { } else {
medicalEntityQueryWrapper.gt("level",0); medicalEntityQueryWrapper.gt("level",0);
} }
if(params.get("sidx")!=null && StringUtils.isNotBlank(String.valueOf(params.get("sidx")))){ //if(params.get("sidx")!=null && StringUtils.isNotBlank(String.valueOf(params.get("sidx")))){
if(String.valueOf(params.get("sidx")).equalsIgnoreCase("type")) { // if(String.valueOf(params.get("sidx")).equalsIgnoreCase("type")) {
params.put("sidx","typeid"); // params.put("sidx","typeid");
medicalEntityQueryWrapper.orderByAsc("typeid"); // medicalEntityQueryWrapper.orderByAsc("typeid");
} // }
} else{ //} else{
medicalEntityQueryWrapper.orderByAsc("typeid"); // medicalEntityQueryWrapper.orderByAsc("typeid");
} //}
IPage<MedicalEntity> page = this.page( IPage<MedicalEntity> page = this.page(
...@@ -69,4 +67,4 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i ...@@ -69,4 +67,4 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
} }
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import io.office.modules.manage.webservice.WebServiceXmlTemplate; ...@@ -5,6 +5,7 @@ import io.office.modules.manage.webservice.WebServiceXmlTemplate;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpEntity; import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
...@@ -108,4 +109,49 @@ public class GLNSearchUtils { ...@@ -108,4 +109,49 @@ public class GLNSearchUtils {
} }
public static void main(String[] args) {
String smsTemplateXml = WebServiceXmlTemplate.SEND_MESSAGE_TEMPLATE.replaceAll("\\$\\{cascade\\}", "9").replaceAll("\\$\\{requestedKeyCode\\}", "GLN")
.replaceAll("\\$\\{requestedKeyValue\\}", "6929020221650").replaceAll("\\$\\{requestedLanguage\\}", "en");
String url = "http://webservice.anccnet.com:8080/gepir4/gepirv4.asmx";
RestTemplate restTemplate = new RestTemplate();
//创建请求头
//创建请求头
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.TEXT_XML);
HttpEntity<String> entity = new HttpEntity<>("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
" <soap:Header>\n" +
" <gep:requestHeader xmlns=\"http://gepir4.ws.gs1.org/\">\n" +
" <requesterGLN xmlns=\"\">6900000000007</requesterGLN>\n" +
" <onBehalfOfGLN xmlns=\"\">6900000000007</onBehalfOfGLN>\n" +
" <isAuthenticated xmlns=\"\">true</isAuthenticated>\n" +
" <cascade xmlns=\"\">9</cascade>\n" +
" </gep:requestHeader>\n" +
" </soap:Header>\n" +
" <soap:Body>\n" +
" <getKeyLicensee xmlns=\"http://gepir4.ws.gs1.org/\">\n" +
" <getKeyLicensee xmlns=\"\">\n" +
" <getKeyLicensee>\n" +
" <requestedKeyCode>GLN</requestedKeyCode>\n" +
" <requestedKeyValue>6970974940012</requestedKeyValue>\n" +
" <requestedLanguage>en</requestedLanguage>\n" +
" </getKeyLicensee>\n" +
" </getKeyLicensee>\n" +
" </getKeyLicensee>\n" +
" </soap:Body>\n" +
"</soap:Envelope>\n", headers);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, entity, String.class);
System.out.println(responseEntity);
}
} }
...@@ -44,15 +44,15 @@ public class SysRoleController extends AbstractController { ...@@ -44,15 +44,15 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:list") @RequiresPermissions("sys:role:list")
public R list(@RequestParam Map<String, Object> params){ public R list(@RequestParam Map<String, Object> params){
//如果不是超级管理员,则只查询自己创建的角色列表 //如果不是超级管理员,则只查询自己创建的角色列表
// if(getUserId() != Constant.SUPER_ADMIN){ if(getUserId() != Constant.SUPER_ADMIN){
// params.put("createUserId", getUserId()); params.put("createUserId", getUserId());
// } }
PageUtils page = sysRoleService.queryPage(params); PageUtils page = sysRoleService.queryPage(params);
return R.ok().put("page", page); return R.ok().put("page", page);
} }
/** /**
* 角色列表 * 角色列表
*/ */
...@@ -60,16 +60,16 @@ public class SysRoleController extends AbstractController { ...@@ -60,16 +60,16 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:select") @RequiresPermissions("sys:role:select")
public R select(){ public R select(){
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
//如果不是超级管理员,则只查询自己所拥有的角色列表 //如果不是超级管理员,则只查询自己所拥有的角色列表
// if(getUserId() != Constant.SUPER_ADMIN){ if(getUserId() != Constant.SUPER_ADMIN){
// map.put("create_user_id", getUserId()); map.put("create_user_id", getUserId());
// } }
List<SysRoleEntity> list = (List<SysRoleEntity>) sysRoleService.listByMap(map); List<SysRoleEntity> list = (List<SysRoleEntity>) sysRoleService.listByMap(map);
return R.ok().put("list", list); return R.ok().put("list", list);
} }
/** /**
* 角色信息 * 角色信息
*/ */
...@@ -77,14 +77,14 @@ public class SysRoleController extends AbstractController { ...@@ -77,14 +77,14 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:info") @RequiresPermissions("sys:role:info")
public R info(@PathVariable("roleId") Long roleId){ public R info(@PathVariable("roleId") Long roleId){
SysRoleEntity role = sysRoleService.getById(roleId); SysRoleEntity role = sysRoleService.getById(roleId);
//查询角色对应的菜单 //查询角色对应的菜单
List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId); List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId);
role.setMenuIdList(menuIdList); role.setMenuIdList(menuIdList);
return R.ok().put("role", role); return R.ok().put("role", role);
} }
/** /**
* 保存角色 * 保存角色
*/ */
...@@ -93,13 +93,13 @@ public class SysRoleController extends AbstractController { ...@@ -93,13 +93,13 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:save") @RequiresPermissions("sys:role:save")
public R save(@RequestBody SysRoleEntity role){ public R save(@RequestBody SysRoleEntity role){
ValidatorUtils.validateEntity(role); ValidatorUtils.validateEntity(role);
role.setCreateUserId(getUserId()); role.setCreateUserId(getUserId());
sysRoleService.saveRole(role); sysRoleService.saveRole(role);
return R.ok(); return R.ok();
} }
/** /**
* 修改角色 * 修改角色
*/ */
...@@ -108,13 +108,13 @@ public class SysRoleController extends AbstractController { ...@@ -108,13 +108,13 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:update") @RequiresPermissions("sys:role:update")
public R update(@RequestBody SysRoleEntity role){ public R update(@RequestBody SysRoleEntity role){
ValidatorUtils.validateEntity(role); ValidatorUtils.validateEntity(role);
role.setCreateUserId(getUserId()); role.setCreateUserId(getUserId());
sysRoleService.update(role); sysRoleService.update(role);
return R.ok(); return R.ok();
} }
/** /**
* 删除角色 * 删除角色
*/ */
...@@ -123,7 +123,7 @@ public class SysRoleController extends AbstractController { ...@@ -123,7 +123,7 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:delete") @RequiresPermissions("sys:role:delete")
public R delete(@RequestBody Long[] roleIds){ public R delete(@RequestBody Long[] roleIds){
sysRoleService.deleteBatch(roleIds); sysRoleService.deleteBatch(roleIds);
return R.ok(); return R.ok();
} }
} }
...@@ -50,14 +50,14 @@ public class SysUserController extends AbstractController { ...@@ -50,14 +50,14 @@ public class SysUserController extends AbstractController {
@RequiresPermissions("sys:user:list") @RequiresPermissions("sys:user:list")
public R list(@RequestParam Map<String, Object> params){ public R list(@RequestParam Map<String, Object> params){
//只有超级管理员,才能查看所有管理员列表 //只有超级管理员,才能查看所有管理员列表
// if(getUserId() != Constant.SUPER_ADMIN){ if(getUserId() != Constant.SUPER_ADMIN){
// params.put("createUserId", getUserId()); params.put("createUserId", getUserId());
// } }
PageUtils page = sysUserService.queryPage(params); PageUtils page = sysUserService.queryPage(params);
return R.ok().put("page", page); return R.ok().put("page", page);
} }
/** /**
* 获取登录的用户信息 * 获取登录的用户信息
*/ */
...@@ -65,7 +65,7 @@ public class SysUserController extends AbstractController { ...@@ -65,7 +65,7 @@ public class SysUserController extends AbstractController {
public R info(){ public R info(){
return R.ok().put("user", getUser()); return R.ok().put("user", getUser());
} }
/** /**
* 修改登录用户密码 * 修改登录用户密码
*/ */
...@@ -73,21 +73,21 @@ public class SysUserController extends AbstractController { ...@@ -73,21 +73,21 @@ public class SysUserController extends AbstractController {
@RequestMapping("/password") @RequestMapping("/password")
public R password(@RequestBody PasswordForm form){ public R password(@RequestBody PasswordForm form){
Assert.isBlank(form.getNewPassword(), "新密码不为能空"); Assert.isBlank(form.getNewPassword(), "新密码不为能空");
//sha256加密 //sha256加密
String password = new Sha256Hash(form.getPassword(), getUser().getSalt()).toHex(); String password = new Sha256Hash(form.getPassword(), getUser().getSalt()).toHex();
//sha256加密 //sha256加密
String newPassword = new Sha256Hash(form.getNewPassword(), getUser().getSalt()).toHex(); String newPassword = new Sha256Hash(form.getNewPassword(), getUser().getSalt()).toHex();
//更新密码 //更新密码
boolean flag = sysUserService.updatePassword(getUserId(), password, newPassword); boolean flag = sysUserService.updatePassword(getUserId(), password, newPassword);
if(!flag){ if(!flag){
return R.error("原密码不正确"); return R.error("原密码不正确");
} }
return R.ok(); return R.ok();
} }
/** /**
* 用户信息 * 用户信息
*/ */
...@@ -95,14 +95,14 @@ public class SysUserController extends AbstractController { ...@@ -95,14 +95,14 @@ public class SysUserController extends AbstractController {
@RequiresPermissions("sys:user:info") @RequiresPermissions("sys:user:info")
public R info(@PathVariable("userId") Long userId){ public R info(@PathVariable("userId") Long userId){
SysUserEntity user = sysUserService.getById(userId); SysUserEntity user = sysUserService.getById(userId);
//获取用户所属的角色列表 //获取用户所属的角色列表
List<Long> roleIdList = sysUserRoleService.queryRoleIdList(userId); List<Long> roleIdList = sysUserRoleService.queryRoleIdList(userId);
user.setRoleIdList(roleIdList); user.setRoleIdList(roleIdList);
return R.ok().put("user", user); return R.ok().put("user", user);
} }
/** /**
* 保存用户 * 保存用户
*/ */
...@@ -111,13 +111,13 @@ public class SysUserController extends AbstractController { ...@@ -111,13 +111,13 @@ public class SysUserController extends AbstractController {
@RequiresPermissions("sys:user:save") @RequiresPermissions("sys:user:save")
public R save(@RequestBody SysUserEntity user){ public R save(@RequestBody SysUserEntity user){
ValidatorUtils.validateEntity(user, AddGroup.class); ValidatorUtils.validateEntity(user, AddGroup.class);
user.setCreateUserId(getUserId()); user.setCreateUserId(getUserId());
sysUserService.saveUser(user); sysUserService.saveUser(user);
return R.ok(); return R.ok();
} }
/** /**
* 修改用户 * 修改用户
*/ */
...@@ -129,10 +129,10 @@ public class SysUserController extends AbstractController { ...@@ -129,10 +129,10 @@ public class SysUserController extends AbstractController {
user.setCreateUserId(getUserId()); user.setCreateUserId(getUserId());
sysUserService.update(user); sysUserService.update(user);
return R.ok(); return R.ok();
} }
/** /**
* 删除用户 * 删除用户
*/ */
...@@ -143,13 +143,13 @@ public class SysUserController extends AbstractController { ...@@ -143,13 +143,13 @@ public class SysUserController extends AbstractController {
if(ArrayUtils.contains(userIds, 1L)){ if(ArrayUtils.contains(userIds, 1L)){
return R.error("系统管理员不能删除"); return R.error("系统管理员不能删除");
} }
if(ArrayUtils.contains(userIds, getUserId())){ if(ArrayUtils.contains(userIds, getUserId())){
return R.error("当前用户不能删除"); return R.error("当前用户不能删除");
} }
sysUserService.deleteBatch(userIds); sysUserService.deleteBatch(userIds);
return R.ok(); return R.ok();
} }
} }
...@@ -30,14 +30,14 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i ...@@ -30,14 +30,14 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
private SysUserService sysUserService; private SysUserService sysUserService;
@Autowired @Autowired
private SysRoleMenuService sysRoleMenuService; private SysRoleMenuService sysRoleMenuService;
@Override @Override
public List<SysMenuEntity> queryListParentId(Long parentId, List<Long> menuIdList) { public List<SysMenuEntity> queryListParentId(Long parentId, List<Long> menuIdList) {
List<SysMenuEntity> menuList = queryListParentId(parentId); List<SysMenuEntity> menuList = queryListParentId(parentId);
if(menuIdList == null){ if(menuIdList == null){
return menuList; return menuList;
} }
List<SysMenuEntity> userMenuList = new ArrayList<>(); List<SysMenuEntity> userMenuList = new ArrayList<>();
for(SysMenuEntity menu : menuList){ for(SysMenuEntity menu : menuList){
if(menuIdList.contains(menu.getMenuId())){ if(menuIdList.contains(menu.getMenuId())){
...@@ -60,10 +60,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i ...@@ -60,10 +60,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
@Override @Override
public List<SysMenuEntity> getUserMenuList(Long userId) { public List<SysMenuEntity> getUserMenuList(Long userId) {
//系统管理员,拥有最高权限 //系统管理员,拥有最高权限
// if(userId == Constant.SUPER_ADMIN){ if(userId == Constant.SUPER_ADMIN){
// return getAllMenuList(null); return getAllMenuList(null);
// } }
//用户菜单列表 //用户菜单列表
List<Long> menuIdList = sysUserService.queryAllMenuId(userId); List<Long> menuIdList = sysUserService.queryAllMenuId(userId);
return getAllMenuList(menuIdList); return getAllMenuList(menuIdList);
...@@ -85,7 +85,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i ...@@ -85,7 +85,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
List<SysMenuEntity> menuList = queryListParentId(0L, menuIdList); List<SysMenuEntity> menuList = queryListParentId(0L, menuIdList);
//递归获取子菜单 //递归获取子菜单
getMenuTreeList(menuList, menuIdList); getMenuTreeList(menuList, menuIdList);
return menuList; return menuList;
} }
...@@ -94,7 +94,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i ...@@ -94,7 +94,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
*/ */
private List<SysMenuEntity> getMenuTreeList(List<SysMenuEntity> menuList, List<Long> menuIdList){ private List<SysMenuEntity> getMenuTreeList(List<SysMenuEntity> menuList, List<Long> menuIdList){
List<SysMenuEntity> subMenuList = new ArrayList<SysMenuEntity>(); List<SysMenuEntity> subMenuList = new ArrayList<SysMenuEntity>();
for(SysMenuEntity entity : menuList){ for(SysMenuEntity entity : menuList){
//目录 //目录
if(entity.getType() == Constant.MenuType.CATALOG.getValue()){ if(entity.getType() == Constant.MenuType.CATALOG.getValue()){
...@@ -102,7 +102,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i ...@@ -102,7 +102,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
} }
subMenuList.add(entity); subMenuList.add(entity);
} }
return subMenuList; return subMenuList;
} }
} }
...@@ -87,7 +87,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i ...@@ -87,7 +87,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
this.save(role); this.save(role);
//检查权限是否越权 //检查权限是否越权
checkPrems(role); //checkPrems(role);
//保存角色与菜单关系 //保存角色与菜单关系
sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList()); sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList());
...@@ -99,7 +99,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i ...@@ -99,7 +99,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
this.updateById(role); this.updateById(role);
//检查权限是否越权 //检查权限是否越权
checkPrems(role); //checkPrems(role);
//更新角色与菜单关系 //更新角色与菜单关系
sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList()); sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList());
...@@ -129,9 +129,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i ...@@ -129,9 +129,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
*/ */
private void checkPrems(SysRoleEntity role) { private void checkPrems(SysRoleEntity role) {
//如果不是超级管理员,则需要判断角色的权限是否超过自己的权限 //如果不是超级管理员,则需要判断角色的权限是否超过自己的权限
// if(role.getCreateUserId() == Constant.SUPER_ADMIN){ if(role.getCreateUserId() == Constant.SUPER_ADMIN){
// return ; return ;
// } }
//查询用户所拥有的菜单列表 //查询用户所拥有的菜单列表
List<Long> menuIdList = sysUserService.queryAllMenuId(role.getCreateUserId()); List<Long> menuIdList = sysUserService.queryAllMenuId(role.getCreateUserId());
......
...@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.exception.RRException; import io.office.common.exception.RRException;
import io.office.common.utils.Constant;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.common.utils.Query; import io.office.common.utils.Query;
import io.office.modules.sys.dao.SysUserDao; import io.office.modules.sys.dao.SysUserDao;
...@@ -84,10 +83,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i ...@@ -84,10 +83,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
user.setPassword(new Sha256Hash(user.getPassword(), salt).toHex()); user.setPassword(new Sha256Hash(user.getPassword(), salt).toHex());
user.setSalt(salt); user.setSalt(salt);
this.save(user); this.save(user);
//检查角色是否越权 //检查角色是否越权
checkRole(user); //checkRole(user);
//保存用户与角色关系 //保存用户与角色关系
sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList()); sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList());
} }
...@@ -101,10 +100,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i ...@@ -101,10 +100,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
user.setPassword(new Sha256Hash(user.getPassword(), user.getSalt()).toHex()); user.setPassword(new Sha256Hash(user.getPassword(), user.getSalt()).toHex());
} }
this.updateById(user); this.updateById(user);
//检查角色是否越权 //检查角色是否越权
checkRole(user); //checkRole(user);
//保存用户与角色关系 //保存用户与角色关系
sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList()); sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList());
} }
...@@ -121,7 +120,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i ...@@ -121,7 +120,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
return this.update(userEntity, return this.update(userEntity,
new QueryWrapper<SysUserEntity>().eq("user_id", userId).eq("password", password)); new QueryWrapper<SysUserEntity>().eq("user_id", userId).eq("password", password));
} }
/** /**
* 检查角色是否越权 * 检查角色是否越权
*/ */
...@@ -130,10 +129,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i ...@@ -130,10 +129,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
return; return;
} }
//如果不是超级管理员,则需要判断用户的角色是否自己创建 //如果不是超级管理员,则需要判断用户的角色是否自己创建
// if(user.getCreateUserId() == Constant.SUPER_ADMIN){ //if(user.getCreateUserId() == Constant.SUPER_ADMIN){
// return ; // return ;
// } //}
//查询用户创建的角色列表 //查询用户创建的角色列表
List<Long> roleIdList = sysRoleService.queryRoleIdList(user.getCreateUserId()); List<Long> roleIdList = sysRoleService.queryRoleIdList(user.getCreateUserId());
...@@ -142,4 +141,4 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i ...@@ -142,4 +141,4 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
throw new RRException("新增用户所选角色,不是本人创建"); throw new RRException("新增用户所选角色,不是本人创建");
} }
} }
} }
\ No newline at end of file
...@@ -18,9 +18,10 @@ ...@@ -18,9 +18,10 @@
<select id="getListPageNews" parameterType="io.office.modules.manage.entity.dto.ClickDetailDTO" <select id="getListPageNews" parameterType="io.office.modules.manage.entity.dto.ClickDetailDTO"
resultType="io.office.modules.manage.entity.dto.ClickDetailDTO"> resultType="io.office.modules.manage.entity.dto.ClickDetailDTO">
select * from ( select a.ID,title,'1' typeValue,(select count(*) from click_detail b where type_value=1 and select * from ( select a.ID,title,'1' typeValue,'文章统计' typeName,(select count(*) from click_detail b where type_value=1 and
b.c_id=a.Id) countNum, b.c_id=a.Id) countNum,
releasedate inputDate,CONVERT(varchar(100),releasedate,120) inputDateStr,directpath jumpPath ,editor , updatedate from news a where ((classid between 5 and 8) or releasedate inputDate,CONVERT(varchar(100),releasedate,120) inputDateStr,directpath jumpPath ,editor ,
updatedate ,content from news a where ((classid between 5 and 8) or
(classid in (select Id (classid in (select Id
from newsClass where p_id=5))) and levels>0 from newsClass where p_id=5))) and levels>0
<if test="clickDetailDTO.keyWordType=='1'.toString()"> <if test="clickDetailDTO.keyWordType=='1'.toString()">
...@@ -38,10 +39,22 @@ ...@@ -38,10 +39,22 @@
and a.ID =#{clickDetailDTO.keyWord} and a.ID =#{clickDetailDTO.keyWord}
</if> </if>
</if> </if>
<if test="clickDetailDTO.releaseTimeStart!=null and clickDetailDTO.releaseTimeStart!=''">
and a.releasedate &gt;=#{clickDetailDTO.releaseTimeStart}
</if>
<if test="clickDetailDTO.releaseTimeEnd!=null and clickDetailDTO.releaseTimeEnd!=''">
and a.releasedate &lt;=#{clickDetailDTO.releaseTimeEnd}
</if>
) c ) c
<choose> <choose>
<when test="clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''"> <when test="clickDetailDTO.keyWordType=='1'.toString() and clickDetailDTO.order!=null and clickDetailDTO.order!=''">
ORDER BY c.${clickDetailDTO.sidx} ${clickDetailDTO.order} ORDER BY content ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY title ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY id ${clickDetailDTO.order}
</when> </when>
<otherwise> <otherwise>
ORDER BY c.id DESC ORDER BY c.id DESC
...@@ -54,8 +67,8 @@ ...@@ -54,8 +67,8 @@
resultType="io.office.modules.manage.entity.dto.ClickDetailDTO"> resultType="io.office.modules.manage.entity.dto.ClickDetailDTO">
select * from ( SELECT select * from ( SELECT
a.pictureid ID, a.pictureid ID,
title, title,content,
'2' typeValue, '2' typeValue,'图片统计' typeName,
( SELECT COUNT ( * ) FROM click_detail b WHERE type_value = 2 AND b.c_id= a.pictureid ) countNum, ( SELECT COUNT ( * ) FROM click_detail b WHERE type_value = 2 AND b.c_id= a.pictureid ) countNum,
inputDate,CONVERT(varchar(100),inputDate,120) inputDateStr, inputDate,CONVERT(varchar(100),inputDate,120) inputDateStr,
jumpPath,editor jumpPath,editor
...@@ -75,16 +88,28 @@ ...@@ -75,16 +88,28 @@
and a.pictureid =#{clickDetailDTO.keyWord} and a.pictureid =#{clickDetailDTO.keyWord}
</if> </if>
</if> </if>
<if test="clickDetailDTO.releaseTimeStart!=null and clickDetailDTO.releaseTimeStart!=''">
and a.inputDate &gt;=#{clickDetailDTO.releaseTimeStart}
</if>
<if test="clickDetailDTO.releaseTimeEnd!=null and clickDetailDTO.releaseTimeEnd!=''">
and a.inputDate &lt;=#{clickDetailDTO.releaseTimeEnd}
</if>
) c ) c
<choose> <choose>
<when test="clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''"> <when test="clickDetailDTO.keyWordType=='1'.toString() and clickDetailDTO.order!=null and clickDetailDTO.order!=''">
ORDER BY c.${clickDetailDTO.sidx} ${clickDetailDTO.order} ORDER BY content ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY title ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY id ${clickDetailDTO.order}
</when> </when>
<otherwise> <otherwise>
ORDER BY c.id DESC ORDER BY c.id DESC
</otherwise> </otherwise>
</choose> </choose>
</select> </select>
...@@ -93,7 +118,8 @@ ...@@ -93,7 +118,8 @@
select * from ( SELECT select * from ( SELECT
a.classid ID, a.classid ID,
title, title,
'3' typeValue, '3' typeValue,shortcontent,
'专题统计' typeName,
( (
SELECT COUNT(*) FROM SELECT COUNT(*) FROM
click_detail b click_detail b
...@@ -101,7 +127,7 @@ ...@@ -101,7 +127,7 @@
type_value = 3 type_value = 3
AND b.c_id= a.classid AND b.c_id= a.classid
) countNum, ) countNum,
TIME inputDate, TIME inputDate
,CONVERT(varchar(100),TIME,120) inputDateStr, ,CONVERT(varchar(100),TIME,120) inputDateStr,
directpath jumpPath, directpath jumpPath,
editor editor
...@@ -126,10 +152,22 @@ ...@@ -126,10 +152,22 @@
and a.classid =#{clickDetailDTO.keyWord} and a.classid =#{clickDetailDTO.keyWord}
</if> </if>
</if> </if>
<if test="clickDetailDTO.releaseTimeStart!=null and clickDetailDTO.releaseTimeStart!=''">
and a.TIME &gt;=#{clickDetailDTO.releaseTimeStart}
</if>
<if test="clickDetailDTO.releaseTimeEnd!=null and clickDetailDTO.releaseTimeEnd!=''">
and a.TIME &lt;=#{clickDetailDTO.releaseTimeEnd}
</if>
) c ) c
<choose> <choose>
<when test="clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''"> <when test="clickDetailDTO.keyWordType=='1'.toString() and clickDetailDTO.order!=null and clickDetailDTO.order!=''">
ORDER BY c.${clickDetailDTO.sidx} ${clickDetailDTO.order} ORDER BY shortcontent ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY title ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY id ${clickDetailDTO.order}
</when> </when>
<otherwise> <otherwise>
ORDER BY c.id DESC ORDER BY c.id DESC
...@@ -141,8 +179,9 @@ ...@@ -141,8 +179,9 @@
resultType="io.office.modules.manage.entity.dto.ClickDetailDTO"> resultType="io.office.modules.manage.entity.dto.ClickDetailDTO">
select * from ( SELECT select * from ( SELECT
a.ID, a.ID,
title, title,brief,
'4' typeValue, '4' typeValue,
'视频统计' typeName,
( (
SELECT SELECT
COUNT (*) COUNT (*)
...@@ -152,7 +191,7 @@ ...@@ -152,7 +191,7 @@
b.type_value = 4 b.type_value = 4
AND b.c_id = a.Id AND b.c_id = a.Id
) countNum, ) countNum,
releasedate inputDate, releasedate inputDate
,CONVERT(varchar(100),releasedate,120) inputDateStr, ,CONVERT(varchar(100),releasedate,120) inputDateStr,
directpath jumpPath, directpath jumpPath,
editor editor
...@@ -175,10 +214,22 @@ ...@@ -175,10 +214,22 @@
and a.id =#{clickDetailDTO.keyWord} and a.id =#{clickDetailDTO.keyWord}
</if> </if>
</if> </if>
<if test="clickDetailDTO.releaseTimeStart!=null and clickDetailDTO.releaseTimeStart!=''">
and a.releasedate &gt;=#{clickDetailDTO.releaseTimeStart}
</if>
<if test="clickDetailDTO.releaseTimeEnd!=null and clickDetailDTO.releaseTimeEnd!=''">
and a.releasedate &lt;=#{clickDetailDTO.releaseTimeEnd}
</if>
) c ) c
<choose> <choose>
<when test="clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''"> <when test="clickDetailDTO.keyWordType=='1'.toString() and clickDetailDTO.order!=null and clickDetailDTO.order!=''">
ORDER BY c.${clickDetailDTO.sidx} ${clickDetailDTO.order} ORDER BY brief ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY title ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY id ${clickDetailDTO.order}
</when> </when>
<otherwise> <otherwise>
ORDER BY c.id DESC ORDER BY c.id DESC
...@@ -191,8 +242,9 @@ ...@@ -191,8 +242,9 @@
resultType="io.office.modules.manage.entity.dto.ClickDetailDTO"> resultType="io.office.modules.manage.entity.dto.ClickDetailDTO">
select * from ( SELECT select * from ( SELECT
a.ID, a.ID,
title, title,content,
'5' typeValue, '5' typeValue,
'政策法规' typeName,
( SELECT COUNT ( * ) FROM click_detail b WHERE type_value = 5 AND b.c_id= a.Id ) countNum, ( SELECT COUNT ( * ) FROM click_detail b WHERE type_value = 5 AND b.c_id= a.Id ) countNum,
releasedate inputDate, releasedate inputDate,
,CONVERT(varchar(100),releasedate,120) inputDateStr, ,CONVERT(varchar(100),releasedate,120) inputDateStr,
...@@ -217,10 +269,22 @@ ...@@ -217,10 +269,22 @@
and a.id =#{clickDetailDTO.keyWord} and a.id =#{clickDetailDTO.keyWord}
</if> </if>
</if> </if>
<if test="clickDetailDTO.releaseTimeStart!=null and clickDetailDTO.releaseTimeStart!=''">
and a.releasedate &gt;=#{clickDetailDTO.releaseTimeStart}
</if>
<if test="clickDetailDTO.releaseTimeEnd!=null and clickDetailDTO.releaseTimeEnd!=''">
and a.releasedate &lt;=#{clickDetailDTO.releaseTimeEnd}
</if>
) c ) c
<choose> <choose>
<when test="clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''"> <when test="clickDetailDTO.keyWordType=='1'.toString() and clickDetailDTO.order!=null and clickDetailDTO.order!=''">
ORDER BY c.${clickDetailDTO.sidx} ${clickDetailDTO.order} ORDER BY content ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY title ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY id ${clickDetailDTO.order}
</when> </when>
<otherwise> <otherwise>
ORDER BY c.id DESC ORDER BY c.id DESC
...@@ -235,10 +299,11 @@ ...@@ -235,10 +299,11 @@
select * from ( select * from (
SELECT SELECT
a.ID, a.ID,
title, title,content,
'6' typeValue, '6' typeValue,
'应用领域' typeName,
( SELECT COUNT ( * ) FROM click_detail b WHERE type_Value = 6 AND b.c_id= a.Id ) countNum, ( SELECT COUNT ( * ) FROM click_detail b WHERE type_Value = 6 AND b.c_id= a.Id ) countNum,
releasedate inputDate, releasedate inputDate
,CONVERT(varchar(100),releasedate,120) inputDateStr, ,CONVERT(varchar(100),releasedate,120) inputDateStr,
directpath jumpPath, directpath jumpPath,
editor editor
...@@ -262,10 +327,22 @@ ...@@ -262,10 +327,22 @@
and a.ID =#{clickDetailDTO.keyWord} and a.ID =#{clickDetailDTO.keyWord}
</if> </if>
</if> </if>
<if test="clickDetailDTO.releaseTimeStart!=null and clickDetailDTO.releaseTimeStart!=''">
and a.releasedate &gt;=#{clickDetailDTO.releaseTimeStart}
</if>
<if test="clickDetailDTO.releaseTimeEnd!=null and clickDetailDTO.releaseTimeEnd!=''">
and a.releasedate &lt;=#{clickDetailDTO.releaseTimeEnd}
</if>
) c ) c
<choose> <choose>
<when test="clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''"> <when test="clickDetailDTO.keyWordType=='1'.toString() and clickDetailDTO.order!=null and clickDetailDTO.order!=''">
ORDER BY c.${clickDetailDTO.sidx} ${clickDetailDTO.order} ORDER BY content ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY title ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY id ${clickDetailDTO.order}
</when> </when>
<otherwise> <otherwise>
ORDER BY c.id DESC ORDER BY c.id DESC
...@@ -279,10 +356,11 @@ ...@@ -279,10 +356,11 @@
select * from ( SELECT select * from ( SELECT
a.knowledgeInfoID ID, a.knowledgeInfoID ID,
title, title,content,
'7' typeValue, '7' typeValue,
'知识统计' typeName,
( SELECT COUNT ( * ) FROM click_detail b WHERE type_Value = 7 AND b.c_id= a.knowledgeInfoID ) countNum, ( SELECT COUNT ( * ) FROM click_detail b WHERE type_Value = 7 AND b.c_id= a.knowledgeInfoID ) countNum,
inputDate, inputDate
,CONVERT(varchar(100),inputDate,120) inputDateStr, ,CONVERT(varchar(100),inputDate,120) inputDateStr,
directpath jumpPath, directpath jumpPath,
editor editor
...@@ -305,10 +383,22 @@ ...@@ -305,10 +383,22 @@
and a.knowledgeInfoID =#{clickDetailDTO.keyWord} and a.knowledgeInfoID =#{clickDetailDTO.keyWord}
</if> </if>
</if> </if>
<if test="clickDetailDTO.releaseTimeStart!=null and clickDetailDTO.releaseTimeStart!=''">
and a.inputDate &gt;=#{clickDetailDTO.releaseTimeStart}
</if>
<if test="clickDetailDTO.releaseTimeEnd!=null and clickDetailDTO.releaseTimeEnd!=''">
and a.inputDate &lt;=#{clickDetailDTO.releaseTimeEnd}
</if>
) c ) c
<choose> <choose>
<when test="clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''"> <when test="clickDetailDTO.keyWordType=='1'.toString() and clickDetailDTO.order!=null and clickDetailDTO.order!=''">
ORDER BY c.${clickDetailDTO.sidx} ${clickDetailDTO.order} ORDER BY content ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY title ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY id ${clickDetailDTO.order}
</when> </when>
<otherwise> <otherwise>
ORDER BY c.id DESC ORDER BY c.id DESC
...@@ -319,9 +409,10 @@ ...@@ -319,9 +409,10 @@
<select id="getListPageProducts" parameterType="io.office.modules.manage.entity.dto.ClickDetailDTO" <select id="getListPageProducts" parameterType="io.office.modules.manage.entity.dto.ClickDetailDTO"
resultType="io.office.modules.manage.entity.dto.ClickDetailDTO"> resultType="io.office.modules.manage.entity.dto.ClickDetailDTO">
select * from ( SELECT select * from ( SELECT
a.ID, a.ID,description,
prename title, prename title,
'9' typeValue, '9' typeValue,
'图书文献' typeName,
( (
SELECT COUNT SELECT COUNT
( * ) ( * )
...@@ -331,7 +422,7 @@ ...@@ -331,7 +422,7 @@
type_Value = 9 type_Value = 9
AND b.c_id= a.ID AND b.c_id= a.ID
) countNum, ) countNum,
adddate inputDate, adddate inputDate
,CONVERT(varchar(100),adddate,120) inputDateStr, ,CONVERT(varchar(100),adddate,120) inputDateStr,
'' jumpPath, '' jumpPath,
author author
...@@ -354,10 +445,22 @@ ...@@ -354,10 +445,22 @@
and a.id =#{clickDetailDTO.keyWord} and a.id =#{clickDetailDTO.keyWord}
</if> </if>
</if> </if>
<if test="clickDetailDTO.releaseTimeStart!=null and clickDetailDTO.releaseTimeStart!=''">
and a.adddate &gt;=#{clickDetailDTO.releaseTimeStart}
</if>
<if test="clickDetailDTO.releaseTimeEnd!=null and clickDetailDTO.releaseTimeEnd!=''">
and a.adddate &lt;=#{clickDetailDTO.releaseTimeEnd}
</if>
) c ) c
<choose> <choose>
<when test="clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''"> <when test="clickDetailDTO.keyWordType=='1'.toString() and clickDetailDTO.order!=null and clickDetailDTO.order!=''">
ORDER BY c.${clickDetailDTO.sidx} ${clickDetailDTO.order} ORDER BY description ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY title ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY id ${clickDetailDTO.order}
</when> </when>
<otherwise> <otherwise>
ORDER BY c.id DESC ORDER BY c.id DESC
...@@ -368,11 +471,12 @@ ...@@ -368,11 +471,12 @@
<select id="getListPageAnnounces" parameterType="io.office.modules.manage.entity.dto.ClickDetailDTO" <select id="getListPageAnnounces" parameterType="io.office.modules.manage.entity.dto.ClickDetailDTO"
resultType="io.office.modules.manage.entity.dto.ClickDetailDTO"> resultType="io.office.modules.manage.entity.dto.ClickDetailDTO">
select * from ( SELECT select * from ( SELECT
a.ID, a.ID,content,
title, title,
'12' typeValue, '12' typeValue,
'公告统计' typeName,
( SELECT COUNT ( * ) FROM click_detail b WHERE type_Value = 12 AND b.c_id= a.Id ) countNum, ( SELECT COUNT ( * ) FROM click_detail b WHERE type_Value = 12 AND b.c_id= a.Id ) countNum,
releasedate inputDate, releasedate inputDate
,CONVERT(varchar(100),releasedate,120) inputDateStr, ,CONVERT(varchar(100),releasedate,120) inputDateStr,
'' jumpPath, '' jumpPath,
editor editor
...@@ -397,10 +501,22 @@ ...@@ -397,10 +501,22 @@
and a.id =#{clickDetailDTO.keyWord} and a.id =#{clickDetailDTO.keyWord}
</if> </if>
</if> </if>
<if test="clickDetailDTO.releaseTimeStart!=null and clickDetailDTO.releaseTimeStart!=''">
and a.releasedate &gt;=#{clickDetailDTO.releaseTimeStart}
</if>
<if test="clickDetailDTO.releaseTimeEnd!=null and clickDetailDTO.releaseTimeEnd!=''">
and a.releasedate &lt;=#{clickDetailDTO.releaseTimeEnd}
</if>
) c ) c
<choose> <choose>
<when test="clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''"> <when test="clickDetailDTO.keyWordType=='1'.toString() and clickDetailDTO.order!=null and clickDetailDTO.order!=''">
ORDER BY c.${clickDetailDTO.sidx} ${clickDetailDTO.order} ORDER BY content ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY title ${clickDetailDTO.order}
</when>
<when test="clickDetailDTO.keyWordType=='2'.toString() and clickDetailDTO.sidx!=null and clickDetailDTO.sidx!=''">
ORDER BY id ${clickDetailDTO.order}
</when> </when>
<otherwise> <otherwise>
ORDER BY c.id DESC ORDER BY c.id DESC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment