Ver código fonte

导出bug修改

zouxuan 2 anos atrás
pai
commit
87969d7b21

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -1416,7 +1416,7 @@ public class ExportServiceImpl implements ExportService {
         queryInfo.setOrderType("3");
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
-        params.put("noGroupType","MALL_SELL");
+//        params.put("noGroupType","MALL_SELL");
         int count = studentPaymentRouteOrderDao.queryCount(params);
         if (count <= 0) {
             return BaseController.failed("没有可导出的数据");
@@ -1678,7 +1678,7 @@ public class ExportServiceImpl implements ExportService {
         }
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
-        params.put("notGroupType","MALL_SELL");
+//        params.put("notGroupType","MALL_SELL");
         int count = studentPaymentOrderService.getDao().queryCount(params);
         if (count <= 0) {
             return BaseController.failed("没有可导出的数据");

+ 19 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -264,7 +264,6 @@ 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;
 
@@ -283,9 +282,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                     if (oaInputDto.getName().contains("金额")) {
                         totalAmount = new BigDecimal(submitValue.toString());
                     }
-                    if (StringUtils.equals("支出类型", oaInputDto.getName())) {
-                        expenditureTypeEnum = ExpenditureTypeEnum.valueOfDesc(submitValue.toString());
-                    }
                     if (StringUtils.equals("费用类别", oaInputDto.getName()) || StringUtils.equals("费用类型", oaInputDto.getName())) {
                         feeProjectEnum = FeeProjectEnum.valueOfDesc(submitValue.toString());
                     }
@@ -328,7 +324,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                     }
                                 }
                                 financialExpenditure.setFeeProject(feeProjectEnum);
-                                financialExpenditure.setType(expenditureTypeEnum);
+                                financialExpenditure.setType(getExpenditureType(feeProjectEnum));
                                 financialExpenditure.setAprovalTime(endTime);
                                 financialExpenditure.setPaymentTime(endTime);
                                 financialExpenditure.setAmount(totalAmount);
@@ -356,7 +352,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                             financialExpenditure.setApplyUserId(pWorkOrderInfo.getCreator());
                             financialExpenditure.setProcessId(pWorkOrderInfo.getProcess());
                             financialExpenditure.setEffectiveTime(DateUtil.format(endTime,DateUtil.ISO_YEAR_MONTH_FORMAT));
-                            financialExpenditure.setType(expenditureTypeEnum);
                             List<OaColumnDto> columns = oaInputDto.getColumns();
                             if (columns != null && columns.size() > 0) {
                                 for (OaColumnDto column : columns) {
@@ -391,14 +386,13 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                                 financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
                                             } else if (StringUtils.equals(name,"情况说明") || StringUtils.equals(name,"事由")) {
                                                 financialExpenditure.setCause(o.toString());
-                                            } else if (StringUtils.equals(name,"支出类型")) {
-                                                financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
-                                            } else if (StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")) {
+                                            }else if (StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")) {
                                                 FeeProjectEnum projectEnum = FeeProjectEnum.valueOfDesc(o.toString());
                                                 if(projectEnum == null){
                                                     projectEnum = feeProjectEnum;
                                                 }
                                                 financialExpenditure.setFeeProject(projectEnum);
+                                                financialExpenditure.setType(getExpenditureType(projectEnum));
                                             }else if (StringUtils.equals(name,"日期") || StringUtils.equals(name,"费用发生日期")) {
                                                 financialExpenditure.setPaymentTime(DateUtil.stringToDate(o.toString(),DateUtil.DEFAULT_PATTERN));
                                             } else if (StringUtils.equals(name,"费用分摊月份")) {
@@ -483,11 +477,10 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         for (FinancialExpenditure financialExpenditure : financialExpenditures) {
                             financialExpenditure.setAprovalTime(endTime);
                             financialExpenditure.setPaymentTime(endTime);
-                            financialExpenditure.setType(expenditureTypeEnum);
                             financialExpenditure.setEffectiveTime(DateUtil.format(endTime,DateUtil.ISO_YEAR_MONTH_FORMAT));
                             financialExpenditure.setApplyUser(realName);
-                            financialExpenditure.setType(ExpenditureTypeEnum.REFUND);
                             financialExpenditure.setFeeProject(FeeProjectEnum.REFUND);
+                            financialExpenditure.setType(getExpenditureType(financialExpenditure.getFeeProject()));
                             financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
                             financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
                         }
@@ -525,10 +518,9 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
                     }else if(StringUtils.equals(name,"情况说明")){
                         financialExpenditure.setCause(o.toString());
-                    }else if(StringUtils.equals(name,"支出类型")){
-                        financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
                     }else if(StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")){
                         financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
+                        financialExpenditure.setType(getExpenditureType(financialExpenditure.getFeeProject()));
                     }
                 }
                 financialExpenditureDao.insert(financialExpenditure);
@@ -536,6 +528,19 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
         }
     }
 
+    public static ExpenditureTypeEnum getExpenditureType(FeeProjectEnum feeProjectEnum) {
+        switch (feeProjectEnum) {
+            case REFUND:
+                return ExpenditureTypeEnum.REFUND;
+            case HOUSE:
+            case OFFICE:
+            case MAINS_PROPERTY:
+                return ExpenditureTypeEnum.FIXED;
+            default:
+                return ExpenditureTypeEnum.VARIABLE;
+        }
+    }
+
     @Override
     public void checkCourseReturnFee(Map<String,String> paramMap) {
         String tplInfoId = paramMap.get("tplInfoId");
@@ -721,4 +726,5 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
         }
         return financialExpenditureList;
     }
+
 }