1、初始化导入数据功能完成
parent
9c42a21a0b
commit
d78f260e13
Binary file not shown.
Binary file not shown.
@ -1,111 +0,0 @@
|
|||||||
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
|
||||||
|
|
||||||
import cn.estsh.i3plus.core.api.iservice.busi.*;
|
|
||||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
||||||
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
|
|
||||||
import cn.estsh.i3plus.pojo.platform.bean.*;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
|
|
||||||
import javax.transaction.Transactional;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统数据初始化
|
|
||||||
*/
|
|
||||||
public class TestInitData extends TestBase {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IOrganizeService organizeService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IPositionService positionService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IDepartmentService departmentService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysMenuService sysMenuService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysRoleService sysRoleService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService sysUserService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysUserInfoService sysUserInfoService;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testInitPosition(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testInitOrganize(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testInitDepartment(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testInitSysRole(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testInitSysUser()throws Exception{
|
|
||||||
Organize organize = new Organize();
|
|
||||||
organize.setName("Junit 组织");
|
|
||||||
organize.setOrganizeTypeId(ImppEnumUtil.ORGANIZE_YTPE.TYPE_COMPANY.getValue());
|
|
||||||
organize.setOrganizeCode("junit 001");
|
|
||||||
Organize insertOrganize = organizeService.insertOrganize(organize);
|
|
||||||
System.out.println(JSON.toJSON(insertOrganize));
|
|
||||||
|
|
||||||
Department department = new Department();
|
|
||||||
department.setName("Junit 部门");
|
|
||||||
department.setDepartmentCode("junit 001");
|
|
||||||
department.setOrganizeId(insertOrganize.getId());
|
|
||||||
Department insertDepartment = departmentService.insertDepartment(department);
|
|
||||||
System.out.println(JSON.toJSON(insertDepartment));
|
|
||||||
|
|
||||||
Position position = new Position();
|
|
||||||
position.setName("Junit 岗位");
|
|
||||||
position.setPositionCode("junit 001");
|
|
||||||
Position insertPosition = positionService.insertPosition(position);
|
|
||||||
System.out.println(JSON.toJSON(insertPosition));
|
|
||||||
|
|
||||||
SysUserInfo info = new SysUserInfo();
|
|
||||||
info.setName("Junit 用户");
|
|
||||||
info.setOrganizeId(insertOrganize.getId());
|
|
||||||
info.setDepartmentId(insertDepartment.getId());
|
|
||||||
info.setPositionId(insertPosition.getId());
|
|
||||||
|
|
||||||
SysUserInfo insertSysUserInfo = sysUserInfoService.insertSysUserInfo(info);
|
|
||||||
|
|
||||||
SysRole role = new SysRole();
|
|
||||||
role.setName("Junit 角色");
|
|
||||||
SysRole insertSysRole = sysRoleService.insertSysRole(role);
|
|
||||||
System.out.println(JSON.toJSON(insertSysRole));
|
|
||||||
|
|
||||||
|
|
||||||
SysUser user = new SysUser();
|
|
||||||
user.setUserLoginName("root");
|
|
||||||
user.setUserLoginPassword("root");
|
|
||||||
user.setUserInfoId(insertSysUserInfo.getId());
|
|
||||||
user.setRoleId(insertSysRole.getId());
|
|
||||||
|
|
||||||
SysUser sysUser = sysUserService.insertSysUser(user);
|
|
||||||
System.out.println(JSON.toJSON(sysUser));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue