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
209c01ca
Commit
209c01ca
authored
Jul 16, 2024
by
鲁鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物品报废申请与过账功能
parent
e82899bb
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1351 additions
and
0 deletions
+1351
-0
productScrapApplyDetail.js
...z/topsun/sap/productScrapApply/productScrapApplyDetail.js
+109
-0
productScrapApplyDetail.jsp
.../topsun/sap/productScrapApply/productScrapApplyDetail.jsp
+33
-0
productScrapApplyList.js
...biz/topsun/sap/productScrapApply/productScrapApplyList.js
+111
-0
productScrapApplyList.jsp
...iz/topsun/sap/productScrapApply/productScrapApplyList.jsp
+47
-0
ProductScrapApplyApplication.java
...tScrapApply/application/ProductScrapApplyApplication.java
+28
-0
ProductScrapApplyItemApplication.java
...apApply/application/ProductScrapApplyItemApplication.java
+24
-0
ProductScrapApplyApplicationImpl.java
...ly/application/impl/ProductScrapApplyApplicationImpl.java
+293
-0
ProductScrapApplyItemApplicationImpl.java
...pplication/impl/ProductScrapApplyItemApplicationImpl.java
+56
-0
ProductScrapApplyController.java
...uctScrapApply/controller/ProductScrapApplyController.java
+115
-0
ProductScrapApply.java
...opsun/sap/productScrapApply/domain/ProductScrapApply.java
+29
-0
ProductScrapApplyItem.java
...n/sap/productScrapApply/domain/ProductScrapApplyItem.java
+126
-0
ProductScrapApplyQueryRequest.java
...crapApply/domain/query/ProductScrapApplyQueryRequest.java
+70
-0
ProductScrapApplyItemRepository.java
...crapApply/repository/ProductScrapApplyItemRepository.java
+15
-0
ProductScrapApplyRepository.java
...uctScrapApply/repository/ProductScrapApplyRepository.java
+12
-0
ProductScrapApplyBackVo.java
...sun/sap/productScrapApply/vo/ProductScrapApplyBackVo.java
+33
-0
ProductScrapApplyVo.java
.../topsun/sap/productScrapApply/vo/ProductScrapApplyVo.java
+116
-0
sapProductScrapApplyProc.bpmn
...opsun/sap/productScrapApply/sapProductScrapApplyProc.bpmn
+111
-0
sapProductScrapApply.xml
...fig/topsun/sap/productScrapApply/sapProductScrapApply.xml
+23
-0
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/productScrapApply/productScrapApplyDetail.js
0 → 100644
View file @
209c01ca
var
itemGridManager
=
null
;
$
(
function
()
{
initItemGrid
();
bindEvent
();
});
function
bindEvent
()
{
}
function
initItemGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
});
itemGridManager
=
UICtrl
.
grid
(
'#maingrid'
,
{
columns
:
getGridColumns
(),
dataAction
:
'server'
,
url
:
web_app
.
name
+
'/productScrapApply/queryProductScrapApplyItems.ajax'
,
parms
:{
productScrapApplyId
:
getId
()},
height
:
'95%'
,
heightDiff
:
-
4
,
sortName
:
'id'
,
sortOrder
:
'asc'
,
checkbox
:
true
,
usePager
:
true
,
rownumbers
:
true
,
enabledEdit
:
false
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
//autoApplyNextEditor:false,
toolbar
:
toolbarOptions
,
}
);
UICtrl
.
setSearchAreaToggle
(
itemGridManager
);
}
function
getGridColumns
()
{
var
columns
=
[];
columns
=
[
{
display
:
"报废申请号"
,
name
:
"zsanum"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"项目"
,
name
:
"zsapos"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"物料"
,
name
:
"matnr"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"数量"
,
name
:
"erfmg"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"单位"
,
name
:
"erfme"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
//, {display: "单位描述", name: "erfmeName", width: 150, minWidth: 60, type: "string", align: "center"}
,
{
display
:
"工厂"
,
name
:
"werks"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"工厂描述"
,
name
:
"werksName"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"存储地点"
,
name
:
"lgort"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"存储地点描述"
,
name
:
"lgortName"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"成本中心"
,
name
:
"kostl"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"成本中心描述"
,
name
:
"kostlName"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"批次"
,
name
:
"charg"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"序列号/PL号"
,
name
:
"sernr"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"文本"
,
name
:
"ztxt"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"SAP创建人"
,
name
:
"zuser1"
,
width
:
140
,
minWidth
:
60
,
type
:
"date"
,
align
:
"center"
}
,
{
display
:
"SAP创建日期"
,
name
:
"zdat"
,
width
:
140
,
minWidth
:
60
,
type
:
"date"
,
align
:
"center"
}
]
return
columns
;
}
//获取数据保存的参数
function
getExtendedData
(
processAction
)
{
//回退、打回、转交时,不需要验证必填项是否已经填写;
if
(
processAction
==
ProcessAction
.
BACK
||
processAction
==
ProcessAction
.
REPLENISH
||
processAction
==
ProcessAction
.
TRANSMIT
)
{
//不验证
$
(
'#submitForm'
).
attr
(
'check'
,
false
);
}
var
extendedData
=
{};
var
_grid
=
UICtrl
.
getGridManager
(
'#maingrid'
);
if
(
_grid
)
{
var
datas
=
DataUtil
.
getGridData
({
gridManager
:
_grid
,
isAllData
:
true
});
if
(
!
datas
)
{
return
false
;
}
extendedData
.
productScrapApplyItems
=
Public
.
encodeJSONURI
(
datas
);
}
return
extendedData
;
}
function
getId
()
{
return
$
(
'#id'
).
val
();
}
function
setId
(
value
)
{
$
(
"#id"
).
val
(
value
);
var
_grid
=
UICtrl
.
getGridManager
(
'#maingrid'
);
_grid
.
options
.
parms
.
productScrapApplyId
=
value
;
}
function
reloadGrid
()
{
itemGridManager
.
loadData
();
}
function
getGridData
(){
var
_grid
=
UICtrl
.
getGridManager
(
'#maingrid'
);
var
datas
=
DataUtil
.
getGridData
({
gridManager
:
_grid
,
isAllData
:
true
});
return
datas
;
}
topsun-xt/src/main/webapp/biz/topsun/sap/productScrapApply/productScrapApplyDetail.jsp
0 → 100644
View file @
209c01ca
<%--采购申请--%>
<%@ page
contentType=
"text/html; charset=utf-8"
language=
"java"
%>
<%@ 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,dateTime,combox,attachment,commonTree,comboDialog"
/>
<x:script
src=
"/biz/topsun/sap/productScrapApply/productScrapApplyDetail.js"
/>
</head>
<body>
<div
class=
"container-fluid"
>
<x:billTitle
title=
"物品报废申请与过账平台"
needStatus=
"true"
needPerson=
"true"
/>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"submitForm"
>
<x:hidden
name=
"id"
/>
<x:hidden
name=
"version"
/>
<x:hidden
name=
"billCode"
/>
<x:hidden
name=
"fillinDate"
/>
<x:hidden
name=
"fullId"
/>
<x:hidden
name=
"organId"
/>
<x:hidden
name=
"organName"
/>
<x:hidden
name=
"deptId"
/>
<x:hidden
name=
"deptName"
/>
<x:hidden
name=
"positionId"
/>
<x:hidden
name=
"positionName"
/>
<x:hidden
name=
"personMemberId"
/>
<x:hidden
name=
"personMemberName"
/>
<x:hidden
name=
"statusId"
/>
<div
class=
"hg-form-cols"
>
</div>
<div
id=
"maingrid"
></div>
</form>
</div>
</body>
\ No newline at end of file
topsun-xt/src/main/webapp/biz/topsun/sap/productScrapApply/productScrapApplyList.js
0 → 100644
View file @
209c01ca
var
purchaseApprovalGridManager
=
null
;
$
(
document
).
ready
(
function
()
{
initUI
();
initPurchaseListGrid
();
}
);
function
initUI
()
{
UICtrl
.
initDefaultLayout
();
}
function
initPurchaseListGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
});
purchaseApprovalGridManager
=
UICtrl
.
grid
(
'#purchaseApprovalGrid'
,
{
columns
:
[
{
display
:
"状态"
,
name
:
"statusTextView"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
}
,
{
display
:
"id"
,
name
:
"id"
,
width
:
"140"
,
align
:
"left"
,
type
:
"string"
,
hide
:
true
}
,
{
display
:
"BPM单据编号"
,
name
:
"billCode"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"报废申请号"
,
name
:
"zsanum"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"项目"
,
name
:
"zsapos"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"物料"
,
name
:
"matnr"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"数量"
,
name
:
"erfmg"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"单位"
,
name
:
"erfme"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
//, {display: "单位描述", name: "erfmeName", width: 150, minWidth: 60, type: "string", align: "center"}
,
{
display
:
"工厂"
,
name
:
"werks"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"工厂描述"
,
name
:
"werksName"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"存储地点"
,
name
:
"lgort"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"存储地点描述"
,
name
:
"lgortName"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"成本中心"
,
name
:
"kostl"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"成本中心描述"
,
name
:
"kostlName"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"批次"
,
name
:
"charg"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"序列号/PL号"
,
name
:
"sernr"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"文本"
,
name
:
"ztxt"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"消息类型"
,
name
:
"type"
,
width
:
100
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"消息文本"
,
name
:
"message"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"创建人"
,
name
:
"personMemberName"
,
width
:
140
,
minWidth
:
60
,
type
:
"date"
,
align
:
"center"
}
,
{
display
:
"SAP创建人"
,
name
:
"zuser1"
,
width
:
140
,
minWidth
:
60
,
type
:
"date"
,
align
:
"center"
}
,
{
display
:
"创建日期"
,
name
:
"fillinDate"
,
width
:
140
,
minWidth
:
60
,
type
:
"date"
,
align
:
"center"
}
,
{
display
:
"SAP创建日期"
,
name
:
"zdat"
,
width
:
140
,
minWidth
:
60
,
type
:
"date"
,
align
:
"center"
}
],
dataAction
:
'server'
,
url
:
web_app
.
name
+
'/productScrapApply/slicedProductScrapApplyList.ajax?'
,
//parms: {requireItemId: $("#prepareItemId").val()},
toolbar
:
toolbarOptions
,
width
:
'99.8%'
,
height
:
'100%'
,
pageSize
:
20
,
heightDiff
:
-
4
,
sortName
:
'fillinDate'
,
sortOrder
:
'desc'
,
checkbox
:
true
,
usePager
:
true
,
rownumbers
:
true
,
enabledEdit
:
false
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
enableObjectBag
:
true
,
onSuccess
:
function
(
data
)
{
if
(
data
.
error
)
{
Public
.
tip
(
data
.
error
);
}
}
,
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
viewHandler
(
data
.
id
);
},
onAfterShowData
:
function
(
currentData
)
{
}
}
);
UICtrl
.
setSearchAreaToggle
(
purchaseApprovalGridManager
);
}
/**
* 查看采购申请详情
* @param id 采购申请id
* @returns {boolean}
*/
function
viewHandler
(
id
)
{
if
(
!
id
)
{
var
row
=
DataUtil
.
getSelectedRow
(
purchaseApprovalGridManager
);
if
(
!
row
)
{
return
row
;
}
id
=
row
.
id
;
}
UICtrl
.
addTabItem
({
tabid
:
'viewProductScrapApply'
+
id
,
text
:
'查看物品报废申请与过账平台'
,
url
:
web_app
.
name
+
'/productScrapApply/showProductScrapApplyDetail.job?isReadOnly=true&bizId='
+
id
});
}
function
reloadPurchaseGrid
()
{
var
params
=
$
(
"#queryMainForm"
).
formToJSON
();
UICtrl
.
gridSearch
(
purchaseApprovalGridManager
,
params
);
}
function
query
(
obj
)
{
var
param
=
$
(
obj
).
formToJSON
();
UICtrl
.
gridSearch
(
purchaseApprovalGridManager
,
param
);
}
function
resetForm
(
obj
)
{
$
(
obj
).
formClean
();
}
topsun-xt/src/main/webapp/biz/topsun/sap/productScrapApply/productScrapApplyList.jsp
0 → 100644
View file @
209c01ca
<%@ 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,dateTime,combox,attachment,commonTree,comboDialog"
/>
<script
src=
'
<c:url
value=
"/lib/jquery/jquery.comboDialog.js"
/>
'
type=
"text/javascript"
></script>
<script
src=
'
<c:url
value=
"/lib/jquery/jquery.commonTree.js"
/>
'
type=
"text/javascript"
></script>
<script
src=
'
<c:url
value=
"/lib/jquery/jquery.flexField.js"
/>
'
type=
"text/javascript"
></script>
<script
src=
'
<c:url
value=
"/biz/topsun/sap/productScrapApply/productScrapApplyList.js"
/>
'
type=
"text/javascript"
></script>
</head>
<body>
<div
class=
"container-fluid"
>
<div
id=
"layout"
>
<div
position=
"center"
title=
""
>
<x:title
title=
"搜索"
hideTable=
"queryMainForm"
/>
<form
class=
"hg-form ui-show"
method=
"post"
action=
""
id=
"queryMainForm"
>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"billCode"
label=
"单据编号"
labelCol=
"1"
/>
</div>
<div
class=
"hg-form-row"
>
<div
class=
"col-xs-4 col-sm-1"
>
<label
class=
"hg-form-label"
>
申请日期起
:
</label>
</div>
<div
class=
"col-xs-4 col-sm-2 col-white-bg"
>
<x:input
name=
"fillinBeginDate"
required=
"false"
wrapper=
"date"
/>
</div>
<div
class=
"col-xs-4 col-sm-1"
>
<label
class=
"hg-form-label"
>
申请日期止
:
</label>
</div>
<div
class=
"col-xs-4 col-sm-2 col-white-bg"
>
<x:input
name=
"fillinEndDate"
label=
"至"
required=
"false"
wrapper=
"date"
/>
</div>
</div>
<div
class=
"hg-form-row"
>
<x:checkboxListC
name=
"statusKind"
label=
"common.field.status"
list=
"statusKindsList"
labelCol=
"1"
fieldCol=
"3"
/>
</div>
<x:searchButtons/>
</form>
<x:title
title=
"物品报废申请与过账平台"
hideTable=
"#purchaseApprovalGrid"
name=
"list"
/>
<div
id=
"purchaseApprovalGrid"
style=
"margin:2px;"
></div>
</div>
</div>
</div>
</body>
</html>
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/application/ProductScrapApplyApplication.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
application
;
import
com.huigou.topsun.sap.productScrapApply.domain.ProductScrapApply
;
import
com.huigou.topsun.sap.productScrapApply.domain.query.ProductScrapApplyQueryRequest
;
import
com.huigou.topsun.sap.productScrapApply.vo.ProductScrapApplyVo
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/15:13
* @Description:
*/
public
interface
ProductScrapApplyApplication
{
public
static
final
String
QUERY_XML_FILE_PATH
=
"config/topsun/sap/productScrapApply/sapProductScrapApply.xml"
;
String
PROCESS_DEFINITION_KEY
=
"sapProductScrapApplyProc"
;
Map
<
String
,
Object
>
slicedProductScrapApplyList
(
ProductScrapApplyQueryRequest
queryRequest
);
ProductScrapApply
loadProductScrapApply
(
String
id
);
void
saveProductScrapApplyVo
(
ProductScrapApply
productScrapApply
);
String
saveProductScrapApplyVo
(
List
<
ProductScrapApplyVo
>
productScrapApplyVoListVo
);
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/application/ProductScrapApplyItemApplication.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
application
;
import
com.huigou.topsun.sap.productScrapApply.domain.ProductScrapApplyItem
;
import
com.huigou.topsun.sap.productScrapApply.domain.query.ProductScrapApplyQueryRequest
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/15:19
* @Description:
*/
public
interface
ProductScrapApplyItemApplication
{
public
static
final
String
QUERY_XML_FILE_PATH
=
"config/topsun/sap/productScrapApply/sapProductScrapApply.xml"
;
void
saveProductScrapApplyItems
(
String
productScrapApplyId
,
List
<
ProductScrapApplyItem
>
productScrapApplyItems
);
void
deleteByIds
(
List
<
String
>
ids
);
Map
<
String
,
Object
>
queryProductScrapApplyItems
(
ProductScrapApplyQueryRequest
queryRequest
);
List
<
ProductScrapApplyItem
>
queryProductScrapApplyItems
(
String
productScrapApplyId
);
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/application/impl/ProductScrapApplyApplicationImpl.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
application
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.cache.SystemCache
;
import
com.huigou.context.Operator
;
import
com.huigou.context.ThreadLocalUtil
;
import
com.huigou.data.domain.model.CommonDomainConstants
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.base.bsnMessage.appliction.MannualStartWorkApplication
;
import
com.huigou.topsun.sap.common.DefaultHttpClient
;
import
com.huigou.topsun.sap.common.application.SapMutualEpLogApplication
;
import
com.huigou.topsun.sap.productScrapApply.application.ProductScrapApplyApplication
;
import
com.huigou.topsun.sap.productScrapApply.application.ProductScrapApplyItemApplication
;
import
com.huigou.topsun.sap.productScrapApply.domain.ProductScrapApply
;
import
com.huigou.topsun.sap.productScrapApply.domain.ProductScrapApplyItem
;
import
com.huigou.topsun.sap.productScrapApply.domain.query.ProductScrapApplyQueryRequest
;
import
com.huigou.topsun.sap.productScrapApply.repository.ProductScrapApplyRepository
;
import
com.huigou.topsun.sap.productScrapApply.vo.ProductScrapApplyBackVo
;
import
com.huigou.topsun.sap.productScrapApply.vo.ProductScrapApplyVo
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bmp.operator.OperatorApplication
;
import
com.huigou.uasp.bmp.opm.domain.model.org.Org
;
import
com.huigou.uasp.bpm.FlowBroker
;
import
com.huigou.util.ClassHelper
;
import
com.huigou.util.DateUtil
;
import
com.huigou.util.StringUtil
;
import
org.activiti.engine.delegate.DelegateExecution
;
import
org.activiti.engine.delegate.DelegateTask
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/15:13
* @Description:
*/
@Service
(
"productScrapApplyApplication"
)
public
class
ProductScrapApplyApplicationImpl
extends
FlowBroker
implements
ProductScrapApplyApplication
{
@Autowired
private
ProductScrapApplyRepository
productScrapApplyRepository
;
@Autowired
private
ProductScrapApplyItemApplication
productScrapApplyItemApplication
;
@Autowired
private
OperatorApplication
operatorApplication
;
@Autowired
private
MannualStartWorkApplication
mannualStartWorkApplication
;
@Autowired
private
DefaultHttpClient
defaultHttpClient
;
@Autowired
private
SapMutualEpLogApplication
sapMutualEpLogApplication
;
@Override
protected
String
saveBizAndApprovalData
()
{
super
.
saveBizAndApprovalData
();
ProductScrapApply
productScrapApply
=
getBizEntity
(
ProductScrapApply
.
class
);
if
(
productScrapApply
.
isNew
())
{
productScrapApply
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
}
else
{
productScrapApply
=
(
ProductScrapApply
)
commonDomainService
.
loadAndFillinProperties
(
productScrapApply
);
}
productScrapApply
=
productScrapApplyRepository
.
save
(
productScrapApply
);
List
<
ProductScrapApplyItem
>
productScrapApplyItems
=
getBizEntities
(
ProductScrapApplyItem
.
class
,
"productScrapApplyItems"
);
productScrapApplyItemApplication
.
saveProductScrapApplyItems
(
productScrapApply
.
getId
(),
productScrapApplyItems
);
//String sapPurchaseVoJson = this.getSapPurchaseVoJson(productScrapApply);
return
productScrapApply
.
getId
();
}
@Override
protected
void
setTaskDescription
(
DelegateTask
delegateTask
)
{
String
bizId
=
delegateTask
.
getExecution
().
getProcessBusinessKey
();
delegateTask
.
setDescription
(
this
.
getApprovalSubjectName
(
bizId
));
}
/**
* 获取任务标题
*
* @param bizId
* @return
*/
private
String
getApprovalSubjectName
(
String
bizId
)
{
ProductScrapApply
productScrapApply
=
this
.
productScrapApplyRepository
.
findOne
(
bizId
);
//查询 单据日期
String
fillinDateStr
=
DateUtil
.
getDateFormat
(
"yyyy-MM-dd HH:mm:ss"
,
productScrapApply
.
getFillinDate
());
//设置标题
return
String
.
format
(
"%s-%s(%s)"
,
"物品报废申请与过账平台"
,
productScrapApply
.
getBillCode
()
,
fillinDateStr
);
}
@Override
protected
Map
<
String
,
Object
>
getProcessBizParams
(
String
bizId
)
{
// 返回业务数据给流程实例,
return
ClassHelper
.
toMap
(
productScrapApplyRepository
.
getOne
(
bizId
));
}
/**
* 流程撤销事件
**/
@Override
protected
void
onRecallProcessInstance
(
DelegateExecution
delegateExecution
)
{
String
bizId
=
delegateExecution
.
getProcessBusinessKey
();
// 修改单据状态为申请
updateStatus
(
bizId
,
BizBillStatus
.
APPLYING
);
}
/**
* 任务完成前执行
*/
@Override
protected
void
onBeforeComplete
(
DelegateTask
delegateTask
)
{
super
.
onBeforeComplete
(
delegateTask
);
String
bizId
=
delegateTask
.
getExecution
().
getProcessBusinessKey
();
if
(
this
.
isApplyProcUnit
(
delegateTask
)
&&
this
.
getApprovalParameter
().
isAdvanceProcessAction
())
{
updateStatus
(
bizId
,
BizBillStatus
.
APPROVING
);
}
}
/**
* 回收事件
**/
@Override
protected
void
onWithdraw
(
DelegateTask
delegateTask
,
String
destActivityId
)
{
super
.
onWithdraw
(
delegateTask
,
destActivityId
);
String
bizId
=
delegateTask
.
getExecution
().
getProcessBusinessKey
();
if
(
destActivityId
.
equalsIgnoreCase
(
"apply"
))
{
updateStatus
(
bizId
,
BizBillStatus
.
APPLYING
);
}
}
@Transactional
protected
void
updateStatus
(
String
bizId
,
BizBillStatus
status
)
{
Assert
.
hasText
(
bizId
,
CommonDomainConstants
.
ID_NOT_BLANK
);
this
.
commonDomainService
.
updateStatus
(
ProductScrapApply
.
class
,
bizId
,
status
.
getId
());
}
@Override
protected
void
onEnd
(
DelegateExecution
delegateExecution
)
{
super
.
onEnd
(
delegateExecution
);
String
bizId
=
delegateExecution
.
getProcessBusinessKey
();
BizBillStatus
status
=
approvePassed
()
?
BizBillStatus
.
COMPLETED
:
BizBillStatus
.
ABORTED
;
ProductScrapApply
productScrapApply
=
productScrapApplyRepository
.
findOne
(
bizId
);
sendSapData
(
productScrapApply
,
"3"
);
//通过
productScrapApply
.
setStatusId
(
status
.
getId
());
productScrapApplyRepository
.
save
(
productScrapApply
);
}
public
void
sendSapData
(
ProductScrapApply
productScrapApply
,
String
status
){
List
<
ProductScrapApplyItem
>
itemList
=
productScrapApplyItemApplication
.
queryProductScrapApplyItems
(
productScrapApply
.
getId
());
ProductScrapApplyBackVo
productScrapApplyBackVo
=
new
ProductScrapApplyBackVo
();
productScrapApplyBackVo
.
setBillCode
(
productScrapApply
.
getBillCode
());
productScrapApplyBackVo
.
setZstatus
(
status
);
productScrapApplyBackVo
.
setZsanum
(
itemList
.
get
(
0
).
getZsanum
());
ObjectMapper
objectMapper
=
new
ObjectMapper
();
//http://192.168.3.109:8000/sap/bc/erp_ep/upd_ztmm004_std?sap-client=300
String
url
=
"upd_ztmm004_std"
;
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"businessType"
,
"废品报废申请"
);
resultMap
.
put
(
"businessId"
,
productScrapApply
.
getBillCode
());
resultMap
.
put
(
"parameter"
,
JSON
.
toJSONString
(
productScrapApplyBackVo
));
try
{
String
result
=
defaultHttpClient
.
execute
(
productScrapApplyBackVo
,
url
);
List
<
Map
<
String
,
Object
>>
resultList
=
objectMapper
.
readValue
(
result
,
new
TypeReference
<
List
<
Map
<
String
,
Object
>>>()
{});
Map
<
String
,
Object
>
backMap
=
resultList
.
get
(
0
);
if
(!
"S"
.
equals
(
backMap
.
get
(
"TYPE"
)))
{
throw
new
RuntimeException
(
"数据传输失败,请稍后手动重试!"
+
backMap
.
get
(
"MESSAGE"
));
}
else
{
resultMap
.
put
(
"TYPE"
,
backMap
.
get
(
"TYPE"
));
resultMap
.
put
(
"MESSAGE"
,
backMap
.
get
(
"MESSAGE"
));
}
productScrapApply
.
setType
((
String
)
backMap
.
get
(
"TYPE"
));
productScrapApply
.
setMessage
((
String
)
backMap
.
get
(
"MESSAGE"
));
productScrapApplyRepository
.
save
(
productScrapApply
);
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"TYPE"
,
"E"
);
resultMap
.
put
(
"MESSAGE"
,
e
.
getMessage
());
throw
new
RuntimeException
(
"数据传输失败请检查数据后重试!"
+
e
.
getMessage
());
}
finally
{
sapMutualEpLogApplication
.
saveSapMutualEpLog
(
resultMap
);
}
}
@Override
protected
void
onAbortProcessInstance
(
DelegateExecution
delegateExecution
)
{
super
.
onAbortProcessInstance
(
delegateExecution
);
String
bizId
=
delegateExecution
.
getProcessBusinessKey
();
ProductScrapApply
productScrapApply
=
productScrapApplyRepository
.
findOne
(
bizId
);
this
.
sendSapData
(
productScrapApply
,
"2"
);
//拒绝
productScrapApply
.
setStatusId
(
BizBillStatus
.
ABORTED
.
getId
());
productScrapApplyRepository
.
save
(
productScrapApply
);
}
/**
* @param delegateTask
* @param destActivityId 回退到的目标节点id
*/
@Override
protected
void
onBack
(
DelegateTask
delegateTask
,
String
destActivityId
)
{
super
.
onBack
(
delegateTask
,
destActivityId
);
if
(
"Apply"
.
equalsIgnoreCase
(
destActivityId
))
{
String
bizId
=
delegateTask
.
getExecution
().
getProcessBusinessKey
();
ProductScrapApply
productScrapApply
=
productScrapApplyRepository
.
findOne
(
bizId
);
productScrapApply
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
productScrapApplyRepository
.
save
(
productScrapApply
);
}
}
@Override
public
Map
<
String
,
Object
>
slicedProductScrapApplyList
(
ProductScrapApplyQueryRequest
queryRequest
)
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"productScrapApplyList"
);
QueryModel
queryModel
=
this
.
sqlExecutorDao
.
getQueryModel
(
queryDescriptor
,
queryRequest
);
queryModel
.
putDictionary
(
"status"
,
BizBillStatus
.
getMap
());
return
this
.
sqlExecutorDao
.
executeSlicedQuery
(
queryModel
);
}
@Override
public
ProductScrapApply
loadProductScrapApply
(
String
id
)
{
return
productScrapApplyRepository
.
findOne
(
id
);
}
@Override
public
void
saveProductScrapApplyVo
(
ProductScrapApply
productScrapApply
)
{
productScrapApplyRepository
.
save
(
productScrapApply
);
}
@Override
@Transactional
public
String
saveProductScrapApplyVo
(
List
<
ProductScrapApplyVo
>
productScrapApplyVoListVo
)
{
String
productScrapApplyId
=
""
;
ProductScrapApply
productScrapApply
=
new
ProductScrapApply
();
//根据SAP传过来的创建人编码,映射流程发起人
String
acceptPersonCode
=
SystemCache
.
getParameter
(
"acceptPersonCode"
,
String
.
class
);
Org
org
=
orgApplication
.
loadMainOrgByLoginName
(
acceptPersonCode
);
if
(
ObjectUtil
.
isNotNull
(
org
)){
Operator
operator
=
operatorApplication
.
createOperatorByPersonMemberId
(
org
.
getId
());
ThreadLocalUtil
.
putOperator
(
operator
);
}
else
{
//throw new RuntimeException("未找到采购申请创建人:" + ernam);
}
//发起流程 05.11 lxh
List
<
ProductScrapApplyItem
>
productScrapApplyItems
=
new
ArrayList
<>();
for
(
ProductScrapApplyVo
productScrapApplyVo
:
productScrapApplyVoListVo
)
{
ProductScrapApplyItem
productScrapApplyItem
=
new
ProductScrapApplyItem
();
BeanUtil
.
copyProperties
(
productScrapApplyVo
,
productScrapApplyItem
);
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
if
(
StringUtil
.
isNotBlank
(
productScrapApplyVo
.
getZdat
())){
try
{
Date
parse
=
dateFormat
.
parse
(
productScrapApplyVo
.
getZdat
());
productScrapApplyItem
.
setZdat
(
parse
);
}
catch
(
ParseException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
productScrapApplyItems
.
add
(
productScrapApplyItem
);
}
productScrapApplyId
=
mannualStartWorkApplication
.
startWorkflow
(
productScrapApply
,
PROCESS_DEFINITION_KEY
,
"productScrapApply"
);
// else{
// for (SapPurchaseApproval purchaseApproval : purchaseApprovalList) {
// //将存在的作废掉 05.11 lxh
//
// //终止状态不管
// //审批完成的,SAP撤审触发,终止审批完成的,并发起新的流程
// if (purchaseApproval.getStatusId() == BizBillStatus.COMPLETED.getId()){
// purchaseApproval.setStatusId(BizBillStatus.ABORTED.getId());
// purchaseApprovalId=mannualStartWorkApplication.startWorkflow(sapPurchaseApproval,PROCESS_DEFINITION_KEY,"sapPurchaseApproval");
// }
//
// //在审批中,更新明细数据的(先删除,再新增)
// if (purchaseApproval.getStatusId() == BizBillStatus.APPROVING.getId() || purchaseApproval.getStatusId() == BizBillStatus.APPLYING.getId()){
// List<SapPurchaseApprovalItem> itemList = sapPurchaseApprovalItemApplication.querySapPurchaseApprovalItems(purchaseApproval.getId());
// List<String> collect = itemList.stream().map(SapPurchaseApprovalItem::getId).collect(Collectors.toList());
// sapPurchaseApprovalItemApplication.deleteByIds(collect);
// purchaseApprovalId = purchaseApproval.getId();
// }
// this.sapPurchaseApprovalRepository.save(purchaseApproval);
// }
// }
productScrapApplyItemApplication
.
saveProductScrapApplyItems
(
productScrapApplyId
,
productScrapApplyItems
);
productScrapApply
=
productScrapApplyRepository
.
findOne
(
productScrapApplyId
);
return
productScrapApply
.
getBillCode
();
}
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/application/impl/ProductScrapApplyItemApplicationImpl.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
application
.
impl
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.sap.productScrapApply.application.ProductScrapApplyItemApplication
;
import
com.huigou.topsun.sap.productScrapApply.domain.ProductScrapApplyItem
;
import
com.huigou.topsun.sap.productScrapApply.domain.query.ProductScrapApplyQueryRequest
;
import
com.huigou.topsun.sap.productScrapApply.repository.ProductScrapApplyItemRepository
;
import
com.huigou.uasp.bmp.common.application.BaseApplication
;
import
com.huigou.util.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/15:40
* @Description:
*/
@Service
(
"productScrapApplyItemApplication"
)
public
class
ProductScrapApplyItemApplicationImpl
extends
BaseApplication
implements
ProductScrapApplyItemApplication
{
@Autowired
private
ProductScrapApplyItemRepository
productScrapApplyItemRepository
;
@Override
public
void
saveProductScrapApplyItems
(
String
productScrapApplyId
,
List
<
ProductScrapApplyItem
>
productScrapApplyItems
)
{
for
(
ProductScrapApplyItem
productScrapApplyItem
:
productScrapApplyItems
)
{
productScrapApplyItem
.
setProductScrapApplyId
(
productScrapApplyId
);
}
productScrapApplyItemRepository
.
save
(
productScrapApplyItems
);
}
@Override
public
void
deleteByIds
(
List
<
String
>
ids
)
{
List
<
ProductScrapApplyItem
>
itemList
=
productScrapApplyItemRepository
.
findAll
(
ids
);
productScrapApplyItemRepository
.
delete
(
itemList
);
}
@Override
public
Map
<
String
,
Object
>
queryProductScrapApplyItems
(
ProductScrapApplyQueryRequest
queryRequest
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
StringUtil
.
isNotBlank
(
queryRequest
.
getProductScrapApplyId
())){
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"productScrapApplyItems"
);
QueryModel
queryModel
=
this
.
sqlExecutorDao
.
getQueryModel
(
queryDescriptor
,
queryRequest
);
map
=
this
.
sqlExecutorDao
.
executeSlicedQuery
(
queryModel
);
}
return
map
;
}
@Override
public
List
<
ProductScrapApplyItem
>
queryProductScrapApplyItems
(
String
productScrapApplyId
)
{
return
productScrapApplyItemRepository
.
findByProductScrapApplyId
(
productScrapApplyId
);
}
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/controller/ProductScrapApplyController.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
controller
;
import
com.huigou.context.Operator
;
import
com.huigou.context.OrgUnit
;
import
com.huigou.topsun.common.BillStatus
;
import
com.huigou.topsun.sap.productScrapApply.application.ProductScrapApplyApplication
;
import
com.huigou.topsun.sap.productScrapApply.application.ProductScrapApplyItemApplication
;
import
com.huigou.topsun.sap.productScrapApply.domain.ProductScrapApply
;
import
com.huigou.topsun.sap.productScrapApply.domain.query.ProductScrapApplyQueryRequest
;
import
com.huigou.topsun.sap.productScrapApply.vo.ProductScrapApplyVo
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.annotation.SkipAuth
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.util.JSONUtil
;
import
com.huigou.util.SDO
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/14:47
* @Description:
*/
@Controller
@ControllerMapping
(
"/productScrapApply"
)
public
class
ProductScrapApplyController
extends
CommonController
{
private
final
static
Logger
LOG
=
LoggerFactory
.
getLogger
(
ProductScrapApplyController
.
class
);
@Autowired
private
ProductScrapApplyApplication
productScrapApplyApplication
;
@Autowired
private
ProductScrapApplyItemApplication
productScrapApplyItemApplication
;
@Override
protected
String
getPagePath
()
{
return
"/biz/topsun/sap/productScrapApply/"
;
}
@SkipAuth
@RequestMapping
(
value
=
"/getProductScrapApply"
)
@ResponseBody
public
HashMap
<
String
,
Object
>
getProductScrapApply
(
@RequestBody
List
<
ProductScrapApplyVo
>
productScrapApplyVoListVo
){
//SDO sdo = this.getSDO();
HashMap
<
String
,
Object
>
messageMap
=
new
HashMap
<>();
messageMap
.
put
(
"Message_Status"
,
"S"
);
messageMap
.
put
(
"Message_Text"
,
"成功"
);
LOG
.
info
(
"物品报废申请与过账平台数据=={}"
,
JSONUtil
.
toString
(
productScrapApplyVoListVo
));
String
billCode
=
""
;
try
{
billCode
=
this
.
productScrapApplyApplication
.
saveProductScrapApplyVo
(
productScrapApplyVoListVo
);
messageMap
.
put
(
"ZBPMID"
,
billCode
);
}
catch
(
RuntimeException
e
){
messageMap
.
put
(
"Message_Status"
,
"E"
);
messageMap
.
put
(
"Message_Text"
,
e
.
getMessage
());
messageMap
.
put
(
"ZBPMID"
,
billCode
);
}
return
messageMap
;
}
public
String
forwardProductScrapApplyList
(){
this
.
putAttribute
(
"statusKindsList"
,
BillStatus
.
getValidMap
());
return
forward
(
"productScrapApplyList"
);
}
public
String
slicedProductScrapApplyList
(){
SDO
sdo
=
this
.
getSDO
();
ProductScrapApplyQueryRequest
queryRequest
=
sdo
.
toQueryRequest
(
ProductScrapApplyQueryRequest
.
class
);
Map
<
String
,
Object
>
map
=
productScrapApplyApplication
.
slicedProductScrapApplyList
(
queryRequest
);
return
toResult
(
map
);
}
public
String
forwardProductScrapApplyDetail
(){
this
.
putAttribute
(
"processDefinitionKey"
,
ProductScrapApplyApplication
.
PROCESS_DEFINITION_KEY
);
// 新增的时候procUnitId一定要设置成Apply,不然jsp页面的所有表单元素是readonly状态
this
.
putAttribute
(
"procUnitId"
,
"Apply"
);
ProductScrapApply
sapPurchase
=
new
ProductScrapApply
();
sapPurchase
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
/**
* 设置jsp页面初始化填充数据,如果不设置, 那么在jsp页面上填写完表单之后立即提交申请TaskDescription获取不到时间和相关人员信息
*/
Operator
operator
=
getOperator
();
sapPurchase
.
setDefaultValues
(
new
OrgUnit
(
operator
.
getFullId
(),
operator
.
getFullName
()));
return
forward
(
"productScrapApplyDetail"
,
sapPurchase
);
}
public
String
showProductScrapApplyDetail
(){
SDO
sdo
=
this
.
getSDO
();
String
id
=
sdo
.
getBizId
();
ProductScrapApply
productScrapApply
=
productScrapApplyApplication
.
loadProductScrapApply
(
id
);
return
forward
(
"productScrapApplyDetail"
,
productScrapApply
);
}
public
String
queryProductScrapApplyItems
(){
SDO
sdo
=
this
.
getSDO
();
ProductScrapApplyQueryRequest
queryRequest
=
sdo
.
toQueryRequest
(
ProductScrapApplyQueryRequest
.
class
);
Map
<
String
,
Object
>
map
=
productScrapApplyItemApplication
.
queryProductScrapApplyItems
(
queryRequest
);
return
toResult
(
map
);
}
public
String
deleteProductScrapApplyItem
(){
SDO
sdo
=
this
.
getSDO
();
List
<
String
>
ids
=
sdo
.
getIds
();
productScrapApplyItemApplication
.
deleteByIds
(
ids
);
return
success
();
}
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/domain/ProductScrapApply.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
domain
;
import
com.huigou.data.domain.model.FlowBillAbstractEntity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/14:47
* @Description: 物品报废申请与过账平台VO类
*/
@Data
@Table
(
name
=
"sap_product_scrap_apply"
)
@Entity
public
class
ProductScrapApply
extends
FlowBillAbstractEntity
{
@Column
(
name
=
"type"
)
private
String
type
;
@Column
(
name
=
"message"
)
private
String
message
;
@Override
protected
String
getCodeRuleId
()
{
return
"productScrapApply"
;
}
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/domain/ProductScrapApplyItem.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
domain
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.huigou.data.domain.model.AbstractEntity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
java.util.Date
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/14:47
* @Description: 物品报废申请与过账平台
*/
@Data
@Table
(
name
=
"sap_product_scrap_apply_item"
)
@Entity
public
class
ProductScrapApplyItem
extends
AbstractEntity
{
@Column
(
name
=
"product_scrap_apply_id"
)
private
String
productScrapApplyId
;
/**
* 报废申请号
*/
@Column
(
name
=
"ZSANUM"
)
private
String
zsanum
;
/**
* 项目
*/
@Column
(
name
=
"ZSAPOS"
)
private
String
zsapos
;
/**
* 物料
*/
@Column
(
name
=
"MATNR"
)
private
String
matnr
;
/**
* 数量
*/
@Column
(
name
=
"ERFMG"
)
private
String
erfmg
;
/**
* 单位
*/
@Column
(
name
=
"ERFME"
)
private
String
erfme
;
/**
* 工厂
*/
@Column
(
name
=
"WERKS"
)
private
String
werks
;
/**
* 存储地点
*/
@Column
(
name
=
"LGORT"
)
private
String
lgort
;
/**
* 成本中心
*/
@Column
(
name
=
"KOSTL"
)
private
String
kostl
;
/**
* 批次
*/
@Column
(
name
=
"CHARG"
)
private
String
charg
;
/**
* 序列号/PL号
*/
@Column
(
name
=
"SERNR"
)
private
String
sernr
;
/**
* 文本
*/
@Column
(
name
=
"ZTXT"
)
private
String
ztxt
;
/**
* 申请日期
*/
@Column
(
name
=
"ZDAT"
)
private
Date
zdat
;
/**
* 申请人
*/
@Column
(
name
=
"ZUSER1"
)
private
String
zuser1
;
/**
* 工厂
*/
@Column
(
name
=
"WERKS_NAME"
)
private
String
werksName
;
/**
* 存储地点
*/
@Column
(
name
=
"LGORT_NAME"
)
private
String
lgortName
;
/**
* 成本中心
*/
@Column
(
name
=
"KOSTL_NAME"
)
private
String
kostlName
;
/**
* 单位
*/
// @Column(name = "ERFME_NAME")
// private String erfmeName;
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/domain/query/ProductScrapApplyQueryRequest.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
domain
.
query
;
import
com.huigou.data.domain.query.QueryAbstractRequest
;
import
lombok.Data
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/14:47
* @Description: 物品报废申请与过账平台
*/
@Data
public
class
ProductScrapApplyQueryRequest
extends
QueryAbstractRequest
{
private
String
productScrapApplyId
;
/**
* 项目
*/
private
String
zsapos
;
/**
* 物料
*/
private
String
matnr
;
/**
* 数量
*/
private
String
erfmg
;
/**
* 单位
*/
private
String
erfme
;
/**
* 工厂
*/
private
String
werks
;
/**
* 存储地点
*/
private
String
lgort
;
/**
* 成本中心
*/
private
String
kostl
;
/**
* 批次
*/
private
String
charg
;
/**
* 序列号/PL号
*/
private
String
sernr
;
/**
* 文本
*/
private
String
ztxt
;
/**
* 报废申请号
*/
private
String
zsanum
;
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/repository/ProductScrapApplyItemRepository.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
repository
;
import
com.huigou.topsun.sap.productScrapApply.domain.ProductScrapApplyItem
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.List
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/15:14
* @Description:
*/
public
interface
ProductScrapApplyItemRepository
extends
JpaRepository
<
ProductScrapApplyItem
,
String
>
{
List
<
ProductScrapApplyItem
>
findByProductScrapApplyId
(
String
productScrapApplyId
);
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/repository/ProductScrapApplyRepository.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
repository
;
import
com.huigou.topsun.sap.productScrapApply.domain.ProductScrapApply
;
import
org.springframework.data.jpa.repository.JpaRepository
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/15:14
* @Description:
*/
public
interface
ProductScrapApplyRepository
extends
JpaRepository
<
ProductScrapApply
,
String
>
{
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/vo/ProductScrapApplyBackVo.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
vo
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Auther: xin.lu
* @Date: 2024/07/10/11:31
* @Description:
*/
@Data
public
class
ProductScrapApplyBackVo
implements
Serializable
{
/**
* 报废申请号
*/
@JsonProperty
(
"ZSANUM"
)
private
String
zsanum
;
/**
* BPM单号
*/
@JsonProperty
(
"ZBPMID"
)
private
String
billCode
;
/**
* 状态
* 程序赋值,创建时为1(未审批),其余值为2(拒绝)3(通过)4(已报废过账)
*/
@JsonProperty
(
"ZSTATUS"
)
private
String
zstatus
;
}
topsun/src/main/java/com/huigou/topsun/sap/productScrapApply/vo/ProductScrapApplyVo.java
0 → 100644
View file @
209c01ca
package
com
.
huigou
.
topsun
.
sap
.
productScrapApply
.
vo
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Auther: xin.lu
* @Date: 2024/07/09/14:47
* @Description: 物品报废申请与过账平台VO类
*/
@Data
public
class
ProductScrapApplyVo
implements
Serializable
{
/**
* 报废申请号
*/
@JsonProperty
(
"ZSANUM"
)
private
String
zsanum
;
/**
* 项目
*/
@JsonProperty
(
"ZSAPOS"
)
private
String
zsapos
;
/**
* 物料
*/
@JsonProperty
(
"MATNR"
)
private
String
matnr
;
/**
* 数量
*/
@JsonProperty
(
"ERFMG"
)
private
String
erfmg
;
/**
* 单位
*/
@JsonProperty
(
"ERFME"
)
private
String
erfme
;
/**
* 单位
*/
//@JsonProperty("ERFME_NAME")
//private String erfmeName;
/**
* 工厂
*/
@JsonProperty
(
"WERKS"
)
private
String
werks
;
/**
* 工厂
*/
@JsonProperty
(
"WERKS_NAME"
)
private
String
werksName
;
/**
* 存储地点
*/
@JsonProperty
(
"LGORT"
)
private
String
lgort
;
/**
* 存储地点
*/
@JsonProperty
(
"LGORT_NAME"
)
private
String
lgortName
;
/**
* 成本中心
*/
@JsonProperty
(
"KOSTL"
)
private
String
kostl
;
/**
* 成本中心
*/
@JsonProperty
(
"KOSTL_NAME"
)
private
String
kostlName
;
/**
* 批次
*/
@JsonProperty
(
"CHARG"
)
private
String
charg
;
/**
* 序列号/PL号
*/
@JsonProperty
(
"SERNR"
)
private
String
sernr
;
/**
* 文本
*/
@JsonProperty
(
"ZTXT"
)
private
String
ztxt
;
/**
* 申请日期
*/
@JsonProperty
(
"ZDAT"
)
private
String
zdat
;
/**
* 申请人
*/
@JsonProperty
(
"ZUSER1"
)
private
String
zuser1
;
}
topsun/src/main/resources/config/bpm/topsun/sap/productScrapApply/sapProductScrapApplyProc.bpmn
0 → 100644
View file @
209c01ca
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
typeLanguage=
"http://www.w3.org/2001/XMLSchema"
expressionLanguage=
"http://www.w3.org/1999/XPath"
targetNamespace=
"http://www.activiti.org/test"
>
<process
id=
"sapProductScrapApplyProc"
name=
"物品报废申请与过账平台"
isExecutable=
"true"
>
<extensionElements>
<activiti:executionListener
event=
"start"
delegateExpression=
"#{productScrapApplyApplication}"
></activiti:executionListener>
<activiti:executionListener
event=
"end"
delegateExpression=
"#{productScrapApplyApplication}"
></activiti:executionListener>
</extensionElements>
<startEvent
id=
"startevent1"
name=
"Start"
></startEvent>
<endEvent
id=
"endevent1"
name=
"End"
></endEvent>
<userTask
id=
"Apply"
name=
"物品报废与过账平台申请"
activiti:formKey=
"productScrapApply/showProductScrapApplyDetail.job"
>
<extensionElements>
<activiti:taskListener
event=
"all"
delegateExpression=
"#{productScrapApplyApplication}"
></activiti:taskListener>
<activiti:taskListener
event=
"saveBizData"
delegateExpression=
"#{productScrapApplyApplication}"
></activiti:taskListener>
</extensionElements>
</userTask>
<userTask
id=
"Approve"
name=
"物品报废与过账平台审批"
activiti:assignee=
"${assignee} "
activiti:formKey=
"productScrapApply/showProductScrapApplyDetail.job"
>
<extensionElements>
<activiti:taskListener
event=
"all"
delegateExpression=
"#{productScrapApplyApplication}"
></activiti:taskListener>
<activiti:taskListener
event=
"saveBizData"
delegateExpression=
"#{productScrapApplyApplication}"
></activiti:taskListener>
</extensionElements>
<multiInstanceLoopCharacteristics
isSequential=
"false"
activiti:collection=
"handlerList"
activiti:elementVariable=
"assignee"
>
<completionCondition>
${chiefApprovePassed}
</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow
id=
"flow1"
sourceRef=
"startevent1"
targetRef=
"Apply"
></sequenceFlow>
<sequenceFlow
id=
"flow2"
sourceRef=
"Apply"
targetRef=
"Approve"
></sequenceFlow>
<exclusiveGateway
id=
"ApproveFinished"
name=
"审批结束"
></exclusiveGateway>
<sequenceFlow
id=
"flow3"
name=
"审批通过"
sourceRef=
"ApprovePassed"
targetRef=
"ApproveFinished"
>
<conditionExpression
xsi:type=
"tFormalExpression"
>
<![CDATA[${approvePassed}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow
id=
"flow4"
name=
"审批结束"
sourceRef=
"ApproveFinished"
targetRef=
"endevent1"
>
<conditionExpression
xsi:type=
"tFormalExpression"
>
<![CDATA[${approveFinished}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow
id=
"flow5"
name=
"审批未结束"
sourceRef=
"ApproveFinished"
targetRef=
"Approve"
>
<conditionExpression
xsi:type=
"tFormalExpression"
>
<![CDATA[${!approveFinished}]]>
</conditionExpression>
</sequenceFlow>
<exclusiveGateway
id=
"ApprovePassed"
name=
"审批通过"
></exclusiveGateway>
<sequenceFlow
id=
"flow6"
sourceRef=
"Approve"
targetRef=
"ApprovePassed"
></sequenceFlow>
<sequenceFlow
id=
"flow9"
name=
"审批未通过"
sourceRef=
"ApprovePassed"
targetRef=
"Apply"
>
<conditionExpression
xsi:type=
"tFormalExpression"
>
<![CDATA[${!approvePassed}]]>
</conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram
id=
"BPMNDiagram_sapProductScrapApplyProc"
>
<bpmndi:BPMNPlane
bpmnElement=
"sapProductScrapApplyProc"
id=
"BPMNPlane_sapProductScrapApplyProc"
>
<bpmndi:BPMNShape
bpmnElement=
"startevent1"
id=
"BPMNShape_startevent1"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"355.0"
y=
"50.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"endevent1"
id=
"BPMNShape_endevent1"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"355.0"
y=
"550.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"Apply"
id=
"BPMNShape_Apply"
>
<omgdc:Bounds
height=
"55.0"
width=
"161.0"
x=
"292.0"
y=
"140.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"Approve"
id=
"BPMNShape_Approve"
>
<omgdc:Bounds
height=
"55.0"
width=
"161.0"
x=
"292.0"
y=
"240.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"ApproveFinished"
id=
"BPMNShape_ApproveFinished"
>
<omgdc:Bounds
height=
"40.0"
width=
"40.0"
x=
"352.0"
y=
"440.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"ApprovePassed"
id=
"BPMNShape_ApprovePassed"
>
<omgdc:Bounds
height=
"40.0"
width=
"40.0"
x=
"352.0"
y=
"349.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge
bpmnElement=
"flow1"
id=
"BPMNEdge_flow1"
>
<omgdi:waypoint
x=
"372.0"
y=
"85.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"372.0"
y=
"140.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow2"
id=
"BPMNEdge_flow2"
>
<omgdi:waypoint
x=
"372.0"
y=
"195.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"372.0"
y=
"240.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow3"
id=
"BPMNEdge_flow3"
>
<omgdi:waypoint
x=
"372.0"
y=
"389.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"372.0"
y=
"440.0"
></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds
height=
"14.0"
width=
"48.0"
x=
"320.0"
y=
"396.0"
></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow4"
id=
"BPMNEdge_flow4"
>
<omgdi:waypoint
x=
"372.0"
y=
"480.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"372.0"
y=
"550.0"
></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds
height=
"14.0"
width=
"48.0"
x=
"382.0"
y=
"489.0"
></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow5"
id=
"BPMNEdge_flow5"
>
<omgdi:waypoint
x=
"392.0"
y=
"460.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"519.0"
y=
"459.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"519.0"
y=
"317.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"519.0"
y=
"267.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"489.0"
y=
"267.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"453.0"
y=
"267.0"
></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds
height=
"14.0"
width=
"60.0"
x=
"459.0"
y=
"411.0"
></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow6"
id=
"BPMNEdge_flow6"
>
<omgdi:waypoint
x=
"372.0"
y=
"295.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"372.0"
y=
"349.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow9"
id=
"BPMNEdge_flow9"
>
<omgdi:waypoint
x=
"352.0"
y=
"369.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"231.0"
y=
"369.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"231.0"
y=
"167.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"292.0"
y=
"167.0"
></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds
height=
"14.0"
width=
"60.0"
x=
"257.0"
y=
"376.0"
></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
topsun/src/main/resources/config/topsun/sap/productScrapApply/sapProductScrapApply.xml
0 → 100644
View file @
209c01ca
<?xml version="1.0" encoding="UTF-8" ?>
<query-mappings>
<query
name=
"productScrapApplyList"
label=
"物品报废申请与过账平台"
table=
"sap_product_scrap_apply_item"
>
<sql-query>
SELECT t.*, p.bill_code, p.person_member_name, p.dept_name, p.fillin_date, p.status, p.type, p.message
FROM sap_product_scrap_apply_item t
LEFT JOIN sap_product_scrap_apply p ON p.id = t.product_scrap_apply_id
WHERE 1 =1
</sql-query>
<condition
column=
"bill_code"
name=
"billCode"
type=
"java.lang.String"
symbol=
"like"
alias=
"p"
/>
<condition
column=
"status"
name=
"statusKind"
type=
"java.lang.Integer"
symbol=
"in"
alias=
"p"
/>
<condition
column=
"fillin_date"
name=
"fillinBeginDate"
type=
"java.util.Date"
symbol=
">="
alias=
"p"
/>
<condition
column=
"fillin_date"
name=
"fillinEndDate"
type=
"java.util.Date"
symbol=
"<="
alias=
"p"
/>
<condition
column=
"product_scrap_apply_id"
name=
"productScrapApplyId"
type=
"java.lang.String"
symbol=
"="
alias=
"t"
/>
</query>
<query
name=
"productScrapApplyItems"
>
<sql-query>
SELECT t.* FROM sap_product_scrap_apply_item t WHERE 1 =1
</sql-query>
<condition
column=
"product_scrap_apply_id"
name=
"productScrapApplyId"
type=
"java.lang.String"
symbol=
"="
alias=
"t"
/>
</query>
</query-mappings>
\ No newline at end of file
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