Commit 0729c3b1 by liuyang

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

parents 6ec05079 db80b9ef
...@@ -65,9 +65,12 @@ public class DaoUtils { ...@@ -65,9 +65,12 @@ public class DaoUtils {
*/ */
public static void batchInsert(String sql, List rows) { public static void batchInsert(String sql, List rows) {
// 创建人部门 // 创建人部门
List<String> orgIds = UserSessionUtils.getOrgId(); String depCode = "";
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!"); if (!"admin".equals(UserSessionUtils.getLoginName())) {
String depCode = orgIds.get(0); List<String> orgIds = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!");
depCode = orgIds.get(0);
}
for (Object row : rows) { for (Object row : rows) {
if (row instanceof DaoEPBase) { if (row instanceof DaoEPBase) {
DaoEPBase daoEPBase = (DaoEPBase) row; DaoEPBase daoEPBase = (DaoEPBase) row;
...@@ -145,10 +148,14 @@ public class DaoUtils { ...@@ -145,10 +148,14 @@ public class DaoUtils {
log.warn("写入创建人企业编码失败", e); log.warn("写入创建人企业编码失败", e);
} }
// 创建人组织机构 // 创建人组织机构
List<String> orgIds = UserSessionUtils.getOrgId(); String depCode = "";
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!"); if (!"admin".equals(userId)) {
List<String> orgIds = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!");
depCode = orgIds.get(0);
}
try { try {
BeanUtils.setProperty(bean, "depCode", orgIds.get(0)); BeanUtils.setProperty(bean, "depCode", depCode);
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人部门编码失败", e); log.warn("写入创建人部门编码失败", e);
} }
...@@ -199,11 +206,15 @@ public class DaoUtils { ...@@ -199,11 +206,15 @@ public class DaoUtils {
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人企业编码失败", e); log.warn("写入创建人企业编码失败", e);
} }
// 创建人部门编码 // 创建人组织机构
List<String> orgIds = UserSessionUtils.getOrgId(); String depCode = "";
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!"); if (!"admin".equals(userId)) {
List<String> orgIds = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!");
depCode = orgIds.get(0);
}
try { try {
map.put("depCode", orgIds.get(0)); map.put("depCode", depCode);
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人企业编码失败", e); log.warn("写入创建人企业编码失败", e);
} }
......
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