武汉君耐营销策划有限公司员工信息管理系统pf

news2024/9/19 15:48:40

@TOC

springboot428武汉君耐营销策划有限公司员工信息管理系统pf

第1章 绪论

1.1 研究背景

互联网概念的产生到如今的蓬勃发展,用了短短的几十年时间就风靡全球,使得全球各个行业都进行了互联网的改造升级,标志着互联网浪潮的来临。在这个新的时代,各行各业都充分考虑互联网是否能与本行业进行结合,是否能解决本行业或者本行业中某些方面的自古以来的痛点。长期以来,数据内容,数据传播,数据储存等都是一门门专业的内容,因为需要记住的内容很多,造成古人的言简意赅,如今互联网的到来让数据更加的清晰好认不复杂,一目了然不出错,毕竟在整个历史上数据的丢失,传承的断代,都是因为数据不能好好的保存,不能好好的流传。当年的年代用互联网思维和互联网技术,对大量数据的录入更新,存储汇总,备份分析方面,使得远远的超过传统的数据管理技术。在这样的时代潮流下,采用新技术开发新软件,对传统行业进行革命性的改造成为了当今的主流。本次开发武汉君耐营销策划有限公司员工信息管理系统,解决了员工信息管理关于数据方面的管理分析,存储传输的痛点,不仅仅对管理员提供了便利,还能提高用户的满意度。

1.2目的和意义

此次武汉君耐营销策划有限公司员工信息管理系统的开发,需要用到的知识不仅涉及到界面设计与功能设计方面的知识,还需要涉及到数据库与编程语言上面的知识,这些知识点对于一个即将毕业的学生来说,一是为了巩固在校所学相关专业知识;二是为了让学生学会如何将专业理论知识运用于现实软件的开发过程;三是让学生明白知识是无穷无尽的,要时刻明白活到老学到老的真正含义,让学生要养成时刻学习的习惯,同时也要相信通过此次程序的开发,会让学生对于专业知识的理解与软件开发水平的提高有着极大的帮助。

1.3 论文研究内容

论文设计的结构也是依照程序开发的流程进展的,也涉及到功能需求分析,功能设计与实现,程序测试等流程。

绪论:讲解课题的背景与意义,展示论文结构。

程序开发技术:讲解程序运用到的工具与技术知识。

系统分析:讲解程序的功能需求与开发可行性问题。

系统设计:讲解程序的功能与数据库的设计。

系统实现:讲解程序功能与界面实现。

系统测试:讲解程序的功能测试。

第2章 程序开发技术

2.1 Mysql数据库

开发的程序面向用户的只是程序的功能界面,让用户操作程序界面的各个功能,那么很多人就会问,用户使用程序功能生成的数据信息放在哪里的?这个就需要涉及到数据库的知识了,一般来说,程序开发通常就会对常用数据存储工具的特点进行分析比对,比如Mysql数据库的特点与优势,Access数据库的特点与优势,Sqlserver数据库的特点与优势等,最终看哪个数据库与需要开发的程序比较匹配,也符合程序功能运行需要的数据存储要求,比如,需要开发商业级别的程序,存储的数据对数据库要求较高,可以选用Oracle,如果只是比较简单的程序,对数据存储没有过多要求,可以选用微软旗下的Access,当开发程序要求数据库占用空间小,并能满足程序数据存储要求时,就可以考虑Oracle公司从瑞典MySQL AB公司在很早之前就收购过一个关系型数据库,它是现在的Mysql数据库。

为了更容易理解Mysql数据库,接下来就对其具备的主要特征进行描述。

(1)首选Mysql数据库也是为了节省开发资金,因为网络上对Mysql的源码都已进行了公开展示,开发者根据程序开发需要可以进行下载,并做一些改动就可以使用在程序中,可以推动开发者开发此程序的开发进度。

(2)SQL数据语言在Mysql里面也同样适用

(3)Mysql不仅可以支持多种编程语言,比如在校期间学到的C语言,Java语言,以及课后接触的PHP语言,C++语言等编程语言,它都能很好的支持,而且Mysql的安装与使用还不挑剔使用平台。

(4)Mysql可以支持具有千万条数据记录的数据库,电脑操作系统在进行首次安装或者是重装时,可以根据需要选择安装32位或64位操作系统,这两种操作系统对表文件的支持力度不一样,32位的操作系统最多可以存放4GB的表文件,64位操作系统最多可以存放8TB的表文件。

(5)Mysql数据库可以通过GPL协议进行个性化定制,需要开发者自己对数据库的源代码进行修改,以此开发出属于自己的Mysql。

2.2 Java语言

程序开发语言有很多,但是截至目前,Java语言在IT领域内,仍然是最被认可,以及被广泛运用的编写语言之一,因此在选择此程序的编写语言上,果断选择这门编程语言进行程序开发。可以说经过了这么多年的发展,Java语言不仅在Web开发领域有了突出性贡献,而且在大数据开发领域以及Android开发领域都得到了广泛运用。由于Java语言拥有较强的扩展性能,并且表现出的稳定性能,让其成为大型后端系统开发语言首选,现如今,Java语言也成为了一种常用的互联网平台的解决方案。

作为一种源码在网络上开源的面向对象的程序开发Java语言,由它开发完成的程序是不可能直接运行在各大平台的,Java程序的运行,需要在操作平台上配置其运行的环境,包括数据库软件与Java程序开发软件等工具的安装与配置。在Win7,Win10或其它操作平台上配置Java程序运行环境,只要环境配置成功,Java程序都可以运行起来。

第3章 系统分析

在进行系统分析之前,需要从网络上或者是图书馆的开发类书籍中收集大量的资料,因为这个环节也是帮助即将开发的程序软件制定一套最优的方案,一旦确定了程序软件需要具备的功能,就意味着接下来的工作和任务都是围绕着这个方案执行的,所以系统分析需要对程序功能反复进行思考和研究。

3.1可行性分析

开发一款系统软件之前,用户都会思考这个软件程序值不值得去开发,把开发软件过程中可能涉及到的问题罗列出来,并一个个分析解决,以此来确定开发这款程序软件是否有必要,这样的分析方法也能帮助用户降低损失,不至于开发者开发进度进行到一半之后,突然遇到问题就放弃对软件的开发,到那时,资金损失,人力投入等方面就损耗太大了。

3.1.1技术可行性分析

此次开发程序使用到的开发工具有:Eclipse,Mysql等工具,使用的开发语言是Java,选择的开发工具和开发语言都是在大学课堂接触并学习过,后期因为自己也比较感兴趣,所以也通过网络渠道,或借助图书馆的开发类书籍进行过软件开发知识的系统学习,让自己有了一定的知识积累,加上自己在校期间也独立开发过一些软件作品,也积累了一定的开发经验,所以这次毕设作品的制作在技术上无须担忧过多。

3.1.2经济可行性分析

目前的信息时代,对信息的管理趋于高效化,便捷化,这也是计算机大力普及所带来的便利,此程序软件在设备选用上,依靠的是比较大众的电脑设备,对电脑的配置没有过多要求,一般学校的计算机机房的电脑都可以满足程序开发需求,另外,开发出此款程序,让信息处理变得高效率,其所带来的高效益是远超程序开发的低成本的,因此程序开发的资金投入是可以忽略不计的。

3.1.3操作可行性分析

程序软件的操作界面是符合大众审美的需求,功能模块的布局也是类似于社会上同种类型的软件,因此使用者操作该软件可以无需培训就上手。加上现在计算机入驻各家各户,大部分人的计算机操作水平都比较高,这样的局面也表明开发出来的程序在操作性问题上也是不用担心的。

综合上面的可行性论证,基本可以确定程序开发完全可行。

3.2系统运行环境

程序经过编码可以实现对程序设计的功能。但是编码实现时需要一定的配置环境,包括了电脑上的硬件环境,也包括在电脑操作系统上安装的软件环境。

硬件环境:一台可以正常使用并能够上网的笔记本或者是电脑,电脑内存最低要求4个G,电脑的中央处理器可以配置i5CPU。

软件环境:运用的微软操作系统是比较稳定的win7旗舰版系统,采用比较熟练360安全浏览器,并在此系统上通过浏览器下载安装好Eclipse软件,下载安装好MYSQL软件等。

3.3系统流程分析

分析程序的流程,涉及到程序的整体操作流程,通过分析与设计,绘制的程序操作流程图见下图。此程序为了确保安全,会让使用者通过登录模块验证信息,符合要求的使用者才有权限操作程序。

图3-1 程序操作流程图

程序处理数据会涉及到数据的录入环节,绘制的添加流程见下图。程序录入数据过程中,始终与数据库保持同步。

图3-2 信息添加流程图

程序里面的数据也会出现错误,因此就有相应的修改数据的功能,绘制的程序修改流程见下图。此过程也是跟后台数据库进行数据同步显示。

图3-3信息修改流程图

程序数据存放于数据仓库,有时也会涉及到数据删除,此过程对应的流程图见下图。数据信息被删除之后,数据库里面也就没有了该数据信息了。

图3-4 信息删除流程图

第4章 系统设计

4.1 系统设计的原则

在系统设计过程中,也需要遵循相应的设计原则,这些设计原则可以帮助设计者在短时间内设计出符合设计规范的设计方案。设计原则主要有可靠性,安全性,可定制化,可扩展性,可维护性,可升级性以及客户体验等原则。下面就对这些原则进行简要阐述。

可靠性:一个软件是否可靠决定了其是否被用户使用,设计不可靠的软件,用户很容易就遗弃;

安全性:程序软件承担了信息的保存与管理等事务,安全性不足的软件会导致使用者承担巨大的损失;所以系统安全也是需要考虑进入的;

可定制化:市场环境从来都不是一直固定不变,面对客户群体的改变,以及使用环境的改变,市场需求的改变等因素,程序软件也要易于调整以适应各种变化;

可扩展性:程序软件在运行使用期间,也需要及时引进当下的新技术来进行系统优化,主要就是在系统功能层面,系统性能层面上进行相应的扩展,只有这样才能让系统在实际生活中继续占有市场;

可维护性:程序软件的维护需要一定量的资金,不管是排除现有程序错误,还是变更软件的现有需求,都需要在软件技术上投入一定资金,所以易于维护的软件程序就可以降低技术层面的资金消耗;

可升级性:程序软件的投入使用,会面临用户数量增多的情况,用户对软件的使用率也会提升,所以系统面临这种情况,仍然需要通过升级保持性能的合理,这样才能够适应市场;

客户体验:设计出来的程序软件在界面上不能够太复杂,要遵循界面设计的原理设计出简单,方便操作的功能操作界面,让用户易于接受软件,并乐于使用软件提供的功能。

4.2 系统结构设计

在系统结构设计上,经综合考虑还是选择比js更加简洁的vue框架,现如今浏览器已经实现了普及,并在技术上逐渐完善和成熟,它在节约软件开发成本的基础上,还能实现原本用专业软件操作才能实现的强大功能。总之,小程序架构是当下全新的,认可度高的系统构造技术。系统结构设计图通过绘制,效果展示如下:

图4-1 系统结构设计图

4.3功能结构设计

在管理员功能模块确定下来的基础上,对管理员各个功能进行设计,确定管理员功能的详细模块。绘制的管理员功能结构见下图。

结构设计图

图4.3 管理员功能结构图

4.4数据库设计

与功能结构设计一样,数据库设计也是程序开发不可避免的设计环节,数据库设计最主要的目的就是帮助运行程序存储相应的数据信息。数据库设计包含的内容有数据表结构的设计,也包含了数据库E-R图的设计。

4.4.1 数据库E-R图

在绘制E-R图之前,先要找出数据库的实体,明确各个实体具有的属性,比如用户信息这个实体,它具备的属性包括了用户的姓名属性,用户的密码属性,用户的创建时间属性等,所以明确了用户这个实体,以及用户实体具备的属性之后,就需要根据这些信息绘制用户实体对应的实体属性图了。绘制软件选用当下认可度高,使用范围广,操作便利的微软旗下的Visio工具。

(1)下图是员工考勤详情实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\3.1\____img\员工考勤详情.jpg

员工考勤详情实体属性图

(2)下图是公告实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\3.1\____img\公告.jpg

公告实体属性图

(3)下图是员工请假实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\3.1\____img\员工请假.jpg

员工请假实体属性图

