Commit 0717d4f9 by liuyang

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

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