master
wangbing 4 years ago
parent 0b12132ae4
commit b9b9e2e0ef

@ -2,6 +2,7 @@ package ${domain}.action.ajax.${moduleName};
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import ${domain}.frame.base.Error;
import ${domain}.frame.excel.WExcel; import ${domain}.frame.excel.WExcel;
import ${domain}.frame.utils.LogUtil; import ${domain}.frame.utils.LogUtil;
import ${domain}.frame.auth.LocalData; import ${domain}.frame.auth.LocalData;
@ -131,7 +132,16 @@ public class ${table.getCName()}Ajax{
@Override @Override
public List<String> exec(${table.getCName()} o, int index) { public List<String> exec(${table.getCName()} o, int index) {
${table.getCName()}CreateRequest request = MapperUtil.map(o, ${table.getCName()}CreateRequest.class); ${table.getCName()}CreateRequest request = MapperUtil.map(o, ${table.getCName()}CreateRequest.class);
return ValidationUtil.validate(request); List<String> validate = ValidationUtil.validate(request);
if (validate == null || validate.size() == 0) {
${table.getCName()}CreateResponse ${table.getFName()}CreateResponse = ${table.getFName()}Manager.create(request, LocalData.getToken());
if (${table.getFName()}CreateResponse.hasError()) {
for (Error error : ${table.getFName()}CreateResponse.getErrors()) {
validate.add(error.getMessage());
}
}
}
return validate;
} }
}); });

