添加公告

This commit is contained in:
yangjun 2024-05-10 20:03:10 +08:00
parent af23f1cb89
commit 6925f971ba
14 changed files with 376 additions and 0 deletions

View File

@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.kc.grab.exports.entity.TBks;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
import org.springframework.beans.factory.annotation.Autowired;
@ -159,4 +161,21 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
return super.importExcel(request, response, Xxhbbks.class);
}
@AutoLog(value = "获取本科生选课人员信息")
@ApiOperation(value="获取本科生选课人员信息", notes="获取本科生选课人员信息")
@GetMapping(value = "/getXsxkbList")
public Result<?> getXsxkbList(Xxhbbks xxhbbks,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<Xxhbbks> queryWrapper = QueryGenerator.initQueryWrapper(xxhbbks, req.getParameterMap());
queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq(StringUtils.isNotBlank(xxhbbks.getRwbh()),"b.KCAPZBBH",xxhbbks.getRwbh());
Page<Xxhbbks> page = new Page<Xxhbbks>(pageNo, pageSize);
IPage<Xxhbbks> pageList = xxhbbksService.getXsxkbList(page, queryWrapper);
return Result.OK(pageList);
}
}

View File

@ -86,4 +86,8 @@ public class Xxhbbks implements Serializable {
@TableField(exist = false)
private Integer mysqlnum;
@TableField(exist = false)
private String rwbh;
}

View File

