Merge branch 'master' of http://git.estsh.com/i3-IMPP/i3plus-core
commit
e3fa15c69e
@ -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"});
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
|
||||
import cn.estsh.i3plus.core.api.iservice.busi.ISysConfigService;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.SysConfig;
|
||||
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 : yunhao
|
||||
* @Date : 2018-10-30 10:49
|
||||
* @Modify :
|
||||
**/
|
||||
public class TestSysConfigServiceImpl extends TestBase {
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService sysConfigService;
|
||||
|
||||
/**
|
||||
* 测试 查询所有系统参数
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListSysConfig() {
|
||||
List list = sysConfigService.ListSysConfig();
|
||||
System.out.println(JSON.toJSONString(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 根据id查询系统参数
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testGetSysConfigById() {
|
||||
SysConfig sysConfig = sysConfigService.getSysConfigById("1057110061127700480");
|
||||
System.out.println(JSON.toJSONString(sysConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 添加系统参数
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
public void testInsertSysConfig() {
|
||||
SysConfig sysConfig = new SysConfig();
|
||||
sysConfig.setName("系统名称");
|
||||
sysConfig.setConfigCode("sys_name");
|
||||
sysConfig.setConfigTypeId(1);
|
||||
sysConfig.setConfigValue("IMPP");
|
||||
sysConfig.setConfigDescription("系统名称");
|
||||
|
||||
sysConfigService.insertSysConfig(sysConfig);
|
||||
System.out.println(JSON.toJSONString(sysConfig));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 修改系统参数
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUpdateSysConfig(){
|
||||
SysConfig sysConfig = sysConfigService.getSysConfigById("1057110613261684736");
|
||||
sysConfig.setConfigDescription("测试修改");
|
||||
|
||||
sysConfigService.updateSysConfig(sysConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 根据id删除系统参数
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testDeleteSysConfigById(){
|
||||
sysConfigService.deleteSysConfigById("1057111616417566720");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 复制查询
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testQuerySysConfigByPager(){
|
||||
SysConfig sysConfig = new SysConfig();
|
||||
|
||||
Pager pager = new Pager();
|
||||
pager.setPageSize(10);
|
||||
pager.setCurrentPage(1);
|
||||
|
||||
ListPager list = sysConfigService.querySysConfigByPager(sysConfig,pager);
|
||||
System.out.println(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
|
||||
import cn.estsh.i3plus.core.api.iservice.busi.ISysDictionaryService;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.SysDictionary;
|
||||
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 : yunhao
|
||||
* @Date : 2018-10-30 18:52
|
||||
* @Modify :
|
||||
**/
|
||||
public class TestSysDictionaryServiceImpl extends TestBase {
|
||||
@Autowired
|
||||
private ISysDictionaryService sysDictionaryService;
|
||||
|
||||
/**
|
||||
* 测试 查询所有字典
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListSysDictionary() {
|
||||
List list = sysDictionaryService.listSysDictionary();
|
||||
System.out.println(JSON.toJSONString(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 根据id查询字典
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testGetSysDictionaryById() {
|
||||
SysDictionary sysDictionary = sysDictionaryService.getSysDictionaryById("1057110061127700480");
|
||||
System.out.println(JSON.toJSONString(sysDictionary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 添加字典
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
public void testInsertSysDictionary() {
|
||||
SysDictionary sysDictionary = new SysDictionary();
|
||||
sysDictionary.setName("字典测试");
|
||||
sysDictionary.setDictionaryCode("dic_test");
|
||||
sysDictionary.setDictionaryValue("TEST");
|
||||
sysDictionary.setDictionaryDescription("字典测试");
|
||||
|
||||
sysDictionaryService.insertSysDictionary(sysDictionary);
|
||||
System.out.println(JSON.toJSONString(sysDictionary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 修改字典
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUpdateSysDictionary(){
|
||||
SysDictionary sysDictionary = sysDictionaryService.getSysDictionaryById("1057110613261684736");
|
||||
sysDictionary.setName("测试修改");
|
||||
|
||||
sysDictionaryService.updateSysDictionary(sysDictionary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 根据id删除字典
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testDeleteSysDictionaryById(){
|
||||
sysDictionaryService.deleteSysDictionaryById("1057111616417566720");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 复杂查询
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testQuerySysDictionaryByPager(){
|
||||
SysDictionary sysDictionary = new SysDictionary();
|
||||
|
||||
Pager pager = new Pager();
|
||||
pager.setPageSize(10);
|
||||
pager.setCurrentPage(5);
|
||||
|
||||
ListPager list = sysDictionaryService.querySysDictionaryByPager(sysDictionary,pager);
|
||||
System.out.println(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
|
||||
import cn.estsh.i3plus.core.api.iservice.busi.IToolService;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.Tool;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.apache.commons.lang3.EnumUtils;
|
||||
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 : yunhao
|
||||
* @Date : 2018-10-31 15:30
|
||||
* @Modify :
|
||||
**/
|
||||
public class TestToolServiceImpl extends TestBase {
|
||||
|
||||
@Autowired
|
||||
IToolService toolService;
|
||||
|
||||
/**
|
||||
* 测试 查询所有硬件
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListTool() {
|
||||
List list = toolService.listTool();
|
||||
System.out.println(JSON.toJSONString(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 根据id查询硬件
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testGetToolById() {
|
||||
Tool tool = toolService.getToolById("1057110061127700480");
|
||||
System.out.println(JSON.toJSONString(tool));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 添加硬件
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
public void testInsertTool() {
|
||||
Tool tool = new Tool();
|
||||
tool.setName("扫描枪");
|
||||
tool.setToolTypeId(1057261374348070912L);
|
||||
tool.setRedToolTypeName("扫描枪22");
|
||||
tool.setToolConnTypeId(1);
|
||||
tool.setToolDataTypeId(1);
|
||||
tool.setToolStatusId(CommonEnumUtil.DATA_STATUS.ENABLE.getValue());
|
||||
|
||||
for (int i = 0; i < 50; i++) {
|
||||
tool.setId(null);
|
||||
tool.setName("扫描枪"+i);
|
||||
toolService.insertTool(tool);
|
||||
}
|
||||
System.out.println(JSON.toJSONString(tool));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 修改硬件
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUpdateTool(){
|
||||
Tool tool = toolService.getToolById("1057110613261684736");
|
||||
tool.setName("测试修改");
|
||||
|
||||
toolService.updateTool(tool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 根据id删除硬件
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testDeleteToolById(){
|
||||
toolService.deleteToolById("1057111616417566720");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 复杂查询
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testQueryToolByPager(){
|
||||
Tool tool = new Tool();
|
||||
|
||||
Pager pager = new Pager();
|
||||
pager.setPageSize(10);
|
||||
pager.setCurrentPage(5);
|
||||
|
||||
ListPager list = toolService.queryToolByPager(tool,pager);
|
||||
System.out.println(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
|
||||
import cn.estsh.i3plus.core.api.iservice.busi.IToolTypeService;
|
||||
import cn.estsh.i3plus.core.api.iservice.busi.IToolTypeService;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.ToolType;
|
||||
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 : yunhao
|
||||
* @Date : 2018-10-30 20:36
|
||||
* @Modify :
|
||||
**/
|
||||
public class TestToolTypeServiceImpl extends TestBase {
|
||||
@Autowired
|
||||
private IToolTypeService toolTypeService;
|
||||
|
||||
/**
|
||||
* 测试 查询所有硬件类型
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListToolType() {
|
||||
List list = toolTypeService.listToolType();
|
||||
System.out.println(JSON.toJSONString(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 根据id查询硬件类型
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testGetToolTypeById() {
|
||||
ToolType toolType = toolTypeService.getToolTypeById("1057110061127700480");
|
||||
System.out.println(JSON.toJSONString(toolType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 添加硬件类型
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
public void testInsertToolType() {
|
||||
ToolType toolType = new ToolType();
|
||||
toolType.setName("扫描枪");
|
||||
|
||||
for (int i = 0; i < 50; i++) {
|
||||
toolType.setId(null);
|
||||
toolType.setName("扫描枪"+i);
|
||||
toolTypeService.insertToolType(toolType);
|
||||
}
|
||||
System.out.println(JSON.toJSONString(toolType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 修改硬件类型
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUpdateToolType(){
|
||||
ToolType toolType = toolTypeService.getToolTypeById("1057110613261684736");
|
||||
toolType.setName("测试修改");
|
||||
|
||||
toolTypeService.updateToolType(toolType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 根据id删除硬件类型
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testDeleteToolTypeById(){
|
||||
toolTypeService.deleteToolTypeById("1057111616417566720");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 复杂查询
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testQueryToolTypeByPager(){
|
||||
ToolType toolType = new ToolType();
|
||||
|
||||
Pager pager = new Pager();
|
||||
pager.setPageSize(10);
|
||||
pager.setCurrentPage(5);
|
||||
|
||||
ListPager list = toolTypeService.queryToolTypeByPager(toolType,pager);
|
||||
System.out.println(list);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue