“This is the second day of my participation in the First Challenge 2022.

Preface:

With the progress of society and the development of science and technology, more and more people pursue novel and unique, practical living and working environment. Therefore, in today’s architectural decoration engineering, we should not only take into account the needs of customers and the coordination and unity of the building structure, but also take into account the cost and the arrangement of the construction organization, so modern decoration engineering is a relatively tedious but must do well. In addition to ensuring the quality and quantity of the work content, we also need to ensure the standard data of construction acceptance. Through a period of learning Java related development knowledge, WE have a basic understanding of various technological processes and characteristics in the construction process. Use JavaSpringboot+ LayUI to simply do a decoration acceptance management system, suitable for simple learning reference use.

Main design:

  1. The acceptance of water and electricity

Main functions:

(1) List query

Functions: Query, add, modify, delete, export.

Query fields: serial number, project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

(2) Business documents

Function: Add water and electricity assessment content

Operation fields: project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

  1. Bricklayer’s acceptance

(1) List query

Functions: Query, add, modify, delete, export.

Query fields: serial number, project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

(2) Business documents

Function: add bricklayer assessment content

Operation fields: project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

  1. Carpenter’s acceptance

(1) List query

Functions: Query, add, modify, delete, export.

Query fields: serial number, project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

(2) Business documents

Function: Add carpentry assessment content

Operation fields: project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

  1. Painter acceptance

(1) List query

Functions: Query, add, modify, delete, export.

Query fields: serial number, project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

(2) Business documents

Function: Add paint examination content

Operation fields: project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

  1. Completion acceptance

(1) List query

Functions: Query, add, modify, delete, export.

Query fields: serial number, project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

(2) Business documents

Function: Add the assessment content at the end of construction

Operation fields: project name, project type, project address, input person, input date, site leader, designer, supervisor, contract amount, construction date, end date, material brand, construction personnel, assessment result, remarks.

Function screenshots:

Administrator Login:

System Home page:

User management:

Role management:

Menu Management:

SQL monitoring:

Hydropower acceptance:

Data export:

Carpenter acceptance:

Change password:

Code implementation:

Decoration acceptance controller:


@RestController
@RequestMapping("/sys/ysWater")
public class YsWaterController extends AbstractController {
    @Autowired
    private YsWaterService ysWaterervice;

    @Autowired
    private YsWaterServiceImpl ysWaterServiceImpl;
    @RequestMapping("/waterList")
    public R waterList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Water and electricity Decoration Acceptance");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }
    @RequestMapping("/waterDjList")
    public R waterDjList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Hydropower Business Documents");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }

    @RequestMapping("/wgList")
    public R wgList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Bricklayer decoration acceptance");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }

    @RequestMapping("/wgDjList")
    public R wgDjList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Bricklayer business Document");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }

    @RequestMapping("/mgList")
    public R mgList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Acceptance of woodworking decoration");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }
    @RequestMapping("/mgDjList")
    public R mgDjList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Woodworking Business Document");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }
    @RequestMapping("/yqgList")
    public R yqgList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Painter decoration acceptance");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }

    @RequestMapping("/yqgDjList")
    public R yqgDjList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Painter's Business Document");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }
    @RequestMapping("/sgjsList")
    public R sgjsList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Completion of Construction acceptance");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }

