ソースを参照

经营报表oa

zouxuan 2 年 前
コミット
159eb78973

+ 18 - 20
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -254,7 +254,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
             JSONObject formData = JSONObject.parseObject(financialExpenditureDao.getFormData(workOrderId));
             OaFormStructureDto oaFormStructureDto = JSONObject.parseObject(formStructure, OaFormStructureDto.class);
             List<OaInputDto> oaInputDtos = oaFormStructureDto.getList();
-            Date now = new Date();
             //课程退费和乐团退费需要单独处理
             if(pWorkOrderInfo.getProcess().equals(33) ||
                     pWorkOrderInfo.getProcess().equals(22) ||
@@ -265,34 +264,31 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                 List<FinancialExpenditure> financialExpenditureList = new ArrayList<>();
                 Integer organId = null;
                 String note = "";
+                ExpenditureTypeEnum expenditureTypeEnum = ExpenditureTypeEnum.REFUND;
+                FeeProjectEnum feeProjectEnum = FeeProjectEnum.REFUND;
                 BigDecimal totalAmount = BigDecimal.ZERO;
                 for (OaInputDto oaInputDto : oaInputDtos) {
+                    String submitForm = oaInputDto.getModel();
+                    Object submitValue = formData.get(submitForm);
+                    if(Objects.isNull(submitValue)){
+                        continue;
+                    }
                     if (StringUtils.equals("分部",oaInputDto.getName())) {
-                        String submitForm = oaInputDto.getModel();
-                        if(Objects.isNull(formData.get(submitForm))){
-                            continue;
-                        }
-                        organId = Integer.parseInt(formData.get(submitForm).toString());
+                        organId = Integer.parseInt(submitValue.toString());
                     }
                     if (StringUtils.equals("情况说明",oaInputDto.getName())) {
-                        String submitForm = oaInputDto.getModel();
-                        if(Objects.isNull(formData.get(submitForm))){
-                            continue;
-                        }
-                        note = formData.get(submitForm).toString();
+                        note = submitValue.toString();
                     }
                     if (StringUtils.equals("金额",oaInputDto.getName())) {
-                        String submitForm = oaInputDto.getModel();
-                        if(Objects.isNull(formData.get(submitForm))){
-                            continue;
-                        }
-                        totalAmount = new BigDecimal(formData.get(submitForm).toString());
+                        totalAmount = new BigDecimal(submitValue.toString());
                     }
-                    if(!StringUtils.equals("子表单",oaInputDto.getName()) && !StringUtils.equals("分摊明细",oaInputDto.getName())){
-                        continue;
+                    if (StringUtils.equals("支出类型",oaInputDto.getName())) {
+                        expenditureTypeEnum = ExpenditureTypeEnum.valueOfDesc(submitValue.toString());
                     }
-                    String submitForm = oaInputDto.getModel();
-                    if(Objects.isNull(formData.get(submitForm))){
+                    if (StringUtils.equals("费用类别",oaInputDto.getName()) || StringUtils.equals("费用类型",oaInputDto.getName())) {
+                        feeProjectEnum = FeeProjectEnum.valueOfDesc(submitValue.toString());
+                    }
+                    if(!StringUtils.equals("子表单",oaInputDto.getName()) && !StringUtils.equals("分摊明细",oaInputDto.getName())){
                         continue;
                     }
                     List<HashMap> hashMaps = JSONObject.parseArray(formData.get(submitForm).toString(), HashMap.class);
@@ -324,6 +320,8 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                                 }
                                             }
                                         }
+                                        financialExpenditure.setFeeProject(feeProjectEnum);
+                                        financialExpenditure.setType(expenditureTypeEnum);
                                         financialExpenditure.setAprovalTime(endTime);
                                         financialExpenditure.setPaymentTime(endTime);
                                         financialExpenditure.setAmount(totalAmount);