Commit ad8d6013 by 宋祥

1.组织机构功能优化

parent 6dfef862
......@@ -10,7 +10,7 @@ public class HPConstants {
public static final String BLOCK_DETAIL = "detail";
//公司編碼
public static final String SQL_FIELD_COMPANYCODE = "companyCode";
public static final String SQL_FIELD_ACCOUNT_CODE = "accountCode";
//創建人
public static final String SQL_FIELD_CREATED_BY = "createdBy";
......
......@@ -6,9 +6,9 @@ package com.baosight.hggp.core.enums;
*/
public enum OrgTypeEnum {
COMPANY("company", "公司"),
FACTORY("factory", "厂区"),
DEPT("dept", "部门"),
COMPANY("dept", "公司"),
PROD_GROUP("prodGroup", "生产组"),
CUT_GROUP("cutGroup", "下料组"),
SYN_GROUP("synGroup", "综合组"),
......
package com.baosight.hggp.core.enums;
/**
* @author:songx
* @date:2024/3/1,17:29
*/
public enum ValidFlagEnum {
STOP(0, "停用"),
ONLINE(1, "启用"),
VIRTUALLY(2, "虚拟"),
;
private Integer code;
private String name;
ValidFlagEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
......@@ -92,7 +92,9 @@ public class UserSessionUtils extends UserSession {
List<String> factoryCodes = new ArrayList<>();
for (String orgId : orgIds) {
Org org = HGXSTools.XsOrg.queryFactory(orgId);
factoryCodes.add(org.getOrgId());
if (org != null) {
factoryCodes.add(org.getOrgId());
}
}
return factoryCodes;
}
......
......@@ -3,11 +3,13 @@ package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.ValidFlagEnum;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
......@@ -58,6 +60,9 @@ public class ServiceHGPZ009 extends ServiceBase {
@OperationLogAnnotation(operModul = "企业管理", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 排除虚拟企业
queryRow.put("exValidFlag", ValidFlagEnum.VIRTUALLY.getCode());
inInfo = super.query(inInfo, HGPZ009.QUERY, new HGPZ009());
String projectEnv = ProjectInfo.getProjectEnv();
inInfo.setCell(EiConstant.resultBlock, ACConstants.ROW_CODE_0, "projectEnv", projectEnv);
......@@ -238,7 +243,7 @@ public class ServiceHGPZ009 extends ServiceBase {
HGPZ009 fPz009 = new HGPZ009();
fPz009.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByCompany(fPz009.getAccountCode());
int count = HGXSTools.XsUser.countByAccount(fPz009.getAccountCode());
if (count > 0) {
throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", fPz009.getAccountName()));
}
......
......@@ -31,6 +31,9 @@
<isNotEmpty prepend=" AND " property="validFlag">
VALID_FLAG = #validFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="exValidFlag">
VALID_FLAG != #exValidFlag#
</isNotEmpty>
</sql>
<sql id="customCondition">
......
......@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.pz.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.enums.ValidFlagEnum;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -30,13 +31,13 @@ public class HGPZTools {
/**
* 查询企业信息
*
* @param companyCode
* @param accountCode
* @return
*/
public static HGPZ009 getByCode(String companyCode) {
AssertUtils.isEmpty(companyCode, "企业编码不能为空");
public static HGPZ009 getByCode(String accountCode) {
AssertUtils.isEmpty(accountCode, "企业编码不能为空");
Map queryMap = new HashMap();
queryMap.put("companyCode", companyCode);
queryMap.put("accountCode", accountCode);
List<HGPZ009> pz009s = DaoBase.getInstance().query(HGPZ009.QUERY, queryMap);
return CollectionUtils.isEmpty(pz009s) ? null : pz009s.get(0);
}
......@@ -52,7 +53,7 @@ public class HGPZTools {
if (pz009 == null) {
return false;
}
return CommonConstant.YesNo.YES_1.equals(pz009.getValidFlag());
return !ValidFlagEnum.STOP.getCode().equals(pz009.getValidFlag());
}
}
......
......@@ -13,7 +13,7 @@ import java.util.Map;
*/
public class Org extends DaoEPBase {
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_ORG_ID = "orgId"; /* 组织机构ID*/
public static final String FIELD_ORG_ENAME = "orgEname"; /* 组织机构名称*/
public static final String FIELD_ORG_CNAME = "orgCname"; /* 组织机构名称*/
......@@ -23,7 +23,7 @@ public class Org extends DaoEPBase {
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 手机号*/
public static final String FIELD_LEVEL = "level"; /* 邮箱*/
private String companyCode = ""; /* 企业编码 */
private String accountCode = ""; /* 企业编码 */
private String orgId = ""; /* 组织ID */
private String orgEname = ""; /* 组织英文名 */
private String orgCname = ""; /* 组织中文名 */
......@@ -39,7 +39,7 @@ public class Org extends DaoEPBase {
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
......@@ -84,12 +84,12 @@ public class Org extends DaoEPBase {
initMetaData();
}
public String getCompanyCode() {
return companyCode;
public String getAccountCode() {
return accountCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
public String getOrgId() {
......@@ -164,7 +164,7 @@ public class Org extends DaoEPBase {
@Override
public void fromMap(Map map) {
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setOrgId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_ID)), orgId));
setOrgEname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_ENAME)), orgEname));
setOrgCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_CNAME)), orgCname));
......@@ -182,7 +182,7 @@ public class Org extends DaoEPBase {
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_ORG_ID, StringUtils.toString(orgId, eiMetadata.getMeta(FIELD_ORG_ID)));
map.put(FIELD_ORG_ENAME, StringUtils.toString(orgEname, eiMetadata.getMeta(FIELD_ORG_ENAME)));
map.put(FIELD_ORG_CNAME, StringUtils.toString(orgCname, eiMetadata.getMeta(FIELD_ORG_CNAME)));
......
......@@ -67,7 +67,7 @@ public class ServiceHGXSUser extends ServiceBase {
public EiInfo queryComboBox(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put("companyCode", UserSessionUtils.getAccountCode());
queryMap.put("accountCode", UserSessionUtils.getAccountCode());
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.USER_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, queryMap);
......@@ -83,7 +83,7 @@ public class ServiceHGXSUser extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo queryCompanyComboBox(EiInfo inInfo) {
public EiInfo queryAccountComboBox(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
if (ObjectUtils.isNullBlank(queryMap.get("loginName"))) {
......@@ -91,7 +91,7 @@ public class ServiceHGXSUser extends ServiceBase {
}
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.COMPANY_RECORD_BLOCK_ID);
queryMap.put("companyCode", UserSessionUtils.getAccountCode());
queryMap.put("accountCode", UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, list, queryMap, false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询企业失败");
......
......@@ -4,8 +4,8 @@
<sql id="condition">
AND IS_DELETED = '0'
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgEname">
ORG_ENAME = #orgEname#
......@@ -77,7 +77,7 @@
(SELECT @CODES:=GROUP_CONCAT(ORG_ID)
FROM ${platSchema}.TXSOG01
WHERE FIND_IN_SET(PARENT_ORG_ID, @CODES)
AND COMPANY_CODE = #companyCode#
AND ACCOUNT_CODE = #accountCode#
AND IS_DELETED = 0
) AS T1,
@LEVEL:=@LEVEL+1 AS LEVEL
......@@ -106,22 +106,22 @@
FROM (
SELECT
@CODES as CODES,
(SELECT @CODES:=GROUP_CONCAT(PARENT_ORG_ID) FROM IPLAT.TXSOG01 WHERE FIND_IN_SET(ORG_ID, @CODES)
AND COMPANY_CODE = #companyCode#
(SELECT @CODES:=GROUP_CONCAT(PARENT_ORG_ID) FROM ${platSchema}.TXSOG01 WHERE FIND_IN_SET(ORG_ID, @CODES)
AND ACCOUNT_CODE = #accountCode#
AND IS_DELETED = 0
) as T1,
@LEVEL:=@LEVEL+1 as level
FROM IPLAT.TXSOG01,
FROM ${platSchema}.TXSOG01,
(select @CODES:=#orgId#, @LEVEL:= 0) T4
where @CODES is not null
) T2,
IPLAT.TXSOG01 T3
${platSchema}.TXSOG01 T3
WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
<isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE = #orgType#
</isNotEmpty>
AND COMPANY_CODE = #companyCode#
AND ACCOUNT_CODE = #accountCode#
ORDER BY T2.LEVEL, T3.ORG_ID
</select>
......@@ -161,7 +161,7 @@
(SELECT @CODES:=GROUP_CONCAT(ORG_ID)
FROM ${platSchema}.TXSOG01
WHERE FIND_IN_SET(PARENT_ORG_ID, @CODES)
AND COMPANY_CODE = #companyCode#
AND ACCOUNT_CODE = #accountCode#
AND IS_DELETED = 0
) AS T1,
@LEVEL:=@LEVEL+1 AS LEVEL
......@@ -187,9 +187,9 @@
<select id="queryAppGroup" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select c.ORG_ID as "groupCode",c.ORG_CNAME as "groupName",c.FACTORY_CODE as "factoryCode"
from iplat.txsog02 a
join iplat.xs_user b on a.USER_ID=b.USER_ID
join iplat.txsog01 c on c.ORG_ID = a.ORG_ID and c.IS_DELETED = 0
from ${platSchema}.txsog02 a
join ${platSchema}.xs_user b on a.USER_ID=b.USER_ID
join ${platSchema}.txsog01 c on c.ORG_ID = a.ORG_ID and c.IS_DELETED = 0
where 1=1 and c.ORG_TYPE = 'prodGroup'
<isNotEmpty prepend=" AND " property="userId">
b.USER_ID = #userId#
......@@ -197,39 +197,12 @@
</select>
<!-- 查询组织信息 -->
<select id="queryList" resultClass="com.baosight.hggp.hg.pz.domain.HPPZ011">
SELECT
A.ORG_ENAME AS "groupCode",
A.ORG_CNAME AS "groupName",
A.PARENT_ORG_ID AS "factoryCode",
B.ORG_CNAME AS "factoryName"
FROM iplat.TXSOG01 A LEFT JOIN (
SELECT
ORG_ENAME,
ORG_CNAME
FROM iplat.TXSOG01 WHERE COMPANY_CODE=#companyCode#
) B ON A.PARENT_ORG_ID=B.ORG_ENAME
WHERE A.ORG_TYPE = 'prodGroup' AND A.COMPANY_CODE=#companyCode#
<isNotEmpty prepend=" AND " property="factoryCode">
A.PARENT_ORG_ID=#factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
B.ORG_CNAME LIKE CONCAT('%', #factoryName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
A.ORG_CNAME LIKE CONCAT('%', #groupName#, '%')
</isNotEmpty>
</select>
<!-- 查询组织信息 -->
<select id="queryTedcm01" resultClass="java.util.HashMap">
SELECT
ITEM_CODE AS "itemCode",
ITEM_CNAME AS "itemCname"
FROM iplat.TEDCM01
FROM ${platSchema}.TEDCM01
WHERE CODESET_CODE = 'hpjx.hpjx.poorType'
</select>
</sqlMap>
......@@ -17,7 +17,8 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.xservices.xs.constants.LoginConstants;
import org.springframework.util.CollectionUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -82,12 +83,12 @@ public class HGXSTools {
/**
* 统计企业下的用户数量
*
* @param companyCode
* @param accountCode
* @return
*/
public static int countByCompany(String companyCode) {
public static int countByAccount(String accountCode) {
Map paramMap = new HashMap();
paramMap.put("companyCode", companyCode);
paramMap.put("accountCode", accountCode);
List<Integer> results = DaoBase.getInstance().query("HGXSUser.count", paramMap);
return CollectionUtils.isEmpty(results) ? 0 : results.get(0);
}
......@@ -211,8 +212,7 @@ public class HGXSTools {
queryMap.put("orgId", orgId);
queryMap.put("orgType", OrgTypeEnum.FACTORY.getCode());
List<Org> results = DaoBase.getInstance().query(HGSqlConstant.HgXsOrg.QUERY_PARENT, queryMap);
AssertUtils.isEmpty(results, String.format("组织[%s]不存在厂区信息", orgId));
return results.get(0);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
......
......@@ -116,7 +116,7 @@ public class CommonMethod {
String time = DateUtils.curDateTimeStr14();
for(int i=0; i < block.getRowCount(); i++){
//TODO 公司代码待补充
block.setCell(i, HPConstants.SQL_FIELD_COMPANYCODE, "");
block.setCell(i, HPConstants.SQL_FIELD_ACCOUNT_CODE, "");
block.setCell(i, HPConstants.SQL_FIELD_CREATED_BY, userId);
block.setCell(i, HPConstants.SQL_FIELD_CREATED_NAME, userName);
block.setCell(i, HPConstants.SQL_FIELD_CREATED_TIME, time);
......@@ -135,7 +135,7 @@ public class CommonMethod {
String time = DateUtils.curDateTimeStr14();
for(int i=0; i < block.getRowCount(); i++){
//TODO 公司代码待补充
block.setCell(i, HPConstants.SQL_FIELD_COMPANYCODE, "");
block.setCell(i, HPConstants.SQL_FIELD_ACCOUNT_CODE, "");
block.setCell(i, HPConstants.SQL_FIELD_UPDATED_BY, userId);
block.setCell(i, HPConstants.SQL_FIELD_UPDATED_NAME, userName);
block.setCell(i, HPConstants.SQL_FIELD_UPDATED_TIME, time);
......
......@@ -169,7 +169,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
parameters = new HashMap();
}
// 设置企业信息
this.setCompanyCode(name, parameters);
this.setAccountCode(name, parameters);
// 设置数据查询权限
this.setDataAuth(name, parameters);
}
......@@ -180,7 +180,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
* @param name
* @param parameters
*/
private void setCompanyCode(String name, Object parameters) {
private void setAccountCode(String name, Object parameters) {
// 需要过滤部分sql name,否则会形成死循环
String[] serviceFilter = {"HGXSUser", "HPPZ009.query"};
if (StringUtils.startsWithAny(name, serviceFilter)) {
......
package com.baosight.xservices.xs.og.service;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiColumn;
......@@ -34,7 +35,13 @@ public class ServiceXSOG0800 extends TreeService {
HashMap<String, String> map = new HashMap();
List<HashMap> list = new ArrayList();
map.put("label", "root");
map.put("text", "组织机构");
//
String accountCode = UserSessionUtils.getAccountCode();
if (StringUtils.isEmpty(accountCode)) {
map.put("text", "组织机构");
} else {
map.put("text", HGPZTools.HgPz009.getByCode(accountCode).getAccountName());
}
map.put("leaf", "0");
map.put("parent", "0");
list.add(map);
......
......@@ -310,18 +310,13 @@ public class ServiceXSOG0801 extends ServiceBase {
List<Map> rows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < rows.size(); ++i) {
Map row = rows.get(i);
// 厂区工人不能同时存在多个组
Map queryMap = new HashMap();
queryMap.put("userId", row.get("userId"));
// List<HPPZ013> dbPz013s = dao.query(HPPZ013.QUERY, queryMap);
// if (dbPz013s.size() > 0) {
// 用户是工人时,只能有一个组织
// List<XSOG02> userResults = dao.query("XSOG02.queryByOrgIdAndUserId", queryMap);
// if (userResults.size() > 0) {
// errorMsg = errorMsg + "\n添加用户[" + row.get("loginName") + "]失败,选择用户已为其他组织机构成员";
// continue;
// }
// }
List<XSOG02> userResults = dao.query("XSOG02.queryByOrgIdAndUserId", queryMap);
if (userResults.size() > 0) {
errorMsg = errorMsg + "\n添加用户[" + row.get("loginName") + "]失败,用户已为其他组织机构成员";
continue;
}
row.put("recCreator", UserSession.getLoginName());
insertList.add(row);
}
......
......@@ -48,10 +48,23 @@ public class ServiceXSOG0801A extends ServiceEPBase {
String parentOrgId = MapUtils.getString(queryMap, "parentOrgId");
String condition;
if (CommonConstant.Field.ROOT.equals(parentOrgId)) {
condition = String.format(" ITEM_CODE = '%s'", OrgTypeEnum.FACTORY.getCode());
condition = String.format(" ITEM_CODE IN ('%s', '%s')", OrgTypeEnum.COMPANY.getCode(),
OrgTypeEnum.DEPT.getCode());
} else {
condition = String.format(" ITEM_CODE IN ('%s', '%s', '%s', '%s')", OrgTypeEnum.DEPT.getCode(),
OrgTypeEnum.PROD_GROUP.getCode(), OrgTypeEnum.CUT_GROUP.getCode(),OrgTypeEnum.SYN_GROUP.getCode());
// 查询组织
Org org = HGXSTools.XsOrg.get(parentOrgId);
if (OrgTypeEnum.COMPANY.getCode().equals(org.getOrgType())) {
condition = String.format(" ITEM_CODE IN ('%s', '%s', '%s')", OrgTypeEnum.COMPANY.getCode(),
OrgTypeEnum.FACTORY.getCode(), OrgTypeEnum.DEPT.getCode());
} else if (OrgTypeEnum.FACTORY.getCode().equals(org.getOrgType())) {
condition = String.format(" ITEM_CODE IN ('%s')", OrgTypeEnum.DEPT.getCode());
} else if (OrgTypeEnum.DEPT.getCode().equals(org.getOrgType())) {
condition = String.format(" ITEM_CODE IN ('%s', '%s', '%s', '%s')", OrgTypeEnum.DEPT.getCode(),
OrgTypeEnum.PROD_GROUP.getCode(), OrgTypeEnum.CUT_GROUP.getCode(),
OrgTypeEnum.SYN_GROUP.getCode());
} else {
condition = " ITEM_CODE = 'NOT CODE'";
}
}
List<Map> orgTypes = CodeValueTools.getCodeValues(CodesetConstant.XsOg.ORG_TYPE, condition);
inInfo.addBlock("orgTypeBlock").addRows(orgTypes);
......@@ -120,8 +133,8 @@ public class ServiceXSOG0801A extends ServiceEPBase {
} else {
// 查询所属厂
Org factoryOrg = HGXSTools.XsOrg.queryFactory(queryRow.get("parentOrgId").toString());
row.put("factoryCode", factoryOrg.getOrgId());
row.put("factoryName", factoryOrg.getOrgCname());
row.put("factoryCode", factoryOrg == null ? "" : factoryOrg.getOrgId());
row.put("factoryName", factoryOrg == null ? "" : factoryOrg.getOrgCname());
}
newRows.add(row);
}
......
......@@ -167,6 +167,32 @@
ORDER BY SORT_INDEX ASC
</select>
<!--条件查询组织机构-->
<select id="count" parameterClass="java.util.HashMap" resultClass="int">
SELECT COUNT(1)
FROM ${platSchema}.TXSOG01
WHERE 1=1
AND IS_DELETED = '0'
<isNotEmpty prepend=" and UPPER(ORG_ENAME) like " property="orgEname">
UPPER ('%$orgEname$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentOrgId">
PARENT_ORG_ID = #parentOrgId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgId">
ORG_ID = #orgId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgCname">
ORG_CNAME like ('%$orgCname$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE like ('%$orgType$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
</select>
<!-- 根据id查询组织机构 -->
<select id="queryByOrgId" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
......
......@@ -680,8 +680,8 @@
<isNotEmpty prepend=" AND " property="orgCname">
ORG_CNAME LIKE ('%$orgCname$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
</select>
......
......@@ -143,7 +143,7 @@ public class ServiceXS3001 extends ServiceEPBase {
// 非超级管理只能看到所属企业的角色 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
inInfo.set("inqu_status-0-companyCode", UserSessionUtils.getAccountCode());
inInfo.set("inqu_status-0-accountCode", UserSessionUtils.getAccountCode());
}
EiInfo outInfo = super.query(inInfo, "XS3001.queryGroupOutOfUser", new XS02());
EiBlock eiBlock = new EiBlock("result3");
......
......@@ -268,7 +268,7 @@ public class ServiceXSOrgManage extends ServiceEPBase {
insertMap.put("recReviseTime", " ");
insertMap.put("archiveFlag", " ");
insertMap.put("isDeleted", "0");
insertMap.put("companyCode", inInfoRowMap.get("companyCode"));
insertMap.put("accountCode", inInfoRowMap.get("accountCode"));
insertMap.put("factoryCode", inInfoRowMap.get("factoryCode"));
insertMap.put("factoryName", inInfoRowMap.get("factoryName"));
if (insertFlag) {
......
......@@ -24,8 +24,8 @@
and MEMBER_ID = #currentUserId#
)
</isNotEmpty>
<isNotEmpty prepend="AND" property="companyCode">
COMPANY_CODE = #companyCode#
<isNotEmpty prepend="AND" property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
ORDER BY SORT_INDEX,ID
</select>
......
......@@ -98,8 +98,8 @@
<isNotEmpty prepend=" AND " property="userName">
t1.user_name like ('%$userName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
t1.COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
t1.account_code = #accountCode#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......
......@@ -2265,7 +2265,7 @@
}
});
// 对于超长的 菜单项,显示叠层
......@@ -2446,9 +2446,9 @@ $(function () {
try {
if (loginName !== "admin"){
var info = new EiInfo()
info.set("inqu_status-0-companyCode",loginName)
EiCommunicator.send("HPPZ009", "query", info, {
onSuccess: function (ei) {//返回结果集
info.set("inqu_status-0-accountCode", loginName)
EiCommunicator.send("HGPZ009", "query", info, {
onSuccess: function (ei) {//返回结果集
if (ei.blocks.result !== undefined){
let results = ei.getBlock("result").getMappedRows();
if (results.length>0 && results[0].docIdPc.trim().length>0){
......
......@@ -2,6 +2,7 @@
<%@ page import="com.baosight.xservices.xs.constants.LoginConstants" %>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page import="com.baosight.hggp.core.security.UserSessionUtils" %>
<%@ page import="com.baosight.hggp.hg.pz.tools.HGPZTools" %>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
......@@ -100,8 +101,8 @@
String passwordDesc = StringUtils.defaultIfEmpty(PlatApplicationContext.getProperty("xservices.security.checkpassword.desc"), "密码必须包含英文及数字");
String loginPublicKey = LoginConstants.loginRsaPublicKey;
String cryptoPasswordEnable = LoginConstants.cryptoPasswordEnable;
String companyCode = UserSessionUtils.getCompanyCode();
String loginPrefix = "";//StringUtils.isBlank(companyCode) ? "" : HPPZTools.HpPz009.getByCode(companyCode).getLoginPrefix();
String accountCode = UserSessionUtils.getAccountCode();
String loginPrefix = StringUtils.isBlank(accountCode) ? "" : HGPZTools.HgPz009.getByCode(accountCode).getLoginPrefix();
%>
<c:set var="pwdRgx" value="<%=passwordRegex%>"/>
<c:set var="pwdDesc" value="<%=passwordDesc%>"/>
......
......@@ -52,13 +52,14 @@
<div class="col-xs-9" style="text-align: right" id="inqu_inside"></div>
</div>
<hr>
<%-- </EF:EFRegion>--%>
<%-- <EF:EFRegion id="result" title="用户信息" fitHeight="true">--%>
<EF:EFGrid blockId="result" autoDraw="no" personal="true">
<%-- <EF:EFGrid blockId="result" autoBind="true" personal="true">--%>
<EF:EFColumn ename="loginName" cname="登录账号" readonly="true" style="text-align:left;"/>
<EF:EFColumn ename="userName" cname="用户姓名" style="text-align:left;"/>
<EF:EFColumn ename="companyCode" cname="企业编码" readonly="true" style="text-align:left;"/>
<EF:EFColumn ename="accountCode" cname="企业编码" readonly="true" style="text-align:left;"/>
<EF:EFComboColumn ename="isManager" cname="是否管理员" valueField="valueField" textField="textField"
columnTemplate="#=textField#" align="center">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="gender" cname="性别" valueField="valueField" textField="textField"
columnTemplate="#=textField#" align="center">
<EF:EFCodeOption codeName="xservices.xs.sex"/>
......
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