mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 10:56:50 +08:00
'pageadd'
This commit is contained in:
162
servers/modify-221027/pom.xml
Normal file
162
servers/modify-221027/pom.xml
Normal file
@@ -0,0 +1,162 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.6.3</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>modify-221027</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<name>modify-221027</name>
|
||||
<description>修改课程考试的一个数据错误</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>xboe-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<!-- java-jwt -->
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.18.3</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.bitbucket.b_c</groupId>
|
||||
<artifactId>jose4j</artifactId>
|
||||
<version>0.7.9</version>
|
||||
</dependency>
|
||||
-->
|
||||
<!-- apache commons -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.27</version>
|
||||
<!-- <scope>runtime</scope> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!--加密配置文件-->
|
||||
<dependency>
|
||||
<groupId>com.github.ulisesbocchio</groupId>
|
||||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>application-${profileActive}.properties</include>
|
||||
<include>application.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>false</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>pro</id>
|
||||
<properties>
|
||||
<profileActive>pro</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>pre</id>
|
||||
<properties>
|
||||
<profileActive>pre</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<profileActive>test</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<profileActive>dev</profileActive>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.xboe;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@SpringBootApplication
|
||||
public class BoeBasicApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("jasypt.encryptor.password","jasypt");
|
||||
SpringApplication.run(BoeBasicApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.xboe;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
|
||||
/**
|
||||
* 返回的数据中如果是null 就会转化成空字符串
|
||||
*
|
||||
*/
|
||||
@Configuration
|
||||
public class ResultNullToEmptyConfig {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConditionalOnMissingBean(ObjectMapper.class)
|
||||
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
|
||||
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
|
||||
objectMapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer<Object>() {
|
||||
@Override
|
||||
public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
|
||||
throws IOException, JsonProcessingException {
|
||||
jsonGenerator.writeString("");
|
||||
}
|
||||
});
|
||||
return objectMapper;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.xboe;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.xboe.basic.service.IModifyService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 启动执行一次
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class StartRunner implements ApplicationRunner {
|
||||
|
||||
@Autowired
|
||||
IModifyService service;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
//用于存放 kid=newId
|
||||
try {
|
||||
//本地 971783273423056896,971783831047385088
|
||||
service.modifyCourseExamScore("971783273423056896","971783831047385088");
|
||||
} catch (Exception e) {
|
||||
log.error("执行失败",e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.exit(0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.xboe.basic.api;
|
||||
|
||||
import com.xboe.core.JsonResponse;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/modify")
|
||||
public class ModifyApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新系统查出用户 并根据老库 更新sys_depart_id,commany_id
|
||||
* */
|
||||
@GetMapping("/save-user")
|
||||
public JsonResponse<Boolean> saveUser(){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xboe.basic.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.basic.entity.StudyCourseItem;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
|
||||
/**
|
||||
* 老系统的机构
|
||||
* */
|
||||
@Repository
|
||||
public class StudyCourseItemDao extends BaseDao<StudyCourseItem> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xboe.basic.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.basic.entity.StudyExam;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
|
||||
@Repository
|
||||
public class StudyExamDao extends BaseDao<StudyExam>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.xboe.basic.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/*
|
||||
* 课程学习记录表,相当于课程学习表的子表
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"study_course_item")
|
||||
public class StudyCourseItem extends IdEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final int STATUS_NONE=1;
|
||||
|
||||
public static final int STATUS_STUDYING=2;
|
||||
|
||||
public static final int STATUS_FINISH=9;
|
||||
|
||||
/*
|
||||
* 学习id
|
||||
* */
|
||||
@Column(name = "study_id",nullable=false,length = 20)
|
||||
private String studyId;
|
||||
|
||||
/*
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length = 20)
|
||||
private String courseId;
|
||||
|
||||
/*
|
||||
* 课程内容id
|
||||
* */
|
||||
@Column(name = "content_id",nullable=true,length=20)
|
||||
private String contentId;
|
||||
|
||||
/**
|
||||
* 内容类型,用于查询
|
||||
*/
|
||||
@Column(name = "content_type",length=2)
|
||||
private Integer contentType;
|
||||
|
||||
/**
|
||||
* 账号id,记录学习人
|
||||
*/
|
||||
@Column(name = "aid",nullable=true,length=20)
|
||||
private String aid;
|
||||
|
||||
/**
|
||||
* 学习人姓名
|
||||
*/
|
||||
@Column(name = "aname",nullable=true,length=30)
|
||||
private String aname;
|
||||
|
||||
/**
|
||||
* 内容学习的最终得分
|
||||
*/
|
||||
@Column(name = "score",nullable=true)
|
||||
private Float score;
|
||||
|
||||
/*
|
||||
* 学习进度
|
||||
* */
|
||||
@Column(name = "progress")
|
||||
private Integer progress;
|
||||
|
||||
/**
|
||||
* 学习状态,当前未使用 ,以学习进度100来定义是否已学完
|
||||
* 1表未学习,2表学习中,9表学习完成
|
||||
*/
|
||||
@Column(name = "status",length=1)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.xboe.basic.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/*
|
||||
* 课程考试提交记录表,此表是课程考试的记录
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"study_exam")
|
||||
public class StudyExam extends IdEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*
|
||||
* 学习id
|
||||
* */
|
||||
@Column(name = "study_id",nullable=false,length = 20)
|
||||
private String studyId;
|
||||
|
||||
/**
|
||||
* 内容学习记录id
|
||||
*/
|
||||
@Column(name = "study_item_id",nullable=false,length = 20)
|
||||
private String studyItemId;
|
||||
|
||||
/*
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length = 20)
|
||||
private String courseId;
|
||||
|
||||
/*
|
||||
* 内容id
|
||||
* */
|
||||
@Column(name = "content_id",nullable=false,length = 20)
|
||||
private String contentId;
|
||||
|
||||
|
||||
/*
|
||||
* 学员id
|
||||
* */
|
||||
@Column(name = "student_id",nullable=false,length = 20)
|
||||
private String studentId;
|
||||
|
||||
/*
|
||||
* 学员name
|
||||
* */
|
||||
@Column(name = "student_name",length = 30)
|
||||
private String studentName;
|
||||
|
||||
|
||||
/*
|
||||
* 对应课程考试的id
|
||||
* */
|
||||
@Column(name = "test_id",nullable=false,length = 20)
|
||||
private String testId;
|
||||
|
||||
/*
|
||||
* 试卷内容
|
||||
* */
|
||||
@Column(name = "paper_json",columnDefinition = "text")
|
||||
private String paperJson;
|
||||
|
||||
/**本次得分 */
|
||||
@Column(name = "score" ,nullable=false)
|
||||
private Float score;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.xboe.basic.service;
|
||||
|
||||
public interface IModifyService {
|
||||
|
||||
void modifyCourseExamScore(String courseId,String testId);
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.xboe.basic.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.type.CollectionType;
|
||||
import com.xboe.basic.dao.StudyCourseItemDao;
|
||||
import com.xboe.basic.dao.StudyExamDao;
|
||||
import com.xboe.basic.entity.StudyExam;
|
||||
import com.xboe.basic.service.IModifyService;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
|
||||
|
||||
/**
|
||||
* 老系统的机构
|
||||
* */
|
||||
@Service
|
||||
public class ModifyServiceImpl implements IModifyService {
|
||||
|
||||
@Autowired
|
||||
StudyExamDao sexameDao;
|
||||
|
||||
@Autowired
|
||||
StudyCourseItemDao scitemDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void modifyCourseExamScore(String courseId,String testId) {
|
||||
|
||||
ObjectMapper mapper=new ObjectMapper();
|
||||
mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY,true);
|
||||
mapper.configure(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT,true);
|
||||
mapper.enable(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT);
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
||||
|
||||
//String json="{\"items\":[{\"id\":\"6978553381937754113\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"3P付薪理念指?\",\"options\":[{\"id\":\"6978553498178695168\",\"content\":\"为岗位价值付薪\",\"answer\":true,\"checked\":true},{\"id\":\"6978553498178695169\",\"content\":\"为个人差异付薪 \",\"answer\":true,\"checked\":false},{\"id\":\"6978553498178695170\",\"content\":\"为绩效付薪\",\"answer\":true,\"checked\":true},{\"id\":\"6978553498178695171\",\"content\":\"为工龄付薪\",\"answer\":false,\"checked\":false}],\"userAnswer\":[\"6978553498178695168\",\"6978553498178695169\",\"6978553498178695170\"]},{\"id\":\"6978553396823339008\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"BOE业绩贡献薪酬主要包含?\",\"options\":[{\"id\":\"6978553618722992128\",\"content\":\"及时激励金\",\"answer\":true,\"checked\":true},{\"id\":\"6978553618722992129\",\"content\":\"绩效奖金\",\"answer\":true,\"checked\":true},{\"id\":\"6978553618722992130\",\"content\":\"年度业绩奖金\",\"answer\":true,\"checked\":true},{\"id\":\"6978553618722992131\",\"content\":\"股权激励计划\",\"answer\":true,\"checked\":true}],\"userAnswer\":[\"6978553618722992128\",\"6978553618722992129\",\"6978553618722992130\",\"6978553618722992131\"]},{\"id\":\"6978553399407030272\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"企业年金领取条件?\",\"options\":[{\"id\":\"6978553732237635584\",\"content\":\"达到国家规定的退休年龄\",\"answer\":true,\"checked\":true},{\"id\":\"6978553732241829888\",\"content\":\"出国(境)定居\",\"answer\":true,\"checked\":true},{\"id\":\"6978553732241829889\",\"content\":\"退休前身故\",\"answer\":true,\"checked\":true},{\"id\":\"6978553732241829890\",\"content\":\"经劳动能力鉴定委员会鉴定,因病(残)完全丧失劳动能力\",\"answer\":true,\"checked\":true}],\"userAnswer\":[\"6978553732237635584\",\"6978553732241829888\",\"6978553732241829889\",\"6978553732241829890\"]},{\"id\":\"6978553744212373504\",\"type\":101,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"考勤异常申诉每月最多可申请()次?\",\"options\":[{\"id\":\"6978553808188092416\",\"content\":\"3\",\"answer\":false,\"checked\":false},{\"id\":\"6978553808188092417\",\"content\":\"4\",\"answer\":false,\"checked\":false},{\"id\":\"6978553808188092418\",\"content\":\"5\",\"answer\":true,\"checked\":true},{\"id\":\"6978553808188092419\",\"content\":\"6\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6978553808188092418\"},{\"id\":\"6978553745848152064\",\"type\":101,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"员工签订劳动合同后办理结婚登记的,在试用期结束后可享受婚假,同时应在办理完结婚登记后()内申请。\",\"options\":[{\"id\":\"6978553896880844800\",\"content\":\"三个月\",\"answer\":false,\"checked\":false},{\"id\":\"6978553896880844801\",\"content\":\"半年\",\"answer\":false,\"checked\":false},{\"id\":\"6978553896880844802\",\"content\":\"一年\",\"answer\":true,\"checked\":true},{\"id\":\"6978553896880844803\",\"content\":\"两年\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6978553896880844802\"}]}";
|
||||
//String json="{\"items\":[{\"id\":\"6978553381937754113\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"3P付薪理念指?\",\"options\":[{\"id\":\"6978553498178695168\",\"content\":\"为岗位价值付薪\",\"answer\":true,\"checked\":true},{\"id\":\"6978553498178695169\",\"content\":\"为个人差异付薪 \",\"answer\":true,\"checked\":false},{\"id\":\"6978553498178695170\",\"content\":\"为绩效付薪\",\"answer\":true,\"checked\":false},{\"id\":\"6978553498178695171\",\"content\":\"为工龄付薪\",\"answer\":false,\"checked\":false}],\"userAnswer\":[\"6978553498178695168\"]},{\"id\":\"6978553396823339008\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"BOE业绩贡献薪酬主要包含?\",\"options\":[{\"id\":\"6978553618722992128\",\"content\":\"及时激励金\",\"answer\":true,\"checked\":false},{\"id\":\"6978553618722992129\",\"content\":\"绩效奖金\",\"answer\":true,\"checked\":false},{\"id\":\"6978553618722992130\",\"content\":\"年度业绩奖金\",\"answer\":true,\"checked\":false},{\"id\":\"6978553618722992131\",\"content\":\"股权激励计划\",\"answer\":true,\"checked\":true}],\"userAnswer\":[\"6978553618722992131\"]},{\"id\":\"6978553399407030272\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"企业年金领取条件?\",\"options\":[{\"id\":\"6978553732237635584\",\"content\":\"达到国家规定的退休年龄\",\"answer\":true,\"checked\":false},{\"id\":\"6978553732241829888\",\"content\":\"出国(境)定居\",\"answer\":true,\"checked\":false},{\"id\":\"6978553732241829889\",\"content\":\"退休前身故\",\"answer\":true,\"checked\":true},{\"id\":\"6978553732241829890\",\"content\":\"经劳动能力鉴定委员会鉴定,因病(残)完全丧失劳动能力\",\"answer\":true,\"checked\":false}],\"userAnswer\":[\"6978553732241829889\"]},{\"id\":\"6978553744212373504\",\"type\":101,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"考勤异常申诉每月最多可申请()次?\",\"options\":[{\"id\":\"6978553808188092416\",\"content\":\"3\",\"answer\":false,\"checked\":false},{\"id\":\"6978553808188092417\",\"content\":\"4\",\"answer\":false,\"checked\":false},{\"id\":\"6978553808188092418\",\"content\":\"5\",\"answer\":true,\"checked\":true},{\"id\":\"6978553808188092419\",\"content\":\"6\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6978553808188092418\"},{\"id\":\"6978553745848152064\",\"type\":101,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"员工签订劳动合同后办理结婚登记的,在试用期结束后可享受婚假,同时应在办理完结婚登记后()内申请。\",\"options\":[{\"id\":\"6978553896880844800\",\"content\":\"三个月\",\"answer\":false,\"checked\":false},{\"id\":\"6978553896880844801\",\"content\":\"半年\",\"answer\":false,\"checked\":true},{\"id\":\"6978553896880844802\",\"content\":\"一年\",\"answer\":true,\"checked\":false},{\"id\":\"6978553896880844803\",\"content\":\"两年\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6978553896880844801\"},{\"id\":\"6991356164617457665\",\"type\":103,\"score\":5,\"checked\":false,\"optShow\":false,\"content\":\"是否\",\"options\":[{\"id\":\"6991356327297732608\",\"content\":\"正确\",\"answer\":true,\"checked\":true},{\"id\":\"6991356327297732609\",\"content\":\"错误\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6991356327297732608\"}]}";
|
||||
//查询出所有的
|
||||
|
||||
//List<StudyExam> list = sexameDao.findList(FieldFilters.eq("courseId", courseId),FieldFilters.eq("testId", testId));
|
||||
List<StudyExam> list = sexameDao.getAll();
|
||||
for(StudyExam se : list) {
|
||||
try {
|
||||
String pageJson=se.getPaperJson();
|
||||
if(StringUtils.isNotBlank(pageJson)) {
|
||||
float total=countTotal(mapper,pageJson);
|
||||
//System.out.println("【"+se.getId()+"】最后的得分="+total);
|
||||
|
||||
//更新分数
|
||||
sexameDao.updateFieldById(se.getId(),"score",total);
|
||||
//scitemDao.updateFieldById(se.getStudyItemId(), "score", total);
|
||||
scitemDao.update("update StudyCourseItem set score=?1 where id=?2 and score<?3",total,se.getStudyItemId(),total);
|
||||
}
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// float total=countTotal(mapper,json);
|
||||
// System.out.println("最后的得分="+total);
|
||||
|
||||
|
||||
//程序自动 退出
|
||||
|
||||
}
|
||||
|
||||
|
||||
private float countTotal(ObjectMapper mapper,String json) throws JsonMappingException, JsonProcessingException{
|
||||
|
||||
JsonNode root = mapper.readTree(json);
|
||||
|
||||
CollectionType collectionType = mapper.getTypeFactory().constructCollectionType(ArrayList.class, PaperItem.class);
|
||||
|
||||
float total=0;
|
||||
float uscore=0;
|
||||
String jsonItems=root.get("items").toString();
|
||||
//System.out.println(root.get("items").toString());
|
||||
List<PaperItem> items=mapper.readValue(jsonItems, collectionType);
|
||||
|
||||
for(PaperItem item:items) {
|
||||
if(item.getOptions()!=null && !item.getOptions().isEmpty()) {
|
||||
boolean right=true;
|
||||
total+=item.getScore();
|
||||
for(PaperItemOption opt : item.getOptions()) {
|
||||
if(!opt.getChecked() && opt.getAnswer()) {
|
||||
right=false;
|
||||
}
|
||||
}
|
||||
if(right){
|
||||
uscore+=item.getScore();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(total!=100) {
|
||||
//转化为面分制
|
||||
uscore=Math.round(uscore*100/total);
|
||||
}
|
||||
return uscore;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xboe.basic.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PaperItem {
|
||||
|
||||
private String id;
|
||||
private Integer type;
|
||||
private Integer score;
|
||||
private Boolean checked;
|
||||
private Boolean optShow;
|
||||
private String content;
|
||||
//private String userAnswer;
|
||||
|
||||
private List<PaperItemOption> options;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xboe.basic.service.impl;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PaperItemOption {
|
||||
|
||||
private String id;
|
||||
private String content;
|
||||
private Boolean answer;
|
||||
private Boolean checked;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
# datasource config
|
||||
# basic数据库
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.open-in-view=false
|
||||
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
# 当前数据库 basic 对应的数据库
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boeu_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-dev.xml
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
@@ -0,0 +1,23 @@
|
||||
# datasource config
|
||||
# basic数据库
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.open-in-view=false
|
||||
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
# 当前数据库 basic 对应的数据库
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boeu_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-dev.xml
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
@@ -0,0 +1,23 @@
|
||||
# datasource config
|
||||
# basic数据库
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.jpa.open-in-view=false
|
||||
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
# 当前数据库 basic 对应的数据库
|
||||
spring.datasource.url=jdbc:mysql://10.251.129.126:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=admin
|
||||
spring.datasource.password=boeRds01
|
||||
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-dev.xml
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
@@ -0,0 +1,23 @@
|
||||
# datasource config
|
||||
# basic数据库
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.open-in-view=false
|
||||
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
# 当前数据库 basic 对应的数据库
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boeu_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-dev.xml
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
@@ -0,0 +1,52 @@
|
||||
spring.profiles.active=@profileActive@
|
||||
spring.application.name=boe-server-modify
|
||||
server.port=9196
|
||||
server.servlet.session.timeout=30m
|
||||
|
||||
|
||||
server.servlet.encoding.charset=UTF-8
|
||||
server.servlet.encoding.enabled=true
|
||||
server.servlet.encoding.force=true
|
||||
|
||||
server.tomcat.uri-encoding=UTF-8
|
||||
|
||||
|
||||
#spring.jackson.locale=
|
||||
#spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||
# spring.jackson.default-property-inclusion=NON_NULL
|
||||
spring.jackson.time-zone=GMT+8
|
||||
|
||||
spring.servlet.multipart.max-file-size=1024MB
|
||||
spring.servlet.multipart.max-request-size=1024MB
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
spring.mvc.static-path-pattern=/cdn/**
|
||||
|
||||
spring.redis.lettuce.pool.max-active=8
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.pool.max-idle=30
|
||||
spring.redis.lettuce.pool.max-wait=10000ms
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
|
||||
# 上传的临时目录,部署到服务器必须指定
|
||||
# spring.servlet.multipart.location=
|
||||
|
||||
# jpa config
|
||||
spring.jpa.database = MYSQL
|
||||
spring.jpa.show-sql = true
|
||||
# spring.jpa.properties.hibernate.cache.use_second_level_cache=true
|
||||
# spring.jpa.properties.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory
|
||||
|
||||
spring.jpa.properties.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy
|
||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
#spring.transaction
|
||||
# spring.jpa.properties.hibernate.allow_update_outside_transaction=true
|
||||
# spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
||||
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
||||
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-@profileActive@.xml
|
||||
|
||||
|
||||
54
servers/modify-221027/src/main/resources/log/logback-dev.xml
Normal file
54
servers/modify-221027/src/main/resources/log/logback-dev.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||
<property name="log.path" value="logs/${spring.application.name}"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
</configuration>
|
||||
55
servers/modify-221027/src/main/resources/log/logback-pro.xml
Normal file
55
servers/modify-221027/src/main/resources/log/logback-pro.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||
<property name="log.path" value="/home/logs/${spring.application.name}"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="WARN">
|
||||
<appender-ref ref="debug"/>
|
||||
<appender-ref ref="error"/>
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||
<property name="log.path" value="logs/${spring.application.name}"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="debug"/>
|
||||
<appender-ref ref="error"/>
|
||||
</root>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user