diff --git a/mdp-form-bootstrap/src/main/java/com/mdp/WebSecurityConfig.java b/mdp-form-bootstrap/src/main/java/com/mdp/WebSecurityConfig.java
index 93dd389..4a35ffb 100644
--- a/mdp-form-bootstrap/src/main/java/com/mdp/WebSecurityConfig.java
+++ b/mdp-form-bootstrap/src/main/java/com/mdp/WebSecurityConfig.java
@@ -1,6 +1,6 @@
package com.mdp;
-import com.mdp.oauth2.client.resource.MdpJwtAuthenticationConverter;
+import com.mdp.safe.client.jwt.JwtAuthenticationConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
@@ -17,7 +17,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
- MdpJwtAuthenticationConverter jwtConverter;
+ JwtAuthenticationConverter jwtConverter;
@Override
diff --git a/mdp-form/src/test/java/com/mdp/WebSecurityConfig.java b/mdp-form/src/test/java/com/mdp/WebSecurityConfig.java
index 93dd389..4a35ffb 100644
--- a/mdp-form/src/test/java/com/mdp/WebSecurityConfig.java
+++ b/mdp-form/src/test/java/com/mdp/WebSecurityConfig.java
@@ -1,6 +1,6 @@
package com.mdp;
-import com.mdp.oauth2.client.resource.MdpJwtAuthenticationConverter;
+import com.mdp.safe.client.jwt.JwtAuthenticationConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
@@ -17,7 +17,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
- MdpJwtAuthenticationConverter jwtConverter;
+ JwtAuthenticationConverter jwtConverter;
@Override
diff --git a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDataController.java b/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDataController.java
deleted file mode 100644
index 035d4b2..0000000
--- a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDataController.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package com.mdp.form.ctrl;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-
-import com.mdp.form.entity.FormData;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockHttpSession;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.request.ServletWebRequest;
-import org.springframework.boot.test.context.SpringBootTest;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.http.MediaType;
-import com.mdp.core.utils.BaseUtils;
-/**
- * 组织 com.qqkj
- * 顶级模块 mdp
- * 大模块 form
- * 小模块
- * 表 FORM.form_data form_data
- * 实体 FormData
- * 表是指数据库结构中的表,实体是指java类型中的实体类
- * 当前实体所有属性名:
- * id,two,three,four,five,six,seven,eight,nine,ten,lastTime,one,zero,remark,formId,userid,eleven,twelve,thirteen,fourteen,fifteen,attachmentUrls,attachmentNames,branchId,bizKey,deptid,flowState,createTime,dqxCode,cuserid,tagIds,tagNames,cusername,deptName;
- * 当前表的所有字段名:
- * id,two,three,four,five,six,seven,eight,nine,ten,last_time,one,zero,remark,form_id,userid,eleven,twelve,thirteen,fourteen,fifteen,attachment_urls,attachment_names,branch_id,biz_key,deptid,flow_state,create_time,dqx_code,cuserid,tag_ids,tag_names,cusername,dept_name;
- * 当前主键(包括多主键):
- * id;
- **/
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-public class TestFormDataController {
-
- @Autowired
- public WebApplicationContext wac; // cached
- @Autowired
- public MockServletContext servletContext; // cached
- @Autowired
- public MockHttpSession session;
- @Autowired
- public MockHttpServletRequest request;
- @Autowired
- public MockHttpServletResponse response;
- @Autowired
- public ServletWebRequest webRequest;
-
- public MockMvc mockMvc;
-
- public MockHttpServletRequestBuilder msrb;
-
- ObjectMapper om = new ObjectMapper();
-
- @Before
- public void setup() {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
- }
-
- @Test
- public void add() throws Exception {
- Map p=BaseUtils.map("id","1N13","two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- String jsonFormData=om.writeValueAsString(formData);
- mockMvc.perform( post("/**/form/formData/add").content(jsonFormData).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void list() throws Exception {
- mockMvc.perform( get("/**/form/formData/list")
- .param("id","1N13").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void listKey() throws Exception {
- mockMvc.perform( get("/**/form/formData/listKey")
- .param("id","1N13").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void edit() throws Exception {
- Map p=BaseUtils.map("id","1N13","two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- String jsonFormData=om.writeValueAsString(formData);
- mockMvc.perform( post("/**/form/formData/edit").content(jsonFormData).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void del() throws Exception {
- mockMvc.perform( post("/**/form/formData/del").content("1N13").contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void batchDel() throws Exception {
- Map p=BaseUtils.map("id","1N13","two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- List formDatas=new ArrayList<>();
- formDatas.add(formData);
- String jsonFormData=om.writeValueAsString(formDatas);
- mockMvc.perform( post("/**/form/formData/batchDel").content(jsonFormData).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
- /**
- * 将字符串类型的日期转成Date对象
- * @param source 如2015-10-23或者 2015-10-23 15:30:25等
- * @param pattern 格式必须与 source的格式一致,如 2015-10-23对应的 pattern为 yyyy-MM-dd,
- * 2015-10-23 15:30:25 对应的pattern 为 yyyy-MM-dd HH:mm:ss
- * @return
- */
- public static Date parse(String source){
-
- SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
- try {
- return sdf.parse(source);
- } catch (Exception e) {
- }
-
- return null;
- }
-}
diff --git a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDataProcessApprovaController.java b/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDataProcessApprovaController.java
deleted file mode 100644
index d2018c2..0000000
--- a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDataProcessApprovaController.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package com.mdp.form.ctrl;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-
-import com.mdp.form.entity.FormDataProcessApprova;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockHttpSession;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.request.ServletWebRequest;
-import org.springframework.boot.test.context.SpringBootTest;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.http.MediaType;
-import com.mdp.core.utils.BaseUtils;
-/**
- * 组织 com.qqkj
- * 顶级模块 mdp
- * 大模块 form
- * 小模块
- * 表 FORM.form_data_process_approva form_data_process_approva
- * 实体 FormDataProcessApprova
- * 表是指数据库结构中的表,实体是指java类型中的实体类
- * 当前实体所有属性名:
- * branchId,procInstId,agree,assignee,mainTitle,actId,taskName,commentMsg,id,eventName,bizKey,modelKey,flowLastTime,flowBranchId,flowState,startUserid,procDefId,modelName,formId,formDataId;
- * 当前表的所有字段名:
- * branch_id,proc_inst_id,agree,assignee,main_title,act_id,task_name,comment_msg,id,event_name,biz_key,model_key,flow_last_time,flow_branch_id,flow_state,start_userid,proc_def_id,model_name,form_id,form_data_id;
- * 当前主键(包括多主键):
- * id;
- **/
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-public class TestFormDataProcessApprovaController {
-
- @Autowired
- public WebApplicationContext wac; // cached
- @Autowired
- public MockServletContext servletContext; // cached
- @Autowired
- public MockHttpSession session;
- @Autowired
- public MockHttpServletRequest request;
- @Autowired
- public MockHttpServletResponse response;
- @Autowired
- public ServletWebRequest webRequest;
-
- public MockMvc mockMvc;
-
- public MockHttpServletRequestBuilder msrb;
-
- ObjectMapper om = new ObjectMapper();
-
- @Before
- public void setup() {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
- }
-
- @Test
- public void add() throws Exception {
- Map p=BaseUtils.map("branchId","AbLo","procInstId","Ff0N","agree","2","assignee","wm1n","mainTitle","Up53","actId","68Xh","taskName","D5px","commentMsg","zarz","id","Dfh2","eventName","YIf6","bizKey","2PXq","modelKey","5fuK","flowLastTime",parse("2020-03-29 20:43:44"),"flowBranchId","EswY","flowState","3U","startUserid","3kqZ","procDefId","wIPQ","modelName","dkqt","formId","9Tsi","formDataId","vag1");
- FormDataProcessApprova formDataProcessApprova=BaseUtils.fromMap(p,FormDataProcessApprova.class);
- String jsonFormDataProcessApprova=om.writeValueAsString(formDataProcessApprova);
- mockMvc.perform( post("/**/form/formDataProcessApprova/add").content(jsonFormDataProcessApprova).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void list() throws Exception {
- mockMvc.perform( get("/**/form/formDataProcessApprova/list")
- .param("id","Dfh2").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void listKey() throws Exception {
- mockMvc.perform( get("/**/form/formDataProcessApprova/listKey")
- .param("id","Dfh2").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void edit() throws Exception {
- Map p=BaseUtils.map("branchId","AbLo","procInstId","Ff0N","agree","2","assignee","wm1n","mainTitle","Up53","actId","68Xh","taskName","D5px","commentMsg","zarz","id","Dfh2","eventName","YIf6","bizKey","2PXq","modelKey","5fuK","flowLastTime",parse("2020-03-29 20:43:44"),"flowBranchId","EswY","flowState","3U","startUserid","3kqZ","procDefId","wIPQ","modelName","dkqt","formId","9Tsi","formDataId","vag1");
- FormDataProcessApprova formDataProcessApprova=BaseUtils.fromMap(p,FormDataProcessApprova.class);
- String jsonFormDataProcessApprova=om.writeValueAsString(formDataProcessApprova);
- mockMvc.perform( post("/**/form/formDataProcessApprova/edit").content(jsonFormDataProcessApprova).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void del() throws Exception {
- mockMvc.perform( post("/**/form/formDataProcessApprova/del").content("Dfh2").contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void batchDel() throws Exception {
- Map p=BaseUtils.map("branchId","AbLo","procInstId","Ff0N","agree","2","assignee","wm1n","mainTitle","Up53","actId","68Xh","taskName","D5px","commentMsg","zarz","id","Dfh2","eventName","YIf6","bizKey","2PXq","modelKey","5fuK","flowLastTime",parse("2020-03-29 20:43:44"),"flowBranchId","EswY","flowState","3U","startUserid","3kqZ","procDefId","wIPQ","modelName","dkqt","formId","9Tsi","formDataId","vag1");
- FormDataProcessApprova formDataProcessApprova=BaseUtils.fromMap(p,FormDataProcessApprova.class);
- List formDataProcessApprovas=new ArrayList<>();
- formDataProcessApprovas.add(formDataProcessApprova);
- String jsonFormDataProcessApprova=om.writeValueAsString(formDataProcessApprovas);
- mockMvc.perform( post("/**/form/formDataProcessApprova/batchDel").content(jsonFormDataProcessApprova).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
- /**
- * 将字符串类型的日期转成Date对象
- * @param source 如2015-10-23或者 2015-10-23 15:30:25等
- * @param pattern 格式必须与 source的格式一致,如 2015-10-23对应的 pattern为 yyyy-MM-dd,
- * 2015-10-23 15:30:25 对应的pattern 为 yyyy-MM-dd HH:mm:ss
- * @return
- */
- public static Date parse(String source){
-
- SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
- try {
- return sdf.parse(source);
- } catch (Exception e) {
- }
-
- return null;
- }
-}
diff --git a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDataTagController.java b/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDataTagController.java
deleted file mode 100644
index 0a0a091..0000000
--- a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDataTagController.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package com.mdp.form.ctrl;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-
-import com.mdp.form.entity.FormDataTag;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockHttpSession;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.request.ServletWebRequest;
-import org.springframework.boot.test.context.SpringBootTest;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.http.MediaType;
-import com.mdp.core.utils.BaseUtils;
-/**
- * 组织 com.qqkj
- * 顶级模块 mdp
- * 大模块 form
- * 小模块
- * 表 FORM.form_data_tag form_data_tag
- * 实体 FormDataTag
- * 表是指数据库结构中的表,实体是指java类型中的实体类
- * 当前实体所有属性名:
- * dataId,tagId,tagName,id,createTime;
- * 当前表的所有字段名:
- * data_id,tag_id,tag_name,id,create_time;
- * 当前主键(包括多主键):
- * id;
- **/
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-public class TestFormDataTagController {
-
- @Autowired
- public WebApplicationContext wac; // cached
- @Autowired
- public MockServletContext servletContext; // cached
- @Autowired
- public MockHttpSession session;
- @Autowired
- public MockHttpServletRequest request;
- @Autowired
- public MockHttpServletResponse response;
- @Autowired
- public ServletWebRequest webRequest;
-
- public MockMvc mockMvc;
-
- public MockHttpServletRequestBuilder msrb;
-
- ObjectMapper om = new ObjectMapper();
-
- @Before
- public void setup() {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
- }
-
- @Test
- public void add() throws Exception {
- Map p=BaseUtils.map("dataId","5IKG","tagId","XMYF","tagName","0Gru","id","kz13","createTime",parse("2020-03-16 14:50:26"));
- FormDataTag formDataTag=BaseUtils.fromMap(p,FormDataTag.class);
- String jsonFormDataTag=om.writeValueAsString(formDataTag);
- mockMvc.perform( post("/**/form/formDataTag/add").content(jsonFormDataTag).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void list() throws Exception {
- mockMvc.perform( get("/**/form/formDataTag/list")
- .param("id","kz13").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void listKey() throws Exception {
- mockMvc.perform( get("/**/form/formDataTag/listKey")
- .param("id","kz13").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void edit() throws Exception {
- Map p=BaseUtils.map("dataId","5IKG","tagId","XMYF","tagName","0Gru","id","kz13","createTime",parse("2020-03-16 14:50:26"));
- FormDataTag formDataTag=BaseUtils.fromMap(p,FormDataTag.class);
- String jsonFormDataTag=om.writeValueAsString(formDataTag);
- mockMvc.perform( post("/**/form/formDataTag/edit").content(jsonFormDataTag).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void del() throws Exception {
- mockMvc.perform( post("/**/form/formDataTag/del").content("kz13").contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void batchDel() throws Exception {
- Map p=BaseUtils.map("dataId","5IKG","tagId","XMYF","tagName","0Gru","id","kz13","createTime",parse("2020-03-16 14:50:26"));
- FormDataTag formDataTag=BaseUtils.fromMap(p,FormDataTag.class);
- List formDataTags=new ArrayList<>();
- formDataTags.add(formDataTag);
- String jsonFormDataTag=om.writeValueAsString(formDataTags);
- mockMvc.perform( post("/**/form/formDataTag/batchDel").content(jsonFormDataTag).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
- /**
- * 将字符串类型的日期转成Date对象
- * @param source 如2015-10-23或者 2015-10-23 15:30:25等
- * @param pattern 格式必须与 source的格式一致,如 2015-10-23对应的 pattern为 yyyy-MM-dd,
- * 2015-10-23 15:30:25 对应的pattern 为 yyyy-MM-dd HH:mm:ss
- * @return
- */
- public static Date parse(String source){
-
- SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
- try {
- return sdf.parse(source);
- } catch (Exception e) {
- }
-
- return null;
- }
-}
diff --git a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDefController.java b/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDefController.java
deleted file mode 100644
index 711c05d..0000000
--- a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDefController.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package com.mdp.form.ctrl;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-
-import com.mdp.form.entity.FormDef;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockHttpSession;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.request.ServletWebRequest;
-import org.springframework.boot.test.context.SpringBootTest;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.http.MediaType;
-import com.mdp.core.utils.BaseUtils;
-/**
- * 组织 com.qqkj
- * 顶级模块 mdp
- * 大模块 form
- * 小模块
- * 表 FORM.form_def form_def
- * 实体 FormDef
- * 表是指数据库结构中的表,实体是指java类型中的实体类
- * 当前实体所有属性名:
- * id,tableName,tableOwner,isCreateTable,formName,userid,deptid,formType,isTemplate,bizType,ctime,branchId,categoryId,tagIds,tagNames,username,deptName;
- * 当前表的所有字段名:
- * id,table_name,table_owner,is_create_table,form_name,userid,deptid,form_type,is_template,biz_type,ctime,branch_id,category_id,tag_ids,tag_names,username,dept_name;
- * 当前主键(包括多主键):
- * id;
- **/
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-public class TestFormDefController {
-
- @Autowired
- public WebApplicationContext wac; // cached
- @Autowired
- public MockServletContext servletContext; // cached
- @Autowired
- public MockHttpSession session;
- @Autowired
- public MockHttpServletRequest request;
- @Autowired
- public MockHttpServletResponse response;
- @Autowired
- public ServletWebRequest webRequest;
-
- public MockMvc mockMvc;
-
- public MockHttpServletRequestBuilder msrb;
-
- ObjectMapper om = new ObjectMapper();
-
- @Before
- public void setup() {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
- }
-
- @Test
- public void add() throws Exception {
- Map p=BaseUtils.map("id","Ohi6","tableName","rMaQ","tableOwner","2Hz4","isCreateTable","V","formName","8gp6","userid","NKUh","deptid","7SMx","formType","n","isTemplate","C","bizType","2N7H","ctime",parse("2020-03-16 23:28:15"),"branchId","h0b0","categoryId","5LwF","tagIds","jXSn","tagNames","71bt","username","qJF0","deptName","8TYz");
- FormDef formDef=BaseUtils.fromMap(p,FormDef.class);
- String jsonFormDef=om.writeValueAsString(formDef);
- mockMvc.perform( post("/**/form/formDef/add").content(jsonFormDef).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void list() throws Exception {
- mockMvc.perform( get("/**/form/formDef/list")
- .param("id","Ohi6").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void listKey() throws Exception {
- mockMvc.perform( get("/**/form/formDef/listKey")
- .param("id","Ohi6").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void edit() throws Exception {
- Map p=BaseUtils.map("id","Ohi6","tableName","rMaQ","tableOwner","2Hz4","isCreateTable","V","formName","8gp6","userid","NKUh","deptid","7SMx","formType","n","isTemplate","C","bizType","2N7H","ctime",parse("2020-03-16 23:28:15"),"branchId","h0b0","categoryId","5LwF","tagIds","jXSn","tagNames","71bt","username","qJF0","deptName","8TYz");
- FormDef formDef=BaseUtils.fromMap(p,FormDef.class);
- String jsonFormDef=om.writeValueAsString(formDef);
- mockMvc.perform( post("/**/form/formDef/edit").content(jsonFormDef).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void del() throws Exception {
- mockMvc.perform( post("/**/form/formDef/del").content("Ohi6").contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void batchDel() throws Exception {
- Map p=BaseUtils.map("id","Ohi6","tableName","rMaQ","tableOwner","2Hz4","isCreateTable","V","formName","8gp6","userid","NKUh","deptid","7SMx","formType","n","isTemplate","C","bizType","2N7H","ctime",parse("2020-03-16 23:28:15"),"branchId","h0b0","categoryId","5LwF","tagIds","jXSn","tagNames","71bt","username","qJF0","deptName","8TYz");
- FormDef formDef=BaseUtils.fromMap(p,FormDef.class);
- List formDefs=new ArrayList<>();
- formDefs.add(formDef);
- String jsonFormDef=om.writeValueAsString(formDefs);
- mockMvc.perform( post("/**/form/formDef/batchDel").content(jsonFormDef).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
- /**
- * 将字符串类型的日期转成Date对象
- * @param source 如2015-10-23或者 2015-10-23 15:30:25等
- * @param pattern 格式必须与 source的格式一致,如 2015-10-23对应的 pattern为 yyyy-MM-dd,
- * 2015-10-23 15:30:25 对应的pattern 为 yyyy-MM-dd HH:mm:ss
- * @return
- */
- public static Date parse(String source){
-
- SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
- try {
- return sdf.parse(source);
- } catch (Exception e) {
- }
-
- return null;
- }
-}
diff --git a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDefTagController.java b/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDefTagController.java
deleted file mode 100644
index 1582a69..0000000
--- a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormDefTagController.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package com.mdp.form.ctrl;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-
-import com.mdp.form.entity.FormDefTag;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockHttpSession;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.request.ServletWebRequest;
-import org.springframework.boot.test.context.SpringBootTest;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.http.MediaType;
-import com.mdp.core.utils.BaseUtils;
-/**
- * 组织 com.qqkj
- * 顶级模块 mdp
- * 大模块 form
- * 小模块
- * 表 FORM.form_def_tag form_def_tag
- * 实体 FormDefTag
- * 表是指数据库结构中的表,实体是指java类型中的实体类
- * 当前实体所有属性名:
- * formId,tagId,tagName,id,createTime;
- * 当前表的所有字段名:
- * form_id,tag_id,tag_name,id,create_time;
- * 当前主键(包括多主键):
- * id;
- **/
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-public class TestFormDefTagController {
-
- @Autowired
- public WebApplicationContext wac; // cached
- @Autowired
- public MockServletContext servletContext; // cached
- @Autowired
- public MockHttpSession session;
- @Autowired
- public MockHttpServletRequest request;
- @Autowired
- public MockHttpServletResponse response;
- @Autowired
- public ServletWebRequest webRequest;
-
- public MockMvc mockMvc;
-
- public MockHttpServletRequestBuilder msrb;
-
- ObjectMapper om = new ObjectMapper();
-
- @Before
- public void setup() {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
- }
-
- @Test
- public void add() throws Exception {
- Map p=BaseUtils.map("formId","4eu8","tagId","zZ3c","tagName","JXVZ","id","F9B1","createTime",parse("2020-03-16 14:50:25"));
- FormDefTag formDefTag=BaseUtils.fromMap(p,FormDefTag.class);
- String jsonFormDefTag=om.writeValueAsString(formDefTag);
- mockMvc.perform( post("/**/form/formDefTag/add").content(jsonFormDefTag).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void list() throws Exception {
- mockMvc.perform( get("/**/form/formDefTag/list")
- .param("id","F9B1").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void listKey() throws Exception {
- mockMvc.perform( get("/**/form/formDefTag/listKey")
- .param("id","F9B1").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void edit() throws Exception {
- Map p=BaseUtils.map("formId","4eu8","tagId","zZ3c","tagName","JXVZ","id","F9B1","createTime",parse("2020-03-16 14:50:25"));
- FormDefTag formDefTag=BaseUtils.fromMap(p,FormDefTag.class);
- String jsonFormDefTag=om.writeValueAsString(formDefTag);
- mockMvc.perform( post("/**/form/formDefTag/edit").content(jsonFormDefTag).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void del() throws Exception {
- mockMvc.perform( post("/**/form/formDefTag/del").content("F9B1").contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void batchDel() throws Exception {
- Map p=BaseUtils.map("formId","4eu8","tagId","zZ3c","tagName","JXVZ","id","F9B1","createTime",parse("2020-03-16 14:50:25"));
- FormDefTag formDefTag=BaseUtils.fromMap(p,FormDefTag.class);
- List formDefTags=new ArrayList<>();
- formDefTags.add(formDefTag);
- String jsonFormDefTag=om.writeValueAsString(formDefTags);
- mockMvc.perform( post("/**/form/formDefTag/batchDel").content(jsonFormDefTag).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
- /**
- * 将字符串类型的日期转成Date对象
- * @param source 如2015-10-23或者 2015-10-23 15:30:25等
- * @param pattern 格式必须与 source的格式一致,如 2015-10-23对应的 pattern为 yyyy-MM-dd,
- * 2015-10-23 15:30:25 对应的pattern 为 yyyy-MM-dd HH:mm:ss
- * @return
- */
- public static Date parse(String source){
-
- SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
- try {
- return sdf.parse(source);
- } catch (Exception e) {
- }
-
- return null;
- }
-}
diff --git a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormFieldController.java b/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormFieldController.java
deleted file mode 100644
index ef51838..0000000
--- a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormFieldController.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package com.mdp.form.ctrl;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-
-import com.mdp.form.entity.FormField;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockHttpSession;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.request.ServletWebRequest;
-import org.springframework.boot.test.context.SpringBootTest;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.http.MediaType;
-import com.mdp.core.utils.BaseUtils;
-/**
- * 组织 com.qqkj
- * 顶级模块 mdp
- * 大模块 form
- * 小模块
- * 表 FORM.form_field form_field
- * 实体 FormField
- * 表是指数据库结构中的表,实体是指java类型中的实体类
- * 当前实体所有属性名:
- * formId,id,fieldId,fieldTitle,secondCodeRow,fieldType,fieldLength,defaultValue,isMultiple,placeholder,isRequired,isFromBaseData,fieldIdCamel,remark,extFieldType,isCloneToFlow,flowFieldId,isBizKey,seqNo;
- * 当前表的所有字段名:
- * form_id,id,field_id,field_title,second_code_row,field_type,field_length,default_value,is_multiple,placeholder,is_required,is_from_base_data,field_id_camel,remark,ext_field_type,is_clone_to_flow,flow_field_id,is_biz_key,seq_no;
- * 当前主键(包括多主键):
- * id;
- **/
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-public class TestFormFieldController {
-
- @Autowired
- public WebApplicationContext wac; // cached
- @Autowired
- public MockServletContext servletContext; // cached
- @Autowired
- public MockHttpSession session;
- @Autowired
- public MockHttpServletRequest request;
- @Autowired
- public MockHttpServletResponse response;
- @Autowired
- public ServletWebRequest webRequest;
-
- public MockMvc mockMvc;
-
- public MockHttpServletRequestBuilder msrb;
-
- ObjectMapper om = new ObjectMapper();
-
- @Before
- public void setup() {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
- }
-
- @Test
- public void add() throws Exception {
- Map p=BaseUtils.map("formId","Oj5r","id","U54V","fieldId","jOBG","fieldTitle","5VpR","secondCodeRow","5ObO","fieldType","kNGG","fieldLength",2866.439,"defaultValue","JpQ6","isMultiple","u","placeholder","9q9n","isRequired","g","isFromBaseData","M","fieldIdCamel","nHOV","remark","iHtf","extFieldType","3IL3","isCloneToFlow","4","flowFieldId","lDQJ","isBizKey","X","seqNo",2119.375);
- FormField formField=BaseUtils.fromMap(p,FormField.class);
- String jsonFormField=om.writeValueAsString(formField);
- mockMvc.perform( post("/**/form/formField/add").content(jsonFormField).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void list() throws Exception {
- mockMvc.perform( get("/**/form/formField/list")
- .param("id","U54V").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void listKey() throws Exception {
- mockMvc.perform( get("/**/form/formField/listKey")
- .param("id","U54V").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void edit() throws Exception {
- Map p=BaseUtils.map("formId","Oj5r","id","U54V","fieldId","jOBG","fieldTitle","5VpR","secondCodeRow","5ObO","fieldType","kNGG","fieldLength",2866.439,"defaultValue","JpQ6","isMultiple","u","placeholder","9q9n","isRequired","g","isFromBaseData","M","fieldIdCamel","nHOV","remark","iHtf","extFieldType","3IL3","isCloneToFlow","4","flowFieldId","lDQJ","isBizKey","X","seqNo",2119.375);
- FormField formField=BaseUtils.fromMap(p,FormField.class);
- String jsonFormField=om.writeValueAsString(formField);
- mockMvc.perform( post("/**/form/formField/edit").content(jsonFormField).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void del() throws Exception {
- mockMvc.perform( post("/**/form/formField/del").content("U54V").contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void batchDel() throws Exception {
- Map p=BaseUtils.map("formId","Oj5r","id","U54V","fieldId","jOBG","fieldTitle","5VpR","secondCodeRow","5ObO","fieldType","kNGG","fieldLength",2866.439,"defaultValue","JpQ6","isMultiple","u","placeholder","9q9n","isRequired","g","isFromBaseData","M","fieldIdCamel","nHOV","remark","iHtf","extFieldType","3IL3","isCloneToFlow","4","flowFieldId","lDQJ","isBizKey","X","seqNo",2119.375);
- FormField formField=BaseUtils.fromMap(p,FormField.class);
- List formFields=new ArrayList<>();
- formFields.add(formField);
- String jsonFormField=om.writeValueAsString(formFields);
- mockMvc.perform( post("/**/form/formField/batchDel").content(jsonFormField).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
- /**
- * 将字符串类型的日期转成Date对象
- * @param source 如2015-10-23或者 2015-10-23 15:30:25等
- * @param pattern 格式必须与 source的格式一致,如 2015-10-23对应的 pattern为 yyyy-MM-dd,
- * 2015-10-23 15:30:25 对应的pattern 为 yyyy-MM-dd HH:mm:ss
- * @return
- */
- public static Date parse(String source){
-
- SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
- try {
- return sdf.parse(source);
- } catch (Exception e) {
- }
-
- return null;
- }
-}
diff --git a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormQxController.java b/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormQxController.java
deleted file mode 100644
index 051d642..0000000
--- a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormQxController.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package com.mdp.form.ctrl;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-
-import com.mdp.form.entity.FormQx;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockHttpSession;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.request.ServletWebRequest;
-import org.springframework.boot.test.context.SpringBootTest;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.http.MediaType;
-import com.mdp.core.utils.BaseUtils;
-/**
- * 组织 com.qqkj
- * 顶级模块 mdp
- * 大模块 form
- * 小模块
- * 表 FORM.form_qx form_qx
- * 实体 FormQx
- * 表是指数据库结构中的表,实体是指java类型中的实体类
- * 当前实体所有属性名:
- * formId,allowQueryRoleids,allowQueryDeptids,allowQueryUserids,notQueryRoleids,notQueryDeptids,notQueryUserids,allowOtherQuery,allowOtherEdit,allowOtherDel,doDeptLvlCheck,deptLvlQx;
- * 当前表的所有字段名:
- * form_id,allow_query_roleids,allow_query_deptids,allow_query_userids,not_query_roleids,not_query_deptids,not_query_userids,allow_other_query,allow_other_edit,allow_other_del,do_dept_lvl_check,dept_lvl_qx;
- * 当前主键(包括多主键):
- * form_id;
- **/
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-public class TestFormQxController {
-
- @Autowired
- public WebApplicationContext wac; // cached
- @Autowired
- public MockServletContext servletContext; // cached
- @Autowired
- public MockHttpSession session;
- @Autowired
- public MockHttpServletRequest request;
- @Autowired
- public MockHttpServletResponse response;
- @Autowired
- public ServletWebRequest webRequest;
-
- public MockMvc mockMvc;
-
- public MockHttpServletRequestBuilder msrb;
-
- ObjectMapper om = new ObjectMapper();
-
- @Before
- public void setup() {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
- }
-
- @Test
- public void add() throws Exception {
- Map p=BaseUtils.map("formId","v1Bz","allowQueryRoleids","hXaR","allowQueryDeptids","zKvQ","allowQueryUserids","b6b9","notQueryRoleids","QW53","notQueryDeptids","abHk","notQueryUserids","lG12","allowOtherQuery","d","allowOtherEdit","R","allowOtherDel","p","doDeptLvlCheck","L","deptLvlQx","6qK2");
- FormQx formQx=BaseUtils.fromMap(p,FormQx.class);
- String jsonFormQx=om.writeValueAsString(formQx);
- mockMvc.perform( post("/**/form/formQx/add").content(jsonFormQx).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void list() throws Exception {
- mockMvc.perform( get("/**/form/formQx/list")
- .param("formId","v1Bz").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void listKey() throws Exception {
- mockMvc.perform( get("/**/form/formQx/listKey")
- .param("formId","v1Bz").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void edit() throws Exception {
- Map p=BaseUtils.map("formId","v1Bz","allowQueryRoleids","hXaR","allowQueryDeptids","zKvQ","allowQueryUserids","b6b9","notQueryRoleids","QW53","notQueryDeptids","abHk","notQueryUserids","lG12","allowOtherQuery","d","allowOtherEdit","R","allowOtherDel","p","doDeptLvlCheck","L","deptLvlQx","6qK2");
- FormQx formQx=BaseUtils.fromMap(p,FormQx.class);
- String jsonFormQx=om.writeValueAsString(formQx);
- mockMvc.perform( post("/**/form/formQx/edit").content(jsonFormQx).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void del() throws Exception {
- mockMvc.perform( post("/**/form/formQx/del").content("v1Bz").contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void batchDel() throws Exception {
- Map p=BaseUtils.map("formId","v1Bz","allowQueryRoleids","hXaR","allowQueryDeptids","zKvQ","allowQueryUserids","b6b9","notQueryRoleids","QW53","notQueryDeptids","abHk","notQueryUserids","lG12","allowOtherQuery","d","allowOtherEdit","R","allowOtherDel","p","doDeptLvlCheck","L","deptLvlQx","6qK2");
- FormQx formQx=BaseUtils.fromMap(p,FormQx.class);
- List formQxs=new ArrayList<>();
- formQxs.add(formQx);
- String jsonFormQx=om.writeValueAsString(formQxs);
- mockMvc.perform( post("/**/form/formQx/batchDel").content(jsonFormQx).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
- /**
- * 将字符串类型的日期转成Date对象
- * @param source 如2015-10-23或者 2015-10-23 15:30:25等
- * @param pattern 格式必须与 source的格式一致,如 2015-10-23对应的 pattern为 yyyy-MM-dd,
- * 2015-10-23 15:30:25 对应的pattern 为 yyyy-MM-dd HH:mm:ss
- * @return
- */
- public static Date parse(String source){
-
- SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
- try {
- return sdf.parse(source);
- } catch (Exception e) {
- }
-
- return null;
- }
-}
diff --git a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormViewController.java b/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormViewController.java
deleted file mode 100644
index 374dc9a..0000000
--- a/mdp-form/src/test/java/com/mdp/form/ctrl/TestFormViewController.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package com.mdp.form.ctrl;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-
-import com.mdp.form.entity.FormView;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockHttpSession;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.request.ServletWebRequest;
-import org.springframework.boot.test.context.SpringBootTest;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.http.MediaType;
-import com.mdp.core.utils.BaseUtils;
-/**
- * 组织 com.qqkj
- * 顶级模块 mdp
- * 大模块 form
- * 小模块
- * 表 FORM.form_view 表单页面
- * 实体 FormView
- * 表是指数据库结构中的表,实体是指java类型中的实体类
- * 当前实体所有属性名:
- * formId,id,viewContext,bizId;
- * 当前表的所有字段名:
- * form_id,id,view_context,biz_id;
- * 当前主键(包括多主键):
- * id;
- **/
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-public class TestFormViewController {
-
- @Autowired
- public WebApplicationContext wac; // cached
- @Autowired
- public MockServletContext servletContext; // cached
- @Autowired
- public MockHttpSession session;
- @Autowired
- public MockHttpServletRequest request;
- @Autowired
- public MockHttpServletResponse response;
- @Autowired
- public ServletWebRequest webRequest;
-
- public MockMvc mockMvc;
-
- public MockHttpServletRequestBuilder msrb;
-
- ObjectMapper om = new ObjectMapper();
-
- @Before
- public void setup() {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
- }
-
- @Test
- public void add() throws Exception {
- Map p=BaseUtils.map("formId","GtW1","id","nqP7","viewContext","gMsH","bizId","W4Uj");
- FormView formView=BaseUtils.fromMap(p,FormView.class);
- String jsonFormView=om.writeValueAsString(formView);
- mockMvc.perform( post("/**/form/formView/add").content(jsonFormView).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void list() throws Exception {
- mockMvc.perform( get("/**/form/formView/list")
- .param("id","nqP7").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void listKey() throws Exception {
- mockMvc.perform( get("/**/form/formView/listKey")
- .param("id","nqP7").param("currentPage", "1").param("pageSize", "10"))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true))
- .andExpect(jsonPath("data").isArray())
- .andExpect(jsonPath("pageInfo.total").exists());
- }
-
- @Test
- public void edit() throws Exception {
- Map p=BaseUtils.map("formId","GtW1","id","nqP7","viewContext","gMsH","bizId","W4Uj");
- FormView formView=BaseUtils.fromMap(p,FormView.class);
- String jsonFormView=om.writeValueAsString(formView);
- mockMvc.perform( post("/**/form/formView/edit").content(jsonFormView).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void del() throws Exception {
- mockMvc.perform( post("/**/form/formView/del").content("nqP7").contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
-
- @Test
- public void batchDel() throws Exception {
- String[] ids=new String[3];
- ids[0]="1";
- ids[1]="2";
- ids[2]="3";
- String jsonFormView=om.writeValueAsString(ids);
- mockMvc.perform( post("/**/form/formView/batchDel").content(jsonFormView).contentType(MediaType.APPLICATION_JSON))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("tips.isOk").value(true));
- }
- /**
- * 将字符串类型的日期转成Date对象
- * @param source 如2015-10-23或者 2015-10-23 15:30:25等
- * @param pattern 格式必须与 source的格式一致,如 2015-10-23对应的 pattern为 yyyy-MM-dd,
- * 2015-10-23 15:30:25 对应的pattern 为 yyyy-MM-dd HH:mm:ss
- * @return
- */
- public static Date parse(String source){
-
- SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
- try {
- return sdf.parse(source);
- } catch (Exception e) {
- }
-
- return null;
- }
-}
diff --git a/mdp-form/src/test/java/com/mdp/form/dao/TestFormDataDao.java b/mdp-form/src/test/java/com/mdp/form/dao/TestFormDataDao.java
deleted file mode 100644
index 40e38c2..0000000
--- a/mdp-form/src/test/java/com/mdp/form/dao/TestFormDataDao.java
+++ /dev/null
@@ -1,320 +0,0 @@
-package com.mdp.form.dao;
-
-import java.util.*;
-import java.text.SimpleDateFormat;
-
-import com.mdp.form.entity.FormData;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import com.mdp.core.utils.BaseUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.mdp.core.dao.BaseDao;
-
-import com.mdp.mybatis.PageUtils;
-import com.github.pagehelper.Page;
-import org.springframework.boot.test.context.SpringBootTest;
-/**
- * FormDataDao的测试案例
- * 组织 com.qqkj
- * 顶级模块 mdp
- * 大模块 form
- * 小模块
- * 表 FORM.form_data form_data
- * 实体 FormData
- * 表是指数据库结构中的表,实体是指java类型中的实体类
- * 当前实体所有属性名:
- * id,two,three,four,five,six,seven,eight,nine,ten,lastTime,one,zero,remark,formId,userid,eleven,twelve,thirteen,fourteen,fifteen,attachmentUrls,attachmentNames,branchId,bizKey,deptid,flowState,createTime,dqxCode,cuserid,tagIds,tagNames,cusername,deptName;
- * 当前表的所有字段名:
- * id,two,three,four,five,six,seven,eight,nine,ten,last_time,one,zero,remark,form_id,userid,eleven,twelve,thirteen,fourteen,fifteen,attachment_urls,attachment_names,branch_id,biz_key,deptid,flow_state,create_time,dqx_code,cuserid,tag_ids,tag_names,cusername,dept_name;
- * 当前主键(包括多主键):
- * id;
- ***/
- @RunWith(SpringJUnit4ClassRunner.class)
- @SpringBootTest
-public class TestFormDataDao {
-
- @Autowired
- BaseDao baseDao;
-
- /**
- * 新增一条数据
- ***/
- @Test
- public void insert() {
- Map p=BaseUtils.map("id","1N13","two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- baseDao.insert(formData);
- //Assert.assertEquals(1, result);
- }
- /**
- * 删除满足条件的一条或者一批数据
- ***/
- @Test
- public void deleteByWhere() {
- Map p=BaseUtils.map("two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- baseDao.deleteByWhere(formData);
- //Assert.assertEquals(1, result);
- }
-
- /**
- * 跟进主键删除一条数据
- ***/
- @Test
- public void deleteByPk() {
- Map p=BaseUtils.map("id","1N13");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- baseDao.deleteByPk(formData);
- //Assert.assertEquals(1, result);
- }
-
- /**
- * 更新满足条件的一条或者一批数据
- ***/
- @Test
- public void updateSomeFieldByPk() {
- Map where=BaseUtils.map("two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData=BaseUtils.fromMap(where,FormData.class);
- baseDao.updateSomeFieldByPk(formData);
- //Assert.assertEquals(1, result);
- }
-
-
-
- /**
- * 根据主键更新一条数据
- ***/
- @Test
- public void updateByPk() {
- Map p=BaseUtils.map("id","1N13");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- baseDao.updateByPk(formData);
- //Assert.assertEquals(1, result);
- }
-
-
- /**
- * 新增或者修改一条数据
- ***/
- @Test
- public void insertOrUpdate() {
- Map p=BaseUtils.map("id","1N13","two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- baseDao.insertOrUpdate(formData);
- //Assert.assertEquals(1, result);
- }
-
-
- /**
- * 批量更新一批数据到数据库
- ***/
- @Test
- public void batchUpdate() {
- List batchValues=new ArrayList();
- Map p0=BaseUtils.map("id","1N13","two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData0=BaseUtils.fromMap(p0,FormData.class);
- batchValues.add(formData0);
- Map p1=BaseUtils.map("id","8F5A","two","axG0","three","vRoJ","four","NbY2","five","7MuL","six","jfmr","seven","dwO1","eight","15o7","nine","PpI8","ten","BD2j","lastTime",parse("2020-03-16 23:28:18"),"one","nDQ7","zero","5FFo","remark","1rdn","formId","46WN","userid","7Oqi","eleven","iawa","twelve","hCTV","thirteen","8MS9","fourteen","vQ7W","fifteen","k2Pd","attachmentUrls","1967","attachmentNames","7817","branchId","BTM0","bizKey","lT0s","deptid","vofa","flowState","0","createTime",parse("2020-03-16 23:28:18"),"dqxCode","JWaK","cuserid","","tagIds","y44k","tagNames","8hr5","cusername","80K5","deptName","H5in");
- FormData formData1=BaseUtils.fromMap(p1,FormData.class);
- batchValues.add(formData1);
- Map p2=BaseUtils.map("id","v987","two","oWPO","three","D2xm","four","wAbG","five","2DZo","six","pBHg","seven","WMgQ","eight","yvfU","nine","Txbv","ten","G0YC","lastTime",parse("2020-03-16 23:28:18"),"one","Ec7q","zero","BM3V","remark","r35q","formId","Xc9I","userid","0zOf","eleven","2D3l","twelve","CU6e","thirteen","14T6","fourteen","k7NU","fifteen","YJBh","attachmentUrls","4EwZ","attachmentNames","c2N2","branchId","pCDc","bizKey","QQ39","deptid","kemy","flowState","v","createTime",parse("2020-03-16 23:28:18"),"dqxCode","r6ad","cuserid","","tagIds","7F3Q","tagNames","Hs6e","cusername","O7us","deptName","Ww5m");
- FormData formData2=BaseUtils.fromMap(p2,FormData.class);
- batchValues.add(formData2);
- Map p3=BaseUtils.map("id","2m64","two","Ls5s","three","SdXp","four","vE6U","five","5z0p","six","Ty0u","seven","nw52","eight","3430","nine","D559","ten","vldy","lastTime",parse("2020-03-16 23:28:18"),"one","X9kF","zero","8KAD","remark","bEtW","formId","azBG","userid","wjcO","eleven","aGRH","twelve","5S7P","thirteen","6Im3","fourteen","OX1d","fifteen","y9jw","attachmentUrls","kK3U","attachmentNames","7JG6","branchId","Ts6V","bizKey","LZCB","deptid","Agyl","flowState","8","createTime",parse("2020-03-16 23:28:18"),"dqxCode","1AAy","cuserid","","tagIds","TFET","tagNames","J45r","cusername","2jpI","deptName","1Ir5");
- FormData formData3=BaseUtils.fromMap(p3,FormData.class);
- batchValues.add(formData3);
- Map p4=BaseUtils.map("id","0O1H","two","naNb","three","974F","four","SsHa","five","nvZc","six","i7wB","seven","BKSv","eight","3emj","nine","vxo8","ten","F7Z2","lastTime",parse("2020-03-16 23:28:18"),"one","k5ZW","zero","4qS6","remark","PFM4","formId","oNB1","userid","dtpB","eleven","j30R","twelve","F82L","thirteen","733o","fourteen","67RN","fifteen","qons","attachmentUrls","0jnD","attachmentNames","urRJ","branchId","lRgv","bizKey","65XJ","deptid","BsCI","flowState","8","createTime",parse("2020-03-16 23:28:18"),"dqxCode","pnmA","cuserid","","tagIds","sP97","tagNames","8d2v","cusername","Qnd1","deptName","8zao");
- FormData formData4=BaseUtils.fromMap(p4,FormData.class);
- batchValues.add(formData4);
- Map p5=BaseUtils.map("id","MrL5","two","vcC4","three","szst","four","455j","five","XdtI","six","mR6Q","seven","HcRN","eight","oJhW","nine","kydj","ten","l40j","lastTime",parse("2020-03-16 23:28:18"),"one","btU0","zero","38c8","remark","3Qqg","formId","0TJ5","userid","uUP0","eleven","Si0i","twelve","nHUo","thirteen","QFXm","fourteen","8ZBa","fifteen","f6w5","attachmentUrls","811U","attachmentNames","Yzdk","branchId","2518","bizKey","39CX","deptid","5g6q","flowState","I","createTime",parse("2020-03-16 23:28:18"),"dqxCode","c9tP","cuserid","","tagIds","3F91","tagNames","iq21","cusername","Qq03","deptName","lnGM");
- FormData formData5=BaseUtils.fromMap(p5,FormData.class);
- batchValues.add(formData5);
- Map p6=BaseUtils.map("id","ZE7M","two","k9tp","three","D9Ur","four","vnJa","five","Y3No","six","CWx4","seven","mQ5w","eight","7BVb","nine","l6HY","ten","ou4J","lastTime",parse("2020-03-16 23:28:18"),"one","ZcMl","zero","uBFa","remark","br58","formId","zZb4","userid","biY8","eleven","k8Pb","twelve","LUAh","thirteen","J6EO","fourteen","N0Dg","fifteen","SwJI","attachmentUrls","Q6Tr","attachmentNames","k59i","branchId","Eo5K","bizKey","5vb7","deptid","u79D","flowState","3","createTime",parse("2020-03-16 23:28:18"),"dqxCode","ZTiF","cuserid","","tagIds","3WaX","tagNames","lS90","cusername","MkKG","deptName","a007");
- FormData formData6=BaseUtils.fromMap(p6,FormData.class);
- batchValues.add(formData6);
- Map p7=BaseUtils.map("id","42U7","two","V2EI","three","eckz","four","aj8c","five","5soT","six","xiGe","seven","YHi2","eight","cPJK","nine","GkfB","ten","G38c","lastTime",parse("2020-03-16 23:28:18"),"one","077d","zero","JHlc","remark","mc9o","formId","HBAq","userid","zjuR","eleven","9t71","twelve","sh7b","thirteen","27h2","fourteen","w61U","fifteen","AFtg","attachmentUrls","iD2H","attachmentNames","8TIl","branchId","91BS","bizKey","H9v8","deptid","Mx71","flowState","r","createTime",parse("2020-03-16 23:28:18"),"dqxCode","wEai","cuserid","","tagIds","bSvu","tagNames","2W2U","cusername","B5V4","deptName","9Q6C");
- FormData formData7=BaseUtils.fromMap(p7,FormData.class);
- batchValues.add(formData7);
- baseDao.batchUpdate(batchValues);
- //Assert.assertEquals(1, result[0]);
- }
-
- /**
- * 批量删除一批数据到数据库
- ***/
- @Test
- public void batchDelete() {
- List batchValues=new ArrayList();
- Map p0=BaseUtils.map("id","1N13","two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData0=BaseUtils.fromMap(p0,FormData.class);
- batchValues.add(formData0);
- Map p1=BaseUtils.map("id","8F5A","two","axG0","three","vRoJ","four","NbY2","five","7MuL","six","jfmr","seven","dwO1","eight","15o7","nine","PpI8","ten","BD2j","lastTime",parse("2020-03-16 23:28:18"),"one","nDQ7","zero","5FFo","remark","1rdn","formId","46WN","userid","7Oqi","eleven","iawa","twelve","hCTV","thirteen","8MS9","fourteen","vQ7W","fifteen","k2Pd","attachmentUrls","1967","attachmentNames","7817","branchId","BTM0","bizKey","lT0s","deptid","vofa","flowState","0","createTime",parse("2020-03-16 23:28:18"),"dqxCode","JWaK","cuserid","","tagIds","y44k","tagNames","8hr5","cusername","80K5","deptName","H5in");
- FormData formData1=BaseUtils.fromMap(p1,FormData.class);
- batchValues.add(formData1);
- Map p2=BaseUtils.map("id","v987","two","oWPO","three","D2xm","four","wAbG","five","2DZo","six","pBHg","seven","WMgQ","eight","yvfU","nine","Txbv","ten","G0YC","lastTime",parse("2020-03-16 23:28:18"),"one","Ec7q","zero","BM3V","remark","r35q","formId","Xc9I","userid","0zOf","eleven","2D3l","twelve","CU6e","thirteen","14T6","fourteen","k7NU","fifteen","YJBh","attachmentUrls","4EwZ","attachmentNames","c2N2","branchId","pCDc","bizKey","QQ39","deptid","kemy","flowState","v","createTime",parse("2020-03-16 23:28:18"),"dqxCode","r6ad","cuserid","","tagIds","7F3Q","tagNames","Hs6e","cusername","O7us","deptName","Ww5m");
- FormData formData2=BaseUtils.fromMap(p2,FormData.class);
- batchValues.add(formData2);
- Map p3=BaseUtils.map("id","2m64","two","Ls5s","three","SdXp","four","vE6U","five","5z0p","six","Ty0u","seven","nw52","eight","3430","nine","D559","ten","vldy","lastTime",parse("2020-03-16 23:28:18"),"one","X9kF","zero","8KAD","remark","bEtW","formId","azBG","userid","wjcO","eleven","aGRH","twelve","5S7P","thirteen","6Im3","fourteen","OX1d","fifteen","y9jw","attachmentUrls","kK3U","attachmentNames","7JG6","branchId","Ts6V","bizKey","LZCB","deptid","Agyl","flowState","8","createTime",parse("2020-03-16 23:28:18"),"dqxCode","1AAy","cuserid","","tagIds","TFET","tagNames","J45r","cusername","2jpI","deptName","1Ir5");
- FormData formData3=BaseUtils.fromMap(p3,FormData.class);
- batchValues.add(formData3);
- Map p4=BaseUtils.map("id","0O1H","two","naNb","three","974F","four","SsHa","five","nvZc","six","i7wB","seven","BKSv","eight","3emj","nine","vxo8","ten","F7Z2","lastTime",parse("2020-03-16 23:28:18"),"one","k5ZW","zero","4qS6","remark","PFM4","formId","oNB1","userid","dtpB","eleven","j30R","twelve","F82L","thirteen","733o","fourteen","67RN","fifteen","qons","attachmentUrls","0jnD","attachmentNames","urRJ","branchId","lRgv","bizKey","65XJ","deptid","BsCI","flowState","8","createTime",parse("2020-03-16 23:28:18"),"dqxCode","pnmA","cuserid","","tagIds","sP97","tagNames","8d2v","cusername","Qnd1","deptName","8zao");
- FormData formData4=BaseUtils.fromMap(p4,FormData.class);
- batchValues.add(formData4);
- Map p5=BaseUtils.map("id","MrL5","two","vcC4","three","szst","four","455j","five","XdtI","six","mR6Q","seven","HcRN","eight","oJhW","nine","kydj","ten","l40j","lastTime",parse("2020-03-16 23:28:18"),"one","btU0","zero","38c8","remark","3Qqg","formId","0TJ5","userid","uUP0","eleven","Si0i","twelve","nHUo","thirteen","QFXm","fourteen","8ZBa","fifteen","f6w5","attachmentUrls","811U","attachmentNames","Yzdk","branchId","2518","bizKey","39CX","deptid","5g6q","flowState","I","createTime",parse("2020-03-16 23:28:18"),"dqxCode","c9tP","cuserid","","tagIds","3F91","tagNames","iq21","cusername","Qq03","deptName","lnGM");
- FormData formData5=BaseUtils.fromMap(p5,FormData.class);
- batchValues.add(formData5);
- Map p6=BaseUtils.map("id","ZE7M","two","k9tp","three","D9Ur","four","vnJa","five","Y3No","six","CWx4","seven","mQ5w","eight","7BVb","nine","l6HY","ten","ou4J","lastTime",parse("2020-03-16 23:28:18"),"one","ZcMl","zero","uBFa","remark","br58","formId","zZb4","userid","biY8","eleven","k8Pb","twelve","LUAh","thirteen","J6EO","fourteen","N0Dg","fifteen","SwJI","attachmentUrls","Q6Tr","attachmentNames","k59i","branchId","Eo5K","bizKey","5vb7","deptid","u79D","flowState","3","createTime",parse("2020-03-16 23:28:18"),"dqxCode","ZTiF","cuserid","","tagIds","3WaX","tagNames","lS90","cusername","MkKG","deptName","a007");
- FormData formData6=BaseUtils.fromMap(p6,FormData.class);
- batchValues.add(formData6);
- Map p7=BaseUtils.map("id","42U7","two","V2EI","three","eckz","four","aj8c","five","5soT","six","xiGe","seven","YHi2","eight","cPJK","nine","GkfB","ten","G38c","lastTime",parse("2020-03-16 23:28:18"),"one","077d","zero","JHlc","remark","mc9o","formId","HBAq","userid","zjuR","eleven","9t71","twelve","sh7b","thirteen","27h2","fourteen","w61U","fifteen","AFtg","attachmentUrls","iD2H","attachmentNames","8TIl","branchId","91BS","bizKey","H9v8","deptid","Mx71","flowState","r","createTime",parse("2020-03-16 23:28:18"),"dqxCode","wEai","cuserid","","tagIds","bSvu","tagNames","2W2U","cusername","B5V4","deptName","9Q6C");
- FormData formData7=BaseUtils.fromMap(p7,FormData.class);
- batchValues.add(formData7);
- baseDao.batchDelete(batchValues);
- //Assert.assertEquals(1, result[0]);
- }
-
-
- /**
- * 批量新增一批数据到数据库
- ***/
- @Test
- public void batchInsert() {
- List batchValues=new ArrayList();
- Map p0=BaseUtils.map("id","1N13","two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData0=BaseUtils.fromMap(p0,FormData.class);
- batchValues.add(formData0);
- Map p1=BaseUtils.map("id","8F5A","two","axG0","three","vRoJ","four","NbY2","five","7MuL","six","jfmr","seven","dwO1","eight","15o7","nine","PpI8","ten","BD2j","lastTime",parse("2020-03-16 23:28:18"),"one","nDQ7","zero","5FFo","remark","1rdn","formId","46WN","userid","7Oqi","eleven","iawa","twelve","hCTV","thirteen","8MS9","fourteen","vQ7W","fifteen","k2Pd","attachmentUrls","1967","attachmentNames","7817","branchId","BTM0","bizKey","lT0s","deptid","vofa","flowState","0","createTime",parse("2020-03-16 23:28:18"),"dqxCode","JWaK","cuserid","","tagIds","y44k","tagNames","8hr5","cusername","80K5","deptName","H5in");
- FormData formData1=BaseUtils.fromMap(p1,FormData.class);
- batchValues.add(formData1);
- Map p2=BaseUtils.map("id","v987","two","oWPO","three","D2xm","four","wAbG","five","2DZo","six","pBHg","seven","WMgQ","eight","yvfU","nine","Txbv","ten","G0YC","lastTime",parse("2020-03-16 23:28:18"),"one","Ec7q","zero","BM3V","remark","r35q","formId","Xc9I","userid","0zOf","eleven","2D3l","twelve","CU6e","thirteen","14T6","fourteen","k7NU","fifteen","YJBh","attachmentUrls","4EwZ","attachmentNames","c2N2","branchId","pCDc","bizKey","QQ39","deptid","kemy","flowState","v","createTime",parse("2020-03-16 23:28:18"),"dqxCode","r6ad","cuserid","","tagIds","7F3Q","tagNames","Hs6e","cusername","O7us","deptName","Ww5m");
- FormData formData2=BaseUtils.fromMap(p2,FormData.class);
- batchValues.add(formData2);
- Map p3=BaseUtils.map("id","2m64","two","Ls5s","three","SdXp","four","vE6U","five","5z0p","six","Ty0u","seven","nw52","eight","3430","nine","D559","ten","vldy","lastTime",parse("2020-03-16 23:28:18"),"one","X9kF","zero","8KAD","remark","bEtW","formId","azBG","userid","wjcO","eleven","aGRH","twelve","5S7P","thirteen","6Im3","fourteen","OX1d","fifteen","y9jw","attachmentUrls","kK3U","attachmentNames","7JG6","branchId","Ts6V","bizKey","LZCB","deptid","Agyl","flowState","8","createTime",parse("2020-03-16 23:28:18"),"dqxCode","1AAy","cuserid","","tagIds","TFET","tagNames","J45r","cusername","2jpI","deptName","1Ir5");
- FormData formData3=BaseUtils.fromMap(p3,FormData.class);
- batchValues.add(formData3);
- Map p4=BaseUtils.map("id","0O1H","two","naNb","three","974F","four","SsHa","five","nvZc","six","i7wB","seven","BKSv","eight","3emj","nine","vxo8","ten","F7Z2","lastTime",parse("2020-03-16 23:28:18"),"one","k5ZW","zero","4qS6","remark","PFM4","formId","oNB1","userid","dtpB","eleven","j30R","twelve","F82L","thirteen","733o","fourteen","67RN","fifteen","qons","attachmentUrls","0jnD","attachmentNames","urRJ","branchId","lRgv","bizKey","65XJ","deptid","BsCI","flowState","8","createTime",parse("2020-03-16 23:28:18"),"dqxCode","pnmA","cuserid","","tagIds","sP97","tagNames","8d2v","cusername","Qnd1","deptName","8zao");
- FormData formData4=BaseUtils.fromMap(p4,FormData.class);
- batchValues.add(formData4);
- Map p5=BaseUtils.map("id","MrL5","two","vcC4","three","szst","four","455j","five","XdtI","six","mR6Q","seven","HcRN","eight","oJhW","nine","kydj","ten","l40j","lastTime",parse("2020-03-16 23:28:18"),"one","btU0","zero","38c8","remark","3Qqg","formId","0TJ5","userid","uUP0","eleven","Si0i","twelve","nHUo","thirteen","QFXm","fourteen","8ZBa","fifteen","f6w5","attachmentUrls","811U","attachmentNames","Yzdk","branchId","2518","bizKey","39CX","deptid","5g6q","flowState","I","createTime",parse("2020-03-16 23:28:18"),"dqxCode","c9tP","cuserid","","tagIds","3F91","tagNames","iq21","cusername","Qq03","deptName","lnGM");
- FormData formData5=BaseUtils.fromMap(p5,FormData.class);
- batchValues.add(formData5);
- Map p6=BaseUtils.map("id","ZE7M","two","k9tp","three","D9Ur","four","vnJa","five","Y3No","six","CWx4","seven","mQ5w","eight","7BVb","nine","l6HY","ten","ou4J","lastTime",parse("2020-03-16 23:28:18"),"one","ZcMl","zero","uBFa","remark","br58","formId","zZb4","userid","biY8","eleven","k8Pb","twelve","LUAh","thirteen","J6EO","fourteen","N0Dg","fifteen","SwJI","attachmentUrls","Q6Tr","attachmentNames","k59i","branchId","Eo5K","bizKey","5vb7","deptid","u79D","flowState","3","createTime",parse("2020-03-16 23:28:18"),"dqxCode","ZTiF","cuserid","","tagIds","3WaX","tagNames","lS90","cusername","MkKG","deptName","a007");
- FormData formData6=BaseUtils.fromMap(p6,FormData.class);
- batchValues.add(formData6);
- Map p7=BaseUtils.map("id","42U7","two","V2EI","three","eckz","four","aj8c","five","5soT","six","xiGe","seven","YHi2","eight","cPJK","nine","GkfB","ten","G38c","lastTime",parse("2020-03-16 23:28:18"),"one","077d","zero","JHlc","remark","mc9o","formId","HBAq","userid","zjuR","eleven","9t71","twelve","sh7b","thirteen","27h2","fourteen","w61U","fifteen","AFtg","attachmentUrls","iD2H","attachmentNames","8TIl","branchId","91BS","bizKey","H9v8","deptid","Mx71","flowState","r","createTime",parse("2020-03-16 23:28:18"),"dqxCode","wEai","cuserid","","tagIds","bSvu","tagNames","2W2U","cusername","B5V4","deptName","9Q6C");
- FormData formData7=BaseUtils.fromMap(p7,FormData.class);
- batchValues.add(formData7);
- baseDao.batchInsert(batchValues);
- //Assert.assertEquals(1, result[0]);
- }
-
-
- /**
- * 查询一条数据到Map中
- ***/
- @Test
- public void selectOneMap() {
- Map p=BaseUtils.map("id","1N13");
- Map result=this.baseDao.selectOne(FormData.class.getName()+".selectOneMap",p);
- Assert.assertEquals("1N13", result.get("id"));
- }
-
-
- /**
- * 计算满足条件的行数
- ***/
- @Test
- public void countByWhere() {
- Map p=BaseUtils.map("two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- long result=baseDao.countByWhere(formData);
- Assert.assertEquals(true, result>0);
- }
-
-
- /**
- * 分页查询,分页数据由平台自动组装并返回前台,后台不需要手工拼装.
- ***/
- @Test
- public void selectListByPage() {
-
-
-
- Map p=BaseUtils.map("two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- p.put("pageNum","1");
- p.put("pageSize","10");
- PageUtils.startPage(p);
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- List result=baseDao.selectListByWhere(formData);
- if(result instanceof Page) {
- Page page=(Page)result;
- Assert.assertEquals(true, page.getTotal()>=0);
- }
-
- }
-
- /**
- * 分页查询,分页数据由平台自动组装并返回前台,后台不需要手工拼装.
- ***/
- @Test
- public void selectListByWhere() {
-
-
- Map p=BaseUtils.map("two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- FormData formData=BaseUtils.fromMap(p,FormData.class);
- List result=baseDao.selectListByWhere(formData);
- Assert.assertEquals(true, result.size()>=1);
- }
-
-
- /**
- * 查询一批map.不分页.
- ***/
- @Test
- public void selectListMapByWhere() {
- Map p=BaseUtils.map("two","28Z2","three","LaYj","four","G837","five","Y7ed","six","5w9y","seven","7I03","eight","DqjP","nine","kafw","ten","p5t6","lastTime",parse("2020-03-16 23:28:18"),"one","M3gU","zero","dLpD","remark","o4z3","formId","f57i","userid","T3y2","eleven","D8HY","twelve","0XHC","thirteen","2JeD","fourteen","4u09","fifteen","IM91","attachmentUrls","BlFB","attachmentNames","7kil","branchId","enpT","bizKey","T21q","deptid","LgTi","flowState","i","createTime",parse("2020-03-16 23:28:18"),"dqxCode","5OQJ","cuserid","","tagIds","wu1U","tagNames","Qs02","cusername","5RxL","deptName","M2IL");
- List