Compare commits

..

No commits in common. "3c138d6e3949254406c35da544baed035ff80fc8" and "515ce249bd880ec0494d595b9f853a84b85b5fc7" have entirely different histories.

9 changed files with 20 additions and 42 deletions

View File

@ -5,7 +5,6 @@ import club.joylink.xiannccda.constants.common.CommonLogTypeEnum;
import club.joylink.xiannccda.constants.common.CommonLogTypeEnum.SubEventType;
import club.joylink.xiannccda.constants.SystemContext;
import club.joylink.xiannccda.event.OperateEvent;
import com.google.common.collect.Maps;
import jakarta.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
@ -23,7 +22,6 @@ import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.security.oauth2.jwt.JwtDecoder;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.context.request.RequestContextHolder;
@ -47,8 +45,8 @@ public class SystemEventAspect {
Jwt jwt = jwtDecoder.decode(returnObj.toString());
String userId = jwt.getClaimAsString("sub");
obj.setUserId(Long.parseLong(userId));
SystemContext.publishEvent(obj);
}
SystemContext.publishEvent(obj);
}
}
@ -68,15 +66,11 @@ public class SystemEventAspect {
if (Objects.nonNull(commonLogAnno)) {
GetMapping getMapping = ms.getMethod().getDeclaredAnnotation(GetMapping.class);
PostMapping postMapping = ms.getMethod().getDeclaredAnnotation(PostMapping.class);
DeleteMapping deleteMapping = ms.getMethod().getDeclaredAnnotation(DeleteMapping.class);
Map<String, Object> params = Map.of();
Map<String, Object> params = null;
if (Objects.nonNull(getMapping)) {
params = getRequestParam(getMapping.value(), joinPoint.getArgs());
} else if (Objects.nonNull(postMapping)) {
params = getRequestParam(postMapping.value(), joinPoint.getArgs());
} else if (Objects.nonNull(deleteMapping)) {
params = getRequestParam(deleteMapping.value(), joinPoint.getArgs());
}
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
String uri = request.getRequestURI();

View File

@ -83,12 +83,12 @@ public class AlertRecordController {
}
@GetMapping("/page/detail")
@PostMapping("/page/detail")
@SecurityRequirement(name = "jwt")
@Operation(summary = "分页查询报警记录详情")
@ApiResponse(description = "报警记录详情")
@CommonLogAnno(name = "报警信息-列表数据2", logType = CommonLogTypeEnum.OPERATE, subLogType = SubEventType.QUERY)
public Page<NccAlertInfo> pageQueryAlertDetail(AlertRecordQueryDTO queryDTO) {
public Page<NccAlertInfo> pageQueryAlertDetail(@RequestBody AlertRecordQueryDTO queryDTO) {
return alertRecordService.pageQueryAlertDetail(queryDTO);
}

View File

@ -55,7 +55,6 @@ public class UserController {
@PostMapping("/info")
@Operation(summary = "用户信息")
@SecurityRequirement(name = "jwt")
@ApiResponse(description = "用户信息")
public UserInfoAuthDTO userInfo(Principal user) {
return this.userService.userInfo((JwtAuthenticationToken) user);

View File

@ -1,12 +1,8 @@
package club.joylink.xiannccda.dto.event;
import club.joylink.xiannccda.constants.common.CommonLogTypeEnum;
import club.joylink.xiannccda.entity.EventLog;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import lombok.Data;
@Data
public class EventLogQueryDTO extends PageDTO<EventLog> {
private CommonLogTypeEnum logType;
}

View File

@ -6,11 +6,9 @@ import club.joylink.xiannccda.dto.user.UserDetailDTO;
import club.joylink.xiannccda.dto.user.UserQueryDTO;
import club.joylink.xiannccda.entity.EventLog;
import club.joylink.xiannccda.entity.User;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>
@ -23,5 +21,5 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface EventLogMapper extends BaseMapper<EventLog> {
Page<EventLogPageDTO> detailPage(Page page, @Param("ew") QueryWrapper<EventLog> dto);
Page<EventLogPageDTO> detailPage(EventLogQueryDTO dto);
}

View File

@ -10,7 +10,6 @@ import club.joylink.xiannccda.mapper.LineInfoMapper;
import club.joylink.xiannccda.repository.IEventLogRepository;
import club.joylink.xiannccda.repository.ILineInfoRepository;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -31,10 +30,6 @@ public class EventLogRepository extends ServiceImpl<EventLogMapper, EventLog> im
@Override
public Page<EventLogPageDTO> detailPage(EventLogQueryDTO dto) {
QueryWrapper<EventLog> qw = new QueryWrapper<>();
qw.eq("A.event_type", dto.getLogType());
return this.baseMapper.detailPage(dto, qw);
return this.baseMapper.detailPage(dto);
}
}

View File

@ -79,8 +79,6 @@ public class AlertTipService {
entity.setDrivingInfo(saveDTO.getDrivingInfo());
entity.setSubmissionInfo(saveDTO.getSubmissionInfo());
entity.setId(saveDTO.getId());
entity.setLineId(saveDTO.getLineId());
entity.setLineType(saveDTO.getLineType());
if (CollectionUtils.isNotEmpty(saveDTO.getTipTimeIds())) {
String selectIds = this.timeConfigService.getCache().stream().filter(d -> saveDTO.getTipTimeIds().contains(d.getTimeType())).map(d -> d.getId().toString())
.collect(Collectors.joining(StringPool.COMMA));

View File

@ -117,7 +117,7 @@ public class UserService {
DefaultUserRuleEnum userDefulatRole = Objects.nonNull(defulatRole) ? DefaultUserRuleEnum.ADMIN : DefaultUserRuleEnum.USER;
long remainingSecond = 0;
List<AuthRole> roleList = null;
if (Objects.nonNull(iat) && Objects.nonNull(exp)) {
if (Objects.nonNull(iat) && !Objects.nonNull(exp)) {
Instant iatInstant = (Instant) iat;
Instant expInstant = (Instant) exp;
remainingSecond = expInstant.getEpochSecond() - iatInstant.getEpochSecond();

View File

@ -3,22 +3,20 @@
<mapper namespace="club.joylink.xiannccda.mapper.EventLogMapper">
<select id="detailPage" resultType="club.joylink.xiannccda.dto.event.EventLogPageDTO">
select A.id,
A.face_name,
A.event_type,
A.sub_event_type,
A.uri,
A.method,
A.parameters,
A.create_date_time,
A.from_user_id,
A.request_success,
B.`name` as user_name,
B.mobile
A.face_name,
A.event_type,
A.sub_event_type,
A.uri,
A.method,
A.parameters,
A.create_date_time,
A.from_user_id,
A.request_success,
B.`name` as user_name,
B.mobile
from event_log A
left join user B on A.from_user_id = B.id
left join user B on A.from_user_id = B.id
where 1 = 1
<if test="ew.sqlSegment !=null and ew.sqlSegment !=''">
and ${ew.sqlSegment}
</if>
</select>
</mapper>