6 years ago
parent
commit
33f1b7c349
  1. 2
      tall/src/main/java/com/ccsens/tall/bean/po/ProRoleExclude.java
  2. 4
      tall/src/main/java/com/ccsens/tall/bean/po/ProRoleExcludeExample.java
  3. 6
      tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java
  4. 1
      tall/src/main/java/com/ccsens/tall/config/SpringConfig.java
  5. 8
      tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleExcludeDao.java
  6. 8
      tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleExecludeDao.java
  7. 30
      tall/src/main/java/com/ccsens/tall/persist/mapper/ProRoleExcludeMapper.java
  8. 31
      tall/src/main/java/com/ccsens/tall/persist/mapper/ProRoleExecludeMapper.java
  9. 2
      tall/src/main/java/com/ccsens/tall/service/ExcelService.java
  10. 8
      tall/src/main/java/com/ccsens/tall/service/ExcludeRoleService.java
  11. 4
      tall/src/main/java/com/ccsens/tall/service/IExcludeRoleService.java
  12. 6
      tall/src/main/java/com/ccsens/tall/service/IProRoleService.java
  13. 2
      tall/src/main/java/com/ccsens/tall/service/IProShowService.java
  14. 2
      tall/src/main/java/com/ccsens/tall/service/IProTaskDetailService.java
  15. 73
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java
  16. 17
      tall/src/main/java/com/ccsens/tall/service/ProShowService.java
  17. 59
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  18. 37
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  19. 2
      tall/src/main/java/com/ccsens/tall/web/DebugController.java
  20. 2
      tall/src/main/java/com/ccsens/tall/web/DomainController.java
  21. 4
      tall/src/main/resources/application.yml
  22. 18
      tall/src/main/resources/mapper_raw/ProRoleExcludeMapper.xml

2
tall/src/main/java/com/ccsens/tall/bean/po/ProRoleExeclude.java → tall/src/main/java/com/ccsens/tall/bean/po/ProRoleExclude.java

