소스 검색

update 支出录入接口修改

river 4 년 전
부모
커밋
6e5861cf79
1개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. 11 2
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduFinancialExpenditureController.java

+ 11 - 2
mec-web/src/main/java/com/ym/mec/web/controller/education/EduFinancialExpenditureController.java

@@ -14,6 +14,7 @@ import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -50,8 +51,16 @@ public class EduFinancialExpenditureController extends BaseController {
                 Integer cooperationOrganId = cooperationOrganMap.get(financialExpenditure.getCooperationOrganName() + financialExpenditure.getOrganId());
                 financialExpenditure.setCooperationOrganId(cooperationOrganId);
             }
-            financialExpenditure.setType(ExpenditureTypeEnum.valueOf(financialExpenditure.getFeeType()));
-            financialExpenditure.setFeeProject(FeeProjectEnum.valueOf(financialExpenditure.getFeeProjectItem()));
+            for (ExpenditureTypeEnum typeEnum : ExpenditureTypeEnum.values()) {
+                if (typeEnum.getDesc().equals(financialExpenditure.getFeeType())) {
+                    financialExpenditure.setType(typeEnum);
+                }
+            }
+            for (FeeProjectEnum feeProjectEnum : FeeProjectEnum.values()) {
+                if (feeProjectEnum.getDesc().equals(financialExpenditure.getFeeProjectItem())) {
+                    financialExpenditure.setFeeProject(feeProjectEnum);
+                }
+            }
         }
         return succeed(financialExpenditureService.batchAdd(financialExpenditures));
     }