|
|
@ -7,7 +7,6 @@ import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.ccsens.tall.bean.dto.ProjectDto; |
|
|
|
import com.ccsens.tall.bean.po.*; |
|
|
|
import com.ccsens.tall.bean.vo.DomainVo; |
|
|
|
import com.ccsens.tall.bean.vo.LabelVo; |
|
|
|
import com.ccsens.tall.bean.vo.ProjectVo; |
|
|
|
import com.ccsens.tall.persist.dao.*; |
|
|
@ -20,11 +19,11 @@ import com.ccsens.util.exception.BaseException; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
@ -32,31 +31,31 @@ import java.util.*; |
|
|
|
@Service |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
|
|
|
public class ProjectService implements IProjectService { |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private SysProjectDao sysProjectDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private ProShowDao proShowDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private ProRoleExcludeDao roleExcludeDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private ProRoleDao proRoleDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private TaskDetailDao taskDetailDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private TaskSubTimeDao taskSubTimeDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private UserAttentionDao attentionDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private TaskPluginDao pluginDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private TaskDeliverDao taskDeliverDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private IProRoleService proRoleService; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private Snowflake snowflake; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private SysDomainDao sysDomainDao; |
|
|
|
@Autowired |
|
|
|
@Resource |
|
|
|
private SysLabelDao sysLabelDao; |
|
|
|
|
|
|
|
@Override |
|
|
@ -71,13 +70,12 @@ public class ProjectService implements IProjectService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据名字查找此用户创建的项目 |
|
|
|
* |
|
|
|
* @param subProject |
|
|
|
* @param currentUserId |
|
|
|
* @return |
|
|
|
* @param subProject 项目名 |
|
|
|
* @param currentUserId userId |
|
|
|
* @return 项目信息 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public SysProject selectByNameAndUserId(String subProject, Long currentUserId) throws Exception { |
|
|
|
public SysProject selectByNameAndUserId(String subProject, Long currentUserId) { |
|
|
|
SysProject project = new SysProject(); |
|
|
|
SysProjectExample projectExample = new SysProjectExample(); |
|
|
|
projectExample.createCriteria().andCreatorIdEqualTo(currentUserId).andNameEqualTo(subProject); |
|
|
@ -90,10 +88,9 @@ public class ProjectService implements IProjectService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 查找本月哪一天有项目 |
|
|
|
* |
|
|
|
* @param currentUserId |
|
|
|
* @param date |
|
|
|
* @return |
|
|
|
* @param currentUserId userId |
|
|
|
* @param date 日期 |
|
|
|
* @return 返回有项目的日期 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<String> haveProjectDay(Long currentUserId, String date) throws Exception { |
|
|
@ -109,13 +106,13 @@ public class ProjectService implements IProjectService { |
|
|
|
for (SysProject sysProject : projectList) { |
|
|
|
startMillisTime = sysProject.getBeginTime() > startMillisTime ? sysProject.getBeginTime() : startMillisTime; |
|
|
|
endMillisTime = sysProject.getEndTime() < endMillisTime ? sysProject.getEndTime() : endMillisTime; |
|
|
|
dateList = getTimeList(dateList, startMillisTime, endMillisTime); |
|
|
|
getTimeList(dateList, startMillisTime, endMillisTime); |
|
|
|
} |
|
|
|
} |
|
|
|
return dateList; |
|
|
|
} |
|
|
|
|
|
|
|
private List<String> getTimeList(List<String> dateList, Long startTime, Long endTime) { |
|
|
|
private void getTimeList(List<String> dateList, Long startTime, Long endTime) { |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("dd"); |
|
|
|
Date s = new Date(startTime); |
|
|
|
Date e = new Date(endTime); |
|
|
@ -133,7 +130,6 @@ public class ProjectService implements IProjectService { |
|
|
|
} |
|
|
|
curr.add(Calendar.DATE, 1); |
|
|
|
} |
|
|
|
return dateList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -193,10 +189,18 @@ public class ProjectService implements IProjectService { |
|
|
|
ProjectVo.ProjectConfig projectConfig = new ProjectVo.ProjectConfig(); |
|
|
|
projectInfo.setProjectConfig(projectConfig); |
|
|
|
} |
|
|
|
//查找项目未处理的消息数量
|
|
|
|
ProjectVo.ProjectUnreadMsg unreadMsg = getUnreadMsgByProject(currentUserId,projectInfo.getId()); |
|
|
|
projectInfo.setProjectUnreadMsg(unreadMsg); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private ProjectVo.ProjectUnreadMsg getUnreadMsgByProject(Long userId,Long projectId) { |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
private List<ProjectVo.ProjectInfo> projectInfoByProject(List<SysProject> projectList, Long currentUserId) { |
|
|
|
List<ProjectVo.ProjectInfo> projectInfoList = new ArrayList<>(); |
|
|
|
if (CollectionUtil.isNotEmpty(projectList)) { |
|
|
@ -587,6 +591,7 @@ public class ProjectService implements IProjectService { |
|
|
|
if (CollectionUtil.isNotEmpty(roleExecludeList)) { |
|
|
|
for (ProRoleExclude roleExeclude : roleExecludeList) { |
|
|
|
ProRoleExclude newRoleExeclude = new ProRoleExclude(); |
|
|
|
newRoleExeclude.setId(snowflake.nextId()); |
|
|
|
newRoleExeclude.setRoleId(newRoleMap.get(oldRoleMap.get(roleExeclude.getRoleId()))); |
|
|
|
newRoleExeclude.setOtherRoleId(newRoleMap.get(oldRoleMap.get(roleExeclude.getRoleId()))); |
|
|
|
roleExcludeDao.insertSelective(newRoleExeclude); |
|
|
@ -757,6 +762,7 @@ public class ProjectService implements IProjectService { |
|
|
|
sysProjectDao.updateByPrimaryKeySelective(project); |
|
|
|
} else { |
|
|
|
throw new BaseException(CodeEnum.NOT_POWER); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
throw new BaseException(CodeEnum.NOT_PROJECT); |
|
|
|