如何使用ssm实现图书管理借阅系统

news2024/9/20 7:55:57

@TOC

ssm301图书管理借阅系统+jsp

绪论

1.1 研究背景

当前社会各行业领域竞争压力非常大,随着当前时代的信息化,科学化发展,让社会各行业领域都争相使用新的信息技术,对行业内的各种相关数据进行科学化,规范化管理。这样的大环境让那些止步不前,不接受信息改革带来的信息技术的企业随时面临被淘汰,被取代的风险。所以当今,各个行业领域,不管是传统的教育行业,餐饮行业,还是旅游行业,医疗行业等领域都将使用新的信息技术进行信息革命,改变传统的纸质化,需要人手工处理工作事务的办公环境。软件信息技术能够覆盖社会各行业领域是时代的发展要求,各种数据以及文件真正实现电子化是信息社会发展的不可逆转的必然趋势。本图书管理借阅系统也是紧跟科学技术的发展,运用当今一流的软件技术实现软件系统的开发,让医生管理信息完全通过管理系统实现科学化,规范化,程序化管理。从而帮助信息管理者节省事务处理的时间,降低数据处理的错误率,对于基础数据的管理水平可以起到促进作用,也从一定程度上对随意的业务管理工作进行了避免,同时,图书管理借阅系统的数据库里面存储的各种动态信息,也为上层管理人员作出重大决策提供了大量的事实依据。总之,图书管理借阅系统是一款可以真正提升管理者的办公效率的软件系统。

1.2 目的和意义

信息数据的处理完全依赖人工进行操作,会耗费大量的人工成本,特别是面对大量的数据信息时,传统人工操作不仅不能对数据的出错率进行保证,还容易出现各种信息资源的低利用率与低安全性问题。更有甚者,耽误大量的宝贵时间,尤其是对信息的更新,归纳与统计更是耗财耗力的过程。所以电子化信息管理的出现就能缓解以及改变传统人工方式面临的处境,一方面可以确保信息数据在短时间被高效处理,还能节省人力成本,另一方面可以确保信息数据的安全性,可靠性,并可以实现信息数据的快速检索与修改操作,这些优点是之前的旧操作模式无法比拟的。因此图书管理借阅系统为数据信息的管理模式的升级与改革提供了重要的窗口。

1.3 论文结构安排

为了帮助用户更好的了解和理解程序的开发流程与相关内容,本文将通过六个章节进行内容阐述。

第一章:描述了程序的开发背景,程序运用于现实生活的目的与意义,以及程序文档的结构安排信息;

第二章:描述了程序的开发环境,包括程序开发涉及到的技术,程序开发使用的数据存储工具等信息;

第三章:描述了程序着手进行开发时,会面临的可行性问题,并对程序功能以及性能要求进行描述;

第四章:描述了程序大功能模块下的功能细分信息,以及存储程序数据的数据库表文件结构的设计信息等;

第五章:描述了程序的功能实现界面的内容,也对程序操作人员操作的部分功能进行了描述;

第六章:描述了程序功能的测试内容,并介绍了系统测试的概念与方法。

2 相关技术

2.1 SSM框架介绍

本课题程序开发使用到的框架技术,英文名称缩写是SSM,在JavaWeb开发中使用的流行框架有SSH、SSM、SpringMVC等,作为一个课题程序采用SSH框架也可以,SSM框架也可以,SpringMVC也可以。SSH框架是属于重量级别的框架,配置繁琐,不够灵活,修改程序需要修改好多个文件,并且运行起来也占用内存较高,CPU使用率相对也高,SpringMVC是Spring开发的一套MVC架构,更灵活更好用,SSM框架取中间值,既没有SSH臃肿,也没有SpringMVC简化,属于中间级别的,在配置过程和使用过程中更能编写和理解。MyBatis框架取代Hibernate框架是因为它更灵活,不需要完全在框架里操作,它在数据操作上可以写出更灵活的代码,它的性能也比Hibernate框架更稳定。总的来说,使用SSM框架是通过综合考虑而使用的,网上有很多的使用教程和心得体会,而且SSM又是这么的流行,用SSM框架开发是顺其自然的。

2.2 B/S结构介绍

在早期,一些使用HTML语言编写的文件,再集合一些其它资源文件就可以组成一个最简单的Web程序,了解了Web程序也需要了解Web站点,它们之间的关系就是一个或者多个Web程序可以放在Internet上的一个Web站点(Web服务器)中进行使用。可以说Web应用程序的开发也带动了B/S这种网络结构模式的兴起。B是Brower(浏览器)的首字母,S是Server(服务器)的首字母,两个首字母进行组合就成了网络结构模式的简称B/S。由于这种结构模式通过安装在客户端的浏览器进行服务器的访问,可以把程序的核心功能安排在服务器中进行处理,给程序的开发,后期使用和维护省去了许多工作。图2.1展示的就是使用这种架构开发的程序的工作原理。

图2.1 B/S架构的工作原理图

2.3 Mysql数据库介绍

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

图2.2 MySQL数据库架构图

3 系统分析

当用户确定开发一款程序时,是需要遵循下面的顺序进行工作,概括为:系统分析-->系统设计-->系统开发-->系统测试,无论这个过程是否有变更或者迭代,都是按照这样的顺序开展工作的。系统分析就是分析系统需要做什么的问题,主要目的就是确定系统的功能,这也为接下来的工作做了一个好的开端。

3.1 系统可行性分析

开发一款程序软件不仅需要时间,也需要人力,物力资源。而进行可行性分析这个环节就是解决用户这方面的疑问,看看程序在当前的条件下是否可以进行开发。

3.1.1 技术可行性分析

