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
70908f2b
Commit
70908f2b
authored
Aug 20, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.仅查询自己所在的生产组的数据
parent
2d47037c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
219 deletions
+85
-219
UserSessionUtils.java
...ava/com/baosight/hggp/core/security/UserSessionUtils.java
+3
-3
ServiceHGSC007.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
+5
-2
ServiceHGSC008.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC008.java
+51
-46
HGSC007.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
+1
-0
HGSC008.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC008.xml
+19
-162
HGSC007.jsp
src/main/webapp/HG/SC/HGSC007.jsp
+6
-6
No files found.
src/main/java/com/baosight/hggp/core/security/UserSessionUtils.java
View file @
70908f2b
...
...
@@ -142,15 +142,15 @@ public class UserSessionUtils extends UserSession {
if
(
CollectionUtils
.
isEmpty
(
orgs
))
{
return
new
ArrayList
<>();
}
List
<
String
>
prod
GroupCodes
=
new
ArrayList
<>();
List
<
String
>
all
GroupCodes
=
new
ArrayList
<>();
for
(
Org
org
:
orgs
)
{
if
(
OrgTypeEnum
.
PROD_GROUP
.
getCode
().
equals
(
org
.
getOrgType
())
||
OrgTypeEnum
.
CUT_GROUP
.
getCode
().
equals
(
org
.
getOrgType
())
||
OrgTypeEnum
.
SYN_GROUP
.
getCode
().
equals
(
org
.
getOrgType
()))
{
prod
GroupCodes
.
add
(
org
.
getOrgId
());
all
GroupCodes
.
add
(
org
.
getOrgId
());
}
}
return
prod
GroupCodes
;
return
all
GroupCodes
;
}
/**
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
View file @
70908f2b
...
...
@@ -91,8 +91,11 @@ public class ServiceHGSC007 extends ServiceEPBase {
if
(
StringUtils
.
isNotBlank
(
creatTime
))
{
queryMap
.
put
(
HGSC007
.
FIELD_created_time
,
StringUtil
.
removeHorizontalLine
(
creatTime
));
}
// 仅查询自己所在组的任务
queryMap
.
put
(
"groupCodes"
,
UserSessionUtils
.
getAllGroupCode
());
// 仅查询自己所在组的任务 added by songx at 20240820
List
<
String
>
allGroupCodes
=
UserSessionUtils
.
getAllGroupCode
();
// 当用户无组的时候,集合中添加一个不存在的组用于查询,如果不加会查询出所有的数据
allGroupCodes
.
add
(
"GROUP_CODE"
);
queryMap
.
put
(
"groupCodes"
,
allGroupCodes
);
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY
,
new
HGSC007
());
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC008.java
View file @
70908f2b
package
com
.
baosight
.
hggp
.
hg
.
sc
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.core.
dao.Dao
Utils
;
import
com.baosight.hggp.core.
security.UserSession
Utils
;
import
com.baosight.hggp.hg.sc.domain.HGSC002
;
import
com.baosight.hggp.hg.sc.domain.HGSC008
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
...
@@ -12,56 +13,60 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author wwl
* @version 1.0 2024/5/24
*/
* @author wwl
* @version 1.0 2024/5/24
*/
public
class
ServiceHGSC008
extends
ServiceEPBase
{
@OperationLogAnnotation
(
operModul
=
"生产报工单"
,
operType
=
"查询"
,
operDesc
=
"初始化页面"
)
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGSC008
().
eiMetadata
);
inInfo
=
super
.
query
(
inInfo
,
HGSC008
.
QUERY
,
new
HGSC008
());
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
}
return
inInfo
;
}
/*
* 查询*/
@OperationLogAnnotation
(
operModul
=
"生产报工单"
,
operType
=
"查询"
,
operDesc
=
"查询"
)
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
inInfo
=
super
.
query
(
inInfo
,
HGSC008
.
QUERY
,
new
HGSC008
()
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
@Override
@OperationLogAnnotation
(
operModul
=
"生产报工单"
,
operType
=
"删除"
,
operDesc
=
"删除"
)
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 销售单号
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
HGSC002
.
FIELD_id
);
HGSCTools
.
THGSC008
.
delete
(
ids
);
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
}
return
inInfo
;
}
@OperationLogAnnotation
(
operModul
=
"生产报工单"
,
operType
=
"查询"
,
operDesc
=
"初始化页面"
)
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGSC008
().
eiMetadata
);
inInfo
=
super
.
query
(
inInfo
,
HGSC008
.
QUERY
,
new
HGSC008
());
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
}
return
inInfo
;
}
/*
* 查询*/
@OperationLogAnnotation
(
operModul
=
"生产报工单"
,
operType
=
"查询"
,
operDesc
=
"查询"
)
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
// 仅查询自己所在组的任务 added by songx at 20240820
List
<
String
>
allGroupCodes
=
UserSessionUtils
.
getAllGroupCode
();
// 当用户无组的时候,集合中添加一个不存在的组用于查询,如果不加会查询出所有的数据
allGroupCodes
.
add
(
"GROUP_CODE"
);
queryMap
.
put
(
"groupCodes"
,
allGroupCodes
);
inInfo
=
super
.
query
(
inInfo
,
HGSC008
.
QUERY
,
new
HGSC008
());
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
@Override
@OperationLogAnnotation
(
operModul
=
"生产报工单"
,
operType
=
"删除"
,
operDesc
=
"删除"
)
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 销售单号
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
HGSC002
.
FIELD_id
);
HGSCTools
.
THGSC008
.
delete
(
ids
);
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
}
return
inInfo
;
}
}
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
View file @
70908f2b
...
...
@@ -269,6 +269,7 @@
LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
</select>
<insert
id=
"insert"
>
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC008.xml
View file @
70908f2b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-05-28 16:11:25
Version : 1.0
schema : hggp
tableName : HGSC008
id BIGINT NOT NULL primarykey,
mat_id BIGINT NOT NULL,
task_id BIGINT NOT NULL,
tech_flow_id BIGINT,
tech_flow_name BIGINT,
invent_process_id BIGINT,
process_code VARCHAR,
process_name VARCHAR,
process_order BIGINT,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
work_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
plan_start_date VARCHAR,
plan_end_date VARCHAR,
factory_code VARCHAR,
factory_name VARCHAR,
group_code VARCHAR,
group_name VARCHAR,
register_date VARCHAR,
quantity TINYINT,
single_weight DECIMAL,
total_weight DECIMAL,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap
namespace=
"HGSC008"
>
<sql
id=
"authCondition"
>
<sql
id=
"authCondition"
>
<!-- 无权限时使用 -->
<isNotEmpty
prepend=
" AND "
property=
"authDepCode"
>
A.DEP_CODE = #authDepCode#
...
...
@@ -177,8 +136,13 @@
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC008"
>
<sql
id=
"customCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"groupCodes"
>
A.GROUP_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"groupCodes"
>
#groupCodes[]#
</iterate>
</isNotEmpty>
</sql>
<select
id=
"query"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC008"
>
SELECT
A.id as "id",
A.mat_id as "matId",
<!-- 物料清单ID -->
...
...
@@ -218,9 +182,11 @@
A.updated_time as "updatedTime",
<!-- 更新时间 -->
B.LENGTH as "length",
<!-- 长 -->
B.SPEC as "spec"
<!-- 规格 -->
FROM ${hggpSchema}.HGSC008 A LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE
FROM ${hggpSchema}.HGSC008 A
LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
...
...
@@ -229,124 +195,15 @@
A.register_date desc ,A.id desc
</isEmpty>
</dynamic>
</select>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hggpSchema}.HGSC008 A LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE WHERE 1=1
<include
refid=
"condition"
/>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskId">
task_id = #taskId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowId">
tech_flow_id = #techFlowId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowName">
tech_flow_name = #techFlowName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventProcessId">
invent_process_id = #inventProcessId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
process_code = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
process_name = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processOrder">
process_order = #processOrder#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="workCode">
work_code = #workCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planStartDate">
plan_start_date = #planStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planEndDate">
plan_end_date = #planEndDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
group_code = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
group_name = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="registerDate">
register_date = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hggpSchema}.HGSC008 A
LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
</select>
<insert
id=
"insert"
>
INSERT INTO ${hggpSchema}.HGSC008 (id,
...
...
src/main/webapp/HG/SC/HGSC007.jsp
View file @
70908f2b
...
...
@@ -37,22 +37,22 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="
2
20" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="
1
20" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="1
2
0" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="1
4
0" align="center" readOnly="true"/>
<EF:EFColumn ename="createdTime" cname="生产任务日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="taskCode" cname="生产任务单号" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productName" cname="产品名称" width="1
0
0" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productName" cname="产品名称" width="1
2
0" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="groupName" cname="生产班组" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="spec" cname="规格" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="length" cname="长(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="singleWeight" cname="单重(KG)" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalWeight" cname="任务总重(KG)" width="1
0
0" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="finishWeight" cname="完工总重(KG)" width="1
0
0" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="unfinishWeight" cname="未完工总重(KG)" width="1
0
0" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalWeight" cname="任务总重(KG)" width="1
1
0" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="finishWeight" cname="完工总重(KG)" width="1
1
0" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="unfinishWeight" cname="未完工总重(KG)" width="1
2
0" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="quantity" cname="任务数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="finishQuantity" cname="完工数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="unfinishQuantity" cname="未完工数量" width="100" enable="false" readonly="true" align="center"/>
...
...
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