Commit 9f6ddcb2 authored by 赵啸非's avatar 赵啸非

编写系统代码生成模块导入导出

parent 84ae12a0
...@@ -8,6 +8,8 @@ import MySwitch from '@/components/Switch'; ...@@ -8,6 +8,8 @@ import MySwitch from '@/components/Switch';
import Confirm from '@/components/Confirm'; import Confirm from '@/components/Confirm';
import FormField from '@/components/FormField'; import FormField from '@/components/FormField';
import Upload from '@/components/Upload'; import Upload from '@/components/Upload';
import ImageUpload from '@/components/ImageUpload';
import FileUpload from '@/components/FileUpload';
const Prototype = function() {}; const Prototype = function() {};
...@@ -21,6 +23,8 @@ Prototype.install = (Vue, options) => { ...@@ -21,6 +23,8 @@ Prototype.install = (Vue, options) => {
Vue.component('MySwitch', MySwitch) // 拨动开关 Vue.component('MySwitch', MySwitch) // 拨动开关
Vue.component('Confirm', Confirm) // 局部确认窗口 Vue.component('Confirm', Confirm) // 局部确认窗口
Vue.component('Upload', Upload) // 文件上传 Vue.component('Upload', Upload) // 文件上传
Vue.component('ImageUpload', ImageUpload) // 图片上传
Vue.component('FileUpload', FileUpload) // 图片上传
} }
export default Prototype; export default Prototype;
...@@ -191,35 +191,26 @@ export const download = (url, formData, config= {}) => { ...@@ -191,35 +191,26 @@ export const download = (url, formData, config= {}) => {
responseType:'blob' responseType:'blob'
}) })
try { try {
console.log("option",option)
const data = await post(url, formData, option) const data = await post(url, formData, option)
const link = document.createElement('a') const link = document.createElement('a')
var blob = new Blob([data], { type: mimeMap.zip }) let blob
// //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名; let extName
// var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*') if(option.type=="zip"){
// var contentDisposition = decodeURI(DataTransferItem.headers['Content-Disposition']) blob = new Blob([data], { type: mimeMap.zip })
// var result = patt.exec(contentDisposition) extName="zip"
// var fileName = result[1] }else if(option.type=="excel"){
// fileName = fileName.replace(/\"/g, '') blob = new Blob([data], { type: mimeMap.xlsx })
extName="xlsx"
}else{
extName="xlsx"
}
link.href = URL.createObjectURL(blob) link.href = URL.createObjectURL(blob)
link.setAttribute('download', `${url.substr(1).replace(/\//g, '_')}_${new Date().getTime()}.zip`) // 设置下载文件名称 link.setAttribute('download', `${url.substr(1).replace(/\//g, '_')}_${new Date().getTime()}.${extName}`) // 设置下载文件名称
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
document.body.appendChild(link) document.body.appendChild(link)
// const data = await post(url, formData, option)
// let downloadUrl = window.URL.createObjectURL(new Blob([data]))
// let link = document.createElement('a')
// link.style.display ='none';
// link.href = downloadUrl;
// link.setAttribute('download', `${url.substr(1).replace(/\//g, '_')}_${new Date().getTime()}.xls`);
// document.body.appendChild(link);
// link.click();
// document.body.removeChild(link);
resolve(); resolve();
} catch (error) { } catch (error) {
reject(error); reject(error);
......
...@@ -36,7 +36,9 @@ const router = new Router({ ...@@ -36,7 +36,9 @@ const router = new Router({
...restBuilder('flowable/definition', 'flowable/definition'), // 流程定义类 ...restBuilder('flowable/definition', 'flowable/definition'), // 流程定义类
...restBuilder('demo', 'demo'), // 测试
...restBuilder('demo/detail', 'demo/detail'), // 测试详细
builder('flowable/task/record/index', 'flowable/task/record/index'),//流程申请 builder('flowable/task/record/index', 'flowable/task/record/index'),//流程申请
...restBuilder('task/process', 'flowable/task/process'), //我的流程 ...restBuilder('task/process', 'flowable/task/process'), //我的流程
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
ref="form" ref="form"
> >
<el-row> <el-row>
<Field label="参数名称" prop="name" v-model="form.name"/> <Field label="参数名称" prop="name" v-model="form.name"/>
<Field label="一级组织" prop="firstOrganize" v-model="form.firstOrganize"/> <Field label="一级组织" prop="firstOrganize" v-model="form.firstOrganize"/>
<Field label="二级组织" prop="secondOrganize" v-model="form.secondOrganize"/> <Field label="二级组织" prop="secondOrganize" v-model="form.secondOrganize"/>
......
...@@ -15,6 +15,10 @@ import java.util.List; ...@@ -15,6 +15,10 @@ import java.util.List;
*/ */
@Repository("gentableColumnDao") @Repository("gentableColumnDao")
public class GentableColumnDaoImpl extends BaseCRUDDaoMybatis<GentableColumnEntity,Long> implements GentableColumnDao { public class GentableColumnDaoImpl extends BaseCRUDDaoMybatis<GentableColumnEntity,Long> implements GentableColumnDao {
@Override
public GentableColumnEntity get(Long id) {
return super.get(id);
}
@Override @Override
public List<GentableColumnEntity> selectDbTableColumnsByName(String tableName) { public List<GentableColumnEntity> selectDbTableColumnsByName(String tableName) {
......
package com.mortals.xhx.base.system.gentable.model; package com.mortals.xhx.base.system.gentable.model;
import com.mortals.framework.model.BaseEntity;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.common.utils.StringUtils; import com.mortals.xhx.common.utils.StringUtils;
import lombok.Data; import lombok.Data;
...@@ -15,6 +16,17 @@ import java.util.Map; ...@@ -15,6 +16,17 @@ import java.util.Map;
@Data @Data
public class GentableColumnEntityExt extends BaseEntityLong { public class GentableColumnEntityExt extends BaseEntityLong {
private List<Map<String,String>> dict; private List<Map<String, String>> dict;
public String test(){
return "aaa";
}
public static void main(String[] args) {
GentableColumnEntity gentableColumnEntity = new GentableColumnEntity();
System.out.println(gentableColumnEntity.test());
}
} }
\ No newline at end of file
package com.mortals.xhx.common.utils; package com.mortals.xhx.common.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.ManagerApplication;
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 com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.GenConstants; import com.mortals.xhx.common.key.GenConstants;
import freemarker.cache.ClassTemplateLoader;
import freemarker.template.Configuration; import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
...@@ -256,13 +253,14 @@ public class FreeMarkerUtils { ...@@ -256,13 +253,14 @@ public class FreeMarkerUtils {
String subClassName = genTable.getSubTable().getClassName(); String subClassName = genTable.getSubTable().getClassName();
String subTableFkClassName = StringUtils.convertToCamelCase(subTableFkName); String subTableFkClassName = StringUtils.convertToCamelCase(subTableFkName);
String businessName = subTable.getBusinessName().replace("\\.", ""); String businessName = subTable.getBusinessName().replace("\\.", "");
String functionName = subTable.getFunctionName();
String subPackageName = genTable.getPackageName() + "." + genTable.getModuleName() + "." + businessName; String subPackageName = genTable.getPackageName() + "." + genTable.getModuleName() + "." + businessName;
data.put("subTable", subTable); data.put("subTable", subTable);
data.put("subPackageName", subPackageName); data.put("subPackageName", subPackageName);
data.put("subTableName", subTableName); data.put("subTableName", subTableName);
data.put("subTableFkName", subTableFkName); data.put("subTableFkName", subTableFkName);
data.put("subFunctionName", StringUtils.isNotEmpty(functionName) ? functionName : subTable.getTableComment());
//外键java类型 //外键java类型
data.put("subTableFkType", getFkJavaType(subTable, subTableFkName)); data.put("subTableFkType", getFkJavaType(subTable, subTableFkName));
data.put("subTableFkClassName", subTableFkClassName); data.put("subTableFkClassName", subTableFkClassName);
......
...@@ -4,11 +4,11 @@ import com.mortals.framework.dao.ICRUDDao; ...@@ -4,11 +4,11 @@ import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.demo.model.DemoEntity; import com.mortals.xhx.module.demo.model.DemoEntity;
/** /**
* 测试Dao * 测试demoDao
* 测试 DAO接口 * 测试demo DAO接口
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public interface DemoDao extends ICRUDDao<DemoEntity,String>{ public interface DemoDao extends ICRUDDao<DemoEntity,String>{
......
...@@ -7,10 +7,10 @@ import com.mortals.xhx.module.demo.model.DemoEntity; ...@@ -7,10 +7,10 @@ import com.mortals.xhx.module.demo.model.DemoEntity;
import java.util.Date; import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
/** /**
* 测试DaoImpl DAO接口 * 测试demoDaoImpl DAO接口
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
@Repository("demoDao") @Repository("demoDao")
public class DemoDaoImpl extends BaseCRUDDaoMybatis<DemoEntity,String> implements DemoDao { public class DemoDaoImpl extends BaseCRUDDaoMybatis<DemoEntity,String> implements DemoDao {
......
...@@ -4,11 +4,11 @@ import com.mortals.framework.dao.ICRUDDao; ...@@ -4,11 +4,11 @@ import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity; import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity;
/** /**
* Dao * 测试详细Dao
* DAO接口 * 测试详细 DAO接口
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public interface DemoDetailDao extends ICRUDDao<DemoDetailEntity,Long>{ public interface DemoDetailDao extends ICRUDDao<DemoDetailEntity,Long>{
......
...@@ -7,10 +7,10 @@ import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity; ...@@ -7,10 +7,10 @@ import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity;
import java.util.Date; import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
/** /**
* DaoImpl DAO接口 * 测试详细DaoImpl DAO接口
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
@Repository("demoDetailDao") @Repository("demoDetailDao")
public class DemoDetailDaoImpl extends BaseCRUDDaoMybatis<DemoDetailEntity,Long> implements DemoDetailDao { public class DemoDetailDaoImpl extends BaseCRUDDaoMybatis<DemoDetailEntity,Long> implements DemoDetailDao {
......
package com.mortals.xhx.module.demo.detail.model; package com.mortals.xhx.module.demo.detail.model;
import java.util.List;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
/** /**
* 实体对象 * 测试详细实体对象
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public class DemoDetailEntity extends BaseEntityLong { public class DemoDetailEntity extends BaseEntityLong {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* * 测试demo表id
*/ */
@Excel(name = "测试demo表id")
private String demoId; private String demoId;
/** /**
* * 浮点值
*/ */
@Excel(name = "浮点值")
private Long number; private Long number;
/** /**
* * 详细
*/ */
@Excel(name = "详细")
private String detail; private String detail;
public DemoDetailEntity(){} public DemoDetailEntity(){}
/** /**
* 获取 * 获取 测试demo表id
* @return String * @return String
*/ */
public String getDemoId(){ public String getDemoId(){
return demoId; return demoId;
} }
/** /**
* 设置 * 设置 测试demo表id
* @param demoId * @param demoId
*/ */
public void setDemoId(String demoId){ public void setDemoId(String demoId){
this.demoId = demoId; this.demoId = demoId;
} }
/** /**
* 获取 * 获取 浮点值
* @return Long * @return Long
*/ */
public Long getNumber(){ public Long getNumber(){
return number; return number;
} }
/** /**
* 设置 * 设置 浮点值
* @param number * @param number
*/ */
public void setNumber(Long number){ public void setNumber(Long number){
this.number = number; this.number = number;
} }
/** /**
* 获取 * 获取 详细
* @return String * @return String
*/ */
public String getDetail(){ public String getDetail(){
return detail; return detail;
} }
/** /**
* 设置 * 设置 详细
* @param detail * @param detail
*/ */
public void setDetail(String detail){ public void setDetail(String detail){
......
package com.mortals.xhx.module.demo.detail.model; package com.mortals.xhx.module.demo.detail.model;
import java.util.List; import java.util.List;
/** /**
* 查询对象 * 测试详细查询对象
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public class DemoDetailQuery extends DemoDetailEntity { public class DemoDetailQuery extends DemoDetailEntity {
/** 开始 */ /** 开始 主键id */
private Long idStart; private Long idStart;
/** 结束 */ /** 结束 主键id */
private Long idEnd; private Long idEnd;
/** 增加 */ /** 增加 主键id */
private Long idIncrement; private Long idIncrement;
/** 列表 */ /** 主键id列表 */
private List<Long> idList; private List <Long> idList;
/** */ /** 测试demo表id */
private List<String> demoIdList; private List<String> demoIdList;
/** 开始 */ /** 开始 浮点值 */
private Long numberStart; private Long numberStart;
/** 结束 */ /** 结束 浮点值 */
private Long numberEnd; private Long numberEnd;
/** 增加 */ /** 增加 浮点值 */
private Long numberIncrement; private Long numberIncrement;
/** 列表 */ /** 浮点值列表 */
private List <Long> numberList; private List <Long> numberList;
/** */ /** 详细 */
private List<String> detailList; private List<String> detailList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
...@@ -48,7 +47,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -48,7 +47,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
public DemoDetailQuery(){} public DemoDetailQuery(){}
/** /**
* 获取 开始 * 获取 开始 主键id
* @return idStart * @return idStart
*/ */
public Long getIdStart(){ public Long getIdStart(){
...@@ -56,7 +55,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -56,7 +55,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 开始 * 设置 开始 主键id
* @param idStart * @param idStart
*/ */
public void setIdStart(Long idStart){ public void setIdStart(Long idStart){
...@@ -64,7 +63,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -64,7 +63,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 获取 结束 * 获取 结束 主键id
* @return $idEnd * @return $idEnd
*/ */
public Long getIdEnd(){ public Long getIdEnd(){
...@@ -72,7 +71,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -72,7 +71,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 结束 * 设置 结束 主键id
* @param idEnd * @param idEnd
*/ */
public void setIdEnd(Long idEnd){ public void setIdEnd(Long idEnd){
...@@ -80,7 +79,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -80,7 +79,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 获取 增加 * 获取 增加 主键id
* @return idIncrement * @return idIncrement
*/ */
public Long getIdIncrement(){ public Long getIdIncrement(){
...@@ -88,7 +87,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -88,7 +87,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 增加 * 设置 增加 主键id
* @param idIncrement * @param idIncrement
*/ */
public void setIdIncrement(Long idIncrement){ public void setIdIncrement(Long idIncrement){
...@@ -96,7 +95,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -96,7 +95,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 获取 * 获取 主键id
* @return idList * @return idList
*/ */
public List<Long> getIdList(){ public List<Long> getIdList(){
...@@ -104,7 +103,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -104,7 +103,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 * 设置 主键id
* @param idList * @param idList
*/ */
public void setIdList(List<Long> idList){ public void setIdList(List<Long> idList){
...@@ -112,7 +111,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -112,7 +111,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 获取 * 获取 测试demo表id
* @return demoIdList * @return demoIdList
*/ */
public List<String> getDemoIdList(){ public List<String> getDemoIdList(){
...@@ -120,14 +119,14 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -120,14 +119,14 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 * 设置 测试demo表id
* @param demoIdList * @param demoIdList
*/ */
public void setDemoIdList(List<String> demoIdList){ public void setDemoIdList(List<String> demoIdList){
this.demoIdList = demoIdList; this.demoIdList = demoIdList;
} }
/** /**
* 获取 开始 * 获取 开始 浮点值
* @return numberStart * @return numberStart
*/ */
public Long getNumberStart(){ public Long getNumberStart(){
...@@ -135,7 +134,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -135,7 +134,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 开始 * 设置 开始 浮点值
* @param numberStart * @param numberStart
*/ */
public void setNumberStart(Long numberStart){ public void setNumberStart(Long numberStart){
...@@ -143,7 +142,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -143,7 +142,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 获取 结束 * 获取 结束 浮点值
* @return $numberEnd * @return $numberEnd
*/ */
public Long getNumberEnd(){ public Long getNumberEnd(){
...@@ -151,7 +150,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -151,7 +150,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 结束 * 设置 结束 浮点值
* @param numberEnd * @param numberEnd
*/ */
public void setNumberEnd(Long numberEnd){ public void setNumberEnd(Long numberEnd){
...@@ -159,7 +158,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -159,7 +158,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 获取 增加 * 获取 增加 浮点值
* @return numberIncrement * @return numberIncrement
*/ */
public Long getNumberIncrement(){ public Long getNumberIncrement(){
...@@ -167,7 +166,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -167,7 +166,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 增加 * 设置 增加 浮点值
* @param numberIncrement * @param numberIncrement
*/ */
public void setNumberIncrement(Long numberIncrement){ public void setNumberIncrement(Long numberIncrement){
...@@ -175,7 +174,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -175,7 +174,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 获取 * 获取 浮点值
* @return numberList * @return numberList
*/ */
public List<Long> getNumberList(){ public List<Long> getNumberList(){
...@@ -183,7 +182,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -183,7 +182,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 * 设置 浮点值
* @param numberList * @param numberList
*/ */
public void setNumberList(List<Long> numberList){ public void setNumberList(List<Long> numberList){
...@@ -191,7 +190,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -191,7 +190,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 获取 * 获取 详细
* @return detailList * @return detailList
*/ */
public List<String> getDetailList(){ public List<String> getDetailList(){
...@@ -199,14 +198,14 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -199,14 +198,14 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 * 设置 详细
* @param detailList * @param detailList
*/ */
public void setDetailList(List<String> detailList){ public void setDetailList(List<String> detailList){
this.detailList = detailList; this.detailList = detailList;
} }
/** /**
* 设置 * 设置 主键id
* @param id * @param id
*/ */
public DemoDetailQuery id(Long id){ public DemoDetailQuery id(Long id){
...@@ -215,7 +214,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -215,7 +214,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 开始 * 设置 开始 主键id
* @param idStart * @param idStart
*/ */
public DemoDetailQuery idStart(Long idStart){ public DemoDetailQuery idStart(Long idStart){
...@@ -224,7 +223,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -224,7 +223,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 结束 * 设置 结束 主键id
* @param idEnd * @param idEnd
*/ */
public DemoDetailQuery idEnd(Long idEnd){ public DemoDetailQuery idEnd(Long idEnd){
...@@ -233,7 +232,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -233,7 +232,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 增加 * 设置 增加 主键id
* @param idIncrement * @param idIncrement
*/ */
public DemoDetailQuery idIncrement(Long idIncrement){ public DemoDetailQuery idIncrement(Long idIncrement){
...@@ -242,7 +241,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -242,7 +241,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 * 设置 主键id
* @param idList * @param idList
*/ */
public DemoDetailQuery idList(List<Long> idList){ public DemoDetailQuery idList(List<Long> idList){
...@@ -252,7 +251,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -252,7 +251,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
/** /**
* 设置 * 设置 测试demo表id
* @param demoId * @param demoId
*/ */
public DemoDetailQuery demoId(String demoId){ public DemoDetailQuery demoId(String demoId){
...@@ -261,7 +260,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -261,7 +260,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 * 设置 测试demo表id
* @param demoIdList * @param demoIdList
*/ */
public DemoDetailQuery demoIdList(List<String> demoIdList){ public DemoDetailQuery demoIdList(List<String> demoIdList){
...@@ -270,7 +269,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -270,7 +269,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 * 设置 浮点值
* @param number * @param number
*/ */
public DemoDetailQuery number(Long number){ public DemoDetailQuery number(Long number){
...@@ -279,7 +278,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -279,7 +278,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 开始 * 设置 开始 浮点值
* @param numberStart * @param numberStart
*/ */
public DemoDetailQuery numberStart(Long numberStart){ public DemoDetailQuery numberStart(Long numberStart){
...@@ -288,7 +287,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -288,7 +287,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 结束 * 设置 结束 浮点值
* @param numberEnd * @param numberEnd
*/ */
public DemoDetailQuery numberEnd(Long numberEnd){ public DemoDetailQuery numberEnd(Long numberEnd){
...@@ -297,7 +296,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -297,7 +296,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 增加 * 设置 增加 浮点值
* @param numberIncrement * @param numberIncrement
*/ */
public DemoDetailQuery numberIncrement(Long numberIncrement){ public DemoDetailQuery numberIncrement(Long numberIncrement){
...@@ -306,7 +305,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -306,7 +305,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 * 设置 浮点值
* @param numberList * @param numberList
*/ */
public DemoDetailQuery numberList(List<Long> numberList){ public DemoDetailQuery numberList(List<Long> numberList){
...@@ -316,7 +315,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -316,7 +315,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
/** /**
* 设置 * 设置 详细
* @param detail * @param detail
*/ */
public DemoDetailQuery detail(String detail){ public DemoDetailQuery detail(String detail){
...@@ -325,7 +324,7 @@ public class DemoDetailQuery extends DemoDetailEntity { ...@@ -325,7 +324,7 @@ public class DemoDetailQuery extends DemoDetailEntity {
} }
/** /**
* 设置 * 设置 详细
* @param detailList * @param detailList
*/ */
public DemoDetailQuery detailList(List<String> detailList){ public DemoDetailQuery detailList(List<String> detailList){
......
...@@ -5,10 +5,10 @@ import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity; ...@@ -5,10 +5,10 @@ import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity;
/** /**
* DemoDetailService * DemoDetailService
* *
* service接口 * 测试详细 service接口
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public interface DemoDetailService extends ICRUDService<DemoDetailEntity,Long>{ public interface DemoDetailService extends ICRUDService<DemoDetailEntity,Long>{
......
...@@ -7,10 +7,10 @@ import com.mortals.xhx.module.demo.detail.service.DemoDetailService; ...@@ -7,10 +7,10 @@ import com.mortals.xhx.module.demo.detail.service.DemoDetailService;
/** /**
* DemoDetailService * DemoDetailService
* service实现 * 测试详细 service实现
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
@Service("demoDetailService") @Service("demoDetailService")
public class DemoDetailServiceImpl extends AbstractCRUDServiceImpl<DemoDetailDao, DemoDetailEntity, Long> implements DemoDetailService { public class DemoDetailServiceImpl extends AbstractCRUDServiceImpl<DemoDetailDao, DemoDetailEntity, Long> implements DemoDetailService {
......
package com.mortals.xhx.module.demo.detail.web; package com.mortals.xhx.module.demo.detail.web;
import com.mortals.framework.common.AjaxResult;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
...@@ -9,30 +15,33 @@ import com.mortals.framework.common.IBaseEnum; ...@@ -9,30 +15,33 @@ import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.code.YesNo; import com.mortals.framework.common.code.YesNo;
import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity; import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity;
import com.mortals.xhx.module.demo.detail.service.DemoDetailService; import com.mortals.xhx.module.demo.detail.service.DemoDetailService;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* DemoDetailController * DemoDetailController
* *
* 控制器 * 测试详细 控制器
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
@RestController @RestController
@RequestMapping("demo/detail") @RequestMapping("demo/detail")
public class DemoDetailController extends BaseCRUDJsonMappingController<DemoDetailService,DemoDetailForm,DemoDetailEntity,Long> { public class DemoDetailController extends BaseCRUDJsonMappingController<DemoDetailService,DemoDetailForm,DemoDetailEntity,Long> {
@Autowired
private ParamService paramService;
public DemoDetailController(){ public DemoDetailController(){
super.setFormClass(DemoDetailForm.class); super.setFormClass(DemoDetailForm.class);
super.setModuleDesc( ""); super.setModuleDesc( "测试详细");
} }
@Override @Override
protected void init(HttpServletRequest request, HttpServletResponse response, DemoDetailForm form, Map<String, Object> model, Context context) { protected void init(HttpServletRequest request, HttpServletResponse response, DemoDetailForm form, Map<String, Object> model, Context context) {
this.addDict(model, "status", IBaseEnum.getEnumMap(YesNo.class));
super.init(request, response, form, model, context); super.init(request, response, form, model, context);
} }
} }
\ No newline at end of file
...@@ -8,10 +8,10 @@ import com.mortals.xhx.module.demo.detail.model.DemoDetailQuery; ...@@ -8,10 +8,10 @@ import com.mortals.xhx.module.demo.detail.model.DemoDetailQuery;
/** /**
* DemoDetail * DemoDetail
* *
* Form * 测试详细 Form
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public class DemoDetailForm extends BaseCRUDFormLong<DemoDetailEntity> { public class DemoDetailForm extends BaseCRUDFormLong<DemoDetailEntity> {
private DemoDetailEntity entity = new DemoDetailEntity(); private DemoDetailEntity entity = new DemoDetailEntity();
......
package com.mortals.xhx.module.demo.model; package com.mortals.xhx.module.demo.model;
import java.util.List; import java.util.List;
import java.util.List;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityStr; import com.mortals.framework.model.BaseEntityStr;
import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity; import com.mortals.xhx.module.demo.detail.model.DemoDetailEntity;
/** /**
* 测试实体对象 * 测试demo实体对象
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public class DemoEntity extends BaseEntityStr { public class DemoEntity extends BaseEntityStr {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* * 主键id
*/
@Excel(name = "主键")
private String id;
/**
* 字段1
*/ */
@Excel(name = "字段1")
private String fieldOne; private String fieldOne;
/** /**
* * 字段2
*/ */
@Excel(name = "字段2")
private Long fieldTwo; private Long fieldTwo;
/**
* 字段3
*/
@Excel(name = "字段3")
private Integer fieldThree;
/** /**
* 信息 * 测试详细信息
*/ */
private List<DemoDetailEntity> demoDetailList; private List<DemoDetailEntity> demoDetailList;
public DemoEntity(){} public DemoEntity(){}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
/** /**
* 获取 * 获取 字段1
* @return String * @return String
*/ */
public String getFieldOne(){ public String getFieldOne(){
return fieldOne; return fieldOne;
} }
/** /**
* 设置 * 设置 字段1
* @param fieldOne * @param fieldOne
*/ */
public void setFieldOne(String fieldOne){ public void setFieldOne(String fieldOne){
this.fieldOne = fieldOne; this.fieldOne = fieldOne;
} }
/** /**
* 获取 * 获取 字段2
* @return Long * @return Long
*/ */
public Long getFieldTwo(){ public Long getFieldTwo(){
return fieldTwo; return fieldTwo;
} }
/** /**
* 设置 * 设置 字段2
* @param fieldTwo * @param fieldTwo
*/ */
public void setFieldTwo(Long fieldTwo){ public void setFieldTwo(Long fieldTwo){
this.fieldTwo = fieldTwo; this.fieldTwo = fieldTwo;
} }
/**
* 获取 字段3
* @return Integer
*/
public Integer getFieldThree(){
return fieldThree;
}
/**
* 设置 字段3
* @param fieldThree
*/
public void setFieldThree(Integer fieldThree){
this.fieldThree = fieldThree;
}
public List<DemoDetailEntity> getDemoDetailList(){ public List<DemoDetailEntity> getDemoDetailList(){
...@@ -86,11 +126,13 @@ public class DemoEntity extends BaseEntityStr { ...@@ -86,11 +126,13 @@ public class DemoEntity extends BaseEntityStr {
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append(",fieldOne:").append(getFieldOne()); sb.append(",fieldOne:").append(getFieldOne());
sb.append(",fieldTwo:").append(getFieldTwo()); sb.append(",fieldTwo:").append(getFieldTwo());
sb.append(",fieldThree:").append(getFieldThree());
return sb.toString(); return sb.toString();
} }
public void initAttrValue(){ public void initAttrValue(){
this.fieldOne = null; this.fieldOne = null;
this.fieldTwo = null; this.fieldTwo = null;
this.fieldThree = null;
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.demo.model; package com.mortals.xhx.module.demo.model;
import java.util.List;
import java.util.List; import java.util.List;
/** /**
* 测试查询对象 * 测试demo查询对象
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public class DemoQuery extends DemoEntity { public class DemoQuery extends DemoEntity {
/** */ /** 主键id */
private List<String> idList; private List<String> idList;
/** */ /** 字段1 */
private List<String> fieldOneList; private List<String> fieldOneList;
/** 开始 */ /** 开始 字段2 */
private Long fieldTwoStart; private Long fieldTwoStart;
/** 结束 */ /** 结束 字段2 */
private Long fieldTwoEnd; private Long fieldTwoEnd;
/** 增加 */ /** 增加 字段2 */
private Long fieldTwoIncrement; private Long fieldTwoIncrement;
/** 列表 */ /** 字段2列表 */
private List <Long> fieldTwoList; private List <Long> fieldTwoList;
/** 开始 字段3 */
private Integer fieldThreeStart;
/** 结束 字段3 */
private Integer fieldThreeEnd;
/** 增加 字段3 */
private Integer fieldThreeIncrement;
/** 字段3列表 */
private List <Integer> fieldThreeList;
/** 开始 */ /** 开始 */
private String updateTimeStart; private String updateTimeStart;
...@@ -53,7 +66,7 @@ public class DemoQuery extends DemoEntity { ...@@ -53,7 +66,7 @@ public class DemoQuery extends DemoEntity {
public DemoQuery(){} public DemoQuery(){}
/** /**
* 获取 * 获取 主键id
* @return idList * @return idList
*/ */
public List<String> getIdList(){ public List<String> getIdList(){
...@@ -61,14 +74,14 @@ public class DemoQuery extends DemoEntity { ...@@ -61,14 +74,14 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 * 设置 主键id
* @param idList * @param idList
*/ */
public void setIdList(List<String> idList){ public void setIdList(List<String> idList){
this.idList = idList; this.idList = idList;
} }
/** /**
* 获取 * 获取 字段1
* @return fieldOneList * @return fieldOneList
*/ */
public List<String> getFieldOneList(){ public List<String> getFieldOneList(){
...@@ -76,14 +89,14 @@ public class DemoQuery extends DemoEntity { ...@@ -76,14 +89,14 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 * 设置 字段1
* @param fieldOneList * @param fieldOneList
*/ */
public void setFieldOneList(List<String> fieldOneList){ public void setFieldOneList(List<String> fieldOneList){
this.fieldOneList = fieldOneList; this.fieldOneList = fieldOneList;
} }
/** /**
* 获取 开始 * 获取 开始 字段2
* @return fieldTwoStart * @return fieldTwoStart
*/ */
public Long getFieldTwoStart(){ public Long getFieldTwoStart(){
...@@ -91,7 +104,7 @@ public class DemoQuery extends DemoEntity { ...@@ -91,7 +104,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 开始 * 设置 开始 字段2
* @param fieldTwoStart * @param fieldTwoStart
*/ */
public void setFieldTwoStart(Long fieldTwoStart){ public void setFieldTwoStart(Long fieldTwoStart){
...@@ -99,7 +112,7 @@ public class DemoQuery extends DemoEntity { ...@@ -99,7 +112,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 获取 结束 * 获取 结束 字段2
* @return $fieldTwoEnd * @return $fieldTwoEnd
*/ */
public Long getFieldTwoEnd(){ public Long getFieldTwoEnd(){
...@@ -107,7 +120,7 @@ public class DemoQuery extends DemoEntity { ...@@ -107,7 +120,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 结束 * 设置 结束 字段2
* @param fieldTwoEnd * @param fieldTwoEnd
*/ */
public void setFieldTwoEnd(Long fieldTwoEnd){ public void setFieldTwoEnd(Long fieldTwoEnd){
...@@ -115,7 +128,7 @@ public class DemoQuery extends DemoEntity { ...@@ -115,7 +128,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 获取 增加 * 获取 增加 字段2
* @return fieldTwoIncrement * @return fieldTwoIncrement
*/ */
public Long getFieldTwoIncrement(){ public Long getFieldTwoIncrement(){
...@@ -123,7 +136,7 @@ public class DemoQuery extends DemoEntity { ...@@ -123,7 +136,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 增加 * 设置 增加 字段2
* @param fieldTwoIncrement * @param fieldTwoIncrement
*/ */
public void setFieldTwoIncrement(Long fieldTwoIncrement){ public void setFieldTwoIncrement(Long fieldTwoIncrement){
...@@ -131,7 +144,7 @@ public class DemoQuery extends DemoEntity { ...@@ -131,7 +144,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 获取 * 获取 字段2
* @return fieldTwoList * @return fieldTwoList
*/ */
public List<Long> getFieldTwoList(){ public List<Long> getFieldTwoList(){
...@@ -139,13 +152,77 @@ public class DemoQuery extends DemoEntity { ...@@ -139,13 +152,77 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 * 设置 字段2
* @param fieldTwoList * @param fieldTwoList
*/ */
public void setFieldTwoList(List<Long> fieldTwoList){ public void setFieldTwoList(List<Long> fieldTwoList){
this.fieldTwoList = fieldTwoList; this.fieldTwoList = fieldTwoList;
} }
/**
* 获取 开始 字段3
* @return fieldThreeStart
*/
public Integer getFieldThreeStart(){
return this.fieldThreeStart;
}
/**
* 设置 开始 字段3
* @param fieldThreeStart
*/
public void setFieldThreeStart(Integer fieldThreeStart){
this.fieldThreeStart = fieldThreeStart;
}
/**
* 获取 结束 字段3
* @return $fieldThreeEnd
*/
public Integer getFieldThreeEnd(){
return this.fieldThreeEnd;
}
/**
* 设置 结束 字段3
* @param fieldThreeEnd
*/
public void setFieldThreeEnd(Integer fieldThreeEnd){
this.fieldThreeEnd = fieldThreeEnd;
}
/**
* 获取 增加 字段3
* @return fieldThreeIncrement
*/
public Integer getFieldThreeIncrement(){
return this.fieldThreeIncrement;
}
/**
* 设置 增加 字段3
* @param fieldThreeIncrement
*/
public void setFieldThreeIncrement(Integer fieldThreeIncrement){
this.fieldThreeIncrement = fieldThreeIncrement;
}
/**
* 获取 字段3
* @return fieldThreeList
*/
public List<Integer> getFieldThreeList(){
return this.fieldThreeList;
}
/**
* 设置 字段3
* @param fieldThreeList
*/
public void setFieldThreeList(List<Integer> fieldThreeList){
this.fieldThreeList = fieldThreeList;
}
/** /**
* 获取 开始 * 获取 开始
* @return updateTimeStart * @return updateTimeStart
...@@ -242,7 +319,7 @@ public class DemoQuery extends DemoEntity { ...@@ -242,7 +319,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 * 设置 主键id
* @param id * @param id
*/ */
public DemoQuery id(String id){ public DemoQuery id(String id){
...@@ -251,7 +328,7 @@ public class DemoQuery extends DemoEntity { ...@@ -251,7 +328,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 * 设置 主键id
* @param idList * @param idList
*/ */
public DemoQuery idList(List<String> idList){ public DemoQuery idList(List<String> idList){
...@@ -261,7 +338,7 @@ public class DemoQuery extends DemoEntity { ...@@ -261,7 +338,7 @@ public class DemoQuery extends DemoEntity {
/** /**
* 设置 * 设置 字段1
* @param fieldOne * @param fieldOne
*/ */
public DemoQuery fieldOne(String fieldOne){ public DemoQuery fieldOne(String fieldOne){
...@@ -270,7 +347,7 @@ public class DemoQuery extends DemoEntity { ...@@ -270,7 +347,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 * 设置 字段1
* @param fieldOneList * @param fieldOneList
*/ */
public DemoQuery fieldOneList(List<String> fieldOneList){ public DemoQuery fieldOneList(List<String> fieldOneList){
...@@ -279,7 +356,7 @@ public class DemoQuery extends DemoEntity { ...@@ -279,7 +356,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 * 设置 字段2
* @param fieldTwo * @param fieldTwo
*/ */
public DemoQuery fieldTwo(Long fieldTwo){ public DemoQuery fieldTwo(Long fieldTwo){
...@@ -288,7 +365,7 @@ public class DemoQuery extends DemoEntity { ...@@ -288,7 +365,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 开始 * 设置 开始 字段2
* @param fieldTwoStart * @param fieldTwoStart
*/ */
public DemoQuery fieldTwoStart(Long fieldTwoStart){ public DemoQuery fieldTwoStart(Long fieldTwoStart){
...@@ -297,7 +374,7 @@ public class DemoQuery extends DemoEntity { ...@@ -297,7 +374,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 结束 * 设置 结束 字段2
* @param fieldTwoEnd * @param fieldTwoEnd
*/ */
public DemoQuery fieldTwoEnd(Long fieldTwoEnd){ public DemoQuery fieldTwoEnd(Long fieldTwoEnd){
...@@ -306,7 +383,7 @@ public class DemoQuery extends DemoEntity { ...@@ -306,7 +383,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 增加 * 设置 增加 字段2
* @param fieldTwoIncrement * @param fieldTwoIncrement
*/ */
public DemoQuery fieldTwoIncrement(Long fieldTwoIncrement){ public DemoQuery fieldTwoIncrement(Long fieldTwoIncrement){
...@@ -315,7 +392,7 @@ public class DemoQuery extends DemoEntity { ...@@ -315,7 +392,7 @@ public class DemoQuery extends DemoEntity {
} }
/** /**
* 设置 * 设置 字段2
* @param fieldTwoList * @param fieldTwoList
*/ */
public DemoQuery fieldTwoList(List<Long> fieldTwoList){ public DemoQuery fieldTwoList(List<Long> fieldTwoList){
...@@ -323,6 +400,51 @@ public class DemoQuery extends DemoEntity { ...@@ -323,6 +400,51 @@ public class DemoQuery extends DemoEntity {
return this; return this;
} }
/**
* 设置 字段3
* @param fieldThree
*/
public DemoQuery fieldThree(Integer fieldThree){
setFieldThree(fieldThree);
return this;
}
/**
* 设置 开始 字段3
* @param fieldThreeStart
*/
public DemoQuery fieldThreeStart(Integer fieldThreeStart){
this.fieldThreeStart = fieldThreeStart;
return this;
}
/**
* 设置 结束 字段3
* @param fieldThreeEnd
*/
public DemoQuery fieldThreeEnd(Integer fieldThreeEnd){
this.fieldThreeEnd = fieldThreeEnd;
return this;
}
/**
* 设置 增加 字段3
* @param fieldThreeIncrement
*/
public DemoQuery fieldThreeIncrement(Integer fieldThreeIncrement){
this.fieldThreeIncrement = fieldThreeIncrement;
return this;
}
/**
* 设置 字段3
* @param fieldThreeList
*/
public DemoQuery fieldThreeList(List<Integer> fieldThreeList){
this.fieldThreeList = fieldThreeList;
return this;
}
/** /**
......
package com.mortals.xhx.module.demo.service; package com.mortals.xhx.module.demo.service;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.demo.model.DemoEntity; import com.mortals.xhx.module.demo.model.DemoEntity;
import java.util.List;
/** /**
* DemoService * DemoService
* *
* 测试 service接口 * 测试demo service接口
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public interface DemoService extends ICRUDService<DemoEntity,String>{ public interface DemoService extends ICRUDService<DemoEntity,String>{
......
package com.mortals.xhx.module.demo.service.impl; package com.mortals.xhx.module.demo.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.demo.dao.DemoDao; import com.mortals.xhx.module.demo.dao.DemoDao;
import com.mortals.xhx.module.demo.model.DemoEntity; import com.mortals.xhx.module.demo.model.DemoEntity;
import com.mortals.xhx.module.demo.service.DemoService; import com.mortals.xhx.module.demo.service.DemoService;
import org.springframework.stereotype.Service;
/** /**
* DemoService * DemoService
* 测试 service实现 * 测试demo service实现
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
@Service("demoService") @Service("demoService")
public class DemoServiceImpl extends AbstractCRUDServiceImpl<DemoDao, DemoEntity, String> implements DemoService { public class DemoServiceImpl extends AbstractCRUDServiceImpl<DemoDao, DemoEntity, String> implements DemoService {
......
package com.mortals.xhx.module.demo.web; package com.mortals.xhx.module.demo.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.AjaxResult;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonMappingController; import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.framework.common.IBaseEnum; import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.code.YesNo; import com.mortals.framework.common.code.YesNo;
import com.mortals.xhx.module.demo.model.DemoEntity; import com.mortals.xhx.module.demo.model.DemoEntity;
import com.mortals.xhx.module.demo.service.DemoService; import com.mortals.xhx.module.demo.service.DemoService;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* DemoController * DemoController
* * <p>
* 测试 控制器 * 测试demo 控制器
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
@RestController @RestController
@RequestMapping("demo") @RequestMapping("demo")
public class DemoController extends BaseCRUDJsonMappingController<DemoService,DemoForm,DemoEntity,String> { public class DemoController extends BaseCRUDJsonMappingController<DemoService, DemoForm, DemoEntity, String> {
public DemoController(){ @Autowired
private ParamService paramService;
public DemoController() {
super.setFormClass(DemoForm.class); super.setFormClass(DemoForm.class);
super.setModuleDesc( "测试"); super.setModuleDesc("测试demo");
} }
@Override @Override
protected void init(HttpServletRequest request, HttpServletResponse response, DemoForm form, Map<String, Object> model, Context context) { protected void init(HttpServletRequest request, HttpServletResponse response, DemoForm form, Map<String, Object> model, Context context) {
this.addDict(model, "status", IBaseEnum.getEnumMap(YesNo.class)); //this.addDict(model, "fieldThree", paramService.getParamByFirstOrganize("fieldThree"));
super.init(request, response, form, model, context); super.init(request, response, form, model, context);
} }
// @PostMapping("exportExcel")
// public void exportExcel(DemoForm form) {
// try {
// PageInfo pageInfo = new PageInfo(65535);
// List<DemoEntity> list = this.service.find(form.getQuery(), pageInfo, getContext()).getList();
// ExcelUtil<DemoEntity> util = new ExcelUtil<>(DemoEntity.class);
// byte[] data = util.exportExcel(list, "demo");
// this.responseStream(response, data, "demo.xlsx");
// } catch (Exception e) {
// this.doException(request, "导出异常", new HashMap<String, Object>(), e);
// }
// }
// @PostMapping("/downloadTemplate")
// public void downloadTemplate() {
// try {
// ExcelUtil<DemoEntity> util = new ExcelUtil<>(DemoEntity.class);
// byte[] data = util.importTemplateExcel("用户数据");
// this.responseStream(response, data, "demo_template.xlsx");
// } catch (Exception e) {
// this.doException(request, "导出模板异常", new HashMap<String, Object>(), e);
// }
// }
// @PostMapping("/importData")
// public String importData(MultipartFile file, boolean updateSupport) {
// JSONObject ret = new JSONObject();
// String busiDesc = "导入数据";
// int code = VALUE_RESULT_SUCCESS;
// try {
// ExcelUtil<DemoEntity> util = new ExcelUtil<>(DemoEntity.class);
// List<DemoEntity> demoList = util.importExcel(file.getInputStream());
// String message = this.service.importDemoList(demoList, updateSupport, getContext());
// ret.put(KEY_RESULT_MSG, message);
// recordSysLog(request, busiDesc + " 【成功】");
// } catch (Exception e) {
// code = VALUE_RESULT_FAILURE;
// }
// ret.put(KEY_RESULT_CODE, code);
// return ret.toJSONString();
// }
} }
\ No newline at end of file
...@@ -8,10 +8,10 @@ import com.mortals.xhx.module.demo.model.DemoQuery; ...@@ -8,10 +8,10 @@ import com.mortals.xhx.module.demo.model.DemoQuery;
/** /**
* Demo * Demo
* *
* 测试 Form * 测试demo Form
* *
* @author zxfei * @author zxfei
* @date 2021-10-03 * @date 2021-10-09
*/ */
public class DemoForm extends BaseCRUDFormStr<DemoEntity> { public class DemoForm extends BaseCRUDFormStr<DemoEntity> {
private DemoEntity entity = new DemoEntity(); private DemoEntity entity = new DemoEntity();
......
...@@ -30,6 +30,7 @@ package ${packageName}.model; ...@@ -30,6 +30,7 @@ package ${packageName}.model;
import ${import}; import ${import};
</#list> </#list>
import java.util.List; import java.util.List;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.${Entity}; import com.mortals.framework.model.${Entity};
<#if table.tplCategory=="sub" > <#if table.tplCategory=="sub" >
import ${subPackageName}.model.${subClassName}Entity; import ${subPackageName}.model.${subClassName}Entity;
...@@ -49,6 +50,22 @@ public class ${ClassName}Entity extends ${Entity} { ...@@ -49,6 +50,22 @@ public class ${ClassName}Entity extends ${Entity} {
/** /**
* ${column.columnComment} * ${column.columnComment}
*/ */
<#if column.isList==1>
<#assign parentheseIndex =column.columnComment?index_of("(")>
<#if parentheseIndex != -1>
<#assign comment =column.columnComment[0..parentheseIndex-1]>
<#else>
<#assign comment =column.columnComment>
</#if>
<#if parentheseIndex != -1>
@Excel(name = "${comment}", readConverterExp = "${column.readConverterExp()}")
<#elseif column.javaType == "Date">
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
<#else>
@Excel(name = "${comment}")
</#if>
</#if>
private ${column.javaType} ${column.javaField}; private ${column.javaType} ${column.javaField};
</#if> </#if>
</#list> </#list>
......
-- ---------------------------- -- ----------------------------
-- 菜单 SQL -- 菜单 SQL
-- ---------------------------- -- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (null, '${tableComment}', '/${RequestMapping}/list', -1, 1, 1, 0, 0, NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL); INSERT INTO `mortals_xhx_menu` VALUES (null, '${tableComment}', '/${RequestMapping}/list', 0, 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
-- ---------------------------- -- ----------------------------
-- 资源路径 SQL -- 资源路径 SQL
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="${packageName}.dao.ibatis.${ClassName}DaoImpl"> <mapper namespace="${packageName}.dao.ibatis.${ClassName}DaoImpl">
<#if table.tplCategory=="sub" > <#if table.tplCategory=="sub" >
<#assign SubArray><collection property="${subclassName}List" column="${subTableFkName}" ofType="${subClassName}Entity-Map" javaType="ArrayList" select="get${subClassName}By${subTableFkClassName}">< /collection></#assign> <#assign SubArray><collection property="${subclassName}List" column="${pkColumn.columnName}" ofType="${subClassName}Entity" javaType="ArrayList" select="get${subClassName}By${subTableFkClassName}"></collection></#assign>
<#else> <#else>
<#assign SubArray></#assign> <#assign SubArray></#assign>
</#if> </#if>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<result property="${column.javaField}" column="${column.columnName}" /> <result property="${column.javaField}" column="${column.columnName}" />
</#if> </#if>
</#list> </#list>
${SubArray} ${SubArray}
</resultMap> </resultMap>
<#if table.tplCategory=="sub" > <#if table.tplCategory=="sub" >
<resultMap type="${subClassName}Entity" id="${subClassName}Entity-Map"> <resultMap type="${subClassName}Entity" id="${subClassName}Entity-Map">
...@@ -87,11 +87,7 @@ ...@@ -87,11 +87,7 @@
<!-- 子表所有列 --> <!-- 子表所有列 -->
<sql id="_columns_sub"> <sql id="_columns_sub">
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<#list subColumns as column> <#list subColumns as column>b.${column.columnName} as ${column.javaField},</#list>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('${column.javaField}') or colPickMode == 1 and data.containsKey('${column.javaField}')))">
a.${column.columnName} as ${column.javaField},
</if>
</#list>
</trim> </trim>
</sql> </sql>
</#if> </#if>
...@@ -228,9 +224,9 @@ ...@@ -228,9 +224,9 @@
</#if> </#if>
<select id="get${subClassName}By${subTableFkClassName}" parameterType="${ParameterType}" resultMap="${subClassName}Entity-Map"> <select id="get${subClassName}By${subTableFkClassName}" parameterType="${ParameterType}" resultMap="${subClassName}Entity-Map">
select <include refid="_columns_sub"/> select <include refid="_columns_sub"/>
from ${TempSubTable} as a from ${TempSubTable} as b
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where a.${subTableFkName} = <#noparse>#</#noparse>{${subTableFkName}} where b.${subTableFkName} = <#noparse>#</#noparse>{${pkColumn.subTableFkName}}
</trim> </trim>
</select> </select>
</#if> </#if>
......
...@@ -6,7 +6,11 @@ package ${packageName}.web; ...@@ -6,7 +6,11 @@ package ${packageName}.web;
<#else> <#else>
<#assign Controller = "BaseCRUDJsonMappingController"> <#assign Controller = "BaseCRUDJsonMappingController">
</#if> </#if>
import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.framework.common.AjaxResult;
import com.mortals.framework.model.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
...@@ -18,7 +22,7 @@ import com.mortals.framework.common.code.YesNo; ...@@ -18,7 +22,7 @@ import com.mortals.framework.common.code.YesNo;
import ${packageName}.model.${ClassName}Entity; import ${packageName}.model.${ClassName}Entity;
import ${packageName}.service.${ClassName}Service; import ${packageName}.service.${ClassName}Service;
import java.util.Map; import java.util.Map;
import java.util.List;
/** /**
* ${ClassName}Controller * ${ClassName}Controller
* *
...@@ -43,11 +47,10 @@ public class ${ClassName}Controller extends ${Controller}<${ClassName}Service,${ ...@@ -43,11 +47,10 @@ public class ${ClassName}Controller extends ${Controller}<${ClassName}Service,${
protected void init(HttpServletRequest request, HttpServletResponse response, ${ClassName}Form form, Map<String, Object> model, Context context) { protected void init(HttpServletRequest request, HttpServletResponse response, ${ClassName}Form form, Map<String, Object> model, Context context) {
<#list columns as column> <#list columns as column>
<#if column.columnType?contains("tinyint") ||column.htmlType==3||column.htmlType==5> <#if column.columnType?contains("tinyint") ||column.htmlType==3||column.htmlType==5>
this.addDict(model, "${column.javaField}", paramService.getParamByFirstOrganize("${column.javaField}"); this.addDict(model, "${column.javaField}", paramService.getParamByFirstOrganize("${column.javaField}"));
</#if> </#if>
</#list> </#list>
super.init(request, response, form, model, context); super.init(request, response, form, model, context);
} }
} }
\ No newline at end of file
<template> <template>
<div class="page"> <div class="page">
<LayoutTable :data='tableData' :config='tableConfig' /> <LayoutTable :data="tableData" :config="tableConfig">
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="handleImport"
>导入</el-button>
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="doExport"
:disabled="isExport"
>导出</el-button>
</LayoutTable>
<!-- ${functionName}导入对话框 -->
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
<div class="el-upload__tip" slot="tip">
<el-checkbox
v-model="upload.updateSupport"
/>是否更新已经存在的数据
<el-link type="primary" style="font-size: 14px" @click="downloadTemplate"
>下载模板</el-link
>
</div>
<div class="el-upload__tip" style="color: red" slot="tip">
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="upload.open = false">取 消</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { export default {
components: { components: {
}, },
...@@ -14,9 +70,92 @@ ...@@ -14,9 +70,92 @@
created() { created() {
}, },
methods: { methods: {
/** 导入 */
handleImport() {
this.upload.title = "${functionName}导入";
this.upload.open = true;
},
/** 下载模板操作 */
downloadTemplate() {
this.isExport = true;
this.$download("${RequestMapping}/downloadTemplate", {}, { type: "excel" })
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
/** 文件上传中处理 */
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
/** 文件上传成功处理 */
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getData();
},
/** 提交上传文件 */
submitFileForm() {
this.$refs.upload.submit();
},
doExport() {
this.isExport = true;
this.$download("${RequestMapping}/exportExcel", {
<#list columns as column>
<#if column.isQuery == 1 >
'query.${column.javaField}': this.$route.query['query.${column.javaField}']<#sep>,
</#if>
</#list>
}, {}).then(() => this.isExport = false).catch(error => {
this.isExport = false;
this.$message.error(error.message);
});
},
<#if table.tplCategory=="sub">
renderTable(tableData) {
return (
<el-table stripe data={tableData} class="total-table">
{this.columnSet.map((item) => this.renderTableColumn(item))}
</el-table>
);
},
renderTableColumn(options) {
return (
<el-table-column
prop={options.prop}
label={options.label}
>
</el-table-column>
);
},
</#if>
}, },
data() { data() {
return { return {
// 用户导入参数
upload: {
// 是否显示弹出层(${functionName}导入)
open: false,
// 弹出层标题(${functionName}导入)
title: "导入${functionName}数据",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的数据
updateSupport: 0,
// 上传的地址
url: "/m/${RequestMapping}/importData",
},
isExport: false,
<#if table.tplCategory=="sub">
columnSet:[
<#list subColumns as column>
{prop:"${column.javaField}",label:"${column.columnComment}"}<#sep>,
</#list>
],
</#if>
config: { config: {
search: [ search: [
<#list columns as column> <#list columns as column>
...@@ -68,7 +207,19 @@ ...@@ -68,7 +207,19 @@
</#if> </#if>
</#list> </#list>
<#if table.tplCategory=="sub"> <#if table.tplCategory=="sub">
{label: "${column.columnComment}", prop: "subColumns"}, {label: "${subFunctionName}",
width: 120,
prop: "subColumns",
formatter: (row) => {
let widthsize=this.columnSet.length*150
return (
<el-popover placement="right" width={widthsize} trigger="click">
{this.renderTable(row.${subclassName}List)}
<el-button type="text" slot="reference">详细</el-button>
</el-popover>
);
},
},
</#if> </#if>
{ {
label: "操作", label: "操作",
......
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