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
3e2be62d
Commit
3e2be62d
authored
Aug 22, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-sx' of
http://129.211.46.84:8800/platform/hg-smart
parents
8f5e564b
e1bb9ffa
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
288 additions
and
178 deletions
+288
-178
UserSessionUtils.java
...ava/com/baosight/hggp/core/security/UserSessionUtils.java
+43
-3
ServiceHGSC007.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
+5
-22
ServiceHGSC008.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC008.java
+14
-8
HGSC007.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
+87
-69
HGSC008.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC008.xml
+78
-61
HgScUtils.java
src/main/java/com/baosight/hggp/hg/sc/util/HgScUtils.java
+57
-0
HGSC007.jsp
src/main/webapp/HG/SC/HGSC007.jsp
+2
-6
HGSC008.jsp
src/main/webapp/HG/SC/HGSC008.jsp
+2
-9
No files found.
src/main/java/com/baosight/hggp/core/security/UserSessionUtils.java
View file @
3e2be62d
...
...
@@ -78,9 +78,10 @@ public class UserSessionUtils extends UserSession {
}
return
accountCode
;
}
/**
获取用户所属公司 *
* 获取用户所属公司
*
* @return
*/
public
static
UserVO
getUserCompany
()
{
...
...
@@ -89,7 +90,7 @@ public class UserSessionUtils extends UserSession {
if
(
CollectionUtils
.
isNotEmpty
(
orgList
))
{
Org
org
=
orgList
.
get
(
0
);
if
(!
org
.
getOrgType
().
equals
(
"company"
))
{
//如果不是公司公司,则找到上一级
//
如果不是公司公司,则找到上一级
Org
org1
=
HGXSTools
.
XsOrg
.
queryCompany
(
org
.
getOrgId
());
userVO
.
setUsercode
(
org1
.
getOrgId
());
userVO
.
setUsername
(
org1
.
getOrgCname
());
...
...
@@ -100,6 +101,7 @@ public class UserSessionUtils extends UserSession {
}
return
userVO
;
}
/**
* 获取登录用户的组织机构
*
...
...
@@ -114,6 +116,25 @@ public class UserSessionUtils extends UserSession {
}
/**
* 获取登录用户的公司编码
*
* @return
*/
public
static
List
<
String
>
getCompanyCode
()
{
List
<
Org
>
orgs
=
HGXSTools
.
XsOrg
.
queryByUser
();
if
(
CollectionUtils
.
isEmpty
(
orgs
))
{
return
new
ArrayList
<>();
}
List
<
String
>
orgIds
=
new
ArrayList
<>();
for
(
Org
org
:
orgs
)
{
if
(
OrgTypeEnum
.
COMPANY
.
getCode
().
equals
(
org
.
getOrgType
()))
{
orgIds
.
add
(
org
.
getOrgId
());
}
}
return
orgIds
;
}
/**
* 获取登录用户的厂区编码
*
* @return
...
...
@@ -133,6 +154,25 @@ public class UserSessionUtils extends UserSession {
}
/**
* 获取登录用户的厂区名称
*
* @return
*/
public
static
List
<
String
>
getFactoryName
()
{
List
<
Org
>
orgs
=
HGXSTools
.
XsOrg
.
queryByUser
();
if
(
CollectionUtils
.
isEmpty
(
orgs
))
{
return
new
ArrayList
<>();
}
List
<
String
>
factoryNames
=
new
ArrayList
<>();
for
(
Org
org
:
orgs
)
{
if
(
OrgTypeEnum
.
FACTORY
.
getCode
().
equals
(
org
.
getOrgType
()))
{
factoryNames
.
add
(
org
.
getOrgCname
());
}
}
return
factoryNames
;
}
/**
* 获取登录用户的所有组
*
* @return
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
View file @
3e2be62d
...
...
@@ -8,6 +8,7 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.sb.tools.HGSBTools
;
import
com.baosight.hggp.hg.sc.domain.HGSC007
;
import
com.baosight.hggp.hg.sc.util.HgScUtils
;
import
com.baosight.hggp.hg.xs.domain.Company
;
import
com.baosight.hggp.hg.xs.domain.Factory
;
import
com.baosight.hggp.hg.xs.domain.Org
;
...
...
@@ -102,8 +103,8 @@ public class ServiceHGSC007 extends ServiceEPBase {
if
(
StringUtils
.
isNotBlank
(
creatTime
))
{
queryMap
.
put
(
HGSC007
.
FIELD_created_time
,
StringUtil
.
removeHorizontalLine
(
creatTime
));
}
//
设置组过滤条件
this
.
setGroup
Condition
(
queryMap
);
//
仅查询自己所在组的任务 added by songx at 20240820
HgScUtils
.
HgSc007
.
setOrg
Condition
(
queryMap
);
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY
,
new
HGSC007
());
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
...
...
@@ -126,33 +127,15 @@ public class ServiceHGSC007 extends ServiceEPBase {
if
(
StringUtils
.
isNotBlank
(
creatTime
))
{
queryMap
.
put
(
HGSC007
.
FIELD_created_time
,
StringUtil
.
removeHorizontalLine
(
creatTime
));
}
//
设置组过滤条件
this
.
setGroup
Condition
(
queryMap
);
//
仅查询自己所在组的任务 added by songx at 20240820
HgScUtils
.
HgSc007
.
setOrg
Condition
(
queryMap
);
count
=
super
.
count
(
HGSC007
.
COUNT
,
queryMap
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
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
();
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC008.java
View file @
3e2be62d
package
com
.
baosight
.
hggp
.
hg
.
sc
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
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.hg.sc.util.HgScUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
...
...
@@ -22,28 +22,34 @@ import java.util.Map;
*/
public
class
ServiceHGSC008
extends
ServiceEPBase
{
/**
* 初始化
*
* @param inInfo
* @return
*/
@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
;
}
/*
* 查询*/
/**
* 查询
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"生产报工单"
,
operType
=
"查询"
,
operDesc
=
"查询"
)
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
// 仅查询自己所在组的任务 added by songx at 20240820
List
<
String
>
allGroupNames
=
UserSessionUtils
.
getAllGroupName
();
// 当用户无组的时候,集合中添加一个不存在的组用于查询,如果不加会查询出所有的数据
allGroupNames
.
add
(
" "
);
queryMap
.
put
(
"groupNames"
,
allGroupNames
);
HgScUtils
.
HgSc007
.
setOrgCondition
(
queryMap
);
inInfo
=
super
.
query
(
inInfo
,
HGSC008
.
QUERY
,
new
HGSC008
());
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
View file @
3e2be62d
...
...
@@ -2,9 +2,54 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap
namespace=
"HGSC007"
>
<sql
id=
"column"
>
id as "id",
mat_id as "matId",
<!-- 物料清单ID -->
order_id as "orderId",
<!-- 生产计划ID -->
order_detail_id as "orderDetailId",
<!-- 生产计划明细ID -->
tech_flow_id as "techFlowId",
<!-- 工艺流程ID -->
tech_flow_name as "techFlowName",
<!-- 工艺流程名称 -->
invent_process_id as "inventProcessId",
<!-- 存货工序ID,对应HGPZ005A.id -->
process_code as "processCode",
<!-- 工序编码 -->
process_name as "processName",
<!-- 工序名称 -->
process_order as "processOrder",
<!-- 加工顺序 -->
company_code as "companyCode",
<!-- 公司编码 -->
company_name as "companyName",
<!-- 公司名称 -->
dep_code as "depCode",
<!-- 部门编码 -->
dep_name as "depName",
<!-- 部门名称 -->
proj_code as "projCode",
<!-- 项目编码 -->
proj_name as "projName",
<!-- 项目名称 -->
task_code as "taskCode",
<!-- 任务编码 -->
product_type as "productType",
<!-- 产品类型 -->
product_code as "productCode",
<!-- 产品编号 -->
product_name as "productName",
<!-- 产品名称 -->
plan_start_date as "planStartDate",
<!-- 计划开始日期 -->
plan_end_date as "planEndDate",
<!-- 计划结束日期 -->
factory_code as "factoryCode",
<!-- 工厂编号 -->
factory_name as "factoryName",
<!-- 工厂名称 -->
group_code as "groupCode",
<!-- 工作组编号 -->
group_name as "groupName",
<!-- 工作组名称 -->
complete_date as "completeDate",
<!-- 完工日期 -->
quantity as "quantity",
<!-- 数量 -->
finish_quantity as "finishQuantity",
<!-- 完工数量 -->
unfinish_quantity as "unfinishQuantity",
<!-- 未完工数量 -->
single_weight as "singleWeight",
<!-- 单重 -->
total_weight as "totalWeight",
<!-- 总重 -->
finish_weight as "finishWeight",
<!-- 完工重量 -->
unfinish_weight as "unfinishWeight",
<!-- 未完工重量 -->
account_code as "accountCode",
<!-- 帐套 -->
created_by as "createdBy",
<!-- 创建人 -->
created_name as "createdName",
<!-- 创建人名称 -->
created_time as "createdTime",
<!-- 创建时间 -->
updated_by as "updatedBy",
<!-- 更新人 -->
updated_name as "updatedName",
<!-- 修改人名称 -->
updated_time as "updatedTime",
<!-- 更新时间 -->
LENGTH as "length",
<!-- 长 -->
SPEC as "spec"
<!-- 规格 -->
</sql>
<sql
id=
"condition"
>
<include
refid=
"HGXSDataAuth.authCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
id = #id#
</isNotEmpty>
...
...
@@ -141,6 +186,15 @@
</sql>
<sql
id=
"customCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"companyCodes"
>
COMPANY_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"companyCodes"
>
#companyCodes[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryCodes"
>
FACTORY_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"factoryCodes"
>
#factoryCodes[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryNames"
>
FACTORY_NAME IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"factoryNames"
>
#factoryNames[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"groupCodes"
>
GROUP_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"groupCodes"
>
#groupCodes[]#
</iterate>
</isNotEmpty>
...
...
@@ -168,6 +222,7 @@
</isNotEmpty>
</isNotEqual>
</sql>
<sql
id=
"appOrderCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
h.account_code = #accountCode#
...
...
@@ -186,70 +241,31 @@
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC007"
>
SELECT
id as "id",
mat_id as "matId",
<!-- 物料清单ID -->
order_id as "orderId",
<!-- 生产计划ID -->
order_detail_id as "orderDetailId",
<!-- 生产计划明细ID -->
tech_flow_id as "techFlowId",
<!-- 工艺流程ID -->
tech_flow_name as "techFlowName",
<!-- 工艺流程名称 -->
invent_process_id as "inventProcessId",
<!-- 存货工序ID,对应HGPZ005A.id -->
process_code as "processCode",
<!-- 工序编码 -->
process_name as "processName",
<!-- 工序名称 -->
process_order as "processOrder",
<!-- 加工顺序 -->
company_code as "companyCode",
<!-- 公司编码 -->
company_name as "companyName",
<!-- 公司名称 -->
dep_code as "depCode",
<!-- 部门编码 -->
dep_name as "depName",
<!-- 部门名称 -->
proj_code as "projCode",
<!-- 项目编码 -->
proj_name as "projName",
<!-- 项目名称 -->
task_code as "taskCode",
<!-- 任务编码 -->
product_type as "productType",
<!-- 产品类型 -->
product_code as "productCode",
<!-- 产品编号 -->
product_name as "productName",
<!-- 产品名称 -->
plan_start_date as "planStartDate",
<!-- 计划开始日期 -->
plan_end_date as "planEndDate",
<!-- 计划结束日期 -->
factory_code as "factoryCode",
<!-- 工厂编号 -->
factory_name as "factoryName",
<!-- 工厂名称 -->
group_code as "groupCode",
<!-- 工作组编号 -->
group_name as "groupName",
<!-- 工作组名称 -->
complete_date as "completeDate",
<!-- 完工日期 -->
quantity as "quantity",
<!-- 数量 -->
finish_quantity as "finishQuantity",
<!-- 完工数量 -->
unfinish_quantity as "unfinishQuantity",
<!-- 未完工数量 -->
single_weight as "singleWeight",
<!-- 单重 -->
total_weight as "totalWeight",
<!-- 总重 -->
finish_weight as "finishWeight",
<!-- 完工重量 -->
unfinish_weight as "unfinishWeight",
<!-- 未完工重量 -->
account_code as "accountCode",
<!-- 帐套 -->
created_by as "createdBy",
<!-- 创建人 -->
created_name as "createdName",
<!-- 创建人名称 -->
created_time as "createdTime",
<!-- 创建时间 -->
updated_by as "updatedBy",
<!-- 更新人 -->
updated_name as "updatedName",
<!-- 修改人名称 -->
updated_time as "updatedTime",
<!-- 更新时间 -->
LENGTH as "length",
<!-- 长 -->
SPEC as "spec"
<!-- 规格 -->
FROM ${hggpSchema}.HGSC007
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
</isNotEmpty>
<isEmpty
property=
"orderBy"
>
id desc, product_type asc, product_name, process_order desc
</isEmpty>
</dynamic>
<sql
id=
"orderBy"
>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
</isNotEmpty>
<isEmpty
property=
"orderBy"
>
id desc, product_type asc, product_name, process_order desc
</isEmpty>
</dynamic>
</sql>
</select>
<select
id=
"query"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC007"
>
SELECT
<include
refid=
"column"
/>
FROM ${hggpSchema}.HGSC007
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<include
refid=
"orderBy"
/>
</select>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hggpSchema}.HGSC007 WHERE 1=1
<include
refid=
"condition"
/>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hggpSchema}.HGSC007
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
</select>
...
...
@@ -306,10 +322,9 @@
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #spec#, #length#)
</insert>
<delete
id=
"delete"
>
DELETE FROM ${hggpSchema}.HGSC007 WHERE
id = #id#
</delete>
<delete
id=
"delete"
>
DELETE FROM ${hggpSchema}.HGSC007 WHERE id = #id#
</delete>
<update
id=
"update"
>
UPDATE ${hggpSchema}.HGSC007
...
...
@@ -360,8 +375,7 @@
id = #id#
</update>
<!-- 行锁 -->
<!-- 行锁 -->
<update
id=
"lock"
>
UPDATE ${hggpSchema}.HGSC007
SET CREATED_TIME = CREATED_TIME
...
...
@@ -430,6 +444,7 @@
) a
group by a.factoryCode, a.factoryName
</select>
<!--查询工序日产量-->
<select
id=
"queryWt"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
select
...
...
@@ -449,6 +464,7 @@
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE asc
</select>
<!--查询工序日产量-->
<select
id=
"queryDayWt"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
select
...
...
@@ -468,6 +484,7 @@
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE asc
</select>
<!--查询工序月产量-->
<select
id=
"queryMonthWt"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
select
...
...
@@ -487,6 +504,7 @@
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE asc
</select>
<!--项目产量-->
<select
id=
"queryProjCodeWt"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
select
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC008.xml
View file @
3e2be62d
...
...
@@ -2,9 +2,50 @@
<!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=
"column"
>
id as "id",
mat_id as "matId",
<!-- 物料清单ID -->
task_id as "taskId",
<!-- 生产任务ID -->
tech_flow_id as "techFlowId",
<!-- 工艺流程ID -->
tech_flow_name as "techFlowName",
<!-- 工艺流程名称 -->
invent_process_id as "inventProcessId",
<!-- 存货工序ID,对应HGPZ005A.id -->
process_code as "processCode",
<!-- 工序编码 -->
process_name as "processName",
<!-- 工序名称 -->
process_order as "processOrder",
<!-- 加工顺序 -->
company_code as "companyCode",
<!-- 公司编码 -->
company_name as "companyName",
<!-- 公司名称 -->
dep_code as "depCode",
<!-- 部门编码 -->
dep_name as "depName",
<!-- 部门名称 -->
proj_code as "projCode",
<!-- 项目编码 -->
proj_name as "projName",
<!-- 项目名称 -->
work_code as "workCode",
<!-- 报工编码 -->
product_type as "productType",
<!-- 产品类型 -->
product_code as "productCode",
<!-- 产品编号 -->
product_name as "productName",
<!-- 产品名称 -->
plan_start_date as "planStartDate",
<!-- 计划开始日期 -->
plan_end_date as "planEndDate",
<!-- 计划结束日期 -->
factory_code as "factoryCode",
<!-- 工厂编号 -->
factory_name as "factoryName",
<!-- 工厂名称 -->
group_code as "groupCode",
<!-- 工作组编号 -->
group_name as "groupName",
<!-- 工作组名称 -->
register_date as "registerDate",
<!-- 报工日期 -->
quantity as "quantity",
<!-- 数量 -->
single_weight as "singleWeight",
<!-- 单重 -->
total_weight as "totalWeight",
<!-- 总重 -->
account_code as "accountCode",
<!-- 帐套 -->
created_by as "createdBy",
<!-- 创建人 -->
created_name as "createdName",
<!-- 创建人名称 -->
created_time as "createdTime",
<!-- 创建时间 -->
updated_by as "updatedBy",
<!-- 更新人 -->
updated_name as "updatedName",
<!-- 修改人名称 -->
updated_time as "updatedTime",
<!-- 更新时间 -->
length as "length",
<!-- 长 -->
spec as "spec",
<!-- 规格 -->
exceed_reason as "exceedReason"
</sql>
<sql
id=
"condition"
>
<include
refid=
"HGXSDataAuth.authCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
id = #id#
</isNotEmpty>
...
...
@@ -116,6 +157,15 @@
</sql>
<sql
id=
"customCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"companyCodes"
>
COMPANY_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"companyCodes"
>
#companyCodes[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryCodes"
>
FACTORY_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"factoryCodes"
>
#factoryCodes[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryNames"
>
FACTORY_NAME IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"factoryNames"
>
#factoryNames[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"groupCodes"
>
GROUP_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"groupCodes"
>
#groupCodes[]#
</iterate>
</isNotEmpty>
...
...
@@ -124,64 +174,31 @@
</isNotEmpty>
</sql>
<select
id=
"query"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC008"
>
SELECT
id as "id",
mat_id as "matId",
<!-- 物料清单ID -->
task_id as "taskId",
<!-- 生产任务ID -->
tech_flow_id as "techFlowId",
<!-- 工艺流程ID -->
tech_flow_name as "techFlowName",
<!-- 工艺流程名称 -->
invent_process_id as "inventProcessId",
<!-- 存货工序ID,对应HGPZ005A.id -->
process_code as "processCode",
<!-- 工序编码 -->
process_name as "processName",
<!-- 工序名称 -->
process_order as "processOrder",
<!-- 加工顺序 -->
company_code as "companyCode",
<!-- 公司编码 -->
company_name as "companyName",
<!-- 公司名称 -->
dep_code as "depCode",
<!-- 部门编码 -->
dep_name as "depName",
<!-- 部门名称 -->
proj_code as "projCode",
<!-- 项目编码 -->
proj_name as "projName",
<!-- 项目名称 -->
work_code as "workCode",
<!-- 报工编码 -->
product_type as "productType",
<!-- 产品类型 -->
product_code as "productCode",
<!-- 产品编号 -->
product_name as "productName",
<!-- 产品名称 -->
plan_start_date as "planStartDate",
<!-- 计划开始日期 -->
plan_end_date as "planEndDate",
<!-- 计划结束日期 -->
factory_code as "factoryCode",
<!-- 工厂编号 -->
factory_name as "factoryName",
<!-- 工厂名称 -->
group_code as "groupCode",
<!-- 工作组编号 -->
group_name as "groupName",
<!-- 工作组名称 -->
register_date as "registerDate",
<!-- 报工日期 -->
quantity as "quantity",
<!-- 数量 -->
single_weight as "singleWeight",
<!-- 单重 -->
total_weight as "totalWeight",
<!-- 总重 -->
account_code as "accountCode",
<!-- 帐套 -->
created_by as "createdBy",
<!-- 创建人 -->
created_name as "createdName",
<!-- 创建人名称 -->
created_time as "createdTime",
<!-- 创建时间 -->
updated_by as "updatedBy",
<!-- 更新人 -->
updated_name as "updatedName",
<!-- 修改人名称 -->
updated_time as "updatedTime",
<!-- 更新时间 -->
length as "length",
<!-- 长 -->
spec as "spec",
<!-- 规格 -->
exceed_reason as "exceedReason"
FROM ${hggpSchema}.HGSC008
WHERE 1=1
<include
refid=
"condition"
/>
<sql
id=
"orderBy"
>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
</isNotEmpty>
<isEmpty
property=
"orderBy"
>
register_date desc, id desc
</isEmpty>
</dynamic>
</sql>
<select
id=
"query"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC008"
>
SELECT
<include
refid=
"column"
/>
FROM ${hggpSchema}.HGSC008
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
</isNotEmpty>
<isEmpty
property=
"orderBy"
>
register_date desc, id desc
</isEmpty>
</dynamic>
</select>
<include
refid=
"orderBy"
/>
</select>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hggpSchema}.HGSC008 WHERE 1=1
<include
refid=
"condition"
/>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hggpSchema}.HGSC008
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
</select>
...
...
@@ -236,10 +253,9 @@
</selectKey>
</insert>
<delete
id=
"delete"
>
DELETE FROM ${hggpSchema}.HGSC008 WHERE
id = #id#
</delete>
<delete
id=
"delete"
>
DELETE FROM ${hggpSchema}.HGSC008 WHERE id = #id#
</delete>
<update
id=
"update"
>
UPDATE ${hggpSchema}.HGSC008
...
...
@@ -290,4 +306,5 @@
DELETE FROM ${hggpSchema}.HGSC008 WHERE
id IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</delete>
</sqlMap>
src/main/java/com/baosight/hggp/hg/sc/util/HgScUtils.java
0 → 100644
View file @
3e2be62d
package
com
.
baosight
.
hggp
.
hg
.
sc
.
util
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.xservices.xs.util.LoginUserDetails
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author:songx
* @date:2024/8/22,16:15
*/
public
class
HgScUtils
{
/**
*
* @author:songx
* @date:2024/8/22,16:17
*/
public
static
class
HgSc007
{
/**
* 设置组织机构查询条件
*
* @param queryMap
*/
public
static
void
setOrgCondition
(
Map
queryMap
)
{
// 超级管理员看所有数据
if
(
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
()))
{
return
;
}
// 仅查询自己所在组的任务 added by songx at 20240820
List
<
String
>
allGroupNames
=
UserSessionUtils
.
getAllGroupName
();
if
(
CollectionUtils
.
isNotEmpty
(
allGroupNames
))
{
queryMap
.
put
(
"groupNames"
,
allGroupNames
);
return
;
}
// 如果没有组,则查看所在厂区的任务
List
<
String
>
factoryNames
=
UserSessionUtils
.
getFactoryName
();
if
(
CollectionUtils
.
isNotEmpty
(
factoryNames
))
{
queryMap
.
put
(
"factoryNames"
,
factoryNames
);
return
;
}
// 如果没有厂区,则查看所在公司的任务
List
<
String
>
companyCodes
=
UserSessionUtils
.
getCompanyCode
();
if
(
CollectionUtils
.
isNotEmpty
(
companyCodes
))
{
queryMap
.
put
(
"companyCodes"
,
companyCodes
);
return
;
}
// 当用户无组织机构时,抛出异常
throw
new
PlatException
(
"当前用户未绑定组织机构,无法操作数据,请联系管理员!"
);
}
}
}
src/main/webapp/HG/SC/HGSC007.jsp
View file @
3e2be62d
...
...
@@ -17,8 +17,6 @@
<EF:EFInput
blockId=
"inqu_status"
row=
"0"
ename=
"productName"
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"
format=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
colWidth=
"3"
/>
--%>
<EF:EFDatePicker
blockId=
"inqu_status"
row=
"0"
ename=
"completeDate"
cname=
"生产完工日期"
role=
"date"
format=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
colWidth=
"3"
/>
</div>
...
...
@@ -35,13 +33,12 @@
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
>
<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=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
enable=
"true"
width=
"1
2
0"
align=
"center"
readOnly=
"true"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
enable=
"true"
width=
"1
8
0"
align=
"center"
readOnly=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
enable=
"true"
width=
"140"
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=
"1
0
0"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"taskCode"
cname=
"生产任务单号"
width=
"1
3
0"
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=
"120"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"processName"
cname=
"工序"
width=
"100"
enable=
"false"
readonly=
"true"
align=
"center"
/>
...
...
@@ -55,7 +52,6 @@
<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"
/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
src/main/webapp/HG/SC/HGSC008.jsp
View file @
3e2be62d
<%--
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"
%
>
...
...
@@ -30,9 +23,9 @@
<EF:EFColumn
ename=
"id"
primaryKey=
"true"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"accountCode"
cname=
"账套"
hidden=
"true"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
locked=
"true"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="1
2
0" align="center" readOnly="true"/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
enable=
"true"
width=
"1
8
0"
align=
"center"
readOnly=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
enable=
"true"
width=
"120"
align=
"center"
readOnly=
"true"
/>
<EF:EFColumn ename="workCode" cname="报工单号" width="1
0
0" enable="false" readonly="true" align="center"/>
<EF:EFColumn
ename=
"workCode"
cname=
"报工单号"
width=
"1
3
0"
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=
"100"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"processName"
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