Commit 2e1988ce authored by mcb's avatar mcb

no message

parent 805ae1f7
package com.jz.dmp.modules.controller.dataOperation;
import com.jz.common.constant.ResultCode;
import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.DataIntegration.bean.RealTimeSyncListDto;
import com.jz.dmp.modules.controller.DataIntegration.bean.RealTimeSyncListReq;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.service.DmpDevelopTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* 数据运维-数据开发任务
*
* @author Bellamy
* @since 2021-01-13 10:56:18
*/
@RestController
@RequestMapping("/dataDevTask")
@Api(tags = "数据运维-数据开发任务")
public class DmpDevTaskController {
@Autowired
private DmpDevelopTaskService dmpDevelopTaskService;
/**
* 列表分页查询
*
* @return
* @author Bellamy
* @since 2021-01-05
*/
@ApiOperation(value = "列表分页查询", notes = "列表分页查询")
@PostMapping(value = "/listPage")
public PageInfoResponse<DataDevTaskListDto> getDevTaskListPage(@RequestBody @Validated DataDevTaskListReq req, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<DataDevTaskListDto> pageInfo = new PageInfoResponse<DataDevTaskListDto>();
if (StringUtils.isEmpty(req.getProjectId())) {
pageInfo.setMessage("项目id不能为空!");
pageInfo.setCode(ResultCode.PARAMS_ERROR);
return pageInfo;
}
try {
pageInfo = dmpDevelopTaskService.queryDevTaskListPage(req);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return pageInfo;
}
}
package com.jz.dmp.modules.controller.dataOperation.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @ClassName: DataDevTaskListDto
* @Description: 数据运维-数据开发任务列表返回参数
* @Author:Bellamy
* @Date 2021/01/13
* @Version 1.0
*/
@ApiModel(value = "数据运维-数据开发任务列表返回参数", description = "数据开发任务列表返回参数")
public class DataDevTaskListDto {
/*
* 任务ID
* */
@ApiModelProperty(value = "任务ID")
private String taskId;
/*
* 任务名称
* */
@ApiModelProperty(value = "任务名称")
private String taskName;
/*
* 最后执行状态
* */
@ApiModelProperty(value = "最后执行状态")
private String status;
/*
* 修改时间
* */
@ApiModelProperty(value = "修改时间")
private String updateTime;
/*
* 创建时间
* */
@ApiModelProperty(value = "创建时间")
private String createTime;
/*
* 最后执行时间
* */
@ApiModelProperty(value = "最后执行时间")
private String finaExecutionTime;
/*
* 创建人
* */
@ApiModelProperty(value = "创建人")
private String userName;
/*
* 调度周期
* */
@ApiModelProperty(value = "调度周期")
private String schedulinCycle;
/*
* 基线
* */
@ApiModelProperty(value = "基线")
private String baseline;
/*
* 通知
* */
@ApiModelProperty(value = "通知")
private String notice;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getFinaExecutionTime() {
return finaExecutionTime;
}
public void setFinaExecutionTime(String finaExecutionTime) {
this.finaExecutionTime = finaExecutionTime;
}
public String getSchedulinCycle() {
return schedulinCycle;
}
public void setSchedulinCycle(String schedulinCycle) {
this.schedulinCycle = schedulinCycle;
}
public String getBaseline() {
return baseline;
}
public void setBaseline(String baseline) {
this.baseline = baseline;
}
public String getNotice() {
return notice;
}
public void setNotice(String notice) {
this.notice = notice;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}
package com.jz.dmp.modules.controller.dataOperation.bean;
import com.jz.common.page.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
* @ClassName: DataDevTaskListReq
* @Description: 数据运维-数据开发任务列表请求参数
* @Author:Bellamy
* @Date 2021/01/13
* @Version 1.0
*/
@ApiModel(value = "数据运维-数据开发任务列表请求参数", description = "数据开发任务列表请求参数")
public class DataDevTaskListReq extends BasePageBean {
/*
* 项目id
* */
@ApiModelProperty(value = "项目id")
@NotNull(message = "项目id不能为空")
@NotEmpty(message = "项目ID不能空")
private String projectId;
/*
* 节点名称或id
* */
@ApiModelProperty(value = "节点名称或id")
private String treeIdOrName;
/*
* 节点id
* */
@ApiModelProperty(value = "节点id")
private String treeId;
/*
* 任务类型
* */
@ApiModelProperty(value = "任务类型")
private String taskType;
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getTreeIdOrName() {
return treeIdOrName;
}
public void setTreeIdOrName(String treeIdOrName) {
this.treeIdOrName = treeIdOrName;
}
public String getTreeId() {
return treeId;
}
public void setTreeId(String treeId) {
this.treeId = treeId;
}
public String getTaskType() {
return taskType;
}
public void setTaskType(String taskType) {
this.taskType = taskType;
}
}
package com.jz.dmp.modules.dao; package com.jz.dmp.modules.dao;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.model.DmpDevelopTask; import com.jz.dmp.modules.model.DmpDevelopTask;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map; import java.util.Map;
public interface DmpDevelopTaskDao { public interface DmpDevelopTaskDao {
...@@ -22,4 +25,13 @@ public interface DmpDevelopTaskDao { ...@@ -22,4 +25,13 @@ public interface DmpDevelopTaskDao {
DmpDevelopTask selectTaskInfoByParam(@Param("treeId") long treeId) throws Exception; DmpDevelopTask selectTaskInfoByParam(@Param("treeId") long treeId) throws Exception;
int update(DmpDevelopTask task) throws Exception; int update(DmpDevelopTask task) throws Exception;
/**
* 数据运维-数据开发任务列表分页查询
*
* @return
* @author Bellamy
* @since 2021-01-13
*/
List<DataDevTaskListDto> queryDevTaskListPage(DataDevTaskListReq req) throws Exception;
} }
package com.jz.dmp.modules.service; package com.jz.dmp.modules.service;
import com.jz.common.constant.JsonResult; import com.jz.common.constant.JsonResult;
import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.model.DmpDevelopTask; import com.jz.dmp.modules.model.DmpDevelopTask;
/** /**
...@@ -14,4 +17,12 @@ public interface DmpDevelopTaskService { ...@@ -14,4 +17,12 @@ public interface DmpDevelopTaskService {
JsonResult submitSyncing(DmpDevelopTask task) throws Exception; JsonResult submitSyncing(DmpDevelopTask task) throws Exception;
/**
* 数据运维-数据开发任务列表分页查询
*
* @return
* @author Bellamy
* @since 2021-01-13
*/
PageInfoResponse<DataDevTaskListDto> queryDevTaskListPage(DataDevTaskListReq req) throws Exception;
} }
\ No newline at end of file
package com.jz.dmp.modules.service.impl; package com.jz.dmp.modules.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.agent.service.DmpDsAgentService; import com.jz.agent.service.DmpDsAgentService;
import com.jz.common.constant.JsonResult; import com.jz.common.constant.JsonResult;
import com.jz.common.constant.ResultCode; import com.jz.common.constant.ResultCode;
import com.jz.common.page.PageInfoResponse;
import com.jz.common.utils.JsonMapper; import com.jz.common.utils.JsonMapper;
import com.jz.common.utils.StringUtils; import com.jz.common.utils.StringUtils;
import com.jz.common.utils.web.XmlUtils; import com.jz.common.utils.web.XmlUtils;
import com.jz.dmp.agent.DmpAgentResult; import com.jz.dmp.agent.DmpAgentResult;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.dao.DmpDevelopTaskDao; import com.jz.dmp.modules.dao.DmpDevelopTaskDao;
import com.jz.dmp.modules.dao.DmpProjectDao; import com.jz.dmp.modules.dao.DmpProjectDao;
import com.jz.dmp.modules.dao.DmpSyncingDatasourceDao;
import com.jz.dmp.modules.dao.DmpSyncingDatasourceTypeDao; import com.jz.dmp.modules.dao.DmpSyncingDatasourceTypeDao;
import com.jz.dmp.modules.model.*; import com.jz.dmp.modules.model.*;
import com.jz.dmp.modules.service.DmpDevelopTaskService; import com.jz.dmp.modules.service.DmpDevelopTaskService;
...@@ -24,6 +28,7 @@ import java.util.ArrayList; ...@@ -24,6 +28,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern;
/** /**
* 任务开发(DmpDevelopTask)表服务实现类 * 任务开发(DmpDevelopTask)表服务实现类
...@@ -711,4 +716,36 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService { ...@@ -711,4 +716,36 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
} }
return new String[]{clean_rules, check_rules}; return new String[]{clean_rules, check_rules};
} }
/**
* 数据运维-数据开发任务列表分页查询
*
* @return
* @author Bellamy
* @since 2021-01-13
*/
@Override
public PageInfoResponse<DataDevTaskListDto> queryDevTaskListPage(DataDevTaskListReq req) throws Exception {
PageInfoResponse<DataDevTaskListDto> pageInfoResponse = new PageInfoResponse<>();
if (StringUtils.isNotBlank(req.getTreeIdOrName())) {
//判断是否为整数 是整数返回true,否则返回false
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
if (pattern.matcher(req.getTreeIdOrName().trim()).matches()) {
req.setTreeId(req.getTreeIdOrName()); //id
} else {
req.setTreeIdOrName(req.getTreeIdOrName().trim());//节点名称
req.setTreeId(null);
}
}
PageHelper.startPage(req.getPageNum(), req.getPageSize());
List<DataDevTaskListDto> list = dmpDevelopTaskDao.queryDevTaskListPage(req);
PageInfo<DataDevTaskListDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(ResultCode.SUCCESS);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
} }
\ No newline at end of file
...@@ -116,4 +116,44 @@ ...@@ -116,4 +116,44 @@
where TREE_ID = #{treeId} where TREE_ID = #{treeId}
</select> </select>
<!--数据运维-数据开发任务列表分页查询-->
<select id="queryDevTaskListPage" resultType="com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto"
parameterType="com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq">
select
a.*,
b.real_name as userName
from(
select
t1.id as taskId,
t1.name as taskName,
t1.type,
t1.create_user_id as createUserId,
date_format(t1.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
date_format(t1.update_time,'%Y-%m-%d %H:%i:%s') as updateTime
from
dmp_navigation_tree t1
left join dmp_develop_task t2 on t2.TREE_ID=t1.ID
where 1=1
and t1.project_id = #{projectId}
union all
select
t1.id as taskId,
t1.name as taskName,
t1.type,
t1.create_user_id as createUserId,
t1.create_time as createTime,
t1.update_time as updateTime
from
dmp_navigation_tree t1
left join dmp_develop_task t2 on t2.TREE_ID=t1.ID
where 1=1
and t1.project_id = #{projectId}
) a
left join dmp_member b on a.createUserId=b.user_id
where 1=1
<if test="treeId != null and treeId != ''"> and a.taskId =#{treeId} </if>
<if test="treeIdOrName != null and treeIdOrName != ''"> and a.taskName like concat('%',#{treeIdOrName},'%') </if>
<if test="taskType != null and taskType!= ''"> and a.type=#{taskType} </if>
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment