Commit 3765fc9a by rongkailun

【新增】公告通知、政策法规、左侧相关标准、右侧相关标准、视频在线、应用动态

parent 0456bb14
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.AnnounceEntity;
import io.office.modules.manage.service.AnnounceService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* 公告通知
*
* @author wudi
* @email
* @date 2021-12-07 15:26:10
*/
@RestController
@RequestMapping("/announce")
public class AnnounceController {
@Autowired
private AnnounceService announceService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:announce:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = announceService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:announce:info")
public R info(@PathVariable("id") Integer id){
AnnounceEntity announce = announceService.getById(id);
return R.ok().put("announce", announce);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:announce:save")
public R save(@RequestBody AnnounceEntity announce){
announceService.save(announce);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:announce:update")
public R update(@RequestBody AnnounceEntity announce){
announceService.updateById(announce);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:announce:delete")
public R delete(@RequestBody Integer[] ids){
announceService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
package io.office.modules.manage.controller;
import java.security.Policy;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.org.apache.regexp.internal.RE;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.entity.*;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.AnnounceService;
import io.office.modules.manage.service.LogisticsService;
import io.office.modules.manage.service.MedicalService;
import io.office.modules.sys.controller.AbstractController;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.service.NewsService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
......@@ -190,6 +198,19 @@ public class NewsController extends AbstractController {
}
/**
* 医疗卫生
*/
@Lazy
@Autowired
MedicalService medicalService;
@Login
@GetMapping("/api/medicalInfo/{id}")
public R medicalInfo(@PathVariable("id") String id) {
MedicalEntity medical = medicalService.getById(id);
return R.ok().put("data", medical);
}
/**
* 物联网
*/
......@@ -202,7 +223,7 @@ public class NewsController extends AbstractController {
return R.ok().put("data", pageUtils);
}
/**
* 物联网
* 其他
*/
@Login
......@@ -226,4 +247,97 @@ public class NewsController extends AbstractController {
}
/**
* 医疗卫生
*/
@Login
@PostMapping("/api/logostocsList")
public R logostocsList(@RequestBody NewsParams newsParams) {
Page<LogisticsEntity> page = this.newsService.logostocsList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
/**
* 医疗卫生
*/
@Lazy
@Autowired
LogisticsService logisticsService;
@Login
@GetMapping("/api/logostocsList/{id}")
public R logostocsList(@PathVariable("id") String id) {
LogisticsEntity logisticsEntity = logisticsService.getById(id);
return R.ok().put("data", logisticsEntity);
}
/**应用动态*/
@Login
@PostMapping("/api/yydtList")
public R yydtList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.yydtList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
/**视频在线*/
@Login
@PostMapping("/api/spList")
public R spList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.spList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
/**公共通知*/
@Login
@PostMapping("/api/announceList")
public R announceList(@RequestBody NewsParams newsParams) {
Page<AnnounceEntity> page = this.newsService.announceList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
/**公共通知详情*/
@Autowired
AnnounceService announceService;
@Login
@GetMapping("/api/announInfo/{id}")
public R announInfo(@PathVariable("id") Integer id) {
AnnounceEntity announceEntity = this.announceService.getById(id);
return R.ok().put("data", announceEntity);
}
/**左侧标准文档*/
@Login
@PostMapping("/api/xgbzList")
public R xgbzList(@RequestBody NewsParams newsParams) {
Page<PolicyEntity> page = this.newsService.xgbzList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
/**右侧标准文档*/
@Login
@PostMapping("/api/ycxgbzList")
public R ycxgbzList(@RequestBody NewsParams newsParams) {
List<PolicyEntity> list = this.newsService.ycxgbzList();
return R.ok().put("data", list);
}
/**政策法规*/
@Login
@PostMapping("/api/zcfgList")
public R zcfgList(@RequestBody NewsParams newsParams) {
Page<PolicyEntity> page = this.newsService.zcfgList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
}
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.AnnounceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-07 15:26:10
*/
@Mapper
public interface AnnounceDao extends BaseMapper<AnnounceEntity> {
}
package io.office.modules.manage.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.entity.dto.NewsParams;
import org.apache.ibatis.annotations.Mapper;
......@@ -46,4 +45,18 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewsEntity> otherList(NewsParams newsParams, Page page);
List<NewsEntity> foodSafetyList(NewsParams newsParams, Page page);
List<LogisticsEntity> logostocsList(NewsParams newsParams, Page page);
List<NewsEntity> yydtList(NewsParams newsParams, Page page);
List<NewsEntity> spList(NewsParams newsParams, Page page);
List<AnnounceEntity> announceList(NewsParams newsParams, Page page);
List<PolicyEntity> xgbzList(NewsParams newsParams, Page page);
List<PolicyEntity> ycxgbzList();
List<PolicyEntity> zcfgList(NewsParams newsParams, Page page);
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-07 15:26:10
*/
@Data
@TableName("announce")
public class AnnounceEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer id;
/**
* $column.comments
*/
private Integer announcetype;
/**
* $column.comments
*/
private String title;
/**
* $column.comments
*/
private String content;
/**
* $column.comments
*/
private Date releasedate;
/**
* $column.comments
*/
private Date updatedate;
/**
* $column.comments
*/
private Integer levels;
/**
* $column.comments
*/
private String editor;
/**
* $column.comments
*/
private String fileurl;
/**
* $column.comments
*/
private String author;
/**
* 0等待审核;1审核成功;-1审核失败
*/
private Integer status;
/**
* $column.comments
*/
private String showtime;
/**
* $column.comments
*/
private String auditor;
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.AnnounceEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-07 15:26:10
*/
public interface AnnounceService extends IService<AnnounceEntity> {
PageUtils queryPage(Map<String, Object> params);
}
......@@ -4,8 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.*;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.sys.entity.SysUserEntity;
......@@ -47,5 +46,19 @@ public interface NewsService extends IService<NewsEntity> {
Page<NewsEntity> otherList(NewsParams newsParams, Page page);
Page<NewsEntity> foodSafetyList(NewsParams newsParams, Page page);
Page<LogisticsEntity> logostocsList(NewsParams newsParams, Page page);
Page<NewsEntity> yydtList(NewsParams newsParams, Page page);
Page<NewsEntity> spList(NewsParams newsParams, Page page);
Page<AnnounceEntity> announceList(NewsParams newsParams, Page page);
Page<PolicyEntity> xgbzList(NewsParams newsParams, Page page);
List<PolicyEntity> ycxgbzList();
Page<PolicyEntity> zcfgList(NewsParams newsParams, Page page);
}
package io.office.modules.manage.service.impl;
import org.springframework.stereotype.Service;
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;
import io.office.modules.manage.dao.AnnounceDao;
import io.office.modules.manage.entity.AnnounceEntity;
import io.office.modules.manage.service.AnnounceService;
@Service("announceService")
public class AnnounceServiceImpl extends ServiceImpl<AnnounceDao, AnnounceEntity> implements AnnounceService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<AnnounceEntity> page = this.page(
new Query<AnnounceEntity>().getPage(params),
new QueryWrapper<AnnounceEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@ package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.utils.R;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.entity.*;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.sys.entity.SysUserEntity;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -18,7 +18,6 @@ import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.NewsDao;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.service.NewsService;
......@@ -166,5 +165,53 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return page;
}
@Override
public Page<LogisticsEntity> logostocsList(NewsParams newsParams, Page page) {
List<LogisticsEntity> list = this.newsDao.logostocsList(newsParams,page);
page.setRecords(list);
return page;
}
@Override
public Page<NewsEntity> yydtList(NewsParams newsParams, Page page) {
List<NewsEntity> list = this.newsDao.yydtList(newsParams,page);
page.setRecords(list);
return page;
}
@Override
public Page<NewsEntity> spList(NewsParams newsParams, Page page) {
List<NewsEntity> list = this.newsDao.spList(newsParams,page);
page.setRecords(list);
return page;
}
@Override
public Page<AnnounceEntity> announceList(NewsParams newsParams, Page page) {
List<AnnounceEntity> list = this.newsDao.announceList(newsParams,page);
page.setRecords(list);
return page;
}
@Override
public Page<PolicyEntity> xgbzList(NewsParams newsParams, Page page) {
List<PolicyEntity> list = this.newsDao.xgbzList(newsParams,page);
page.setRecords(list);
return page;
}
@Override
public List<PolicyEntity> ycxgbzList() {
List<PolicyEntity> list = this.newsDao.ycxgbzList();
return list;
}
@Override
public Page<PolicyEntity> zcfgList(NewsParams newsParams, Page page) {
List<PolicyEntity> list = this.newsDao.zcfgList(newsParams,page);
page.setRecords(list);
return page;
}
}
\ No newline at end of file
......@@ -257,6 +257,7 @@
<select id="medicalList" resultType="io.office.modules.manage.entity.MedicalEntity">
SELECT * FROM medical t
where t.level >0
and t.status = '1'
ORDER BY
t.level DESC,
t.id DESC
......@@ -314,4 +315,83 @@
levels DESC,
id DESC
</select>
<select id="logostocsList" resultType="io.office.modules.manage.entity.LogisticsEntity">
SELECT * FROM logistics t
where t.level >0
and t.status = '1'
ORDER BY
t.level DESC,
t.id DESC
</select>
<select id="yydtList" resultMap="newsMap">
SELECT
a.*
FROM
news a
WHERE
status = 1
AND levels > 0
and a.keyword like '%电商%' or a.keyword like '%电子商务%'
ORDER BY
a.levels DESC,
a.showtime DESC,
a.id DESC
</select>
<select id="spList" resultMap="newsMap">
SELECT
a.*
FROM
news_movie a
WHERE
status = 1
AND levels > 0
and a.keyword like '%电商%' or a.keyword like '%电子商务%'
ORDER BY
a.levels DESC,
a.showtime DESC,
a.id DESC
</select>
<select id="announceList" resultType="io.office.modules.manage.entity.AnnounceEntity">
SELECT
id,
title,
editor,
releasedate,
announcetype,
(
SELECT
announcetype
FROM
announcelist
WHERE
(id = announce.announcetype)
) AS announcetype_name
FROM
announce
WHERE
(announcetype = 1)
AND (levels > 0)
AND (status = 1)
ORDER BY
levels DESC,
id DESC
</select>
<select id="xgbzList" resultType="io.office.modules.manage.entity.PolicyEntity">
select * from Policy where class='相关标准' and levels>0 and status > 0 order by levels desc,releasedate desc
</select>
<select id="ycxgbzList" resultType="io.office.modules.manage.entity.PolicyEntity">
select top 16 * from Policy where class='相关标准' and levels>0 and status > 0 order by levels desc,releasedate desc
</select>
<select id="zcfgList" resultType="io.office.modules.manage.entity.PolicyEntity">
select * from Policy where class='法律法规' and levels>0 and status > 0 order by levels desc,releasedate desc
</select>
</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