    @RequestMapping("/sgjsDjList")
    public R sgjsDjList(@RequestParam Map<String, Object> params){
        params.put("ysType"."Construction Completion Business Document");
        PageUtils page = ysWaterervice.queryPage(params);
        return R.ok().put("page", page);
    }

    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        YsWater ysWater = ysWaterervice.getById(id);
        return R.ok().put("ysWater", ysWater);
    }
    @RequestMapping("/export")
    public R save(HttpServletResponse response, HttpServletRequest request){
        try {
            ysWaterServiceImpl.outExcelByMealOrReserve(getParametersMap(request),response);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return R.ok();
    }


    /** * assemble all parameters into Map *@return* /
    private   Map<String, String> getParametersMap(HttpServletRequest request) throws UnsupportedEncodingException {
        Map<String, String> map = new HashMap<String, String>();
        Enumeration<String> paramNames = request.getParameterNames();
        String encoding = request.getCharacterEncoding();
        while (paramNames.hasMoreElements()) {
            String paramName = paramNames.nextElement();

            String[] paramValues = request.getParameterValues(paramName);
            if (paramValues.length == 1) {
                String paramValue = paramValues[0];
                if(paramValue.length() ! =0) {
                    if(! encoding.toUpperCase().equals("UTF-8")) {
                        map.put(paramName, new String(paramValue.getBytes("ISO-8859-1"),"UTF-8"));
                    } else{ map.put(paramName, paramValue); }}}}return map;
    }

    @RequestMapping("/save")
    public R save(@RequestBody YsWater ysWater){
        ysWaterervice.save(ysWater);
        return R.ok();
    }
    @RequestMapping("/update")
    public R update(@RequestBody YsWater ysWater){
        ysWaterervice.updateById(ysWater);
        return R.ok();
    }
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        ysWaterervice.removeByIds(Arrays.asList(ids));
        returnR.ok(); }}Copy the code

User permission blocking and releasing:


/** * Shiro configuration file ** /
@Configuration
public class ShiroConfig {

    /** * Shiro manages sessions */
    @Bean
    @ConditionalOnProperty(prefix = "renren", name = "cluster", havingValue = "false")
    public DefaultWebSessionManager sessionManager(@Value("${renren.globalSessionTimeout:3600}") long globalSessionTimeout){
        DefaultWebSessionManager sessionManager = new DefaultWebSessionManager();
        sessionManager.setSessionValidationSchedulerEnabled(true);
        sessionManager.setSessionIdUrlRewritingEnabled(false);
        sessionManager.setSessionValidationInterval(globalSessionTimeout * 1000);
        sessionManager.setGlobalSessionTimeout(globalSessionTimeout * 1000);

        return sessionManager;
    }

    /** * Cluster environment, session to spring-Session management */
    @Bean
    @ConditionalOnProperty(prefix = "renren", name = "cluster", havingValue = "true")
    public ServletContainerSessionManager servletContainerSessionManager(a) {
        return new ServletContainerSessionManager();
    }

    @Bean("securityManager")
    public SecurityManager securityManager(UserRealm userRealm, SessionManager sessionManager) {
        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
        securityManager.setCacheManager(new EhCacheManager());
        securityManager.setRealm(userRealm);
        securityManager.setSessionManager(sessionManager);
        securityManager.setRememberMeManager(null);

        return securityManager;
    }


    @Bean("shiroFilter")
    public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
        ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean();
        shiroFilter.setSecurityManager(securityManager);
        shiroFilter.setLoginUrl("/login.html");
        shiroFilter.setUnauthorizedUrl("/");

        Map<String, String> filterMap = new LinkedHashMap<>();
        filterMap.put("/swagger/**"."anon");
        filterMap.put("/v2/api-docs"."anon");
        filterMap.put("/swagger-ui.html"."anon");
        filterMap.put("/webjars/**"."anon");
        filterMap.put("/swagger-resources/**"."anon");

        filterMap.put("/statics/**"."anon");
        filterMap.put("/login.html"."anon");
        filterMap.put("/sys/login"."anon");
        filterMap.put("/favicon.ico"."anon");
        filterMap.put("/captcha.jpg"."anon");
        filterMap.put("/ * *"."authc");
        shiroFilter.setFilterChainDefinitionMap(filterMap);

        return shiroFilter;
    }

    @Bean("lifecycleBeanPostProcessor")
    public LifecycleBeanPostProcessor lifecycleBeanPostProcessor(a) {
        return new LifecycleBeanPostProcessor();
    }

    @Bean
    public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) {
        AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor();
        advisor.setSecurityManager(securityManager);
        returnadvisor; }}Copy the code

Database design:

** database name: **renren_zxys

** Issue: **V1.0.0

** Document description: ** Decoration acceptance database table design description

Table SYS_config (System configuration information table)

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 id bigint 20 0 N Y
2 param_key varchar 50 0 Y N key
3 param_value varchar 2000 0 Y N value
4 status tinyint 4 0 Y N Status 0: Hidden 1: displayed
5 remark varchar 500 0 Y N note

Table SYS_DEPT

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 dept_id bigint 20 0 N Y
2 parent_id bigint 20 0 Y N ID of the upper department. The value of the primary department is 0
3 name varchar 50 0 Y N Department name
4 order_num int 10 0 Y N The sorting
5 del_flag tinyint 4 0 Y N Delete or not -1: deleted. 0: Normal

Table SYS_dict (data dictionary table)

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 id bigint 20 0 N Y
2 name varchar 100 0 N N Name of the dictionary
3 type varchar 100 0 Y N A dictionary type
4 code varchar 100 0 Y N The dictionary code
5 value varchar 1000 0 Y N A dictionary value
6 order_num int 10 0 Y N The sorting
7 remark varchar 255 0 Y N note
8 del_flag tinyint 4 0 Y N Delete the flag. -1: deleted. 0: Normal

