Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-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
hp-smart
Commits
d0ddda17
Commit
d0ddda17
authored
Mar 08, 2024
by
yukang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加智能排产
parent
46955641
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
177 additions
and
112 deletions
+177
-112
ServiceHPFF001.java
.../java/com/baosight/hpjx/hp/ff/service/ServiceHPFF001.java
+10
-0
ServiceHPSC006.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC006.java
+31
-22
ServiceHPSC007.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC007.java
+2
-1
HPSC003.js
src/main/webapp/HP/SC/HPSC003.js
+82
-82
HPSC003A.js
src/main/webapp/HP/SC/HPSC003A.js
+10
-0
HPSC003B.js
src/main/webapp/HP/SC/HPSC003B.js
+38
-3
HPSC003B.jsp
src/main/webapp/HP/SC/HPSC003B.jsp
+3
-2
HPSC006.js
src/main/webapp/HP/SC/HPSC006.js
+1
-2
No files found.
src/main/java/com/baosight/hpjx/hp/ff/service/ServiceHPFF001.java
View file @
d0ddda17
package
com
.
baosight
.
hpjx
.
hp
.
ff
.
service
;
import
com.baosight.hpjx.common.HPConstants
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002
;
import
com.baosight.hpjx.hp.sc.domain.HPSC006
;
import
com.baosight.hpjx.hp.sc.tools.HPSCTools
;
import
com.baosight.hpjx.util.ExcelUtils
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
ServiceHPFF001
extends
ServiceEPBase
{
...
...
@@ -48,7 +51,14 @@ public class ServiceHPFF001 extends ServiceEPBase {
map1
.
put
(
"productionOrderNo"
,
productionOrderNo
);
map1
.
put
(
"inventType"
,
"7"
);
ExcelUtils
.
importFromExcel
(
inInfo
,
fileName
,
map1
,
new
HPSC006
());
inInfo
=
this
.
refreshHPSC006
(
inInfo
,
productionOrderNo
);
}
return
inInfo
;
}
private
EiInfo
refreshHPSC006
(
EiInfo
inInfo
,
String
productionOrderNo
)
{
List
<
HPSC006
>
HPSC006
=
HPSCTools
.
Hpsc006
.
get
(
productionOrderNo
);
inInfo
.
addBlock
(
CommonConstant
.
Field
.
DETAIL
).
addRows
(
HPSC006
);
return
inInfo
;
}
}
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC006.java
View file @
d0ddda17
...
...
@@ -111,6 +111,7 @@ public class ServiceHPSC006 extends ServiceBase {
@OperationLogAnnotation
(
operModul
=
"生产下料"
,
operType
=
"新增"
,
operDesc
=
"新增"
)
@Override
public
EiInfo
insert
(
EiInfo
inInfo
)
{
EiInfo
outInfo
=
new
EiInfo
();
try
{
HPSC006
HPSC006
=
new
HPSC006
();
String
productionOrderNo
=
inInfo
.
getString
(
"productionOrderNo"
);
...
...
@@ -143,19 +144,19 @@ public class ServiceHPSC006 extends ServiceBase {
DaoUtils
.
insert
(
"HPSC006.insert"
,
HPSC006
);
}
//刷新
inInfo
=
this
.
refreshHPSC006
(
in
Info
,
productionOrderNo
);
in
Info
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
in
Info
.
setMsg
(
"新增成功!"
);
outInfo
=
this
.
refreshHPSC006
(
out
Info
,
productionOrderNo
);
out
Info
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
out
Info
.
setMsg
(
"新增成功!"
);
}
catch
(
PlatException
e
)
{
e
.
printStackTrace
();
in
Info
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
in
Info
.
setMsg
(
"新增失败!原因参见详细错误描述!"
);
in
Info
.
setDetailMsg
(
e
.
getMessage
());
out
Info
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
out
Info
.
setMsg
(
"新增失败!原因参见详细错误描述!"
);
out
Info
.
setDetailMsg
(
e
.
getMessage
());
logError
(
"新增失败"
,
e
.
getMessage
());
return
in
Info
;
return
out
Info
;
}
return
in
Info
;
return
out
Info
;
}
private
EiInfo
refreshHPSC006
(
EiInfo
inInfo
,
String
productionOrderNo
)
{
List
<
HPSC006
>
HPSC006
=
HPSCTools
.
Hpsc006
.
get
(
productionOrderNo
);
...
...
@@ -167,6 +168,7 @@ public class ServiceHPSC006 extends ServiceBase {
*/
@OperationLogAnnotation
(
operModul
=
"生产下料"
,
operType
=
"修改"
,
operDesc
=
"修改"
)
public
EiInfo
update
(
EiInfo
inInfo
)
{
EiInfo
outInfo
=
new
EiInfo
();
try
{
HPSC006
HPSC006
=
new
HPSC006
();
String
productionOrderNo
=
inInfo
.
getString
(
"productionOrderNo"
);
...
...
@@ -192,16 +194,18 @@ public class ServiceHPSC006 extends ServiceBase {
HPSC006
.
setFactoryName
(
HPXSTools
.
XsOrg
.
get
(
HPSC006
.
getOrgNo
()).
getOrgCname
());
DaoUtils
.
update
(
"HPSC006.update"
,
HPSC006
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"修改成功!"
);
//刷新
outInfo
=
this
.
refreshHPSC006
(
outInfo
,
productionOrderNo
);
outInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
outInfo
.
setMsg
(
"新增成功!"
);
}
catch
(
PlatException
e
)
{
in
Info
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
in
Info
.
setMsg
(
"操作失败!原因参见详细错误描述!"
);
in
Info
.
setDetailMsg
(
e
.
getMessage
());
out
Info
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
out
Info
.
setMsg
(
"操作失败!原因参见详细错误描述!"
);
out
Info
.
setDetailMsg
(
e
.
getMessage
());
logError
(
"修改失败"
,
e
.
getMessage
());
return
in
Info
;
return
out
Info
;
}
return
query
(
inInfo
)
;
return
outInfo
;
}
/**
...
...
@@ -268,6 +272,7 @@ public class ServiceHPSC006 extends ServiceBase {
*/
@OperationLogAnnotation
(
operModul
=
"生产下料"
,
operType
=
"新增"
,
operDesc
=
"分派"
)
public
EiInfo
assign
(
EiInfo
eiInfo
)
{
EiInfo
outInfo
=
new
EiInfo
();
try
{
String
ids
=
eiInfo
.
get
(
"ids"
).
toString
();
String
factoryCode
=
eiInfo
.
get
(
"factoryCode"
).
toString
();
...
...
@@ -276,6 +281,8 @@ public class ServiceHPSC006 extends ServiceBase {
String
groupName
=
eiInfo
.
get
(
"groupName"
).
toString
();
String
[]
id
=
ids
.
split
(
","
);
HPSC006
hpsc006
=
HPSCTools
.
Hpsc006
.
getById
(
NumberUtils
.
toLong
(
id
[
0
]));
String
productionOrderNo
=
hpsc006
.
getProductionOrderNo
();
for
(
int
i
=
0
;
i
<
id
.
length
;
i
++)
{
// 更新HPSC005的数据
HPSC006
HPSC006
=
new
HPSC006
();
...
...
@@ -288,16 +295,18 @@ public class ServiceHPSC006 extends ServiceBase {
DaoUtils
.
update
(
"HPSC006.updateAssign"
,
HPSC006
.
toMap
());
}
eiInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
eiInfo
.
setMsg
(
"分派成功!"
);
//刷新
outInfo
=
this
.
refreshHPSC006
(
outInfo
,
productionOrderNo
);
outInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
outInfo
.
setMsg
(
"新增成功!"
);
}
catch
(
PlatException
e
)
{
ei
Info
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
ei
Info
.
setMsg
(
"分派失败!原因参见详细错误描述!"
);
ei
Info
.
setDetailMsg
(
e
.
getMessage
());
out
Info
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
out
Info
.
setMsg
(
"分派失败!原因参见详细错误描述!"
);
out
Info
.
setDetailMsg
(
e
.
getMessage
());
logError
(
"分派失败"
,
e
.
getMessage
());
return
ei
Info
;
return
out
Info
;
}
return
query
(
eiInfo
)
;
return
outInfo
;
}
}
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC007.java
View file @
d0ddda17
...
...
@@ -117,7 +117,7 @@ public class ServiceHPSC007 extends ServiceBase {
DaoUtils
.
insert
(
"HPSC007.insert"
,
HPSC007
);
}
// 修改下料表中的字段
AssertUtils
.
isGt
(
totalNum
,
HPSC006
.
getNum
(),
"登记数量不能大于计划数量!"
);
HPSC006
.
setActualCompletionNum
(
HPSC006
.
getActualCompletionNum
().
add
(
totalNum
));
HPSC006
.
setActualCompletionTotalWt
(
HPSC006
.
getActualCompletionTotalWt
().
add
(
actualCompletionTotalWt
));
if
(
HPSC006
.
getActualCompletionNum
().
compareTo
(
HPSC006
.
getNum
())
>=
0
)
{
...
...
@@ -181,6 +181,7 @@ public class ServiceHPSC007 extends ServiceBase {
DaoUtils
.
insert
(
"HPSC007.update"
,
HPSC007
);
}
// 修改下料表中的字段
AssertUtils
.
isGt
(
HPSC006
.
getActualCompletionNum
().
add
(
totalNum
),
HPSC006
.
getNum
(),
"登记数量不能大于计划数量!"
);
HPSC006
.
setActualCompletionNum
(
HPSC006
.
getActualCompletionNum
().
add
(
totalNum
));
HPSC006
.
setActualCompletionTotalWt
(
HPSC006
.
getActualCompletionTotalWt
().
add
(
actualCompletionTotalWt
));
if
(
HPSC006
.
getActualCompletionNum
().
compareTo
(
HPSC006
.
getNum
())
>=
0
)
{
...
...
src/main/webapp/HP/SC/HPSC003.js
View file @
d0ddda17
...
...
@@ -135,87 +135,87 @@ function showUploadFile(id) {
});
}
function
check
(
id
,
auditStatus
,
planInfoNo
)
{
//
const inEiInfo = new EiInfo();
//
inEiInfo.set("id", id);
//
inEiInfo.set("planInfoNo",planInfoNo);
//
//
先判断本身是否填写
//
EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, {
//
onSuccess(ei) {
//
var model=ei.get("model");
//
if(!(model.planCompletionDate).trim()) {
//
NotificationUtil("提交失败!原因:基本信息中计划完成日期未填写", "error");
//
return;
//
} else {
//
//提交
//
//提交前先判断明细信息中的计划开始和计划结束时间是否都已经填写,只有填写了之后才能进行提交
//
if (auditStatus == 1) {
//
EiCommunicator.send('HPSC004', 'inspectDetail', inEiInfo, {
//
onSuccess(ei) {
//
var list=ei.get("list");
//
if(list) {
//
var count = list[0];
//
if (count > 0) {
//
NotificationUtil("提交失败!原因:明细信息中有未填写的计划开始时间或计划结束时间", "error");
//
} else {
//
EiCommunicator.send('HPSC004','queryDetail',inEiInfo,{
//
onSuccess(ei){
//
var rows = ei.blocks.detail.rows;
//
var res = check_time(model,rows);
//
if (!res){
//
NotificationUtil("计划结束时间应该大于计划开始时间!", "error");
//
}
//
else {
//
// 提交通过,生成
//
EiCommunicator.send('HPSC003', 'submitPlan', inEiInfo, {
//
onSuccess(response) {
//
NotificationUtil(response.msg);
//
console.log(response)
//
autoProductionschedul(response.get('planInfoNo'));
//
resultGrid.dataSource.page(1);
//
},
//
onFail(errorMessage, status, e) {
//
NotificationUtil("执行失败!", "error");
//
}
//
},
//
{
//
async: false
//
}
//
);
//
}
//
//
//
}
//
})
//
//
}
//
} else {
//
NotificationUtil("提交失败!未找到明细信息", "error");
//
}
//
},
//
onFail(errorMessage, status, e) {
//
NotificationUtil("执行失败!", "error");
//
}
//
},
//
{
//
async: false
//
}
//
);
//
} else {
//
// 撤回
//
//
}
//
}
//
},
//
onFail(errorMessage, status, e) {
//
NotificationUtil("执行失败!", "error");
//
}
//
},
//
{
//
async: false
//
}
//
);
const
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"id"
,
id
);
inEiInfo
.
set
(
"planInfoNo"
,
planInfoNo
);
//先判断本身是否填写
EiCommunicator
.
send
(
'HPSC003'
,
'getInfo'
,
inEiInfo
,
{
onSuccess
(
ei
)
{
var
model
=
ei
.
get
(
"model"
);
if
(
!
(
model
.
planCompletionDate
).
trim
())
{
NotificationUtil
(
"提交失败!原因:基本信息中计划完成日期未填写"
,
"error"
);
return
;
}
else
{
//提交
//提交前先判断明细信息中的计划开始和计划结束时间是否都已经填写,只有填写了之后才能进行提交
if
(
auditStatus
==
1
)
{
EiCommunicator
.
send
(
'HPSC004'
,
'inspectDetail'
,
inEiInfo
,
{
onSuccess
(
ei
)
{
var
list
=
ei
.
get
(
"list"
);
if
(
list
)
{
var
count
=
list
[
0
];
if
(
count
>
0
)
{
NotificationUtil
(
"提交失败!原因:明细信息中有未填写的计划开始时间或计划结束时间"
,
"error"
);
}
else
{
EiCommunicator
.
send
(
'HPSC004'
,
'queryDetail'
,
inEiInfo
,{
onSuccess
(
ei
){
var
rows
=
ei
.
blocks
.
detail
.
rows
;
var
res
=
check_time
(
model
,
rows
);
if
(
!
res
){
NotificationUtil
(
"计划结束时间应该大于计划开始时间!"
,
"error"
);
}
else
{
// 提交通过,生成
EiCommunicator
.
send
(
'HPSC003'
,
'submitPlan'
,
inEiInfo
,
{
onSuccess
(
response
)
{
NotificationUtil
(
response
.
msg
);
console
.
log
(
response
)
autoProductionschedul
(
response
.
get
(
'planInfoNo'
));
resultGrid
.
dataSource
.
page
(
1
);
},
onFail
(
errorMessage
,
status
,
e
)
{
NotificationUtil
(
"执行失败!"
,
"error"
);
}
},
{
async
:
false
}
);
}
}
})
}
}
else
{
NotificationUtil
(
"提交失败!未找到明细信息"
,
"error"
);
}
},
onFail
(
errorMessage
,
status
,
e
)
{
NotificationUtil
(
"执行失败!"
,
"error"
);
}
},
{
async
:
false
}
);
}
else
{
// 撤回
}
}
},
onFail
(
errorMessage
,
status
,
e
)
{
NotificationUtil
(
"执行失败!"
,
"error"
);
}
},
{
async
:
false
}
);
autoProductionschedul
(
'SCJH24030700006'
);
//
autoProductionschedul('SCJH24030700006');
}
/**
...
...
@@ -242,8 +242,8 @@ function autoProductionschedulCallback (factoryCode,planInfoNo) {
href
:
"HPSC003B?methodName=initLoad&inqu_status-0-planInfoNo="
+
planInfoNo
+
'&inqu_status-0-factoryCode='
+
factoryCode
,
title
:
"<div style='text-align: center;'>自动排产</div>"
,
width
:
"80%"
,
height
:
"80%"
,
//
width: "80%",
//
height: "80%",
callbackName
:
autoProductionschedulCallback1
});
}
else
{
...
...
src/main/webapp/HP/SC/HPSC003A.js
View file @
d0ddda17
...
...
@@ -14,6 +14,16 @@ $(function () {
$
(
'#confirm'
).
on
(
'click'
,
function
()
{
var
factoryCode
=
$
(
'#inqu_status-0-factoryCode'
).
val
();
var
planInfoNo
=
$
(
'#inqu_status-0-planInfoNo'
).
val
();
if
(
factoryCode
)
{
if
(
planInfoNo
)
{
parent
.
JSColorbox
.
setValueCallback
(
factoryCode
,
planInfoNo
);
}
else
{
message
(
"生产计划单号不能为空!"
);
return
;
}
}
else
{
message
(
"请选择工厂生成生产任务!"
);
return
;
}
})
});
src/main/webapp/HP/SC/HPSC003B.js
View file @
d0ddda17
...
...
@@ -5,10 +5,16 @@ $(function () {
toolbarConfig
:
{
hidden
:
true
,
// true时,不显示功能按钮,但保留setting导出按钮
},
pageable
:
{
pageSize
:
15
,
pageSizes
:
[
15
,
50
,
70
,
100
],
columns
:
[{
field
:
"operator"
,
title
:
"操作"
,
template
:
function
(
item
)
{
let
template
=
''
;
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="deleteRow('
+
item
.
rowNo
+
')" >删除</a>'
;
return
template
}
}]
}
}
...
...
@@ -22,3 +28,32 @@ function query() {
resultGrid
.
dataSource
.
page
(
1
);
}
function
deleteRow
(
rowNo
)
{
resultGrid
.
removeRows
([
rowNo
]);
// 刷新行号
refreshRowNo
();
}
let
refreshRowNo
=
function
()
{
let
allRows
=
resultGrid
.
getDataItems
();
for
(
let
i
=
0
;
i
<
allRows
.
length
;
i
++
)
{
resultGrid
.
setCellValue
(
i
,
"rowNo"
,
i
);
resultGrid
.
refresh
();
}
}
$
(
window
).
load
(
function
()
{
refreshRowNo
();
});
/**
* 取消
*/
$
(
'#cancel'
).
on
(
'click'
,
function
()
{
// 关闭弹窗
parent
.
JSColorbox
.
close
();
})
/**
* 确认
*/
$
(
'#confirm'
).
on
(
'click'
,
function
()
{
})
src/main/webapp/HP/SC/HPSC003B.jsp
View file @
d0ddda17
...
...
@@ -9,7 +9,9 @@
<EF:EFRegion
id=
"result"
title=
"记录集"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
locked=
"true"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"id"
cname=
"主键"
hidden=
"true"
/>
<EF:EFColumn
ename=
"rowNo"
cname=
"行号"
hidden=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"prdtName"
cname=
"部件名称"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"partName"
cname=
"零件名称"
enable=
"false"
width=
"100"
align=
"center"
/>
...
...
@@ -22,10 +24,9 @@
<EF:EFColumn
ename=
"factoryCode"
cname=
"厂区"
enable=
"false"
width=
"140"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"orgName"
cname=
"生产组"
enable=
"false"
width=
"140"
align=
"center"
hidden=
"true"
/>
<EF:EFComboColumn
ename=
"orgNo"
cname=
"生产组"
width=
"110"
align=
"center"
defaultValue=
""
filter=
"contains"
readonly=
"true"
>
filter=
"contains"
>
<EF:EFOptions
blockId=
"group_record_block_id"
valueField=
"valueField"
textField=
"textField"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
locked=
"true"
enable=
"false"
width=
"80"
align=
"center"
/>
</EF:EFGrid>
</EF:EFRegion>
<span
style=
'color: red;font-size: 13px;'
>
注:只会对未分派的订单进行自动排产!
</span>
...
...
src/main/webapp/HP/SC/HPSC006.js
View file @
d0ddda17
...
...
@@ -397,7 +397,7 @@ assignCallback = function (row) {
msg
:
'修改成功'
});
// 刷新列表
resultGrid
.
dataSource
.
page
(
1
);
detailGrid
.
setEiInfo
(
ei
);
// 关闭弹窗
JSColorbox
.
close
();
}
...
...
@@ -458,7 +458,6 @@ function saveFunc() {
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"detail"
,
"HPSC006"
,
"insert"
,
true
,
function
(
e
)
{
query
();
detailGrid
.
setEiInfo
(
e
);
});
}
...
...
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