当前位置:网站首页>SSM garbage classification management system
SSM garbage classification management system
2022-07-02 07:19:00 【Night Weiyang 5788】
Author URI : In the middle of the night 5788
brief introduction :Java Quality creators in the field 、Java project 、 Learning materials 、 Technical assistance
Get the source code at the end of the article
Project introduction
The garbage classification management system adopts B/S Structure . The system administrator has the function of community management 、 Garbage classification information 、 Garbage station information 、 Garbage transportation information 、 Spam 、 Repair management , Complaint management and other functions . The interface of this system is simple and intuitive , Easy to operate and use , Strong interaction .
Environmental needs
1. Running environment : It is best to java jdk 1.8, We run on this platform . Other versions can, in theory .
2.IDE Environmental Science :IDEA,Eclipse,Myeclipse Fine . recommend IDEA;
3.tomcat Environmental Science :Tomcat 7.x,8.x,9.x All versions are available
4. Hardware environment :windows 7/8/10 1G Above memory ; perhaps Mac OS;
5. whether Maven project : yes ; See if the source directory contains pom.xml; If included , Then for maven project , Otherwise, it is not maven project
6. database :MySql 5.7 edition ;
Technology stack
1. Back end :Spring SpringMVC MyBatis
2. front end :HTML+CSS+Javascript+jQuery+bootstrap
Instructions
1. Use Navicat Or other tools , stay mysql Create a database with the corresponding name in , And import the sql file ;
2. In the project yml Change the database configuration in the configuration file to your own configuration
3. Use IDEA/Eclipse/MyEclipse Import the project ,Eclipse/MyEclipse Import time , if maven Item, please select maven;
if maven project , After importing successfully, please execute maven clean;maven install command , To configure tomcat, And then run ;
4. Run the project , Input localhost:8080/ Sign in
5. Account admin password 123123
Run a screenshot

