Commit b63e9257 by 宋祥

1.企业管理调整为账户account_code

parent 3a408c03
......@@ -17,7 +17,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* @version 1.0
* @history 2024-05-07 9:05:59 create
*/
public class Hgpz009 extends DaoEPBase {
public class HGPZ009 extends DaoEPBase {
private static final long serialVersionUID = 1L;
......@@ -148,7 +148,7 @@ public class Hgpz009 extends DaoEPBase {
/**
* the constructor.
*/
public Hgpz009() {
public HGPZ009() {
initMetaData();
}
......
......@@ -4,7 +4,7 @@ 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.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.Hgpz009;
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;
......@@ -41,7 +41,7 @@ public class ServiceHGPZ009 extends ServiceBase {
@OperationLogAnnotation(operModul = "企业管理", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new Hgpz009().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ009().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -58,7 +58,7 @@ public class ServiceHGPZ009 extends ServiceBase {
@OperationLogAnnotation(operModul = "企业管理", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, Hgpz009.QUERY, new Hgpz009());
inInfo = super.query(inInfo, HGPZ009.QUERY, new HGPZ009());
String projectEnv = ProjectInfo.getProjectEnv();
inInfo.setCell(EiConstant.resultBlock, ACConstants.ROW_CODE_0, "projectEnv", projectEnv);
} catch (Exception e) {
......@@ -81,7 +81,7 @@ public class ServiceHGPZ009 extends ServiceBase {
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
Hgpz009 fPz009 = new Hgpz009();
HGPZ009 fPz009 = new HGPZ009();
fPz009.fromMap(resultRows.get(i));
if (fPz009.getId() == null || fPz009.getId() == 0) {
this.add(fPz009);
......@@ -106,7 +106,7 @@ public class ServiceHGPZ009 extends ServiceBase {
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
Hgpz009 fPz009 = new Hgpz009();
HGPZ009 fPz009 = new HGPZ009();
fPz009.fromMap(resultRows.get(i));
AssertUtils.isEmpty(fPz009.getAccountName(), "企业名称不能为空");
AssertUtils.isEmpty(fPz009.getLoginPrefix(), "登录前缀不能为空");
......@@ -120,7 +120,7 @@ public class ServiceHGPZ009 extends ServiceBase {
* @param fPz009
* @throws Exception
*/
private void add(Hgpz009 fPz009) throws Exception {
private void add(HGPZ009 fPz009) throws Exception {
// 生成企业编码
fPz009.setAccountCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.COMPANY_CODE));
fPz009.setDeleteFlag(CommonConstant.YesNo.NO_0);
......@@ -128,7 +128,7 @@ public class ServiceHGPZ009 extends ServiceBase {
fPz009.setCreatedName(UserSession.getLoginCName());
fPz009.setCreatedTime(DateUtils.shortDateTime());
// 此处不能使用DaoUtils方法insert
dao.insert(Hgpz009.INSERT, fPz009);
dao.insert(HGPZ009.INSERT, fPz009);
// 默认新增企业管理员账号
String userId = fPz009.getLoginPrefix() + "0000";
HGXSTools.XsUser.addUser(fPz009.getAccountCode(), userId, fPz009.getAccountName(),
......@@ -142,8 +142,8 @@ public class ServiceHGPZ009 extends ServiceBase {
*
* @param fPz009
*/
private void modify(Hgpz009 fPz009) {
DaoUtils.update(Hgpz009.UPDATE, fPz009);
private void modify(HGPZ009 fPz009) {
DaoUtils.update(HGPZ009.UPDATE, fPz009);
}
/**
......@@ -161,7 +161,7 @@ public class ServiceHGPZ009 extends ServiceBase {
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
Hgpz009 fPz009 = new Hgpz009();
HGPZ009 fPz009 = new HGPZ009();
fPz009.fromMap(resultRows.get(i));
this.add(fPz009);
}
......@@ -180,7 +180,7 @@ public class ServiceHGPZ009 extends ServiceBase {
* @param hgpz009
* @param userId
*/
private void insertGroupMember(Hgpz009 hgpz009, String userId) {
private void insertGroupMember(HGPZ009 hgpz009, String userId) {
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("memberId", userId);
inInfoRowMap.put("memberName", hgpz009.getAccountName());
......@@ -211,9 +211,9 @@ public class ServiceHGPZ009 extends ServiceBase {
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
Hgpz009 hppz009 = new Hgpz009();
HGPZ009 hppz009 = new HGPZ009();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(Hgpz009.UPDATE, hppz009);
DaoUtils.update(HGPZ009.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......@@ -235,14 +235,14 @@ public class ServiceHGPZ009 extends ServiceBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
Hgpz009 fPz009 = new Hgpz009();
HGPZ009 fPz009 = new HGPZ009();
fPz009.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByCompany(fPz009.getAccountCode());
if (count > 0) {
throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", fPz009.getAccountName()));
}
DaoUtils.update(Hgpz009.DELETE, fPz009);
DaoUtils.update(HGPZ009.DELETE, fPz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -58,7 +58,7 @@
</sql>
<!-- 查询品种大类配置 -->
<select id="query" resultClass="com.baosight.hggp.hg.pz.domain.Hgpz009">
<select id="query" resultClass="com.baosight.hggp.hg.pz.domain.HGPZ009">
SELECT
<include refid="column"/>
FROM ${metaSchema}.HGPZ009
......
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.hg.pz.domain.HGPZ009;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
/**
* @author:songx
* @date:2024/1/16,10:48
*/
@Slf4j
public class HGPZTools {
/**
* HPPZ009 公共DAO定义
*
* @author:songx
* @date:2024/2/6,13:37
*/
public static class HgPz009 {
/**
* 查询企业信息
*
* @param companyCode
* @return
*/
public static HGPZ009 getByCode(String companyCode) {
AssertUtils.isEmpty(companyCode, "企业编码不能为空");
Map queryMap = new HashMap();
queryMap.put("companyCode", companyCode);
List<HGPZ009> pz009s = DaoBase.getInstance().query(HGPZ009.QUERY, queryMap);
return CollectionUtils.isEmpty(pz009s) ? null : pz009s.get(0);
}
/**
* 企业是否启用
*
* @param accountCode
* @return
*/
public static boolean isValid(String accountCode) {
HGPZ009 pz009 = getByCode(accountCode);
if (pz009 == null) {
return false;
}
return CommonConstant.YesNo.YES_1.equals(pz009.getValidFlag());
}
}
}
......@@ -95,26 +95,26 @@ public class HGXSTools {
/**
* 初始化新增用户
*
* @param companyCode
* @param accountCode
* @param userId
* @param userName
* @param gender
* @param mobile
*/
public static void addUser(String companyCode, String userId, String userName, String gender, String mobile)
public static void addUser(String accountCode, String userId, String userName, String gender, String mobile)
throws Exception {
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", userId);
inInfoRowMap.put("loginName", userId);
inInfoRowMap.put("userName", userName);
// 使用公钥加密密码
String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, companyCode);
String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, userId);
inInfoRowMap.put("password", password);
inInfoRowMap.put("rePass", password);
inInfoRowMap.put("email", " ");
inInfoRowMap.put("gender", StringUtils.isBlank(gender) ? " " : gender);
inInfoRowMap.put("mobile", StringUtils.isBlank(mobile) ? " " : mobile);
inInfoRowMap.put("companyCode", companyCode);
inInfoRowMap.put("accountCode", accountCode);
EiInfo inInfo = new EiInfo();
inInfo.addBlock("details").addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XS0102");
......
......@@ -61,7 +61,7 @@ public class CommonMethod {
if (selectParams == null) {
selectParams = new HashMap<>();
}
selectParams.put("companyCode", UserSessionUtils.getCompanyCode());
selectParams.put("accountCode", UserSessionUtils.getAccountCode());
/* 遍历每个数据源 */
for (DdynamicEnum tableParam : tableParams) {
/* 编辑块名称 */
......
......@@ -186,7 +186,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
if (StringUtils.startsWithAny(name, serviceFilter)) {
return;
}
((Map) parameters).put("companyCode", UserSessionUtils.getCompanyCode());
((Map) parameters).put("accountCode", UserSessionUtils.getAccountCode());
}
/**
......@@ -197,7 +197,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
*/
private void setDataAuth(String name, Object parameters) {
// 需要过滤部分sql name,否则会形成死循环
String[] serviceFilter = {"HGXSUser", "HGXSOrg", "HPPZ009.query", "HPPZ010.query"};
String[] serviceFilter = {"HGXSUser", "HGXSOrg", "HGPZ009.query", "HPPZ010.query"};
if (StringUtils.startsWithAny(name, serviceFilter)) {
return;
}
......
package com.baosight.xservices.xs.impl;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.iplat4j.core.cache.CacheManager;
import com.baosight.iplat4j.core.data.ibatis.dao.Dao;
import com.baosight.iplat4j.core.data.ibatis.dao.IbatisDaoUtils;
......@@ -59,11 +60,11 @@ public class SecurityUserStandardImpl extends ServiceEPBase implements ISecurity
int status = -1;
String msg = "";
if (eiInfo.get("loginName") != null && eiInfo.get("password") != null) {
String companyCode = eiInfo.getString("companyCode");
String accountCode = eiInfo.getString("accountCode");
String loginName = eiInfo.getString("loginName");
String password = eiInfo.getString("password");
Map map = new HashMap();
map.put("companyCode", companyCode);
map.put("accountCode", accountCode);
map.put("loginName", loginName);
List user = dao.query("XSUser.queryForLogin", map);
String hashedPassword;
......@@ -126,8 +127,8 @@ public class SecurityUserStandardImpl extends ServiceEPBase implements ISecurity
msg = msgSb.toString();
} else if (!"-1".equals(userMap.get("isLocked")) && !"-1".equals(userMap.get("status"))) {
// 登录校验增加企业是否启用 modify by songx at 2024-01-16
String dbCompanyCode = (String) userMap.get("companyCode");
// if (StringUtils.isBlank(dbCompanyCode) || HPPZTools.HpPz009.isValid(dbCompanyCode)) {
String dbAccountCode = (String) userMap.get("accountCode");
if (StringUtils.isBlank(dbAccountCode) || HGPZTools.HgPz009.isValid(dbAccountCode)) {
String pwdExpireDateString = (String) userMap.get("pwdExpireDate");
String accountExpireDateString = (String) userMap.get("accountExpireDate");
String nowDateString = DateUtils.curDateStr8();
......@@ -210,11 +211,11 @@ public class SecurityUserStandardImpl extends ServiceEPBase implements ISecurity
this.failCount.remove(loginName);
}
}
// } else {
// msg = "企业被停用,请联系管理员!";
// logger.info(msg);
// status = -2;
// }
} else {
msg = "企业被停用,请联系管理员!";
logger.info(msg);
status = -2;
}
} else {
msg = "用户被禁用,请联系管理员!";
logger.info(msg);
......@@ -264,13 +265,13 @@ public class SecurityUserStandardImpl extends ServiceEPBase implements ISecurity
Map resultObject = null;
int status = 0;
String msg = "";
String companyCode = eiInfo.getString("companyCode");
String accountCode = eiInfo.getString("accountCode");
String loginName = eiInfo.getString("loginName");
try {
if (StringUtils.isNotEmpty(loginName)) {
Map map = new HashMap();
map.put("loginName", loginName);
map.put("companyCode", companyCode);
map.put("accountCode", accountCode);
List user = dao.query("XSUser.query", map);
if (user != null && user.size() > 0) {
status = 1;
......
......@@ -49,7 +49,7 @@ public class ServiceXSOG0800 extends TreeService {
queryMap.put("node", parentLabel);
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
queryMap.put("companyCode", UserSessionUtils.getCompanyCode());
queryMap.put("accountCode", UserSessionUtils.getAccountCode());
}
List<Map> ret = this.dao.query("XSOG01.queryOrganiation", queryMap, 0, -999999);
Map parentOrgMap = new HashMap();
......
......@@ -4,6 +4,8 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
......@@ -248,7 +250,7 @@ public class ServiceXSOG0801 extends ServiceBase {
hashMap.put("userName", inInfo.get("inqu_status-0-userName"));
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
hashMap.put("companyCode", UserSessionUtils.getCompanyCode());
hashMap.put("accountCode", UserSessionUtils.getAccountCode());
}
List<Map<String, Object>> totalUser = this.dao.query("XSOG0801.queryUserByOrgIdBack", hashMap);
List<Map<String, Object>> userList = new ArrayList();
......@@ -390,7 +392,7 @@ public class ServiceXSOG0801 extends ServiceBase {
}
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
inInfo.set("inqu_status-0-companyCode", UserSessionUtils.getCompanyCode());
inInfo.set("inqu_status-0-accountCode", UserSessionUtils.getAccountCode());
}
EiInfo outInfo = super.query(inInfo, "XSOG0801.queryUserOutOfOrgId", new XS01());
r1Block.setRows(outInfo.getBlock(EiConstant.resultBlock).getRows());
......@@ -416,7 +418,7 @@ public class ServiceXSOG0801 extends ServiceBase {
}
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
inInfo.set("inqu_status-0-companyCode", UserSessionUtils.getCompanyCode());
inInfo.set("inqu_status-0-accountCode", UserSessionUtils.getAccountCode());
}
EiInfo outInfo = super.query(inInfo, "XSOG01.query", new XSOG01());
r2Block.setRows(outInfo.getBlock(EiConstant.resultBlock).getRows());
......@@ -436,9 +438,7 @@ public class ServiceXSOG0801 extends ServiceBase {
inInfo.setBlock(resultBlock);
}
// 非管理员组织机构编码前缀增加企业编码 added by songx at 2024-01-15
String companyCode = UserSessionUtils.getCompanyCode();
// HPPZ009 dbPz009 = StringUtils.isBlank(companyCode) ? null : HPPZTools.HpPz009.getByCode(companyCode);
// final String companyPrefix = dbPz009 == null ? "" : "[" + dbPz009.getLoginPrefix() + "]";
String accountCode = UserSessionUtils.getAccountCode();
String orgCode = SequenceGenerator.getNextSequence(HGConstant.SequenceId.ORG_CODE);
resultBlock = inInfo.getBlock(EiConstant.resultBlock);
List rows = resultBlock.getRows();
......@@ -446,7 +446,7 @@ public class ServiceXSOG0801 extends ServiceBase {
Map row = (Map) m;
row.put("orgId", orgCode);
row.put("orgEname", orgCode);
row.put("companyCode", companyCode);
row.put("accountCode", accountCode);
row.put("parentOrgId", inInfo.get("inqu_status2-0-parentOrgId"));
row.put("recCreator", UserSession.getLoginName());
});
......
......@@ -78,7 +78,7 @@ public class ServiceXSOG0801A extends ServiceEPBase {
}
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
queryRow.put("companyCode", UserSessionUtils.getCompanyCode());
queryRow.put("accountCode", UserSessionUtils.getAccountCode());
}
inInfo = super.query(inInfo, "XSOG01.query", new XSOG01());
} catch (Exception e) {
......@@ -98,7 +98,7 @@ public class ServiceXSOG0801A extends ServiceEPBase {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 非管理员组织机构编码前缀增加企业编码 added by songx at 2024-01-15
String companyCode = UserSessionUtils.getCompanyCode();
String accountCode = UserSessionUtils.getAccountCode();
List<Map> newRows = new ArrayList<>();
for (Map row : resultRows) {
// 已存在的数据跳过
......@@ -109,7 +109,7 @@ public class ServiceXSOG0801A extends ServiceEPBase {
orgId = SequenceGenerator.getNextSequence(HGConstant.SequenceId.ORG_CODE);
row.put("orgId", orgId);
row.put("orgEname", orgId);
row.put("companyCode", companyCode);
row.put("accountCode", accountCode);
row.put("establishDate", DateUtils.formatShort(MapUtils.getString(row, "establishDate")));
row.put("parentOrgId", queryRow.get("parentOrgId"));
row.put("recCreator", UserSession.getLoginName());
......
......@@ -71,7 +71,7 @@ public class ServiceXSOG0801B extends ServiceEPBase {
if ("".equals(orgId)) {
return inInfo;
}
queryRow.put("companyCode", UserSessionUtils.getCompanyCode());
queryRow.put("accountCode", UserSessionUtils.getAccountCode());
inInfo = super.query(inInfo, "XSOG01.query", new XSOG01());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -161,8 +161,8 @@
<isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE like ('%$orgType$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
ORDER BY SORT_INDEX ASC
</select>
......@@ -256,8 +256,8 @@
<isNotEmpty prepend=" AND " property="node">
PARENT_ORG_ID = #node#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
order by SORT_INDEX asc
</select>
......@@ -291,14 +291,14 @@
REC_REVISE_TIME, <!-- 记录修改时刻 -->
ARCHIVE_FLAG, <!-- 归档标记 -->
IS_DELETED, <!-- 逻辑删除(1-已删除|0-正常状态) -->
COMPANY_CODE, <!-- 企业编码 -->
ACCOUNT_CODE, <!-- 企业编码 -->
FACTORY_CODE,
FACTORY_NAME
) VALUES (
#orgId#, #orgEname#, #orgCname#, #orgBriefName#, #orgType#, #parentOrgId#,
#establishDate#, #orgLevel#, #orgNodeType#, #sortIndex#, #recCreator#,
#recCreateTime#, #recRevisor#, #recReviseTime#, #archiveFlag#, #isDeleted#,
#companyCode#, #factoryCode#, #factoryName#
#accountCode#, #factoryCode#, #factoryName#
)
</insert>
......
......@@ -142,8 +142,8 @@
INNER JOIN ${platSchema}.xs_user xu ON t2.USER_ID = xu.USER_ID
WHERE
xu.LOGIN_NAME != 'admin'
<isNotEmpty prepend="AND" property="companyCode">
t1.COMPANY_CODE = #companyCode#
<isNotEmpty prepend="AND" property="accountCode">
t1.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend="AND" property="orgCname">
t1.ORG_CNAME LIKE ('%$orgCname$%')
......@@ -240,8 +240,8 @@
where ORG_ID = #parentOrgId#
)
</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">
......
......@@ -145,8 +145,8 @@ public class ServiceXS0102 extends ServiceEPBase implements LoginConstants {
inInfoRowMap.put("pwdReviseDate", " ");
inInfoRowMap.put("pwdRevisor", " ");
// 设置所属企业 added by songx at 2024-01-15
if (ObjectUtils.isEmpty(inInfoRowMap.get("companyCode"))) {
inInfoRowMap.put("companyCode", UserSessionUtils.getCompanyCode());
if (ObjectUtils.isEmpty(inInfoRowMap.get("accountCode"))) {
inInfoRowMap.put("accountCode", UserSessionUtils.getAccountCode());
}
insertedUser = this.callAddUserService(inInfoRowMap);
buffer.append("注册成功\n");
......
......@@ -53,7 +53,7 @@ public class ServiceXS02 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
// 非超级管理只能看到所属企业的信息 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
inInfo.set("inqu_status-0-companyCode", UserSessionUtils.getCompanyCode());
inInfo.set("inqu_status-0-accountCode", UserSessionUtils.getAccountCode());
}
EiInfo outInfo = super.query(inInfo, "XS02.query", new XS02());
return outInfo;
......
......@@ -38,7 +38,7 @@ public class ServiceXS0702 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
// 非超级管理只能看到所属企业的角色 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
inInfo.set("inqu_status-0-companyCode", UserSessionUtils.getCompanyCode());
inInfo.set("inqu_status-0-accountCode", UserSessionUtils.getAccountCode());
}
EiInfo outInfo = super.query(inInfo, "XS07.query", new XS07());
return outInfo;
......
......@@ -53,7 +53,7 @@ public class ServiceXS0710 extends MenuTreeService {
}
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
map.put("companyCode", UserSessionUtils.getCompanyCode());
map.put("accountCode", UserSessionUtils.getAccountCode());
}
resultList = this.dao.query(stmt, map, 0, -999999);
List haveAuth = ServiceXS0707.haveAuthList;
......
......@@ -26,14 +26,14 @@ public class ServiceXS3002 extends ServiceEPBase {
public EiInfo insert(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
String companyCode = UserSessionUtils.getCompanyCode();
String accountCode = UserSessionUtils.getAccountCode();
for(int i = 0; i < eiBlock.getRowCount(); ++i) {
Map<String, Object> inInfoRowMap = eiBlock.getRow(i);
inInfoRowMap.remove("groupId");
inInfoRowMap.put("recCreator", UserSession.getUser().getUsername());
inInfoRowMap.put("recCreateTime", DateUtils.curDateTimeStr14());
// 设置所属企业 added by songx at 2024-01-16
inInfoRowMap.put("companyCode", companyCode);
inInfoRowMap.put("accountCode", accountCode);
}
eiInfo.addBlock(inInfo.getBlock(EiConstant.resultBlock));
......@@ -45,7 +45,7 @@ public class ServiceXS3002 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
// 非管理员仅查询所属企业用户组 added by songx at 2024-01-15
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
inInfo.set("inqu_status-0-companyCode", UserSessionUtils.getCompanyCode());
inInfo.set("inqu_status-0-accountCode", UserSessionUtils.getAccountCode());
}
EiInfo outInfo = super.query(inInfo, "XS02.query", new XS02());
return outInfo;
......@@ -90,7 +90,7 @@ public class ServiceXS3002 extends ServiceEPBase {
}
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
inInfo.set("inqu_status-0-companyCode", UserSessionUtils.getCompanyCode());
inInfo.set("inqu_status-0-accountCode", UserSessionUtils.getAccountCode());
}
EiInfo outInfo = super.query(inInfo, "XS3002.queryUserOutOfUserGroup", new XS01());
EiBlock eiBlock = new EiBlock("resultC");
......
package com.baosight.xservices.xs.service;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -197,7 +199,7 @@ public class ServiceXS40 extends ServiceEPBase {
}
// 非超级管理只能看到所属企业的角色 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
inInfo.set("inqu_status-0-companyCode", UserSessionUtils.getCompanyCode());
inInfo.set("inqu_status-0-accountCode", UserSessionUtils.getAccountCode());
}
List countList = this.dao.query("XS03.countForMemberGroups", map);
int count = (Integer)countList.get(0);
......@@ -224,14 +226,14 @@ public class ServiceXS40 extends ServiceEPBase {
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(r1Block.getRows());
// 非管理员组织机构编码前缀增加企业编码 added by songx at 2024-01-15
String companyCode = UserSessionUtils.getCompanyCode();
// HPPZ009 dbPz009 = StringUtils.isBlank(companyCode) ? null : HPPZTools.HpPz009.getByCode(companyCode);
final String companyPrefix = "";//dbPz009 == null ? "" : "[" + dbPz009.getLoginPrefix() + "]";
String accountCode = UserSessionUtils.getAccountCode();
HGPZ009 dbPz009 = StringUtils.isBlank(accountCode) ? null : HGPZTools.HgPz009.getByCode(accountCode);
final String companyPrefix = dbPz009 == null ? "" : dbPz009.getLoginPrefix() + "_";
for (int i = 0; i < eiBlock.getRowCount(); ++i) {
Map<String, Object> inInfoRowMap = eiBlock.getRow(i);
inInfoRowMap.remove("groupId");
inInfoRowMap.put("groupEname", companyPrefix + inInfoRowMap.get("groupEname"));
inInfoRowMap.put("companyCode", companyCode);
inInfoRowMap.put("accountCode", accountCode);
inInfoRowMap.put("recCreator", UserSession.getUser().getUsername());
inInfoRowMap.put("recCreateTime", DateUtils.curDateTimeStr14());
}
......
......@@ -40,7 +40,7 @@ public class ServiceXS4000 extends MenuTreeService {
params.put("parentId", parentId);
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
params.put("companyCode", UserSessionUtils.getCompanyCode());
params.put("accountCode", UserSessionUtils.getAccountCode());
}
if ("off".equals(manageSwitch)) {
ret = this.dao.query("XS03.queryNodes", params);
......
......@@ -15,7 +15,7 @@
REC_REVISOR,
REC_REVISE_TIME,
ARCHIVE_FLAG,
COMPANY_CODE
ACCOUNT_CODE
) VALUES (
#groupId#,
#groupEname#,
......@@ -28,7 +28,7 @@
#recRevisor#,
#recReviseTime#,
#archiveFlag#,
#companyCode#
#accountCode#
)
</insert>
......@@ -80,7 +80,7 @@
t1.archive_flag as "archiveFlag",
t2.group_cname as "manageGroupCname"
FROM (select id,group_ename,group_cname,manage_group_ename,group_type,sort_index,rec_creator,rec_create_time,
rec_revisor,rec_revise_time,archive_flag,company_code from ${platSchema}.XS_USER_GROUP where group_ename != 'ADMIN') t1
rec_revisor,rec_revise_time,archive_flag,account_code from ${platSchema}.XS_USER_GROUP where group_ename != 'ADMIN') t1
left join ${platSchema}.XS_USER_GROUP t2 on t1.manage_group_ename=t2.group_ename
where 1=1
<isNotEmpty prepend=" AND " property="groupId">
......@@ -98,8 +98,8 @@
<isNotEmpty prepend=" AND " property="manageGroupEname">
t1.manage_group_ename like ('%$manageGroupEname$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
t1.company_code = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
t1.account_code = #accountCode#
</isNotEmpty>
ORDER BY t1.SORT_INDEX,t1.ID
</select>
......@@ -118,7 +118,7 @@
t1.archive_flag as "archiveFlag",
t2.group_cname as "manageGroupCname"
FROM (select id,group_ename,group_cname,manage_group_ename,group_type,sort_index,rec_creator,rec_create_time,
rec_revisor,rec_revise_time,archive_flag,company_code from ${platSchema}.xs_user_group where group_ename != 'ADMIN') t1
rec_revisor,rec_revise_time,archive_flag,account_code from ${platSchema}.xs_user_group where group_ename != 'ADMIN') t1
left join ${platSchema}.xs_user_group t2 on t1.manage_group_ename=t2.group_ename
where 1=1
<isNotEmpty prepend=" AND " property="groupId">
......
......@@ -127,8 +127,8 @@
<isNotEmpty prepend=" AND " property="objectEname">
(t6.resource_group_ename = #objectEname# or t7.resource_ename like concat(#objectEname#, '%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
t2.company_code = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
t2.account_code = #accountCode#
</isNotEmpty>
ORDER BY t1.SORT_INDEX, t1.SUBJECT_ID, t1.OBJECT_ID
</select>
......
......@@ -163,8 +163,8 @@
<isNotEmpty prepend="AND" property="loginName">
t1.member_id IN (<include refid="getAllManagerGroupsByLoginNameDetail"/>)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
t2.COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
t2.account_code = #accountCode#
</isNotEmpty>
</sql>
......
......@@ -60,8 +60,8 @@
<isNotEmpty prepend=" AND " property="userType">
USER_TYPE = #userType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......@@ -106,7 +106,7 @@
pwd_revise_date as "pwdReviseDate",
pwd_revisor as "pwdRevisor",
archive_flag as "archiveFlag",
company_code as "companyCode"
account_code as "accountCode"
FROM ${platSchema}.XS_USER where 1=1
<isNotEmpty prepend=" AND " property="userId">
user_id = #userId#
......@@ -120,8 +120,8 @@
<isNotEmpty prepend=" AND " property="userType">
user_type like ('%$userType$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......
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