|
@@ -7,8 +7,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.hotent.base.manager.impl.BaseManagerImpl;
|
|
import com.hotent.base.manager.impl.BaseManagerImpl;
|
|
|
import com.hotent.base.util.AuthenticationUtil;
|
|
import com.hotent.base.util.AuthenticationUtil;
|
|
|
import com.hotent.base.util.StringUtil;
|
|
import com.hotent.base.util.StringUtil;
|
|
|
|
|
+import com.hotent.baseInfo.manager.AuditedUnitManager;
|
|
|
import com.hotent.baseInfo.manager.CostCatalogManager;
|
|
import com.hotent.baseInfo.manager.CostCatalogManager;
|
|
|
import com.hotent.baseInfo.manager.CostDistrictManager;
|
|
import com.hotent.baseInfo.manager.CostDistrictManager;
|
|
|
|
|
+import com.hotent.baseInfo.model.AuditedUnit;
|
|
|
import com.hotent.baseInfo.model.CostCatalog;
|
|
import com.hotent.baseInfo.model.CostCatalog;
|
|
|
import com.hotent.baseInfo.model.CostDistrict;
|
|
import com.hotent.baseInfo.model.CostDistrict;
|
|
|
import com.hotent.baseInfo.req.CostTaskSearchReq;
|
|
import com.hotent.baseInfo.req.CostTaskSearchReq;
|
|
@@ -91,6 +93,9 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CostCatalogManager costCatalogManager;
|
|
private CostCatalogManager costCatalogManager;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private AuditedUnitManager auditedUnitManager;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<CostProjectTask> getTaskList(CostTaskSearchReq req) throws Exception {
|
|
public List<CostProjectTask> getTaskList(CostTaskSearchReq req) throws Exception {
|
|
@@ -432,6 +437,11 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
case "10":
|
|
case "10":
|
|
|
// 催报
|
|
// 催报
|
|
|
resultMessage = remindUnitTask(task, req);
|
|
resultMessage = remindUnitTask(task, req);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "8":
|
|
|
|
|
+ // 复核
|
|
|
|
|
+ resultMessage = reviewTask(task, req);
|
|
|
|
|
+ break;
|
|
|
default:
|
|
default:
|
|
|
return "未知的操作类型";
|
|
return "未知的操作类型";
|
|
|
}
|
|
}
|
|
@@ -628,6 +638,36 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
}
|
|
}
|
|
|
String prevNodeStatus = prevNode.getNodeKey();
|
|
String prevNodeStatus = prevNode.getNodeKey();
|
|
|
|
|
|
|
|
|
|
+ // 更新流程节点时间:清空当前节点的结束时间,重置上一节点的开始时间
|
|
|
|
|
+ CostProjectProccess proccess = costProjectProccessManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectProccess>().eq(CostProjectProccess::getProjectId,task.getProjectId())
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ // 清空当前节点的实际结束时间和操作信息
|
|
|
|
|
+ CostProjectProccessNode currentNode = costProjectProccessNodeManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectProccessNode>()
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessNodeKey, task.getCurrentNode())
|
|
|
|
|
+ );
|
|
|
|
|
+ if (currentNode != null) {
|
|
|
|
|
+ currentNode.setActEndTime(null);
|
|
|
|
|
+ currentNode.setActUserIds(null);
|
|
|
|
|
+ currentNode.setActUserNames(null);
|
|
|
|
|
+ currentNode.setActRemarks(null);
|
|
|
|
|
+ costProjectProccessNodeManager.updateById(currentNode);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 重置上一节点的开始时间
|
|
|
|
|
+ CostProjectProccessNode prevNodeObj = costProjectProccessNodeManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectProccessNode>()
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessNodeKey, prevNodeStatus)
|
|
|
|
|
+ );
|
|
|
|
|
+ if (prevNodeObj != null) {
|
|
|
|
|
+ prevNodeObj.setActStartTime(LocalDateTime.now());
|
|
|
|
|
+ costProjectProccessNodeManager.updateById(prevNodeObj);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 主任务退回上一步,重置归档状态
|
|
// 主任务退回上一步,重置归档状态
|
|
|
nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
|
|
nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
|
|
|
nTask.setCurrentNode(prevNodeStatus);
|
|
nTask.setCurrentNode(prevNodeStatus);
|
|
@@ -663,37 +703,68 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
child.setStatus(childStatus);
|
|
child.setStatus(childStatus);
|
|
|
child.setCurrentNode(prevNodeStatus);
|
|
child.setCurrentNode(prevNodeStatus);
|
|
|
costProjectTaskManager.updateById(child);
|
|
costProjectTaskManager.updateById(child);
|
|
|
|
|
+
|
|
|
|
|
+ // 如果退回到意见反馈节点,通知企业
|
|
|
|
|
+ if ("yjfk".equals(prevNodeStatus) && StringUtil.isNotEmpty(child.getAuditedUnitId())) {
|
|
|
|
|
+ AuditedUnit auditedUnit = auditedUnitManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<AuditedUnit>()
|
|
|
|
|
+ .eq(AuditedUnit::getUnitId, child.getAuditedUnitId())
|
|
|
|
|
+ .eq(AuditedUnit::getIsDeleted, "0")
|
|
|
|
|
+ );
|
|
|
|
|
+ if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
|
|
|
+ String noticeTitle = "意见反馈通知";
|
|
|
|
|
+ String noticeContent = "您的项目(" + child.getProjectName() + ")需要反馈意见,请及时处理";
|
|
|
|
|
+ String orgId = getCurrentUserMainOrgId();
|
|
|
|
|
+ Org org = orgManager.getById(orgId);
|
|
|
|
|
+ String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
|
|
|
+ costNoticeManager.sendNotice(
|
|
|
|
|
+ child.getProjectId(),
|
|
|
|
|
+ child.getId(),
|
|
|
|
|
+ "1",
|
|
|
|
|
+ noticeTitle,
|
|
|
|
|
+ noticeContent,
|
|
|
|
|
+ child.getAuditedUnitId(),
|
|
|
|
|
+ noticeSource,
|
|
|
|
|
+ auditedUnit.getAccount()
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 通知内容组装
|
|
// 通知内容组装
|
|
|
- String title = NodeConstant.getNodeValueByKey(prevNodeStatus) + "退回上一步";
|
|
|
|
|
|
|
+ String title = "已退回至" + NodeConstant.getNodeValueByKey(prevNodeStatus);
|
|
|
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();
|
|
|
- costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
|
|
|
|
|
|
|
+ String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]已退回至[" + NodeConstant.getNodeValueByKey(prevNodeStatus) + "]," + task.getProjectName();
|
|
|
|
|
+ if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
|
|
+ content += ",原因:" + req.getContent();
|
|
|
|
|
+ }
|
|
|
|
|
+ costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
|
return title;
|
|
return title;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 扭转下一步,修改状态和节点(主任务操作,子任务同步节点流转)
|
|
* 扭转下一步,修改状态和节点(主任务操作,子任务同步节点流转)
|
|
|
|
|
+ * 自动完成办结操作并扭转到下一步
|
|
|
*/
|
|
*/
|
|
|
private String toNextSubmit(CostProjectTask task, CostTaskPageReq req) {
|
|
private String toNextSubmit(CostProjectTask task, CostTaskPageReq req) {
|
|
|
CostProjectTask nTask = costProjectTaskManager.getById(task.getId());
|
|
CostProjectTask nTask = costProjectTaskManager.getById(task.getId());
|
|
|
if (!"0".equals(task.getPid())) {
|
|
if (!"0".equals(task.getPid())) {
|
|
|
return "仅支持主任务进行此操作";
|
|
return "仅支持主任务进行此操作";
|
|
|
}
|
|
}
|
|
|
- if (!nTask.getStatus().equals(TaskStatusConstant.COMPLETED.getStatusCode())) {
|
|
|
|
|
- throw new RuntimeException("请办结任务后,再进行扭转下一步");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 获取下一节点
|
|
|
NodeConstant nextNode = NodeConstant.getNextNode(nTask.getCurrentNode());
|
|
NodeConstant nextNode = NodeConstant.getNextNode(nTask.getCurrentNode());
|
|
|
if (nextNode == null) {
|
|
if (nextNode == null) {
|
|
|
throw new RuntimeException("当前节点已是最后一步,无法扭转");
|
|
throw new RuntimeException("当前节点已是最后一步,无法扭转");
|
|
|
}
|
|
}
|
|
|
- String nextNodeStatus = nextNode.getNodeKey();
|
|
|
|
|
|
|
+ String nextNodeStatus = nextNode.getNodeKey();
|
|
|
|
|
+
|
|
|
|
|
+ // 获取所有子任务
|
|
|
List<CostProjectTask> children = costProjectTaskManager.list(
|
|
List<CostProjectTask> children = costProjectTaskManager.list(
|
|
|
new LambdaQueryWrapper<CostProjectTask>()
|
|
new LambdaQueryWrapper<CostProjectTask>()
|
|
|
.eq(CostProjectTask::getPid, nTask.getId())
|
|
.eq(CostProjectTask::getPid, nTask.getId())
|
|
@@ -707,28 +778,13 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
if (!allChildrenCompleted) {
|
|
if (!allChildrenCompleted) {
|
|
|
throw new RuntimeException("子任务未全部办结,主任务无法扭转");
|
|
throw new RuntimeException("子任务未全部办结,主任务无法扭转");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 主任务扭转到下一节点
|
|
|
|
|
- nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
|
|
|
|
|
- nTask.setCurrentNode(nextNodeStatus);
|
|
|
|
|
- nTask.setIsGd("0");
|
|
|
|
|
- costProjectTaskManager.updateById(nTask);
|
|
|
|
|
-
|
|
|
|
|
- // 子任务同步节点流转,根据节点设置对应状态
|
|
|
|
|
- String childStatus = "";
|
|
|
|
|
- switch (nextNodeStatus) {
|
|
|
|
|
- case "yjfk":
|
|
|
|
|
- childStatus = TaskStatusConstant.WAIT_FEEDBACK.getStatusCode();
|
|
|
|
|
- break;
|
|
|
|
|
- case "jtsy":
|
|
|
|
|
- case "cjbg":
|
|
|
|
|
- case "gd":
|
|
|
|
|
- childStatus = TaskStatusConstant.COMPLETED.getStatusCode();
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- childStatus = TaskStatusConstant.AUDITING.getStatusCode();
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 先完成当前节点的办结操作(如果未办结)
|
|
|
|
|
+ if (!nTask.getStatus().equals(TaskStatusConstant.COMPLETED.getStatusCode())) {
|
|
|
|
|
+ nTask.setStatus(TaskStatusConstant.COMPLETED.getStatusCode());
|
|
|
|
|
+ costProjectTaskManager.updateById(nTask);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 修改当前节点的结束时间
|
|
// 修改当前节点的结束时间
|
|
|
CostProjectProccess proccess = costProjectProccessManager.getOne(
|
|
CostProjectProccess proccess = costProjectProccessManager.getOne(
|
|
|
new LambdaQueryWrapper<CostProjectProccess>().eq(CostProjectProccess::getProjectId,task.getProjectId())
|
|
new LambdaQueryWrapper<CostProjectProccess>().eq(CostProjectProccess::getProjectId,task.getProjectId())
|
|
@@ -743,6 +799,14 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
one.setActRemarks(req.getContent());
|
|
one.setActRemarks(req.getContent());
|
|
|
one.setActEndTime(LocalDateTime.now());
|
|
one.setActEndTime(LocalDateTime.now());
|
|
|
costProjectProccessNodeManager.updateById(one);
|
|
costProjectProccessNodeManager.updateById(one);
|
|
|
|
|
+
|
|
|
|
|
+ // 主任务扭转到下一节点
|
|
|
|
|
+ nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
|
|
|
|
|
+ nTask.setCurrentNode(nextNodeStatus);
|
|
|
|
|
+ nTask.setIsGd("0");
|
|
|
|
|
+ costProjectTaskManager.updateById(nTask);
|
|
|
|
|
+
|
|
|
|
|
+ // 设置下一节点的开始时间
|
|
|
CostProjectProccessNode two = costProjectProccessNodeManager.getOne(
|
|
CostProjectProccessNode two = costProjectProccessNodeManager.getOne(
|
|
|
new LambdaQueryWrapper<CostProjectProccessNode>()
|
|
new LambdaQueryWrapper<CostProjectProccessNode>()
|
|
|
.eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
|
|
.eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
|
|
@@ -751,23 +815,69 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
two.setActStartTime(LocalDateTime.now());
|
|
two.setActStartTime(LocalDateTime.now());
|
|
|
costProjectProccessNodeManager.updateById(two);
|
|
costProjectProccessNodeManager.updateById(two);
|
|
|
|
|
|
|
|
|
|
+ // 子任务同步节点流转,根据节点设置对应状态
|
|
|
|
|
+ String childStatus = "";
|
|
|
|
|
+ switch (nextNodeStatus) {
|
|
|
|
|
+ case "yjfk":
|
|
|
|
|
+ childStatus = TaskStatusConstant.WAIT_FEEDBACK.getStatusCode();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "jtsy":
|
|
|
|
|
+ case "cjbg":
|
|
|
|
|
+ case "gd":
|
|
|
|
|
+ childStatus = TaskStatusConstant.COMPLETED.getStatusCode();
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ childStatus = TaskStatusConstant.AUDITING.getStatusCode();
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 同步所有非中止状态的子任务
|
|
// 同步所有非中止状态的子任务
|
|
|
for (CostProjectTask child : children) {
|
|
for (CostProjectTask child : children) {
|
|
|
if (!child.getStatus().equals(TaskStatusConstant.SUSPENDED.getStatusCode())) {
|
|
if (!child.getStatus().equals(TaskStatusConstant.SUSPENDED.getStatusCode())) {
|
|
|
child.setStatus(childStatus);
|
|
child.setStatus(childStatus);
|
|
|
child.setCurrentNode(nextNodeStatus);
|
|
child.setCurrentNode(nextNodeStatus);
|
|
|
costProjectTaskManager.updateById(child);
|
|
costProjectTaskManager.updateById(child);
|
|
|
|
|
+
|
|
|
|
|
+ // 如果扭转到意见反馈节点,通知企业
|
|
|
|
|
+ if ("yjfk".equals(nextNodeStatus) && StringUtil.isNotEmpty(child.getAuditedUnitId())) {
|
|
|
|
|
+ AuditedUnit auditedUnit = auditedUnitManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<AuditedUnit>()
|
|
|
|
|
+ .eq(AuditedUnit::getUnitId, child.getAuditedUnitId())
|
|
|
|
|
+ .eq(AuditedUnit::getIsDeleted, "0")
|
|
|
|
|
+ );
|
|
|
|
|
+ if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
|
|
|
|
|
+ String noticeTitle = "意见反馈通知";
|
|
|
|
|
+ String noticeContent = "您的项目(" + child.getProjectName() + ")需要反馈意见,请及时处理";
|
|
|
|
|
+ String orgId = getCurrentUserMainOrgId();
|
|
|
|
|
+ Org org = orgManager.getById(orgId);
|
|
|
|
|
+ String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
|
|
|
+ costNoticeManager.sendNotice(
|
|
|
|
|
+ child.getProjectId(),
|
|
|
|
|
+ child.getId(),
|
|
|
|
|
+ "1",
|
|
|
|
|
+ noticeTitle,
|
|
|
|
|
+ noticeContent,
|
|
|
|
|
+ child.getAuditedUnitId(),
|
|
|
|
|
+ noticeSource,
|
|
|
|
|
+ auditedUnit.getAccount()
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 通知内容组装
|
|
// 通知内容组装
|
|
|
- String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "扭转至下一步";
|
|
|
|
|
|
|
+ String title = NodeConstant.getNodeValueByKey(nextNodeStatus) + "已开始";
|
|
|
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();
|
|
|
- costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
|
|
|
|
|
|
|
+ String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]已办结并扭转至[" + NodeConstant.getNodeValueByKey(nextNodeStatus) + "]," + task.getProjectName();
|
|
|
|
|
+ if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
|
|
+ content += ",备注:" + req.getContent();
|
|
|
|
|
+ }
|
|
|
|
|
+ costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
|
return title;
|
|
return title;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1097,4 +1207,114 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
|
|
|
return title;
|
|
return title;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 复核,主任务退回到实地审核节点,子任务恢复到流程初始状态
|
|
|
|
|
+ * @param task 任务对象
|
|
|
|
|
+ * @param req 请求参数
|
|
|
|
|
+ * @return 复核结果消息
|
|
|
|
|
+ */
|
|
|
|
|
+ private String reviewTask(CostProjectTask task, CostTaskPageReq req) {
|
|
|
|
|
+ CostProjectTask nTask = costProjectTaskManager.getById(task.getId());
|
|
|
|
|
+ if (!"0".equals(task.getPid())) {
|
|
|
|
|
+ return "仅支持主任务进行此操作";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取实地审核节点
|
|
|
|
|
+ String reviewNodeKey = NodeConstant.sdshenhe.getNodeKey();
|
|
|
|
|
+
|
|
|
|
|
+ // 更新流程节点时间:清空当前节点及之后节点的时间,重置实地审核节点的开始时间
|
|
|
|
|
+ CostProjectProccess proccess = costProjectProccessManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectProccess>().eq(CostProjectProccess::getProjectId, task.getProjectId())
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ if (proccess != null) {
|
|
|
|
|
+ // 清空当前节点的实际结束时间和操作信息
|
|
|
|
|
+ CostProjectProccessNode currentNode = costProjectProccessNodeManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectProccessNode>()
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessNodeKey, task.getCurrentNode())
|
|
|
|
|
+ );
|
|
|
|
|
+ if (currentNode != null) {
|
|
|
|
|
+ currentNode.setActEndTime(null);
|
|
|
|
|
+ currentNode.setActUserIds(null);
|
|
|
|
|
+ currentNode.setActUserNames(null);
|
|
|
|
|
+ currentNode.setActRemarks(null);
|
|
|
|
|
+ costProjectProccessNodeManager.updateById(currentNode);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 清空实地审核之后所有节点的时间和操作信息
|
|
|
|
|
+ boolean foundReviewNode = false;
|
|
|
|
|
+ for (NodeConstant nodeConstant : NodeConstant.values()) {
|
|
|
|
|
+ if (nodeConstant.getNodeKey().equals(reviewNodeKey)) {
|
|
|
|
|
+ foundReviewNode = true;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (foundReviewNode) {
|
|
|
|
|
+ CostProjectProccessNode node = costProjectProccessNodeManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectProccessNode>()
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessNodeKey, nodeConstant.getNodeKey())
|
|
|
|
|
+ );
|
|
|
|
|
+ if (node != null) {
|
|
|
|
|
+ node.setActStartTime(null);
|
|
|
|
|
+ node.setActEndTime(null);
|
|
|
|
|
+ node.setActUserIds(null);
|
|
|
|
|
+ node.setActUserNames(null);
|
|
|
|
|
+ node.setActRemarks(null);
|
|
|
|
|
+ costProjectProccessNodeManager.updateById(node);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 重置实地审核节点的开始时间
|
|
|
|
|
+ CostProjectProccessNode reviewNode = costProjectProccessNodeManager.getOne(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectProccessNode>()
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
|
|
|
|
|
+ .eq(CostProjectProccessNode::getProcessNodeKey, reviewNodeKey)
|
|
|
|
|
+ );
|
|
|
|
|
+ if (reviewNode != null) {
|
|
|
|
|
+ reviewNode.setActStartTime(LocalDateTime.now());
|
|
|
|
|
+ costProjectProccessNodeManager.updateById(reviewNode);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 主任务退回到实地审核节点
|
|
|
|
|
+ nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
|
|
|
|
|
+ nTask.setCurrentNode(reviewNodeKey);
|
|
|
|
|
+ nTask.setIsGd("0");
|
|
|
|
|
+ costProjectTaskManager.updateById(nTask);
|
|
|
|
|
+
|
|
|
|
|
+ // 子任务恢复到流程初始状态(实地审核节点,审核中状态)
|
|
|
|
|
+ List<CostProjectTask> children = costProjectTaskManager.list(
|
|
|
|
|
+ new LambdaQueryWrapper<CostProjectTask>()
|
|
|
|
|
+ .eq(CostProjectTask::getPid, nTask.getId())
|
|
|
|
|
+ .eq(CostProjectTask::getIsDeleted, "0")
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ String initialNodeKey = NodeConstant.sdshenhe.getNodeKey();
|
|
|
|
|
+ for (CostProjectTask child : children) {
|
|
|
|
|
+ // 非中止状态的子任务恢复到初始状态
|
|
|
|
|
+ if (!child.getStatus().equals(TaskStatusConstant.SUSPENDED.getStatusCode())) {
|
|
|
|
|
+ child.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
|
|
|
|
|
+ child.setCurrentNode(initialNodeKey);
|
|
|
|
|
+ costProjectTaskManager.updateById(child);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 发送通知
|
|
|
|
|
+ String title = "复核-已退回至" + NodeConstant.getNodeValueByKey(reviewNodeKey);
|
|
|
|
|
+ String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
|
|
|
|
|
+ String orgId = getCurrentUserMainOrgId();
|
|
|
|
|
+ Org org = orgManager.getById(orgId);
|
|
|
|
|
+ String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
|
|
|
|
|
+ String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
|
|
|
|
|
+ String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "要求复核,已退回至[" + NodeConstant.getNodeValueByKey(reviewNodeKey) + "]," + task.getProjectName();
|
|
|
|
|
+ if (StringUtil.isNotEmpty(req.getContent())) {
|
|
|
|
|
+ content += ",原因:" + req.getContent();
|
|
|
|
|
+ }
|
|
|
|
|
+ costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
|
|
|
|
|
+
|
|
|
|
|
+ return title;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|