|
@@ -11,10 +11,7 @@ import com.usky.pm.domain.PmProject;
|
|
import com.usky.pm.domain.PmReceive;
|
|
import com.usky.pm.domain.PmReceive;
|
|
import com.usky.pm.domain.PmWorkContent;
|
|
import com.usky.pm.domain.PmWorkContent;
|
|
import com.usky.pm.domain.PmWorkReport;
|
|
import com.usky.pm.domain.PmWorkReport;
|
|
-import com.usky.pm.mapper.PmReceiveMapper;
|
|
|
|
-import com.usky.pm.mapper.PmWorkContentMapper;
|
|
|
|
-import com.usky.pm.mapper.PmWorkReportMapper;
|
|
|
|
-import com.usky.pm.mapper.SysUserMapper;
|
|
|
|
|
|
+import com.usky.pm.mapper.*;
|
|
import com.usky.pm.service.PmProjectService;
|
|
import com.usky.pm.service.PmProjectService;
|
|
import com.usky.pm.service.PmWorkContentService;
|
|
import com.usky.pm.service.PmWorkContentService;
|
|
import com.usky.pm.service.PmWorkReportService;
|
|
import com.usky.pm.service.PmWorkReportService;
|
|
@@ -79,6 +76,9 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
|
|
@Autowired
|
|
@Autowired
|
|
private RemoteMceService remoteMceService;
|
|
private RemoteMceService remoteMceService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private PmProjectMapper pmProjectMapper;
|
|
|
|
+
|
|
private static final String INFO_TITLE = "日报未提交提醒";
|
|
private static final String INFO_TITLE = "日报未提交提醒";
|
|
private static final String INFO_CONTENT = "您今天的日报还未提交,别忘记哦~";
|
|
private static final String INFO_CONTENT = "您今天的日报还未提交,别忘记哦~";
|
|
private static final int INFO_TYPE = 5;
|
|
private static final int INFO_TYPE = 5;
|
|
@@ -239,6 +239,15 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
|
|
if (workContents == null) {
|
|
if (workContents == null) {
|
|
throw new BusinessException("报告内容不能为空,请检查后提交!");
|
|
throw new BusinessException("报告内容不能为空,请检查后提交!");
|
|
} else {
|
|
} else {
|
|
|
|
+
|
|
|
|
+ // 查询租户下所有项目
|
|
|
|
+ LambdaQueryWrapper<PmProject> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
+ queryWrapper.select(PmProject::getId, PmProject::getProjectName)
|
|
|
|
+ .eq(PmProject::getTenantId, tenantId)
|
|
|
|
+ .eq(PmProject::getDelFlag, 0);
|
|
|
|
+ Map<Integer, String> projectMap = pmProjectMapper.selectList(queryWrapper).stream()
|
|
|
|
+ .collect(Collectors.toMap(PmProject::getId, PmProject::getProjectName));
|
|
|
|
+
|
|
for (PmWorkContent workContent : workContents) {
|
|
for (PmWorkContent workContent : workContents) {
|
|
BigDecimal workTime = workContent.getWorkTime();
|
|
BigDecimal workTime = workContent.getWorkTime();
|
|
// 单个工时大于零
|
|
// 单个工时大于零
|
|
@@ -257,6 +266,22 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
|
|
if (StringUtils.isBlank(workContent1)) {
|
|
if (StringUtils.isBlank(workContent1)) {
|
|
throw new BusinessException("工作内容不能为空,请检查后提交!");
|
|
throw new BusinessException("工作内容不能为空,请检查后提交!");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 检查项目ID是否有效
|
|
|
|
+ if (workContent.getProjectId() == null || workContent.getProjectId() <= 0) {
|
|
|
|
+ throw new BusinessException("项目ID无效,请选择正确项目后提交。");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 检查项目名称是否为空
|
|
|
|
+ if (StringUtils.isBlank(workContent.getProjectName())) {
|
|
|
|
+ throw new BusinessException("项目名称不能为空,请检查后提交。");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 检查项目ID和项目名称是否匹配
|
|
|
|
+ if (!projectMap.containsKey(workContent.getProjectId()) ||
|
|
|
|
+ !projectMap.get(workContent.getProjectId()).equals(workContent.getProjectName())) {
|
|
|
|
+ throw new BusinessException("项目不存在或项目名称不匹配,请检查后提交。");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Set<Integer> projectIds2 = new HashSet<>();
|
|
Set<Integer> projectIds2 = new HashSet<>();
|