表格列表-表单构建-redis监控
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.nl;
|
||||
|
||||
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
|
||||
import com.alicp.jetcache.anno.config.EnableMethodCache;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nl.annotation.rest.AnonymousGetMapping;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
@@ -30,6 +32,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@ServletComponentScan
|
||||
@EnableTransactionManagement
|
||||
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
|
||||
@EnableMethodCache(basePackages = "org.nl")
|
||||
@EnableCreateCacheAnnotation
|
||||
public class AppRun {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.nl.modules.system.rest;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.annotation.Log;
|
||||
import org.nl.modules.system.service.GridService;
|
||||
import org.nl.modules.system.service.dto.GridDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 系统表格管理
|
||||
* @Date: 2022-08-01
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "系统表格管理")
|
||||
@RequestMapping("/api/grid")
|
||||
@Slf4j
|
||||
public class GridController {
|
||||
private final GridService gridService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询系统表格")
|
||||
@ApiOperation("查询系统表格")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(gridService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增系统表格")
|
||||
@ApiOperation("新增系统表格")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody GridDto dto){
|
||||
log.info("dto:{}",dto);
|
||||
gridService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改系统表格")
|
||||
@ApiOperation("修改系统表格")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody GridDto dto){
|
||||
gridService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除系统表格")
|
||||
@ApiOperation("删除系统表格")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
gridService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/selectList")
|
||||
@Log("下拉框获取表格数据")
|
||||
@ApiOperation("下拉框获取表格数据")
|
||||
public ResponseEntity<Object> getGridList(){
|
||||
return new ResponseEntity<>(gridService.getGridList(),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package org.nl.modules.system.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.annotation.Log;
|
||||
import org.nl.modules.system.service.GridFieldService;
|
||||
import org.nl.modules.system.service.dto.GridFieldDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 系统表格字段管理
|
||||
* @Date: 2022-08-01
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "系统表格字段管理")
|
||||
@RequestMapping("/api/gridField")
|
||||
@Slf4j
|
||||
public class GridFieldController {
|
||||
private final GridFieldService gridFieldService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询系统表格")
|
||||
@ApiOperation("查询系统表格")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(gridFieldService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("单个新增表格字段")
|
||||
@ApiOperation("单个新增表格字段")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody GridFieldDto dto){
|
||||
log.info("dto:{}",dto);
|
||||
gridFieldService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改表格字段")
|
||||
@ApiOperation("修改表格字段")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody GridFieldDto dto){
|
||||
gridFieldService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除表格字段")
|
||||
@ApiOperation("删除表格字段")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
gridFieldService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/batchAdd")
|
||||
@Log("批量新增表格字段")
|
||||
@ApiOperation("批量新增表格字段")
|
||||
public ResponseEntity<Object> batchAdd(@RequestBody JSONObject json){
|
||||
// log.info("json{}",json);
|
||||
gridFieldService.batchAdd(json);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/getGridFields")
|
||||
@Log("根据gridId获取所有字段")
|
||||
@ApiOperation("根据gridId获取所有字段")
|
||||
public ResponseEntity<Object> getGridFieldsById(@RequestBody String id){
|
||||
log.info("dto:{}",id);
|
||||
return new ResponseEntity<>(gridFieldService.getGridFieldsById(id),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/getGridFieldsByCode")
|
||||
@Log("根据gridCode获取所有字段")
|
||||
@ApiOperation("根据gridCode获取所有字段")
|
||||
public ResponseEntity<Object> getGridFieldsByCode(@RequestBody String grid_code){
|
||||
log.info("dto:{}",grid_code);
|
||||
return new ResponseEntity<>(gridFieldService.getGridFieldsByCode(grid_code),HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.nl.modules.system.rest;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.annotation.Log;
|
||||
import org.nl.modules.system.service.RedisService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: Redis监控管理
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "系统表格管理")
|
||||
@RequestMapping("/api/redis")
|
||||
@Slf4j
|
||||
public class RedisController {
|
||||
|
||||
private final RedisService redisService;
|
||||
|
||||
@GetMapping("/get-monitor-info")
|
||||
@Log("查询redis的信息")
|
||||
@ApiOperation("查询redis的信息")
|
||||
public ResponseEntity<Object> getRedisMonitorInfo() {
|
||||
return new ResponseEntity<>(redisService.getRedisMonitorInfo(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/get-key-define-list")
|
||||
@Log("获得 Redis Key 模板列表")
|
||||
@ApiOperation("获得 Redis Key 模板列表")
|
||||
public ResponseEntity<Object> getKeyDefineList() {
|
||||
return new ResponseEntity<>(redisService.getKeyDefineList(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/get-key-value-list")
|
||||
@Log("获得 Redis Key Value列表")
|
||||
@ApiOperation("获得 Redis Key Value列表")
|
||||
public ResponseEntity<Object> getKeyValueList() {
|
||||
return new ResponseEntity<>( redisService.getKeyValueList(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("根据key删除Redis数据")
|
||||
@ApiOperation("根据key删除Redis数据")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> deleteByKey(@RequestBody String[] ids) {
|
||||
redisService.deleteByKey(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.nl.modules.system.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.modules.system.service.dto.GridFieldDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 表格字段服务
|
||||
* @Date: 2022-08-01
|
||||
*/
|
||||
public interface GridFieldService {
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto
|
||||
*/
|
||||
void create(GridFieldDto dto);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return Param
|
||||
*/
|
||||
GridFieldDto findById(String id);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto
|
||||
*/
|
||||
void update(GridFieldDto dto);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
/**
|
||||
* 批量添加数据
|
||||
* @param json
|
||||
*/
|
||||
void batchAdd(JSONObject json);
|
||||
|
||||
/**
|
||||
* 根据grid_id获取所有字段信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
JSONArray getGridFieldsById(String id);
|
||||
|
||||
/**
|
||||
* 根据grid_code获取所有字段信息
|
||||
* @param grid_code
|
||||
* @return
|
||||
*/
|
||||
JSONArray getGridFieldsByCode(String grid_code);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.nl.modules.system.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.modules.system.service.dto.GridDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 表格服务接口
|
||||
* @Date: 2022-08-01
|
||||
*/
|
||||
public interface GridService {
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto
|
||||
*/
|
||||
void create(GridDto dto);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return Param
|
||||
*/
|
||||
GridDto findById(String id);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto
|
||||
*/
|
||||
void update(GridDto dto);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
/**
|
||||
* 下拉选择表格
|
||||
* @return
|
||||
*/
|
||||
JSONArray getGridList();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.modules.system.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: Redis监控的服务
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
public interface RedisService {
|
||||
/**
|
||||
* 获取redis的信息
|
||||
* @return
|
||||
*/
|
||||
JSONObject getRedisMonitorInfo();
|
||||
|
||||
/**
|
||||
* 获得 Redis Key 模板列表
|
||||
* @return
|
||||
*/
|
||||
JSONObject getKeyDefineList();
|
||||
|
||||
/**
|
||||
* 获取所有的键值信息
|
||||
* @return
|
||||
*/
|
||||
JSONArray getKeyValueList();
|
||||
|
||||
/**
|
||||
* 删除redis缓存数据
|
||||
* @param ids
|
||||
*/
|
||||
void deleteByKey(String[] ids);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package org.nl.modules.system.service.convert;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.nl.modules.system.service.entity.RedisKeyDefine;
|
||||
import org.nl.modules.system.service.vo.RedisKeyDefineRespVO;
|
||||
import org.nl.modules.system.service.vo.RedisMonitorRespVO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: redis---Spring Boot 对象转换 MapStruct
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface RedisConvert {
|
||||
|
||||
RedisConvert INSTANCE = Mappers.getMapper(RedisConvert.class);
|
||||
|
||||
default RedisMonitorRespVO build(Properties info, Long dbSize, Properties commandStats) {
|
||||
RedisMonitorRespVO respVO = RedisMonitorRespVO.builder().info(info).dbSize(dbSize)
|
||||
.commandStats(new ArrayList<>(commandStats.size())).build();
|
||||
commandStats.forEach((key, value) -> {
|
||||
respVO.getCommandStats().add(RedisMonitorRespVO.CommandStat.builder()
|
||||
.command(StrUtil.subAfter((String) key, "cmdstat_", false))
|
||||
.calls(Integer.valueOf(StrUtil.subBetween((String) value, "calls=", ",")))
|
||||
.usec(Long.valueOf(StrUtil.subBetween((String) value, "usec=", ",")))
|
||||
.build());
|
||||
});
|
||||
return respVO;
|
||||
}
|
||||
|
||||
List<RedisKeyDefineRespVO> convertList(List<RedisKeyDefine> list);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.nl.modules.system.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 系统表格dto
|
||||
* @Date: 2022-08-01
|
||||
*/
|
||||
@Data
|
||||
public class GridDto {
|
||||
/**
|
||||
* 标识id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否激活
|
||||
*/
|
||||
private String is_active;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_by;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String update_by;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String update_time;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package org.nl.modules.system.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 表格字段dto
|
||||
* @Date: 2022-08-01
|
||||
*/
|
||||
@Data
|
||||
public class GridFieldDto {
|
||||
/**
|
||||
* 标识id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private Integer width;
|
||||
|
||||
/**
|
||||
* 对齐
|
||||
*/
|
||||
private String align;
|
||||
|
||||
/**
|
||||
* 格式
|
||||
*/
|
||||
private String format;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort_num;
|
||||
|
||||
/**
|
||||
* 是否激活
|
||||
*/
|
||||
private String is_active;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 是否隐藏
|
||||
*/
|
||||
private String is_hidden;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_by;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String update_by;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 表格id
|
||||
*/
|
||||
private String grid_id;
|
||||
|
||||
/**
|
||||
* 表格名称
|
||||
*/
|
||||
private String grid_name;
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.nl.modules.system.service.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: Redis Key 定义类
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
@Data
|
||||
public class RedisKeyDefine {
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum KeyTypeEnum {
|
||||
|
||||
STRING("String"),
|
||||
LIST("List"),
|
||||
HASH("Hash"),
|
||||
SET("Set"),
|
||||
ZSET("Sorted Set"),
|
||||
STREAM("Stream"),
|
||||
PUBSUB("Pub/Sub");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@JsonValue
|
||||
private final String type;
|
||||
|
||||
}
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum TimeoutTypeEnum {
|
||||
|
||||
FOREVER(1), // 永不超时
|
||||
DYNAMIC(2), // 动态超时
|
||||
FIXED(3); // 固定超时
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@JsonValue
|
||||
private final Integer type;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Key 模板
|
||||
*/
|
||||
private final String keyTemplate;
|
||||
/**
|
||||
* Key 类型的枚举
|
||||
*/
|
||||
private final KeyTypeEnum keyType;
|
||||
/**
|
||||
* Value 类型
|
||||
*
|
||||
* 如果是使用分布式锁,设置为 {@link java.util.concurrent.locks.Lock} 类型
|
||||
*/
|
||||
private final Class<?> valueType;
|
||||
/**
|
||||
* 超时类型
|
||||
*/
|
||||
private final TimeoutTypeEnum timeoutType;
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private final Duration timeout;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private final String memo;
|
||||
|
||||
private RedisKeyDefine(String memo, String keyTemplate, KeyTypeEnum keyType, Class<?> valueType,
|
||||
TimeoutTypeEnum timeoutType, Duration timeout) {
|
||||
this.memo = memo;
|
||||
this.keyTemplate = keyTemplate;
|
||||
this.keyType = keyType;
|
||||
this.valueType = valueType;
|
||||
this.timeout = timeout;
|
||||
this.timeoutType = timeoutType;
|
||||
// 添加注册表
|
||||
RedisKeyRegistry.add(this);
|
||||
}
|
||||
|
||||
public RedisKeyDefine(String memo, String keyTemplate, KeyTypeEnum keyType, Class<?> valueType, Duration timeout) {
|
||||
this(memo, keyTemplate, keyType, valueType, TimeoutTypeEnum.FIXED, timeout);
|
||||
}
|
||||
|
||||
public RedisKeyDefine(String memo, String keyTemplate, KeyTypeEnum keyType, Class<?> valueType, TimeoutTypeEnum timeoutType) {
|
||||
this(memo, keyTemplate, keyType, valueType, timeoutType, Duration.ZERO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化 Key
|
||||
*
|
||||
* 注意,内部采用 {@link String#format(String, Object...)} 实现
|
||||
*
|
||||
* @param args 格式化的参数
|
||||
* @return Key
|
||||
*/
|
||||
public String formatKey(Object... args) {
|
||||
return String.format(keyTemplate, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.modules.system.service.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: {@link RedisKeyDefine} 注册表
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
public class RedisKeyRegistry {
|
||||
/**
|
||||
* Redis RedisKeyDefine 数组
|
||||
*/
|
||||
private static final List<RedisKeyDefine> defines = new ArrayList<>();
|
||||
|
||||
public static void add(RedisKeyDefine define) {
|
||||
defines.add(define);
|
||||
}
|
||||
|
||||
public static List<RedisKeyDefine> list() {
|
||||
return defines;
|
||||
}
|
||||
|
||||
public static int size() {
|
||||
return defines.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package org.nl.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.service.GridFieldService;
|
||||
import org.nl.modules.system.service.dto.GridDto;
|
||||
import org.nl.modules.system.service.dto.GridFieldDto;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.ResultBean;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 表格字段实现类
|
||||
* @Date: 2022-08-01
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class GridFieldServiceImpl implements GridFieldService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
String grid_name = (String) whereJson.get("name");
|
||||
map.put("flag","1");
|
||||
if (StrUtil.isNotEmpty(grid_name)){
|
||||
map.put("grid_name","%" + grid_name + "%");
|
||||
}
|
||||
JSONObject json = WQL.getWO("GRIDFIELD").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "sys_grid_field.sort_num");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(GridFieldDto dto) {
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setId(IdUtil.simpleUUID());
|
||||
dto.setCreate_by(currentUsername);
|
||||
dto.setUpdate_by(currentUsername);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid_field");
|
||||
JSONObject json = JSONObject.parseObject( JSONObject.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridFieldDto findById(String id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid_field");
|
||||
JSONObject json = wo.query("id ='" + id + "' AND is_delete = '0'").uniqueResult(0);
|
||||
final GridFieldDto obj = json.toJavaObject(GridFieldDto.class);;
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(GridFieldDto dto) {
|
||||
GridFieldDto entity = this.findById(dto.getId());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_by(currentUsername);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid_field");
|
||||
JSONObject json = JSONObject.parseObject( JSONObject.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid_field");
|
||||
for (String id : ids) {
|
||||
GridFieldDto gridFieldDto = this.findById(id);
|
||||
gridFieldDto.setIs_delete("1");
|
||||
JSONObject json = JSONObject.parseObject( JSONObject.toJSONString(gridFieldDto));
|
||||
wo.update(json);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void batchAdd(JSONObject json) {
|
||||
String grid_id = json.getString("grid_id");
|
||||
JSONArray fieldDatas = json.getJSONArray("gridFieldData");
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid_field");
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
// 先删除原先所有的数据
|
||||
wo.delete("grid_id = '" + grid_id + "'");
|
||||
// 然后添加
|
||||
for (int i=0; i<fieldDatas.size(); i++) {
|
||||
String now = DateUtil.now();
|
||||
JSONObject fieldData = fieldDatas.getJSONObject(i);
|
||||
fieldData.put("grid_id", grid_id);
|
||||
fieldData.put("id", IdUtil.simpleUUID());
|
||||
fieldData.put("create_by", currentUsername);
|
||||
fieldData.put("create_time", currentUsername);
|
||||
fieldData.put("update_by", now);
|
||||
fieldData.put("update_time", now);
|
||||
wo.insert(fieldData);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getGridFieldsById(String id) {
|
||||
JSONArray arr = WQLObject.getWQLObject("sys_grid_field").query("grid_id = '"+ id +"' AND is_delete= '0'", "sort_num").getResultJSONArray(0);
|
||||
return arr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getGridFieldsByCode(String grid_code) {
|
||||
// 获取得到id
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid");
|
||||
JSONObject json = wo.query("code ='" + grid_code + "'").uniqueResult(0);
|
||||
String grid_id = json.getString("id");
|
||||
JSONArray arr = WQLObject.getWQLObject("sys_grid_field").query("grid_id = '"+ grid_id +"'", "sort_num").getResultJSONArray(0);
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package org.nl.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.service.GridService;
|
||||
import org.nl.modules.system.service.dto.GridDto;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wql.core.bean.ResultBean;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 表格服务实现类
|
||||
* @Date: 2022-08-01
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class GridServiceImpl implements GridService {
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid");
|
||||
String where = "1=1";
|
||||
if (whereJson.get("name") != null) {
|
||||
where = "name like ('%" + whereJson.get("name") + "%')";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where +" AND is_delete = '0'", "update_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(GridDto dto) {
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setId(IdUtil.simpleUUID());
|
||||
dto.setCreate_by(currentUsername);
|
||||
dto.setUpdate_by(currentUsername);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid");
|
||||
JSONObject json = JSONObject.parseObject( JSONObject.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridDto findById(String id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid");
|
||||
JSONObject json = wo.query("id ='" + id + "' AND is_delete = '0'").uniqueResult(0);
|
||||
final GridDto obj = json.toJavaObject(GridDto.class);;
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(GridDto dto) {
|
||||
GridDto entity = this.findById(dto.getId());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_by(currentUsername);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid");
|
||||
JSONObject json = JSONObject.parseObject( JSONObject.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_grid");
|
||||
WQLObject wqlObject = WQLObject.getWQLObject("sys_grid_field");
|
||||
// 删除明细
|
||||
for (String grid_id : ids) {
|
||||
wqlObject.delete("grid_id = '" + grid_id + "'");
|
||||
wo.delete("id = '" + grid_id + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getGridList() {
|
||||
JSONArray arr = WQLObject.getWQLObject("sys_grid").query("is_delete= '0' AND is_active= '1'").getResultJSONArray(0);
|
||||
JSONArray result = new JSONArray();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject obj = arr.getJSONObject(i);
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("grid_id", obj.getString("id"));
|
||||
json.put("grid_code", obj.getString("code"));
|
||||
json.put("grid_name", obj.getString("name"));
|
||||
result.add(json);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package org.nl.modules.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.system.service.RedisService;
|
||||
import org.nl.modules.system.service.convert.RedisConvert;
|
||||
import org.nl.modules.system.service.entity.RedisKeyDefine;
|
||||
import org.nl.modules.system.service.entity.RedisKeyRegistry;
|
||||
//import org.nl.modules.system.service.vo.IdempotentRedisDAO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.connection.DataType;
|
||||
import org.springframework.data.redis.connection.RedisServerCommands;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: Redis监控的实现类
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class RedisServiceImpl implements RedisService {
|
||||
|
||||
@Autowired
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
|
||||
@Override
|
||||
public JSONObject getRedisMonitorInfo() {
|
||||
// 获得 Redis 统计信息
|
||||
Properties info = stringRedisTemplate.execute((RedisCallback<Properties>) RedisServerCommands::info);
|
||||
Long dbSize = stringRedisTemplate.execute(RedisServerCommands::dbSize);
|
||||
Properties commandStats = stringRedisTemplate.execute((
|
||||
RedisCallback<Properties>) connection -> connection.info("commandstats"));
|
||||
assert commandStats != null; // 断言,避免警告
|
||||
// System.out.println("info:" + info + " dbsize:" + dbSize + " com:" + commandStats);
|
||||
// 拼接结果返回
|
||||
// 转成实体
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("info", RedisConvert.INSTANCE.build(info, dbSize, commandStats));
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getKeyDefineList() {
|
||||
List<RedisKeyDefine> keyDefines = RedisKeyRegistry.list();
|
||||
JSONObject json = new JSONObject();
|
||||
System.out.println(keyDefines);
|
||||
json.put("info", RedisConvert.INSTANCE.convertList(keyDefines));
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getKeyValueList() {
|
||||
JSONArray result = new JSONArray();
|
||||
Set<String> keys = stringRedisTemplate.keys("*");
|
||||
// 迭代
|
||||
Iterator<String> it = keys.iterator();
|
||||
while ( it.hasNext() ) {
|
||||
String key = it.next();
|
||||
JSONObject redis = new JSONObject();
|
||||
DataType dataType = stringRedisTemplate.type(key); // 数据类型
|
||||
String s = stringRedisTemplate.opsForValue().get(key); // 获取值
|
||||
Long expire = stringRedisTemplate.getExpire(key); // 获取剩余时间
|
||||
redis.put("dataType", dataType);
|
||||
redis.put("key", key);
|
||||
redis.put("value", s);
|
||||
redis.put("expire", expire);
|
||||
result.add(redis);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByKey(String[] ids) {
|
||||
stringRedisTemplate.delete(Arrays.asList(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.modules.system.service.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.nl.modules.system.service.entity.RedisKeyDefine;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.nl.modules.system.service.entity.RedisKeyDefine.KeyTypeEnum.STRING;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 幂等操作
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
//@AllArgsConstructor
|
||||
//public class IdempotentRedisDAO {
|
||||
//
|
||||
// private static final RedisKeyDefine IDEMPOTENT = new RedisKeyDefine("幂等操作",
|
||||
// "idempotent:%s", // 参数为 uuid
|
||||
// STRING, String.class, RedisKeyDefine.TimeoutTypeEnum.DYNAMIC);
|
||||
//
|
||||
// private final StringRedisTemplate redisTemplate;
|
||||
//
|
||||
// public Boolean setIfAbsent(String key, long timeout, TimeUnit timeUnit) {
|
||||
// String redisKey = formatKey(key);
|
||||
// return redisTemplate.opsForValue().setIfAbsent(redisKey, "", timeout, timeUnit);
|
||||
// }
|
||||
//
|
||||
// private static String formatKey(String key) {
|
||||
// return String.format(IDEMPOTENT.getKeyTemplate(), key);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package org.nl.modules.system.service.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.nl.modules.system.service.entity.RedisKeyDefine;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 管理后台 - Redis Key 信息 Response VO
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
@ApiModel("管理后台 - Redis Key 信息 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class RedisKeyDefineRespVO {
|
||||
@ApiModelProperty(value = "Key 模板", required = true, example = "login_user:%s")
|
||||
private String keyTemplate;
|
||||
|
||||
@ApiModelProperty(value = "Key 类型的枚举", required = true, example = "String")
|
||||
private RedisKeyDefine.KeyTypeEnum keyType;
|
||||
|
||||
@ApiModelProperty(value = "Value 类型", required = true, example = "java.lang.String")
|
||||
private Class<?> valueType;
|
||||
|
||||
@ApiModelProperty(value = "超时类型", required = true, example = "1")
|
||||
private RedisKeyDefine.TimeoutTypeEnum timeoutType;
|
||||
|
||||
@ApiModelProperty(value = "过期时间,单位:毫秒", required = true, example = "1024")
|
||||
private Duration timeout;
|
||||
|
||||
@ApiModelProperty(value = "备注", required = true, example = "啦啦啦啦~")
|
||||
private String memo;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.nl.modules.system.service.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 管理后台 - Redis 监控信息 Response VO
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
@ApiModel("管理后台 - Redis 监控信息 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class RedisMonitorRespVO {
|
||||
@ApiModelProperty(value = "Redis info 指令结果", required = true, notes = "具体字段,查看 Redis 文档")
|
||||
private Properties info;
|
||||
|
||||
@ApiModelProperty(value = "Redis key 数量", required = true, example = "1024")
|
||||
private Long dbSize;
|
||||
|
||||
@ApiModelProperty(value = "CommandStat 数组", required = true)
|
||||
private List<CommandStat> commandStats;
|
||||
|
||||
@ApiModel("Redis 命令统计结果")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public static class CommandStat {
|
||||
|
||||
@ApiModelProperty(value = "Redis 命令", required = true, example = "get")
|
||||
private String command;
|
||||
|
||||
@ApiModelProperty(value = "调用次数", required = true, example = "1024")
|
||||
private Integer calls;
|
||||
|
||||
@ApiModelProperty(value = "消耗 CPU 秒数", required = true, example = "666")
|
||||
private Long usec;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.modules.system.service.vo;
|
||||
|
||||
import org.nl.config.RedisConfig;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 测试的Redistemplate模板
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
//@Configuration(proxyBeanMethods = false)
|
||||
//@AutoConfigureAfter(RedisConfig.class)
|
||||
//public class YudaoIdempotentConfiguration {
|
||||
// @Bean
|
||||
// public IdempotentRedisDAO idempotentRedisDAO(StringRedisTemplate stringRedisTemplate) {
|
||||
// return new IdempotentRedisDAO(stringRedisTemplate);
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,56 @@
|
||||
[交易说明]
|
||||
交易名: 表格数据
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.grid_name TYPEAS s_string
|
||||
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
sys_grid_field.*, sys_grid.name as grid_name
|
||||
FROM
|
||||
sys_grid_field
|
||||
LEFT JOIN sys_grid ON sys_grid_field.grid_id = sys_grid.id
|
||||
WHERE
|
||||
sys_grid_field.is_delete = '0' AND sys_grid.is_delete = '0'
|
||||
OPTION 输入.grid_name <> ""
|
||||
sys_grid.name LIKE 输入.grid_name
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
Reference in New Issue
Block a user