package com.bl.car.controller;
import com.bl.car.constants.StateConstant;
import com.bl.car.entity.Car;
import com.bl.car.entity.Driver;
import com.bl.car.entity.Owner;
import com.bl.car.entity.User;
import com.bl.car.repositiy.CarRepository;
import com.bl.car.repositiy.DriverRepository;
import com.bl.car.repositiy.OwnerRepository;
import com.bl.car.repositiy.UserRepository;
import com.bl.car.result.Result;
import com.bl.car.utils.SpringSessionUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpSession;
import javax.transaction.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 审核接口
*
* @author zhx
* @create 2017-11-16 15:29
**/
@RestController
@RequestMapping("/check")
public class CheckController {
@Autowired
private OwnerRepository ownerRepository;
@Autowired
private DriverRepository driverRepository;
@Autowired
private UserRepository userRepository;
@Autowired
private CarRepository carRepository;
//获取驾驶员列表
@PostMapping("/getDriverList")
public Result<List<Driver>> getDriverList(){
List<Driver> all = driverRepository.findByUserIdNotNullOrderById();
return Result.ok(all);
}
//获取业户列表
@PostMapping("/getOwnerList")
public Result<List<Owner>> getOwnerList(){
Sort sort = new Sort(Sort.Direction.DESC, "id");
List<Owner> all = ownerRepository.findAll(sort);
return Result.ok(all);
}
//获取业户申请的驾驶员列表
@PostMapping("/getOwnerDriverList")
public Result<List<Driver>> getOwnerDriverList(){
List<Driver> all = driverRepository.findByOwnerIdNotNullOrderById();
return Result.ok(all);
}
//获取我的驾驶员列表
@PostMapping("/getMyDriverList")
public Result<List<Driver>> getMyDriverList(@RequestParam("userId") String userId){
List<Driver> all = driverRepository.findByOwnerIdOrderById("userId");
return Result.ok(all);
}
//提交审核信息业户
@PostMapping("/getCheckOwner")
public Result<Owner> getCheckOwner(@RequestBody Owner owner,HttpSession session){
//设置日期格式
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
owner.setApplyTime(df.format(new Date()));
User tmpUser = SpringSessionUtil.getSession(session);
owner.setUserId( Long.toString(tmpUser.getId()));
owner.setIsEffect(StateConstant.USER_NONE);
ownerRepository.save(owner);
tmpUser.setIsEffect(StateConstant.USER_CHECK);
userRepository.save(tmpUser);
return Result.ok(owner);
}
@PostMapping("/getCheckDriver")
public Result<String> getCheckDriver(@RequestBody Driver driver,HttpSession session){
//设置日期格式
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
driver.setApplyTime(df.format(new Date()));
User tmpUser = SpringSessionUtil.getSession(session);
driver.setUserId( Long.toString(tmpUser.getId()));
driver.setIsEffect(StateConstant.USER_NONE);
driverRepository.save(driver);
tmpUser.setIsEffect(StateConstant.USER_CHECK);
userRepository.save(tmpUser);
return Result.ok(driver);
}
//业户审核
@PostMapping("/checkOwner")
public Result<String> checkOwner(@RequestParam("id") Long id,@RequestParam("type") String type){
Owner one = ownerRepository.findOne(id);
one.setIsEffect(type);
ownerRepository.save(one);
User user = userRepository.findOne(Long.parseLong(one.getUserId()));
user.setIsEffect(type);
userRepository.save(user);
return Result.ok("");
}
//驾驶员审核
//业户审核
@PostMapping("/checkDriver")
public Result<String> checkDriver(@RequestParam("id") Long id,@RequestParam("type") String type){
Driver one = driverRepository.findOne(id);
one.setIsEffect(type);
driverRepository.save(one);
if(one.getUserId() != null){
User user = userRepository.findOne(Long.parseLong(one.getUserId()));
user.setIsEffect(type);
userRepository.save(user);
}
return Result.ok("");
}
//车辆审核
@PostMapping("/checkCar")
@Transactional
public Result<String> checkCar(@RequestParam("id") Long id,@RequestParam("type") String type){
//注 不通过就删除
if(type.equals(StateConstant.USER_FAILURE)){
carRepository.delete(id);
return Result.ok("");
}
Car one = carRepository.findOne(id);
one.setIsEffect(type);
carRepository.save(one);
return Result.ok("");
}
///注销方法
//前端注销方法
@PostMapping("/ownerpushdel")
@Transactional
public Result<String> ownerpushdel(@RequestParam("id") Long id){
List<Driver> byOwnerIdOrderById = driverRepository.findByOwnerIdOrderById(Long.toString(id));
if(byOwnerIdOrderById.size()>0){
return Result.error("当前业户下存在驾驶员!请先注销驾驶员!");
}
Owner one = ownerRepository.getOne(id);
one.setIsEffect(StateConstant.DELETE_TYPE);
ownerRepository.save(one);
return Result.ok("");
}
//业主提交注销
//驾驶员提交注销
@PostMapping("/driverpushdel")
@Transactional
public Result<String> driverpushdel(@RequestParam("id") Long id){
Car byDriverId = carRepository.findByDriverId(Long.toString(id));
if(byDriverId != null){
return Result.error("当前驾驶员下有车辆!清先注销车辆!");
}
Driver one = driverRepository.getOne(id);
one.setIsEffect(StateConstant.DELETE_TYPE);
driverRepository.save(one);
return Result.ok("");
}
//车辆提交注销
@PostMapping("/carpushdel")
@Transactional
public Result<String> carpushdel(@RequestParam("id") Long id){
Car one = carRepository.getOne(id);
one.setIsEffect(StateConstant.DELETE_TYPE);
carRepository.save(one);
return Result.ok("");
}
//后台注销判断
//业户注销
@PostMapping("/ownerdel")
@Transactional
public Result<String> ownerdel(@RequestParam("id") Long id,@RequestParam("type") String type){
if(type.equals(StateConstant.DELETE_TYPE)){
Owner one = ownerRepository.getOne(id);
ownerRepository.delete(id);
userRepository.delete(Long.parseLong(one.getUserId()));
}else{
Owner one = ownerRepository.getOne(id);
one.setIsEffect(StateConstant.USER_OWNER);
ownerRepository.save(one);
}
return Result.ok("");
}
//驾驶员注销
@PostMapping("/driverdel")
@Transactional
public Result<String> driverdel(@RequestParam("id") Long id,@RequestParam("type") String type){
if(type.equals(StateConstant.DELETE_TYPE)){
Driver one = driverRepository.getOne(id);
driverRepository.delete(id);
userRepository.delete(Long.parseLong(one.getUserId()));
}else{
Driver one = driverRepository.getOne(id);
one.setIsEffect(StateConstant.USER_OWNER);
driverRepository.save(one);
}
return Result.ok("");
}
//车辆注销
@PostMapping("/cardel")
public Result<String> cardel(@RequestParam("id") Long id,@RequestParam("type") String type){
if(type.equals(StateConstant.DELETE_TYPE)){
carRepository.delete(id);
没有合适的资源?快使用搜索试试~ 我知道了~
基于SpringBoot+Angular的汽车驾驶员管理系统设计源码
共690个文件
js:267个
png:156个
css:58个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 5 浏览量
2024-10-08
09:37:45
上传
评论
收藏 18.51MB ZIP 举报
温馨提示
该项目是一款基于SpringBoot和Angular构建的汽车驾驶员管理系统源码,包含690个文件,涵盖267个JavaScript文件、156个PNG图像文件、58个CSS样式文件、52个GIF图像文件、49个HTML文件、23个Java文件、16个LESS样式文件、15个映射文件、8个JPG图像文件、7个WOFF字体文件。系统采用SpringDataJpa进行后端数据操作,前端使用requirejs和Angular框架,样式模板基于Bootstrap。数据库采用MySQL,后端通过Maven打包,运行容器为Tomcat,使用Java 1.8版本,Angular版本为1.5.8。系统功能包括注册、登录、资料提交与审批、注销等,支持后台登录后进行审批操作。
资源推荐
资源详情
资源评论
收起资源包目录
基于SpringBoot+Angular的汽车驾驶员管理系统设计源码 (690个子文件)
foundation.css 154KB
bootstrap.css 123KB
app.css 62KB
jquery-ui-1.10.0.custom.css 59KB
ueditor.css 43KB
ueditor.min.css 34KB
font-awesome.min.css 30KB
video-js.css 21KB
image.css 18KB
animate.css 16KB
bootstrap-responsive.min.css 16KB
video.css 15KB
attachment.css 14KB
epiceditor.css 12KB
calendar.css 12KB
video-js.min.css 11KB
bootstrap-datetimepicker.min.css 11KB
jquery-ui.slider.css 10KB
chosen.css 10KB
icon.css 10KB
calendar.min.css 9KB
ng-grid.min.css 7KB
shCoreDefault.css 7KB
blueimp-gallery.min.css 7KB
zTreeStyle.css 6KB
scrawl.css 4KB
introjs.css 4KB
nestable.css 3KB
codemirror.css 3KB
charts.css 3KB
bootstrap-image-gallery.min.css 2KB
bartik.css 2KB
tree-control.css 2KB
background.css 2KB
tree-control-attribute.css 2KB
slider.css 2KB
emotion.css 2KB
dialogbase.css 2KB
music.css 2KB
prettify-style.css 2KB
jquery.fileupload-ui.css 2KB
edittable.css 1KB
template.css 1KB
jquery.bootstrap-touchspin.css 1016B
jquery-jvectormap-1.2.2.css 755B
jquery.fileupload.css 655B
font.css 590B
typehead.css 549B
projCommon.css 516B
webuploader.css 515B
jquery.ui.1.10.0.ie.css 507B
epic-light.css 502B
jquery.fileupload-noscript.css 431B
help.css 389B
jquery.fileupload-ui-noscript.css 371B
angular-csp.css 343B
style.css 291B
iframe.css 67B
fontawesome-webfont.eot 162KB
icon.eot 69KB
glyphicons-halflings-regular.eot 20KB
vjs.eot 3KB
UEditorSnapscreen.exe 508KB
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
icons.gif 20KB
file-icons.gif 20KB
file-icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
cface.gif 8KB
zTreeStandard.gif 5KB
loading.gif 4KB
loading.gif 4KB
icons-all.gif 4KB
progressbar.gif 3KB
videologo.gif 2KB
loader3.gif 1KB
cancelbutton.gif 1KB
button-bg.gif 1KB
lock.gif 1KB
alignicon.gif 1KB
word.gif 1019B
icon_doc.gif 1012B
icon_psd.gif 1009B
icon_rar.gif 1007B
icon_xls.gif 1005B
icon_mv.gif 1001B
icon_ppt.gif 1001B
icon_pdf.gif 996B
icon_mp3.gif 986B
icon_txt.gif 970B
icon_jpg.gif 950B
icon_exe.gif 949B
icon_chm.gif 923B
loading.gif 734B
icons.gif 453B
icons.gif 453B
共 690 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
csbysj2020
- 粉丝: 2535
- 资源: 5471
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 利用Gurobi求解设施选址问题(也被称为位置分析)代码
- 【哈哈哈哈哈啊啊啊啊啊哈】
- ubuntu20.04实测运行fast-lio-LC算法-测试1数据包(lidar、imu)
- 世界环境绩效指数EPI(2000-2022年).zip
- 中国大陆高等院校名单 最新大学名单 xls 全国高等学校名单 2024年06月20日更新
- 【安卓毕业设计】Android平台兼职发布系统的设计与开发源码(完整前后端+mysql+说明文档+LW).zip
- 【安卓毕业设计】焦点新闻APP的设计与实现源码(完整前后端+mysql+说明文档+LW).zip
- “知识产权示范”多期DID-地级市(第1至6批).zip
- 【安卓毕业设计】基于andriod的网上影院app的设计与实现源码(完整前后端+mysql+说明文档+LW).zip
- 计算机辅助设计:AutoCAD工程制图教程【资源库】_1_20240821112411964.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功