fase()规范化

dev-2
王熙朝 2024-05-10 14:43:05 +08:00
parent a9aa680abe
commit 91ceda487b
222 changed files with 5596 additions and 5053 deletions

View File

@ -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";
}

View File

@ -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;

View File

@ -31,9 +31,7 @@ public class FastDfsSysFileServiceImpl implements ISysFileService {
* FastDfs
*
* @param file
*
* @return 访
*
* @throws Exception
*/
@Override

View File

@ -12,9 +12,7 @@ public interface ISysFileService {
*
*
* @param file
*
* @return 访
*
* @throws Exception
*/
public String uploadFile(MultipartFile file) throws Exception;

View File

@ -36,9 +36,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
*
*
* @param file
*
* @return 访
*
* @throws Exception
*/
@Override

View File

@ -28,9 +28,7 @@ public class MinioSysFileServiceImpl implements ISysFileService {
* Minio
*
* @param file
*
* @return 访
*
* @throws Exception
*/
@Override

View File

@ -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) {

View File

@ -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;

View File

@ -15,8 +15,6 @@ import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* gen_table
*

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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) {

View File

@ -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>

View File

@ -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>

View File

@ -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));
}
}

View File

@ -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}
*

View File

@ -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}
*

View File

@ -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);
}
}

View File

@ -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(() => {
});
}
}
};

View File

@ -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>

View File

@ -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();

View File

@ -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', {

View File

@ -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 &gt; #{$javaField}</if>
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
and $columnName &gt; #{$javaField}
</if>
#elseif($queryType == "GTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt;= #{$javaField}</if>
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
and $columnName &gt;= #{$javaField}
</if>
#elseif($queryType == "LT")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt; #{$javaField}</if>
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
and $columnName &lt; #{$javaField}
</if>
#elseif($queryType == "LTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt;= #{$javaField}</if>
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end">
and $columnName &lt;= #{$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

View File

@ -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>

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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>

View File

@ -2,6 +2,7 @@ package com.muyu.edition.constant;
/**
*
*
* @ClassName ConfigCodeConstants
* @Author
* @Date 2024/5/4 15:28

View File

@ -2,6 +2,7 @@ package com.muyu.edition.constant;
/**
*
*
* @ClassName RuleOperationConstants
* @Author
* @Date 2024/5/4 16:12

View File

@ -58,6 +58,7 @@ public class Anduser extends BaseEntity {
.age(anduserQueryResp.getAge())
.build();
}
/**
*
*/

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -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>

View File

@ -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);
}

View File

@ -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());
}
};
}
}

View File

@ -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>

View File

@ -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
*/

View File

@ -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));
}

View File

@ -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);

View File

@ -53,7 +53,6 @@ public class DynamicLoader {
* URLClassLoaderclassjvm
*
* @author Administrator
*
*/
public static class MemoryClassLoader extends URLClassLoader {
Map<String, byte[]> classBytes = new HashMap<String, byte[]>();

View File

@ -9,6 +9,7 @@ import java.util.Map;
/**
* .classmap
*
* @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);
}
}
/**
* stringsourcejkd
*/
@ -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");
}
}
}
}

View File

@ -10,8 +10,7 @@ import java.util.List;
* @author muyu
* @date 2024-05-04
*/
public interface ConfigMapper
{
public interface ConfigMapper {
/**
*
*

View File

@ -10,8 +10,7 @@ import java.util.List;
* @author muyu
* @date 2024-05-06
*/
public interface EditionMapper
{
public interface EditionMapper {
/**
*
*

View File

@ -11,8 +11,7 @@ import java.util.List;
* @author muyu
* @date 2024-05-02
*/
public interface RuleEngineMapper
{
public interface RuleEngineMapper {
/**
*
*

View File

@ -4,6 +4,7 @@ import lombok.Data;
/**
*
*
* @ClassName DataModelContextHolder
* @Author
* @Version: 1.0

View File

@ -4,6 +4,7 @@ import lombok.Data;
/**
*
*
* @ClassName DataSetContextHolder
* @Author
* @Version: 1.0

View File

@ -4,6 +4,7 @@ import lombok.Data;
/**
*
*
* @ClassName RecordContextHolder
* @Author
* @Version: 1.0

View File

@ -2,6 +2,7 @@ package com.muyu.edition.scope;
/**
*
*
* @ClassName TaskContextHolder
* @Author
* @Version: 1.0

View File

@ -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
*/

View File

@ -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);
/**
*
*

View File

@ -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);
/**
*
*

View File

@ -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
*/

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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 {
}
}

View File

@ -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>

View File

@ -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>

View File

@ -1,4 +0,0 @@
package com.muyu.data.test.remote;
public interface RemoteDataManagerService {
}

View File

@ -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 {
}

View File

@ -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>

View File

@ -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);
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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);
//
}
}

View File

@ -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 {

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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 {
}
}

View File

@ -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