(4)下图是员工实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\3.1\____img\员工.jpg

员工实体属性图

(5)下图是员工考勤实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\3.1\____img\员工考勤.jpg

员工考勤实体属性图

(6)下图是薪资实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\3.1\____img\薪资.jpg

薪资实体属性图

4.4.2 数据库表结构

在进行这部分设计之前,需要明白和掌握数据类型以及各个数据类型的长度范围等知识,因为在一张具体的数据表中,为了方便理解,这里就举个简单的例子。比如用户信息表,这个表格的字段就是用户这个实体具备的属性,这时就需要对字段进行数据类型,以及字段长度的设置,也要设置一个主键来作为用户信息表的唯一标识。这些都是数据库表结构设计需要完成的内容。根据武汉君耐营销策划有限公司员工信息管理系统的功能设计以及数据库设计要求,展示该系统的数据表结构。

表4.1字典表

序号列名数据类型说明允许空
1IdIntid
2dic_codeString字段
3dic_nameString字段名
4code_indexInteger编码
5index_nameString编码名字
6super_idInteger父字段id
7beizhuString备注
8create_timeDate创建时间

表4.2公告表

序号列名数据类型说明允许空
1IdIntid
2gonggao_nameString公告名称
3gonggao_typesInteger公告类型
4insert_timeDate公告发布时间
5gonggao_contentString公告详情
6create_timeDate创建时间

表4.3薪资表

序号列名数据类型说明允许空
1IdIntid
2yuangong_idInteger员工
3xinzi_uuid_numberString薪资编号
4xinzi_nameString标题
5xinzi_monthString月份
6jiben_jineBigDecimal基本工资
7jiangjin_jineBigDecimal奖金
8jixiao_jineBigDecimal绩效
9butie_jineBigDecimal补贴
10shifa_jineBigDecimal实发
11xinzi_contentString备注
12insert_timeDate添加时间
13create_timeDate创建时间

表4.4员工表

序号列名数据类型说明允许空
1IdIntid
2yuangong_nameString员工姓名
3yuangong_phoneString员工手机号
4yuangong_id_numberString员工身份证号
5yuangong_photoString员工头像
6bumen_typesInteger部门
7zhiwei_typesInteger职位
8yuangong_emailString员工邮箱
9jinyong_typesInteger账户状态
10create_timeDate创建时间

表4.5员工考勤表

序号列名数据类型说明允许空
1IdIntid
2yuangong_kaoqin_uuid_numberString考勤唯一编号
3yuangong_kaoqin_nameString考勤标题
4yuangong_kaoqin_typesInteger员工考勤类型
5bumen_typesInteger部门
6yuangong_kaoqin_contentString考勤详情
7insert_timeDate考勤发起时间
8jiezhi_timeDate考勤截止时间
9create_timeDate创建时间

表4.6员工考勤详情表

序号列名数据类型说明允许空
1IdIntid
2yuangong_idInteger员工
3yuangong_kaoqin_idInteger考勤
4yuangong_kaoqin_list_typesInteger打卡状态
5insert_timeDate添加时间
6update_timeDate打卡时间
7create_timeDate创建时间

表4.7员工请假表

序号列名数据类型说明允许空
1IdIntid
2yuangong_idInteger员工
3yuangongqingjia_nameString请假标题
4yuangongqingjia_textString请假缘由
5yuangongqingjia_typesInteger请假类型
6insert_timeDate申请时间
7yuangongqingjia_timeDate请假时间
8yuangongqingjia_numberInteger请假天数
9yuangongqingjia_yesno_typesInteger申请状态
10yuangongqingjia_yesno_textString处理意见
11yuangongqingjia_shenhe_timeDate审核时间
12create_timeDate创建时间

表4.8管理员表

序号列名数据类型说明允许空
1IdIntid
2usernameString员工名
3passwordString密码
4roleString角色
5addtimeDate新增时间
  1. 系统实现

系统实现这个章节的内容主要还是展示系统的功能界面设计效果,在实现系统基本功能,比如修改,比如添加,比如删除等管理功能的同时,也显示出系统各个功能的界面实现效果,该部分内容一方面与前面提到的系统分析,系统设计的内容相呼应,另一方面也是一个实际成果的展示。

5.1管理员功能实现

5.1.1 员工管理

此页面让管理员管理员工的数据,员工管理页面见下图。此页面主要实现员工的增加、修改、删除、查看的功能。

图5-1 员工管理页面

5.1.2 公告信息管理

公告信息管理页面提供的功能操作有:新增公告,修改公告,删除公告操作。下图就是公告信息管理页面。

图5.3 公告信息管理页面

5.1.3公告类型管理

公告类型管理页面显示所有公告类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的公告类型信息执行编辑更新,失效的公告类型信息也能让管理员快速删除。下图就是公告类型管理页面。

图5.4 公告类型列表页面

第6章 系统测试

程序软件的开发阶段也包括了系统测试,这个部分就是程序质量评定的一个重要环节,如果说程序通过编码实现功能之后,不通过测试检查程序中出现的错误,那么程序一旦投入生活中运行使用时,就会产生许多大大小小的错误,这个时候去解决问题已经晚了,所以一个程序在被交付给使用者使用之前,开发者就需要使用多种测试方法反复进行测试,也是对程序的一个负责表现。程序进入系统测试阶段,在讲究策略进行测试时,也需要对时效性进行把控。当开发者测试完程序,并解决完测试期间程序产生的各种错误时,就需要程序的验收方来对程序进行验收测试,这也是程序测试的最后一个操作步骤。验收测试也是对程序的质量以及可交付性方面起到关键的作用。

FileController.java
package com.controller;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
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.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 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")
	public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		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()){
				/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
					getResponse().sendError(403);
				}*/
				HttpHeaders headers = new HttpHeaders();
			    headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    
			    headers.setContentDispositionFormData("attachment", fileName);    
			    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
	}
	
}

TokenServiceImpl.java

package com.service.impl;


import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.TokenDao;
import com.entity.TokenEntity;
import com.entity.TokenEntity;
import com.service.TokenService;
import com.utils.CommonUtil;
import com.utils.PageUtils;
import com.utils.Query;


/**
 * token
 * @author
 */