@ -3,7 +3,7 @@ package ${domain}.module.${moduleName}.ent;
<#if table.has('Date')> <#if table.has('Date')>
import java.util.Date; import java.util.Date;
</#if> </#if>
<#if table.getHtml()> <#if table.isPage()>
import ${domain}.frame.excel.annotation.ExcelNote; import ${domain}.frame.excel.annotation.ExcelNote;
import ${domain}.frame.excel.annotation.ExcelSelect; import ${domain}.frame.excel.annotation.ExcelSelect;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
@ -18,7 +18,7 @@ import ${domain}.frame.base.BaseEntity;
* @version 0.0.1 * @version 0.0.1
* @since ${.now?string["yyyy-MM-dd"]} * @since ${.now?string["yyyy-MM-dd"]}
*/ */
<#if table.getHtml()> <#if table.isPage()>
@ExcelSheet("${table.tableComment?default("")}") @ExcelSheet("${table.tableComment?default("")}")
</#if> </#if>
public class ${table.getCName()} extends BaseEntity { public class ${table.getCName()} extends BaseEntity {
@ -28,7 +28,7 @@ public class ${table.getCName()} extends BaseEntity {
/** /**
* ${field.fieldName} - ${field.fieldComment?default("")} * ${field.fieldName} - ${field.fieldComment?default("")}
*/ */
<#if table.getHtml()> <#if table.isPage()>
@ExcelProperty("${field.fieldComment?default("")}") @ExcelProperty("${field.fieldComment?default("")}")
@ExcelNote("") @ExcelNote("")
<#if field.getFieldTypeJava()=="Boolean"> <#if field.getFieldTypeJava()=="Boolean">

@ -1,14 +1,12 @@
package ${domain}.module.wsys.mgr; package ${domain}.module.wsys.mgr;
import ${domain}.frame.auth.Token;
import ${domain}.module.wsys.req.LogtaskCreateRequest; import ${domain}.module.wsys.req.LogtaskCreateRequest;
import ${domain}.module.wsys.req.LogtaskDeleteRequest; import ${domain}.module.wsys.req.LogtaskDeleteRequest;
import ${domain}.module.wsys.req.LogtaskFindRequest; import ${domain}.module.wsys.req.LogtaskFindRequest;
import ${domain}.module.wsys.req.LogtaskUpdateRequest;
import ${domain}.module.wsys.rsp.LogtaskCreateResponse; import ${domain}.module.wsys.rsp.LogtaskCreateResponse;
import ${domain}.module.wsys.rsp.LogtaskDeleteResponse; import ${domain}.module.wsys.rsp.LogtaskDeleteResponse;
import ${domain}.module.wsys.rsp.LogtaskFindResponse; import ${domain}.module.wsys.rsp.LogtaskFindResponse;
import ${domain}.module.wsys.rsp.LogtaskUpdateResponse;
import ${domain}.frame.auth.Token;
/** /**
* *

@ -1,27 +1,25 @@
package ${domain}.module.wsys.mgr; package ${domain}.module.wsys.mgr;
import ${domain}.frame.utils.IDgenerator; import com.github.pagehelper.PageHelper;
import ${domain}.frame.utils.Message; import com.github.pagehelper.PageInfo;
import ${domain}.frame.base.ErrorType; import com.github.pagehelper.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import ${domain}.frame.auth.Token; import ${domain}.frame.auth.Token;
import ${domain}.frame.base.ErrorType;
import ${domain}.frame.utils.IDgenerator;
import ${domain}.frame.utils.MapperUtil; import ${domain}.frame.utils.MapperUtil;
import ${domain}.frame.utils.Message;
import ${domain}.frame.utils.ValidationUtil; import ${domain}.frame.utils.ValidationUtil;
import ${domain}.module.wsys.ent.Logtask; import ${domain}.module.wsys.ent.Logtask;
import ${domain}.module.wsys.mpr.LogtaskMapper; import ${domain}.module.wsys.mpr.LogtaskMapper;
import ${domain}.module.wsys.req.LogtaskCreateRequest; import ${domain}.module.wsys.req.LogtaskCreateRequest;
import ${domain}.module.wsys.req.LogtaskDeleteRequest; import ${domain}.module.wsys.req.LogtaskDeleteRequest;
import ${domain}.module.wsys.req.LogtaskFindRequest; import ${domain}.module.wsys.req.LogtaskFindRequest;
import ${domain}.module.wsys.req.LogtaskUpdateRequest;
import ${domain}.module.wsys.rsp.LogtaskCreateResponse; import ${domain}.module.wsys.rsp.LogtaskCreateResponse;
import ${domain}.module.wsys.rsp.LogtaskDeleteResponse; import ${domain}.module.wsys.rsp.LogtaskDeleteResponse;
import ${domain}.module.wsys.rsp.LogtaskFindResponse; import ${domain}.module.wsys.rsp.LogtaskFindResponse;
import ${domain}.module.wsys.rsp.LogtaskUpdateResponse;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** /**
* LOGTASK - * LOGTASK -

@ -20,6 +20,9 @@
onUploadProgress: function (progressEvent) { onUploadProgress: function (progressEvent) {
var complete = (progressEvent.loaded / progressEvent.total * 100 | 0) + '%' var complete = (progressEvent.loaded / progressEvent.total * 100 | 0) + '%'
nav.tipShow("上传中(" + complete + ")") nav.tipShow("上传中(" + complete + ")")
if (complete === '100%') {
nav.tipShow("处理中,请稍等..")
}
}, },
}); });
var importService = axios.create({ var importService = axios.create({
@ -31,6 +34,9 @@
onUploadProgress: function (progressEvent) { onUploadProgress: function (progressEvent) {
var complete = (progressEvent.loaded / progressEvent.total * 100 | 0) + '%' var complete = (progressEvent.loaded / progressEvent.total * 100 | 0) + '%'
nav.tipShow("上传中(" + complete + ")") nav.tipShow("上传中(" + complete + ")")
if (complete === '100%') {
nav.tipShow("处理中,请稍等..")
}
}, },
}); });
function handleError(status) { function handleError(status) {

@ -112,8 +112,8 @@
日志框架 日志框架
</li> </li>
<li> <li>
<el-tag>poi-ooxml v3.8</el-tag> <el-tag>easyexcel 2.2.6</el-tag>
Excel处理框架导入导出数据 EasyExcel是一个基于Java的简单、省内存的读写Excel的开源项目。在尽可能节约内存的情况下支持读写百M的Excel。
</li> </li>
<li> <li>
<el-tag>jQuery v3.2.1</el-tag> <el-tag>jQuery v3.2.1</el-tag>

@ -93,7 +93,7 @@
<span slot="title">${module.note}</span> <span slot="title">${module.note}</span>
</template> </template>
<#list module.tables as table> <#list module.tables as table>
<#if table.getHtml()> <#if table.isPage()>
${print('<#if token.hasRes("${module.name?upper_case}_${table.tableName?upper_case}")>')} ${print('<#if token.hasRes("${module.name?upper_case}_${table.tableName?upper_case}")>')}
<el-menu-item index="${uuid()}" @click="addTab({title: '${table.tableComment}', name: '${table.tableName}', url: '${r"${context}"}/${module.name}/${table.getFName()}.htm'})">${table.tableComment}</el-menu-item> <el-menu-item index="${uuid()}" @click="addTab({title: '${table.tableComment}', name: '${table.tableName}', url: '${r"${context}"}/${module.name}/${table.getFName()}.htm'})">${table.tableComment}</el-menu-item>
${print('</#if>')} ${print('</#if>')}

@ -93,31 +93,32 @@
<el-card class="box-card"> <el-card class="box-card">
<el-row> <el-row>
<el-col :span="12"> <#if table.isPageAdd()>
<el-button type="success" size="mini" icon="el-icon-plus" @click="onCreate">新增</el-button> <el-button type="success" size="mini" icon="el-icon-plus" @click="onCreate">新增</el-button>
</#if>
<el-button type="danger" size="mini" icon="el-icon-delete" @click="onBitchDelete">删除</el-button>
<el-button type="warning" size="mini" icon="el-icon-download" @click="onExport">导出</el-button> <el-button-group style="float: right;">
</el-col> <#if table.isPageImp()>
<el-tooltip effect="dark" content="Excel模板下载" placement="bottom">
<el-button size="mini" icon="el-icon-date" @click="onTemplate"></el-button>
</el-tooltip>
<el-col :span="12"> <el-tooltip effect="dark" content="Excel导入" placement="bottom">
<el-button-group style="float: right;"> <el-button size="mini" icon="el-icon-upload2" @click="onImport"></el-button>
<el-tooltip effect="dark" content="Excel模板下载" placement="bottom"> </el-tooltip>
<el-button size="mini" icon="el-icon-date" @click="onTemplate"></el-button> </#if>
</el-tooltip> <#if table.isPageExp()>
<el-tooltip effect="dark" content="Excel导入" placement="bottom"> <el-tooltip effect="dark" content="Excel导出" placement="bottom">
<el-button size="mini" icon="el-icon-upload2" @click="onImport"></el-button> <el-button size="mini" icon="el-icon-download" @click="onExport"></el-button>
</el-tooltip> </el-tooltip>
</#if>
<el-tooltip effect="dark" content="批量删除" placement="bottom"> <el-tooltip effect="dark" content="刷新" placement="bottom">
<el-button size="mini" icon="el-icon-delete" @click="onBitchDelete"></el-button> <el-button size="mini" icon="el-icon-refresh" @click="onFind"></el-button>
</el-tooltip> </el-tooltip>
</el-button-group>
<el-tooltip effect="dark" content="刷新" placement="bottom">
<el-button size="mini" icon="el-icon-refresh" @click="onFind"></el-button>
</el-tooltip>
</el-button-group>
</el-col>
</el-row> </el-row>
<el-table <el-table

@ -243,7 +243,7 @@ public class DataInit {
<#if module.getNeedGenerate()> <#if module.getNeedGenerate()>
forMgr.add(createRes("${index}", "${module.note}菜单", "WEB", "${module.name?upper_case}")); forMgr.add(createRes("${index}", "${module.note}菜单", "WEB", "${module.name?upper_case}"));
<#list module.tables as table> <#list module.tables as table>
<#if table.html> <#if table.isPage()>
forMgr.add(createRes("${index}01", "${table.tableComment}管理菜单", "WEB", "${module.name?upper_case}_${table.tableName?upper_case}")); forMgr.add(createRes("${index}01", "${table.tableComment}管理菜单", "WEB", "${module.name?upper_case}_${table.tableName?upper_case}"));
forMgr.add(createRes("${index}0101", "${table.tableComment}管理页", "WEB", "/${module.name}/${table.getFName()}.htm")); forMgr.add(createRes("${index}0101", "${table.tableComment}管理页", "WEB", "/${module.name}/${table.getFName()}.htm"));
forMgr.add(createRes("${index}010101", "${table.tableComment}模板", "WEB", "/ajax/${module.name}/${table.getFName()}/template")); forMgr.add(createRes("${index}010101", "${table.tableComment}模板", "WEB", "/ajax/${module.name}/${table.getFName()}/template"));

Loading…
Cancel
Save

Powered by TurnKey Linux.