添加实体类

master
陈思豪 2024-08-26 15:19:05 +08:00
parent 37ff5821f9
commit c83fa72ae1
12 changed files with 129 additions and 102 deletions

View File

@ -1,9 +1,8 @@
package com.muyu.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.*;
import lombok.experimental.SuperBuilder;
/**
* @PackageName:com.muyu.domain
@ -12,18 +11,23 @@ import lombok.NoArgsConstructor;
* @author:
* @date: 2024/8/23 18:53
*/
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class Structure {
@SuperBuilder
public class Structure extends BaseEntity {
private Integer id;
private String fieldName;
private String fieldType;
private String fieldLength;
private String fieldDecimals;
private Integer tableId;
private String columnName;
private String columnRemark;
private String isPrimary;
private String columnType;
private String javaType;
private String columnLength;
private String columnDecimals;
private String isNull;
private String isDictionary;
private String defaultValue;
private String isDictionary;
private String dictionaryTable;
}

View File

@ -0,0 +1,31 @@
package com.muyu.domain;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
* @PackageName:com.muyu.domain
* @ClassName:TableInfo
* @Description:
* @author:
* @date: 2024/8/26 11:38
*/
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class TableInfo extends BaseEntity {
private String id;
private String basicId;
private String tableName;
private String tableRemark;
private String type;
private String dataNum;
private String center;
private String parentId;
}

View File

@ -23,6 +23,8 @@ import java.util.List;
@SuperBuilder
public class TaskInputInfo extends BaseEntity {
private Integer id;
/**

View File

@ -100,10 +100,13 @@
<!-- 加入maven deploy插件当在deploy时忽略些model-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<skip>true</skip>
<source>17</source> <!-- 你的Java源代码版本 -->
<target>17</target> <!-- 你的目标Java版本 -->
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>

View File

@ -1,14 +1,11 @@
package com.muyu.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.muyu.common.core.domain.Result;
import com.muyu.domain.Structure;
import com.muyu.service.StructureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
@ -22,11 +19,12 @@ import java.util.List;
@RequestMapping("/structure")
public class StructureController {
@Resource
@Autowired
private StructureService structureService;
@GetMapping("/findThis")
public String findThis() {
return structureService.findThis();
@GetMapping("/findStructureList")
public Result<List<Structure>> findStructureList(@RequestParam Integer tableId) {
List<Structure> structureList = structureService.findStructureList(tableId);
return Result.success(structureList);
}
}

View File

@ -1,15 +1,12 @@
package com.muyu.controller;
import com.muyu.common.core.domain.Result;
import com.muyu.domain.TaskInputInfo;
import com.muyu.domain.TableInfo;
import com.muyu.domain.resp.TaskInputInfoResp;
import com.muyu.service.TaskInputService;
import com.muyu.service.TableInfoService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -23,17 +20,17 @@ import static com.muyu.common.core.utils.PageUtils.startPage;
* @date: 2024/8/22 20:17
*/
@RestController
@RequestMapping("/taskInput")
public class TaskInputController {
@RequestMapping("/tableInfo")
public class TableInfoController {
@Autowired
private TaskInputService taskInputService;
private TableInfoService tableInfoService;
@RequestMapping(path = "/list", method = RequestMethod.GET)
@Operation(summary = "查看任务节点详情", description = "根据任务的名称或者状态 ,进行模糊查询")
public Result<List<TaskInputInfo>> selectList() {
public Result<List<TableInfo>> selectList() {
startPage();
List<TaskInputInfo> taskInputInfos = taskInputService.selectList();
List<TableInfo> taskInputInfos = tableInfoService.selectList();
return Result.success(
taskInputInfos
);
@ -44,11 +41,11 @@ public class TaskInputController {
* @param id
* @return
*/
@RequestMapping(path = "/findByInputId/{id}", method = RequestMethod.POST)
@RequestMapping(path = "/findByTableId", method = RequestMethod.POST)
@Operation(summary = "查看任务节点详情", description = "根据任务的名称或者状态 ,进行模糊查询")
public Result<TaskInputInfoResp> findByInputId(@PathVariable(name = "id") Integer id) {
public Result<TableInfo> findByTableId(@RequestParam Integer id) {
startPage();
TaskInputInfoResp taskInfoResp = taskInputService.findByInputId(id);
TableInfo taskInfoResp = tableInfoService.findByTableId(id);
return Result.success(
taskInfoResp
);

View File

@ -1,9 +1,10 @@
package com.muyu.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.domain.TableInfo;
import com.muyu.domain.TaskInputInfo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TaskInputInfoMapper extends BaseMapper<TaskInputInfo> {
public interface TableInfoMapper extends BaseMapper<TableInfo> {
}

View File

@ -1,9 +1,10 @@
package com.muyu.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.domain.Structure;
import java.util.List;
public interface StructureService extends IService<Structure> {
String findThis();
List<Structure> findStructureList(Integer tableId);
}

View File

@ -1,7 +1,7 @@
package com.muyu.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.domain.TaskInputInfo;
import com.muyu.domain.TableInfo;
import com.muyu.domain.resp.TaskInputInfoResp;
import java.util.List;
@ -13,8 +13,8 @@ import java.util.List;
* @author:
* @date: 2024/8/22 20:18
*/
public interface TaskInputService extends IService<TaskInputInfo> {
List<TaskInputInfo> selectList();
public interface TableInfoService extends IService<TableInfo> {
List<TableInfo> selectList();
TaskInputInfoResp findByInputId(Integer id);
TableInfo findByTableId(Integer id);
}

View File

@ -7,9 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.domain.Structure;
import com.muyu.domain.TaskInputInfo;
import com.muyu.mapper.StructureMapper;
import com.muyu.mapper.TaskInputInfoMapper;
import com.muyu.service.StructureService;
import com.muyu.service.TaskInputService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -25,10 +23,14 @@ import java.util.List;
@Service
public class StructureServiceImpl extends ServiceImpl<StructureMapper, Structure> implements StructureService {
@Autowired
private StructureMapper structureMapper;
@Override
public String findThis() {
List<Structure> list = this.list();
String jsonString = JSONArray.toJSONString(list);
return jsonString;
public List<Structure> findStructureList(Integer tableId) {
LambdaQueryWrapper<Structure> queryWrapper = new LambdaQueryWrapper<Structure>();
queryWrapper.eq(Structure::getTableId, tableId);
List<Structure> structures = structureMapper.selectList(queryWrapper);
return structures;
}
}

View File

@ -0,0 +1,39 @@
package com.muyu.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.domain.Structure;
import com.muyu.domain.TableInfo;
import com.muyu.domain.TaskInputInfo;
import com.muyu.domain.resp.TaskInputInfoResp;
import com.muyu.mapper.TableInfoMapper;
import com.muyu.service.TableInfoService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @PackageName:com.muyu.service
* @ClassName:TaskInputInfoService
* @Description:
* @author:
* @date: 2024/8/22 20:18
*/
@Service
public class TableInfoServiceImpl extends ServiceImpl<TableInfoMapper, TableInfo> implements TableInfoService {
@Override
public List<TableInfo> selectList() {
LambdaQueryWrapper<TableInfo> queryWrapper = new LambdaQueryWrapper<>();
return this.list(queryWrapper);
}
@Override
public TableInfo findByTableId(Integer id) {
LambdaQueryWrapper<TableInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TableInfo::getId, id);
return this.getOne(queryWrapper);
}
}

View File

@ -1,51 +0,0 @@
package com.muyu.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.domain.Structure;
import com.muyu.domain.TaskInputInfo;
import com.muyu.domain.resp.TaskInputInfoResp;
import com.muyu.mapper.TaskInputInfoMapper;
import com.muyu.service.TaskInputService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @PackageName:com.muyu.service
* @ClassName:TaskInputInfoService
* @Description:
* @author:
* @date: 2024/8/22 20:18
*/
@Service
public class TaskInputServiceImpl extends ServiceImpl<TaskInputInfoMapper, TaskInputInfo> implements TaskInputService {
@Override
public List<TaskInputInfo> selectList() {
LambdaQueryWrapper<TaskInputInfo> queryWrapper = new LambdaQueryWrapper<>();
return this.list(queryWrapper);
}
@Override
public TaskInputInfoResp findByInputId(Integer id) {
LambdaQueryWrapper<TaskInputInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TaskInputInfo::getId, id);
TaskInputInfo taskInputInfo = this.getOne(queryWrapper);
String tableField = taskInputInfo.getTableField();
List<Structure> structures = JSONArray.parseArray(tableField, Structure.class);
TaskInputInfoResp taskInputInfoResp = new TaskInputInfoResp();
taskInputInfoResp.setStructureList(structures);
taskInputInfoResp.setId(taskInputInfo.getId());
taskInputInfoResp.setNodeId(taskInputInfo.getNodeId());
taskInputInfoResp.setNodeName(taskInputInfo.getNodeName());
taskInputInfoResp.setTableField(taskInputInfo.getTableField());
taskInputInfoResp.setTableName(taskInputInfo.getTableName());
taskInputInfoResp.setTableAsName(taskInputInfo.getTableAsName());
taskInputInfoResp.setAbleAsField(taskInputInfo.getAbleAsField());
taskInputInfoResp.setFieldAsEngineId(taskInputInfo.getFieldAsEngineId());
return taskInputInfoResp;
}
}