项目: https://gitee.com/aaluoxiang/oa_system
介绍:
办公自动化(OA)是面向组织的日常运作和管理,员工及管理者使用频率最高的应用系统,极大提高公司的办公效率。oasys是一个OA办公自动化系统,使用Maven进行项目管理,基于springboot框架开发的项目,mysql底层数据库,前端采用freemarker模板引擎,Bootstrap作为前端UI框架,集成了jpa、mybatis等框架
- 我直接用IDEA克隆打开的,发现报错
javax.validation.Validation
、org.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() |
- 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);
}
- 替换 拦截器
//配置拦截器
@Configuration
public class Interceptorconfig implements WebMvcConfigurer {
@Overridepublic void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false);}@Overridepublic void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");}}
- 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/*.xmltype-aliases-package: cn.gson.oasys.model.entity
server:port: 8088
spring:datasource:driver-class-name: com.mysql.cj.jdbc.Driverpassword: rooturl: jdbc:mysql://localhost:3306/oasys?autoReconnect=true&useSSL=false&characterEncoding=utf-8&serverTimezone=GMT%2B8username: rootfreemarker:suffix: .ftl # 设置模板后缀名content-type: text/html # 设置文档类型charset: UTF-8 # 设置页面编码格式cache: false # 设置页面缓存template-loader-path: classpath:/templates # 设置ftl文件路径http:multipart:enabled: truefile-size-threshold: 5MBmax-file-size: 500MBmax-request-size: 200MBresolve-lazily: false
- 创建文件夹
D:/oasys/resources/static/attachment
D:/oasys/resources/static/file
D:/oasys/resources/static/images
将 oasys.jpg 图片 放到 D:/oasys/resources/static/images 下
- 暂时能记得的就这么多,启动无报错!
文章原创,项目非原创
chsengni@126.com