Commit cae6dab8 by 宋祥

Merge branch 'dev-sx' of http://git.pseer.com:8800/platform/hg-smart into dev

parents 97de8883 3fddd8ea
......@@ -67,9 +67,12 @@ public class DaoUtils {
*/
public static void batchInsert(String sql, List rows) {
// 创建人部门
List<String> orgIds = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!");
String depCode = orgIds.get(0);
String depCode = "";
if (StringUtils.isBlank(depCode) && !"admin".equals(UserSessionUtils.getLoginName())) {
List<String> orgIds = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!");
depCode = orgIds.get(0);
}
for (Object row : rows) {
if (row instanceof DaoEPBase) {
DaoEPBase daoEPBase = (DaoEPBase) row;
......@@ -189,7 +192,7 @@ public class DaoUtils {
// 创建人组织机构
try {
String depCode = BeanUtils.getProperty(bean, "depCode");
if (StringUtils.isBlank(depCode)) {
if (StringUtils.isBlank(depCode) && !"admin".equals(userId)) {
List<String> orgIds = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!");
depCode = orgIds.get(0);
......@@ -257,7 +260,7 @@ public class DaoUtils {
// 创建人部门编码
try {
String depCode = MapUtils.getString(map, "depCode");
if (ObjectUtils.isNullBlank(depCode)) {
if (ObjectUtils.isNullBlank(depCode) && !"admin".equals(userId)) {
List<String> orgIds = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!");
depCode = orgIds.get(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment