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
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
174 deletions
+40
-174
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
+9
-4
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
+16
-159
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 {
...
@@ -142,15 +142,15 @@ public class UserSessionUtils extends UserSession {
if
(
CollectionUtils
.
isEmpty
(
orgs
))
{
if
(
CollectionUtils
.
isEmpty
(
orgs
))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
List
<
String
>
prod
GroupCodes
=
new
ArrayList
<>();
List
<
String
>
all
GroupCodes
=
new
ArrayList
<>();
for
(
Org
org
:
orgs
)
{
for
(
Org
org
:
orgs
)
{
if
(
OrgTypeEnum
.
PROD_GROUP
.
getCode
().
equals
(
org
.
getOrgType
())
if
(
OrgTypeEnum
.
PROD_GROUP
.
getCode
().
equals
(
org
.
getOrgType
())
||
OrgTypeEnum
.
CUT_GROUP
.
getCode
().
equals
(
org
.
getOrgType
())
||
OrgTypeEnum
.
CUT_GROUP
.
getCode
().
equals
(
org
.
getOrgType
())
||
OrgTypeEnum
.
SYN_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 {
...
@@ -91,8 +91,11 @@ public class ServiceHGSC007 extends ServiceEPBase {
if
(
StringUtils
.
isNotBlank
(
creatTime
))
{
if
(
StringUtils
.
isNotBlank
(
creatTime
))
{
queryMap
.
put
(
HGSC007
.
FIELD_created_time
,
StringUtil
.
removeHorizontalLine
(
creatTime
));
queryMap
.
put
(
HGSC007
.
FIELD_created_time
,
StringUtil
.
removeHorizontalLine
(
creatTime
));
}
}
// 仅查询自己所在组的任务
// 仅查询自己所在组的任务 added by songx at 20240820
queryMap
.
put
(
"groupCodes"
,
UserSessionUtils
.
getAllGroupCode
());
List
<
String
>
allGroupCodes
=
UserSessionUtils
.
getAllGroupCode
();
// 当用户无组的时候,集合中添加一个不存在的组用于查询,如果不加会查询出所有的数据
allGroupCodes
.
add
(
"GROUP_CODE"
);
queryMap
.
put
(
"groupCodes"
,
allGroupCodes
);
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY
,
new
HGSC007
());
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY
,
new
HGSC007
());
}
catch
(
PlatException
e
)
{
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
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
;
package
com
.
baosight
.
hggp
.
hg
.
sc
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
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.HGSC002
;
import
com.baosight.hggp.hg.sc.domain.HGSC008
;
import
com.baosight.hggp.hg.sc.domain.HGSC008
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
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.LogUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
@@ -12,11 +13,9 @@ import com.baosight.iplat4j.core.ei.EiInfo;
...
@@ -12,11 +13,9 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* @author wwl
* @author wwl
* @version 1.0 2024/5/24
* @version 1.0 2024/5/24
...
@@ -39,7 +38,13 @@ public class ServiceHGSC008 extends ServiceEPBase {
...
@@ -39,7 +38,13 @@ public class ServiceHGSC008 extends ServiceEPBase {
@OperationLogAnnotation
(
operModul
=
"生产报工单"
,
operType
=
"查询"
,
operDesc
=
"查询"
)
@OperationLogAnnotation
(
operModul
=
"生产报工单"
,
operType
=
"查询"
,
operDesc
=
"查询"
)
public
EiInfo
query
(
EiInfo
inInfo
)
{
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
try
{
inInfo
=
super
.
query
(
inInfo
,
HGSC008
.
QUERY
,
new
HGSC008
()
);
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
)
{
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
}
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
View file @
70908f2b
...
@@ -269,6 +269,7 @@
...
@@ -269,6 +269,7 @@
LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE
LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE
WHERE 1=1
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
</select>
</select>
<insert
id=
"insert"
>
<insert
id=
"insert"
>
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC008.xml
View file @
70908f2b
<?xml version="1.0" encoding="UTF-8"?>
<?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
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
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
-->
<sqlMap
namespace=
"HGSC008"
>
<sqlMap
namespace=
"HGSC008"
>
<sql
id=
"authCondition"
>
<sql
id=
"authCondition"
>
...
@@ -177,8 +136,13 @@
...
@@ -177,8 +136,13 @@
</isNotEmpty>
</isNotEmpty>
</sql>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
<sql
id=
"customCondition"
>
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC008"
>
<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
SELECT
A.id as "id",
A.id as "id",
A.mat_id as "matId",
<!-- 物料清单ID -->
A.mat_id as "matId",
<!-- 物料清单ID -->
...
@@ -218,9 +182,11 @@
...
@@ -218,9 +182,11 @@
A.updated_time as "updatedTime",
<!-- 更新时间 -->
A.updated_time as "updatedTime",
<!-- 更新时间 -->
B.LENGTH as "length",
<!-- 长 -->
B.LENGTH as "length",
<!-- 长 -->
B.SPEC as "spec"
<!-- 规格 -->
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
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<dynamic
prepend=
"ORDER BY"
>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
$orderBy$
...
@@ -229,125 +195,16 @@
...
@@ -229,125 +195,16 @@
A.register_date desc ,A.id desc
A.register_date desc ,A.id desc
</isEmpty>
</isEmpty>
</dynamic>
</dynamic>
</select>
</select>
<select
id=
"count"
resultClass=
"int"
>
<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
SELECT COUNT(*) FROM ${hggpSchema}.HGSC008 A
<include
refid=
"condition"
/>
LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
</select>
</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>
-->
<insert
id=
"insert"
>
<insert
id=
"insert"
>
INSERT INTO ${hggpSchema}.HGSC008 (id,
INSERT INTO ${hggpSchema}.HGSC008 (id,
mat_id,
<!-- 物料清单ID -->
mat_id,
<!-- 物料清单ID -->
...
...
src/main/webapp/HG/SC/HGSC007.jsp
View file @
70908f2b
...
@@ -37,22 +37,22 @@
...
@@ -37,22 +37,22 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<%--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="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"
<EF:EFColumn ename="createdTime" cname="生产任务日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="taskCode" cname="生产任务单号" width="100" enable="false" readonly="true" align="center"/>
<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="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="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="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="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="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="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="totalWeight" cname="任务总重(KG)" width="1
1
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="finishWeight" cname="完工总重(KG)" width="1
1
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="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="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="finishQuantity" cname="完工数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="unfinishQuantity" 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