此程序选用的开发语言是Java,这种编程语言有着丰富的数据类型,在指令控制语句上也比较完善,更重要的就是对类与对象的大力支持,这些优点为程序开发者提供了技术保障,尤其是现在代码都逐渐模块化,有关系统功能开发的源码在网络上都公开展示了,所以让具备一定计算机开发基础的开发人员独立开发系统在技术上也逐渐容易。

3.1.2 经济可行性分析

开发此程序最关键的设备就是一台电脑,无论是学校计算机室配备的电脑,还是自己入学以来购置的笔记本,都是可以符合开发要求的设备,另外在网络上,学校本已完全覆盖了校园网,所以在设备以及网络上无须考虑经济问题。

3.1.3 运行可行性分析

随着电脑软件以及配套硬件的完善升级,当下的计算机环境是一片大好,尤其是计算机已经广泛普及到家家户户,所以计算机设备现在是随处可见,由于本次开发的程序占有的资源耗费较小,在一般的电脑或笔记本上都能轻松运转起来。

通过上面的可行性描述,可以从经济,技术,运行方面解决程序开发是否可行的问题。因此可以认为该程序软件是可以进行开发的。

3.2 系统性能分析

系统性能分析也是比较重要的内容,进行系统性能分析就是为了确保系统的功能要能够在生活中运行使用时,达到规定的指标,因此一个完整的系统软件,是需要进行系统的性能分析这个步骤的。本次进行性能分析主要从易用性指标,可扩展性指标,系统健壮性指标,系统安全性指标这几个方面进行分析。

3.2.1 易用性指标

本次程序软件的开发的目的就是让使用者可以通过使用该软件提高信息数据的管理效率,同时该程序软件也需要针对不同的操作用户设置对应的功能,因此,此程序的操作流程应该尽量与用户日常操作软件的行为习惯相贴合,另外,程序软件的设计与开发也应考虑非计算机专业用户的计算机操作水平,要让大部分使用者都可以轻松操作程序提供的各个功能。

3.2.2 可扩展性指标

当前需要开发的程序软件是根据当下的用户需求进行设计开发的,但是随着时间的推移,社会大环境的改变,开发出的程序也是需要与时俱进的,需要根据用户不断变换的需求进行相应的功能内容的扩展,需要注意的就是,当对成型的程序进行功能模块新增时,仍然需要保证程序原有架构以及功能不能受到影响,新增的功能模块在系统中也能够运行正常,该指标达标也就可以保证此程序是可以在满足信息管理要求下,从容应对市场环境的变化。

3.2.3 健壮性指标

程序软件的开发就是为了投入使用时,可以一直稳定的处理各种数据信息,程序软件一旦不稳定,也会给使用者带来干扰。因此从性能分析的角度,就要要求程序软件在应对使用者的误操作,或者是使用者因为各种原因,填写有误的数据等情况时,程序要一直保持稳定,并能够正常让使用者进行使用。当程序的某个功能模块出现异常时,程序的其它功能模块也要能够确保正常使用。程序的健壮性指标达标可以让使用者产生良好的用户体验。

3.2.4 安全性指标

程序软件的安全问题是首要问题,毕竟程序对应数据库里面存放的数据信息是庞大的,里面也包括了许多重要的个人信息,这就对程序要具备一个完善的安全机制提出了要求。因此程序必须要设置登录功能用以进行用户身份的检查,以及身份和权限的匹配,通过对不同用户身份进行功能约束,绝不容忍用户越权操作程序。另外,也需要时刻防范计算机病毒,还有黑客,通过采取针对性的办法进行安全应对,确保程序时刻处于安全的环境,让使用者放心使用。

3.3 系统流程分析

3.3.1 操作流程分析

程序上交给用户进行使用时,需要提供程序的操作流程图(如图3.1所示),这样便于用户容易理解程序的具体工作步骤,现如今程序的操作流程都有一个大致的标准,即先通过登录页面提交登录数据,通过程序验证正确之后,用户才能在程序功能操作区页面操作对应的功能。

图3.1 程序操作流程图

3.3.2 登录流程分析

在这个部分,需要对程序的登录功能模块的运行流程(如图3.2所示),进行单独说明。程序设置登录模块也是为了安全起见,让用户使用放心,登录模块主要就是让用户提交登录信息,程序进行数据验证,验证通过的用户才能够成功登录程序。

图3.2 程序登录流程图

3.3.3 信息添加流程分析

程序的添加功能就是提供给操作者录入信息的功能,不管是涉及到用户信息添加,还是其它功能模块涉及到的信息添加,程序的信息添加流程(如图3.3所示)都是一致的。程序都是先对操作者录入的数据进行判定,这个判定规则是一段提前编写完成的程序代码,当程序判定数据符合要求时,才会把操作者录入的数据登记在数据表里面,比如添加的用户信息,就会把新添加的用户信息写入用户信息的数据表文件里面。

图3.3 信息添加流程图

3.3.4 信息删除流程分析

当从程序里面删除某种无效数据时,遵循程序的信息删除流程(如图3.4所示),先要选中操作者需要删除的数据,程序为了预防操作者误删信息,也会进行提示,当操作者真正确定要删选中的信息时,该信息就会从数据库中被永久删除。

图3.4 信息删除流程图

4 系统设计

图书管理借阅系统的设计方案比如功能框架的设计,比如数据库的设计的好坏也就决定了该系统在开发层面是否高效,以及在系统维护层面是否容易维护和升级,因为在系统实现阶段是需要考虑用户的所有需求,要是在设计阶段没有经过全方位考虑,那么系统实现的部分也就无从下手,所以系统设计部分也是至关重要的一个环节,只有根据用户需求进行细致全面的考虑,才有希望开发出功能健全稳定的程序软件。

