diff --git a/servers/modify-user/pom.xml b/servers/modify-user/pom.xml new file mode 100644 index 00000000..7e39f620 --- /dev/null +++ b/servers/modify-user/pom.xml @@ -0,0 +1,162 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.6.3 + + + com.xboe + modify-user + 2.0.0 + modify-user + 整理用户的数据问题 + + 1.8 + + + + com.xboe + xboe-core + 1.0.0 + + + + com.auth0 + java-jwt + 3.18.3 + + + + + org.apache.commons + commons-lang3 + + + commons-codec + commons-codec + + + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + + + mysql + mysql-connector-java + 5.1.27 + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + com.github.ulisesbocchio + jasypt-spring-boot-starter + 3.0.3 + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + + + true + src/main/resources + + application-${profileActive}.properties + application.properties + + + + false + src/main/resources + + *.properties + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + true + + + + + + + pro + + pro + + + + pre + + pre + + + + test + + test + + + + dev + + dev + + + true + + + + diff --git a/servers/modify-user/src/main/java/com/xboe/BoeBasicApplication.java b/servers/modify-user/src/main/java/com/xboe/BoeBasicApplication.java new file mode 100644 index 00000000..e59dea50 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/BoeBasicApplication.java @@ -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); + } +} diff --git a/servers/modify-user/src/main/java/com/xboe/ResultNullToEmptyConfig.java b/servers/modify-user/src/main/java/com/xboe/ResultNullToEmptyConfig.java new file mode 100644 index 00000000..12de9ef2 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/ResultNullToEmptyConfig.java @@ -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() { + @Override + public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) + throws IOException, JsonProcessingException { + jsonGenerator.writeString(""); + } + }); + return objectMapper; + } +} diff --git a/servers/modify-user/src/main/java/com/xboe/StartRunner.java b/servers/modify-user/src/main/java/com/xboe/StartRunner.java new file mode 100644 index 00000000..8894a324 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/StartRunner.java @@ -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); + + } + +} diff --git a/servers/modify-user/src/main/java/com/xboe/basic/api/ModifyApi.java b/servers/modify-user/src/main/java/com/xboe/basic/api/ModifyApi.java new file mode 100644 index 00000000..5def2d8f --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/basic/api/ModifyApi.java @@ -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 saveUser(){ + return null; + } +} diff --git a/servers/modify-user/src/main/java/com/xboe/basic/dao/StudyCourseItemDao.java b/servers/modify-user/src/main/java/com/xboe/basic/dao/StudyCourseItemDao.java new file mode 100644 index 00000000..7b6c3a45 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/basic/dao/StudyCourseItemDao.java @@ -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 { + +} diff --git a/servers/modify-user/src/main/java/com/xboe/basic/dao/StudyExamDao.java b/servers/modify-user/src/main/java/com/xboe/basic/dao/StudyExamDao.java new file mode 100644 index 00000000..ef8f8451 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/basic/dao/StudyExamDao.java @@ -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{ + +} diff --git a/servers/modify-user/src/main/java/com/xboe/basic/entity/StudyCourseItem.java b/servers/modify-user/src/main/java/com/xboe/basic/entity/StudyCourseItem.java new file mode 100644 index 00000000..83286327 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/basic/entity/StudyCourseItem.java @@ -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; + +} diff --git a/servers/modify-user/src/main/java/com/xboe/basic/entity/StudyExam.java b/servers/modify-user/src/main/java/com/xboe/basic/entity/StudyExam.java new file mode 100644 index 00000000..9424a215 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/basic/entity/StudyExam.java @@ -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; + +} diff --git a/servers/modify-user/src/main/java/com/xboe/basic/service/IModifyService.java b/servers/modify-user/src/main/java/com/xboe/basic/service/IModifyService.java new file mode 100644 index 00000000..88767d9e --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/basic/service/IModifyService.java @@ -0,0 +1,6 @@ +package com.xboe.basic.service; + +public interface IModifyService { + + void modifyCourseExamScore(String courseId,String testId); +} diff --git a/servers/modify-user/src/main/java/com/xboe/basic/service/impl/ModifyServiceImpl.java b/servers/modify-user/src/main/java/com/xboe/basic/service/impl/ModifyServiceImpl.java new file mode 100644 index 00000000..9d035fd0 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/basic/service/impl/ModifyServiceImpl.java @@ -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 list = sexameDao.findList(FieldFilters.eq("courseId", courseId),FieldFilters.eq("testId", testId)); + List 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 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; + + } + +} diff --git a/servers/modify-user/src/main/java/com/xboe/basic/service/impl/PaperItem.java b/servers/modify-user/src/main/java/com/xboe/basic/service/impl/PaperItem.java new file mode 100644 index 00000000..add606b6 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/basic/service/impl/PaperItem.java @@ -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 options; + + +} diff --git a/servers/modify-user/src/main/java/com/xboe/basic/service/impl/PaperItemOption.java b/servers/modify-user/src/main/java/com/xboe/basic/service/impl/PaperItemOption.java new file mode 100644 index 00000000..34fee3a2 --- /dev/null +++ b/servers/modify-user/src/main/java/com/xboe/basic/service/impl/PaperItemOption.java @@ -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; +} diff --git a/servers/modify-user/src/main/resources/application-dev.properties b/servers/modify-user/src/main/resources/application-dev.properties new file mode 100644 index 00000000..428da12a --- /dev/null +++ b/servers/modify-user/src/main/resources/application-dev.properties @@ -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 \ No newline at end of file diff --git a/servers/modify-user/src/main/resources/application-pre.properties b/servers/modify-user/src/main/resources/application-pre.properties new file mode 100644 index 00000000..428da12a --- /dev/null +++ b/servers/modify-user/src/main/resources/application-pre.properties @@ -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 \ No newline at end of file diff --git a/servers/modify-user/src/main/resources/application-pro.properties b/servers/modify-user/src/main/resources/application-pro.properties new file mode 100644 index 00000000..4c8d43bb --- /dev/null +++ b/servers/modify-user/src/main/resources/application-pro.properties @@ -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 \ No newline at end of file diff --git a/servers/modify-user/src/main/resources/application-test.properties b/servers/modify-user/src/main/resources/application-test.properties new file mode 100644 index 00000000..428da12a --- /dev/null +++ b/servers/modify-user/src/main/resources/application-test.properties @@ -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 \ No newline at end of file diff --git a/servers/modify-user/src/main/resources/application.properties b/servers/modify-user/src/main/resources/application.properties new file mode 100644 index 00000000..aa6d29d5 --- /dev/null +++ b/servers/modify-user/src/main/resources/application.properties @@ -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 + + diff --git a/servers/modify-user/src/main/resources/log/logback-dev.xml b/servers/modify-user/src/main/resources/log/logback-dev.xml new file mode 100644 index 00000000..4a26a112 --- /dev/null +++ b/servers/modify-user/src/main/resources/log/logback-dev.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + + + ${log.path}/debug.log + + ${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + + + + ${log.path}/error.log + + ${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + ERROR + + + + + + + + diff --git a/servers/modify-user/src/main/resources/log/logback-pro.xml b/servers/modify-user/src/main/resources/log/logback-pro.xml new file mode 100644 index 00000000..d5d8cead --- /dev/null +++ b/servers/modify-user/src/main/resources/log/logback-pro.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + + + ${log.path}/debug.log + + ${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + + + + ${log.path}/error.log + + ${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + ERROR + + + + + + + + + diff --git a/servers/modify-user/src/main/resources/log/logback-test.xml b/servers/modify-user/src/main/resources/log/logback-test.xml new file mode 100644 index 00000000..f2b97986 --- /dev/null +++ b/servers/modify-user/src/main/resources/log/logback-test.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + + + ${log.path}/debug.log + + ${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + + + + ${log.path}/error.log + + ${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + ERROR + + + + + + + + +