添加实体类

master
陈思豪 2024-08-25 17:00:04 +08:00
parent c7548b2cb6
commit 37ff5821f9
7 changed files with 59 additions and 46 deletions

View File

@ -7,6 +7,8 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
* @PackageName:com.muyu.domain
* @ClassName:TaskInputInfo
@ -68,4 +70,7 @@ public class TaskInputInfo extends BaseEntity {
*/
private String fieldAsEngineId;
}

View File

@ -1,16 +0,0 @@
package com.muyu.domain.resp;
import lombok.*;
import lombok.experimental.SuperBuilder;
/**
* @PackageName:com.muyu.domain.resp
* @ClassName:TaskInfoResp
* @Description:
* @author:
* @date: 2024/8/23 10:48
*/
public class TaskInfoResp {
}

View File

@ -0,0 +1,25 @@
package com.muyu.domain.resp;
import com.muyu.domain.Structure;
import com.muyu.domain.TaskInputInfo;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
* @PackageName:com.muyu.domain.resp
* @ClassName:TaskInfoResp
* @Description:
* @author:
* @date: 2024/8/23 10:48
*/
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class TaskInputInfoResp extends TaskInputInfo {
private List<Structure> structureList;
}

View File

@ -1,15 +1,15 @@
package com.muyu.controller;
import com.muyu.common.core.domain.Result;
import com.muyu.domain.Structure;
import com.muyu.domain.TaskInfo;
import com.muyu.domain.TaskInputInfo;
import com.muyu.domain.resp.TaskInputInfoResp;
import com.muyu.service.TaskInputService;
import com.muyu.service.TaskService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
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 java.util.List;
@ -39,13 +39,18 @@ public class TaskInputController {
);
}
/**
*
* @param id
* @return
*/
@RequestMapping(path = "/findByInputId/{id}", method = RequestMethod.POST)
@Operation(summary = "查看任务节点详情", description = "根据任务的名称或者状态 ,进行模糊查询")
public Result<List<Structure>> findByInputId(@PathVariable(name = "id") Integer id) {
public Result<TaskInputInfoResp> findByInputId(@PathVariable(name = "id") Integer id) {
startPage();
List<Structure> taskInputInfo = taskInputService.findByInputId(id);
TaskInputInfoResp taskInfoResp = taskInputService.findByInputId(id);
return Result.success(
taskInputInfo
taskInfoResp
);
}

View File

@ -1,9 +1,8 @@
package com.muyu.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.domain.Structure;
import com.muyu.domain.TaskInfo;
import com.muyu.domain.TaskInputInfo;
import com.muyu.domain.resp.TaskInputInfoResp;
import java.util.List;
@ -17,5 +16,5 @@ import java.util.List;
public interface TaskInputService extends IService<TaskInputInfo> {
List<TaskInputInfo> selectList();
List<Structure> findByInputId(Integer id);
TaskInputInfoResp findByInputId(Integer id);
}

View File

@ -1,19 +1,13 @@
package com.muyu.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.domain.Structure;
import com.muyu.domain.TaskInfo;
import com.muyu.domain.TaskInputInfo;
import com.muyu.domain.resp.TaskInputInfoResp;
import com.muyu.mapper.TaskInputInfoMapper;
import com.muyu.mapper.TaskMapper;
import com.muyu.service.TaskInputService;
import com.muyu.service.TaskService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Service;
import java.util.List;
@ -36,11 +30,22 @@ public class TaskInputServiceImpl extends ServiceImpl<TaskInputInfoMapper, TaskI
}
@Override
public List<Structure> findByInputId(Integer id) {
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);
return structures;
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;
}
}

View File

@ -1,23 +1,13 @@
package com.muyu.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.domain.TaskInfo;
import com.muyu.domain.req.TaskInfoReq;
import com.muyu.mapper.TaskMapper;
import com.muyu.service.TaskService;
import io.swagger.v3.oas.annotations.Operation;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;