|
@@ -152,13 +152,12 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
if (taskProcessInfo != null) {
|
|
|
//构造基础信息
|
|
|
Map<Long, String> userMap = iUserClient.selectUserAll().stream().filter(f -> ObjectUtil.isNotEmpty(f.getRealName())).collect(Collectors.toMap(User::getId, User::getRealName));
|
|
|
- List<DictInfo> dictInfoList1 = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'report_type'", new BeanPropertyRowMapper<>(DictInfo.class));
|
|
|
- List<DictInfo> dictInfoList2 = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'expense_fr_type'", new BeanPropertyRowMapper<>(DictInfo.class));
|
|
|
+ List<DictInfo> dictInfoListBasics = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'report_type'", new BeanPropertyRowMapper<>(DictInfo.class));
|
|
|
List<ControlProjectInfo> controlProjectInfos = projectInfoServiceImpl.getBaseMapper().selectList(Wrappers.<ControlProjectInfo>lambdaQuery().select(ControlProjectInfo::getId, ControlProjectInfo::getName));
|
|
|
TaskProcessDetailBasicsVO basicsVO = new TaskProcessDetailBasicsVO();
|
|
|
basicsVO.setTaskId(taskProcessInfo.getId());
|
|
|
basicsVO.setTaskName(taskProcessInfo.getTaskName());
|
|
|
- for (DictInfo dictInfo : dictInfoList1) {
|
|
|
+ for (DictInfo dictInfo : dictInfoListBasics) {
|
|
|
if ((taskProcessInfo.getTaskType()).equals(dictInfo.getDictValue().intValue())) {
|
|
|
basicsVO.setReportTypeName(dictInfo.getDictName());
|
|
|
break;
|
|
@@ -191,8 +190,8 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
voRW.setTransferObjectName(userMap.get(voRW.getTransferObject()));
|
|
|
data = voRW;
|
|
|
}
|
|
|
-
|
|
|
break;
|
|
|
+
|
|
|
case 2: //财务
|
|
|
data = jdbcTemplate.query("select * from c_expense_financial_reimbursement_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMFinancialReimbursementInfo.class)).stream().findAny().orElse(null);
|
|
|
EMFinancialReimbursementInfoVO voCW = BeanUtil.copyProperties(data, EMFinancialReimbursementInfoVO.class);
|
|
@@ -203,8 +202,9 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
vo.setPlanTaskInfoList(Collections.singletonList(planTaskInfoList2));
|
|
|
}
|
|
|
}
|
|
|
- for (DictInfo dictInfo : dictInfoList2) {
|
|
|
- if (dictInfo.getDictValue().equals(voCW.getFrType())) {
|
|
|
+ List<DictInfo> dictInfoListCW = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'expense_fr_type'", new BeanPropertyRowMapper<>(DictInfo.class));
|
|
|
+ for (DictInfo dictInfo : dictInfoListCW) {
|
|
|
+ if (voCW.getFrType().equals(dictInfo.getDictValue().intValue())) {
|
|
|
voCW.setFrTypeName(dictInfo.getDictName());
|
|
|
break;
|
|
|
}
|
|
@@ -227,37 +227,114 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
|
|
|
case 3: //支付
|
|
|
data = jdbcTemplate.query("select * from c_expense_pay_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMPayInfo.class)).stream().findAny().orElse(null);
|
|
|
+ EMPayInfoVO voZF = BeanUtil.copyProperties(data, EMPayInfoVO.class);
|
|
|
+ if (voZF != null) {
|
|
|
+ ControlProjectInfo projectInfo = jdbcTemplate.query("select name from c_control_project_info where id = " + voZF.getProjectId(), new BeanPropertyRowMapper<>(ControlProjectInfo.class)).stream().findAny().orElse(null);
|
|
|
+ if (projectInfo != null) {
|
|
|
+ voZF.setProjectName(projectInfo.getName());
|
|
|
+ }
|
|
|
+ voZF.setAfUserName(userMap.get(voZF.getAfUserId()));
|
|
|
+
|
|
|
+ data = voZF;
|
|
|
+ }
|
|
|
break;
|
|
|
+
|
|
|
case 4: //借款
|
|
|
data = jdbcTemplate.query("select * from c_expense_loan_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMLoanInfo.class)).stream().findAny().orElse(null);
|
|
|
break;
|
|
|
+
|
|
|
case 5: //采购
|
|
|
data = jdbcTemplate.query("select * from c_expense_purchase_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMPurchaseInfo.class)).stream().findAny().orElse(null);
|
|
|
+ EMPurchaseInfoVO voCG = BeanUtil.copyProperties(data, EMPurchaseInfoVO.class);
|
|
|
+ if (voCG != null) {
|
|
|
+ List<DictInfo> dictInfoListCG = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'purchase_type'", new BeanPropertyRowMapper<>(DictInfo.class));
|
|
|
+ for (DictInfo dictInfo : dictInfoListCG) {
|
|
|
+ if (voCG.getPurType().equals(dictInfo.getDictValue().intValue())) {
|
|
|
+ voCG.setPurTypeName(dictInfo.getDictName());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ data = voCG;
|
|
|
+ }
|
|
|
break;
|
|
|
+
|
|
|
case 6: //用车
|
|
|
data = jdbcTemplate.query("select * from c_expense_use_car_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMUseCarInfo.class)).stream().findAny().orElse(null);
|
|
|
break;
|
|
|
+
|
|
|
case 7: //发票
|
|
|
data = jdbcTemplate.query("select * from c_expense_invoice_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMInvoiceInfo.class)).stream().findAny().orElse(null);
|
|
|
+ EMInvoiceInfoVO voFP = BeanUtil.copyProperties(data, EMInvoiceInfoVO.class);
|
|
|
+ if (voFP != null) {
|
|
|
+ ControlProjectInfo projectInfo = jdbcTemplate.query("select name from c_control_project_info where id = " + voFP.getProjectId(), new BeanPropertyRowMapper<>(ControlProjectInfo.class)).stream().findAny().orElse(null);
|
|
|
+ if (projectInfo != null) {
|
|
|
+ voFP.setProjectName(projectInfo.getName());
|
|
|
+ }
|
|
|
+ List<DictInfo> dictInfoListFP = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'invoice_type'", new BeanPropertyRowMapper<>(DictInfo.class));
|
|
|
+ for (DictInfo dictInfo : dictInfoListFP) {
|
|
|
+ if (voFP.getInvoiceType().equals(dictInfo.getDictValue().intValue())) {
|
|
|
+ voFP.setInvoiceTypeName(dictInfo.getDictName());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ voFP.setInvoiceUserName(userMap.get(voFP.getInvoiceUserId()));
|
|
|
+ //TODO 发票抬头等信息
|
|
|
|
|
|
+ data = voFP;
|
|
|
+ }
|
|
|
break;
|
|
|
+
|
|
|
case 8: //外包
|
|
|
data = jdbcTemplate.query("select * from c_expense_outsourcing_pay_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMOutsourcingPayInfo.class)).stream().findAny().orElse(null);
|
|
|
+ EMOutsourcingPayInfoVO voWB = BeanUtil.copyProperties(data, EMOutsourcingPayInfoVO.class);
|
|
|
+ if (voWB != null) {
|
|
|
+ ControlProjectInfo projectInfo = jdbcTemplate.query("select name from c_control_project_info where id = " + voWB.getProjectId(), new BeanPropertyRowMapper<>(ControlProjectInfo.class)).stream().findAny().orElse(null);
|
|
|
+ if (projectInfo != null) {
|
|
|
+ voWB.setProjectName(projectInfo.getName());
|
|
|
+ }
|
|
|
+ List<DictInfo> dictInfoListWB = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'outsourcing_type'", new BeanPropertyRowMapper<>(DictInfo.class));
|
|
|
+ for (DictInfo dictInfo : dictInfoListWB) {
|
|
|
+ if (voWB.getOutsourcingType().equals(dictInfo.getDictValue().intValue())) {
|
|
|
+ voWB.setOutsourcingTypeName(dictInfo.getDictName());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ data = voWB;
|
|
|
+ }
|
|
|
break;
|
|
|
+
|
|
|
case 9: //出差
|
|
|
data = jdbcTemplate.query("select * from c_attendance_trip_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(AttendanceTripInfo.class)).stream().findAny().orElse(null);
|
|
|
-
|
|
|
AttendanceTripInfoVO voCC = BeanUtil.copyProperties(data, AttendanceTripInfoVO.class);
|
|
|
if (voCC != null) {
|
|
|
- if (ObjectUtil.isNotEmpty(voCC.getProjectId()) && ObjectUtil.isNotEmpty(voCC.getBudgetPlanIds())) { //如果预算ids不为空,那么证明有关联计划任务(单关联)
|
|
|
- TaskPlanInfoVO planTaskInfoList2 = this.getPlanTaskInfoList(voCC.getBudgetPlanIds(), controlProjectInfos);
|
|
|
- if (planTaskInfoList2 != null) {
|
|
|
- vo.setPlanTaskInfoList(Collections.singletonList(planTaskInfoList2));
|
|
|
+ if (ObjectUtil.isNotEmpty(voCC.getProjectId())) {
|
|
|
+ ControlProjectInfo projectInfo = jdbcTemplate.query("select name from c_control_project_info where id = " + voCC.getProjectId(), new BeanPropertyRowMapper<>(ControlProjectInfo.class)).stream().findAny().orElse(null);
|
|
|
+ if (projectInfo != null) {
|
|
|
+ voCC.setProjectName(projectInfo.getName());
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(voCC.getBudgetPlanIds())) { //如果预算ids不为空,那么证明有关联计划任务(单关联)
|
|
|
+ TaskPlanInfoVO planTaskInfoList2 = this.getPlanTaskInfoList(voCC.getBudgetPlanIds(), controlProjectInfos);
|
|
|
+ if (planTaskInfoList2 != null) {
|
|
|
+ vo.setPlanTaskInfoList(Collections.singletonList(planTaskInfoList2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ObjectUtil.isNotEmpty(voCC.getFellowTravelerUserIds())) {
|
|
|
+ List<String> userIds = Func.toStrList(voCC.getFellowTravelerUserIds());
|
|
|
+ List<String> names = new ArrayList<>();
|
|
|
+ for (String userId : userIds) {
|
|
|
+ String name = userMap.getOrDefault(Long.parseLong(userId), null);
|
|
|
+ if (name != null) {
|
|
|
+ names.add(name);
|
|
|
+ }
|
|
|
}
|
|
|
+ voCC.setFellowTravelerUserNames(StringUtils.join(names, "、"));
|
|
|
}
|
|
|
data = voCC;
|
|
|
}
|
|
|
break;
|
|
|
+
|
|
|
case 10: //成本测算
|
|
|
List<ProjectCostBudget> query = jdbcTemplate.query("select project_id from c_project_cost_budget where id in(" + record.getExpenseInfoId() + ")", new BeanPropertyRowMapper<>(ProjectCostBudget.class));
|
|
|
if (query.size() > 0) {
|
|
@@ -270,6 +347,7 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|