| | |
| | | <modules> |
| | | <module>ycl-platform</module> |
| | | <module>ycl-common</module> |
| | | <!-- <module>ycl-generator</module>--> |
| | | </modules> |
| | | |
| | | <dependencies> |
| | |
| | | // 允许cookies跨域
|
| | | config.setAllowCredentials(true);
|
| | | // #允许向该服务器提交请求的URI,*表示全部允许,在SpringMVC中,如果设成*,会自动转成当前请求头中的Origin
|
| | | config.addAllowedOrigin("*");
|
| | | // config.addAllowedOrigin("*");
|
| | | config.addAllowedOriginPattern("*");
|
| | | // #允许访问的头信息,*表示全部
|
| | | config.addAllowedHeader("*");
|
| | | // 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.ycl</groupId> |
| | | <artifactId>ycl-airport-server</artifactId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | </parent> |
| | | |
| | | <groupId>com.ycl</groupId> |
| | | <artifactId>ycl-platform</artifactId> |
| | | <version>1.0.0</version> |
| | | <name>ycl-platform</name> |
| | | <description>后端模块</description> |
| | | |
| | | <properties> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | </properties> |
| | | |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.ycl</groupId> |
| | | <artifactId>ycl-common</artifactId> |
| | | <version>1.0.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.ycl</groupId>--> |
| | | <!-- <artifactId>ycl-generator</artifactId>--> |
| | | <!-- <version>1.0.0</version>--> |
| | | <!-- <scope>compile</scope>--> |
| | | <!-- </dependency>--> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>ycl-platform</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
| | | <modelVersion>4.0.0</modelVersion>
|
| | | <parent>
|
| | | <groupId>com.ycl</groupId>
|
| | | <artifactId>ycl-airport-server</artifactId>
|
| | | <version>1.0-SNAPSHOT</version>
|
| | | </parent>
|
| | |
|
| | | <groupId>com.ycl</groupId>
|
| | | <artifactId>ycl-platform</artifactId>
|
| | | <version>1.0.0</version>
|
| | | <name>ycl-platform</name>
|
| | | <description>后端模块</description>
|
| | |
|
| | | <properties>
|
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
| | | </properties>
|
| | |
|
| | |
|
| | | <dependencies>
|
| | | <dependency>
|
| | | <groupId>com.ycl</groupId>
|
| | | <artifactId>ycl-common</artifactId>
|
| | | <version>1.0.0</version>
|
| | | </dependency>
|
| | | <dependency>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter-test</artifactId>
|
| | | <scope>test</scope>
|
| | | </dependency>
|
| | | <dependency>
|
| | | <groupId>com.github.pagehelper</groupId>
|
| | | <artifactId>pagehelper</artifactId>
|
| | | <version>4.1.6</version>
|
| | | </dependency>
|
| | | </dependencies>
|
| | |
|
| | | <build>
|
| | | <finalName>ycl-platform</finalName>
|
| | | <plugins>
|
| | | <plugin>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-maven-plugin</artifactId>
|
| | | </plugin>
|
| | | </plugins>
|
| | | </build>
|
| | |
|
| | | </project>
|
| | |
| | | public class Intercept implements HandlerInterceptor { |
| | | |
| | | @Resource |
| | | NewsAdminService newsAdminService; |
| | | @Resource |
| | | NewsIpService newsIpService; |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
| | | List<String> ips = newsIpService.list().stream().map(item->item.getIpAddess()).collect(Collectors.toList()); |
| | | if (!ips.contains(request.getRemoteAddr())){ |
| | | List<String> ips = newsIpService.list().stream().map(item -> item.getIpAddess()).collect(Collectors.toList()); |
| | | if (!ips.contains(request.getRemoteAddr())) { |
| | | return false; |
| | | |
| | | } |
| | | String token = request.getHeader("token"); |
| | | JwtTokenUtil jwtTokenUtil = new JwtTokenUtil(); |
| | | if (token==null||token.isEmpty()){ |
| | | // String token = request.getHeader("token"); |
| | | // JwtTokenUtil jwtTokenUtil = new JwtTokenUtil(); |
| | | // if (token==null||token.isEmpty()){ |
| | | // response.sendRedirect(""); |
| | | // return true; |
| | | throw new ApiException("用户未登录"); |
| | | } |
| | | AuthInfo authInfo = jwtTokenUtil.parseToken(token); |
| | | if (authInfo == null) { |
| | | throw new ApiException("未认证用户"); |
| | | } |
| | | if (newsAdminService.getOne(new LambdaQueryWrapper<NewsAdmin>().eq(NewsAdmin::getUsername, authInfo.getUsername())) == null) { |
| | | throw new ApiException("不是系统用户"); |
| | | } else { |
| | | // throw new ApiException("用户未登录"); |
| | | // } |
| | | // AuthInfo authInfo = jwtTokenUtil.parseToken(token); |
| | | // if (authInfo == null) { |
| | | // throw new ApiException("未认证用户"); |
| | | // } |
| | | // if (newsAdminService.getOne(new LambdaQueryWrapper<NewsAdmin>().eq(NewsAdmin::getUsername, authInfo.getUsername())) == null) { |
| | | // throw new ApiException("不是系统用户"); |
| | | // } else { |
| | | return true; |
| | | } |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | return new ApiInfoBuilder() |
| | | .title("机场公安文档管理系统") |
| | | .description("机场公安后台模块") |
| | | .version("1.0").contact(new Contact("lyq",null,null)) |
| | | .version("1.0").contact(new Contact("fy",null,null)) |
| | | .build(); |
| | | } |
| | | |
New file |
| | |
| | | package com.ycl.config;
|
| | |
|
| | | import com.github.pagehelper.PageHelper;
|
| | | import org.springframework.context.annotation.Bean;
|
| | | import org.springframework.context.annotation.Configuration;
|
| | |
|
| | | import java.util.Properties;
|
| | |
|
| | | /***
|
| | | * 分页配置
|
| | | * @author:lcj
|
| | | */
|
| | | @Configuration
|
| | | public class PageHelperConfig {
|
| | |
|
| | | /**
|
| | | * 配置mybatis的分页插件pageHelper
|
| | | *
|
| | | * @return
|
| | | */
|
| | | @Bean
|
| | | public PageHelper pageHelper() {
|
| | | PageHelper pageHelper = new PageHelper();
|
| | | Properties properties = new Properties();
|
| | | properties.setProperty("offsetAsPageNum", "true");
|
| | | properties.setProperty("rowBoundsWithCount", "true");
|
| | | properties.setProperty("reasonable", "true");
|
| | | properties.setProperty("dialect", "postgresql");//配置postgresql数据库的方言支持Oracle,Mysql,MariaDB,SQLite,Hsqldb,PostgreSQL六种数据库
|
| | | pageHelper.setProperties(properties);
|
| | | return pageHelper;
|
| | | }
|
| | | } |
| | |
| | | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(this.Intercept()) |
| | | //需要验证请求路径 /*代表全部 |
| | | .addPathPatterns("/*") |
| | | .excludePathPatterns(urlsConfig.getUrls()); |
| | | registry.addInterceptor(this.Intercept()); |
| | | // 需要验证请求路径 /*代表全部 |
| | | // .addPathPatterns("/*") |
| | | // .excludePathPatterns(urlsConfig.getUrls()); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.api.ApiController;
|
| | | import com.baomidou.mybatisplus.extension.api.R;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.github.pagehelper.PageHelper;
|
| | | import com.ycl.api.CommonResult;
|
| | | import com.ycl.entity.NewsAdmin;
|
| | | import com.ycl.pojo.dto.LoginParam;
|
| | |
| | | } else {
|
| | | if (admin.getPassword().equals(MD5Util.md5Encrypt32Lower(loginParam.getPassword()))) {
|
| | | JwtTokenUtil jwtTokenUtil = new JwtTokenUtil();
|
| | |
|
| | | return CommonResult.success(jwtTokenUtil.generateToken(admin.getId(), admin.getUsername()));
|
| | | } else {
|
| | | return CommonResult.failed("密码错误");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @PostMapping("/login/reception")
|
| | | @ApiOperation(value = "前台登录")
|
| | | @SneakyThrows
|
| | | public CommonResult Reception(@RequestBody LoginParam loginParam) {
|
| | | NewsAdmin admin = newsAdminService.getOne(new LambdaQueryWrapper<NewsAdmin>().eq(NewsAdmin::getUsername, loginParam.getUsername()));
|
| | | if (admin == null) {
|
| | | return CommonResult.failed("用户不存在");
|
| | | } else {
|
| | | if (admin.getPassword().equals(MD5Util.md5Encrypt32Lower(loginParam.getPassword()))) {
|
| | |
|
| | |
|
| | | return CommonResult.success(admin.getNewsPoliceId());
|
| | | } else {
|
| | | return CommonResult.failed("密码错误");
|
| | | }
|
| | |
| | | @GetMapping
|
| | | @ApiOperation(value = "查询所有数据")
|
| | | public R selectAll(Page<NewsAdmin> page, NewsAdmin newsAdmin) {
|
| | | page.setTotal(newsAdminService.count());
|
| | | PageHelper.startPage(new Long(page.getCurrent()).intValue(),new Long(page.getSize()).intValue());
|
| | | return success(this.newsAdminService.page(page, new QueryWrapper<>(newsAdmin)));
|
| | | }
|
| | |
|
| | |
| | | @Resource
|
| | | private NewsChannelService newsChannelService;
|
| | |
|
| | | @Autowired
|
| | | private NewsChannelColumnService newsChannelColumnService;
|
| | |
|
| | | /**
|
| | | * 分页查询所有数据
|
| | |
| | | * @param id 主键
|
| | | * @return 单条数据
|
| | | */
|
| | | @GetMapping("{id}")
|
| | | @ApiOperation(value = "按id查询数据")
|
| | | public R selectOne(@PathVariable Serializable id) {
|
| | | return success(this.newsChannelService.getById(id));
|
| | | }
|
| | | // @GetMapping("{id}")
|
| | | // @ApiOperation(value = "按id查询数据")
|
| | | // public R selectOne(@PathVariable Serializable id) {
|
| | | // return success(this.newsChannelService.getById(id));
|
| | | // }
|
| | |
|
| | | /**
|
| | | * 新增数据
|
| | |
| | | @ApiOperation(value = "新增数据")
|
| | | public R insert(@RequestBody NewsChannel newsChannel) {
|
| | | int result = this.newsChannelService.insertOneChannel(newsChannel);
|
| | | List<String> columnId = newsChannel.getColumnId();
|
| | | columnId.stream().forEach(item->newsChannelColumnService.save(NewsChannelColumn.builder().channelId(newsChannel.getId()).columnId(Integer.parseInt(item)).build()));
|
| | | // List<String> columnId = newsChannel.getColumnId();
|
| | | // columnId.stream().forEach(item->newsChannelColumnService.save(NewsChannelColumn.builder().channelId(newsChannel.getId()).columnId(Integer.parseInt(item)).build()));
|
| | | return success(result);
|
| | | }
|
| | |
|
| | |
| | | @PutMapping
|
| | | @ApiOperation(value = "修改数据")
|
| | | public R update(@RequestBody NewsChannel newsChannel) {
|
| | | List<String> columnId = newsChannel.getColumnId();
|
| | | newsChannelColumnService.remove(new QueryWrapper<NewsChannelColumn>().eq("channel_id",newsChannel.getId()));
|
| | | columnId.stream().forEach(item->newsChannelColumnService.save(NewsChannelColumn.builder().channelId(newsChannel.getId()).columnId(Integer.parseInt(item)).build()));
|
| | | // List<String> columnId = newsChannel.getColumnId();
|
| | | // newsChannelColumnService.remove(new QueryWrapper<NewsChannelColumn>().eq("channel_id",newsChannel.getId()));
|
| | | // columnId.stream().forEach(item->newsChannelColumnService.save(NewsChannelColumn.builder().channelId(newsChannel.getId()).columnId(Integer.parseInt(item)).build()));
|
| | | return success(this.newsChannelService.updateById(newsChannel));
|
| | | }
|
| | |
|
| | |
| | | import com.baomidou.mybatisplus.extension.api.ApiController;
|
| | | import com.baomidou.mybatisplus.extension.api.R;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.ycl.entity.NewsChannel;
|
| | | import com.ycl.dto.ColumnDto;
|
| | | import com.ycl.entity.NewsChannelColumn;
|
| | | import com.ycl.entity.NewsColumn;
|
| | | import com.ycl.service.NewsChannelColumnService;
|
| | | import com.ycl.service.NewsColumnService;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | */
|
| | | @Resource
|
| | | private NewsColumnService newsColumnService;
|
| | |
|
| | | @Autowired
|
| | | private NewsChannelColumnService newsChannelColumnService;
|
| | |
|
| | | /**
|
| | | * 分页查询所有数据
|
| | |
| | | /**
|
| | | * 新增数据
|
| | | *
|
| | | * @param newsColumn 实体对象
|
| | | * @param columnDto 实体对象
|
| | | * @return 新增结果
|
| | | */
|
| | | @PostMapping
|
| | | @ApiOperation(value = "新增数据")
|
| | | public R insert(@RequestBody NewsColumn newsColumn) {
|
| | | return success(this.newsColumnService.save(newsColumn));
|
| | | public R insert(@RequestBody ColumnDto columnDto) {
|
| | | List<String> columnId = columnDto.getChannelId();
|
| | | this.newsColumnService.save(columnDto.getNewsColumn());
|
| | | columnId.stream().forEach(item->newsChannelColumnService.save(NewsChannelColumn.builder().channelId(Integer.parseInt(item)).columnId(columnDto.getNewsColumn().getId()).build()));
|
| | | return success(columnDto).setMsg("执行成功");
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.api.ApiController;
|
| | | import com.baomidou.mybatisplus.extension.api.R;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.github.pagehelper.PageHelper;
|
| | | import com.github.pagehelper.PageInfo;
|
| | | import com.ycl.entity.NewsColumnInformation;
|
| | | import com.ycl.entity.NewsInformation;
|
| | | import com.ycl.service.NewsColumnInformationService;
|
| | | import com.ycl.service.NewsInformationService;
|
| | | import com.ycl.vo.depart.UmsDepartVO;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | |
| | | import javax.annotation.Resource;
|
| | | import java.io.Serializable;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.List;
|
| | | import java.util.stream.Collectors;
|
| | | import java.util.stream.Stream;
|
| | |
|
| | | /**
|
| | | * 栏目咨询中间表(NewsColumnInformation)表控制层
|
| | |
| | | * @return 资讯查询结果
|
| | | */
|
| | | @GetMapping("column/{id}")
|
| | | @ApiOperation(value = "按")
|
| | | public R selectInformationByColumnId(@PathVariable Serializable id) {
|
| | | @ApiOperation(value = "按栏目id查询讯息")
|
| | | public R selectInformationByColumnId(@PathVariable Serializable id ,@RequestParam(value = "pageNum", required = false,defaultValue = "1")Integer pageNum,@RequestParam(value = "pageSize", required = false,defaultValue = "10")Integer pageSize) {
|
| | | List<NewsColumnInformation> newsColumnInformationList = newsColumnInformationService.list(new QueryWrapper<NewsColumnInformation>().eq("column_id", id));
|
| | | List<NewsInformation> resultList=new ArrayList<>();
|
| | | IPage<NewsInformation> page = new Page<>(pageNum, pageSize);
|
| | | for (NewsColumnInformation newsColumnInformation:newsColumnInformationList){
|
| | | resultList.add(newsInformationService.selectInformationById(newsColumnInformation.getInformationId()));
|
| | | }
|
| | | return success(resultList);
|
| | | }}
|
| | | page.setTotal(resultList.size());
|
| | | if (pageSize>resultList.size()){
|
| | | page.setRecords(resultList);
|
| | | }
|
| | | else {
|
| | | List<List<NewsInformation>> lists = split8(resultList, pageSize);
|
| | | page.setRecords(lists.get(pageNum-1));
|
| | | }
|
| | | return success(page);
|
| | | }
|
| | |
|
| | | public static <T> List<List<T>> split8(List<T> list,int splitSize){
|
| | | // 每份个数 splitSize
|
| | | if( null == list || list.isEmpty() ){ return Collections.emptyList(); }
|
| | | // 列表元素数,总份数
|
| | | int size = list.size(), cnt = (size + splitSize - 1 ) / splitSize;
|
| | | return Stream
|
| | | .iterate(0,i -> i+1 )
|
| | | .limit(cnt)
|
| | | .parallel()
|
| | | .map(i -> list.parallelStream().skip( i * splitSize ).limit(splitSize).collect(Collectors.toList()))
|
| | | .filter(a -> !a.isEmpty())
|
| | | .collect(Collectors.toList());
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
| | | import com.baomidou.mybatisplus.extension.api.ApiController;
|
| | | import com.baomidou.mybatisplus.extension.api.R;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.github.pagehelper.PageHelper;
|
| | | import com.ycl.entity.NewsDepartment;
|
| | | import com.ycl.service.NewsDepartmentService;
|
| | | import io.swagger.annotations.Api;
|
| | |
| | | @GetMapping
|
| | | @ApiOperation(value = "查询所有数据")
|
| | | public R selectAll(Page<NewsDepartment> page, NewsDepartment newsDepartment) {
|
| | | page.setTotal(newsDepartmentService.count());
|
| | | PageHelper.startPage(new Long(page.getCurrent()).intValue(),new Long(page.getSize()).intValue());
|
| | | return success(this.newsDepartmentService.page(page, new QueryWrapper<>(newsDepartment)));
|
| | | }
|
| | |
|
| | |
| | | import com.baomidou.mybatisplus.extension.api.ApiController;
|
| | | import com.baomidou.mybatisplus.extension.api.R;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.github.pagehelper.PageHelper;
|
| | | import com.ycl.entity.NewsDuty;
|
| | | import com.ycl.service.NewsDutyService;
|
| | | import io.swagger.annotations.Api;
|
| | |
| | | @GetMapping
|
| | | @ApiOperation(value = "查询所有数据")
|
| | | public R selectAll(Page<NewsDuty> page, NewsDuty newsDuty) {
|
| | | page.setTotal(newsDutyService.count());
|
| | | PageHelper.startPage(new Long(page.getCurrent()).intValue(),new Long(page.getSize()).intValue());
|
| | | return success(this.newsDutyService.page(page, new QueryWrapper<>(newsDuty)));
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | @GetMapping("{id}")
|
| | | @ApiOperation(value = "按id查询数据")
|
| | | public R selectOne(@PathVariable Serializable id) {
|
| | | return success(this.newsInformationService.getById(id));
|
| | | public R selectOne(@PathVariable Integer id) {
|
| | | return success(this.newsInformationService.selectInformationById(id));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @ApiOperation(value = "修改数据")
|
| | | @Transactional
|
| | | public R update(@RequestBody NewsInformation newsInformation) {
|
| | | Integer informationId = newsInformation.getId();
|
| | | if (newsInformation.getIsSign()==0){
|
| | | newsInformationPoliceService.remove(new QueryWrapper<NewsInformationPolice>().eq("news_information_id",informationId));
|
| | | List<String> departmentIds = newsInformation.getDepartmentId();
|
| | | for (String departmentId:departmentIds){
|
| | | QueryWrapper<NewsPolice> wrapper = new QueryWrapper();
|
| | | wrapper.eq("news_department_id",departmentId);
|
| | | List<NewsPolice> list = policeService.list(wrapper);
|
| | | if (!list.isEmpty()){
|
| | | for (NewsPolice newsPolice:list){
|
| | | newsInformationPoliceService.save(NewsInformationPolice.builder().newsPoliceId(newsPolice.getId()).newsInformationId(informationId).isSign(0).build());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | newsColumnInformationService.remove(new QueryWrapper<NewsColumnInformation>().eq("information_id",informationId));
|
| | | for (String columnId:newsInformation.getColumnId()){
|
| | | newsColumnInformationService.save(NewsColumnInformation.builder().columnId(Integer.parseInt(columnId)).informationId(informationId).build());
|
| | | }
|
| | | // Integer informationId = newsInformation.getId();
|
| | | // if (newsInformation.getIsSign()==0){
|
| | | // newsInformationPoliceService.remove(new QueryWrapper<NewsInformationPolice>().eq("news_information_id",informationId));
|
| | | // List<String> departmentIds = newsInformation.getDepartmentId();
|
| | | // for (String departmentId:departmentIds){
|
| | | // QueryWrapper<NewsPolice> wrapper = new QueryWrapper();
|
| | | // wrapper.eq("news_department_id",departmentId);
|
| | | // List<NewsPolice> list = policeService.list(wrapper);
|
| | | // if (!list.isEmpty()){
|
| | | // for (NewsPolice newsPolice:list){
|
| | | // newsInformationPoliceService.save(NewsInformationPolice.builder().newsPoliceId(newsPolice.getId()).newsInformationId(informationId).isSign(0).build());
|
| | | // }
|
| | | // }
|
| | | // }
|
| | | // }
|
| | | // newsColumnInformationService.remove(new QueryWrapper<NewsColumnInformation>().eq("information_id",informationId));
|
| | | // for (String columnId:newsInformation.getColumnId()){
|
| | | // newsColumnInformationService.save(NewsColumnInformation.builder().columnId(Integer.parseInt(columnId)).informationId(informationId).build());
|
| | | // }
|
| | |
|
| | | // return success(this.newsInformationService.updateInformationById(newsInformation));
|
| | | return success(this.newsInformationService.updateInformationById(newsInformation));
|
| | | }
|
| | |
|
| | |
| | | @DeleteMapping
|
| | | @ApiOperation(value = "删除数据")
|
| | | public R delete(@RequestParam("idList") List<Long> idList) {
|
| | | if (idList==null||idList.size()==0){
|
| | | return failed("请选择一个刹车农户对象");
|
| | | }
|
| | | for (long id:idList){
|
| | | newsColumnInformationService.remove(new QueryWrapper<NewsColumnInformation>().eq("information_id",id));
|
| | | }
|
| | | return success(this.newsInformationService.removeByIds(idList));
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.ycl.dto;
|
| | |
|
| | | import com.ycl.entity.NewsColumn;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | | import lombok.Getter;
|
| | | import lombok.Setter;
|
| | |
|
| | | import java.util.List;
|
| | | @Getter
|
| | | @Setter
|
| | | public class ColumnDto {
|
| | | //频道id
|
| | | @ApiModelProperty("频道id")
|
| | | private List<String> channelId;
|
| | |
|
| | | //栏目实体类
|
| | | @ApiModelProperty("栏目实体类")
|
| | | private NewsColumn newsColumn;
|
| | | }
|
| | |
| | |
|
| | |
|
| | | import com.baomidou.mybatisplus.extension.activerecord.Model;
|
| | | import com.fasterxml.jackson.annotation.JsonFormat;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
| | | private String note;
|
| | | //创建时间
|
| | | @ApiModelProperty("创建时间")
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
| | | private Date createTime;
|
| | | //帐号启用状态:0->禁用;1->启用
|
| | | @ApiModelProperty("帐号启用状态")
|
| | |
| | | @ApiModelProperty("创建时间")
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
| | | private Date createTime;
|
| | | //栏目id
|
| | | @ApiModelProperty("栏目id")
|
| | | private List<String> columnId;
|
| | |
|
| | | public List<String> getColumnId() {
|
| | | return columnId;
|
| | | }
|
| | |
|
| | | public void setColumnId(List<String> columnId) {
|
| | | this.columnId = columnId;
|
| | | }
|
| | |
|
| | | public Integer getId() {
|
| | | return id;
|
| | |
| | | import io.swagger.annotations.ApiModelProperty;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * 栏目表(NewsColumn)表实体类
|
| | |
| | |
|
| | |
|
| | | import com.baomidou.mybatisplus.extension.activerecord.Model;
|
| | | import com.fasterxml.jackson.annotation.JsonFormat;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
| | | private String jobTitle;
|
| | | //创建时间
|
| | | @ApiModelProperty("创建时间")
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
| | | private Date createTime;
|
| | | //值班时间
|
| | | @ApiModelProperty("值班日期")
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
| | | private Date dutyTime;
|
| | |
|
| | |
|
| | |
| | | List<NewsInformation> selectAllInformation();
|
| | |
|
| | | int updateInformationById(@Param("entity") NewsInformation entity);
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
| | | server:
|
| | | port: 8082
|
| | | port: 8099
|
| | | tomcat:
|
| | | uri-encoding: UTF-8
|
| | | servlet:
|
| | |
| | | testOnReturn: false
|
| | | poolPreparedStatements: true
|
| | | maxOpenPreparedStatements: 20
|
| | | #配置pageHelper
|
| | | pageHelper:
|
| | | reasonable: "true"
|
| | | supportMethodsArguments: "true"
|
| | | returnPageInfo: check
|
| | | params: count=countSql
|
| | | #e-mail:
|
| | | # sendHost: smtp.qq.com
|
| | | # username: 1723292425@qq.com
|
| | |
| | | - /**/*.js
|
| | | - /**/*.css
|
| | | - /**/*.png
|
| | | - /newsAdmin/login
|
| | | - /**/*.ico
|
| | | # - /newsAdmin/login
|
| | |
| | | </select>
|
| | |
|
| | | <update id="updateInformationById" parameterType="com.ycl.entity.NewsInformation">
|
| | | update news_information set title=#{entity.title},content=#{entity.content},publish_time=#{entity.publishTime}, is_sign=#{entity.isSign}, create_time=#{entity.createTime}, send_to=#{entity.sendTo}, image_url=#{entity.imageUrl}
|
| | | update news_information
|
| | | <trim prefix="set" suffixOverrides=",">
|
| | | <if test="entity.title!=null and entity.title!=''">
|
| | | title=#{entity.title},
|
| | | </if>
|
| | | <if test="entity.content!=null and entity.content!=''">
|
| | | content=#{entity.content},
|
| | | </if>
|
| | | <if test="entity.publishTime!=null ">
|
| | | publish_time=#{entity.publishTime},
|
| | | </if>
|
| | | <if test="entity.isSign!=null and entity.isSign!=''">
|
| | | is_sign=#{entity.isSign},
|
| | | </if>
|
| | | <if test="entity.createTime!=null ">
|
| | | create_time=#{entity.createTime},
|
| | | </if>
|
| | | <if test="entity.sendTo!=null and entity.sendTo!=''">
|
| | | send_to=#{entity.sendTo},
|
| | | </if>
|
| | | <if test="entity.imageUrl!=null and entity.imageUrl!=''">
|
| | | image_url=#{entity.imageUrl},
|
| | | </if>
|
| | | </trim>
|
| | | where id=#{entity.id}
|
| | | </update>
|
| | | </mapper>
|