Commit 1c8ca75b authored by mcb's avatar mcb

冲突解决

parents f55e0cab 0360e9a7
package com.jz.common.bean; package com.jz.common.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**分页信息封装 /**分页信息封装
* @author ybz * @author ybz
* *
*/ */
@ApiModel(value = "分页信息", description = "分页信息封装")
public class BasePageBean { public class BasePageBean {
@ApiModelProperty(value = "当前页码")
private int pageNum = 1; private int pageNum = 1;
@ApiModelProperty(value = "每页显示记录数")
private int pageSize = 10; private int pageSize = 10;
public int getPageNum() { public int getPageNum() {
return pageNum; return pageNum;
} }
......
package com.jz.common.bean; package com.jz.common.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/** /**
* @author ybz * @author ybz
* *
*/ */
@ApiModel(value = "响应码封装实体", description = "响应码封装实体")
public class BaseResponse { public class BaseResponse {
//错误码 //错误码
@ApiModelProperty(value = "错误码")
private String code; private String code;
//错误消息 //错误消息
@ApiModelProperty(value = "错误消息")
private String message; private String message;
public BaseResponse() {} public BaseResponse() {}
......
...@@ -9,6 +9,7 @@ import org.springframework.security.core.userdetails.UserDetails; ...@@ -9,6 +9,7 @@ import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import com.jz.dmp.modules.model.DmpMember; import com.jz.dmp.modules.model.DmpMember;
import com.jz.dmp.modules.model.DmpPermission; import com.jz.dmp.modules.model.DmpPermission;
...@@ -55,6 +56,15 @@ public class CustomUserService implements UserDetailsService { ...@@ -55,6 +56,15 @@ public class CustomUserService implements UserDetailsService {
//设置用户在当前默认项目的资源 //设置用户在当前默认项目的资源
List<DmpPermission> memberProjPermissions = dmpPermissionService.findPermissionByRoles(memberProjectRoles); List<DmpPermission> memberProjPermissions = dmpPermissionService.findPermissionByRoles(memberProjectRoles);
user.setMemberProjectPermissionList(memberProjPermissions); user.setMemberProjectPermissionList(memberProjPermissions);
//设置用户资源
List<DmpPermission> permissions = new ArrayList<DmpPermission>();
if (!CollectionUtils.isEmpty(memberPermissions)) {
permissions.addAll(memberPermissions);
}
if (!CollectionUtils.isEmpty(memberProjPermissions)) {
permissions.addAll(memberProjPermissions);
}
user.setPermissionList(permissions);
List<GrantedAuthority> grantedAuthorities = new ArrayList<>(); List<GrantedAuthority> grantedAuthorities = new ArrayList<>();
//List<DmpPermission> permissions = permissionDao.getDmpDefaultPermission(); //List<DmpPermission> permissions = permissionDao.getDmpDefaultPermission();
......
package com.jz.common.persistence;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.sql.Blob;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
public class CBTHandler extends BaseTypeHandler<String> {
private static final String DEFAULT_CHARSET = "utf-8";
@Override
public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType)
throws SQLException {
ByteArrayInputStream bis;
try {
bis = new ByteArrayInputStream(parameter.getBytes(DEFAULT_CHARSET));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Blob Encoding Error!");
}
ps.setBinaryStream(i, bis, parameter.length());
}
@Override
public String getNullableResult(ResultSet rs, String columnName) throws SQLException {
Blob blob = rs.getBlob(columnName);
byte[] returnValue = null;
if (null != blob) {
returnValue = blob.getBytes(1, (int) blob.length());
}
try {
if(returnValue == null) return "";
return new String(returnValue, DEFAULT_CHARSET);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Blob Encoding Error!");
}
}
@Override
public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
Blob blob = cs.getBlob(columnIndex);
byte[] returnValue = null;
if (null != blob) {
returnValue = blob.getBytes(1, (int) blob.length());
}
try {
return new String(returnValue, DEFAULT_CHARSET);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Blob Encoding Error!");
}
}
@Override
public String getNullableResult(ResultSet arg0, int arg1) throws SQLException {
return null;
}
}
\ No newline at end of file
package com.jz.dmp.modules.controller; package com.jz.dmp.modules.controller;
import com.jz.dmp.modules.service.DmpDevelopTaskService; import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; 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.RestController;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.StatuConstant;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskDto;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskRequest;
import com.jz.dmp.modules.service.DmpDevelopTaskService;
import io.swagger.annotations.ApiOperation;
/** /**
* 任务开发(DmpDevelopTask)表控制层 * 任务开发(DmpDevelopTask)表控制层
* *
...@@ -19,6 +30,24 @@ public class DmpDevelopTaskController { ...@@ -19,6 +30,24 @@ public class DmpDevelopTaskController {
*/ */
@Autowired @Autowired
private DmpDevelopTaskService dmpDevelopTaskService; private DmpDevelopTaskService dmpDevelopTaskService;
/**列表查询任务开发
* @param dmpDevelopTaskRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/findListWithPage")
@ApiOperation(value = "分頁列表查询任务开发", notes = "分頁列表查询任务开发")
public PageInfoResponse<DmpDevelopTaskDto> findListWithPage(@RequestBody DmpDevelopTaskRequest dmpDevelopTaskRequest, HttpServletRequest httpRequest){
PageInfoResponse<DmpDevelopTaskDto> pageInfo = new PageInfoResponse<DmpDevelopTaskDto>();
try {
pageInfo = dmpDevelopTaskService.findListWithPage(dmpDevelopTaskRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
} }
\ No newline at end of file
package com.jz.dmp.modules.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.StatuConstant;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskHistoryDto;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskHistoryRequest;
import com.jz.dmp.modules.service.DmpDevelopTaskHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
/**
* 任务历史版本Controller
* @author ybz
*
*/
@RestController
@RequestMapping("/dmp/develop/task/history")
@Api(tags = "任务历史版本")
public class DmpDevelopTaskHistoryController {
@Autowired
private DmpDevelopTaskHistoryService dmpDevelopTaskHistoryService;
/**列表查询任务历史版本
* @param dmpDevelopTaskHistoryRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/findListWithPage")
@ApiOperation(value = "分頁列表查询任务历史版本", notes = "分頁列表查询任务历史版本")
public PageInfoResponse<DmpDevelopTaskHistoryDto> findListWithPage(@RequestBody DmpDevelopTaskHistoryRequest dmpDevelopTaskHistoryRequest, HttpServletRequest httpRequest){
PageInfoResponse<DmpDevelopTaskHistoryDto> pageInfo = new PageInfoResponse<DmpDevelopTaskHistoryDto>();
try {
pageInfo = dmpDevelopTaskHistoryService.findListWithPage(dmpDevelopTaskHistoryRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
/**版本回滚
* @param dmpDevelopTaskHistoryRequest
* @return
*/
@RequestMapping(method = RequestMethod.GET, value = "/taskVersionRollback")
@ApiOperation(value = "版本回滚", notes = "版本回滚")
@ApiImplicitParam(name = "id", value = "任务历史版本主键")
public BaseResponse taskVersionRollback(@RequestParam(name = "id", required = true ) Integer id, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
baseResponse = dmpDevelopTaskHistoryService.taskVersionRollback(id, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("请求失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
}
package com.jz.dmp.modules.controller; package com.jz.dmp.modules.controller;
import com.jz.dmp.modules.model.DmpNavigationTree; import javax.servlet.http.HttpServletRequest;
import com.jz.dmp.modules.service.DmpNavigationTreeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; 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.RestController;
import javax.annotation.Resource; import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.constant.StatuConstant;
import com.jz.dmp.modules.controller.bean.DmpNavigationTreeDto;
import com.jz.dmp.modules.controller.bean.DmpNavigationTreeRequest;
import com.jz.dmp.modules.model.DmpNavigationTree;
import com.jz.dmp.modules.service.DmpNavigationTreeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/** /**
* DMP资源导航树(DmpNavigationTree)表控制层 * DMP资源导航树(DmpNavigationTree)表控制层
...@@ -38,5 +46,46 @@ public class DmpNavigationTreeController { ...@@ -38,5 +46,46 @@ public class DmpNavigationTreeController {
public DmpNavigationTree selectOne(Integer id) { public DmpNavigationTree selectOne(Integer id) {
return this.dmpNavigationTreeService.queryById(id); return this.dmpNavigationTreeService.queryById(id);
} }
/**列表查询DMP资源导航树
* @param dmpNavigationTreeRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/findList")
@ApiOperation(value = "列表查询DMP资源导航树", notes = "列表查询DMP资源导航树")
public BaseBeanResponse<DmpNavigationTreeDto> findList(@RequestBody DmpNavigationTreeRequest dmpNavigationTreeRequest, HttpServletRequest httpRequest){
BaseBeanResponse<DmpNavigationTreeDto> baseBeanResponse = new BaseBeanResponse<DmpNavigationTreeDto>();
try {
baseBeanResponse = dmpNavigationTreeService.findList(dmpNavigationTreeRequest, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("查询失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**新增DMP资源导航树
* @param dmpNavigationTreeRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/add")
@ApiOperation(value = "新增DMP资源导航树", notes = "新增DMP资源导航树")
public BaseBeanResponse<DmpNavigationTree> add(@RequestBody DmpNavigationTree dmpNavigationTree, HttpServletRequest httpRequest){
BaseBeanResponse<DmpNavigationTree> baseBeanResponse = new BaseBeanResponse<DmpNavigationTree>();
try {
DmpNavigationTree dmpNavigationTreeDb = dmpNavigationTreeService.insert(dmpNavigationTree);
baseBeanResponse.setCode(StatuConstant.CODE_SUCCESS);
baseBeanResponse.setMessage("新增成功");
baseBeanResponse.setData(dmpNavigationTreeDb);
} catch (Exception e) {
baseBeanResponse.setMessage("新增失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
} }
\ No newline at end of file
package com.jz.dmp.modules.controller.bean;
import com.jz.dmp.modules.model.DmpDevelopTask;
import io.swagger.annotations.ApiModel;
/**任务开发Dto
* @author ybz
*
*/
@ApiModel(value = "任务开发Dto", description = "任务开发Dto")
public class DmpDevelopTaskDto extends DmpDevelopTask {
}
package com.jz.dmp.modules.controller.bean;
import com.jz.dmp.modules.model.DmpDevelopTaskHistory;
import io.swagger.annotations.ApiModel;
/**任务历史版本Dto
* @author ybz
*
*/
@ApiModel(value = "任务历史版本Dto", description = "任务历史版本Dto")
public class DmpDevelopTaskHistoryDto extends DmpDevelopTaskHistory {
}
package com.jz.dmp.modules.controller.bean;
import java.util.Date;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**任务历史版本参数请求封装
* @author ybz
*
*/
@ApiModel(value = "任务历史版本参数请求封装", description = "任务历史版本参数请求封装")
public class DmpDevelopTaskHistoryRequest extends BasePageBean {
/**
* 主键
*/
@ApiModelProperty(value = "主键")
private Integer id;
/**
* 所属任务(关联任务主键)
*/
@ApiModelProperty(value = "所属任务(关联任务主键)")
private Integer taskId;
/**
* tree ID
*/
@ApiModelProperty(value = "tree ID")
private Integer treeId;
/**
* 数据源ID
*/
@ApiModelProperty(value = "数据源ID")
private Integer datasourceId;
/**
* 任务类型
*/
@ApiModelProperty(value = "任务类型")
private String taskType;
/**
* 类型
*/
@ApiModelProperty(value = "类型")
private String type;
/**
* 调度类型
*/
@ApiModelProperty(value = "调度类型")
private String scheduleType;
/**
* 是否已提交
*/
@ApiModelProperty(value = "是否已提交")
private String isSubmit;
/**
* 描述
*/
@ApiModelProperty(value = "描述")
private String taskDesc;
/**
* 脚本
*/
@ApiModelProperty(value = "脚本")
private String script;
/**
* flow_header
*/
@ApiModelProperty(value = "flow_header")
private String flowHeader;
/**
* flow_json
*/
@ApiModelProperty(value = "flow_json")
private String flowJson;
/**
* 版本
*/
@ApiModelProperty(value = "版本")
private String version;
/**
* is_gziped
*/
@ApiModelProperty(value = "is_gziped")
private String isGziped;
/**
* 任务数据状态
*/
@ApiModelProperty(value = "任务数据状态")
private String taskDataStatus;
/**
* 任务创建用户ID
*/
@ApiModelProperty(value = "任务创建用户ID")
private String taskCreateUserId;
/**
* 任务创建时间起
*/
@ApiModelProperty(value = "任务创建时间起")
private Date taskCreateTimeStart;
/**
* 任务创建时间止
*/
@ApiModelProperty(value = "任务创建时间止")
private Date taskCreateTimeEnd;
/**
* 任务修改用户ID
*/
@ApiModelProperty(value = "任务修改用户ID")
private String taskUpdateUserId;
/**
* 任务修改时间起
*/
@ApiModelProperty(value = "任务修改时间起")
private Date taskUpdateTimeStart;
/**
* 任务修改时间止
*/
@ApiModelProperty(value = "任务修改时间止")
private Date taskUpdateTimeEnd;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* 数据状态(0:删除,1,未删除)
*/
@ApiModelProperty(value = "数据状态(0:删除,1,未删除)")
private String dataStatus;
/**
* 创建用户ID
*/
@ApiModelProperty(value = "创建用户ID")
private Integer createUserId;
/**
* 创建时间起
*/
@ApiModelProperty(value = "创建时间起")
private Date createTimeStart;
/**
* 创建时间止
*/
@ApiModelProperty(value = "创建时间止")
private Date createTimeEnd;
/**
* 修改用户ID
*/
@ApiModelProperty(value = "修改用户ID")
private Integer updateUserId;
/**
* 修改时间起
*/
@ApiModelProperty(value = "修改时间起")
private Date updateTimeStart;
/**
* 修改时间止
*/
@ApiModelProperty(value = "修改时间止")
private Date updateTimeEnd;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getTaskId() {
return taskId;
}
public void setTaskId(Integer taskId) {
this.taskId = taskId;
}
public Integer getTreeId() {
return treeId;
}
public void setTreeId(Integer treeId) {
this.treeId = treeId;
}
public Integer getDatasourceId() {
return datasourceId;
}
public void setDatasourceId(Integer datasourceId) {
this.datasourceId = datasourceId;
}
public String getTaskType() {
return taskType;
}
public void setTaskType(String taskType) {
this.taskType = taskType;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getScheduleType() {
return scheduleType;
}
public void setScheduleType(String scheduleType) {
this.scheduleType = scheduleType;
}
public String getIsSubmit() {
return isSubmit;
}
public void setIsSubmit(String isSubmit) {
this.isSubmit = isSubmit;
}
public String getTaskDesc() {
return taskDesc;
}
public void setTaskDesc(String taskDesc) {
this.taskDesc = taskDesc;
}
public String getScript() {
return script;
}
public void setScript(String script) {
this.script = script;
}
public String getFlowHeader() {
return flowHeader;
}
public void setFlowHeader(String flowHeader) {
this.flowHeader = flowHeader;
}
public String getFlowJson() {
return flowJson;
}
public void setFlowJson(String flowJson) {
this.flowJson = flowJson;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getIsGziped() {
return isGziped;
}
public void setIsGziped(String isGziped) {
this.isGziped = isGziped;
}
public String getTaskDataStatus() {
return taskDataStatus;
}
public void setTaskDataStatus(String taskDataStatus) {
this.taskDataStatus = taskDataStatus;
}
public String getTaskCreateUserId() {
return taskCreateUserId;
}
public void setTaskCreateUserId(String taskCreateUserId) {
this.taskCreateUserId = taskCreateUserId;
}
public Date getTaskCreateTimeStart() {
return taskCreateTimeStart;
}
public void setTaskCreateTimeStart(Date taskCreateTimeStart) {
this.taskCreateTimeStart = taskCreateTimeStart;
}
public Date getTaskCreateTimeEnd() {
return taskCreateTimeEnd;
}
public void setTaskCreateTimeEnd(Date taskCreateTimeEnd) {
this.taskCreateTimeEnd = taskCreateTimeEnd;
}
public String getTaskUpdateUserId() {
return taskUpdateUserId;
}
public void setTaskUpdateUserId(String taskUpdateUserId) {
this.taskUpdateUserId = taskUpdateUserId;
}
public Date getTaskUpdateTimeStart() {
return taskUpdateTimeStart;
}
public void setTaskUpdateTimeStart(Date taskUpdateTimeStart) {
this.taskUpdateTimeStart = taskUpdateTimeStart;
}
public Date getTaskUpdateTimeEnd() {
return taskUpdateTimeEnd;
}
public void setTaskUpdateTimeEnd(Date taskUpdateTimeEnd) {
this.taskUpdateTimeEnd = taskUpdateTimeEnd;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public Integer getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Integer createUserId) {
this.createUserId = createUserId;
}
public Date getCreateTimeStart() {
return createTimeStart;
}
public void setCreateTimeStart(Date createTimeStart) {
this.createTimeStart = createTimeStart;
}
public Date getCreateTimeEnd() {
return createTimeEnd;
}
public void setCreateTimeEnd(Date createTimeEnd) {
this.createTimeEnd = createTimeEnd;
}
public Integer getUpdateUserId() {
return updateUserId;
}
public void setUpdateUserId(Integer updateUserId) {
this.updateUserId = updateUserId;
}
public Date getUpdateTimeStart() {
return updateTimeStart;
}
public void setUpdateTimeStart(Date updateTimeStart) {
this.updateTimeStart = updateTimeStart;
}
public Date getUpdateTimeEnd() {
return updateTimeEnd;
}
public void setUpdateTimeEnd(Date updateTimeEnd) {
this.updateTimeEnd = updateTimeEnd;
}
}
package com.jz.dmp.modules.controller.bean;
import java.util.Date;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**任务开发参数请求封装
* @author ybz
*
*/
@ApiModel(value = "任务开发参数请求封装", description = "任务开发参数请求封装")
public class DmpDevelopTaskRequest extends BasePageBean {
/**
* ID
*/
@ApiModelProperty(value = "ID")
private Integer id;
/**
* tree ID
*/
@ApiModelProperty(value = "tree ID")
private Integer treeId;
/**
* 数据源ID
*/
@ApiModelProperty(value = "数据源ID")
private Integer datasourceId;
/**
* 任务类型
*/
@ApiModelProperty(value = "任务类型")
private String taskType;
/**
* 类型
*/
@ApiModelProperty(value = "类型")
private String type;
/**
* 调度类型
*/
@ApiModelProperty(value = "调度类型")
private String scheduleType;
/**
* 是否已提交
*/
@ApiModelProperty(value = "是否已提交")
private String isSubmit;
/**
* 描述
*/
@ApiModelProperty(value = "描述")
private String taskDesc;
/**
* 脚本
*/
@ApiModelProperty(value = "脚本")
private String script;
/**
* 数据状态
*/
@ApiModelProperty(value = "数据状态")
private String dataStatus;
/**
* 创建用户ID
*/
@ApiModelProperty(value = "创建用户ID")
private String createUserId;
/**
* 数据创建时间起
*/
@ApiModelProperty(value = "数据创建时间起")
private Date createTimeStart;
/**
* 数据创建时间止
*/
@ApiModelProperty(value = "数据创建时间止")
private Date createTimeEnd;
/**
* 创建用户ID
*/
@ApiModelProperty(value = "创建用户ID")
private String updateUserId;
/**
* 数据更新时间起
*/
@ApiModelProperty(value = "数据更新时间起")
private Date updateTimeStart;
/**
* 数据更新时间止
*/
@ApiModelProperty(value = "数据更新时间止")
private Date updateTimeEnd;
/**
* 校验状态:SUCCEED 成功, FAIL 失败
*/
@ApiModelProperty(value = "校验状态:SUCCEED 成功, FAIL 失败")
private String chkResult;
/**
* 同步状态:SUCCEED 成功,FAIL 失败
*/
@ApiModelProperty(value = "同步状态:SUCCEED 成功,FAIL 失败")
private String syncResult;
/**
* 最终校验时间起
*/
@ApiModelProperty(value = "最终校验时间起")
private Date chkTimeStart;
/**
* 最终校验时间止
*/
@ApiModelProperty(value = "最终校验时间止")
private Date chkTimeEnd;
/**
* 最终同步时间起
*/
@ApiModelProperty(value = "最终同步时间起")
private Date syncTimeStart;
/**
* 最终同步时间止
*/
@ApiModelProperty(value = "最终同步时间止")
private Date syncTimeEnd;
/**
*
*/
@ApiModelProperty(value = "")
private String flowHeader;
/**
*
*/
@ApiModelProperty(value = "")
private String flowJson;
/**
*
*/
@ApiModelProperty(value = "")
private String version;
/**
*
*/
@ApiModelProperty(value = "")
private Integer isGziped;
/**
* 源数据库ID
*/
@ApiModelProperty(value = "源数据库ID")
private String sourceDbId;
/**
* 源数据库名称
*/
@ApiModelProperty(value = "源数据库名称")
private String sourceDbName;
/**
* 源数据表名称
*/
@ApiModelProperty(value = "源数据表名称")
private String sourceTableName;
/**
* 目标数据库名称
*/
@ApiModelProperty(value = "目标数据库名称")
private String targetDbName;
/**
* 目标数据表名称
*/
@ApiModelProperty(value = "目标数据表名称")
private String targetTableName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getTreeId() {
return treeId;
}
public void setTreeId(Integer treeId) {
this.treeId = treeId;
}
public Integer getDatasourceId() {
return datasourceId;
}
public void setDatasourceId(Integer datasourceId) {
this.datasourceId = datasourceId;
}
public String getTaskType() {
return taskType;
}
public void setTaskType(String taskType) {
this.taskType = taskType;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getScheduleType() {
return scheduleType;
}
public void setScheduleType(String scheduleType) {
this.scheduleType = scheduleType;
}
public String getIsSubmit() {
return isSubmit;
}
public void setIsSubmit(String isSubmit) {
this.isSubmit = isSubmit;
}
public String getTaskDesc() {
return taskDesc;
}
public void setTaskDesc(String taskDesc) {
this.taskDesc = taskDesc;
}
public String getScript() {
return script;
}
public void setScript(String script) {
this.script = script;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public String getCreateUserId() {
return createUserId;
}
public void setCreateUserId(String createUserId) {
this.createUserId = createUserId;
}
public Date getCreateTimeStart() {
return createTimeStart;
}
public void setCreateTimeStart(Date createTimeStart) {
this.createTimeStart = createTimeStart;
}
public Date getCreateTimeEnd() {
return createTimeEnd;
}
public void setCreateTimeEnd(Date createTimeEnd) {
this.createTimeEnd = createTimeEnd;
}
public String getUpdateUserId() {
return updateUserId;
}
public void setUpdateUserId(String updateUserId) {
this.updateUserId = updateUserId;
}
public Date getUpdateTimeStart() {
return updateTimeStart;
}
public void setUpdateTimeStart(Date updateTimeStart) {
this.updateTimeStart = updateTimeStart;
}
public Date getUpdateTimeEnd() {
return updateTimeEnd;
}
public void setUpdateTimeEnd(Date updateTimeEnd) {
this.updateTimeEnd = updateTimeEnd;
}
public String getChkResult() {
return chkResult;
}
public void setChkResult(String chkResult) {
this.chkResult = chkResult;
}
public String getSyncResult() {
return syncResult;
}
public void setSyncResult(String syncResult) {
this.syncResult = syncResult;
}
public Date getChkTimeStart() {
return chkTimeStart;
}
public void setChkTimeStart(Date chkTimeStart) {
this.chkTimeStart = chkTimeStart;
}
public Date getChkTimeEnd() {
return chkTimeEnd;
}
public void setChkTimeEnd(Date chkTimeEnd) {
this.chkTimeEnd = chkTimeEnd;
}
public Date getSyncTimeStart() {
return syncTimeStart;
}
public void setSyncTimeStart(Date syncTimeStart) {
this.syncTimeStart = syncTimeStart;
}
public Date getSyncTimeEnd() {
return syncTimeEnd;
}
public void setSyncTimeEnd(Date syncTimeEnd) {
this.syncTimeEnd = syncTimeEnd;
}
public String getFlowHeader() {
return flowHeader;
}
public void setFlowHeader(String flowHeader) {
this.flowHeader = flowHeader;
}
public String getFlowJson() {
return flowJson;
}
public void setFlowJson(String flowJson) {
this.flowJson = flowJson;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public Integer getIsGziped() {
return isGziped;
}
public void setIsGziped(Integer isGziped) {
this.isGziped = isGziped;
}
public String getSourceDbId() {
return sourceDbId;
}
public void setSourceDbId(String sourceDbId) {
this.sourceDbId = sourceDbId;
}
public String getSourceDbName() {
return sourceDbName;
}
public void setSourceDbName(String sourceDbName) {
this.sourceDbName = sourceDbName;
}
public String getSourceTableName() {
return sourceTableName;
}
public void setSourceTableName(String sourceTableName) {
this.sourceTableName = sourceTableName;
}
public String getTargetDbName() {
return targetDbName;
}
public void setTargetDbName(String targetDbName) {
this.targetDbName = targetDbName;
}
public String getTargetTableName() {
return targetTableName;
}
public void setTargetTableName(String targetTableName) {
this.targetTableName = targetTableName;
}
}
package com.jz.dmp.modules.controller.bean;
import com.jz.dmp.modules.model.DmpNavigationTree;
import io.swagger.annotations.ApiModel;
/**DMP资源导航树Dto
* @author ybz
*
*/
@ApiModel(value = "DMP资源导航树Dto", description = "DMP资源导航树Dto")
public class DmpNavigationTreeDto extends DmpNavigationTree {
}
package com.jz.dmp.modules.controller.bean;
import java.util.Date;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**DMP资源导航树参数请求封装
* @author ybz
*
*/
@ApiModel(value = "DMP资源导航树参数请求封装", description = "DMP资源导航树参数请求封装")
public class DmpNavigationTreeRequest extends BasePageBean {
/**
* ID
*/
@ApiModelProperty(value = "ID")
private Integer id;
/**
* 项目ID
*/
@ApiModelProperty(value = "项目ID")
private Integer projectId;
/**
* 树类别
*/
@ApiModelProperty(value = "树类别")
private String category;
/**
* 树类型
*/
@ApiModelProperty(value = "树类型")
private String type;
/**
* 名称
*/
@ApiModelProperty(value = "名称")
private String name;
/**
* 序号
*/
@ApiModelProperty(value = "序号")
private Integer treeSort;
/**
* 是否叶子节点(0:否,1:是)
*/
@ApiModelProperty(value = "是否叶子节点(0:否,1:是)")
private String isLevel;
/**
* 是否启用(0:否,1:是)
*/
@ApiModelProperty(value = "是否启用(0:否,1:是)")
private String isEnable;
/**
* 父节点ID
*/
@ApiModelProperty(value = "父节点ID")
private Integer parentId;
/**
* 数据状态
*/
@ApiModelProperty(value = "数据状态")
private String dataStatus;
/**
* 创建用户ID
*/
@ApiModelProperty(value = "创建用户ID")
private String createUserId;
/**
* 数据创建时间起
*/
@ApiModelProperty(value = "数据创建时间起")
private Date createTimeStart;
/**
* 数据创建时间止
*/
@ApiModelProperty(value = "数据创建时间止")
private Date createTimeEnd;
/**
* 创建用户ID
*/
@ApiModelProperty(value = "创建用户ID")
private String updateUserId;
/**
* 数据更新时间起
*/
@ApiModelProperty(value = "数据更新时间起")
private Date updateTimeStart;
/**
* 数据更新时间止
*/
@ApiModelProperty(value = "数据更新时间止")
private Date updateTimeEnd;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getProjectId() {
return projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getTreeSort() {
return treeSort;
}
public void setTreeSort(Integer treeSort) {
this.treeSort = treeSort;
}
public String getIsLevel() {
return isLevel;
}
public void setIsLevel(String isLevel) {
this.isLevel = isLevel;
}
public String getIsEnable() {
return isEnable;
}
public void setIsEnable(String isEnable) {
this.isEnable = isEnable;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public String getCreateUserId() {
return createUserId;
}
public void setCreateUserId(String createUserId) {
this.createUserId = createUserId;
}
public Date getCreateTimeStart() {
return createTimeStart;
}
public void setCreateTimeStart(Date createTimeStart) {
this.createTimeStart = createTimeStart;
}
public Date getCreateTimeEnd() {
return createTimeEnd;
}
public void setCreateTimeEnd(Date createTimeEnd) {
this.createTimeEnd = createTimeEnd;
}
public String getUpdateUserId() {
return updateUserId;
}
public void setUpdateUserId(String updateUserId) {
this.updateUserId = updateUserId;
}
public Date getUpdateTimeStart() {
return updateTimeStart;
}
public void setUpdateTimeStart(Date updateTimeStart) {
this.updateTimeStart = updateTimeStart;
}
public Date getUpdateTimeEnd() {
return updateTimeEnd;
}
public void setUpdateTimeEnd(Date updateTimeEnd) {
this.updateTimeEnd = updateTimeEnd;
}
}
package com.jz.dmp.modules.controller.bean;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.BeanUtils;
import com.jz.dmp.modules.model.DmpDevelopTask;
public class MyDmpDevelopTaskConverter {
private static MyDmpDevelopTaskConverter instance;
private MyDmpDevelopTaskConverter() {};
public synchronized static MyDmpDevelopTaskConverter INSTANCE() {
if (instance==null) {
instance = new MyDmpDevelopTaskConverter();
}
return instance;
}
public DmpDevelopTaskDto domain2dto(DmpDevelopTask dmpDevelopTask) {
DmpDevelopTaskDto dmpDevelopTaskDto = new DmpDevelopTaskDto();
BeanUtils.copyProperties(dmpDevelopTask, dmpDevelopTaskDto);
return dmpDevelopTaskDto;
}
public List<DmpDevelopTaskDto> domain2dto(List<DmpDevelopTask> dmpDevelopTasks) {
List<DmpDevelopTaskDto> dmpDevelopTaskDtos = new ArrayList<DmpDevelopTaskDto>();
dmpDevelopTasks.stream().forEach(x -> {
dmpDevelopTaskDtos.add(domain2dto(x));
});
return dmpDevelopTaskDtos;
}
}
package com.jz.dmp.modules.controller.bean;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.BeanUtils;
import com.jz.dmp.modules.model.DmpNavigationTree;
public class MyDmpNavigationTreeConverter {
private static MyDmpNavigationTreeConverter instance;
private MyDmpNavigationTreeConverter() {};
public synchronized static MyDmpNavigationTreeConverter INSTANCE() {
if (instance==null) {
instance = new MyDmpNavigationTreeConverter();
}
return instance;
}
public DmpNavigationTreeDto domain2dto(DmpNavigationTree dmpNavigationTree) {
DmpNavigationTreeDto dmpNavigationTreeDto = new DmpNavigationTreeDto();
BeanUtils.copyProperties(dmpNavigationTree, dmpNavigationTreeDto);
return dmpNavigationTreeDto;
}
public List<DmpNavigationTreeDto> domain2dto(List<DmpNavigationTree> dmpNavigationTrees) {
List<DmpNavigationTreeDto> dmpNavigationTreeDtos = new ArrayList<DmpNavigationTreeDto>();
dmpNavigationTrees.stream().forEach(x -> {
dmpNavigationTreeDtos.add(domain2dto(x));
});
return dmpNavigationTreeDtos;
}
}
...@@ -25,6 +25,7 @@ import com.jz.dmp.modules.service.sys.DmpPermissionService; ...@@ -25,6 +25,7 @@ import com.jz.dmp.modules.service.sys.DmpPermissionService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
/** /**
...@@ -161,12 +162,15 @@ public class DmpPermissionController { ...@@ -161,12 +162,15 @@ public class DmpPermissionController {
*/ */
@RequestMapping(method = RequestMethod.POST, value = "/findListByParentCode") @RequestMapping(method = RequestMethod.POST, value = "/findListByParentCode")
@ApiOperation(value = "获取当前用户指定资源", notes = "根据父级资源编码,获取当前登录用户所有资源") @ApiOperation(value = "获取当前用户指定资源", notes = "根据父级资源编码,获取当前登录用户所有资源")
@ApiImplicitParam(name = "parentCode", value = "父资源编码") @ApiImplicitParams({
public BaseBeanResponse<DmpPermissionDto> findListByParentCode(@RequestParam(name = "parentCode", required = true) String parentCode, HttpServletRequest httpRequest){ @ApiImplicitParam(name = "parentCode", value = "父资源编码"),
@ApiImplicitParam(name = "type", value = "请求类型:0:用户项目下资源;1:用户系统级别资源")
})
public BaseBeanResponse<DmpPermissionDto> findListByParentCode(@RequestParam(name = "parentCode", required = true) String parentCode, @RequestParam(name = "type", required = true) String type, HttpServletRequest httpRequest){
BaseBeanResponse<DmpPermissionDto> baseBeanResponse = new BaseBeanResponse<DmpPermissionDto>(); BaseBeanResponse<DmpPermissionDto> baseBeanResponse = new BaseBeanResponse<DmpPermissionDto>();
try { try {
baseBeanResponse = dmpPermissionService.findListByParentCode(parentCode, httpRequest); baseBeanResponse = dmpPermissionService.findListByParentCode(parentCode, type, httpRequest);
} catch (Exception e) { } catch (Exception e) {
baseBeanResponse.setMessage("查询失败"); baseBeanResponse.setMessage("查询失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE); baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
......
...@@ -4,6 +4,7 @@ import java.util.ArrayList; ...@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
import com.jz.dmp.modules.model.DmpPermission; import com.jz.dmp.modules.model.DmpPermission;
...@@ -30,9 +31,11 @@ public class MyDmpPermissionConverter { ...@@ -30,9 +31,11 @@ public class MyDmpPermissionConverter {
public List<DmpPermissionDto> domain2dto(List<DmpPermission> dmpPermissions) { public List<DmpPermissionDto> domain2dto(List<DmpPermission> dmpPermissions) {
List<DmpPermissionDto> dmpPermissionDtos = new ArrayList<DmpPermissionDto>(); List<DmpPermissionDto> dmpPermissionDtos = new ArrayList<DmpPermissionDto>();
dmpPermissions.stream().forEach(x -> { if (!CollectionUtils.isEmpty(dmpPermissions)) {
dmpPermissionDtos.add(domain2dto(x)); dmpPermissions.stream().forEach(x -> {
}); dmpPermissionDtos.add(domain2dto(x));
});
}
return dmpPermissionDtos; return dmpPermissionDtos;
} }
...@@ -46,9 +49,12 @@ public class MyDmpPermissionConverter { ...@@ -46,9 +49,12 @@ public class MyDmpPermissionConverter {
public List<DmpPermission> dto2domain(List<DmpPermissionDto> dmpPermissionDtos) { public List<DmpPermission> dto2domain(List<DmpPermissionDto> dmpPermissionDtos) {
List<DmpPermission> dmpPermissions = new ArrayList<DmpPermission>(); List<DmpPermission> dmpPermissions = new ArrayList<DmpPermission>();
dmpPermissionDtos.stream().forEach(x -> {
dmpPermissions.add(domain2dto(x)); if (!CollectionUtils.isEmpty(dmpPermissionDtos)) {
}); dmpPermissionDtos.stream().forEach(x -> {
dmpPermissions.add(domain2dto(x));
});
}
return dmpPermissions; return dmpPermissions;
} }
......
package com.jz.dmp.modules.dao; package com.jz.dmp.modules.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq; 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 java.util.List;
import java.util.Map;
public interface DmpDevelopTaskDao { public interface DmpDevelopTaskDao {
...@@ -36,4 +38,12 @@ public interface DmpDevelopTaskDao { ...@@ -36,4 +38,12 @@ public interface DmpDevelopTaskDao {
List<DataDevTaskListDto> queryDevTaskListPage(DataDevTaskListReq req) throws Exception; List<DataDevTaskListDto> queryDevTaskListPage(DataDevTaskListReq req) throws Exception;
List<DataDevTaskListDto> queryTaskTreeInfo(Map params) throws Exception; List<DataDevTaskListDto> queryTaskTreeInfo(Map params) throws Exception;
/**条件查询任务开发
* @param param
* @return
* @throws Exception
*/
public List<DmpDevelopTask> findList(Map<String, Object> param)throws Exception;
} }
package com.jz.dmp.modules.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskHistoryDto;
import com.jz.dmp.modules.model.DmpDevelopTaskHistory;
/**任务历史版本 mapper
* @author ybz
*
*/
public interface DmpDevelopTaskHistoryMapper {
/**新增任务历史版本
* @param dmpDevelopTaskHistory
* @return
* @throws Exception
*/
public int insert(DmpDevelopTaskHistory dmpDevelopTaskHistory)throws Exception;
/**选择性增加任务历史版本
* @param dmpDevelopTaskHistory
* @return
* @throws Exception
*/
public int insertSelective(DmpDevelopTaskHistory dmpDevelopTaskHistory)throws Exception;
/**主键修改任务历史版本
* @param dmpDevelopTaskHistory
* @return
* @throws Exception
*/
public int updateByPrimaryKey(DmpDevelopTaskHistory dmpDevelopTaskHistory)throws Exception;
/**选择性修改任务历史版本
* @param dmpDevelopTaskHistory
* @return
* @throws Exception
*/
public int updateByPrimaryKeySelective(DmpDevelopTaskHistory dmpDevelopTaskHistory)throws Exception;
/**主键查询任务历史版本
* @param id
* @return
* @throws Exception
*/
public DmpDevelopTaskHistory selectByPrimaryKey(Integer id)throws Exception;
/**主键删除任务历史版本
* @param id
* @return
* @throws Exception
*/
public int deleteByPrimaryKey(Integer id)throws Exception;
/**主键软删除任务历史版本
* @param id
* @return
* @throws Exception
*/
public int softDeleteByPrimaryKey(Integer id)throws Exception;
/**主键删除任务历史版本
* @param id
* @return
* @throws Exception
*/
public int delete(Map<String, Object> param)throws Exception;
/**主键软删除任务历史版本
* @param id
* @return
* @throws Exception
*/
public int softDelete(Map<String, Object> param)throws Exception;
/**条件查询任务历史版本
* @param param
* @return
* @throws Exception
*/
public List<DmpDevelopTaskHistoryDto> findList(Map<String, Object> param)throws Exception;
/**主键查询任务历史版本
* @param id
* @return
* @throws Exception
*/
public DmpDevelopTaskHistoryDto findById(Integer id)throws Exception;
/**批量新增任务历史版本
* @param dmpDevelopTaskHistorys
* @throws Exception
*/
public void insertBatch(List<DmpDevelopTaskHistory> dmpDevelopTaskHistorys)throws Exception;
/**
* @Title: deleteByIds
* @Description: TODO(批量删除)
* @param @param idList
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
public void deleteByIds(@Param("idList")List<Integer> idList)throws Exception;
/**
* @Title: softDeleteByIds
* @Description: TODO(批量软删除)
* @param @param idList
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
public void softDeleteByIds(@Param("idList")List<Integer> idList)throws Exception;
}
package com.jz.dmp.modules.model;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**任务历史版本
* @author ybz
*
*/
@ApiModel(value = "任务历史版本", description = "任务历史版本")
public class DmpDevelopTaskHistory implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty(value = "主键")
private Integer id;
/**
* 所属任务(关联任务主键)
*/
@ApiModelProperty(value = "所属任务(关联任务主键)")
private Integer taskId;
/**
* tree ID
*/
@ApiModelProperty(value = "tree ID")
private Integer treeId;
/**
* 数据源ID
*/
@ApiModelProperty(value = "数据源ID")
private Integer datasourceId;
/**
* 任务类型
*/
@ApiModelProperty(value = "任务类型")
private String taskType;
/**
* 类型
*/
@ApiModelProperty(value = "类型")
private String type;
/**
* 调度类型
*/
@ApiModelProperty(value = "调度类型")
private String scheduleType;
/**
* 是否已提交
*/
@ApiModelProperty(value = "是否已提交")
private String isSubmit;
/**
* 描述
*/
@ApiModelProperty(value = "描述")
private String taskDesc;
/**
* 脚本
*/
@ApiModelProperty(value = "脚本")
private String script;
/**
* flow_header
*/
@ApiModelProperty(value = "flow_header")
private String flowHeader;
/**
* flow_json
*/
@ApiModelProperty(value = "flow_json")
private String flowJson;
/**
* 版本
*/
@ApiModelProperty(value = "版本")
private String version;
/**
* is_gziped
*/
@ApiModelProperty(value = "is_gziped")
private String isGziped;
/**
* 任务数据状态
*/
@ApiModelProperty(value = "任务数据状态")
private String taskDataStatus;
/**
* 任务创建用户ID
*/
@ApiModelProperty(value = "任务创建用户ID")
private String taskCreateUserId;
/**
* 任务创建时间
*/
@ApiModelProperty(value = "任务创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date taskCreateTime;
/**
* 任务修改用户ID
*/
@ApiModelProperty(value = "任务修改用户ID")
private String taskUpdateUserId;
/**
* 任务修改时间
*/
@ApiModelProperty(value = "任务修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date taskUpdateTime;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* 数据状态(0:删除,1,未删除)
*/
@ApiModelProperty(value = "数据状态(0:删除,1,未删除)")
private String dataStatus;
/**
* 创建用户ID
*/
@ApiModelProperty(value = "创建用户ID")
private Integer createUserId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 修改用户ID
*/
@ApiModelProperty(value = "修改用户ID")
private Integer updateUserId;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getTaskId() {
return taskId;
}
public void setTaskId(Integer taskId) {
this.taskId = taskId;
}
public Integer getTreeId() {
return treeId;
}
public void setTreeId(Integer treeId) {
this.treeId = treeId;
}
public Integer getDatasourceId() {
return datasourceId;
}
public void setDatasourceId(Integer datasourceId) {
this.datasourceId = datasourceId;
}
public String getTaskType() {
return taskType;
}
public void setTaskType(String taskType) {
this.taskType = taskType;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getScheduleType() {
return scheduleType;
}
public void setScheduleType(String scheduleType) {
this.scheduleType = scheduleType;
}
public String getIsSubmit() {
return isSubmit;
}
public void setIsSubmit(String isSubmit) {
this.isSubmit = isSubmit;
}
public String getTaskDesc() {
return taskDesc;
}
public void setTaskDesc(String taskDesc) {
this.taskDesc = taskDesc;
}
public String getScript() {
return script;
}
public void setScript(String script) {
this.script = script;
}
public String getFlowHeader() {
return flowHeader;
}
public void setFlowHeader(String flowHeader) {
this.flowHeader = flowHeader;
}
public String getFlowJson() {
return flowJson;
}
public void setFlowJson(String flowJson) {
this.flowJson = flowJson;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getIsGziped() {
return isGziped;
}
public void setIsGziped(String isGziped) {
this.isGziped = isGziped;
}
public String getTaskDataStatus() {
return taskDataStatus;
}
public void setTaskDataStatus(String taskDataStatus) {
this.taskDataStatus = taskDataStatus;
}
public String getTaskCreateUserId() {
return taskCreateUserId;
}
public void setTaskCreateUserId(String taskCreateUserId) {
this.taskCreateUserId = taskCreateUserId;
}
public Date getTaskCreateTime() {
return taskCreateTime;
}
public void setTaskCreateTime(Date taskCreateTime) {
this.taskCreateTime = taskCreateTime;
}
public String getTaskUpdateUserId() {
return taskUpdateUserId;
}
public void setTaskUpdateUserId(String taskUpdateUserId) {
this.taskUpdateUserId = taskUpdateUserId;
}
public Date getTaskUpdateTime() {
return taskUpdateTime;
}
public void setTaskUpdateTime(Date taskUpdateTime) {
this.taskUpdateTime = taskUpdateTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public Integer getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Integer createUserId) {
this.createUserId = createUserId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getUpdateUserId() {
return updateUserId;
}
public void setUpdateUserId(Integer updateUserId) {
this.updateUserId = updateUserId;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
...@@ -127,6 +127,9 @@ public class DmpMember implements UserDetails{ ...@@ -127,6 +127,9 @@ public class DmpMember implements UserDetails{
@ApiModelProperty(value = "用户当前项目资源") @ApiModelProperty(value = "用户当前项目资源")
private List<DmpPermission> memberProjectPermissionList; private List<DmpPermission> memberProjectPermissionList;
@ApiModelProperty(value = "用户资源")
private List<DmpPermission> permissionList;
@ApiModelProperty(value = "权限") @ApiModelProperty(value = "权限")
private List<? extends GrantedAuthority> authorities; private List<? extends GrantedAuthority> authorities;
...@@ -290,6 +293,14 @@ public class DmpMember implements UserDetails{ ...@@ -290,6 +293,14 @@ public class DmpMember implements UserDetails{
this.memberProjectPermissionList = memberProjectPermissionList; this.memberProjectPermissionList = memberProjectPermissionList;
} }
public List<DmpPermission> getPermissionList() {
return permissionList;
}
public void setPermissionList(List<DmpPermission> permissionList) {
this.permissionList = permissionList;
}
public void setAuthorities(List<? extends GrantedAuthority> authorities) { public void setAuthorities(List<? extends GrantedAuthority> authorities) {
this.authorities = authorities; this.authorities = authorities;
} }
......
package com.jz.dmp.modules.service;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskHistoryDto;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskHistoryRequest;
import com.jz.dmp.modules.model.DmpDevelopTaskHistory;
/**
* 任务历史版本服务接口
* @author ybz
*
*/
public interface DmpDevelopTaskHistoryService {
/**条件分頁查询所有任务历史版本
* @param dmpDevelopTaskHistoryRequest
* @param httpRequest
* @return
* @throws Exception
*/
public PageInfoResponse<DmpDevelopTaskHistoryDto> findListWithPage(DmpDevelopTaskHistoryRequest dmpDevelopTaskHistoryRequest, HttpServletRequest httpRequest)throws Exception;
/**条件查询所有任务历史版本
* @param dmpDevelopTaskHistoryRequest
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DmpDevelopTaskHistoryDto> findList(DmpDevelopTaskHistoryRequest dmpDevelopTaskHistoryRequest, HttpServletRequest httpRequest)throws Exception;
/**新增任务历史版本
* @param dmpDevelopTaskHistory
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DmpDevelopTaskHistory> add(DmpDevelopTaskHistory dmpDevelopTaskHistory, HttpServletRequest httpRequest)throws Exception;
/**主键查询任务历史版本
* @param id
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DmpDevelopTaskHistoryDto> findById(Integer id, HttpServletRequest httpRequest)throws Exception;
/**修改任务历史版本
* @param dmpDevelopTaskHistory
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DmpDevelopTaskHistory> edit(DmpDevelopTaskHistory dmpDevelopTaskHistory, HttpServletRequest httpRequest)throws Exception;
/**主键删除任务历史版本
* @param id
* @param httpRequest
* @return
* @throws Exception
*/
public BaseResponse deleteById(Integer id, HttpServletRequest httpRequest)throws Exception;
/**主键软删除任务历史版本
* @param id
* @param httpRequest
* @return
* @throws Exception
*/
public BaseResponse softDeleteById(Integer id, HttpServletRequest httpRequest)throws Exception;
/**条件删除任务历史版本
* @param dmpDevelopTaskHistoryRequest
* @param httpRequest
* @return
* @throws Exception
*/
public BaseResponse delete(DmpDevelopTaskHistoryRequest dmpDevelopTaskHistoryRequest, HttpServletRequest httpRequest)throws Exception;
/**条件软删除任务历史版本
* @param dmpDevelopTaskHistoryRequest
* @param httpRequest
* @return
* @throws Exception
*/
public BaseResponse softDelete(DmpDevelopTaskHistoryRequest dmpDevelopTaskHistoryRequest, HttpServletRequest httpRequest)throws Exception;
/**
* @Title: deleteByIds
* @Description: TODO(根据主键批量删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public BaseResponse deleteByIds(List<Integer> idList, HttpServletRequest httpRequest)throws Exception;
/**
* @Title: softDeleteByIds
* @Description: TODO(根据主键批量软删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public BaseResponse softDeleteByIds(List<Integer> idList, HttpServletRequest httpRequest)throws Exception;
/**
* @Title: taskVersionRollback
* @Description: TODO(任务版本回滚)
* @param @param id
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public BaseResponse taskVersionRollback(Integer id, HttpServletRequest httpRequest)throws Exception;
}
package com.jz.dmp.modules.service; package com.jz.dmp.modules.service;
import javax.servlet.http.HttpServletRequest;
import com.jz.common.constant.JsonResult; import com.jz.common.constant.JsonResult;
import com.jz.common.page.PageInfoResponse; import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListDto; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListReq; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListReq;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskDto;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskRequest;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.model.DmpDevelopTask; import com.jz.dmp.modules.model.DmpDevelopTask;
...@@ -44,4 +48,13 @@ public interface DmpDevelopTaskService { ...@@ -44,4 +48,13 @@ public interface DmpDevelopTaskService {
* @since 2021-01-14 * @since 2021-01-14
*/ */
PageInfoResponse<DataDevExamplesListDto> queryDevExamplesListPage(DataDevExamplesListReq req) throws Exception; PageInfoResponse<DataDevExamplesListDto> queryDevExamplesListPage(DataDevExamplesListReq req) throws Exception;
/**条件分頁查询所有任务开发
* @param dmpDevelopTaskRequest
* @param httpRequest
* @return
* @throws Exception
*/
public com.jz.common.bean.PageInfoResponse<DmpDevelopTaskDto> findListWithPage(DmpDevelopTaskRequest dmpDevelopTaskRequest, HttpServletRequest httpRequest)throws Exception;
} }
\ No newline at end of file
package com.jz.dmp.modules.service; package com.jz.dmp.modules.service;
import com.jz.dmp.modules.model.DmpNavigationTree;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.dmp.modules.controller.bean.DmpNavigationTreeDto;
import com.jz.dmp.modules.controller.bean.DmpNavigationTreeRequest;
import com.jz.dmp.modules.model.DmpNavigationTree;
/** /**
* DMP资源导航树(DmpNavigationTree)表服务接口 * DMP资源导航树(DmpNavigationTree)表服务接口
* *
...@@ -35,7 +40,7 @@ public interface DmpNavigationTreeService { ...@@ -35,7 +40,7 @@ public interface DmpNavigationTreeService {
* @param dmpNavigationTree 实例对象 * @param dmpNavigationTree 实例对象
* @return 实例对象 * @return 实例对象
*/ */
DmpNavigationTree insert(DmpNavigationTree dmpNavigationTree); DmpNavigationTree insert(DmpNavigationTree dmpNavigationTree)throws Exception;
/** /**
* 修改数据 * 修改数据
...@@ -52,5 +57,14 @@ public interface DmpNavigationTreeService { ...@@ -52,5 +57,14 @@ public interface DmpNavigationTreeService {
* @return 是否成功 * @return 是否成功
*/ */
boolean deleteById(Integer id); boolean deleteById(Integer id);
/**条件查询所有DMP资源导航树
* @param dmpNavigationTreeRequest
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DmpNavigationTreeDto> findList(DmpNavigationTreeRequest dmpNavigationTreeRequest, HttpServletRequest httpRequest)throws Exception;
} }
\ No newline at end of file
package com.jz.dmp.modules.service.impl; package com.jz.dmp.modules.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; 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.constant.StatuConstant;
import com.jz.common.page.PageInfoResponse; import com.jz.common.page.PageInfoResponse;
import com.jz.common.utils.DateUtils; import com.jz.common.utils.DateUtils;
import com.jz.common.utils.JsonMapper; import com.jz.common.utils.JsonMapper;
...@@ -14,12 +29,19 @@ import com.jz.dmp.agent.DmpAgentResult; ...@@ -14,12 +29,19 @@ import com.jz.dmp.agent.DmpAgentResult;
import com.jz.dmp.azkaban.dao.ExecutionFlowsMapper; import com.jz.dmp.azkaban.dao.ExecutionFlowsMapper;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListDto; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListReq; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListReq;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskDto;
import com.jz.dmp.modules.controller.bean.DmpDevelopTaskRequest;
import com.jz.dmp.modules.controller.bean.MyDmpDevelopTaskConverter;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq; 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.DmpSyncingDatasourceTypeDao; import com.jz.dmp.modules.dao.DmpSyncingDatasourceTypeDao;
import com.jz.dmp.modules.model.*; import com.jz.dmp.modules.model.DmpAgentDatasourceInfo;
import com.jz.dmp.modules.model.DmpDevelopTask;
import com.jz.dmp.modules.model.DmpProjectSystemInfo;
import com.jz.dmp.modules.model.DmpSyncingDatasource;
import com.jz.dmp.modules.model.DmpSyncingDatasourceType;
import com.jz.dmp.modules.service.DmpDevelopTaskService; import com.jz.dmp.modules.service.DmpDevelopTaskService;
import com.jz.dmp.modules.service.DmpSyncingDatasourceService; import com.jz.dmp.modules.service.DmpSyncingDatasourceService;
import com.jz.dmp.modules.service.OfflineSynchService; import com.jz.dmp.modules.service.OfflineSynchService;
...@@ -759,6 +781,157 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService { ...@@ -759,6 +781,157 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
return pageInfoResponse; return pageInfoResponse;
} }
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpDevelopTaskService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpDevelopTaskRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public com.jz.common.bean.PageInfoResponse<DmpDevelopTaskDto> findListWithPage(DmpDevelopTaskRequest dmpDevelopTaskRequest, HttpServletRequest httpRequest)
throws Exception {
com.jz.common.bean.PageInfoResponse<DmpDevelopTaskDto> pageInfoResponse = new com.jz.common.bean.PageInfoResponse<>();
Map<String, Object> param = new HashMap<>();
//ID
if (dmpDevelopTaskRequest.getId() != null) {
param.put("id", dmpDevelopTaskRequest.getId());
}
//tree ID
if (dmpDevelopTaskRequest.getTreeId() != null) {
param.put("treeId", dmpDevelopTaskRequest.getTreeId());
}
//数据源ID
if (dmpDevelopTaskRequest.getDatasourceId() != null) {
param.put("datasourceId", dmpDevelopTaskRequest.getDatasourceId());
}
//任务类型
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getTaskType())) {
param.put("taskType", dmpDevelopTaskRequest.getTaskType());
}
//类型
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getType())) {
param.put("type", dmpDevelopTaskRequest.getType());
}
//调度类型
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getScheduleType())) {
param.put("scheduleType", dmpDevelopTaskRequest.getScheduleType());
}
//是否已提交
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getIsSubmit())) {
param.put("isSubmit", dmpDevelopTaskRequest.getIsSubmit());
}
//描述
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getTaskDesc())) {
param.put("taskDesc", dmpDevelopTaskRequest.getTaskDesc());
}
//脚本
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getScript())) {
param.put("script", dmpDevelopTaskRequest.getScript());
}
//数据状态
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getDataStatus())) {
param.put("dataStatus", dmpDevelopTaskRequest.getDataStatus());
}
//创建用户ID
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getCreateUserId())) {
param.put("createUserId", dmpDevelopTaskRequest.getCreateUserId());
}
//数据创建时间起
if (dmpDevelopTaskRequest.getCreateTimeStart() != null) {
param.put("createTimeStart", dmpDevelopTaskRequest.getCreateTimeStart());
}
//数据创建时间止
if (dmpDevelopTaskRequest.getCreateTimeEnd() != null) {
param.put("createTimeEnd", dmpDevelopTaskRequest.getCreateTimeEnd());
}
//创建用户ID
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getUpdateUserId())) {
param.put("updateUserId", dmpDevelopTaskRequest.getUpdateUserId());
}
//数据更新时间起
if (dmpDevelopTaskRequest.getUpdateTimeStart() != null) {
param.put("updateTimeStart", dmpDevelopTaskRequest.getUpdateTimeStart());
}
//数据更新时间止
if (dmpDevelopTaskRequest.getUpdateTimeEnd() != null) {
param.put("updateTimeEnd", dmpDevelopTaskRequest.getUpdateTimeEnd());
}
//校验状态:SUCCEED 成功, FAIL 失败
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getChkResult())) {
param.put("chkResult", dmpDevelopTaskRequest.getChkResult());
}
//同步状态:SUCCEED 成功,FAIL 失败
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getSyncResult())) {
param.put("syncResult", dmpDevelopTaskRequest.getSyncResult());
}
//最终校验时间起
if (dmpDevelopTaskRequest.getChkTimeStart() != null) {
param.put("chkTimeStart", dmpDevelopTaskRequest.getChkTimeStart());
}
//最终校验时间止
if (dmpDevelopTaskRequest.getChkTimeEnd() != null) {
param.put("chkTimeEnd", dmpDevelopTaskRequest.getChkTimeEnd());
}
//最终同步时间起
if (dmpDevelopTaskRequest.getSyncTimeStart() != null) {
param.put("syncTimeStart", dmpDevelopTaskRequest.getSyncTimeStart());
}
//最终同步时间止
if (dmpDevelopTaskRequest.getSyncTimeEnd() != null) {
param.put("syncTimeEnd", dmpDevelopTaskRequest.getSyncTimeEnd());
}
//
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getFlowHeader())) {
param.put("flowHeader", dmpDevelopTaskRequest.getFlowHeader());
}
//
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getFlowJson())) {
param.put("flowJson", dmpDevelopTaskRequest.getFlowJson());
}
//
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getVersion())) {
param.put("version", dmpDevelopTaskRequest.getVersion());
}
//
if (dmpDevelopTaskRequest.getIsGziped() != null) {
param.put("isGziped", dmpDevelopTaskRequest.getIsGziped());
}
//源数据库ID
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getSourceDbId())) {
param.put("sourceDbId", dmpDevelopTaskRequest.getSourceDbId());
}
//源数据库名称
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getSourceDbName())) {
param.put("sourceDbName", dmpDevelopTaskRequest.getSourceDbName());
}
//源数据表名称
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getSourceTableName())) {
param.put("sourceTableName", dmpDevelopTaskRequest.getSourceTableName());
}
//目标数据库名称
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getTargetDbName())) {
param.put("targetDbName", dmpDevelopTaskRequest.getTargetDbName());
}
//目标数据表名称
if (!StringUtils.isEmpty(dmpDevelopTaskRequest.getTargetTableName())) {
param.put("targetTableName", dmpDevelopTaskRequest.getTargetTableName());
}
PageHelper.startPage(dmpDevelopTaskRequest.getPageNum(), dmpDevelopTaskRequest.getPageSize());
List<DmpDevelopTask> list = dmpDevelopTaskDao.findList(param);
List<DmpDevelopTaskDto> dtos = MyDmpDevelopTaskConverter.INSTANCE().domain2dto(list);
PageInfo<DmpDevelopTaskDto> pageInfo = new PageInfo<>(dtos);
pageInfoResponse.setCode(StatuConstant.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
/** /**
* 数据运维-执行任务 * 数据运维-执行任务
* *
......
package com.jz.dmp.modules.service.impl; package com.jz.dmp.modules.service.impl;
import com.jz.dmp.modules.dao.DmpNavigationTreeDao; import java.util.Date;
import com.jz.dmp.modules.model.DmpNavigationTree; import java.util.List;
import com.jz.dmp.modules.service.DmpNavigationTreeService;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource; import com.jz.common.bean.BaseBeanResponse;
import java.util.List; import com.jz.common.constant.StatuConstant;
import com.jz.common.persistence.BaseService;
import com.jz.dmp.modules.controller.bean.DmpNavigationTreeDto;
import com.jz.dmp.modules.controller.bean.DmpNavigationTreeRequest;
import com.jz.dmp.modules.controller.bean.MyDmpNavigationTreeConverter;
import com.jz.dmp.modules.dao.DmpNavigationTreeDao;
import com.jz.dmp.modules.model.DmpNavigationTree;
import com.jz.dmp.modules.service.DmpNavigationTreeService;
/** /**
* DMP资源导航树(DmpNavigationTree)表服务实现类 * DMP资源导航树(DmpNavigationTree)表服务实现类
...@@ -16,7 +26,7 @@ import java.util.List; ...@@ -16,7 +26,7 @@ import java.util.List;
* @since 2020-12-29 15:08:16 * @since 2020-12-29 15:08:16
*/ */
@Service("dmpNavigationTreeService") @Service("dmpNavigationTreeService")
public class DmpNavigationTreeServiceImpl implements DmpNavigationTreeService { public class DmpNavigationTreeServiceImpl extends BaseService implements DmpNavigationTreeService {
@Autowired @Autowired
private DmpNavigationTreeDao dmpNavigationTreeDao; private DmpNavigationTreeDao dmpNavigationTreeDao;
...@@ -49,9 +59,14 @@ public class DmpNavigationTreeServiceImpl implements DmpNavigationTreeService { ...@@ -49,9 +59,14 @@ public class DmpNavigationTreeServiceImpl implements DmpNavigationTreeService {
* *
* @param dmpNavigationTree 实例对象 * @param dmpNavigationTree 实例对象
* @return 实例对象 * @return 实例对象
* @throws Exception
*/ */
@Override @Override
public DmpNavigationTree insert(DmpNavigationTree dmpNavigationTree) { public DmpNavigationTree insert(DmpNavigationTree dmpNavigationTree) throws Exception {
// 创建人
dmpNavigationTree.setCreateUserId(getHttpRequestUserId(null).toString());
// 创建时间
dmpNavigationTree.setCreateTime(new Date());
this.dmpNavigationTreeDao.insert(dmpNavigationTree); this.dmpNavigationTreeDao.insert(dmpNavigationTree);
return dmpNavigationTree; return dmpNavigationTree;
} }
...@@ -78,4 +93,76 @@ public class DmpNavigationTreeServiceImpl implements DmpNavigationTreeService { ...@@ -78,4 +93,76 @@ public class DmpNavigationTreeServiceImpl implements DmpNavigationTreeService {
public boolean deleteById(Integer id) { public boolean deleteById(Integer id) {
return this.dmpNavigationTreeDao.deleteById(id) > 0; return this.dmpNavigationTreeDao.deleteById(id) > 0;
} }
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpNavigationTreeService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpNavigationTreeRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public BaseBeanResponse<DmpNavigationTreeDto> findList(DmpNavigationTreeRequest dmpNavigationTreeRequest, HttpServletRequest httpRequest)
throws Exception {
BaseBeanResponse<DmpNavigationTreeDto> baseBeanResponse = new BaseBeanResponse<>();
DmpNavigationTree dmpNavigationTree = new DmpNavigationTree();
//ID
if (dmpNavigationTreeRequest.getId() != null) {
dmpNavigationTree.setId(dmpNavigationTreeRequest.getId());
}
//项目ID
if (dmpNavigationTreeRequest.getProjectId() != null) {
dmpNavigationTree.setProjectId(dmpNavigationTreeRequest.getProjectId());
}
//树类别
if (!StringUtils.isEmpty(dmpNavigationTreeRequest.getCategory())) {
dmpNavigationTree.setCategory(dmpNavigationTreeRequest.getCategory());
}
//树类型
if (!StringUtils.isEmpty(dmpNavigationTreeRequest.getType())) {
dmpNavigationTree.setType(dmpNavigationTreeRequest.getType());
}
//名称
if (!StringUtils.isEmpty(dmpNavigationTreeRequest.getName())) {
dmpNavigationTree.setName(dmpNavigationTreeRequest.getName());
}
//序号
if (dmpNavigationTreeRequest.getTreeSort() != null) {
dmpNavigationTree.setTreeSort(dmpNavigationTreeRequest.getTreeSort());
}
//是否叶子节点(0:否,1:是)
if (!StringUtils.isEmpty(dmpNavigationTreeRequest.getIsLevel())) {
dmpNavigationTree.setIsLevel(dmpNavigationTreeRequest.getIsLevel());
}
//是否启用(0:否,1:是)
if (!StringUtils.isEmpty(dmpNavigationTreeRequest.getIsEnable())) {
dmpNavigationTree.setIsEnable(dmpNavigationTreeRequest.getIsEnable());
}
//父节点ID
if (dmpNavigationTreeRequest.getParentId() != null) {
dmpNavigationTree.setParentId(dmpNavigationTreeRequest.getParentId());
}
//数据状态
if (!StringUtils.isEmpty(dmpNavigationTreeRequest.getDataStatus())) {
dmpNavigationTree.setDataStatus(dmpNavigationTreeRequest.getDataStatus());
}
//创建用户ID
if (!StringUtils.isEmpty(dmpNavigationTreeRequest.getCreateUserId())) {
dmpNavigationTree.setCreateUserId(dmpNavigationTreeRequest.getCreateUserId());
}
//创建用户ID
if (!StringUtils.isEmpty(dmpNavigationTreeRequest.getUpdateUserId())) {
dmpNavigationTree.setUpdateUserId(dmpNavigationTreeRequest.getUpdateUserId());
}
List<DmpNavigationTree> list = dmpNavigationTreeDao.queryAll(dmpNavigationTree);
List<DmpNavigationTreeDto> dtos = MyDmpNavigationTreeConverter.INSTANCE().domain2dto(list);
baseBeanResponse.setCode(StatuConstant.SUCCESS_CODE);
baseBeanResponse.setMessage("查询成功");
baseBeanResponse.setDatas(dtos);
return baseBeanResponse;
}
} }
\ No newline at end of file
...@@ -101,6 +101,6 @@ public interface DmpPermissionService { ...@@ -101,6 +101,6 @@ public interface DmpPermissionService {
* @throws * @throws
*/ */
public BaseBeanResponse<DmpPermissionDto> findListByParentCode(String parentCode, public BaseBeanResponse<DmpPermissionDto> findListByParentCode(String parentCode,
HttpServletRequest httpRequest)throws Exception; String type, HttpServletRequest httpRequest)throws Exception;
} }
...@@ -467,6 +467,15 @@ public class DmpMemberServiceImpl extends BaseService implements DmpMemberServic ...@@ -467,6 +467,15 @@ public class DmpMemberServiceImpl extends BaseService implements DmpMemberServic
List<DmpPermission> memberProjPermissions = dmpPermissionService.findPermissionByRoles(memberProjectRoles); List<DmpPermission> memberProjPermissions = dmpPermissionService.findPermissionByRoles(memberProjectRoles);
member.setMemberProjectPermissionList(memberProjPermissions); member.setMemberProjectPermissionList(memberProjPermissions);
List<DmpPermission> permissions = new ArrayList<DmpPermission>();
if (!CollectionUtils.isEmpty(memberProjPermissions)) {
permissions.addAll(memberProjPermissions);
}
if (!CollectionUtils.isEmpty(member.getMemberPermissionList())) {
permissions.addAll(member.getMemberPermissionList());
}
member.setPermissionList(permissions);
//修改session上用户信息 //修改session上用户信息
//生成当所有授权 //生成当所有授权
List<GrantedAuthority> grantedAuthorities = new ArrayList<GrantedAuthority>(authentication.getAuthorities()); List<GrantedAuthority> grantedAuthorities = new ArrayList<GrantedAuthority>(authentication.getAuthorities());
......
...@@ -350,7 +350,7 @@ public class DmpPermissionServiceImpl extends BaseService implements DmpPermissi ...@@ -350,7 +350,7 @@ public class DmpPermissionServiceImpl extends BaseService implements DmpPermissi
*/ */
@Override @Override
public BaseBeanResponse<DmpPermissionDto> findListByParentCode(String parentCode, public BaseBeanResponse<DmpPermissionDto> findListByParentCode(String parentCode,
HttpServletRequest httpRequest) throws Exception { String type, HttpServletRequest httpRequest) throws Exception {
BaseBeanResponse<DmpPermissionDto> baseBeanResponse = new BaseBeanResponse<>(); BaseBeanResponse<DmpPermissionDto> baseBeanResponse = new BaseBeanResponse<>();
...@@ -362,7 +362,23 @@ public class DmpPermissionServiceImpl extends BaseService implements DmpPermissi ...@@ -362,7 +362,23 @@ public class DmpPermissionServiceImpl extends BaseService implements DmpPermissi
return baseBeanResponse; return baseBeanResponse;
} }
List<DmpPermission> dmpPermissions = dmpPermissionMapper.findByRoles(currentUser.getMemberProjectRoleList()); List<DmpPermission> dmpPermissions = new ArrayList<DmpPermission>();
if ("0".equals(type)) {
dmpPermissions = dmpPermissionMapper.findByRoles(currentUser.getMemberProjectRoleList());
}else if("1".equals(type)) {
dmpPermissions = dmpPermissionMapper.findByRoles(currentUser.getMemberRoleList());
}else {
List<DmpPermission> list1 = dmpPermissionMapper.findByRoles(currentUser.getMemberProjectRoleList());
List<DmpPermission> list2 = dmpPermissionMapper.findByRoles(currentUser.getMemberRoleList());
List<DmpPermission> permissions = new ArrayList<DmpPermission>();
if (!CollectionUtils.isEmpty(list1)) {
permissions.addAll(list1);
}
if (!CollectionUtils.isEmpty(list2)) {
permissions.addAll(list2);
}
dmpPermissions = permissions;
}
//整理资源为树形结构 //整理资源为树形结构
List<DmpPermission> permissions = permissionArrangeTree(parentCode, dmpPermissions); List<DmpPermission> permissions = permissionArrangeTree(parentCode, dmpPermissions);
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.jz.dmp.modules.dao.DmpDevelopTaskDao" > <mapper namespace="com.jz.dmp.modules.dao.DmpDevelopTaskDao">
<resultMap id="DmpDevelopTaskResultMap"
type="com.jz.dmp.modules.model.DmpDevelopTask">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="task_type" property="taskType" jdbcType="CHAR" />
<result column="type" property="type" jdbcType="CHAR" />
<result column="schedule_type" property="scheduleType"
jdbcType="CHAR" />
<result column="is_submit" property="isSubmit" jdbcType="CHAR" />
<result column="task_desc" property="taskDesc"
jdbcType="VARCHAR" />
<result column="script" property="script" jdbcType="BLOB"
typeHandler="com.jz.common.persistence.CBTHandler" />
<result column="flow_json" property="flowJson" jdbcType="BLOB"
typeHandler="com.jz.common.persistence.CBTHandler" />
<result column="flow_header" property="flowHeader"
jdbcType="VARCHAR" />
<result column="version" property="version" jdbcType="VARCHAR" />
<result column="data_status" property="dataStatus"
jdbcType="CHAR" />
<result column="tree_id" property="treeId" jdbcType="INTEGER" />
<result column="is_gziped" property="isGziped" jdbcType="INTEGER" />
<!-- <result column="chk_result" property="chkResult" javaType="VARCHAR"/> -->
<!-- <result column="sync_result" property="syncResult" javaType="VARCHAR"/> -->
</resultMap>
<sql id="FIND_ALL_COLUMN">
id,task_type,type,schedule_type,is_submit,task_desc,script,data_status,create_user_id,create_time,update_user_id,update_time,tree_id,flow_header,
flow_json, version,is_gziped
</sql>
<select id="getDmpTaskAndTreeInfo" parameterType="string" resultType="map"> <select id="getDmpTaskAndTreeInfo" parameterType="string" resultType="map">
select select
...@@ -137,6 +166,25 @@ ...@@ -137,6 +166,25 @@
<if test="treeIdOrName != null and treeIdOrName != ''"> and t1.name like concat('%',#{treeIdOrName},'%') </if> <if test="treeIdOrName != null and treeIdOrName != ''"> and t1.name like concat('%',#{treeIdOrName},'%') </if>
<if test="taskType != null and taskType!= ''"> and t1.type=#{taskType} </if> <if test="taskType != null and taskType!= ''"> and t1.type=#{taskType} </if>
</select> </select>
<select id="findList" resultMap="DmpDevelopTaskResultMap">
SELECT
<include refid="FIND_ALL_COLUMN" />
FROM dmp_develop_task WHERE 1=1
<if test="taskType != null">AND task_type = #{taskType}</if>
<if test="type != null">AND type = #{type}</if>
<if test="scheduleType != null">AND schedule_type = #{scheduleType}</if>
<if test="isSubmit != null">AND is_submit = #{isSubmit}</if>
<if test="taskDesc != null">AND task_desc = #{taskDesc}</if>
<if test="script != null">AND script = #{script, jdbcType=BLOB,
typeHandler=com.jz.common.persistence.CBTHandler}</if>
<if test="dataStatus != null">AND data_status = #{dataStatus}</if>
<if test="treeId != null">AND tree_id = #{treeId}</if>
<if test="flowHeader != null">AND flow_header = #{flowHeader}</if>
<if test="flowJson != null">AND flow_json = #{flowJson}</if>
<if test="version != null">AND version = #{version}</if>
<if test="gziped != null">AND is_gziped = #{gziped}</if>
</select>
<select id="queryTaskTreeInfo" resultType="com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto"> <select id="queryTaskTreeInfo" resultType="com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto">
select select
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<!-- 封装用户项目角色信息 --> <!-- 封装用户项目角色信息 -->
<select id="getRoleNamesByUserid" resultType="java.lang.String"> <select id="getRoleNamesByUserid" resultType="java.lang.String">
select role.role_name select DISTINCT role.role_name
from dmp_member_project_role mprole left join dmp_role role on mprole.role_id = role.role_id from dmp_member_project_role mprole left join dmp_role role on mprole.role_id = role.role_id
where mprole.user_id=#{userId,jdbcType=INTEGER} where mprole.user_id=#{userId,jdbcType=INTEGER}
</select> </select>
......
...@@ -301,7 +301,7 @@ ...@@ -301,7 +301,7 @@
<!-- 项目角色用户人数统计 --> <!-- 项目角色用户人数统计 -->
<select id="projRoleStat" resultType="map"> <select id="projRoleStat" resultType="map">
select select
role.role_code AS roleCode,role.role_name AS roleName,COUNT(1) AS statCount role.role_code AS roleCode,role.role_name AS roleName,COUNT(DISTINCT member.user_id) AS statCount
from dmp_member_project_role mprole from dmp_member_project_role mprole
left join dmp_role role on mprole.role_id=role.role_id left join dmp_role role on mprole.role_id=role.role_id
left join dmp_member member on mprole.user_id=member.user_id left join dmp_member member on mprole.user_id=member.user_id
......
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