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
bd6f3e10
Commit
bd6f3e10
authored
Aug 21, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.管理员看所有数据,新增工序查询条件,组织机构支持修改
parent
cd364bb0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
45 deletions
+101
-45
ServiceHGSC007.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
+42
-13
ServiceXSOG0801A.java
...om/baosight/xservices/xs/og/service/ServiceXSOG0801A.java
+50
-22
HGSC007.jsp
src/main/webapp/HG/SC/HGSC007.jsp
+7
-8
XSOG0801A.jsp
src/main/webapp/XS/OG/XSOG0801A.jsp
+2
-2
No files found.
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
View file @
bd6f3e10
package
com
.
baosight
.
hggp
.
hg
.
sc
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.enums.OrgTypeEnum
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
...
...
@@ -11,6 +12,7 @@ import com.baosight.hggp.hg.xs.domain.Company;
import
com.baosight.hggp.hg.xs.domain.Factory
;
import
com.baosight.hggp.hg.xs.domain.Org
;
import
com.baosight.hggp.hg.xs.tools.HGXSTools
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.DateUtil
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
...
...
@@ -22,10 +24,12 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.xservices.xs.util.LoginUserDetails
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -66,9 +70,16 @@ public class ServiceHGSC007 extends ServiceEPBase {
return
list
;
}
/**
* 初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"查询"
,
operDesc
=
"初始化页面"
)
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
PROCESS_CODE_BLOCK_ID
));
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGSC007
().
eiMetadata
);
// inInfo = super.query(inInfo, HGSC007.QUERY, new HGSC007());
}
catch
(
PlatException
e
)
{
...
...
@@ -91,11 +102,8 @@ public class ServiceHGSC007 extends ServiceEPBase {
if
(
StringUtils
.
isNotBlank
(
creatTime
))
{
queryMap
.
put
(
HGSC007
.
FIELD_created_time
,
StringUtil
.
removeHorizontalLine
(
creatTime
));
}
// 仅查询自己所在组的任务 added by songx at 20240820
List
<
String
>
allGroupNames
=
UserSessionUtils
.
getAllGroupName
();
// 当用户无组的时候,集合中添加空字符串用于查询,如果不加会查询出所有的数据
allGroupNames
.
add
(
" "
);
queryMap
.
put
(
"groupNames"
,
allGroupNames
);
// 设置组过滤条件
this
.
setGroupCondition
(
queryMap
);
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY
,
new
HGSC007
());
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
...
...
@@ -103,18 +111,24 @@ public class ServiceHGSC007 extends ServiceEPBase {
return
inInfo
;
}
/**
* 统计
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"查询"
,
operDesc
=
"APP查询数量"
)
public
Integer
count
(
EiInfo
inInfo
)
{
Integer
count
=
null
;
try
{
EiBlock
block
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
);
String
creatTime
=
block
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_created_time
);
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
creatTime
=
MapUtils
.
getString
(
queryMap
,
HGSC007
.
FIELD_created_time
);
if
(
StringUtils
.
isNotBlank
(
creatTime
))
{
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_created_time
,
StringUtil
.
removeHorizontalLine
(
creatTime
));
queryMap
.
put
(
HGSC007
.
FIELD_created_time
,
StringUtil
.
removeHorizontalLine
(
creatTime
));
}
Map
paramMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
count
=
super
.
count
(
HGSC007
.
COUNT
,
paramMap
);
// 设置组过滤条件
this
.
setGroupCondition
(
queryMap
);
count
=
super
.
count
(
HGSC007
.
COUNT
,
queryMap
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
...
...
@@ -122,6 +136,23 @@ public class ServiceHGSC007 extends ServiceEPBase {
return
count
;
}
/**
* 设置组过滤条件
*
* @param queryMap
*/
private
void
setGroupCondition
(
Map
queryMap
)
{
// 超级管理员看所有数据
if
(
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
()))
{
return
;
}
// 仅查询自己所在组的任务 added by songx at 20240820
List
<
String
>
allGroupNames
=
UserSessionUtils
.
getAllGroupName
();
// 当用户无组的时候,集合中添加空字符串用于查询,如果不加会查询出所有的数据
allGroupNames
.
add
(
" "
);
queryMap
.
put
(
"groupNames"
,
allGroupNames
);
}
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询公司"
,
operDesc
=
"APP查询当前登陆用户角色所属公司"
)
public
List
<
Company
>
getRoleCompany
(
EiInfo
inInfo
)
{
List
<
Company
>
companyList
=
UserSessionUtils
.
getRoleCompany
();
...
...
@@ -259,5 +290,3 @@ public class ServiceHGSC007 extends ServiceEPBase {
}
}
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0801A.java
View file @
bd6f3e10
...
...
@@ -110,29 +110,64 @@ public class ServiceXSOG0801A extends ServiceEPBase {
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
parentOrgId
=
queryRow
.
get
(
"parentOrgId"
).
toString
();
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 非管理员组织机构编码前缀增加企业编码 added by songx at 2024-01-15
String
accountCode
=
UserSessionUtils
.
getAccountCode
();
List
<
Map
>
newRows
=
new
ArrayList
<>();
List
<
Map
>
addRows
=
new
ArrayList
<>();
List
<
Map
>
modifyRows
=
new
ArrayList
<>();
for
(
Map
row
:
resultRows
)
{
// 已存在的数据跳过
String
orgId
=
MapUtils
.
getString
(
row
,
"orgId"
);
if
(
StringUtils
.
isNotBlank
(
orgId
))
{
continue
;
buildModifyData
(
row
);
modifyRows
.
add
(
row
);
}
else
{
buildAddData
(
row
,
parentOrgId
,
accountCode
);
addRows
.
add
(
row
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
addRows
))
{
EiInfo
call
=
new
EiInfo
();
call
.
set
(
"list"
,
addRows
);
call
.
set
(
EiConstant
.
serviceId
,
"S_XS_87"
);
XServiceManager
.
call
(
call
);
}
if
(
CollectionUtils
.
isNotEmpty
(
modifyRows
))
{
EiInfo
call
=
new
EiInfo
();
call
.
set
(
"list"
,
modifyRows
);
call
.
set
(
EiConstant
.
serviceId
,
"S_XS_89"
);
XServiceManager
.
call
(
call
);
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setMsg
(
"保存成功"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"保存组织机构失败"
);
}
orgId
=
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
ORG_CODE
);
return
inInfo
;
}
/**
* 构建添加数据
*
* @param row
* @param parentOrgId
* @param accountCode
*/
private
void
buildAddData
(
Map
row
,
String
parentOrgId
,
String
accountCode
)
{
String
orgId
=
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
ORG_CODE
);
row
.
put
(
"orgId"
,
orgId
);
row
.
put
(
"orgEname"
,
orgId
);
row
.
put
(
"accountCode"
,
accountCode
);
row
.
put
(
"establishDate"
,
DateUtils
.
formatShort
(
MapUtils
.
getString
(
row
,
"establishDate"
)));
row
.
put
(
"parentOrgId"
,
queryRow
.
get
(
"parentOrgId"
)
);
row
.
put
(
"parentOrgId"
,
parentOrgId
);
row
.
put
(
"recCreator"
,
UserSession
.
getLoginName
());
// 厂区代码
if
(
OrgTypeEnum
.
FACTORY
.
getCode
().
equals
(
row
.
get
(
"orgType"
)))
{
row
.
put
(
"factoryCode"
,
orgId
);
row
.
put
(
"factoryName"
,
row
.
get
(
"orgCname"
));
}
else
{
Org
factoryOrg
=
HGXSTools
.
XsOrg
.
queryFactory
(
queryRow
.
get
(
"parentOrgId"
).
toString
()
);
Org
factoryOrg
=
HGXSTools
.
XsOrg
.
queryFactory
(
parentOrgId
);
row
.
put
(
"factoryCode"
,
factoryOrg
==
null
?
""
:
factoryOrg
.
getOrgId
());
row
.
put
(
"factoryName"
,
factoryOrg
==
null
?
""
:
factoryOrg
.
getOrgCname
());
}
...
...
@@ -141,27 +176,20 @@ public class ServiceXSOG0801A extends ServiceEPBase {
row
.
put
(
"companyCode"
,
orgId
);
row
.
put
(
"companyName"
,
row
.
get
(
"orgCname"
));
}
else
{
Org
companyOrg
=
HGXSTools
.
XsOrg
.
queryCompany
(
queryRow
.
get
(
"parentOrgId"
).
toString
()
);
Org
companyOrg
=
HGXSTools
.
XsOrg
.
queryCompany
(
parentOrgId
);
row
.
put
(
"companyCode"
,
companyOrg
==
null
?
""
:
companyOrg
.
getOrgId
());
row
.
put
(
"companyName"
,
companyOrg
==
null
?
""
:
companyOrg
.
getOrgCname
());
}
newRows
.
add
(
row
);
}
if
(
CollectionUtils
.
isEmpty
(
newRows
))
{
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
inInfo
.
setMsg
(
"请新增一行输入需要新增的数据"
);
return
inInfo
;
}
EiInfo
call
=
new
EiInfo
();
call
.
set
(
"list"
,
newRows
);
call
.
set
(
EiConstant
.
serviceId
,
"S_XS_87"
);
XServiceManager
.
call
(
call
);
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setMsg
(
"新增成功"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"新增组织机构失败"
);
}
return
inInfo
;
/**
* 构建修改数据
*
* @param row
*/
private
void
buildModifyData
(
Map
row
)
{
row
.
put
(
"establishDate"
,
DateUtils
.
formatShort
(
row
.
get
(
"establishDate"
)));
row
.
put
(
"recRevisor"
,
UserSession
.
getLoginName
());
}
}
src/main/webapp/HG/SC/HGSC007.jsp
View file @
bd6f3e10
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/10
Time: 15:29
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
<
%@
taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%
>
...
...
@@ -22,7 +15,6 @@
<EF:EFInput
ename=
"inqu_status-0-orderDetailId"
cname=
"订单详情ID"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-productCode"
cname=
"产品编码"
placeholder=
"模糊查询"
colWidth=
"3"
/>
<EF:EFInput
blockId=
"inqu_status"
row=
"0"
ename=
"productName"
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=
"createdTime"
cname=
"生产任务日期"
role=
"date"
format=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
colWidth=
"3"
/>
<
%
--
<
EF:EFDatePicker
blockId=
"inqu_status"
row=
"0"
ename=
"complete_date"
cname=
"生产完工日期"
role=
"date"
...
...
@@ -30,6 +22,13 @@
<EF:EFDatePicker
blockId=
"inqu_status"
row=
"0"
ename=
"completeDate"
cname=
"生产完工日期"
role=
"date"
format=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
colWidth=
"3"
/>
</div>
<div
class=
"row"
>
<EF:EFInput
blockId=
"inqu_status"
row=
"0"
ename=
"groupName"
cname=
"班组名称"
placeholder=
"模糊查询"
colWidth=
"3"
/>
<EF:EFSelect
cname=
"工序"
ename=
"processCode"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
optionLabel=
"全部"
filter=
"contains"
>
<EF:EFOptions
blockId=
"processCode_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
...
...
src/main/webapp/XS/OG/XSOG0801A.jsp
View file @
bd6f3e10
...
...
@@ -18,12 +18,12 @@
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"子组织机构"
>
<EF:EFGrid
blockId=
"result"
autoBind=
"false"
autoDraw=
"false"
checkMode=
"multiple,row"
readonly=
"true"
>
<EF:EFGrid
blockId=
"result"
autoBind=
"false"
autoDraw=
"false"
checkMode=
"multiple,row"
>
<EF:EFColumn
ename=
"orgId"
cname=
"组织ID"
hidden=
"true"
/>
<EF:EFColumn
ename=
"orgEname"
cname=
"组织编码"
readonly=
"true"
hidden=
"true"
/>
<EF:EFColumn
ename=
"orgCname"
cname=
"组织名称"
required=
"true"
locked=
"true"
/>
<EF:EFColumn
ename=
"orgBriefName"
cname=
"组织别名"
hidden=
"true"
/>
<EF:EFComboColumn
ename=
"orgType"
cname=
"组织类型"
align=
"center"
required=
"true"
>
<EF:EFComboColumn
ename=
"orgType"
cname=
"组织类型"
align=
"center"
required=
"true"
readonly=
"true"
>
<EF:EFOptions
blockId=
"orgTypeBlock"
textField=
"label"
valueField=
"value"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"orgNodeType"
cname=
"节点类型"
hidden=
"true"
defaultValue=
"2"
/>
<
%
--
隐藏
默认值为
2--
%
>
...
...
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