Design and Implementation of a Financial Management System for Textile Enterprises Based on SpringBoot and Vue

Introduction

In today's digital age, the efficient handling of information has become critical for enterprises and individuals alike. Traditional paper-based record systems no longer meet modern demands for rapid data transmission, storage, and retrieval. Therefore, developing a financial management system for textile companies is essential for improving the efficiency and accuracy of financial operations.

The system developed using Spring Boot and MySQL enables comprehensive management of financial data including personnel records, employee information, revenue and expenditure details, salary data, communication logs, and reimbursement records. This structured approach enhances data organization, facilitates easier access and analysis, and contributes to green office practices by reducing paper usage.

Development Environment

  • Language: Java
  • Framework: Spring Boot
  • JDK Version: JDK 1.8
  • Server: Tomcat 7
  • Database: MySQL 5.7
  • Database Tool: Navicat 11
  • IDE: Eclipse / MyEclipse / IntelliJ IDEA
  • Build Tool: Maven 3.3.9
  • Browser: Google Chrome

Access URLs:

  • Admin Panel: localhost:8080/project-name/admin/dist/index.html
  • Frontend Interface: localhost:8080/project-name/front/dist/index.html (Not required if not implemented)

Admin Credentials:

  • Username: admin
  • Password: admin

Technology Overview

Java

Java is an object-oriented programming language known for its robustness, security, and platform independence. It supports multithreading and encapsulation, making it ideal for enterprise-level applications. Key features include inheritance, polymorphism, and data abstraction which allow developers to create scalable and maintainable software solutions.

Spring Boot Framework

Spring Boot simplifies the setup and configuration of Spring applications by providing auto-configuration capabilities. It eliminates much of the boilerplate code typically associated with Spring projects and includes embedded servers for quick deployment. Additionally, it manages dependencies efficiently, avoiding version conflicts and ensuring stability.

MySQL Database

MySQL is a widely used relational database management system known for its speed, reliability, and ease of use. Its support for SQL makes it suitable for complex queries and data manipulation tasks. MySQL’s low redundancy, high data sharing capabilities, and built-in security mechanisms make it an excellent choice for storing bussiness-critical information.

System Functionality Demo

Core Code Snippets

package com.controller;

import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Map;
import java.util.HashMap;
import java.util.UUID;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;