Related codes
Log in to the controller
/**
*
* Login related
*/
@Controller
public class SysLoginController {
@Autowired
private Producer producer;
@Autowired
private SysUserService sysUserService;
@RequestMapping("captcha.jpg")
public void captcha(HttpServletResponse response) throws ServletException, IOException {
response.setHeader("Cache-Control", "no-store, no-cache");
response.setContentType("image/jpeg");
// Generate text verification code
String text = producer.createText();
// Generate image captcha
BufferedImage image = producer.createImage(text);
// Save to shiro session
ShiroUtils.setSessionAttribute(Constants.KAPTCHA_SESSION_KEY, text);
ServletOutputStream out = response.getOutputStream();
ImageIO.write(image, "jpg", out);
}
/**
* Sign in
*/
@ResponseBody
@RequestMapping(value = "/sys/login", method = RequestMethod.POST)
public R login(String username, String password, String captcha) throws IOException {
String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY);
System.out.println("== Verification Code =="+kaptcha);
System.out.println("==password=="+password);
System.out.println("==username=="+username);
if(!captcha.equalsIgnoreCase(kaptcha)){
return R.error(" The verification code is incorrect ");
}
if(password==null){
return R.error(" The password cannot be empty ");
}
try {
Subject subject = ShiroUtils.getSubject();
//sha256 encryption
password = new Sha256Hash(password).toHex();
System.out.println("==sha256 encryption ==="+password);
UsernamePasswordToken token = new UsernamePasswordToken(username, password);
subject.login(token);
} catch (UnknownAccountException e) {
return R.error(e.getMessage());
} catch (IncorrectCredentialsException e) {
return R.error(e.getMessage());
} catch (LockedAccountException e) {
return R.error(e.getMessage());
} catch (AuthenticationException e) {
return R.error(" Account verification failed ");
}
return R.ok();
}
/**
*/
@ResponseBody
@RequestMapping(value = "/sys/reg", method = RequestMethod.POST)
public R reg(String username, String password, String captcha) throws IOException {
// String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY);
// if(!captcha.equalsIgnoreCase(kaptcha)){
// return R.error(" The verification code is incorrect ");
// }
//sha256 encryption
SysUserEntity user = new SysUserEntity();
user.setUsername(username);
user.setPassword(password);
user.setStatus(1);
List<Long> roles = new ArrayList<>();
roles.add(1L);
user.setRoleIdList(roles);
this.sysUserService.save(user);
return R.ok();
}
/**
* sign out
*/
@RequestMapping(value = "logout", method = RequestMethod.GET)
public String logout() {
ShiroUtils.logout();
return "redirect:login.html";
}
}
User controller
/**
*
* System users
*
*/
@RestController
@RequestMapping("/sys/user")
public class SysUserController extends AbstractController {
@Autowired
private SysUserService sysUserService;
@Autowired
private SysUserRoleService sysUserRoleService;
/**
* List of all users
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params) {
// Query list data
Query query = new Query(params);
List<SysUserEntity> userList = sysUserService.queryList(query);
int total = sysUserService.queryTotal(query);
PageUtils pageUtil = new PageUtils(userList, total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil);
}
@RequestMapping("/list2")
public R list2(@RequestParam Map<String, Object> params) {
// Query list data
Query query = new Query(params);
List<SysUserEntity> userList = sysUserService.queryList(query);
return R.ok().put("list", userList);
}
/**
* Get the login user information
*/
@RequestMapping("/info")
public R info() {
return R.ok().put("user", this.sysUserService.queryObject(getUser().getUserId()));
}
/**
* Change the login user password
*/
@SysLog(" Change Password ")
@RequestMapping("/password")
public R password(String password, String newPassword) {
Assert.isBlank(newPassword, " New password cannot be empty ");
//sha256 encryption
password = new Sha256Hash(password).toHex();
//sha256 encryption
newPassword = new Sha256Hash(newPassword).toHex();
// Update the password
int count = sysUserService.updatePassword(getUserId(), password, newPassword);
if (count == 0) {
return R.error(" The original password is incorrect ");
}
// sign out
ShiroUtils.logout();
return R.ok();
}
@SysLog(" Modify personal information ")
@RequestMapping("/updateInfo")
public R updateInfo(@RequestBody SysUserEntity user) {
this.sysUserService.update(user);
return R.ok();
}
/**
* User information
*/
@RequestMapping("/info/{userId}")
public R info(@PathVariable("userId") Long userId) {
SysUserEntity user = sysUserService.queryObject(userId);
// Get the list of roles to which the user belongs
List<Long> roleIdList = sysUserRoleService.queryRoleIdList(userId);
user.setRoleIdList(roleIdList);
return R.ok().put("user", user);
}
/**
* Save the user
*/
@SysLog(" Save the user ")
@RequestMapping("/save")
public R save(@RequestBody SysUserEntity user) {
ValidatorUtils.validateEntity(user, AddGroup.class);
user.setCreateUserId(getUserId());
sysUserService.save(user);
return R.ok();
}
/**
* Modify the user
*/
@SysLog(" Modify the user ")
@RequestMapping("/update")
public R update(@RequestBody SysUserEntity user) {
ValidatorUtils.validateEntity(user, UpdateGroup.class);
user.setCreateUserId(getUserId());
sysUserService.update(user);
return R.ok();
}
/**
* Delete user
*/
@SysLog(" Delete user ")
@RequestMapping("/delete")
public R delete(@RequestBody Long[] userIds) {
if (ArrayUtils.contains(userIds, 1L) || ArrayUtils.contains(userIds, -1L)) {
return R.error(" The system administrator cannot delete ");
}
if (ArrayUtils.contains(userIds, getUserId())) {
return R.error(" The current user cannot delete ");
}
sysUserService.deleteBatch(userIds);
return R.ok();
}
}
If you want to learn this system , Now get . reply :030ssm
边栏推荐
- 【论文介绍】R-Drop: Regularized Dropout for Neural Networks
- 搭建frp进行内网穿透
- ORACLE 11G利用 ORDS+pljson来实现json_table 效果
- User login function: simple but difficult
- 类加载器及双亲委派机制
- Oracle RMAN semi automatic recovery script restore phase
- Yolov5 practice: teach object detection by hand
- 【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization
- php中删除指定文件夹下的内容
- Oracle EBs and apex integrated login and principle analysis
猜你喜欢

Changes in foreign currency bookkeeping and revaluation general ledger balance table (Part 2)

CAD secondary development object

Message queue fnd in Oracle EBS_ msg_ pub、fnd_ Application of message in pl/sql

2021-07-05C#/CAD二次开发创建圆弧(4)

Sqli labs customs clearance summary-page2

SSM学生成绩信息管理系统

ssm人事管理系统

Sqli labs customs clearance summary-page4

ORACLE EBS 和 APEX 集成登录及原理分析

软件开发模式之敏捷开发(scrum)
随机推荐
ORACLE 11.2.0.3 不停机处理SYSAUX表空间一直增长问题
php中的二维数组去重
php中生成随机的6位邀请码
【模型蒸馏】TinyBERT: Distilling BERT for Natural Language Understanding
ORACLE EBS中消息队列fnd_msg_pub、fnd_message在PL/SQL中的应用
优化方法:常用数学符号的含义
ERNIE1.0 与 ERNIE2.0 论文解读
ssm超市订单管理系统
Three principles of architecture design
Data warehouse model fact table model design
图解Kubernetes中的etcd的访问
IDEA2020中测试PySpark的运行出错
Practice and thinking of offline data warehouse and Bi development
Alpha Beta Pruning in Adversarial Search
Principle analysis of spark
ORACLE EBS ADI 开发步骤
读《敏捷整洁之道:回归本源》后感
Ingress Controller 0.47.0的Yaml文件
Sqli Labs clearance summary - page 2
oracle EBS标准表的后缀解释说明