feat(流程): 添加财务人员任务跳转功能并更新相关服务- 在 ActTaskDefService 中添加了财务人员任务跳转的逻辑

- 更新了 ProjectBudgetService 中的预算计算方法,支持按名称过滤
- 修改了 ProjectInstanceService 和 ProjectService 中的任务完成方法,增加了文件 URL 参数
- 更新了 application-local.properties 中的上传路径配置
dev_2.0.2
chenhao 2024-12-24 17:30:31 +08:00
parent 4dba9a69cb
commit baabb3c5bc
5 changed files with 29 additions and 15 deletions

View File

@ -74,6 +74,10 @@ public class ActTaskDefService {
ActTaskDef actTaskDef = findFirstByProcDefIdAndTaskKey(currentTask.getProcessDefinitionId(), currentTask.getTaskDefinitionKey());
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(procInsId).singleResult();
boolean addVariableFlag = currentTask.getName().equals("财务人员") && processInstance.getProcessDefinitionKey().equals("budget");
if (addVariableFlag) {
runtimeService.setVariable(procInsId, "skipTask", StringUtils.isNotBlank(fileUrl));
}
taskService.setAssignee(taskId, userId);
if (ActConstant.TASK_TYPE_SINGE == actTaskDef.getTaskType()) {
handleSinge(processInstance, taskId, approveEnum, actTaskDef);
@ -93,10 +97,10 @@ public class ActTaskDefService {
* @param approveEnum
* @param comment
*/
public void completeTaskByProcInsId(String procInsId, ActApproveTypeEnum approveEnum, String comment) {
public void completeTaskByProcInsId(String procInsId, ActApproveTypeEnum approveEnum, String comment, String fileUrl) {
List<Task> taskList = taskService.createTaskQuery().processInstanceId(procInsId).list();
for (Task task : taskList) {
completeTask(task.getId(), procInsId, comment, approveEnum, "");
completeTask(task.getId(), procInsId, comment, approveEnum, fileUrl);
}
}

View File

@ -1052,20 +1052,28 @@ public class ProjectBudgetService {
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
if (projectBudgetCostDetails.size() > 0) {
ProcurementType huizhiType = procurementTypeRepository.findByName("汇智产品");
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a ->a.getCategory().equals(huizhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a ->(a.getCategory().equals(huizhiType.getId().toString()))||("汇智产品".equals(a.getCategory())))
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
budget.setHuizhiProductAmountBudget(huizhi);
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huazhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> (a.getCategory().equals(huazhiType.getId().toString()))||("华智产品".equals(a.getCategory())))
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
budget.setHuazhiProductAmountBudget(huazhi);
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a ->( a.getCategory().equals(huasanType.getId().toString()))||( "华三产品".equals(a.getCategory())))
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
budget.setHuasanProductAmountBudget(huasan);
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> !a.getCategory().equals( huizhiType.getId().toString()) && !a.getCategory().equals(huazhiType.getId().toString())
&& !a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> isABoolean(a, huizhiType, huazhiType, huasanType)).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
budget.setZiguangOtherAmountBudget(other);
}
}
private static boolean isABoolean(ProjectBudgetCostDetail a, ProcurementType huizhiType, ProcurementType huazhiType, ProcurementType huasanType) {
return !a.getCategory().equals(huizhiType.getId().toString()) &&!"汇智产品".equals(a.getCategory())
&& !a.getCategory().equals(huazhiType.getId().toString()) && !"华智产品".equals(a.getCategory())
&& !a.getCategory().equals(huasanType.getId().toString()) && !"华三产品".equals(a.getCategory());
}
private void saveProjectExtend(Project p) {
ProjectExtend extend = projectExtendRepository.findByProjectId(p.getId());
if (extend == null) {
@ -1100,16 +1108,18 @@ public class ProjectBudgetService {
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
if (projectBudgetCostDetails.size() > 0) {
ProcurementType huizhiType = procurementTypeRepository.findByName("汇智产品");
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huizhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a -> (a.getCategory().equals(huizhiType.getId().toString()) )||("汇智产品".equals(a.getCategory())) )
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
extend.setHuizhiProductAmount(huizhi);
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huazhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> (a.getCategory().equals(huazhiType.getId().toString()))||("华智产品".equals(a.getCategory())))
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
extend.setHuazhiProductAmount(huazhi);
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a ->(a.getCategory().equals(huasanType.getId().toString()))||( "华三产品".equals(a.getCategory())))
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
extend.setHuasanProductAmount(huasan);
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> !a.getCategory().equals( huizhiType.getId().toString()) && !a.getCategory().equals(huazhiType.getId().toString())
&& !a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> isABoolean(a, huizhiType, huazhiType, huasanType)).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
extend.setZiguangOtherAmount(other);
}

View File

@ -77,7 +77,7 @@ public class ProjectInstanceService {
return false;
}
actTaskDefService.completeTaskByProcInsId(projectInstance.getProcessInsId(), approveEnum, message);
actTaskDefService.completeTaskByProcInsId(projectInstance.getProcessInsId(), approveEnum, message,"");
return true;
}

View File

@ -579,7 +579,7 @@ public class ProjectService {
JSONObject obj = JSON.parseObject(json);
ActApproveTypeEnum approveTypeEnum = ActApproveTypeEnum.ofType(obj.getIntValue("type"));
actTaskDefService.completeTaskByProcInsId(projectInstanceRelation.getProcessInsId(),
approveTypeEnum, obj.getString("message"));
approveTypeEnum, obj.getString("message"), obj.getString("fileUrl"));
return ResponseMsg.buildSuccessMsg("审核成功",approvetype);
}

View File

@ -10,4 +10,4 @@ spring.jpa.show-sql=true
admin.domain=https://dzgtest.palmte.cn
upload.path=/home/data/dzg/fourcal
upload.prefix=https://dzgtest.palmte.cn/fourcal/upload
upload.prefix=http://183.230.174.15:8088/fourcal/upload