package com.controller;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
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 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.ZichanxinxiEntity;
import com.entity.view.ZichanxinxiView;
import com.service.ZichanxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.MapUtils;
import com.utils.CommonUtil;
import java.io.IOException;
import java.io.InputStream;
import org.springframework.web.multipart.MultipartFile;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
/**
* 资产信息
* 后端接口
* @author
* @email
* @date 2024-03-21 11:21:16
*/
@RestController
@RequestMapping("/zichanxinxi")
public class ZichanxinxiController {
@Autowired
private ZichanxinxiService zichanxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ZichanxinxiEntity zichanxinxi,
HttpServletRequest request){
EntityWrapper<ZichanxinxiEntity> ew = new EntityWrapper<ZichanxinxiEntity>();
PageUtils page = zichanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zichanxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ZichanxinxiEntity zichanxinxi,
HttpServletRequest request){
EntityWrapper<ZichanxinxiEntity> ew = new EntityWrapper<ZichanxinxiEntity>();
PageUtils page = zichanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zichanxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ZichanxinxiEntity zichanxinxi){
EntityWrapper<ZichanxinxiEntity> ew = new EntityWrapper<ZichanxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( zichanxinxi, "zichanxinxi"));
return R.ok().put("data", zichanxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ZichanxinxiEntity zichanxinxi){
EntityWrapper< ZichanxinxiEntity> ew = new EntityWrapper< ZichanxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( zichanxinxi, "zichanxinxi"));
ZichanxinxiView zichanxinxiView = zichanxinxiService.selectView(ew);
return R.ok("查询资产信息成功").put("data", zichanxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ZichanxinxiEntity zichanxinxi = zichanxinxiService.selectById(id);
return R.ok().put("data", zichanxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ZichanxinxiEntity zichanxinxi = zichanxinxiService.selectById(id);
return R.ok().put("data", zichanxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ZichanxinxiEntity zichanxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(zichanxinxi);
zichanxinxiService.insert(zichanxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ZichanxinxiEntity zichanxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(zichanxinxi);
zichanxinxiService.insert(zichanxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody ZichanxinxiEntity zichanxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(zichanxinxi);
zichanxinxiService.updateById(zichanxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
zichanxinxiService.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<ZichanxinxiEntity> wrapper = new EntityWrapper<ZichanxinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = zichanxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
@RequestMapping("/importExcel")
public R importExcel(@RequestParam("file") MultipartFile file){
try {
//获取输入流
InputStream inputStream = file.getInputStream();
//创建读取工作簿
Workbook workbook = WorkbookFactory.create(inputStream);
//获取工作表
Sheet sheet = workbook.getSheetAt(0);
//获取总行
int rows=sheet.getPhysicalNumberOfRows();
if(rows>1){
//获取单元格
for (int i = 1; i < rows; i++) {
Row row = sheet.getRow(i);
ZichanxinxiEntity zichanxinxiEntity =new ZichanxinxiEntity();
zichanxinxiEntity.setId(new Date().getTime());
String zichanbianhao = CommonUtil.getCellValue(row.getCell(0));
zichanxinxiEntity.setZichanbianhao(zichanbianhao);
String zichanmingcheng = CommonUtil.getCellValue(row.g
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
项目资源包含:可运行源码+sql文件+文档 适用人群:学习不同技术领域的小白或进阶学习者;可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 项目具有较高的学习借鉴价值,也可拿来修改、二次开发。 有任何使用上的问题,欢迎随时与博主沟通,博主看到后会第一时间及时解答。 开发语言:Java 框架:springboot 技术:Vue JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7(一定要5.7版本) 数据库工具:Navicat11 开发软件:eclipse/myeclipse/idea Maven包:Maven3.3.9 系统是一个很好的项目,结合了后端服务(SpringBoot)和前端用户界面(Vue.js)技术,实现了前后端分离。 后台路径地址:localhost:8080/项目名称/admin/dist/index.html 前台路径地址:localhost:8080/项目名称/front/index.html
资源推荐
资源详情
资源评论
收起资源包目录
springboot356数据驱动的资产管理系统.zip (456个子文件)
main.js.bak 2KB
3-build.bat 15B
2-run.bat 14B
1-install.bat 12B
.classpath 2KB
mvnw.cmd 7KB
app.dfcc3b2c.css 418KB
chunk-vendors.1f0a25b2.css 37KB
canvas-bg-1.css 391B
canvas-bg-2.css 83B
canvas-bg-4.css 61B
canvas-bg-5.css 61B
canvas-bg-3.css 61B
springboothfj1343u数据库文档.doc 1.27MB
springboot开发文档.docx 14KB
.factorypath 15KB
.gitignore 364B
index.html 1KB
index.html 964B
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
ZichanxinxiController.java 10KB
QinglihebaofeiController.java 10KB
LingyongshenqingController.java 9KB
ZichanjieyongController.java 9KB
WeixiuxinxiController.java 9KB
BaiduUtil.java 9KB
ZichantuikuController.java 9KB
ZichanguihaiController.java 9KB
EncryptUtil.java 8KB
WeibaoxinxiController.java 8KB
YonghuController.java 8KB
CommonController.java 7KB
ZichanfenleiController.java 7KB
MPUtil.java 6KB
ZichanxinxiEntity.java 6KB
ZichantuikuEntity.java 6KB
ZichanjieyongEntity.java 5KB
LingyongshenqingEntity.java 5KB
QinglihebaofeiEntity.java 5KB
ZichanguihaiEntity.java 5KB
UsersController.java 5KB
WeixiuxinxiEntity.java 5KB
MavenWrapperDownloader.java 5KB
ZichanxinxiModel.java 5KB
ZichanxinxiVO.java 4KB
ZichantuikuModel.java 4KB
FileController.java 4KB
ZichanjieyongModel.java 4KB
CommonUtil.java 4KB
LingyongshenqingModel.java 4KB
ZichantuikuVO.java 4KB
QinglihebaofeiModel.java 4KB
WeibaoxinxiEntity.java 4KB
ZichanjieyongVO.java 4KB
ZichanguihaiModel.java 4KB
LingyongshenqingVO.java 4KB
QinglihebaofeiVO.java 4KB
WeixiuxinxiModel.java 4KB
ZichanguihaiVO.java 4KB
WeixiuxinxiVO.java 4KB
YonghuEntity.java 4KB
AuthorizationInterceptor.java 3KB
ConfigController.java 3KB
HttpClientUtils.java 3KB
WeibaoxinxiModel.java 3KB
Query.java 3KB
WeibaoxinxiVO.java 3KB
TokenServiceImpl.java 2KB
YonghuModel.java 2KB
TokenEntity.java 2KB
YonghuVO.java 2KB
LingyongshenqingServiceImpl.java 2KB
ZichanfenleiEntity.java 2KB
QinglihebaofeiServiceImpl.java 2KB
ZichanjieyongServiceImpl.java 2KB
ZichanguihaiServiceImpl.java 2KB
ZichanfenleiServiceImpl.java 2KB
ZichanxinxiServiceImpl.java 2KB
WeixiuxinxiServiceImpl.java 2KB
ZichantuikuServiceImpl.java 2KB
WeibaoxinxiServiceImpl.java 2KB
PageUtils.java 2KB
YonghuServiceImpl.java 2KB
InterceptorConfig.java 1KB
UsersEntity.java 1KB
CommonServiceImpl.java 1KB
UsersServiceImpl.java 1KB
SpringContextUtils.java 1KB
ValidatorUtils.java 1KB
LingyongshenqingService.java 1KB
LingyongshenqingDao.java 1KB
QinglihebaofeiService.java 1KB
QinglihebaofeiDao.java 1KB
SQLFilter.java 1KB
ZichanjieyongService.java 1KB
LingyongshenqingView.java 1KB
ZichanjieyongDao.java 1KB
ZichanfenleiService.java 1KB
共 456 条
- 1
- 2
- 3
- 4
- 5
资源评论
大叔_爱编程
- 粉丝: 4982
- 资源: 3511
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 下载视频工具,c++开发
- PHP的ThinkPHP5多小区物业管理系统源码(支持多小区)数据库 MySQL源码类型 WebForm
- 【安卓毕业设计】Android作业源码(完整前后端+mysql+说明文档).zip
- 【安卓毕业设计】基于Android租房软件app源码(完整前后端+mysql+说明文档).zip
- Untitled7.ipynb
- C#ASP.NET酒店管理系统源码 宾馆管理系统源码数据库 SQL2008源码类型 WebForm
- 【安卓毕业设计】基于安卓的奶牛管理源码(完整前后端+mysql+说明文档).zip
- 【安卓毕业设计】Android app作业源码(完整前后端+mysql+说明文档).zip
- Scrapy基础(讲解详细、包括框架流程代码实战,最佳学习资料).zip
- FPGA实现IIC通信quartus工程,纯verliog,可进行移植
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功