信息数据从传统到当代,是一直在变革当中,突如其来的互联网让传统的信息管理看到了革命性的曙光,因为传统信息管理从时效性,还是安全性,还是可操作性等各个方面来讲,遇到了互联网时代才发现能补上自古以来的短板,有效的提升管理的效率和业务水平。传统的管理模式,时间越久管理的内容越多,也需要更多的人来对数据进行整理,并且数据的汇总查询方面效率也是极其的低下,并且数据安全方面永远不会保证安全性能。结合数据内容管理的种种缺点,在互联网时代都可以得到有效的补充。结合先进的互联网技术,开发符合需求的软件,让数据内容管理不管是从录入的及时性,查看的及时性还是汇总分析的及时性,都能让正确率达到最高,管理更加的科学和便捷。本次开发的中小型制造企业质量管理实现了成品检验管理、抽样标准管理、出货检验管理、字典管理、公告管理、工作人员管理、控制图初始化管理、来料检验管理、输出立方图管理、制成检验管理、输出直方图管理、管理员管理等功能。系统用到了关系型数据库中王者MySql作为系统的数据库,有效的对数据进行安全的存储,有效的备份,对数据可靠性方面得到了保证。并且程序也具备程序需求的所有功能,使得操作性还是安全性都大大提高,让中小型制造企业质量管理更能从理念走到现实,确确实实的让人们提升信息处理效率。
关键字:信息管理,时效性,安全性,MySql
基于springboot中小型制造企业质量管理系统源码和论文660
演示视频:
【包调试运行】基于springboot中小型制造企业质量管理系统源码和论文
Information data has been changing from traditional to contemporary, and the sudden Internet has allowed traditional information management to see a revolutionary dawn, because traditional information management is in terms of timeliness, security, or operability. It was only after encountering the Internet era that it was able to make up for the shortcomings since ancient times, and effectively improve the management efficiency and business level. The traditional management model, the longer the time, the more content is managed, and more people are needed to organize the data, and the efficiency of data aggregation and query is extremely low, and data security will never guarantee security performance. Combined with various shortcomings of data content management, they can be effectively supplemented in the Internet era. Combined with advanced Internet technology, develop software that meets the needs, so that the data content management can maximize the accuracy rate from the timeliness of entry, the timeliness of viewing, and the timeliness of summary analysis. The train ticket selling system developed this time has realized the functions of online booking, online payment, online change of ticket, and online refund of train tickets. The system uses MySql, the king of the relational database, as the system database, which effectively stores the data safely and effectively backs up, ensuring the reliability of the data. And the program also has all the functions required by the program, which greatly improves the operability or security, so that the train ticket sales system can go from concept to reality, and it really allows people to improve the efficiency of information processing.
Key Words:Information management, timeliness, security, MySql
摘 要
目 录
第1章 绪论
1.1 研究背景
1.2目的和意义
1.3 论文研究内容
第2章 程序开发技术
2.1 Mysql数据库
2.2 Java语言
第3章 系统分析
3.1可行性分析
3.1.1技术可行性分析
3.1.2经济可行性分析
3.1.3操作可行性分析
3.2系统运行环境
3.3系统流程分析
第4章 系统设计
4.1 系统设计的原则
4.2 系统结构设计
4.3功能结构设计
4.4数据库设计
4.4.1 数据库E-R图
4.4.2 数据库表结构
第5章 系统实现
5.1管理员功能实现
5.1.1 成品检验管理
5.1.2 公告信息管理
5.1.3公告类型管理
第6章 系统测试
6.1系统测试方法
6.2 系统功能测试
6.2.1 用户登录测试
6.2.2 添加账户功能测试
6.3 系统测试分析
结 论
致 谢
参考文献
第1章 绪论
1.1 研究背景
互联网概念的产生到如今的蓬勃发展,用了短短的几十年时间就风靡全球,使得全球各个行业都进行了互联网的改造升级,标志着互联网浪潮的来临。在这个新的时代,各行各业都充分考虑互联网是否能与本行业进行结合,是否能解决本行业或者本行业中某些方面的自古以来的痛点。长期以来,数据内容,数据传播,数据储存等都是一门门专业的内容,因为需要记住的内容很多,造成古人的言简意赅,如今互联网的到来让数据更加的清晰好认不复杂,一目了然不出错,毕竟在整个历史上数据的丢失,传承的断代,都是因为数据不能好好的保存,不能好好的流传。当年的年代用互联网思维和互联网技术,对大量数据的录入更新,存储汇总,备份分析方面,使得远远的超过传统的数据管理技术。在这样的时代潮流下,采用新技术开发新软件,对传统行业进行革命性的改造成为了当今的主流。本次开发中小型制造企业质量管理,解决了成品检验信息管理关于数据方面的管理分析,存储传输的痛点,不仅仅对管理员提供了便利,还能提高用户的满意度。
1.2目的和意义
此次中小型制造企业质量管理的开发,需要用到的知识不仅涉及到界面设计与功能设计方面的知识,还需要涉及到数据库与编程语言上面的知识,这些知识点对于一个即将毕业的学生来说,一是为了巩固在校所学相关专业知识;二是为了让学生学会如何将专业理论知识运用于现实软件的开发过程;三是让学生明白知识是无穷无尽的,要时刻明白活到老学到老的真正含义,让学生要养成时刻学习的习惯,同时也要相信通过此次程序的开发,会让学生对于专业知识的理解与软件开发水平的提高有着极大的帮助。
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 工作人员
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/gongzuorenyuan")
public class GongzuorenyuanController {
private static final Logger logger = LoggerFactory.getLogger(GongzuorenyuanController.class);
private static final String TABLE_NAME = "gongzuorenyuan";
@Autowired
private GongzuorenyuanService gongzuorenyuanService;
@Autowired
private TokenService tokenService;
@Autowired
private ChengpinjianyanService chengpinjianyanService;//成品检验
@Autowired
private ChouyangbiaozhunService chouyangbiaozhunService;//抽样标准
@Autowired
private ChuhuojianyanService chuhuojianyanService;//出货检验
@Autowired
private DictionaryService dictionaryService;//字典
@Autowired
private GonggaoService gonggaoService;//公告
@Autowired
private KongzhituchushihuaService kongzhituchushihuaService;//控制图初始化
@Autowired
private LailiaojianyanService lailiaojianyanService;//来料检验
@Autowired
private LifangtuService lifangtuService;//输出立方图
@Autowired
private ZhichengjianyanService zhichengjianyanService;//制成检验
@Autowired
private ZhifangtuService zhifangtuService;//输出直方图
@Autowired
private UsersService usersService;//管理员
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("工作人员".equals(role))
params.put("gongzuorenyuanId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = gongzuorenyuanService.queryPage(params);
//字典表数据转换
List<GongzuorenyuanView> list =(List<GongzuorenyuanView>)page.getList();
for(GongzuorenyuanView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
GongzuorenyuanEntity gongzuorenyuan = gongzuorenyuanService.selectById(id);
if(gongzuorenyuan !=null){
//entity转view
GongzuorenyuanView view = new GongzuorenyuanView();
BeanUtils.copyProperties( gongzuorenyuan , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody GongzuorenyuanEntity gongzuorenyuan, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,gongzuorenyuan:{}",this.getClass().getName(),gongzuorenyuan.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<GongzuorenyuanEntity> queryWrapper = new EntityWrapper<GongzuorenyuanEntity>()
.eq("username", gongzuorenyuan.getUsername())
.or()
.eq("gongzuorenyuan_phone", gongzuorenyuan.getGongzuorenyuanPhone())
.or()
.eq("gongzuorenyuan_id_number", gongzuorenyuan.getGongzuorenyuanIdNumber())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GongzuorenyuanEntity gongzuorenyuanEntity = gongzuorenyuanService.selectOne(queryWrapper);
if(gongzuorenyuanEntity==null){
gongzuorenyuan.setCreateTime(new Date());
gongzuorenyuan.setPassword("123456");
gongzuorenyuanService.insert(gongzuorenyuan);
return R.ok();
}else {
return R.error(511,"账户或者工作人员手机号或者工作人员身份证号已经被使用");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody GongzuorenyuanEntity gongzuorenyuan, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,gongzuorenyuan:{}",this.getClass().getName(),gongzuorenyuan.toString());
GongzuorenyuanEntity oldGongzuorenyuanEntity = gongzuorenyuanService.selectById(gongzuorenyuan.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
if("".equals(gongzuorenyuan.getGongzuorenyuanPhoto()) || "null".equals(gongzuorenyuan.getGongzuorenyuanPhoto())){
gongzuorenyuan.setGongzuorenyuanPhoto(null);
}
gongzuorenyuanService.updateById(gongzuorenyuan);//根据id更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<GongzuorenyuanEntity> oldGongzuorenyuanList =gongzuorenyuanService.selectBatchIds(Arrays.asList(ids));//要删除的数据
gongzuorenyuanService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer gongzuorenyuanId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
try {
List<GongzuorenyuanEntity> gongzuorenyuanList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
GongzuorenyuanEntity gongzuorenyuanEntity = new GongzuorenyuanEntity();
// gongzuorenyuanEntity.setUsername(data.get(0)); //账户 要改的
// gongzuorenyuanEntity.setPassword("123456");//密码
// gongzuorenyuanEntity.setGongzuorenyuanUuidNumber(data.get(0)); //工作人员编号 要改的
// gongzuorenyuanEntity.setGongzuorenyuanName(data.get(0)); //工作人员姓名 要改的
// gongzuorenyuanEntity.setGongzuorenyuanPhone(data.get(0)); //工作人员手机号 要改的
// gongzuorenyuanEntity.setGongzuorenyuanIdNumber(data.get(0)); //工作人员身份证号 要改的
// gongzuorenyuanEntity.setGongzuorenyuanPhoto("");//详情和图片
// gongzuorenyuanEntity.setSexTypes(Integer.valueOf(data.get(0))); //性别 要改的
// gongzuorenyuanEntity.setJianyangongzhongTypes(Integer.valueOf(data.get(0))); //检验工种 要改的
// gongzuorenyuanEntity.setGongzuorenyuanEmail(data.get(0)); //工作人员邮箱 要改的
// gongzuorenyuanEntity.setJinyongTypes(Integer.valueOf(data.get(0))); //账户状态 要改的
// gongzuorenyuanEntity.setCreateTime(date);//时间
gongzuorenyuanList.add(gongzuorenyuanEntity);
//把要查询是否重复的字段放入map中
//账户
if(seachFields.containsKey("username")){
List<String> username = seachFields.get("username");
username.add(data.get(0));//要改的
}else{
List<String> username = new ArrayList<>();
username.add(data.get(0));//要改的
seachFields.put("username",username);
}
//工作人员编号
if(seachFields.containsKey("gongzuorenyuanUuidNumber")){
List<String> gongzuorenyuanUuidNumber = seachFields.get("gongzuorenyuanUuidNumber");
gongzuorenyuanUuidNumber.add(data.get(0));//要改的
}else{
List<String> gongzuorenyuanUuidNumber = new ArrayList<>();
gongzuorenyuanUuidNumber.add(data.get(0));//要改的
seachFields.put("gongzuorenyuanUuidNumber",gongzuorenyuanUuidNumber);
}
//工作人员手机号
if(seachFields.containsKey("gongzuorenyuanPhone")){
List<String> gongzuorenyuanPhone = seachFields.get("gongzuorenyuanPhone");
gongzuorenyuanPhone.add(data.get(0));//要改的
}else{
List<String> gongzuorenyuanPhone = new ArrayList<>();
gongzuorenyuanPhone.add(data.get(0));//要改的
seachFields.put("gongzuorenyuanPhone",gongzuorenyuanPhone);
}
//工作人员身份证号
if(seachFields.containsKey("gongzuorenyuanIdNumber")){
List<String> gongzuorenyuanIdNumber = seachFields.get("gongzuorenyuanIdNumber");
gongzuorenyuanIdNumber.add(data.get(0));//要改的
}else{
List<String> gongzuorenyuanIdNumber = new ArrayList<>();
gongzuorenyuanIdNumber.add(data.get(0));//要改的
seachFields.put("gongzuorenyuanIdNumber",gongzuorenyuanIdNumber);
}
}
//查询是否重复
//账户
List<GongzuorenyuanEntity> gongzuorenyuanEntities_username = gongzuorenyuanService.selectList(new EntityWrapper<GongzuorenyuanEntity>().in("username", seachFields.get("username")));
if(gongzuorenyuanEntities_username.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(GongzuorenyuanEntity s:gongzuorenyuanEntities_username){
repeatFields.add(s.getUsername());
}
return R.error(511,"数据库的该表中的 [账户] 字段已经存在 存在数据为:"+repeatFields.toString());
}
//工作人员编号
List<GongzuorenyuanEntity> gongzuorenyuanEntities_gongzuorenyuanUuidNumber = gongzuorenyuanService.selectList(new EntityWrapper<GongzuorenyuanEntity>().in("gongzuorenyuan_uuid_number", seachFields.get("gongzuorenyuanUuidNumber")));
if(gongzuorenyuanEntities_gongzuorenyuanUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(GongzuorenyuanEntity s:gongzuorenyuanEntities_gongzuorenyuanUuidNumber){
repeatFields.add(s.getGongzuorenyuanUuidNumber());
}
return R.error(511,"数据库的该表中的 [工作人员编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
//工作人员手机号
List<GongzuorenyuanEntity> gongzuorenyuanEntities_gongzuorenyuanPhone = gongzuorenyuanService.selectList(new EntityWrapper<GongzuorenyuanEntity>().in("gongzuorenyuan_phone", seachFields.get("gongzuorenyuanPhone")));
if(gongzuorenyuanEntities_gongzuorenyuanPhone.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(GongzuorenyuanEntity s:gongzuorenyuanEntities_gongzuorenyuanPhone){
repeatFields.add(s.getGongzuorenyuanPhone());
}
return R.error(511,"数据库的该表中的 [工作人员手机号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
//工作人员身份证号
List<GongzuorenyuanEntity> gongzuorenyuanEntities_gongzuorenyuanIdNumber = gongzuorenyuanService.selectList(new EntityWrapper<GongzuorenyuanEntity>().in("gongzuorenyuan_id_number", seachFields.get("gongzuorenyuanIdNumber")));
if(gongzuorenyuanEntities_gongzuorenyuanIdNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(GongzuorenyuanEntity s:gongzuorenyuanEntities_gongzuorenyuanIdNumber){
repeatFields.add(s.getGongzuorenyuanIdNumber());
}
return R.error(511,"数据库的该表中的 [工作人员身份证号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
gongzuorenyuanService.insertBatch(gongzuorenyuanList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
GongzuorenyuanEntity gongzuorenyuan = gongzuorenyuanService.selectOne(new EntityWrapper<GongzuorenyuanEntity>().eq("username", username));
if(gongzuorenyuan==null || !gongzuorenyuan.getPassword().equals(password))
return R.error("账号或密码不正确");
else if(gongzuorenyuan.getJinyongTypes() != 1)
return R.error("账户已被禁用");
String token = tokenService.generateToken(gongzuorenyuan.getId(),username, "gongzuorenyuan", "工作人员");
R r = R.ok();
r.put("token", token);
r.put("role","工作人员");
r.put("username",gongzuorenyuan.getGongzuorenyuanName());
r.put("tableName","gongzuorenyuan");
r.put("userId",gongzuorenyuan.getId());
return r;
}
/**
* 注册
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody GongzuorenyuanEntity gongzuorenyuan, HttpServletRequest request) {
// ValidatorUtils.validateEntity(user);
Wrapper<GongzuorenyuanEntity> queryWrapper = new EntityWrapper<GongzuorenyuanEntity>()
.eq("username", gongzuorenyuan.getUsername())
.or()
.eq("gongzuorenyuan_phone", gongzuorenyuan.getGongzuorenyuanPhone())
.or()
.eq("gongzuorenyuan_id_number", gongzuorenyuan.getGongzuorenyuanIdNumber())
;
GongzuorenyuanEntity gongzuorenyuanEntity = gongzuorenyuanService.selectOne(queryWrapper);
if(gongzuorenyuanEntity != null)
return R.error("账户或者工作人员手机号或者工作人员身份证号已经被使用");
gongzuorenyuan.setGongzuorenyuanUuidNumber(String.valueOf(new Date().getTime()));
gongzuorenyuan.setJinyongTypes(1);//启用
gongzuorenyuan.setCreateTime(new Date());
gongzuorenyuanService.insert(gongzuorenyuan);
return R.ok();
}
/**
* 重置密码
*/
@GetMapping(value = "/resetPassword")
public R resetPassword(Integer id, HttpServletRequest request) {
GongzuorenyuanEntity gongzuorenyuan = gongzuorenyuanService.selectById(id);
gongzuorenyuan.setPassword("123456");
gongzuorenyuanService.updateById(gongzuorenyuan);
return R.ok();
}
/**
* 修改密码
*/
@GetMapping(value = "/updatePassword")
public R updatePassword(String oldPassword, String newPassword, HttpServletRequest request) {
GongzuorenyuanEntity gongzuorenyuan = gongzuorenyuanService.selectById((Integer)request.getSession().getAttribute("userId"));
if(newPassword == null){
return R.error("新密码不能为空") ;
}
if(!oldPassword.equals(gongzuorenyuan.getPassword())){
return R.error("原密码输入错误");
}
if(newPassword.equals(gongzuorenyuan.getPassword())){
return R.error("新密码不能和原密码一致") ;
}
gongzuorenyuan.setPassword(newPassword);
gongzuorenyuanService.updateById(gongzuorenyuan);
return R.ok();
}
/**
* 忘记密码
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request) {
GongzuorenyuanEntity gongzuorenyuan = gongzuorenyuanService.selectOne(new EntityWrapper<GongzuorenyuanEntity>().eq("username", username));
if(gongzuorenyuan!=null){
gongzuorenyuan.setPassword("123456");
gongzuorenyuanService.updateById(gongzuorenyuan);
return R.ok();
}else{
return R.error("账号不存在");
}
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrGongzuorenyuan(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
GongzuorenyuanEntity gongzuorenyuan = gongzuorenyuanService.selectById(id);
if(gongzuorenyuan !=null){
//entity转view
GongzuorenyuanView view = new GongzuorenyuanView();
BeanUtils.copyProperties( gongzuorenyuan , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 退出
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
}