4.1 系统概要设计

本次拟开发的系统为了节约开发成本,也为了后期在维护和升级上的便利性,打算通过浏览器来实现系统功能界面的展示,让程序软件的主要事务集中在后台的服务器端处理,前端部分只用处理少量的事务逻辑。下面使用一张图(如图4.1所示)来说明程序的工作原理。

图4.1 程序工作的原理图

4.2 系统功能结构设计

在分析并得出使用者对程序的功能要求时,就可以进行程序设计了。如图4.2展示的就是管理员功能结构图。

图书管理借阅系统

系用户信息管理

反公告信息管理

收公告信息管理

申借阅记录管理

用图书信息管理

帐用户信息修改

密用户信息新增

用图书信息添加

用图书信息删除

用图书信息修改

申借阅记录添加

申借阅记录修改

申借阅记录删除

反公告信息添加

反公告信息删改

反公告信息删除

用公告信息添加

用公告信息修改

用公告信息删除

反留言信息管理

反留言信息修改

反留言信息删除

反留言信息添加

图4.2 系统功能结构图

4.3 数据库设计

程序功能操作不管是添加,修改,还是删除等功能产生的数据都是经由数据库进行数据保存和更新的,所以一个数据库设计的好坏也是程序是否好坏的判定标准,因为程序的成功,有一半的功劳都是靠数据库的优秀设计。数据库一旦设计得良好是可以减轻开发人员的开发负担的。

4.3.1 数据库E-R图设计

这个部分的设计需要使用到E-R图绘制工具,常用的工具就是Visio工具来绘制E-R模型图,这款工具不仅可以快速创建需要的E-R模型图,而且该工具提供的操作界面很简单,可以短时间内修改绘图界面的图形或者是文字的属性。在绘制E-R模型图时,要分清楚各个图形代表的含义,以免绘制出错,E-R模型图由长方形(实体),椭圆形(属性),菱形(关系)这三部分图形符号组成,绘制期间要区分开来,用准确的图形符号代表相应的数据元素。

各个实体之间的联系用下图的E-R图表示。绘制的系统E-R图见图4.8。

图书信息

属于

属于

查询

管理

用户

公告信息

管理员

图书管理借阅系统

管理

管理

管理

查询

n

n

n

n

1

1

n

1

1

1

图4.8 系统E-R图

4.3.2 数据库表结构设计

数据库系统一旦选定之后,需要根据程序要求在数据库中建立数据库文件,并在已经完成创建的数据库文件里面,为程序运行中产生的数据建立对应的数据表格,数据表结构设计就是对创建的数据表格进行字段设计,字段长度设计,字段类型设计等,当数据表格合理设计完成之后,才能正常存储相关程序运行产生的数据信息。

表4.1字典表表

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

表4.2借阅记录表

序号列名数据类型说明允许空
1IdIntid
8yonghu_idInteger借阅用户
9tushu_idInteger借阅书
10jieyue_timeDate借阅时间
11huanshu_timeDate最晚还书时间
12jieyue_typesInteger借阅状态
13create_timeDate创建时间

表4.3留言表

序号列名数据类型说明允许空
1IdIntid
14noteString留言信息
15yhnoteString留言人
16note_timeDate留言时间 Search
17replyString回复
18glreplyString回复人
19reply_timeDate回复时间 Search

表4.4公告信息表

序号列名数据类型说明允许空
1IdIntid
20news_nameString公告信息名称
21news_typesInteger公告信息类型
22news_photoString公告信息图片
23insert_timeDate公告信息时间
24news_contentString公告信息详情
25create_timeDate创建时间

表4.6图书表

序号列名数据类型说明允许空
1IdIntid
30tushu_bianhaoString图书编号
31tushu_nameString图书名称
32tushu_zuozheString作者
33tushu_photoString图书封面
34tushu_typesInteger图书类型
35chubanshe_typesInteger出版社
36tushu_kuchuenInteger图书库存
37tushu_jieyueInteger可借阅天数
38tushu_contentString详情信息
39create_timeDate创建时间

表4.7图书留言表

序号列名数据类型说明允许空
1IdIntid
40tushu_idInteger图书id
41yonghu_idInteger用户id
42tushu_liuyan_contentString留言内容
43reply_contentString回复内容
44insert_timeDate讨论时间
45create_timeDate创建时间

表4.8用户表

序号列名数据类型说明允许空
1IdIntid
46yonghu_nameString用户姓名
47yonghu_xuehaoString学号
48sex_typesInteger性别
49yonghu_id_numberString身份证号
50yonghu_phoneString手机号
51yonghu_zhuzhiString住址
52yonghu_photoString照片
53yonghu_xueyuanString学院
54yonghu_zhanyeString专业
55yonghu_banjiString班级
56create_timeDate创建时间

表4.9用户表表

序号列名数据类型说明允许空
1IdIntid
57roleString角色
58addtimeDate新增时间

5 系统实现

系统实现部分就是将系统分析,系统设计部分的内容通过编码进行功能实现,以一个实际应用系统的形式展示系统分析与系统设计的结果。前面提到的系统分析,系统设计最主要还是进行功能,系统操作逻辑的设计,也包括了存储数据的数据库方面的设计等内容,系统实现就是一个最终的实施阶段,将前面的设计成果进行物理转化,最终出具可以运用于实际的软件系统。

5.1用户信息管理

如图5.1显示的就是用户信息管理页面,此页面提供给管理员的功能有:用户信息的查询管理,可以删除用户信息、修改用户信息、新增用户信息,