@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController {
    @Autowired
    private ConfigService configService;

    @RequestMapping("/upload")
    @IgnoreAuth
    public R upload(@RequestParam("file") MultipartFile file, String type) throws Exception {
        if (file.isEmpty()) {
            throw new EIException("File upload cannot be empty");
        }
        String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
        File path = new File(ResourceUtils.getURL("classpath:static").getPath());
        if (!path.exists()) {
            path = new File("");
        }
        File upload = new File(path.getAbsolutePath(), "/upload/");
        if (!upload.exists()) {
            upload.mkdirs();
        }
        String fileName = new Date().getTime() + "." + fileExt;
        File dest = new File(upload.getAbsolutePath() + "/" + fileName);
        file.transferTo(dest);

        if (StringUtils.isNotBlank(type) && type.equals("1")) {
            ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
            if (configEntity == null) {
                configEntity = new ConfigEntity();
                configEntity.setName("faceFile");
                configEntity.setValue(fileName);
            } else {
                configEntity.setValue(fileName);
            }
            configService.insertOrUpdate(configEntity);
        }
        return R.ok().put("file", fileName);
    }

    @IgnoreAuth
    @RequestMapping("/download")
    public ResponseEntity<byte[]> download(@RequestParam String fileName) {
        try {
            File path = new File(ResourceUtils.getURL("classpath:static").getPath());
            if (!path.exists()) {
                path = new File("");
            }
            File upload = new File(path.getAbsolutePath(), "/upload/");
            if (!upload.exists()) {
                upload.mkdirs();
            }
            File file = new File(upload.getAbsolutePath() + "/" + fileName);
            if (file.exists()) {
                HttpHeaders headers = new HttpHeaders();
                headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
                headers.setContentDispositionFormData("attachment", fileName);
                return new ResponseEntity<>(FileUtils.readFileToByteArray(file), headers, HttpStatus.CREATED);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
    }
}
package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ForumEntity;
import com.entity.view.ForumView;
import com.service.ForumService;
import com.service.TokenService;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;

@RestController
@RequestMapping("/forum")
public class ForumController {
    @Autowired
    private ForumService forumService;

    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, ForumEntity forum, HttpServletRequest request) {
        if (!request.getSession().getAttribute("role").toString().equals("管理员")) {
            forum.setUserid((Long) request.getSession().getAttribute("userId"));
        }
        EntityWrapper<ForumEntity> ew = new EntityWrapper<>();
        PageUtils page = forumService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, forum), params), params));
        return R.ok().put("data", page);
    }

    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params, ForumEntity forum, HttpServletRequest request) {
        if (!request.getSession().getAttribute("role").toString().equals("管理员")) {
            forum.setUserid((Long) request.getSession().getAttribute("userId"));
        }
        EntityWrapper<ForumEntity> ew = new EntityWrapper<>();
        PageUtils page = forumService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, forum), params), params));
        return R.ok().put("data", page);
    }

    @IgnoreAuth
    @RequestMapping("/flist")
    public R flist(@RequestParam Map<String, Object> params, ForumEntity forum, HttpServletRequest request) {
        EntityWrapper<ForumEntity> ew = new EntityWrapper<>();
        PageUtils page = forumService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, forum), params), params));
        return R.ok().put("data", page);
    }

    @RequestMapping("/query")
    public R query(ForumEntity forum) {
        EntityWrapper<ForumEntity> ew = new EntityWrapper<>();
        ew.allEq(MPUtil.allEQMapPre(forum, "forum"));
        ForumView forumView = forumService.selectView(ew);
        return R.ok("Query successful").put("data", forumView);
    }

    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id) {
        ForumEntity forum = forumService.selectById(id);
        return R.ok().put("data", forum);
    }

    @IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id) {
        ForumEntity forum = forumService.selectById(id);
        return R.ok().put("data", forum);
    }

    @IgnoreAuth
    @RequestMapping("/list/{id}")
    public R list(@PathVariable("id") String id) {
        ForumEntity forum = forumService.selectById(id);
        getChilds(forum);
        return R.ok().put("data", forum);
    }

    private ForumEntity getChilds(ForumEntity forum) {
        List<ForumEntity> childs = new ArrayList<>();
        childs = forumService.selectList(new EntityWrapper<ForumEntity>().eq("parentid", forum.getId()));
        if (childs == null || childs.size() == 0) {
            return null;
        }
        forum.setChilds(childs);
        for (ForumEntity forumEntity : childs) {
            getChilds(forumEntity);
        }
        return forum;
    }

    @RequestMapping("/save")
    public R save(@RequestBody ForumEntity forum, HttpServletRequest request) {
        forum.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
        forum.setUserid((Long) request.getSession().getAttribute("userId"));
        forumService.insert(forum);
        return R.ok();
    }

    @RequestMapping("/add")
    public R add(@RequestBody ForumEntity forum, HttpServletRequest request) {
        forum.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
        forum.setUserid((Long) request.getSession().getAttribute("userId"));
        forumService.insert(forum);
        return R.ok();
    }

    @RequestMapping("/update")
    @Transactional
    public R update(@RequestBody ForumEntity forum, HttpServletRequest request) {
        forumService.updateById(forum);
        return R.ok();
    }

    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids) {
        forumService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }

    @RequestMapping("/remind/{columnName}/{type}")
    public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
                         @PathVariable("type") String type, @RequestParam Map<String, Object> map) {
        map.put("column", columnName);
        map.put("type", type);

        if (type.equals("2")) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            Calendar c = Calendar.getInstance();
            Date remindStartDate = null;
            Date remindEndDate = null;
            if (map.get("remindstart") != null) {
                Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
                c.setTime(new Date());
                c.add(Calendar.DAY_OF_MONTH, remindStart);
                remindStartDate = c.getTime();
                map.put("remindstart", sdf.format(remindStartDate));
            }
            if (map.get("remindend") != null) {
                Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
                c.setTime(new Date());
                c.add(Calendar.DAY_OF_MONTH, remindEnd);
                remindEndDate = c.getTime();
                map.put("remindend", sdf.format(remindEndDate));
            }
        }

        Wrapper<ForumEntity> wrapper = new EntityWrapper<>();
        if (map.get("remindstart") != null) {
            wrapper.ge(columnName, map.get("remindstart"));
        }
        if (map.get("remindend") != null) {
            wrapper.le(columnName, map.get("remindend"));
        }

        int count = forumService.selectCount(wrapper);
        return R.ok().put("count", count);
    }
}

Testing Results

The application was initially installed and tested on a local server. Subsequently, both white-box and black-box testing techniques were employed to ensure thorough validation of system functionality. These tests focused on verifying the system’s compliance with user requirements, identifying potential issues early in the development cycle, and applying Pareto principles to prioritize critical modules for testing.

Conclusion

Compared to existing financial management systems for textile enterprises, this solution offers enhanced functionality, ease of maintenance, and improved data handling capabilities. The use of Java ensures dynamic web pages with high maintainability, while Spring Boot provides a modular architecture that supports large-scale development. MySQL serves as a reliable backend with strong performance and scalability.

This project marks a significant milestone in my academic journey, offering valuable insights into full-stack development and system design. Continued learning and refinement will further enhance the system’s robustness and usability.

Tags: SpringBoot vue Financial Management Textile Enterprise MySQL

Posted on Wed, 04 Nov 2026 16:39:54 +0000 by sspoke