fase()规范化
parent
a9aa680abe
commit
91ceda487b
|
@ -21,5 +21,5 @@ public class ServiceNameConstants {
|
|||
*/
|
||||
public static final String FILE_SERVICE = "muyu-file";
|
||||
|
||||
public static final String TEST_MUYU = "muyu-test";
|
||||
public static final String EDITION_MUYU = "muyu-edition";
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.muyu.file.controller;
|
|||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.file.FileUtils;
|
||||
import com.muyu.file.service.ISysFileService;
|
||||
import com.muyu.common.system.domain.SysFile;
|
||||
import com.muyu.file.service.ISysFileService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
@ -31,9 +31,7 @@ public class FastDfsSysFileServiceImpl implements ISysFileService {
|
|||
* FastDfs文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
*
|
||||
* @return 访问地址
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -12,9 +12,7 @@ public interface ISysFileService {
|
|||
* 文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
*
|
||||
* @return 访问地址
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public String uploadFile(MultipartFile file) throws Exception;
|
||||
|
|
|
@ -36,9 +36,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
|
|||
* 本地文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
*
|
||||
* @return 访问地址
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -28,9 +28,7 @@ public class MinioSysFileServiceImpl implements ISysFileService {
|
|||
* Minio文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
*
|
||||
* @return 访问地址
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -38,9 +38,7 @@ public class FileUploadUtils {
|
|||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
*
|
||||
* @return 文件名称
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public static final String upload(String baseDir, MultipartFile file) throws IOException {
|
||||
|
@ -59,9 +57,7 @@ public class FileUploadUtils {
|
|||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param allowedExtension 上传文件类型
|
||||
*
|
||||
* @return 返回上传成功的文件名
|
||||
*
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws FileNameLengthLimitExceededException 文件名太长
|
||||
* @throws IOException 比如读写文件出错时
|
||||
|
@ -112,7 +108,6 @@ public class FileUploadUtils {
|
|||
* 文件大小校验
|
||||
*
|
||||
* @param file 上传的文件
|
||||
*
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
|
@ -149,7 +144,6 @@ public class FileUploadUtils {
|
|||
*
|
||||
* @param extension 上传文件类型
|
||||
* @param allowedExtension 允许上传文件类型
|
||||
*
|
||||
* @return true/false
|
||||
*/
|
||||
public static final boolean isAllowedExtension(String extension, String[] allowedExtension) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.muyu.gen.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
|
|
@ -15,8 +15,6 @@ import javax.validation.constraints.NotBlank;
|
|||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 业务表 gen_table
|
||||
*
|
||||
|
|
|
@ -15,7 +15,6 @@ public interface GenTableColumnMapper extends BaseMapper<GenTableColumn> {
|
|||
* 根据表名称查询列信息
|
||||
*
|
||||
* @param tableName 表名称
|
||||
*
|
||||
* @return 列信息
|
||||
*/
|
||||
List<GenTableColumn> selectDbTableColumnsByName(String tableName);
|
||||
|
@ -24,7 +23,6 @@ public interface GenTableColumnMapper extends BaseMapper<GenTableColumn> {
|
|||
* 查询业务字段列表
|
||||
*
|
||||
* @param tableId 业务字段编号
|
||||
*
|
||||
* @return 业务字段集合
|
||||
*/
|
||||
List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
||||
|
@ -33,7 +31,6 @@ public interface GenTableColumnMapper extends BaseMapper<GenTableColumn> {
|
|||
* 新增业务字段
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||
|
@ -42,7 +39,6 @@ public interface GenTableColumnMapper extends BaseMapper<GenTableColumn> {
|
|||
* 修改业务字段
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||
|
@ -51,7 +47,6 @@ public interface GenTableColumnMapper extends BaseMapper<GenTableColumn> {
|
|||
* 删除业务字段
|
||||
*
|
||||
* @param genTableColumns 列数据
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGenTableColumns(List<GenTableColumn> genTableColumns);
|
||||
|
@ -60,7 +55,6 @@ public interface GenTableColumnMapper extends BaseMapper<GenTableColumn> {
|
|||
* 批量删除业务字段
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGenTableColumnByIds(Long[] ids);
|
||||
|
|
|
@ -15,7 +15,6 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
|
|||
* 查询业务列表
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 业务集合
|
||||
*/
|
||||
List<GenTable> selectGenTableList(GenTable genTable);
|
||||
|
@ -24,7 +23,6 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
|
|||
* 查询据库列表
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 数据库表集合
|
||||
*/
|
||||
List<GenTable> selectDbTableList(GenTable genTable);
|
||||
|
@ -33,7 +31,6 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
|
|||
* 查询据库列表
|
||||
*
|
||||
* @param tableNames 表名称组
|
||||
*
|
||||
* @return 数据库表集合
|
||||
*/
|
||||
List<GenTable> selectDbTableListByNames(String[] tableNames);
|
||||
|
@ -49,7 +46,6 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
|
|||
* 查询表ID业务信息
|
||||
*
|
||||
* @param id 业务ID
|
||||
*
|
||||
* @return 业务信息
|
||||
*/
|
||||
GenTable selectGenTableById(Long id);
|
||||
|
@ -58,7 +54,6 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
|
|||
* 查询表名称业务信息
|
||||
*
|
||||
* @param tableName 表名称
|
||||
*
|
||||
* @return 业务信息
|
||||
*/
|
||||
GenTable selectGenTableByName(String tableName);
|
||||
|
@ -67,7 +62,6 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
|
|||
* 新增业务
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGenTable(GenTable genTable);
|
||||
|
@ -76,7 +70,6 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
|
|||
* 修改业务
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGenTable(GenTable genTable);
|
||||
|
@ -85,7 +78,6 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
|
|||
* 批量删除业务
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGenTableByIds(Long[] ids);
|
||||
|
|
|
@ -22,7 +22,6 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
|||
* 查询业务字段列表
|
||||
*
|
||||
* @param tableId 业务字段编号
|
||||
*
|
||||
* @return 业务字段集合
|
||||
*/
|
||||
@Override
|
||||
|
@ -34,7 +33,6 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
|||
* 新增业务字段
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -46,7 +44,6 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
|||
* 修改业务字段
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -58,7 +55,6 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
|||
* 删除业务字段对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -58,7 +58,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
*
|
||||
* @param table 业务表信息
|
||||
* @param template 模板文件路径
|
||||
*
|
||||
* @return 生成地址
|
||||
*/
|
||||
public static String getGenPath(GenTable table, String template) {
|
||||
|
@ -73,7 +72,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
* 查询业务信息
|
||||
*
|
||||
* @param id 业务ID
|
||||
*
|
||||
* @return 业务信息
|
||||
*/
|
||||
@Override
|
||||
|
@ -87,7 +85,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
* 查询业务列表
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 业务集合
|
||||
*/
|
||||
@Override
|
||||
|
@ -99,7 +96,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
* 查询据库列表
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 数据库表集合
|
||||
*/
|
||||
@Override
|
||||
|
@ -111,7 +107,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
* 查询据库列表
|
||||
*
|
||||
* @param tableNames 表名称组
|
||||
*
|
||||
* @return 数据库表集合
|
||||
*/
|
||||
@Override
|
||||
|
@ -133,7 +128,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
* 修改业务
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -153,7 +147,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
* 删除业务对象
|
||||
*
|
||||
* @param tableIds 需要删除的数据ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -195,7 +188,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
* 预览代码
|
||||
*
|
||||
* @param tableId 表编号
|
||||
*
|
||||
* @return 预览数据列表
|
||||
*/
|
||||
@Override
|
||||
|
@ -227,7 +219,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
* 生成代码(下载方式)
|
||||
*
|
||||
* @param tableName 表名称
|
||||
*
|
||||
* @return 数据
|
||||
*/
|
||||
@Override
|
||||
|
@ -326,7 +317,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||
* 批量生成代码(下载方式)
|
||||
*
|
||||
* @param tableNames 表数组
|
||||
*
|
||||
* @return 数据
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -14,7 +14,6 @@ public interface IGenTableColumnService {
|
|||
* 查询业务字段列表
|
||||
*
|
||||
* @param tableId 业务字段编号
|
||||
*
|
||||
* @return 业务字段集合
|
||||
*/
|
||||
List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
||||
|
@ -23,7 +22,6 @@ public interface IGenTableColumnService {
|
|||
* 新增业务字段
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||
|
@ -32,7 +30,6 @@ public interface IGenTableColumnService {
|
|||
* 修改业务字段
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||
|
@ -41,7 +38,6 @@ public interface IGenTableColumnService {
|
|||
* 删除业务字段信息
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGenTableColumnByIds(String ids);
|
||||
|
|
|
@ -15,7 +15,6 @@ public interface IGenTableService {
|
|||
* 查询业务列表
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 业务集合
|
||||
*/
|
||||
List<GenTable> selectGenTableList(GenTable genTable);
|
||||
|
@ -24,7 +23,6 @@ public interface IGenTableService {
|
|||
* 查询据库列表
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 数据库表集合
|
||||
*/
|
||||
List<GenTable> selectDbTableList(GenTable genTable);
|
||||
|
@ -33,7 +31,6 @@ public interface IGenTableService {
|
|||
* 查询据库列表
|
||||
*
|
||||
* @param tableNames 表名称组
|
||||
*
|
||||
* @return 数据库表集合
|
||||
*/
|
||||
List<GenTable> selectDbTableListByNames(String[] tableNames);
|
||||
|
@ -49,7 +46,6 @@ public interface IGenTableService {
|
|||
* 查询业务信息
|
||||
*
|
||||
* @param id 业务ID
|
||||
*
|
||||
* @return 业务信息
|
||||
*/
|
||||
GenTable selectGenTableById(Long id);
|
||||
|
@ -58,7 +54,6 @@ public interface IGenTableService {
|
|||
* 修改业务
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
void updateGenTable(GenTable genTable);
|
||||
|
@ -67,7 +62,6 @@ public interface IGenTableService {
|
|||
* 删除业务信息
|
||||
*
|
||||
* @param tableIds 需要删除的表数据ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
void deleteGenTableByIds(Long[] tableIds);
|
||||
|
@ -83,7 +77,6 @@ public interface IGenTableService {
|
|||
* 预览代码
|
||||
*
|
||||
* @param tableId 表编号
|
||||
*
|
||||
* @return 预览数据列表
|
||||
*/
|
||||
Map<String, String> previewCode(Long tableId);
|
||||
|
@ -92,7 +85,6 @@ public interface IGenTableService {
|
|||
* 生成代码(下载方式)
|
||||
*
|
||||
* @param tableName 表名称
|
||||
*
|
||||
* @return 数据
|
||||
*/
|
||||
byte[] downloadCode(String tableName);
|
||||
|
@ -101,7 +93,6 @@ public interface IGenTableService {
|
|||
* 生成代码(自定义路径)
|
||||
*
|
||||
* @param tableName 表名称
|
||||
*
|
||||
* @return 数据
|
||||
*/
|
||||
void generatorCode(String tableName);
|
||||
|
@ -117,7 +108,6 @@ public interface IGenTableService {
|
|||
* 批量生成代码(下载方式)
|
||||
*
|
||||
* @param tableNames 表数组
|
||||
*
|
||||
* @return 数据
|
||||
*/
|
||||
byte[] downloadCode(String[] tableNames);
|
||||
|
|
|
@ -116,7 +116,6 @@ public class GenUtils {
|
|||
*
|
||||
* @param arr 数组
|
||||
* @param targetValue 值
|
||||
*
|
||||
* @return 是否包含
|
||||
*/
|
||||
public static boolean arraysContains(String[] arr, String targetValue) {
|
||||
|
@ -127,7 +126,6 @@ public class GenUtils {
|
|||
* 获取模块名
|
||||
*
|
||||
* @param packageName 包名
|
||||
*
|
||||
* @return 模块名
|
||||
*/
|
||||
public static String getModuleName(String packageName) {
|
||||
|
@ -140,7 +138,6 @@ public class GenUtils {
|
|||
* 获取业务名
|
||||
*
|
||||
* @param tableName 表名
|
||||
*
|
||||
* @return 业务名
|
||||
*/
|
||||
public static String getBusinessName(String tableName) {
|
||||
|
@ -153,7 +150,6 @@ public class GenUtils {
|
|||
* 表名转换成Java类名
|
||||
*
|
||||
* @param tableName 表名称
|
||||
*
|
||||
* @return 类名
|
||||
*/
|
||||
public static String convertClassName(String tableName) {
|
||||
|
@ -171,7 +167,6 @@ public class GenUtils {
|
|||
*
|
||||
* @param replacementm 替换值
|
||||
* @param searchList 替换列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String replaceFirst(String replacementm, String[] searchList) {
|
||||
|
@ -189,7 +184,6 @@ public class GenUtils {
|
|||
* 关键字替换
|
||||
*
|
||||
* @param text 需要被替换的名字
|
||||
*
|
||||
* @return 替换后的名字
|
||||
*/
|
||||
public static String replaceText(String text) {
|
||||
|
@ -200,7 +194,6 @@ public class GenUtils {
|
|||
* 获取数据库类型字段
|
||||
*
|
||||
* @param columnType 列类型
|
||||
*
|
||||
* @return 截取后的列类型
|
||||
*/
|
||||
public static String getDbType(String columnType) {
|
||||
|
@ -215,7 +208,6 @@ public class GenUtils {
|
|||
* 获取字段长度
|
||||
*
|
||||
* @param columnType 列类型
|
||||
*
|
||||
* @return 截取后的列类型
|
||||
*/
|
||||
public static Integer getColumnLength(String columnType) {
|
||||
|
|
|
@ -195,7 +195,6 @@ public class VelocityUtils {
|
|||
* 获取包前缀
|
||||
*
|
||||
* @param packageName 包名称
|
||||
*
|
||||
* @return 包前缀名称
|
||||
*/
|
||||
public static String getPackagePrefix(String packageName) {
|
||||
|
@ -207,7 +206,6 @@ public class VelocityUtils {
|
|||
* 根据列类型获取导入包
|
||||
*
|
||||
* @param genTable 业务表对象
|
||||
*
|
||||
* @return 返回需要导入的包列表
|
||||
*/
|
||||
public static HashSet<String> getImportList(GenTable genTable) {
|
||||
|
@ -232,7 +230,6 @@ public class VelocityUtils {
|
|||
* 根据列类型获取字典组
|
||||
*
|
||||
* @param genTable 业务表对象
|
||||
*
|
||||
* @return 返回字典组
|
||||
*/
|
||||
public static String getDicts(GenTable genTable) {
|
||||
|
@ -267,7 +264,6 @@ public class VelocityUtils {
|
|||
*
|
||||
* @param moduleName 模块名称
|
||||
* @param businessName 业务名称
|
||||
*
|
||||
* @return 返回权限前缀
|
||||
*/
|
||||
public static String getPermissionPrefix(String moduleName, String businessName) {
|
||||
|
@ -278,7 +274,6 @@ public class VelocityUtils {
|
|||
* 获取上级菜单ID字段
|
||||
*
|
||||
* @param paramsObj 生成其他选项
|
||||
*
|
||||
* @return 上级菜单ID字段
|
||||
*/
|
||||
public static String getParentMenuId(JSONObject paramsObj) {
|
||||
|
@ -293,7 +288,6 @@ public class VelocityUtils {
|
|||
* 获取树编码
|
||||
*
|
||||
* @param paramsObj 生成其他选项
|
||||
*
|
||||
* @return 树编码
|
||||
*/
|
||||
public static String getTreecode(JSONObject paramsObj) {
|
||||
|
@ -307,7 +301,6 @@ public class VelocityUtils {
|
|||
* 获取树父编码
|
||||
*
|
||||
* @param paramsObj 生成其他选项
|
||||
*
|
||||
* @return 树父编码
|
||||
*/
|
||||
public static String getTreeParentCode(JSONObject paramsObj) {
|
||||
|
@ -321,7 +314,6 @@ public class VelocityUtils {
|
|||
* 获取树名称
|
||||
*
|
||||
* @param paramsObj 生成其他选项
|
||||
*
|
||||
* @return 树名称
|
||||
*/
|
||||
public static String getTreeName(JSONObject paramsObj) {
|
||||
|
@ -335,7 +327,6 @@ public class VelocityUtils {
|
|||
* 获取需要在哪一列上面显示展开按钮
|
||||
*
|
||||
* @param genTable 业务表对象
|
||||
*
|
||||
* @return 展开按钮列序号
|
||||
*/
|
||||
public static int getExpandColumn(GenTable genTable) {
|
||||
|
|
|
@ -55,7 +55,8 @@
|
|||
from gen_table_column
|
||||
</sql>
|
||||
|
||||
<select id="selectGenTableColumnListByTableId" parameterType="com.muyu.gen.domain.GenTableColumn" resultMap="GenTableColumnResult">
|
||||
<select id="selectGenTableColumnListByTableId" parameterType="com.muyu.gen.domain.GenTableColumn"
|
||||
resultMap="GenTableColumnResult">
|
||||
<include refid="selectGenTableColumnVo"/>
|
||||
where table_id = #{tableId}
|
||||
order by sort
|
||||
|
@ -75,7 +76,8 @@
|
|||
order by ordinal_position
|
||||
</select>
|
||||
|
||||
<insert id="insertGenTableColumn" parameterType="com.muyu.gen.domain.GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
|
||||
<insert id="insertGenTableColumn" parameterType="com.muyu.gen.domain.GenTableColumn" useGeneratedKeys="true"
|
||||
keyProperty="columnId">
|
||||
insert into gen_table_column (
|
||||
<if test="tableId != null and tableId != ''">table_id,</if>
|
||||
<if test="columnName != null and columnName != ''">column_name,</if>
|
||||
|
|
|
@ -249,7 +249,8 @@
|
|||
order by c.sort
|
||||
</select>
|
||||
|
||||
<insert id="insertGenTable" parameterType="com.muyu.gen.domain.GenTable" useGeneratedKeys="true" keyProperty="tableId">
|
||||
<insert id="insertGenTable" parameterType="com.muyu.gen.domain.GenTable" useGeneratedKeys="true"
|
||||
keyProperty="tableId">
|
||||
insert into gen_table (
|
||||
<if test="tableName != null">table_name,</if>
|
||||
<if test="tableComment != null and tableComment != ''">table_comment,</if>
|
||||
|
|
|
@ -3,6 +3,7 @@ package ${packageName}.controller;
|
|||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
@ -33,8 +34,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${businessName}")
|
||||
public class ${ClassName}Controller extends BaseController
|
||||
{
|
||||
public class ${ClassName}Controller extends BaseController {
|
||||
@Autowired
|
||||
private I${ClassName}Service ${className}Service;
|
||||
|
||||
|
@ -44,15 +44,13 @@ public class ${ClassName}Controller extends BaseController
|
|||
@RequiresPermissions("${permissionPrefix}:list")
|
||||
@GetMapping("/list")
|
||||
#if($table.crud || $table.sub)
|
||||
public Result<TableDataInfo> list(${ClassName} ${className})
|
||||
{
|
||||
public Result<TableDataInfo> list(${ClassName} ${className}) {
|
||||
startPage();
|
||||
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
||||
return getDataTable(list);
|
||||
}
|
||||
#elseif($table.tree)
|
||||
public Result list(${ClassName} ${className})
|
||||
{
|
||||
public Result list(${ClassName} ${className}) {
|
||||
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
||||
return success(list);
|
||||
}
|
||||
|
@ -64,8 +62,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
@RequiresPermissions("${permissionPrefix}:export")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ${ClassName} ${className})
|
||||
{
|
||||
public void export(HttpServletResponse response, ${ClassName} ${className}) {
|
||||
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
||||
ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}. class);
|
||||
util.exportExcel(response, list, "${functionName}数据");
|
||||
|
@ -76,8 +73,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:query")
|
||||
@GetMapping(value = "/{${pkColumn.javaField}}")
|
||||
public Result getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
|
||||
{
|
||||
public Result getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) {
|
||||
return success(${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}));
|
||||
}
|
||||
|
||||
|
@ -87,8 +83,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
@RequiresPermissions("${permissionPrefix}:add")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody ${ClassName} ${className})
|
||||
{
|
||||
public Result add(@RequestBody ${ClassName} ${className}) {
|
||||
return toAjax(${className}Service.insert${ClassName}(${className}));
|
||||
}
|
||||
|
||||
|
@ -98,8 +93,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
@RequiresPermissions("${permissionPrefix}:edit")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody ${ClassName} ${className})
|
||||
{
|
||||
public Result edit(@RequestBody ${ClassName} ${className}) {
|
||||
return toAjax(${className}Service.update${ClassName}(${className}));
|
||||
}
|
||||
|
||||
|
@ -109,8 +103,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
@RequiresPermissions("${permissionPrefix}:remove")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{${pkColumn.javaField}s}")
|
||||
public Result remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
||||
{
|
||||
public Result remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) {
|
||||
return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ${packageName}.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ${packageName}.domain.${ClassName};
|
||||
#if($table.sub)
|
||||
import ${packageName}.domain.${subClassName};
|
||||
|
@ -12,8 +13,7 @@ import ${packageName}.domain.${subClassName};
|
|||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
public interface ${ClassName}Mapper
|
||||
{
|
||||
public interface ${ClassName}Mapper {
|
||||
/**
|
||||
* 查询${functionName}
|
||||
*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ${packageName}.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ${packageName}.domain.${ClassName};
|
||||
|
||||
/**
|
||||
|
@ -9,8 +10,7 @@ import ${packageName}.domain.${ClassName};
|
|||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
public interface I${ClassName}Service
|
||||
{
|
||||
public interface I${ClassName}Service {
|
||||
/**
|
||||
* 查询${functionName}
|
||||
*
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
#if($table.sub)
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ${packageName}.domain.${subClassName};
|
||||
|
@ -26,8 +27,7 @@ import ${packageName}.service.I${ClassName}Service;
|
|||
* @date ${datetime}
|
||||
*/
|
||||
@Service
|
||||
public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||
{
|
||||
public class ${ClassName}ServiceImpl implements I${ClassName}Service {
|
||||
@Autowired
|
||||
private ${ClassName}Mapper ${className}Mapper;
|
||||
|
||||
|
@ -38,8 +38,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
* @return ${functionName}
|
||||
*/
|
||||
@Override
|
||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField})
|
||||
{
|
||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) {
|
||||
return ${className}Mapper.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField});
|
||||
}
|
||||
|
||||
|
@ -50,8 +49,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
* @return ${functionName}
|
||||
*/
|
||||
@Override
|
||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className})
|
||||
{
|
||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) {
|
||||
return ${className}Mapper.select${ClassName}List(${className});
|
||||
}
|
||||
|
||||
|
@ -65,8 +63,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
@Transactional
|
||||
#end
|
||||
@Override
|
||||
public int insert${ClassName}(${ClassName} ${className})
|
||||
{
|
||||
public int insert${ClassName}(${ClassName} ${className}) {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.javaField == 'createTime')
|
||||
${className}.setCreateTime(DateUtils.getNowDate());
|
||||
|
@ -91,15 +88,15 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
@Transactional
|
||||
#end
|
||||
@Override
|
||||
public int update${ClassName}(${ClassName} ${className})
|
||||
{
|
||||
public int update${ClassName}(${ClassName} ${className}) {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.javaField == 'updateTime')
|
||||
${className}.setUpdateTime(DateUtils.getNowDate());
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}());
|
||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}())
|
||||
;
|
||||
insert${subClassName}(${className});
|
||||
#end
|
||||
return ${className}Mapper.update${ClassName}(${className});
|
||||
|
@ -115,8 +112,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
@Transactional
|
||||
#end
|
||||
@Override
|
||||
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
||||
{
|
||||
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s) {
|
||||
#if($table.sub)
|
||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s);
|
||||
#end
|
||||
|
@ -133,8 +129,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
@Transactional
|
||||
#end
|
||||
@Override
|
||||
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField})
|
||||
{
|
||||
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) {
|
||||
#if($table.sub)
|
||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField});
|
||||
#end
|
||||
|
@ -147,20 +142,17 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
*
|
||||
* @param ${className} ${functionName}对象
|
||||
*/
|
||||
public void insert${subClassName}(${ClassName} ${className})
|
||||
{
|
||||
public void insert${subClassName}(${ClassName} ${className}) {
|
||||
List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List();
|
||||
${pkColumn.javaType} ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}();
|
||||
if (StringUtils.isNotNull(${subclassName}List))
|
||||
{
|
||||
if (StringUtils.isNotNull(${subclassName}List)) {
|
||||
List<${subClassName}> list = new ArrayList<${subClassName}>();
|
||||
for (${subClassName} ${subclassName} :${subclassName}List)
|
||||
{
|
||||
${subclassName}.set${subTableFkClassName}(${pkColumn.javaField});
|
||||
list.add(${subclassName});
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
if (list.size() > 0) {
|
||||
${className}Mapper.batch${subClassName}(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,8 @@
|
|||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -85,7 +86,8 @@
|
|||
icon="el-icon-sort"
|
||||
size="mini"
|
||||
@click="toggleExpandAll"
|
||||
>展开/折叠</el-button>
|
||||
>展开/折叠
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
@ -123,7 +125,8 @@
|
|||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||
<template slot-scope="scope">
|
||||
#if($column.htmlType == "checkbox")
|
||||
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
<dict-tag :options="dict.type.${column.dictType}"
|
||||
:value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
#else
|
||||
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField}"/>
|
||||
#end
|
||||
|
@ -145,21 +148,24 @@
|
|||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -180,7 +186,8 @@
|
|||
#set($dictType=$column.dictType)
|
||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
||||
<el-form-item label="${comment}" prop="${treeParentCode}">
|
||||
<treeselect v-model="form.${treeParentCode}" :options="${businessName}Options" :normalizer="normalizer" placeholder="请选择${comment}" />
|
||||
<treeselect v-model="form.${treeParentCode}" :options="${businessName}Options"
|
||||
:normalizer="normalizer" placeholder="请选择${comment}"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "input")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
|
@ -247,7 +254,8 @@
|
|||
#else
|
||||
:label="dict.value"
|
||||
#end
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{dict.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && $dictType)
|
||||
|
@ -283,7 +291,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
import {get${BusinessName}, list${BusinessName}} from "@/api/";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
|
@ -341,7 +349,9 @@ export default {
|
|||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
$column.javaField: [
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
{
|
||||
required: true, message: "$comment不能为空", trigger: #if($column.htmlType ==
|
||||
"select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
|
@ -468,22 +478,54 @@ export default {
|
|||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.#[[$]]#refs["form"].validate(valid => {
|
||||
this.
|
||||
#
|
||||
[[$]]
|
||||
#refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
#foreach($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
this.form.$column.javaField = this.form.${column.javaField}.join(",");
|
||||
this.form.$column.javaField = this.form.$
|
||||
{
|
||||
column.javaField
|
||||
}
|
||||
.
|
||||
join(",");
|
||||
#end
|
||||
#end
|
||||
if (this.form.${pkColumn.javaField} != null) {
|
||||
update${BusinessName}(this.form).then(response => {
|
||||
this.#[[$modal]]#.msgSuccess("修改成功");
|
||||
if (this.form.${
|
||||
pkColumn.javaField
|
||||
}
|
||||
!=
|
||||
null
|
||||
)
|
||||
{
|
||||
update$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(this.form).then(response => {
|
||||
this.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
add${BusinessName}(this.form).then(response => {
|
||||
this.#[[$modal]]#.msgSuccess("新增成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
add$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(this.form).then(response => {
|
||||
this.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
|
@ -493,12 +535,36 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
||||
return del${BusinessName}(row.${pkColumn.javaField});
|
||||
this.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
confirm('是否确认删除${functionName}编号为"' + row.$
|
||||
{
|
||||
pkColumn.javaField
|
||||
}
|
||||
+'"的数据项?'
|
||||
).
|
||||
then(function () {
|
||||
return del$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(row.$
|
||||
{
|
||||
pkColumn.javaField
|
||||
}
|
||||
)
|
||||
;
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.#[[$modal]]#.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -76,7 +76,8 @@
|
|||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -87,7 +88,8 @@
|
|||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -98,7 +100,8 @@
|
|||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -108,7 +111,8 @@
|
|||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['${moduleName}:${businessName}:export']"
|
||||
>导出</el-button>
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
@ -141,7 +145,8 @@
|
|||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||
<template slot-scope="scope">
|
||||
#if($column.htmlType == "checkbox")
|
||||
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
<dict-tag :options="dict.type.${column.dictType}"
|
||||
:value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
#else
|
||||
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField}"/>
|
||||
#end
|
||||
|
@ -159,14 +164,16 @@
|
|||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -258,7 +265,8 @@
|
|||
#else
|
||||
:label="dict.value"
|
||||
#end
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{dict.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && $dictType)
|
||||
|
@ -288,13 +296,16 @@
|
|||
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd${subClassName}">添加</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd${subClassName}">添加
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete${subClassName}">删除</el-button>
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete${subClassName}">删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
|
||||
<el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index"
|
||||
@selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
|
||||
<el-table-column type="selection" width="50" align="center"/>
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
#foreach($column in $subTable.columns)
|
||||
|
@ -315,10 +326,12 @@
|
|||
#elseif($column.list && $column.htmlType == "datetime")
|
||||
<el-table-column label="$comment" prop="${javaField}" width="240">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker clearable v-model="scope.row.$javaField" type="date" value-format="yyyy-MM-dd" placeholder="请选择$comment" />
|
||||
<el-date-picker clearable v-model="scope.row.$javaField" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择$comment"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" != $column.dictType)
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") &&
|
||||
"" != $column.dictType)
|
||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
||||
|
@ -331,7 +344,8 @@
|
|||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" == $column.dictType)
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") &&
|
||||
"" == $column.dictType)
|
||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
||||
|
@ -353,7 +367,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
import {get${BusinessName}, list${BusinessName}} from "@/api/";
|
||||
|
||||
export default {
|
||||
name: "${BusinessName}",
|
||||
|
@ -418,7 +432,9 @@ export default {
|
|||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
$column.javaField: [
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
{
|
||||
required: true, message: "$comment不能为空", trigger: #if($column.htmlType ==
|
||||
"select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
|
@ -522,25 +538,65 @@ export default {
|
|||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.#[[$]]#refs["form"].validate(valid => {
|
||||
this.
|
||||
#
|
||||
[[$]]
|
||||
#refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
#foreach($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
this.form.$column.javaField = this.form.${column.javaField}.join(",");
|
||||
this.form.$column.javaField = this.form.$
|
||||
{
|
||||
column.javaField
|
||||
}
|
||||
.
|
||||
join(",");
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
this.form.${subclassName}List = this.${subclassName}List;
|
||||
this.form.$
|
||||
{
|
||||
subclassName
|
||||
}
|
||||
List = this.$
|
||||
{
|
||||
subclassName
|
||||
}
|
||||
List;
|
||||
#end
|
||||
if (this.form.${pkColumn.javaField} != null) {
|
||||
update${BusinessName}(this.form).then(response => {
|
||||
this.#[[$modal]]#.msgSuccess("修改成功");
|
||||
if (this.form.${
|
||||
pkColumn.javaField
|
||||
}
|
||||
!=
|
||||
null
|
||||
)
|
||||
{
|
||||
update$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(this.form).then(response => {
|
||||
this.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
add${BusinessName}(this.form).then(response => {
|
||||
this.#[[$modal]]#.msgSuccess("新增成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
add$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(this.form).then(response => {
|
||||
this.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
|
@ -550,21 +606,51 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids;
|
||||
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
|
||||
return del${BusinessName}(${pkColumn.javaField}s);
|
||||
const ${pkColumn.javaField}s = row.$
|
||||
{
|
||||
pkColumn.javaField
|
||||
}
|
||||
||
|
||||
this.ids;
|
||||
this.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function () {
|
||||
return del$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(${pkColumn.javaField}s);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.#[[$modal]]#.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
#if($table.sub)
|
||||
#if($table.sub
|
||||
)
|
||||
/** ${subTable.functionName}序号 */
|
||||
row${subClassName}Index({ row, rowIndex }) {
|
||||
row$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
Index({row, rowIndex})
|
||||
{
|
||||
row.index = rowIndex + 1;
|
||||
},
|
||||
}
|
||||
,
|
||||
/** ${subTable.functionName}添加按钮操作 */
|
||||
handleAdd${subClassName}() {
|
||||
handleAdd$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
()
|
||||
{
|
||||
let obj = {};
|
||||
#foreach($column in $subTable.columns)
|
||||
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
||||
|
@ -572,31 +658,87 @@ export default {
|
|||
obj.$column.javaField = "";
|
||||
#end
|
||||
#end
|
||||
this.${subclassName}List.push(obj);
|
||||
},
|
||||
this.$
|
||||
{
|
||||
subclassName
|
||||
}
|
||||
List.push(obj);
|
||||
}
|
||||
,
|
||||
/** ${subTable.functionName}删除按钮操作 */
|
||||
handleDelete${subClassName}() {
|
||||
if (this.checked${subClassName}.length == 0) {
|
||||
this.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
|
||||
} else {
|
||||
const ${subclassName}List = this.${subclassName}List;
|
||||
const checked${subClassName} = this.checked${subClassName};
|
||||
this.${subclassName}List = ${subclassName}List.filter(function(item) {
|
||||
return checked${subClassName}.indexOf(item.index) == -1
|
||||
handleDelete$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
()
|
||||
{
|
||||
if (this.checked${
|
||||
subClassName
|
||||
}
|
||||
.
|
||||
length == 0
|
||||
)
|
||||
{
|
||||
this.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgError("请先选择要删除的${subTable.functionName}数据");
|
||||
}
|
||||
else
|
||||
{
|
||||
const ${subclassName}List = this.$
|
||||
{
|
||||
subclassName
|
||||
}
|
||||
List;
|
||||
const checked$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
= this.checked$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
;
|
||||
this.$
|
||||
{
|
||||
subclassName
|
||||
}
|
||||
List = ${subclassName}List.filter(function (item) {
|
||||
return checked$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
.
|
||||
indexOf(item.index) == -1
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
,
|
||||
/** 复选框选中数据 */
|
||||
handle${subClassName}SelectionChange(selection) {
|
||||
this.checked${subClassName} = selection.map(item => item.index)
|
||||
},
|
||||
handle$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
SelectionChange(selection)
|
||||
{
|
||||
this.checked$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
= selection.map(item => item.index)
|
||||
}
|
||||
,
|
||||
#end
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
handleExport()
|
||||
{
|
||||
this.download('${moduleName}/${businessName}/export', {
|
||||
...this.queryParams
|
||||
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
;
|
||||
</script>
|
||||
|
|
|
@ -74,7 +74,8 @@
|
|||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -82,7 +83,8 @@
|
|||
plain
|
||||
icon="Sort"
|
||||
@click="toggleExpandAll"
|
||||
>展开/折叠</el-button>
|
||||
>展开/折叠
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
@ -120,7 +122,8 @@
|
|||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||
<template #default="scope">
|
||||
#if($column.htmlType == "checkbox")
|
||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
<dict-tag :options="${column.dictType}"
|
||||
:value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
#else
|
||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
|
||||
#end
|
||||
|
@ -136,9 +139,15 @@
|
|||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:edit']">修改
|
||||
</el-button>
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:add']">新增
|
||||
</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:remove']">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -233,7 +242,8 @@
|
|||
#else
|
||||
:label="dict.value"
|
||||
#end
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{dict.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && $dictType)
|
||||
|
@ -271,7 +281,7 @@
|
|||
</template>
|
||||
|
||||
<script setup name="${BusinessName}">
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
import {get${BusinessName}, list${BusinessName}} from "@/api/";
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
#if(${dicts} != '')
|
||||
|
@ -313,7 +323,9 @@ const data = reactive({
|
|||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
$column.javaField: [
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
{
|
||||
required: true, message: "$comment不能为空", trigger: #if($column.htmlType ==
|
||||
"select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
|
@ -436,22 +448,54 @@ async function handleUpdate(row) {
|
|||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.#[[$]]#refs["${businessName}Ref"].validate(valid => {
|
||||
proxy.
|
||||
#
|
||||
[[$]]
|
||||
#refs["${businessName}Ref"].validate(valid => {
|
||||
if (valid) {
|
||||
#foreach($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
form.value.$column.javaField = form.value.${column.javaField}.join(",");
|
||||
form.value.$column.javaField = form.value.$
|
||||
{
|
||||
column.javaField
|
||||
}
|
||||
.
|
||||
join(",");
|
||||
#end
|
||||
#end
|
||||
if (form.value.${pkColumn.javaField} != null) {
|
||||
update${BusinessName}(form.value).then(response => {
|
||||
proxy.#[[$modal]]#.msgSuccess("修改成功");
|
||||
if (form.value.${
|
||||
pkColumn.javaField
|
||||
}
|
||||
!=
|
||||
null
|
||||
)
|
||||
{
|
||||
update$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(form.value).then(response => {
|
||||
proxy.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
add${BusinessName}(form.value).then(response => {
|
||||
proxy.#[[$modal]]#.msgSuccess("新增成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
add$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(form.value).then(response => {
|
||||
proxy.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
|
@ -462,12 +506,36 @@ function submitForm() {
|
|||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
||||
return del${BusinessName}(row.${pkColumn.javaField});
|
||||
proxy.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
confirm('是否确认删除${functionName}编号为"' + row.$
|
||||
{
|
||||
pkColumn.javaField
|
||||
}
|
||||
+'"的数据项?'
|
||||
).
|
||||
then(function () {
|
||||
return del$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(row.$
|
||||
{
|
||||
pkColumn.javaField
|
||||
}
|
||||
)
|
||||
;
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
proxy.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
|
||||
getList();
|
||||
|
|
|
@ -74,7 +74,8 @@
|
|||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -84,7 +85,8 @@
|
|||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -94,7 +96,8 @@
|
|||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -103,7 +106,8 @@
|
|||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['${moduleName}:${businessName}:export']"
|
||||
>导出</el-button>
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
@ -136,7 +140,8 @@
|
|||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||
<template #default="scope">
|
||||
#if($column.htmlType == "checkbox")
|
||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
<dict-tag :options="${column.dictType}"
|
||||
:value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
#else
|
||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
|
||||
#end
|
||||
|
@ -148,8 +153,12 @@
|
|||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:edit']">修改
|
||||
</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['${moduleName}:${businessName}:remove']">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -241,7 +250,8 @@
|
|||
#else
|
||||
:label="dict.value"
|
||||
#end
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{dict.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && $dictType)
|
||||
|
@ -277,7 +287,8 @@
|
|||
<el-button type="danger" icon="Delete" @click="handleDelete${subClassName}">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
|
||||
<el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index"
|
||||
@selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
|
||||
<el-table-column type="selection" width="50" align="center"/>
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
#foreach($column in $subTable.columns)
|
||||
|
@ -306,7 +317,8 @@
|
|||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" != $column.dictType)
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") &&
|
||||
"" != $column.dictType)
|
||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
||||
|
@ -319,7 +331,8 @@
|
|||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" == $column.dictType)
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") &&
|
||||
"" == $column.dictType)
|
||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
||||
|
@ -343,7 +356,7 @@
|
|||
</template>
|
||||
|
||||
<script setup name="${BusinessName}">
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
import {get${BusinessName}, list${BusinessName}} from "@/api/";
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
#if(${dicts} != '')
|
||||
|
@ -394,7 +407,9 @@ const data = reactive({
|
|||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
$column.javaField: [
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
{
|
||||
required: true, message: "$comment不能为空", trigger: #if($column.htmlType ==
|
||||
"select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
|
@ -504,25 +519,61 @@ function handleUpdate(row) {
|
|||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.#[[$]]#refs["${businessName}Ref"].validate(valid => {
|
||||
proxy.
|
||||
#
|
||||
[[$]]
|
||||
#refs["${businessName}Ref"].validate(valid => {
|
||||
if (valid) {
|
||||
#foreach($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
form.value.$column.javaField = form.value.${column.javaField}.join(",");
|
||||
form.value.$column.javaField = form.value.$
|
||||
{
|
||||
column.javaField
|
||||
}
|
||||
.
|
||||
join(",");
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
form.value.${subclassName}List = ${subclassName}List.value;
|
||||
form.value.$
|
||||
{
|
||||
subclassName
|
||||
}
|
||||
List = ${subclassName}List.value;
|
||||
#end
|
||||
if (form.value.${pkColumn.javaField} != null) {
|
||||
update${BusinessName}(form.value).then(response => {
|
||||
proxy.#[[$modal]]#.msgSuccess("修改成功");
|
||||
if (form.value.${
|
||||
pkColumn.javaField
|
||||
}
|
||||
!=
|
||||
null
|
||||
)
|
||||
{
|
||||
update$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(form.value).then(response => {
|
||||
proxy.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
add${BusinessName}(form.value).then(response => {
|
||||
proxy.#[[$modal]]#.msgSuccess("新增成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
add$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(form.value).then(response => {
|
||||
proxy.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
|
@ -533,23 +584,68 @@ function submitForm() {
|
|||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value;
|
||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() {
|
||||
return del${BusinessName}(_${pkColumn.javaField}s);
|
||||
const _$
|
||||
{
|
||||
pkColumn.javaField
|
||||
}
|
||||
s = row.$
|
||||
{
|
||||
pkColumn.javaField
|
||||
}
|
||||
||
|
||||
ids.value;
|
||||
proxy.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
confirm('是否确认删除${functionName}编号为"' + _$
|
||||
{
|
||||
pkColumn.javaField
|
||||
}
|
||||
s + '"的数据项?'
|
||||
).
|
||||
then(function () {
|
||||
return del$
|
||||
{
|
||||
BusinessName
|
||||
}
|
||||
(_$
|
||||
{
|
||||
pkColumn.javaField
|
||||
}
|
||||
s
|
||||
)
|
||||
;
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
proxy.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
|
||||
#if($table.sub)
|
||||
|
||||
/** ${subTable.functionName}序号 */
|
||||
function row${subClassName}Index({ row, rowIndex }) {
|
||||
function row$ {
|
||||
subClassName
|
||||
}
|
||||
|
||||
Index({row, rowIndex})
|
||||
{
|
||||
row.index = rowIndex + 1;
|
||||
}
|
||||
|
||||
/** ${subTable.functionName}添加按钮操作 */
|
||||
function handleAdd${subClassName}() {
|
||||
function handleAdd$ {
|
||||
subClassName
|
||||
}
|
||||
|
||||
()
|
||||
{
|
||||
let obj = {};
|
||||
#foreach($column in $subTable.columns)
|
||||
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
||||
|
@ -557,28 +653,71 @@ function handleAdd${subClassName}() {
|
|||
obj.$column.javaField = "";
|
||||
#end
|
||||
#end
|
||||
${subclassName}List.value.push(obj);
|
||||
${subclassName}
|
||||
List.value.push(obj);
|
||||
}
|
||||
|
||||
/** ${subTable.functionName}删除按钮操作 */
|
||||
function handleDelete${subClassName}() {
|
||||
if (checked${subClassName}.value.length == 0) {
|
||||
proxy.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
|
||||
} else {
|
||||
function handleDelete$ {
|
||||
subClassName
|
||||
}
|
||||
|
||||
()
|
||||
{
|
||||
if (checked${
|
||||
subClassName
|
||||
}
|
||||
.
|
||||
value.length == 0
|
||||
)
|
||||
{
|
||||
proxy.
|
||||
#
|
||||
[[$modal]]
|
||||
#.
|
||||
msgError("请先选择要删除的${subTable.functionName}数据");
|
||||
}
|
||||
else
|
||||
{
|
||||
const ${subclassName}s = ${subclassName}List.value;
|
||||
const checked${subClassName}s = checked${subClassName}.value;
|
||||
${subclassName}List.value = ${subclassName}s.filter(function(item) {
|
||||
return checked${subClassName}s.indexOf(item.index) == -1
|
||||
const checked$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
s = checked$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
.
|
||||
value;
|
||||
${subclassName}
|
||||
List.value = ${subclassName}s.filter(function (item) {
|
||||
return checked$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
s.indexOf(item.index) == -1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 复选框选中数据 */
|
||||
function handle${subClassName}SelectionChange(selection) {
|
||||
checked${subClassName}.value = selection.map(item => item.index)
|
||||
function handle$ {
|
||||
subClassName
|
||||
}
|
||||
|
||||
SelectionChange(selection)
|
||||
{
|
||||
checked$
|
||||
{
|
||||
subClassName
|
||||
}
|
||||
.
|
||||
value = selection.map(item => item.index)
|
||||
}
|
||||
|
||||
#end
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('${moduleName}/${businessName}/export', {
|
||||
|
|
|
@ -12,7 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#if($table.sub)
|
||||
|
||||
<resultMap id="${ClassName}${subClassName}Result" type="${ClassName}" extends="${ClassName}Result">
|
||||
<collection property="${subclassName}List" notNullColumn="sub_${subTable.pkColumn.columnName}" javaType="java.util.List" resultMap="${subClassName}Result" />
|
||||
<collection property="${subclassName}List" notNullColumn="sub_${subTable.pkColumn.columnName}"
|
||||
javaType="java.util.List" resultMap="${subClassName}Result"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="${subClassName}" id="${subClassName}Result">
|
||||
|
@ -23,7 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#end
|
||||
|
||||
<sql id="select${ClassName}Vo">
|
||||
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
|
||||
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end
|
||||
from ${tableName}
|
||||
</sql>
|
||||
|
||||
<select id="select${ClassName}List" parameterType="${ClassName}" resultMap="${ClassName}Result">
|
||||
|
@ -37,34 +39,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
#if($column.query)
|
||||
#if($column.queryType == "EQ")
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName = #{$javaField}</if>
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
|
||||
and $columnName = #{$javaField}
|
||||
</if>
|
||||
#elseif($queryType == "NE")
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName != #{$javaField}</if>
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
|
||||
and $columnName != #{$javaField}
|
||||
</if>
|
||||
#elseif($queryType == "GT")
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName > #{$javaField}</if>
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
|
||||
and $columnName > #{$javaField}
|
||||
</if>
|
||||
#elseif($queryType == "GTE")
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName >= #{$javaField}</if>
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
|
||||
and $columnName >= #{$javaField}
|
||||
</if>
|
||||
#elseif($queryType == "LT")
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName < #{$javaField}</if>
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
|
||||
and $columnName < #{$javaField}
|
||||
</if>
|
||||
#elseif($queryType == "LTE")
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName <= #{$javaField}</if>
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
|
||||
and $columnName <= #{$javaField}
|
||||
</if>
|
||||
#elseif($queryType == "LIKE")
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName like concat('%', #{$javaField}, '%')</if>
|
||||
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
|
||||
and $columnName like concat('%', #{$javaField}, '%')
|
||||
</if>
|
||||
#elseif($queryType == "BETWEEN")
|
||||
<if test="params.begin$AttrName != null and params.begin$AttrName != '' and params.end$AttrName != null and params.end$AttrName != ''"> and $columnName between #{params.begin$AttrName} and #{params.end$AttrName}</if>
|
||||
<if test="params.begin$AttrName != null and params.begin$AttrName != '' and params.end$AttrName != null and params.end$AttrName != ''">
|
||||
and $columnName between #{params.begin$AttrName} and #{params.end$AttrName}
|
||||
</if>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="select${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}" resultMap="#if($table.sub)${ClassName}${subClassName}Result#else${ClassName}Result#end">
|
||||
<select id="select${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}"
|
||||
resultMap="#if($table.sub)${ClassName}${subClassName}Result#else${ClassName}Result#end">
|
||||
#if($table.crud || $table.tree)
|
||||
<include refid="select${ClassName}Vo"/>
|
||||
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
|
||||
#elseif($table.sub)
|
||||
select#foreach($column in $columns) a.$column.columnName#if($foreach.count != $columns.size()),#end#end,
|
||||
#foreach($column in $subTable.columns) b.$column.columnName as sub_$column.columnName#if($foreach.count != $subTable.columns.size()),#end#end
|
||||
#foreach($column in $subTable.columns) b.$column.columnName as
|
||||
sub_$column.columnName#if($foreach.count != $subTable.columns.size()),#end#end
|
||||
|
||||
from ${tableName} a
|
||||
left join ${subTableName} b on b.${subTableFkName} = a.${pkColumn.columnName}
|
||||
|
@ -72,19 +92,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#end
|
||||
</select>
|
||||
|
||||
<insert id="insert${ClassName}" parameterType="${ClassName}"#if($pkColumn.increment) useGeneratedKeys="true" keyProperty="$pkColumn.javaField"#end>
|
||||
<insert id="insert${ClassName}" parameterType="${ClassName}"#if($pkColumn.increment) useGeneratedKeys="true"
|
||||
keyProperty="$pkColumn.javaField"#end>
|
||||
insert into ${tableName}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
|
||||
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">$column.columnName,</if>
|
||||
<if test="$column.javaField != null#if($column.javaType ==
|
||||
'String' && $column.required) and $column.javaField != ''#end">$column.columnName,
|
||||
</if>
|
||||
#end
|
||||
#end
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
|
||||
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">#{$column.javaField},</if>
|
||||
<if test="$column.javaField != null#if($column.javaType ==
|
||||
'String' && $column.required) and $column.javaField != ''#end">#{$column.javaField},
|
||||
</if>
|
||||
#end
|
||||
#end
|
||||
</trim>
|
||||
|
@ -95,7 +120,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="SET" suffixOverrides=",">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $pkColumn.columnName)
|
||||
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">$column.columnName = #{$column.javaField},</if>
|
||||
<if test="$column.javaField != null#if($column.javaType ==
|
||||
'String' && $column.required) and $column.javaField != ''#end">$column.columnName =
|
||||
#{$column.javaField},
|
||||
</if>
|
||||
#end
|
||||
#end
|
||||
</trim>
|
||||
|
@ -103,7 +131,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<delete id="delete${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}">
|
||||
delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}}
|
||||
delete
|
||||
from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}}
|
||||
</delete>
|
||||
|
||||
<delete id="delete${ClassName}By${pkColumn.capJavaField}s" parameterType="String">
|
||||
|
@ -122,13 +151,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="delete${subClassName}By${subTableFkClassName}" parameterType="${pkColumn.javaType}">
|
||||
delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}}
|
||||
delete
|
||||
from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}}
|
||||
</delete>
|
||||
|
||||
<insert id="batch${subClassName}">
|
||||
insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values
|
||||
insert into ${subTableName}
|
||||
(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size())
|
||||
,#end#end) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end)
|
||||
(#foreach($column in $subTable.columns) #{item.$column.javaField
|
||||
}#if($foreach.count != $subTable.columns.size()),#end#end)
|
||||
</foreach>
|
||||
</insert>
|
||||
#end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
@ -17,4 +17,18 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-goods-edition-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-goods-edition-remote</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.edition.test.clinet.cllent.config;
|
||||
package com.muyu.efition.clinet.config;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Import;
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.efition.clinet.config;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.edition.domain.RuleEngine;
|
||||
import com.muyu.goods.edition.remote.RemoteDataManagerService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
|
||||
@Log4j2
|
||||
public class AccessConfigRunner implements ApplicationRunner {
|
||||
@Autowired
|
||||
private RemoteDataManagerService remoteDataManagerService;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
Result<TableDataInfo<RuleEngine>> list = remoteDataManagerService.list(null);
|
||||
|
||||
log.info("远程调用成功,效果为:{}", list);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
com.muyu.efition.clinet.config.AccessConfig
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/muyu-visual-monitor"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -2,6 +2,7 @@ package com.muyu.edition.constant;
|
|||
|
||||
/**
|
||||
* 配置编码常量
|
||||
*
|
||||
* @ClassName ConfigCodeConstants
|
||||
* @Author 森静若林
|
||||
* @Date 2024/5/4 15:28
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.edition.constant;
|
|||
|
||||
/**
|
||||
* 规则运行常量
|
||||
*
|
||||
* @ClassName RuleOperationConstants
|
||||
* @Author 森静若林
|
||||
* @Date 2024/5/4 16:12
|
||||
|
|
|
@ -58,6 +58,7 @@ public class Anduser extends BaseEntity {
|
|||
.age(anduserQueryResp.getAge())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
|
|
|
@ -11,55 +11,60 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
* @author muyu
|
||||
* @date 2024-05-04
|
||||
*/
|
||||
public class Config extends BaseEntity
|
||||
{
|
||||
public class Config extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 版本编码 */
|
||||
/**
|
||||
* 版本编码
|
||||
*/
|
||||
@Excel(name = "版本编码")
|
||||
private String versionCode;
|
||||
|
||||
/** 规则内容 */
|
||||
/**
|
||||
* 规则内容
|
||||
*/
|
||||
@Excel(name = "规则内容")
|
||||
private String ruleContent;
|
||||
|
||||
/** 注释 */
|
||||
/**
|
||||
* 注释
|
||||
*/
|
||||
@Excel(name = "注释")
|
||||
private String remark;
|
||||
|
||||
/** 维护编号 */
|
||||
/**
|
||||
* 维护编号
|
||||
*/
|
||||
@Excel(name = "维护编号")
|
||||
private Long ruleId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
public String getVersionCode() {
|
||||
return versionCode;
|
||||
}
|
||||
public void setVersionCode(String versionCode)
|
||||
{
|
||||
|
||||
public void setVersionCode(String versionCode) {
|
||||
this.versionCode = versionCode;
|
||||
}
|
||||
|
||||
public String getVersionCode()
|
||||
{
|
||||
return versionCode;
|
||||
}
|
||||
public void setRuleContent(String ruleContent)
|
||||
{
|
||||
this.ruleContent = ruleContent;
|
||||
public String getRuleContent() {
|
||||
return ruleContent;
|
||||
}
|
||||
|
||||
public String getRuleContent()
|
||||
{
|
||||
return ruleContent;
|
||||
public void setRuleContent(String ruleContent) {
|
||||
this.ruleContent = ruleContent;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -72,14 +77,12 @@ public class Config extends BaseEntity
|
|||
this.remark = remark;
|
||||
}
|
||||
|
||||
public void setRuleId(Long ruleId)
|
||||
{
|
||||
this.ruleId = ruleId;
|
||||
public Long getRuleId() {
|
||||
return ruleId;
|
||||
}
|
||||
|
||||
public Long getRuleId()
|
||||
{
|
||||
return ruleId;
|
||||
public void setRuleId(Long ruleId) {
|
||||
this.ruleId = ruleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,41 +11,56 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
* @author muyu
|
||||
* @date 2024-05-06
|
||||
*/
|
||||
public class Edition extends BaseEntity
|
||||
{
|
||||
public class Edition extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 规则序号 */
|
||||
/**
|
||||
* 规则序号
|
||||
*/
|
||||
@Excel(name = "规则序号")
|
||||
private Long ruleId;
|
||||
|
||||
/** 版本类 */
|
||||
/**
|
||||
* 版本类
|
||||
*/
|
||||
@Excel(name = "版本类")
|
||||
private String versionClass;
|
||||
|
||||
/** 版本名称 */
|
||||
/**
|
||||
* 版本名称
|
||||
*/
|
||||
@Excel(name = "版本名称")
|
||||
private String name;
|
||||
|
||||
/** 版本编码 */
|
||||
/**
|
||||
* 版本编码
|
||||
*/
|
||||
@Excel(name = "版本编码")
|
||||
private String versionCode;
|
||||
|
||||
/** 版本状态 */
|
||||
/**
|
||||
* 版本状态
|
||||
*/
|
||||
@Excel(name = "是否发布")
|
||||
private Integer editionStatus;
|
||||
|
||||
/** 引擎状态 */
|
||||
/**
|
||||
* 引擎状态
|
||||
*/
|
||||
@Excel(name = "是否激活")
|
||||
private String ruleStatus;
|
||||
|
||||
@Excel(name = "是否测试")
|
||||
private Integer ruleIsTest;
|
||||
|
||||
/** 内容 */
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@Excel(name = "内容描述")
|
||||
private String editionContent;
|
||||
|
||||
|
|
|
@ -11,112 +11,118 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
* @author goods
|
||||
* @date 2024-05-02
|
||||
*/
|
||||
public class RuleEngine extends BaseEntity
|
||||
{
|
||||
public class RuleEngine extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long ruleId;
|
||||
|
||||
/** 规则名称 */
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
@Excel(name = "规则名称")
|
||||
private String ruleName;
|
||||
|
||||
/** 引擎编码 */
|
||||
/**
|
||||
* 引擎编码
|
||||
*/
|
||||
@Excel(name = "引擎编码")
|
||||
private String ruleCode;
|
||||
|
||||
/** 规则级别 */
|
||||
/**
|
||||
* 规则级别
|
||||
*/
|
||||
@Excel(name = "规则级别")
|
||||
private Integer ruleLevel;
|
||||
|
||||
/** 规则类型 */
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
@Excel(name = "规则类型")
|
||||
private Integer ruleType;
|
||||
|
||||
/** 是否激活 */
|
||||
/**
|
||||
* 是否激活
|
||||
*/
|
||||
@Excel(name = "是否激活")
|
||||
private String ruleIsActivate;
|
||||
|
||||
/** 规则状态 */
|
||||
/**
|
||||
* 规则状态
|
||||
*/
|
||||
@Excel(name = "规则状态")
|
||||
private String ruleStatus;
|
||||
|
||||
/** 规则描述 */
|
||||
/**
|
||||
* 规则描述
|
||||
*/
|
||||
@Excel(name = "规则描述")
|
||||
private String description;
|
||||
|
||||
public void setRuleId(Long ruleId)
|
||||
{
|
||||
public Long getRuleId() {
|
||||
return ruleId;
|
||||
}
|
||||
|
||||
public void setRuleId(Long ruleId) {
|
||||
this.ruleId = ruleId;
|
||||
}
|
||||
|
||||
public Long getRuleId()
|
||||
{
|
||||
return ruleId;
|
||||
public String getRuleName() {
|
||||
return ruleName;
|
||||
}
|
||||
public void setRuleName(String ruleName)
|
||||
{
|
||||
|
||||
public void setRuleName(String ruleName) {
|
||||
this.ruleName = ruleName;
|
||||
}
|
||||
|
||||
public String getRuleName()
|
||||
{
|
||||
return ruleName;
|
||||
public String getRuleCode() {
|
||||
return ruleCode;
|
||||
}
|
||||
public void setRuleCode(String ruleCode)
|
||||
{
|
||||
|
||||
public void setRuleCode(String ruleCode) {
|
||||
this.ruleCode = ruleCode;
|
||||
}
|
||||
|
||||
public String getRuleCode()
|
||||
{
|
||||
return ruleCode;
|
||||
public Integer getRuleLevel() {
|
||||
return ruleLevel;
|
||||
}
|
||||
public void setRuleLevel(Integer ruleLevel)
|
||||
{
|
||||
|
||||
public void setRuleLevel(Integer ruleLevel) {
|
||||
this.ruleLevel = ruleLevel;
|
||||
}
|
||||
|
||||
public Integer getRuleLevel()
|
||||
{
|
||||
return ruleLevel;
|
||||
public Integer getRuleType() {
|
||||
return ruleType;
|
||||
}
|
||||
public void setRuleType(Integer ruleType)
|
||||
{
|
||||
|
||||
public void setRuleType(Integer ruleType) {
|
||||
this.ruleType = ruleType;
|
||||
}
|
||||
|
||||
public Integer getRuleType()
|
||||
{
|
||||
return ruleType;
|
||||
public String getRuleIsActivate() {
|
||||
return ruleIsActivate;
|
||||
}
|
||||
public void setRuleIsActivate(String ruleIsActivate)
|
||||
{
|
||||
|
||||
public void setRuleIsActivate(String ruleIsActivate) {
|
||||
this.ruleIsActivate = ruleIsActivate;
|
||||
}
|
||||
|
||||
public String getRuleIsActivate()
|
||||
{
|
||||
return ruleIsActivate;
|
||||
public String getRuleStatus() {
|
||||
return ruleStatus;
|
||||
}
|
||||
public void setRuleStatus(String ruleStatus)
|
||||
{
|
||||
|
||||
public void setRuleStatus(String ruleStatus) {
|
||||
this.ruleStatus = ruleStatus;
|
||||
}
|
||||
|
||||
public String getRuleStatus()
|
||||
{
|
||||
return ruleStatus;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,12 +8,18 @@ import lombok.experimental.SuperBuilder;
|
|||
public class EngineConfigResp {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 类型 */
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/** 名称 */
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/** 代码 */
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private String code;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/muyu-visual-monitor"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,21 @@
|
|||
package com.muyu.goods.edition.remote;
|
||||
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.edition.domain.RuleEngine;
|
||||
import com.muyu.goods.edition.remote.factory.DataMangFacrory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@FeignClient(
|
||||
contextId = "RemoteSys",
|
||||
value = ServiceNameConstants.EDITION_MUYU,
|
||||
fallbackFactory = DataMangFacrory.class,
|
||||
path = "/engine"
|
||||
)
|
||||
public interface RemoteDataManagerService {
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<RuleEngine>> list(RuleEngine ruleEngine);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.muyu.goods.edition.remote.factory;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.edition.domain.RuleEngine;
|
||||
import com.muyu.goods.edition.remote.RemoteDataManagerService;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
|
||||
//熔断
|
||||
|
||||
public class DataMangFacrory implements FallbackFactory<RemoteDataManagerService> {
|
||||
@Override
|
||||
public RemoteDataManagerService create(Throwable cause) {
|
||||
return new RemoteDataManagerService() {
|
||||
@Override
|
||||
public Result<TableDataInfo<RuleEngine>> list(RuleEngine ruleEngine) {
|
||||
return Result.error(cause.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
com.muyu.goods.edition.remote.factory.DataMangFacrory
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/muyu-visual-monitor"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -25,8 +25,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/config")
|
||||
public class ConfigController extends BaseController
|
||||
{
|
||||
public class ConfigController extends BaseController {
|
||||
@Autowired
|
||||
private IConfigService configService;
|
||||
|
||||
|
@ -35,8 +34,7 @@ public class ConfigController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:config:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Config>> list(Config config)
|
||||
{
|
||||
public Result<TableDataInfo<Config>> list(Config config) {
|
||||
startPage();
|
||||
List<Config> list = configService.selectConfigList(config);
|
||||
return getDataTable(list);
|
||||
|
@ -44,6 +42,7 @@ public class ConfigController extends BaseController
|
|||
|
||||
/**
|
||||
* 查询引擎列表
|
||||
*
|
||||
* @param ruleId
|
||||
* @return
|
||||
*/
|
||||
|
@ -59,8 +58,7 @@ public class ConfigController extends BaseController
|
|||
@RequiresPermissions("system:config:export")
|
||||
@Log(title = "引擎", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Config config)
|
||||
{
|
||||
public void export(HttpServletResponse response, Config config) {
|
||||
List<Config> list = configService.selectConfigList(config);
|
||||
ExcelUtil<Config> util = new ExcelUtil<Config>(Config.class);
|
||||
util.exportExcel(response, list, "引擎数据");
|
||||
|
@ -71,8 +69,7 @@ public class ConfigController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:config:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public Result getInfo(@PathVariable("id") Long id) {
|
||||
return success(configService.selectConfigById(id));
|
||||
}
|
||||
|
||||
|
@ -82,8 +79,7 @@ public class ConfigController extends BaseController
|
|||
@RequiresPermissions("system:config:add")
|
||||
@Log(title = "引擎", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody Config config)
|
||||
{
|
||||
public Result add(@RequestBody Config config) {
|
||||
return toAjax(configService.insertConfig(config));
|
||||
}
|
||||
|
||||
|
@ -93,8 +89,7 @@ public class ConfigController extends BaseController
|
|||
@RequiresPermissions("system:config:edit")
|
||||
@Log(title = "引擎", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody Config config)
|
||||
{
|
||||
public Result edit(@RequestBody Config config) {
|
||||
return toAjax(configService.updateConfig(config));
|
||||
}
|
||||
|
||||
|
@ -104,13 +99,13 @@ public class ConfigController extends BaseController
|
|||
@RequiresPermissions("system:config:remove")
|
||||
@Log(title = "引擎", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] ids) {
|
||||
return toAjax(configService.deleteConfigByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 引擎测试
|
||||
*
|
||||
* @param textData
|
||||
* @return
|
||||
*/
|
||||
|
@ -121,6 +116,7 @@ public class ConfigController extends BaseController
|
|||
|
||||
/**
|
||||
* 通过引擎作用域获取引擎配置作用域信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -23,8 +23,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/edition")
|
||||
public class EditionController extends BaseController
|
||||
{
|
||||
public class EditionController extends BaseController {
|
||||
@Autowired
|
||||
private IEditionService editionService;
|
||||
|
||||
|
@ -33,8 +32,7 @@ public class EditionController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("goods:edition:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Edition>> list()
|
||||
{
|
||||
public Result<TableDataInfo<Edition>> list() {
|
||||
startPage();
|
||||
List<Edition> list = editionService.selectEditionList();
|
||||
return getDataTable(list);
|
||||
|
@ -42,6 +40,7 @@ public class EditionController extends BaseController
|
|||
|
||||
/**
|
||||
* 获取相应的规则引擎版本
|
||||
*
|
||||
* @param ruleId
|
||||
* @return
|
||||
*/
|
||||
|
@ -56,8 +55,7 @@ public class EditionController extends BaseController
|
|||
@RequiresPermissions("goods:edition:export")
|
||||
@Log(title = "规则引擎版本", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Edition edition)
|
||||
{
|
||||
public void export(HttpServletResponse response, Edition edition) {
|
||||
List<Edition> list = editionService.selectEditionList();
|
||||
ExcelUtil<Edition> util = new ExcelUtil<Edition>(Edition.class);
|
||||
util.exportExcel(response, list, "规则引擎版本数据");
|
||||
|
@ -68,8 +66,7 @@ public class EditionController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("goods:edition:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public Result getInfo(@PathVariable("id") Long id) {
|
||||
return success(editionService.selectEditionById(id));
|
||||
}
|
||||
|
||||
|
@ -79,8 +76,7 @@ public class EditionController extends BaseController
|
|||
@RequiresPermissions("goods:edition:add")
|
||||
@Log(title = "规则引擎版本", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody Edition edition)
|
||||
{
|
||||
public Result add(@RequestBody Edition edition) {
|
||||
return toAjax(editionService.insertEdition(edition));
|
||||
}
|
||||
|
||||
|
@ -90,8 +86,7 @@ public class EditionController extends BaseController
|
|||
@RequiresPermissions("goods:edition:edit")
|
||||
@Log(title = "规则引擎版本", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody Edition edition)
|
||||
{
|
||||
public Result edit(@RequestBody Edition edition) {
|
||||
return toAjax(editionService.updateEdition(edition));
|
||||
}
|
||||
|
||||
|
@ -101,8 +96,7 @@ public class EditionController extends BaseController
|
|||
@RequiresPermissions("goods:edition:remove")
|
||||
@Log(title = "规则引擎版本", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] ids) {
|
||||
return toAjax(editionService.deleteEditionByIds(ids));
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/engine")
|
||||
public class RuleEngineController extends BaseController
|
||||
{
|
||||
public class RuleEngineController extends BaseController {
|
||||
@Autowired
|
||||
private IRuleEngineService ruleEngineService;
|
||||
|
||||
|
@ -33,8 +32,7 @@ public class RuleEngineController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("goods:engine:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<RuleEngine>> list(RuleEngine ruleEngine)
|
||||
{
|
||||
public Result<TableDataInfo<RuleEngine>> list(RuleEngine ruleEngine) {
|
||||
startPage();
|
||||
List<RuleEngine> list = ruleEngineService.selectRuleEngineList(ruleEngine);
|
||||
return getDataTable(list);
|
||||
|
@ -46,8 +44,7 @@ public class RuleEngineController extends BaseController
|
|||
@RequiresPermissions("goods:engine:export")
|
||||
@Log(title = "规则引擎", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RuleEngine ruleEngine)
|
||||
{
|
||||
public void export(HttpServletResponse response, RuleEngine ruleEngine) {
|
||||
List<RuleEngine> list = ruleEngineService.selectRuleEngineList(ruleEngine);
|
||||
ExcelUtil<RuleEngine> util = new ExcelUtil<RuleEngine>(RuleEngine.class);
|
||||
util.exportExcel(response, list, "规则引擎数据");
|
||||
|
@ -58,8 +55,7 @@ public class RuleEngineController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("goods:engine:query")
|
||||
@GetMapping(value = "/{ruleId}")
|
||||
public Result getInfo(@PathVariable("ruleId") Long ruleId)
|
||||
{
|
||||
public Result getInfo(@PathVariable("ruleId") Long ruleId) {
|
||||
return success(ruleEngineService.selectRuleEngineByRuleId(ruleId));
|
||||
}
|
||||
|
||||
|
@ -74,8 +70,7 @@ public class RuleEngineController extends BaseController
|
|||
@RequiresPermissions("goods:engine:add")
|
||||
@Log(title = "规则引擎", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody RuleEngine ruleEngine)
|
||||
{
|
||||
public Result add(@RequestBody RuleEngine ruleEngine) {
|
||||
return toAjax(ruleEngineService.insertRuleEngine(ruleEngine));
|
||||
}
|
||||
|
||||
|
@ -85,8 +80,7 @@ public class RuleEngineController extends BaseController
|
|||
@RequiresPermissions("goods:engine:edit")
|
||||
@Log(title = "规则引擎", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody RuleEngine ruleEngine)
|
||||
{
|
||||
public Result edit(@RequestBody RuleEngine ruleEngine) {
|
||||
return toAjax(ruleEngineService.updateRuleEngine(ruleEngine));
|
||||
}
|
||||
|
||||
|
@ -96,13 +90,13 @@ public class RuleEngineController extends BaseController
|
|||
@RequiresPermissions("goods:engine:remove")
|
||||
@Log(title = "规则引擎", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ruleIds}")
|
||||
public Result remove(@PathVariable Long[] ruleIds)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] ruleIds) {
|
||||
return toAjax(ruleEngineService.deleteRuleEngineByRuleIds(ruleIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 规则描述
|
||||
*
|
||||
* @param ruleId
|
||||
* @return
|
||||
*/
|
||||
|
@ -116,6 +110,7 @@ public class RuleEngineController extends BaseController
|
|||
ruleEngineService.updateRuleIsActivate(ruleEngine);
|
||||
return success("改变激活状态");
|
||||
}
|
||||
|
||||
@PutMapping("/updateRuleStatus")
|
||||
public Result updateRuleStatus(@RequestBody RuleEngine ruleEngine) {
|
||||
ruleEngineService.updateRuleStatus(ruleEngine);
|
||||
|
|
|
@ -53,7 +53,6 @@ public class DynamicLoader {
|
|||
* URLClassLoader的具体作用就是将class文件加载到jvm虚拟机中去
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public static class MemoryClassLoader extends URLClassLoader {
|
||||
Map<String, byte[]> classBytes = new HashMap<String, byte[]>();
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* 将编译好的.class文件保存到内存当中,这里的内存也就是map映射当中
|
||||
*
|
||||
* @ClassName MemoryJavaFileManager
|
||||
* @Author 森静若林
|
||||
* @Date 2024/5/1 20:38
|
||||
|
@ -25,6 +26,30 @@ public final class MemoryJavaFileManager extends ForwardingJavaFileManager {
|
|||
classBytes = new HashMap<String, byte[]>();
|
||||
}
|
||||
|
||||
static JavaFileObject makeStringSource(String name, String code) {
|
||||
return new StringInputBuffer(name, code);
|
||||
}
|
||||
|
||||
static URI toURI(String name) {
|
||||
File file = new File(name);
|
||||
if (file.exists()) {// 如果文件存在,返回他的URI
|
||||
return file.toURI();
|
||||
} else {
|
||||
try {
|
||||
final StringBuilder newUri = new StringBuilder();
|
||||
newUri.append("mfm:///");
|
||||
newUri.append(name.replace('.', '/'));
|
||||
if (name.endsWith(EXT)) {
|
||||
newUri.replace(newUri.length() - EXT.length(),
|
||||
newUri.length(), EXT);
|
||||
}
|
||||
return URI.create(newUri.toString());
|
||||
} catch (Exception exp) {
|
||||
return URI.create("mfm:///com/sun/script/java/java_source");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, byte[]> getClassBytes() {
|
||||
return classBytes;
|
||||
}
|
||||
|
@ -38,6 +63,18 @@ public final class MemoryJavaFileManager extends ForwardingJavaFileManager {
|
|||
public void flush() throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaFileObject getJavaFileForOutput(
|
||||
Location location, String className,
|
||||
JavaFileObject.Kind kind, FileObject sibling) throws IOException {
|
||||
if (kind == JavaFileObject.Kind.CLASS) {
|
||||
return new ClassOutputBuffer(className);
|
||||
} else {
|
||||
return super.getJavaFileForOutput(location, className, kind,
|
||||
sibling);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 一个文件对象,用来表示从string中获取到的source,一下类容是按照jkd给出的例子写的
|
||||
*/
|
||||
|
@ -95,40 +132,4 @@ public final class MemoryJavaFileManager extends ForwardingJavaFileManager {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaFileObject getJavaFileForOutput(
|
||||
Location location, String className,
|
||||
JavaFileObject.Kind kind, FileObject sibling) throws IOException {
|
||||
if (kind == JavaFileObject.Kind.CLASS) {
|
||||
return new ClassOutputBuffer(className);
|
||||
} else {
|
||||
return super.getJavaFileForOutput(location, className, kind,
|
||||
sibling);
|
||||
}
|
||||
}
|
||||
|
||||
static JavaFileObject makeStringSource(String name, String code) {
|
||||
return new StringInputBuffer(name, code);
|
||||
}
|
||||
|
||||
static URI toURI(String name) {
|
||||
File file = new File(name);
|
||||
if (file.exists()) {// 如果文件存在,返回他的URI
|
||||
return file.toURI();
|
||||
} else {
|
||||
try {
|
||||
final StringBuilder newUri = new StringBuilder();
|
||||
newUri.append("mfm:///");
|
||||
newUri.append(name.replace('.', '/'));
|
||||
if (name.endsWith(EXT)) {
|
||||
newUri.replace(newUri.length() - EXT.length(),
|
||||
newUri.length(), EXT);
|
||||
}
|
||||
return URI.create(newUri.toString());
|
||||
} catch (Exception exp) {
|
||||
return URI.create("mfm:///com/sun/script/java/java_source");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
* @author muyu
|
||||
* @date 2024-05-04
|
||||
*/
|
||||
public interface ConfigMapper
|
||||
{
|
||||
public interface ConfigMapper {
|
||||
/**
|
||||
* 查询引擎
|
||||
*
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
* @author muyu
|
||||
* @date 2024-05-06
|
||||
*/
|
||||
public interface EditionMapper
|
||||
{
|
||||
public interface EditionMapper {
|
||||
/**
|
||||
* 查询规则引擎版本
|
||||
*
|
||||
|
|
|
@ -11,8 +11,7 @@ import java.util.List;
|
|||
* @author muyu
|
||||
* @date 2024-05-02
|
||||
*/
|
||||
public interface RuleEngineMapper
|
||||
{
|
||||
public interface RuleEngineMapper {
|
||||
/**
|
||||
* 查询规则引擎
|
||||
*
|
||||
|
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
|
||||
/**
|
||||
* 数据模型上下文
|
||||
*
|
||||
* @ClassName DataModelContextHolder
|
||||
* @Author 森静若林
|
||||
* @Version: 1.0
|
||||
|
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
|
||||
/**
|
||||
* 数据集上下文
|
||||
*
|
||||
* @ClassName DataSetContextHolder
|
||||
* @Author 森静若林
|
||||
* @Version: 1.0
|
||||
|
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
|
||||
/**
|
||||
* 记录上下文
|
||||
*
|
||||
* @ClassName RecordContextHolder
|
||||
* @Author 森静若林
|
||||
* @Version: 1.0
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.edition.scope;
|
|||
|
||||
/**
|
||||
* 任务上下文
|
||||
*
|
||||
* @ClassName TaskContextHolder
|
||||
* @Author 森静若林
|
||||
* @Version: 1.0
|
||||
|
|
|
@ -12,8 +12,7 @@ import java.util.List;
|
|||
* @author muyu
|
||||
* @date 2024-05-04
|
||||
*/
|
||||
public interface IConfigService
|
||||
{
|
||||
public interface IConfigService {
|
||||
/**
|
||||
* 查询引擎
|
||||
*
|
||||
|
@ -32,6 +31,7 @@ public interface IConfigService
|
|||
|
||||
/**
|
||||
* 查询引擎列表
|
||||
*
|
||||
* @param ruleId
|
||||
* @return
|
||||
*/
|
||||
|
@ -73,6 +73,7 @@ public interface IConfigService
|
|||
|
||||
/**
|
||||
* 通过引擎作用域获取引擎配置作用域信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
* @author muyu
|
||||
* @date 2024-05-06
|
||||
*/
|
||||
public interface IEditionService
|
||||
{
|
||||
public interface IEditionService {
|
||||
/**
|
||||
* 查询规则引擎版本
|
||||
*
|
||||
|
@ -27,6 +26,7 @@ public interface IEditionService
|
|||
* @return
|
||||
*/
|
||||
List<Edition> selectListRuleId(Long ruleId);
|
||||
|
||||
/**
|
||||
* 查询规则引擎版本列表
|
||||
*
|
||||
|
|
|
@ -11,8 +11,7 @@ import java.util.List;
|
|||
* @author muyu
|
||||
* @date 2024-05-02
|
||||
*/
|
||||
public interface IRuleEngineService
|
||||
{
|
||||
public interface IRuleEngineService {
|
||||
/**
|
||||
* 查询规则引擎
|
||||
*
|
||||
|
@ -23,10 +22,12 @@ public interface IRuleEngineService
|
|||
|
||||
/**
|
||||
* 规则详情
|
||||
*
|
||||
* @param ruleId
|
||||
* @return
|
||||
*/
|
||||
RuleEngine selectRuleEngineOne(Long ruleId);
|
||||
|
||||
/**
|
||||
* 查询规则引擎列表
|
||||
*
|
||||
|
|
|
@ -27,8 +27,7 @@ import java.util.stream.Collectors;
|
|||
* @date 2024-05-04
|
||||
*/
|
||||
@Service
|
||||
public class ConfigServiceImpl implements IConfigService
|
||||
{
|
||||
public class ConfigServiceImpl implements IConfigService {
|
||||
@Autowired
|
||||
private ConfigMapper configMapper;
|
||||
|
||||
|
@ -39,8 +38,7 @@ public class ConfigServiceImpl implements IConfigService
|
|||
* @return 引擎
|
||||
*/
|
||||
@Override
|
||||
public Config selectConfigById(Long id)
|
||||
{
|
||||
public Config selectConfigById(Long id) {
|
||||
return configMapper.selectConfigById(id);
|
||||
}
|
||||
|
||||
|
@ -51,13 +49,13 @@ public class ConfigServiceImpl implements IConfigService
|
|||
* @return 引擎
|
||||
*/
|
||||
@Override
|
||||
public List<Config> selectConfigList(Config config)
|
||||
{
|
||||
public List<Config> selectConfigList(Config config) {
|
||||
return configMapper.selectConfigList(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* y引擎列表
|
||||
*
|
||||
* @param ruleId
|
||||
* @return
|
||||
*/
|
||||
|
@ -73,8 +71,7 @@ public class ConfigServiceImpl implements IConfigService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertConfig(Config config)
|
||||
{
|
||||
public int insertConfig(Config config) {
|
||||
return configMapper.insertConfig(config);
|
||||
}
|
||||
|
||||
|
@ -85,8 +82,7 @@ public class ConfigServiceImpl implements IConfigService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateConfig(Config config)
|
||||
{
|
||||
public int updateConfig(Config config) {
|
||||
return configMapper.updateConfig(config);
|
||||
}
|
||||
|
||||
|
@ -97,8 +93,7 @@ public class ConfigServiceImpl implements IConfigService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteConfigByIds(Long[] ids)
|
||||
{
|
||||
public int deleteConfigByIds(Long[] ids) {
|
||||
return configMapper.deleteConfigByIds(ids);
|
||||
}
|
||||
|
||||
|
@ -109,8 +104,7 @@ public class ConfigServiceImpl implements IConfigService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteConfigById(Long id)
|
||||
{
|
||||
public int deleteConfigById(Long id) {
|
||||
return configMapper.deleteConfigById(id);
|
||||
}
|
||||
|
||||
|
@ -141,6 +135,7 @@ public class ConfigServiceImpl implements IConfigService
|
|||
|
||||
/**
|
||||
* 通过引擎作用域获取引擎配置作用域信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -16,8 +16,7 @@ import java.util.stream.Collectors;
|
|||
* @date 2024-05-06
|
||||
*/
|
||||
@Service
|
||||
public class EditionServiceImpl implements IEditionService
|
||||
{
|
||||
public class EditionServiceImpl implements IEditionService {
|
||||
@Autowired
|
||||
private EditionMapper editionMapper;
|
||||
|
||||
|
@ -28,8 +27,7 @@ public class EditionServiceImpl implements IEditionService
|
|||
* @return 规则引擎版本
|
||||
*/
|
||||
@Override
|
||||
public Edition selectEditionById(Long id)
|
||||
{
|
||||
public Edition selectEditionById(Long id) {
|
||||
return editionMapper.selectEditionById(id);
|
||||
}
|
||||
|
||||
|
@ -50,8 +48,7 @@ public class EditionServiceImpl implements IEditionService
|
|||
* @return 规则引擎版本
|
||||
*/
|
||||
@Override
|
||||
public List<Edition> selectEditionList()
|
||||
{
|
||||
public List<Edition> selectEditionList() {
|
||||
return editionMapper.selectEditionList();
|
||||
}
|
||||
|
||||
|
@ -62,8 +59,7 @@ public class EditionServiceImpl implements IEditionService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEdition(Edition edition)
|
||||
{
|
||||
public int insertEdition(Edition edition) {
|
||||
return editionMapper.insertEdition(edition);
|
||||
}
|
||||
|
||||
|
@ -74,8 +70,7 @@ public class EditionServiceImpl implements IEditionService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEdition(Edition edition)
|
||||
{
|
||||
public int updateEdition(Edition edition) {
|
||||
return editionMapper.updateEdition(edition);
|
||||
}
|
||||
|
||||
|
@ -86,8 +81,7 @@ public class EditionServiceImpl implements IEditionService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEditionByIds(Long[] ids)
|
||||
{
|
||||
public int deleteEditionByIds(Long[] ids) {
|
||||
return editionMapper.deleteEditionByIds(ids);
|
||||
}
|
||||
|
||||
|
@ -98,8 +92,7 @@ public class EditionServiceImpl implements IEditionService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEditionById(Long id)
|
||||
{
|
||||
public int deleteEditionById(Long id) {
|
||||
return editionMapper.deleteEditionById(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,8 +23,7 @@ import java.util.stream.Collectors;
|
|||
* @date 2024-05-02
|
||||
*/
|
||||
@Service
|
||||
public class RuleEngineServiceImpl implements IRuleEngineService
|
||||
{
|
||||
public class RuleEngineServiceImpl implements IRuleEngineService {
|
||||
@Autowired
|
||||
private RuleEngineMapper ruleEngineMapper;
|
||||
|
||||
|
@ -35,13 +34,13 @@ public class RuleEngineServiceImpl implements IRuleEngineService
|
|||
* @return 规则引擎
|
||||
*/
|
||||
@Override
|
||||
public RuleEngine selectRuleEngineByRuleId(Long ruleId)
|
||||
{
|
||||
public RuleEngine selectRuleEngineByRuleId(Long ruleId) {
|
||||
return ruleEngineMapper.selectRuleEngineByRuleId(ruleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 规则引擎详情
|
||||
*
|
||||
* @param ruleId
|
||||
* @return
|
||||
*/
|
||||
|
@ -59,8 +58,7 @@ public class RuleEngineServiceImpl implements IRuleEngineService
|
|||
* @return 规则引擎
|
||||
*/
|
||||
@Override
|
||||
public List<RuleEngine> selectRuleEngineList(RuleEngine ruleEngine)
|
||||
{
|
||||
public List<RuleEngine> selectRuleEngineList(RuleEngine ruleEngine) {
|
||||
return ruleEngineMapper.selectRuleEngineList(ruleEngine);
|
||||
}
|
||||
|
||||
|
@ -71,8 +69,7 @@ public class RuleEngineServiceImpl implements IRuleEngineService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRuleEngine(RuleEngine ruleEngine)
|
||||
{
|
||||
public int insertRuleEngine(RuleEngine ruleEngine) {
|
||||
return ruleEngineMapper.insertRuleEngine(ruleEngine);
|
||||
}
|
||||
|
||||
|
@ -83,8 +80,7 @@ public class RuleEngineServiceImpl implements IRuleEngineService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRuleEngine(RuleEngine ruleEngine)
|
||||
{
|
||||
public int updateRuleEngine(RuleEngine ruleEngine) {
|
||||
return ruleEngineMapper.updateRuleEngine(ruleEngine);
|
||||
}
|
||||
|
||||
|
@ -95,8 +91,7 @@ public class RuleEngineServiceImpl implements IRuleEngineService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRuleEngineByRuleIds(Long[] ruleIds)
|
||||
{
|
||||
public int deleteRuleEngineByRuleIds(Long[] ruleIds) {
|
||||
return ruleEngineMapper.deleteRuleEngineByRuleIds(ruleIds);
|
||||
}
|
||||
|
||||
|
@ -107,8 +102,7 @@ public class RuleEngineServiceImpl implements IRuleEngineService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRuleEngineByRuleId(Long ruleId)
|
||||
{
|
||||
public int deleteRuleEngineByRuleId(Long ruleId) {
|
||||
return ruleEngineMapper.deleteRuleEngineByRuleId(ruleId);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/muyu-visual-monitor"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,74 @@
|
|||
<?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="com.muyu.edition.mapper.ConfigMapper">
|
||||
|
||||
<resultMap type="com.muyu.edition.domain.Config" id="ConfigResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="versionCode" column="version_code"/>
|
||||
<result property="ruleContent" column="rule_content"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="ruleId" column="rule_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectConfigVo">
|
||||
select id, version_code, rule_content, remark, rule_id
|
||||
from config
|
||||
</sql>
|
||||
|
||||
<select id="selectConfigList" parameterType="com.muyu.edition.domain.Config" resultMap="ConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<where>
|
||||
<if test="versionCode != null and versionCode != ''">and version_code = #{versionCode}</if>
|
||||
<if test="ruleContent != null and ruleContent != ''">and rule_content = #{ruleContent}</if>
|
||||
<if test="ruleId != null ">and rule_id = #{ruleId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigById" parameterType="Long" resultMap="ConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="listConfigEs" resultType="com.muyu.edition.domain.Config">
|
||||
<include refid="selectConfigVo"/>
|
||||
where rule_id = #{ruleId}
|
||||
</select>
|
||||
|
||||
<insert id="insertConfig" parameterType="com.muyu.edition.domain.Config" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="versionCode != null">version_code,</if>
|
||||
<if test="ruleContent != null">rule_content,</if>
|
||||
<if test="ruleId != null">rule_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="versionCode != null">#{versionCode},</if>
|
||||
<if test="ruleContent != null">#{ruleContent},</if>
|
||||
<if test="ruleId != null">#{ruleId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateConfig" parameterType="com.muyu.edition.domain.Config">
|
||||
update config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="versionCode != null">version_code = #{versionCode},</if>
|
||||
<if test="ruleContent != null">rule_content = #{ruleContent},</if>
|
||||
<if test="ruleId != null">rule_id = #{ruleId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteConfigById" parameterType="Long">
|
||||
delete
|
||||
from config
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteConfigByIds" parameterType="String">
|
||||
delete from config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,11 @@
|
|||
<?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="com.muyu.edition.mapper.CopeMapper">
|
||||
|
||||
<select id="list" resultType="com.muyu.edition.domain.Cope">
|
||||
select *
|
||||
from cope
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,85 @@
|
|||
<?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="com.muyu.edition.mapper.EditionMapper">
|
||||
|
||||
<resultMap type="com.muyu.edition.domain.Edition" id="EditionResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="ruleId" column="rule_id"/>
|
||||
<result property="versionClass" column="version_class"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="versionCode" column="version_code"/>
|
||||
<result property="editionStatus" column="edition_status"/>
|
||||
<result property="ruleStatus" column="rule_status"/>
|
||||
<result property="ruleIsTest" column="rule_is_test"/>
|
||||
<result property="editionContent" column="edition_content"/>
|
||||
<result property="ruleContent" column="rule_content"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEditionVo">
|
||||
select id,
|
||||
rule_id,
|
||||
version_class,
|
||||
name,
|
||||
version_code,
|
||||
edition_status,
|
||||
rule_status,
|
||||
rule_is_test,
|
||||
edition_content,
|
||||
rule_content
|
||||
from edition
|
||||
</sql>
|
||||
|
||||
<select id="selectEditionList" parameterType="com.muyu.edition.domain.Edition" resultMap="EditionResult">
|
||||
<include refid="selectEditionVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectEditionById" parameterType="Long" resultMap="EditionResult">
|
||||
<include refid="selectEditionVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEdition" parameterType="com.muyu.edition.domain.Edition" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into edition
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleId != null">rule_id,</if>
|
||||
<if test="versionClass != null">version_class,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="versionCode != null">version_code,</if>
|
||||
<if test="editionContent != null">edition_content,</if>
|
||||
<if test="ruleContent != null">rule_content,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleId != null">#{ruleId},</if>
|
||||
<if test="versionClass != null">#{versionClass},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="versionCode != null">#{versionCode},</if>
|
||||
<if test="editionContent != null">#{editionContent},</if>
|
||||
<if test="ruleContent != null">#{ruleContent},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEdition" parameterType="com.muyu.edition.domain.Edition">
|
||||
update edition
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="editionContent != null">edition_content = #{editionContent},</if>
|
||||
<if test="ruleContent != null">rule_content = #{ruleContent},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEditionById" parameterType="Long">
|
||||
delete
|
||||
from edition
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEditionByIds" parameterType="String">
|
||||
delete from edition where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,115 @@
|
|||
<?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="com.muyu.edition.mapper.RuleEngineMapper">
|
||||
|
||||
<resultMap type="com.muyu.edition.domain.RuleEngine" id="RuleEngineResult">
|
||||
<result property="ruleId" column="rule_id"/>
|
||||
<result property="ruleName" column="rule_name"/>
|
||||
<result property="ruleCode" column="rule_code"/>
|
||||
<result property="ruleLevel" column="rule_level"/>
|
||||
<result property="ruleType" column="rule_type"/>
|
||||
<result property="ruleIsActivate" column="rule_is_activate"/>
|
||||
<result property="ruleStatus" column="rule_status"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRuleEngineVo">
|
||||
select rule_id,
|
||||
rule_name,
|
||||
rule_code,
|
||||
rule_level,
|
||||
rule_type,
|
||||
rule_is_activate,
|
||||
rule_status,
|
||||
description,
|
||||
remark
|
||||
from rule_engine
|
||||
</sql>
|
||||
|
||||
<select id="selectRuleEngineList" parameterType="com.muyu.edition.domain.RuleEngine" resultMap="RuleEngineResult">
|
||||
<include refid="selectRuleEngineVo"/>
|
||||
<where>
|
||||
<if test="ruleName != null and ruleName != ''">and rule_name like concat('%', #{ruleName}, '%')</if>
|
||||
<if test="ruleLevel != null and ruleLevel != ''">and rule_level = #{ruleLevel}</if>
|
||||
<if test="ruleType != null and ruleType != ''">and rule_type = #{ruleType}</if>
|
||||
<if test="ruleIsActivate != null and ruleIsActivate != ''">and rule_is_activate = #{ruleIsActivate}</if>
|
||||
<if test="ruleStatus != null and ruleStatus != ''">and rule_status = #{ruleStatus}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRuleEngineByRuleId" parameterType="Long" resultMap="RuleEngineResult">
|
||||
<include refid="selectRuleEngineVo"/>
|
||||
where rule_id = #{ruleId}
|
||||
</select>
|
||||
<select id="description" resultType="java.lang.String">
|
||||
select description
|
||||
from rule_engine
|
||||
where rule_id = #{ruleId};
|
||||
</select>
|
||||
|
||||
<insert id="insertRuleEngine" parameterType="com.muyu.edition.domain.RuleEngine" useGeneratedKeys="true"
|
||||
keyProperty="ruleId">
|
||||
insert into rule_engine
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleName != null">rule_name,</if>
|
||||
<if test="ruleCode != null">rule_code,</if>
|
||||
<if test="ruleLevel != null">rule_level,</if>
|
||||
<if test="ruleType != null">rule_type,</if>
|
||||
<if test="ruleIsActivate != null">rule_is_activate,</if>
|
||||
<if test="ruleStatus != null">rule_status,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleName != null">#{ruleName},</if>
|
||||
<if test="ruleCode != null">#{ruleCode},</if>
|
||||
<if test="ruleLevel != null">#{ruleLevel},</if>
|
||||
<if test="ruleType != null">#{ruleType},</if>
|
||||
<if test="ruleIsActivate != null">#{ruleIsActivate},</if>
|
||||
<if test="ruleStatus != null">#{ruleStatus},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRuleEngine" parameterType="com.muyu.edition.domain.RuleEngine">
|
||||
update rule_engine
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ruleName != null">rule_name = #{ruleName},</if>
|
||||
<if test="ruleCode != null">rule_code = #{ruleCode},</if>
|
||||
<if test="ruleLevel != null">rule_level = #{ruleLevel},</if>
|
||||
<if test="ruleType != null">rule_type = #{ruleType},</if>
|
||||
<if test="ruleIsActivate != null">rule_is_activate = #{ruleIsActivate},</if>
|
||||
<if test="ruleStatus != null">rule_status = #{ruleStatus},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where rule_id = #{ruleId}
|
||||
</update>
|
||||
<update id="updateRuleIsActivate">
|
||||
update rule_engine
|
||||
set rule_is_activate = #{ruleIsActivate}
|
||||
where rule_id = #{ruleId};
|
||||
</update>
|
||||
<update id="updateRuleStatus">
|
||||
update rule_engine
|
||||
set rule_status = #{ruleStatus}
|
||||
where rule_id = #{ruleId};
|
||||
</update>
|
||||
|
||||
<delete id="deleteRuleEngineByRuleId" parameterType="Long">
|
||||
delete
|
||||
from rule_engine
|
||||
where rule_id = #{ruleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRuleEngineByRuleIds" parameterType="String">
|
||||
delete from rule_engine where rule_id in
|
||||
<foreach item="ruleId" collection="array" open="(" separator="," close=")">
|
||||
#{ruleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-goods-tests</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-goods-test-clinet</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-goods-test-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,15 +0,0 @@
|
|||
package com.muyu.edition.test.clinet.cllent.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
|
||||
import java.rmi.server.RemoteServer;
|
||||
|
||||
public class AccessConfigRunner implements ApplicationRunner {
|
||||
@Autowired
|
||||
private RemoteServer remoteServer;
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-goods-tests</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-goods-test-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-goods-tests</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-goods-test-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,4 +0,0 @@
|
|||
package com.muyu.data.test.remote;
|
||||
|
||||
public interface RemoteDataManagerService {
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.muyu.data.test.remote.factory;
|
||||
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
||||
import java.rmi.Remote;
|
||||
|
||||
//熔断
|
||||
@FeignClient(
|
||||
contextId = "RemoteSys",
|
||||
value = ServiceNameConstants.TEST_MUYU,
|
||||
fallbackFactory = DataMangFacrory.class,
|
||||
path = "/system"
|
||||
)
|
||||
public class DataMangFacrory {
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-goods-tests</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-goods-test-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.test.config;
|
||||
|
||||
import com.google.common.hash.BloomFilter;
|
||||
import com.google.common.hash.Funnels;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
@Configuration
|
||||
public class BloomFilterConfig {
|
||||
|
||||
@Value("${bloom-filter-exrcted-insertions}")
|
||||
private int expectedInsertions;
|
||||
|
||||
@Value("${bloom-filter.fpp}")
|
||||
private double falsePositiveProbability;
|
||||
|
||||
@Bean
|
||||
public BloomFilter<String> bloomFilter() {
|
||||
return BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()),expectedInsertions);
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-goods-tests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>muyu-goods-test-clinet</module>
|
||||
<module>muyu-goods-test-common</module>
|
||||
<module>muyu-goods-test-remote</module>
|
||||
<module>muyu-goods-test-server</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import com.muyu.edition.domain.Cope;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -74,23 +72,6 @@ public class stream {
|
|||
System.out.println(first.stream().collect(Collectors.toSet()));
|
||||
//findAny 返回流的任意一个元素
|
||||
|
||||
// peek 修改元素
|
||||
List<Cope> copes = new ArrayList<>();
|
||||
for (int i = 1; i <= 3; i++) {
|
||||
Cope cope = new Cope();
|
||||
cope.setCode("code"+i);
|
||||
cope.setType("type"+i);
|
||||
cope.setVal("val"+i);
|
||||
copes.add(cope);
|
||||
}
|
||||
System.out.println(copes);
|
||||
Stream<Cope> peek = copes.stream().peek(c -> {
|
||||
if (c.getVal().contains("1")){
|
||||
c.setVal("123");
|
||||
}
|
||||
});
|
||||
List<Cope> collect3 = peek.collect(Collectors.toList());
|
||||
System.out.println(collect3);
|
||||
//
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class yes {
|
||||
|
|
|
@ -13,7 +13,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectConfigVo">
|
||||
select id, version_code, rule_content, remark, rule_id from config
|
||||
select id, version_code, rule_content, remark, rule_id
|
||||
from config
|
||||
</sql>
|
||||
|
||||
<select id="selectConfigList" parameterType="com.muyu.edition.domain.Config" resultMap="ConfigResult">
|
||||
|
@ -59,7 +60,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<delete id="deleteConfigById" parameterType="Long">
|
||||
delete from config where id = #{id}
|
||||
delete
|
||||
from config
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteConfigByIds" parameterType="String">
|
||||
|
|
|
@ -18,7 +18,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectEditionVo">
|
||||
select id, rule_id, version_class, name, version_code, edition_status, rule_status, rule_is_test, edition_content, rule_content from edition
|
||||
select id,
|
||||
rule_id,
|
||||
version_class,
|
||||
name,
|
||||
version_code,
|
||||
edition_status,
|
||||
rule_status,
|
||||
rule_is_test,
|
||||
edition_content,
|
||||
rule_content
|
||||
from edition
|
||||
</sql>
|
||||
|
||||
<select id="selectEditionList" parameterType="com.muyu.edition.domain.Edition" resultMap="EditionResult">
|
||||
|
@ -61,7 +71,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<delete id="deleteEditionById" parameterType="Long">
|
||||
delete from edition where id = #{id}
|
||||
delete
|
||||
from edition
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEditionByIds" parameterType="String">
|
||||
|
|
|
@ -17,7 +17,16 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectRuleEngineVo">
|
||||
select rule_id, rule_name, rule_code, rule_level, rule_type, rule_is_activate, rule_status, description, remark from rule_engine
|
||||
select rule_id,
|
||||
rule_name,
|
||||
rule_code,
|
||||
rule_level,
|
||||
rule_type,
|
||||
rule_is_activate,
|
||||
rule_status,
|
||||
description,
|
||||
remark
|
||||
from rule_engine
|
||||
</sql>
|
||||
|
||||
<select id="selectRuleEngineList" parameterType="com.muyu.edition.domain.RuleEngine" resultMap="RuleEngineResult">
|
||||
|
@ -37,10 +46,12 @@
|
|||
</select>
|
||||
<select id="description" resultType="java.lang.String">
|
||||
select description
|
||||
from rule_engine where rule_id = #{ruleId};
|
||||
from rule_engine
|
||||
where rule_id = #{ruleId};
|
||||
</select>
|
||||
|
||||
<insert id="insertRuleEngine" parameterType="com.muyu.edition.domain.RuleEngine" useGeneratedKeys="true" keyProperty="ruleId">
|
||||
<insert id="insertRuleEngine" parameterType="com.muyu.edition.domain.RuleEngine" useGeneratedKeys="true"
|
||||
keyProperty="ruleId">
|
||||
insert into rule_engine
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleName != null">rule_name,</if>
|
||||
|
@ -90,7 +101,9 @@
|
|||
</update>
|
||||
|
||||
<delete id="deleteRuleEngineByRuleId" parameterType="Long">
|
||||
delete from rule_engine where rule_id = #{ruleId}
|
||||
delete
|
||||
from rule_engine
|
||||
where rule_id = #{ruleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRuleEngineByRuleIds" parameterType="String">
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.muyu.job.controller;
|
||||
|
||||
import com.muyu.common.core.constant.Constants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.exception.job.TaskException;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.muyu.job.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
|
|
@ -15,7 +15,6 @@ public interface SysJobLogMapper extends BaseMapper<SysJobLog> {
|
|||
* 获取quartz调度器日志的计划任务
|
||||
*
|
||||
* @param jobLog 调度日志信息
|
||||
*
|
||||
* @return 调度任务日志集合
|
||||
*/
|
||||
public List<SysJobLog> selectJobLogList(SysJobLog jobLog);
|
||||
|
@ -31,7 +30,6 @@ public interface SysJobLogMapper extends BaseMapper<SysJobLog> {
|
|||
* 通过调度任务日志ID查询调度信息
|
||||
*
|
||||
* @param jobLogId 调度任务日志ID
|
||||
*
|
||||
* @return 调度任务日志对象信息
|
||||
*/
|
||||
public SysJobLog selectJobLogById(Long jobLogId);
|
||||
|
@ -40,7 +38,6 @@ public interface SysJobLogMapper extends BaseMapper<SysJobLog> {
|
|||
* 新增任务日志
|
||||
*
|
||||
* @param jobLog 调度日志信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJobLog(SysJobLog jobLog);
|
||||
|
@ -49,7 +46,6 @@ public interface SysJobLogMapper extends BaseMapper<SysJobLog> {
|
|||
* 批量删除调度日志信息
|
||||
*
|
||||
* @param logIds 需要删除的数据ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJobLogByIds(Long[] logIds);
|
||||
|
@ -58,7 +54,6 @@ public interface SysJobLogMapper extends BaseMapper<SysJobLog> {
|
|||
* 删除任务日志
|
||||
*
|
||||
* @param jobId 调度日志ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJobLogById(Long jobId);
|
||||
|
|
|
@ -15,7 +15,6 @@ public interface SysJobMapper extends BaseMapper<SysJob> {
|
|||
* 查询调度任务日志集合
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return 操作日志集合
|
||||
*/
|
||||
public List<SysJob> selectJobList(SysJob job);
|
||||
|
@ -31,7 +30,6 @@ public interface SysJobMapper extends BaseMapper<SysJob> {
|
|||
* 通过调度ID查询调度任务信息
|
||||
*
|
||||
* @param jobId 调度ID
|
||||
*
|
||||
* @return 角色对象信息
|
||||
*/
|
||||
public SysJob selectJobById(Long jobId);
|
||||
|
@ -40,7 +38,6 @@ public interface SysJobMapper extends BaseMapper<SysJob> {
|
|||
* 通过调度ID删除调度任务信息
|
||||
*
|
||||
* @param jobId 调度ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJobById(Long jobId);
|
||||
|
@ -49,7 +46,6 @@ public interface SysJobMapper extends BaseMapper<SysJob> {
|
|||
* 批量删除调度任务信息
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJobByIds(Long[] ids);
|
||||
|
@ -58,7 +54,6 @@ public interface SysJobMapper extends BaseMapper<SysJob> {
|
|||
* 修改调度任务信息
|
||||
*
|
||||
* @param job 调度任务信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateJob(SysJob job);
|
||||
|
@ -67,7 +62,6 @@ public interface SysJobMapper extends BaseMapper<SysJob> {
|
|||
* 新增调度任务信息
|
||||
*
|
||||
* @param job 调度任务信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJob(SysJob job);
|
||||
|
|
|
@ -14,7 +14,6 @@ public interface ISysJobLogService {
|
|||
* 获取quartz调度器日志的计划任务
|
||||
*
|
||||
* @param jobLog 调度日志信息
|
||||
*
|
||||
* @return 调度任务日志集合
|
||||
*/
|
||||
public List<SysJobLog> selectJobLogList(SysJobLog jobLog);
|
||||
|
@ -23,7 +22,6 @@ public interface ISysJobLogService {
|
|||
* 通过调度任务日志ID查询调度信息
|
||||
*
|
||||
* @param jobLogId 调度任务日志ID
|
||||
*
|
||||
* @return 调度任务日志对象信息
|
||||
*/
|
||||
public SysJobLog selectJobLogById(Long jobLogId);
|
||||
|
@ -39,7 +37,6 @@ public interface ISysJobLogService {
|
|||
* 批量删除调度日志信息
|
||||
*
|
||||
* @param logIds 需要删除的日志ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJobLogByIds(Long[] logIds);
|
||||
|
@ -48,7 +45,6 @@ public interface ISysJobLogService {
|
|||
* 删除任务日志
|
||||
*
|
||||
* @param jobId 调度日志ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJobLogById(Long jobId);
|
||||
|
|
|
@ -16,7 +16,6 @@ public interface ISysJobService {
|
|||
* 获取quartz调度器的计划任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return 调度任务集合
|
||||
*/
|
||||
public List<SysJob> selectJobList(SysJob job);
|
||||
|
@ -25,7 +24,6 @@ public interface ISysJobService {
|
|||
* 通过调度任务ID查询调度信息
|
||||
*
|
||||
* @param jobId 调度任务ID
|
||||
*
|
||||
* @return 调度任务对象信息
|
||||
*/
|
||||
public SysJob selectJobById(Long jobId);
|
||||
|
@ -34,7 +32,6 @@ public interface ISysJobService {
|
|||
* 暂停任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int pauseJob(SysJob job) throws SchedulerException;
|
||||
|
@ -43,7 +40,6 @@ public interface ISysJobService {
|
|||
* 恢复任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int resumeJob(SysJob job) throws SchedulerException;
|
||||
|
@ -52,7 +48,6 @@ public interface ISysJobService {
|
|||
* 删除任务后,所对应的trigger也将被删除
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJob(SysJob job) throws SchedulerException;
|
||||
|
@ -61,7 +56,6 @@ public interface ISysJobService {
|
|||
* 批量删除调度信息
|
||||
*
|
||||
* @param jobIds 需要删除的任务ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public void deleteJobByIds(Long[] jobIds) throws SchedulerException;
|
||||
|
@ -70,7 +64,6 @@ public interface ISysJobService {
|
|||
* 任务调度状态修改
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int changeStatus(SysJob job) throws SchedulerException;
|
||||
|
@ -79,7 +72,6 @@ public interface ISysJobService {
|
|||
* 立即运行任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean run(SysJob job) throws SchedulerException;
|
||||
|
@ -88,7 +80,6 @@ public interface ISysJobService {
|
|||
* 新增任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJob(SysJob job) throws SchedulerException, TaskException;
|
||||
|
@ -97,7 +88,6 @@ public interface ISysJobService {
|
|||
* 更新任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateJob(SysJob job) throws SchedulerException, TaskException;
|
||||
|
@ -106,7 +96,6 @@ public interface ISysJobService {
|
|||
* 校验cron表达式是否有效
|
||||
*
|
||||
* @param cronExpression 表达式
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkCronExpressionIsValid(String cronExpression);
|
||||
|
|
|
@ -21,7 +21,6 @@ public class SysJobLogServiceImpl implements ISysJobLogService {
|
|||
* 获取quartz调度器日志的计划任务
|
||||
*
|
||||
* @param jobLog 调度日志信息
|
||||
*
|
||||
* @return 调度任务日志集合
|
||||
*/
|
||||
@Override
|
||||
|
@ -33,7 +32,6 @@ public class SysJobLogServiceImpl implements ISysJobLogService {
|
|||
* 通过调度任务日志ID查询调度信息
|
||||
*
|
||||
* @param jobLogId 调度任务日志ID
|
||||
*
|
||||
* @return 调度任务日志对象信息
|
||||
*/
|
||||
@Override
|
||||
|
@ -55,7 +53,6 @@ public class SysJobLogServiceImpl implements ISysJobLogService {
|
|||
* 批量删除调度日志信息
|
||||
*
|
||||
* @param logIds 需要删除的数据ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -46,7 +46,6 @@ public class SysJobServiceImpl implements ISysJobService {
|
|||
* 获取quartz调度器的计划任务列表
|
||||
*
|
||||
* @param job 调度信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
@ -58,7 +57,6 @@ public class SysJobServiceImpl implements ISysJobService {
|
|||
* 通过调度任务ID查询调度信息
|
||||
*
|
||||
* @param jobId 调度任务ID
|
||||
*
|
||||
* @return 调度任务对象信息
|
||||
*/
|
||||
@Override
|
||||
|
@ -123,7 +121,6 @@ public class SysJobServiceImpl implements ISysJobService {
|
|||
* 批量删除调度信息
|
||||
*
|
||||
* @param jobIds 需要删除的任务ID
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -229,7 +226,6 @@ public class SysJobServiceImpl implements ISysJobService {
|
|||
* 校验cron表达式是否有效
|
||||
*
|
||||
* @param cronExpression 表达式
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -90,7 +90,6 @@ public abstract class AbstractQuartzJob implements Job {
|
|||
*
|
||||
* @param context 工作执行上下文对象
|
||||
* @param sysJob 系统计划任务
|
||||
*
|
||||
* @throws Exception 执行过程中的异常
|
||||
*/
|
||||
protected abstract void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception;
|
||||
|
|
|
@ -15,7 +15,6 @@ public class CronUtils {
|
|||
* 返回一个布尔值代表一个给定的Cron表达式的有效性
|
||||
*
|
||||
* @param cronExpression Cron表达式
|
||||
*
|
||||
* @return boolean 表达式是否有效
|
||||
*/
|
||||
public static boolean isValid(String cronExpression) {
|
||||
|
@ -26,7 +25,6 @@ public class CronUtils {
|
|||
* 返回一个字符串值,表示该消息无效Cron表达式给出有效性
|
||||
*
|
||||
* @param cronExpression Cron表达式
|
||||
*
|
||||
* @return String 无效时返回表达式错误描述,如果有效返回null
|
||||
*/
|
||||
public static String getInvalidMessage(String cronExpression) {
|
||||
|
@ -42,7 +40,6 @@ public class CronUtils {
|
|||
* 返回下一个执行时间根据给定的Cron表达式
|
||||
*
|
||||
* @param cronExpression Cron表达式
|
||||
*
|
||||
* @return Date 下次Cron表达式执行时间
|
||||
*/
|
||||
public static Date getNextExecution(String cronExpression) {
|
||||
|
|
|
@ -58,7 +58,6 @@ public class JobInvokeUtil {
|
|||
* 校验是否为为class包名
|
||||
*
|
||||
* @param invokeTarget 名称
|
||||
*
|
||||
* @return true是 false否
|
||||
*/
|
||||
public static boolean isValidClassName(String invokeTarget) {
|
||||
|
@ -69,7 +68,6 @@ public class JobInvokeUtil {
|
|||
* 获取bean名称
|
||||
*
|
||||
* @param invokeTarget 目标字符串
|
||||
*
|
||||
* @return bean名称
|
||||
*/
|
||||
public static String getBeanName(String invokeTarget) {
|
||||
|
@ -81,7 +79,6 @@ public class JobInvokeUtil {
|
|||
* 获取bean方法
|
||||
*
|
||||
* @param invokeTarget 目标字符串
|
||||
*
|
||||
* @return method方法
|
||||
*/
|
||||
public static String getMethodName(String invokeTarget) {
|
||||
|
@ -93,7 +90,6 @@ public class JobInvokeUtil {
|
|||
* 获取method方法参数相关列表
|
||||
*
|
||||
* @param invokeTarget 目标字符串
|
||||
*
|
||||
* @return method方法相关参数列表
|
||||
*/
|
||||
public static List<Object[]> getMethodParams(String invokeTarget) {
|
||||
|
@ -133,7 +129,6 @@ public class JobInvokeUtil {
|
|||
* 获取参数类型
|
||||
*
|
||||
* @param methodParams 参数相关列表
|
||||
*
|
||||
* @return 参数类型列表
|
||||
*/
|
||||
public static Class<?>[] getMethodParamsType(List<Object[]> methodParams) {
|
||||
|
@ -150,7 +145,6 @@ public class JobInvokeUtil {
|
|||
* 获取参数值
|
||||
*
|
||||
* @param methodParams 参数相关列表
|
||||
*
|
||||
* @return 参数值列表
|
||||
*/
|
||||
public static Object[] getMethodParamsValue(List<Object[]> methodParams) {
|
||||
|
|
|
@ -19,7 +19,6 @@ public class ScheduleUtils {
|
|||
* 得到quartz任务类
|
||||
*
|
||||
* @param sysJob 执行计划
|
||||
*
|
||||
* @return 具体执行任务类
|
||||
*/
|
||||
private static Class<? extends Job> getQuartzJobClass(SysJob sysJob) {
|
||||
|
@ -104,7 +103,6 @@ public class ScheduleUtils {
|
|||
* 检查包名是否为白名单配置
|
||||
*
|
||||
* @param invokeTarget 目标字符串
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public static boolean whiteList(String invokeTarget) {
|
||||
|
|
|
@ -34,6 +34,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取表名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/tableNameList/{databaseName}")
|
||||
|
@ -44,6 +45,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取表名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/tableNameList2")
|
||||
|
@ -54,6 +56,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取表结构
|
||||
*
|
||||
* @return
|
||||
* @throws SQLException
|
||||
*/
|
||||
|
@ -64,6 +67,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 数据连接
|
||||
*
|
||||
* @param dataAccess
|
||||
* @return
|
||||
*/
|
||||
|
@ -76,6 +80,7 @@ public class AccreditController extends BaseController {
|
|||
return error("连接失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 测试
|
||||
@PostMapping("/selJDBCStream2")
|
||||
public Result selJDBCStream2(@RequestBody DataAccess dataAccess) {
|
||||
|
@ -89,6 +94,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取表详情
|
||||
*
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
|
@ -100,6 +106,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 查询部门
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/listDeptVo")
|
||||
|
@ -110,6 +117,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 查询用户
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/listSelectSysUser")
|
||||
|
@ -120,6 +128,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取表结构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/listListstructure")
|
||||
|
@ -130,6 +139,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据名称查询表框架
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
|
@ -141,6 +151,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据名称获取表结构
|
||||
*
|
||||
* @param databaseName
|
||||
* @return
|
||||
*/
|
||||
|
@ -152,6 +163,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 修改状态/添加字典
|
||||
*
|
||||
* @param listStructure
|
||||
* @return
|
||||
*/
|
||||
|
@ -167,6 +179,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 查看父表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/selectFrimary")
|
||||
|
@ -177,6 +190,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取部门
|
||||
*
|
||||
* @param tableName
|
||||
* @param databaseName
|
||||
* @return
|
||||
|
@ -189,6 +203,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取部门2
|
||||
*
|
||||
* @param databaseName
|
||||
* @return
|
||||
*/
|
||||
|
@ -200,6 +215,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取用户
|
||||
*
|
||||
* @param tableName
|
||||
* @param databaseName
|
||||
* @return
|
||||
|
@ -212,6 +228,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取用户2
|
||||
*
|
||||
* @param databaseName
|
||||
* @return
|
||||
*/
|
||||
|
@ -223,6 +240,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 部门授权
|
||||
*
|
||||
* @param mid
|
||||
* @param statusId
|
||||
* @return
|
||||
|
@ -239,6 +257,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 用户授权
|
||||
*
|
||||
* @param mid
|
||||
* @param statusId
|
||||
* @return
|
||||
|
@ -255,6 +274,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 查询数据
|
||||
*
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
|
@ -266,6 +286,7 @@ public class AccreditController extends BaseController {
|
|||
|
||||
/**
|
||||
* 查看整体
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("selTotalNum")
|
||||
|
@ -275,5 +296,4 @@ public class AccreditController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.system.domain.Library;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.system.domain.AssetModel;
|
||||
import com.muyu.system.domain.Library;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
import com.muyu.system.service.IAssetModelService;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产详情Controller
|
||||
|
@ -25,8 +25,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/model")
|
||||
public class AssetModelController extends BaseController
|
||||
{
|
||||
public class AssetModelController extends BaseController {
|
||||
@Autowired
|
||||
private IAssetModelService assetModelService;
|
||||
|
||||
|
@ -35,8 +34,7 @@ public class AssetModelController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:model:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<AssetModel>> list(AssetModel assetModel)
|
||||
{
|
||||
public Result<TableDataInfo<AssetModel>> list(AssetModel assetModel) {
|
||||
startPage();
|
||||
List<AssetModel> list = assetModelService.selectAssetModelList(assetModel);
|
||||
return getDataTable(list);
|
||||
|
@ -48,8 +46,7 @@ public class AssetModelController extends BaseController
|
|||
@RequiresPermissions("system:model:export")
|
||||
@Log(title = "资产详情", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AssetModel assetModel)
|
||||
{
|
||||
public void export(HttpServletResponse response, AssetModel assetModel) {
|
||||
List<AssetModel> list = assetModelService.selectAssetModelList(assetModel);
|
||||
ExcelUtil<AssetModel> util = new ExcelUtil<AssetModel>(AssetModel.class);
|
||||
util.exportExcel(response, list, "资产详情数据");
|
||||
|
@ -60,8 +57,7 @@ public class AssetModelController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:model:query")
|
||||
@GetMapping(value = "/{annotation}")
|
||||
public Result getInfo(@PathVariable("annotation") String annotation)
|
||||
{
|
||||
public Result getInfo(@PathVariable("annotation") String annotation) {
|
||||
return success(assetModelService.selectAssetModelByAnnotation(annotation));
|
||||
}
|
||||
|
||||
|
@ -71,8 +67,7 @@ public class AssetModelController extends BaseController
|
|||
@RequiresPermissions("system:model:add")
|
||||
@Log(title = "资产详情", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody AssetModel assetModel)
|
||||
{
|
||||
public Result add(@RequestBody AssetModel assetModel) {
|
||||
return toAjax(assetModelService.insertAssetModel(assetModel));
|
||||
}
|
||||
|
||||
|
@ -82,8 +77,7 @@ public class AssetModelController extends BaseController
|
|||
@RequiresPermissions("system:model:edit")
|
||||
@Log(title = "资产详情", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody AssetModel assetModel)
|
||||
{
|
||||
public Result edit(@RequestBody AssetModel assetModel) {
|
||||
return toAjax(assetModelService.updateAssetModel(assetModel));
|
||||
}
|
||||
|
||||
|
@ -93,13 +87,13 @@ public class AssetModelController extends BaseController
|
|||
@RequiresPermissions("system:model:remove")
|
||||
@Log(title = "资产详情", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{annotations}")
|
||||
public Result remove(@PathVariable String[] annotations)
|
||||
{
|
||||
public Result remove(@PathVariable String[] annotations) {
|
||||
return toAjax(assetModelService.deleteAssetModelByAnnotations(annotations));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据库的所有表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("library")
|
||||
|
@ -110,6 +104,7 @@ public class AssetModelController extends BaseController
|
|||
|
||||
/**
|
||||
* 数据详情
|
||||
*
|
||||
* @param libraryName
|
||||
* @return
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue