Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
zhizhi wu 4 years ago
parent
commit
ee7ab2a6f5
  1. 4
      signin/src/main/java/com/ccsens/signin/service/UserService.java
  2. 212
      tall/src/main/java/com/ccsens/tall/service/ExcelService.java
  3. 7
      tall/src/main/java/com/ccsens/tall/service/ILwbsService.java
  4. 11
      tall/src/main/java/com/ccsens/tall/service/InputDocService.java
  5. 101
      tall/src/main/java/com/ccsens/tall/service/LwbsService.java
  6. 4
      tall/src/main/java/com/ccsens/tall/service/UserService.java
  7. 49
      util/src/main/java/com/ccsens/util/CodeEnum.java
  8. 12
      util/src/test/java/com/ccsens/util/OtherTest.java

4
signin/src/main/java/com/ccsens/signin/service/UserService.java

@ -621,10 +621,10 @@ public class UserService implements IUserService {
//检查图形验证码是否正确
String codeKey = WebConstant.IMAGE_CODE + verificationCodeId;
if (!redisUtil.hasKey(codeKey)) {
throw new BaseException(CodeEnum.VERIFICATION_CODE_PAST);
throw new BaseException(CodeEnum.VERIFICATION_CODE_PAST_IMG);
}
if (!verificationCodeValue.equals(String.valueOf(redisUtil.get(codeKey)))) {
throw new BaseException(CodeEnum.VERIFICATION_CODE_ERROR);
throw new BaseException(CodeEnum.VERIFICATION_CODE_ERROR_IMG);
}
//验证一次,无论是否正确,都将缓存删除
redisUtil.del(codeKey);

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

@ -179,7 +179,8 @@ public class ExcelService implements IExcelService {
private void readProject(XSSFSheet wbsSheet, int projectInfoStart, int projectInfoEnd, Long currentUserId, SysProject sysProject) throws Exception {
XSSFRow row = wbsSheet.getRow(projectInfoStart + 1);
if(ObjectUtil.isNull(row)){
throw new BaseException(CodeEnum.NOT_ROW.addMsg(wbsSheet.getSheetName() + (projectInfoStart + 1)));
//TODO
throw new BaseException(CodeEnum.WBS_NOT_PROJECT.addMsg(wbsSheet.getSheetName(),projectInfoStart + 1));
}
String projectName = ExcelUtil.getCellValue(row.getCell(0));
if (StrUtil.isNotEmpty(projectName)) {
@ -194,7 +195,7 @@ public class ExcelService implements IExcelService {
endTime = Long.parseLong(end);
} catch (Exception e) {
//日期格式错误
throw new BaseException(CodeEnum.WBS_PROJECT_TIME_ERROR);
throw new BaseException(CodeEnum.WBS_PROJECT_TIME_ERROR.addMsg(wbsSheet.getSheetName(),projectInfoStart + 1));
}
sysProject.setId(snowflake.nextId());
sysProject.setName(projectName);
@ -229,7 +230,7 @@ public class ExcelService implements IExcelService {
*/
private void readMember(XSSFSheet wbsSheet, XSSFSheet memberSheet, int memberStart, int memberEnd,
SysProject sysProject, List<ProRole> proRoles, List<ProMember> proMembers) throws Exception {
Integer seq=new Integer(0);
int seq= 0;
//添加奖惩干系人角色(一级角色)
ProRole stakeholderRole = new ProRole();
stakeholderRole.setName(WebConstant.ROLE_NAME.MoneyStakeholder.value);
@ -292,6 +293,8 @@ public class ExcelService implements IExcelService {
Long firstRoleId = null;
Long secondRoleId = null;
//循环结束判断字符串allOneRole是否包含PM和Member
StringBuilder allOneRole = new StringBuilder();
for (int i = memberStart + 1; i <= memberEnd; i++) {
XSSFRow row = wbsSheet.getRow(i);
if(ObjectUtil.isNull(row)){
@ -306,51 +309,43 @@ public class ExcelService implements IExcelService {
ProRole role = new ProRole();
role.setId(snowflake.nextId());
role.setProjectId(sysProject.getId());
// switch (proRoleCell){
// case WebConstant.ROLE_NAME.God:
// break;
// default:
// }
if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.God.phase)) {
role.setName(WebConstant.ROLE_NAME.God.value);
role.setDescription(WebConstant.ROLE_NAME.God.phase);
allOneRole.append(WebConstant.ROLE_NAME.God.value);
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.ManageRepresent.phase)) {
role.setName(WebConstant.ROLE_NAME.ManageRepresent.value);
role.setDescription(WebConstant.ROLE_NAME.ManageRepresent.phase);
allOneRole.append(WebConstant.ROLE_NAME.ManageRepresent.value);
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Stakeholder.phase)) {
role.setName(WebConstant.ROLE_NAME.Stakeholder.value);
role.setDescription(WebConstant.ROLE_NAME.Stakeholder.phase);
allOneRole.append(WebConstant.ROLE_NAME.Stakeholder.value);
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.PM.phase)) {
role.setName(WebConstant.ROLE_NAME.PM.value);
role.setDescription(WebConstant.ROLE_NAME.PM.phase);
allOneRole.append(WebConstant.ROLE_NAME.PM.value);
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Member.phase)) {
role.setName(WebConstant.ROLE_NAME.Member.value);
role.setDescription(WebConstant.ROLE_NAME.Member.phase);
allOneRole.append(WebConstant.ROLE_NAME.Member.value);
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Attention.phase)) {
role.setName(WebConstant.ROLE_NAME.Attention.value);
role.setDescription(WebConstant.ROLE_NAME.Attention.phase);
allOneRole.append(WebConstant.ROLE_NAME.Attention.value);
}else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.ProjectVirtualRole.phase)) {
role.setName(WebConstant.ROLE_NAME.ProjectVirtualRole.value);
role.setDescription(WebConstant.ROLE_NAME.ProjectVirtualRole.phase);
allOneRole.append(WebConstant.ROLE_NAME.ProjectVirtualRole.value);
} else {
throw new BaseException(CodeEnum.WBS_NOT_FIRST_ROLE.addMsg(wbsSheet.getSheetName() + i));
throw new BaseException(CodeEnum.WBS_NOT_FIRST_ROLE.addMsg(wbsSheet.getSheetName(),(i+1),proRoleCell));
}
proRoleService.saveProRole(role);
proRoles.add(role);
firstRoleId = role.getId();
// if(CollectionUtil.isNotEmpty(proRoles)) {
// for (ProRole proRole : proRoles) {
// if(ObjectUtil.isNull(proRole.getParentId())) {
// if (proRole.getDescription().equals(proRoleCell)) {
// firstRoleId = proRole.getId();
// break;
// }
// }
// }
// }
}
if (ObjectUtil.isNull(firstRoleId)) {
throw new BaseException("找不到系统角色[" + i + "]");
continue;
}
//二级角色
if (StrUtil.isNotEmpty(secondRoleCell)) {
@ -367,43 +362,71 @@ public class ExcelService implements IExcelService {
try {
SysProject project = sysProjectDao.selectByPrimaryKey(Long.parseLong(roleRelevanceProjectId));
if(ObjectUtil.isNull(project)){
throw new BaseException(CodeEnum.NOT_PROJECT.addMsg(wbsSheet.getSheetName() + i));
throw new BaseException(CodeEnum.NOT_PROJECT.addMsg(wbsSheet.getSheetName(),(i+1),roleRelevanceProjectId));
}
proRole.setRelevanceProjectId(project.getId());
}catch (NumberFormatException e){
throw new BaseException(CodeEnum.NOT_PROJECT.addMsg(wbsSheet.getSheetName() + i));
throw new BaseException(CodeEnum.NOT_PROJECT.addMsg(wbsSheet.getSheetName(),(i+1),roleRelevanceProjectId));
}
}
proRoleService.saveProRole(proRole);
proRoles.add(proRole);
secondRoleId = proRole.getId();
} else {
throw new BaseException(CodeEnum.WBS_REPEAT_ROLE_NAME.addMsg(wbsSheet.getSheetName() + i));
throw new BaseException(CodeEnum.WBS_REPEAT_ROLE_NAME.addMsg(wbsSheet.getSheetName(),(i+1),secondRoleCell));
}
}
if (ObjectUtil.isNull(secondRoleId)) {
throw new BaseException("找不到二级角色[" + i + "]");
continue;
}
//添加角色成员关联信息
if (StrUtil.isNotEmpty(memberCell)) {
ProMemberRole memberRole = null;
for (ProMember member : proMembers) {
if (memberCell.equalsIgnoreCase(member.getNickname())) {
memberRole = new ProMemberRole();
memberRole.setId(snowflake.nextId());
memberRole.setMemberId(member.getId());
memberRole.setRoleId(secondRoleId);
proMemberRoleService.saveMemberRole(memberRole);
String regex = ",|,|;|;|、|/";
String[] split = memberCell.split(regex);
String memberName ="";
for (int j = 0; j < split.length; j++) {
ProMemberRole memberRole = null;
memberName = split[j];
for (ProMember member : proMembers) {
if (memberName.equalsIgnoreCase(member.getNickname())) {
memberRole = new ProMemberRole();
memberRole.setId(snowflake.nextId());
memberRole.setMemberId(member.getId());
memberRole.setRoleId(secondRoleId);
proMemberRoleService.saveMemberRole(memberRole);
break;
}
}
if (ObjectUtil.isNull(memberRole)) {
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(wbsSheet.getSheetName(),(i+1),memberName));
}
}
if (ObjectUtil.isNull(memberRole)) {
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(wbsSheet.getSheetName() + i));
}
}else if (StrUtil.isNotEmpty(roleRelevanceProjectId)) {
// ProMemberRole memberRole = null;
// for (ProMember member : proMembers) {
// if (memberCell.equalsIgnoreCase(member.getNickname())) {
// memberRole = new ProMemberRole();
// memberRole.setId(snowflake.nextId());
// memberRole.setMemberId(member.getId());
// memberRole.setRoleId(secondRoleId);
// proMemberRoleService.saveMemberRole(memberRole);
// }
// }
// if (ObjectUtil.isNull(memberRole)) {
// throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(wbsSheet.getSheetName() + (i+1)));
// }
}
// else if (StrUtil.isNotEmpty(roleRelevanceProjectId)) {
//
// }
}
if (!allOneRole.toString().contains(WebConstant.ROLE_NAME.PM.value)){
throw new BaseException(CodeEnum.NOT_FOUND_PM);
}
if (!allOneRole.toString().contains(WebConstant.ROLE_NAME.Member.value)){
throw new BaseException(CodeEnum.NOT_FOUND_MEMBER);
}
//角色对谁不可见
String[] excludeRoleCells;
for (int i = memberStart + 1; i <= memberEnd; i++) {
@ -415,7 +438,8 @@ public class ExcelService implements IExcelService {
String excludeRoleCell = StringUtil.replaceComma(ExcelUtil.getCellValue(row.getCell(4)));
//获取角色对谁不可见
if (StrUtil.isNotEmpty(excludeRoleCell)) {
excludeRoleCells = excludeRoleCell.split(",");
String regex = ",|,|;|;|、|/";
excludeRoleCells = excludeRoleCell.split(regex);
Long proRoleId = null;
if (StrUtil.isNotEmpty(secondRoleCell)) {
@ -428,7 +452,9 @@ public class ExcelService implements IExcelService {
}
if (ObjectUtil.isNotNull(excludeRoleCells)) {
String noLookName = "";
for (int a = 0; a < excludeRoleCells.length; a++) {
noLookName = excludeRoleCells[a];
ProRoleExclude excludeRole = new ProRoleExclude();
excludeRole.setId(snowflake.nextId());
excludeRole.setRoleId(proRoleId);
@ -442,7 +468,7 @@ public class ExcelService implements IExcelService {
}
}
if (ObjectUtil.isNull(roleId)) {
throw new BaseException(CodeEnum.WBS_NOT_FIND_ROLE.addMsg(wbsSheet.getSheetName() + i));
throw new BaseException(CodeEnum.WBS_NOT_FIND_ROLE.addMsg(wbsSheet.getSheetName(),(i+1),noLookName));
}
}
excludeRoleService.saveExcludeRole(excludeRole);
@ -497,10 +523,13 @@ public class ExcelService implements IExcelService {
//手机号不能为空
if ((StrUtil.isNotEmpty(memberCell) && StrUtil.isEmpty(phoneCell)) ||
(StrUtil.isNotEmpty(stakeholderCell) && StrUtil.isEmpty(stakeholderPhoneCell))) {
throw new BaseException(CodeEnum.WBS_NOT_PHONE.addMsg(memberSheet.getSheetName() + i));
throw new BaseException(CodeEnum.WBS_NOT_PHONE.addMsg(memberSheet.getSheetName(), (i+1),memberCell));
}
//TODO 判断手机号格式
String regex ="^[1]([3-9])[0-9]{9}$";
if (!phoneCell.matches(regex)){
throw new BaseException(CodeEnum.WBS_PHONE_ERROR.addMsg(memberSheet.getSheetName() + (i+1)));
}
//添加奖惩干系人
if (StrUtil.isNotEmpty(stakeholderCell)) {
if (!stakeholderWithPhone(stakeholderList, stakeholderCell, stakeholderPhoneCell)) {
@ -523,7 +552,7 @@ public class ExcelService implements IExcelService {
proMemberRole.setRoleId(stakeholderId);
proMemberRoleService.saveMemberRole(proMemberRole);
} else {
throw new BaseException(CodeEnum.WBS_STAKEHOLDER_PHONE.addMsg(memberSheet.getSheetName() + i));
throw new BaseException(CodeEnum.WBS_STAKEHOLDER_PHONE.addMsg(memberSheet.getSheetName(),(i+1),stakeholderCell));
}
}
//成员
@ -546,7 +575,7 @@ public class ExcelService implements IExcelService {
proMembers.add(member);
// //创建者依据project的creatorId判断,不需要添加成员
} else {
throw new BaseException(CodeEnum.WBS_REPEAT_MEMBER_PHONE.addMsg(memberSheet.getSheetName() + i));
throw new BaseException(CodeEnum.WBS_REPEAT_MEMBER_PHONE.addMsg(memberSheet.getSheetName(),(i+1)));
}
}
}
@ -616,9 +645,8 @@ public class ExcelService implements IExcelService {
private void readTask(XSSFWorkbook xssfWorkbook, XSSFSheet wbsSheet, int taskStart, int taskEnd,
Long currentUserId, SysProject sysProject, List<ProTaskDetail> taskDetails,
List<ProRole> proRoles, List<ProMember> proMembers, Map<String, List<ProTaskDetail>> hasGroupMap) throws Exception {
/**
* 读取到任务的表头key为属性value为在第几列
*/
//读取到任务的表头,key为属性,value为在第几列
HashMap<String, Integer> map =new HashMap<String, Integer>();
XSSFRow rowq = wbsSheet.getRow(taskStart);
for (int q=0;q<100;q++){
@ -765,7 +793,6 @@ public class ExcelService implements IExcelService {
if(map.get("延迟时间(自动延迟模式可用)")!=null){
delayTime = ExcelUtil.getCellValue(row.getCell(map.get("延迟时间(自动延迟模式可用)")));
//TODO 跳转任务和跳转次数暂不处理
}else {
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("延迟时间(自动延迟模式可用)"));
}
@ -781,20 +808,16 @@ public class ExcelService implements IExcelService {
loopTimes = ExcelUtil.getCellValue(row.getCell(17));
//这个不知道要不要先给你留着
}else {
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb(""));
// throw new BaseException(CodeEnum.NOTNAME.addMsgLwb(""));
}
//输入文件
if(map.get("任务(节点)")!=null){
input = ExcelUtil.getCellValue(row.getCell(18));
//二级任务名不能为空
// if(StrUtil.isEmpty(task2)){
// throw new BaseException(CodeEnum.WBS_NOT_TASK_NAME.addMsg(wbsSheet.getSheetName()+i));
// }
//一级任务
}else {
// throw new BaseException(CodeEnum.NOTNAME.addMsgLwb(""));
}
//一级任务
if (StrUtil.isNotEmpty(task1)) {
ProTaskDetail firstTaskDetail = new ProTaskDetail();
firstTaskDetail.setId(snowflake.nextId());
@ -809,7 +832,11 @@ public class ExcelService implements IExcelService {
// firstTaskDetail.setBeginTime(firstStartTime);
// }else{
if (StrUtil.isNotEmpty(beginTime)) {
firstTaskDetail.setBeginTime(Long.valueOf(beginTime));
try{
firstTaskDetail.setBeginTime(Long.valueOf(beginTime));
}catch (Exception e){
throw new BaseException(CodeEnum.WBS_TASK_START_TIME_ERROR.addMsg(wbsSheet.getSheetName() + (i+1)));
}
}else {
firstTaskDetail.setBeginTime(sysProject.getBeginTime());
}
@ -824,14 +851,19 @@ public class ExcelService implements IExcelService {
}
if (ObjectUtil.isNull(firstTaskDetailId)) {
throw new BaseException("找不到任务[" + i + "]");
continue;
// throw new BaseException("找不到任务[" + (i+1) + "]");
}
if(StrUtil.isNotEmpty(endTime)){
if(CollectionUtil.isNotEmpty(taskDetails)){
for(ProTaskDetail taskDetail : taskDetails){
if(taskDetail.getId().longValue() == firstTaskDetailId){
taskDetail.setEndTime(Long.valueOf(endTime));
try {
taskDetail.setEndTime(Long.valueOf(endTime));
}catch (Exception e){
throw new BaseException(CodeEnum.WBS_TASK_END_TIME_ERROR.addMsg(wbsSheet.getSheetName() + (i+1)));
}
taskDetailDao.updateByPrimaryKeySelective(taskDetail);
firstStartTime = taskDetail.getEndTime();
break;
@ -879,7 +911,7 @@ public class ExcelService implements IExcelService {
}
}
if (ObjectUtil.isNull(executorRoleId)) {
throw new BaseException(CodeEnum.WBS_NOT_FIND_EXECUTOR_ROLE.addMsg(wbsSheet.getSheetName() + i));
throw new BaseException(CodeEnum.WBS_NOT_FIND_EXECUTOR_ROLE.addMsg(wbsSheet.getSheetName(),(i+1),executorRole));
}
}
//检查人
@ -893,7 +925,7 @@ public class ExcelService implements IExcelService {
}
}
if (ObjectUtil.isNull(checkerRoleId)) {
throw new BaseException(CodeEnum.WBS_NOT_FIND_CHECKER_ROLE.addMsg(wbsSheet.getSheetName() + i));
throw new BaseException(CodeEnum.WBS_NOT_FIND_CHECKER_ROLE.addMsg(wbsSheet.getSheetName(),(i+1),checkerRole));
}
}
//奖惩金额
@ -909,30 +941,18 @@ public class ExcelService implements IExcelService {
} else if (delay.equals(WebConstant.TASK_DELAY.Manual.phase)) {
taskDetail.setDelay((byte) WebConstant.TASK_DELAY.Manual.value);
} else {
throw new BaseException(CodeEnum.WBS_DELAY_ERROR.addMsg(wbsSheet.getSheetName() + i));
taskDetail.setDelay((byte) WebConstant.TASK_DELAY.SelfMotion.value);
}
}
//延迟时间
if (StrUtil.isNotEmpty(delayTime)) {
taskDetail.setDelayTime(DateUtil.str2MillSeconds(delayTime));
}
//TODO 跳转任务(应该在循环外处理)
//输入文档 旧的
// if (StrUtil.isNotEmpty(input)) {
// ProTaskDeliver taskDeliver = new ProTaskDeliver();
// taskDeliver.setId(snowflake.nextId());
// taskDeliver.setTaskDetailId(taskDetail.getId());
// taskDeliver.setName(input);
// taskDeliver.setIsInput(1);
// taskDeliver.setIsFinal(0);
// taskDeliverService.saveDeliver(taskDeliver);
// }
//TODO 跳转任务(应该在循环外处理
//输入文档 新的
if(StrUtil.isNotEmpty(inputFiles)){
String regex=",|,|;|:|;|:|、|。";
String regex=",|,|;|;|、|/";
String[] fileNames= inputFiles.split(regex);
if(fileNames.length>0){
taskDeliverService.saveProTaskInputDoc(fileNames,taskDetail.getId());
@ -989,7 +1009,7 @@ public class ExcelService implements IExcelService {
wbsSubSheetService.getSubTaskMt(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
break;
default:
// throw new BaseException(CodeEnum.WBS_SUB_TASK_ANALYSIS.addMsg(wbsSheet.getSheetName() + i));
// throw new BaseException(CodeEnum.WBS_SUB_TASK_ANALYSIS.addMsg(wbsSheet.getSheetName() + (i+1)));
wbsSubSheetService.getSubTask(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
}
}
@ -1149,21 +1169,27 @@ public class ExcelService implements IExcelService {
} else {
Date startDate = new Date(taskDetail.getBeginTime());
Date endDate = new Date(taskDetail.getEndTime());
List<CronConstant.TaskDate> taskDateList =
NatureToDate.generateDates(taskDetail.getCycle(), startDate, endDate);
if (CollectionUtil.isEmpty(taskDateList)) {
return;
}
for (CronConstant.TaskDate taskDate : taskDateList) {
try {
List<CronConstant.TaskDate> taskDateList =
NatureToDate.generateDates(taskDetail.getCycle(), startDate, endDate);
if (CollectionUtil.isEmpty(taskDateList)) {
return;
}
for (CronConstant.TaskDate taskDate : taskDateList) {
ProTaskSubTime proTaskSubTime = new ProTaskSubTime();
proTaskSubTime.setId(snowflake.nextId());
proTaskSubTime.setTaskDetailId(taskDetail.getId());
proTaskSubTime.setBeginTime(taskDate.getStartDate().getTime());
proTaskSubTime.setEndTime(taskDate.getEndDate().getTime());
ProTaskSubTime proTaskSubTime = new ProTaskSubTime();
proTaskSubTime.setId(snowflake.nextId());
proTaskSubTime.setTaskDetailId(taskDetail.getId());
proTaskSubTime.setBeginTime(taskDate.getStartDate().getTime());
proTaskSubTime.setEndTime(taskDate.getEndDate().getTime());
taskSubTimeService.saveProTaskSubTask(proTaskSubTime);
taskSubTimeService.saveProTaskSubTask(proTaskSubTime);
}
}catch (Exception e){
throw new BaseException(CodeEnum.NOT_SUPPORT_CYCLE.addMsg(taskDetail.getCycle()));
}
}
}
}
@ -1214,7 +1240,7 @@ public class ExcelService implements IExcelService {
// taskDeliverService.saveDeliver(taskDeliver);
// }
// }
String regex=",|,|;|:|;|:|、|。";
String regex=",|,|;|;|、|/";
deliverCell= deliverCell.replace("\n","").replace("\r","");
String[] fileNames= deliverCell.split(regex);
if(fileNames.length>0){
@ -1248,7 +1274,7 @@ public class ExcelService implements IExcelService {
Long memberRoleId = null;
XSSFRow roleRow = sheet.getRow(2);
if(ObjectUtil.isNull(roleRow)){
throw new BaseException(CodeEnum.NOT_ROW.addMsg(sheet.getSheetName() + (2)));
throw new BaseException(CodeEnum.NOT_ROW.addMsg(sheet.getSheetName(),2));
}
for (int i = 3; i < sheet.getLastRowNum() + 1; i++) {
@ -1276,7 +1302,8 @@ public class ExcelService implements IExcelService {
for (int a = 2; a < roleRow.getLastCellNum(); a++) {
String plugin = StringUtil.replaceComma(ExcelUtil.getCellValue(pluginRow.getCell(a)));
if (StrUtil.isNotEmpty(plugin)) {
String[] plugins = plugin.split(",");
String regex=",|,|;|;|、|/";
String[] plugins = plugin.split(regex);
//获取memberRoleId
String roleCell = ExcelUtil.getCellValue(roleRow.getCell(a));
if (StrUtil.isNotEmpty(roleCell) && CollectionUtil.isNotEmpty(proRoles)) {
@ -1296,7 +1323,7 @@ public class ExcelService implements IExcelService {
}
}
if (ObjectUtil.isNull(sysPluginId)) {
throw new BaseException(CodeEnum.WBS_NOT_PLUGIN.addMsg(sheet.getSheetName() + i));
throw new BaseException(CodeEnum.WBS_NOT_PLUGIN.addMsg(sheet.getSheetName(),(i+1),plugins[p]));
}
if (CollectionUtil.isNotEmpty(taskNameList)) {
for (ProTaskDetail taskName : taskNameList) {
@ -1321,9 +1348,6 @@ public class ExcelService implements IExcelService {
}
}
}
// else {
// throw new BaseException(CodeEnum.WBS_NOT_PLUGIN_SHEET);
// }
}
}

7
tall/src/main/java/com/ccsens/tall/service/ILwbsService.java

@ -0,0 +1,7 @@
package com.ccsens.tall.service;
/**
* @author
*/
public interface ILwbsService {
}

11
tall/src/main/java/com/ccsens/tall/service/InputDocService.java

@ -103,17 +103,6 @@ public class InputDocService implements IInputDocService {
return selByUserIdToComProjectVos;
}
public TaskVo.ProTaskInfo queryLwbs(LwbsDto.SelByProjectIdToTaskDto param, Long userId) {
if(ObjectUtil.isNotNull(param.getId())){
//如果项目id为空。则查询所有
}else {
//项目id不为空。查询单个项目
}
return null;
}
@Override
public TaskVo.ProTaskInfo selByProjectIdToTask(LwbsDto.SelByProjectIdToTaskDto param, Long userId) {
TaskVo.ProTaskInfo taskInfo=new TaskVo.ProTaskInfo();

101
tall/src/main/java/com/ccsens/tall/service/LwbsService.java

@ -0,0 +1,101 @@
package com.ccsens.tall.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.tall.bean.dto.LwbsDto;
import com.ccsens.tall.bean.po.ProRole;
import com.ccsens.tall.bean.po.ProShow;
import com.ccsens.tall.bean.po.ProShowExample;
import com.ccsens.tall.bean.po.ProSubTimeMember;
import com.ccsens.tall.bean.vo.TaskVo;
import com.ccsens.tall.util.TaskUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class LwbsService implements ILwbsService{
public TaskVo.ProTaskInfo queryLwbs(LwbsDto.SelByProjectIdToTaskDto param, Long userId) {
if(ObjectUtil.isNotNull(param.getId())){
//如果项目id为空。则查询所有
}else {
//项目id不为空。查询单个项目
}
return null;
}
// private TaskVo.ProTaskInfo getTaskInfoByProjectIdAndRoleId(Long currentUserId, Long projectId, Long startTime,
// Long endTime, Integer process, Integer priority) throws Exception {
// TaskVo.ProTaskInfo proTaskInfo = new TaskVo.ProTaskInfo();
//
// List<TaskVo.GlobalTask> globalTaskList = new ArrayList<>();
// List<TaskVo.NormalTask> normalTaskList = new ArrayList<>();
// TaskVo.GlobalTask globalTask;
// //获取“全体成员”角色
// ProRole allMember = proRoleService.getAllMember(projectId);
// Long allMemberId = null;
// if (ObjectUtil.isNotNull(allMember)) {
// allMemberId = allMember.getId();
// }
//
// //查找该项目下该用户的的所有的任务
// List<TaskVo.NormalTask> secondTaskVoList =
// List<TaskVo.NormalTask> secondTaskVoList = taskDetailDao.selectTaskByRoleAndAllMembers(projectId, roleId,
// allMemberId, startTime, endTime, priority);
//
// if (CollectionUtil.isNotEmpty(secondTaskVoList)) {
// for (TaskVo.NormalTask normalTask : secondTaskVoList) {
//
// //任务完成状态
// if (normalTask.getProcess() != 2) {
// ProSubTimeMember subTimeMember = getProcessByUserIdAndTask(currentUserId, normalTask.getId());
// if (ObjectUtil.isNotNull(subTimeMember)) {
// normalTask.setProcess(subTimeMember.getComplatedStatus());
// normalTask.setRealEndTime(subTimeMember.getRealFinishTime());
// } else if (normalTask.getProcess() > 2) {
// normalTask.setRealEndTime((long) 0);
// normalTask.setProcess(0);
// }
// }
// }
//
// TaskUtil.Task task = TaskUtil.splitTask(secondTaskVoList, startTime, endTime, process);
//
// if (CollectionUtil.isNotEmpty(task.getGlobalTask())) {
// for (TaskVo.NormalTask global : task.getGlobalTask()) {
// globalTask = new TaskVo.GlobalTask();
// BeanUtil.copyProperties(global, globalTask);
// globalTaskList.add(globalTask);
// }
// }
// if (CollectionUtil.isNotEmpty(task.getCommonTask())) {
// if (priority == 0) {
// normalTaskList = sortTaskTime(task.getCommonTask());
// } else {
// normalTaskList = task.getCommonTask();
// }
// }
//
// }
//
// proTaskInfo.setGlobalTaskList(globalTaskList);
// proTaskInfo.setNormalTaskList(normalTaskList);
//
// return proTaskInfo;
// }
}

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

@ -619,10 +619,10 @@ public class UserService implements IUserService {
//检查图形验证码是否正确
String codeKey = WebConstant.IMAGE_CODE + verificationCodeId;
if (!redisUtil.hasKey(codeKey)) {
throw new BaseException(CodeEnum.VERIFICATION_CODE_PAST);
throw new BaseException(CodeEnum.VERIFICATION_CODE_PAST_IMG);
}
if (!verificationCodeValue.equals(String.valueOf(redisUtil.get(codeKey)))) {
throw new BaseException(CodeEnum.VERIFICATION_CODE_ERROR);
throw new BaseException(CodeEnum.VERIFICATION_CODE_ERROR_IMG);
}
//验证一次,无论是否正确,都将缓存删除
redisUtil.del(codeKey);

49
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -29,13 +29,15 @@ public enum CodeEnum {
WBS_PROJECT_TIME_ERROR(15,"时间格式异常",true),
WBS_NOT_PROJECT_TIME(16,"项目时间不能为空",true),
WBS_NOT_PROJECT_NAME(17,"项目名称不能为空",true),
WBS_NOT_PROJECT(17,"找不到项目信息",true),
WBS_NOT_MEMBER_SHEET(18,"未找到项目成员表",true),
WBS_NOT_PHONE(19,"手机号为空",true),
WBS_PHONE_ERROR(19,"手机号格式错误",true),
WBS_STAKEHOLDER_PHONE(20,"奖惩干系人和手机号不匹配",true),
WBS_REPEAT_MEMBER_PHONE(21,"成员已存在",true),
WBS_REPEAT_MEMBER_PHONE(21,"成员名或手机号与其他人重复",true),
WBS_NOT_FIRST_ROLE(22,"系统角色名称错误",true),
WBS_REPEAT_ROLE_NAME(23,"角色名称重复",true),
WSB_NOT_MEMBER(24,"未找到对应成员,请检查成员姓名是否正确", true),
WSB_NOT_MEMBER(24,"未找到对应成员", true),
WBS_NOT_FIND_ROLE(25,"未找到对应的角色,请检查对谁不可见一列的名字与格式",true),
WBS_NOT_TASK_NAME(26,"任务名不能为空",true),
WBS_NOT_FIND_EXECUTOR_ROLE(27,"找不到负责人,请检查负责人的名称",true),
@ -133,7 +135,9 @@ public enum CodeEnum {
NOT_UNIT(108,"时间单位不能为空",true),
NOT_USER(109,"用户不存在",true),
VERIFICATION_CODE_PAST(110,"验证码失效,请刷新重试",true),
VERIFICATION_CODE_PAST_IMG(110,"图形验证码失效,请刷新重试",true),
VERIFICATION_CODE_ERROR(111,"验证码错误",true),
VERIFICATION_CODE_ERROR_IMG(111,"图形验证码错误",true),
NOT_ROW(112,"该行不存在",true),
VOTED(113,"对不起,您已经支持过看好的队伍了",true),
@ -197,6 +201,11 @@ public enum CodeEnum {
CHONGFUTIJIAO(163,"不要重复提交",true),
ZUISHAOCHUANLIANGE(164,"排序最少需要传入两个",true),
HOSPITAL_NOT_FOUND(165,"没有找到医院",true),
NOT_FOUND_PM(166,"系统角色缺少项目经理",true),
NOT_FOUND_MEMBER(167,"系统角色缺少项目成员",true),
NOT_SUPPORT_CYCLE(168,"重复规则文本格式暂不支持",true),
WBS_TASK_START_TIME_ERROR(168,"任务开始时间格式错误,请检查后操作",true),
WBS_TASK_END_TIME_ERROR(169,"任务结束时间格式错误,请检查后操作",true),
;
@ -224,10 +233,44 @@ public enum CodeEnum {
this.msg = msg+"报名人数已满";
return this;
}
public CodeEnum addMsg(String msg){
this.msg = msg+"行:"+this.msg;
if(this.msg.contains("错误:")){
this.msg = this.msg.substring(this.msg.indexOf("错误:") + 3);
}
this.msg = msg+"--错误:"+this.msg;
return this;
}
public CodeEnum addMsg(String sheetName,Integer rowNum){
if(this.msg.contains("错误:")){
this.msg = this.msg.substring(this.msg.indexOf("错误:") + 3);
}
this.msg = sheetName+"第"+rowNum+"行--错误:"+this.msg;
return this;
}
public CodeEnum addMsg(String sheetName,Integer rowNum,String value){
if(this.msg.contains("错误:")){
this.msg = this.msg.substring(this.msg.indexOf("错误:") + 3);
}
this.msg = sheetName+"第"+rowNum+"行["+value+"]--错误:"+this.msg;
return this;
}
public CodeEnum addMsgAndMemberName(String msg,String memberName){
this.msg = msg+"行:成员["+memberName+"]"+this.msg;
return this;
}
public CodeEnum addMsgAndNoLookName(String msg,String noLookName){
this.msg = msg+"行:对谁不可见成员["+noLookName+"]"+this.msg;
return this;
}
public CodeEnum addMsgLwb(String msg) {
this.msg = "未找到名为“"+msg+"”的列,请检查列名称是否正确";
return this;

12
util/src/test/java/com/ccsens/util/OtherTest.java

@ -129,6 +129,18 @@ public class OtherTest {
public void test8(){
System.out.println(Byte.parseByte("-1") & 0xff);
}
@Test
public void test9(){
String a = "a,b,c";
String x = "a";
String[] split = a.split(",");
String[] split1 = x.split(",");
System.out.println(split);
System.out.println(split1);
}
//
// /**
// * 发送https请求

Loading…
Cancel
Save