|
@@ -363,7 +363,20 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
.filter(c -> rootTask.getAuditType() != null &&
|
|
.filter(c -> rootTask.getAuditType() != null &&
|
|
|
rootTask.getAuditType().equals(String.valueOf(c.getKey())))
|
|
rootTask.getAuditType().equals(String.valueOf(c.getKey())))
|
|
|
.findAny().ifPresent(costDictData -> rootTask.setAuditTypeName(costDictData.getName()));
|
|
.findAny().ifPresent(costDictData -> rootTask.setAuditTypeName(costDictData.getName()));
|
|
|
- // 根任务状态
|
|
|
|
|
|
|
+ // 获取项目立项信息
|
|
|
|
|
+ CostProjectApproval approval = costProjectApprovalManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectApproval>()
|
|
|
|
|
+ .eq(CostProjectApproval::getProjectId, rootTask.getProjectId())
|
|
|
|
|
+ .eq(CostProjectApproval::getIsDeleted, "0")
|
|
|
|
|
+ );
|
|
|
|
|
+ String projectMembers = approval.getProjectMembers();
|
|
|
|
|
+ String leaderIds = approval.getLeaderIds();
|
|
|
|
|
+ if (leaderIds!=null){
|
|
|
|
|
+ rootTask.setCanLeaderOperate(Arrays.asList(leaderIds.split(",")).contains(currentUserId));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ rootTask.setCanLeaderOperate(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ rootTask.setCanMemberOperate(false);
|
|
|
rootTask.setStatusName(TaskStatusConstant.getStatusNameByCode(rootTask.getStatus()));
|
|
rootTask.setStatusName(TaskStatusConstant.getStatusNameByCode(rootTask.getStatus()));
|
|
|
rootTask.setCurrentNodeName(NodeConstant.getNodeValueByKey(rootTask.getCurrentNode()));
|
|
rootTask.setCurrentNodeName(NodeConstant.getNodeValueByKey(rootTask.getCurrentNode()));
|
|
|
rootTask.setWarningStatus(taskWarningStatusComponent.calculateWarningStatus(rootTask));
|
|
rootTask.setWarningStatus(taskWarningStatusComponent.calculateWarningStatus(rootTask));
|
|
@@ -390,6 +403,8 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
List<CostProjectTask> childTasks =
|
|
List<CostProjectTask> childTasks =
|
|
|
childGroup.getOrDefault(rootTask.getId(), Collections.emptyList());
|
|
childGroup.getOrDefault(rootTask.getId(), Collections.emptyList());
|
|
|
for (CostProjectTask childTask : childTasks) {
|
|
for (CostProjectTask childTask : childTasks) {
|
|
|
|
|
+ childTask.setCanLeaderOperate(false);
|
|
|
|
|
+ childTask.setCanMemberOperate(Arrays.asList(projectMembers.split(",")).contains(currentUserId));
|
|
|
childTask.setStatusName(TaskStatusConstant.getStatusNameByCode(childTask.getStatus()));
|
|
childTask.setStatusName(TaskStatusConstant.getStatusNameByCode(childTask.getStatus()));
|
|
|
CostProjectApproval detail = approvalMap.get(childTask.getProjectId());
|
|
CostProjectApproval detail = approvalMap.get(childTask.getProjectId());
|
|
|
if (detail != null) {
|
|
if (detail != null) {
|
|
@@ -452,9 +467,10 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
this.updateById(task);
|
|
this.updateById(task);
|
|
|
|
|
|
|
|
// 发送通知
|
|
// 发送通知
|
|
|
- String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "材料已提交";
|
|
|
|
|
|
|
+ String nodeName = NodeConstant.getNodeValueByKey(task.getCurrentNode());
|
|
|
|
|
+ String title = "【" + nodeName + "】材料已提交";
|
|
|
// 操作人
|
|
// 操作人
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "材料已提交" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() + ")";
|
|
|
|
|
|
|
+ String content = "【" + nodeName + "】" + AuthenticationUtil.getCurrentUserFullname() + "已提交" + nodeName + "所需材料。(" + task.getProjectName() + ")";
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
@@ -478,9 +494,10 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
task.setStatus(TaskStatusConstant.FEEDBACKED.getStatusCode());
|
|
task.setStatus(TaskStatusConstant.FEEDBACKED.getStatusCode());
|
|
|
this.updateById(task);
|
|
this.updateById(task);
|
|
|
// 发送通知
|
|
// 发送通知
|
|
|
- String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "意见已反馈";
|
|
|
|
|
|
|
+ String nodeName = NodeConstant.getNodeValueByKey(task.getCurrentNode());
|
|
|
|
|
+ String title = "【" + nodeName + "】意见已反馈";
|
|
|
// 操作人
|
|
// 操作人
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "意见已反馈" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() + ")";
|
|
|
|
|
|
|
+ String content = "【" + nodeName + "】" + AuthenticationUtil.getCurrentUserFullname() + "已提交意见反馈所需资料。(" + task.getProjectName() + ")";
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
@@ -500,6 +517,8 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
|
|
|
|
|
CostProjectTask task = costProjectTaskManager.getById(req.getTaskId());
|
|
CostProjectTask task = costProjectTaskManager.getById(req.getTaskId());
|
|
|
|
|
|
|
|
|
|
+ // 权限校验:主办人操作主任务,从办人操作子任务
|
|
|
|
|
+ checkTaskOperationPermission(task);
|
|
|
|
|
|
|
|
String resultMessage = "";
|
|
String resultMessage = "";
|
|
|
switch (req.getKey()) {
|
|
switch (req.getKey()) {
|
|
@@ -592,9 +611,10 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
costProjectTaskManager.updateById(task);
|
|
costProjectTaskManager.updateById(task);
|
|
|
|
|
|
|
|
// 发送通知
|
|
// 发送通知
|
|
|
- String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "通过";
|
|
|
|
|
|
|
+ String nodeName = NodeConstant.getNodeValueByKey(task.getCurrentNode());
|
|
|
|
|
+ String title = "【" + nodeName + "】任务已通过";
|
|
|
// 操作人
|
|
// 操作人
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "已通过" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() + ")";
|
|
|
|
|
|
|
+ String content = "【" + nodeName + "】" + AuthenticationUtil.getCurrentUserFullname() + "已通过" + task.getAuditedUnitName() + "提交的材料。(" + task.getProjectName() + ")";
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
@@ -616,17 +636,19 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
return "仅支持子任务进行此操作!";
|
|
return "仅支持子任务进行此操作!";
|
|
|
}
|
|
}
|
|
|
// 通知内容组装
|
|
// 通知内容组装
|
|
|
- String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "退回";
|
|
|
|
|
|
|
+ String nodeName = NodeConstant.getNodeValueByKey(task.getCurrentNode());
|
|
|
|
|
+ String title = "【" + nodeName + "】任务未通过";
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
|
|
|
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "已退回" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() + ")";
|
|
|
|
|
|
|
+ String content = "【" + nodeName + "】" + AuthenticationUtil.getCurrentUserFullname() + "未通过" + task.getAuditedUnitName() + "提交的材料";
|
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
content += ",原因:" + req.getContent();
|
|
content += ",原因:" + req.getContent();
|
|
|
}
|
|
}
|
|
|
|
|
+ content += "。(" + task.getProjectName() + ")";
|
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
|
|
|
|
|
|
task.setStatus(TaskStatusConstant.NOT_PASSED.getStatusCode());
|
|
task.setStatus(TaskStatusConstant.NOT_PASSED.getStatusCode());
|
|
@@ -702,12 +724,15 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 通知内容组装
|
|
// 通知内容组装
|
|
|
|
|
+ String nodeName = NodeConstant.getNodeValueByKey(task.getCurrentNode());
|
|
|
String taskTypeDesc = isMainTask ? "" : "子任务";
|
|
String taskTypeDesc = isMainTask ? "" : "子任务";
|
|
|
- String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + taskTypeDesc + TaskStatusConstant.getStatusNameByCode(status);
|
|
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "已" + TaskStatusConstant.getStatusNameByCode(status) + task.getAuditedUnitName() + "的" + (isMainTask ? "项目" : "子任务") + "(" + task.getProjectName() + ")";
|
|
|
|
|
|
|
+ String statusName = TaskStatusConstant.SUSPENDED.getStatusCode().equals(status) ? "中止" : "恢复";
|
|
|
|
|
+ String title = "【" + nodeName + "】任务已" + statusName;
|
|
|
|
|
+ String content = "【" + nodeName + "】" + AuthenticationUtil.getCurrentUserFullname() + statusName + "此任务";
|
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
content += ",原因:" + req.getContent();
|
|
content += ",原因:" + req.getContent();
|
|
|
}
|
|
}
|
|
|
|
|
+ content += "。(" + task.getProjectName() + ")";
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
@@ -727,7 +752,8 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
*/
|
|
*/
|
|
|
private String supplementMaterial(CostProjectTask task, CostTaskPageReq req) {
|
|
private String supplementMaterial(CostProjectTask task, CostTaskPageReq req) {
|
|
|
String currentNode = task.getCurrentNode();
|
|
String currentNode = task.getCurrentNode();
|
|
|
- String title = NodeConstant.getNodeValueByKey(currentNode) + TaskStatusConstant.BCCL.getStatusName();
|
|
|
|
|
|
|
+ String nodeName = NodeConstant.getNodeValueByKey(currentNode);
|
|
|
|
|
+ String title = "【" + nodeName + "】补充材料";
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
@@ -755,7 +781,11 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
childTask.setStatus(TaskStatusConstant.BCCL.getStatusCode());
|
|
childTask.setStatus(TaskStatusConstant.BCCL.getStatusCode());
|
|
|
costProjectTaskManager.updateById(childTask);
|
|
costProjectTaskManager.updateById(childTask);
|
|
|
// 通知内容组装(针对子任务对应的单位)
|
|
// 通知内容组装(针对子任务对应的单位)
|
|
|
- String childContent = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "要求" + childTask.getAuditedUnitName() + "补充材料,项目(" + task.getProjectName() + ")";
|
|
|
|
|
|
|
+ String childContent = "【" + nodeName + "】您有一条任务未处理,请及时办理";
|
|
|
|
|
+ if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
|
|
+ childContent += ",原因:" + req.getContent();
|
|
|
|
|
+ }
|
|
|
|
|
+ childContent += "。(" + task.getProjectName() + ")";
|
|
|
String childEnterpriseId = childTask.getAuditedUnitId() == null ? "" : childTask.getAuditedUnitId();
|
|
String childEnterpriseId = childTask.getAuditedUnitId() == null ? "" : childTask.getAuditedUnitId();
|
|
|
String childSendTarget = childTask.getCreateBy() == null ? "" : childTask.getCreateBy();
|
|
String childSendTarget = childTask.getCreateBy() == null ? "" : childTask.getCreateBy();
|
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, childContent, childEnterpriseId, noticeSource, childSendTarget);
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, childContent, childEnterpriseId, noticeSource, childSendTarget);
|
|
@@ -779,7 +809,11 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
}
|
|
}
|
|
|
task.setStatus(TaskStatusConstant.BCCL.getStatusCode());
|
|
task.setStatus(TaskStatusConstant.BCCL.getStatusCode());
|
|
|
costProjectTaskManager.updateById(task);
|
|
costProjectTaskManager.updateById(task);
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "要求" + task.getAuditedUnitName() + "补充材料,项目(" + task.getProjectName() + ")";
|
|
|
|
|
|
|
+ String content = "【" + nodeName + "】您有一条任务未处理,请及时办理";
|
|
|
|
|
+ if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
|
|
+ content += ",原因:" + req.getContent();
|
|
|
|
|
+ }
|
|
|
|
|
+ content += "。(" + task.getProjectName() + ")";
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
@@ -895,8 +929,8 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
.eq(AuditedUnit::getIsDeleted, "0")
|
|
.eq(AuditedUnit::getIsDeleted, "0")
|
|
|
);
|
|
);
|
|
|
if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
|
- String noticeTitle = "意见告知通知";
|
|
|
|
|
- String noticeContent = "您的项目(" + child.getProjectName() + ")已退回至意见告知阶段,请及时查看";
|
|
|
|
|
|
|
+ String noticeTitle = "【意见告知】进入意见告知环节";
|
|
|
|
|
+ String noticeContent = "【意见告知】您的项目已进入意见告知环节,请及时查看。(" + child.getProjectName() + ")";
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
@@ -921,8 +955,8 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
.eq(AuditedUnit::getIsDeleted, "0")
|
|
.eq(AuditedUnit::getIsDeleted, "0")
|
|
|
);
|
|
);
|
|
|
if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
|
- String noticeTitle = "意见反馈通知";
|
|
|
|
|
- String noticeContent = "您的项目(" + child.getProjectName() + ")需要反馈意见,请及时处理";
|
|
|
|
|
|
|
+ String noticeTitle = "【意见反馈】进入意见反馈环节";
|
|
|
|
|
+ String noticeContent = "【意见反馈】您的项目已进入意见反馈环节,请及时查看。(" + child.getProjectName() + ")";
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
@@ -942,16 +976,18 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 通知内容组装
|
|
// 通知内容组装
|
|
|
- String title = "已退回至" + NodeConstant.getNodeValueByKey(prevNodeStatus);
|
|
|
|
|
|
|
+ String prevNodeName = NodeConstant.getNodeValueByKey(prevNodeStatus);
|
|
|
|
|
+ String title = "【" + prevNodeName + "】已退回至" + prevNodeName;
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]已退回至[" + NodeConstant.getNodeValueByKey(prevNodeStatus) + "]," + task.getProjectName();
|
|
|
|
|
|
|
+ String content = "【" + prevNodeName + "】" + AuthenticationUtil.getCurrentUserFullname() + "已将任务退回至" + prevNodeName;
|
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
content += ",原因:" + req.getContent();
|
|
content += ",原因:" + req.getContent();
|
|
|
}
|
|
}
|
|
|
|
|
+ content += "。(" + task.getProjectName() + ")";
|
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
|
|
|
|
|
|
// 记录环节明细
|
|
// 记录环节明细
|
|
@@ -1085,8 +1121,8 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
.eq(AuditedUnit::getIsDeleted, "0")
|
|
.eq(AuditedUnit::getIsDeleted, "0")
|
|
|
);
|
|
);
|
|
|
if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
|
- String noticeTitle = "意见告知通知";
|
|
|
|
|
- String noticeContent = "您的项目(" + child.getProjectName() + ")已进入意见告知阶段,请及时查看";
|
|
|
|
|
|
|
+ String noticeTitle = "【意见告知】进入意见告知环节";
|
|
|
|
|
+ String noticeContent = "【意见告知】您的项目已进入意见告知环节,请及时查看。(" + child.getProjectName() + ")";
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
@@ -1111,8 +1147,8 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
.eq(AuditedUnit::getIsDeleted, "0")
|
|
.eq(AuditedUnit::getIsDeleted, "0")
|
|
|
);
|
|
);
|
|
|
if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
|
- String noticeTitle = "意见反馈通知";
|
|
|
|
|
- String noticeContent = "您的项目(" + child.getProjectName() + ")需要反馈意见,请及时处理";
|
|
|
|
|
|
|
+ String noticeTitle = "【意见反馈】进入意见反馈环节";
|
|
|
|
|
+ String noticeContent = "【意见反馈】您的项目已进入意见反馈环节,请及时查看。(" + child.getProjectName() + ")";
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
@@ -1132,16 +1168,18 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 通知内容组装
|
|
// 通知内容组装
|
|
|
- String title = NodeConstant.getNodeValueByKey(nextNodeStatus) + "已开始";
|
|
|
|
|
|
|
+ String nextNodeName = NodeConstant.getNodeValueByKey(nextNodeStatus);
|
|
|
|
|
+ String title = "【" + nextNodeName + "】已进入" + nextNodeName + "环节";
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]已办结并扭转至[" + NodeConstant.getNodeValueByKey(nextNodeStatus) + "]," + task.getProjectName();
|
|
|
|
|
|
|
+ String content = "【" + nextNodeName + "】" + AuthenticationUtil.getCurrentUserFullname() + "已填写相应数据并通过此任务";
|
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
content += ",备注:" + req.getContent();
|
|
content += ",备注:" + req.getContent();
|
|
|
}
|
|
}
|
|
|
|
|
+ content += "。(" + task.getProjectName() + ")";
|
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
|
//流程节点如果选择主办人或者从办人后修改任务负责人和负责组信息
|
|
//流程节点如果选择主办人或者从办人后修改任务负责人和负责组信息
|
|
|
if (StringUtil.isNotEmpty(req.getUserIds()) || StringUtil.isNotEmpty(req.getLeaderIds())) {
|
|
if (StringUtil.isNotEmpty(req.getUserIds()) || StringUtil.isNotEmpty(req.getLeaderIds())) {
|
|
@@ -1503,17 +1541,19 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
if (StringUtil.isEmpty(req.getUserIds())) {
|
|
if (StringUtil.isEmpty(req.getUserIds())) {
|
|
|
throw new RuntimeException("未指定催办人员");
|
|
throw new RuntimeException("未指定催办人员");
|
|
|
}
|
|
}
|
|
|
- String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "催办";
|
|
|
|
|
|
|
+ String nodeName = NodeConstant.getNodeValueByKey(task.getCurrentNode());
|
|
|
|
|
+ String title = "【" + nodeName + "】催办通知";
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
// 分割用户ID并逐个发送通知
|
|
// 分割用户ID并逐个发送通知
|
|
|
for (String userId : req.getUserIds().split(",")) {
|
|
for (String userId : req.getUserIds().split(",")) {
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "催办" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() + ")";
|
|
|
|
|
|
|
+ String content = "【" + nodeName + "】您有一条催办消息通知,请及时查看";
|
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
content += ",原因:" + req.getContent();
|
|
content += ",原因:" + req.getContent();
|
|
|
}
|
|
}
|
|
|
|
|
+ content += "。(" + task.getProjectName() + ")";
|
|
|
// 使用传入的用户ID作为发送目标
|
|
// 使用传入的用户ID作为发送目标
|
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, userId);
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, userId);
|
|
|
}
|
|
}
|
|
@@ -1532,11 +1572,13 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
* @return 催报结果消息
|
|
* @return 催报结果消息
|
|
|
*/
|
|
*/
|
|
|
private String remindUnitTask(CostProjectTask task, CostTaskPageReq req) {
|
|
private String remindUnitTask(CostProjectTask task, CostTaskPageReq req) {
|
|
|
- String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "催报";
|
|
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "催报" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() + ")";
|
|
|
|
|
|
|
+ String nodeName = NodeConstant.getNodeValueByKey(task.getCurrentNode());
|
|
|
|
|
+ String title = "【" + nodeName + "】督办通知";
|
|
|
|
|
+ String content = "【" + nodeName + "】您有一条督办消息通知,请及时查看";
|
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
content += ",原因:" + req.getContent();
|
|
content += ",原因:" + req.getContent();
|
|
|
}
|
|
}
|
|
|
|
|
+ content += "。(" + task.getProjectName() + ")";
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
@@ -1657,16 +1699,18 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 发送通知
|
|
// 发送通知
|
|
|
- String title = "复核-已退回至" + NodeConstant.getNodeValueByKey(reviewNodeKey);
|
|
|
|
|
|
|
+ String reviewNodeName = NodeConstant.getNodeValueByKey(reviewNodeKey);
|
|
|
|
|
+ String title = "【" + reviewNodeName + "】复核-已退回至" + reviewNodeName;
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "要求复核,已退回至[" + NodeConstant.getNodeValueByKey(reviewNodeKey) + "]," + task.getProjectName();
|
|
|
|
|
|
|
+ String content = "【" + reviewNodeName + "】" + AuthenticationUtil.getCurrentUserFullname() + "要求复核,已退回至" + reviewNodeName;
|
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
content += ",原因:" + req.getContent();
|
|
content += ",原因:" + req.getContent();
|
|
|
}
|
|
}
|
|
|
|
|
+ content += "。(" + task.getProjectName() + ")";
|
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
|
|
|
|
|
|
// 记录环节明细
|
|
// 记录环节明细
|
|
@@ -1712,11 +1756,13 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
|
|
|
|
|
|
|
|
|
|
// 发送通知
|
|
// 发送通知
|
|
|
- String title = "任务已归档";
|
|
|
|
|
- String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "已归档" + task.getProjectName();
|
|
|
|
|
|
|
+ String nodeName = NodeConstant.getNodeValueByKey(task.getCurrentNode());
|
|
|
|
|
+ String title = "【" + nodeName + "】任务已归档";
|
|
|
|
|
+ String content = "【" + nodeName + "】" + AuthenticationUtil.getCurrentUserFullname() + "已归档此任务";
|
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
content += ",备注:" + req.getContent();
|
|
content += ",备注:" + req.getContent();
|
|
|
}
|
|
}
|
|
|
|
|
+ content += "。(" + task.getProjectName() + ")";
|
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
String orgId = getCurrentUserMainOrgId();
|
|
String orgId = getCurrentUserMainOrgId();
|
|
|
Org org = orgManager.getById(orgId);
|
|
Org org = orgManager.getById(orgId);
|
|
@@ -1737,4 +1783,49 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
costProjectProccessNodeDetailManager.recordByTaskId(task.getId(), actionType, actionName, remark);
|
|
costProjectProccessNodeDetailManager.recordByTaskId(task.getId(), actionType, actionName, remark);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 校验任务操作权限
|
|
|
|
|
+ * 主任务(pid=0):只有主办人(leaderIds)可以操作
|
|
|
|
|
+ * 子任务(pid!=0):只有从办人(projectMembers)可以操作
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param task 任务对象
|
|
|
|
|
+ */
|
|
|
|
|
+ private void checkTaskOperationPermission(CostProjectTask task) {
|
|
|
|
|
+ if (task == null) {
|
|
|
|
|
+ throw new RuntimeException("任务不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取当前用户ID
|
|
|
|
|
+ IUser currentUser = ContextUtil.getCurrentUser();
|
|
|
|
|
+ String currentUserId = currentUser.getUserId();
|
|
|
|
|
+
|
|
|
|
|
+ // 获取项目立项信息
|
|
|
|
|
+ CostProjectApproval approval = costProjectApprovalManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectApproval>()
|
|
|
|
|
+ .eq(CostProjectApproval::getProjectId, task.getProjectId())
|
|
|
|
|
+ .eq(CostProjectApproval::getIsDeleted, "0")
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ if (approval == null) {
|
|
|
|
|
+ throw new RuntimeException("项目立项信息不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ boolean isMainTask = "0".equals(task.getPid());
|
|
|
|
|
+
|
|
|
|
|
+ if (isMainTask) {
|
|
|
|
|
+ // 主任务:只有主办人可以操作
|
|
|
|
|
+ String leaderIds = approval.getLeaderIds();
|
|
|
|
|
+ if (StringUtil.isEmpty(leaderIds) || !leaderIds.contains(currentUserId)) {
|
|
|
|
|
+ throw new RuntimeException("您不是该项目的主办人,无权操作主任务");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 子任务:只有从办人可以操作
|
|
|
|
|
+ String projectMembers = approval.getProjectMembers();
|
|
|
|
|
+ if (StringUtil.isEmpty(projectMembers) || !projectMembers.contains(currentUserId)) {
|
|
|
|
|
+ throw new RuntimeException("您不是该项目的从办人,无权操作子任务");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|