fix: 审核列表与申报可见性,并统一 Docker 北京时区
修复团支部等角色待审漏数、PageParam 对 Collection 的 IN 条件失效,以及容器默认 UTC 导致时间偏移 8 小时的问题。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,6 +14,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* 启动类
|
||||
* Created by WebSoft on 2018-02-22 11:29:03
|
||||
@@ -29,6 +31,8 @@ import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||
public class WebSoftApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Docker 默认 UTC,未设置 TZ 时 LocalDateTime.now() 会比北京时间慢 8 小时
|
||||
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
|
||||
SpringApplication.run(WebSoftApplication.class, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -171,6 +171,10 @@ public class BaseController {
|
||||
return;
|
||||
}
|
||||
Set<Integer> userIds = resolveScopedUserIdsByOrganization();
|
||||
// 组织树解析偶发漏掉本人时,仍保证能看到自己提交的数据
|
||||
if (loginUserId != null) {
|
||||
userIds.add(loginUserId);
|
||||
}
|
||||
if (!userIds.isEmpty()) {
|
||||
userIdsSetter.accept(userIds);
|
||||
}
|
||||
|
||||
@@ -260,10 +260,30 @@ public class PageParam<T, U extends BaseParam> extends Page<T> {
|
||||
queryWrapper.isNotNull(fieldName);
|
||||
break;
|
||||
case IN:
|
||||
queryWrapper.in(fieldName, fieldValue);
|
||||
// Collection 必须走 in(column, Collection),不能走 in(column, Object...),
|
||||
// 否则整个集合会被当成单个参数,导致 user_id IN (?) 永远匹配不到。
|
||||
if (fieldValue instanceof Collection) {
|
||||
Collection<?> coll = (Collection<?>) fieldValue;
|
||||
if (!coll.isEmpty()) {
|
||||
queryWrapper.in(fieldName, coll);
|
||||
}
|
||||
} else if (fieldValue != null && fieldValue.getClass().isArray()) {
|
||||
queryWrapper.in(fieldName, (Object[]) fieldValue);
|
||||
} else {
|
||||
queryWrapper.in(fieldName, fieldValue);
|
||||
}
|
||||
break;
|
||||
case NOT_IN:
|
||||
queryWrapper.notIn(fieldName, fieldValue);
|
||||
if (fieldValue instanceof Collection) {
|
||||
Collection<?> coll = (Collection<?>) fieldValue;
|
||||
if (!coll.isEmpty()) {
|
||||
queryWrapper.notIn(fieldName, coll);
|
||||
}
|
||||
} else if (fieldValue != null && fieldValue.getClass().isArray()) {
|
||||
queryWrapper.notIn(fieldName, (Object[]) fieldValue);
|
||||
} else {
|
||||
queryWrapper.notIn(fieldName, fieldValue);
|
||||
}
|
||||
break;
|
||||
case IN_STR:
|
||||
if (fieldValue instanceof String) {
|
||||
|
||||
@@ -170,6 +170,11 @@ public class ReviewListController extends BaseController {
|
||||
if (!isBackendAccess(param) || !hasBackendScopeRole()) {
|
||||
return;
|
||||
}
|
||||
// 已按当前审核人收敛时,不再按申报人组织过滤。
|
||||
// 否则团支部/院团委等角色会漏掉「已指派给自己、但申报人不在本组织树」的待审。
|
||||
if (param.getUserId() != null) {
|
||||
return;
|
||||
}
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser == null || loginUser.getOrganizationId() == null) {
|
||||
return;
|
||||
|
||||
@@ -264,9 +264,6 @@
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
@@ -467,6 +464,10 @@
|
||||
AND latest_group.pk = grouped.pk
|
||||
INNER JOIN gxmu_review_list latest ON latest.id = latest_group.latest_id
|
||||
<where>
|
||||
<!-- 个人审核列表只看「当前轮到我」的最新节点,避免历史参与过的流程被带出 -->
|
||||
<if test="param.userId != null">
|
||||
AND latest.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND latest.status = #{param.status}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user