还进行了对用户名称的模糊查询的条件

图5.1 用户信息管理页面

5.2 图书信息管理

如图5.2显示的就是图书信息管理页面,此页面提供给管理员的功能有:查看已发布的图书信息数据,修改图书信息,图书信息作废,即可删除。

图5.2 图书信息管理页面

5.3公告信息管理

如图5.3显示的就是公告信息管理页面,此页面提供给管理员的功能有:根据公告信息进行条件查询,还可以对公告信息进行删除、查询操作等等。

图5.3 公告信息管理页面

5.1留言信息管理

如图5.4显示的就是留言信息管理页面,此页面提供给管理员的功能有:根据留言信息进行回复、删除、查询操作等等。

图5.4 留言信息管理页面

系统

DictionaryController.java
package com.controller;


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.StringUtil;
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.DictionaryEntity;

import com.service.DictionaryService;
import com.entity.view.DictionaryView;

import com.utils.PageUtils;
import com.utils.R;

/**
 * 字典表
 * 后端接口
 * @author
 * @email
 * @date 2021-04-17
*/
@RestController
@Controller
@RequestMapping("/dictionary")
public class DictionaryController {
    private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);

    @Autowired
    private DictionaryService dictionaryService;


    @Autowired
    private TokenService tokenService;



    //级联表service


    /**
    * 后端列表
    */
    @RequestMapping("/page")
    @IgnoreAuth
    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(StringUtil.isNotEmpty(role) && "用户".equals(role)){
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        }
        params.put("orderBy","id");
        PageUtils page = dictionaryService.queryPage(params);

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

    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        DictionaryEntity dictionary = dictionaryService.selectById(id);
        if(dictionary !=null){
            //entity转view
            DictionaryView view = new DictionaryView();
            BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中

            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
        Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
            .eq("dic_code", dictionary.getDicCode())
            .eq("code_index", dictionary.getCodeIndex())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
        if(dictionaryEntity==null){
            dictionary.setCreateTime(new Date());
        //  String role = String.valueOf(request.getSession().getAttribute("role"));
        //  if("".equals(role)){
        //      dictionary.set
        //  }
            dictionaryService.insert(dictionary);
            //如果字典表新增数据的话,把数据再重新查出,放入监听器中
            List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
            ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
            Map<String, Map<Integer,String>> map = new HashMap<>();
            for(DictionaryEntity d :dictionaryEntities){
                Map<Integer, String> m = map.get(d.getDicCode());
                if(m ==null || m.isEmpty()){
                    m = new HashMap<>();
                }
                m.put(d.getCodeIndex(),d.getIndexName());
                map.put(d.getDicCode(),m);
            }
            servletContext.setAttribute("dictionaryMap",map);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
        //根据字段查询是否有相同数据
        Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
            .notIn("id",dictionary.getId())
            .eq("dic_code", dictionary.getDicCode())
            .eq("code_index", dictionary.getCodeIndex())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
        if(dictionaryEntity==null){
            //  String role = String.valueOf(request.getSession().getAttribute("role"));
            //  if("".equals(role)){
            //      dictionary.set
            //  }
            dictionaryService.updateById(dictionary);//根据id更新
            //如果字典表修改数据的话,把数据再重新查出,放入监听器中
            List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
            ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
            Map<String, Map<Integer,String>> map = new HashMap<>();
            for(DictionaryEntity d :dictionaryEntities){
                Map<Integer, String> m = map.get(d.getDicCode());
                if(m ==null || m.isEmpty()){
                    m = new HashMap<>();
                }
                m.put(d.getCodeIndex(),d.getIndexName());
                map.put(d.getDicCode(),m);
            }
            servletContext.setAttribute("dictionaryMap",map);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }



    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        dictionaryService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }



}


CommonController.java
package com.controller;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
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.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
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 com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;

/**
 * 通用接口
 */
@RestController
public class CommonController{
	private static final Logger logger = LoggerFactory.getLogger(CommonController.class);
	@Autowired
	private CommonService commonService;
	
	@Autowired
	private ConfigService configService;
	
	private static AipFace client = null;
	
	private static String BAIDU_DITU_AK = null;
	
	@RequestMapping("/location")
	public R location(String lng,String lat) {
		if(BAIDU_DITU_AK==null) {
			BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue();
			if(BAIDU_DITU_AK==null) {
				return R.error("请在配置管理中正确配置baidu_ditu_ak");
			}
		}
		Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
		return R.ok().put("data", map);
	}
	
	/**
	 * 人脸比对
	 * 
	 * @param face1 人脸1
	 * @param face2 人脸2
	 * @return
	 */
	@RequestMapping("/matchFace")
	public R matchFace(String face1, String face2, HttpServletRequest request) {
		if(client==null) {
			/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
			String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
			String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
			String token = BaiduUtil.getAuth(APIKey, SecretKey);
			if(token==null) {
				return R.error("请在配置管理中正确配置APIKey和SecretKey");
			}
			client = new AipFace(null, APIKey, SecretKey);
			client.setConnectionTimeoutInMillis(2000);
			client.setSocketTimeoutInMillis(60000);
		}
		JSONObject res = null;
		try {
			File file1 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face1);
			File file2 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face2);
			String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
			String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
			MatchRequest req1 = new MatchRequest(img1, "BASE64");
			MatchRequest req2 = new MatchRequest(img2, "BASE64");
			ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
			requests.add(req1);
			requests.add(req2);
			res = client.match(requests);
			System.out.println(res.get("result"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return R.error("文件不存在");
		} catch (IOException e) {
			e.printStackTrace();
		} 
		return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
	}
    
