feat(流程): 添加财务人员任务跳转功能并更新相关服务- 在 ActTaskDefService 中添加了财务人员任务跳转的逻辑
- 更新了 ProjectBudgetService 中的预算计算方法,支持按名称过滤 - 修改了 ProjectInstanceService 和 ProjectService 中的任务完成方法,增加了文件 URL 参数 - 更新了 application-local.properties 中的上传路径配置dev_2.0.2
parent
4dba9a69cb
commit
baabb3c5bc
|
@ -74,6 +74,10 @@ public class ActTaskDefService {
|
||||||
ActTaskDef actTaskDef = findFirstByProcDefIdAndTaskKey(currentTask.getProcessDefinitionId(), currentTask.getTaskDefinitionKey());
|
ActTaskDef actTaskDef = findFirstByProcDefIdAndTaskKey(currentTask.getProcessDefinitionId(), currentTask.getTaskDefinitionKey());
|
||||||
|
|
||||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(procInsId).singleResult();
|
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);
|
taskService.setAssignee(taskId, userId);
|
||||||
if (ActConstant.TASK_TYPE_SINGE == actTaskDef.getTaskType()) {
|
if (ActConstant.TASK_TYPE_SINGE == actTaskDef.getTaskType()) {
|
||||||
handleSinge(processInstance, taskId, approveEnum, actTaskDef);
|
handleSinge(processInstance, taskId, approveEnum, actTaskDef);
|
||||||
|
@ -93,10 +97,10 @@ public class ActTaskDefService {
|
||||||
* @param approveEnum
|
* @param approveEnum
|
||||||
* @param comment
|
* @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();
|
List<Task> taskList = taskService.createTaskQuery().processInstanceId(procInsId).list();
|
||||||
for (Task task : taskList) {
|
for (Task task : taskList) {
|
||||||
completeTask(task.getId(), procInsId, comment, approveEnum, "");
|
completeTask(task.getId(), procInsId, comment, approveEnum, fileUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1052,20 +1052,28 @@ public class ProjectBudgetService {
|
||||||
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
||||||
if (projectBudgetCostDetails.size() > 0) {
|
if (projectBudgetCostDetails.size() > 0) {
|
||||||
ProcurementType huizhiType = procurementTypeRepository.findByName("汇智产品");
|
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);
|
budget.setHuizhiProductAmountBudget(huizhi);
|
||||||
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
|
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);
|
budget.setHuazhiProductAmountBudget(huazhi);
|
||||||
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
|
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);
|
budget.setHuasanProductAmountBudget(huasan);
|
||||||
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> !a.getCategory().equals( huizhiType.getId().toString()) && !a.getCategory().equals(huazhiType.getId().toString())
|
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> isABoolean(a, huizhiType, huazhiType, huasanType)).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
||||||
&& !a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
||||||
budget.setZiguangOtherAmountBudget(other);
|
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) {
|
private void saveProjectExtend(Project p) {
|
||||||
ProjectExtend extend = projectExtendRepository.findByProjectId(p.getId());
|
ProjectExtend extend = projectExtendRepository.findByProjectId(p.getId());
|
||||||
if (extend == null) {
|
if (extend == null) {
|
||||||
|
@ -1100,16 +1108,18 @@ public class ProjectBudgetService {
|
||||||
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
||||||
if (projectBudgetCostDetails.size() > 0) {
|
if (projectBudgetCostDetails.size() > 0) {
|
||||||
ProcurementType huizhiType = procurementTypeRepository.findByName("汇智产品");
|
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);
|
extend.setHuizhiProductAmount(huizhi);
|
||||||
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
|
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);
|
extend.setHuazhiProductAmount(huazhi);
|
||||||
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
|
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);
|
extend.setHuasanProductAmount(huasan);
|
||||||
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> !a.getCategory().equals( huizhiType.getId().toString()) && !a.getCategory().equals(huazhiType.getId().toString())
|
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> isABoolean(a, huizhiType, huazhiType, huasanType)).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
||||||
&& !a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
||||||
extend.setZiguangOtherAmount(other);
|
extend.setZiguangOtherAmount(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class ProjectInstanceService {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
actTaskDefService.completeTaskByProcInsId(projectInstance.getProcessInsId(), approveEnum, message);
|
actTaskDefService.completeTaskByProcInsId(projectInstance.getProcessInsId(), approveEnum, message,"");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -579,7 +579,7 @@ public class ProjectService {
|
||||||
JSONObject obj = JSON.parseObject(json);
|
JSONObject obj = JSON.parseObject(json);
|
||||||
ActApproveTypeEnum approveTypeEnum = ActApproveTypeEnum.ofType(obj.getIntValue("type"));
|
ActApproveTypeEnum approveTypeEnum = ActApproveTypeEnum.ofType(obj.getIntValue("type"));
|
||||||
actTaskDefService.completeTaskByProcInsId(projectInstanceRelation.getProcessInsId(),
|
actTaskDefService.completeTaskByProcInsId(projectInstanceRelation.getProcessInsId(),
|
||||||
approveTypeEnum, obj.getString("message"));
|
approveTypeEnum, obj.getString("message"), obj.getString("fileUrl"));
|
||||||
|
|
||||||
return ResponseMsg.buildSuccessMsg("审核成功",approvetype);
|
return ResponseMsg.buildSuccessMsg("审核成功",approvetype);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,4 @@ spring.jpa.show-sql=true
|
||||||
admin.domain=https://dzgtest.palmte.cn
|
admin.domain=https://dzgtest.palmte.cn
|
||||||
|
|
||||||
upload.path=/home/data/dzg/fourcal
|
upload.path=/home/data/dzg/fourcal
|
||||||
upload.prefix=https://dzgtest.palmte.cn/fourcal/upload
|
upload.prefix=http://183.230.174.15:8088/fourcal/upload
|
Loading…
Reference in New Issue