添加实体类

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
package com.muyu.service; package com.muyu.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.domain.TaskInputInfo; import com.muyu.domain.TableInfo;
import com.muyu.domain.resp.TaskInputInfoResp; import com.muyu.domain.resp.TaskInputInfoResp;
import java.util.List; import java.util.List;
@ -13,8 +13,8 @@ import java.util.List;
* @author: * @author:
* @date: 2024/8/22 20:18 * @date: 2024/8/22 20:18
*/ */
public interface TaskInputService extends IService<TaskInputInfo> { public interface TableInfoService extends IService<TableInfo> {
List<TaskInputInfo> selectList(); 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.Structure;
import com.muyu.domain.TaskInputInfo; import com.muyu.domain.TaskInputInfo;
import com.muyu.mapper.StructureMapper; import com.muyu.mapper.StructureMapper;
import com.muyu.mapper.TaskInputInfoMapper;
import com.muyu.service.StructureService; import com.muyu.service.StructureService;
import com.muyu.service.TaskInputService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -25,10 +23,14 @@ import java.util.List;
@Service @Service
public class StructureServiceImpl extends ServiceImpl<StructureMapper, Structure> implements StructureService { public class StructureServiceImpl extends ServiceImpl<StructureMapper, Structure> implements StructureService {
@Autowired
private StructureMapper structureMapper;
@Override @Override
public String findThis() { public List<Structure> findStructureList(Integer tableId) {
List<Structure> list = this.list(); LambdaQueryWrapper<Structure> queryWrapper = new LambdaQueryWrapper<Structure>();
String jsonString = JSONArray.toJSONString(list); queryWrapper.eq(Structure::getTableId, tableId);
return jsonString; 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;
}
}