mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 19:06:49 +08:00
同步一下
This commit is contained in:
@@ -1,22 +1,11 @@
|
||||
package com.xboe;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.xboe.basic.entity.OldOrganization;
|
||||
import com.xboe.basic.entity.OldUser;
|
||||
import com.xboe.basic.service.IOldService;
|
||||
import com.xboe.primary.entity.MainOrganization;
|
||||
import com.xboe.primary.entity.MainUser;
|
||||
import com.xboe.primary.service.IMainDbSyncService;
|
||||
import com.xboe.basic.service.IModifyService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -30,57 +19,15 @@ import lombok.extern.slf4j.Slf4j;
|
||||
public class StartRunner implements ApplicationRunner {
|
||||
|
||||
@Autowired
|
||||
IOldService oldService;
|
||||
IModifyService service;
|
||||
|
||||
@Autowired
|
||||
IMainDbSyncService mainService;
|
||||
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
//用于存放 kid=newId
|
||||
|
||||
Map<String,String> mainOrgMap=new HashMap<String,String>();
|
||||
try {
|
||||
//同步机构
|
||||
List<OldOrganization> allList =oldService.listAll();
|
||||
for(OldOrganization org :allList) {
|
||||
|
||||
MainOrganization mainOrg = mainService.findByKid(org.getKid());
|
||||
|
||||
if(mainOrg==null) {
|
||||
//添加
|
||||
mainOrg=organizationToEntity(org);
|
||||
mainService.save(mainOrg);
|
||||
}else {
|
||||
//更新
|
||||
copyOrganizationToEntity(mainOrg,org);
|
||||
mainService.update(mainOrg);
|
||||
}
|
||||
|
||||
mainOrgMap.put(org.getKid(),mainOrg.getId());//
|
||||
|
||||
}
|
||||
//同步用户信息
|
||||
//查询出本地用户
|
||||
List<MainUser> allUsers=mainService.findAll();
|
||||
for(MainUser mainUser : allUsers) {
|
||||
|
||||
OldUser oldUser = oldService.getByUserKid(mainUser.getSysId());
|
||||
if(oldUser!=null) {
|
||||
|
||||
String newId=mainOrgMap.get(oldUser.getOrgnizationId());
|
||||
|
||||
if(StringUtils.isBlank(newId)) {
|
||||
log.error("未找到【"+oldUser.getKid()+"】对应的机构id,不更新用户");
|
||||
}else {
|
||||
mainUser.setSysDepartId(oldUser.getOrgnizationId());
|
||||
mainUser.setCompanyId(oldUser.getCompanyId());
|
||||
mainUser.setDepartId(newId);
|
||||
mainService.updateUser(mainUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("执行失败",e);
|
||||
@@ -89,49 +36,4 @@ public class StartRunner implements ApplicationRunner {
|
||||
|
||||
}
|
||||
|
||||
private void copyOrganizationToEntity(MainOrganization ov ,OldOrganization org) {
|
||||
ov.setCode(org.getOrgnizationCode());
|
||||
ov.setName(org.getOrgnizationName());
|
||||
ov.setSysId(org.getKid());
|
||||
ov.setSysParentId(org.getParentOrgnizationId());
|
||||
ov.setDescription(org.getDescription());
|
||||
ov.setCompanyId(org.getCompanyId());
|
||||
ov.setDomainId(org.getDomainId());
|
||||
ov.setNamePath(org.getNamePath());
|
||||
ov.setOrgnizationManagerId(org.getOrgnizationManagerId());
|
||||
ov.setOrganizationLevel(org.getOrganizationLevel());
|
||||
if(StringUtils.isNotBlank(org.getIsMakeOrg())){
|
||||
ov.setIsMakeOrg("1".equals(org.getIsMakeOrg()));//0:否,1:是
|
||||
}
|
||||
if(StringUtils.isNotBlank(org.getIsServiceSite())) {
|
||||
ov.setIsServiceSite("1".equals(org.getIsServiceSite()));//0:否,1:是
|
||||
}
|
||||
if(StringUtils.isNotBlank(org.getIsDefaultOrganization())) {
|
||||
ov.setIsDefaultOrganization("1".equals(org.getIsDefaultOrganization()));//0:否,1:是
|
||||
}
|
||||
if(StringUtils.isNotBlank(org.getStatus())) {
|
||||
ov.setStatus(Integer.parseInt(org.getStatus()));
|
||||
}else{
|
||||
ov.setStatus(1);
|
||||
}
|
||||
|
||||
if(org.getIsDeleted()!=null) {
|
||||
ov.setDeleted(org.getIsDeleted()==0? false:true); //0:正常,1:已删除
|
||||
}else {
|
||||
ov.setDeleted(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化对象
|
||||
* @param org
|
||||
* @return
|
||||
*/
|
||||
private MainOrganization organizationToEntity(OldOrganization org) {
|
||||
MainOrganization ov = new MainOrganization();
|
||||
copyOrganizationToEntity(ov,org);
|
||||
return ov;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.xboe.basic.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.basic.entity.OldOrganization;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.QueryBuilder;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 老系统的机构
|
||||
* */
|
||||
@Slf4j
|
||||
@Repository
|
||||
public class OldOrganizationDao extends BaseDao<OldOrganization> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询全部机构信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<OldOrganization> listAll() {
|
||||
// 删除状态的也同步,用于解决删除数据问题
|
||||
//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("OldOrganization org,OldTreeNode tn");
|
||||
query.addFields("org","tn.namePath");
|
||||
|
||||
query.addFilter(FieldFilters.eqField("org.treeNodeId", "tn.kid"));
|
||||
query.addFilter(FieldFilters.eq("org.isDeleted", 0));
|
||||
|
||||
|
||||
List<OldOrganization> list=new ArrayList<OldOrganization>();
|
||||
|
||||
try {
|
||||
List<Object[]> rs = this.findListFields(query.builder());
|
||||
//List<Object[]> rs=this.findListFields(query.builder());
|
||||
for(Object[] objs : rs) {
|
||||
OldOrganization fworg=(OldOrganization)objs[0];
|
||||
String namePath=(String)objs[1];
|
||||
fworg.setNamePath(namePath);
|
||||
list.add(fworg);
|
||||
}
|
||||
}catch(Exception e) {
|
||||
log.error("查询机构信息错误",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xboe.basic.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.basic.entity.StudyCourseItem;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
|
||||
/**
|
||||
* 老系统的机构
|
||||
* */
|
||||
@Repository
|
||||
public class StudyCourseItemDao extends BaseDao<StudyCourseItem> {
|
||||
|
||||
}
|
||||
@@ -2,10 +2,10 @@ package com.xboe.basic.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.basic.entity.OldUser;
|
||||
import com.xboe.basic.entity.StudyExam;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
|
||||
@Repository
|
||||
public class OldUserDao extends BaseDao<OldUser>{
|
||||
public class StudyExamDao extends BaseDao<StudyExam>{
|
||||
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
package com.xboe.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_fw_orgnization")
|
||||
public class OldOrganization {
|
||||
|
||||
/**
|
||||
* 组织部门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 Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.xboe.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* 机构treeNode表
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "eln_fw_tree_node")
|
||||
public class OldTreeNode {
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.xboe.basic.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_user")
|
||||
public class OldUser implements java.io.Serializable{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "kid", length = 150)
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 员工编号
|
||||
*/
|
||||
@Column(name = "user_no", length = 90)
|
||||
private String userNo;
|
||||
|
||||
|
||||
/**
|
||||
* 状态;0:临时,1:正常,2:停用
|
||||
*/
|
||||
@Column(name = "status", length = 3)
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
@Column(name = "company_id", length = 150)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 组织部门ID
|
||||
*/
|
||||
@Column(name = "orgnization_id", length = 150)
|
||||
private String orgnizationId;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.xboe.basic.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/*
|
||||
* 课程学习记录表,相当于课程学习表的子表
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"study_course_item")
|
||||
public class StudyCourseItem extends IdEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final int STATUS_NONE=1;
|
||||
|
||||
public static final int STATUS_STUDYING=2;
|
||||
|
||||
public static final int STATUS_FINISH=9;
|
||||
|
||||
/*
|
||||
* 学习id
|
||||
* */
|
||||
@Column(name = "study_id",nullable=false,length = 20)
|
||||
private String studyId;
|
||||
|
||||
/*
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length = 20)
|
||||
private String courseId;
|
||||
|
||||
/*
|
||||
* 课程内容id
|
||||
* */
|
||||
@Column(name = "content_id",nullable=true,length=20)
|
||||
private String contentId;
|
||||
|
||||
/**
|
||||
* 内容类型,用于查询
|
||||
*/
|
||||
@Column(name = "content_type",length=2)
|
||||
private Integer contentType;
|
||||
|
||||
/**
|
||||
* 账号id,记录学习人
|
||||
*/
|
||||
@Column(name = "aid",nullable=true,length=20)
|
||||
private String aid;
|
||||
|
||||
/**
|
||||
* 学习人姓名
|
||||
*/
|
||||
@Column(name = "aname",nullable=true,length=30)
|
||||
private String aname;
|
||||
|
||||
/**
|
||||
* 内容学习的最终得分
|
||||
*/
|
||||
@Column(name = "score",nullable=true)
|
||||
private Float score;
|
||||
|
||||
/*
|
||||
* 学习进度
|
||||
* */
|
||||
@Column(name = "progress")
|
||||
private Integer progress;
|
||||
|
||||
/**
|
||||
* 学习状态,当前未使用 ,以学习进度100来定义是否已学完
|
||||
* 1表未学习,2表学习中,9表学习完成
|
||||
*/
|
||||
@Column(name = "status",length=1)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.xboe.basic.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/*
|
||||
* 课程考试提交记录表,此表是课程考试的记录
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"study_exam")
|
||||
public class StudyExam extends IdEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*
|
||||
* 学习id
|
||||
* */
|
||||
@Column(name = "study_id",nullable=false,length = 20)
|
||||
private String studyId;
|
||||
|
||||
/**
|
||||
* 内容学习记录id
|
||||
*/
|
||||
@Column(name = "study_item_id",nullable=false,length = 20)
|
||||
private String studyItemId;
|
||||
|
||||
/*
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length = 20)
|
||||
private String courseId;
|
||||
|
||||
/*
|
||||
* 内容id
|
||||
* */
|
||||
@Column(name = "content_id",nullable=false,length = 20)
|
||||
private String contentId;
|
||||
|
||||
|
||||
/*
|
||||
* 学员id
|
||||
* */
|
||||
@Column(name = "student_id",nullable=false,length = 20)
|
||||
private String studentId;
|
||||
|
||||
/*
|
||||
* 学员name
|
||||
* */
|
||||
@Column(name = "student_name",length = 30)
|
||||
private String studentName;
|
||||
|
||||
|
||||
/*
|
||||
* 对应课程考试的id
|
||||
* */
|
||||
@Column(name = "test_id",nullable=false,length = 20)
|
||||
private String testId;
|
||||
|
||||
/*
|
||||
* 试卷内容
|
||||
* */
|
||||
@Column(name = "paper_json",columnDefinition = "text")
|
||||
private String paperJson;
|
||||
|
||||
/**本次得分 */
|
||||
@Column(name = "score" ,nullable=false)
|
||||
private Float score;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.xboe.basic.service;
|
||||
|
||||
public interface IModifyService {
|
||||
|
||||
void modifyCourseExamScore(String courseId,String testId);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.xboe.basic.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.xboe.basic.entity.OldOrganization;
|
||||
import com.xboe.basic.entity.OldUser;
|
||||
|
||||
public interface IOldService {
|
||||
|
||||
/**
|
||||
* 查询指定条数的机构信息
|
||||
*
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
List<OldOrganization> listAll();
|
||||
|
||||
/**
|
||||
* 根据kid获取用户信息
|
||||
* @param kid
|
||||
* @return
|
||||
*/
|
||||
OldUser getByUserKid(String kid);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.xboe.basic.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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;
|
||||
|
||||
@Override
|
||||
public void modifyCourseExamScore(String courseId,String testId) {
|
||||
|
||||
//查询出所有的
|
||||
List<StudyExam> list = sexameDao.findList(FieldFilters.eq("courseId", courseId),FieldFilters.eq("testId", testId));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.xboe.basic.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.xboe.basic.dao.OldOrganizationDao;
|
||||
import com.xboe.basic.dao.OldUserDao;
|
||||
import com.xboe.basic.entity.OldOrganization;
|
||||
import com.xboe.basic.entity.OldUser;
|
||||
import com.xboe.basic.service.IOldService;
|
||||
import com.xboe.common.OrderCondition;
|
||||
|
||||
|
||||
/**
|
||||
* 老系统的机构
|
||||
* */
|
||||
@Service
|
||||
public class OldServiceImpl implements IOldService {
|
||||
|
||||
@Resource
|
||||
OldOrganizationDao dao;
|
||||
|
||||
@Resource
|
||||
OldUserDao userDao;
|
||||
|
||||
@Override
|
||||
public List<OldOrganization> listAll() {
|
||||
List<OldOrganization> list = dao.listAll();
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OldUser getByUserKid(String kid) {
|
||||
|
||||
return userDao.get(kid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.xboe.datasource;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
|
||||
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.orm.jpa.JpaTransactionManager;
|
||||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@EnableJpaRepositories(
|
||||
entityManagerFactoryRef="entityManagerFactoryBasic",
|
||||
transactionManagerRef="transactionManagerBasic",
|
||||
basePackages= { "com.xboe.basic" }) //设置Repository所在位置
|
||||
public class BasicJPAConfig {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("basicDataSource")
|
||||
private DataSource basicDataSource;
|
||||
|
||||
@Autowired
|
||||
private JpaProperties jpaProperties;
|
||||
|
||||
@Autowired
|
||||
private HibernateProperties hibernateProperties;
|
||||
|
||||
private Map<String, Object> getVendorProperties() {
|
||||
return hibernateProperties.determineHibernateProperties(jpaProperties.getProperties(), new HibernateSettings());
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(name = "entityManagerBasic")
|
||||
public EntityManager entityManager(EntityManagerFactoryBuilder builder) {
|
||||
return entityManagerFactoryPrimary(builder).getObject().createEntityManager();
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(name = "entityManagerFactoryBasic")
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary (EntityManagerFactoryBuilder builder) {
|
||||
return builder
|
||||
.dataSource(basicDataSource)
|
||||
.packages("com.xboe.basic") //设置实体类所在位置
|
||||
.persistenceUnit("basicPersistenceUnit")
|
||||
.properties(getVendorProperties())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(name = "transactionManagerBasic")
|
||||
public PlatformTransactionManager transactionManagerPrimary(EntityManagerFactoryBuilder builder) {
|
||||
return new JpaTransactionManager(entityManagerFactoryPrimary(builder).getObject());
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.xboe.datasource;
|
||||
|
||||
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
|
||||
@Configuration
|
||||
public class DataSourceConfiguration {
|
||||
|
||||
@Primary
|
||||
@Bean(name="basicDataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.db1")
|
||||
public DataSource primaryDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
@Bean(name="primaryDataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.db2")
|
||||
public DataSource secondaryDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.xboe.datasource;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
|
||||
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.orm.jpa.JpaTransactionManager;
|
||||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@EnableJpaRepositories(
|
||||
entityManagerFactoryRef="entityManagerFactoryPrimary",
|
||||
transactionManagerRef="transactionManagerPrimary",
|
||||
basePackages= { "com.xboe.primary" }) //设置Repository所在位置
|
||||
public class MainJPAConfig {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("primaryDataSource")
|
||||
private DataSource primaryDataSource;
|
||||
|
||||
@Autowired
|
||||
private JpaProperties jpaProperties;
|
||||
|
||||
@Autowired
|
||||
private HibernateProperties hibernateProperties;
|
||||
|
||||
private Map<String, Object> getVendorProperties() {
|
||||
return hibernateProperties.determineHibernateProperties(jpaProperties.getProperties(), new HibernateSettings());
|
||||
}
|
||||
|
||||
@Bean(name = "entityManagerPrimary")
|
||||
public EntityManager entityManager(EntityManagerFactoryBuilder builder) {
|
||||
return entityManagerFactoryPrimary(builder).getObject().createEntityManager();
|
||||
}
|
||||
|
||||
@Bean(name = "entityManagerFactoryPrimary")
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary (EntityManagerFactoryBuilder builder) {
|
||||
return builder
|
||||
.dataSource(primaryDataSource)
|
||||
.packages("com.xboe.primary") //设置实体类所在位置
|
||||
.persistenceUnit("primaryPersistenceUnit")
|
||||
.properties(getVendorProperties())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean(name = "transactionManagerPrimary")
|
||||
public PlatformTransactionManager transactionManagerPrimary(EntityManagerFactoryBuilder builder) {
|
||||
return new JpaTransactionManager(entityManagerFactoryPrimary(builder).getObject());
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
package com.xboe.dto;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 按数据标准构建
|
||||
*/
|
||||
@Data
|
||||
public class OrganizationDto implements java.io.Serializable{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**新系统的id*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 老系统ID
|
||||
*/
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 组织部门代码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 组织名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**使用默认体系下,机构的namePath路径,中间使用/分开*/
|
||||
private String namePath;
|
||||
|
||||
/**
|
||||
* 机构名称简称
|
||||
*/
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* 多租户下的id,此机构属于哪个sass用户
|
||||
*/
|
||||
private String sassId;
|
||||
|
||||
/**
|
||||
* 系统级别
|
||||
*/
|
||||
private Integer sysLevel;
|
||||
|
||||
/**
|
||||
* 是否是默认注册组织机构
|
||||
*/
|
||||
private Boolean isDefault;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
private String dataFrom;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 创建来源
|
||||
*/
|
||||
private String createFrom;
|
||||
|
||||
/**
|
||||
* 组织级别
|
||||
*/
|
||||
private String organizationLevel;
|
||||
|
||||
/**
|
||||
* 是否制造组织
|
||||
*/
|
||||
private Boolean isMakeOrg;
|
||||
|
||||
/**
|
||||
* 是否服务现地
|
||||
*/
|
||||
private Boolean isServiceSite;
|
||||
|
||||
/**
|
||||
* 状态 0:临时,1:正常,2:停用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**备注*/
|
||||
private String remark;
|
||||
|
||||
//以下字段用于检查体系
|
||||
/**
|
||||
* 上级id
|
||||
* */
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 体系标识
|
||||
* */
|
||||
private String treeType;
|
||||
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
package com.xboe.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 按用户的数据标准构建
|
||||
*/
|
||||
@Data
|
||||
public class UserDto implements java.io.Serializable{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**新系统的用户id*/
|
||||
private String id;
|
||||
|
||||
/** 原系统的kid */
|
||||
private String kid;
|
||||
|
||||
/**人员基本信息id*/
|
||||
private String personId;
|
||||
|
||||
/**姓名*/
|
||||
private String name;
|
||||
|
||||
/**出生日期 yyyy-MM-dd*/
|
||||
private String birthday;
|
||||
|
||||
/**登录名*/
|
||||
private String loginName;
|
||||
|
||||
/**头像路径*/
|
||||
private String avatar;
|
||||
|
||||
/**邮箱*/
|
||||
private String email;
|
||||
|
||||
/**状态*/
|
||||
private Integer status;
|
||||
|
||||
/**性别,男,女 */
|
||||
private String gender;
|
||||
|
||||
/**证件类型, 身份证*/
|
||||
private String idType;
|
||||
|
||||
/**证件号码*/
|
||||
private String idNumber;
|
||||
|
||||
/**家庭电话*/
|
||||
private String homePhoneNo;
|
||||
|
||||
/**国家*/
|
||||
private String nationality;
|
||||
|
||||
/**民族*/
|
||||
private String nation;
|
||||
|
||||
/**毕来院校*/
|
||||
private String graduatedFrom;
|
||||
|
||||
/**毕业专业*/
|
||||
private String graduatedMajor;
|
||||
|
||||
/**最高学历*/
|
||||
private String highestEducation;
|
||||
|
||||
/**数据来源,老系统字段*/
|
||||
private String dataFrom;
|
||||
|
||||
/**语言,老系统字段*/
|
||||
private String language;
|
||||
|
||||
/**级别代码*/
|
||||
private String bandCode;
|
||||
|
||||
/**级别描述*/
|
||||
private String bandDesc;
|
||||
|
||||
/**发薪地id*/
|
||||
private String payrollPlaceId;
|
||||
|
||||
/**发薪地名称*/
|
||||
private String payrollPlaceName;
|
||||
|
||||
|
||||
/**管理序列职级*/
|
||||
private String positionMgrLevel;
|
||||
|
||||
/**是否在职 2正常,3离职*/
|
||||
private Integer employeeStatus;
|
||||
|
||||
/** 手机号 */
|
||||
private String mobile;
|
||||
|
||||
/** 默认的组织机构体系 */
|
||||
private String orgTreeType;
|
||||
|
||||
/**原数据关联的企业id*/
|
||||
private String oldEnterpriseId;
|
||||
|
||||
/** 旧系统机构id */
|
||||
private String oldDepartId;
|
||||
|
||||
/** 员工编号 */
|
||||
private String userNo;
|
||||
|
||||
/** 所在公司,新系统的关联的企业ID, 对应机构表中的企业 */
|
||||
private String enterpriseId;
|
||||
|
||||
/** 所在部门,新系统的机构id*/
|
||||
private String departId;
|
||||
|
||||
/** 机构名称/分隔的全路径 */
|
||||
private String orgNamePath;
|
||||
|
||||
|
||||
/** 所在域 */
|
||||
private String domainId;
|
||||
|
||||
/** 扩展字段,多租户系统的标识值 */
|
||||
private String sassId;
|
||||
|
||||
|
||||
/** 办公电话*/
|
||||
private String telephoneNo;
|
||||
|
||||
/** 职务 */
|
||||
private String duty;
|
||||
|
||||
/** 职级*/
|
||||
private String rank;
|
||||
|
||||
/** 描述*/
|
||||
private String description;
|
||||
|
||||
/**boe的时长,和系统时长单独保存,此字段不应该存在的*/
|
||||
private Integer learningDuration;
|
||||
|
||||
public Integer toGenderInteger() {
|
||||
if(this.gender!=null) {
|
||||
if(this.gender.equals("male")) {
|
||||
return 1;
|
||||
}else if(this.gender.equals("female")) {
|
||||
return 2;
|
||||
}else {
|
||||
return 3;//其它
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.xboe.primary.dao;
|
||||
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.primary.entity.MainAccount;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 账号信息DAO
|
||||
*/
|
||||
@Repository
|
||||
public interface MainAccountDao extends JpaRepository<MainAccount,String>{
|
||||
|
||||
@Modifying
|
||||
@Query(value = "update MainAccount set deleted=true where id=?1")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
public Integer setDeleted(String id);
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.xboe.primary.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.primary.entity.MainOrganization;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 机构管理DAO
|
||||
*/
|
||||
@Repository("organizationAllDao")
|
||||
public interface MainOrganizationDao extends JpaRepository<MainOrganization,String> {
|
||||
|
||||
@Modifying
|
||||
@Query(value = "update MainOrganization set deleted=true where id=?1")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer setDeleted(String id);
|
||||
|
||||
@Query(value = "from MainOrganization where id=?1")
|
||||
public MainOrganization get(String id);
|
||||
|
||||
@Query(value = "from MainOrganization where sysId=?1")
|
||||
public List<MainOrganization> findBySysId(String sysId);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.xboe.primary.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.primary.entity.MainUser;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 用户DAO
|
||||
*/
|
||||
@Transactional
|
||||
@Repository("userAllDao")
|
||||
public interface MainUserDao extends JpaRepository<MainUser,String> {
|
||||
|
||||
@Modifying
|
||||
@Query(value = "update MainUser set deleted=true where id=?1")
|
||||
public Integer setDeleted(String id);
|
||||
|
||||
@Modifying
|
||||
@Query(value = "update MainUser set departId=?1, sysDepartId=?2,companyId=?3 where id=?4")
|
||||
public Integer update(String departId,String sysDepartId,String companyId,String id);
|
||||
|
||||
|
||||
@Query(value = "from MainUser where id=?1")
|
||||
public MainUser get(String id);
|
||||
|
||||
|
||||
@Query(value = "Select new MainUser(id,sysId,userNo) from MainUser where id=?1")
|
||||
public List<MainUser> findAll(String id);
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.xboe.primary.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import com.xboe.core.orm.annotation.MetaInfo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 账号表,只是记录登录的账号信息,无任务业务实名类的信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE + "account")
|
||||
public class MainAccount extends IdEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**0 临时数据*/
|
||||
public static final int STATUS_TEMPORARY=0;
|
||||
|
||||
/**1 正常数据*/
|
||||
public static final int STATUS_NORMAL=1;
|
||||
|
||||
/**2 停用数据*/
|
||||
public static final int STATUS_DEAD=2;
|
||||
|
||||
@MetaInfo("原系统中的id")
|
||||
@Column(name = "sys_id", length = 36)
|
||||
private String sysId;
|
||||
|
||||
@MetaInfo("登录名")
|
||||
@Column(name = "login_name", nullable = true, length = 30)
|
||||
private String loginName;
|
||||
|
||||
@MetaInfo("用户头像地址")
|
||||
@Column(name = "avatar", nullable = true, length = 100)
|
||||
private String avatar;
|
||||
|
||||
@MetaInfo("手机号")
|
||||
@Column(name = "mobile", length = 11)
|
||||
private String mobile;
|
||||
|
||||
@Column(name = "email", length = 100)
|
||||
private String email;
|
||||
|
||||
@Column(name = "nick_name", length = 20)
|
||||
private String nickName;
|
||||
|
||||
@Column(name = "pass_key", length = 6)
|
||||
private String passKey;
|
||||
|
||||
@Column(name = "pass_value", length = 32)
|
||||
private String passValue;
|
||||
|
||||
@Column(name = "reg_time" )
|
||||
private LocalDateTime regTime;
|
||||
|
||||
@MetaInfo("关联的公司id")
|
||||
@Column(name = "company_id", length = 36)
|
||||
private String companyId;
|
||||
|
||||
// 状态1, 正常,2停用
|
||||
@Column(name = "status", length = 1)
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "deleted", length = 1)
|
||||
private Boolean deleted;
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
package com.xboe.primary.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 机构实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE + "organization")
|
||||
public class MainOrganization extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 原系统ID
|
||||
*/
|
||||
@Column(name = "sys_id", length = 36)
|
||||
private String sysId;
|
||||
|
||||
/**
|
||||
* 旧系统父id
|
||||
*/
|
||||
@Column(name = "sys_parent_id", length = 36)
|
||||
private String sysParentId;
|
||||
|
||||
/**
|
||||
* 组织部门代码
|
||||
*/
|
||||
@Column(name = "code", nullable = false, length = 50)
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 组织名
|
||||
*/
|
||||
@Column(name = "name", nullable = false, length = 50)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 组织全路径
|
||||
*/
|
||||
@Column(name = "name_path")
|
||||
private String namePath;
|
||||
|
||||
/**
|
||||
* 父组织部门ID
|
||||
*/
|
||||
@Column(name = "parent_id", length = 20)
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Column(name = "description", columnDefinition = "text")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
@Column(name = "company_id", length = 36)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 域ID
|
||||
*/
|
||||
@Column(name = "domain_id", length = 36)
|
||||
private String domainId;
|
||||
|
||||
/**
|
||||
* 组织部门经理ID
|
||||
*/
|
||||
@Column(name = "orgnization_manager_id", length = 36)
|
||||
private String orgnizationManagerId;
|
||||
|
||||
/**
|
||||
* 组织级别
|
||||
*/
|
||||
@Column(name = "organization_level", length = 50)
|
||||
private String organizationLevel;
|
||||
|
||||
/**
|
||||
* 是否制造组织
|
||||
*/
|
||||
@Column(name = "is_make_org", length = 1)
|
||||
private Boolean isMakeOrg;
|
||||
|
||||
/**
|
||||
* 是否服务现地
|
||||
*/
|
||||
@Column(name = "is_service_site", length = 1)
|
||||
private Boolean isServiceSite;
|
||||
|
||||
/**
|
||||
* 是否默认注册组织
|
||||
*/
|
||||
@Column(name = "is_default_organization", length = 1)
|
||||
private Boolean isDefaultOrganization;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* 0:临时,1:正常,2:停用
|
||||
*/
|
||||
@Column(name = "status", nullable = false, length = 1)
|
||||
private Integer status;
|
||||
|
||||
@Column(name="deleted",length = 1)
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package com.xboe.primary.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
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE + "user")
|
||||
public class MainUser extends IdEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 旧系统id
|
||||
*/
|
||||
@Column(name = "sys_id", length = 36)
|
||||
private String sysId;
|
||||
|
||||
/**
|
||||
* 旧系统机构id
|
||||
*/
|
||||
@Column(name = "sys_depart_id", length = 36)
|
||||
private String sysDepartId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Column(name = "name", length = 30)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 员工编号
|
||||
*/
|
||||
@Column(name = "user_no", length = 30)
|
||||
private String userNo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 所在公司
|
||||
*/
|
||||
@Column(name = "company_id", length = 36)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 所在部门
|
||||
*/
|
||||
@Column(name = "depart_id", length = 20)
|
||||
private String departId;
|
||||
|
||||
/**
|
||||
* 扩展字段,多租户系统的标识值
|
||||
*/
|
||||
@Column(name = "sass_id", length = 36)
|
||||
private String sassId;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
* */
|
||||
@Column(name="deleted",length = 1)
|
||||
private Boolean deleted;
|
||||
|
||||
public MainUser() {
|
||||
|
||||
}
|
||||
|
||||
public MainUser(String id,String sysId,String userNo) {
|
||||
this.setId(id);
|
||||
this.sysId=sysId;
|
||||
this.userNo=userNo;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.xboe.primary.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.xboe.primary.entity.MainOrganization;
|
||||
import com.xboe.primary.entity.MainUser;
|
||||
|
||||
/**
|
||||
* 基本数据同步的相关处理
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
public interface IMainDbSyncService {
|
||||
|
||||
/**
|
||||
* 查询所有的用户
|
||||
* @return
|
||||
*/
|
||||
List<MainUser> findAll();
|
||||
|
||||
MainOrganization findByKid(String kid);
|
||||
|
||||
|
||||
|
||||
void save(MainOrganization mainOrg);
|
||||
|
||||
void update(MainOrganization mainOrg);
|
||||
|
||||
void updateUser(MainUser muser);
|
||||
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.xboe.primary.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.xboe.common.utils.IDGenerator;
|
||||
import com.xboe.primary.dao.MainAccountDao;
|
||||
import com.xboe.primary.dao.MainOrganizationDao;
|
||||
import com.xboe.primary.dao.MainUserDao;
|
||||
import com.xboe.primary.entity.MainOrganization;
|
||||
import com.xboe.primary.entity.MainUser;
|
||||
import com.xboe.primary.service.IMainDbSyncService;
|
||||
|
||||
/**
|
||||
* 主数据库同步的实现
|
||||
*/
|
||||
@Service("allService")
|
||||
public class MainDbSyncServiceImpl implements IMainDbSyncService {
|
||||
|
||||
@Autowired
|
||||
MainOrganizationDao orgDao;
|
||||
|
||||
@Autowired
|
||||
MainUserDao userDao;
|
||||
|
||||
@Autowired
|
||||
MainAccountDao accountDao;
|
||||
|
||||
@Override
|
||||
@Transactional("transactionManagerPrimary")
|
||||
public MainOrganization findByKid(String kid) {
|
||||
List<MainOrganization> orgs=orgDao.findBySysId(kid);
|
||||
if(orgs!=null && !orgs.isEmpty()) {
|
||||
return orgs.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional("transactionManagerPrimary")
|
||||
public void save(MainOrganization mainOrg) {
|
||||
mainOrg.setId(IDGenerator.generate());
|
||||
orgDao.save(mainOrg);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional("transactionManagerPrimary")
|
||||
public void update(MainOrganization mainOrg) {
|
||||
orgDao.save(mainOrg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MainUser> findAll() {
|
||||
|
||||
return userDao.findAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUser(MainUser muser) {
|
||||
userDao.update(muser.getDepartId(),muser.getSysDepartId(),muser.getCompanyId(),muser.getId());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,20 +13,9 @@ 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.db1.driverClassName=com.mysql.jdbc.Driver
|
||||
spring.datasource.db1.jdbc-url=jdbc:mysql://127.0.0.1:3306/boeu_basic?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db1.username=root
|
||||
spring.datasource.db1.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
|
||||
|
||||
# 主数据库 all 对应的数据库
|
||||
spring.datasource.db2.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.db2.jdbc-url=jdbc:mysql://127.0.0.1:3306/boe_base3?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db2.username=root
|
||||
spring.datasource.db2.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
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
|
||||
@@ -35,15 +24,13 @@ logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
logging.config=classpath:log/logback-dev.xml
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
spring.web.resources.static-locations=file:E:/Projects/BOE/java/static
|
||||
|
||||
|
||||
## 上传相磁的路径配置
|
||||
xboe.upload.file.temp_path=E:/Projects/BOE/java/static/temp
|
||||
xboe.upload.file.save_path=E:/Projects/BOE/java/static/upload
|
||||
xboe.upload.file.http_path=http://localhost:9090/cdn/upload
|
||||
xboe.upload.file.temp_path=
|
||||
xboe.upload.file.save_path=
|
||||
xboe.upload.file.http_path=
|
||||
|
||||
## 新系统的内部地址,可以不通过nginx调用
|
||||
xboe.inner.data.sync.baseurl=http://localhost:9090
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
|
||||
@@ -1,35 +1,36 @@
|
||||
## redis
|
||||
# redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
# 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
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
# 当前数据库 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=ERROR
|
||||
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-pro.xml
|
||||
logging.config=classpath:log/logback-dev.xml
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
spring.web.resources.static-locations=file:E:/Projects/BOE/java/static
|
||||
|
||||
## xboe config
|
||||
xboe.api.cross_filter=true
|
||||
|
||||
## 上传相磁的路径配置
|
||||
xboe.upload.file.temp_path=E:/Projects/BOE/java/static/temp
|
||||
xboe.upload.file.save_path=E:/Projects/BOE/java/static/upload
|
||||
xboe.upload.file.http_path=http://localhost:9090/cdn/upload
|
||||
xboe.upload.file.temp_path=
|
||||
xboe.upload.file.save_path=
|
||||
xboe.upload.file.http_path=
|
||||
|
||||
## 新系统的内部地址,可以不通过nginx调用
|
||||
xboe.inner.data.sync.baseurl=http://localhost:9090
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
|
||||
@@ -1,52 +1,36 @@
|
||||
## redis
|
||||
# redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=10.251.160.38
|
||||
spring.redis.password=qwert!W577
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
# datasource config
|
||||
# basic数据库
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
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
|
||||
# 原数据库 old 对应的数据库
|
||||
spring.datasource.db1.driverClassName=com.mysql.jdbc.Driver
|
||||
spring.datasource.db1.jdbc-url=jdbc:mysql://10.251.129.126:3306/elearninglms?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db1.username=admin
|
||||
spring.datasource.db1.password=boeRds01
|
||||
# 当前数据库 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==)
|
||||
|
||||
|
||||
|
||||
# 新主数据库 all 对应的数据库
|
||||
spring.datasource.db2.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.db2.jdbc-url=jdbc:mysql://10.251.129.126:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db2.username=admin
|
||||
spring.datasource.db2.password=boeRds01
|
||||
|
||||
|
||||
logging.level.org.hibernate.SQL=ERROR
|
||||
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
#spring.web.resources.static-locations=file:E:/Projects/BOE/java/static
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-pro.xml
|
||||
logging.config=classpath:log/logback-dev.xml
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
|
||||
## xboe config
|
||||
xboe.api.cross_filter=true
|
||||
|
||||
## 上传相磁的路径配置
|
||||
xboe.upload.file.temp_path=
|
||||
xboe.upload.file.save_path=
|
||||
xboe.upload.file.http_path=
|
||||
|
||||
## 新系统的内部地址,可以不通过nginx调用
|
||||
xboe.inner.data.sync.baseurl=http://localhost:9090
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
|
||||
@@ -1,32 +1,36 @@
|
||||
## redis
|
||||
# redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
# 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
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=boe_base
|
||||
spring.datasource.password=ENC(MaC28GJw2JcbH8Lil0CrqSDTYxX49FJ0rxcmHH2pX0k=)
|
||||
# 当前数据库 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-test.xml
|
||||
logging.config=classpath:log/logback-dev.xml
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
|
||||
## xboe config
|
||||
xboe.api.cross_filter=true
|
||||
|
||||
## 上传相磁的路径配置
|
||||
xboe.upload.file.temp_path=/www/wwwroot/file/temp
|
||||
xboe.upload.file.save_path=/www/wwwroot/file/upload
|
||||
xboe.upload.file.http_path=http://114.115.162.187/file/upload
|
||||
xboe.upload.file.temp_path=
|
||||
xboe.upload.file.save_path=
|
||||
xboe.upload.file.http_path=
|
||||
|
||||
## 新系统的内部地址,可以不通过nginx调用
|
||||
xboe.inner.data.sync.baseurl=http://localhost:9090
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.xboe;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xboe.dto.OrganizationDto;
|
||||
import com.xboe.dto.UserDto;
|
||||
|
||||
public class BasicSyncTest {
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// OrganizationDto dto=new OrganizationDto();
|
||||
// dto.setCode("100001");
|
||||
// dto.setName("机构名称");
|
||||
// dto.setKid("1234-4567-3948");
|
||||
// dto.setSysLevel(0);
|
||||
// dto.setStatus(1);
|
||||
//
|
||||
// UserDto u=new UserDto();
|
||||
// u.setKid("02928-10231-01239-2392");
|
||||
// u.setLoginName("2029182");
|
||||
// u.setLearningDuration(0);
|
||||
// u.setGender(1);
|
||||
//
|
||||
// ObjectMapper om=new ObjectMapper();
|
||||
// try {
|
||||
// System.out.println(om.writeValueAsString(dto));
|
||||
// System.out.println(om.writeValueAsString(u));
|
||||
// } catch (JsonProcessingException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
package com.xboe;
|
||||
|
||||
//@SpringBootTest
|
||||
public class MultiDbTest {
|
||||
|
||||
// @Autowired
|
||||
// BasicOrganizationDao orgDao;
|
||||
//
|
||||
// @Autowired
|
||||
// MainOrganizationDao mainOrgDao;
|
||||
//
|
||||
// @Autowired
|
||||
// ErrorLogDao errDao;
|
||||
//
|
||||
// @Autowired
|
||||
// MainAccountDao mainAccountDao;
|
||||
//
|
||||
// @Autowired
|
||||
// IMainDbSyncService mainService;
|
||||
//
|
||||
// @Autowired
|
||||
// IBasicDataSyncService basicService;
|
||||
|
||||
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testOrganizationDto() {
|
||||
//
|
||||
// OrganizationDto dto=new OrganizationDto();
|
||||
//
|
||||
// dto.setCode("100001");
|
||||
// dto.setName("机构名称");
|
||||
// dto.setKid("1234-4567-39048");
|
||||
// dto.setSysLevel(0);
|
||||
// dto.setStatus(1);
|
||||
//
|
||||
// Organization org=null;
|
||||
//
|
||||
// List<Organization> orgList=orgDao.getByKid(dto.getKid());
|
||||
//
|
||||
// if(!orgList.isEmpty()) {
|
||||
// org=orgList.get(0);
|
||||
// }
|
||||
// System.out.println("org");
|
||||
// System.out.println(org);
|
||||
// if(org==null) {//新增加
|
||||
// org=new Organization();
|
||||
// org.setId(IDGenerator.generate());
|
||||
// org.setKid(dto.getKid());
|
||||
//
|
||||
// org.setCode(org.getCode());
|
||||
// org.setCreateFrom(dto.getCreateFrom());
|
||||
// org.setSysCreateTime(dto.getCreateTime());
|
||||
// org.setDataFrom(dto.getDataFrom());
|
||||
// org.setDeleted(false);
|
||||
// org.setDescription(dto.getDescription());
|
||||
// org.setIsDefault(dto.getIsDefault());
|
||||
// org.setIsMakeOrg(dto.getIsMakeOrg());
|
||||
// org.setIsServiceSite(dto.getIsServiceSite());
|
||||
// org.setName(dto.getName());
|
||||
// org.setNamePath(dto.getNamePath());
|
||||
//
|
||||
// //org.setOrganizationLevel(dto.getSysLevel());
|
||||
// org.setSysLevel(dto.getSysLevel());
|
||||
// org.setRemark(dto.getRemark());
|
||||
// org.setSassId(dto.getSassId());
|
||||
// org.setShortName(dto.getShortName());
|
||||
// org.setStatus(dto.getStatus());
|
||||
// dto.setId(org.getId());
|
||||
// orgDao.save(org);
|
||||
//
|
||||
// }else {//更新
|
||||
//
|
||||
// if(dto.getDeleted()!=null && dto.getDeleted()) {
|
||||
// org.setDeleted(dto.getDeleted());
|
||||
// }
|
||||
// org.setDescription(dto.getDescription());
|
||||
// org.setIsDefault(dto.getIsDefault());
|
||||
// org.setIsMakeOrg(dto.getIsMakeOrg());
|
||||
// org.setIsServiceSite(dto.getIsServiceSite());
|
||||
// org.setName(dto.getName());
|
||||
// //org.setOrganizationLevel(dto.getSysLevel());
|
||||
// org.setSysLevel(dto.getSysLevel());
|
||||
// org.setRemark(dto.getRemark());
|
||||
// org.setSassId(dto.getSassId());
|
||||
// org.setShortName(dto.getShortName());
|
||||
// org.setStatus(dto.getStatus());
|
||||
// orgDao.save(org);
|
||||
// dto.setId(org.getId());
|
||||
// }
|
||||
//
|
||||
// MainOrganization hasOrg=null;
|
||||
// System.out.println("dto.id");
|
||||
// System.out.println("dto.id="+dto.getId());
|
||||
// hasOrg =mainOrgDao.get(dto.getId());
|
||||
// System.out.println("hasOrg");
|
||||
// //System.out.println(hasOrg);
|
||||
// System.out.println("hasOrg");
|
||||
// if(hasOrg!=null) {
|
||||
// System.out.println("hasOrg不为null");
|
||||
// System.out.println("hasOrg name ="+hasOrg.getName());
|
||||
//// if(dto.getDeleted()!=null && dto.getDeleted()) {
|
||||
//// hasOrg.setDeleted(dto.getDeleted());
|
||||
//// }
|
||||
//// //hasOrg.setDescription(dto.getDescription());
|
||||
//// hasOrg.setIsMakeOrg(dto.getIsMakeOrg());
|
||||
//// hasOrg.setIsServiceSite(dto.getIsServiceSite());
|
||||
//// hasOrg.setName(dto.getName());
|
||||
//// hasOrg.setParentId(dto.getParentId());
|
||||
//// //hasOrg.setNamePath(dto.getn);
|
||||
//// hasOrg.setStatus(dto.getStatus());
|
||||
//// mainOrgDao.save(hasOrg);
|
||||
// }else {
|
||||
// System.out.println("hasOrg 是 null");
|
||||
// //hasOrg =orgDao.getBySysId(dto.getKid());
|
||||
// hasOrg=new MainOrganization();
|
||||
// hasOrg.setId(dto.getId());
|
||||
// hasOrg.setCode(dto.getCode());
|
||||
// hasOrg.setCompanyId(dto.getSassId());
|
||||
// hasOrg.setDeleted(false);
|
||||
// hasOrg.setDescription(dto.getDescription());
|
||||
// //hasOrg.setDomainId(dto.getD);
|
||||
// hasOrg.setIsDefaultOrganization(true);
|
||||
// hasOrg.setStatus(dto.getStatus());
|
||||
// hasOrg.setIsMakeOrg(dto.getIsMakeOrg());
|
||||
// hasOrg.setIsServiceSite(dto.getIsServiceSite());
|
||||
// hasOrg.setName(dto.getName());
|
||||
// hasOrg.setNamePath(dto.getNamePath());
|
||||
// hasOrg.setOrganizationLevel(dto.getOrganizationLevel());
|
||||
// //hasOrg.setOrgnizationManagerId(dto.get);
|
||||
// hasOrg.setParentId(dto.getParentId());
|
||||
// //hasOrg.setSysCreateAid();//创建人没有这个数据
|
||||
// hasOrg.setSysCreateBy("同步基础数据");
|
||||
// hasOrg.setSysCreateTime(LocalDateTime.now());
|
||||
// hasOrg.setSysId(dto.getKid());
|
||||
// hasOrg.setSysParentId(dto.getParentId());
|
||||
// hasOrg.setSysUpdateBy("");
|
||||
// hasOrg.setSysUpdateTime(hasOrg.getSysCreateTime());
|
||||
// mainOrgDao.save(hasOrg);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void userSave() {
|
||||
//
|
||||
// OrganizationDto dto=new OrganizationDto();
|
||||
//
|
||||
// dto.setCode("100001");
|
||||
// dto.setName("机构名称");
|
||||
// dto.setKid("1234-4567-3948");
|
||||
// dto.setSysLevel(0);
|
||||
// dto.setStatus(1);
|
||||
// //Organization org=orgDao.findOne(FieldFilters.eq("kid", dto.getKid()));
|
||||
// basicService.syncOrganization(dto);
|
||||
// mainService.syncOrganization(dto);
|
||||
//
|
||||
// }
|
||||
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void userSave1() {
|
||||
//
|
||||
// ErrorLog error=new ErrorLog();
|
||||
// error.setId(IDGenerator.generate());
|
||||
// error.setDataType(1);
|
||||
// error.setDataId("1");
|
||||
// error.setLogObject("{}");
|
||||
// error.setLogTime(LocalDateTime.now());
|
||||
// error.setType(1);
|
||||
// errDao.save(error);
|
||||
//
|
||||
// MainAccount ma=new MainAccount();
|
||||
// ma.setId(IDGenerator.generate());
|
||||
// ma.setAvatar("");
|
||||
// ma.setLoginName("aaaaa");
|
||||
// ma.setPassKey("");
|
||||
// ma.setPassValue("");
|
||||
// ma.setRegTime(LocalDateTime.now());
|
||||
// ma.setStatus(1);
|
||||
// ma.setSysId("1");
|
||||
// ma.setDeleted(false);
|
||||
// mainAccountDao.save(ma);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user