parent
2d870ae379
commit
5da6fc4f75
@ -0,0 +1,118 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.IDepartmentService;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Department;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Organize;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.test.annotation.Rollback;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 岗位信息测试
|
||||||
|
* @Reference :
|
||||||
|
* @Author : wei.peng
|
||||||
|
* @Date : 2018-10-29 19:02
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public class TestDepartmentServiceImpl extends TestBase {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDepartmentService departmentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testInsertDepartment(){
|
||||||
|
for(int i = 0 ; i < 50 ; i++ ){
|
||||||
|
Department obj = new Department();
|
||||||
|
obj.setName("Junit Test " + i);
|
||||||
|
obj.setDepartmentCode("TEST_JUNIT " + i);
|
||||||
|
obj.setParentId(1057165194242953216L);
|
||||||
|
obj.setOrganizeId(1057163974900060160L);
|
||||||
|
obj = departmentService.insertDepartment(obj);
|
||||||
|
System.out.println(JSON.toJSONString(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Key 数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testGetDepartmentById(){
|
||||||
|
Department obj = departmentService.getDepartmentById("1057163974900060160");
|
||||||
|
System.out.println(JSON.toJSONString(obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testListDepartment(){
|
||||||
|
List list = departmentService.listDepartment();
|
||||||
|
System.out.println(JSON.toJSONString(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据岗位信息进行查找
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testFindDepartmentByPager(){
|
||||||
|
Organize obj = new Organize();
|
||||||
|
|
||||||
|
Pager pager = new Pager();
|
||||||
|
pager.setPageSize(10);
|
||||||
|
pager.setCurrentPage(1);
|
||||||
|
|
||||||
|
ListPager list = departmentService.queryDepartment(null, pager);
|
||||||
|
|
||||||
|
System.out.println(JSON.toJSONString(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testUpdateDepartment(){
|
||||||
|
Department obj = departmentService.getDepartmentById("1057108586410414080");
|
||||||
|
obj.setName("Junit update Name ");
|
||||||
|
departmentService.updateDepartment(obj);
|
||||||
|
System.out.println(JSON.toJSONString(obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Key 删除数据
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testDeleteDepartmentById(){
|
||||||
|
// departmentService.deleteOrganizeById("");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id批量删除岗位
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void deleteDepartmentByIds(){
|
||||||
|
// departmentService.deleteOrganizeByIds(new String[]{"1057108585445724160","1057108585760296960"});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.IOrganizeService;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Organize;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Organize;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.test.annotation.Rollback;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 岗位信息测试
|
||||||
|
* @Reference :
|
||||||
|
* @Author : wei.peng
|
||||||
|
* @Date : 2018-10-29 19:02
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public class TestOrganizeServiceImpl extends TestBase {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOrganizeService organizeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
@Rollback(false)
|
||||||
|
public void testInsertOrganize(){
|
||||||
|
for(int i = 0 ; i < 50 ; i++ ){
|
||||||
|
Organize obj = new Organize();
|
||||||
|
obj.setName("Junit Test " + i);
|
||||||
|
obj.setOrganizeCode("TEST_JUNIT " + i);
|
||||||
|
obj.setParentId(-1L);
|
||||||
|
obj = organizeService.insertOrganize(obj);
|
||||||
|
System.out.println(JSON.toJSONString(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Key 数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testGetOrganizeById(){
|
||||||
|
Organize obj = organizeService.getOrganizeById("1057163974900060160");
|
||||||
|
System.out.println(JSON.toJSONString(obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testListOrganize(){
|
||||||
|
List list = organizeService.listOrganize();
|
||||||
|
System.out.println(JSON.toJSONString(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据岗位信息进行查找
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testFindOrganizeByPager(){
|
||||||
|
Organize obj = new Organize();
|
||||||
|
|
||||||
|
Pager pager = new Pager();
|
||||||
|
pager.setPageSize(10);
|
||||||
|
pager.setCurrentPage(1);
|
||||||
|
|
||||||
|
ListPager list = organizeService.queryOrganize(null, pager);
|
||||||
|
|
||||||
|
System.out.println(JSON.toJSONString(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testUpdateOrganize(){
|
||||||
|
Organize obj = organizeService.getOrganizeById("1057108586410414080");
|
||||||
|
obj.setName("Junit update Name ");
|
||||||
|
organizeService.updateOrganize(obj);
|
||||||
|
System.out.println(JSON.toJSONString(obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Key 删除数据
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void testDeleteOrganizeById(){
|
||||||
|
// organizeService.deleteOrganizeById("");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id批量删除岗位
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void deleteOrganizeByIds(){
|
||||||
|
// organizeService.deleteOrganizeByIds(new String[]{"1057108585445724160","1057108585760296960"});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue