Implementation of auto repair management system based on SSM (Spring+SpringMVC+MyBatis)+Android "Suggested collection: Attached complete source code + database"

Project name: Zhibaisheng Auto Repair Management System
Note: This project is only used as a learning case and for reference only.

1. Log in to the system

(1) Login information needs to be filled in by the user:
  • 1. Account number
  • 2. Password
  • 3. Verification code
  • 4. User type
(2) Login operations are strictly judged:
a: When the user directly clicks "Login" to log in without entering any information, the judgment will be based on the order of the input boxes:

Then the following prompts will be given:

  • 1. The username cannot be empty;
  • 2. The password cannot be empty;
  • 3. The verification code cannot be empty;
  • 4. Please select the user type!
b: When the user starts to enter information and clicks "Login" to log in, the judgment will be made again based on the order of the input boxes:

Then the following prompts will be given:

  • 1. Determine whether the user is correct;
  • 2. Determine whether the password is correct;
  • 3. Determine whether the verification code is correct;
  • 4. Determine whether the user type is correct.

If all the entered information is incorrect, a prompt will be given based on the judgment: and then the following prompts will be given:

  • 1. The user is incorrect;
  • 2. The password is incorrect;
  • 3. The verification code is incorrect;
  • 4. The user type is incorrect.

Only when all the information entered is correct can you successfully enter the "Smart Parkson Auto Repair and Auto Parts" management system.

The login page is shown below:

Insert image description here

2. Main page

After logging in to the main page, the screenshot of the main page is as follows:

Insert image description here

  1. The main page is set in the upper right corner to display the currently logged in user name (not the logged in account number, but the user name), login time (get the system time of the current login) and login duration (set session, automatic timing, no You need to refresh the page, and the login time will automatically increase)

Insert image description here

  2. Click the "Auto Repair Management" button on the left navigation bar to enter the auto repair management module. The screenshot of the page is as follows:

Insert image description here

3. "Appointment Scheduling" module

  · Appointment arrangement is mainly for the appointment registration of customers who need to come for car repair, and enter the basic information of the car owner, repair vehicle (if you are an old customer, you can directly import the information) and repair items.

  ♦ Register the license plate, car model, and car owner information to facilitate subsequent query of the car owner information.
  ♦Repair order number, repair category, amount, billing date and scheduled repair date, and person to pick up the vehicle.
  ♦Repair items (details), estimated accessories, other costs, notes, and insurance claims: It is convenient for maintenance personnel to pick up repair materials, as well as precautions during repair, as well as the handling of subsequent insurance claims.

  Then click the "Appointment Arrangement" button or icon to enter the appointment arrangement page to perform related operations. The screenshot of the page is as follows:

Insert image description here

  The functions that can be operated on this page include "Add", "Delete", "Save", "Print", "Query Document", "Transfer to Maintenance Order", "Audit", "De-Audit", and "Exit".

First, please take a look at the content on the appointment schedule page:

  Reservation order number: This order number is automatically generated (composed of capital letters BJ + year, month, day, hour and minute/yyMMdd HHmm + logged in account number + 0001), and then increases automatically according to the date of each day. The first order every day automatically starts from 0001 incrementally.

  Corresponding maintenance order number: It cannot be entered and is used for backfilling. It is generated automatically after the document is converted to a maintenance order.

  The billing date and scheduled maintenance date are both bound to the current system time. You can click the "Go!" button in the license plate text box, and then enter the license plate modal box. The page is as follows:
