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.transaction.annotation.Transactional;
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.WuzixiangqingEntity;
import com.entity.view.WuzixiangqingView;
import com.service.WuzixiangqingService;
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-05-14 10:48:30
*/
@RestController
@RequestMapping("/wuzixiangqing")
public class WuzixiangqingController {
@Autowired
private WuzixiangqingService wuzixiangqingService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,WuzixiangqingEntity wuzixiangqing,
@RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") Date shengchanriqistart,
@RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") Date shengchanriqiend,
HttpServletRequest request){
EntityWrapper<WuzixiangqingEntity> ew = new EntityWrapper<WuzixiangqingEntity>();
if(shengchanriqistart!=null) ew.ge("shengchanriqi", shengchanriqistart);
if(shengchanriqiend!=null) ew.le("shengchanriqi", shengchanriqiend);
PageUtils page = wuzixiangqingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wuzixiangqing), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,WuzixiangqingEntity wuzixiangqing,
@RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") Date shengchanriqistart,
@RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") Date shengchanriqiend,
HttpServletRequest request){
EntityWrapper<WuzixiangqingEntity> ew = new EntityWrapper<WuzixiangqingEntity>();
if(shengchanriqistart!=null) ew.ge("shengchanriqi", shengchanriqistart);
if(shengchanriqiend!=null) ew.le("shengchanriqi", shengchanriqiend);
PageUtils page = wuzixiangqingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wuzixiangqing), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( WuzixiangqingEntity wuzixiangqing){
EntityWrapper<WuzixiangqingEntity> ew = new EntityWrapper<WuzixiangqingEntity>();
ew.allEq(MPUtil.allEQMapPre( wuzixiangqing, "wuzixiangqing"));
return R.ok().put("data", wuzixiangqingService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(WuzixiangqingEntity wuzixiangqing){
EntityWrapper< WuzixiangqingEntity> ew = new EntityWrapper< WuzixiangqingEntity>();
ew.allEq(MPUtil.allEQMapPre( wuzixiangqing, "wuzixiangqing"));
WuzixiangqingView wuzixiangqingView = wuzixiangqingService.selectView(ew);
return R.ok("查询物资详情成功").put("data", wuzixiangqingView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
WuzixiangqingEntity wuzixiangqing = wuzixiangqingService.selectById(id);
return R.ok().put("data", wuzixiangqing);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
WuzixiangqingEntity wuzixiangqing = wuzixiangqingService.selectById(id);
return R.ok().put("data", wuzixiangqing);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody WuzixiangqingEntity wuzixiangqing, HttpServletRequest request){
wuzixiangqing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wuzixiangqing);
wuzixiangqingService.insert(wuzixiangqing);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody WuzixiangqingEntity wuzixiangqing, HttpServletRequest request){
wuzixiangqing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wuzixiangqing);
wuzixiangqingService.insert(wuzixiangqing);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody WuzixiangqingEntity wuzixiangqing, HttpServletRequest request){
//ValidatorUtils.validateEntity(wuzixiangqing);
wuzixiangqingService.updateById(wuzixiangqing);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
wuzixiangqingService.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<WuzixiangqingEntity> wrapper = new EntityWrapper<WuzixiangqingEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = wuzixiangqingService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* (按值统计)
*/
@RequestMapping("/value/{xColumnName}/{yColumnName}")
public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
Map<String, Object>
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
功能说明: (1)管理员功能需求 管理员登陆后,主要模块包括首页,个人中心,用户管理,仓库管理,物资入库管理,物资出库管理,仓库管理,物资详情管理,报警通知管理,安全检查提醒管理等功能。 (2)用户功能需求 用户登陆后,主要模块包括首页,个人中心,仓库管理,物资入库管理,物资出库管理,仓库管理,物资详情管理,报警通知管理,安全检查提醒管理等功能。 环境说明: 开发语言:Java 框架:ssm,mybatis JDK版本:JDK1.8 数据库:mysql 5.7及以上 数据库工具:Navicat11及以上 开发软件:eclipse/idea Maven包:Maven3.3及以上 服务器:tomcat7及以上
资源推荐
资源详情
资源评论
收起资源包目录
【java毕业设计】消防物资存储系统源码(ssm+mysql+说明文档+LW).zip (451个子文件)
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.65cd9863.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 942B
index.html 571B
favicon.ico 4KB
favicon.ico 4KB
WuzixiangqingController.java 10KB
CommonController.java 9KB
CangkuController.java 9KB
YonghuController.java 9KB
AnquanjianchatixingController.java 8KB
BaojingtongzhiController.java 7KB
ChukuxinxiController.java 7KB
RukuxinxiController.java 6KB
CangweiController.java 6KB
WuzixiangqingEntity.java 5KB
UserController.java 5KB
MPUtil.java 5KB
WuzixiangqingModel.java 4KB
WuzixiangqingVO.java 4KB
CangweiEntity.java 4KB
BaiduUtil.java 4KB
AnquanjianchatixingEntity.java 4KB
BaojingtongzhiEntity.java 4KB
YonghuEntity.java 3KB
FileController.java 3KB
ConfigController.java 3KB
CangkuEntity.java 3KB
AuthorizationInterceptor.java 3KB
Query.java 3KB
WuzixiangqingServiceImpl.java 3KB
CangweiModel.java 3KB
CangweiVO.java 2KB
TokenServiceImpl.java 2KB
CangkuServiceImpl.java 2KB
AnquanjianchatixingModel.java 2KB
BaojingtongzhiModel.java 2KB
AnquanjianchatixingVO.java 2KB
BaojingtongzhiVO.java 2KB
CommonUtil.java 2KB
TokenEntity.java 2KB
AnquanjianchatixingServiceImpl.java 2KB
YonghuModel.java 2KB
ChukuxinxiEntity.java 2KB
BaojingtongzhiServiceImpl.java 2KB
RukuxinxiEntity.java 2KB
YonghuVO.java 2KB
PageUtils.java 2KB
ChukuxinxiServiceImpl.java 2KB
RukuxinxiServiceImpl.java 2KB
CangweiServiceImpl.java 2KB
CangkuModel.java 2KB
YonghuServiceImpl.java 2KB
CangkuVO.java 2KB
WuzixiangqingDao.java 1KB
CommonServiceImpl.java 1KB
WuzixiangqingService.java 1KB
UserServiceImpl.java 1KB
CangkuDao.java 1KB
CangkuService.java 1KB
UserEntity.java 1KB
AnquanjianchatixingService.java 1KB
AnquanjianchatixingDao.java 1KB
SpringContextUtils.java 1KB
ValidatorUtils.java 1KB
BaojingtongzhiService.java 1KB
SQLFilter.java 1KB
BaojingtongzhiDao.java 1KB
AnquanjianchatixingView.java 1015B
ChukuxinxiService.java 1014B
HttpClientUtils.java 1013B
RukuxinxiService.java 1000B
ChukuxinxiDao.java 999B
RukuxinxiDao.java 984B
CangweiService.java 966B
BaojingtongzhiView.java 964B
WuzixiangqingView.java 955B
YonghuService.java 952B
CangweiDao.java 948B
YonghuDao.java 933B
ChukuxinxiView.java 928B
RukuxinxiView.java 919B
共 451 条
- 1
- 2
- 3
- 4
- 5
资源评论
风月歌
- 粉丝: 1644
- 资源: 3433
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功