@ -1,6 +1,11 @@
package org.jeecg.modules.kc.grab.imports.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
/**
@ -12,4 +17,6 @@ import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
public interface XxhbbksMapper extends BaseMapper<Xxhbbks> {
Xxhbbks getSumnum();
IPage<Xxhbbks> getXsxkbList(Page<Xxhbbks> page,@Param(Constants.WRAPPER) QueryWrapper<Xxhbbks> queryWrapper);
}

View File

@ -5,4 +5,13 @@
<select id="getSumnum" resultType="org.jeecg.modules.kc.grab.imports.entity.Xxhbbks">
select count(*) as mysqlnum from xxhbbks
</select>
<select id="getXsxkbList" resultType="org.jeecg.modules.kc.grab.imports.entity.Xxhbbks">
select a.* from xxhbbks a ,xxhbxsxkb b
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -1,5 +1,8 @@
package org.jeecg.modules.kc.grab.imports.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
@ -29,4 +32,6 @@ public interface IXxhbbksService extends IService<Xxhbbks> {
boolean syncList(Collection<Xxhbbks> entityList, boolean isDelete);
Xxhbbks getSumnum();
IPage<Xxhbbks> getXsxkbList(Page<Xxhbbks> page, QueryWrapper<Xxhbbks> queryWrapper);
}

View File

@ -1,6 +1,8 @@
package org.jeecg.modules.kc.grab.imports.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
import org.jeecg.modules.kc.grab.imports.mapper.XxhbbksMapper;
@ -39,4 +41,9 @@ public class XxhbbksServiceImpl extends ServiceImpl<XxhbbksMapper, Xxhbbks> impl
public Xxhbbks getSumnum() {
return baseMapper.getSumnum();
}
@Override
public IPage<Xxhbbks> getXsxkbList(Page<Xxhbbks> page, QueryWrapper<Xxhbbks> queryWrapper) {
return baseMapper.getXsxkbList(page, queryWrapper);
}
}

View File

@ -278,4 +278,19 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
IPage<KcKechengbiao> pageList = kcKechengbiaoService.getStudentKclist(page, queryWrapper);
return Result.OK(pageList);
}
@ApiOperation(value="根据课程的任务编号学期学年获取课程信息", notes="根据课程的任务编号学期学年获取课程信息")
@GetMapping(value = "/getKcxxByRwbhXqxn")
public Result<KcKechengbiao> getKcxxByRwbh(@RequestParam(name="rwbh",required=true) String rwbh,@RequestParam(name="xqxn",required=true) String xqxn) {
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("rwbh",rwbh);
kcKechengbiaoQueryWrapper.eq("xqxn",xqxn);
kcKechengbiaoQueryWrapper.last("limit 1");
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
if(kcKechengbiao==null) {
return Result.error("未找到对应数据");
}
return Result.OK(kcKechengbiao);
}
}

View File

@ -270,6 +270,7 @@
kt.zbfs,
kt.kclj,
kc.jsbh,
kc.rwbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,
@ -338,6 +339,7 @@
kt.zbfs,
kt.kclj,
kc.jsbh,
kc.rwbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,
@ -404,6 +406,7 @@
kt.zbfs,
kt.kclj,
kc.jsbh,
kc.rwbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,
@ -466,6 +469,7 @@
kt.zbfs,
kt.kclj,
kc.jsbh,
kc.rwbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,
@ -528,6 +532,7 @@
kt.zbfs,
kt.kclj,
kc.jsbh,
kc.rwbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,

View File

@ -0,0 +1,176 @@
package org.jeecg.modules.kc.zyGonggao.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.zyGonggao.entity.ZyGonggao;
import org.jeecg.modules.kc.zyGonggao.service.IZyGonggaoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 公告
* @Author: jeecg-boot
* @Date: 2024-05-10
* @Version: V1.0
*/
@Api(tags="公告")
@RestController
@RequestMapping("/zyGonggao/zyGonggao")
@Slf4j
public class ZyGonggaoController extends JeecgController<ZyGonggao, IZyGonggaoService> {
@Autowired
private IZyGonggaoService zyGonggaoService;
/**
* 分页列表查询
*
* @param zyGonggao
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "公告-分页列表查询")
@ApiOperation(value="公告-分页列表查询", notes="公告-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ZyGonggao>> queryPageList(ZyGonggao zyGonggao,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyGonggao> queryWrapper = QueryGenerator.initQueryWrapper(zyGonggao, req.getParameterMap());
Page<ZyGonggao> page = new Page<ZyGonggao>(pageNo, pageSize);
IPage<ZyGonggao> pageList = zyGonggaoService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyGonggao
* @return
*/
@AutoLog(value = "公告-添加")
@ApiOperation(value="公告-添加", notes="公告-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ZyGonggao zyGonggao) {
zyGonggao.setGgStatus("0");
zyGonggaoService.save(zyGonggao);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyGonggao
* @return
*/
@AutoLog(value = "公告-编辑")
@ApiOperation(value="公告-编辑", notes="公告-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ZyGonggao zyGonggao) {
zyGonggaoService.updateById(zyGonggao);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "公告-通过id删除")
@ApiOperation(value="公告-通过id删除", notes="公告-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
zyGonggaoService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "公告-批量删除")
@ApiOperation(value="公告-批量删除", notes="公告-批量删除")
@RequiresPermissions("zyGonggao:zy_gonggao:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.zyGonggaoService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "公告-通过id查询")
@ApiOperation(value="公告-通过id查询", notes="公告-通过id查询")
@GetMapping(value = "/queryById")
public Result<ZyGonggao> queryById(@RequestParam(name="id",required=true) String id) {
ZyGonggao zyGonggao = zyGonggaoService.getById(id);
if(zyGonggao==null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyGonggao);
}
/**
* 导出excel
*
* @param request
* @param zyGonggao
*/
@RequiresPermissions("zyGonggao:zy_gonggao:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyGonggao zyGonggao) {
return super.exportXls(request, zyGonggao, ZyGonggao.class, "公告");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("zyGonggao:zy_gonggao:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyGonggao.class);
}
}

View File

@ -0,0 +1,74 @@
package org.jeecg.modules.kc.zyGonggao.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 公告
* @Author: jeecg-boot
* @Date: 2024-05-10
* @Version: V1.0
*/
@Data
@TableName("zy_gonggao")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="zy_gonggao对象", description="公告")
public class ZyGonggao implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**createBy*/
@ApiModelProperty(value = "createBy")
private java.lang.String createBy;
/**createTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "createTime")
private java.util.Date createTime;
/**updateBy*/
@ApiModelProperty(value = "updateBy")
private java.lang.String updateBy;
/**updateTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "updateTime")
private java.util.Date updateTime;
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
private java.lang.String title;
/**内容*/
@Excel(name = "内容", width = 15)
@ApiModelProperty(value = "内容")
private java.lang.String content;
/**状态*/
@Excel(name = "状态", width = 15, dicCode = "zy_status")
@Dict(dicCode = "zy_status")
@ApiModelProperty(value = "状态")
private java.lang.String ggStatus;
/**发布时间*/
@Excel(name = "发布时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "发布时间")
private java.util.Date fbTime;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.zyGonggao.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.zyGonggao.entity.ZyGonggao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 公告
* @Author: jeecg-boot
* @Date: 2024-05-10
* @Version: V1.0
*/
public interface ZyGonggaoMapper extends BaseMapper<ZyGonggao> {
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.kc.zyGonggao.mapper.ZyGonggaoMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.zyGonggao.service;
import org.jeecg.modules.kc.zyGonggao.entity.ZyGonggao;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 公告
* @Author: jeecg-boot
* @Date: 2024-05-10
* @Version: V1.0
*/
public interface IZyGonggaoService extends IService<ZyGonggao> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.kc.zyGonggao.service.impl;
import org.jeecg.modules.kc.zyGonggao.entity.ZyGonggao;
import org.jeecg.modules.kc.zyGonggao.mapper.ZyGonggaoMapper;
import org.jeecg.modules.kc.zyGonggao.service.IZyGonggaoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 公告
* @Author: jeecg-boot
* @Date: 2024-05-10
* @Version: V1.0
*/
@Service
public class ZyGonggaoServiceImpl extends ServiceImpl<ZyGonggaoMapper, ZyGonggao> implements IZyGonggaoService {
}