	/**
	 * 获取table表中的column列表(联动接口)
	 * @return
	 */
	@RequestMapping("/option/{tableName}/{columnName}")
	@IgnoreAuth
	public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		if(StringUtils.isNotBlank(level)) {
			params.put("level", level);
		}
		if(StringUtils.isNotBlank(parent)) {
			params.put("parent", parent);
		}
		List<String> data = commonService.getOption(params);
		return R.ok().put("data", data);
	}
	
	/**
	 * 根据table中的column获取单条记录
	 * @return
	 */
	@RequestMapping("/follow/{tableName}/{columnName}")
	@IgnoreAuth
	public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		params.put("columnValue", columnValue);
		Map<String, Object> result = commonService.getFollowByOption(params);
		return R.ok().put("data", result);
	}
	
	/**
	 * 修改table表的sfsh状态
	 * @param map
	 * @return
	 */
	@RequestMapping("/sh/{tableName}")
	public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
		map.put("table", tableName);
		commonService.sh(map);
		return R.ok();
	}
	
	/**
	 * 获取需要提醒的记录数
	 * @param tableName
	 * @param columnName
	 * @param type 1:数字 2:日期
	 * @param map
	 * @return
	 */
	@RequestMapping("/remind/{tableName}/{columnName}/{type}")
	@IgnoreAuth
	public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("table", tableName);
		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));
			}
		}
		
		int count = commonService.remindCount(map);
		return R.ok().put("count", count);
	}

	/**
	 * 圖表统计
	 */
	@IgnoreAuth
	@RequestMapping("/group/{tableName}")
	public R group1(@PathVariable("tableName") String tableName, @RequestParam Map<String,Object> params) {
		params.put("table1", tableName);
		List<Map<String, Object>> result = commonService.chartBoth(params);
		return R.ok().put("data", result);
	}

	
	/**
	 * 单列求和
	 */
	@RequestMapping("/cal/{tableName}/{columnName}")
	@IgnoreAuth
	public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		Map<String, Object> result = commonService.selectCal(params);
		return R.ok().put("data", result);
	}
	
	/**
	 * 分组统计
	 */
	@RequestMapping("/group/{tableName}/{columnName}")
	@IgnoreAuth
	public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		List<Map<String, Object>> result = commonService.selectGroup(params);
		return R.ok().put("data", result);
	}
	
	/**
	 * (按值统计)
	 */
	@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
	@IgnoreAuth
	public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("xColumn", xColumnName);
		params.put("yColumn", yColumnName);
		List<Map<String, Object>> result = commonService.selectValue(params);
		return R.ok().put("data", result);
	}


	/**
	 * 下面为新加的
	 *
	 *
	 *
	 */

	/**
	 * 查询字典表的分组求和
	 * @param tableName  		表名
	 * @param groupColumn  		分组字段
	 * @param sumCloum			统计字段
	 * @return
	 */
	@RequestMapping("/sum/group/{tableName}/{groupColumn}/{sumCloum}")
	@IgnoreAuth
	public R newSelectGroupSum(@PathVariable("tableName") String tableName, @PathVariable("groupColumn") String groupColumn, @PathVariable("sumCloum") String sumCloum) {
		logger.debug("newSelectGroupSum:,,Controller:{},,tableName:{},groupColumn:{},sumCloum:{}",this.getClass().getName(),tableName,groupColumn,sumCloum);
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("tableName", tableName);
		params.put("groupColumn", groupColumn);
		params.put("sumColumn", sumCloum);
		List<Map<String, Object>> result = commonService.newSelectGroupSum(params);
		return R.ok().put("data", result);
	}

	/**
	 * 查询字典表的分组统计总条数
	 * @param tableName  		表名
	 * @param groupColumn  		分组字段
	 * @return
	 */
	@RequestMapping("/count/group/{tableName}/{groupColumn}")
	@IgnoreAuth
	public R newSelectGroupCount(@PathVariable("tableName") String tableName, @PathVariable("groupColumn") String groupColumn) {
		logger.debug("newSelectGroupCount:,,Controller:{},,tableName:{},groupColumn:{}",this.getClass().getName(),tableName,groupColumn);
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("tableName", tableName);
		params.put("groupColumn", groupColumn);
		List<Map<String, Object>> result = commonService.newSelectGroupCount(params);
		return R.ok().put("data", result);
	}


	/**
	 * 当前表的日期分组求和
	 * @param tableName  		表名
	 * @param groupColumn  		分组字段
	 * @param sumCloum			统计字段
	 * @param dateFormatType	日期格式化类型   1:年 2:月 3:日
	 * @return
	 */
	@RequestMapping("/sum/group/{tableName}/{groupColumn}/{sumCloum}/{dateFormatType}")
	@IgnoreAuth
	public R newSelectDateGroupSum(@PathVariable("tableName") String tableName, @PathVariable("groupColumn") String groupColumn, @PathVariable("sumCloum") String sumCloum, @PathVariable("dateFormatType") String dateFormatType) {
		logger.debug("newSelectDateGroupSum:,,Controller:{},,tableName:{},groupColumn:{},sumCloum:{},dateFormatType:{}",this.getClass().getName(),tableName,groupColumn,sumCloum,dateFormatType);
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("tableName", tableName);
		params.put("groupColumn", groupColumn);
		params.put("sumColumn", sumCloum);
		if("1".equals(dateFormatType)){
			params.put("dateFormat", "%Y");
		}else if("2".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m");
		}else if("3".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m-%d");
		}else{
			R.error("日期格式化不正确");
		}
		List<Map<String, Object>> result = commonService.newSelectDateGroupSum(params);
		return R.ok().put("data", result);
	}

	/**
	 *
	 * 查询字典表的分组统计总条数
	 * @param tableName  		表名
	 * @param groupColumn  		分组字段
	 * @param dateFormatType	日期格式化类型   1:年 2:月 3:日
	 * @return
	 */
	@RequestMapping("/count/group/{tableName}/{groupColumn}/{dateFormatType}")
	@IgnoreAuth
	public R newSelectDateGroupCount(@PathVariable("tableName") String tableName, @PathVariable("groupColumn") String groupColumn, @PathVariable("dateFormatType") String dateFormatType) {
		logger.debug("newSelectDateGroupCount:,,Controller:{},,tableName:{},groupColumn:{},dateFormatType:{}",this.getClass().getName(),tableName,groupColumn,dateFormatType);
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("tableName", tableName);
		params.put("groupColumn", groupColumn);
		if("1".equals(dateFormatType)){
			params.put("dateFormat", "%Y");
		}else if("2".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m");
		}else if("3".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m-%d");
		}else{
			R.error("日期格式化类型不正确");
		}
		List<Map<String, Object>> result = commonService.newSelectDateGroupCount(params);
		return R.ok().put("data", result);
	}

	/**
	 * 字段加数字
	 * @param tableName 表名
	 * @param id		id
	 * @param column	字段
	 * @param number	数量
	 * @return
	 */
	@RequestMapping("/plus/{tableName}/{id}/{column}/{number}")
	public R plusCloumNumber(@PathVariable("tableName") String tableName, @PathVariable("id") Integer id, @PathVariable("column") String column, @PathVariable("number") String number) {
		logger.debug("plusCloumNumber:,,Controller:{},,tableName:{},id:{},column:{},number:{}",this.getClass().getName(),tableName,id,column,number);
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("tableName", tableName);
		params.put("id", id);
		params.put("column", column);
		params.put("number", number);
		int i = commonService.plusCloumNumber(params);
		if(i>0){
			return R.ok();
		}
		return R.error("添加失败");
	}

	/**
	 * 字段减数字
	 * @param tableName
	 * @param id
	 * @param column
	 * @param number
	 * @return
	 */
	@RequestMapping("/reduce/{tableName}/{id}/{column}/{number}")
	public R reduceCloumNumber(@PathVariable("tableName") String tableName, @PathVariable("id") Integer id, @PathVariable("column") String column, @PathVariable("number") String number) {
		logger.debug("reduceCloumNumber:,,Controller:{},,tableName:{},id:{},column:{},number:{}",this.getClass().getName(),tableName,id,column,number);
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("tableName", tableName);
		params.put("id", id);
		params.put("column", column);
		params.put("number", number);
		int i = commonService.reduceCloumNumber(params);
		if(i>0){
			return R.ok();
		}
		return R.error("添加失败");
	}

	@RequestMapping("/update/{tableName}/{id}/{column}/{value}")
	public R updateCloumValue(@PathVariable("tableName") String tableName, @PathVariable("id") Integer id, @PathVariable("column") String column, @PathVariable("value") String value) {
		logger.debug("updateCloumValue:,,Controller:{},,tableName:{},id:{},column:{},number:{}",this.getClass().getName(),tableName,id,column,value);
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("tableName", tableName);
		params.put("id", id);
		params.put("column", column);
		params.put("value", value);
		int i = commonService.updateCloumValue(params);
		if(i>0){
			return R.ok();
		}
		return R.error("添加失败");
	}



}

