|
@@ -61,18 +61,29 @@ public class AppointmentService {
|
|
|
}
|
|
|
mzClasses = new ArrayList<>();
|
|
|
JSONObject param = new JSONObject();
|
|
|
- for (Map<String, String> item : response.getData()) {
|
|
|
+ for (Map<String, Object> item : response.getData()) {
|
|
|
MzClass pojo = new MzClass();
|
|
|
- pojo.setId(item.get("code"));
|
|
|
- pojo.setText(item.get("name"));
|
|
|
+ pojo.setId(item.get("code").toString());
|
|
|
+ pojo.setText(item.get("name").toString());
|
|
|
param.put("mzClass", pojo.getId());
|
|
|
MzClassResponse response2 = template.postForObject(hrgApiUrl + "/getUnitCodeByMzClass", param, MzClassResponse.class);
|
|
|
if (null != response2 && response2.getResultCode() == 0) {
|
|
|
List<MzDept> children = new ArrayList<>();
|
|
|
- for (Map<String, String> child : response2.getData()) {
|
|
|
+ for (Map<String, Object> child : response2.getData()) {
|
|
|
MzDept dept = new MzDept();
|
|
|
- dept.setId(child.get("code"));
|
|
|
- dept.setText(child.get("name"));
|
|
|
+ dept.setId(child.get("code").toString());
|
|
|
+ dept.setText(child.get("name").toString());
|
|
|
+ List<Map<String, Object>> grandChildrenMap = CastUtil.cast(child.get("children"));
|
|
|
+ if (null != grandChildrenMap && grandChildrenMap.size() > 0) {
|
|
|
+ List<MzDept> grandChildren = new ArrayList<>();
|
|
|
+ for (Map<String, Object> temp : grandChildrenMap) {
|
|
|
+ MzDept mzDept = new MzDept();
|
|
|
+ mzDept.setId(temp.get("code").toString());
|
|
|
+ mzDept.setText(temp.get("name").toString());
|
|
|
+ grandChildren.add(mzDept);
|
|
|
+ }
|
|
|
+ dept.setChildren(grandChildren);
|
|
|
+ }
|
|
|
children.add(dept);
|
|
|
}
|
|
|
pojo.setChildren(children);
|