@Service("tokenService")
public class TokenServiceImpl extends ServiceImpl<TokenDao, TokenEntity> implements TokenService {

	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		Page<TokenEntity> page = this.selectPage(
                new Query<TokenEntity>(params).getPage(),
                new EntityWrapper<TokenEntity>()
        );
        return new PageUtils(page);
	}

	@Override
	public List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper) {
		return baseMapper.selectListView(wrapper);
	}

	@Override
	public PageUtils queryPage(Map<String, Object> params,
			Wrapper<TokenEntity> wrapper) {
		 Page<TokenEntity> page =new Query<TokenEntity>(params).getPage();
	        page.setRecords(baseMapper.selectListView(page,wrapper));
	    	PageUtils pageUtil = new PageUtils(page);
	    	return pageUtil;
	}

	@Override
	public String generateToken(Integer userid,String username, String tableName, String role) {
		TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("userid", userid).eq("role", role));
		String token = CommonUtil.getRandomString(32);
		Calendar cal = Calendar.getInstance();   
    	cal.setTime(new Date());   
    	cal.add(Calendar.HOUR_OF_DAY, 1);
		if(tokenEntity!=null) {
			tokenEntity.setToken(token);
			tokenEntity.setExpiratedtime(cal.getTime());
			this.updateById(tokenEntity);
		} else {
			this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime()));
		}
		return token;
	}

	@Override
	public TokenEntity getTokenEntity(String token) {
		TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("token", token));
		if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime()<new Date().getTime()) {
			return null;
		}
		return tokenEntity;
	}
}

YuangongKaoqinListController.java

package com.controller;

import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;

import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;

/**
 * 员工考勤详情
 * 后端接口
 * @author
 * @email
*/
@RestController
@Controller
@RequestMapping("/yuangongKaoqinList")
public class YuangongKaoqinListController {
    private static final Logger logger = LoggerFactory.getLogger(YuangongKaoqinListController.class);

    private static final String TABLE_NAME = "yuangongKaoqinList";

    @Autowired
    private YuangongKaoqinListService yuangongKaoqinListService;


    @Autowired
    private TokenService tokenService;

    @Autowired
    private DictionaryService dictionaryService;//字典
    @Autowired
    private GonggaoService gonggaoService;//公告
    @Autowired
    private XinziService xinziService;//薪资
    @Autowired
    private YuangongService yuangongService;//员工
    @Autowired
    private YuangongKaoqinService yuangongKaoqinService;//员工考勤
    @Autowired
    private YuangongqingjiaService yuangongqingjiaService;//员工请假
    @Autowired
    private UsersService usersService;//管理员


    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永不会进入");
        else if("员工".equals(role))
            params.put("yuangongId",request.getSession().getAttribute("userId"));
        CommonUtil.checkMap(params);
        PageUtils page = yuangongKaoqinListService.queryPage(params);

