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 { ...@@ -67,9 +67,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 (StringUtils.isBlank(depCode) && !"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;
...@@ -189,7 +192,7 @@ public class DaoUtils { ...@@ -189,7 +192,7 @@ public class DaoUtils {
// 创建人组织机构 // 创建人组织机构
try { try {
String depCode = BeanUtils.getProperty(bean, "depCode"); String depCode = BeanUtils.getProperty(bean, "depCode");
if (StringUtils.isBlank(depCode)) { if (StringUtils.isBlank(depCode) && !"admin".equals(userId)) {
List<String> orgIds = UserSessionUtils.getOrgId(); List<String> orgIds = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!");
depCode = orgIds.get(0); depCode = orgIds.get(0);
...@@ -257,7 +260,7 @@ public class DaoUtils { ...@@ -257,7 +260,7 @@ public class DaoUtils {
// 创建人部门编码 // 创建人部门编码
try { try {
String depCode = MapUtils.getString(map, "depCode"); String depCode = MapUtils.getString(map, "depCode");
if (ObjectUtils.isNullBlank(depCode)) { if (ObjectUtils.isNullBlank(depCode) && !"admin".equals(userId)) {
List<String> orgIds = UserSessionUtils.getOrgId(); List<String> orgIds = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(orgIds, "当前用户未绑定部门,无法操作数据,请联系管理员!");
depCode = orgIds.get(0); 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