package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.ZiyuanshangchuanEntity;
import com.entity.view.ZiyuanshangchuanView;
import com.service.ZiyuanshangchuanService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 资源上传
* 后端接口
* @author
* @email
* @date 2022-04-19 14:41:53
*/
@RestController
@RequestMapping("/ziyuanshangchuan")
public class ZiyuanshangchuanController {
@Autowired
private ZiyuanshangchuanService ziyuanshangchuanService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ZiyuanshangchuanEntity ziyuanshangchuan,
@RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd") Date chuangjianshijianstart,
@RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd") Date chuangjianshijianend,
@RequestParam(required = false) Double shuliangstart,
@RequestParam(required = false) Double shuliangend,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
ziyuanshangchuan.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<ZiyuanshangchuanEntity> ew = new EntityWrapper<ZiyuanshangchuanEntity>();
if(chuangjianshijianstart!=null) ew.ge("chuangjianshijian", chuangjianshijianstart);
if(chuangjianshijianend!=null) ew.le("chuangjianshijian", chuangjianshijianend);
if(shuliangstart!=null) ew.ge("shuliang", shuliangstart);
if(shuliangend!=null) ew.le("shuliang", shuliangend);
PageUtils page = ziyuanshangchuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, ziyuanshangchuan), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ZiyuanshangchuanEntity ziyuanshangchuan,
@RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd") Date chuangjianshijianstart,
@RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd") Date chuangjianshijianend,
@RequestParam(required = false) Double shuliangstart,
@RequestParam(required = false) Double shuliangend,
HttpServletRequest request){
EntityWrapper<ZiyuanshangchuanEntity> ew = new EntityWrapper<ZiyuanshangchuanEntity>();
if(chuangjianshijianstart!=null) ew.ge("chuangjianshijian", chuangjianshijianstart);
if(chuangjianshijianend!=null) ew.le("chuangjianshijian", chuangjianshijianend);
if(shuliangstart!=null) ew.ge("shuliang", shuliangstart);
if(shuliangend!=null) ew.le("shuliang", shuliangend);
PageUtils page = ziyuanshangchuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, ziyuanshangchuan), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ZiyuanshangchuanEntity ziyuanshangchuan){
EntityWrapper<ZiyuanshangchuanEntity> ew = new EntityWrapper<ZiyuanshangchuanEntity>();
ew.allEq(MPUtil.allEQMapPre( ziyuanshangchuan, "ziyuanshangchuan"));
return R.ok().put("data", ziyuanshangchuanService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ZiyuanshangchuanEntity ziyuanshangchuan){
EntityWrapper< ZiyuanshangchuanEntity> ew = new EntityWrapper< ZiyuanshangchuanEntity>();
ew.allEq(MPUtil.allEQMapPre( ziyuanshangchuan, "ziyuanshangchuan"));
ZiyuanshangchuanView ziyuanshangchuanView = ziyuanshangchuanService.selectView(ew);
return R.ok("查询资源上传成功").put("data", ziyuanshangchuanView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ZiyuanshangchuanEntity ziyuanshangchuan = ziyuanshangchuanService.selectById(id);
return R.ok().put("data", ziyuanshangchuan);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ZiyuanshangchuanEntity ziyuanshangchuan = ziyuanshangchuanService.selectById(id);
return R.ok().put("data", ziyuanshangchuan);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ZiyuanshangchuanEntity ziyuanshangchuan, HttpServletRequest request){
ziyuanshangchuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(ziyuanshangchuan);
ziyuanshangchuanService.insert(ziyuanshangchuan);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ZiyuanshangchuanEntity ziyuanshangchuan, HttpServletRequest request){
ziyuanshangchuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(ziyuanshangchuan);
ziyuanshangchuanService.insert(ziyuanshangchuan);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ZiyuanshangchuanEntity ziyuanshangchuan, HttpServletRequest request){
//ValidatorUtils.validateEntity(ziyuanshangchuan);
ziyuanshangchuanService.updateById(ziyuanshangchuan);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
ziyuanshangchuanService.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) {
I
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
电子资源管理系统实现的内容主要包括首页,个人中心,用户管理,电子资源管理,资源列表管理,资源日志管理,我的收藏管理,系统管理等功能。 环境说明: 开发语言:Java 框架:ssm JDK版本:JDK1.8 数据库:mysql 5.7+ 部署容器:tomcat7+ 数据库工具:Navicat11+ 开发软件:eclipse/myeclipse/idea(推荐idea) Maven包:Maven3.3.9
资源推荐
资源详情
资源评论
收起资源包目录
java毕业设计之电子资源管理系统源码(ssm完整前后端+mysql+LW).zip (444个子文件)
update-password.vue.bak 3KB
IndexMain.vue.bak 2KB
IndexAsideStatic.vue.bak 2KB
BreadCrumbs.vue.bak 2KB
IndexHeader.vue.bak 2KB
3-build.bat 15B
2-run.bat 14B
1-install.bat 12B
.classpath 1KB
org.eclipse.wst.common.component 689B
org.eclipse.wst.jsdt.ui.superType.container 49B
app.10d9bb80.css 264KB
bootstrap.css 143KB
bootstrap.min.css 118KB
chunk-vendors.1f0a25b2.css 37KB
canvas-bg-1.css 391B
canvas-bg-2.css 83B
canvas-bg-3.css 61B
glyphicons-halflings-regular.eot 20KB
.gitignore 10B
index.html 930B
index.html 559B
favicon.ico 4KB
favicon.ico 4KB
ZiyuanshangchuanController.java 12KB
ShujukuController.java 11KB
CommonController.java 9KB
YonghuController.java 9KB
ZiyuanliebiaoController.java 7KB
BianmujianchaController.java 7KB
XitongrizhiController.java 7KB
ShujukumingchengController.java 7KB
ZiyuanbiaoyinController.java 7KB
ZiyuanjiansuoController.java 7KB
ZiyuanbiaoyinEntity.java 6KB
ZiyuanshangchuanEntity.java 5KB
UserController.java 5KB
MPUtil.java 5KB
ZiyuanbiaoyinModel.java 5KB
ZiyuanbiaoyinVO.java 4KB
ShujukuEntity.java 4KB
ZiyuanshangchuanModel.java 4KB
BianmujianchaEntity.java 4KB
ZiyuanshangchuanVO.java 4KB
ShujukumingchengEntity.java 4KB
XitongrizhiEntity.java 4KB
ZiyuanliebiaoEntity.java 4KB
BaiduUtil.java 4KB
YonghuEntity.java 3KB
FileController.java 3KB
ConfigController.java 3KB
AuthorizationInterceptor.java 3KB
ShujukuModel.java 3KB
ShujukuVO.java 3KB
ShujukumingchengModel.java 3KB
BianmujianchaModel.java 3KB
ZiyuanshangchuanServiceImpl.java 3KB
ShujukumingchengVO.java 3KB
BianmujianchaVO.java 3KB
XitongrizhiModel.java 3KB
Query.java 3KB
XitongrizhiVO.java 3KB
TokenServiceImpl.java 2KB
ShujukuServiceImpl.java 2KB
ZiyuanliebiaoModel.java 2KB
ZiyuanjiansuoEntity.java 2KB
ZiyuanliebiaoVO.java 2KB
CommonUtil.java 2KB
TokenEntity.java 2KB
YonghuModel.java 2KB
ShujukumingchengServiceImpl.java 2KB
YonghuVO.java 2KB
BianmujianchaServiceImpl.java 2KB
ZiyuanjiansuoServiceImpl.java 2KB
ZiyuanliebiaoServiceImpl.java 2KB
ZiyuanbiaoyinServiceImpl.java 2KB
PageUtils.java 2KB
XitongrizhiServiceImpl.java 2KB
YonghuServiceImpl.java 2KB
ZiyuanshangchuanDao.java 1KB
CommonServiceImpl.java 1KB
ZiyuanshangchuanService.java 1KB
UserServiceImpl.java 1KB
ShujukuDao.java 1KB
ShujukuService.java 1KB
UserEntity.java 1KB
SpringContextUtils.java 1KB
ValidatorUtils.java 1KB
ShujukumingchengService.java 1KB
ShujukumingchengDao.java 1KB
SQLFilter.java 1KB
ZiyuanliebiaoService.java 1KB
BianmujianchaService.java 1KB
ZiyuanjiansuoService.java 1KB
ZiyuanbiaoyinService.java 1KB
ZiyuanbiaoyinDao.java 1KB
ZiyuanjiansuoDao.java 1KB
ZiyuanliebiaoDao.java 1KB
BianmujianchaDao.java 1KB
XitongrizhiService.java 1KB
共 444 条
- 1
- 2
- 3
- 4
- 5
资源评论
大学生资源网
- 粉丝: 139
- 资源: 1334
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功