日志-调整
This commit is contained in:
parent
78be5a048f
commit
92134db503
|
|
@ -102,6 +102,14 @@
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>10</source>
|
||||
<target>10</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
package com.nflg.mobilebroken.admin.config;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @decription
|
||||
* @Author 大米
|
||||
* @Date 2022/7/20 17:57
|
||||
**/
|
||||
@Configuration
|
||||
public class JacksonMapper {
|
||||
|
||||
|
||||
@Bean
|
||||
public ObjectMapper serializingObjectMapper() {
|
||||
JavaTimeModule module = new JavaTimeModule();
|
||||
module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
||||
// module.addDeserializer(LocalDateTime.class, MyLocalDateTimeDeserializer.INSTANCE);
|
||||
|
||||
SimpleModule simpleModule = new SimpleModule();
|
||||
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
|
||||
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
|
||||
// simpleModule.addSerializer(BigDecimal.class, new BigDecimalSerializer());
|
||||
return Jackson2ObjectMapperBuilder.json()
|
||||
.modules(module, simpleModule)
|
||||
.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -59,14 +59,14 @@ public class RequestLogController extends ControllerBase {
|
|||
|
||||
/**
|
||||
* 清除日志
|
||||
* @param rowIds
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("del")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ApiResult<Boolean> del(@RequestBody List<Long> rowIds){
|
||||
public ApiResult<Boolean> del(@RequestBody RequestLogQuery query){
|
||||
|
||||
VUtils.trueThrow(CollUtil.isEmpty(rowIds)).throwMessage(STATE.ParamErr,"请选择要删除的行");
|
||||
List<Long> rowIds = logService.selectRowIds(query);
|
||||
logService.getBaseMapper().deleteByIds(rowIds);
|
||||
|
||||
logDetailService.getBaseMapper().deleteByIds(rowIds);
|
||||
|
|
|
|||
|
|
@ -181,7 +181,8 @@ public class TicketController extends ControllerBase {
|
|||
String html = templateEngine.process("ticketpdf", context);
|
||||
|
||||
response.setContentType(MediaType.APPLICATION_PDF_VALUE);
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode(ticket.getTitle() + ".pdf", StandardCharsets.UTF_8));
|
||||
String encode = URLEncoder.encode(ticket.getTitle() + ".pdf", StandardCharsets.UTF_8);
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" +encode );
|
||||
// 生成PDF
|
||||
try {
|
||||
ConverterProperties converterProperties = new ConverterProperties();
|
||||
|
|
|
|||
|
|
@ -22,4 +22,6 @@ public interface TBaseRequestLogMapper extends BaseMapper<TBaseRequestLog> {
|
|||
Page<TBaseRequestLog> getList(@Param("page")Page<PageBaseQuery> page, @Param("query") PageBaseQuery query);
|
||||
|
||||
void delByIds(@Param("ids")List<Long> ids);
|
||||
|
||||
List<Long> selectRowIds(@Param("query") PageBaseQuery query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,4 +22,7 @@ public interface ITBaseRequestLogService extends IService<TBaseRequestLog> {
|
|||
Page<TBaseRequestLog> getList(@Param("page")Page<PageBaseQuery> page, @Param("query") PageBaseQuery query);
|
||||
|
||||
void delByIds(@Param("ids") List<Long> ids);
|
||||
|
||||
|
||||
List<Long> selectRowIds(@Param("query") PageBaseQuery query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,4 +30,8 @@ public class TBaseRequestLogServiceImpl extends ServiceImpl<TBaseRequestLogMappe
|
|||
public void delByIds(@Param("ids") List<Long> ids){
|
||||
this.getBaseMapper().delByIds(ids);
|
||||
}
|
||||
|
||||
public List<Long> selectRowIds(@Param("query") PageBaseQuery query){
|
||||
return this.getBaseMapper().selectRowIds(query);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
and data_create_user_no=#{query.dataCreateUserNo}
|
||||
</if>
|
||||
<if test="query.createStartTime!=null and query.createStartTime!=''">
|
||||
and data_create_time>= #{query.createStartTime} and data_create_time <= #{query.createEndTime}
|
||||
and data_create_time>= #{query.createStartTime} and data_create_time <= date_add(#{query.createEndTime}, INTERVAL 1 DAY )
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
|
|
@ -25,6 +25,10 @@
|
|||
<include refid="whr"/>
|
||||
</select>
|
||||
|
||||
<select id="selectRowIds" resultType="java.lang.Long">
|
||||
select row_id from t_base_request_log where 1=1 <include refid="whr"/>
|
||||
</select>
|
||||
|
||||
<delete id="delByIds">
|
||||
delete from t_base_request_log where row_id in
|
||||
<foreach collection="ids" open="(" close=")" separator="," item="item">
|
||||
|
|
|
|||
Loading…
Reference in New Issue