网站360做的标记如何取消,成都健康码小程序,最优做网站,网络推广需要多少费用作者主页#xff1a;源码空间codegym 简介#xff1a;Java领域优质创作者、Java项目、学习资料、技术互助 文中获取源码 项目介绍
本管理系统有管理员和用户。
本大学城水电管理系统管理员功能有个人中心#xff0c;用户管理#xff0c;领用设备管理#xff0c;消耗设备… 作者主页源码空间codegym 简介Java领域优质创作者、Java项目、学习资料、技术互助 文中获取源码 项目介绍
本管理系统有管理员和用户。
本大学城水电管理系统管理员功能有个人中心用户管理领用设备管理消耗设备管理设备申请管理设备派发管理状体汇报管理领用报表管理消耗报表管理班组报表管理个人报表管理用户反馈管理维护保养管理设备检测管理设备维修管理报修信息管理定期修复管理修理计划管理。
用户功能有个人中心领用设备管理消耗设备管理设备申请管理设备派发管理状态汇报管理用户反馈管理报修信息管理。因而具有一定的实用性。
环境要求
1.运行环境最好是java jdk1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境Tomcat7.x,8.X,9.x版本均可
4.硬件环境windows7/8/10 4G内存以上或者Mac OS;
5.是否Maven项目是查看源码目录中是否包含pom.xml;若包含则为maven项目否则为非maven.项目
6.数据库MySql5.7/8.0等版本均可
技术栈
运行环境jdk8 tomcat9 mysql5.7 windows10
服务端技术SpringBoot MyBatis Vue Bootstrap jQuery
使用说明
1.使用Navicati或者其它工具在mysql中创建对应sq文件名称的数据库并导入项目的sql文件
2.使用IDEA/Eclipse/MyEclipse导入项目修改配置运行项目
3.将项目中config-propertiesi配置文件中的数据库配置改为自己的配置然后运行
运行指导
idea导入源码空间站顶目教程说明(Vindows版)-ssm篇
http://mtw.so/5MHvZq
源码看好后直接在网站付款下单即可付款成功会自动弹出百度网盘链接网站地址http://codegym.top
其它问题请关注公众号IT小舟,关注后发送消息即可都会给您回复的。若没有及时回复请耐心等待通常当天会有回复
运行截图
文档截图 后台 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(/dictionary)
public class DictionaryController {private static final Logger logger LoggerFactory.getLogger(DictionaryController.class);Autowiredprivate DictionaryService dictionaryService;Autowiredprivate TokenService tokenService;//级联表serviceAutowiredprivate YonghuService yonghuService;Autowiredprivate YishengService yishengService;/*** 后端列表*/RequestMapping(/page)IgnoreAuthpublic R page(RequestParam MapString, Object params, HttpServletRequest request){logger.debug(page方法:,,Controller:{},,params:{},this.getClass().getName(),JSONObject.toJSONString(params));if(params.get(orderBy)null || params.get(orderBy)){params.put(orderBy,id);}PageUtils page dictionaryService.queryPage(params);//字典表数据转换ListDictionaryView list (ListDictionaryView)page.getList();for(DictionaryView 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);DictionaryEntity dictionary dictionaryService.selectById(id);if(dictionary !null){//entity转viewDictionaryView view new DictionaryView();BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put(data, view);}else {return R.error(511,查不到数据);}}/*** 后端保存*/RequestMapping(/save)public R save(RequestBody DictionaryEntity dictionary, HttpServletRequest request){logger.debug(save方法:,,Controller:{},,dictionary:{},this.getClass().getName(),dictionary.toString());String role String.valueOf(request.getSession().getAttribute(role));if(false)return R.error(511,永远不会进入);WrapperDictionaryEntity queryWrapper new EntityWrapperDictionaryEntity().eq(dic_code, dictionary.getDicCode()).eq(index_name, dictionary.getIndexName());if(dictionary.getDicCode().contains(_erji_types)){queryWrapper.eq(super_id,dictionary.getSuperId());}logger.info(sql语句:queryWrapper.getSqlSegment());DictionaryEntity dictionaryEntity dictionaryService.selectOne(queryWrapper);if(dictionaryEntitynull){dictionary.setCreateTime(new Date());dictionaryService.insert(dictionary);//字典表新增数据,把数据再重新查出,放入监听器中ListDictionaryEntity dictionaryEntities dictionaryService.selectList(new EntityWrapperDictionaryEntity());ServletContext servletContext request.getServletContext();MapString, MapInteger,String map new HashMap();for(DictionaryEntity d :dictionaryEntities){MapInteger, String m map.get(d.getDicCode());if(m null || m.isEmpty()){m new HashMap();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute(dictionaryMap,map);return R.ok();}else {return R.error(511,表中有相同数据);}}/*** 后端修改*/RequestMapping(/update)public R update(RequestBody DictionaryEntity dictionary, HttpServletRequest request){logger.debug(update方法:,,Controller:{},,dictionary:{},this.getClass().getName(),dictionary.toString());String role String.valueOf(request.getSession().getAttribute(role));
// if(false)
// return R.error(511,永远不会进入);//根据字段查询是否有相同数据WrapperDictionaryEntity queryWrapper new EntityWrapperDictionaryEntity().notIn(id,dictionary.getId()).eq(dic_code, dictionary.getDicCode()).eq(index_name, dictionary.getIndexName());if(dictionary.getDicCode().contains(_erji_types)){queryWrapper.eq(super_id,dictionary.getSuperId());}logger.info(sql语句:queryWrapper.getSqlSegment());DictionaryEntity dictionaryEntity dictionaryService.selectOne(queryWrapper);if(dictionaryEntitynull){dictionaryService.updateById(dictionary);//根据id更新//如果字典表修改数据的话,把数据再重新查出,放入监听器中ListDictionaryEntity dictionaryEntities dictionaryService.selectList(new EntityWrapperDictionaryEntity());ServletContext servletContext request.getServletContext();MapString, MapInteger,String map new HashMap();for(DictionaryEntity d :dictionaryEntities){MapInteger, String m map.get(d.getDicCode());if(m null || m.isEmpty()){m new HashMap();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute(dictionaryMap,map);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());dictionaryService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 最大值*/RequestMapping(/maxCodeIndex)public R maxCodeIndex(RequestBody DictionaryEntity dictionary){logger.debug(maxCodeIndex:,,Controller:{},,dictionary:{},this.getClass().getName(),dictionary.toString());ListString descs new ArrayList();descs.add(code_index);WrapperDictionaryEntity queryWrapper new EntityWrapperDictionaryEntity().eq(dic_code, dictionary.getDicCode()).orderDesc(descs);logger.info(sql语句:queryWrapper.getSqlSegment());ListDictionaryEntity dictionaryEntityList dictionaryService.selectList(queryWrapper);if(dictionaryEntityList ! null ){return R.ok().put(maxCodeIndex,dictionaryEntityList.get(0).getCodeIndex()1);}else{return R.ok().put(maxCodeIndex,1);}}/*** 批量上传*/RequestMapping(/batchInsert)public R save( String fileName){logger.debug(batchInsert方法:,,Controller:{},,fileName:{},this.getClass().getName(),fileName);try {ListDictionaryEntity dictionaryList new ArrayList();//上传的东西MapString, ListString 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{ListListString dataList PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行因为第一行是提示for(ListString data:dataList){//循环DictionaryEntity dictionaryEntity new DictionaryEntity();
// dictionaryEntity.setDicCode(data.get(0)); //字段 要改的
// dictionaryEntity.setDicName(data.get(0)); //字段名 要改的
// dictionaryEntity.setCodeIndex(Integer.valueOf(data.get(0))); //编码 要改的
// dictionaryEntity.setIndexName(data.get(0)); //编码名字 要改的
// dictionaryEntity.setSuperId(Integer.valueOf(data.get(0))); //父字段id 要改的
// dictionaryEntity.setBeizhu(data.get(0)); //备注 要改的
// dictionaryEntity.setCreateTime(date);//时间dictionaryList.add(dictionaryEntity);//把要查询是否重复的字段放入map中}//查询是否重复dictionaryService.insertBatch(dictionaryList);return R.ok();}}}}catch (Exception e){return R.error(511,批量插入数据异常请联系管理员);}}}