Commit d7a0d715 authored by 赵啸非's avatar 赵啸非

修改部分生成代码逻辑

parent c478037d
...@@ -68,17 +68,6 @@ export default { ...@@ -68,17 +68,6 @@ export default {
> >
代码构建 代码构建
</el-button> </el-button>
<el-button
type="primary"
icon="el-icon-s-order"
size="mini"
onClick={() => {
this.test(row);
}}
>
测试抓包
</el-button>
</div> </div>
); );
}, },
......
...@@ -94,16 +94,76 @@ ...@@ -94,16 +94,76 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.12.0</version>
</dependency>
<!--
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>5.3.18</version>
<scope>provided</scope>
</dependency>-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>5.2.2</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<resources> <resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
<filtering>true</filtering> <filtering>true</filtering>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
<include>**/*.json</include>
<include>**/*.yml</include>
<include>**/*.js</include>
<include>**/*.html</include>
<include>**/*.css</include>
<include>**/*.svg</include>
<include>**/*.jpg</include>
<include>**/*.jpeg</include>
<include>**/*.png</include>
<include>**/*.ico</include>
<include>**/*.woff2</include>
<include>**/*.txt</include>
<include>**/*.xlsx</include>
<include>**/*.xls</include>
</includes>
<excludes>
<exclude>env/*.properties</exclude>
</excludes>
</resource> </resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.docx</include>
<include>**/*.ftl</include>
</includes>
</resource>
</resources> </resources>
<plugins> <plugins>
......
...@@ -634,18 +634,18 @@ public class GentableColumnEntity extends GentableColumnEntityExt { ...@@ -634,18 +634,18 @@ public class GentableColumnEntity extends GentableColumnEntityExt {
public void initAttrValue() { public void initAttrValue() {
this.tableId = null; this.tableId = null;
this.columnName = null; this.columnName = "1231";
this.columnComment = null; this.columnComment = "1313131";
this.columnType = null; this.columnType = null;
this.javaType = null; this.javaType = null;
this.javaField = null; this.javaField = null;
this.isPrimaryKey = null; this.isPrimaryKey = 0;
this.isIncrement = null; this.isIncrement = 0;
this.isRequired = null; this.isRequired = 0;
this.isInsert = null; this.isInsert = 0;
this.isEdit = null; this.isEdit = 0;
this.isList = null; this.isList = 0;
this.isQuery = null; this.isQuery = 0;
this.htmlType = null; this.htmlType = null;
this.defaultValue = null; this.defaultValue = null;
this.sort = null; this.sort = null;
......
...@@ -306,6 +306,32 @@ public class UserEntity extends UserEntityExt implements IUser { ...@@ -306,6 +306,32 @@ public class UserEntity extends UserEntityExt implements IUser {
public Integer getUserType() { public Integer getUserType() {
return this.userType; return this.userType;
} }
@Override
public String getToken() {
return null;
}
@Override
public Long getLoginTime() {
return null;
}
@Override
public Long getExpireTime() {
return null;
}
@Override
public void setExpireTime(Long expireTime) {
}
@Override
public String getMenuUrl() {
return null;
}
/** /**
* 设置 用户类型,0:系统用户 1:普通用户 2:工作人员,默认2 * 设置 用户类型,0:系统用户 1:普通用户 2:工作人员,默认2
* @param userType * @param userType
......
...@@ -113,7 +113,8 @@ public class FreeMarkerUtils { ...@@ -113,7 +113,8 @@ public class FreeMarkerUtils {
templates.add("entityQuery.java.ftl"); templates.add("entityQuery.java.ftl");
templates.add("dao.java.ftl"); templates.add("dao.java.ftl");
templates.add("daoImpl.java.ftl"); templates.add("daoImpl.java.ftl");
templates.add("web.java.ftl"); // templates.add("web.java.ftl");
templates.add("webBody.java.ftl");
templates.add("webForm.java.ftl"); templates.add("webForm.java.ftl");
templates.add("sqlMap.xml.ftl"); templates.add("sqlMap.xml.ftl");
templates.add("db.sql.ftl"); templates.add("db.sql.ftl");
...@@ -128,7 +129,7 @@ public class FreeMarkerUtils { ...@@ -128,7 +129,7 @@ public class FreeMarkerUtils {
templates.add("serviceImpl.java.ftl"); templates.add("serviceImpl.java.ftl");
templates.add("webVueList.vue.ftl"); templates.add("webVueList.vue.ftl");
templates.add("VueDialogShow.vue.ftl"); templates.add("VueDialogShow.vue.ftl");
templates.add("webVueShow.vue.ftl"); // templates.add("webVueShow.vue.ftl");
} else if (GenConstants.TPL_TREE.equals(tplCategory)) { } else if (GenConstants.TPL_TREE.equals(tplCategory)) {
templates.add("entity-tree.java.ftl"); templates.add("entity-tree.java.ftl");
templates.add("service-tree.java.ftl"); templates.add("service-tree.java.ftl");
...@@ -139,10 +140,10 @@ public class FreeMarkerUtils { ...@@ -139,10 +140,10 @@ public class FreeMarkerUtils {
templates.add("service.java.ftl"); templates.add("service.java.ftl");
templates.add("serviceImpl.java.ftl"); templates.add("serviceImpl.java.ftl");
templates.add("webVueList.vue.ftl"); templates.add("webVueList.vue.ftl");
templates.add("webVueShow.vue.ftl"); //templates.add("webVueShow.vue.ftl");
templates.add("VueDialogShow.vue.ftl"); templates.add("VueDialogShow.vue.ftl");
} }
templates.add("webVueView.vue.ftl"); //templates.add("webVueView.vue.ftl");
return templates; return templates;
} }
...@@ -444,9 +445,14 @@ public class FreeMarkerUtils { ...@@ -444,9 +445,14 @@ public class FreeMarkerUtils {
fileName = StringUtils.format("{}/{}/service/impl/{}ServiceImpl.java", javaPath, businessName, className); fileName = StringUtils.format("{}/{}/service/impl/{}ServiceImpl.java", javaPath, businessName, className);
} else if (template.contains("serviceImpl-tree.java.ftl")) { } else if (template.contains("serviceImpl-tree.java.ftl")) {
fileName = StringUtils.format("{}/{}/service/impl/{}ServiceImpl.java", javaPath, businessName, className); fileName = StringUtils.format("{}/{}/service/impl/{}ServiceImpl.java", javaPath, businessName, className);
} else if (template.contains("web.java.ftl")) { }
// else if (template.contains("web.java.ftl")) {
// fileName = StringUtils.format("{}/{}/web/{}Controller.java", javaPath, businessName, className);
// }
else if (template.contains("webBody.java.ftl")) {
fileName = StringUtils.format("{}/{}/web/{}Controller.java", javaPath, businessName, className); fileName = StringUtils.format("{}/{}/web/{}Controller.java", javaPath, businessName, className);
} else if (template.contains("webForm.java.ftl")) { }
else if (template.contains("webForm.java.ftl")) {
fileName = StringUtils.format("{}/{}/web/{}Form.java", javaPath, businessName, className); fileName = StringUtils.format("{}/{}/web/{}Form.java", javaPath, businessName, className);
} else if (template.contains("sqlMap.xml.ftl")) { } else if (template.contains("sqlMap.xml.ftl")) {
fileName = StringUtils.format("{}/{}/{}Mapper.xml", mybatisPath, businessName, className); fileName = StringUtils.format("{}/{}/{}Mapper.xml", mybatisPath, businessName, className);
...@@ -454,15 +460,19 @@ public class FreeMarkerUtils { ...@@ -454,15 +460,19 @@ public class FreeMarkerUtils {
String businessNameExt = getBusinessNameExt(genTable.getTableName()); String businessNameExt = getBusinessNameExt(genTable.getTableName());
businessNameExt = StringUtils.replace(businessNameExt, ".", "/"); businessNameExt = StringUtils.replace(businessNameExt, ".", "/");
fileName = StringUtils.format("{}/views/{}/list.vue", vuePath, businessNameExt); fileName = StringUtils.format("{}/views/{}/list.vue", vuePath, businessNameExt);
} else if (template.contains("webVueShow.vue.ftl")) { }
/* else if (template.contains("webVueShow.vue.ftl")) {
String businessNameExt = getBusinessNameExt(genTable.getTableName()); String businessNameExt = getBusinessNameExt(genTable.getTableName());
businessNameExt = StringUtils.replace(businessNameExt, ".", "/"); businessNameExt = StringUtils.replace(businessNameExt, ".", "/");
fileName = StringUtils.format("{}/views/{}/show.vue", vuePath, businessNameExt); fileName = StringUtils.format("{}/views/{}/show.vue", vuePath, businessNameExt);
} else if (template.contains("webVueView.vue.ftl")) { }
else if (template.contains("webVueView.vue.ftl")) {
String businessNameExt = getBusinessNameExt(genTable.getTableName()); String businessNameExt = getBusinessNameExt(genTable.getTableName());
businessNameExt = StringUtils.replace(businessNameExt, ".", "/"); businessNameExt = StringUtils.replace(businessNameExt, ".", "/");
fileName = StringUtils.format("{}/views/{}/view.vue", vuePath, businessNameExt); fileName = StringUtils.format("{}/views/{}/view.vue", vuePath, businessNameExt);
} else if (template.contains("webVueTreeList.vue.ftl")) { }*/
else if (template.contains("webVueTreeList.vue.ftl")) {
String businessNameExt = getBusinessNameExt(genTable.getTableName()); String businessNameExt = getBusinessNameExt(genTable.getTableName());
businessNameExt = StringUtils.replace(businessNameExt, ".", "/"); businessNameExt = StringUtils.replace(businessNameExt, ".", "/");
fileName = StringUtils.format("{}/views/{}/list.vue", vuePath, businessNameExt); fileName = StringUtils.format("{}/views/{}/list.vue", vuePath, businessNameExt);
......
...@@ -4,6 +4,8 @@ import cn.hutool.core.io.FileUtil; ...@@ -4,6 +4,8 @@ import cn.hutool.core.io.FileUtil;
import com.mortals.xhx.base.system.gentable.model.GentableColumnEntity; import com.mortals.xhx.base.system.gentable.model.GentableColumnEntity;
import com.mortals.xhx.base.system.gentable.model.GentableEntity; import com.mortals.xhx.base.system.gentable.model.GentableEntity;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.usermodel.*;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFTable; import org.apache.poi.xwpf.usermodel.XWPFTable;
...@@ -79,7 +81,7 @@ public class ReadDoc { ...@@ -79,7 +81,7 @@ public class ReadDoc {
} }
docTable.setTableName(tableName.trim()); docTable.setTableName(tableName.trim());
docTable.setTableComment(split[0].replace(",表名","").trim()); docTable.setTableComment(split[0].replace(",表名", "").trim());
// System.out.println("这是第" + num + "个表的数据"); // System.out.println("这是第" + num + "个表的数据");
List<XWPFTableRow> rows = table.getRows(); List<XWPFTableRow> rows = table.getRows();
//读取每一行数据,每一行为一列 //读取每一行数据,每一行为一列
...@@ -118,9 +120,9 @@ public class ReadDoc { ...@@ -118,9 +120,9 @@ public class ReadDoc {
column.setIsQuery("是".equals(cell.getText().trim()) ? 1 : 0); column.setIsQuery("是".equals(cell.getText().trim()) ? 1 : 0);
//默认值 //默认值
cell = cells.get(9); cell = cells.get(9);
if(!ObjectUtils.isEmpty(cell.getText().trim())){ if (!ObjectUtils.isEmpty(cell.getText().trim())) {
column.setDefaultValue(cell.getText().trim()); column.setDefaultValue(cell.getText().trim());
}else{ } else {
column.setDefaultValue(""); column.setDefaultValue("");
} }
//备注信息 //备注信息
...@@ -135,64 +137,105 @@ public class ReadDoc { ...@@ -135,64 +137,105 @@ public class ReadDoc {
} }
} else { } else {
// 处理doc格式 即office2003版本 // 处理doc格式 即office2003版本
// POIFSFileSystem pfs = new POIFSFileSystem(file.getInputStream()); POIFSFileSystem pfs = new POIFSFileSystem(file.getInputStream());
//
// HWPFDocument hwpf = new HWPFDocument(pfs); HWPFDocument hwpf = new HWPFDocument(pfs);
// Range range = hwpf.getRange();//得到文档的读取范围 Range range = hwpf.getRange();//得到文档的读取范围
// TableIterator it = new TableIterator(range); TableIterator it = new TableIterator(range);
// while (it.hasNext()) { while (it.hasNext()) {
// List<DocTableModel> docTableModels = new ArrayList<DocTableModel>(); List<GentableColumnEntity> columns = new ArrayList<GentableColumnEntity>();
//
// Table tb = it.next(); Table table = it.next();
// // XWPFTable table = (XWPFTable) next;
// DocTable docTable = new DocTable(); GentableEntity docTable = new GentableEntity();
// TableRow firstRow = table.getRow(0);
// TableRow firstRow = tb.getRow(0); TableCell firstTdCell = firstRow.getCell(0);
// String firstStr = firstTdCell.text();
// TableCell firstTdCell = firstRow.getCell(0); String[] split = firstStr.split(":");
// if (split.length < 2) {
// Paragraph firstTdCellParagraph = firstTdCell.getParagraph(0); continue;
// String firstStr = firstTdCellParagraph.text(); }
// //去除后面的特殊符号
// if (null != firstStr && !"".equals(firstStr)) { String tableName = split[1];
// firstStr = firstStr.substring(0, firstStr.length() - 1); String[] vals = tableName.split("_");
// }
// String[] split = firstStr.split(":"); if (tableName.indexOf("yyyymmdd") != -1) {
// docTable.setDataTableName(split[1]); docTable.setDividedTableType(3);
// } else if (tableName.indexOf("yyyymm") != -1) {
// //System.out.println("这是第" + num + "个表的数据"); docTable.setDividedTableType(2);
// //迭代行,默认从0开始,可以依据需要设置i的值,改变起始行数,也可设置读取到那行,只需修改循环的判断条件即可 } else if (tableName.indexOf("yyyy") != -1) {
// for (int i = 1; i < tb.numRows(); i++) { docTable.setDividedTableType(1);
// DocTableModel docTableModel = new DocTableModel(); } else {
// TableRow tr = tb.getRow(i); docTable.setDividedTableType(0);
// }
// if("".equals(tr.getCell(0).text().trim())){
if (vals[vals.length - 1].startsWith("yyyy")) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < vals.length - 1; i++) {
sb.append(vals[i]);
if (i < vals.length - 2) {
sb.append("_");
}
}
tableName = sb.toString();
}
docTable.setTableName(tableName.trim());
docTable.setTableComment(split[0].replace(",表名", "").trim());
// System.out.println("这是第" + num + "个表的数据");
int rows = table.numRows();
//读取每一行数据,每一行为一列
for (int i = 2; i < rows; i++) {
GentableColumnEntity column = new GentableColumnEntity();
TableRow row = table.getRow(i);
//判断是否第一个列数据为空 如果为空 跳过
// if ("".equals(row.getCell(0).getText().trim())) {
// continue; // continue;
// } // }
// //迭代列,默认从0开始 //读取每一列数据
// for (int j = 0; j < tr.numCells(); j++) { // List<TableCell> cells = row.getCell();
// TableCell td = tr.getCell(j);//取得单元格 //列名
// //获取需要设置的属性名称 TableCell cell = row.getCell(1);
// String att = vars[j]; column.setColumnName(cell.text().trim());
// //数据类型
// //取得单元格的内容 cell = row.getCell(2);
// for (int k = 0; k < td.numParagraphs(); k++) { column.setColumnType(cell.text().trim());
// Paragraph para = td.getParagraph(k); //是否必填
// String s = para.text(); cell = row.getCell(3);
// //去除后面的特殊符号 column.setIsRequired("是".equals(cell.text().trim()) ? 1 : 0);
// if (null != s && !"".equals(s)) { //是否主键
// s = s.substring(0, s.length() - 1); cell = row.getCell(4);
// } column.setIsPrimaryKey("是".equals(cell.text().trim()) ? 1 : 0);
// //是否自增
// setFieldValueByFieldName(att, docTableModel, s); cell = row.getCell(5);
// } column.setIsIncrement("是".equals(cell.text().trim()) ? 1 : 0);
// } //是否列表
// cell = row.getCell(6);
// docTableModels.add(docTableModel); column.setIsList("是".equals(cell.text().trim()) ? 1 : 0);
// } //是否导入导出
// docTable.setModelList(docTableModels); cell = row.getCell(7);
// docTables.add(docTable); column.setIsExport("是".equals(cell.text().trim()) ? 1 : 0);
// } //是否查询
cell = row.getCell(8);
column.setIsQuery("是".equals(cell.text().trim()) ? 1 : 0);
//默认值
cell = row.getCell(9);
if (!ObjectUtils.isEmpty(cell.text().trim())) {
column.setDefaultValue(cell.text().trim());
} else {
column.setDefaultValue("");
}
//备注信息
cell = row.getCell(10);
column.setColumnComment(cell.text().trim());
columns.add(column);
}
docTable.setColumns(columns);
docTables.add(docTable);
}
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
where table_schema = (select database()) where table_schema = (select database())
AND table_name NOT LIKE 'act_%' AND table_name NOT LIKE 'act_%'
<!--过滤初始系统表--> <!--过滤初始系统表-->
AND table_name NOT IN ( <!-- AND table_name NOT IN (
'mortals_xhx_gentable', 'mortals_xhx_gentable',
'mortals_xhx_gentable_column', 'mortals_xhx_gentable_column',
'mortals_xhx_idgenerator', 'mortals_xhx_idgenerator',
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
'mortals_xhx_user', 'mortals_xhx_user',
'mortals_xhx_valid_code', 'mortals_xhx_valid_code',
'mortals_xhx_area' 'mortals_xhx_area'
) )-->
<!-- AND table_name NOT LIKE 'mortals_xhx_gen%'--> <!-- AND table_name NOT LIKE 'mortals_xhx_gen%'-->
AND table_name NOT IN (select tableName from mortals_xhx_gentable AND table_name NOT IN (select tableName from mortals_xhx_gentable
......
...@@ -16,16 +16,19 @@ ...@@ -16,16 +16,19 @@
参数名称|类型|备注|必填|其它 参数名称|类型|备注|必填|其它
---|---|---|---|--- ---|---|---|---|---
page|Integer|当前页|否|- page|Integer|当前页|否|-
size|Integer|每页条数|否|- size|Integer|每页条数|否|值为-1,查询所有记录
<#list columns as column> <#list columns as column>
<#if column.isQuery == 1> <#if column.isQuery == 1>
<#if column.javaType=="String" >
${column.javaField}|${column.javaType}|${column.columnComment}|否|字段前后添加%%模糊查询
<#else>
${column.javaField}|${column.javaType}|${column.columnComment}|否|- ${column.javaField}|${column.javaType}|${column.columnComment}|否|-
</#if> </#if>
</#if>
</#list> </#list>
**请求样例:** **请求样例:**
``` ```
{ {
<#list columns as column> <#list columns as column>
<#if column.isQuery == 1> <#if column.isQuery == 1>
...@@ -70,15 +73,6 @@ dict|object|字典对象|- ...@@ -70,15 +73,6 @@ dict|object|字典对象|-
{ {
"code":1, "code":1,
"data":{ "data":{
"per_page":10,
"total":0,
"data":[],
"last_page":0,
"current_page":1
},
"query":{
"modelCode":"phxt1",
"modelName":"排号系统"
} }
} }
``` ```
...@@ -101,9 +95,7 @@ ${pkColumn.javaField}|${pkColumn.javaType}|主键,唯一|是|- ...@@ -101,9 +95,7 @@ ${pkColumn.javaField}|${pkColumn.javaType}|主键,唯一|是|-
**请求样例:** **请求样例:**
``` ```
http://localhost/${RequestMapping}/edit?id=549 http://localhost/${RequestMapping}/edit?id=549
``` ```
**响应参数:** **响应参数:**
...@@ -125,7 +117,6 @@ dict|object|字典对象|- ...@@ -125,7 +117,6 @@ dict|object|字典对象|-
**响应消息样例:** **响应消息样例:**
``` ```
{ {
"code": 1, "code": 1,
"data": { "data": {
...@@ -139,7 +130,6 @@ dict|object|字典对象|- ...@@ -139,7 +130,6 @@ dict|object|字典对象|-
</#list> </#list>
} }
} }
``` ```
### 查看${functionName} ### 查看${functionName}
...@@ -160,9 +150,7 @@ ${pkColumn.javaField}|${pkColumn.javaType}|主键,唯一|是|- ...@@ -160,9 +150,7 @@ ${pkColumn.javaField}|${pkColumn.javaType}|主键,唯一|是|-
**请求样例:** **请求样例:**
``` ```
http://localhost/${RequestMapping}/info?id=549 http://localhost/${RequestMapping}/info?id=549
``` ```
**响应参数:** **响应参数:**
...@@ -205,7 +193,6 @@ dict|object|字典对象|- ...@@ -205,7 +193,6 @@ dict|object|字典对象|-
**请求方式:** POST **请求方式:** POST
**内容类型:** application/json;charset=utf-8 **内容类型:** application/json;charset=utf-8
**简要描述:** 保存或更新${functionName}:id为空时为新增保存,否则为更新提交 **简要描述:** 保存或更新${functionName}:id为空时为新增保存,否则为更新提交
...@@ -222,7 +209,6 @@ ${column.javaField}|${column.javaType}|${column.columnComment}|是|- ...@@ -222,7 +209,6 @@ ${column.javaField}|${column.javaType}|${column.columnComment}|是|-
**请求样例:** **请求样例:**
``` ```
{ {
<#list columns as column> <#list columns as column>
<#if !column.isSuperColumn(column.javaField)> <#if !column.isSuperColumn(column.javaField)>
...@@ -252,19 +238,10 @@ data|object|数据对象|- ...@@ -252,19 +238,10 @@ data|object|数据对象|-
**响应消息样例:** **响应消息样例:**
``` ```
{ {
"msg":"新增模块成功", "msg":"新增模块成功",
"code":1, "code":1,
"data":{ "data":{
"__mortals_form_state__":"ADD",
"id":4,
"entity":{
"createTime":1642486776780,
"id":4,
"modelCode":"phxt1",
"modelName":"排号系统4",
"updateTime":1642486776780
} }
} }
} }
...@@ -276,7 +253,7 @@ data|object|数据对象|- ...@@ -276,7 +253,7 @@ data|object|数据对象|-
**请求URL:** ${RequestMapping}/delete **请求URL:** ${RequestMapping}/delete
**请求方式:** POST **请求方式:** GET
**内容类型:** application/json;charset=utf-8 **内容类型:** application/json;charset=utf-8
...@@ -290,9 +267,7 @@ id|String|字符串,多个逗号分隔|是|- ...@@ -290,9 +267,7 @@ id|String|字符串,多个逗号分隔|是|-
**请求样例:** **请求样例:**
``` ```
http://localhost:8080/${RequestMapping}/delete?id=1' http://localhost:8080/${RequestMapping}/delete?id=1'
``` ```
**响应参数:** **响应参数:**
......
###${functionName}列表 ###${functionName}列表
POST {{baseUrl}}/${RequestMapping}/list POST {{baseUrl}}/${RequestMapping}/list
Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
...@@ -21,6 +22,7 @@ Content-Type: application/json ...@@ -21,6 +22,7 @@ Content-Type: application/json
###${functionName}更新与保存 ###${functionName}更新与保存
POST {{baseUrl}}/${RequestMapping}/save POST {{baseUrl}}/${RequestMapping}/save
Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
...@@ -42,15 +44,18 @@ client.global.set("${ClassName}_id", JSON.parse(response.body).data.id); ...@@ -42,15 +44,18 @@ client.global.set("${ClassName}_id", JSON.parse(response.body).data.id);
###${functionName}查看 ###${functionName}查看
GET {{baseUrl}}/${RequestMapping}/info?id={{${ClassName}_id}} GET {{baseUrl}}/${RequestMapping}/info?id={{${ClassName}_id}}
Authorization: {{authToken}}
Accept: application/json Accept: application/json
###${functionName}编辑 ###${functionName}编辑
GET {{baseUrl}}/${RequestMapping}/edit?id={{${ClassName}_id}} GET {{baseUrl}}/${RequestMapping}/edit?id={{${ClassName}_id}}
Authorization: {{authToken}}
Accept: application/json Accept: application/json
###${functionName}删除 ###${functionName}删除
GET {{baseUrl}}/${RequestMapping}/delete?id={{${ClassName}_id}} GET {{baseUrl}}/${RequestMapping}/delete?id={{${ClassName}_id}}
Authorization: {{authToken}}
Accept: application/json Accept: application/json
......
...@@ -151,7 +151,7 @@ public class ${ClassName}ServiceImpl extends ${Service}<${ClassName}Dao, ${Class ...@@ -151,7 +151,7 @@ public class ${ClassName}ServiceImpl extends ${Service}<${ClassName}Dao, ${Class
for (Iterator<${ClassName}Entity> iterator = list.iterator(); iterator.hasNext(); ) { for (Iterator<${ClassName}Entity> iterator = list.iterator(); iterator.hasNext(); ) {
${ClassName}Entity ${ClassName?uncap_first}Entity = iterator.next(); ${ClassName}Entity ${ClassName?uncap_first}Entity = iterator.next();
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(${ClassName?uncap_first}Entity.get${treeParentCode?cap_first}())) { if (!tempList.contains(${ClassName?uncap_first}Entity.get${treeParentCode?cap_first}())) {
recursionFn(list, ${ClassName?uncap_first}Entity); recursionFn(list, ${ClassName?uncap_first}Entity);
returnList.add(${ClassName?uncap_first}Entity); returnList.add(${ClassName?uncap_first}Entity);
......
...@@ -5,11 +5,11 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -5,11 +5,11 @@ import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
<#assign Controller = "BaseCRUDJsonController"> <#assign Controller = "BaseCRUDJsonController">
<#elseif table.isShowControl==2 > <#elseif table.isShowControl==2 >
<#assign Controller = "BaseCRUDJsonPhpController"> <#assign Controller = "BaseCRUDJsonBodyMappingController">
<#else> <#else>
<#assign Controller = "BaseCRUDJsonMappingController"> <#assign Controller = "BaseCRUDJsonMappingController">
</#if> </#if>
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.mortals</groupId> <groupId>com.mortals</groupId>
<artifactId>mortals-common</artifactId> <artifactId>mortals-common</artifactId>
<version>1.1.4-SNAPSHOT</version> <version>1.1.5-SNAPSHOT</version>
</parent> </parent>
<groupId>com.mortals.xhx</groupId> <groupId>com.mortals.xhx</groupId>
<artifactId>appbuild-platform</artifactId> <artifactId>appbuild-platform</artifactId>
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
</dependencies> </dependencies>
<build> <build>
<!--
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
...@@ -124,6 +125,7 @@ ...@@ -124,6 +125,7 @@
<filtering>true</filtering> <filtering>true</filtering>
</resource> </resource>
</resources> </resources>
-->
<plugins> <plugins>
<plugin> <plugin>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment