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
9daa8b3e
Commit
9daa8b3e
authored
Sep 04, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.按查询内容进行排产
parent
168269f2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
114 deletions
+84
-114
ServiceHGSC005A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC005A.java
+2
-1
HGSC005A.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC005A.xml
+41
-78
HGSCTools.java
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
+32
-8
HGSC005A.js
src/main/webapp/HG/SC/HGSC005A.js
+9
-27
No files found.
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC005A.java
View file @
9daa8b3e
...
...
@@ -119,10 +119,11 @@ public class ServiceHGSC005A extends ServiceBase {
public
EiInfo
schedule
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
processName
=
MapUtils
.
getString
(
queryMap
,
"processName"
);
String
planCode
=
MapUtils
.
getString
(
queryMap
,
"planCode"
);
HGSC005
dbSc005
=
HGSCTools
.
THGSC005
.
queryByPlanCode
(
planCode
);
this
.
checkScheduleData
(
dbSc005
);
int
count
=
HGSCTools
.
THGSC005A
.
schedule
(
planCode
);
int
count
=
HGSCTools
.
THGSC005A
.
schedule
(
planCode
,
processName
);
dbSc005
.
setIsSchedule
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
update
(
HGSC005
.
UPDATE
,
dbSc005
);
inInfo
=
this
.
query
(
inInfo
);
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC005A.xml
View file @
9daa8b3e
<?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-17 17:15:03
Version : 1.0
schema : hggp
tableName : HGSC005A
id BIGINT NOT NULL primarykey,
mat_id BIGINT NOT NULL,
mat_detail_id BIGINT NOT NULL,
tech_flow_id BIGINT,
tech_flow_name BIGINT,
invent_process_id BIGINT,
process_name VARCHAR,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
plan_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
finish_date VARCHAR,
plan_start_date VARCHAR,
plan_end_date VARCHAR,
quantity TINYINT,
finish_quantity TINYINT,
unfinish_quantity TINYINT,
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=
"HGSC005A"
>
<sql
id=
"condition"
>
<sql
id=
"condition"
>
<!--<include refid="HGXSDataAuth.authCondition"/>-->
<isNotEmpty
prepend=
" AND "
property=
"id"
>
id = #id#
</isNotEmpty>
...
...
@@ -156,46 +120,45 @@
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC005A"
>
SELECT
id as "id",
mat_id as "matId",
<!-- 物料清单ID -->
mat_detail_id as "matDetailId",
<!-- 物料清单明细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",
<!-- 工序名称 -->
company_code as "companyCode",
<!-- 公司编码 -->
process_order as "processOrder",
<!-- 加工顺序 -->
company_name as "companyName",
<!-- 公司名称 -->
dep_code as "depCode",
<!-- 部门编码 -->
dep_name as "depName",
<!-- 部门名称 -->
proj_code as "projCode",
<!-- 项目编码 -->
proj_name as "projName",
<!-- 项目名称 -->
plan_code as "planCode",
<!-- 计划编码 -->
product_type as "productType",
<!-- 产品类型 -->
product_code as "productCode",
<!-- 产品编号 -->
product_name as "productName",
<!-- 产品名称 -->
finish_date as "finishDate",
<!-- 完工日期 -->
plan_start_date as "planStartDate",
<!-- 计划开始日期 -->
plan_end_date as "planEndDate",
<!-- 计划结束日期 -->
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"
<!-- 更新时间 -->
FROM ${hggpSchema}.HGSC005A WHERE 1=1
<select
id=
"query"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC005A"
>
SELECT
id as "id",
mat_id as "matId",
<!-- 物料清单ID -->
mat_detail_id as "matDetailId",
<!-- 物料清单明细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",
<!-- 工序名称 -->
company_code as "companyCode",
<!-- 公司编码 -->
process_order as "processOrder",
<!-- 加工顺序 -->
company_name as "companyName",
<!-- 公司名称 -->
dep_code as "depCode",
<!-- 部门编码 -->
dep_name as "depName",
<!-- 部门名称 -->
proj_code as "projCode",
<!-- 项目编码 -->
proj_name as "projName",
<!-- 项目名称 -->
plan_code as "planCode",
<!-- 计划编码 -->
product_type as "productType",
<!-- 产品类型 -->
product_code as "productCode",
<!-- 产品编号 -->
product_name as "productName",
<!-- 产品名称 -->
finish_date as "finishDate",
<!-- 完工日期 -->
plan_start_date as "planStartDate",
<!-- 计划开始日期 -->
plan_end_date as "planEndDate",
<!-- 计划结束日期 -->
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"
<!-- 更新时间 -->
FROM ${hggpSchema}.HGSC005A WHERE 1=1
<include
refid=
"condition"
/>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
...
...
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
View file @
9daa8b3e
...
...
@@ -615,6 +615,11 @@ public class HGSCTools {
}
}
/**
*
* @author:songx
* @date:2024/9/4,22:02
*/
public
static
class
THGSC005A
{
public
static
HGSC005A
getById
(
Long
id
){
...
...
@@ -639,6 +644,22 @@ public class HGSCTools {
List
<
HGSC005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGSC005A
.
QUERY
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
/**
* 根据工序查询
*
* @param planCode
* @param processName
* @return
*/
public
static
List
<
HGSC005A
>
queryByPlanCode
(
String
planCode
,
String
processName
)
{
AssertUtils
.
isEmpty
(
planCode
,
"计划编码不能为空!"
);
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
HGSC005A
.
FIELD_plan_code
,
planCode
);
paramMap
.
put
(
HGSC005A
.
FIELD_process_name
,
processName
);
List
<
HGSC005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGSC005A
.
QUERY
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
public
static
List
<
HGSC005A
>
queryByMatId
(
Long
matId
){
AssertUtils
.
isTrue
(
Objects
.
isNull
(
matId
)||
matId
<=
0
,
"物料清单ID不能为空!"
);
...
...
@@ -1039,10 +1060,11 @@ public class HGSCTools {
* 排产
*
* @param planCode
* @param processName 工序
* @return
*/
public
static
int
schedule
(
String
planCode
)
{
List
<
HGSC005A
>
hgsc005AList
=
queryByPlanCode
(
planCode
);
public
static
int
schedule
(
String
planCode
,
String
processName
)
{
List
<
HGSC005A
>
hgsc005AList
=
queryByPlanCode
(
planCode
,
processName
);
// hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder()));
//通过工序编码查询工序设置
List
<
String
>
processCodes
=
hgsc005AList
.
stream
().
map
(
HGSC005A:
:
getProcessCode
)
...
...
@@ -1080,12 +1102,14 @@ public class HGSCTools {
}
}
for
(
HGSC005A
planInfo
:
partList
)
{
remainder
=
calculateWordHour
(
planInfo
,
hgsj001List
,
hgpz005List
,
hgpz005AList
,
minDate
,
remainder
);
minDate
=
DateUtil
.
toDate
(
planInfo
.
getPlanStartDate
(),
DateUtil
.
DATE10_PATTERN
).
compareTo
(
DateUtil
.
toDate
(
minDate
,
DateUtil
.
DATE10_PATTERN
))
<=
0
?
planInfo
.
getPlanStartDate
():
minDate
;
DaoUtils
.
update
(
HGSC005A
.
UPDATE
,
planInfo
);
}
return
hgsc005AList
.
size
();
}
remainder
=
calculateWordHour
(
planInfo
,
hgsj001List
,
hgpz005List
,
hgpz005AList
,
minDate
,
remainder
);
minDate
=
DateUtil
.
toDate
(
planInfo
.
getPlanStartDate
(),
DateUtil
.
DATE10_PATTERN
)
.
compareTo
(
DateUtil
.
toDate
(
minDate
,
DateUtil
.
DATE10_PATTERN
))
<=
0
?
planInfo
.
getPlanStartDate
()
:
minDate
;
DaoUtils
.
update
(
HGSC005A
.
UPDATE
,
planInfo
);
}
return
hgsc005AList
.
size
();
}
private
static
String
handleEndDate
(
String
endDate
,
HGSC005A
planInfo
){
if
(
StringUtils
.
isBlank
(
endDate
)&&
StringUtils
.
isNotBlank
(
planInfo
.
getFinishDate
())){
...
...
src/main/webapp/HG/SC/HGSC005A.js
View file @
9daa8b3e
...
...
@@ -17,11 +17,12 @@ $(function () {
//排产
$
(
"#BNT_SCHEDULE"
).
on
(
"click"
,
schedule
);
},
onSuccess
:
function
(
e
)
{
if
(
e
.
eiInfo
.
extAttr
.
methodName
==
'save'
||
e
.
eiInfo
.
extAttr
.
methodName
==
'delete'
){
query
();
}
}
onSuccess
:
function
(
e
)
{
if
(
e
.
eiInfo
.
extAttr
.
methodName
==
'save'
||
e
.
eiInfo
.
extAttr
.
methodName
==
'delete'
||
e
.
eiInfo
.
extAttr
.
methodName
==
'update'
)
{
query
();
}
}
}
});
...
...
@@ -41,28 +42,9 @@ $(window).load(function () {
* 排产
*/
function
schedule
()
{
var
planCode
=
$
(
"#inqu_status-0-planCode"
).
val
();
IPLAT
.
confirm
({
title
:
'提交'
,
message
:
'自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产?'
,
okFn
:
function
()
{
var
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"inqu_status-0-planCode"
,
planCode
);
EiCommunicator
.
send
(
"HGSC005A"
,
"schedule"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
if
(
ei
.
getStatus
()
>=
0
)
{
$
(
"#inqu_status-0-isSchedule"
).
val
(
'1'
);
NotificationUtil
(
ei
);
resultGrid
.
dataSource
.
query
();
}
else
{
NotificationUtil
(
ei
,
"error"
);
}
},
onFail
:
function
(
ei
)
{
// 发生异常
NotificationUtil
(
"操作失败,原因["
+
ei
+
"]"
,
"error"
);
}
});
JSUtils
.
confirm
(
"自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGSC005A"
,
"schedule"
,
true
);
}
});
}
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