🍊作者:计算机编程-吉哥
🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。
🍊心愿:点赞 👍 收藏 ?评论 📝
🍅 文末获取源码联系👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~
Java毕业设计项目~热门选题推荐《1000套》
目录
springboot、mybatisplus、vue、elementui、html、css、js、mysql、jdk1.8
14张?
idea、navicat
管理员、工作人员
?
?
?
?
?
CREATE TABLE `chengpinjianyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`gongzuorenyuan_id` int(11) DEFAULT NULL COMMENT '工作人员',
`chengpinjianyan_uuid_number` varchar(200) DEFAULT NULL COMMENT '检验编号',
`chengpinjianyan_name` varchar(200) DEFAULT NULL COMMENT '检验标题 Search111 ',
`jianyanzhongxin_types` int(11) DEFAULT NULL COMMENT '检验中心 Search111',
`jianyanyiqi_types` int(11) DEFAULT NULL COMMENT '检验仪器 Search111',
`jianyanxiangmu_types` int(11) DEFAULT NULL COMMENT '检验项目 Search111',
`chengpinjianyan_types` int(11) DEFAULT NULL COMMENT '成品检验类型 Search111',
`chengpinjianyan_file` varchar(200) DEFAULT NULL COMMENT '检验文件',
`chengpinjianyan_time` timestamp NULL DEFAULT NULL COMMENT '检验时间',
`zhiliangdengji_types` int(11) DEFAULT NULL COMMENT '质量等级 Search111',
`quexiandengji_types` int(11) DEFAULT NULL COMMENT '缺陷等级 Search111',
`quexianyuanyin_types` int(11) DEFAULT NULL COMMENT '缺陷原因类型 Search111',
`jieguo_types` int(11) DEFAULT NULL COMMENT '检测结果 Search111',
`chengpinjianyan_content` longtext COMMENT '检验结果',
`chengpinjianyan_beizhu_content` longtext COMMENT '备注',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='成品检验';
CREATE TABLE `chouyangbiaozhun` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`chouyangbiaozhun_uuid_number` varchar(200) DEFAULT NULL COMMENT '标准编号',
`chouyangbiaozhun_name` varchar(200) DEFAULT NULL COMMENT '标准标题 Search111 ',
`jianyanxiangmu_types` int(11) DEFAULT NULL COMMENT '检验项目 Search111',
`chouyangbiaozhun_types` int(11) DEFAULT NULL COMMENT '抽样标准类型 Search111',
`chouyangbiaozhun_file` varchar(200) DEFAULT NULL COMMENT '依据标准',
`chouyangbiaozhun_content` longtext COMMENT '合格标准',
`chouyangbiaozhun_beizhu_content` longtext COMMENT '备注',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='抽样标准';
CREATE TABLE `chuhuojianyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`gongzuorenyuan_id` int(11) DEFAULT NULL COMMENT '工作人员',
`chuhuojianyan_uuid_number` varchar(200) DEFAULT NULL COMMENT '检验编号',
`chuhuojianyan_name` varchar(200) DEFAULT NULL COMMENT '检验标题 Search111 ',
`jianyanzhongxin_types` int(11) DEFAULT NULL COMMENT '检验中心 Search111',
`jianyanyiqi_types` int(11) DEFAULT NULL COMMENT '检验仪器 Search111',
`jianyanxiangmu_types` int(11) DEFAULT NULL COMMENT '检验项目 Search111',
`chuhuojianyan_types` int(11) DEFAULT NULL COMMENT '出货检验类型 Search111',
`chuhuojianyan_file` varchar(200) DEFAULT NULL COMMENT '检验文件',
`chuhuojianyan_time` timestamp NULL DEFAULT NULL COMMENT '检验时间',
`zhiliangdengji_types` int(11) DEFAULT NULL COMMENT '质量等级 Search111',
`quexiandengji_types` int(11) DEFAULT NULL COMMENT '缺陷等级 Search111',
`quexianyuanyin_types` int(11) DEFAULT NULL COMMENT '缺陷原因类型 Search111',
`jieguo_types` int(11) DEFAULT NULL COMMENT '检测结果 Search111',
`chuhuojianyan_content` longtext COMMENT '检验结果',
`chuhuojianyan_beizhu_content` longtext COMMENT '备注',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='出货检验';
CREATE TABLE `config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(100) NOT NULL COMMENT '配置参数名称',
`value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='配置文件';
CREATE TABLE `dictionary` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`dic_code` varchar(200) DEFAULT NULL COMMENT '字段',
`dic_name` varchar(200) DEFAULT NULL COMMENT '字段名',
`code_index` int(11) DEFAULT NULL COMMENT '编码',
`index_name` varchar(200) DEFAULT NULL COMMENT '编码名字 Search111 ',
`super_id` int(11) DEFAULT NULL COMMENT '父字段id',
`beizhu` varchar(200) DEFAULT NULL COMMENT '备注',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8 COMMENT='字典';
CREATE TABLE `gonggao` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`gonggao_name` varchar(200) DEFAULT NULL COMMENT '公告名称 Search111 ',
`gonggao_types` int(11) NOT NULL COMMENT '公告类型 Search111 ',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '发布时间',
`gonggao_content` longtext COMMENT '公告详情 ',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 nameShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='公告';
CREATE TABLE `gongzuorenyuan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(200) DEFAULT NULL COMMENT '账户',
`password` varchar(200) DEFAULT NULL COMMENT '密码',
`gongzuorenyuan_uuid_number` varchar(200) DEFAULT NULL COMMENT '工作人员编号 Search111 ',
`gongzuorenyuan_name` varchar(200) DEFAULT NULL COMMENT '工作人员姓名 Search111 ',
`gongzuorenyuan_phone` varchar(200) DEFAULT NULL COMMENT '工作人员手机号',
`gongzuorenyuan_id_number` varchar(200) DEFAULT NULL COMMENT '工作人员身份证号',
`gongzuorenyuan_photo` varchar(200) DEFAULT NULL COMMENT '工作人员头像',
`sex_types` int(11) DEFAULT NULL COMMENT '性别',
`jianyangongzhong_types` int(11) DEFAULT NULL COMMENT '检验工种 Search111 ',
`gongzuorenyuan_email` varchar(200) DEFAULT NULL COMMENT '工作人员邮箱',
`jinyong_types` int(11) DEFAULT NULL COMMENT '账户状态 Search111 ',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='工作人员';
CREATE TABLE `kongzhituchushihua` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`gongzuorenyuan_id` int(11) DEFAULT NULL COMMENT '工作人员',
`kongzhituchushihua_uuid_number` varchar(200) DEFAULT NULL COMMENT '初始化编号',
`kongzhituchushihua_name` varchar(200) DEFAULT NULL COMMENT '初始化标题 Search111 ',
`kongzhituchushihua_types` int(11) DEFAULT NULL COMMENT '控制图初始化类型 Search111',
`kongzhituchushihua_qian_file` varchar(200) DEFAULT NULL COMMENT '初始化前文件',
`kongzhituchushihua_hou_file` varchar(200) DEFAULT NULL COMMENT '初始化后文件',
`kongzhituchushihua_time` timestamp NULL DEFAULT NULL COMMENT '初始化时间',
`kongzhituchushihua_content` longtext COMMENT '初始化内容',
`kongzhituchushihua_beizhu_content` longtext COMMENT '备注',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='控制图初始化';
CREATE TABLE `token` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`userid` bigint(20) NOT NULL COMMENT '员工id',
`username` varchar(100) NOT NULL COMMENT '员工名',
`tablename` varchar(100) DEFAULT NULL COMMENT '表名',
`role` varchar(100) DEFAULT NULL COMMENT '角色',
`token` varchar(200) NOT NULL COMMENT '密码',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
`expiratedtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '过期时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='token表';
CREATE TABLE `users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(100) NOT NULL COMMENT '员工名',
`password` varchar(100) NOT NULL COMMENT '密码',
`role` varchar(100) DEFAULT '管理员' COMMENT '角色',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员';
CREATE TABLE `zhifangtu` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`gongzuorenyuan_id` int(11) DEFAULT NULL COMMENT '工作人员',
`zhifangtu_uuid_number` varchar(200) DEFAULT NULL COMMENT '输出编号',
`zhifangtu_name` varchar(200) DEFAULT NULL COMMENT '输出标题 Search111 ',
`zhifangtu_types` int(11) DEFAULT NULL COMMENT '直方图输出类型 Search111',
`zhifangtu_file` varchar(200) DEFAULT NULL COMMENT '输出文件',
`zhifangtu_time` timestamp NULL DEFAULT NULL COMMENT '输出时间',
`zhifangtu_content` longtext COMMENT '输出备注',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='输出直方图';
package com.controller;
/**
* 抽样标准
* 后端接口
* @author 计算机编程-吉哥
* @email
*/
@RestController
@Controller
@RequestMapping("/chouyangbiaozhun")
public class ChouyangbiaozhunController {
private static final Logger logger = LoggerFactory.getLogger(ChouyangbiaozhunController.class);
private static final String TABLE_NAME = "chouyangbiaozhun";
@Autowired
private ChouyangbiaozhunService chouyangbiaozhunService;
@Autowired
private TokenService tokenService;
@Autowired
private ChengpinjianyanService chengpinjianyanService;//成品检验
@Autowired
private ChuhuojianyanService chuhuojianyanService;//出货检验
@Autowired
private DictionaryService dictionaryService;//字典
@Autowired
private GonggaoService gonggaoService;//公告
@Autowired
private GongzuorenyuanService gongzuorenyuanService;//工作人员
@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 = chouyangbiaozhunService.queryPage(params);
//字典表数据转换
List<ChouyangbiaozhunView> list =(List<ChouyangbiaozhunView>)page.getList();
for(ChouyangbiaozhunView 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);
ChouyangbiaozhunEntity chouyangbiaozhun = chouyangbiaozhunService.selectById(id);
if(chouyangbiaozhun !=null){
//entity转view
ChouyangbiaozhunView view = new ChouyangbiaozhunView();
BeanUtils.copyProperties( chouyangbiaozhun , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ChouyangbiaozhunEntity chouyangbiaozhun, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,chouyangbiaozhun:{}",this.getClass().getName(),chouyangbiaozhun.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<ChouyangbiaozhunEntity> queryWrapper = new EntityWrapper<ChouyangbiaozhunEntity>()
.eq("chouyangbiaozhun_name", chouyangbiaozhun.getChouyangbiaozhunName())
.eq("jianyanxiangmu_types", chouyangbiaozhun.getJianyanxiangmuTypes())
.eq("chouyangbiaozhun_types", chouyangbiaozhun.getChouyangbiaozhunTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ChouyangbiaozhunEntity chouyangbiaozhunEntity = chouyangbiaozhunService.selectOne(queryWrapper);
if(chouyangbiaozhunEntity==null){
chouyangbiaozhun.setInsertTime(new Date());
chouyangbiaozhun.setCreateTime(new Date());
chouyangbiaozhunService.insert(chouyangbiaozhun);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody ChouyangbiaozhunEntity chouyangbiaozhun, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,chouyangbiaozhun:{}",this.getClass().getName(),chouyangbiaozhun.toString());
ChouyangbiaozhunEntity oldChouyangbiaozhunEntity = chouyangbiaozhunService.selectById(chouyangbiaozhun.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
if("".equals(chouyangbiaozhun.getChouyangbiaozhunFile()) || "null".equals(chouyangbiaozhun.getChouyangbiaozhunFile())){
chouyangbiaozhun.setChouyangbiaozhunFile(null);
}
chouyangbiaozhunService.updateById(chouyangbiaozhun);//根据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<ChouyangbiaozhunEntity> oldChouyangbiaozhunList =chouyangbiaozhunService.selectBatchIds(Arrays.asList(ids));//要删除的数据
chouyangbiaozhunService.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<ChouyangbiaozhunEntity> chouyangbiaozhunList = 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){
//循环
ChouyangbiaozhunEntity chouyangbiaozhunEntity = new ChouyangbiaozhunEntity();
chouyangbiaozhunList.add(chouyangbiaozhunEntity);
//把要查询是否重复的字段放入map中
//标准编号
if(seachFields.containsKey("chouyangbiaozhunUuidNumber")){
List<String> chouyangbiaozhunUuidNumber = seachFields.get("chouyangbiaozhunUuidNumber");
chouyangbiaozhunUuidNumber.add(data.get(0));//要改的
}else{
List<String> chouyangbiaozhunUuidNumber = new ArrayList<>();
chouyangbiaozhunUuidNumber.add(data.get(0));//要改的
seachFields.put("chouyangbiaozhunUuidNumber",chouyangbiaozhunUuidNumber);
}
}
//查询是否重复
//标准编号
List<ChouyangbiaozhunEntity> chouyangbiaozhunEntities_chouyangbiaozhunUuidNumber = chouyangbiaozhunService.selectList(new EntityWrapper<ChouyangbiaozhunEntity>().in("chouyangbiaozhun_uuid_number", seachFields.get("chouyangbiaozhunUuidNumber")));
if(chouyangbiaozhunEntities_chouyangbiaozhunUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(ChouyangbiaozhunEntity s:chouyangbiaozhunEntities_chouyangbiaozhunUuidNumber){
repeatFields.add(s.getChouyangbiaozhunUuidNumber());
}
return R.error(511,"数据库的该表中的 [标准编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
chouyangbiaozhunService.insertBatch(chouyangbiaozhunList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}
package com.service;
/**
* 抽样标准 服务类
* author 计算机编程-吉哥
*/
public interface ChouyangbiaozhunService extends IService<ChouyangbiaozhunEntity> {
/**
* @param params 查询参数
* @return 带分页的查询出来的数据
*/
PageUtils queryPage(Map<String, Object> params);
}
package com.service.impl;
/**
* 抽样标准 服务实现类
* author 计算机编程-吉哥
*/
@Service("chouyangbiaozhunService")
@Transactional
public class ChouyangbiaozhunServiceImpl extends ServiceImpl<ChouyangbiaozhunDao, ChouyangbiaozhunEntity> implements ChouyangbiaozhunService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
Page<ChouyangbiaozhunView> page =new Query<ChouyangbiaozhunView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}
package com.dao;
/**
* 抽样标准 Dao 接口
*
* @author 计算机编程-吉哥
*/
public interface ChouyangbiaozhunDao extends BaseMapper<ChouyangbiaozhunEntity> {
List<ChouyangbiaozhunView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}
?
你可能还有感兴趣的项目👇🏻👇🏻👇🏻
更多项目推荐:计算机毕业设计项目
如果大家有任何疑虑,请在下方咨询或评论