Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
Project
Project
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
鲁鑫
topsun-bpm
Commits
7ffd0f2e
Commit
7ffd0f2e
authored
Dec 01, 2023
by
鲁鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工序物料
parent
34eac83e
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
541 additions
and
139 deletions
+541
-139
processDetail.js
...xt/src/main/webapp/biz/topsun/technology/processDetail.js
+140
-0
technologyDetail.js
...src/main/webapp/biz/topsun/technology/technologyDetail.js
+130
-20
technologyDetail.jsp
...rc/main/webapp/biz/topsun/technology/technologyDetail.jsp
+25
-13
technologyList.js
...t/src/main/webapp/biz/topsun/technology/technologyList.js
+117
-98
ResourceSearchController.java
...opsun/easySearch/controller/ResourceSearchController.java
+32
-0
ProcessMaterialItemApplication.java
...echnology/application/ProcessMaterialItemApplication.java
+6
-0
ProcessMaterialItemApplicationImpl.java
.../application/impl/ProcessMaterialItemApplicationImpl.java
+17
-0
TechnologyProcessApplicationImpl.java
...gy/application/impl/TechnologyProcessApplicationImpl.java
+17
-5
TechnologyController.java
...ou/topsun/technology/controller/TechnologyController.java
+7
-2
ProcessMaterialItem.java
...u/topsun/technology/domain/model/ProcessMaterialItem.java
+9
-0
ProcessMaterialItemRepository.java
.../technology/repository/ProcessMaterialItemRepository.java
+3
-0
TechnologyProcessVo.java
.../com/huigou/topsun/technology/vo/TechnologyProcessVo.java
+30
-0
technologyProcess.xml
.../resources/config/topsun/technology/technologyProcess.xml
+8
-1
No files found.
topsun-xt/src/main/webapp/biz/topsun/technology/processDetail.js
0 → 100644
View file @
7ffd0f2e
var
resourceGridManager
=
null
,
processMaterialGridManager
=
null
;
$
(
document
).
ready
(
function
()
{
initializateUI
();
loadResourceGrid
();
loadProcessMaterialGrid
();
});
function
initializateUI
()
{
UICtrl
.
layout
(
"#layout"
,
{
leftWidth
:
3
});
}
function
loadResourceGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
(){
UICtrl
.
addGridRow
(
resourceGridManager
);
},
deleteHandler
:
function
(){
var
_grid
=
UICtrl
.
getGridManager
(
'#rsourceGrid'
);
DataUtil
.
delSelectedRows
({
action
:
'processResource/deleteProcessResource.ajax'
,
param
:
{},
gridManager
:
_grid
,
idFieldName
:
'processResourceId'
,
onSuccess
:
function
()
{
reloadResourceGrid
();
}
});
},
});
resourceGridManager
=
UICtrl
.
grid
(
"#rsourceGrid"
,
{
columns
:
[
{
display
:
"资源名称"
,
name
:
"resourceName"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
type
:
'system'
,
name
:
"resourceSelect"
,
back
:
{
resourceId
:
"resourceId"
,
resourceName
:
"resourceName"
,
version
:
"version"
,
}
},
}
},
{
display
:
"版本"
,
name
:
"version"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/processResource/slicedProcessResourceList.ajax'
,
pageSize
:
20
,
usePager
:
true
,
toolbar
:
toolbarOptions
,
enabledEdit
:
true
,
width
:
"100%"
,
height
:
"100%"
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
//updateHandler(data);
}
});
UICtrl
.
setSearchAreaToggle
(
resourceGridManager
);
}
function
reloadResourceGrid
()
{
resourceGridManager
.
loadData
();
}
function
loadProcessMaterialGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
(){
UICtrl
.
addGridRow
(
processMaterialGridManager
);
},
deleteHandler
:
function
(){
var
_grid
=
UICtrl
.
getGridManager
(
'#processMaterialGrid'
);
DataUtil
.
delSelectedRows
({
action
:
'processMaterialItem/deleteProcessMaterialItem.ajax'
,
param
:
{},
gridManager
:
_grid
,
idFieldName
:
'processMaterialItemId'
,
onSuccess
:
function
()
{
reloadProcessMaterialGrid
();
}
});
},
});
processMaterialGridManager
=
UICtrl
.
grid
(
"#processMaterialGrid"
,
{
columns
:
[
{
display
:
"物料名称"
,
name
:
"materialName"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
type
:
'system'
,
name
:
"sapMaterialSelect"
,
back
:
{
materialId
:
"materialId"
,
materialName
:
"materialName"
,
materialUnit
:
"materialUnit"
,
materialJson
:
"materialJson"
,
}
},
}
},
{
display
:
"物料计量单位"
,
name
:
"materialUnit"
,
width
:
100
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"使用物料数量"
,
name
:
"materialNumber"
,
width
:
100
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'text'
,
mask
:
'positiveMoney'
,
required
:
true
}
},
{
display
:
"物料相关内容"
,
name
:
"materialJson"
,
width
:
400
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/processMaterialItem/slicedProcessMaterialItems.ajax'
,
pageSize
:
20
,
usePager
:
true
,
toolbar
:
toolbarOptions
,
enabledEdit
:
true
,
width
:
"100%"
,
height
:
"100%"
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
//updateHandler(data);
}
});
UICtrl
.
setSearchAreaToggle
(
processMaterialGridManager
);
}
function
reloadProcessMaterialGrid
()
{
processMaterialGridManager
.
loadData
();
}
topsun-xt/src/main/webapp/biz/topsun/technology/technologyDetail.js
View file @
7ffd0f2e
...
...
@@ -2,10 +2,12 @@ var processGridManager = null;
$
(
document
).
ready
(
function
()
{
loadProcessListGrid
();
bindQueryEvent
();
bindEvent
();
});
function
loadProcessListGrid
(){
function
loadProcessListGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
()
{
addHandler
:
function
()
{
UICtrl
.
addGridRow
(
processGridManager
);
},
deleteHandler
:
function
()
{
...
...
@@ -21,9 +23,10 @@ function loadProcessListGrid(){
});
}
});
processGridManager
=
UICtrl
.
grid
(
"#processListGrid"
,
{
processGridManager
=
UICtrl
.
grid
(
"#processListGrid"
,
{
columns
:
[
{
display
:
"工序名称"
,
name
:
"processName"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
{
display
:
"工序名称"
,
name
:
"processName"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
...
...
@@ -31,17 +34,23 @@ function loadProcessListGrid(){
name
:
"processNameGroup"
,
back
:
{
processId
:
"processId"
,
processName
:
"processName"
,
processType
:
"processType"
,
processTypeTextView
:
"processTypeTextView"
,
workHours
:
"workHours"
,
processContent
:
"processContent"
,
processRemark
:
"processRemark"
,
processName
:
"processName"
,
processType
:
"processType"
,
processTypeTextView
:
"processTypeTextView"
,
workHours
:
"workHours"
,
processContent
:
"processContent"
,
processRemark
:
"processRemark"
,
}
},
}
},
{
display
:
"工序类别"
,
name
:
"processTypeTextView"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
{
display
:
"工序类别"
,
name
:
"processTypeTextView"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
/*editor : {
type : 'combobox',
data : $("#processType").combox('getJSONData'),
...
...
@@ -49,26 +58,30 @@ function loadProcessListGrid(){
valueField : 'processType'
}*/
},
{
display
:
"工时"
,
name
:
"workHours"
,
width
:
120
,
minWidth
:
60
,
type
:
"number"
,
align
:
"left"
,
{
display
:
"工时"
,
name
:
"workHours"
,
width
:
120
,
minWidth
:
60
,
type
:
"number"
,
align
:
"left"
,
/*editor: {
required: true,
type: 'text',
mask: 'positiveMoney'
}*/
},
{
display
:
"工序内容"
,
name
:
"processContent"
,
width
:
180
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
{
display
:
"工序内容"
,
name
:
"processContent"
,
width
:
180
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
/*editor: {
required: true,
type: 'text'
}*/
},
{
display
:
"工序说明"
,
name
:
"processRemark"
,
width
:
180
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
{
display
:
"工序说明"
,
name
:
"processRemark"
,
width
:
180
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
/*editor: {
required: true,
type: 'text'
}*/
},
{
display
:
'资源'
,
name
:
"resourceName"
,
width
:
180
,
align
:
"left"
,
type
:
"string"
,
{
display
:
'资源'
,
name
:
"resourceName"
,
width
:
180
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
...
...
@@ -84,22 +97,49 @@ function loadProcessListGrid(){
},
}
},
{
display
:
"工序物料"
,
name
:
"materialName"
,
width
:
180
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
{
display
:
"版本"
,
name
:
"version"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"工序物料"
,
name
:
"materialName"
,
width
:
180
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
false
,
type
:
'text'
required
:
true
,
type
:
"select"
,
data
:
{
type
:
'system'
,
name
:
"sapMaterialSelect"
,
back
:
{
materialId
:
"materialId"
,
materialName
:
"materialName"
,
materialUnit
:
"materialUnit"
,
materialJson
:
"materialJson"
,
}
},
}
},
{
display
:
"物料计量单位"
,
name
:
"materialUnit"
,
width
:
100
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"使用物料数量"
,
name
:
"materialNumber"
,
width
:
100
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'text'
,
mask
:
'positiveMoney'
,
required
:
true
}
},
{
display
:
"物料相关内容"
,
name
:
"materialJson"
,
width
:
400
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/technologyProcess/slicedTechnologyProcessList.ajax'
,
parms
:
{
technologyId
:
$
(
"#technologyId"
).
val
()
},
parms
:
{
technologyId
:
getId
},
pageSize
:
20
,
usePager
:
true
,
toolbar
:
toolbarOptions
,
enabledEdit
:
true
,
width
:
"98%"
,
height
:
500
,
height
:
"100%"
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
...
...
@@ -118,3 +158,73 @@ function bindQueryEvent() {
});
}
function
bindEvent
()
{
$
(
"#save"
).
click
(
function
()
{
saveData
(
"save"
);
})
$
(
"#submit"
).
click
(
function
()
{
saveData
(
"submit"
);
})
$
(
"#close"
).
click
(
function
()
{
//关闭
closeDispatchTabItem
();
})
}
function
getTechnologyDetail
(
processAction
)
{
//采购订单保存时数据不进行必填验证,提交时数据才进行必填验证
var
op
=
{};
if
(
processAction
==
"save"
)
{
op
=
{
check
:
false
};
}
else
if
(
processAction
==
"submit"
)
{
op
=
{
check
:
true
};
}
else
{
op
=
{
check
:
true
};
}
var
technology
=
$
(
'#submitForm'
).
formToJSON
(
op
);
if
(
!
technology
)
{
return
false
;
}
var
processList
=
[];
if
(
processAction
==
"save"
)
{
processList
=
DataUtil
.
getGridData
({
gridManager
:
processGridManager
,
isAllData
:
true
,
onCheck
:
false
})
}
else
if
(
processAction
==
"submit"
)
{
processList
=
DataUtil
.
getGridData
({
gridManager
:
processGridManager
,
isAllData
:
true
,
onCheck
:
true
})
}
else
{
processList
=
DataUtil
.
getGridData
({
gridManager
:
processGridManager
,
isAllData
:
true
,
onCheck
:
true
})
}
if
(
!
processList
)
{
return
false
;
}
technology
.
processList
=
$
.
toJSON
(
processList
);
return
technology
;
}
function
saveData
(
action
)
{
var
technologyDetail
=
getTechnologyDetail
(
"submit"
);
if
(
!
technologyDetail
)
{
return
;
}
Public
.
ajax
(
web_app
.
name
+
'/technology/saveTechnology.ajax?code='
+
action
,
technologyDetail
,
function
(
data
)
{
setId
(
data
.
technologyId
);
Public
.
successTip
(
"数据保存成功"
);
processGridManager
.
setParm
(
'technologyId'
,
data
.
technologyId
);
processGridManager
.
loadData
();
}
);
}
function
closeDispatchTabItem
()
{
UICtrl
.
closeCurrentTab
();
}
function
setId
(
value
)
{
$
(
'#technologyId'
).
val
(
value
);
}
function
getId
()
{
return
$
(
"#technologyId"
).
val
();
}
topsun-xt/src/main/webapp/biz/topsun/technology/technologyDetail.jsp
View file @
7ffd0f2e
<%@ page
language=
"java"
contentType=
"text/html; charset=utf-8"
%>
<%@taglib
uri=
"/WEB-INF/taglib.tld"
prefix=
"x"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<html>
<head>
<x:base
include=
"layout,dialog,grid,tree,combox,commonTree"
/>
<x:script
src=
'/biz/topsun/technology/technologyDetail.js'
/>
</head>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"submitForm"
>
<x:hidden
name=
"technologyId"
/>
<x:hidden
name=
"productId"
/>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"technologyName"
required=
"true"
label=
"工艺路线名称"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:selectC
name=
"technologyType"
required=
"true"
label=
"工艺类型"
labelCol=
"2"
dictionary=
"technologyType"
fieldCol=
"4"
/>
<x:inputC
name=
"productName"
required=
"true"
label=
"产品"
wrapper=
"select"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"technologyVersion"
required=
"false"
label=
"工艺版本"
labelCol=
"2"
maxLength=
"32"
fieldCol=
"4"
/>
</div>
<div
class=
"blank_div clearfix"
></div>
<x:title
title=
"工序设置"
name=
"group"
hideTable=
"#info"
/>
<div
id=
"processListGrid"
style=
"margin: 2px;"
></div>
</form>
\ No newline at end of file
<body>
<%--<div class="container-fluid">--%>
<x:billTitle
title=
"工艺详情"
needStatus=
"false"
needPerson=
"true"
/>
<div
class=
"blank_div clearfix"
></div>
<button
class=
"btn btn-default"
type=
"button"
id=
"close"
style=
"left: 200px;float:right;bottom: 10px;"
>
关闭
</button>
<button
class=
"btn btn-warning"
type=
"button"
id=
"submit"
style=
"left: 200px;float:right;bottom: 10px;"
>
提交
</button>
<button
class=
"btn btn-success"
type=
"button"
id=
"save"
style=
"left: 200px;float:right;bottom: 10px;"
>
保存
</button>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"submitForm"
>
<x:hidden
name=
"technologyId"
/>
<x:hidden
name=
"productId"
/>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"technologyName"
required=
"true"
label=
"工艺路线名称"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:selectC
name=
"technologyType"
required=
"true"
label=
"工艺类型"
labelCol=
"2"
dictionary=
"technologyType"
fieldCol=
"4"
/>
<x:inputC
name=
"productName"
required=
"true"
label=
"产品"
wrapper=
"select"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"technologyVersion"
required=
"false"
label=
"工艺版本"
labelCol=
"2"
maxLength=
"32"
fieldCol=
"4"
/>
</div>
<div
class=
"blank_div clearfix"
></div>
<x:title
title=
"工序设置"
name=
"group"
hideTable=
"#info"
/>
<div
id=
"processListGrid"
style=
"margin: 2px;"
></div>
</form>
<%--</div>--%>
</body>
</html>
\ No newline at end of file
topsun-xt/src/main/webapp/biz/topsun/technology/technologyList.js
View file @
7ffd0f2e
var
gridManager
=
null
;
$
(
document
).
ready
(
function
()
{
initializateUI
();
loadTechnologyListGrid
();
$
(
document
).
ready
(
function
()
{
initializateUI
();
loadTechnologyListGrid
();
});
function
initializateUI
()
{
UICtrl
.
layout
(
"#layout"
,
{
leftWidth
:
3
});
UICtrl
.
layout
(
"#layout"
,
{
leftWidth
:
3
});
}
function
loadTechnologyListGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
()
{
addHandler
();
},
updateHandler
:
function
()
{
updateHandler
();
},
deleteHandler
:
deleteHandler
,
});
gridManager
=
UICtrl
.
grid
(
"#technologyListGrid"
,
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
()
{
addHandler
();
},
updateHandler
:
function
()
{
updateHandler
();
},
deleteHandler
:
deleteHandler
,
});
gridManager
=
UICtrl
.
grid
(
"#technologyListGrid"
,
{
columns
:
[
{
display
:
"工艺路线名称"
,
name
:
"technologyName"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"产品ID"
,
name
:
"productId"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"工艺版本"
,
name
:
"technologyVersion"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"工艺类型"
,
name
:
"technologyTypeTextView"
,
width
:
100
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
],
{
display
:
"工艺路线名称"
,
name
:
"technologyName"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"产品ID"
,
name
:
"productId"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"工艺版本"
,
name
:
"technologyVersion"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"工艺类型"
,
name
:
"technologyTypeTextView"
,
width
:
100
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/technology/slicedTechnologyList.ajax'
,
pageSize
:
20
,
usePager
:
true
,
toolbar
:
toolbarOptions
,
width
:
"100%"
,
height
:
"100%"
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
updateHandler
(
data
);
}
url
:
web_app
.
name
+
'/technology/slicedTechnologyList.ajax'
,
pageSize
:
20
,
usePager
:
true
,
toolbar
:
toolbarOptions
,
width
:
"100%"
,
height
:
"100%"
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
updateHandler
(
data
);
}
});
UICtrl
.
setSearchAreaToggle
(
gridManager
);
}
function
query
(
obj
)
{
var
param
=
$
(
obj
).
formToJSON
();
UICtrl
.
gridSearch
(
gridManager
,
param
);
var
param
=
$
(
obj
).
formToJSON
();
UICtrl
.
gridSearch
(
gridManager
,
param
);
}
function
reloadGrid
()
{
gridManager
.
loadData
();
}
gridManager
.
loadData
();
}
function
resetForm
(
obj
)
{
$
(
obj
).
formClean
();
$
(
obj
).
formClean
();
}
function
addHandler
(){
UICtrl
.
showAjaxDialog
({
url
:
web_app
.
name
+
'/technology/addTechnologyDetail.load'
,
title
:
"新增工艺设置"
,
width
:
1000
,
ok
:
function
(
div
){
var
_self
=
this
;
$
(
'#submitForm'
,
div
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/technology/saveTechnology.ajax'
,
param
:
{
processList
:
getProcessList
(),
},
success
:
function
()
{
_self
.
close
();
reloadGrid
();
}
});
}
});
function
addHandler
()
{
/*UICtrl.showAjaxDialog({
url: web_app.name + '/technology/addTechnologyDetail.load',
title: "新增工艺设置",
width: 1000,
ok: function (div) {
var _self = this;
$('#submitForm', div).ajaxSubmit({
url: web_app.name + '/technology/saveTechnology.ajax',
param: {
processList: getProcessList(),
},
success: function () {
_self.close();
reloadGrid();
}
});
}
});*/
UICtrl
.
addTabItem
({
tabid
:
'technologyDetail'
,
text
:
"新增工艺"
,
url
:
web_app
.
name
+
'/technology/addTechnologyDetail.do'
})
}
function
updateHandler
(
row
){
if
(
!
row
)
{
row
=
DataUtil
.
getUpdateRow
(
gridManager
);
if
(
!
row
)
{
return
;
}
}
UICtrl
.
showAjaxDialog
({
url
:
web_app
.
name
+
'/technology/showTechnologyDetail.load'
,
title
:
"修改工艺设置"
,
width
:
1000
,
param
:{
technologyId
:
row
.
technologyId
},
ok
:
function
(
div
){
var
_self
=
this
;
$
(
'#submitForm'
,
div
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/technology/updateTechnology.ajax'
,
param
:
{
processList
:
getProcessList
(),
},
success
:
function
()
{
_self
.
close
();
reloadGrid
();
}
});
}
});
function
updateHandler
(
row
)
{
if
(
!
row
)
{
row
=
DataUtil
.
getUpdateRow
(
gridManager
);
if
(
!
row
)
{
return
;
}
}
/*UICtrl.showAjaxDialog({
url: web_app.name + '/technology/showTechnologyDetail.load',
title: "修改工艺设置",
width: 1000,
param: {technologyId: row.technologyId},
ok: function (div) {
var _self = this;
$('#submitForm', div).ajaxSubmit({
url: web_app.name + '/technology/updateTechnology.ajax',
param: {
processList: getProcessList(),
},
success: function () {
_self.close();
reloadGrid();
}
});
}
});*/
UICtrl
.
addTabItem
({
tabid
:
'technologyDetail'
,
text
:
"新增工艺"
,
url
:
web_app
.
name
+
'/technology/showTechnologyDetail.do?technologyId='
+
row
.
technologyId
})
}
//删除按钮
function
deleteHandler
()
{
DataUtil
.
del
({
action
:
'technology/deleteTechnologyByTechnologyId.ajax'
,
gridManager
:
gridManager
,
idFieldName
:
'technologyId'
,
onSuccess
:
function
()
{
reloadGrid
();
}
});
DataUtil
.
del
({
action
:
'technology/deleteTechnologyByTechnologyId.ajax'
,
gridManager
:
gridManager
,
idFieldName
:
'technologyId'
,
onSuccess
:
function
()
{
reloadGrid
();
}
});
}
function
getProcessList
(){
var
processList
=
null
;
var
processManager
=
UICtrl
.
getGridManager
(
'#processListGrid'
);
if
(
processManager
)
{
processList
=
DataUtil
.
getGridData
({
gridManager
:
processManager
,
isAllData
:
true
});
processList
=
Public
.
encodeJSONURI
(
processList
);
}
return
processList
;
function
getProcessList
()
{
var
processList
=
null
;
var
processManager
=
UICtrl
.
getGridManager
(
'#processListGrid'
);
if
(
processManager
)
{
processList
=
DataUtil
.
getGridData
({
gridManager
:
processManager
,
isAllData
:
true
});
processList
=
Public
.
encodeJSONURI
(
processList
);
}
return
processList
;
}
topsun/src/main/java/com/huigou/topsun/easySearch/controller/ResourceSearchController.java
View file @
7ffd0f2e
...
...
@@ -109,4 +109,36 @@ public class ResourceSearchController {
Map
<
String
,
Object
>
model
=
memEasySearcher
.
search
(
mapList
,
easySearchParse
,
pageRequest
,
null
);
return
model
;
}
@EasySearch
(
queryName
=
"sapMaterialSelect"
)
public
Map
<
String
,
Object
>
sapMaterialSelect
(
SDO
sdo
){
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
,
10
);
PageRequest
pageRequest
=
new
PageRequest
(
intPage
-
1
,
pageSize
);
List
<
QuerySchemeField
>
fields
=
Arrays
.
asList
(
new
QuerySchemeField
(
"materialId"
,
"materialId"
,
"hidden"
),
new
QuerySchemeField
(
"物料名称"
,
"materialName"
,
"string"
,
200L
),
new
QuerySchemeField
(
"SAP物料相关内容"
,
"materialJson"
,
"hidden"
,
200L
),
new
QuerySchemeField
(
"物料计量单位"
,
"materialUnit"
,
"string"
,
100L
)
);
EasySearchParse
easySearchParse
=
new
EasySearchParse
();
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setWidth
(
450L
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"materialId"
,
"1"
);
map
.
put
(
"materialName"
,
"测试物料1"
);
map
.
put
(
"materialJson"
,
"相关内容11"
);
map
.
put
(
"materialUnit"
,
"张"
);
Map
<
String
,
Object
>
map2
=
new
HashMap
<>();
map2
.
put
(
"materialId"
,
"2"
);
map2
.
put
(
"materialName"
,
"测试物料2"
);
map2
.
put
(
"materialJson"
,
"相关内容22"
);
map2
.
put
(
"materialUnit"
,
"张"
);
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
mapList
.
add
(
map
);
mapList
.
add
(
map2
);
MemEasySearcher
<
Map
<
String
,
Object
>>
memEasySearcher
=
new
MemEasySearcherImpl
<>();
Map
<
String
,
Object
>
model
=
memEasySearcher
.
search
(
mapList
,
easySearchParse
,
pageRequest
,
null
);
return
model
;
}
}
topsun/src/main/java/com/huigou/topsun/technology/application/ProcessMaterialItemApplication.java
View file @
7ffd0f2e
package
com
.
huigou
.
topsun
.
technology
.
application
;
import
com.huigou.topsun.technology.domain.model.ProcessMaterialItem
;
/**
* @author 16508
* @description 针对表【process_material_item(工序物料关系表)】的数据库操作Service
...
...
@@ -8,4 +10,8 @@ package com.huigou.topsun.technology.application;
*/
public
interface
ProcessMaterialItemApplication
{
ProcessMaterialItem
saveProcessMaterialItem
(
ProcessMaterialItem
processMaterialItem
);
void
deleteByTechnologyProcessId
(
String
technologyProcessId
);
}
topsun/src/main/java/com/huigou/topsun/technology/application/impl/ProcessMaterialItemApplicationImpl.java
View file @
7ffd0f2e
package
com
.
huigou
.
topsun
.
technology
.
application
.
impl
;
import
com.huigou.topsun.technology.application.ProcessMaterialItemApplication
;
import
com.huigou.topsun.technology.domain.model.ProcessMaterialItem
;
import
com.huigou.topsun.technology.repository.ProcessMaterialItemRepository
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author 16508
* @description 针对表【process_material_item(工序物料关系表)】的数据库操作Service实现
...
...
@@ -10,7 +15,19 @@ import org.springframework.stereotype.Service;
*/
@Service
public
class
ProcessMaterialItemApplicationImpl
implements
ProcessMaterialItemApplication
{
@Resource
private
ProcessMaterialItemRepository
processMaterialItemRepository
;
@Override
public
ProcessMaterialItem
saveProcessMaterialItem
(
ProcessMaterialItem
processMaterialItem
)
{
return
processMaterialItemRepository
.
save
(
processMaterialItem
);
}
@Override
public
void
deleteByTechnologyProcessId
(
String
technologyProcessId
)
{
List
<
ProcessMaterialItem
>
materialItemList
=
processMaterialItemRepository
.
findByTechnologyProcessId
(
technologyProcessId
);
processMaterialItemRepository
.
delete
(
materialItemList
);
}
}
...
...
topsun/src/main/java/com/huigou/topsun/technology/application/impl/TechnologyProcessApplicationImpl.java
View file @
7ffd0f2e
package
com
.
huigou
.
topsun
.
technology
.
application
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.topsun.technology.application.ProcessApplication
;
import
com.huigou.topsun.technology.application.Process
MaterialItem
Application
;
import
com.huigou.topsun.technology.application.ProcessResourceApplication
;
import
com.huigou.topsun.technology.application.TechnologyProcessApplication
;
import
com.huigou.topsun.technology.domain.model.ProcessMaterialItem
;
import
com.huigou.topsun.technology.domain.model.ProcessResource
;
import
com.huigou.topsun.technology.domain.model.TechnologyProcess
;
import
com.huigou.topsun.technology.repository.TechnologyProcessRepository
;
import
com.huigou.topsun.technology.vo.ProcessVo
;
import
com.huigou.topsun.technology.vo.TechnologyProcessVo
;
import
com.huigou.uasp.bmp.common.application.BaseApplication
;
import
org.springframework.stereotype.Service
;
...
...
@@ -26,9 +25,9 @@ public class TechnologyProcessApplicationImpl extends BaseApplication implements
@Resource
private
TechnologyProcessRepository
technologyProcessRepository
;
@Resource
private
ProcessApplication
processApplication
;
@Resource
private
ProcessResourceApplication
processResourceApplication
;
@Resource
private
ProcessMaterialItemApplication
processMaterialItemApplication
;
@Override
public
List
<
Map
<
String
,
Object
>>
slicedTechnologyProcessList
(
String
technologyId
)
{
...
...
@@ -52,6 +51,16 @@ public class TechnologyProcessApplicationImpl extends BaseApplication implements
processResource
.
setTechnologyProcessId
(
technologyProcess
.
getTechnologyProcessId
());
processResource
.
setResourceId
(
technologyProcessVo
.
getResourceId
());
processResourceApplication
.
saveProcessResource
(
processResource
);
//保存工序物料
ProcessMaterialItem
processMaterialItem
=
new
ProcessMaterialItem
();
processMaterialItem
.
setTechnologyProcessId
(
technologyProcess
.
getTechnologyProcessId
());
processMaterialItem
.
setMaterialId
(
technologyProcessVo
.
getMaterialId
());
processMaterialItem
.
setMaterialName
(
technologyProcessVo
.
getMaterialName
());
processMaterialItem
.
setMaterialNumber
(
technologyProcessVo
.
getMaterialNumber
());
processMaterialItem
.
setMaterialUnit
(
technologyProcessVo
.
getMaterialUnit
());
processMaterialItem
.
setMaterialJson
(
technologyProcessVo
.
getMaterialJson
());
processMaterialItemApplication
.
saveProcessMaterialItem
(
processMaterialItem
);
});
}
...
...
@@ -79,6 +88,9 @@ public class TechnologyProcessApplicationImpl extends BaseApplication implements
technologyProcessList
.
forEach
(
technologyProcess
->
{
//删除工序资源
processResourceApplication
.
deleteByTechnologyProcessId
(
technologyProcess
.
getTechnologyProcessId
());
//删除工序物料
processMaterialItemApplication
.
deleteByTechnologyProcessId
(
technologyProcess
.
getTechnologyProcessId
());
});
//删除工艺工序关系表
technologyProcessRepository
.
delete
(
technologyProcessList
);
...
...
topsun/src/main/java/com/huigou/topsun/technology/controller/TechnologyController.java
View file @
7ffd0f2e
...
...
@@ -9,6 +9,7 @@ import com.huigou.topsun.technology.vo.TechnologyVo;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.util.SDO
;
import
com.huigou.util.StringUtil
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -83,8 +84,12 @@ public class TechnologyController extends CommonController {
SDO
sdo
=
this
.
getSDO
();
TechnologyVo
technologyVo
=
sdo
.
toObject
(
TechnologyVo
.
class
);
List
<
TechnologyProcessVo
>
processList
=
sdo
.
getList
(
"processList"
,
TechnologyProcessVo
.
class
);
technologyVo
=
technologyApplication
.
saveTechnology
(
technologyVo
);
technologyProcessApplication
.
saveTechnologyProcessVoList
(
technologyVo
.
getTechnologyId
(),
processList
);
if
(
StringUtil
.
isNotBlank
(
technologyVo
.
getTechnologyId
())){
technologyProcessApplication
.
updateTechnologyProcessVoList
(
technologyVo
.
getTechnologyId
(),
processList
);
}
else
{
technologyVo
=
technologyApplication
.
saveTechnology
(
technologyVo
);
technologyProcessApplication
.
saveTechnologyProcessVoList
(
technologyVo
.
getTechnologyId
(),
processList
);
}
return
success
(
technologyVo
);
}
...
...
topsun/src/main/java/com/huigou/topsun/technology/domain/model/ProcessMaterialItem.java
View file @
7ffd0f2e
...
...
@@ -4,6 +4,7 @@ import java.io.Serializable;
import
javax.persistence.*
;
import
lombok.Data
;
import
org.hibernate.annotations.GenericGenerator
;
/**
* 工序物料关系表
...
...
@@ -17,6 +18,8 @@ public class ProcessMaterialItem implements Serializable {
* 工艺物料关系ID
*/
@Id
@GeneratedValue
(
generator
=
"system-uuid"
)
@GenericGenerator
(
name
=
"system-uuid"
,
strategy
=
"guid"
)
@Column
(
name
=
"process_material_item_id"
)
private
String
processMaterialItemId
;
...
...
@@ -32,6 +35,12 @@ public class ProcessMaterialItem implements Serializable {
@Column
(
name
=
"material_id"
)
private
String
materialId
;
/**
* 物料名称
*/
@Column
(
name
=
"material_name"
)
private
String
materialName
;
/**
* 使用的物料数量
*/
...
...
topsun/src/main/java/com/huigou/topsun/technology/repository/ProcessMaterialItemRepository.java
View file @
7ffd0f2e
...
...
@@ -3,10 +3,13 @@ package com.huigou.topsun.technology.repository;
import
com.huigou.topsun.technology.domain.model.ProcessMaterialItem
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.List
;
/**
* @Auther: xin.lu
* @Date: 2023/11/22/11:11
* @Description:
*/
public
interface
ProcessMaterialItemRepository
extends
JpaRepository
<
ProcessMaterialItem
,
String
>
{
List
<
ProcessMaterialItem
>
findByTechnologyProcessId
(
String
technologyProcessId
);
}
topsun/src/main/java/com/huigou/topsun/technology/vo/TechnologyProcessVo.java
View file @
7ffd0f2e
...
...
@@ -33,6 +33,11 @@ public class TechnologyProcessVo implements Serializable {
*/
private
String
resourceId
;
/**
* 资源版本
*/
private
String
version
;
/**
* 条目序号
*/
...
...
@@ -64,6 +69,31 @@ public class TechnologyProcessVo implements Serializable {
*/
private
String
processContent
;
/**
* 工序物料id
*/
private
String
materialId
;
/**
* 物料名称
*/
private
String
materialName
;
/**
* 使用的物料数量
*/
private
Double
materialNumber
;
/**
* 物料计量单位
*/
private
String
materialUnit
;
/**
* sap物料相信内容
*/
private
String
materialJson
;
public
static
Process
getProcess
(
TechnologyProcessVo
processVo
){
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
processVo
),
Process
.
class
);
}
...
...
topsun/src/main/resources/config/topsun/technology/technologyProcess.xml
View file @
7ffd0f2e
...
...
@@ -19,11 +19,18 @@
WHEN p.process_type = 'printing' THEN
( SELECT gxmc FROM res_ys t WHERE t.id = pr.resource_id )
WHEN p.process_type = 'cropping' THEN
( SELECT gxmc FROM res_cj t WHERE t.id = pr.resource_id ) ELSE '' end AS resource_name
( SELECT gxmc FROM res_cj t WHERE t.id = pr.resource_id ) ELSE '' end AS resource_name,
mi.material_id,
mi.material_name,
mi.material_unit,
mi.material_number,
mi.material_json,
mi.process_material_item_id
FROM
technology_process tp
LEFT JOIN process p ON tp.process_id = p.process_id
LEFT JOIN process_resource pr ON pr.technology_process_id = tp.technology_process_id
LEFT JOIN process_material_item mi ON tp.technology_process_id = mi.technology_process_id
WHERE tp.technology_id = ?
</sql-query>
</query>
...
...
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