Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hg-smart
Commits
ad8d6013
Commit
ad8d6013
authored
May 07, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.组织机构功能优化
parent
6dfef862
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
165 additions
and
100 deletions
+165
-100
HPConstants.java
src/main/java/com/baosight/hggp/common/HPConstants.java
+1
-1
OrgTypeEnum.java
src/main/java/com/baosight/hggp/core/enums/OrgTypeEnum.java
+1
-1
ValidFlagEnum.java
...main/java/com/baosight/hggp/core/enums/ValidFlagEnum.java
+38
-0
UserSessionUtils.java
...ava/com/baosight/hggp/core/security/UserSessionUtils.java
+2
-0
ServiceHGPZ009.java
.../java/com/baosight/hggp/hg/pz/service/ServiceHGPZ009.java
+6
-1
HGPZ009.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ009.xml
+3
-0
HGPZTools.java
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
+6
-5
Org.java
src/main/java/com/baosight/hggp/hg/xs/domain/Org.java
+9
-9
ServiceHGXSUser.java
...java/com/baosight/hggp/hg/xs/service/ServiceHGXSUser.java
+3
-3
HGXSOrg.xml
src/main/java/com/baosight/hggp/hg/xs/sql/HGXSOrg.xml
+13
-40
HGXSTools.java
src/main/java/com/baosight/hggp/hg/xs/tools/HGXSTools.java
+6
-6
CommonMethod.java
src/main/java/com/baosight/hggp/util/CommonMethod.java
+2
-2
SqlMapDaoLogProxy.java
...sight/iplat4j/core/data/ibatis/dao/SqlMapDaoLogProxy.java
+2
-2
ServiceXSOG0800.java
...com/baosight/xservices/xs/og/service/ServiceXSOG0800.java
+7
-0
ServiceXSOG0801.java
...com/baosight/xservices/xs/og/service/ServiceXSOG0801.java
+5
-10
ServiceXSOG0801A.java
...om/baosight/xservices/xs/og/service/ServiceXSOG0801A.java
+17
-4
XSOG01.xml
src/main/java/com/baosight/xservices/xs/og/sql/XSOG01.xml
+26
-0
XSOG0801.xml
src/main/java/com/baosight/xservices/xs/og/sql/XSOG0801.xml
+2
-2
ServiceXS3001.java
...java/com/baosight/xservices/xs/service/ServiceXS3001.java
+1
-1
ServiceXSOrgManage.java
...com/baosight/xservices/xs/service/ServiceXSOrgManage.java
+1
-1
XS3001.xml
src/main/java/com/baosight/xservices/xs/sql/XS3001.xml
+2
-2
XS3002.xml
src/main/java/com/baosight/xservices/xs/sql/XS3002.xml
+2
-2
iPlatV7-index.js
src/main/resources/META-INF/resources/iPlatV7-index.js
+2
-2
XSOG0801.jsp
src/main/webapp/XS/OG/XSOG0801.jsp
+3
-2
XS3001.jsp
src/main/webapp/XS/XS3001.jsp
+5
-4
No files found.
src/main/java/com/baosight/hggp/common/HPConstants.java
View file @
ad8d6013
...
...
@@ -10,7 +10,7 @@ public class HPConstants {
public
static
final
String
BLOCK_DETAIL
=
"detail"
;
//公司編碼
public
static
final
String
SQL_FIELD_
COMPANYCODE
=
"company
Code"
;
public
static
final
String
SQL_FIELD_
ACCOUNT_CODE
=
"account
Code"
;
//創建人
public
static
final
String
SQL_FIELD_CREATED_BY
=
"createdBy"
;
...
...
src/main/java/com/baosight/hggp/core/enums/OrgTypeEnum.java
View file @
ad8d6013
...
...
@@ -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"
,
"综合组"
),
...
...
src/main/java/com/baosight/hggp/core/enums/ValidFlagEnum.java
0 → 100644
View file @
ad8d6013
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
;
}
}
src/main/java/com/baosight/hggp/core/security/UserSessionUtils.java
View file @
ad8d6013
...
...
@@ -92,8 +92,10 @@ public class UserSessionUtils extends UserSession {
List
<
String
>
factoryCodes
=
new
ArrayList
<>();
for
(
String
orgId
:
orgIds
)
{
Org
org
=
HGXSTools
.
XsOrg
.
queryFactory
(
orgId
);
if
(
org
!=
null
)
{
factoryCodes
.
add
(
org
.
getOrgId
());
}
}
return
factoryCodes
;
}
...
...
src/main/java/com/baosight/hggp/hg/pz/service/ServiceHGPZ009.java
View file @
ad8d6013
...
...
@@ -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
.
countBy
Company
(
fPz009
.
getAccountCode
());
int
count
=
HGXSTools
.
XsUser
.
countBy
Account
(
fPz009
.
getAccountCode
());
if
(
count
>
0
)
{
throw
new
PlatException
(
String
.
format
(
"企业[%s]已关联用户,请先解除用户"
,
fPz009
.
getAccountName
()));
}
...
...
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ009.xml
View file @
ad8d6013
...
...
@@ -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"
>
...
...
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
View file @
ad8d6013
...
...
@@ -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
company
Code
* @param
account
Code
* @return
*/
public
static
HGPZ009
getByCode
(
String
company
Code
)
{
AssertUtils
.
isEmpty
(
company
Code
,
"企业编码不能为空"
);
public
static
HGPZ009
getByCode
(
String
account
Code
)
{
AssertUtils
.
isEmpty
(
account
Code
,
"企业编码不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"
companyCode"
,
company
Code
);
queryMap
.
put
(
"
accountCode"
,
account
Code
);
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
());
}
}
...
...
src/main/java/com/baosight/hggp/hg/xs/domain/Org.java
View file @
ad8d6013
...
...
@@ -13,7 +13,7 @@ import java.util.Map;
*/
public
class
Org
extends
DaoEPBase
{
public
static
final
String
FIELD_
COMPANY_CODE
=
"company
Code"
;
/* 企业编码*/
public
static
final
String
FIELD_
ACCOUNT_CODE
=
"account
Code"
;
/* 企业编码*/
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
company
Code
=
""
;
/* 企业编码 */
private
String
account
Code
=
""
;
/* 企业编码 */
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
get
Company
Code
()
{
return
company
Code
;
public
String
get
Account
Code
()
{
return
account
Code
;
}
public
void
set
CompanyCode
(
String
company
Code
)
{
this
.
companyCode
=
company
Code
;
public
void
set
AccountCode
(
String
account
Code
)
{
this
.
accountCode
=
account
Code
;
}
public
String
getOrgId
()
{
...
...
@@ -164,7 +164,7 @@ public class Org extends DaoEPBase {
@Override
public
void
fromMap
(
Map
map
)
{
set
CompanyCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_COMPANY_CODE
)),
company
Code
));
set
AccountCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_ACCOUNT_CODE
)),
account
Code
));
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
)));
...
...
src/main/java/com/baosight/hggp/hg/xs/service/ServiceHGXSUser.java
View file @
ad8d6013
...
...
@@ -67,7 +67,7 @@ public class ServiceHGXSUser extends ServiceBase {
public
EiInfo
queryComboBox
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
queryMap
.
put
(
"
company
Code"
,
UserSessionUtils
.
getAccountCode
());
queryMap
.
put
(
"
account
Code"
,
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
query
Company
ComboBox
(
EiInfo
inInfo
)
{
public
EiInfo
query
Account
ComboBox
(
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
(
"
company
Code"
,
UserSessionUtils
.
getAccountCode
());
queryMap
.
put
(
"
account
Code"
,
UserSessionUtils
.
getAccountCode
());
CommonMethod
.
initBlock
(
inInfo
,
list
,
queryMap
,
false
);
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"查询企业失败"
);
...
...
src/main/java/com/baosight/hggp/hg/xs/sql/HGXSOrg.xml
View file @
ad8d6013
...
...
@@ -4,8 +4,8 @@
<sql
id=
"condition"
>
AND IS_DELETED = '0'
<isNotEmpty
prepend=
" AND "
property=
"
company
Code"
>
COMPANY_CODE = #company
Code#
<isNotEmpty
prepend=
" AND "
property=
"
account
Code"
>
ACCOUNT_CODE = #account
Code#
</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 = #company
Code#
AND
ACCOUNT_CODE = #account
Code#
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 = #company
Code#
(SELECT @CODES:=GROUP_CONCAT(PARENT_ORG_ID) FROM
${platSchema}
.TXSOG01 WHERE FIND_IN_SET(ORG_ID, @CODES)
AND
ACCOUNT_CODE = #account
Code#
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 = #company
Code#
AND
ACCOUNT_CODE = #account
Code#
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 = #company
Code#
AND
ACCOUNT_CODE = #account
Code#
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>
src/main/java/com/baosight/hggp/hg/xs/tools/HGXSTools.java
View file @
ad8d6013
...
...
@@ -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
company
Code
* @param
account
Code
* @return
*/
public
static
int
countBy
Company
(
String
company
Code
)
{
public
static
int
countBy
Account
(
String
account
Code
)
{
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
"
companyCode"
,
company
Code
);
paramMap
.
put
(
"
accountCode"
,
account
Code
);
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
);
}
/**
...
...
src/main/java/com/baosight/hggp/util/CommonMethod.java
View file @
ad8d6013
...
...
@@ -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_
COMPANY
CODE
,
""
);
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_
COMPANY
CODE
,
""
);
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
);
...
...
src/main/java/com/baosight/iplat4j/core/data/ibatis/dao/SqlMapDaoLogProxy.java
View file @
ad8d6013
...
...
@@ -169,7 +169,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
parameters
=
new
HashMap
();
}
// 设置企业信息
this
.
set
Company
Code
(
name
,
parameters
);
this
.
set
Account
Code
(
name
,
parameters
);
// 设置数据查询权限
this
.
setDataAuth
(
name
,
parameters
);
}
...
...
@@ -180,7 +180,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
* @param name
* @param parameters
*/
private
void
set
Company
Code
(
String
name
,
Object
parameters
)
{
private
void
set
Account
Code
(
String
name
,
Object
parameters
)
{
// 需要过滤部分sql name,否则会形成死循环
String
[]
serviceFilter
=
{
"HGXSUser"
,
"HPPZ009.query"
};
if
(
StringUtils
.
startsWithAny
(
name
,
serviceFilter
))
{
...
...
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0800.java
View file @
ad8d6013
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"
);
//
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
);
...
...
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0801.java
View file @
ad8d6013
...
...
@@ -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
);
}
...
...
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0801A.java
View file @
ad8d6013
...
...
@@ -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
{
// 查询组织
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
());
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
);
}
...
...
src/main/java/com/baosight/xservices/xs/og/sql/XSOG01.xml
View file @
ad8d6013
...
...
@@ -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"
>
...
...
src/main/java/com/baosight/xservices/xs/og/sql/XSOG0801.xml
View file @
ad8d6013
...
...
@@ -680,8 +680,8 @@
<isNotEmpty
prepend=
" AND "
property=
"orgCname"
>
ORG_CNAME LIKE ('%$orgCname$%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"
company
Code"
>
COMPANY_CODE = #company
Code#
<isNotEmpty
prepend=
" AND "
property=
"
account
Code"
>
ACCOUNT_CODE = #account
Code#
</isNotEmpty>
</select>
...
...
src/main/java/com/baosight/xservices/xs/service/ServiceXS3001.java
View file @
ad8d6013
...
...
@@ -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-
company
Code"
,
UserSessionUtils
.
getAccountCode
());
inInfo
.
set
(
"inqu_status-0-
account
Code"
,
UserSessionUtils
.
getAccountCode
());
}
EiInfo
outInfo
=
super
.
query
(
inInfo
,
"XS3001.queryGroupOutOfUser"
,
new
XS02
());
EiBlock
eiBlock
=
new
EiBlock
(
"result3"
);
...
...
src/main/java/com/baosight/xservices/xs/service/ServiceXSOrgManage.java
View file @
ad8d6013
...
...
@@ -268,7 +268,7 @@ public class ServiceXSOrgManage extends ServiceEPBase {
insertMap
.
put
(
"recReviseTime"
,
" "
);
insertMap
.
put
(
"archiveFlag"
,
" "
);
insertMap
.
put
(
"isDeleted"
,
"0"
);
insertMap
.
put
(
"
companyCode"
,
inInfoRowMap
.
get
(
"company
Code"
));
insertMap
.
put
(
"
accountCode"
,
inInfoRowMap
.
get
(
"account
Code"
));
insertMap
.
put
(
"factoryCode"
,
inInfoRowMap
.
get
(
"factoryCode"
));
insertMap
.
put
(
"factoryName"
,
inInfoRowMap
.
get
(
"factoryName"
));
if
(
insertFlag
)
{
...
...
src/main/java/com/baosight/xservices/xs/sql/XS3001.xml
View file @
ad8d6013
...
...
@@ -24,8 +24,8 @@
and MEMBER_ID = #currentUserId#
)
</isNotEmpty>
<isNotEmpty
prepend=
"AND"
property=
"
company
Code"
>
COMPANY_CODE = #company
Code#
<isNotEmpty
prepend=
"AND"
property=
"
account
Code"
>
ACCOUNT_CODE = #account
Code#
</isNotEmpty>
ORDER BY SORT_INDEX,ID
</select>
...
...
src/main/java/com/baosight/xservices/xs/sql/XS3002.xml
View file @
ad8d6013
...
...
@@ -98,8 +98,8 @@
<isNotEmpty
prepend=
" AND "
property=
"userName"
>
t1.user_name like ('%$userName$%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"
company
Code"
>
t1.
COMPANY_CODE = #company
Code#
<isNotEmpty
prepend=
" AND "
property=
"
account
Code"
>
t1.
account_code = #account
Code#
</isNotEmpty>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
...
...
src/main/resources/META-INF/resources/iPlatV7-index.js
View file @
ad8d6013
...
...
@@ -2446,8 +2446,8 @@ $(function () {
try
{
if
(
loginName
!==
"admin"
){
var
info
=
new
EiInfo
()
info
.
set
(
"inqu_status-0-companyCode"
,
loginName
)
EiCommunicator
.
send
(
"HP
PZ009"
,
"query"
,
info
,
{
info
.
set
(
"inqu_status-0-accountCode"
,
loginName
)
EiCommunicator
.
send
(
"HG
PZ009"
,
"query"
,
info
,
{
onSuccess
:
function
(
ei
)
{
//返回结果集
if
(
ei
.
blocks
.
result
!==
undefined
){
let
results
=
ei
.
getBlock
(
"result"
).
getMappedRows
();
...
...
src/main/webapp/XS/OG/XSOG0801.jsp
View file @
ad8d6013
...
...
@@ -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.getCompany
Code();
String loginPrefix =
"";//StringUtils.isBlank(companyCode) ? "" : HPPZTools.HpPz009.getByCode(company
Code).getLoginPrefix();
String
accountCode = UserSessionUtils.getAccount
Code();
String loginPrefix =
StringUtils.isBlank(accountCode) ? "" : HGPZTools.HgPz009.getByCode(account
Code).getLoginPrefix();
%>
<c:set var="pwdRgx" value="<%=passwordRegex%>"/>
<c:set var="pwdDesc" value="<%=passwordDesc%>"/>
...
...
src/main/webapp/XS/XS3001.jsp
View file @
ad8d6013
...
...
@@ -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"/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment