Commit 1d492b05 authored by sml's avatar sml

冲突解决

parent 2e1988ce
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;
import javax.servlet.http.HttpServletRequest;
import com.jz.common.constant.JsonResult;
import com.jz.common.page.PageInfoResponse;
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.DataDevTaskListReq;
import com.jz.dmp.modules.model.DmpDevelopTask;
......@@ -25,4 +29,21 @@ public interface DmpDevelopTaskService {
* @since 2021-01-13
*/
PageInfoResponse<DataDevTaskListDto> queryDevTaskListPage(DataDevTaskListReq req) throws Exception;
/**
* 数据运维-执行任务
*
* @return
* @author Bellamy
*/
JsonResult runTaskByTaskId(String taskId) 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;
import com.jz.dmp.modules.model.DmpNavigationTree;
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)表服务接口
*
......@@ -35,7 +40,7 @@ public interface DmpNavigationTreeService {
* @param dmpNavigationTree 实例对象
* @return 实例对象
*/
DmpNavigationTree insert(DmpNavigationTree dmpNavigationTree);
DmpNavigationTree insert(DmpNavigationTree dmpNavigationTree)throws Exception;
/**
* 修改数据
......@@ -52,5 +57,14 @@ public interface DmpNavigationTreeService {
* @return 是否成功
*/
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;
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.PageInfo;
import com.jz.agent.service.DmpDsAgentService;
import com.jz.common.constant.JsonResult;
import com.jz.common.constant.ResultCode;
import com.jz.common.constant.StatuConstant;
import com.jz.common.page.PageInfoResponse;
import com.jz.common.utils.JsonMapper;
import com.jz.common.utils.StringUtils;
import com.jz.common.utils.web.XmlUtils;
import com.jz.dmp.agent.DmpAgentResult;
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.DataDevTaskListReq;
import com.jz.dmp.modules.dao.DmpDevelopTaskDao;
import com.jz.dmp.modules.dao.DmpProjectDao;
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.DmpSyncingDatasourceService;
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 java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import com.jz.dmp.modules.service.OfflineSynchService;
/**
* 任务开发(DmpDevelopTask)表服务实现类
......@@ -57,6 +69,9 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
@Autowired
private DmpSyncingDatasourceService dmpSyncingDatasourceService;
@Autowired
private OfflineSynchService offlineSynchService;
/**
* 添加保存dmp数据(包含校验数据)
*
......@@ -733,9 +748,9 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
if (pattern.matcher(req.getTreeIdOrName().trim()).matches()) {
req.setTreeId(req.getTreeIdOrName()); //id
req.setTreeIdOrName(null);
} else {
req.setTreeIdOrName(req.getTreeIdOrName().trim());//节点名称
req.setTreeId(null);
}
}
......@@ -748,4 +763,167 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
/**
* 数据运维-执行任务
*
* @return
* @author Bellamy
*/
@Override
public JsonResult runTaskByTaskId(String taskId) throws Exception {
return offlineSynchService.taskRunNowByTaskId(taskId);
}
/*
* (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;
}
}
\ No newline at end of file
package com.jz.dmp.modules.service.impl;
import com.jz.dmp.modules.dao.DmpNavigationTreeDao;
import com.jz.dmp.modules.model.DmpNavigationTree;
import com.jz.dmp.modules.service.DmpNavigationTreeService;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.List;
import com.jz.common.bean.BaseBeanResponse;
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)表服务实现类
......@@ -16,7 +26,7 @@ import java.util.List;
* @since 2020-12-29 15:08:16
*/
@Service("dmpNavigationTreeService")
public class DmpNavigationTreeServiceImpl implements DmpNavigationTreeService {
public class DmpNavigationTreeServiceImpl extends BaseService implements DmpNavigationTreeService {
@Autowired
private DmpNavigationTreeDao dmpNavigationTreeDao;
......@@ -49,9 +59,14 @@ public class DmpNavigationTreeServiceImpl implements DmpNavigationTreeService {
*
* @param dmpNavigationTree 实例对象
* @return 实例对象
* @throws Exception
*/
@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);
return dmpNavigationTree;
}
......@@ -78,4 +93,76 @@ public class DmpNavigationTreeServiceImpl implements DmpNavigationTreeService {
public boolean deleteById(Integer id) {
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 {
* @throws
*/
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
List<DmpPermission> memberProjPermissions = dmpPermissionService.findPermissionByRoles(memberProjectRoles);
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上用户信息
//生成当所有授权
List<GrantedAuthority> grantedAuthorities = new ArrayList<GrantedAuthority>(authentication.getAuthorities());
......
......@@ -350,7 +350,7 @@ public class DmpPermissionServiceImpl extends BaseService implements DmpPermissi
*/
@Override
public BaseBeanResponse<DmpPermissionDto> findListByParentCode(String parentCode,
HttpServletRequest httpRequest) throws Exception {
String type, HttpServletRequest httpRequest) throws Exception {
BaseBeanResponse<DmpPermissionDto> baseBeanResponse = new BaseBeanResponse<>();
......@@ -362,7 +362,23 @@ public class DmpPermissionServiceImpl extends BaseService implements DmpPermissi
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);
......
This diff is collapsed.
<?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" >
<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
......@@ -119,41 +148,42 @@
<!--数据运维-数据开发任务列表分页查询-->
<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
date_format(t1.update_time,'%Y-%m-%d %H:%i:%s') as updateTime,
t3.real_name as userName
from
dmp_navigation_tree t1
left join dmp_develop_task t2 on t2.TREE_ID=t1.ID
where 1=1
left join dmp_member t3 on t1.create_user_id=t3.user_id
where 1=1 and t1.type='01'
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>
<if test="treeId != null and treeId != ''"> and t1.id =#{treeId} </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>
</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>
</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