diff --git a/luoo_common/src/main/java/util/ExcelUtil.java b/luoo_common/src/main/java/util/ExcelUtil.java index 579600d..52c5d75 100644 --- a/luoo_common/src/main/java/util/ExcelUtil.java +++ b/luoo_common/src/main/java/util/ExcelUtil.java @@ -26,7 +26,6 @@ import annotation.Excel; import annotation.Excels; import annotation.Excel.ColumnType; import annotation.Excel.Type; -import com.sun.xml.internal.ws.util.UtilException; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.RegExUtils; import org.apache.commons.lang3.reflect.FieldUtils; @@ -267,7 +266,6 @@ public class ExcelUtil{ catch (Exception e) { log.error("导入Excel异常{}", e.getMessage()); - throw new UtilException(e.getMessage()); } finally { diff --git a/luoo_user/pom.xml b/luoo_user/pom.xml index 73faf45..3789860 100644 --- a/luoo_user/pom.xml +++ b/luoo_user/pom.xml @@ -147,6 +147,17 @@ ${mybatis-plus.version} compile + + + + com.querydsl + querydsl-apt + + + com.querydsl + querydsl-jpa + + app @@ -174,6 +185,24 @@ http://116.62.145.60:2375 + + + com.mysema.maven + apt-maven-plugin + 1.1.3 + + + generate-sources + + process + + + target/generated-sources/java + com.querydsl.apt.jpa.JPAAnnotationProcessor + + + + diff --git a/luoo_user/src/main/java/com/luoo/user/config/WebMvcConfig.java b/luoo_user/src/main/java/com/luoo/user/config/WebMvcConfig.java new file mode 100644 index 0000000..2cd1d35 --- /dev/null +++ b/luoo_user/src/main/java/com/luoo/user/config/WebMvcConfig.java @@ -0,0 +1,23 @@ +package com.luoo.user.config; + +import com.querydsl.jpa.impl.JPAQueryFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import javax.persistence.EntityManager; + + +/** + * 使用QueryDSL的功能时,会依赖使用到JPAQueryFactory,而JPAQueryFactory在这里依赖使用EntityManager, + * 所以在主类中做如下配置,使得Spring自动帮我们注入EntityManager与自动管理JPAQueryFactory + * @author NJ + * @create 2022/12/5 15:12 + */ +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + + @Bean + public JPAQueryFactory jpaQuery(EntityManager entityManager) { + return new JPAQueryFactory(entityManager); + } +} diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java b/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java index 6f0ac9d..6c33706 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java @@ -155,6 +155,9 @@ public class UserPointLogService { if (taskPointId != null) { TaskPoint taskPoint = taskPointService.getTaskPoint(taskPointId); + if(taskPoint == null) { + return ; + } // 获取积分任务类型 Integer type = taskPoint.getType();