Table SYS_log

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 id bigint 20 0 N Y
2 username varchar 50 0 Y N The user name
3 operation varchar 50 0 Y N The user action
4 method varchar 200 0 Y N Request method
5 params varchar 5000 0 Y N Request parameters
6 time bigint 20 0 N N Execution time (ms)
7 ip varchar 64 0 Y N The IP address
8 create_date datetime 19 0 Y N Creation time

Table SYS_menu (Menu Management)

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 menu_id bigint 20 0 N Y
2 parent_id bigint 20 0 Y N ID of the parent menu. The first-level menu is 0
3 name varchar 50 0 Y N The name of the menu
4 url varchar 200 0 Y N Menu URL
5 perms varchar 500 0 Y N Authorization (multiple users are separated by commas, for example,user: list,user:create)
6 type int 10 0 Y N Type 0: directory 1: menu 2: button
7 icon varchar 50 0 Y N The menu icon
8 order_num int 10 0 Y N The sorting

Table SYS_role

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 role_id bigint 20 0 N Y
2 role_name varchar 100 0 Y N Character name
3 remark varchar 100 0 Y N note
4 dept_id bigint 20 0 Y N Department ID
5 create_time datetime 19 0 Y N Creation time

Table SYS_ROLE_DEPT (Role and department mapping)

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 id bigint 20 0 N Y
2 role_id bigint 20 0 Y N Character ID
3 dept_id bigint 20 0 Y N Department ID

Table SYS_ROLE_MENU (Role and menu mapping)

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key The default value instructions
1 id bigint 20 0 N Y
2 role_id bigint 20 0 Y N Character ID
3 menu_id bigint 20 0 Y N Menu ids

Table SYS_user (system user)

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 user_id bigint 20 0 N Y
2 username varchar 50 0 N N The user name
3 password varchar 100 0 Y N password
4 salt varchar 20 0 Y N salt
5 email varchar 100 0 Y N email
6 mobile varchar 100 0 Y N Mobile phone no.
7 status tinyint 4 0 Y N Status 0: Disabled 1: Normal
8 dept_id bigint 20 0 Y N Department ID
9 create_time datetime 19 0 Y N Creation time

Table SYS_user_role (User and role mapping)

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 id bigint 20 0 N Y
2 user_id bigint 20 0 Y N The user ID
3 role_id bigint 20 0 Y N Character ID

Table ys_water

Serial number The name of the The data type The length of the Decimal places Allows null values A primary key instructions
1 id int 10 0 N Y
2 name varchar 255 0 Y N The project name
3 xm_type varchar 255 0 Y N Project type
4 xm_dizhi varchar 255 0 Y N The project address
5 username varchar 255 0 Y N Enter one
6 lr_time datetime 19 0 Y N Date of entry
7 gz_username varchar 255 0 Y N Site manager
8 sjs varchar 255 0 Y N The designer
9 jlry varchar 255 0 Y N Supervisory staff
10 money varchar 255 0 Y N
11 sg_time datetime 19 0 Y N
12 js_time datetime 19 0 Y N
13 clpp varchar 255 0 Y N Material brand
14 sg_username varchar 255 0 Y N Construction personnel
15 khjg varchar 255 0 Y N The results of the appraisal
16 remark varchar 255 0 Y N
17 ys_type varchar 255 0 Y N Type of acceptance (water, electricity, tile, wood, painter)

Personal Summary:

Through the recent mastery and learning of Java object-oriented programming, front-end knowledge and Java framework, as well as the development of this period of education and teaching system, I have learned more about the importance of Java learning. Which is in the development of the system, I finished the multiple management platform of the experiment and the plot management functional testing, phase of the study of system development, from I know to be familiar with Java, and then to independent use relevant technology, I found it really have a lot of convenience, such as Java collection of abstraction and encapsulation and inheritance and polymorphism in the integral whole, Realizing the functions of code reuse and code expansion, improving the speed and efficiency of the overall software development. Such as the administrator to add users to Java. Lang. NullPointException, solution: View console print information, find did not fill in the relevant information, when you add to Java. Lang NullPointException, through debugging found power user information is empty items of data, in the front you must fill in the user in the complete information or database setting field can be null can be solve, The main purpose of my study of programming is to improve my key skills and techniques in programming solutions to practical problems.

Source code:

Everyone likes, favorites, attention, comments, interested and I exchange

Clocked articles updated 178/365 days