|
|
@ -33,6 +33,7 @@ public class ZsbServiceImpl implements ZsbService {
|
|
|
|
if (jgid == null) {
|
|
|
|
if (jgid == null) {
|
|
|
|
List<Zsb> result = repository.findAll();
|
|
|
|
List<Zsb> result = repository.findAll();
|
|
|
|
this.fillJgBdzName(result);
|
|
|
|
this.fillJgBdzName(result);
|
|
|
|
|
|
|
|
this.fillLxName(result);
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
List<Zsb> result = repository.findByJgid(jgid);
|
|
|
|
List<Zsb> result = repository.findByJgid(jgid);
|
|
|
@ -42,6 +43,7 @@ public class ZsbServiceImpl implements ZsbService {
|
|
|
|
zsb.setJgName(jg.getMc());
|
|
|
|
zsb.setJgName(jg.getMc());
|
|
|
|
zsb.setBdzName(jg.getBdzName());
|
|
|
|
zsb.setBdzName(jg.getBdzName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.fillLxName(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -62,6 +64,20 @@ public class ZsbServiceImpl implements ZsbService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void fillLxName(List<Zsb> list) {
|
|
|
|
|
|
|
|
List<Lx> lxList = lxRepository.findAll();
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(list) && !CollectionUtils.isEmpty(lxList)) {
|
|
|
|
|
|
|
|
for (Zsb zsb : list) {
|
|
|
|
|
|
|
|
for (Lx lx : lxList) {
|
|
|
|
|
|
|
|
if (lx.getId().equals(zsb.getLxid())) {
|
|
|
|
|
|
|
|
zsb.setLxName(lx.getMc());
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Zsb add(Zsb item) throws Exception {
|
|
|
|
public Zsb add(Zsb item) throws Exception {
|
|
|
|
item.setId(null);
|
|
|
|
item.setId(null);
|
|
|
@ -100,6 +116,10 @@ public class ZsbServiceImpl implements ZsbService {
|
|
|
|
Jg jg = jgService.detail(zsb.getJgid());
|
|
|
|
Jg jg = jgService.detail(zsb.getJgid());
|
|
|
|
zsb.setBdzName(jg.getBdzName());
|
|
|
|
zsb.setBdzName(jg.getBdzName());
|
|
|
|
zsb.setJgName(jg.getMc());
|
|
|
|
zsb.setJgName(jg.getMc());
|
|
|
|
|
|
|
|
Optional<Lx> optionalLx = lxRepository.findById(zsb.getLxid());
|
|
|
|
|
|
|
|
if (optionalLx.isPresent()) {
|
|
|
|
|
|
|
|
zsb.setLxName(optionalLx.get().getMc());
|
|
|
|
|
|
|
|
}
|
|
|
|
return zsb;
|
|
|
|
return zsb;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|