springboot271制造装备物联及生产管理ERP系统

博主介绍:专注于Java(springboot ssm 等开发框架) vue  .net  php phython node.js    uniapp 微信小程序 等诸多技术领域和毕业项目实战、企业信息化系统建设,从业十五余年开发设计教学工作
☆☆☆ 精彩专栏推荐订阅☆☆☆☆☆不然下次找不到哟
我的博客空间发布了2000+毕设题目 方便大家学习使用
感兴趣的可以先收藏起来,还有大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助更多的人
文末下方有源码获取地址

4.2功能结构设计

为了让系统的编码可以顺利进行,特意对本系统功能进行细分设计,设计的系统功能结构见下图。

图4.1 系统功能结构图

4.3 数据库设计

4.3.1 数据库概念设计

4.3.2 数据库物理设计

表4.1材料信息表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

cailiao_uuid_unmber

String

材料编号

3

cailiao_name

String

材料名称

4

cailiao_types

Integer

材料类型

5

cailiao_kucun_number

Integer

材料数量

6

cailiao_danwei

String

单位

7

create_time

Date

创建时间

表4.2出入库表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

cailiao_churu_inout_uuid_number

String

出入库流水号

3

cailiao_churu_inout_name

String

出入库名称

4

cailiao_churu_inout_types

Integer

出入库类型

5

cailiao_churu_inout_content

String

备注

6

insert_time

Date

添加时间

7

create_time

Date

创建时间

表4.3出入库详情表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

cailiao_churu_inout_id

Integer

出入库

3

cailiao_id

Integer

材料

4

cailiao_churu_inout_list_number

Integer

操作数量

5

insert_time

Date

操作时间

6

create_time

Date

创建时间

表4.4产品信息表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

chanpin_uuid_unmber

String

产品编号

3

chanpin_name

String

产品名称

4

chanpin_types

Integer

产品类型

5

shangxia_types

Integer

是否上架

6

chanpin_content

String

产品详情

7

create_time

Date

创建时间

表4.5字典表表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

dic_code

String

字段

3

dic_name

String

字段名

4

code_index

Integer

编码

5

index_name

String

编码名字

6

super_id

Integer

父字段id

7

beizhu

String

备注

8

create_time

Date

创建时间

表4.6顾客订单表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

gukedingdan_uuid_unmber

String

订单编号

3

chanpin_id

Integer

产品

4

gukedingdan_number

Integer

订购数量

5

insert_time

Date

下订单日期

6

gukedingdan_time

Date

订单截止时间

7

gukedingdan_types

Integer

订单状态

8

gukedingdan_text

String

顾客订单内容

9

create_time

Date

创建时间

表4.7设备信息表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

shebei_uuid_unmber

String

设备编号

3

shebei_name

String

设备名称

4

shebei_types

Integer

设备类型

5

shebei_time

Date

上次检修日期

6

status_types

Integer

设备状态

7

create_time

Date

创建时间

表4.8设备检修表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

shebei_id

Integer

设备

3

weixiuyuan_id

Integer

员工

4

shebeijianxiu_time

Date

上次检修日期

5

create_time

Date

创建时间

表4.9生产计划表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

gukedingdan_id

Integer

订单编号

3

shengcanjihukaishi_time

Date

开始的时间

4

shengcanjihujieshu_time

Date

结束时间

5

shengcanjihua_types

Integer

计划状态

6

create_time

Date

创建时间

表4.10维修员表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

weixiuyuan_name

String

维修员姓名

3

weixiuyuan_photo

String

头像

4

weixiuyuan_phone

String

维修员手机号

5

weixiuyuan_id_number

String

维修员身份证号

6

weixiuyuan_email

String

邮箱

7

weixiuyuan_delete

Integer

假删

8

weixiuyuan_time

Date

入职日期

9

create_time

Date

创建时间

表4.11员工表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

yonghu_name

String

员工姓名

3

yonghu_photo

String

头像

4

yonghu_phone

String

员工手机号

5

yonghu_id_number

String

员工身份证号

6

yonghu_email

String

邮箱

7

yonghu_zhineng

String

职能

8

bumen_types

Integer

部门

9

yonghu_delete

Integer

假删

10

yonghu_time

Date

入职日期

11

create_time

Date

创建时间

表4.12质量监控表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

shengcanjihua_id

Integer

生产计划

3

zhiljiankong_name

String

不合格产品名称

4

shebei_types

Integer

设备类型

5

yonghu_id

Integer

员工

6

zhiljiankong_number

Integer

不合格产品数量

7

insert_time

Date

时间

8

create_time

Date

创建时间

表4.13用户表表

序号

列名

数据类型

说明

允许空

1

Id

Int

id

2

username

String

用户名

3

password

String

密码

4

role

String

角色

5

addtime

Date

新增时间


5 系统实现

这个环节需要使用前面的设计方案,包括对系统模块的设计,还有对程序后台的数据支持的数据库的设计等。不过这部分内容还是强调系统编码人员的开发能力,要把前面设计的内容通过编码的形式以一个完整的,可以运行的系统呈现出来。

功能模块的实现