        //字典表数据转换
        List<YuangongKaoqinListView> list =(List<YuangongKaoqinListView>)page.getList();
        for(YuangongKaoqinListView c:list){
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(c, request);
        }
        return R.ok().put("data", page);
    }

    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        YuangongKaoqinListEntity yuangongKaoqinList = yuangongKaoqinListService.selectById(id);
        if(yuangongKaoqinList !=null){
            //entity转view
            YuangongKaoqinListView view = new YuangongKaoqinListView();
            BeanUtils.copyProperties( yuangongKaoqinList , view );//把实体数据重构到view中
            //级联表 员工
            //级联表
            YuangongEntity yuangong = yuangongService.selectById(yuangongKaoqinList.getYuangongId());
            if(yuangong != null){
            BeanUtils.copyProperties( yuangong , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yuangongId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
            view.setYuangongId(yuangong.getId());
            }
            //级联表 员工考勤
            //级联表
            YuangongKaoqinEntity yuangongKaoqin = yuangongKaoqinService.selectById(yuangongKaoqinList.getYuangongKaoqinId());
            if(yuangongKaoqin != null){
            BeanUtils.copyProperties( yuangongKaoqin , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yuangongId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
            view.setYuangongKaoqinId(yuangongKaoqin.getId());
            }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody YuangongKaoqinListEntity yuangongKaoqinList, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,yuangongKaoqinList:{}",this.getClass().getName(),yuangongKaoqinList.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");
        else if("员工".equals(role))
            yuangongKaoqinList.setYuangongId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

            yuangongKaoqinList.setInsertTime(new Date());
            yuangongKaoqinList.setCreateTime(new Date());
            yuangongKaoqinListService.insert(yuangongKaoqinList);
            return R.ok();
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody YuangongKaoqinListEntity yuangongKaoqinList, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
        logger.debug("update方法:,,Controller:{},,yuangongKaoqinList:{}",this.getClass().getName(),yuangongKaoqinList.toString());
        YuangongKaoqinListEntity oldYuangongKaoqinListEntity = yuangongKaoqinListService.selectById(yuangongKaoqinList.getId());//查询原先数据

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("员工".equals(role))
//            yuangongKaoqinList.setYuangongId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        yuangongKaoqinList.setUpdateTime(new Date());

            yuangongKaoqinListService.updateById(yuangongKaoqinList);//根据id更新
            return R.ok();
    }



    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<YuangongKaoqinListEntity> oldYuangongKaoqinListList =yuangongKaoqinListService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        yuangongKaoqinListService.deleteBatchIds(Arrays.asList(ids));

        return R.ok();
    }


    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName, HttpServletRequest request){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        Integer yuangongId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            List<YuangongKaoqinListEntity> yuangongKaoqinListList = new ArrayList<>();//上传的东西
            Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
            Date date = new Date();
            int lastIndexOf = fileName.lastIndexOf(".");
            if(lastIndexOf == -1){
                return R.error(511,"该文件没有后缀");
            }else{
                String suffix = fileName.substring(lastIndexOf);
                if(!".xls".equals(suffix)){
                    return R.error(511,"只支持后缀为xls的excel文件");
                }else{
                    URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
                    File file = new File(resource.getFile());
                    if(!file.exists()){
                        return R.error(511,"找不到上传文件,请联系管理员");
                    }else{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            YuangongKaoqinListEntity yuangongKaoqinListEntity = new YuangongKaoqinListEntity();
//                            yuangongKaoqinListEntity.setYuangongId(Integer.valueOf(data.get(0)));   //员工 要改的
//                            yuangongKaoqinListEntity.setYuangongKaoqinId(Integer.valueOf(data.get(0)));   //考勤 要改的
//                            yuangongKaoqinListEntity.setYuangongKaoqinListTypes(Integer.valueOf(data.get(0)));   //打卡状态 要改的
//                            yuangongKaoqinListEntity.setInsertTime(date);//时间
//                            yuangongKaoqinListEntity.setUpdateTime(sdf.parse(data.get(0)));          //打卡时间 要改的
//                            yuangongKaoqinListEntity.setCreateTime(date);//时间
                            yuangongKaoqinListList.add(yuangongKaoqinListEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        yuangongKaoqinListService.insertBatch(yuangongKaoqinListList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }




}


huanyuan.vue
<template>
	<div class="addEdit-block">
		<el-form label-position="top" class="detail-form-content" ref="ruleForm" :model="ruleForm" :rules="rules"
			>
			<el-form-item class="input" label="MySQL安装目录" prop="mysqlUrl">
				<el-input clearable placeholder="MySQL安装目录" v-model="ruleForm.mysqlUrl"></el-input>
			</el-form-item>
			<el-form-item class="input" label="MySQL数据库所在服务器地址IP" prop="hostIP">
				<el-input clearable placeholder="MySQL数据库所在服务器地址IP" v-model="ruleForm.hostIP"></el-input>
			</el-form-item>
			<el-form-item class="input" label="进入数据库所需要的用户名" prop="userName">
				<el-input clearable placeholder="进入数据库所需要的用户名" v-model="ruleForm.userName"></el-input>
			</el-form-item>
			<el-form-item class="input" label="数据库端口" prop="hostPort">
				<el-input clearable placeholder="数据库端口" v-model="ruleForm.hostPort"></el-input>
			</el-form-item>
			<el-form-item class="input" label="进入数据库所需要的密码" prop="password">
				<el-input clearable placeholder="进入数据库所需要的密码" v-model="ruleForm.password"></el-input>
			</el-form-item>
			<el-form-item class="input" label="数据库文件保存路径" prop="savePath">
				<el-input clearable placeholder="数据库文件保存路径" v-model="ruleForm.savePath">
				</el-input>
			</el-form-item>
			<el-form-item class="input" label="数据库还原文件文件名(.sql结尾)" prop="fileName">
				<el-input clearable placeholder="数据库还原文件文件名" v-model="ruleForm.fileName"></el-input>
			</el-form-item>
			<el-form-item class="input" label="要还原的数据库名" prop="databaseName">
				<el-input clearable placeholder="要还原的数据库名" v-model="ruleForm.databaseName"></el-input>
			</el-form-item>
			<el-form-item class="btn">
				<el-button type="primary" class="btn-success" @click="huanyuan">确定</el-button>
			</el-form-item>
		</el-form>
	</div>
</template>
<script>
	// 数字,邮件,手机,url,身份证校验
	import styleJs from "../../../utils/style.js";
	import utilsJs, {getYearFormat,getMonthFormat,getDateFormat,getDatetimeFormat} from "../../../utils/utils.js";
	export default {
		data() {
			return {
				ruleForm: {
					mysqlUrl: "C:/Program Files/MySQL/MySQL Server 5.7/bin/", //MySQL安装目录
					hostIP: '127.0.0.1', //MySQL数据库所在服务器地址IP
					userName: '', //进入数据库所需要的用户名
					hostPort: '3306', //数据库端口
					password: '', //进入数据库所需要的密码
					savePath: '', //数据库还原文件保存路径
					fileName: "", //数据库还原文件文件名
					databaseName: "", //要还原的数据库名
				},
				rules: {
					mysqlUrl: [{
						required: true,
						message: 'MySQL安装目录不能为空',
						trigger: 'blur'
					}, ],
					hostIP: [{
						required: true,
						message: 'MySQL数据库所在服务器地址IP不能为空',
						trigger: 'blur'
					}, ],
					userName: [{
						required: true,
						message: '进入数据库所需要的用户名不能为空',
						trigger: 'blur'
					}, ],
					hostPort: [{
						required: true,
						message: '数据库端口不能为空',
						trigger: 'blur'
					}, ],
					password: [{
						required: true,
						message: '进入数据库所需要的密码不能为空',
						trigger: 'blur'
					}, ],
					savePath: [{
						required: true,
						message: '数据库还原文件保存路径不能为空',
						trigger: 'blur'
					}, ],
					fileName: [{
						required: true,
						message: '数据库还原文件文件名不能为空',
						trigger: 'blur'
					}, ],
					databaseName: [{
						required: true,
						message: '要还原的数据库名不能为空',
						trigger: 'blur'
					}, ],
				}
			};
		},
		props: ["parent"],
		computed: {},
		created() {
			this.addEditForm = styleJs.addStyle();
			this.addEditStyleChange()
			this.addEditUploadStyleChange()
		},
		methods: {
			huanyuan() {
				let _this = this
				_this.ruleForm.hostIP = _this.ruleForm.hostIP.replaceAll("\\", "/")
				_this.ruleForm.savePath = _this.ruleForm.savePath.replaceAll("\\", "/")
				_this.$refs["ruleForm"].validate(valid => {
					if (valid) {
						_this.$http({
							url: '/huanyuan?hostIP=' + _this.ruleForm.hostIP +
								"&userName=" + _this.ruleForm.userName +
								"&hostPort=" + _this.ruleForm.hostPort +
								"&password=" + _this.ruleForm.password +
								"&savePath=" + _this.ruleForm.savePath +
								"&fileName=" + _this.ruleForm.fileName +
								"&databaseName=" + _this.ruleForm.databaseName +
								"&mysqlUrl=" + _this.ruleForm.mysqlUrl,
							method: "get",
						}).then(({
							data
						}) => {
							if (data && data.code === 0) {
								this.$message({
									message: "操作成功",
									type: "success",
									duration: 1500,
									onClose: () => {}
								});
							} else {
								this.$message.error(data.msg);
							}
							_this.ruleForm = {
								mysqlUrl: 'C:/Program Files/MySQL/MySQL Server 5.7/bin/', //MySQL数据库所在服务器地址IP
								hostIP: '127.0.0.1', //MySQL数据库所在服务器地址IP
								userName: null, //进入数据库所需要的用户名
								hostPort: '3306', //数据库端口
								password: null, //进入数据库所需要的密码
								savePath: null, //数据库还原文件保存路径
								fileName: null, //数据库还原文件文件名
								databaseName: null, //要还原的数据库名
							}
						});
					}
				})
			},
			addEditStyleChange() {
				this.$nextTick(() => {
					// input
					document.querySelectorAll('.addEdit-block .input .el-input__inner').forEach(el => {
						el.style.height = this.addEditForm.inputHeight
						el.style.color = this.addEditForm.inputFontColor
						el.style.fontSize = this.addEditForm.inputFontSize
						el.style.borderWidth = this.addEditForm.inputBorderWidth
						el.style.borderStyle = this.addEditForm.inputBorderStyle
						el.style.borderColor = this.addEditForm.inputBorderColor
						el.style.borderRadius = this.addEditForm.inputBorderRadius
						el.style.backgroundColor = this.addEditForm.inputBgColor
					})
					document.querySelectorAll('.addEdit-block .input .el-form-item__label').forEach(el => {
						el.style.lineHeight = this.addEditForm.inputHeight
						el.style.color = this.addEditForm.inputLableColor
						el.style.fontSize = this.addEditForm.inputLableFontSize
					})
					// select
					document.querySelectorAll('.addEdit-block .select .el-input__inner').forEach(el => {
						el.style.height = this.addEditForm.selectHeight
						el.style.color = this.addEditForm.selectFontColor
						el.style.fontSize = this.addEditForm.selectFontSize
						el.style.borderWidth = this.addEditForm.selectBorderWidth
						el.style.borderStyle = this.addEditForm.selectBorderStyle
						el.style.borderColor = this.addEditForm.selectBorderColor
						el.style.borderRadius = this.addEditForm.selectBorderRadius
						el.style.backgroundColor = this.addEditForm.selectBgColor
					})
					document.querySelectorAll('.addEdit-block .select .el-form-item__label').forEach(el => {
						el.style.lineHeight = this.addEditForm.selectHeight
						el.style.color = this.addEditForm.selectLableColor
						el.style.fontSize = this.addEditForm.selectLableFontSize
					})
					document.querySelectorAll('.addEdit-block .select .el-select__caret').forEach(el => {
						el.style.color = this.addEditForm.selectIconFontColor
						el.style.fontSize = this.addEditForm.selectIconFontSize
					})
					// date
					document.querySelectorAll('.addEdit-block .date .el-input__inner').forEach(el => {
						el.style.height = this.addEditForm.dateHeight
						el.style.color = this.addEditForm.dateFontColor
						el.style.fontSize = this.addEditForm.dateFontSize
						el.style.borderWidth = this.addEditForm.dateBorderWidth
						el.style.borderStyle = this.addEditForm.dateBorderStyle
						el.style.borderColor = this.addEditForm.dateBorderColor
						el.style.borderRadius = this.addEditForm.dateBorderRadius
						el.style.backgroundColor = this.addEditForm.dateBgColor
					})
					document.querySelectorAll('.addEdit-block .date .el-form-item__label').forEach(el => {
						el.style.lineHeight = this.addEditForm.dateHeight
						el.style.color = this.addEditForm.dateLableColor
						el.style.fontSize = this.addEditForm.dateLableFontSize
					})
					document.querySelectorAll('.addEdit-block .date .el-input__icon').forEach(el => {
						el.style.color = this.addEditForm.dateIconFontColor
						el.style.fontSize = this.addEditForm.dateIconFontSize
						el.style.lineHeight = this.addEditForm.dateHeight
					})
					// upload
					let iconLineHeight = parseInt(this.addEditForm.uploadHeight) - parseInt(this.addEditForm
						.uploadBorderWidth) * 2 + 'px'
					document.querySelectorAll('.addEdit-block .upload .el-upload--picture-card').forEach(el => {
						el.style.width = this.addEditForm.uploadHeight
						el.style.height = this.addEditForm.uploadHeight
						el.style.borderWidth = this.addEditForm.uploadBorderWidth
						el.style.borderStyle = this.addEditForm.uploadBorderStyle
						el.style.borderColor = this.addEditForm.uploadBorderColor
						el.style.borderRadius = this.addEditForm.uploadBorderRadius
						el.style.backgroundColor = this.addEditForm.uploadBgColor
					})
					document.querySelectorAll('.addEdit-block .upload .el-form-item__label').forEach(el => {
						el.style.lineHeight = this.addEditForm.uploadHeight
						el.style.color = this.addEditForm.uploadLableColor
						el.style.fontSize = this.addEditForm.uploadLableFontSize
					})
					document.querySelectorAll('.addEdit-block .upload .el-icon-plus').forEach(el => {
						el.style.color = this.addEditForm.uploadIconFontColor
						el.style.fontSize = this.addEditForm.uploadIconFontSize
						el.style.lineHeight = iconLineHeight
						el.style.display = 'block'
					})
					// 多文本输入框
					document.querySelectorAll('.addEdit-block .textarea .el-textarea__inner').forEach(el => {
						el.style.height = this.addEditForm.textareaHeight
						el.style.color = this.addEditForm.textareaFontColor
						el.style.fontSize = this.addEditForm.textareaFontSize
						el.style.borderWidth = this.addEditForm.textareaBorderWidth
						el.style.borderStyle = this.addEditForm.textareaBorderStyle
						el.style.borderColor = this.addEditForm.textareaBorderColor
						el.style.borderRadius = this.addEditForm.textareaBorderRadius
						el.style.backgroundColor = this.addEditForm.textareaBgColor
					})
					document.querySelectorAll('.addEdit-block .textarea .el-form-item__label').forEach(el => {
						// el.style.lineHeight = this.addEditForm.textareaHeight
						el.style.color = this.addEditForm.textareaLableColor
						el.style.fontSize = this.addEditForm.textareaLableFontSize
					})
					// 保存
					document.querySelectorAll('.addEdit-block .btn .btn-success').forEach(el => {
						el.style.width = this.addEditForm.btnSaveWidth
						el.style.height = this.addEditForm.btnSaveHeight
						el.style.color = this.addEditForm.btnSaveFontColor
						el.style.fontSize = this.addEditForm.btnSaveFontSize
						el.style.borderWidth = this.addEditForm.btnSaveBorderWidth
						el.style.borderStyle = this.addEditForm.btnSaveBorderStyle
						el.style.borderColor = this.addEditForm.btnSaveBorderColor
						el.style.borderRadius = this.addEditForm.btnSaveBorderRadius
						el.style.backgroundColor = this.addEditForm.btnSaveBgColor
					})
					// 返回
					document.querySelectorAll('.addEdit-block .btn .btn-close').forEach(el => {
						el.style.width = this.addEditForm.btnCancelWidth
						el.style.height = this.addEditForm.btnCancelHeight
						el.style.color = this.addEditForm.btnCancelFontColor
						el.style.fontSize = this.addEditForm.btnCancelFontSize
						el.style.borderWidth = this.addEditForm.btnCancelBorderWidth
						el.style.borderStyle = this.addEditForm.btnCancelBorderStyle
						el.style.borderColor = this.addEditForm.btnCancelBorderColor
						el.style.borderRadius = this.addEditForm.btnCancelBorderRadius
						el.style.backgroundColor = this.addEditForm.btnCancelBgColor
					})
				})
			},
			addEditUploadStyleChange() {
				this.$nextTick(() => {
					document.querySelectorAll(
						'.addEdit-block .upload .el-upload-list--picture-card .el-upload-list__item').forEach(
						el => {
							el.style.width = this.addEditForm.uploadHeight
							el.style.height = this.addEditForm.uploadHeight
							el.style.borderWidth = this.addEditForm.uploadBorderWidth
							el.style.borderStyle = this.addEditForm.uploadBorderStyle
							el.style.borderColor = this.addEditForm.uploadBorderColor
							el.style.borderRadius = this.addEditForm.uploadBorderRadius
							el.style.backgroundColor = this.addEditForm.uploadBgColor
						})
				})
			},
		}
	};
</script>
<style lang="scss">
	.slt {
    margin: 0 !important;
    display: flex;
  }

  .ad {
    margin: 0 !important;
    display: flex;
  }

  .pages {
    & /deep/ el-pagination__sizes{
      & /deep/ el-input__inner {
        height: 22px;
        line-height: 22px;
      }
    }
  }


  .el-button+.el-button {
    margin:0;
  }

  .tables {
	& /deep/ .el-button--success {
		height: 40px;
		color: rgba(255, 255, 255, 1);
		font-size: 14px;
		border-width: 5px           ;
		border-style: double;
		border-color: rgba(255, 255, 255, 1);
		border-radius: 30px 0px 0px 0px;
		background-color: var(--publicMainColor);
	}

	& /deep/ .el-button--primary {
		height: 40px;
		color: rgba(255, 255, 255, 1);
		font-size: 14px;
		border-width: 5px           ;
		border-style: double;
		border-color: rgba(255, 255, 255, 1);
		border-radius: 30px 0px 0px 0px;
		background-color: var(--publicMainColor);
	}

	& /deep/ .el-button--danger {
		height: 40px;
		color: rgba(255, 255, 255, 1);
		font-size: 14px;
		border-width: 5px           ;
		border-style: double;
		border-color: rgba(255, 255, 255, 1);
		border-radius: 30px 0px 0px 0px;
		background-color: var(--publicMainColor);
	}

    & /deep/ .el-button {
      margin: 4px;
    }
  }
	.form-content {
		background: transparent;
	}
	.table-content {
		background: transparent;
	}

	.tables /deep/ .el-table__body tr {
				background-color: rgba(252, 253, 253, 1) !important;
				color: #606266 !important;
	 }
	.tables /deep/ .el-table__body tr.el-table__row--striped td {
	    background: transparent;
	}
	.tables /deep/ .el-table__body tr.el-table__row--striped {
		background-color: rgba(252, 253, 253, 1) !important;
		color: #606266 !important;
	}

	 .tables /deep/ .el-table__body tr:hover>td {
	   	   background-color: rgba(245, 245, 245, 1) !important;
	   	   	   color: #333 !important;
	   	 }</style>

声明

本博客适用于广泛的学术和教育用途,包括但不限于个人学习、开发设计,产品设计。仅供学习参考,旨在为读者提供深入理解和学术研究的材料。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2050447.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【Harmony OS 4.0】待办列表案例

src/main/ets/example1/Models.ets // 定义class类数据模型 export class TaskDataModel {// private 私有属性&#xff0c;在类对象外不允许随意更改数据&#xff0c;必须本地初始化。private tasks: Array<string> [早起晨练, 准备早餐, 阅读名著, 学习ArkTs, 玩游戏…

答题情况和每题得分

文章目录 1.提交答题情况1.PracticeDetailController.java2.PracticeDetailService.java3.PracticeDetailServiceImpl.java4.PracticeDetailDao.java5.PracticeDetailDao.xml6.reqSubmitSubjectDetailReq.java 7.dto1.SubjectDetailDTO.java2.SubjectDTO.java3.SubjectOptionDT…

算法的学习笔记—合并两个排序的链表(牛客JZ25)

&#x1f600;前言 在算法面试中&#xff0c;链表问题是经常遇到的考点之一&#xff0c;其中合并两个排序链表是一个非常经典的问题。本文将详细介绍如何通过递归和迭代两种方式实现两个有序链表的合并。 &#x1f3e0;个人主页&#xff1a;尘觉主页 文章目录 &#x1f600;合并…

大厂高频软件测试面试题和答案都帮你准备好啦,备战金九银十

还有两周时间就是金九银十求职招聘季了&#xff0c;每年的9月和10月&#xff0c;都是毕业生求职的大好时机&#xff0c;很多企业为招揽人才&#xff0c;会在每年的九十月份举办针对应届生的招聘会。接下来小编已为大家备好了多家大厂高频软件测试面试题和答案&#xff0c; 说下…

Zookeeper应用场景实战一

目录 1. Zookeeper Java客户端实战 1.1 Zookeeper 原生Java客户端使用 ZooKeeper常用构造器 示例代码&#xff1a; Zookeeper主要方法 1.2 Curator开源客户端使用 引入依赖 示例代码&#xff1a; 创建一个客户端实例 创建节点 一次性创建带层级结构的节点 获取数据 …

RTC时钟测试

1. 基础知识 Linux 的系统时间有时跟硬件时间是不同步的。 Linux时钟分为系统时钟(System Clock)和硬件(Real Time Clock&#xff0c;简称RTC)时钟。系统时钟是指当前Linux Kernel中的时钟&#xff0c;而硬件时钟则是主板上由电池供电的时钟&#xff0c;这个硬件时钟可以在BIO…

编译aws并访问minio

Aws amazon (S3) 是一个公开的服务&#xff0c;Web 应用程序开发人员可以使用它存储数字资产&#xff0c;包括图片、视频、音乐和文档。 S3 提供一个 RESTful API 以编程方式实现与该服务的交互. MinIO是兼容AWS SDK,所以可以通过aws访问minio文件系统。 指导文档&#xff1…

CSS知识点详解:display+float

display&#xff1a;浮动 1.block&#xff1a;使元素呈现为块级元素&#xff0c;可设置宽高 display: block; 特点&#xff1a;使元素呈现为块级元素&#xff0c;即该元素会以新行开始&#xff0c;占据整行的宽度&#xff0c;即使其宽度未满。 例子&#xff1a; 2.inline&a…

队列(笔记)

文章目录 1. 概念2. 实现方式3. 复杂度其他 4. 实际应用5. 内容出处 1. 概念 队列&#xff1a;其实就是排队。像我们在银行窗口取钱、车站买车票等都可以叫队列。 特点&#xff1a;队列只允许在后端(rear)进行插入操作&#xff0c;在前端(front)进行删除操作(即先进先出…

算法刷题记录 八十五【图论的广度优先搜索理论基础】

前言 图论章节第2篇。 第1篇&#xff1a;记录 八十二【图论理论基础及深度优先搜索算法】&#xff1b; 本文&#xff1a;记录 八十五【图论的广度优先搜索理论基础】 一、广度优先搜索理论基础 广度优先搜索理论基础 参考链接 1.1 知识点框架 1.2 模拟广度搜索的过程 在有向…

Llama 3.1深度解析:405B、70B及8B模型的多语言与长上下文处理能力

Llama 3.1 发布了&#xff01;今天我们迎来了 Llama 家族的新成员 Llama 3.1 进入 Hugging Face 平台。我们很高兴与 Meta 合作&#xff0c;确保在 Hugging Face 生态系统中实现最佳集成。Hub 上现有八个开源权重模型 (3 个基础模型和 5 个微调模型)。 Llama 3.1 有三种规格: …

字符串拼接和反转

定义一个方法&#xff0c;把int数组中的数据按照指定的格式拼接成一个字符串 调用该方法&#xff0c;并在控制台输出结果 例如&#xff1a; 数组为 int[] arr [1,2,3]; 执行方法后的输出结果为:[1,2,3] package stringdemo;public class StringDemo3 {public static void…

洋牡丹:多彩花语与深邃寓意

一、洋牡丹概述 洋牡丹&#xff0c;学名为花毛茛&#xff0c;其名称的由来颇为有趣。因花型酷似牡丹花&#xff0c;且从国外引入栽培&#xff0c;故得 “洋牡丹” 这一亲切的称呼。 洋牡丹的常见品种繁多&#xff0c;有单瓣和重瓣之分。单瓣的洋牡丹清新雅致&#xff0c;花瓣舒…

docker 最新可用镜像源地址

无论是docker桌布版本&#xff0c;还是linux版本通用 直接更换镜像源地址即可&#xff1a;亲测目前可用 { "registry-mirrors": ["https://0c105db5188026850f80c001def654a0.mirror.swr.myhuaweicloud.com","https://5tqw56kt.mirror.aliyuncs.com&…

大模型基于指令的知识编辑:InstructEdit技术

人工智能咨询培训老师叶梓 转载标明出处 在知识更新和编辑方面&#xff0c;大模型在特定任务上表现出色&#xff0c;但在面对不同任务时往往力不从心&#xff0c;需要为每个任务单独设计编辑器&#xff0c;这在一定程度上限制了其应用范围。为了解决这一问题&#xff0c;浙江大…

二十二、状态模式

文章目录 1 基本介绍2 案例2.1 Season 接口2.2 Spring 类2.3 Summer 类2.4 Autumn 类2.5 Winter 类2.6 Person 类2.7 Client 类2.8 Client 类的运行结果2.9 总结 3 各角色之间的关系3.1 角色3.1.1 State ( 状态 )3.1.2 ConcreteState ( 具体的状态 )3.1.3 Context ( 上下文 )3.…

【ARM+Codesys 客户案例 】 基于RK3568/A40i/STM32+CODESYS开发AGV运动控制器,支持国产定制

在过去&#xff0c;步科更多的是为AGV客户提供单一、高性能的低压伺服核心部件产品&#xff0c;而现在&#xff0c;步科基于 CODESYS 开发了一款面向AGV机器人的特种控制器 - 青龙1号&#xff0c;开始提供以步科AGV运动控制器FD1X4S系列低压伺服Green系列HMI等为核心的AGV总线控…

keepalived理论--实验

一 . 高可用集群 1.1 集群类型 LB &#xff1a; Load Balance 负载均衡 LVS/HAProxy/nginx &#xff08; http/upstream, stream/upstream &#xff09; HA &#xff1a; High Availability 高可用集群 数据库、 Redis SPoF: Single Point of Failure &#xff0c;解决…

2004-2023华为杯数学建模优秀参考论文

笔者整理了2004-2023年华为杯研究生数学建模全部优秀论文和赛题&#xff0c;内容齐全&#xff0c;适合将要参加建模比赛的朋友学习使用。 免费优秀论文获取联系&#xff1a; 建模忠哥小师妹 2004-2023历届华为杯研究生数学建模优秀论文合集&#xff1a;

【数学分析笔记】第2章第1节实数系的连续性(2)

2. 数列极限 2.1 实数系的连续性 2.1.3 确界存在定理 【定理2.1.1】&#xff08;确界存在定理——实数系连续性定理&#xff09;非空有上界的数集必有上确界&#xff0c;非空有下界的数集必有下确界。 【证】&#xff08;写了一些我自己的理解&#xff0c;欢迎数院大神批评指…