|
@@ -102,20 +102,21 @@ public class LawenforcementRecordServiceImpl extends BaseServiceImpl implements
|
|
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
|
+ int i = 0;
|
|
//新增子表信息
|
|
//新增子表信息
|
|
if (StringUtils.isNotEmpty(standardAddList)) {
|
|
if (StringUtils.isNotEmpty(standardAddList)) {
|
|
- recordMapper.insertStandardByList(standardAddList);
|
|
|
|
|
|
+ i += recordMapper.insertStandardByList(standardAddList);
|
|
}
|
|
}
|
|
if (StringUtils.isNotEmpty(subitemAddList)) {
|
|
if (StringUtils.isNotEmpty(subitemAddList)) {
|
|
- recordMapper.insertSubitemByList(subitemAddList);
|
|
|
|
|
|
+ i += recordMapper.insertSubitemByList(subitemAddList);
|
|
}
|
|
}
|
|
if (StringUtils.isNotEmpty(personAddList)) {
|
|
if (StringUtils.isNotEmpty(personAddList)) {
|
|
- recordMapper.insertPersonByList(personAddList);
|
|
|
|
|
|
+ i += recordMapper.insertPersonByList(personAddList);
|
|
}
|
|
}
|
|
- int i = 0;
|
|
|
|
|
|
+
|
|
//执行批量写入操作
|
|
//执行批量写入操作
|
|
if (StringUtils.isNotEmpty(recordAddList)) {
|
|
if (StringUtils.isNotEmpty(recordAddList)) {
|
|
- i = recordMapper.insertRecordByList(recordAddList);
|
|
|
|
|
|
+ return recordMapper.insertRecordByList(recordAddList);
|
|
}
|
|
}
|
|
return i;
|
|
return i;
|
|
}
|
|
}
|
|
@@ -410,18 +411,16 @@ public class LawenforcementRecordServiceImpl extends BaseServiceImpl implements
|
|
//取出部门集合
|
|
//取出部门集合
|
|
List<Map<String, Object>> deptList = (List<Map<String, Object>>) ajaxResult.get("data");
|
|
List<Map<String, Object>> deptList = (List<Map<String, Object>>) ajaxResult.get("data");
|
|
//如果部门集合不为空,则转换为key-value 部门名称-部门id
|
|
//如果部门集合不为空,则转换为key-value 部门名称-部门id
|
|
|
|
+ HashMap<String, Object> deptMap = new HashMap<>();
|
|
if (StringUtils.isNotEmpty(deptList)) {
|
|
if (StringUtils.isNotEmpty(deptList)) {
|
|
- HashMap<String, Object> deptMap = new HashMap<>();
|
|
|
|
deptList.forEach(dept -> {
|
|
deptList.forEach(dept -> {
|
|
deptMap.put(MapUtils.getString(dept, "deptName"), MapUtils.getString(dept, "deptId"));
|
|
deptMap.put(MapUtils.getString(dept, "deptName"), MapUtils.getString(dept, "deptId"));
|
|
});
|
|
});
|
|
-
|
|
|
|
- //设置部门id,如果deptMap不存在key,则设置deptId为null
|
|
|
|
- persons.forEach(person -> {
|
|
|
|
- person.setDeptId(deptMap.containsKey(person.getDeptName()) ? MapUtils.getString(deptMap, person.getDeptName()) : null);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+ //设置部门id,如果deptMap不存在key,则设置deptId为null
|
|
|
|
+ persons.forEach(person -> {
|
|
|
|
+ person.setDeptId(deptMap.containsKey(person.getDeptName()) ? MapUtils.getString(deptMap, person.getDeptName()) : null);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|