Compare commits

...

3 Commits

Author SHA1 Message Date
yangjun a10540b7cd 添加提醒功能 2024-05-25 09:52:21 +08:00
yangjun 23dcee1c97 Merge branch 'master' of http://47.115.223.229:8888/yangjun/dbsd_kczx_java 2024-05-24 20:46:05 +08:00
yangjun f6b02406c0 修改bug 2024-05-24 20:45:52 +08:00
14 changed files with 572 additions and 47 deletions

View File

@ -29,6 +29,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@ -63,6 +65,8 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
private IKcSzkcService kcSzkcService; private IKcSzkcService kcSzkcService;
@Autowired @Autowired
private IKcSysConfigService kcSysConfigService; private IKcSysConfigService kcSysConfigService;
@Autowired
private IZyDbtxService zyDbtxService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -259,6 +263,24 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
queryWrapper.orderByDesc("xqxn"); queryWrapper.orderByDesc("xqxn");
Page<KcKechengbiao> page = new Page<KcKechengbiao>(pageNo, pageSize); Page<KcKechengbiao> page = new Page<KcKechengbiao>(pageNo, pageSize);
IPage<KcKechengbiao> pageList = kcKechengbiaoService.getKechengbiaolist(page, queryWrapper); IPage<KcKechengbiao> pageList = kcKechengbiaoService.getKechengbiaolist(page, queryWrapper);
//展示代办提醒
if(pageList.getRecords().size()>0){
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(sysUser.getUsername());
List<ZyDbtx> dbtxList = zyDbtxService.getDbtxList(zyDbtx);
for(KcKechengbiao par:pageList.getRecords()){
for(ZyDbtx txPar : dbtxList){
if(StringUtils.equals(par.getRwbh(),txPar.getRwbh())){
par.setDbtxType(txPar.getType());
break;
}
}
}
}
return Result.OK(pageList); return Result.OK(pageList);
} }
@ -277,6 +299,25 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
queryWrapper.orderByAsc("kc.kcmc"); queryWrapper.orderByAsc("kc.kcmc");
Page<KcKechengbiao> page = new Page<KcKechengbiao>(pageNo, pageSize); Page<KcKechengbiao> page = new Page<KcKechengbiao>(pageNo, pageSize);
IPage<KcKechengbiao> pageList = kcKechengbiaoService.getStudentKclist(page, queryWrapper); IPage<KcKechengbiao> pageList = kcKechengbiaoService.getStudentKclist(page, queryWrapper);
//展示代办提醒
if(pageList.getRecords().size()>0){
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(sysUser.getUsername());
List<ZyDbtx> dbtxList = zyDbtxService.getDbtxList(zyDbtx);
for(KcKechengbiao par:pageList.getRecords()){
for(ZyDbtx txPar : dbtxList){
if(StringUtils.equals(par.getRwbh(),txPar.getRwbh())){
par.setDbtxType(txPar.getType());
break;
}
}
}
}
return Result.OK(pageList); return Result.OK(pageList);
} }

View File

@ -254,5 +254,7 @@ public class KcKechengbiao implements Serializable {
private java.lang.String ywcol; private java.lang.String ywcol;
@TableField(exist = false) @TableField(exist = false)
private java.lang.String checkType; private java.lang.String checkType;
@TableField(exist = false)
private java.lang.String dbtxType;
} }

View File

@ -44,6 +44,7 @@ public class WjxDjxxController extends JeecgController<WjxDjxx, IWjxDjxxService>
if(list.size()>0) { if(list.size()>0) {
res = wjxDjxxService.djtj(list); res = wjxDjxxService.djtj(list);
} }
return Result.OK(res); return Result.OK(res);
} }

View File

@ -19,6 +19,8 @@ import org.jeecg.modules.kc.wjxWjxx.mapper.WjxWjxxMapper;
import org.jeecg.modules.kc.wjxWjxx.utils.WjxUtil; import org.jeecg.modules.kc.wjxWjxx.utils.WjxUtil;
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmxx; import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmxx;
import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmxxMapper; import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmxxMapper;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -43,6 +45,9 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
@Autowired @Autowired
private WjxWjxxMapper wjxWjxxMapper; private WjxWjxxMapper wjxWjxxMapper;
@Autowired
private IZyDbtxService zyDbtxService;
/** /**
* 提交问卷并查询答卷 * 提交问卷并查询答卷
* @param list * @param list
@ -222,6 +227,29 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
wjxWjxxMapper.updateById(wjxWjxx); wjxWjxxMapper.updateById(wjxWjxx);
} }
String type = "";
String content = "";
if(StringUtils.equals("6",wjxWjxx.getAtype())){
type = "6";
content = "您有一条新的测验待查阅";
}else{
type = "7";
content = "您有一条新的问卷待查阅";
}
//作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(wjxWjxx.getCreateBy());
zyDbtx.setType(type);//0发布作业 1评分 2测验 3问卷 4讨论 5学生提交作业 6学生提交测验 7学生提交问卷
zyDbtx.setMainId(wjxWjxx.getId());
zyDbtx.setRwbh(wjxWjxx.getRwbh());
zyDbtx.setContent(content);
zyDbtx.setFlag("0");
zyDbtxService.save(zyDbtx);
return "提交成功!"; return "提交成功!";
} }

View File

@ -1,11 +1,15 @@
package org.jeecg.modules.kc.wjxWjxx.controller; package org.jeecg.modules.kc.wjxWjxx.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx; import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import org.jeecg.modules.kc.wjxWjxx.service.IWjxWjxxService; import org.jeecg.modules.kc.wjxWjxx.service.IWjxWjxxService;
@ -14,6 +18,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import org.jeecg.modules.tools.WjxAuthService; import org.jeecg.modules.tools.WjxAuthService;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -40,6 +47,12 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
@Autowired @Autowired
private WjxAuthService wjxAuthService; private WjxAuthService wjxAuthService;
@Autowired
private IXxhbbksService xxhbbksService;
@Autowired
private IZyDbtxService zyDbtxService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -208,6 +221,37 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
@GetMapping(value = "/fbwj") @GetMapping(value = "/fbwj")
public Result<String> fbwj(@RequestParam(name="id",required=true) String id,@RequestParam(name="wjlx",required=true) String wjlx) { public Result<String> fbwj(@RequestParam(name="id",required=true) String id,@RequestParam(name="wjlx",required=true) String wjlx) {
String res = wjxWjxxService.fbwj(id,wjlx); String res = wjxWjxxService.fbwj(id,wjlx);
WjxWjxx wjxWjxx=wjxWjxxService.getById(id);
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq("b.KCAPZBBH",wjxWjxx.getRwbh());
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
String type = "";
String content = "";
if(StringUtils.equals(wjlx,"6")){
type = "2";
content = "您有一条测验需要提交!";
}else{
type = "3";
content = "您有一条问卷需要提交!";
}
for(Xxhbbks xxhbbks:list){
//作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(xxhbbks.getXh());
zyDbtx.setType(type);//0发布作业 1评分 2测验 3问卷 4讨论
zyDbtx.setMainId(wjxWjxx.getId());
zyDbtx.setRwbh(wjxWjxx.getRwbh());
zyDbtx.setContent(content);
zyDbtx.setFlag("0");
zyDbtxService.save(zyDbtx);
}
return Result.OK(res); return Result.OK(res);
} }

View File

@ -0,0 +1,192 @@
package org.jeecg.modules.kc.zyDbtx.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 com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
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-24
* @Version: V1.0
*/
@Api(tags="代办提醒")
@RestController
@RequestMapping("/zyDbtx/zyDbtx")
@Slf4j
public class ZyDbtxController extends JeecgController<ZyDbtx, IZyDbtxService> {
@Autowired
private IZyDbtxService zyDbtxService;
/**
* 分页列表查询
*
* @param zyDbtx
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "代办提醒-分页列表查询")
@ApiOperation(value="代办提醒-分页列表查询", notes="代办提醒-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ZyDbtx>> queryPageList(ZyDbtx zyDbtx,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyDbtx> queryWrapper = QueryGenerator.initQueryWrapper(zyDbtx, req.getParameterMap());
Page<ZyDbtx> page = new Page<ZyDbtx>(pageNo, pageSize);
IPage<ZyDbtx> pageList = zyDbtxService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyDbtx
* @return
*/
@AutoLog(value = "代办提醒-添加")
@ApiOperation(value="代办提醒-添加", notes="代办提醒-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ZyDbtx zyDbtx) {
zyDbtxService.save(zyDbtx);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyDbtx
* @return
*/
@AutoLog(value = "代办提醒-编辑")
@ApiOperation(value="代办提醒-编辑", notes="代办提醒-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ZyDbtx zyDbtx) {
zyDbtxService.updateById(zyDbtx);
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) {
zyDbtxService.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.zyDbtxService.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<ZyDbtx> queryById(@RequestParam(name="id",required=true) String id) {
ZyDbtx zyDbtx = zyDbtxService.getById(id);
if(zyDbtx==null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyDbtx);
}
/**
* 导出excel
*
* @param request
* @param zyDbtx
*/
@RequiresPermissions("zyDbtx:zy_dbtx:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyDbtx zyDbtx) {
return super.exportXls(request, zyDbtx, ZyDbtx.class, "代办提醒");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("zyDbtx:zy_dbtx:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyDbtx.class);
}
@AutoLog(value = "代办提醒-通过rwbh")
@ApiOperation(value="代办提醒-通过rwbh删除", notes="代办提醒-通过rwbh删除")
@PostMapping(value = "/deleteByRwbhCreate")
public Result<ZyDbtx> deleteByRwbhCreate(@RequestBody ZyDbtx zyDbtx) {
String rwbh = zyDbtx.getRwbh();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
UpdateWrapper<ZyDbtx> zyDbtxDeleteMapping = new UpdateWrapper<>();
zyDbtxDeleteMapping.eq("rwbh", rwbh);
zyDbtxDeleteMapping.eq("create_by", sysUser.getUsername());
zyDbtxService.remove(zyDbtxDeleteMapping);
return Result.OK(null);
}
}

View File

@ -0,0 +1,77 @@
package org.jeecg.modules.kc.zyDbtx.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-24
* @Version: V1.0
*/
@Data
@TableName("zy_dbtx")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="zy_dbtx对象", description="代办提醒")
public class ZyDbtx 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;
/**通知类型0发布作业 1评分 2测验 3问卷 4讨论*/
@Excel(name = "通知类型0发布作业 1评分 2测验 3问卷 4讨论", width = 15, dicCode = "dbtx_type")
@Dict(dicCode = "dbtx_type")
@ApiModelProperty(value = "通知类型0发布作业 1评分 2测验 3问卷 4讨论")
private java.lang.String type;
/**任务编号*/
@Excel(name = "任务编号", width = 15)
@ApiModelProperty(value = "任务编号")
private java.lang.String rwbh;
/**任务id*/
@Excel(name = "任务id", width = 15)
@ApiModelProperty(value = "任务id")
private java.lang.String mainId;
/**内容*/
@Excel(name = "内容", width = 15)
@ApiModelProperty(value = "内容")
private java.lang.String content;
/**标识*/
@Excel(name = "标识", width = 15, dicCode = "yn")
@Dict(dicCode = "yn")
@ApiModelProperty(value = "标识")
private java.lang.String flag;
}

View File

@ -0,0 +1,18 @@
package org.jeecg.modules.kc.zyDbtx.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 代办提醒
* @Author: jeecg-boot
* @Date: 2024-05-24
* @Version: V1.0
*/
public interface ZyDbtxMapper extends BaseMapper<ZyDbtx> {
List<ZyDbtx> getDbtxList(ZyDbtx zyDbtx);
}

View File

@ -0,0 +1,8 @@
<?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.zyDbtx.mapper.ZyDbtxMapper">
<select id="getDbtxList" resultType="org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx">
select rwbh,GROUP_CONCAT(type) as type from zy_dbtx where create_by = #{createBy} GROUP BY rwbh
</select>
</mapper>

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.zyDbtx.service;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 代办提醒
* @Author: jeecg-boot
* @Date: 2024-05-24
* @Version: V1.0
*/
public interface IZyDbtxService extends IService<ZyDbtx> {
List<ZyDbtx> getDbtxList(ZyDbtx zyDbtx);
}

View File

@ -0,0 +1,25 @@
package org.jeecg.modules.kc.zyDbtx.service.impl;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.mapper.ZyDbtxMapper;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: 代办提醒
* @Author: jeecg-boot
* @Date: 2024-05-24
* @Version: V1.0
*/
@Service
public class ZyDbtxServiceImpl extends ServiceImpl<ZyDbtxMapper, ZyDbtx> implements IZyDbtxService {
@Override
public List<ZyDbtx> getDbtxList(ZyDbtx zyDbtx) {
return baseMapper.getDbtxList(zyDbtx);
}
}

View File

@ -1,57 +1,38 @@
package org.jeecg.modules.kc.zyInfo.controller; package org.jeecg.modules.kc.zyInfo.controller;
import java.util.Arrays;
import java.util.Date;
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.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
import org.jeecg.modules.kc.kcSysConfig.entity.KcSysConfig;
import org.jeecg.modules.kc.kcSysConfig.service.IKcSysConfigService;
import org.jeecg.modules.kc.kcXqxnHistory.entity.KcXqxnHistory;
import org.jeecg.modules.kc.kcXqxnHistory.service.IKcXqxnHistoryService;
import org.jeecg.modules.kc.ktgl.entity.KcKechengbiao;
import org.jeecg.modules.kc.ktgl.service.IKcKechengbiaoService;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import org.jeecg.modules.kc.zyInfoStudent.service.IZyInfoStudentService;
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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; 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.common.system.vo.LoginUser;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
import org.jeecg.modules.kc.kcSysConfig.entity.KcSysConfig;
import org.jeecg.modules.kc.kcSysConfig.service.IKcSysConfigService;
import org.jeecg.modules.kc.ktgl.entity.KcKechengbiao;
import org.jeecg.modules.kc.ktgl.service.IKcKechengbiaoService;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import org.jeecg.modules.kc.zyInfoStudent.service.IZyInfoStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/** /**
* @Description: 作业发布 * @Description: 作业发布
@ -74,6 +55,9 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
private IXxhbbksService xxhbbksService; private IXxhbbksService xxhbbksService;
@Autowired @Autowired
private IZyInfoStudentService zyInfoStudentService; private IZyInfoStudentService zyInfoStudentService;
@Autowired
private IZyDbtxService zyDbtxService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -164,6 +148,17 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
zyInfoStudent.setCreateBy(xxhbbks.getXh()); zyInfoStudent.setCreateBy(xxhbbks.getXh());
zyInfoStudent.setStudentName(xxhbbks.getXm()); zyInfoStudent.setStudentName(xxhbbks.getXm());
zyInfoStudentService.save(zyInfoStudent); zyInfoStudentService.save(zyInfoStudent);
//作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(xxhbbks.getXh());
zyDbtx.setType("0");//0发布作业 1评分 2测验 3问卷 4讨论
zyDbtx.setMainId(zyInfo.getId());
zyDbtx.setRwbh(zyInfo.getRwbh());
zyDbtx.setContent("您有一条作业需要提交!");
zyDbtx.setFlag("0");
zyDbtxService.save(zyDbtx);
} }
} }
return Result.OK(zyInfo); return Result.OK(zyInfo);

View File

@ -21,6 +21,8 @@ import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.SpringContextHolder; import org.jeecg.common.util.SpringContextHolder;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.zyCcjg.service.IZyCcjgService; import org.jeecg.modules.kc.zyCcjg.service.IZyCcjgService;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo; import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService; import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent; import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
@ -71,6 +73,9 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
@Autowired @Autowired
private IZyCcjgService zyCcjgService; private IZyCcjgService zyCcjgService;
@Autowired
private IZyDbtxService zyDbtxService;
@Value("${jeecg.path.upload}") @Value("${jeecg.path.upload}")
private String upLoadPath; private String upLoadPath;
/** /**
@ -131,10 +136,22 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
@ApiOperation(value="发布评分状态", notes="发布评分状态") @ApiOperation(value="发布评分状态", notes="发布评分状态")
@RequestMapping(value = "/editFabu", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/editFabu", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> editFabu(@RequestBody ZyInfoStudent zyInfoStudent) { public Result<String> editFabu(@RequestBody ZyInfoStudent zyInfoStudent) {
String score = zyInfoStudent.getScore();
zyInfoStudentService.editFabu(zyInfoStudent); zyInfoStudentService.editFabu(zyInfoStudent);
ZyInfoStudent zyInfoStudentPar = zyInfoStudentService.getById(zyInfoStudent.getId()); ZyInfoStudent zyInfoStudentPar = zyInfoStudentService.getById(zyInfoStudent.getId());
if(StringUtils.isNotEmpty(score)){
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudentPar.getMainId());
//作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(zyInfoStudentPar.getCreateBy());
zyDbtx.setType("1");//0发布作业 1评分 2测验 3问卷 4讨论
zyDbtx.setMainId(zyInfoStudentPar.getId());
zyDbtx.setRwbh(zyInfo.getRwbh());
zyDbtx.setContent("您有一条新的评分,请及时查看!");
zyDbtx.setFlag("0");
zyDbtxService.save(zyDbtx);
}
QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrapper = new QueryWrapper<>(); QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrapper = new QueryWrapper<>();
zyInfoStudentQueryWrapper.eq("main_id",zyInfoStudentPar.getMainId()); zyInfoStudentQueryWrapper.eq("main_id",zyInfoStudentPar.getMainId());
@ -252,6 +269,23 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
ZyInfoStudent stuPar = zyInfoStudentService.getById(zyInfoStudent.getId());
ZyInfo zyInfo = zyInfoService.getById(stuPar.getMainId());
//作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(zyInfo.getCreateBy());
zyDbtx.setType("5");//0发布作业 1评分 2测验 3问卷 4讨论 5学生提交作业 6学生提交测验 7学生提交问卷
zyDbtx.setMainId(zyInfo.getId());
zyDbtx.setRwbh(zyInfo.getRwbh());
zyDbtx.setContent("您有一条新的作业待审批!");
zyDbtx.setFlag("0");
zyDbtxService.save(zyDbtx);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }

View File

@ -9,9 +9,16 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.jeecg.modules.kc.zyTlq.entity.ZyTlq; import org.jeecg.modules.kc.zyTlq.entity.ZyTlq;
import org.jeecg.modules.kc.zyTlq.service.IZyTlqService; import org.jeecg.modules.kc.zyTlq.service.IZyTlqService;
@ -50,6 +57,12 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class ZyTlqController extends JeecgController<ZyTlq, IZyTlqService> { public class ZyTlqController extends JeecgController<ZyTlq, IZyTlqService> {
@Autowired @Autowired
private IZyTlqService zyTlqService; private IZyTlqService zyTlqService;
@Autowired
private IXxhbbksService xxhbbksService;
@Autowired
private IZyDbtxService zyDbtxService;
/** /**
* 分页列表查询 * 分页列表查询
@ -172,4 +185,34 @@ public class ZyTlqController extends JeecgController<ZyTlq, IZyTlqService> {
return super.importExcel(request, response, ZyTlq.class); return super.importExcel(request, response, ZyTlq.class);
} }
@AutoLog(value = "讨论区-发布")
@ApiOperation(value="讨论区-发布", notes="讨论区-发布")
@RequestMapping(value = "/editFbtl", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> editFbtl(@RequestBody ZyTlq zyTlq) {
zyTlqService.updateById(zyTlq);
ZyTlq par=zyTlqService.getById(zyTlq.getId());
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq("b.KCAPZBBH",par.getRwbh());
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
for(Xxhbbks xxhbbks:list){
//作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(xxhbbks.getXh());
zyDbtx.setType("4");//0发布作业 1评分 2测验 3问卷 4讨论
zyDbtx.setMainId(par.getId());
zyDbtx.setRwbh(par.getRwbh());
zyDbtx.setContent("您有一条新的讨论话题,请即时进行讨论");
zyDbtx.setFlag("0");
zyDbtxService.save(zyDbtx);
}
return Result.OK("编辑成功!");
}
} }