@ -3,7 +3,7 @@ package com.ccsens.tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class ProRoleExeclude implements Serializable {
public class ProRoleExclude implements Serializable {
private Long id;
private Long roleId;

4
tall/src/main/java/com/ccsens/tall/bean/po/ProRoleExecludeExample.java → tall/src/main/java/com/ccsens/tall/bean/po/ProRoleExcludeExample.java

@ -4,14 +4,14 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ProRoleExecludeExample {
public class ProRoleExcludeExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public ProRoleExecludeExample() {
public ProRoleExcludeExample() {
oredCriteria = new ArrayList<Criteria>();
}

6
tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java

@ -89,10 +89,8 @@ public class TaskVo {
private Long endTime;
@ApiModelProperty("时长")
private Long duration;
@ApiModelProperty("显示的开始时间")
private String showBeginTime;
@ApiModelProperty("显示的结束时间")
private String showEndTime;
@ApiModelProperty("显示的日期格式")
private String showTimeFormat;
@ApiModelProperty("循环周期")
private String cycle;
@ApiModelProperty("跳转模式 -1手动,0自动,1延迟")

1
tall/src/main/java/com/ccsens/tall/config/SpringConfig.java

@ -101,6 +101,7 @@ public class SpringConfig implements WebMvcConfigurer {
/**
* 配置静态资源
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/upload/**")
.addResourceLocations("classpath:/upload/");

8
tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleExcludeDao.java

@ -0,0 +1,8 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.persist.mapper.ProRoleExcludeMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface ProRoleExcludeDao extends ProRoleExcludeMapper {
}

8
tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleExecludeDao.java

@ -1,8 +0,0 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.persist.mapper.ProRoleExecludeMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface ProRoleExecludeDao extends ProRoleExecludeMapper{
}

30
tall/src/main/java/com/ccsens/tall/persist/mapper/ProRoleExcludeMapper.java

@ -0,0 +1,30 @@
package com.ccsens.tall.persist.mapper;
import com.ccsens.tall.bean.po.ProRoleExclude;
import com.ccsens.tall.bean.po.ProRoleExcludeExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ProRoleExcludeMapper {
long countByExample(ProRoleExcludeExample example);
int deleteByExample(ProRoleExcludeExample example);
int deleteByPrimaryKey(Long id);
int insert(ProRoleExclude record);
int insertSelective(ProRoleExclude record);
List<ProRoleExclude> selectByExample(ProRoleExcludeExample example);
ProRoleExclude selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") ProRoleExclude record, @Param("example") ProRoleExcludeExample example);
int updateByExample(@Param("record") ProRoleExclude record, @Param("example") ProRoleExcludeExample example);
int updateByPrimaryKeySelective(ProRoleExclude record);
int updateByPrimaryKey(ProRoleExclude record);
}

31
tall/src/main/java/com/ccsens/tall/persist/mapper/ProRoleExecludeMapper.java

@ -1,31 +0,0 @@
package com.ccsens.tall.persist.mapper;
import com.ccsens.tall.bean.po.ProRoleExeclude;
import com.ccsens.tall.bean.po.ProRoleExecludeExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ProRoleExecludeMapper {
long countByExample(ProRoleExecludeExample example);
int deleteByExample(ProRoleExecludeExample example);
int deleteByPrimaryKey(Long id);
int insert(ProRoleExeclude record);
int insertSelective(ProRoleExeclude record);
List<ProRoleExeclude> selectByExample(ProRoleExecludeExample example);
ProRoleExeclude selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") ProRoleExeclude record, @Param("example") ProRoleExecludeExample example);
int updateByExample(@Param("record") ProRoleExeclude record, @Param("example") ProRoleExecludeExample example);
int updateByPrimaryKeySelective(ProRoleExeclude record);
int updateByPrimaryKey(ProRoleExeclude record);
}

2
tall/src/main/java/com/ccsens/tall/service/ExcelService.java

@ -359,7 +359,7 @@ public class ExcelService implements IExcelService {
if (ObjectUtil.isNotNull(excludeRoleCells)) {
for (int a = 0; a < excludeRoleCells.length; a++) {
ProRoleExeclude excludeRole = new ProRoleExeclude();
ProRoleExclude excludeRole = new ProRoleExclude();
excludeRole.setId(snowflake.nextId());
excludeRole.setRoleId(proRoleId);
if (CollectionUtil.isNotEmpty(proRoles)) {

8
tall/src/main/java/com/ccsens/tall/service/ExcludeRoleService.java

@ -1,7 +1,7 @@
package com.ccsens.tall.service;
import com.ccsens.tall.bean.po.ProRoleExeclude;
import com.ccsens.tall.persist.dao.ProRoleExecludeDao;
import com.ccsens.tall.bean.po.ProRoleExclude;
import com.ccsens.tall.persist.dao.ProRoleExcludeDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -13,9 +13,9 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public class ExcludeRoleService implements IExcludeRoleService{
@Autowired
private ProRoleExecludeDao proRoleExecludeDao;
private ProRoleExcludeDao proRoleExecludeDao;
@Override
public void saveExcludeRole(ProRoleExeclude excludeRole) {
public void saveExcludeRole(ProRoleExclude excludeRole) {
proRoleExecludeDao.insertSelective(excludeRole);
}
}

4
tall/src/main/java/com/ccsens/tall/service/IExcludeRoleService.java

@ -1,7 +1,7 @@
package com.ccsens.tall.service;
import com.ccsens.tall.bean.po.ProRoleExeclude;
import com.ccsens.tall.bean.po.ProRoleExclude;
public interface IExcludeRoleService {
void saveExcludeRole(ProRoleExeclude excludeRole);
void saveExcludeRole(ProRoleExclude excludeRole);
}

6
tall/src/main/java/com/ccsens/tall/service/IProRoleService.java

@ -16,11 +16,13 @@ public interface IProRoleService {
List<ProjectVo.RoleInfo> getRealMemberRolesByProjectId(Long projectId);
int selectPowerByRoleName(List<ProRole> roles);
int selectPowerByRoleName(Long userId,Long projectId);
TaskVo.RoleCheckList selectRoleByCheckOrExecutor(Long executorRole);
ProRole getAllMember(Long projectId);
void deleteRoleByProjectId(Long userId,Long projectId);
void deleteRole(Long userId,Long roleId);
void deleteRoleByProjectId(Long projectId);
}

2
tall/src/main/java/com/ccsens/tall/service/IProShowService.java

@ -4,4 +4,6 @@ import com.ccsens.tall.bean.po.ProShow;
public interface IProShowService{
void saveProShow(ProShow proShow);
ProShow selectByProjectId(Long projectId)throws Exception;
}

2
tall/src/main/java/com/ccsens/tall/service/IProTaskDetailService.java

@ -22,5 +22,5 @@ public interface IProTaskDetailService {
void deleteTask(Long currentUserId,Long taskId);
void deleteTaskByTaskId(Long taskId);
void deleteTaskByRoleId(Long taskId);
}

73
tall/src/main/java/com/ccsens/tall/service/ProRoleService.java

@ -2,15 +2,13 @@ package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.tall.bean.po.ProMember;
import com.ccsens.tall.bean.po.ProRole;
import com.ccsens.tall.bean.po.ProRoleExample;
import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.bean.vo.TaskVo;
import com.ccsens.tall.persist.dao.ProMemberDao;
import com.ccsens.tall.persist.dao.ProMemberRoleDao;
import com.ccsens.tall.persist.dao.ProRoleDao;
import com.ccsens.tall.persist.dao.*;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -28,8 +26,16 @@ public class ProRoleService implements IProRoleService {
@Autowired
private ProMemberDao proMemberDao;
@Autowired
private ProMemberRoleDao memberRoleDao;
@Autowired
private ProRoleExcludeDao excludeDao;
@Autowired
private SysProjectDao projectDao;
@Autowired
private IProMemberService proMemberService;
@Autowired
private IProTaskDetailService taskDetailService;
@Autowired
private IUserService userService;
@Override
@ -151,12 +157,16 @@ public class ProRoleService implements IProRoleService {
/**
* 获取用户在项目中的最高权限
* @param roles 用户在项目中所属的一级角色的名字
* @return
*/
@Override
public int selectPowerByRoleName(List<ProRole> roles) {
public int selectPowerByRoleName(Long userId,Long projectId) {
int power = 0;
SysProject project = projectDao.selectByPrimaryKey(projectId);
if(project.getCreatorId().longValue() == userId){
power = 2;
}
List<ProRole> roles = getProRoleByProjectIdAndUserId(projectId,userId);
if(CollectionUtil.isNotEmpty(roles)){
for(ProRole role:roles){
int i = proRoleDao.selectPowerByRoleName(role.getDescription());
@ -201,12 +211,53 @@ public class ProRoleService implements IProRoleService {
* 删除角色
*/
@Override
public void deleteRoleByProjectId(Long userId,Long roleId) {
public void deleteRole(Long userId,Long roleId){
ProRole role = proRoleDao.selectByPrimaryKey(roleId);
//本用户在项目中的角色
List<ProRole> proRoles = getProRoleByProjectIdAndUserId(role.getProjectId(), userId);
//用户在项目中的最高权限
int power = selectPowerByRoleName(userId,role.getProjectId());
if (power > 1) {
deleteRoleByRoleId(roleId);
} else {
throw new BaseException(CodeEnum.NOT_POWER);
}
}
/**
* 删除项目下的所有角色
*/
@Override
public void deleteRoleByProjectId(Long projectId) {
ProRoleExample roleExample = new ProRoleExample();
roleExample.createCriteria().andProjectIdEqualTo(roleId);
roleExample.createCriteria().andProjectIdEqualTo(projectId);
List<ProRole> roleList = proRoleDao.selectByExample(roleExample);
if(CollectionUtil.isNotEmpty(roleList)){
for(ProRole role:roleList){
deleteRoleByRoleId(role.getId());
}
}
}
private void deleteRoleByRoleId(Long roleId){
//删除角色下的任务
taskDetailService.deleteTaskByRoleId(roleId);
//删除成员和成员角色关联表
ProMemberRoleExample memberRoleExample = new ProMemberRoleExample();
memberRoleExample.createCriteria().andRoleIdEqualTo(roleId);
List<ProMemberRole> memberRoleList = memberRoleDao.selectByExample(memberRoleExample);
if(CollectionUtil.isNotEmpty(memberRoleList)){
for(ProMemberRole memberRole:memberRoleList){
proMemberDao.deleteByPrimaryKey(memberRole.getMemberId());
memberRoleDao.deleteByPrimaryKey(memberRole.getId());
}
}
//删除对谁不可见
ProRoleExcludeExample excludeExample = new ProRoleExcludeExample();
excludeExample.createCriteria().andRoleIdEqualTo(roleId);
excludeDao.deleteByExample(excludeExample);
//删除角色
proRoleDao.deleteByPrimaryKey(roleId);
}
}

17
tall/src/main/java/com/ccsens/tall/service/ProShowService.java

@ -1,10 +1,14 @@
package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.tall.bean.po.ProShow;
import com.ccsens.tall.bean.po.ProShowExample;
import com.ccsens.tall.persist.dao.ProShowDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ProShowService implements IProShowService{
@Autowired
@ -14,4 +18,17 @@ public class ProShowService implements IProShowService{
public void saveProShow(ProShow proShow) {
proShowDao.insertSelective(proShow);
}
@Override
public ProShow selectByProjectId(Long projectId) throws Exception {
ProShow proShow = null;
ProShowExample proShowExample = new ProShowExample();
proShowExample.createCriteria().andProjectIdEqualTo(projectId);
List<ProShow> proShowList = proShowDao.selectByExample(proShowExample);
if(CollectionUtil.isNotEmpty(proShowList)){
proShow = proShowList.get(0);
}
return proShow;
}
}

59
tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java

@ -14,6 +14,7 @@ import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -36,6 +37,8 @@ public class ProTaskDetailService implements IProTaskDetailService {
@Autowired
private IProMemberService proMemberService;
@Autowired
private IProShowService proShowService;
@Autowired
private TaskDetailDao taskDetailDao;
@Autowired
private TaskSubTimeDao taskSubTimeDao;
@ -93,6 +96,8 @@ public class ProTaskDetailService implements IProTaskDetailService {
* 查看任务 项目经理
*/
private TaskVo.ProTaskInfo getTaskInfoByProjectIdAndPM(Long currentUserId, Long projectId, Long startTime, Long endTime, Integer process, Integer page, Integer pageSize) throws Exception {
ProShow proShow = proShowService.selectByProjectId(projectId);
TaskVo.ProTaskInfo proTaskInfo = new TaskVo.ProTaskInfo();
List<TaskVo.GlobalTask> globalTaskList = new ArrayList<>();
List<TaskVo.NormalTask> normalTaskList = new ArrayList<>();
@ -123,6 +128,14 @@ public class ProTaskDetailService implements IProTaskDetailService {
task.setRealEndTime(subTimeMember.getRealFinishTime());
task.setProcess(subTimeMember.getComplatedStatus());
}
if(ObjectUtil.isNotNull(proShow)){
task.setShowTimeFormat(proShow.getTimeShow());
if(proShow.getDuration() == 1){
task.setDuration(null);
}
}else {
task.setShowTimeFormat("MM-dd HH:mm");
}
}
TaskUtil.Task task = TaskUtil.splitTask(secondNormalTaskList, startTime, endTime, process);
if (CollectionUtil.isNotEmpty(task.getGlobalTask())) {
@ -157,6 +170,8 @@ public class ProTaskDetailService implements IProTaskDetailService {
* 查看任务 项目成员
*/
private TaskVo.ProTaskInfo getTaskInfoByProjectIdAndRoleId(Long currentUserId, Long projectId, Long roleId, Long startTime, Long endTime, Integer process, Integer page, Integer pageSize) throws Exception {
ProShow proShow = proShowService.selectByProjectId(projectId);
TaskVo.ProTaskInfo proTaskInfo = new TaskVo.ProTaskInfo();
List<TaskVo.GlobalTask> globalTaskList = new ArrayList<>();
List<TaskVo.NormalTask> normalTaskList = new ArrayList<>();
@ -176,6 +191,14 @@ public class ProTaskDetailService implements IProTaskDetailService {
normalTask.setProcess(subTimeMember.getComplatedStatus());
normalTask.setRealEndTime(subTimeMember.getRealFinishTime());
}
if(ObjectUtil.isNotNull(proShow)){
normalTask.setShowTimeFormat(proShow.getTimeShow());
if(proShow.getDuration() == 1){
normalTask.setDuration(null);
}
}else {
normalTask.setShowTimeFormat("MM-dd HH:mm");
}
}
TaskUtil.Task task = TaskUtil.splitTask(secondTaskVoList, startTime, endTime, process);
if (CollectionUtil.isNotEmpty(task.getGlobalTask())) {
@ -380,6 +403,8 @@ public class ProTaskDetailService implements IProTaskDetailService {
*/
@Override
public TaskVo.NormalTask getTaskInfoByTaskId(Long currentUserId, Long projectId, Long taskId) throws Exception {
ProShow proShow = proShowService.selectByProjectId(projectId);
ProTaskSubTime subTime = taskSubTimeDao.selectByPrimaryKey(taskId);
TaskVo.NormalTask taskDetail = null;
if (ObjectUtil.isNotNull(subTime)) {
@ -390,6 +415,15 @@ public class ProTaskDetailService implements IProTaskDetailService {
taskDetail.setProcess(subTimeMember.getComplatedStatus());
taskDetail.setRealEndTime(subTimeMember.getRealFinishTime());
}
//显示的日期格式和时长格式
if(ObjectUtil.isNotNull(proShow)){
taskDetail.setShowTimeFormat(proShow.getTimeShow());
if(proShow.getDuration() == 1){
taskDetail.setDuration(null);
}
}else {
taskDetail.setShowTimeFormat("MM-dd HH:mm");
}
//添加项目信息和插件信息
normalTaskAddPlugin(currentUserId, subTime.getTaskDetailId(), taskDetail);
if (ObjectUtil.isNotNull(taskDetail)) {
@ -403,6 +437,15 @@ public class ProTaskDetailService implements IProTaskDetailService {
groupTask.setProcess(proSubTimeMember.getComplatedStatus());
groupTask.setRealEndTime(proSubTimeMember.getRealFinishTime());
}
//显示的日期格式和时长格式
if(ObjectUtil.isNotNull(proShow)){
groupTask.setShowTimeFormat(proShow.getTimeShow());
if(proShow.getDuration() == 1){
groupTask.setDuration(null);
}
}else {
groupTask.setShowTimeFormat("MM-dd HH:mm");
}
//添加项目信息和插件信息
normalTaskAddPlugin(currentUserId, groupTask.getDetailId(), groupTask);
//修改返回时子任务的名字(“任务名+(xx和XX)”)
@ -461,6 +504,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
return name;
}
/**
* 任务清单
*/
@ -773,7 +817,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
//本用户在项目中的角色
List<ProRole> proRoles = proRoleService.getProRoleByProjectIdAndUserId(taskDetail.getProjectId(), currentUserId);
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(proRoles);
int power = proRoleService.selectPowerByRoleName(currentUserId,taskDetail.getProjectId());
if (power > 1) {
if (ObjectUtil.isNotNull(taskDetail)) {
deleteTaskByTaskId(taskDetail.getId());
@ -784,7 +828,18 @@ public class ProTaskDetailService implements IProTaskDetailService {
}
@Override
public void deleteTaskByTaskId(Long taskId) {
public void deleteTaskByRoleId(Long roleId) {
ProTaskDetailExample taskDetailExample = new ProTaskDetailExample();
taskDetailExample.createCriteria().andExecutorRoleEqualTo(roleId);
List<ProTaskDetail> detailList = taskDetailDao.selectByExample(taskDetailExample);
if(CollectionUtil.isNotEmpty(detailList)){
for(ProTaskDetail taskDetail:detailList){
deleteTaskByTaskId(taskDetail.getId());
}
}
}
private void deleteTaskByTaskId(Long taskId) {
//1、删除交付物相关信息
taskDeliverService.deleteDeliverByTaskId(taskId);
//2、删除插件

37
tall/src/main/java/com/ccsens/tall/service/ProjectService.java

@ -31,7 +31,7 @@ public class ProjectService implements IProjectService {
@Autowired
private SysProjectDao sysProjectDao;
@Autowired
private ProRoleExecludeDao roleExecludeDao;
private ProRoleExcludeDao roleExcludeDao;
@Autowired
private ProRoleDao proRoleDao;
@Autowired
@ -197,7 +197,7 @@ public class ProjectService implements IProjectService {
projectInfo.getRoles().add(WebConstant.ROLE_NAME.Attention.phase);
}
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(proRoles);
int power = proRoleService.selectPowerByRoleName(currentUserId,project.getId());
projectInfo.setPower(power);
projectInfoList.add(projectInfo);
@ -235,7 +235,7 @@ public class ProjectService implements IProjectService {
projectInfo.getRoles().add(WebConstant.ROLE_NAME.Attention.phase);
}
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(proRoles);
int power = proRoleService.selectPowerByRoleName(userId,projectId);
projectInfo.setPower(power);
//获取项目配置
ProShowExample proShowExample = new ProShowExample();
@ -377,14 +377,14 @@ public class ProjectService implements IProjectService {
//本用户在项目中的角色
List<ProRole> proRoles = proRoleService.getProRoleByProjectIdAndUserId(projectId, currentUserId);
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(proRoles);
int power = proRoleService.selectPowerByRoleName(currentUserId,projectId);
if(power>1){
//修改项目状态
SysProject project = sysProjectDao.selectByPrimaryKey(projectId);
project.setRecStatus((byte) 1);
sysProjectDao.updateByPrimaryKeySelective(project);
// //修改项目状态
// SysProject project = sysProjectDao.selectByPrimaryKey(projectId);
// project.setRecStatus((byte) 1);
// sysProjectDao.updateByPrimaryKeySelective(project);
//彻底删除项目
deleteProjectById(projectId);
}else {
throw new BaseException(CodeEnum.NOT_POWER);
}
@ -393,7 +393,14 @@ public class ProjectService implements IProjectService {
* 删除项目
*/
private void deleteProjectById(Long projectId){
//删除任务下的角色
proRoleService.deleteRoleByProjectId(projectId);
//删除这个项目被关注的信息
UserAttentionExample attentionExample = new UserAttentionExample();
attentionExample.createCriteria().andProjectIdEqualTo(projectId);
attentionDao.deleteByExample(attentionExample);
//删除项目
sysProjectDao.deleteByPrimaryKey(projectId);
}
/**
@ -475,15 +482,15 @@ public class ProjectService implements IProjectService {
private void copyRoleExeclude(List<ProRole> oldRoleList, Map<Long,String> oldRoleMap, Map<String,Long> newRoleMap){
if(CollectionUtil.isNotEmpty(oldRoleList)) {
for (ProRole oldRole : oldRoleList) {
ProRoleExecludeExample execludeExample = new ProRoleExecludeExample();
ProRoleExcludeExample execludeExample = new ProRoleExcludeExample();
execludeExample.createCriteria().andRoleIdEqualTo(oldRole.getId());
List<ProRoleExeclude> roleExecludeList = roleExecludeDao.selectByExample(execludeExample);
List<ProRoleExclude> roleExecludeList = roleExcludeDao.selectByExample(execludeExample);
if(CollectionUtil.isNotEmpty(roleExecludeList)){
for(ProRoleExeclude roleExeclude:roleExecludeList){
ProRoleExeclude newRoleExeclude = new ProRoleExeclude();
for(ProRoleExclude roleExeclude:roleExecludeList){
ProRoleExclude newRoleExeclude = new ProRoleExclude();
newRoleExeclude.setRoleId(newRoleMap.get(oldRoleMap.get(roleExeclude.getRoleId())));
newRoleExeclude.setOtherRoleId(newRoleMap.get(oldRoleMap.get(roleExeclude.getRoleId())));
roleExecludeDao.insertSelective(newRoleExeclude);
roleExcludeDao.insertSelective(newRoleExeclude);
}
}
}

2
tall/src/main/java/com/ccsens/tall/web/DebugController.java

@ -1,6 +1,5 @@
package com.ccsens.tall.web;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
@ -10,7 +9,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
@Api(tags = "DEBUG" , description = "DebugController | ")
@RestController

2
tall/src/main/java/com/ccsens/tall/web/DomainController.java

@ -31,6 +31,6 @@ public class DomainController {
public JsonResponse<DomainVo.DomainInfo> getDomainByName(HttpServletRequest request,
@RequestParam(required = true) String domainName) throws Exception {
DomainVo.DomainInfo domainInfo = domainService.getDomainByName(domainName);
return JsonResponse.newInstance().ok();
return JsonResponse.newInstance().ok(domainInfo);
}
}

4
tall/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: dev
include: util-dev,common
active: test
include: util-test,common

18
tall/src/main/resources/mapper_raw/ProRoleExecludeMapper.xml → tall/src/main/resources/mapper_raw/ProRoleExcludeMapper.xml

@ -1,7 +1,7 @@
<?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.ccsens.tall.persist.mapper.ProRoleExecludeMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.ProRoleExeclude">
<mapper namespace="com.ccsens.tall.persist.mapper.ProRoleExcludeMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.ProRoleExclude">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="role_id" jdbcType="BIGINT" property="roleId" />
<result column="other_role_id" jdbcType="BIGINT" property="otherRoleId" />
@ -70,7 +70,7 @@
<sql id="Base_Column_List">
id, role_id, other_role_id, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProRoleExecludeExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProRoleExcludeExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
@ -94,13 +94,13 @@
delete from t_pro_role_execlude
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.ProRoleExecludeExample">
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.ProRoleExcludeExample">
delete from t_pro_role_execlude
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.ProRoleExeclude">
<insert id="insert" parameterType="com.ccsens.tall.bean.po.ProRoleExclude">
insert into t_pro_role_execlude (id, role_id, other_role_id,
created_at, updated_at, rec_status
)
@ -108,7 +108,7 @@
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProRoleExeclude">
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProRoleExclude">
insert into t_pro_role_execlude
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -151,7 +151,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.ProRoleExecludeExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.ProRoleExcludeExample" resultType="java.lang.Long">
select count(*) from t_pro_role_execlude
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
@ -195,7 +195,7 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.ProRoleExeclude">
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.ProRoleExclude">
update t_pro_role_execlude
<set>
<if test="roleId != null">
@ -216,7 +216,7 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.ProRoleExeclude">
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.ProRoleExclude">
update t_pro_role_execlude
set role_id = #{roleId,jdbcType=BIGINT},
other_role_id = #{otherRoleId,jdbcType=BIGINT},
Loading…
Cancel
Save