一个开源的企业级自动化办公(OA)系统项目 -SpringBoot依赖升级篇

项目: https://gitee.com/aaluoxiang/oa_system

介绍:

办公自动化(OA)是面向组织的日常运作和管理,员工及管理者使用频率最高的应用系统,极大提高公司的办公效率。oasys是一个OA办公自动化系统,使用Maven进行项目管理,基于springboot框架开发的项目,mysql底层数据库,前端采用freemarker模板引擎,Bootstrap作为前端UI框架,集成了jpa、mybatis等框架

  1. 我直接用IDEA克隆打开的,发现报错javax.validation.Validationorg.hibernate.validator.constraints.NotEmpty@RunWith @Test 需要junit4
<dependency>
	<groupId>org.hibernate</groupId>
	<artifactId>hibernate-validator</artifactId>
	<version>5.3.4.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.validation/validation-api -->
<dependency>
	<groupId>javax.validation</groupId>
	<artifactId>validation-api</artifactId>
	<version>2.0.1.Final</version>
</dependency>
<dependency>
	<groupId>junit</groupId>
	<artifactId>junit</artifactId>
	<scope>test</scope>
	<version>4.13.2</version>
</dependency>

<!-- springload maven下载不了,舍弃 -->

SpringData JPA的函数变动:

SpringBoot 2.0以下SpringBoot 2.0 以上
findOne()findById().get()
new PageRequest()PageRequest().of()
new Sort()Sort.by()
delete()deleteById()
  1. No property in found for type Notepaper!
public interface NotepaperDao extends JpaRepository<Notepaper, Long> {
	
	//查找
	@Query(nativeQuery=true,value="SELECT * from aoa_notepaper n where n.notepaper_user_id=?1 ORDER BY n.create_time DESC LIMIT 0,5")
	List<Notepaper> findByUserIdOrderByCreateTimeDesc(long userid);
	
	// 根据用户找便签
	Page<Notepaper> findByUserIdOrderByCreateTimeDesc(User user,Pageable pa);

	// 根据用户找便签
//	Page<Notepaper> findByUserIdOrderByCreateTimeDesc(Pageable page);

	/**
	 * 模糊查询
	 * 
	 * @param baseKey
	 * @param page
	 * @return
	 */
	Page<Notepaper> findByTitleLikeOrderByCreateTimeDesc(String baseKey, Pageable page);
}

3.Operator SIMPLE_PROPERTY on users requires a scalar argument

public interface DaymanageDao extends JpaRepository<ScheduleList,Long>{
	
	List<ScheduleList> findByUser(User user);
	//这两行名字改下
	List<ScheduleList> findByUsersIn(List<User> users);
	//这两行名字改下
	Page<ScheduleList> findByUsersIn(List<User> users,Pageable pa);
	
	Page<ScheduleList> findByUser(User user,Pageable pa);
	
	Page<ScheduleList> findByUserAndUsersIn(User user,List<User> users,Pageable pa);
}
  1. 替换 拦截器
//配置拦截器
@Configuration
public class Interceptorconfig implements WebMvcConfigurer {
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        configurer.setUseSuffixPatternMatch(false);
    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**")
                .addResourceLocations("classpath:/static/");
    }

}
  1. application.yml
attachment:
    roopath: D:/oasys/resources/static/attachment
file:
    root:
        path: D:/oasys/resources/static/file
img:
    rootpath: D:/oasys/resources/static/images
mybatis:
    mapper-locations: classpath*:/mappers/*.xml
    type-aliases-package: cn.gson.oasys.model.entity
server:
    port: 8088
spring:
    datasource:
        driver-class-name: com.mysql.cj.jdbc.Driver
        password: root
        url: jdbc:mysql://localhost:3306/oasys?autoReconnect=true&useSSL=false&characterEncoding=utf-8&serverTimezone=GMT%2B8
        username: root
    freemarker:
        suffix: .ftl                                 # 设置模板后缀名
        content-type: text/html                      # 设置文档类型
        charset: UTF-8                               # 设置页面编码格式
        cache: false                                 # 设置页面缓存
        template-loader-path: classpath:/templates   # 设置ftl文件路径
    http:
        multipart:
            enabled: true
            file-size-threshold: 5MB
            max-file-size: 500MB
            max-request-size: 200MB
            resolve-lazily: false

  1. 创建文件夹
D:/oasys/resources/static/attachment
D:/oasys/resources/static/file
D:/oasys/resources/static/images 

将 oasys.jpg 图片 放到 D:/oasys/resources/static/images 下

  1. 暂时能记得的就这么多,启动无报错!

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

文章原创,项目非原创

chsengni@126.com

<siteMapNode url="~/PersonManage/BranchManage.aspx" title="机构管理" description="" /> <siteMapNode url="~/PersonManage/DepartManage.aspx" title="部门管理" description="" /> <siteMapNode url="~/SysManage/UserManage.aspx" title="用户管理" description="" /> <siteMapNode url="~/SysManage/CreateUser.aspx" title="保存用户信息" description="" /> <siteMapNode url="~/ScheduleManage/PersonNote/PersonNote.aspx" title="我的便签" description="" /> <siteMapNode url="~/ManualSign/ManualSign.aspx" title="员工签到、签退" description="" /> <siteMapNode url="~/ManualSign/Search/ManualSignSearch.aspx" title="员工考勤历史记录查询" description="" /> <siteMapNode url="~/ManualSign/SignStatistic.aspx" title="员工考勤统计" description="" /> <siteMapNode url="~/ScheduleManage/PersonSchedule/PersonSchedule.aspx" title="日程管理" description="" /> <siteMapNode url="~/ScheduleManage/DepartSchedule/DepartSchedule.aspx" title="部门日程" description="" /> <siteMapNode url="~/File/RecycleBin.aspx" title="回收站" description="" /> <siteMapNode url="~/File/FileManager/FileSearch.aspx" title="文件搜索" description="" /> <siteMapNode url="~/Message/MessageManage/MessageManage.aspx" title="消息管理" description="" /> <siteMapNode url="~/SysManage/Log/LoginLog.aspx" title="登录日志" description="" /> <siteMapNode url="~/SysManage/Log/OperateLog.aspx" title="操作日志" description="" /> <siteMapNode url="~/SysManage/MenuAdjust.aspx" title="菜单排序" description="" /> <siteMapNode url="~/ManualSign/Search/SignStatistic.aspx" title="员工考勤统计" description="" />
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

陈增林

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值