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.web.multipart.MultipartFile;
import ${domain}.frame.base.Error;
import ${domain}.frame.excel.WExcel;
import ${domain}.frame.utils.LogUtil;
import ${domain}.frame.auth.LocalData;
@ -131,7 +132,16 @@ public class ${table.getCName()}Ajax{
@Override
public List<String> exec(${table.getCName()} o, int index) {
${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')>
import java.util.Date;
</#if>
<#if table.getHtml()>
<#if table.isPage()>
import ${domain}.frame.excel.annotation.ExcelNote;
import ${domain}.frame.excel.annotation.ExcelSelect;
import com.alibaba.excel.annotation.ExcelProperty;
@ -18,7 +18,7 @@ import ${domain}.frame.base.BaseEntity;
* @version 0.0.1
* @since ${.now?string["yyyy-MM-dd"]}
*/
<#if table.getHtml()>
<#if table.isPage()>
@ExcelSheet("${table.tableComment?default("")}")
</#if>
public class ${table.getCName()} extends BaseEntity {
@ -28,7 +28,7 @@ public class ${table.getCName()} extends BaseEntity {
/**
* ${field.fieldName} - ${field.fieldComment?default("")}
*/
<#if table.getHtml()>
<#if table.isPage()>
@ExcelProperty("${field.fieldComment?default("")}")
@ExcelNote("")
<#if field.getFieldTypeJava()=="Boolean">

@ -1,14 +1,12 @@
package ${domain}.module.wsys.mgr;
import ${domain}.frame.auth.Token;
import ${domain}.module.wsys.req.LogtaskCreateRequest;
import ${domain}.module.wsys.req.LogtaskDeleteRequest;
import ${domain}.module.wsys.req.LogtaskFindRequest;
import ${domain}.module.wsys.req.LogtaskUpdateRequest;
import ${domain}.module.wsys.rsp.LogtaskCreateResponse;
import ${domain}.module.wsys.rsp.LogtaskDeleteResponse;
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;
import ${domain}.frame.utils.IDgenerator;
import ${domain}.frame.utils.Message;
import ${domain}.frame.base.ErrorType;
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;
import ${domain}.frame.auth.Token;
import ${domain}.frame.base.ErrorType;
import ${domain}.frame.utils.IDgenerator;
import ${domain}.frame.utils.MapperUtil;
import ${domain}.frame.utils.Message;
import ${domain}.frame.utils.ValidationUtil;
import ${domain}.module.wsys.ent.Logtask;
import ${domain}.module.wsys.mpr.LogtaskMapper;
import ${domain}.module.wsys.req.LogtaskCreateRequest;
import ${domain}.module.wsys.req.LogtaskDeleteRequest;
import ${domain}.module.wsys.req.LogtaskFindRequest;
import ${domain}.module.wsys.req.LogtaskUpdateRequest;
import ${domain}.module.wsys.rsp.LogtaskCreateResponse;
import ${domain}.module.wsys.rsp.LogtaskDeleteResponse;
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 -

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

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

@ -93,7 +93,7 @@
<span slot="title">${module.note}</span>
</template>
<#list module.tables as table>
<#if table.getHtml()>
<#if table.isPage()>
${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>
${print('</#if>')}

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

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

Loading…
Cancel
Save

Powered by TurnKey Linux.