Commit 0717d4f9 by liuyang

2024-06-26 设备管理根据角色查询公司

parent 4caab276
......@@ -44,6 +44,7 @@ public class HGSB001 extends DaoEPBase {
public static final String FIELD_MAINTAIN_DATE = "maintainDate"; /* 保养日期*/
public static final String FIELD_DEVICE_USER_ID = "deviceUserId"; /* 设备负责人*/
public static final String FIELD_DEVICE_STATUS = "deviceStatus"; /* 设备状态 0-停止 1-启用*/
public static final String FIELD_COMPANY_CODES = "companyCodes";
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
......
......@@ -9,6 +9,7 @@ import com.baosight.hggp.hg.constant.HGConstant;
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.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -36,29 +37,18 @@ public class ServiceHGSB001 extends ServiceEPBase {
@Override
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);
outInfo = super.query(inInfo, HGSB001.QUERY, new HGSB001());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
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.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);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_FACTORY_CODE,companyCode);
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
outInfo = super.query(inInfo, HGSB001.QUERY, new HGSB001());
Map<String,Object> qarma = new HashMap<>();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败!");
}
return outInfo;
}
......@@ -71,6 +61,10 @@ public class ServiceHGSB001 extends ServiceEPBase {
if (!purchaseDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB001.FIELD_PURCHASE_DATE,StringUtil.removeHorizontalLine(purchaseDate));
}
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if (!roleCompanyCode.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
}
return super.query(inInfo,HGSB001.QUERY,new HGSB001());
}
......
......@@ -9,6 +9,7 @@ import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002A;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -37,28 +38,18 @@ public class ServiceHGSB002 extends ServiceEPBase {
@Override
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);
outInfo = super.query(inInfo, HGSB002.QUERY, new HGSB002());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
try {
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
Map<String,Object> qarma = new HashMap<>();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
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.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);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "companyStr",companyCode);
}
return outInfo;
}
......@@ -78,6 +69,12 @@ public class ServiceHGSB002 extends ServiceEPBase {
if (!planEndDate.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB002.FIELD_PLAN_END_DATE, StringUtil.removeHorizontalLine(planEndDate));
}
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGSB002.QUERY,new HGSB002());
}
......
......@@ -6,17 +6,16 @@ import com.baosight.hggp.core.constant.CommonConstant;
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.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB003;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -41,39 +40,17 @@ public class ServiceHGSB003 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,new HGSB003());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
outInfo = super.query(inInfo, HGSB003.QUERY, new HGSB003());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
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);
qarma.clear();
try {
Map<String,Object> qarma = new HashMap<>();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!"company".equals(org.getOrgType())) {
//如果不是公司公司,则找到上一级
List<Org> orgList1 = HGXSTools.XsOrg.queryParent(org.getOrgId());
for (Org org1:orgList1) {
if ("company".equals(org1.getOrgType()) && !"root".equals(org1.getParentOrgId())) {
qarma.put(HGSB003.FIELD_COMPANY_CODE,org1.getOrgId());
}
}
}else {
qarma.put(HGSB003.FIELD_COMPANY_CODE,org.getOrgId());
}
}
qarma.put(HGSB003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID));
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "companyStr",companyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID));
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
return outInfo;
}
......@@ -86,6 +63,11 @@ public class ServiceHGSB003 extends ServiceEPBase {
if (!applyDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB003.FIELD_APPLY_DATE, StringUtil.removeHorizontalLine(applyDate));
}
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGSB003.QUERY,new HGSB003());
}
......
......@@ -7,16 +7,15 @@ 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.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -40,28 +39,16 @@ public class ServiceHGSB004 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,new HGSB004());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
outInfo = super.query(inInfo, HGSB004.QUERY, new HGSB004());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
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(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "companyStr",companyCode);
try {
Map<String,Object> qarma = new HashMap<>();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
return outInfo;
}
......@@ -73,6 +60,11 @@ public class ServiceHGSB004 extends ServiceEPBase {
if (!planDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB004.FIELD_INSPEC_DATE, StringUtil.removeHorizontalLine(planDate));
}
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGSB004.QUERY,new HGSB004());
}
......
......@@ -8,6 +8,7 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.*;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -36,22 +37,17 @@ public class ServiceHGSB004B extends ServiceEPBase {
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_PLAN_STATUS, CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSB002.QUERY, new HGSB002());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
try {
Map<String,Object> qarma = new HashMap<>();
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
List<String> orgIds = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
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;
}
......@@ -63,6 +59,11 @@ public class ServiceHGSB004B extends ServiceEPBase {
if (!planDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB002.FIELD_PLAN_DATE, StringUtil.removeHorizontalLine(planDate));
}
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGSB002.QUERY,new HGSB002());
}
......
......@@ -7,9 +7,11 @@ 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.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB005;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -37,29 +39,17 @@ public class ServiceHGSB005 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,new HGSB005());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
outInfo = super.query(inInfo, HGSB005.QUERY, new HGSB005());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
try {
Map<String,Object> qarma = new HashMap<>();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
//角色公司
List<String> orgIds = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
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);
/*CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null
);*/
return outInfo;
}
......@@ -71,6 +61,11 @@ public class ServiceHGSB005 extends ServiceEPBase {
if (!upkeepDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB005.FIELD_UPKEEP_DATE, StringUtil.removeHorizontalLine(upkeepDate));
}
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGSB005.QUERY,new HGSB005());
}
......@@ -117,9 +112,9 @@ public class ServiceHGSB005 extends ServiceEPBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
for (Map resultRow : resultRows) {
HGSB005 hgsb005 = new HGSB005();
hgsb005.fromMap(resultRows.get(i));
hgsb005.fromMap(resultRow);
if (hgsb005.getId() == null || hgsb005.getId() == 0) {
this.add(hgsb005);
} else {
......
......@@ -3,14 +3,18 @@ package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB006;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.LangUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
......@@ -29,17 +33,12 @@ public class ServiceHGSB006 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,new HGSB006());
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);
outInfo = super.query(inInfo, HGSB006.QUERY, new HGSB006());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
try {
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null);
//outInfo.getBlock(EiConstant.queryBlock).removeCol(HGSB004.FIELD_CHECK_STATUS);
return outInfo;
}
......@@ -47,6 +46,11 @@ public class ServiceHGSB006 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
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);
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGSB006.QUERY,new HGSB006());
}
}
......@@ -3,15 +3,15 @@ package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB005;
import com.baosight.hggp.hg.sb.domain.HGSB007;
import com.baosight.hggp.hg.sb.domain.*;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -32,16 +32,12 @@ public class ServiceHGSB007 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,new HGSB007());
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);
outInfo = super.query(inInfo, HGSB007.QUERY, new HGSB007(),false, new HGSB007().eiMetadata, EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
try {
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null);
return outInfo;
}
......@@ -49,6 +45,11 @@ public class ServiceHGSB007 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
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);
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGSB007.QUERY,new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
}
}
......@@ -4,11 +4,15 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.RunStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB008;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -17,6 +21,7 @@ import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -27,16 +32,13 @@ public class ServiceHGSB008 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo,HGSB008.QUERY,new HGSB008());
Map qarma = new HashMap();
if (!HGSBTools.getRoleDataAuth()){
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
try {
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null);
inInfo.setBlock(RunStatusEnum.generatorEiBlock());
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
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());
return inInfo;
}
......@@ -47,6 +49,11 @@ public class ServiceHGSB008 extends ServiceEPBase {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGSB008.FIELD_LOG_DATE, DateUtils.formatShort(logDate));
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGSB008.QUERY,new HGSB008());
}
}
......@@ -155,6 +155,9 @@
<isNotEmpty prepend=" AND " property="deviceStatus">
DEVICE_STATUS = #deviceStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -284,8 +287,7 @@
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSB001 WHERE
ID = #id#
DELETE FROM ${hggpSchema}.HGSB001 WHERE ID = #id#
</delete>
<update id="deleteFlag">
......
......@@ -162,6 +162,9 @@
<isNotEmpty prepend=" AND " property="endDate">
PLAN_DATE &lt;= #endDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -292,8 +295,7 @@
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSB002 WHERE
ID = #id#
DELETE FROM ${hggpSchema}.HGSB002 WHERE ID = #id#
</delete>
<update id="deleteFlag">
......
......@@ -144,6 +144,9 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......
......@@ -143,6 +143,9 @@
<isNotEmpty prepend=" AND " property="checkStatus">
CHECK_STATUS = #checkStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......
......@@ -142,6 +142,9 @@
<isNotEmpty prepend=" AND " property="checkStatus">
CHECK_STATUS LIKE CONCAT('%', #checkStatus#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......
......@@ -153,26 +153,29 @@
<isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
<isNotEmpty prepend=" AND " property="companyCodes">
B.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB006">
SELECT
<include refid="column"/>
SELECT <include refid="column"/>
from (
SELECT
<include refid="column001"/>
SELECT <include refid="column001"/>
FROM ${hggpSchema}.HGSB004A A
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID
WHERE 1=1 <include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
SELECT <include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND B.PLAN_STATUS = '1' and B.TASK_STATUS = '0' AND B.PLAN_TYPE = '1'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCodes">
B.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
......@@ -205,35 +208,38 @@
COUNT(*)
from (
SELECT
<include refid="column001"/>
<include refid="column001"/>
FROM ${hggpSchema}.HGSB004A A
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID
WHERE 1=1 <include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
<include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1 and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND B.PLAN_STATUS = '1' AND TASK_STATUS = '0' AND B.PLAN_TYPE = '1'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
AND B.PLAN_STATUS = '1' AND TASK_STATUS = '0' AND B.PLAN_TYPE = '1'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
B.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
) A
where 1=1
<isEqual prepend=" AND " property="checkStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
</select>
</sqlMap>
\ No newline at end of file
......@@ -159,21 +159,21 @@
<isEqual prepend=" AND " property="upkeepStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
<isNotEmpty prepend=" AND " property="companyCodes">
B.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB007">
SELECT
<include refid="column"/>
SELECT <include refid="column"/>
FROM (
SELECT
<include refid="column001"/>
SELECT <include refid="column001"/>
FROM ${hggpSchema}.HGSB005A A
JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0' WHERE 1=1
<include refid="authCondition"/>
<include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
SELECT <include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
......@@ -189,6 +189,9 @@
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
B.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
) A
WHERE 1=1
<isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
......@@ -208,33 +211,33 @@
</select>
<select id="count" resultClass="int">
SELECT
COUNT(*)
SELECT COUNT(*)
FROM (
SELECT
<include refid="column001"/>
SELECT <include refid="column001"/>
FROM ${hggpSchema}.HGSB005A A
JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0' WHERE 1=1
<include refid="authCondition"/>
<include refid="condition" />
<include refid="authCondition"/>
<include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
SELECT <include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND B.PLAN_STATUS = '1' AND TASK_STATUS = '0' AND B.PLAN_TYPE = '2'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND B.PLAN_STATUS = '1' AND TASK_STATUS = '0' AND B.PLAN_TYPE = '2'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
B.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
) A
WHERE 1=1
<isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
......
......@@ -115,6 +115,9 @@
<isNotEmpty prepend=" AND " property="endDura">
END_DURA = #endDura#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB008">
......
......@@ -6,6 +6,7 @@ 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.*;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.UserGroup;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -37,10 +38,10 @@ public class HGSBTools {
}
/**
* 查询用户所属公司
* 查询组织机构用户所属公司
*/
public static Map<String, Object> getUserCompany(){
Map<String, Object> orgMap = new HashMap();
Map<String, Object> orgMap = new HashMap<>();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
......@@ -56,28 +57,15 @@ public class HGSBTools {
}
/**
* 查询用户所属公司用户
* 查询用户所属所属角色所属公司用户
*/
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();
public static List<String> getRoleCompanyCode(){
//角色公司
List<Company> companyList = UserSessionUtils.getRoleCompany();
List<String> strList = new ArrayList<>();
while (var6.hasNext()) {
HashMap map = (HashMap) var6.next();
strList.add(map.get("ORG_ID").toString());
for (Company company : companyList) {
strList.add(company.getCompanyCode());
}
return strList;
}
......
......@@ -43,7 +43,7 @@ public class ServiceHGSC009 extends ServiceEPBase {
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID),qarma);
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
List<String> orgIds = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
return outInfo;
......
......@@ -10,6 +10,7 @@ import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -34,21 +35,24 @@ public class ServiceHGSJ001 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ001.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
EiInfo outInfo = super.query(inInfo, HGSJ001.QUERY, new HGSJ001());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID)); //COMPANY_RECORD_BOX_BLOCK_ID
qarma.clear();
List orgIds = getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODE,companyCode);
EiInfo outInfo = new EiInfo();
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ001.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
outInfo = super.initLoad(inInfo, EiConstant.resultBlock, new HGSJ001());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
//CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
qarma.clear();
List orgIds = getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
return outInfo;
}
......@@ -56,6 +60,12 @@ public class ServiceHGSJ001 extends ServiceEPBase {
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ001.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
List<Company> roleCompany = UserSessionUtils.getRoleCompany();
List<String> companys = new ArrayList<>();
for (Company company:roleCompany) {
companys.add(company.getCompanyCode());
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "factoryCodes",companys);
return super.query(inInfo, HGSJ001.QUERY);
}
......
......@@ -9,13 +9,11 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -25,10 +23,7 @@ import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author LiuYang
......@@ -38,24 +33,28 @@ public class ServiceHGSJ002 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
EiInfo outInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
/*if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODE,companyCode);
EiInfo outInfo = new EiInfo();
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
outInfo = super.initLoad(inInfo, EiConstant.resultBlock, new HGSJ002());
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
List<Company> roleCompany = UserSessionUtils.getRoleCompany();
List<String> companys = new ArrayList<>();
for (Company company:roleCompany) {
companys.add(company.getCompanyCode());
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "factoryCodes",companys);
return super.query(inInfo, HGSJ002.QUERY,new HGSJ002());
}
......
......@@ -11,6 +11,7 @@ import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -38,41 +39,29 @@ public class ServiceHGSJ003 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
EiInfo outInfo = super.query(inInfo, HGSJ003.QUERY, new HGSJ003());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
/*if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
/*if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
List<Org> orgList1 = HGXSTools.XsOrg.queryParent(org.getOrgId());
for (Org org1:orgList1) {
if ("company".equals(org1.getOrgType()) && !"root".equals(org1.getParentOrgId())) {
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org1.getOrgId());
}
}
}else {
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org.getOrgId());
}
}*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROCESS_CODE_BLOCK_ID), qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODE,companyCode);
EiInfo outInfo = new EiInfo();
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
outInfo = super.initLoad(inInfo, EiConstant.resultBlock, new HGSJ003());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROCESS_CODE_BLOCK_ID), qarma);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
List<Company> roleCompany = UserSessionUtils.getRoleCompany();
List<String> companys = new ArrayList<>();
for (Company company:roleCompany) {
companys.add(company.getCompanyCode());
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "factoryCodes",companys);
return super.query(inInfo,HGSJ003.QUERY,new HGSJ003());
}
......
......@@ -118,6 +118,9 @@
<isNotEmpty prepend=" AND " property="processCodes">
PROCESS_CODE IN <iterate close=")" open="(" conjunction="," property="processCodes">#processCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCodes">
FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="computeType">
COMPUTE_TYPE = #computeType#
</isNotEmpty>
......
......@@ -88,6 +88,9 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCodes">
FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="authCondition">
......
......@@ -133,6 +133,9 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCodes">
FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="authCondition">
......
......@@ -12,6 +12,11 @@
<!-- 数据权限 -->
<sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml"/>
<!--成本-->
<sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB004.xml"/>
<!-- 采购 -->
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG002.xml"/>
......
$(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -77,9 +77,9 @@ $(function () {
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['companyName']
return companyCodeBox[i]['companyName'];
}
}
return dataItem["companyCode"];
......@@ -221,6 +221,13 @@ $(function () {
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
......
......@@ -21,7 +21,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains">
......@@ -49,7 +49,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="210" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="设备区域"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
$(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
......@@ -93,9 +93,9 @@ $(function () {
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['companyName']
return companyCodeBox[i]['companyName'];
}
}
return dataItem["companyCode"];
......@@ -247,6 +247,13 @@ $(function () {
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
......
......@@ -22,7 +22,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains">
......@@ -55,7 +55,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="设备区域"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......@@ -88,8 +88,7 @@
<EF:EFComboColumn ename="planStatus" cname="审批状态" width="80" align="center" enable="false" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>
......
$(function () {
var deviceCodeBox = __eiInfo.getBlock("deviceCodeBox_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -68,9 +68,9 @@ $(function () {
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['companyName']
return companyCodeBox[i]['companyName'];
}
}
return dataItem["companyCode"];
......@@ -190,6 +190,14 @@ $(function () {
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
......
......@@ -21,7 +21,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="applyDate" cname="申请日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
......@@ -42,7 +42,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="applyDate" cname="申请日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
$(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
//var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
......@@ -83,9 +83,9 @@ $(function () {
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['companyName']
return companyCodeBox[i]['companyName'];
}
}
return dataItem["companyCode"];
......@@ -172,6 +172,14 @@ $(function () {
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
......
......@@ -22,7 +22,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="inspecDate" cname="点检日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
......@@ -43,7 +43,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="inspecDate" cname="点检日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
......@@ -71,6 +71,14 @@ $(function () {
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
......
......@@ -25,7 +25,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="planDate" cname="计划日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
......@@ -47,7 +47,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="设备区域"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
$(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
//var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
......@@ -74,9 +74,9 @@ $(function () {
title: "公司名称",
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['companyName']
return companyCodeBox[i]['companyName'];
}
}
return dataItem["companyCode"];
......@@ -163,6 +163,14 @@ $(function () {
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
......
......@@ -22,7 +22,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="upkeepDate" cname="保养日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
......@@ -41,7 +41,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="upkeepDate" cname="保养日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
......@@ -116,6 +116,14 @@ $(function () {
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="checkStatus" cname="点检状态" colWidth="3" filter="contains">
......@@ -37,7 +37,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFComboColumn ename="deviceCode" cname="设备名称"
......
......@@ -173,6 +173,16 @@ $(function () {
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/*
let deepblue = false;
window.onload = () => {
......
......@@ -18,7 +18,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="upkeepStatus" cname="保养状态" colWidth="3" filter="contains">
......@@ -37,7 +37,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="planCode" cname="计划单号" width="120" align="center" readonly="true" required="true"/>
<EF:EFComboColumn ename="deviceCode" cname="设备名称"
......
......@@ -46,4 +46,16 @@ $(function () {
}
}
});
\ No newline at end of file
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
......@@ -18,7 +18,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="logDate" cname="日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
......@@ -39,7 +39,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="logDate" cname="日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
......
$(function (){
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows(); //company_record_box_block_id
var factoryCodes = __eiInfo.getBlock("roleCompany").getMappedRows(); //company_record_box_block_id
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -44,16 +44,16 @@ $(function (){
let companyCode = $("#inqu_status-0-companyCode").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
return item["companyCode"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
dataItem['factoryName'] = factoryCodes[i]['textField'];
return factoryCodes[i]['textField'];
if (factoryCodes[i]['companyCode'] === dataItem['factoryCode']) {
dataItem['factoryName'] = factoryCodes[i]['companyName'];
return factoryCodes[i]['companyName'];
}
}
return dataItem['factoryCode'];
......@@ -159,7 +159,14 @@ $(function (){
}
downKeyUp();
})
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
......
......@@ -22,7 +22,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="princName" cname="负责人" placeholder="模糊查询" colWidth="3"/>
......@@ -44,7 +44,7 @@
textField="textField" valueField="valueField"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="processCode" cname="工序编码" enable="false" width="100" align="center"/>
......
$(function (){
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("roleCompany").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -52,9 +52,9 @@ $(function (){
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
dataItem['factoryName'] = factoryCodes[i]['textField'];
return factoryCodes[i]['textField'];
if (factoryCodes[i]['companyCode'] === dataItem['factoryCode']) {
dataItem['factoryName'] = factoryCodes[i]['companyName'];
return factoryCodes[i]['companyName'];
}
}
return dataItem['factoryCode'];
......@@ -112,7 +112,13 @@ $(function (){
downKeyUp();
})
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
......
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
......@@ -38,7 +38,7 @@
textField="textField" valueField="valueField"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="flowCode" cname="流程编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="flowName" cname="流程名称" width="120" enable="true" readonly="false" align="center" required="true"/>
......
$(function (){
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("roleCompany").getMappedRows();
var processCodes = __eiInfo.getBlock("processCode_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -51,9 +51,9 @@ $(function (){
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
dataItem['factoryName'] = factoryCodes[i]['textField'];
return factoryCodes[i]['textField'];
if (factoryCodes[i]['companyCode'] === dataItem['factoryCode']) {
dataItem['factoryName'] = factoryCodes[i]['companyName'];
return factoryCodes[i]['companyName'];
}
}
return dataItem['factoryCode'];
......@@ -267,7 +267,13 @@ $(function (){
//grush.downloadFile(`${ctx}\\DC\\BB\\template\\DCAMIN02_附加费用管理.xls`);
})
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
......
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="processCode" cname="工序名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
......@@ -42,7 +42,7 @@
textField="textField" valueField="valueField"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="processCode" cname="工序名称"
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