Commit eabcd7f0 by liuyang

2024-05-23 优化更改设备管理新增下拉框数据

parent f27c13ea
...@@ -4,8 +4,13 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,8 +4,13 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001; import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -29,12 +34,28 @@ public class ServiceHGSB001 extends ServiceEPBase { ...@@ -29,12 +34,28 @@ public class ServiceHGSB001 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,new HGSB001());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB001.QUERY, new HGSB001()); outInfo = super.query(inInfo, HGSB001.QUERY, new HGSB001());
CommonMethod.initBlock(inInfo, Map qarma = new HashMap();
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null if (!HGSBTools.getRoleDataAuth()){
); String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
return inInfo; qarma.put(User.FIELD_USER_ID,userId);
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
return outInfo;
} }
@Override @Override
......
...@@ -4,7 +4,11 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,7 +4,11 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -20,6 +24,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -20,6 +24,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -31,12 +36,26 @@ public class ServiceHGSB002 extends ServiceEPBase { ...@@ -31,12 +36,26 @@ public class ServiceHGSB002 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,new HGSB002());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB002.QUERY, new HGSB002()); outInfo = super.query(inInfo, HGSB002.QUERY, new HGSB002());
CommonMethod.initBlock(inInfo, Map qarma = new HashMap();
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null if (!HGSBTools.getRoleDataAuth()){
); String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
return inInfo; qarma.put(User.FIELD_USER_ID,userId);
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
qarma.put(HGSB002.FIELD_COMPANY_CODE,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
return outInfo;
} }
@Override @Override
......
...@@ -8,6 +8,7 @@ import com.baosight.hggp.hg.sb.domain.HGSB001; ...@@ -8,6 +8,7 @@ import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002; import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB002A; import com.baosight.hggp.hg.sb.domain.HGSB002A;
import com.baosight.hggp.hg.sb.tools.HGSBTools; import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
...@@ -35,7 +36,13 @@ public class ServiceHGSB002A extends ServiceEPBase { ...@@ -35,7 +36,13 @@ public class ServiceHGSB002A extends ServiceEPBase {
String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB001.FIELD_COMPANY_CODE); String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB001.FIELD_COMPANY_CODE);
String groupCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB002A.FIELD_GROUP_CODE); String groupCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB002A.FIELD_GROUP_CODE);
inInfo = super.query(inInfo, HGSB002A.QUERY, new HGSB002A()); inInfo = super.query(inInfo, HGSB002A.QUERY, new HGSB002A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null); Map qarma = new HashMap();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
//CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID), CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{ new HashMap<String,Object>(){{
put(HGSB001.FIELD_COMPANY_CODE,companyCode); put(HGSB001.FIELD_COMPANY_CODE,companyCode);
......
...@@ -4,8 +4,12 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,8 +4,12 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB003; import com.baosight.hggp.hg.sb.domain.HGSB003;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -34,10 +38,17 @@ public class ServiceHGSB003 extends ServiceEPBase { ...@@ -34,10 +38,17 @@ public class ServiceHGSB003 extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB003.QUERY, new HGSB003()); inInfo = super.query(inInfo, HGSB003.QUERY, new HGSB003());
CommonMethod.initBlock(inInfo, Map qarma = new HashMap();
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID, if (!HGSBTools.getRoleDataAuth()){
DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID, String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
DdynamicEnum.USER_BLOCK_ID), qarma.put(User.FIELD_USER_ID,userId);
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{ new HashMap<String,Object>(){{
put(HGSB003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);}} put(HGSB003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);}}
); );
......
...@@ -4,8 +4,13 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,8 +4,13 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB004; import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -20,6 +25,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -20,6 +25,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -33,9 +39,22 @@ public class ServiceHGSB004 extends ServiceEPBase { ...@@ -33,9 +39,22 @@ public class ServiceHGSB004 extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB004.QUERY, new HGSB004()); inInfo = super.query(inInfo, HGSB004.QUERY, new HGSB004());
CommonMethod.initBlock(inInfo, Map qarma = new HashMap();
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null if (!HGSBTools.getRoleDataAuth()){
); String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
/*Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
qarma.clear();*/
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
return inInfo; return inInfo;
} }
......
...@@ -4,9 +4,12 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,9 +4,12 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.*; import com.baosight.hggp.hg.sb.domain.*;
import com.baosight.hggp.hg.sb.tools.HGSBTools; import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -31,9 +34,22 @@ public class ServiceHGSB004B extends ServiceEPBase { ...@@ -31,9 +34,22 @@ public class ServiceHGSB004B extends ServiceEPBase {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_TASK_STATUS, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_TASK_STATUS, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB002.QUERY, new HGSB002()); inInfo = super.query(inInfo, HGSB002.QUERY, new HGSB002());
CommonMethod.initBlock(inInfo, Map qarma = new HashMap();
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID, DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null if (!HGSBTools.getRoleDataAuth()){
); String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
return inInfo; return inInfo;
} }
......
...@@ -4,8 +4,13 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,8 +4,13 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB005; import com.baosight.hggp.hg.sb.domain.HGSB005;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -17,6 +22,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -17,6 +22,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -30,9 +36,27 @@ public class ServiceHGSB005 extends ServiceEPBase { ...@@ -30,9 +36,27 @@ public class ServiceHGSB005 extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB005.QUERY, new HGSB005()); inInfo = super.query(inInfo, HGSB005.QUERY, new HGSB005());
CommonMethod.initBlock(inInfo, Map qarma = new HashMap();
if (!HGSBTools.getRoleDataAuth()){
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
/*CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null
); );*/
return inInfo; return inInfo;
} }
......
...@@ -4,8 +4,11 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,8 +4,11 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB005A; import com.baosight.hggp.hg.sb.domain.HGSB005A;
import com.baosight.hggp.hg.sb.domain.HGSB005; import com.baosight.hggp.hg.sb.domain.HGSB005;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -34,7 +37,12 @@ public class ServiceHGSB005A extends ServiceEPBase { ...@@ -34,7 +37,12 @@ public class ServiceHGSB005A extends ServiceEPBase {
//String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_COMPANY_CODE); //String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_COMPANY_CODE);
//String groupCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB005A.FIELD_GROUP_CODE); //String groupCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB005A.FIELD_GROUP_CODE);
inInfo = super.query(inInfo, HGSB005A.QUERY, new HGSB005A()); inInfo = super.query(inInfo, HGSB005A.QUERY, new HGSB005A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null); Map qarma = new HashMap();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID), CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{ new HashMap<String,Object>(){{
//put(HGSB005.FIELD_COMPANY_CODE,companyCode); //put(HGSB005.FIELD_COMPANY_CODE,companyCode);
......
...@@ -2,8 +2,11 @@ package com.baosight.hggp.hg.sb.service; ...@@ -2,8 +2,11 @@ package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB004; import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB006; import com.baosight.hggp.hg.sb.domain.HGSB006;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -12,6 +15,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -12,6 +15,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
/** /**
* @author LiuYang * @author LiuYang
...@@ -24,8 +28,13 @@ public class ServiceHGSB006 extends ServiceEPBase { ...@@ -24,8 +28,13 @@ public class ServiceHGSB006 extends ServiceEPBase {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_INIT_CHECK_STATUS, CommonConstant.YesNo.YES_1); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_INIT_CHECK_STATUS, CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSB006.QUERY, new HGSB006()); inInfo = super.query(inInfo, HGSB006.QUERY, new HGSB006());
CommonMethod.initBlock(inInfo, Map qarma = new HashMap();
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null if (!HGSBTools.getRoleDataAuth()){
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null
); );
inInfo.getBlock(EiConstant.queryBlock).removeCol(HGSB004.FIELD_CHECK_STATUS); inInfo.getBlock(EiConstant.queryBlock).removeCol(HGSB004.FIELD_CHECK_STATUS);
return inInfo; return inInfo;
......
...@@ -2,9 +2,12 @@ package com.baosight.hggp.hg.sb.service; ...@@ -2,9 +2,12 @@ package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB004; import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB005; import com.baosight.hggp.hg.sb.domain.HGSB005;
import com.baosight.hggp.hg.sb.domain.HGSB007; import com.baosight.hggp.hg.sb.domain.HGSB007;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlockMeta; import com.baosight.iplat4j.core.ei.EiBlockMeta;
...@@ -13,6 +16,8 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -13,6 +16,8 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** /**
* @author LiuYang * @author LiuYang
...@@ -25,9 +30,13 @@ public class ServiceHGSB007 extends ServiceEPBase { ...@@ -25,9 +30,13 @@ public class ServiceHGSB007 extends ServiceEPBase {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSB007.QUERY, new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL); inInfo = super.query(inInfo, HGSB007.QUERY, new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
CommonMethod.initBlock(inInfo, Map qarma = new HashMap();
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null if (!HGSBTools.getRoleDataAuth()){
); String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null);
return inInfo; return inInfo;
} }
......
...@@ -3,7 +3,10 @@ package com.baosight.hggp.hg.sb.service; ...@@ -3,7 +3,10 @@ package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.RunStatusEnum; import com.baosight.hggp.common.RunStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB008; import com.baosight.hggp.hg.sb.domain.HGSB008;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
...@@ -13,6 +16,8 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -13,6 +16,8 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** /**
* @author LiuYang * @author LiuYang
...@@ -24,9 +29,13 @@ public class ServiceHGSB008 extends ServiceEPBase { ...@@ -24,9 +29,13 @@ public class ServiceHGSB008 extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo,HGSB008.QUERY,new HGSB008()); inInfo = super.query(inInfo,HGSB008.QUERY,new HGSB008());
CommonMethod.initBlock(inInfo, Map qarma = new HashMap();
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null if (!HGSBTools.getRoleDataAuth()){
); String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null);
inInfo.setBlock(RunStatusEnum.generatorEiBlock()); inInfo.setBlock(RunStatusEnum.generatorEiBlock());
return inInfo; return inInfo;
} }
......
...@@ -393,6 +393,9 @@ ...@@ -393,6 +393,9 @@
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="type"> <isNotEmpty prepend=" AND " property="type">
ORG_TYPE = #type# ORG_TYPE = #type#
</isNotEmpty> </isNotEmpty>
......
package com.baosight.hggp.hg.sb.tools; package com.baosight.hggp.hg.sb.tools;
import com.baosight.hggp.common.DataAuthTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002; import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB002A; import com.baosight.hggp.hg.sb.domain.HGSB002A;
import com.baosight.hggp.hg.sb.domain.HGSB004; import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB004A; import com.baosight.hggp.hg.sb.domain.HGSB004A;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.UserGroup;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
/** /**
* @author LiuYang * @author LiuYang
...@@ -19,6 +23,64 @@ import java.util.Map; ...@@ -19,6 +23,64 @@ import java.util.Map;
*/ */
public class HGSBTools { public class HGSBTools {
/*查询当前用户是否拥有全部权限*/
public static Boolean getRoleDataAuth(){
boolean onlyPeople = false;
// 当前用户所有角色
List<UserGroup> userGroups = UserSessionUtils.getRole();
for (UserGroup userGroup : userGroups) {
String dataAuthType = userGroup.getDataAuthType();
if (DataAuthTypeEnum.ALL.getCode().equals(dataAuthType)) {
onlyPeople = true;
}
}
return onlyPeople;
}
/*查询用户所属公司
*/
public static Map<String, Object> getUserCompany(){
Map<String, Object> orgMap = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
orgMap.put(HGSB002.FIELD_COMPANY_CODE,org.getOrgId());
}else {
orgMap.put(HGSB002.FIELD_COMPANY_CODE, org.getOrgId());
}
}
return orgMap;
}
/*查询用户所属公司用户
*/
public static List<String> getOrgId(){
Map<String, Object> orgMap = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
orgMap.put("orgId",org1.getParentOrgId());
}else {
orgMap.put("orgId", org.getParentOrgId());
}
}
List<HashMap<String, Object>> orgIdChildList = DaoBase.getInstance().query("XSOG01.queryOrgChild", orgMap);
List<String> strList = new ArrayList();
Iterator var6 = orgIdChildList.iterator();
while (var6.hasNext()) {
HashMap map = (HashMap) var6.next();
strList.add(map.get("ORG_ID").toString());
}
return strList;
}
/** /**
* Hgsb002公共DAO方法定义 * Hgsb002公共DAO方法定义
* *
...@@ -48,6 +110,7 @@ public class HGSBTools { ...@@ -48,6 +110,7 @@ public class HGSBTools {
List<HGSB002A> results = DaoBase.getInstance().query(HGSB002A.QUERY, queryMap); List<HGSB002A> results = DaoBase.getInstance().query(HGSB002A.QUERY, queryMap);
return results; return results;
} }
} }
/** /**
......
...@@ -170,7 +170,9 @@ ...@@ -170,7 +170,9 @@
(SELECT @CODES:=GROUP_CONCAT(ORG_ID) (SELECT @CODES:=GROUP_CONCAT(ORG_ID)
FROM ${platSchema}.TXSOG01 FROM ${platSchema}.TXSOG01
WHERE FIND_IN_SET(PARENT_ORG_ID, @CODES) WHERE FIND_IN_SET(PARENT_ORG_ID, @CODES)
AND ACCOUNT_CODE = #accountCode# <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
AND IS_DELETED = 0 AND IS_DELETED = 0
) AS T1, ) AS T1,
@LEVEL:=@LEVEL+1 AS LEVEL @LEVEL:=@LEVEL+1 AS LEVEL
......
$(function () { $(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows(); var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows(); var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
...@@ -78,22 +78,10 @@ $(function () { ...@@ -78,22 +78,10 @@ $(function () {
},{ },{
field: "groupCode", field: "groupCode",
title: "设备区域", title: "设备区域",
filter: function (options) {
var companyCode = options.model['companyCode'];
if(companyCode) {
// 返回我们过滤后的数据集
return _.filter(groupCodeBox, function (item) {
return item["param3Field"] === companyCode;
})
}
return groupCodeBox;
},
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) { for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) { if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) {
dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1] dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1]
dataItem['factoryCode'] = groupCodeBox[i]['param1Field']
dataItem['factoryName'] = groupCodeBox[i]['param2Field']
return groupCodeBox[i]['textField'].split("]")[1]; return groupCodeBox[i]['textField'].split("]")[1];
} }
} }
...@@ -119,9 +107,7 @@ $(function () { ...@@ -119,9 +107,7 @@ $(function () {
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化 // 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化 // 判断父级节点是否发生变化
if (e.field === "companyCode") { if (e.field === "groupCode") {
loadChange(grid,e,"groupCode");
}else if (e.field === "groupCode") {
if (e.items[0].companyCode.length===0){ if (e.items[0].companyCode.length===0){
loadChange(grid,e,"companyCode"); loadChange(grid,e,"companyCode");
} }
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true" maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="deviceType" cname="设备类型" <EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
......
$(function () { $(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows(); var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows(); var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows(); var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
...@@ -94,7 +94,7 @@ $(function () { ...@@ -94,7 +94,7 @@ $(function () {
}, { }, {
field: "groupCode", field: "groupCode",
title: "设备区域", title: "设备区域",
filter: function (options) { /*filter: function (options) {
var companyCode = options.model['companyCode']; var companyCode = options.model['companyCode'];
if(companyCode) { if(companyCode) {
// 返回我们过滤后的数据集 // 返回我们过滤后的数据集
...@@ -103,13 +103,13 @@ $(function () { ...@@ -103,13 +103,13 @@ $(function () {
}) })
} }
return groupCodeBox; return groupCodeBox;
}, },*/
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) { for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) { if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) {
dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1] dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1]
dataItem['factoryCode'] = groupCodeBox[i]['param1Field'] //dataItem['factoryCode'] = groupCodeBox[i]['param1Field']
dataItem['factoryName'] = groupCodeBox[i]['param2Field'] //dataItem['factoryName'] = groupCodeBox[i]['param2Field']
return groupCodeBox[i]['textField'].split("]")[1]; return groupCodeBox[i]['textField'].split("]")[1];
} }
} }
......
$(function () { $(function () {
var deviceCodeBox = __eiInfo.getBlock("deviceCodeBox_block_id").getMappedRows(); var deviceCodeBox = __eiInfo.getBlock("deviceCodeBox_block_id").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows(); var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true" maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="deviceType" cname="设备类型" <EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
......
...@@ -36,8 +36,8 @@ $(function () { ...@@ -36,8 +36,8 @@ $(function () {
if (auditStatus == 0) { if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>'; 'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + /*template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',-1)" >审批未通过</a>'; 'onclick="updateStatus(' + item.id + ',-1)" >审批未通过</a>';*/
} }
if (auditStatus == -1){ if (auditStatus == -1){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
......
$(function () { $(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows(); var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows(); //var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows(); var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
......
$(function () { $(function () {
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows(); var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true" maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="planDate" cname="计划日期" width="120" enable="true" readonly="true" align="center" editType="date" <EF:EFColumn ename="planDate" cname="计划日期" width="120" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
$(function () { $(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows(); var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows(); //var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows(); var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/> <EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" <EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
......
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