package com.cl.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.cl.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.cl.annotation.IgnoreAuth;
import com.cl.entity.LajiyunshucheliangEntity;
import com.cl.entity.view.LajiyunshucheliangView;
import com.cl.service.LajiyunshucheliangService;
import com.cl.service.TokenService;
import com.cl.utils.PageUtils;
import com.cl.utils.R;
import com.cl.utils.MPUtil;
import com.cl.utils.CommonUtil;
import java.io.IOException;
/**
* 垃圾运输车辆
* 后端接口
* @author
* @email
* @date 2024-05-06 11:50:50
*/
@RestController
@RequestMapping("/lajiyunshucheliang")
public class LajiyunshucheliangController {
@Autowired
private LajiyunshucheliangService lajiyunshucheliangService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,LajiyunshucheliangEntity lajiyunshucheliang,
HttpServletRequest request){
EntityWrapper<LajiyunshucheliangEntity> ew = new EntityWrapper<LajiyunshucheliangEntity>();
PageUtils page = lajiyunshucheliangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, lajiyunshucheliang), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,LajiyunshucheliangEntity lajiyunshucheliang,
HttpServletRequest request){
EntityWrapper<LajiyunshucheliangEntity> ew = new EntityWrapper<LajiyunshucheliangEntity>();
PageUtils page = lajiyunshucheliangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, lajiyunshucheliang), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( LajiyunshucheliangEntity lajiyunshucheliang){
EntityWrapper<LajiyunshucheliangEntity> ew = new EntityWrapper<LajiyunshucheliangEntity>();
ew.allEq(MPUtil.allEQMapPre( lajiyunshucheliang, "lajiyunshucheliang"));
return R.ok().put("data", lajiyunshucheliangService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(LajiyunshucheliangEntity lajiyunshucheliang){
EntityWrapper< LajiyunshucheliangEntity> ew = new EntityWrapper< LajiyunshucheliangEntity>();
ew.allEq(MPUtil.allEQMapPre( lajiyunshucheliang, "lajiyunshucheliang"));
LajiyunshucheliangView lajiyunshucheliangView = lajiyunshucheliangService.selectView(ew);
return R.ok("查询垃圾运输车辆成功").put("data", lajiyunshucheliangView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
LajiyunshucheliangEntity lajiyunshucheliang = lajiyunshucheliangService.selectById(id);
lajiyunshucheliang = lajiyunshucheliangService.selectView(new EntityWrapper<LajiyunshucheliangEntity>().eq("id", id));
return R.ok().put("data", lajiyunshucheliang);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
LajiyunshucheliangEntity lajiyunshucheliang = lajiyunshucheliangService.selectById(id);
lajiyunshucheliang = lajiyunshucheliangService.selectView(new EntityWrapper<LajiyunshucheliangEntity>().eq("id", id));
return R.ok().put("data", lajiyunshucheliang);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody LajiyunshucheliangEntity lajiyunshucheliang, HttpServletRequest request){
if(lajiyunshucheliangService.selectCount(new EntityWrapper<LajiyunshucheliangEntity>().eq("chepaihao", lajiyunshucheliang.getChepaihao()))>0) {
return R.error("车牌号已存在");
}
lajiyunshucheliang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(lajiyunshucheliang);
lajiyunshucheliangService.insert(lajiyunshucheliang);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody LajiyunshucheliangEntity lajiyunshucheliang, HttpServletRequest request){
if(lajiyunshucheliangService.selectCount(new EntityWrapper<LajiyunshucheliangEntity>().eq("chepaihao", lajiyunshucheliang.getChepaihao()))>0) {
return R.error("车牌号已存在");
}
lajiyunshucheliang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(lajiyunshucheliang);
lajiyunshucheliangService.insert(lajiyunshucheliang);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody LajiyunshucheliangEntity lajiyunshucheliang, HttpServletRequest request){
//ValidatorUtils.validateEntity(lajiyunshucheliang);
lajiyunshucheliangService.updateById(lajiyunshucheliang);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
lajiyunshucheliangService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* (按值统计)
*/
@RequestMapping("/value/{xColumnName}/{yColumnName}")
public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
EntityWrapper<LajiyunshucheliangEntity> ew = new EntityWrapper<LajiyunshucheliangEntity>();
List<Map<String, Object>> result = lajiyunshucheliangService.selectValue(params, ew);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* (按值统计(多))
*/
@RequestMapping("/valueMul/{xColumnName}")
public R valueMul(@PathVariable("xColumnName") String xColumnName,@RequestParam String yColumnNameMul, HttpServletRequest request) {
String[] yColumnNames = yColumnNameMul.split(",");
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
List<List<Map<String, Object>>> result2 = new ArrayList<List<Map<String,Object>>>();
SimpleDateFormat sdf = new SimpleDateFormat("y
没有合适的资源?快使用搜索试试~ 我知道了~
【java毕业设计】springboot乡村生活垃圾(springboot+vue+mysql+说明文档).zip
共503个文件
class:82个
java:82个
jpg:69个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 108 浏览量
2024-11-05
13:42:48
上传
评论
收藏 24.37MB ZIP 举报
温馨提示
【java毕业设计】springboot乡村生活垃圾(springboot+vue+mysql+说明文档).zip
资源推荐
资源详情
资源评论
收起资源包目录
【java毕业设计】springboot乡村生活垃圾(springboot+vue+mysql+说明文档).zip (503个子文件)
LajiyunshucheliangController.class 11KB
LajitoufangdianController.class 11KB
YonghuController.class 8KB
CommonController.class 8KB
MenuController.class 8KB
BaiduUtil.class 7KB
MPUtil.class 7KB
UsersController.class 6KB
RenyuanxinxiController.class 6KB
ToufangdianfenleiController.class 6KB
EncryptUtil.class 6KB
NewsController.class 6KB
FileController.class 5KB
TokenServiceImpl.class 5KB
LajiyunshucheliangEntity.class 4KB
LajitoufangdianEntity.class 4KB
LajiyunshucheliangServiceImpl.class 4KB
LajitoufangdianServiceImpl.class 4KB
HttpClientUtils.class 4KB
ConfigController.class 4KB
AuthorizationInterceptor.class 4KB
YonghuEntity.class 4KB
RenyuanxinxiEntity.class 4KB
ToufangdianfenleiServiceImpl.class 3KB
RenyuanxinxiServiceImpl.class 3KB
CommonUtil.class 3KB
YonghuServiceImpl.class 3KB
NewsServiceImpl.class 3KB
MenuServiceImpl.class 3KB
NewsEntity.class 3KB
Query.class 3KB
UsersServiceImpl.class 3KB
PageUtils.class 3KB
TokenEntity.class 3KB
ToufangdianfenleiEntity.class 2KB
MenuEntity.class 2KB
CommonServiceImpl.class 2KB
InterceptorConfig.class 2KB
LajiyunshucheliangDao.class 2KB
R.class 2KB
LajiyunshucheliangService.class 2KB
LajitoufangdianDao.class 2KB
LajitoufangdianService.class 2KB
UsersEntity.class 2KB
ConfigServiceImpl.class 2KB
SpringContextUtils.class 2KB
ValidatorUtils.class 2KB
EIException.class 1KB
ToufangdianfenleiService.class 1KB
JQPageInfo.class 1KB
SpringbootSchemaApplication.class 1KB
RenyuanxinxiService.class 1KB
ToufangdianfenleiDao.class 1KB
ConfigEntity.class 1KB
YonghuService.class 1KB
RenyuanxinxiDao.class 1KB
NewsService.class 1KB
MenuService.class 1KB
SQLFilter.class 1KB
TokenService.class 1KB
YonghuDao.class 1KB
MenuDao.class 1KB
NewsDao.class 1KB
LajiyunshucheliangView.class 1KB
ToufangdianfenleiView.class 1KB
LajitoufangdianView.class 1KB
RenyuanxinxiView.class 1KB
YonghuView.class 1KB
MenuView.class 1KB
NewsView.class 1KB
CommonDao.class 1KB
CommonService.class 1KB
TokenDao.class 987B
UsersDao.class 987B
UsersService.class 979B
FileUtil.class 970B
MybatisPlusConfig.class 675B
ConfigService.class 604B
MD5Util.class 522B
IgnoreAuth.class 431B
AlipayConfig.class 289B
ConfigDao.class 275B
chunk-vendors.83167ee3.css 339KB
chunk-vendors.83167ee3.css 339KB
chunk-vendors.9650af1e.css 319KB
chunk-vendors.9650af1e.css 319KB
app.4ece60b3.css 145KB
app.4ece60b3.css 145KB
app.cce4e1f2.css 103KB
app.cce4e1f2.css 103KB
864.62ba85e2.css 12KB
864.62ba85e2.css 12KB
123.0e6c7cb3.css 3KB
123.0e6c7cb3.css 3KB
700.2b4f7fe5.css 3KB
700.2b4f7fe5.css 3KB
5.b1fb1c2f.css 1KB
5.b1fb1c2f.css 1KB
iconfont.css 622B
canvas-bg-1.css 391B
共 503 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
计算机学长阿伟
- 粉丝: 3124
- 资源: 593
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功