当前位置:网站首页>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
边栏推荐
- php中的二维数组去重
- view的绘制机制(一)
- 使用MAME32K进行联机游戏
- Ceaspectuss shipping company shipping artificial intelligence products, anytime, anywhere container inspection and reporting to achieve cloud yard, shipping company intelligent digital container contr
- oracle-外币记账时总账余额表gl_balance变化(上)
- User login function: simple but difficult
- Oracle段顾问、怎么处理行链接行迁移、降低高水位
- Oracle EBS DataGuard setup
- ORACLE 11.2.0.3 不停机处理SYSAUX表空间一直增长问题
- @Transational踩坑
猜你喜欢
随机推荐
【调参Tricks】WhiteningBERT: An Easy Unsupervised Sentence Embedding Approach
Ingress Controller 0.47.0的Yaml文件
CRP实施方法论
ORACLE EBS接口开发-json格式数据快捷生成
Sqli-labs customs clearance (less18-less20)
【Torch】解决tensor参数有梯度,weight不更新的若干思路
php中树形结构转数组(拉平树结构,保留上下级排序)
Changes in foreign currency bookkeeping and revaluation general ledger balance table (Part 2)
实现接口 Interface Iterable&lt;T&gt;
2021-07-19c CAD secondary development creates multiple line segments
php中的数字金额转换大写数字
ssm超市订单管理系统
ssm人事管理系统
php中判断版本号是否连续
Sqli labs customs clearance summary-page2
使用 Compose 实现可见 ScrollBar
Yaml file of ingress controller 0.47.0
类加载器及双亲委派机制
離線數倉和bi開發的實踐和思考
读《敏捷整洁之道:回归本源》后感