Design and implementation of Langtu automobile store management system based on SSM framework

Design and implementation of Langtu automobile store management system based on SSM framework

โœŒ20W+ fans on the whole network, csdn invited author, blog expert, CSDN Rising Star Program Mentor, high-quality creator in java field, blog star, high-quality author on Nuggets/Huawei Cloud/Alibaba Cloud/InfoQ and other platforms, focusing on Java technology field and graduation project practiceโœŒ

๐Ÿ…Get the project download method at the end of the article๐Ÿ…

1. Project background introduction:

The concept of car beauty has entered China for more than ten years, and the ways of car beauty have gradually developed in various ways. The foothold of many 4S stores in China also shows that the auto beauty industry has officially entered a mature development period. It has to be said that China's auto market is very large. Thanks to China's rapid economic development, people's living standards are improving day by day. Many big cities have realized that cars are a must-have for families, and even many Every family has more than one car. There are more cars, so car stores also appear in all parts of our country like bamboo shoots after spring.
The automotive service industry is considered a relatively good "industry". The main reason is that this industry is a product of the rapid development of social economy, and it is a new type of industry formed according to the increase in car ownership. So what is the after-sales service market for the hot cars? The car after-sales service market can be understood in this way. After you buy a car, if you want to make the interior of the car more beautiful, then the store can help you solve this problem. From a macro point of view, in fact, there are all service stores after buying a car that can help you solve your needs. However, since my country's auto after-sales service market is actually just in its infancy, it is in an extremely unstable state. There will definitely be a fierce competition in the next few years, and the ending after reshuffle is the beginning of the real auto service industry. At that time, the stores that can "survive" through these competitions must be those who know how to use information management technology to operate. Because only those stores that will seize the opportunity can strategize.
Although China's Internet technology has developed relatively well in recent years, compared with those developed countries in the West, there is still a little gap. The reason is that those countries in Europe and the United States mainly advocate the O2O model. This model is actually taking advantage of the advantages of the Internet in today's society and using real information to manage stores. Let the store truly be "unmanaged". The application of the O2O model in China is still relatively small. In fact, many Chinese auto stores are still operating in a purely offline manner. This mode of operation is actually not in line with the current development situation, after all, it belongs to the era of information technology. If a store is a purely offline model, when faced with a huge amount of information, there is no way to manage it manually. Faced with this situation, we can actually learn from the practices of those European and American countries, use databases to access these information, take advantage of the Internet age, and use a fully functional, lightweight, and capable of handling large amounts of data for car store management System to manage stores, so as to truly realize mechanized management and make the operation of auto stores more convenient and advanced.

2. Technical introduction of the project:

  1. JAVA: Java is an object-oriented programming language. It not only absorbs various advantages of the C++ language, but also abandons concepts such as multiple inheritance and pointers that are difficult to understand in C++. Therefore, the Java language has two characteristics: powerful and easy to use. As a representative of the static object-oriented programming language, the Java language perfectly implements the object-oriented theory and allows programmers to perform complex programming in an elegant way of thinking.
  2. Spring: The Spring framework is an open source J2EE application framework initiated by Rod Johnson and is a lightweight container for bean lifecycle management. Spring solves many common problems encountered by developers in J2EE development, and provides powerful functions such as IOC, AOP and Web MVC. Spring can be used alone to build applications, and can also be used in combination with many Web frameworks such as Struts, Webwork, and Tapestry, and can be combined with desktop application AP s such as Swing. Therefore, Spring can be applied not only to J2EE applications, but also to desktop applications and applets. The Spring framework is mainly composed of seven parts, namely Spring Core, Spring AOP, Spring ORM, Spring DAO, Spring Context, Spring Web and Spring Web MVC.
  3. Mybatis: MyBatis was originally iBatis, an open source project of apache. In 2010, this project was migrated from apache software foundation to google code and renamed MyBatis. Migrated to Github in November 2013.
    The word iBATIS comes from the combination of "internet" and "abatis", which is a Java-based persistence layer framework. The persistence layer framework provided by iBATIS includes SQL Maps and Data Access Objects (DAOs).
  4. Bootstrap: Bootstrap is a concise, intuitive, and powerful front-end development framework based on HTML, CSS, and JavaScript developed by Mark Otto and Jacob Thornton, designers of Twitter in the United States, making Web development faster. Bootstrap provides elegant HTML and CSS specifications, which are written in the dynamic CSS language Less. Bootstrap has been very popular since its launch and has always been a popular open source project on GitHub, including NASA's MSNBC (Microsoft National Broadcasting Company)'s Breaking News. Frameworks familiar to some mobile developers in China, such as the WeX5 front-end open source framework, are also based on Bootstrap source code for performance optimization.
  5. Html: The full name of HTML is Hypertext Markup Language, which is a markup language. It includes a series of tags. Through these tags, the document format on the network can be unified, and the scattered Internet resources can be connected into a logical whole. HTML text is a descriptive text composed of HTML commands, which can explain text, graphics, animations, sounds, tables, links, etc.
    Hypertext is a way of organizing information. It associates text, graphics and other information media in the text through hyperlinks. These interrelated information media may be in the same text, or may be other files, or files on a computer located at a geographically distant location. This way of organizing information connects information resources distributed in different locations in a random way, providing convenience for people to search and retrieve information.

