Commit cd9e1cfb by 吴迪

Merge remote-tracking branch 'origin/master'

parents a8eb4c4b afddff05
...@@ -2,6 +2,8 @@ package io.office.modules.manage.controller; ...@@ -2,6 +2,8 @@ package io.office.modules.manage.controller;
import java.util.List; import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.app.annotation.Login; import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.dto.NewsParams; import io.office.modules.manage.entity.dto.NewsParams;
...@@ -134,5 +136,31 @@ public class NewsController extends AbstractController { ...@@ -134,5 +136,31 @@ public class NewsController extends AbstractController {
} }
} }
/**
* 资讯中心
*/
@Login
@PostMapping("/api/realTimeInfo")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R realTimeInfo(@RequestParam Map<String, Object> params) {
try {
return R.ok().put("data", newsService.selectRealTimeInfo(params));
} catch (Exception e) {
log.error("realTimeInfo error:", e);
return R.error(e.getMessage());
}
}
/**
* 资讯中心查看
*/
@Login
@GetMapping("/api/info/{id}")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R getDetail(@PathVariable("id") Integer id) {
NewsEntity news = newsService.getById(id);
return R.ok().put("data", news);
}
} }
...@@ -141,4 +141,37 @@ public class PictureController extends AbstractController { ...@@ -141,4 +141,37 @@ public class PictureController extends AbstractController {
} }
} }
@Login
@PostMapping("/api/pictureList")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R pictureList() {
try {
QueryWrapper<PictureEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("status","1");
newsEntityQueryWrapper.gt("PicLevel","0");
newsEntityQueryWrapper.orderByDesc("PicLevel");
newsEntityQueryWrapper.orderByDesc("showtime");
newsEntityQueryWrapper.orderByDesc("inputDate");
newsEntityQueryWrapper.orderByDesc("pictureID");
List<PictureEntity> list = pictureService.list(newsEntityQueryWrapper);
return R.ok().put("data", list);
} catch (Exception e) {
log.error("pictureList error:", e);
return R.error(e.getMessage());
}
}
/**
* 信息
*/
@Login
@RequestMapping("/api/info/{pictureid}")
// @RequiresPermissions("generator:picture:info")
public R getDetail(@PathVariable("pictureid") Integer pictureid){
PictureEntity picture = pictureService.getById(pictureid);
return R.ok().put("picture", picture);
}
} }
...@@ -136,5 +136,33 @@ public class PolicyController extends AbstractController { ...@@ -136,5 +136,33 @@ public class PolicyController extends AbstractController {
return R.error(e.getMessage()); return R.error(e.getMessage());
} }
} }
@Login
@PostMapping("/api/policyList")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R policyList() {
try {
QueryWrapper<PolicyEntity> policyEntityQueryWrapper = new QueryWrapper<>();
policyEntityQueryWrapper.eq("class","法律法规");
policyEntityQueryWrapper.gt("levels","0");
policyEntityQueryWrapper.eq("status ","1");
policyEntityQueryWrapper.orderByDesc("levels");
policyEntityQueryWrapper.orderByDesc("releasedate ");
policyEntityQueryWrapper.orderByDesc("id");
return R.ok().put("data",policyService.list(policyEntityQueryWrapper));
} catch (Exception e) {
log.error("policyList error: {}", e);
return R.error(e.getMessage());
}
}
@Login
@GetMapping("/api/info/{id}")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R getDetail(@PathVariable("id") Integer id){
PolicyEntity policy = policyService.getById(id);
return R.ok().put("policy", policy);
}
} }
...@@ -30,4 +30,5 @@ public interface NewsDao extends BaseMapper<NewsEntity> { ...@@ -30,4 +30,5 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
*/ */
List<NewsEntity> selectNewsListCondition(@Param("newsEntity") NewsEntity newsEntity); List<NewsEntity> selectNewsListCondition(@Param("newsEntity") NewsEntity newsEntity);
List<NewsEntity> selectRealTimeInfo(Map<String, Object> params);
} }
...@@ -33,5 +33,6 @@ public interface NewsService extends IService<NewsEntity> { ...@@ -33,5 +33,6 @@ public interface NewsService extends IService<NewsEntity> {
List<NewsEntity> selectNewsListCondition(NewsEntity newsEntity); List<NewsEntity> selectNewsListCondition(NewsEntity newsEntity);
List<NewsEntity> selectRealTimeInfo(Map<String, Object> params);
} }
...@@ -113,4 +113,9 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements ...@@ -113,4 +113,9 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return newsDao.selectNewsListCondition(newsEntity); return newsDao.selectNewsListCondition(newsEntity);
} }
@Override
public List<NewsEntity> selectRealTimeInfo(Map<String, Object> params) {
return newsDao.selectRealTimeInfo(params);
}
} }
\ No newline at end of file
...@@ -181,5 +181,29 @@ ...@@ -181,5 +181,29 @@
id DESC id DESC
</select> </select>
<select id="selectRealTimeInfo" resultMap="newsMap">
SELECT t.id,
t.title,
t.author,
t.showtime,
t.startdate,
t.keyword,
t.editor,
t.lasteditor,
t.auditor,
t.status,
t.classid,
t.levels,
t.releasedate,
t.updatedate,
t1.name
from news t
LEFT JOIN newsClass t1
on t.classid = t1.columnid
where t1.name is not null
and t.classid = #{classid}
and t.levels > 0
and t.status = '1'
order by t.levels desc,t.showtime desc ,t.id desc
</select>
</mapper> </mapper>
\ No newline at end of file
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