Forráskód Böngészése

新增字段企业融资

Administrator 2 éve
szülő
commit
215f2d2621

+ 19 - 13
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/FgwJdapServiceImpl.java

@@ -144,20 +144,26 @@ public class FgwJdapServiceImpl implements IFgwJdapService {
 
         //判断新增节点中有没有重复的
         for (FgwJdap fgwJdap : fgwJdapList) {
-            String[] t = String.valueOf(fgwJdap.getJdsj()).split("-");
-            fgwJdap.setYear(t[0]);
-            fgwJdap.setMonth(t[1]);
-            int i = 0;
-            for (FgwJdap fgwJdapz : fgwJdapList) {
-                String[] t1 = String.valueOf(fgwJdapz.getJdsj()).split("-");
-                fgwJdapz.setYear(t1[0]);
-                fgwJdapz.setMonth(t1[1]);
-                if(fgwJdap.getYear().equals(fgwJdapz.getYear()) && fgwJdap.getMonth().equals(fgwJdapz.getMonth())){
-                    i++;
+            String jdsj = fgwJdap.getJdsj();
+            if (StringUtils.isNotBlank(jdsj)){
+                String[] t = jdsj.split("-");
+                fgwJdap.setYear(t[0]);
+                fgwJdap.setMonth(t[1]);
+                int i = 0;
+                for (FgwJdap fgwJdapz : fgwJdapList) {
+                    String jdsj1 = fgwJdapz.getJdsj();
+                    if (StringUtils.isNotBlank(jdsj1)){
+                        String[] t1 = jdsj1.split("-");
+                        fgwJdapz.setYear(t1[0]);
+                        fgwJdapz.setMonth(t1[1]);
+                        if(fgwJdap.getYear().equals(fgwJdapz.getYear()) && fgwJdap.getMonth().equals(fgwJdapz.getMonth())){
+                            i++;
+                        }
+                    }
+                }
+                if(i>1){
+                    return AjaxResult.error("存在相同的月份数据,请检查后重新保存");
                 }
-            }
-            if(i>1){
-                return AjaxResult.error("存在相同的月份数据,请检查后重新保存");
             }
         }
         //获取当前年月