5.1员工信息管理

如图5.1显示的就是员工信息管理页面,此页面提供给管理员的功能有:员工信息的查询管理,可以删除员工信息、修改员工信息、新增员工信息,

还进行了对用户名称的模糊查询的条件

图5.1 员工信息管理页面

5.2 材料信息管理

如图5.2显示的就是材料信息管理页面,此页面提供给管理员的功能有:查看已发布的材料信息数据,修改材料信息,材料信息作废,即可删除,还进行了对材料信息名称的模糊查询 材料信息信息的类型查询等等一些条件。

图5.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("/cailiao")
public class CailiaoController {
    private static final Logger logger = LoggerFactory.getLogger(CailiaoController.class);

    @Autowired
    private CailiaoService cailiaoService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表service

    @Autowired
    private YonghuService yonghuService;
    @Autowired
    private WeixiuyuanService weixiuyuanService;


    /**
    * 后端列表
    */
    @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(StringUtil.isEmpty(role))
            return R.error(511,"权限为空");
        else if("员工".equals(role))
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        else if("维修员".equals(role))
            params.put("weixiuyuanId",request.getSession().getAttribute("userId"));
        if(params.get("orderBy")==null || params.get("orderBy")==""){
            params.put("orderBy","id");
        }
        PageUtils page = cailiaoService.queryPage(params);

        //字典表数据转换
        List<CailiaoView> list =(List<CailiaoView>)page.getList();
        for(CailiaoView 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);
        CailiaoEntity cailiao = cailiaoService.selectById(id);
        if(cailiao !=null){
            //entity转view
            CailiaoView view = new CailiaoView();
            BeanUtils.copyProperties( cailiao , view );//把实体数据重构到view中

            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody CailiaoEntity cailiao, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,cailiao:{}",this.getClass().getName(),cailiao.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(StringUtil.isEmpty(role))
            return R.error(511,"权限为空");

        Wrapper<CailiaoEntity> queryWrapper = new EntityWrapper<CailiaoEntity>()
            .eq("cailiao_uuid_unmber", cailiao.getCailiaoUuidUnmber())
            .eq("cailiao_name", cailiao.getCailiaoName())
            .eq("cailiao_types", cailiao.getCailiaoTypes())
            .eq("cailiao_kucun_number", cailiao.getCailiaoKucunNumber())
            .eq("cailiao_danwei", cailiao.getCailiaoDanwei())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CailiaoEntity cailiaoEntity = cailiaoService.selectOne(queryWrapper);
        if(cailiaoEntity==null){
            cailiao.setCreateTime(new Date());
            cailiaoService.insert(cailiao);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody CailiaoEntity cailiao, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,cailiao:{}",this.getClass().getName(),cailiao.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(StringUtil.isEmpty(role))
//            return R.error(511,"权限为空");
        //根据字段查询是否有相同数据
        Wrapper<CailiaoEntity> queryWrapper = new EntityWrapper<CailiaoEntity>()
            .notIn("id",cailiao.getId())
            .andNew()
            .eq("cailiao_uuid_unmber", cailiao.getCailiaoUuidUnmber())
            .eq("cailiao_name", cailiao.getCailiaoName())
            .eq("cailiao_types", cailiao.getCailiaoTypes())
            .eq("cailiao_kucun_number", cailiao.getCailiaoKucunNumber())
            .eq("cailiao_danwei", cailiao.getCailiaoDanwei())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CailiaoEntity cailiaoEntity = cailiaoService.selectOne(queryWrapper);
        if(cailiaoEntity==null){
            cailiaoService.updateById(cailiao);//根据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());
        cailiaoService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }


    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        try {
            List<CailiaoEntity> cailiaoList = 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){
                            //循环
                            CailiaoEntity cailiaoEntity = new CailiaoEntity();
//                            cailiaoEntity.setCailiaoUuidUnmber(data.get(0));                    //材料编号 要改的
//                            cailiaoEntity.setCailiaoName(data.get(0));                    //材料名称 要改的
//                            cailiaoEntity.setCailiaoTypes(Integer.valueOf(data.get(0)));   //材料类型 要改的
//                            cailiaoEntity.setCailiaoKucunNumber(Integer.valueOf(data.get(0)));   //材料数量 要改的
//                            cailiaoEntity.setCailiaoDanwei(data.get(0));                    //单位 要改的
//                            cailiaoEntity.setCreateTime(date);//时间
                            cailiaoList.add(cailiaoEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        cailiaoService.insertBatch(cailiaoList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }






}

5.3设备信息管理

如图5.3显示的就是设备信息管理页面,此页面提供给管理员的功能有:根据设备信息进行条件查询,还可以对设备信息进行新增、修改、查询操作等等。

图5.3 设备信息管理页面

5.1设备类型管理

如图5.4显示的就是设备类型管理页面,此页面提供给管理员的功能有:根据设备类型进行新增、修改、查询操作等等。

图5.4 设备类型管理页面


大家点赞、收藏、关注、评论啦  其他的定制服务 商务合作  下方联系卡片↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 或者私信作者

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

翰文编程

你的鼓励 是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值