网上国网app推广,百度刷排名优化软件,淘宝店铺网站策划,东莞企业黄页资料末尾获取源码 开发语言#xff1a;Java Java开发工具#xff1a;JDK1.8 后端框架#xff1a;SSM 前端#xff1a;采用JSP技术开发 数据库#xff1a;MySQL5.7和Navicat管理工具结合 服务器#xff1a;Tomcat8.5 开发软件#xff1a;IDEA / Eclipse 是否Maven项目#x… 末尾获取源码 开发语言Java Java开发工具JDK1.8 后端框架SSM 前端采用JSP技术开发 数据库MySQL5.7和Navicat管理工具结合 服务器Tomcat8.5 开发软件IDEA / Eclipse 是否Maven项目是 目录
一、项目简介
二、数据库设计
数据库E-R图设计
数据库表结构设计 角色信息表
代取订单表 快递信息表
三、系统项目截图
角色信息管理
快递信息管理
代取订单管理
新闻公告管理
四、核心代码
4.1登录相关
4.2文件上传
4.3封装 一、项目简介
当前社会各行业领域竞争压力非常大随着当前时代的信息化科学化发展让社会各行业领域都争相使用新的信息技术对行业内的各种相关数据进行科学化规范化管理。这样的大环境让那些止步不前不接受信息改革带来的信息技术的企业随时面临被淘汰被取代的风险。所以当今各个行业领域不管是传统的教育行业餐饮行业还是旅游行业医疗行业等领域都将使用新的信息技术进行信息革命改变传统的纸质化需要人手工处理工作事务的办公环境。软件信息技术能够覆盖社会各行业领域是时代的发展要求各种数据以及文件真正实现电子化是信息社会发展的不可逆转的必然趋势。本校园快递代取系统也是紧跟科学技术的发展运用当今一流的软件技术实现软件系统的开发让快递管理信息完全通过管理系统实现科学化规范化程序化管理。从而帮助信息管理者节省事务处理的时间降低数据处理的错误率对于基础数据的管理水平可以起到促进作用也从一定程度上对随意的业务管理工作进行了避免同时校园快递代取系统的数据库里面存储的各种动态信息也为上层管理人员作出重大决策提供了大量的事实依据。总之校园快递代取系统是一款可以真正提升管理者的办公效率的软件系统。 二、数据库设计
程序功能操作不管是添加修改还是删除等功能产生的数据都是经由数据库进行数据保存和更新的所以一个数据库设计的好坏也是程序是否好坏的判定标准因为程序的成功有一半的功劳都是靠数据库的优秀设计。数据库一旦设计得良好是可以减轻开发人员的开发负担的。
数据库E-R图设计
这个部分的设计需要使用到E-R图绘制工具常用的工具就是Visio工具来绘制E-R模型图这款工具不仅可以快速创建需要的E-R模型图而且该工具提供的操作界面很简单可以短时间内修改绘图界面的图形或者是文字的属性。在绘制E-R模型图时要分清楚各个图形代表的含义以免绘制出错E-R模型图由长方形实体椭圆形属性菱形关系这三部分图形符号组成绘制期间要区分开来用准确的图形符号代表相应的数据元素。
各个实体之间的联系用下图的E-R图表示。绘制的系统E-R图。 数据库表结构设计
数据库系统一旦选定之后需要根据程序要求在数据库中建立数据库文件并在已经完成创建的数据库文件里面为程序运行中产生的数据建立对应的数据表格数据表结构设计就是对创建的数据表格进行字段设计字段长度设计字段类型设计等当数据表格合理设计完成之后才能正常存储相关程序运行产生的数据信息。 角色信息表 列名 说明 数据类型 允许空 id int(20) 主键 否 name varchar(200) 名称 是 account varchar(255) 账号 是 password varchar(255) 密码 是 img_photo varchar(255) 头像 是 sex_types tinyint(4) 性别 是 mobile varchar(200) 手机号 是 role varchar(255) 身份 是
代取订单表 列名 说明 数据类型 允许空 id int(20) 主键 否 name varchar(200) 代取快递名称 是 yh_types int(255) 订单发布人 是 consigneeSite varchar(200) 送件地址 是 consignee varchar(200) 收件人 是 consigneeNumber varchar(200) 收件人手机号 是 kdzt_types tinyint(4) 快递状态 是 dqr_types tinyint(4) 代取人 是 快递信息表 列名 说明 数据类型 允许空 id int(20) 主键 否 name varchar(200) 快递名称 是 consigneeSite varchar(200) 收件地址 是 consignee varchar(200) 收件人 是 consigneeNumber varchar(200) 收件人手机号 是 addresser varchar(200) 发件人 是 addresserNumber varchar(200) 发件人手机号 是 kdzt_types tinyint(4) 快递状态 是 create_time timestamp 创建时间 是
新闻公告信息表 列名 说明 数据类型 允许空 id bigint(20) 主键 否 addtime timestamp 创建时间 是 biaoti varchar(200) 标题 是 leixing varchar(200) 类型 是 neirong longtext 内容 是 riqi datetime 日期 是 三、系统项目截图
角色信息管理
角色信息管理页面此页面提供给管理员的功能有角色信息的查询管理可以删除角色信息、修改角色信息、新增角色信息还进行了对角色名称的模糊查询的条件 快递信息管理
快递信息管理页面此页面提供给管理员的功能有快递信息的查询管理可以删除快递信息、修改快递信息、新增快递信息还进行了对快递名称、快递状态 查询的条件 代取订单管理
代取订单管理页面此页面提供给管理员的功能有根据快递名称、快递状态、快递单号进行条件查询还可以对快递数据进行新增、修改、查询操作等等。 新闻公告管理
新闻公告管理页面此页面提供给管理员的功能有角色信息的查询管理可以删除新闻公告信息、修改新闻公告信息、新增新闻公告信息还进行了对新闻公告名称的模糊查询的条件 四、核心代码
4.1登录相关 package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
RequestMapping(users)
RestController
public class UserController{Autowiredprivate UserService userService;Autowiredprivate TokenService tokenService;/*** 登录*/IgnoreAuthPostMapping(value /login)public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user userService.selectOne(new EntityWrapperUserEntity().eq(username, username));if(usernull || !user.getPassword().equals(password)) {return R.error(账号或密码不正确);}String token tokenService.generateToken(user.getId(),username, users, user.getRole());return R.ok().put(token, token);}/*** 注册*/IgnoreAuthPostMapping(value /register)public R register(RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapperUserEntity().eq(username, user.getUsername())) !null) {return R.error(用户已存在);}userService.insert(user);return R.ok();}/*** 退出*/GetMapping(value logout)public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok(退出成功);}/*** 密码重置*/IgnoreAuthRequestMapping(value /resetPass)public R resetPass(String username, HttpServletRequest request){UserEntity user userService.selectOne(new EntityWrapperUserEntity().eq(username, username));if(usernull) {return R.error(账号不存在);}user.setPassword(123456);userService.update(user,null);return R.ok(密码已重置为123456);}/*** 列表*/RequestMapping(/page)public R page(RequestParam MapString, Object params,UserEntity user){EntityWrapperUserEntity ew new EntityWrapperUserEntity();PageUtils page userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put(data, page);}/*** 列表*/RequestMapping(/list)public R list( UserEntity user){EntityWrapperUserEntity ew new EntityWrapperUserEntity();ew.allEq(MPUtil.allEQMapPre( user, user)); return R.ok().put(data, userService.selectListView(ew));}/*** 信息*/RequestMapping(/info/{id})public R info(PathVariable(id) String id){UserEntity user userService.selectById(id);return R.ok().put(data, user);}/*** 获取用户的session用户信息*/RequestMapping(/session)public R getCurrUser(HttpServletRequest request){Long id (Long)request.getSession().getAttribute(userId);UserEntity user userService.selectById(id);return R.ok().put(data, user);}/*** 保存*/PostMapping(/save)public R save(RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapperUserEntity().eq(username, user.getUsername())) !null) {return R.error(用户已存在);}userService.insert(user);return R.ok();}/*** 修改*/RequestMapping(/update)public R update(RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 删除*/RequestMapping(/delete)public R delete(RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}4.2文件上传
package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
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 org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上传文件映射表*/
RestController
RequestMapping(file)
SuppressWarnings({unchecked,rawtypes})
public class FileController{Autowiredprivate ConfigService configService;/*** 上传文件*/RequestMapping(/upload)public R upload(RequestParam(file) MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException(上传文件不能为空);}String fileExt file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(.)1);File path new File(ResourceUtils.getURL(classpath:static).getPath());if(!path.exists()) {path new File();}File upload new File(path.getAbsolutePath(),/upload/);if(!upload.exists()) {upload.mkdirs();}String fileName new Date().getTime().fileExt;File dest new File(upload.getAbsolutePath()/fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File(C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload/fileName));if(StringUtils.isNotBlank(type) type.equals(1)) {ConfigEntity configEntity configService.selectOne(new EntityWrapperConfigEntity().eq(name, faceFile));if(configEntitynull) {configEntity new ConfigEntity();configEntity.setName(faceFile);configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put(file, fileName);}/*** 下载文件*/IgnoreAuthRequestMapping(/download)public ResponseEntitybyte[] download(RequestParam String fileName) {try {File path new File(ResourceUtils.getURL(classpath:static).getPath());if(!path.exists()) {path new File();}File upload new File(path.getAbsolutePath(),/upload/);if(!upload.exists()) {upload.mkdirs();}File file new File(upload.getAbsolutePath()/fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); headers.setContentDispositionFormData(attachment, fileName); return new ResponseEntitybyte[](FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntitybyte[](HttpStatus.INTERNAL_SERVER_ERROR);}}4.3封装
package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回数据*/
public class R extends HashMapString, Object {private static final long serialVersionUID 1L;public R() {put(code, 0);}public static R error() {return error(500, 未知异常请联系管理员);}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r new R();r.put(code, code);r.put(msg, msg);return r;}public static R ok(String msg) {R r new R();r.put(msg, msg);return r;}public static R ok(MapString, Object map) {R r new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}