Java毕业设计-基于Springboot框架的商业辅助决策系统项目实战(附源码+论文)
大家好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发环境
开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7
数据库工具:Navicat12
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器
源码下载地址:
<>
论文目录
【如需全文请按文末获取联系】


一、项目简介
商业辅助决策系统实现的功能包括收入信息管理与支出信息管理,员工销售订单信息管理,员工薪资管理,员工管理,公告管理等功能。该系统采用了Mysql数据库,Java语言,Spring Boot框架等技术进行编程实现。
二、系统设计
2.1软件功能模块设计
图4.1即为设计的管理员功能结构,管理员权限操作的功能包括管理员工基本信息,管理收入信息,管理支出信息,增删改查销售订单信息,增删改查员工薪资信息等。

图4.2即为设计的员工功能结构,员工权限操作的功能包括查看自己的薪资信息,查看销售订单信息,查看公告,更改个人信息与登录密码等。

2.2数据库设计
(1)图4.4即为薪资这个实体所拥有的属性值。

(2)图4.5即为销售订单这个实体所拥有的属性值。

(3)图4.6即为员工这个实体所拥有的属性值。

(5)图4.8即为上面介绍的实体中存在的联系。

三、系统项目部分截图
3.1管理员功能实现
收支管理
图5.2 即为编码实现的收支管理界面,管理员在收支管理界面中新增收支信息,主要是对支出信息或者是收入信息进行登记,已经新增的收支信息存在登记错误的情况,也能及时更改,在收支管理界面,管理员也能删除需要删除的收支信息,查看收支报表,收支信息主要包括收支类型,收支金额信息,以及收支名称等信息。

销售订单管理
图5.3 即为编码实现的销售订单管理界面,管理员在销售订单管理界面可以新增销售订单信息,销售订单信息主要包括销售数量,销售时间,销售金额,员工姓名,销售名称,添加时间等信息,销售订单信息存在登记错误的情况也能及时更改,同时在销售订单管理界面,管理员也能删除需要删除的销售订单信息,根据员工姓名查询销售订单,或者是选择销售类型来完成对销售订单信息的筛选。

薪资管理
图5.4 即为编码实现的薪资管理界面,管理员在薪资管理界面新增员工薪资,员工薪资主要包括基本工资,奖金,绩效,补贴,实发薪资,添加时间,月份,员工姓名,员工头像,员工手机号等信息,已经存在的员工薪资信息如果存在登记错误的情况,也可以及时更改,在薪资管理界面,管理员可以删除需要删除的薪资信息,提供员工姓名可以对员工薪资信息进行查询,或者选择月份来完成对员工薪资信息的筛选等。

3.2员工功能实现
销售订单查看
图5.9 即为编码实现的销售订单查看界面,员工在销售订单查看界面中主要是对属于自己的销售订单的信息进行查看,当销售订单信息比较多时,员工可以使用销售订单查看界面的查询功能来实现对销售订单的查询,查询前,需要选择适合的查询方式来进行查询,如果选择根据销售订单类型查询销售订单信息,则会查询并显示出该销售订单类型的销售订单信息。

薪资查看
图5.10 即为编码实现的薪资查看界面,员工在薪资查看界面中只能查看属于自己的薪资信息,当薪资信息比较多时,员工可以使用薪资查看界面的查询功能进行薪资查询。

个人信息
图5.11 即为编码实现的个人信息界面,员工在个人信息界面中除了不能更改部门和职位信息外,其他的信息包括头像,手机号在内的信息都能进行更改。

