|
@@ -144,20 +144,26 @@ public class FgwJdapServiceImpl implements IFgwJdapService {
|
|
|
|
|
|
//判断新增节点中有没有重复的
|
|
//判断新增节点中有没有重复的
|
|
for (FgwJdap fgwJdap : fgwJdapList) {
|
|
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("存在相同的月份数据,请检查后重新保存");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//获取当前年月
|
|
//获取当前年月
|