基于javaweb+mysql的ssm+maven幼儿园管理系统(java+ssm+vue+echarts+maven+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8、Node.js≥10
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven幼儿园管理系统(java+ssm+vue+echarts+maven+mysql)
项目介绍
该系统主要分为前台和后台两大功能模块,共包含三个角色:管理员、老师、家长。
具体的系统功能如下: 1.前台功能 前台为家长与老师登录,主要功能包含如下: 前台首页、学校公告、园况介绍、课程信息、论坛信息、教学特色、个人中心等功能。
2.后台功能 后台为管理员、家长与老师登录,主要功能包含如下: 后台系统登陆、个人中心、老师管理、家长管理、班级管理、学校公告管理、园况介绍管理、课程信息管理、家长沟通管理、沟通回复管理、论坛管理、系统管理等功能。
后台框架:Spring、SpringMVC、MyBatis UI界面:JSP、jQuery、vue、echarts 数据库:MySQL
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(BanjiEntity banji){
EntityWrapper< BanjiEntity> ew = new EntityWrapper< BanjiEntity>();
ew.allEq(MPUtil.allEQMapPre( banji, "banji"));
BanjiView banjiView = banjiService.selectView(ew);
return R.ok("查询班级成功").put("data", banjiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
BanjiEntity banji = banjiService.selectById(id);
return R.ok().put("data", banji);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
BanjiEntity banji = banjiService.selectById(id);
return R.ok().put("data", banji);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody BanjiEntity banji, HttpServletRequest request){
banji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(banji);
banjiService.insert(banji);
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
discussxuexiaogonggaoService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<DiscussxuexiaogonggaoEntity> wrapper = new EntityWrapper<DiscussxuexiaogonggaoEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
*/
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
public static final String LOGIN_TOKEN_KEY = "Token";
@Autowired
private TokenService tokenService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//支持跨域请求
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
IgnoreAuth annotation;
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
} else {
return true;
}
//从header中获取token
String token = request.getHeader(LOGIN_TOKEN_KEY);
/**
* 不需要验证权限的方法直接放过
*/
if(annotation!=null) {
return true;
}
TokenEntity tokenEntity = null;
if(StringUtils.isNotBlank(token)) {
tokenEntity = tokenService.getTokenEntity(token);
}
if(tokenEntity != null) {
request.getSession().setAttribute("userId", tokenEntity.getUserid());
request.getSession().setAttribute("role", tokenEntity.getRole());
request.getSession().setAttribute("tableName", tokenEntity.getTablename());
request.getSession().setAttribute("username", tokenEntity.getUsername());
return true;
}
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
try {
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<YuankuangjieshaoEntity> wrapper = new EntityWrapper<YuankuangjieshaoEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = yuankuangjieshaoService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
userService.updateById(user);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
public R detail(@PathVariable("id") String id){
KechengxinxiEntity kechengxinxi = kechengxinxiService.selectById(id);
return R.ok().put("data", kechengxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody KechengxinxiEntity kechengxinxi, HttpServletRequest request){
kechengxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(kechengxinxi);
kechengxinxiService.insert(kechengxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody KechengxinxiEntity kechengxinxi, HttpServletRequest request){
kechengxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(kechengxinxi);
kechengxinxiService.insert(kechengxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody KechengxinxiEntity kechengxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(kechengxinxi);
kechengxinxiService.updateById(kechengxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
kechengxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,DiscussyuankuangjieshaoEntity discussyuankuangjieshao, HttpServletRequest request){
EntityWrapper<DiscussyuankuangjieshaoEntity> ew = new EntityWrapper<DiscussyuankuangjieshaoEntity>();
PageUtils page = discussyuankuangjieshaoService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussyuankuangjieshao), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( DiscussyuankuangjieshaoEntity discussyuankuangjieshao){
EntityWrapper<DiscussyuankuangjieshaoEntity> ew = new EntityWrapper<DiscussyuankuangjieshaoEntity>();
ew.allEq(MPUtil.allEQMapPre( discussyuankuangjieshao, "discussyuankuangjieshao"));
return R.ok().put("data", discussyuankuangjieshaoService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(DiscussyuankuangjieshaoEntity discussyuankuangjieshao){
EntityWrapper< DiscussyuankuangjieshaoEntity> ew = new EntityWrapper< DiscussyuankuangjieshaoEntity>();
ew.allEq(MPUtil.allEQMapPre( discussyuankuangjieshao, "discussyuankuangjieshao"));
DiscussyuankuangjieshaoView discussyuankuangjieshaoView = discussyuankuangjieshaoService.selectView(ew);
return R.ok("查询园况介绍评论表成功").put("data", discussyuankuangjieshaoView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
DiscussyuankuangjieshaoEntity discussyuankuangjieshao = discussyuankuangjieshaoService.selectById(id);
return R.ok().put("data", discussyuankuangjieshao);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
DiscussyuankuangjieshaoEntity discussyuankuangjieshao = discussyuankuangjieshaoService.selectById(id);
return R.ok().put("data", discussyuankuangjieshao);
}
/**
* 后端保存
*/
@RequestMapping("/save")
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
DiscussyuankuangjieshaoEntity discussyuankuangjieshao = discussyuankuangjieshaoService.selectById(id);
return R.ok().put("data", discussyuankuangjieshao);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody DiscussyuankuangjieshaoEntity discussyuankuangjieshao, HttpServletRequest request){
discussyuankuangjieshao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(discussyuankuangjieshao);
discussyuankuangjieshaoService.insert(discussyuankuangjieshao);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody DiscussyuankuangjieshaoEntity discussyuankuangjieshao, HttpServletRequest request){
discussyuankuangjieshao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(discussyuankuangjieshao);
discussyuankuangjieshaoService.insert(discussyuankuangjieshao);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody DiscussyuankuangjieshaoEntity discussyuankuangjieshao, HttpServletRequest request){
//ValidatorUtils.validateEntity(discussyuankuangjieshao);
discussyuankuangjieshaoService.updateById(discussyuankuangjieshao);//全部更新
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<DiscussyuankuangjieshaoEntity> wrapper = new EntityWrapper<DiscussyuankuangjieshaoEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = discussyuankuangjieshaoService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
/**
* 家长沟通
* 后端接口
* @email
*/
@RestController
@RequestMapping("/jiazhanggoutong")
public class JiazhanggoutongController {
@Autowired
private JiazhanggoutongService jiazhanggoutongService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,JiazhanggoutongEntity jiazhanggoutong, HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("jiazhang")) {
jiazhanggoutong.setJiazhangzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<JiazhanggoutongEntity> ew = new EntityWrapper<JiazhanggoutongEntity>();
PageUtils page = jiazhanggoutongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiazhanggoutong), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
@RequestMapping("/discusskechengxinxi")
public class DiscusskechengxinxiController {
@Autowired
private DiscusskechengxinxiService discusskechengxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,DiscusskechengxinxiEntity discusskechengxinxi, HttpServletRequest request){
EntityWrapper<DiscusskechengxinxiEntity> ew = new EntityWrapper<DiscusskechengxinxiEntity>();
PageUtils page = discusskechengxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discusskechengxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,DiscusskechengxinxiEntity discusskechengxinxi, HttpServletRequest request){
EntityWrapper<DiscusskechengxinxiEntity> ew = new EntityWrapper<DiscusskechengxinxiEntity>();
PageUtils page = discusskechengxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discusskechengxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( DiscusskechengxinxiEntity discusskechengxinxi){
EntityWrapper<DiscusskechengxinxiEntity> ew = new EntityWrapper<DiscusskechengxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( discusskechengxinxi, "discusskechengxinxi"));
return R.ok().put("data", discusskechengxinxiService.selectListView(ew));
}
/**
goutonghuifu.setJiazhangzhanghao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("laoshi")) {
goutonghuifu.setLaoshigonghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<GoutonghuifuEntity> ew = new EntityWrapper<GoutonghuifuEntity>();
PageUtils page = goutonghuifuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, goutonghuifu), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,GoutonghuifuEntity goutonghuifu, HttpServletRequest request){
EntityWrapper<GoutonghuifuEntity> ew = new EntityWrapper<GoutonghuifuEntity>();
PageUtils page = goutonghuifuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, goutonghuifu), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( GoutonghuifuEntity goutonghuifu){
EntityWrapper<GoutonghuifuEntity> ew = new EntityWrapper<GoutonghuifuEntity>();
ew.allEq(MPUtil.allEQMapPre( goutonghuifu, "goutonghuifu"));
return R.ok().put("data", goutonghuifuService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(GoutonghuifuEntity goutonghuifu){
EntityWrapper< GoutonghuifuEntity> ew = new EntityWrapper< GoutonghuifuEntity>();
ew.allEq(MPUtil.allEQMapPre( goutonghuifu, "goutonghuifu"));
GoutonghuifuView goutonghuifuView = goutonghuifuService.selectView(ew);
return R.ok("查询沟通回复成功").put("data", goutonghuifuView);
}
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<GoutonghuifuEntity> wrapper = new EntityWrapper<GoutonghuifuEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("jiazhang")) {
wrapper.eq("jiazhangzhanghao", (String)request.getSession().getAttribute("username"));
}
if(tableName.equals("laoshi")) {
wrapper.eq("laoshigonghao", (String)request.getSession().getAttribute("username"));
}
int count = goutonghuifuService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
/**
* 沟通回复
* 后端接口
* @email
*/
@RestController
@RequestMapping("/goutonghuifu")
public class GoutonghuifuController {
@Autowired
private GoutonghuifuService goutonghuifuService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,GoutonghuifuEntity goutonghuifu, HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("jiazhang")) {
goutonghuifu.setJiazhangzhanghao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("laoshi")) {
goutonghuifu.setLaoshigonghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<GoutonghuifuEntity> ew = new EntityWrapper<GoutonghuifuEntity>();
PageUtils page = goutonghuifuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, goutonghuifu), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,GoutonghuifuEntity goutonghuifu, HttpServletRequest request){
EntityWrapper<GoutonghuifuEntity> ew = new EntityWrapper<GoutonghuifuEntity>();
PageUtils page = goutonghuifuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, goutonghuifu), params), params));
return R.ok().put("data", page);
* @email
*/
@RestController
@RequestMapping("/jiazhanggoutong")
public class JiazhanggoutongController {
@Autowired
private JiazhanggoutongService jiazhanggoutongService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,JiazhanggoutongEntity jiazhanggoutong, HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("jiazhang")) {
jiazhanggoutong.setJiazhangzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<JiazhanggoutongEntity> ew = new EntityWrapper<JiazhanggoutongEntity>();
PageUtils page = jiazhanggoutongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiazhanggoutong), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,JiazhanggoutongEntity jiazhanggoutong, HttpServletRequest request){
EntityWrapper<JiazhanggoutongEntity> ew = new EntityWrapper<JiazhanggoutongEntity>();
PageUtils page = jiazhanggoutongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiazhanggoutong), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
client = new AipFace(null, APIKey, SecretKey);
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
}
JSONObject res = null;
try {
File file1 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face1);
File file2 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face2);
String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
MatchRequest req1 = new MatchRequest(img1, "BASE64");
MatchRequest req2 = new MatchRequest(img2, "BASE64");
ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
requests.add(req1);
requests.add(req2);
res = client.match(requests);
System.out.println(res.get("result"));
} catch (FileNotFoundException e) {
e.printStackTrace();
return R.error("文件不存在");
} catch (IOException e) {
e.printStackTrace();
}
return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
}
/**
* 获取table表中的column列表(联动接口)
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/option/{tableName}/{columnName}")
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
if(StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if(StringUtils.isNotBlank(parent)) {
*/
@RequestMapping("/update")
public R update(@RequestBody ForumEntity forum, HttpServletRequest request){
//ValidatorUtils.validateEntity(forum);
forumService.updateById(forum);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
forumService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
discussxuexiaogonggaoService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<DiscussxuexiaogonggaoEntity> wrapper = new EntityWrapper<DiscussxuexiaogonggaoEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = discussxuexiaogonggaoService.selectCount(wrapper);
return R.ok().put("count", count);
}
}