添加提醒功能
This commit is contained in:
parent
23dcee1c97
commit
a10540b7cd
|
@ -263,6 +263,24 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
|
|||
queryWrapper.orderByDesc("xqxn");
|
||||
Page<KcKechengbiao> page = new Page<KcKechengbiao>(pageNo, pageSize);
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ public class WjxDjxxController extends JeecgController<WjxDjxx, IWjxDjxxService>
|
|||
if(list.size()>0) {
|
||||
res = wjxDjxxService.djtj(list);
|
||||
}
|
||||
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
|
|
|
@ -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.wjxWjxxTmlb.entity.WjxWjxxTmxx;
|
||||
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.stereotype.Service;
|
||||
|
||||
|
@ -43,6 +45,9 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
@Autowired
|
||||
private WjxWjxxMapper wjxWjxxMapper;
|
||||
|
||||
@Autowired
|
||||
private IZyDbtxService zyDbtxService;
|
||||
|
||||
/**
|
||||
* 提交问卷,并查询答卷
|
||||
* @param list
|
||||
|
@ -222,6 +227,29 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
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 "提交成功!";
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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>
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -269,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("编辑成功!");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue