chore: pre-autopush snapshot @ 2026-06-11T10:05:43 (working tree snapshot)
This commit is contained in:
1 parent
df972a7ee7
commit
9a602d6f45
2546 files changed
+53713
-7603
No files matched your search
@@ -0,0 +1,56 @@
|
||||
#set($name = "${context.className.substring(0,1).toUpperCase()}${context.className.substring(1)}")
|
||||
package ${context.package}.model.$!{name.toLowerCase()};
|
||||
|
||||
import jnpf.constant.GlobalConst;
|
||||
#if($context.webType != 4)
|
||||
import jnpf.model.generater.GenerParamConst;
|
||||
#else
|
||||
import jnpf.model.generater.GenerViewConst;
|
||||
#end
|
||||
import jnpf.util.JsonUtil;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StreamUtils;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* ${context.genInfo.description}配置json
|
||||
*
|
||||
* @版本: ${context.genInfo.version}
|
||||
* @版权: ${context.genInfo.copyright}
|
||||
* @作者: ${context.genInfo.createUser}
|
||||
* @日期: ${context.genInfo.createDate}
|
||||
*/
|
||||
@Data
|
||||
@Slf4j
|
||||
public class $!{name}Constant extends #if($context.webType != 4) GenerParamConst#else GenerViewConst#end {
|
||||
|
||||
private static String contStr = null;
|
||||
|
||||
private static $!{name}Constant contEnt;
|
||||
|
||||
static {
|
||||
if (contStr == null) {
|
||||
try (InputStream is = $!{name}Constant.class.getResourceAsStream("$!{name}Json.json")) {
|
||||
contStr = StreamUtils.copyToString(is, GlobalConst.DEFAULT_CHARSET);
|
||||
} catch (Exception e) {
|
||||
log.error("加载配置文件失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static $!{name}Constant get() {
|
||||
if (contEnt == null) {
|
||||
contEnt = JsonUtil.getJsonToBean(contStr, $!{name}Constant.class);
|
||||
}
|
||||
return contEnt;
|
||||
}
|
||||
|
||||
#if($context.billRule)
|
||||
/** 单据规则 */
|
||||
#foreach($key in ${context.billRule.keySet()})
|
||||
public String $key = "";
|
||||
#end
|
||||
#end
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
#parse("PublicMacro/ControllerMarco.vm")
|
||||
package ${package.Controller};
|
||||
#set($peimaryKeyName = "${pKeyName.substring(0,1).toUpperCase()}${pKeyName.substring(1)}")
|
||||
#set($peimaryKeyname = "${pKeyName.substring(0,1).toLowerCase()}${pKeyName.substring(1)}")
|
||||
#set($serviceName = "${table.serviceName.substring(0,1).toLowerCase()}${table.serviceName.substring(1)}")
|
||||
#set($Name = "${genInfo.className.substring(0,1).toUpperCase()}${genInfo.className.substring(1)}")
|
||||
#set($name = "${genInfo.className.substring(0,1).toLowerCase()}${genInfo.className.substring(1)}")
|
||||
#set($packName = "${genInfo.className.toLowerCase()}")
|
||||
#set($searchListSize =$!{searchList})
|
||||
#set($columnListSize=$!{columnList})
|
||||
|
||||
#set($serverHasUpload = false)
|
||||
#set($serverHasDownload = false)
|
||||
#foreach($btn in ${btnsList})
|
||||
#if(${btn.value}=='upload' && ${btn.show})
|
||||
#set($serverHasUpload = true)
|
||||
#end
|
||||
#if(${btn.value}=='download' && ${btn.show})
|
||||
#set($serverHasDownload = true)
|
||||
#end
|
||||
#end
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jnpf.base.ActionResult;
|
||||
import jnpf.base.UserInfo;
|
||||
import jnpf.constant.FileTypeConstant;
|
||||
import jnpf.exception.DataException;
|
||||
import jnpf.permission.entity.UserEntity;
|
||||
import jnpf.constant.MsgCode;
|
||||
import ${package.Service}.*;
|
||||
import ${package.Entity}.*;
|
||||
import jnpf.util.*;
|
||||
import ${modulePackageName}.model.${packName}.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
#if(${springVersion.startsWith("2")})
|
||||
import javax.validation.Valid;
|
||||
#else
|
||||
import jakarta.validation.Valid;
|
||||
#end
|
||||
import java.util.*;
|
||||
import jnpf.model.ExcelModel;
|
||||
import jnpf.excel.ExcelExportStyler;
|
||||
import jnpf.excel.ExcelHelper;
|
||||
#if($isList)
|
||||
import jnpf.annotation.JnpfField;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
import jnpf.base.vo.DownloadVO;
|
||||
import jnpf.base.entity.ProvinceEntity;
|
||||
import java.util.stream.Collectors;
|
||||
import jnpf.flowable.entity.TaskEntity;
|
||||
import jnpf.exception.WorkFlowException;
|
||||
import jnpf.model.visualjson.UploaderTemplateModel;
|
||||
import jnpf.base.util.FormExecelUtils;
|
||||
#end
|
||||
#if(${serverHasUpload} || ${serverHasDownload})
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import jnpf.onlinedev.model.ExcelImFieldModel;
|
||||
import jnpf.base.model.online.ImportDataModel;
|
||||
import jnpf.base.model.online.ImportFormCheckUniqueModel;
|
||||
import jnpf.base.model.online.ExcelImportModel;
|
||||
import jnpf.base.model.online.VisualImportModel;
|
||||
import lombok.Cleanup;
|
||||
import jnpf.model.visualjson.config.HeaderModel;
|
||||
import jnpf.base.model.ColumnDataModel;
|
||||
import jnpf.base.util.VisualUtils;
|
||||
#end
|
||||
#if(${DS})
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
#else
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
#end
|
||||
#if(${isCloud}=="cloud")
|
||||
import jnpf.config.ConfigValueUtil;
|
||||
import jnpf.model.upload.UploadFileModel;
|
||||
import jnpf.file.FileApi;
|
||||
import jnpf.constant.FileTypeConstant;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import jnpf.file.FileUploadApi;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${genInfo.description}
|
||||
* @版本: ${genInfo.version}
|
||||
* @版权: ${genInfo.copyright}
|
||||
* @作者: ${genInfo.createUser}
|
||||
* @日期: ${genInfo.createDate}
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "${genInfo.description}" , description = "${module}")
|
||||
#if(${isCloud}=="cloud")
|
||||
#if(${module}=="form")
|
||||
@RequestMapping("/${module}/${genInfo.className}")
|
||||
#else
|
||||
@RequestMapping("/${genInfo.className}")
|
||||
#end
|
||||
#else
|
||||
#if(${module}=="form")
|
||||
##添加流程表单模块名称
|
||||
@RequestMapping("/api/workflow/${module}/${genInfo.className}")
|
||||
#else
|
||||
@RequestMapping("/api/${module}/${genInfo.className}")
|
||||
#end
|
||||
#end
|
||||
public class ${table.controllerName} {
|
||||
|
||||
private ${Name}Constant paramConst = ${Name}Constant.get();
|
||||
|
||||
private final GeneraterSwapUtil generaterSwapUtil;
|
||||
private final ${table.serviceName} ${serviceName};
|
||||
#foreach($tableModel in ${childTableHandle})
|
||||
private final ${tableModel.aliasUpName}Service ${tableModel.aliasLowName}Service;
|
||||
#end
|
||||
#foreach($cl in ${columnTableHandle})
|
||||
private final ${cl.modelUpName}Service ${cl.modelLowName}Service;
|
||||
#end
|
||||
#if(${serverHasUpload} || ${serverHasDownload})
|
||||
#if(${isCloud}=="cloud")
|
||||
private final ConfigValueUtil configValueUtil;
|
||||
private final FileUploadApi fileUploadApi;
|
||||
private final FileApi fileApi;
|
||||
#end
|
||||
#end
|
||||
##表头按钮接口
|
||||
#if(!${isList})## 纯表单方法
|
||||
#CreateMethod()
|
||||
#UpdateMethod()
|
||||
#DeleteMethod()
|
||||
#else## 列表方法
|
||||
## 获取列表信息
|
||||
#GetList()
|
||||
## 表头按键接口
|
||||
#foreach($btn in ${btnsList})
|
||||
#if(${btn.value}=='add' && ${btn.show})
|
||||
#CreateMethod()
|
||||
#end
|
||||
#if(${btn.value}=='upload' && ${btn.show})
|
||||
#UploaderMethod()
|
||||
#end
|
||||
#if(${btn.value}=='download' && ${btn.show})
|
||||
#ExportMethod()
|
||||
#end
|
||||
#if(${btn.value}=='batchRemove' && ${btn.show})
|
||||
#end
|
||||
#if(${btn.value}=='batchPrint' && ${btn.show})
|
||||
#BatchPrintMethod()
|
||||
#end
|
||||
#end
|
||||
## 删除全部走批量删除方法。(必生成)
|
||||
#DeleteMethod()
|
||||
#BatchRemoveMethod()
|
||||
## 行内按钮接口
|
||||
#foreach($column in ${columnBtnsList})
|
||||
#if(${column.value}=='detail' && ${column.show} && ${isList})
|
||||
#GetDetailMethod()
|
||||
#end
|
||||
#if(${column.value}=='remove' && ${column.show} && ${isList})
|
||||
## #DeleteMethod()
|
||||
#end
|
||||
#if(${column.value}=='edit' && ${column.show} && ${isList})
|
||||
#UpdateMethod()
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
## 获取数据接口(不转换数据)
|
||||
#GetInfoMethod()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package ${package.Entity};
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
#foreach($field in ${table.fields})
|
||||
#if(${field.propertyType} =='BigDecimal')
|
||||
import java.math.BigDecimal;
|
||||
#elseif(${field.propertyType} == 'BigInteger')
|
||||
import java.math.BigInteger;
|
||||
#elseif(${field.propertyType} == 'LocalTime')
|
||||
import java.sql.Time;
|
||||
#end
|
||||
#end
|
||||
/**
|
||||
* ${table.comment}
|
||||
*
|
||||
* @版本: ${genInfo.version}
|
||||
* @版权: ${genInfo.copyright}
|
||||
* @作者: ${genInfo.createUser}
|
||||
* @日期: ${genInfo.createDate}
|
||||
*/
|
||||
@Data
|
||||
#if(${table.convert})
|
||||
@TableName("${table.name}")
|
||||
#end
|
||||
#if(${activeRecord})
|
||||
public class ${table.entity} extends Model<${table.entity}> {
|
||||
#else
|
||||
public class ${table.entityName} {
|
||||
#end
|
||||
#foreach($field in ${table.fields})
|
||||
#set($tableField = "${field.name}")
|
||||
#set($Property = "${field.propertyName}")
|
||||
#if('f_tenant_id'==${tableField} || 'F_TENANT_ID'==${tableField})
|
||||
@TableField(value = "${tableField}",fill = FieldFill.INSERT_UPDATE)
|
||||
#elseif('f_delete_time' == ${tableField.toLowerCase()} || 'f_delete_user_id' == ${tableField.toLowerCase()})
|
||||
@TableField(value = "${tableField}",fill = FieldFill.UPDATE)
|
||||
#elseif(${field.keyFlag}=='true')
|
||||
@TableId(value ="${tableField}" #if(${field.keyIdentityFlag}),type = IdType.AUTO #end)
|
||||
#else
|
||||
#if(${tableNotSystemField.contains(${Property.toUpperCase()})})
|
||||
@TableField(value = "${tableField}" , updateStrategy = FieldStrategy.ALWAYS)
|
||||
#else
|
||||
@TableField("${tableField}")
|
||||
#end
|
||||
#end
|
||||
#if('f_version'==${tableField.toLowerCase()})
|
||||
@Version
|
||||
@JSONField(name = "f_version")
|
||||
#else
|
||||
@JSONField(name = "${tableField}")
|
||||
#end
|
||||
#if(${field.propertyType} =='LocalDateTime' || ${field.propertyType} =='datePicker' || ${field.propertyType} =='LocalDate')
|
||||
private Date ${Property};
|
||||
#elseif(${field.propertyType} =='Clob')
|
||||
private String ${Property};
|
||||
#elseif(${field.propertyType} == 'LocalTime')
|
||||
private Time ${Property};
|
||||
#elseif(${field.type} =='datetime')
|
||||
private Date ${Property};
|
||||
#elseif(${field.type} =='datetime')
|
||||
private Date ${Property};
|
||||
#else
|
||||
## 删除标记和版本字段强制int
|
||||
#if(${tableField.toLowerCase()} =='f_version' || ${tableField.toLowerCase()} =='f_delete_mark')
|
||||
private Integer ${Property};
|
||||
#else
|
||||
private ${field.propertyType} ${Property};
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
||||
#if(${main})
|
||||
#foreach($item in $allTableNameList)
|
||||
#set($TableEntity = "${item.table.substring(0,1).toUpperCase()}${item.table.substring(1)}")
|
||||
#set($tableEntity = "${item.table.substring(0,1).toLowerCase()}${item.table.substring(1)}")
|
||||
## 副表一对一
|
||||
#if(${item.tableTag} =='sub-jnpf')
|
||||
@JSONField(name = "${tableEntity}")
|
||||
@TableField(exist = false)
|
||||
private ${TableEntity}Entity $tableEntity;
|
||||
#end
|
||||
## 子表一对多
|
||||
#if(${item.tableTag} =='sub')
|
||||
@JSONField(name = "${item.tableName}")
|
||||
@TableField(exist = false)
|
||||
private List<${TableEntity}Entity> $tableEntity;
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#set($name = "${context.className.substring(0,1).toLowerCase()}${context.className.substring(1)}")
|
||||
#set($pKeyName =${context.pKeyName})
|
||||
|
||||
#set($peimaryKeyName = "${pKeyName.substring(0,1).toUpperCase()}${pKeyName.substring(1)}")
|
||||
#set($peimaryKeyname = "${pKeyName.substring(0,1).toLowerCase()}${pKeyName.substring(1)}")
|
||||
|
||||
package ${context.package}.model.$!{name.toLowerCase()};
|
||||
|
||||
import lombok.Data;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
/**
|
||||
*
|
||||
* ${context.genInfo.description}
|
||||
* @版本: ${context.genInfo.version}
|
||||
* @版权: ${context.genInfo.copyright}
|
||||
* @作者: ${context.genInfo.createUser}
|
||||
* @日期: ${context.genInfo.createDate}
|
||||
*/
|
||||
@Data
|
||||
public class $!{context.className}ExcelErrorVO extends $!{context.className}ExcelVO{
|
||||
|
||||
@Excel(name = "异常原因",orderNum = "-999")
|
||||
@JSONField(name = "errorsInfo")
|
||||
private String errorsInfo;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
#parse("PublicMacro/ExcelMarco.vm")
|
||||
##通用参数
|
||||
#parse("PublicMacro/ConstantMarco.vm")
|
||||
#ConstantParams()
|
||||
#set($moduleName = "${context.genInfo.className.toLowerCase()}")
|
||||
package ${context.package}.model.${moduleName};
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Time;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
/**
|
||||
*
|
||||
* ${context.genInfo.description}
|
||||
* @版本: ${context.genInfo.version}
|
||||
* @版权: ${context.genInfo.copyright}
|
||||
* @作者: ${context.genInfo.createUser}
|
||||
* @日期: ${context.genInfo.createDate}
|
||||
*/
|
||||
@Data
|
||||
public class $!{context.className}ExcelVO{
|
||||
#if(${context.isMain} && !${context.isComplexVo})
|
||||
## 复杂表头对象
|
||||
#foreach($item in ${context.complexHeaderList})
|
||||
#if(${item.childColumns.size()}>0)
|
||||
@JsonProperty("${item.id}")
|
||||
@ExcelCollection(name="${item.fullName}(${item.id})",orderNum = "0")
|
||||
private List<Complex${item.id}ExcelVO> ${item.id};
|
||||
#end
|
||||
#end
|
||||
#foreach($fieLdsModel in ${context.importFields})
|
||||
#set($html = $fieLdsModel)
|
||||
#set($vModel = "${html.vModel}")
|
||||
#set($config = $html.config)
|
||||
#set($jnpfkey = "${config.jnpfKey}")
|
||||
## 判断是否子表
|
||||
#if(${vModel.toLowerCase().startsWith("tablefield")} )
|
||||
@JsonProperty("${vModel}")
|
||||
@ExcelCollection(name="${html.label}(${vModel})",orderNum = "${html.childList.size()}")
|
||||
private List<${html.aliasUpName}ExcelVO> ${vModel};
|
||||
|
||||
#else
|
||||
#if(!${context.complexFieldList.contains(${vModel})})
|
||||
#CreateExcelFields($html,${foreach.index})
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#elseif(${context.isMain} && ${context.isComplexVo})
|
||||
#foreach($fieLdsModel in ${context.importFields})
|
||||
#set($html = $fieLdsModel)
|
||||
#set($vModel = "${html.vModel}")
|
||||
#set($config = $html.config)
|
||||
#set($jnpfkey = "${config.jnpfKey}")
|
||||
##复杂表头字段
|
||||
#if(${context.complexList.contains(${vModel})} )
|
||||
#CreateExcelFields($html,${foreach.index})
|
||||
#end
|
||||
#end
|
||||
#else
|
||||
#foreach($html in ${context.children.childList})
|
||||
#set($fieLdsModel = ${html.fieLdsModel})
|
||||
#set($config = ${fieLdsModel.config})
|
||||
#set($jnpfkey = ${config.jnpfKey})
|
||||
#set($vModel = "${fieLdsModel.vModel}")
|
||||
#set($fieldName=${config.label})
|
||||
#if($!vModel && ${fieLdsModel.needImport} && !$DownLoadSkipUint.contains($jnpfkey))
|
||||
#CreateExcelFields($fieLdsModel,${foreach.index})
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
##通用参数
|
||||
#parse("PublicMacro/ConstantMarco.vm")
|
||||
#ConstantParams()
|
||||
#set($modelPath = "model."+${context.modelPathName})
|
||||
#set($pKeyName =${context.pKeyName})
|
||||
#set($pKeyNameOriginal =${context.pKeyNameOriginal})
|
||||
#set($peimaryKeyname = "${pKeyName.substring(0,1).toLowerCase()}${pKeyName.substring(1)}")
|
||||
package ${context.package}.${modelPath};
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* ${context.genInfo.description}
|
||||
* @版本: ${context.genInfo.version}
|
||||
* @版权: ${context.genInfo.copyright}
|
||||
* @作者: ${context.genInfo.createUser}
|
||||
* @日期: ${context.genInfo.createDate}
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "表单参数")
|
||||
public class $!{context.className}Form {
|
||||
/** 主键 */
|
||||
@Schema(description = "主键")
|
||||
@JSONField(name = "${pKeyNameOriginal}")
|
||||
private String $!{peimaryKeyname};
|
||||
|
||||
#if(${context.version})
|
||||
/** 乐观锁 **/
|
||||
@Schema(description = "乐观锁")
|
||||
@JsonProperty("f_version")
|
||||
@JSONField(name = "f_version")
|
||||
private Integer version;
|
||||
#end
|
||||
#if(${context.isFlow})
|
||||
/** 流程id **/
|
||||
@Schema(description = "流程id")
|
||||
@JsonProperty("flowId")
|
||||
@JSONField(name = "f_flow_id")
|
||||
private String flowId;
|
||||
/** 流程权限列表 **/
|
||||
@JsonProperty("formOperates")
|
||||
private List<Map<String,Object>> formOperates = new ArrayList<>();
|
||||
#end
|
||||
|
||||
## 主副表字段
|
||||
#foreach($item in ${context.form})
|
||||
#if($item.jnpfKey=='mast' || $item.jnpfKey=='mastTable')
|
||||
#set($html = $item.formColumnModel.fieLdsModel)
|
||||
#set($vModel = "${html.vModel}")
|
||||
#set($fieldAlias = "${html.fieldAlias}")
|
||||
#if($item.jnpfKey=='mastTable')
|
||||
#set($html = $item.formMastTableModel.mastTable.fieLdsModel)
|
||||
#set($vModel = "${item.formMastTableModel.vModel}")
|
||||
#set($fieldAlias = "jnpf_"+"${html.tableAlias}"+"_jnpf_"+ "${html.fieldAlias}")
|
||||
#end
|
||||
#set($resultType = "String")
|
||||
#if($vModel!='')
|
||||
#set($config = $html.config)
|
||||
#set($jnpfkey = "${config.jnpfKey}")
|
||||
#set($fieldName=${config.label})
|
||||
#if(${jnpfkey}!='text' && ${jnpfkey}!='divider')
|
||||
#if(${jnpfkey}=='inputNumber' || ${jnpfkey}=='calculate')
|
||||
#if(${fieLdsModel.formColumnModel.fieLdsModel.precision}==0)
|
||||
#set($resultType = "Integer")
|
||||
#else
|
||||
#set($resultType = "BigDecimal")
|
||||
#end
|
||||
#elseif(${jnpfkey}=='slider' || ${jnpfkey} == 'rate')
|
||||
#set($resultType = "BigDecimal")
|
||||
#elseif(${jnpfkey} == 'switch')
|
||||
#set($resultType = "Integer")
|
||||
#elseif(${multipleUnit.contains(${jnpfkey})} || ${UploadFileUnit.contains(${jnpfkey})})
|
||||
#set($resultType = "Object")
|
||||
#else
|
||||
#set($resultType = "String")
|
||||
#end
|
||||
/** ${fieldName} **/
|
||||
@Schema(description = "${fieldName}")
|
||||
@JsonProperty("${vModel}")
|
||||
@JSONField(name = "${vModel}")
|
||||
private ${resultType} ${fieldAlias};
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
||||
#foreach($html in ${context.children})
|
||||
/** 子表数据 **/
|
||||
@Schema(description = "${html.aliasLowName}子表数据")
|
||||
@JsonProperty("${html.tableModel}")
|
||||
@JSONField(name = "${html.tableModel}")
|
||||
private List<${html.aliasUpName}Model> ${html.aliasLowName}List;
|
||||
#end
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
${context.paramConst}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package ${package.Mapper};
|
||||
|
||||
|
||||
import ${package.Entity}.${table.entityName};
|
||||
import ${superMapperClassPackage};
|
||||
import jnpf.base.mapper.SuperMapper;
|
||||
|
||||
/**
|
||||
* ${genInfo.description}
|
||||
* 版本: ${genInfo.version}
|
||||
* 版权: ${genInfo.copyright}
|
||||
* 作者: ${genInfo.createUser}
|
||||
* 日期: ${genInfo.createDate}
|
||||
*/
|
||||
public interface ${table.mapperName} extends SuperMapper<${table.entityName}> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${package.Mapper}.${table.mapperName}">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,83 @@
|
||||
#parse("PublicMacro/ConstantMarco.vm")
|
||||
#ConstantParams()
|
||||
#set($moduleName = "${context.genInfo.className.toLowerCase()}")
|
||||
#if($context.isForm)
|
||||
#set($package = "package ${context.package}.${context.isForm}.model.${moduleName};")
|
||||
#else
|
||||
#set($package = "package ${context.package}.model.${moduleName};")
|
||||
#end
|
||||
${package}
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
*
|
||||
* ${context.genInfo.description}
|
||||
* 版本: ${context.genInfo.version}
|
||||
* 版权: ${context.genInfo.copyright}
|
||||
* 作者: ${context.genInfo.createUser}
|
||||
* 日期: ${context.genInfo.createDate}
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "${context.className}子表参数")
|
||||
public class ${context.className}Model {
|
||||
|
||||
#if($!{context.thisKeyFields})
|
||||
#set($keyField =${context.thisKeyFields.field})
|
||||
/** 子表:${context.className} 主键:${keyField} **/
|
||||
@Schema(description = "主键")
|
||||
@JsonProperty("${keyField}")
|
||||
#if(${context.thisKeyFields.dataType} =="int")
|
||||
private Integer ${keyField};
|
||||
#elseif(${context.thisKeyFields.dataType} == "bigint")
|
||||
private Long ${keyField};
|
||||
#else
|
||||
private String ${keyField};
|
||||
#end
|
||||
#end
|
||||
#foreach($html in ${context.children.childList})
|
||||
#set($fieLdsModel = ${html.fieLdsModel})
|
||||
#set($config = ${fieLdsModel.config})
|
||||
#set($jnpfkey = ${config.jnpfKey})
|
||||
#set($vModel = "${fieLdsModel.vModel}")
|
||||
#set($fieldName=${config.label})
|
||||
#set($fieldAlias="${fieLdsModel.fieldAlias}")
|
||||
#if($vModel)
|
||||
#if(${jnpfkey}=='datePicker')
|
||||
#set($resultType="Long")
|
||||
#elseif(${jnpfkey}=='inputNumber' || ${jnpfkey}=='calculate')
|
||||
#if(${fieLdsModel.precision}==0)
|
||||
#set($resultType="Integer")
|
||||
#else
|
||||
#set($resultType="BigDecimal")
|
||||
#end
|
||||
#elseif(${jnpfkey}=='slider'|| ${jnpfkey}=='rate')
|
||||
#set($resultType="BigDecimal")
|
||||
#elseif(${jnpfkey}=='relationFormAttr'|| ${jnpfkey}=='popupAttr' ||${jnpfkey}=='relationForm' )
|
||||
#set($resultType="String")
|
||||
#elseif(${multipleUnit.contains($jnpfkey)} || ${UploadFileUnit.contains(${jnpfkey})})
|
||||
#set($resultType="Object")
|
||||
#else
|
||||
#set($resultType="String")
|
||||
#end
|
||||
/** ${fieldName} **/
|
||||
@Schema(description = "${fieldName}")
|
||||
#if($fieLdsModel.needImport)
|
||||
@Excel(name = "${fieldName}",orderNum = "1",isImportField = "true")
|
||||
#end
|
||||
@JsonProperty("${vModel}")
|
||||
@JSONField(name = "${vModel}")
|
||||
private ${resultType} ${fieldAlias};
|
||||
#if(${jnpfkey}=='relationForm')
|
||||
private String ${vModel}_id;
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
#set($name = "${context.className.substring(0,1).toUpperCase()}${context.className.substring(1)}")
|
||||
package ${context.package}.model.$!{name.toLowerCase()};
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import jnpf.base.Pagination;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* ${context.genInfo.description}
|
||||
* @版本: ${context.genInfo.version}
|
||||
* @版权: ${context.genInfo.copyright}
|
||||
* @作者: ${context.genInfo.createUser}
|
||||
* @日期: ${context.genInfo.createDate}
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "列表查询参数")
|
||||
public class $!{name}Pagination extends Pagination {
|
||||
#if($!{context.isFlow})
|
||||
/** 流程模板id */
|
||||
@Schema(description = "流程模板id")
|
||||
private String flowId;
|
||||
@Schema(description = "流程状态")
|
||||
private Integer jnpfFlowState;
|
||||
#end
|
||||
/** 关键词搜索 */
|
||||
@Schema(description = "关键词搜索")
|
||||
private String jnpfKeyword;
|
||||
/** 查询key */
|
||||
@Schema(description = "查询key")
|
||||
private String[] selectKey;
|
||||
/** 选中数据数组id */
|
||||
@Schema(description = "选中数据数组id")
|
||||
private Object[] selectIds;
|
||||
/** json */
|
||||
@Schema(description = "json")
|
||||
private String json;
|
||||
/** 数据类型 0-当前页,1-全部数据 */
|
||||
@Schema(description = "数据类型 0-当前页,1-全部数据")
|
||||
private String dataType;
|
||||
/** 高级查询 */
|
||||
@Schema(description = "高级查询")
|
||||
private String superQueryJson;
|
||||
/** 功能id */
|
||||
@Schema(description = "功能id")
|
||||
private String moduleId;
|
||||
/** 菜单id */
|
||||
@Schema(description = "菜单id")
|
||||
private String menuId;
|
||||
#foreach($search in ${context.searchListAll})
|
||||
#set($jsonKey =${search.id})
|
||||
#set($label = ${search.label})
|
||||
#set($fieldAliasName = "${search.afterVModel}")
|
||||
#set($tableAliasName = "${search.tableAliasName}")
|
||||
#if($jsonKey.contains("_jnpf_"))
|
||||
#set($fieldAliasName = "jnpf_${tableAliasName}_jnpf_${fieldAliasName}")
|
||||
#elseif($jsonKey.toLowerCase().startsWith("tablefield"))
|
||||
#set($fieldAliasName = "${search.tableAliasName}_${fieldAliasName}")
|
||||
#end
|
||||
/** ${label} */
|
||||
@Schema(description = "${label}")
|
||||
@JsonProperty("$jsonKey")
|
||||
@JSONField(name = "${fieldAliasName}")
|
||||
private Object ${fieldAliasName};
|
||||
#end
|
||||
#if(${context.treeTable} == true)
|
||||
/**
|
||||
* 树形异步父级字段传值
|
||||
*/
|
||||
private String treeParentValue;
|
||||
/**
|
||||
* 是否有参数
|
||||
*/
|
||||
private boolean hasParam=false;
|
||||
#end
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package ${package.Service};
|
||||
|
||||
#set($moduleName = "${mainModelName.substring(0,1).toLowerCase()}${mainModelName.substring(1).toLowerCase()}")
|
||||
import ${package.Entity}.*;
|
||||
import jnpf.base.service.SuperService;
|
||||
#if(${main})
|
||||
import ${modulePackageName}.model.${moduleName}.*;
|
||||
import java.util.*;
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${genInfo.description}
|
||||
* 版本: ${genInfo.version}
|
||||
* 版权: ${genInfo.copyright}
|
||||
* 作者: ${genInfo.createUser}
|
||||
* 日期: ${genInfo.createDate}
|
||||
*/
|
||||
public interface ${table.serviceName} extends SuperService<${table.entityName}> {
|
||||
#if(${main})
|
||||
#if(${pKeyName.toLowerCase().startsWith('f_')})
|
||||
#set($peimaryKeyname = "${pKeyName.substring(2,3).toLowerCase()}${pKeyName.substring(3)}")
|
||||
#else
|
||||
#set($peimaryKeyname = "${pKeyName.substring(0,1).toLowerCase()}${pKeyName.substring(1).toLowerCase()}")
|
||||
#end
|
||||
#if($isList)
|
||||
List<${table.entityName}> getList(${Name}Pagination ${name}Pagination);
|
||||
|
||||
List<${table.entityName}> getTypeList(${Name}Pagination ${name}Pagination,String dataType);
|
||||
|
||||
#end
|
||||
${table.entityName} getInfo(String ${peimaryKeyname});
|
||||
|
||||
void delete(${table.entityName} entity);
|
||||
|
||||
void create(${table.entityName} entity);
|
||||
|
||||
boolean update(String ${peimaryKeyname}, ${table.entityName} entity);
|
||||
|
||||
String checkForm(${Name}Form form,int i);
|
||||
|
||||
void saveOrUpdate(${Name}Form ${name}Form,String id, boolean isSave);
|
||||
|
||||
#if($isFlow)
|
||||
void saveState(String flowTaskId, Integer flowState);
|
||||
#end
|
||||
#end
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
#parse("PublicMacro/ServiceImpMarco.vm")
|
||||
#set($moduleName = "${mainModelName.substring(0,1).toLowerCase()}${mainModelName.substring(1).toLowerCase()}")
|
||||
#set($peimaryKeyName="${pKeyName.substring(0,1).toUpperCase()}${pKeyName.substring(1)}")
|
||||
package ${package.ServiceImpl};
|
||||
|
||||
import ${package.Entity}.*;
|
||||
import ${package.Mapper}.${table.mapperName};
|
||||
import ${package.Service}.*;
|
||||
import ${modulePackageName}.model.${moduleName}.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jnpf.base.service.SuperServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jnpf.util.GeneraterSwapUtil;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import lombok.Cleanup;
|
||||
import jnpf.database.util.DynamicDataSourceUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import jnpf.i18n.util.I18nUtil;
|
||||
import jnpf.exception.DataException;
|
||||
import jnpf.constant.MsgCode;
|
||||
#if(${DS})
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import jnpf.database.util.DataSourceUtil;
|
||||
import jnpf.database.model.entity.DbLinkEntity;
|
||||
import jnpf.database.plugins.DynamicSourceGeneratorInterface;
|
||||
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||
#end
|
||||
#if(${main})
|
||||
import java.math.BigDecimal;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.github.yulichang.wrapper.segments.Select;
|
||||
import jnpf.model.QueryAllModel;
|
||||
import jnpf.util.*;
|
||||
import java.util.*;
|
||||
import jnpf.base.UserInfo;
|
||||
import jnpf.permission.entity.UserEntity;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
#end
|
||||
/**
|
||||
*
|
||||
* ${genInfo.description}
|
||||
* 版本: ${genInfo.version}
|
||||
* 版权: ${genInfo.copyright}
|
||||
* 作者: ${genInfo.createUser}
|
||||
* 日期: ${genInfo.createDate}
|
||||
*/
|
||||
@Service
|
||||
#if(${DS})
|
||||
@DS("${DS}")
|
||||
#end
|
||||
@RequiredArgsConstructor
|
||||
public class ${table.serviceImplName} extends SuperServiceImpl<${table.mapperName}, ${table.entityName}> implements ${table.serviceName}#if(${DS}),DynamicSourceGeneratorInterface #end{
|
||||
private final GeneraterSwapUtil generaterSwapUtil;
|
||||
#if(${main})
|
||||
#foreach($child in ${columnTableHandle})
|
||||
private final ${child.modelUpName}Service ${child.modelLowName}Service;
|
||||
#end
|
||||
#foreach($subfield in ${childTableHandle})
|
||||
private final ${subfield.aliasUpName}Service ${subfield.aliasLowName}Service;
|
||||
#end
|
||||
private ${Name}Constant paramConst = ${Name}Constant.get();
|
||||
## 通用变量
|
||||
#set($Name = "${genInfo.className.substring(0,1).toUpperCase()}${genInfo.className.substring(1)}")
|
||||
#set($name = "${genInfo.className.substring(0,1).toLowerCase()}${genInfo.className.substring(1)}")
|
||||
#set($QueryWrapper = "${name}QueryWrapper")
|
||||
#set($serviceName = "${table.serviceName.substring(0,1).toLowerCase()}${table.serviceName.substring(1)}")
|
||||
#set($Entity = "${table.entityName}")
|
||||
#set($searchListSize =$!{searchList})
|
||||
#if($isList)
|
||||
## 列表接口
|
||||
#GetTypeList()
|
||||
#end
|
||||
## 增删改查接口
|
||||
#CrudMethod()
|
||||
## 表单验证
|
||||
#CheckForm()
|
||||
## 业务主键验证
|
||||
#if(${useBusinessKey})
|
||||
#CheckBusinessKey()
|
||||
#end
|
||||
## 保存修改事务方法
|
||||
#SaveOrUpdate()
|
||||
#end
|
||||
## 数据源切换
|
||||
#if(${DS})
|
||||
@Override
|
||||
public DataSourceUtil getDataSource() {
|
||||
return generaterSwapUtil.getDataSource(this.getClass().getAnnotation(DS.class).value());
|
||||
}
|
||||
#end
|
||||
}
|
||||
Reference in new issue
Block a user