This commit is contained in:
1378012178@qq.com 2025-01-15 17:02:19 +08:00
commit 32239a8523
12 changed files with 345 additions and 2 deletions

View File

@ -0,0 +1,174 @@
package org.jeecg.modules.kc.kcZjInfo.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.kcZjInfo.entity.KcZjInfo;
import org.jeecg.modules.kc.kcZjInfo.service.IKcZjInfoService;
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: 2025-01-15
* @Version: V1.0
*/
@Api(tags="课程助教名称")
@RestController
@RequestMapping("/kcZjInfo/kcZjInfo")
@Slf4j
public class KcZjInfoController extends JeecgController<KcZjInfo, IKcZjInfoService> {
@Autowired
private IKcZjInfoService kcZjInfoService;
/**
* 分页列表查询
*
* @param kcZjInfo
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "课程助教名称-分页列表查询")
@ApiOperation(value="课程助教名称-分页列表查询", notes="课程助教名称-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<KcZjInfo>> queryPageList(KcZjInfo kcZjInfo,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<KcZjInfo> queryWrapper = QueryGenerator.initQueryWrapper(kcZjInfo, req.getParameterMap());
Page<KcZjInfo> page = new Page<KcZjInfo>(pageNo, pageSize);
IPage<KcZjInfo> pageList = kcZjInfoService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param kcZjInfo
* @return
*/
@AutoLog(value = "课程助教名称-添加")
@ApiOperation(value="课程助教名称-添加", notes="课程助教名称-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody KcZjInfo kcZjInfo) {
kcZjInfoService.save(kcZjInfo);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param kcZjInfo
* @return
*/
@AutoLog(value = "课程助教名称-编辑")
@ApiOperation(value="课程助教名称-编辑", notes="课程助教名称-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody KcZjInfo kcZjInfo) {
kcZjInfoService.updateById(kcZjInfo);
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) {
kcZjInfoService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "课程助教名称-批量删除")
@ApiOperation(value="课程助教名称-批量删除", notes="课程助教名称-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.kcZjInfoService.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<KcZjInfo> queryById(@RequestParam(name="id",required=true) String id) {
KcZjInfo kcZjInfo = kcZjInfoService.getById(id);
if(kcZjInfo==null) {
return Result.error("未找到对应数据");
}
return Result.OK(kcZjInfo);
}
/**
* 导出excel
*
* @param request
* @param kcZjInfo
*/
@RequiresPermissions("kcZjInfo:kc_zj_info:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, KcZjInfo kcZjInfo) {
return super.exportXls(request, kcZjInfo, KcZjInfo.class, "课程助教名称");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("kcZjInfo:kc_zj_info:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, KcZjInfo.class);
}
}

View File

@ -0,0 +1,72 @@
package org.jeecg.modules.kc.kcZjInfo.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: 2025-01-15
* @Version: V1.0
*/
@Data
@TableName("kc_zj_info")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="kc_zj_info对象", description="课程助教名称")
public class KcZjInfo 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")
@DateTimeFormat(pattern="yyyy-MM-dd")
@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 rwbh;
/**主教编号*/
@Excel(name = "主教编号", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ApiModelProperty(value = "主教编号")
private java.lang.String zjbh;
/**课程名称*/
@Excel(name = "课程名称", width = 15)
@ApiModelProperty(value = "课程名称")
private java.lang.String kcmc;
/**助教名称*/
@Excel(name = "助教名称", width = 15)
@ApiModelProperty(value = "助教名称")
private java.lang.String zjxm;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.kcZjInfo.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.kcZjInfo.entity.KcZjInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 课程助教名称
* @Author: jeecg-boot
* @Date: 2025-01-15
* @Version: V1.0
*/
public interface KcZjInfoMapper extends BaseMapper<KcZjInfo> {
}

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.kcZjInfo.mapper.KcZjInfoMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.kcZjInfo.service;
import org.jeecg.modules.kc.kcZjInfo.entity.KcZjInfo;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 课程助教名称
* @Author: jeecg-boot
* @Date: 2025-01-15
* @Version: V1.0
*/
public interface IKcZjInfoService extends IService<KcZjInfo> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.kc.kcZjInfo.service.impl;
import org.jeecg.modules.kc.kcZjInfo.entity.KcZjInfo;
import org.jeecg.modules.kc.kcZjInfo.mapper.KcZjInfoMapper;
import org.jeecg.modules.kc.kcZjInfo.service.IKcZjInfoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 课程助教名称
* @Author: jeecg-boot
* @Date: 2025-01-15
* @Version: V1.0
*/
@Service
public class KcZjInfoServiceImpl extends ServiceImpl<KcZjInfoMapper, KcZjInfo> implements IKcZjInfoService {
}

View File

@ -287,6 +287,29 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
return Result.OK(pageList);
}
@ApiOperation(value="助教查询我的课程", notes="助教查询我的课程")
@GetMapping(value = "/getZjlist")
public Result<IPage<KcKechengbiao>> getZjlist(KcKechengbiao kcKechengbiao,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<KcKechengbiao> queryWrapper = QueryGenerator.initQueryWrapper(kcKechengbiao, req.getParameterMap());
KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
if(StringUtils.equals("0",kcKechengbiao.getCheckType())){//当前学年
queryWrapper.eq("xqxn",kcSysConfig.getFlag1());
}else{//历史学年
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
queryWrapper.apply("jgh in (select create_by from kc_zj_info where zjbh = "+sysUser.getUsername()+")");
queryWrapper.eq("flag","0");
queryWrapper.orderByDesc("xqxn");
Page<KcKechengbiao> page = new Page<KcKechengbiao>(pageNo, pageSize);
IPage<KcKechengbiao> pageList = kcKechengbiaoService.getZjlist(page, queryWrapper);
return Result.OK(pageList);
}
@ApiOperation(value="学生端我的课程", notes="学生端我的课程")
@GetMapping(value = "/getStudentKclist")
public Result<IPage<KcKechengbiao>> getStudentKclist(KcKechengbiao kcKechengbiao,

View File

@ -50,4 +50,6 @@ public interface KcKechengbiaoMapper extends BaseMapper<KcKechengbiao> {
List getStudentRiliKclist(KcKetangbiao kcKetangbiao);
void updateSzkc();
IPage<KcKechengbiao> getZjlist(Page<KcKechengbiao> page,@Param(Constants.WRAPPER) QueryWrapper<KcKechengbiao> queryWrapper);
}

View File

@ -243,4 +243,16 @@
<update id="updateSzkc">
update kc_kechengbiao set szkc = '1' where kkdw = '马列教研室'
</update>
<select id="getZjlist" resultType="org.jeecg.modules.kc.ktgl.entity.KcKechengbiao">
SELECT kcbh,kcmc,xf,kkdw,kcxz,szkc,xqxn,rwbh,skdd,xkrs,jgh,skjs,func_jc (GROUP_CONCAT( sksj )) AS sksj FROM
(
SELECT DISTINCT
kcbh,kcmc,xf,jkzc,kkdw,kcxz,szkc,xqxn,rwbh,skdd,xkrs,jgh,skjs,concat(WEEK,REPLACE ( hh, '、', '' )) AS sksj
FROM kc_kechengbiao
${ew.customSqlSegment}
) t
GROUP BY kcbh,kcmc,xf,kkdw,kcxz,szkc,xqxn,rwbh,skdd,xkrs,jgh,skjs
</select>
</mapper>

View File

@ -48,4 +48,6 @@ public interface IKcKechengbiaoService extends IService<KcKechengbiao> {
List getStudentRiliKclist(KcKetangbiao kcKetangbiao);
void updateSzkc();
IPage<KcKechengbiao> getZjlist(Page<KcKechengbiao> page, QueryWrapper<KcKechengbiao> queryWrapper);
}

View File

@ -102,4 +102,9 @@ public class KcKechengbiaoServiceImpl extends ServiceImpl<KcKechengbiaoMapper, K
baseMapper.updateSzkc();
}
@Override
public IPage<KcKechengbiao> getZjlist(Page<KcKechengbiao> page, QueryWrapper<KcKechengbiao> queryWrapper) {
return baseMapper.getZjlist(page,queryWrapper);
}
}

View File

@ -109,7 +109,6 @@ public class SysUserController {
* @param req
* @return
*/
@RequiresPermissions("system:user:listAll")
@PermissionData(pageComponent = "system/UserList")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public Result<IPage<SysUser>> queryPageList(SysUser user,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@ -141,7 +140,6 @@ public class SysUserController {
* @param req
* @return
*/
@RequiresPermissions("system:user:listAll")
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
public Result<IPage<SysUser>> queryAllPageList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {