mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 03:16:48 +08:00
一基的服务与模板重新建立一个环境
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.xboe;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.system.ApplicationPid;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@SpringBootApplication
|
||||
public class BoeServerAllApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("jasypt.encryptor.password","jasypt");
|
||||
SpringApplication.run(BoeServerAllApplication.class, args);
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void handlePid() throws IOException {
|
||||
File file = new File("application.pid");
|
||||
new ApplicationPid().write(file);
|
||||
file.deleteOnExit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.xboe;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import com.xboe.core.api.authentication.ApiAuthenticateHandle;
|
||||
|
||||
/**
|
||||
* 使用实现 WebMvcConfigurer 此接口,不使用继承WebMvcConfigurationSupport的方式</br>
|
||||
* 这样原有的自动配置不会失效
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
//@EnableWebMvc
|
||||
@Configuration
|
||||
public class WebMvcConfig implements WebMvcConfigurer{
|
||||
|
||||
@Autowired
|
||||
private ApiAuthenticateHandle authenticateHandle;
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
// //设置静态访问目录
|
||||
// if(env.containsProperty(BaseConstant.CONFIG_MVC_STATIC_PATH)) {
|
||||
// String path=env.getProperty(BaseConstant.CONFIG_MVC_STATIC_PATH);
|
||||
// System.out.println("设置static路径:"+path);
|
||||
// registry.addResourceHandler("/static/**").addResourceLocations(path);
|
||||
// }else {
|
||||
// System.out.println("config static classpath");
|
||||
// registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(authenticateHandle).addPathPatterns("/api/**");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.xboe.constants;
|
||||
|
||||
public interface Constants {
|
||||
// 通用
|
||||
String DELETED_NORMAL = "0";
|
||||
|
||||
String DELETED_DEL = "1";
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.xboe.old.data.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.old.data.entity.Audience;
|
||||
import com.xboe.old.data.entity.AudienceMember;
|
||||
import com.xboe.old.data.service.IAudienceMemberService;
|
||||
import com.xboe.old.data.service.IAudienceService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/xboe/old/data/audience")
|
||||
public class AudienceApi extends ApiBaseController {
|
||||
|
||||
@Autowired
|
||||
IAudienceService audienceService;
|
||||
|
||||
@Autowired
|
||||
IAudienceMemberService audienceMemberService;
|
||||
|
||||
/**
|
||||
* 受众基本信息
|
||||
*/
|
||||
@PostMapping("/detail")
|
||||
public JsonResponse<Audience> detail(String kid){
|
||||
if(StringUtil.isBlank(kid)){
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
Audience audience = audienceService.get(kid);
|
||||
return success(audience);
|
||||
}
|
||||
|
||||
/**
|
||||
* 受众成员信息
|
||||
* */
|
||||
@PostMapping("/all")
|
||||
public JsonResponse<List<AudienceMember>> all(String audienceId){
|
||||
if(StringUtil.isBlank(audienceId)){
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
List<AudienceMember> all = audienceMemberService.all(audienceId);
|
||||
return success(all);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.xboe.old.data.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.old.data.service.IManageRefService;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/xboe/old/data/managrref")
|
||||
public class ManagrRefApi extends ApiBaseController{
|
||||
|
||||
@Resource
|
||||
private IManageRefService service;
|
||||
|
||||
|
||||
@RequestMapping(value="/user-company-ids")
|
||||
public JsonResponse<List<String>> query(String uid){
|
||||
if(StringUtils.isBlank(uid)){
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
List<String> query = service.getCompanyIdsByUserId(uid);
|
||||
return success(query);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xboe.old.data.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.old.data.entity.Audience;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class AudienceDao extends BaseDao<Audience> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xboe.old.data.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.old.data.entity.AudienceMember;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class AudienceMemberDao extends BaseDao<AudienceMember> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xboe.old.data.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.old.data.entity.ManageRef;
|
||||
|
||||
@Repository
|
||||
public class ManageRefDao extends BaseDao<ManageRef> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package com.xboe.old.data.entity;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_so_audience")
|
||||
public class Audience implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 受众id
|
||||
* */
|
||||
@Id
|
||||
@Column(name = "kid",length = 50)
|
||||
private String kid;
|
||||
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
* */
|
||||
@Column(name = "company_id",length = 50)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 所有者id
|
||||
* */
|
||||
@Column(name = "owner_id",length = 50)
|
||||
private String ownerId;
|
||||
|
||||
/**
|
||||
* 受众目录id
|
||||
* */
|
||||
@Column(name = "category_id",length = 50)
|
||||
private String cateGoryId;
|
||||
|
||||
/**
|
||||
* 受众编码
|
||||
* */
|
||||
@Column(name = "audience_code",length = 50)
|
||||
private String audienceCode;
|
||||
|
||||
/**
|
||||
* 受众名称
|
||||
* */
|
||||
@Column(name = "audience_name",length = 200)
|
||||
private String audienceName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* */
|
||||
@Column(name = "description",columnDefinition = "mediumtext")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 来源id
|
||||
* */
|
||||
@Column(name = "source_id",length = 50)
|
||||
private String sourceId;
|
||||
|
||||
/**
|
||||
* 受众类型 0名单列表 1课程
|
||||
* */
|
||||
@Column(name = "audience_type",length = 1)
|
||||
private Character audienceType;
|
||||
|
||||
/**
|
||||
* 受众类型
|
||||
* */
|
||||
@Column(name = "type",length = 1)
|
||||
private Character type;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* */
|
||||
@Column(name = "status",length = 1)
|
||||
private Character status;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
* */
|
||||
@Column(name = "version",length = 11)
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Column(name = "created_by", length = 150)
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "created_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建来源
|
||||
*/
|
||||
@Column(name = "created_from", length = 150)
|
||||
private String createdFrom;
|
||||
|
||||
/**
|
||||
* 创建IP
|
||||
*/
|
||||
@Column(name = "created_ip", length = 150)
|
||||
private String createdIp;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
@Column(name = "updated_by", length = 150)
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "updated_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新来源
|
||||
*/
|
||||
@Column(name = "updated_from", length = 150)
|
||||
private String updatedFrom;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
@Column(name = "updated_ip", length = 150)
|
||||
private String updatedIp;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.xboe.old.data.entity;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_so_audience_member")
|
||||
public class AudienceMember implements Serializable {
|
||||
|
||||
/**
|
||||
* 受众成员id
|
||||
* */
|
||||
@Id
|
||||
@Column(name = "kid",length = 50)
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 受众id
|
||||
* */
|
||||
@Column(name = "audience_id",length = 50)
|
||||
private String audienceId;
|
||||
|
||||
/**
|
||||
* 受众条件id
|
||||
* */
|
||||
@Column(name = "condition_id",length = 50)
|
||||
private String conditionId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
* */
|
||||
@Column(name = "user_id",length = 50)
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 状态 0临时 1正常 2停用
|
||||
* */
|
||||
@Column(name = "status",length = 1)
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
//
|
||||
// /**
|
||||
// * 关系生效时间
|
||||
// * */
|
||||
// @Column(name = "start_at",nullable = false,length = 11)
|
||||
// private Integer startAt;
|
||||
//
|
||||
// /**
|
||||
// *'关系失效时间,如果为空,表示无截止时间限制',
|
||||
// * */
|
||||
// @Column(name = "end_at",length = 11)
|
||||
// private Integer endAt;
|
||||
//
|
||||
// /**
|
||||
// * 版本号
|
||||
// */
|
||||
// @Column(name = "version", length = 11)
|
||||
// private Integer version;
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 创建人ID
|
||||
// */
|
||||
// @Column(name = "created_by", length = 150)
|
||||
// private String createdBy;
|
||||
//
|
||||
// /**
|
||||
// * 创建时间
|
||||
// */
|
||||
// @Column(name = "created_at")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// private Date createdAt;
|
||||
//
|
||||
// /**
|
||||
// * 创建来源
|
||||
// */
|
||||
// @Column(name = "created_from", length = 150)
|
||||
// private String createdFrom;
|
||||
//
|
||||
// /**
|
||||
// * 创建IP
|
||||
// */
|
||||
// @Column(name = "created_ip", length = 150)
|
||||
// private String createdIp;
|
||||
//
|
||||
// /**
|
||||
// * 更新人ID
|
||||
// */
|
||||
// @Column(name = "updated_by", length = 150)
|
||||
// private String updatedBy;
|
||||
//
|
||||
// /**
|
||||
// * 更新时间
|
||||
// */
|
||||
// @Column(name = "updated_at")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// private Date updatedAt;
|
||||
//
|
||||
// /**
|
||||
// * 更新来源
|
||||
// */
|
||||
// @Column(name = "updated_from", length = 150)
|
||||
// private String updatedFrom;
|
||||
//
|
||||
// /**
|
||||
// * 更新IP
|
||||
// */
|
||||
// @Column(name = "updated_ip", length = 150)
|
||||
// private String updatedIp;
|
||||
//
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.xboe.old.data.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_fw_cnt_manage_ref")
|
||||
public class ManageRef {
|
||||
|
||||
|
||||
/**
|
||||
* 内容管辖关系id
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "kid", length = 50)
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 主体ID
|
||||
* */
|
||||
@Column(name = "subject_id",nullable = false,length = 50)
|
||||
private String subjectId;
|
||||
/**
|
||||
* 主体类型
|
||||
* */
|
||||
@Column(name = "subjectType",nullable = false,length = 30)
|
||||
private String subjectType;
|
||||
|
||||
/**
|
||||
*内容ID
|
||||
* */
|
||||
@Column(name = "content_id",nullable = false,length = 50)
|
||||
private String contentId;
|
||||
|
||||
/**
|
||||
* 内容类型
|
||||
* */
|
||||
@Column(name = "content_type",nullable = false,length = 50)
|
||||
private String contentType;
|
||||
|
||||
/**
|
||||
* '关联类型;0:查询关系;1:管理关系',
|
||||
* */
|
||||
@Column(name = "reference_type",nullable = false,length = 1)
|
||||
private Character referenceType;
|
||||
|
||||
/**
|
||||
* 状态;0:临时,1:正常,2:停用',
|
||||
*/
|
||||
@Column(name = "status",nullable = false,length = 1)
|
||||
private Character status;
|
||||
|
||||
/**
|
||||
* 关系生效时间
|
||||
* */
|
||||
@Column(name = "start_at",nullable = false,length = 11)
|
||||
private Integer startAt;
|
||||
|
||||
/**
|
||||
*'关系失效时间,如果为空,表示无截止时间限制',
|
||||
* */
|
||||
@Column(name = "end_at",length = 11)
|
||||
private Integer endAt;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@Column(name = "version", length = 11)
|
||||
private Integer version;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Column(name = "created_by", length = 150)
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "created_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建来源
|
||||
*/
|
||||
@Column(name = "created_from", length = 150)
|
||||
private String createdFrom;
|
||||
|
||||
/**
|
||||
* 创建IP
|
||||
*/
|
||||
@Column(name = "created_ip", length = 150)
|
||||
private String createdIp;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
@Column(name = "updated_by", length = 150)
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "updated_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新来源
|
||||
*/
|
||||
@Column(name = "updated_from", length = 150)
|
||||
private String updatedFrom;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
@Column(name = "updated_ip", length = 150)
|
||||
private String updatedIp;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xboe.old.data.service;
|
||||
|
||||
import com.xboe.old.data.entity.AudienceMember;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IAudienceMemberService {
|
||||
|
||||
/**
|
||||
* 受众下的成员列表
|
||||
* */
|
||||
List<AudienceMember> all(String id);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.xboe.old.data.service;
|
||||
|
||||
import com.xboe.old.data.entity.Audience;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IAudienceService {
|
||||
|
||||
|
||||
/**
|
||||
* 受众基本信息
|
||||
* */
|
||||
Audience get(String kid);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.xboe.old.data.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IManageRefService {
|
||||
|
||||
List<String> getCompanyIdsByUserId(String uid);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.xboe.old.data.service.impl;
|
||||
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.old.data.dao.AudienceMemberDao;
|
||||
import com.xboe.old.data.entity.AudienceMember;
|
||||
import com.xboe.old.data.service.IAudienceMemberService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AudienceMemberServiceImpl implements IAudienceMemberService {
|
||||
|
||||
@Autowired
|
||||
AudienceMemberDao audienceMemberDao;
|
||||
|
||||
@Override
|
||||
public List<AudienceMember> all(String audienceId) {
|
||||
List<AudienceMember> memberDaoList = audienceMemberDao.findList(
|
||||
FieldFilters.eq("audienceId", audienceId),
|
||||
FieldFilters.eq("status", "1"),
|
||||
FieldFilters.eq("isDeleted", "0"));
|
||||
return memberDaoList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.xboe.old.data.service.impl;
|
||||
|
||||
import com.xboe.old.data.dao.AudienceDao;
|
||||
import com.xboe.old.data.entity.Audience;
|
||||
import com.xboe.old.data.service.IAudienceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@Service
|
||||
public class AudienceServiceImpl implements IAudienceService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private AudienceDao audienceDao;
|
||||
|
||||
@Override
|
||||
public Audience get(String kid) {
|
||||
Audience audience = audienceDao.get(kid);
|
||||
return audience;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.xboe.old.data.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.old.data.dao.ManageRefDao;
|
||||
import com.xboe.old.data.service.IManageRefService;
|
||||
|
||||
@Service
|
||||
public class ManageRefServiceImpl implements IManageRefService {
|
||||
|
||||
@Resource
|
||||
private ManageRefDao dao;
|
||||
|
||||
@Override
|
||||
public List<String> getCompanyIdsByUserId(String uid) {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> listField = (List<String>) dao.findListField("contentId", FieldFilters.eq("subjectType", "user"),
|
||||
FieldFilters.eq("subjectId", uid),
|
||||
FieldFilters.eq("contentType", "company"),
|
||||
FieldFilters.eq("status", '1'),
|
||||
FieldFilters.eq("referenceType", '1'));
|
||||
|
||||
return listField;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.xboe.system.organization.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.system.organization.entity.FwOrganization;
|
||||
import com.xboe.system.organization.service.IOrganizationService;
|
||||
|
||||
/**
|
||||
* 为boe-serve提供查询旧系统机构数据的接口服务
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/xboe-org/org")
|
||||
public class OrganizationApi extends ApiBaseController {
|
||||
|
||||
@Resource
|
||||
IOrganizationService service;
|
||||
|
||||
/**
|
||||
* 查询指定条数的机构信息
|
||||
*
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @param org
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public JsonResponse<List<FwOrganization>> list(@RequestParam(required = true, defaultValue = "1") Integer pageIndex,
|
||||
@RequestParam(required = true, defaultValue = "10") Integer pageSize,
|
||||
FwOrganization org) {
|
||||
List<FwOrganization> list = service.list(pageIndex, pageSize, org, OrderCondition.asc("kid"));
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构信息
|
||||
*
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/get")
|
||||
public JsonResponse<FwOrganization> get(String kid) {
|
||||
FwOrganization result = service.get(kid);
|
||||
return success(result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.xboe.system.organization.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.constants.Constants;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.QueryBuilder;
|
||||
import com.xboe.system.organization.entity.FwOrganization;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 机构信息查询DAO
|
||||
*/
|
||||
@Slf4j
|
||||
@Repository
|
||||
public class OrganizationDao extends BaseDao<FwOrganization> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询指定条数的机构信息
|
||||
*
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @param org
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
public List<FwOrganization> list(int pageIndex, int pageSize, FwOrganization org, OrderCondition order) {
|
||||
// 删除状态的也同步,用于解决删除数据问题
|
||||
//filters.add(FieldFilters.eq("isDeleted", Constants.DELETED_NORMAL));
|
||||
//String hql="Select org,tn.namePath from FwOrganization org,FwOrgTreeNode tn where org.treeNodeId=tn.kid and tn.isDeleted=0";
|
||||
|
||||
QueryBuilder query=QueryBuilder.from("FwOrganization org,FwOrgTreeNode tn");
|
||||
query.addFields("org","tn.namePath");
|
||||
|
||||
query.addFilter(FieldFilters.eqField("org.treeNodeId", "tn.kid"));
|
||||
//query.addFilter(FieldFilters.eq("tn.isDeleted", 0));
|
||||
if (org != null) {
|
||||
if (StringUtils.isNotBlank(org.getParentOrgnizationId())) {
|
||||
query.addFilter(FieldFilters.eq("org.parentOrgnizationId", org.getParentOrgnizationId()));
|
||||
}
|
||||
}
|
||||
query.setPageIndex(pageIndex);
|
||||
query.setPageSize(pageSize);
|
||||
|
||||
List<FwOrganization> list=new ArrayList<FwOrganization>();
|
||||
|
||||
try {
|
||||
PageList<Object[]> rs = this.findPageFields(query.builder());
|
||||
//List<Object[]> rs=this.findListFields(query.builder());
|
||||
for(Object[] objs : rs.getList()) {
|
||||
FwOrganization fworg=(FwOrganization)objs[0];
|
||||
String namePath=(String)objs[1];
|
||||
fworg.setNamePath(namePath);
|
||||
list.add(fworg);
|
||||
}
|
||||
}catch(Exception e) {
|
||||
log.error("查询机构信息错误",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按id查询机构信息
|
||||
*
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
public FwOrganization getById(String kid) {
|
||||
FwOrganization org = this.findOne(FieldFilters.eq("kid", kid), FieldFilters.eq("isDeleted", Constants.DELETED_NORMAL));
|
||||
return org;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.xboe.system.organization.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 机构treeNode表
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "eln_fw_tree_node")
|
||||
public class FwOrgTreeNode {
|
||||
|
||||
@Id
|
||||
@Column(name = "kid", length = 36)
|
||||
private String kid;
|
||||
|
||||
@Column(name = "tree_node_name", length = 100)
|
||||
private String nodeName;
|
||||
|
||||
@Column(name = "node_name_path", length = 500)
|
||||
private String namePath;
|
||||
|
||||
@Column(name = "is_deleted", length = 1)
|
||||
private Integer isDeleted;
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.xboe.system.organization.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_fw_orgnization")
|
||||
public class FwOrganization {
|
||||
|
||||
/**
|
||||
* 组织部门ID
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "kid", length = 150)
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 树节点ID
|
||||
*/
|
||||
@Column(name = "tree_node_id", length = 150)
|
||||
private String treeNodeId;
|
||||
|
||||
/**
|
||||
* 父组织部门ID
|
||||
*/
|
||||
@Column(name = "parent_orgnization_id", length = 150)
|
||||
private String parentOrgnizationId;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
@Column(name = "company_id", length = 150)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 域ID
|
||||
*/
|
||||
@Column(name = "domain_id", length = 150)
|
||||
private String domainId;
|
||||
|
||||
/**
|
||||
* 组织部门代码
|
||||
*/
|
||||
@Column(name = "orgnization_code", length = 150)
|
||||
private String orgnizationCode;
|
||||
|
||||
/**
|
||||
* 组织名
|
||||
*/
|
||||
@Column(name = "orgnization_name", length = 150)
|
||||
private String orgnizationName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Column(name = "description", columnDefinition = "text")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 组织部门经理ID
|
||||
*/
|
||||
@Column(name = "orgnization_manager_id", length = 150)
|
||||
private String orgnizationManagerId;
|
||||
|
||||
/**
|
||||
* 组织级别orgnization_level
|
||||
*/
|
||||
@Column(name = "orgnization_level", length = 150)
|
||||
private String organizationLevel;
|
||||
|
||||
/**
|
||||
* 是否制造组织
|
||||
* 0:否,1:是
|
||||
*/
|
||||
@Column(name = "is_make_org", length = 3)
|
||||
private String isMakeOrg;
|
||||
|
||||
/**
|
||||
* 是否服务现地
|
||||
* 0:否,1:是
|
||||
*/
|
||||
@Column(name = "is_service_site", length = 3)
|
||||
private String isServiceSite;
|
||||
|
||||
/**
|
||||
* 是否默认注册组织
|
||||
* 0:否,1:是
|
||||
*/
|
||||
@Column(name = "is_default_orgnization", length = 3)
|
||||
private String isDefaultOrganization;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* 0:临时,1:正常,2:停用
|
||||
*/
|
||||
@Column(name = "status", length = 3)
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 组织全路径
|
||||
*/
|
||||
@Column(name = "orgnization_name_path")
|
||||
private String namePath;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@Column(name = "version", length = 11)
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
@Column(name = "data_from", length = 150)
|
||||
private String dataFrom;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Column(name = "created_by", length = 150)
|
||||
private String createdBy;
|
||||
|
||||
// /**
|
||||
// * 创建时间
|
||||
// */
|
||||
// @Column(name = "created_at")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// private Date createdAt;
|
||||
//
|
||||
// /**
|
||||
// * 创建来源
|
||||
// */
|
||||
// @Column(name = "created_from", length = 150)
|
||||
// private String createdFrom;
|
||||
//
|
||||
// /**
|
||||
// * 创建IP
|
||||
// */
|
||||
// @Column(name = "created_ip", length = 150)
|
||||
// private String createdIp;
|
||||
//
|
||||
// /**
|
||||
// * 更新人ID
|
||||
// */
|
||||
// @Column(name = "updated_by", length = 150)
|
||||
// private String updatedBy;
|
||||
//
|
||||
// /**
|
||||
// * 更新时间
|
||||
// */
|
||||
// @Column(name = "updated_at")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// private Date updatedAt;
|
||||
//
|
||||
// /**
|
||||
// * 更新来源
|
||||
// */
|
||||
// @Column(name = "updated_from", length = 150)
|
||||
// private String updatedFrom;
|
||||
//
|
||||
// /**
|
||||
// * 更新IP
|
||||
// */
|
||||
// @Column(name = "updated_ip", length = 150)
|
||||
// private String updatedIp;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.xboe.system.organization.service;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.system.organization.entity.FwOrganization;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机构信息查询接口
|
||||
*/
|
||||
public interface IOrganizationService {
|
||||
|
||||
/**
|
||||
* 查询指定条数的机构信息
|
||||
*
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @param org
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
List<FwOrganization> list(Integer pageIndex, Integer pageSize, FwOrganization org, OrderCondition order);
|
||||
|
||||
/**
|
||||
* 按id查询
|
||||
*
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
FwOrganization get(String kid);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.xboe.system.organization.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.system.organization.dao.OrganizationDao;
|
||||
import com.xboe.system.organization.entity.FwOrganization;
|
||||
import com.xboe.system.organization.service.IOrganizationService;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class OrganizationServiceImpl implements IOrganizationService {
|
||||
|
||||
@Resource
|
||||
OrganizationDao dao;
|
||||
|
||||
@Override
|
||||
public List<FwOrganization> list(Integer pageIndex, Integer pageSize, FwOrganization org, OrderCondition order) {
|
||||
List<FwOrganization> list = dao.list(pageIndex, pageSize, org, order);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FwOrganization get(String kid) {
|
||||
return dao.getById(kid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.xboe.system.teacher.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.system.teacher.entity.LnTeacher;
|
||||
import com.xboe.system.teacher.service.ITeacherService;
|
||||
|
||||
/**
|
||||
* 为boe-serve提供查询旧系统教师数据的接口服务
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/xboe-org/teacher")
|
||||
public class TeacherApi extends ApiBaseController {
|
||||
|
||||
@Resource
|
||||
ITeacherService service;
|
||||
|
||||
/**
|
||||
* 通过kid获取教师信息
|
||||
*
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/get")
|
||||
public JsonResponse<LnTeacher> get(String kid) {
|
||||
LnTeacher user = service.get(kid);
|
||||
return success(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定条数的教师信息
|
||||
*
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @param org
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public JsonResponse<List<LnTeacher>> list(@RequestParam(required = true, defaultValue = "1") Integer pageIndex,
|
||||
@RequestParam(required = true, defaultValue = "10") Integer pageSize,
|
||||
LnTeacher org) {
|
||||
List<LnTeacher> list = service.list(pageIndex, pageSize, org, OrderCondition.asc("kid"));
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.xboe.system.teacher.dao;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.constants.Constants;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.IFieldFilter;
|
||||
import com.xboe.system.teacher.entity.LnTeacher;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 教师信息查询DAO
|
||||
*/
|
||||
@Repository
|
||||
public class TeacherDao extends BaseDao<LnTeacher> {
|
||||
|
||||
/**
|
||||
* 按kid查询教师信息
|
||||
*
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
public LnTeacher getById(String kid) {
|
||||
LnTeacher user = this.findOne(FieldFilters.eq("kid", kid), FieldFilters.eq("isDeleted", Constants.DELETED_NORMAL));
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定条数的机构信息
|
||||
*
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @param tea
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
public List<LnTeacher> list(int pageIndex, int pageSize, LnTeacher tea, OrderCondition order) {
|
||||
List<IFieldFilter> filters = new ArrayList<>();
|
||||
filters.add(FieldFilters.eq("isDeleted", Constants.DELETED_NORMAL));
|
||||
// if (tea != null) {
|
||||
// }
|
||||
PageList<LnTeacher> page = this.getGenericDao().findPage(pageIndex, pageSize, getEntityClass(), filters, order);
|
||||
return page.getList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
package com.xboe.system.teacher.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 教师信息表
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_ln_teacher")
|
||||
public class LnTeacher implements java.io.Serializable{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "kid")
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
@Column(name = "company_id")
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 企业
|
||||
*/
|
||||
@Column(name = "company_name")
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 教师编码
|
||||
*/
|
||||
@Column(name = "teacher_code")
|
||||
private String teacherCode;
|
||||
|
||||
/**
|
||||
* 教师姓名
|
||||
*/
|
||||
@Column(name = "teacherName")
|
||||
private String teacherName;
|
||||
|
||||
/**
|
||||
* 教师昵称
|
||||
*/
|
||||
@Column(name = "teacher_nick")
|
||||
private String teacherNick;
|
||||
|
||||
/**
|
||||
* 教师类型
|
||||
*/
|
||||
@Column(name = "teacher_type")
|
||||
private String teacherType;
|
||||
|
||||
/**
|
||||
* 教师级别
|
||||
*/
|
||||
@Column(name = "teacher_level")
|
||||
private String teacherLevel;
|
||||
|
||||
/**
|
||||
* 教师级别ID
|
||||
*/
|
||||
@Column(name = "teacher_level_id")
|
||||
private String teacherLevelId;
|
||||
|
||||
/**
|
||||
* 职称
|
||||
*/
|
||||
@Column(name = "teacher_title")
|
||||
private String teacherTitle;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Column(name = "teacher_thumb_url")
|
||||
private String teacherThumbUrl;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@Column(name = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Column(name = "user_id")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@Column(name = "user_no")
|
||||
private String userNo;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@Column(name = "gender")
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@Column(name = "birthday")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 学历
|
||||
*/
|
||||
@Column(name = "degree")
|
||||
private String degree;
|
||||
|
||||
/**
|
||||
* 毕业院校
|
||||
*/
|
||||
@Column(name = "graduate_school")
|
||||
private String graduateSchool;
|
||||
|
||||
/**
|
||||
* 教龄
|
||||
*/
|
||||
@Column(name = "teach_year")
|
||||
private Float teachYear;
|
||||
|
||||
/**
|
||||
* 领域
|
||||
*/
|
||||
@Column(name = "teach_domain")
|
||||
private String teachDomain;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Column(name = "mobile_no")
|
||||
private String mobileNo;
|
||||
|
||||
/**
|
||||
* Email地址
|
||||
*/
|
||||
@Column(name = "email")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 家庭电话
|
||||
*/
|
||||
@Column(name = "home_phone_no")
|
||||
private String homePhoneNo;
|
||||
|
||||
/**
|
||||
* 语言
|
||||
*/
|
||||
@Column(name = "language")
|
||||
private String language;
|
||||
|
||||
/**
|
||||
* 时区
|
||||
*/
|
||||
@Column(name = "timezone")
|
||||
private String timezone;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
@Column(name = "data_from")
|
||||
private String dataFrom;
|
||||
|
||||
/**
|
||||
* 系统ID
|
||||
*/
|
||||
@Column(name = "system_id")
|
||||
private String systemId;
|
||||
|
||||
/**
|
||||
* 系统名称
|
||||
*/
|
||||
@Column(name = "system_name")
|
||||
private String systemName;
|
||||
|
||||
/**
|
||||
* 教授时间
|
||||
*/
|
||||
@Column(name = "teaching_time")
|
||||
private Integer teachingTime;
|
||||
|
||||
/**
|
||||
* 默认教授时间
|
||||
*/
|
||||
@Column(name = "default_teaching_time")
|
||||
private Integer defaultTeachingTime;
|
||||
|
||||
/**
|
||||
* 级别id
|
||||
*/
|
||||
@Column(name = "level_id")
|
||||
private String levelId;
|
||||
|
||||
/**
|
||||
* 级别名称
|
||||
*/
|
||||
@Column(name = "level_name")
|
||||
private String levelName;
|
||||
|
||||
/**
|
||||
* 语言
|
||||
*/
|
||||
@Column(name = "is_certify")
|
||||
private String isCertify;
|
||||
|
||||
@Column(name = "certification")
|
||||
private String certificatio;
|
||||
|
||||
@Column(name = "certify_at")
|
||||
private String certifyAt;
|
||||
|
||||
@Column(name = "certify_by")
|
||||
private String certifyBy;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Column(name = "status")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Column(name = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@Column(name = "version", length = 11)
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Column(name = "created_by", length = 150)
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "created_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建来源
|
||||
*/
|
||||
@Column(name = "created_from", length = 150)
|
||||
private String createdFrom;
|
||||
|
||||
/**
|
||||
* 创建IP
|
||||
*/
|
||||
@Column(name = "created_ip", length = 150)
|
||||
private String createdIp;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
@Column(name = "updated_by", length = 150)
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "updated_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新来源
|
||||
*/
|
||||
@Column(name = "updated_from", length = 150)
|
||||
private String updatedFrom;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
@Column(name = "updated_ip", length = 150)
|
||||
private String updatedIp;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.xboe.system.teacher.service;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.system.teacher.entity.LnTeacher;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 教师信息查询接口
|
||||
*/
|
||||
public interface ITeacherService {
|
||||
|
||||
/**
|
||||
* 按kid查询教师
|
||||
*
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
LnTeacher get(String kid);
|
||||
|
||||
/**
|
||||
* 查询指定条数的教师信息
|
||||
*
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @param tea
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
List<LnTeacher> list(Integer pageIndex, Integer pageSize, LnTeacher tea, OrderCondition order);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.xboe.system.teacher.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.system.teacher.dao.TeacherDao;
|
||||
import com.xboe.system.teacher.entity.LnTeacher;
|
||||
import com.xboe.system.teacher.service.ITeacherService;
|
||||
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class TeacherServiceImpl implements ITeacherService {
|
||||
|
||||
@Resource
|
||||
TeacherDao dao;
|
||||
|
||||
@Override
|
||||
public LnTeacher get(String kid) {
|
||||
LnTeacher user = dao.getById(kid);
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LnTeacher> list(Integer pageIndex, Integer pageSize, LnTeacher tea, OrderCondition order){
|
||||
return dao.list(pageIndex, pageSize, tea, order);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.xboe.system.user.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.system.user.entity.FwUser;
|
||||
import com.xboe.system.user.service.IUserService;
|
||||
|
||||
/**
|
||||
* 为boe-serve提供查询旧系统用户数据的接口服务
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/xboe-org/user")
|
||||
public class UserApi extends ApiBaseController {
|
||||
|
||||
@Resource
|
||||
IUserService service;
|
||||
|
||||
/**
|
||||
* 通过kid获取用户信息
|
||||
*
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/get")
|
||||
public JsonResponse<FwUser> get(String kid) {
|
||||
FwUser user = service.get(kid);
|
||||
return success(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过登录名来获取用户信息
|
||||
*
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/get-by-username")
|
||||
public JsonResponse<FwUser> getByUserName(String userName) {
|
||||
FwUser user = service.getByUserName(userName);
|
||||
return success(user);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public JsonResponse<List<FwUser>> pageList(@RequestParam(required = true, defaultValue = "1") Integer pageIndex,
|
||||
@RequestParam(required = true, defaultValue = "10") Integer pageSize) {
|
||||
List<FwUser> list = service.list(pageIndex, pageSize);
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.xboe.system.user.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.constants.Constants;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.system.user.entity.FwUser;
|
||||
|
||||
/**
|
||||
* 用户信息查询DAO
|
||||
*/
|
||||
@Repository
|
||||
public class UserDao extends BaseDao<FwUser> {
|
||||
|
||||
/**
|
||||
* 按kid查询用户信息
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
public FwUser getById(String kid) {
|
||||
FwUser user = this.findOne(FieldFilters.eq("kid", kid), FieldFilters.eq("isDeleted", Constants.DELETED_NORMAL));
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按用户名查询用户信息
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
public FwUser getByUserName(String userName) {
|
||||
FwUser user = this.findOne(FieldFilters.eq("userName", userName), FieldFilters.eq("isDeleted", Constants.DELETED_NORMAL));
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取用户
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
public List<FwUser> list(int pageIndex, int pageSize) {
|
||||
PageList<FwUser> page = this.findPage(pageIndex,pageSize,FieldFilters.eq("isDeleted", Constants.DELETED_NORMAL));
|
||||
if(page.getList() != null && !page.getList().isEmpty()){
|
||||
return page.getList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,630 @@
|
||||
package com.xboe.system.user.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户信息表
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_fw_user")
|
||||
public class FwUser implements java.io.Serializable{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "kid", length = 150)
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 系统用户名
|
||||
*/
|
||||
@Column(name = "user_name", length = 150)
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@Column(name = "real_name", length = 150)
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Column(name = "nick_name", length = 150)
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 员工编号
|
||||
*/
|
||||
@Column(name = "user_no", length = 90)
|
||||
private String userNo;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
* male 男 female 女
|
||||
*/
|
||||
@Column(name = "gender", length = 90)
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@Column(name = "birthday")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@Column(name = "id_number", length = 150)
|
||||
private String idNumber;
|
||||
|
||||
/**
|
||||
* 主题
|
||||
*/
|
||||
@Column(name = "theme", length = 90)
|
||||
private String theme;
|
||||
|
||||
/**
|
||||
* 授权密钥
|
||||
*/
|
||||
@Column(name = "auth_key")
|
||||
private String authKey;
|
||||
|
||||
/**
|
||||
* 密码Hash值
|
||||
*/
|
||||
@Column(name = "password_hash")
|
||||
private String passwordHash;
|
||||
|
||||
/**
|
||||
* 授权令牌
|
||||
*/
|
||||
@Column(name = "auth_token")
|
||||
private String authToken;
|
||||
|
||||
/**
|
||||
* Email地址
|
||||
*/
|
||||
@Column(name = "email")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 状态;0:临时,1:正常,2:停用
|
||||
*/
|
||||
@Column(name = "status", length = 3)
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 用户类型;0:初始化人员;1:超级管理员;2:普通用户
|
||||
*/
|
||||
@Column(name = "user_type", length = 3)
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Column(name = "mobile_no", length = 90)
|
||||
private String mobileNo;
|
||||
|
||||
/**
|
||||
* 家庭电话
|
||||
*/
|
||||
@Column(name = "home_phone_no", length = 90)
|
||||
private String homePhoneNo;
|
||||
|
||||
/**
|
||||
* 直线经理ID
|
||||
*/
|
||||
@Column(name = "reporting_manager_id", length = 150)
|
||||
private String reportingManagerId;
|
||||
|
||||
/**
|
||||
* 语言信息
|
||||
*/
|
||||
@Column(name = "language", length = 150)
|
||||
private String language;
|
||||
|
||||
/**
|
||||
* 时区信息
|
||||
*/
|
||||
@Column(name = "timezone", length = 150)
|
||||
private String timezone;
|
||||
|
||||
/**
|
||||
* 国籍
|
||||
*/
|
||||
@Column(name = "nationality", length = 150)
|
||||
private String nationality;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
@Column(name = "thumb", length = 1500)
|
||||
private String thumb;
|
||||
|
||||
/**
|
||||
* 毕业院校
|
||||
*/
|
||||
@Column(name = "graduated_from")
|
||||
private String graduatedFrom;
|
||||
|
||||
/**
|
||||
* 毕业专业
|
||||
*/
|
||||
@Column(name = "graduated_major")
|
||||
private String graduatedMajor;
|
||||
|
||||
/**
|
||||
* 最高学历
|
||||
*/
|
||||
@Column(name = "highest_education")
|
||||
private String highestEducation;
|
||||
|
||||
/**
|
||||
* 招聘渠道
|
||||
*/
|
||||
@Column(name = "recruitment_channel")
|
||||
private String recruitmentChannel;
|
||||
|
||||
/**
|
||||
* 招聘类型
|
||||
*/
|
||||
@Column(name = "recruitment_type", length = 150)
|
||||
private String recruitmentType;
|
||||
|
||||
/**
|
||||
* 备用字段1
|
||||
*/
|
||||
@Column(name = "memo1", length = 150)
|
||||
private String memo1;
|
||||
|
||||
/**
|
||||
* 备用字段2
|
||||
*/
|
||||
@Column(name = "memo2", length = 150)
|
||||
private String memo2;
|
||||
|
||||
/**
|
||||
* 备用字段3
|
||||
*/
|
||||
@Column(name = "memo3", length = 150)
|
||||
private String memo3;
|
||||
|
||||
/**
|
||||
* 备用字段4
|
||||
*/
|
||||
@Column(name = "memo4", length = 150)
|
||||
private String memo4;
|
||||
|
||||
/**
|
||||
* 备用字段5
|
||||
*/
|
||||
@Column(name = "memo5", length = 150)
|
||||
private String memo5;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Column(name = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 代理用户信息
|
||||
*/
|
||||
@Column(name = "additional_accounts")
|
||||
private String additionalAccounts;
|
||||
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
@Column(name = "location", length = 150)
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 办公电话
|
||||
*/
|
||||
@Column(name = "telephone_no", length = 150)
|
||||
private String telephoneNo;
|
||||
|
||||
/**
|
||||
* 员工状态
|
||||
*/
|
||||
@Column(name = "employee_status", length = 150)
|
||||
private String employeeStatus;
|
||||
|
||||
/**
|
||||
* 开始工作时间
|
||||
*/
|
||||
@Column(name = "start_work_day")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startWorkDay;
|
||||
|
||||
/**
|
||||
* 入企时间
|
||||
*/
|
||||
@Column(name = "onboard_day")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date onboardDay;
|
||||
|
||||
/**
|
||||
* 职务
|
||||
*/
|
||||
@Column(name = "duty", length = 150)
|
||||
private String duty;
|
||||
|
||||
/**
|
||||
* 职级
|
||||
*/
|
||||
@Column(name = "rank", length = 150)
|
||||
private String rank;
|
||||
|
||||
/**
|
||||
* 工作地
|
||||
*/
|
||||
@Column(name = "work_place", length = 150)
|
||||
private String workPlace;
|
||||
|
||||
/**
|
||||
* 发薪地
|
||||
*/
|
||||
@Column(name = "payroll_place", length = 150)
|
||||
private String payrollPlace;
|
||||
|
||||
/**
|
||||
* 管理序列职级
|
||||
*/
|
||||
@Column(name = "position_mgr_level", length = 150)
|
||||
private String positionMgrLevel;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
@Column(name = "company_id", length = 150)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 组织部门ID
|
||||
*/
|
||||
@Column(name = "orgnization_id", length = 150)
|
||||
private String orgnizationId;
|
||||
|
||||
/**
|
||||
* 计费中心ID
|
||||
*/
|
||||
@Column(name = "cost_center_id", length = 150)
|
||||
private String costCenterId;
|
||||
|
||||
/**
|
||||
* 是否强制更新到email,1代表强制更新,0代表不强制更新
|
||||
*/
|
||||
@Column(name = "to_email", length = 3)
|
||||
private String toEmail;
|
||||
|
||||
/**
|
||||
* 备用邮箱
|
||||
*/
|
||||
@Column(name = "email2", length = 765)
|
||||
private String email2;
|
||||
|
||||
/**
|
||||
* 是否强制更新到手机,1代表强制更新,0代表不强制更新
|
||||
*/
|
||||
@Column(name = "to_mobile_no", length = 3)
|
||||
private String toMobileNo;
|
||||
|
||||
/**
|
||||
* 备用手机号码
|
||||
*/
|
||||
@Column(name = "mobile_no2", length = 765)
|
||||
private String mobileNo2;
|
||||
|
||||
/**
|
||||
* 是否有更新备用信息,1代表有更新,0代表没有更新
|
||||
*/
|
||||
@Column(name = "is_spare", length = 3)
|
||||
private String isSpare;
|
||||
|
||||
/**
|
||||
* 所在域
|
||||
*/
|
||||
@Column(name = "domain_id", length = 150)
|
||||
private String domainId;
|
||||
|
||||
/**
|
||||
* 经理标志;0:否;1:是
|
||||
*/
|
||||
@Column(name = "manager_flag", length = 3)
|
||||
private String managerFlag;
|
||||
|
||||
/**
|
||||
* 停用理由
|
||||
*/
|
||||
@Column(name = "frozen_reason")
|
||||
private String frozenReason;
|
||||
|
||||
/**
|
||||
* 账号激活令牌
|
||||
*/
|
||||
@Column(name = "account_active_token", length = 765)
|
||||
private String accountActiveToken;
|
||||
|
||||
/**
|
||||
* 登录失败次数
|
||||
*/
|
||||
@Column(name = "failed_login_times", length = 11)
|
||||
private Integer failedLoginTimes;
|
||||
|
||||
/**
|
||||
* 登录失败开始时间
|
||||
*/
|
||||
@Column(name = "failed_login_start_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date failedLoginStartAt;
|
||||
|
||||
/**
|
||||
* 最近一次登录失败时间
|
||||
*/
|
||||
@Column(name = "failed_login_last_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date failedLoginLastAt;
|
||||
|
||||
/**
|
||||
* 登录失败原因
|
||||
*/
|
||||
@Column(name = "failed_login_reason")
|
||||
private String failedLoginReason;
|
||||
|
||||
/**
|
||||
* 索回密码请求时间
|
||||
*/
|
||||
@Column(name = "find_pwd_req_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date findPwdReqAt;
|
||||
|
||||
/**
|
||||
* 临时密码
|
||||
*/
|
||||
@Column(name = "find_pwd_tmp_key", length = 765)
|
||||
private String findPwdTmpKey;
|
||||
|
||||
/**
|
||||
* 临时密码过期时间
|
||||
*/
|
||||
@Column(name = "find_pwd_exp_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date findPwdExpAt;
|
||||
|
||||
/**
|
||||
* 密码重置令牌
|
||||
*/
|
||||
@Column(name = "password_reset_token", length = 765)
|
||||
private String passwordResetToken;
|
||||
|
||||
/**
|
||||
* 登陆时是否强制需要修改密码;0:否;1:是
|
||||
*/
|
||||
@Column(name = "need_pwd_change", length = 3)
|
||||
private String needPwdChange;
|
||||
|
||||
/**
|
||||
* 最近一次修改密码时间
|
||||
*/
|
||||
@Column(name = "last_pwd_change_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastPwdChangeAt;
|
||||
|
||||
/**
|
||||
* 最近一次修改密码原因
|
||||
*/
|
||||
@Column(name = "last_pwd_change_reason")
|
||||
private String lastPwdChangeReason;
|
||||
|
||||
/**
|
||||
* 最近一次登录时间
|
||||
*/
|
||||
@Column(name = "last_login_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastLoginAt;
|
||||
|
||||
/**
|
||||
* 最近一次登录IP
|
||||
*/
|
||||
@Column(name = "last_login_ip", length = 90)
|
||||
private String lastLoginIp;
|
||||
|
||||
/**
|
||||
* 最近一次登录MAC地址
|
||||
*/
|
||||
@Column(name = "last_login_mac", length = 90)
|
||||
private String lastLoginMac;
|
||||
|
||||
/**
|
||||
* 最近一次操作时间
|
||||
*/
|
||||
@Column(name = "last_action_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastActionAt;
|
||||
|
||||
/**
|
||||
* 最近一次操作IP
|
||||
*/
|
||||
@Column(name = "last_action_ip", length = 90)
|
||||
private String lastActionIp;
|
||||
|
||||
/**
|
||||
* 最近一次操作MAC地址
|
||||
*/
|
||||
@Column(name = "last_action_mac", length = 90)
|
||||
private String lastActionMac;
|
||||
|
||||
/**
|
||||
* 在线状态;0:离线,1:在线
|
||||
*/
|
||||
@Column(name = "online_status", length = 3)
|
||||
private String onlineStatus;
|
||||
|
||||
/**
|
||||
* 有效期开始时间
|
||||
*/
|
||||
@Column(name = "valid_start_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date validStartAt;
|
||||
|
||||
/**
|
||||
* 有效期结束时间
|
||||
*/
|
||||
@Column(name = "valid_end_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date validEndAt;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
@Column(name = "data_from", length = 150)
|
||||
private String dataFrom;
|
||||
|
||||
/**
|
||||
* 登录次数
|
||||
*/
|
||||
@Column(name = "login_number", length = 11)
|
||||
private Integer loginNumber;
|
||||
|
||||
/**
|
||||
* 在线时长
|
||||
*/
|
||||
@Column(name = "online_duration")
|
||||
private Float onlineDuration;
|
||||
|
||||
/**
|
||||
* 学习时长
|
||||
*/
|
||||
@Column(name = "learning_duration")
|
||||
private Float learningDuration;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Column(name = "sequence_number", length = 11)
|
||||
private Integer sequenceNumber;
|
||||
|
||||
/**
|
||||
* 离职类型
|
||||
*/
|
||||
@Column(name = "dimission_type", length = 96)
|
||||
private String dimissionType;
|
||||
|
||||
/**
|
||||
* 离职日期
|
||||
*/
|
||||
@Column(name = "dimission_time", length = 96)
|
||||
private String dimissionTime;
|
||||
|
||||
/**
|
||||
* band
|
||||
*/
|
||||
@Column(name = "band_code", length = 96)
|
||||
private String bandCode;
|
||||
|
||||
/**
|
||||
* band描述
|
||||
*/
|
||||
@Column(name = "band_desc", length = 765)
|
||||
private String bandDesc;
|
||||
|
||||
/**
|
||||
* band方向
|
||||
*/
|
||||
@Column(name = "band_direction", length = 96)
|
||||
private String bandDirection;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@Column(name = "version", length = 11)
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Column(name = "created_by", length = 150)
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "created_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建来源
|
||||
*/
|
||||
@Column(name = "created_from", length = 150)
|
||||
private String createdFrom;
|
||||
|
||||
/**
|
||||
* 创建IP
|
||||
*/
|
||||
@Column(name = "created_ip", length = 150)
|
||||
private String createdIp;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
@Column(name = "updated_by", length = 150)
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "updated_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新来源
|
||||
*/
|
||||
@Column(name = "updated_from", length = 150)
|
||||
private String updatedFrom;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
@Column(name = "updated_ip", length = 150)
|
||||
private String updatedIp;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.xboe.system.user.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.xboe.system.user.entity.FwUser;
|
||||
|
||||
/**
|
||||
* 用户信息查询接口
|
||||
*/
|
||||
public interface IUserService {
|
||||
|
||||
/**
|
||||
* 按kid查询用户
|
||||
*
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
FwUser get(String kid);
|
||||
|
||||
/**
|
||||
* 按用户名查询用户
|
||||
*
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
FwUser getByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
List<FwUser> list(Integer pageIndex, Integer pageSize);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.xboe.system.user.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.xboe.system.user.dao.UserDao;
|
||||
import com.xboe.system.user.entity.FwUser;
|
||||
import com.xboe.system.user.service.IUserService;
|
||||
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class UserServiceImpl implements IUserService {
|
||||
|
||||
@Resource
|
||||
UserDao dao;
|
||||
|
||||
@Override
|
||||
public FwUser get(String kid) {
|
||||
FwUser user = dao.getById(kid);
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FwUser getByUserName(String userName) {
|
||||
FwUser user = dao.getByUserName(userName);
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FwUser> list(Integer pageIndex, Integer pageSize) {
|
||||
return dao.list(pageIndex, pageSize);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
## redis
|
||||
spring.redis.database=3
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
## datasource config
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_old?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
# 设置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,21 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-pro.xml
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
@@ -0,0 +1,21 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-pro.xml
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
@@ -0,0 +1,21 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_org?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=boe_org
|
||||
spring.datasource.password=ENC(MaC28GJw2JcbH8Lil0CrqSDTYxX49FJ0rxcmHH2pX0k=)
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-test.xml
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
@@ -0,0 +1,49 @@
|
||||
spring.profiles.active=@profileActive@
|
||||
spring.application.name=boe-server-old
|
||||
server.port=9091
|
||||
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.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=1Qaz2wsx
|
||||
spring.redis.port=6379
|
||||
|
||||
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.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||
|
||||
# spring.jackson.default-property-inclusion=non_null
|
||||
#spring.jackson.locale=
|
||||
spring.jackson.time-zone=GMT+8
|
||||
|
||||
# jpa config
|
||||
spring.jpa.database = MYSQL
|
||||
spring.jpa.show-sql = true
|
||||
#spring.jpa.properties.hibernate.format_sql = true
|
||||
#spring.jpa.properties.hibernate.use_sql_comments = 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.hibernate.ddl-auto=none
|
||||
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
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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>
|
||||
<!-- <logger name="org.hibernate.SQL" level="DEBUG"/>-->
|
||||
<!-- <logger name="org.hibernate.engine.QueryParameters" level="DEBUG"/>-->
|
||||
<!-- <logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG"/>-->
|
||||
</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="/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="ERROR">
|
||||
<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="/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="ERROR">
|
||||
<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>
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.xask.test;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
import com.xboe.common.utils.IDGenerator;
|
||||
|
||||
public class NewUserSql {
|
||||
|
||||
// public static void main(String[] args) {
|
||||
//
|
||||
// String filePath="E:\\Projects\\BOEU\\java\\servers\\boe-server-old\\users.txt";
|
||||
// String sqlPath="E:\\Projects\\BOEU\\java\\servers\\boe-server-old\\users.sql";
|
||||
//
|
||||
// String orgId="965356084879429632";
|
||||
// String orgKid="32DEB39B-F9AD-4771-9DB5-CD9FA4AA5ED5";
|
||||
//
|
||||
//
|
||||
// BufferedReader reader = null;
|
||||
// BufferedWriter writer=null;
|
||||
// try {
|
||||
//
|
||||
// reader=new BufferedReader(new InputStreamReader(new FileInputStream(filePath),"UTF-8"));
|
||||
// writer = new BufferedWriter(new FileWriter(sqlPath));
|
||||
//
|
||||
// String line = reader.readLine();
|
||||
//
|
||||
// while (line != null) {
|
||||
// String[] values=line.split(",");
|
||||
// String id=IDGenerator.generate();
|
||||
// String loginName=values[1];
|
||||
// String sql1="insert into boe_account(id,login_name,pass_key,pass_value,reg_time,status,sys_id,deleted)"
|
||||
// + "values('"+id+"','"+loginName+"','U2Uw6x','d1f151a5766e7a7736a0ba9022998866','2022-07-04',1,'"+values[0]+"',0);"
|
||||
// + "";
|
||||
//
|
||||
// String sql2="insert into boe_user(id,depart_id,gender,name,study_total,sys_depart_id,sys_id,user_no,user_type)"
|
||||
// + "values("+id+",'"+orgId+"',1,'"+values[2]+"',0,'"+orgKid+"','"+values[0]+"','"+loginName+"',3);";
|
||||
// writer.write(sql1+"\n");
|
||||
// writer.write(sql2+"\n");
|
||||
// line = reader.readLine();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }catch(Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }finally {
|
||||
// if(reader!=null) {
|
||||
// try {
|
||||
// reader.close();
|
||||
// } catch (IOException e) {
|
||||
//
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// if(writer!=null) {
|
||||
// try {
|
||||
// writer.close();
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// for(int i=1;i<6;i++) {
|
||||
// String id=IDGenerator.generate();
|
||||
// String sql1="insert into boe_account(id,login_name,pass_key,pass_value,reg_time,status,sys_id,deleted)"
|
||||
// + "values('"+id+"','testbairu000"+i+"','U2Uw6x','d1f151a5766e7a7736a0ba9022998866','2022-07-04',1,'对应的kid',0);"
|
||||
// + "";
|
||||
//
|
||||
// String sql2="insert into boe_user(id,depart_id,gender,name,study_total,sys_depart_id,sys_id,user_no,user_type)"
|
||||
// + "values("+id+",'"+orgId+"',1,'测试账号"+i+"',0,'"+orgKid+"','原用户的id','testbairu000"+i+"',3);";
|
||||
//
|
||||
// System.out.println(sql1);
|
||||
// System.out.println(sql2);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user