Insert image description here

  The data in this modal box is customer information. You can enter the basic information of the customer here, that is, the basic information of the new customer. You can also backfill and modify it after adding it (click any row in the table to backfill the data to (in the corresponding text box on the right), "Please enter the license plate number for quick search" is to query the license plate vaguely. You can enter the complete license plate number or a number to match the corresponding data vehicle to facilitate the operator's operation; then there is the "Select" button , this button is used to select and backfill the data in the table to the main page. It is also equivalent to double-clicking the data in the table to backfill. Here you can either select the "Select" button to operate or double-click the table to backfill. Both functions can be achieved. ;Then there is the "Add" button. This button is not really about adding new data, but when you click any row in the table, you can backfill the data into the corresponding text box on the right, and all the text The data in the box is cleared. To put it bluntly, it is a clear button; then there is the "Save" button, which can perform two operations. The first is to add data to the database, and the second is to modify the data. Be careful when coding here. Next is the "refresh" operation, which is to refresh the page and is ignored here. Finally, there is the "close" button. Click to close the modal box.

  PS: The customer number in the table on the right is also achieved by using the principle of automatically generating numbers. The bottom right corner is the "Modify check box" which is used to check and modify the data. The backfilled data cannot be modified if it is not checked. Only the Only when the check box is selected can the data be modified.

Now we click on a piece of data to backfill. The effect of backfilling to the page is as follows:

Insert image description here

The remaining text boxes and drop-down boxes require users to manually enter and select;

Next, the following is the operation of the detailed table:

  1. In the repair item details table: You can use the right button of the mouse to select "Add" and "Delete" operations. To add is to continue adding a row, and to delete is to delete from the last row;

Insert image description here

  After adding a row, just select the repair item drop-down box to bind other data, and then select the repair nature drop-down box. If changes need to be made, the table can also be edited, and you can modify it directly in the table.

Insert image description here

  2. In the product material details table: You can use the right button of the mouse to select the two operations of "Add" and "Delete". Add another product modal box and pop up another product modal box for the user to select the required product materials, as shown below, deletion is done from the last line delete data;

Insert image description here

  The product modal box can also perform fuzzy queries of multiple product types. The first choice is to select the drop-down box next to the quick search, select the corresponding data, and then enter the information matching the drop-down box in the text box next to the drop-down box to filter. You can also click on the product category catalog on the left to filter the corresponding data. If you filter out the required receipts, you can check (multiple) the check boxes in front of the corresponding data, and then click the "OK" button to backfill the product material details. In the form, if the data you are looking for does not meet your needs, you can click the "Add New" button to enter another modal box, and then you can enter the information you want in the modal box, or you can upload pictures, as shown below, and then proceed. Save, after the data is successfully added, it will refresh and appear in the product modal box, and then you can repeat the above operation to backfill.

Insert image description here

Insert image description here

  3. In the other expense details table: You can use the right button of the mouse to select "Add" and "Delete". To add is to continue adding a row, and to delete is to delete from the last row. After adding a row, you only need to select the drop-down box of the expense name. Bind other data. If changes need to be made, the table can also be edited. Just modify it directly in the table. As shown in the picture:

Insert image description here

  Then look at the operation of the "Query Document" button. The query document is the data saved from the main page just now. Click "Query Document" to pop up the document modal box, as shown in the figure:

Insert image description here

  In this modal box, you can perform fuzzy query of reservation number and matching query of the audit status drop-down box. Then you can double-click the form to backfill the data to the main page (or click the data and click the "OK" button to backfill). After backfilling, you can also backfill. You can perform "audit" and "anti-audit" operations on the main page;

The audited data is not allowed to be changed, as shown below,

Insert image description here

The data after de-auditing can be modified again, as shown below.

Insert image description here

4. "Customer Reception" Module

  Customer reception mainly involves registering customers who come for car repairs and basic repair information, and entering repair details for later inquiry.

  ♦ Registered license plate, vehicle model, factory mileage, fuel level, vehicle owner information, and engine number: to facilitate subsequent query of vehicle owner information.
  ♦Repair number, category, amount, date of entering the factory and settlement date, telephone number of the repairman: it is convenient for management personnel to contact the repairman to pick up the car at the corresponding time.
  ♦Repair items (details), estimated accessories, other costs, notes, and insurance claims: It is convenient for maintenance personnel to pick up repair materials, as well as precautions during repair, as well as the handling of subsequent insurance claims.

  Click the "Customer Reception" button or icon on the main page to enter the customer reception page to perform related operations. The screenshot of the page is as follows:

Insert image description here

  This page is also the basic information for registering maintenance customers, and then entering various details. For specific operations, please refer to the "Appointment Arrangement" module;

Then click "Query Document" to pop up the document modal box. As shown in the picture:

Insert image description here

This modal box records the data saved in it. Double-click the data to backfill the data, as shown in the figure:

Insert image description here

5. "Maintenance Dispatch" module

  Click "Transfer Work Order" in the "Customer Reception" module to bind the corresponding data, that is, backfill. Here, we will select the data after backfilling the document. After backfilling, just click "Transfer Work Order". The data on the "Customer Reception" page is bound, as shown in the figure:

Insert image description here

  On this page, you can also click "Assign Work" to continue adding detailed rows, one row at a time, or you can click the "Delete" button to delete. You can also click "Query Document" to enter the document modal box, as shown in the figure:

Insert image description here

  In this modal box, you can perform fuzzy query of maintenance order number, document status, payment drop-down box and license plate matching query, and then you can double-click the form to backfill the data to the main page.

6. "Maintenance Material Requisition Query" module

  To deal with the issue of accessories for vehicles sent for repair, you can check the materials received and returned for the vehicle sent for repair, as well as the information of the person who received the materials, for later settlement.

  Mainly query the information needed to repair the vehicle, and then perform the "picking" and "returning" operations on this page; when new data first comes to this page, the status of "not picked up" is displayed, as shown below:

Insert image description here

  Then those who have received materials are in the status of "Material Received", and those who have received materials are in the status of "Returned Materials". As shown in the figure:

Insert image description here

  On this page, you can perform fuzzy query for the time period. You can select the drop-down box of picking status and enter the license plate information to filter. For example, the time period query effect is as follows (query based on the settlement date, because it is the factory time after settlement):

Insert image description here

7. "Maintenance Material Picking" module

  Then if you need to pick materials, you can click the data row, click "Pick" to enter the "Maintenance Picking" module, as shown below:

Insert image description here

  When you click "Pick" to enter the "Maintenance Picking" module, the corresponding data in the data row you just clicked will be backfilled into the page. Then there are some empty text boxes and drop-down boxes that require you to enter data manually. Or choose, the gray text box cannot be input, you can get the backfill after saving, and then pay attention to the operation of the picker's input box: as shown in the figure:

Insert image description here

  This input box can either manually input data or select the drop-down box. Here, the drop-down box and text box are merged and operated at the same time to facilitate the user's operation when entering data;

  Then look at the content in the detail table: when it is time to enter this page, the detail table is empty. At this time, we can use the right mouse button to select "Add" and "Delete". Add another pop-up. A product modal box for users to select the required product materials (for details, please refer to the operation of the product material details table in the "Appointment Arrangement" module). Deletion is to delete data from the last row;
When the data After selecting backfill, as shown in the figure: you need to manually select the warehouse drop-down box and enter the position information.

Insert image description here

  Finally, take a look at the "Query Document" operation. Click "Query Document" to enter the query document modal box, as shown in the figure:

Insert image description here

  This modal box queries the vehicle information of maintenance customers who have received materials in the previous period. It can also be backfilled to the main page. Click the data row you selected, and then click the "OK" button to backfill the data to the main page. . As shown in the picture:

Insert image description here

8. "Maintenance Return" module

  The return operation is similar to the picking operation. They are both operated on the page in the "Maintenance Picking Query" module.

  When clicking "Return Materials", it will be judged based on the picking status in the data. If the material is not picked up, clicking "Return Materials" will prompt "The materials have not been picked yet and cannot be returned", as shown in the figure:

Insert image description here

  If the material has been returned, clicking "Return" will prompt "This data has been returned, please verify!", as shown in the figure:

Insert image description here

  Only when the material has been picked, click "Return Material" to enter the modal box for data selection, and then select the data to enter the "Maintenance Return" page. The modal box data is as shown in the figure:

Insert image description here

  This modal box displays the materials that have been collected in the selected document. At this time, which piece of material you need to return or all materials need to be returned, you only need to select the check box in front of the data and click "OK" to enter the "Repair Return" The return operation is performed on the "Materials" page.

For example: I selected all the materials in the modal box just now. After clicking OK, the materials just selected will be backfilled in the "Maintenance Return" page, as shown in the figure:

Insert image description here

  At this time, fill in the information in the text box such as the picker and then "save" to complete the return of materials. If you suddenly don't want to return all the materials, but only want to return one item, you can click "Delete Details" on this page to delete the details, starting from the last item, and only delete one item at a time; as shown in the figure:Insert image description here

Just delete it and then continue the saving operation.

9. "Completion Confirmation" Module

  After the repair of the vehicle sent for repair is completed, the vehicle needs to be inspected for factory quality inspection, and the completion review operation is performed in the "Completion Confirmation" module. As shown in the picture:

Insert image description here

  On this page, you can perform fuzzy queries on the billing time period (default is bound to the current system time, you can also click the text box to select the corresponding time period for operation), and you can select the completion status drop-down box to filter. For example, the time period query effect is as follows (query based on date)

Insert image description here

  The most important operations on this page are still the two operations of "Completion Confirmation" and "Cancel Completion"; in the data table, the orders that have not been confirmed to be completed are the orders for review, and the completion time is displayed as "0000-00-00" by default. ", and the document status is "Unsettled". At this time, you can click on the completion time of the row data to be "0000-00-00" to confirm the completion.

The data before completion confirmation is marked as shown in the figure:

Insert image description here

After completion confirmation, the data is marked as shown in the figure:

Insert image description here

  After clicking "Completion Confirmation", the completion time in the data will change from "0000-00-00" to the current system time; the document status will change from the original "Unsettled" to "Complete Unsettled". If there is completion confirmation, there must be completion cancellation. Select the data just now and click "Completion Cancel". At this time, the completion time in the data will change from the current system time to "0000-00-00"; the document status will change from "Complete to Unsettled" Change back to the original "unsettled".

The data before completion and cancellation are marked as shown in the figure:

Insert image description here

The data after completion and cancellation is marked as shown in the figure:

Insert image description here

  NOTE: There is time (2018-09-06). You cannot click "Completion Confirmation" like this: clicking will also give a prompt (completed documents do not need to be repeated!), as shown below:

Insert image description here

  And the completion time is (0000-00-00), you cannot click "Complete Cancel" like this: clicking will also give a prompt (uncompleted documents do not need to be repeated!), as shown below:

Insert image description here

10. "Settlement and Export" module

  The vehicles that have completed the review will be settled and shipped out of the factory. If the repair order involves a three-guarantee claim or insurance, the claim information needs to be filled in here. Click the "Settlement and Shipment" button or icon to enter the pre-settlement and factory page to perform related operations. The screenshot of the page is as follows:

Insert image description here

For specific function operations, please refer to the operation and use of the "Appointment Scheduling" module;

11: "Quick Car Repair" module

  The function of quick car repair is to solve the maintenance registration process that is not particularly complicated. If the auto repair shop does not have strict standards for front desk reception, maintenance dispatch, warehouse picking, maintenance order processing, financial settlement and other independent business positions, It can be solved through the quick repair function with the same window and integration.

  "Quick Car Repair" integrates "Customer Reception" to "Maintenance Material Requisition" to achieve the purpose of rapid car repair registration management.
The screenshot of the page is as follows:

Insert image description here

For specific functional operations, please refer to the operation and use of the "Customer Reception" module and "Maintenance Recruitment";

Part of the code display:

@ResponseBody
@RequestMapping(value = "/login", produces = "application/json")
public Object login(HttpServletRequest request, String userNumber, String password, Integer userTypeId,
		String validateCode) {
    
    
	String strsmg = "";
	JsonReturn jsonReturn = new JsonReturn();
	HttpSession session = request.getSession();
	Date date = new Date();// 获取当前时间的date对象
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	String strDate = dateFormat.format(date);
	// main登陆时间
	request.getSession().setAttribute("time", strDate);// ("自定义名,jsp接收",变量名)

	if (!"".equals(userNumber)) {
    
    
		if (!"".equals(password)) {
    
    
			if (!"".equals(validateCode)) {
    
    
				if (Integer.valueOf(userTypeId) != 0) {
    
    
					SysUser user = userService.findByUsernameAndPassword(userNumber);
					if (user != null) {
    
    
						request.getSession().setAttribute("yonghu", user);// main获取登陆用户,从数据库查出来//或者用下面精细到某个字段
						if (password.equals(user.getPassword())) {
    
    
							if (session.getAttribute("randomString").toString().equalsIgnoreCase(validateCode)) {
    
    
								if (Integer.valueOf(userTypeId).equals(user.getUsertypeid())) {
    
    
									strsmg = "seccess";
									jsonReturn.setState(true);
								} else {
    
    
									strsmg = "用户类型不正确!";
									jsonReturn.setState(false);
								}
							} else {
    
    
								strsmg = "验证码不正确!";
								jsonReturn.setState(false);
							}
						} else {
    
    
							strsmg = "密码不正确!";
							jsonReturn.setState(false);
						}
					} else {
    
    
						strsmg = "账户不正确!";
						jsonReturn.setState(false);
					}
				} else {
    
    
					strsmg = "请选择用户类型!";
					jsonReturn.setState(false);
				}
			} else {
    
    
				strsmg = "验证码不能为空!";
				jsonReturn.setState(false);
			}
		} else {
    
    
			strsmg = "密码不能为空!";
			jsonReturn.setState(false);
		}
	} else {
    
    
		strsmg = "账户不能为空!";
		jsonReturn.setState(false);
	}
	jsonReturn.setMsg(strsmg);
	return JSONSerializer.toJSON(jsonReturn);
}

Attached is Android related display page and code

Insert image description here
Insert image description here
Insert image description here

//文本-按钮 登陆 点击事件
btnSubmit.setOnClickListener(new View.OnClickListener() {
    
    
    @Override
    public void onClick(View v) {
    
    
        //获取参数
        String phone = etPhone.getText() == null ? null : etPhone.getText().toString();
        String smsValidCode = etSmsCode.getText() == null ? "" : etSmsCode.getText().toString();
        String password = etPassword.getText() == null ? null : etPassword.getText().toString();

        boolean isSmsLogin = llSms.getVisibility() == View.VISIBLE;

        if (phone==null || "".equals(phone.trim())){
    
    
            //Toast.makeText(mActivityContext, "手机号不能为空", Toast.LENGTH_LONG).show();
            //提示框居中显示
            Toast toast = Toast.makeText(getApplicationContext(), "手机号不能为空", Toast.LENGTH_SHORT);
            toast.setGravity(Gravity.CENTER, 0, 0);
            toast.show();
            return;
        }

        //验证数据
        if (!Tools.isMobile(phone)) {
    
    
            etPhone.setError("请输入正确的手机号");
            return;
        }
        //在短信登录的情况下验证 验证码
        if (isSmsLogin && !Tools.isNotNull(smsValidCode)) {
    
    
            etSmsCode.setError("请输入验证码");
            return;
        }
        //在密码登录情况下 验证密码是否为空
        if (!isSmsLogin && !Tools.isNotNull(password)) {
    
    
            etPassword.setError("请输入密码");
            return;
        }

        //发送请求url
        //String url = ServiceUrls.getMemberMethodUrl("UserController/appLogin");
        String url = isSmsLogin ? ServiceUrls.getMemberMethodUrl("UserController/loginBySms") : ServiceUrls.getMemberMethodUrl("UserController/appLogin");

        Map<String, Object> map = new HashMap<>();
        map.put("phone", phone);
        if (isSmsLogin) {
    
    
            map.put("smsValidCode", smsValidCode);
        } else {
    
    
            map.put("password", MD5Util.getMD5(password));
        }

        //发送请求
        OkHttpTool.httpPost(url, map, new OkHttpTool.ResponseCallback() {
    
    

            @Override
            public void onResponse(final boolean isSuccess, final int responseCode, final String response, Exception exception) {
    
    
                //需要更新UI,所有要在UI线程中执行
                mActivityContext.runOnUiThread(new Runnable() {
    
    
                    @Override
                    public void run() {
    
    
                        String strText = "无法访问服务器,请检查网络连接";
                        if (isSuccess && responseCode == 200){
    
    
                            try {
    
    
                                JSONObject jsonObject = new JSONObject(response);
                                //获取服务端数据
                                int code = jsonObject.getInt("code");
                                strText = jsonObject.getString("text");
                                if (code == 200) {
    
    
                                    String strData = jsonObject.getString("data");
                                    User user = gson.fromJson(strData, User.class);
                                    if (user != null) {
    
    
                                        //将用户信息保存到Application(内存)
                                        myApplication.setLoginUser(user);

                                        //将phone和Password存入SharedPreferences
                                        //!!!!*实际项目中避免这样做做,安全性不高
                                        SPUtils.put(mActivityContext, ServiceUrls.SP_USER_NUMBER, user.getUserNumber().trim());
                                        SPUtils.put(mActivityContext, ServiceUrls.SP_USER_PASSWORD, user.getPassword().trim());

                                        //Toast.makeText(mActivityContext, strText, Toast.LENGTH_LONG).show();
                                        //提示框居中显示
                                        Toast toast = Toast.makeText(getApplicationContext(), strText, Toast.LENGTH_SHORT);
                                        toast.setGravity(Gravity.CENTER, 0, 0);
                                        toast.show();

                                        Intent intent = new Intent(LoginActivity.this, MainActivity.class);
                                        startActivity(intent);
                                        finish();//关闭并销毁当前activity
                                    } else {
    
    
                                        strText = "登录失败";
                                    }
                                } else {
    
    
                                    //strText = "登录失败";
                                    //Toast.makeText(mActivityContext, strText, Toast.LENGTH_LONG).show();
                                    //提示框居中显示
                                    Toast toast = Toast.makeText(getApplicationContext(), strText, Toast.LENGTH_SHORT);
                                    toast.setGravity(Gravity.CENTER, 0, 0);
                                    toast.show();
                                }
                            } catch (JSONException e) {
    
    
                                e.printStackTrace();
                            }
                        }
                        //Toast.makeText(mActivityContext, strText, Toast.LENGTH_LONG).show();
                        //提示框居中显示
                        Toast toast = Toast.makeText(getApplicationContext(), strText, Toast.LENGTH_SHORT);
                        toast.setGravity(Gravity.CENTER, 0, 0);
                        toast.show();
                    }
                });
            }
        });
    }
});

Complete source code + database:Click to download

Guess you like

Origin blog.csdn.net/weixin_44563573/article/details/134324948