四、部分核心代码
4.1 用户部分
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("/shouzhi")
public class ShouzhiController {
private static final Logger logger = LoggerFactory.getLogger(ShouzhiController.class);
@Autowired
private ShouzhiService shouzhiService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YuangongService yuangongService;
/** * 后端列表
*/
@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("yuangongId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = shouzhiService.queryPage(params);
//字典表数据转换
List<ShouzhiView> list =(List<ShouzhiView>)page.getList();
for(ShouzhiView 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);
ShouzhiEntity shouzhi = shouzhiService.selectById(id);
if(shouzhi !=null){
//entity转view
ShouzhiView view = new ShouzhiView();
BeanUtils.copyProperties( shouzhi , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/** * 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ShouzhiEntity shouzhi, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,shouzhi:{}",this.getClass().getName(),shouzhi.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<ShouzhiEntity> queryWrapper = new EntityWrapper<ShouzhiEntity>()
.eq("shouzhi_uuid_number", shouzhi.getShouzhiUuidNumber())
.eq("shouzhi_name", shouzhi.getShouzhiName())
.eq("shouzhi_types", shouzhi.getShouzhiTypes())
.eq("shouzhi_erji_types", shouzhi.getShouzhiErjiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ShouzhiEntity shouzhiEntity = shouzhiService.selectOne(queryWrapper);
if(shouzhiEntity==null){
shouzhi.setInsertTime(new Date());
shouzhi.setCreateTime(new Date());
shouzhiService.insert(shouzhi);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/** * 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody ShouzhiEntity shouzhi, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,shouzhi:{}",this.getClass().getName(),shouzhi.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<ShouzhiEntity> queryWrapper = new EntityWrapper<ShouzhiEntity>()
.notIn("id",shouzhi.getId())
.andNew()
.eq("shouzhi_uuid_number", shouzhi.getShouzhiUuidNumber())
.eq("shouzhi_name", shouzhi.getShouzhiName())
.eq("shouzhi_types", shouzhi.getShouzhiTypes())
.eq("shouzhi_erji_types", shouzhi.getShouzhiErjiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ShouzhiEntity shouzhiEntity = shouzhiService.selectOne(queryWrapper);
if(shouzhiEntity==null){
shouzhiService.updateById(shouzhi);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/** * 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
shouzhiService.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 yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<ShouzhiEntity> shouzhiList = 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){
//循环
ShouzhiEntity shouzhiEntity = new ShouzhiEntity();
// shouzhiEntity.setShouzhiUuidNumber(data.get(0)); //唯一编号 要改的
// shouzhiEntity.setShouzhiName(data.get(0)); //收支名称 要改的
// shouzhiEntity.setShouzhiTypes(Integer.valueOf(data.get(0))); //收支类型 要改的
// shouzhiEntity.setShouzhiErjiTypes(Integer.valueOf(data.get(0))); //二级类型 要改的
// shouzhiEntity.setShouzhiMoney(data.get(0)); //收支金额 要改的
// shouzhiEntity.setShouzhiContent("");//详情和图片
// shouzhiEntity.setInsertTime(date);//时间
// shouzhiEntity.setCreateTime(date);//时间
shouzhiList.add(shouzhiEntity);
//把要查询是否重复的字段放入map中
//唯一编号
if(seachFields.containsKey("shouzhiUuidNumber")){
List<String> shouzhiUuidNumber = seachFields.get("shouzhiUuidNumber");
shouzhiUuidNumber.add(data.get(0));//要改的
}else{
List<String> shouzhiUuidNumber = new ArrayList<>();
shouzhiUuidNumber.add(data.get(0));//要改的
seachFields.put("shouzhiUuidNumber",shouzhiUuidNumber);
}
}
//查询是否重复
//唯一编号
List<ShouzhiEntity> shouzhiEntities_shouzhiUuidNumber = shouzhiService.selectList(new EntityWrapper<ShouzhiEntity>().in("shouzhi_uuid_number", seachFields.get("shouzhiUuidNumber")));
if(shouzhiEntities_shouzhiUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(ShouzhiEntity s:shouzhiEntities_shouzhiUuidNumber){
repeatFields.add(s.getShouzhiUuidNumber());
}
return R.error(511,"数据库的该表中的 [唯一编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
shouzhiService.insertBatch(shouzhiList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}
AI写代码
获取源码或论文
如需对应的论文或源码,以及其他定制需求,也可以下方微信联系我。
