测试案例提交
parent
7e64595203
commit
b734a90de7
@ -0,0 +1,50 @@
|
||||
package cn.estsh.i3plus.core.apiservice.mq;
|
||||
|
||||
import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase;
|
||||
import cn.estsh.i3plus.core.apiservice.util.MailUtil;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
|
||||
import org.junit.Test;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2018-11-15 13:22
|
||||
* @Modify:
|
||||
**/
|
||||
public class TestMQ extends TestBase {
|
||||
|
||||
/**
|
||||
* rabbitMQ队列
|
||||
*/
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
@Autowired
|
||||
private MailUtil mailUtil;
|
||||
|
||||
@Test
|
||||
public void sendMail() throws InterruptedException {
|
||||
|
||||
SysMessage sysMessage = new SysMessage();
|
||||
sysMessage.setMessageTitle("test-系统通知");
|
||||
sysMessage.setMessageSenderNameRdd("system");
|
||||
sysMessage.setMessageSenderId(-1L);
|
||||
sysMessage.setMessageType(ImppEnumUtil.MESSAGE_TYPE.MAIL.getValue());
|
||||
sysMessage.setMessageSendTime("2018-11-01 16:58:00");
|
||||
|
||||
for (int i = 0; i < 50; i++) {
|
||||
sysMessage = new SysMessage();
|
||||
sysMessage.setId(null);
|
||||
sysMessage.setMessageTitle( i + "mail测试");
|
||||
sysMessage.setMessageSenderNameRdd(i+"");
|
||||
rabbitTemplate.convertAndSend("WYH_MESSAGE_QUEUE", new SysMessage());
|
||||
System.out.println("第" + i + "次");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : alwaysfrin
|
||||
* @CreateDate : 2018-11-09 10:00
|
||||
* @Modify:
|
||||
**/
|
||||
public class ArraySort implements Runnable {
|
||||
|
||||
private String num;
|
||||
|
||||
public ArraySort(int num){
|
||||
this.num = num + "";
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
int[] num = {11,3,9,5,1,4,15};
|
||||
for(int i=0;i<num.length;i++){
|
||||
new Thread(new ArraySort(num[i])).start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(Integer.parseInt(num));
|
||||
System.out.println(num);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -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 TestDepartmentService 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("DEV_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,45 @@
|
||||
package test.cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : Adair Peng
|
||||
* @CreateDate : 2019-02-27 1:24
|
||||
* @Modify:
|
||||
**/
|
||||
public class TestMain {
|
||||
static int a ;
|
||||
int b;
|
||||
static int c;
|
||||
|
||||
public int setT(){
|
||||
a++;
|
||||
return a;
|
||||
}
|
||||
|
||||
public int setT2(){
|
||||
b++;
|
||||
return b;
|
||||
}
|
||||
|
||||
public int setT3(){
|
||||
c++;
|
||||
return c;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
TestMain t1 = new TestMain();
|
||||
TestMain t2 = new TestMain();
|
||||
TestMain t3 = new TestMain();
|
||||
|
||||
t1.setT();
|
||||
System.out.println(t1.setT());
|
||||
|
||||
t2.setT2();
|
||||
System.out.println(t2.setT2());
|
||||
|
||||
t3.setT3();
|
||||
System.out.println(t3.setT3());
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
|
||||
import cn.estsh.i3plus.pojo.platform.bean.SysConfig;
|
||||
import cn.estsh.i3plus.pojo.platform.repository.SysConfigRepository;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2018-12-20 17:02
|
||||
* @Modify:
|
||||
**/
|
||||
public class TestMathOper extends cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase {
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
System.out.println("Hello World !~");
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private SysConfigRepository sysConfigRDao;
|
||||
|
||||
String propertyName = "configType";
|
||||
String groupByName = "configType";
|
||||
String[] param = new String[]{"configType"};
|
||||
Object[] paramValue = new Object[]{1};
|
||||
|
||||
|
||||
@Test
|
||||
public void testMax(){
|
||||
SysConfig sysConfig = new SysConfig();
|
||||
// max
|
||||
System.out.println(sysConfigRDao.findMaxByProperties(propertyName,groupByName,param,paramValue));
|
||||
System.out.println(sysConfigRDao.findMaxByProperty(propertyName,groupByName,param[0],paramValue[0]));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMin(){
|
||||
// min
|
||||
System.out.println(sysConfigRDao.findMinByProperties(propertyName,groupByName,param,paramValue));
|
||||
System.out.println(sysConfigRDao.findMinByProperty(propertyName,groupByName,param[0],paramValue[0]));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSum(){
|
||||
//sum
|
||||
System.out.println(sysConfigRDao.findSumByProperties(propertyName,groupByName,param,paramValue));
|
||||
System.out.println(sysConfigRDao.findSumByProperty(propertyName,groupByName,param[0],paramValue[0]));
|
||||
}
|
||||
@Test
|
||||
public void testAvg(){
|
||||
//avg
|
||||
System.out.println(sysConfigRDao.findAvgByProperties(propertyName,groupByName,param,paramValue));
|
||||
System.out.println(sysConfigRDao.findAvgByProperty(propertyName,groupByName,param[0],paramValue[0]));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
//package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
//
|
||||
//import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService;
|
||||
//import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
//import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
//import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
|
||||
//import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
|
||||
//import com.alibaba.fastjson.JSON;
|
||||
//import org.junit.Test;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//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 TestMessageService extends TestBase {
|
||||
//
|
||||
// public static final Logger LOGGER = LoggerFactory.getLogger(TestMessageService.class);
|
||||
// @Autowired
|
||||
// private ISysMessageService sysMessageService;
|
||||
//
|
||||
// /**
|
||||
// * 测试 查询所有消息
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testListSysMessage() {
|
||||
// List list = sysMessageService.listSysMessage();
|
||||
// System.out.println(JSON.toJSONString(list));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 根据id查询消息
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testGetSysMessageById() {
|
||||
// SysMessage sysMessage = sysMessageService.getSysMessageById(1L);
|
||||
// System.out.println(JSON.toJSONString(sysMessage));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 添加消息
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// @Rollback(false)
|
||||
// public void testInsertSysMessage() {
|
||||
// SysMessage sysMessage = new SysMessage();
|
||||
// sysMessage.setMessageTitle("test-系统通知");
|
||||
// sysMessage.setMessageSenderNameRdd("system");
|
||||
// sysMessage.setMessageSenderId(-1L);
|
||||
// sysMessage.setMessageType(ImppEnumUtil.MESSAGE_TYPE.MAIL.getValue());
|
||||
// sysMessage.setMessageSendTime("2018-11-01 16:58:00");
|
||||
//
|
||||
// for (int i = 0; i < 50; i++) {
|
||||
// sysMessage.setId(null);
|
||||
// sysMessage.setMessageTitle("test-系统通知" + i);
|
||||
// sysMessageService.insertSysMessage(sysMessage);
|
||||
// }
|
||||
// System.out.println(JSON.toJSONString(sysMessage));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 修改消息
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testUpdateSysMessage(){
|
||||
// SysMessage sysMessage = sysMessageService.getSysMessageById(1L);
|
||||
// sysMessage.setMessageTitle("测试修改");
|
||||
//
|
||||
// sysMessageService.updateSysMessage(sysMessage);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 根据id删除消息
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testDeleteSysMessageById(){
|
||||
// sysMessageService.deleteSysMessageById(1L);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 复杂查询
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testQuerySysMessageByPager(){
|
||||
// SysMessage sysMessage = new SysMessage();
|
||||
//
|
||||
// Pager pager = new Pager();
|
||||
// pager.setPageSize(10);
|
||||
// pager.setCurrentPage(5);
|
||||
//
|
||||
// ListPager list = sysMessageService.querySysMessageByPager(sysMessage,pager);
|
||||
// System.out.println(list);
|
||||
// }
|
||||
//
|
||||
//}
|
@ -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 TestOrganizeService 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("DEV_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,117 @@
|
||||
//package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
//
|
||||
//import cn.estsh.i3plus.core.api.iservice.busi.IPositionService;
|
||||
//import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
//import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
//import cn.estsh.i3plus.pojo.platform.bean.Position;
|
||||
//import com.alibaba.fastjson.JSON;
|
||||
//import org.junit.Test;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.core.annotation.Order;
|
||||
//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 TestPositionService extends TestBase {
|
||||
//
|
||||
// @Autowired
|
||||
// private IPositionService positionService;
|
||||
//
|
||||
// /**
|
||||
// * 新增数据
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// @Rollback(false)
|
||||
// public void testInsertPosition(){
|
||||
// for(int i = 0 ; i < 50 ; i++ ){
|
||||
// Position position = new Position();
|
||||
// position.setName("Junit Test " + i);
|
||||
// position.setPositionCode("DEV_JUNIT " + i);
|
||||
// position = positionService.insertPosition(position);
|
||||
// System.out.println(JSON.toJSONString(position));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据Key 数据
|
||||
// * @return
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testGetPositionById(){
|
||||
// Position pos = positionService.getPositionById("1057108589715525632");
|
||||
// System.out.println(JSON.toJSONString(pos));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询所有数据
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testListPosition(){
|
||||
// List list = positionService.listPosition();
|
||||
// System.out.println(JSON.toJSONString(list));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据岗位信息进行查找
|
||||
// * @return
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testFindPositionByPager(){
|
||||
// Position position = new Position();
|
||||
//
|
||||
// Pager pager = new Pager();
|
||||
// pager.setPageSize(10);
|
||||
// pager.setCurrentPage(1);
|
||||
//
|
||||
// ListPager list = positionService.findPositionByPager(null, pager);
|
||||
//
|
||||
// System.out.println(JSON.toJSONString(list));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改数据
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testUpdatePosition(){
|
||||
// Position position = positionService.getPositionById("1057108586410414080");
|
||||
// position.setName("Junit update Name ");
|
||||
// positionService.updatePosition(position);
|
||||
// System.out.println(JSON.toJSONString(position));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据Key 删除数据
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testDeletePositionById(){
|
||||
// positionService.deletePositionById("1057108585240203264");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据id批量删除岗位
|
||||
// * @return
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void deletePositionByIds(){
|
||||
// positionService.deletePositionByIds(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 TestSysConfigService 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(1057110061127700480L);
|
||||
System.out.println(JSON.toJSONString(sysConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 添加系统参数
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
public void testInsertSysConfig() {
|
||||
SysConfig sysConfig = new SysConfig();
|
||||
sysConfig.setName("系统名称");
|
||||
sysConfig.setConfigCode("sys_name");
|
||||
sysConfig.setConfigType(1);
|
||||
sysConfig.setConfigValue("IMPP");
|
||||
sysConfig.setConfigDescription("系统名称");
|
||||
|
||||
sysConfigService.insertSysConfig(sysConfig);
|
||||
System.out.println(JSON.toJSONString(sysConfig));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 修改系统参数
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUpdateSysConfig(){
|
||||
SysConfig sysConfig = sysConfigService.getSysConfigById(1057110613261684736L);
|
||||
sysConfig.setConfigDescription("测试修改");
|
||||
|
||||
sysConfigService.updateSysConfig(sysConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 根据id删除系统参数
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testDeleteSysConfigById(){
|
||||
sysConfigService.deleteSysConfigById(1057111616417566720L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 复制查询
|
||||
*/
|
||||
@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 TestSysDictionaryService 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("DEV");
|
||||
// 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,107 @@
|
||||
//package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
//
|
||||
//import cn.estsh.i3plus.core.api.iservice.busi.ISysFileService;
|
||||
//import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
//import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
//import cn.estsh.i3plus.pojo.platform.bean.SysFile;
|
||||
//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-31 15:30
|
||||
// * @Modify :
|
||||
// **/
|
||||
//public class TestSysFileService extends TestBase {
|
||||
//
|
||||
// @Autowired
|
||||
// public ISysFileService sysFileService;
|
||||
//
|
||||
// /**
|
||||
// * 测试 查询所有文件资源
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testListSysFile() {
|
||||
// List list = sysFileService.listSysFile();
|
||||
// System.out.println(JSON.toJSONString(list));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 根据id查询文件资源
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testGetSysFileById() {
|
||||
// SysFile sysFile = sysFileService.getSysFileById(1057110061127700480L);
|
||||
// System.out.println(JSON.toJSONString(sysFile));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 添加文件资源
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// @Rollback(false)
|
||||
// public void testInsertSysFile() {
|
||||
// SysFile sysFile = new SysFile();
|
||||
// sysFile.setName("文件doc");
|
||||
// sysFile.setFileTypeId(1058251784058966016L);
|
||||
// sysFile.setFileTypeName("doc");
|
||||
// sysFile.setDownloads(999);
|
||||
// sysFile.setFileSize(1024);
|
||||
// sysFile.setCreateUser("中国移动");
|
||||
// sysFile.setCreateDatetime("2018-01-01 00:00:00");
|
||||
// for (int i = 0; i < 50; i++) {
|
||||
// sysFile.setId(null);
|
||||
// sysFile.setName("文件"+ i +".doc");
|
||||
// sysFile.setCreateDatetime("2018-01-01 " + (i % 10) + "0:00:00");
|
||||
// sysFileService.insertSysFile(sysFile);
|
||||
// }
|
||||
// System.out.println(JSON.toJSONString(sysFile));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 修改文件资源
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testUpdateSysFile(){
|
||||
// SysFile sysFile = sysFileService.getSysFileById(1057110613261684736L);
|
||||
// sysFile.setName("测试修改");
|
||||
//
|
||||
// sysFileService.updateSysFile(sysFile);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 根据id删除文件资源
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testDeleteSysFileById(){
|
||||
// sysFileService.deleteSysFileById("1057111616417566720");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 复杂查询
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testQuerySysFileByPager(){
|
||||
// SysFile sysFile = new SysFile();
|
||||
//
|
||||
// Pager pager = new Pager();
|
||||
// pager.setPageSize(10);
|
||||
// pager.setCurrentPage(5);
|
||||
//
|
||||
// ListPager list = sysFileService.querySysFileByPager(sysFile,pager);
|
||||
// System.out.println(list);
|
||||
// }
|
||||
//}
|
@ -0,0 +1,104 @@
|
||||
//package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
//
|
||||
//import cn.estsh.i3plus.core.api.iservice.busi.ISysMenuService;
|
||||
//import cn.estsh.i3plus.pojo.platform.bean.Organize;
|
||||
//import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
|
||||
//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-11-01 11:58
|
||||
// * @Modify :
|
||||
// **/
|
||||
//public class TestSysMenuService extends TestBase {
|
||||
//
|
||||
// @Autowired
|
||||
// private ISysMenuService sysMenuService;
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 修改数据
|
||||
// */
|
||||
// @Test
|
||||
// public void testUpdateSysMenu() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改权限状态
|
||||
// */
|
||||
// @Test
|
||||
// public void testUpdateSysMenuStatus() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 批量修改状态
|
||||
// */
|
||||
// @Test
|
||||
// public void testUpdateSysMenuStatusByIds() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据Key 删除数据
|
||||
// */
|
||||
// @Test
|
||||
// public void testDeleteSysMenuById() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增数据
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// @Rollback(false)
|
||||
// public void testInsertSysMenu() {
|
||||
// for(int i = 0 ; i < 50 ; i++ ){
|
||||
// SysMenu obj = new SysMenu();
|
||||
// obj.setName("Junit Test " + i);
|
||||
// obj.setMenuCode("DEV_JUNIT " + i);
|
||||
// obj.setParentId(-1L);
|
||||
// obj = sysMenuService.insertSysMenu(obj);
|
||||
// System.out.println(JSON.toJSONString(obj));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询所有数据
|
||||
// */
|
||||
// @Test
|
||||
// public void testFindSysMenuAll() {
|
||||
// List<SysMenu> list = sysMenuService.findSysMenuAll();
|
||||
// System.out.println(JSON.toJSONString(list));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据id 数据
|
||||
// */
|
||||
// @Test
|
||||
// public void testGetSysMenuById() {
|
||||
// SysMenu menu = sysMenuService.getSysMenuById("1057844135052054528");
|
||||
// System.out.println(JSON.toJSONString(menu));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 复杂查询
|
||||
// */
|
||||
// @Test
|
||||
// public void testQuerySysMenu() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
//}
|
@ -0,0 +1,104 @@
|
||||
//package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
//
|
||||
//import cn.estsh.i3plus.core.api.iservice.busi.ITaskTimeExpressionService;
|
||||
//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.platform.bean.TaskTimeExpression;
|
||||
//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-31 15:30
|
||||
// * @Modify :
|
||||
// **/
|
||||
//public class TestTaskTimeExpressionService extends TestBase {
|
||||
//
|
||||
// @Autowired
|
||||
// ITaskTimeExpressionService taskTimeExpressionService;
|
||||
//
|
||||
// /**
|
||||
// * 测试 查询所有时间表达式
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testListTaskTimeExpression() {
|
||||
// List list = taskTimeExpressionService.listTaskTimeExpression();
|
||||
// System.out.println(JSON.toJSONString(list));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 根据id查询时间表达式
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testGetTaskTimeExpressionById() {
|
||||
// TaskTimeExpression taskTimeExpression = taskTimeExpressionService.getTaskTimeExpressionById("1057110061127700480");
|
||||
// System.out.println(JSON.toJSONString(taskTimeExpression));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 添加时间表达式
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// @Rollback(false)
|
||||
// public void testInsertTaskTimeExpression() {
|
||||
// TaskTimeExpression taskTimeExpression = new TaskTimeExpression();
|
||||
// taskTimeExpression.setName("表达式");
|
||||
// taskTimeExpression.setExpressionContent("0000000");
|
||||
// taskTimeExpression.setExpressionDescription("描述");
|
||||
//
|
||||
// for (int i = 0; i < 50; i++) {
|
||||
// taskTimeExpression.setId(null);
|
||||
// taskTimeExpression.setName("表达式"+i);
|
||||
// taskTimeExpressionService.insertTaskTimeExpression(taskTimeExpression);
|
||||
// }
|
||||
// System.out.println(JSON.toJSONString(taskTimeExpression));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 修改时间表达式
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testUpdateTaskTimeExpression(){
|
||||
// TaskTimeExpression taskTimeExpression = taskTimeExpressionService.getTaskTimeExpressionById("1057110613261684736");
|
||||
// taskTimeExpression.setName("测试修改");
|
||||
//
|
||||
// taskTimeExpressionService.updateTaskTimeExpression(taskTimeExpression);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 根据id删除时间表达式
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testDeleteTaskTimeExpressionById(){
|
||||
// taskTimeExpressionService.deleteTaskTimeExpressionById("1057111616417566720");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 复杂查询
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testQueryTaskTimeExpressionByPager(){
|
||||
// TaskTimeExpression taskTimeExpression = new TaskTimeExpression();
|
||||
//
|
||||
// Pager pager = new Pager();
|
||||
// pager.setPageSize(10);
|
||||
// pager.setCurrentPage(5);
|
||||
//
|
||||
// ListPager list = taskTimeExpressionService.queryTaskTimeExpressionByPager(taskTimeExpression,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.ITaskTimeService;
|
||||
//import cn.estsh.i3plus.core.api.iservice.busi.ITaskTimeService;
|
||||
//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.TaskTime;
|
||||
//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-11-03 00:09
|
||||
// * @Modify :
|
||||
// **/
|
||||
//public class TestTaskTimeService extends TestBase {
|
||||
//
|
||||
// @Autowired
|
||||
// ITaskTimeService taskTimeService;
|
||||
//
|
||||
// /**
|
||||
// * 测试 查询所有硬件
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testListTaskTime() {
|
||||
// List list = taskTimeService.listTaskTime();
|
||||
// System.out.println(JSON.toJSONString(list));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 根据id查询硬件
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testGetTaskTimeById() {
|
||||
// TaskTime taskTime = taskTimeService.getTaskTimeById("1057110061127700480");
|
||||
// System.out.println(JSON.toJSONString(taskTime));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 添加硬件
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// @Rollback(false)
|
||||
// public void testInsertTaskTime() {
|
||||
// TaskTime taskTime = new TaskTime();
|
||||
// taskTime.setName("时间表达式");
|
||||
// taskTime.setTimeExpressionId(1L);
|
||||
// taskTime.setTaskStartDateTimeRdd("2018-01-01 00:00:00");
|
||||
// taskTime.setTaskEndDateTimeRdd("2018-12-31 00:00:00");
|
||||
// taskTime.setTaskTypeId(ImppEnumUtil.TASK_METHOD_TYPE.TYPE_GROUP.getValue());
|
||||
// taskTime.setTaskStatus(CommonEnumUtil.DATA_STATUS.ENABLE.getValue());
|
||||
//
|
||||
// for (int i = 0; i < 50; i++) {
|
||||
// taskTime.setId(null);
|
||||
// taskTime.setName("时间表达式"+i);
|
||||
// taskTimeService.insertTaskTime(taskTime,null);
|
||||
// }
|
||||
// System.out.println(JSON.toJSONString(taskTime));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 修改硬件
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testUpdateTaskTime(){
|
||||
// TaskTime taskTime = taskTimeService.getTaskTimeById("1057110613261684736");
|
||||
// taskTime.setName("测试修改");
|
||||
//
|
||||
// taskTimeService.updateTaskTime(taskTime,null);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 根据id删除硬件
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testDeleteTaskTimeById(){
|
||||
// taskTimeService.deleteTaskTimeById("1058406771644829696");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试 复杂查询
|
||||
// */
|
||||
// @Test
|
||||
// @Transactional
|
||||
// public void testQueryTaskTimeByPager(){
|
||||
// TaskTime taskTime = new TaskTime();
|
||||
//
|
||||
// Pager pager = new Pager();
|
||||
// pager.setPageSize(10);
|
||||
// pager.setCurrentPage(5);
|
||||
//
|
||||
// ListPager list = taskTimeService.queryTaskTimeByPager(taskTime,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 TestToolService 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 TestToolTypeService 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);
|
||||
// }
|
||||
//}
|
@ -0,0 +1,41 @@
|
||||
package cn.estsh.i3plus.core.apiservice.util;
|
||||
|
||||
import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.SysTool;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description : excel导入导出测试
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2018-11-21 19:44
|
||||
* @Modify:
|
||||
**/
|
||||
public class TestExcelUtil extends TestBase {
|
||||
|
||||
|
||||
@Test
|
||||
public void TestExportData(){
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void importData() throws Exception{
|
||||
try {
|
||||
List sy = ExcelUtil.importData("testOut.xls", new FileInputStream("E://testOut.xls"), SysTool.class);
|
||||
System.out.println(sy);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.estsh.i3plus.core.apiservice.util;
|
||||
|
||||
import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2018-11-21 19:44
|
||||
* @Modify:
|
||||
**/
|
||||
public class TestMailUtil extends TestBase {
|
||||
|
||||
@Autowired
|
||||
MailUtil mailUtil;
|
||||
|
||||
@Test
|
||||
public void TestSendMail(){
|
||||
mailUtil.setTo("yunhao.wang@estsh.com");
|
||||
mailUtil.setSubject("中文");
|
||||
mailUtil.setContentType(ImppEnumUtil.MESSAGE_TYPE_CONTENT.HTML.getDescription());
|
||||
mailUtil.setBody("内容");
|
||||
mailUtil.send();
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.estsh.i3plus.core.apiservice.util;
|
||||
|
||||
import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.SysOrderNoRule;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2018-11-21 19:45
|
||||
* @Modify:
|
||||
**/
|
||||
public class TestOrderNoMakeUtil extends TestBase {
|
||||
|
||||
@Test
|
||||
public void TestMakeOrderNo() {
|
||||
SysOrderNoRule sysOrderNoRule = new SysOrderNoRule();
|
||||
sysOrderNoRule.setName("一号单据");
|
||||
sysOrderNoRule.setOrderNoRule("GG-{yyyy}{MM}{dd}{serialNo}");
|
||||
sysOrderNoRule.setSerialNoSeed(1L);
|
||||
sysOrderNoRule.setSerialNoIncrement(1L);
|
||||
sysOrderNoRule.setSerialNoLength(4L);
|
||||
sysOrderNoRule.setSerialNo(9999L);
|
||||
sysOrderNoRule.setIsCycle(1);
|
||||
|
||||
System.out.println(OrderNoMakeUtil.next(sysOrderNoRule));
|
||||
|
||||
// String d= MessageFormat.format("%0{0}d", 3);
|
||||
// System.out.println(d);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue