|
|
@ -76,6 +76,8 @@ public class ExcelService implements IExcelService { |
|
|
|
@Resource |
|
|
|
private IUserAttentionService userAttentionService; |
|
|
|
@Resource |
|
|
|
private UserAttentionDao userAttentionDao; |
|
|
|
@Resource |
|
|
|
private IWbsSubSheetService wbsSubSheetService; |
|
|
|
@Resource |
|
|
|
private IWpsService wpsService; |
|
|
@ -93,6 +95,17 @@ public class ExcelService implements IExcelService { |
|
|
|
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is); |
|
|
|
//读取WBS表
|
|
|
|
SysProject sysProject = readWbs(xssfWorkbook, currentUserId); |
|
|
|
//查看创建人是否关注了项目
|
|
|
|
UserAttentionExample example = new UserAttentionExample(); |
|
|
|
example.createCriteria().andUserIdEqualTo(currentUserId).andProjectIdEqualTo(sysProject.getId()); |
|
|
|
long count = userAttentionDao.countByExample(example); |
|
|
|
if (0 == count){ |
|
|
|
UserAttention userAttention = new UserAttention(); |
|
|
|
userAttention.setId(snowflake.nextId()); |
|
|
|
userAttention.setProjectId(sysProject.getId()); |
|
|
|
userAttention.setUserId(currentUserId); |
|
|
|
userAttentionDao.insertSelective(userAttention); |
|
|
|
} |
|
|
|
return selectByProjectId(currentUserId, sysProject); |
|
|
|
} |
|
|
|
|
|
|
@ -536,9 +549,11 @@ public class ExcelService implements IExcelService { |
|
|
|
|
|
|
|
//添加奖惩干系人
|
|
|
|
if (StrUtil.isNotEmpty(stakeholderCell)) { |
|
|
|
//判断奖惩干系人的手机号是否为空
|
|
|
|
if ( StrUtil.isEmpty(stakeholderPhoneCell)){ |
|
|
|
throw new BaseException(CodeEnum.WBS_NOT_PHONE.addMsg(memberSheet.getSheetName(), (i+1),stakeholderCell)); |
|
|
|
} |
|
|
|
//判断奖惩干系人的手机号格式是否正确
|
|
|
|
if (!stakeholderPhoneCell.matches(regex)){ |
|
|
|
throw new BaseException(CodeEnum.WBS_PHONE_ERROR.addMsg(memberSheet.getSheetName(),(i+1),stakeholderCell)); |
|
|
|
} |
|
|
@ -740,6 +755,10 @@ public class ExcelService implements IExcelService { |
|
|
|
} |
|
|
|
if(map.get("标签")!=null){ |
|
|
|
label=StringUtil.replaceStrSpace(ExcelUtil.getCellValue(row.getCell(map.get("标签")))); |
|
|
|
int length = label.length(); |
|
|
|
if (WebConstant.LABEL_LENGTH < length){ |
|
|
|
throw new BaseException(CodeEnum.LABEL_TOO_LONG.addMsg(wbsSheet.getSheetName(),(i+1),label)); |
|
|
|
} |
|
|
|
}else { |
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("标签")); |
|
|
|
} |
|
|
|