3. Introduction of system function modules:

4. Database design:

1: Administrator table

field nametypeDefaultscolumn comment
idbigint(20)NULLprimary key ID
nick_namevarchar(50)NULLNick name

2: Accessories list

field nametypeDefaultscolumn comment
idbigint(20)NULLprimary key ID
parts_namevarchar(50)NULLParts name
pricevarchar(10)NULLunit price
stockint(20)NULLin stock
current_stockint(20)NULLCurrent inventory

3: Accessories classification

field nametypeDefaultscolumn comment
idbigint(20)NULLprimary key ID
parts_type_namevarchar(255)NULLAccessories classification

4: Service item table

field nametypeDefaultscolumn comment
idbigint(20)NULLprimary key ID
subscribe_idbigint(20)NULLAppointment Form ID
user_idbigint(20)NULLUser ID
contenttextNULLMain service content
typeint(3)NULLItem Category [1: Car Beauty

5: User appointment form

field nametypeDefaultscolumn comment
idbigint(20)NULLprimary key ID
user_idbigint(20)NULLUser ID
su_infotextNULLappointment content
statusint(3)NULLAppointment Status [1: Appointment in progress

6: Supplier table

field nametypeDefaultscolumn comment
idbigint(20)NULLprimary key ID
supplier_namevarchar(50)NULLSupplier name
supplier_typevarchar(50)NULLSupplier category
supplier_localtionvarchar(255)NULLSupplier's address
supplier_boss_namevarchar(50)NULLSupplier Contact Name
supplier_telvarchar(20)NULLcontact number

7: Item Accessories List

field nametypeDefaultscolumn comment
idbigint(20)NULLprimary key ID
parts_idbigint(20)NULLAccessory ID
use_numint(20)NULLusage amount
projects_idbigint(20)NULLMaintenance item ID

8: User table (users)

field nametypeDefaultscolumn comment
idbigint(20)NULLprimary key ID
nick_namevarchar(50)NULLNick name

5. Functional modules:

  1. The function realization of the front page: when you click to make an appointment now, the modal box of the appointment information will pop up. The appointment information includes name, phone number, reserved store (you can select from the drop-down), reserved business (select from the drop-down), and the reservation information time and notes. After clicking OK to make an appointment, the user will be prompted that the appointment is successful. After clicking ok, you can return to the store home page.

  2. Realization of the login page function: When the input account does not exist or the password is wrong, it will prompt that the account or password is wrong. When the entered account password is correct, it will jump to the employee information page and display the currently logged in user name in the menu bar

  3. Realization of employee page functions: when you click Add/Edit, you will jump to the edit page. When the entered information does not meet the conditions, it will not be allowed to be saved.
    When you click to export the employee table, a table containing all employee information will be directly generated and returned to the user.
    When the import button is clicked, the template will be downloaded and the selected file will be downloaded. The user can download the template, then fill in the employee data in the template form, and then select the file just written. After clicking Save, it will jump back to the employee information page.

  4. Realization of permission page function: Because the code of the system may be changed, it is necessary to provide a button on the page to synchronize the permission expression with the database permission expression. Click the reload button, and you will be prompted whether to reload the permissions. After clicking OK, the permissions page will be updated.

  5. Implementation of the announcement page function: when the view button is clicked, the corresponding read status will be changed to read. And it will jump to the page to view the announcement.
    When you click the Publish button, the status will change to Published, and the announcement page will be refreshed at the same time.

  6. Realization of the store information page function: When you click Edit, you will enter the information editing page, and there is a button to view the attachment. When you click this button, the store's business license photo will be opened. A file can be selected to be uploaded as a photo of the business license.

  7. Realization of the reservation information page function: when clicking to confirm the reservation, the status of the reservation form will change to fulfilling. When you click Cancel Appointment, the status of the Appointment Form will change to Obsolete.

6. Code example:

Functional realization of the front page
   * Show front-end page method
   * @param model
   * @return
  public String index(Model model){
    //Get all data dictionaries
   //Get the main store object
    Business business = businessService.getBymainStore(true);
    //Get all store information
    List<Business> businesses = businessService.listAll();
    return "index";
Implementation of login page functionality
public class LoginController {

  private IEmployeeService employeeService;

  public JsonResult empLogin(String username,String password){
    try {
       UsernamePasswordToken token = new UsernamePasswordToken(username,password);
       return new JsonResult();
    }  catch (UnknownAccountException e) {
      return new JsonResult(false, "Account does not exist");
    } catch (IncorrectCredentialsException e) {
      return new JsonResult(false, "wrong password");
    } catch (Exception e) {
      return new JsonResult(false, "Login is abnormal, please contact the administrator");
Realization of employee page functions
public class CheckLoginInterceptor implements HandlerInterceptor {

  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
      throws Exception {

      if (handler instanceof HandlerMethod){
        //All intercepted requests are requests for dynamic resources
        //Determine whether there is a login, if there is a release, if there is no jump to the login page
        Object emp = request.getSession().getAttribute(UserContext.USER_IN_SESSION);
        if (emp == null){
          return false;

    return true;
Realization of permission page function
 public void reload() {
        //1. Check out all the permission information of the database at one time.
        List<Permission> permissions = permissionMapper.selectAll();
        //2. Create a set collection to store permission expressions
        Set<String> expressionSet = new HashSet<>();
        for(Permission p:permissions){
            //3. Add all permission information to the collection
        //Get all the RequiredPermission annotations, take out the name and expression on the annotations,
        // Encapsulate it as Permission and save it in the database
        //HandlerMethod represents a method reference for each control
        Map<RequestMappingInfo, HandlerMethod> handlerMethods = rmhm.getHandlerMethods();
        Collection<HandlerMethod> values = handlerMethods.values();
        for(HandlerMethod method:values){
            // Get method annotations
            RequiresPermissions annotation = method.getMethodAnnotation(RequiresPermissions.class);
            // There are our custom permission annotations on the method
            if (annotation != null) {
                // Get method annotation name and expression value
                String name = annotation.value()[1];
                String expression = annotation.value()[0];
                // Make a judgment before storing it in the database, if it does not exist in the database, store it
                if(!expressionSet.contains(expression)) {
                    Permission permission = new Permission();
Realization of announcement page function
    public Notice get(Long id) {
        Notice notice = noticeMapper.selectByPrimaryKey(id);
        //When clicking to view, the intermediate table inserts data
        return notice;
Realization of store information page function
 @RequiresPermissions(value = {"business:saveOrUpdate","store editor"}, logical = Logical.OR)
    public String saveOrUpdate(Business business, MultipartFile file) throws Exception {
     if (file != null && file.getSize()>0) {
         //Handle uploaded operations
         String realPath = servletContext.getRealPath("/");
         //If it exists, upload it when editing and delete the previous one
         if (StringUtils.hasText(business.getLicenseImg())) {
             //Spell out the deleted path
             String deletePath = realPath + business.getLicenseImg();
         String filePath = FileUploadUtil.uploadFile(file, realPath);
        if (business.getId() == null) {
        } else {
        return "redirect:/business/list";
Realization of reservation information page function
//Modify the reservation status function
    public String updateStatus(Long id ,Integer status){
        return "redirect:/appointment/list";

void updateStatus(@Param("id") Long id, @Param("status") Integer status);

<update id="updateStatus">
    update appointment
    set status = #{status}
    where id = #{id}

7. Paper reference:

8. Project summary:

During this graduation project, I learned a lot of new technologies. In the past, when Baidu developed technology, I always felt that it would be good to understand these things. Isn't it something that can be easily grasped by then? Through the development of this graduation design project, I really realized that if you just understand a technology, then you can only tell the main points of the technology, and if you really implement it, you will find that it is more difficult than reaching the sky. In fact, computer knowledge focuses on practice. Only when you are really familiar with these technologies can you be said to understand them.
However, since it is the first time to manually develop a complete set of projects based on the SSM framework, there are still many system problems. For example, on the selection of front-end pages, I use the template pages of various framework technologies; the design of tables in the database may also have the problem of disordered relationships. But in this development process, I also gained a lot of development experience that I didn't have before. Have a deeper understanding of Bootstrap, Jquery, Freemarker, mybatis and other frameworks or technologies. It also laid a solid foundation for my study, life and work after graduation.
The biggest gain in this design is not the mastery of technology, but the understanding that the development of a project must be well planned. You can't be clueless like a headless fly. Only by planning the entire process of the project in detail, recording it with documents, and then realizing the requirements of the project step by step can the system come to life. The development process will not be smooth sailing. When encountering system problems, I have benefited from this development from being helpless before to being calm now. Now when I encounter problems, I will first analyze the process of the system, and then analyze the logic of the code implementation according to the process. If I can't solve it, I will use the power of Baidu. When the problem is very difficult, I will choose to ask Bi She’s tutor, Mr. Zhou Shaobo, for help. I think we should have this kind of attitude when working after graduation, so that we can really develop the project well.
The projects made in this graduation design may not be able to meet the real enterprise requirements, and there is still a certain gap with the real practical application. The reason is that the collected information is not sufficient, the understanding of the actual situation is not deep enough, and the analysis of the system is not thorough enough. But with this development experience, I believe that I can avoid many detours in the future development road, and can also develop a project system that can really be applied in real life.

9. Source code acquisition:

Everyone like, favorite, follow, comment, view ๐Ÿ‘‡๐Ÿป๐Ÿ‘‡๐Ÿป๐Ÿ‘‡๐ŸปGet contact information๐Ÿ‘‡๐Ÿป๐Ÿ‘‡๐Ÿป๐Ÿ‘‡๐Ÿป

Click on the link to go directly to: download link

Tags: Java programming language

Posted by skeetley on Tue, 21 Feb 2023 02:22:11 +1030