FileController.java
package com.controller;

import java.io.File;
import java.io.IOException;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
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,HttpServletRequest request) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+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 void download(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {
		try {
			File file = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
			if (file.exists()) {
				response.reset();
				response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName+"\"");
				response.setHeader("Cache-Control", "no-cache");
				response.setHeader("Access-Control-Allow-Credentials", "true");
				response.setContentType("application/octet-stream; charset=UTF-8");
				IOUtils.write(FileUtils.readFileToByteArray(file), response.getOutputStream());
			}

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
}

wordimage.js
/**
 * Created by JetBrains PhpStorm.
 * User: taoqili
 * Date: 12-1-30
 * Time: 下午12:50
 * To change this template use File | Settings | File Templates.
 */



var wordImage = {};
//(function(){
var g = baidu.g,
	flashObj,flashContainer;

wordImage.init = function(opt, callbacks) {
	showLocalPath("localPath");
	//createCopyButton("clipboard","localPath");
	createFlashUploader(opt, callbacks);
	addUploadListener();
	addOkListener();
};

function hideFlash(){
    flashObj = null;
    flashContainer.innerHTML = "";
}
function addOkListener() {
	dialog.onok = function() {
		if (!imageUrls.length) return;
		var urlPrefix = editor.getOpt('imageUrlPrefix'),
            images = domUtils.getElementsByTagName(editor.document,"img");
        editor.fireEvent('saveScene');
		for (var i = 0,img; img = images[i++];) {
			var src = img.getAttribute("word_img");
			if (!src) continue;
			for (var j = 0,url; url = imageUrls[j++];) {
				if (src.indexOf(url.original.replace(" ","")) != -1) {
					img.src = urlPrefix + url.url;
					img.setAttribute("_src", urlPrefix + url.url);  //同时修改"_src"属性
					img.setAttribute("title",url.title);
                    domUtils.removeAttributes(img, ["word_img","style","width","height"]);
					editor.fireEvent("selectionchange");
					break;
				}
			}
		}
        editor.fireEvent('saveScene');
        hideFlash();
	};
    dialog.oncancel = function(){
        hideFlash();
    }
}

/**
 * 绑定开始上传事件
 */
function addUploadListener() {
	g("upload").onclick = function () {
		flashObj.upload();
		this.style.display = "none";
	};
}

function showLocalPath(id) {
    //单张编辑
    var img = editor.selection.getRange().getClosedNode();
    var images = editor.execCommand('wordimage');
    if(images.length==1 || img && img.tagName == 'IMG'){
        g(id).value = images[0];
        return;
    }
	var path = images[0];
    var leftSlashIndex  = path.lastIndexOf("/")||0,  //不同版本的doc和浏览器都可能影响到这个符号,故直接判断两种
        rightSlashIndex = path.lastIndexOf("\\")||0,
        separater = leftSlashIndex > rightSlashIndex ? "/":"\\" ;

	path = path.substring(0, path.lastIndexOf(separater)+1);
	g(id).value = path;
}

function createFlashUploader(opt, callbacks) {
    //由于lang.flashI18n是静态属性,不可以直接进行修改,否则会影响到后续内容
    var i18n = utils.extend({},lang.flashI18n);
    //处理图片资源地址的编码,补全等问题
    for(var i in i18n){
        if(!(i in {"lang":1,"uploadingTF":1,"imageTF":1,"textEncoding":1}) && i18n[i]){
            i18n[i] = encodeURIComponent(editor.options.langPath + editor.options.lang + "/images/" + i18n[i]);
        }
    }
    opt = utils.extend(opt,i18n,false);
	var option = {
		createOptions:{
			id:'flash',
			url:opt.flashUrl,
			width:opt.width,
			height:opt.height,
			errorMessage:lang.flashError,
			wmode:browser.safari ? 'transparent' : 'window',
			ver:'10.0.0',
			vars:opt,
			container:opt.container
		}
	};

	option = extendProperty(callbacks, option);
	flashObj = new baidu.flash.imageUploader(option);
    flashContainer = $G(opt.container);
}

function extendProperty(fromObj, toObj) {
	for (var i in fromObj) {
		if (!toObj[i]) {
			toObj[i] = fromObj[i];
		}
	}
	return toObj;
}

//})();

function getPasteData(id) {
	baidu.g("msg").innerHTML = lang.copySuccess + "</br>";
	setTimeout(function() {
		baidu.g("msg").innerHTML = "";
	}, 5000);
	return baidu.g(id).value;
}

function createCopyButton(id, dataFrom) {
	baidu.swf.create({
			id:"copyFlash",
			url:"fClipboard_ueditor.swf",
			width:"58",
			height:"25",
			errorMessage:"",
			bgColor:"#CBCBCB",
			wmode:"transparent",
			ver:"10.0.0",
			vars:{
				tid:dataFrom
			}
		}, id
	);

	var clipboard = baidu.swf.getMovie("copyFlash");
	var clipinterval = setInterval(function() {
		if (clipboard && clipboard.flashInit) {
			clearInterval(clipinterval);
			clipboard.setHandCursor(true);
			clipboard.setContentFuncName("getPasteData");
			//clipboard.setMEFuncName("mouseEventHandler");
		}
	}, 500);
}
createCopyButton("clipboard", "localPath");

声明

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

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

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

相关文章

构建在线教育系统源码:企业培训APP开发的技术指南

在数字化浪潮的推动下&#xff0c;企业培训正从传统课堂转向在线教育模式。构建一个高效、稳定且可扩展的在线教育系统源码&#xff0c;已经成为开发企业培训APP的关键。在本文中&#xff0c;我们将深入探讨构建在线教育系统源码的核心技术&#xff0c;并提供一份开发企业培训A…

免费分享一套SpringBoot+Vue个人理财管理系统【论文+源码+SQL脚本】,帅呆了~~

大家好&#xff0c;我是java1234_小锋老师&#xff0c;看到一个不错的SpringBootVue个人理财管理系统&#xff0c;分享下哈。 项目视频演示 【免费】SpringbootVue个人理财管理系统 Java毕业设计_哔哩哔哩_bilibili 项目介绍 随着信息技术在管理上越来越深入而广泛的应用&am…

记录一次polarDB出现Waiting for table metadata lock

在业务实践中&#xff0c;常见的 DDL 阻塞 原因是由于无法获取到 MDL 锁&#xff0c;即 Waiting for table metadata lock 。借助 metadata_lock 表&#xff0c;可以快速定位到 DDL 阻塞的原因。 元数据锁&#xff08;MDL&#xff09; MDL加锁过程是系统自动控制&#xff0c;无…

京东商品信息快速获取:API返回值实战教程

京东商品信息快速获取通常通过调用京东的API接口来实现&#xff0c;特别是针对商品搜索和商品详情等需求。以下是一个基于京东商品信息API返回值的实战教程&#xff0c;帮助您快速理解和利用这些API返回的数据。 1. 注册与认证 首先&#xff0c;您需要在京东开放平台&#xf…

Python爬虫的这几个实用技巧你都知道吗?

Python爬虫是一种强大的网络数据抓取工具&#xff0c;通过编写Python脚本来自动化地访问网页、提取所需信息并保存到本地。以下是Python爬虫的8大实用技巧&#xff0c;详细讲解如下&#xff1a; 1. 发送HTTP请求 基本方法&#xff1a;使用requests库发送HTTP请求是Python爬虫…

【学术会议征稿】第五届机械工程、智能制造与自动化技术国际学术会议(MEMAT 2024)

第五届机械工程、智能制造与自动化技术国际学术会议&#xff08;MEMAT 2024&#xff09; The 5th International Conference on Mechanical Engineering, Intelligent Manufacturing and Automation Technology 目前&#xff0c;我国自动化技术随着科学技术水平的不断提高已经…

责任链设计模式详解

责任链设计模式详解 一、定义 责任链设计模式&#xff08;Chain of Responsibility Pattern&#xff09;是一种行为设计模式&#xff0c;它允许多个对象有机会处理请求&#xff0c;从而避免请求的发送者和接收者之间的耦合。这种模式将这些对象连接成一条链&#xff0c;并沿着…

麒麟kylin v10 sp3 升级glibc2.28 到 2.31

1. 下载glibc 2.31 wget https://mirrors.aliyun.com/gnu/glibc/glibc-2.31.tar.gz 2.解压 tar -xf glibc-2.31.tar.gz cd glibc-2.31 mkdir build && cd build 3.修改 Makefile 125行添加一行 yum reinstall libxcrypt -y scripts/test-installation.pl 128行修…

java Boss直聘爬虫数据分析

摘要 本报告利用Java和Selenium爬虫技术获取数据&#xff0c;并使用ECharts库对薪资数据进行可视化分析&#xff0c;旨在探究不同经验和学历的薪资分布情况。 数据来源 数据来源于Boss直聘&#xff0c;使用Java结合Selenium库进行数据抓取。 数据总数&#xff1a;约2000家企…

虚幻引擎(Unreal Engine)技术使得《黑神话悟空传》大火,现在重视C++的开始吃香了,JAVA,Go,Unity都不能和C++相媲美!

虚幻引擎&#xff08;Unreal Engine&#xff09;火了黑神话游戏。 往后&#xff0c;会有大批量的公司开始模仿这个赛道&#xff01; C 的虚拟引擎技术通常指的是使用 C 语言开发的游戏引擎&#xff0c;如虚幻引擎&#xff08;Unreal Engine&#xff09;等。以下是对 C 虚拟引…

[WUSTCTF2020]spaceclub(我把输入的字符切片研究了)

上sublime txt 每一行的长短对应一个二进制位&#xff0c;长空格是1&#xff0c;短空格是0&#xff0c;全部替换掉得到 上python脚本 import binasciiwith open(attachment_5.txt, r) as file:lines file.readlines() # 逐行读取文本内容output # 初始化输出字符串# 遍历…

【C++题解】1145. 数列求和

欢迎关注本专栏《C从零基础到信奥赛入门级&#xff08;CSP-J&#xff09;》 问题&#xff1a;1145. 数列求和 类型&#xff1a;递归基础 题目描述&#xff1a; 有一数列如下&#xff1a; 1 2 4 7 11 16 22 …… 试求该数列前 N 项之和。 输入&#xff1a; 一个整数 N &…

STM32G474定时器触发1次引起ADC转换直至DMA请求传输完所有通道的数据

STM32G474使用定时器1触发1次ADC转换&#xff0c;然后交给DMA循环执行&#xff0c;实现多通道ADC转换和多通道数据传输。若定时器1停止工作&#xff0c;则ADC转换也会随之停止&#xff0c;当然也不会再有DMA数据传输。 1、ADC触发信号分配 2、DMA多路复合器分配&#xff0c;指…

微信表情包格式推荐要求:240*240 +gif

微信表情包格式要求&#xff1a;240*240 gif

2024了,Neo4j能显示节点图片吗?

经过一番调研&#xff0c;答案是官方的是不能的.但有一个中文版可以显示网络图片作为节点背景 如通义千问说说&#xff1a; Neo4j 图数据库本身并不直接支持在节点中存储和显示图片。但是&#xff0c;你可以通过几种方式间接实现这一功能&#xff1a;1. 存储图片URL 最简单的…

K8S持久化存储数据

环境&#xff1a; Ubuntu-1:192.168.114.110作为主 Ubuntu-2:192.168.114.120作为从1&#xff0c;node节点1 Ubuntu-3:192.168.114.130作为从2&#xff0c;node节点2 持久化volumeMounts pod里面&#xff1a;emptyDir和hostPath。存储在node&#xff0c;NFS...&#xff0c;Clo…

微软Win11 24H2最新可选更新补丁26100.1591发布!

系统之家于8月28日发出最新报道&#xff0c;微软面向Win11 24H2用户推出八月最新的可选更新KB5041865&#xff0c;系统更新后版本号升至26100.1591。本次更新进行了多项改进&#xff0c;还优化了小组件面板。接下来&#xff0c;跟随小编一起深入了解这次更新的详细内容吧。 更新…

RSA非对称性加密02: 加密redis的连接密码(下)-私钥加密,公钥解密

全文目录,一步到位 1.前言简介1.1 专栏传送门1.1.2 上文传送门 2. 使用方式2.1 使用druid自带的RSA加密工具2.1.1 引入druid依赖2.1.2 原yml配置(对比使用)2.1.2 新yml配置 2.2 springboot的redis配置类2.2.1 例如在RedisConfig中2.2.2 设置序列化与反序列化代码示例如下: 2.3 …

Golang小项目(1)

Golang小项目(1) 前言 本项目适合Golang初学者,通过简单的项目实践来加深对Golang的基本语法和Web开发的理解。 建议前往 torna.top 查阅效果更佳 项目结构 . ├── main.go └── static├── form.html└── index.html项目流程图 定义三个路由: /:首页,显示static…

SWOT分析:解锁个人优势,规划未来成功路径

在传统的SWOT分析中&#xff0c;人们常常采用手工绘制的方式来创建图表&#xff0c;这种方式不仅过程繁琐&#xff0c;而且耗费大量时间和精力。为了简化这一流程&#xff0c;本文推荐使用可免费使用的实时在线编辑工具——即时白板&#xff0c;它是一款高效便捷的SWOT分析工具…