当前位置:网站首页>SSM supermarket order management system
SSM supermarket order 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
Supermarket order management system . The main functions include order management 、 Supplier management 、 User management and other functions ;
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 : no ; 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 :JSP+bootstrap+jQuery
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 applicationContext-jdbc.xml 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/ssm8/login Sign in ; among ss8 Is the project name , Customizable , But the following path must be /login;
Run a screenshot


Related codes
Index controller
@Controller
public class IndexController{
// User login processing interface
@RequestMapping("/userLoginGo")
public ModelAndView userLoginGo(User user,HttpSession session) {
ModelAndView mv =new ModelAndView();
mv.addObject("user",user);
session.setAttribute("userName","ddd");
mv.setViewName("success");
return mv;
}
// User login interface
@RequestMapping("/userLogin")
public String userLogin() {
return "userLogin";
}
@RequestMapping("/input")
public String input() {
return "input";
}
//@RequestMapping({"/index","/","/my"})
@RequestMapping(value="/index",method=RequestMethod.GET)
public String index(@RequestParam(value="username",required=false) String username,Model md) {
System.out.println("Hello SpringMVC");
md.addAttribute("username",username);
return "index";
}
@RequestMapping("/welcome")
public ModelAndView welcome(String username) {
ModelAndView mv=new ModelAndView();
mv.addObject("username",username);
mv.setViewName("welcome");
return mv;
}
}Supplier controller
@Controller
public class ProviderController {
// Introduce business layer resources
@Autowired
ProviderService proService;
// Add vendor handling
@RequestMapping("/providerAddGo")
public String providerAddGo(Provider provider,HttpSession session) {
Provider pro=new Provider();
pro=provider;
Integer uid=null;
uid=((User) session.getAttribute(Constants.USER_SESSION)).getId();
if(null!=uid) {
pro.setCreatedBy(uid);
if(proService.providerAdd(pro))
return "redirect:getProviders";
else
return "redirect:providerAdd";
}
else
return "redirect:login";
}
// Add supplier interface
@RequestMapping("/providerAdd")
public String providerAdd() {
return "providerAdd";
}
@RequestMapping("/getProviders")
public String getProviderList(String proName,Model md,String pageIndex) {
String strName="";
if(!StringUtils.isEmpty(proName)) {
strName=proName;
}
Integer currentPageNo=1;
Integer pageSize=Constants.pageSize;
if(!StringUtils.isEmpty(pageIndex)) {
currentPageNo=Integer.parseInt(pageIndex);
}
// Get the total number of records according to the conditions
Integer totalCount=proService.getProviderCount(strName);
// The calculation can be divided into several pages
PageHelper pages=new PageHelper();
pages.setCurrentPageNo(currentPageNo);
pages.setPageSize(pageSize);
pages.setTotalCount(totalCount);
int totalPageCount = pages.getTotalPageCount();
List<Provider> providers=proService.getProviderList(strName,(currentPageNo-1)*pageSize,pageSize);
md.addAttribute("totalPageCount", totalPageCount);
md.addAttribute("totalCount", totalCount);
md.addAttribute("currentPageNo", currentPageNo);
md.addAttribute("providers",providers);
return "providerList";
}
// Add / modify interface
@RequestMapping("/modifyProvider")
public String modifyProvider(String id,Model md) {
Provider provider=new Provider();
provider=proService.getProvider(id);
md.addAttribute("provider", provider);
return "modifyProvider";
}
// Modify supplier
@RequestMapping("/modifyProviderGo")
public String modifyProviderGo(Provider provider,HttpSession session) {
Integer oid=((User)session.getAttribute(Constants.USER_SESSION)).getId();
if(null!=provider) {
provider.setModifyBy(oid);
provider.setModifyDate(new Date());
proService.modifyProvider(provider);
}
return "redirect:getProviders";
}
// from ID Get information about a supplier
@RequestMapping("/viewProvider")
public String viewProvider(String id,Model md) {
Provider provider=new Provider();
provider=proService.getProvider(id);
md.addAttribute("provider", provider);
return "viewProvider";
}
// Delete supplier
@RequestMapping("deleteProviderById")
public String deleteProviderById(String id,Model md) {
String msg="";
if(proService.deleteProviderById(id)) {
msg=" Order deleted successfully !";
}else
msg=" Failed to delete order !";
md.addAttribute("msg", msg);
return "redirect:getProviders";
}
}
If you want to learn this system , Now get . reply :040ssm
边栏推荐
猜你喜欢

Proteus -- RS-232 dual computer communication

【信息检索导论】第一章 布尔检索

IDEA2020中测试PySpark的运行出错

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

Explain in detail the process of realizing Chinese text classification by CNN

Oracle EBS数据库监控-Zabbix+zabbix-agent2+orabbix

CSRF攻击

读《敏捷整洁之道:回归本源》后感

ssm垃圾分类管理系统

ERNIE1.0 与 ERNIE2.0 论文解读
随机推荐
UEditor . Net version arbitrary file upload vulnerability recurrence
TCP攻击
spark sql任务性能优化(基础)
php中的二维数组去重
Sqli-labs customs clearance (less18-less20)
SSM二手交易网站
Changes in foreign currency bookkeeping and revaluation general ledger balance table (Part 2)
【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization
SQL injection closure judgment
Pratique et réflexion sur l'entrepôt de données hors ligne et le développement Bi
Agile development of software development pattern (scrum)
Oracle segment advisor, how to deal with row link row migration, reduce high water level
Module not found: Error: Can't resolve './$$_ gendir/app/app. module. ngfactory'
矩阵的Jordan分解实例
Brief analysis of PHP session principle
软件开发模式之敏捷开发(scrum)
MySQL中的正则表达式
【信息检索导论】第七章搜索系统中的评分计算
MapReduce concepts and cases (Shang Silicon Valley Learning Notes)
【Ranking】Pre-trained Language Model based Ranking in Baidu Search