فهرست منبع

修改企业效益监测评估接口传入空值报错

ljx 1 ماه پیش
والد
کامیت
8027d6a006

+ 10 - 4
enteprise-admin/src/main/java/com/enteprise/benefit_monitor_assess/service/impl/BusinessMonitorAssessService.java

@@ -29,13 +29,19 @@ public class BusinessMonitorAssessService implements IBusinessMonitorAssessServi
         List<EnterpriseBaseDataTotal> previousDataTotal = new ArrayList<>();
         String year = businessMonitorAssess.getYear();
         String season = businessMonitorAssess.getSeason();
+        String code = businessMonitorAssess.getCode();
+        String enterpriseName = businessMonitorAssess.getEnterpriseName();
         //若有企业、行业过滤直接赋值进行筛选
-        dataTotal.setCode(businessMonitorAssess.getCode());
-        dataTotal.setEnterpriseName(businessMonitorAssess.getEnterpriseName());
+        if (code != null && !code.isEmpty()) {
+            dataTotal.setCode(code);
+        }
+        if (enterpriseName != null && !enterpriseName.isEmpty()) {
+            dataTotal.setEnterpriseName(enterpriseName);
+        }
         //if趋势分析,获取上一个季度的工业产值、电力消耗、实缴税金、本季度实缴税金
-        if (year !=null || !year.equals("")) {
+        if (year !=null && !year.isEmpty()) {
             //精确到年份
-            if (season != null) {
+            if (season != null && !season.isEmpty()) {
                 //精确到季度
                 setDataWithYearAndSeason(year, season, dataTotal);
                 currentDataTotal = service.selectEnterpriseBaseDataTotalList(dataTotal);