| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtPageDto; |
| | | import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; |
| | | import com.ruoyi.system.domain.dto.*; |
| | | import com.ruoyi.system.domain.vo.*; |
| | | import com.ruoyi.system.service.config.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.web.domain.AjaxResult.success; |
| | | |
| | | /** |
| | | * @ClassName MgtConfigController |
| | |
| | | |
| | | @Resource |
| | | private ArticleService articleService; |
| | | |
| | | @Resource |
| | | private RegionService regionService; |
| | | |
| | | @Resource |
| | | private RecommendCooperationService recommendCooperationService; |
| | | |
| | | |
| | | @RequestMapping(value = "/getCustomConfig", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取单个配置") |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/deleteActiveness", method = RequestMethod.POST) |
| | | @ApiOperation(value = "删除活跃度") |
| | | public R deleteMgtActiveness(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | mgtBaseGetDto.setUserId(SecurityUtils.getUserId()); |
| | | activenessService.deleteMgtActiveness(mgtBaseGetDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageClassification", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取分类列表") |
| | | public R<Page<MgtClassificationPageVo>> pageClassification(@RequestBody MgtClassificationPageDto mgtClassificationPageDto) { |
| | |
| | | return R.ok(page.setRecords(mgtOperLogPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/exportPageOperLog", method = RequestMethod.POST) |
| | | @ApiOperation(value = "导出操作日志") |
| | | public void exportPageOperLog(@RequestBody MgtOperLogPageDto mgtOperLogPageDto, HttpServletResponse response) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtOperLogPageDto.setUserId(userId); |
| | | Page<MgtOperLogPageVo> page = new Page<>(); |
| | | page.setSize(2000); |
| | | page.setCurrent(1); |
| | | List<MgtOperLogPageVo> mgtOperLogPageVoList = customConfigService.pageOperLog(page, mgtOperLogPageDto); |
| | | ExcelUtil<MgtOperLogPageVo> util = new ExcelUtil<MgtOperLogPageVo>(MgtOperLogPageVo.class); |
| | | util.exportExcel(response, mgtOperLogPageVoList, "操作日志"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageTag", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取标签列表") |
| | | public R<Page<MgtTagPageVo>> pageTag(@RequestBody MgtTagPageDto mgtTagPageDto) { |
| | |
| | | page.setCurrent(mgtTagPageDto.getPageNum()); |
| | | List<MgtTagPageVo> mgtTagPageVoList = sysTagService.pageTag(page, mgtTagPageDto); |
| | | return R.ok(page.setRecords(mgtTagPageVoList)); |
| | | } |
| | | |
| | | @ApiOperation(value = "导入标签") |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file, Integer tagType) throws Exception |
| | | { |
| | | ExcelUtil<MgtTagImportDto> util = new ExcelUtil<MgtTagImportDto>(MgtTagImportDto.class); |
| | | List<MgtTagImportDto> tagList = util.importExcel(file.getInputStream()); |
| | | String operName = SecurityUtils.getUsername(); |
| | | String message = sysTagService.importTag(tagList, tagType, operName); |
| | | return success(message); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载标签模板") |
| | | @PostMapping("/importTemplate") |
| | | public void importTemplate(HttpServletResponse response) throws IOException |
| | | { |
| | | ExcelUtil<MgtTagImportDto> util = new ExcelUtil<MgtTagImportDto>(MgtTagImportDto.class); |
| | | util.importTemplateExcel(response, "标签导入模板"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/editTag", method = RequestMethod.POST) |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageArticle", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取标签列表") |
| | | @ApiOperation(value = "分页获取文章列表") |
| | | public R<Page<MgtArticlePageVo>> pageArticle(@RequestBody MgtArticlePageDto mgtArticlePageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtArticlePageDto.setUserId(userId); |
| | |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/listRegion", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取省市区列表") |
| | | public R<List<RegionVo>> listRegion(){ |
| | | List<RegionVo> regionVoList = regionService.listRegionVo(); |
| | | return R.ok(regionVoList); |
| | | } |
| | | |
| | | @RequestMapping(value = "/listCity", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取省市列表") |
| | | public R<List<RegionVo>> listCity(){ |
| | | List<RegionVo> regionVoList = regionService.listRegionVo(); |
| | | return R.ok(regionVoList); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageAllotRecommend", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取推荐分配列表") |
| | | public R<Page<MgtAllotRecommendPageVo>> pageAllotRecommend(@RequestBody MgtAllotRecommendPageDto mgtAllotRecommendPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtAllotRecommendPageDto.setUserId(userId); |
| | | Page<MgtAllotRecommendPageVo> page = new Page<>(); |
| | | page.setSize(mgtAllotRecommendPageDto.getPageSize()); |
| | | page.setCurrent(mgtAllotRecommendPageDto.getPageNum()); |
| | | List<MgtAllotRecommendPageVo> allotRecommendPageVoList = recommendCooperationService.pageAllotRecommend(page, mgtAllotRecommendPageDto); |
| | | return R.ok(page.setRecords(allotRecommendPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/allotRecommend", method = RequestMethod.POST) |
| | | @ApiOperation(value = "删除文章") |
| | | public R allotRecommend(@RequestBody MgtAllotRecommendDto mgtAllotRecommendDto) { |
| | | mgtAllotRecommendDto.setUserId(SecurityUtils.getUserId()); |
| | | recommendCooperationService.allotRecommend(mgtAllotRecommendDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getBulletinBoard", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取看板统计") |
| | | public R<MgtBulletinBoardVo> getBulletinBoard() { |
| | | MgtBulletinBoardVo bulletinBoard = customConfigService.getBulletinBoard(); |
| | | return R.ok(bulletinBoard); |
| | | } |
| | | } |