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
4955405a
Commit
4955405a
authored
Jun 14, 2024
by
鲁鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成本中心导入优化
parent
4675c708
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
280 additions
and
40 deletions
+280
-40
sapCostCenterDetail.js
...n/webapp/biz/topsun/sap/costCenter/sapCostCenterDetail.js
+9
-0
sapCostCenterDetail.jsp
.../webapp/biz/topsun/sap/costCenter/sapCostCenterDetail.jsp
+1
-0
sapCostCenterHisDetail.js
...ebapp/biz/topsun/sap/costCenter/sapCostCenterHisDetail.js
+23
-0
sapCostCenterHisDetail.jsp
...bapp/biz/topsun/sap/costCenter/sapCostCenterHisDetail.jsp
+54
-0
sapCostCenterList.js
...ain/webapp/biz/topsun/sap/costCenter/sapCostCenterList.js
+55
-17
CostCenterApplicationImpl.java
...ostCenter/application/impl/CostCenterApplicationImpl.java
+2
-0
CostCenterDataExcelImport.java
...ostCenter/application/impl/CostCenterDataExcelImport.java
+102
-23
CostCenterController.java
...opsun/sap/costCenter/controller/CostCenterController.java
+8
-0
CostCenter.java
...a/com/huigou/topsun/sap/costCenter/domain/CostCenter.java
+6
-0
TmpCostCenterData.java
...uigou/topsun/sap/costCenter/domain/TmpCostCenterData.java
+12
-0
CostCenterVo.java
.../huigou/topsun/sap/costCenter/domain/vo/CostCenterVo.java
+6
-0
SuppliersDataApplicationImpl.java
...pliers/application/impl/SuppliersDataApplicationImpl.java
+2
-0
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/costCenter/sapCostCenterDetail.js
View file @
4955405a
...
@@ -79,4 +79,13 @@ function getId() {
...
@@ -79,4 +79,13 @@ function getId() {
return
$
(
"#id"
).
val
();
return
$
(
"#id"
).
val
();
}
}
function
checkConstraints
(){
var
kostl
=
$
(
"#kostl"
).
val
();
if
(
kostl
.
length
!=
10
){
Public
.
tip
(
"成本中心编码只能是10位数,请检查"
)
return
false
;
}
return
true
;
}
topsun-xt/src/main/webapp/biz/topsun/sap/costCenter/sapCostCenterDetail.jsp
View file @
4955405a
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
<x:hidden
name=
"statusId"
/>
<x:hidden
name=
"statusId"
/>
<x:hidden
name=
"isEnable"
/>
<x:hidden
name=
"isEnable"
/>
<x:hidden
name=
"isDelete"
/>
<x:hidden
name=
"isDelete"
/>
<x:hidden
name=
"isCostCenterHis"
/>
<div
class=
"hg-form-row"
>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"kostl"
required=
"true"
label=
"成本中心编码"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"kostl"
required=
"true"
label=
"成本中心编码"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"ktext"
required=
"true"
label=
"名称"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"ktext"
required=
"true"
label=
"名称"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/costCenter/sapCostCenterHisDetail.js
0 → 100644
View file @
4955405a
$
(
document
).
ready
(
function
(){
bindEvent
();
})
function
bindEvent
(){
$
(
'#khinr'
).
treebox
({
name
:
'sapOrgDpt'
,
searchName
:
'sapOrgDpt'
,
searchType
:
'bsn'
,
hasSearch
:
true
,
minWidth
:
500
,
param
:{
treeViewMappingType
:
"bsn"
,
parentId
:
'ogn'
},
back
:{
//text:$('#queryDataManageName')
},
onChange
:
function
(
node
,
data
){
$
(
'#khinr'
).
val
(
data
.
id
);
}
});
}
\ No newline at end of file
topsun-xt/src/main/webapp/biz/topsun/sap/costCenter/sapCostCenterHisDetail.jsp
0 → 100644
View file @
4955405a
<%--
Created by IntelliJ IDEA.
User: zht
Date: 2023/12/13
Time: 16:39
--%>
<%@ 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,date"
/>
<x:script
src=
'/biz/topsun/sap/costCenter/sapCostCenterDetail.js'
/>
</head>
<body>
<div
class=
"container-fluid"
>
<x:billTitle
title=
"成本中心"
needStatus=
"false"
needPerson=
"true"
/>
<div
class=
"blank_div clearfix"
></div>
<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"
type=
"datetime"
/>
<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"
/>
<x:hidden
name=
"isEnable"
/>
<x:hidden
name=
"isDelete"
/>
<x:hidden
name=
"isCostCenterHis"
/>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"kostl"
required=
"true"
readonly=
"true"
label=
"成本中心编码"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"ktext"
required=
"true"
label=
"名称"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"ltext"
required=
"false"
label=
"描述"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:selectC
name=
"kosar"
required=
"true"
label=
"成本中心类型"
labelCol=
"2"
dictionary=
"KOSAR"
fieldCol=
"4"
/>
<x:inputC
name=
"datbi"
required=
"true"
label=
"有限期自"
labelCol=
"2"
wrapper=
"date"
fieldCol=
"4"
/>
<x:inputC
name=
"datab"
required=
"true"
label=
"有限截止日"
labelCol=
"2"
wrapper=
"date"
fieldCol=
"4"
/>
<x:inputC
name=
"verak"
required=
"true"
label=
"负责人"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"khinr"
required=
"true"
label=
"层次结构范围"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
wrapper=
"select"
/>
<x:selectC
name=
"prctr"
required=
"true"
label=
"利润中心"
labelCol=
"2"
dictionary=
"PRCTR"
fieldCol=
"4"
/>
<x:inputC
name=
"telePhone"
required=
"false"
label=
"联系方式"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"reason"
required=
"false"
label=
"原因"
labelCol=
"2"
maxLength=
"255"
fieldCol=
"4"
/>
</div>
<div
class=
"blank_div clearfix"
></div>
</form>
</div>
</body>
</html>
topsun-xt/src/main/webapp/biz/topsun/sap/costCenter/sapCostCenterList.js
View file @
4955405a
var
gridManager
=
null
;
var
gridManager
=
null
,
refreshFlag
=
null
;
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
initializateUI
();
initializateUI
();
...
@@ -16,10 +16,10 @@ function loadCostCenterListGrid() {
...
@@ -16,10 +16,10 @@ function loadCostCenterListGrid() {
addHandler
();
addHandler
();
},
},
impExcelDataHandler
:{
id
:
'impExcelData'
,
img
:
'fa-table'
,
text
:
'导入数据'
,
click
:
impExcelDataHandler
},
impExcelDataHandler
:{
id
:
'impExcelData'
,
img
:
'fa-table'
,
text
:
'导入数据'
,
click
:
impExcelDataHandler
},
//
updateHandler: function () {
updateHandler
:
function
()
{
//
updateHandler();
updateHandler
();
//
},
},
//
deleteHandler: deleteHandler,
deleteHandler
:
deleteHandler
,
// disableHandler: disableHandler,
// disableHandler: disableHandler,
frozenHandler
:
{
frozenHandler
:
{
id
:
'frozenHandler'
,
text
:
'冻结'
,
img
:
'fa-clipboard'
,
click
:
function
()
{
id
:
'frozenHandler'
,
text
:
'冻结'
,
img
:
'fa-clipboard'
,
click
:
function
()
{
...
@@ -53,23 +53,26 @@ function loadCostCenterListGrid() {
...
@@ -53,23 +53,26 @@ function loadCostCenterListGrid() {
{
display
:
"申请人"
,
name
:
"personMemberName"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"申请人"
,
name
:
"personMemberName"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"申请部门"
,
name
:
"deptName"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"申请部门"
,
name
:
"deptName"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"联系方式"
,
name
:
"telePhone"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"联系方式"
,
name
:
"telePhone"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"申请日期"
,
name
:
"fillinDate"
,
width
:
140
,
minWidth
:
60
,
type
:
"
string
"
,
align
:
"left"
},
{
display
:
"申请日期"
,
name
:
"fillinDate"
,
width
:
140
,
minWidth
:
60
,
type
:
"
date
"
,
align
:
"left"
},
{
display
:
"原因"
,
name
:
"reason"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"原因"
,
name
:
"reason"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
{
display
:
"状态"
,
name
:
"
isEnable
"
,
width
:
60
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
display
:
"状态"
,
name
:
"
statusTextView
"
,
width
:
60
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
render
:
function
(
item
)
{
//
render: function (item) {
return
UICtrl
.
getStatusInfo
(
item
.
isEnable
);
//
return UICtrl.getStatusInfo(item.isEnable);
}
//
}
},
},
{
display
:
"消息类型"
,
name
:
"typeTextView"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"消息类型"
,
name
:
"typeTextView"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
//{display: "消息编号", name: "number", width: 140, minWidth: 60, type: "string", align: "left"},
//{display: "消息编号", name: "number", width: 140, minWidth: 60, type: "string", align: "left"},
{
display
:
"消息文本"
,
name
:
"message"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"消息文本"
,
name
:
"message"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"是否历史数据"
,
name
:
"isCostCenterHisTextView"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
//{display: "应用程序日志", name: "logNo", width: 140, minWidth: 60, type: "string", align: "left"},
//{display: "应用程序日志", name: "logNo", width: 140, minWidth: 60, type: "string", align: "left"},
],
],
dataAction
:
"server"
,
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/sapCostCenter/slicedCostCenterList.ajax'
,
url
:
web_app
.
name
+
'/sapCostCenter/slicedCostCenterList.ajax'
,
pageSize
:
20
,
pageSize
:
20
,
usePager
:
true
,
usePager
:
true
,
sortName
:
'fillinDate'
,
sortOrder
:
'desc'
,
toolbar
:
toolbarOptions
,
toolbar
:
toolbarOptions
,
width
:
"100%"
,
width
:
"100%"
,
height
:
"100%"
,
height
:
"100%"
,
...
@@ -79,7 +82,7 @@ function loadCostCenterListGrid() {
...
@@ -79,7 +82,7 @@ function loadCostCenterListGrid() {
selectRowButtonOnly
:
true
,
selectRowButtonOnly
:
true
,
// 双击执行
// 双击执行
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
update
Handler
(
data
);
view
Handler
(
data
);
}
}
});
});
UICtrl
.
setSearchAreaToggle
(
gridManager
);
UICtrl
.
setSearchAreaToggle
(
gridManager
);
...
@@ -108,11 +111,19 @@ function addHandler() {
...
@@ -108,11 +111,19 @@ function addHandler() {
//从EXCEL导入数据
//从EXCEL导入数据
function
impExcelDataHandler
(){
function
impExcelDataHandler
(){
ExcelImpManager
.
showImpDialog
(
'导入'
,
'sapCostCenterData'
,
'100'
,
function
(){
ExcelImpManager
.
showImpDialog
(
'导入'
,
'sapCostCenterData'
,
new
Date
().
getTime
()
,
function
(){
reloadGrid
();
reloadGrid
();
});
});
}
}
function
viewHandler
(
data
){
UICtrl
.
addTabItem
({
tabid
:
data
.
id
,
text
:
"查看成本中心"
,
url
:
web_app
.
name
+
'/sapCostCenter/showCostCenter.job?isReadOnly=true&bizId='
+
data
.
id
})
}
function
updateHandler
(
row
)
{
function
updateHandler
(
row
)
{
if
(
!
row
)
{
if
(
!
row
)
{
row
=
DataUtil
.
getUpdateRow
(
gridManager
);
row
=
DataUtil
.
getUpdateRow
(
gridManager
);
...
@@ -120,15 +131,42 @@ function updateHandler(row) {
...
@@ -120,15 +131,42 @@ function updateHandler(row) {
return
;
return
;
}
}
}
}
UICtrl
.
addTabItem
({
if
(
row
.
isCostCenterHis
!=
1
){
tabid
:
'CostCenterDetail'
,
Public
.
tip
(
"只能修改历史数据"
)
text
:
"查看成本中心"
,
return
false
;
url
:
web_app
.
name
+
'/sapCostCenter/showCostCenterDetail.job?isReadOnly=true&id='
+
row
.
id
}
})
UICtrl
.
showAjaxDialog
({
url
:
web_app
.
name
+
'/sapCostCenter/showLoadCostCenterHis.load'
,
param
:{
id
:
row
.
id
},
title
:
"编辑功能"
,
width
:
800
,
ok
:
function
doSaveNodeFunction
(
div
){
var
_self
=
this
;
$
(
'#submitForm'
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/sapCostCenter/saveCostCenter.ajax'
,
success
:
function
()
{
refreshFlag
=
true
;
_self
.
close
();
reloadGrid
();
}
});
},
//关闭对话框
close
:
function
dialogClose
(){
if
(
refreshFlag
){
refreshFlag
=
false
;
}
},
});
}
}
//删除按钮
//删除按钮
function
deleteHandler
()
{
function
deleteHandler
()
{
let
row
=
DataUtil
.
getSelectedRow
(
gridManager
);
if
(
row
.
isCostCenterHis
!=
1
){
Public
.
tip
(
"只能删除历史数据"
)
return
false
;
}
DataUtil
.
del
({
DataUtil
.
del
({
action
:
'sapCostCenter/deleteCostCenterById.ajax'
,
action
:
'sapCostCenter/deleteCostCenterById.ajax'
,
gridManager
:
gridManager
,
idFieldName
:
'id'
,
gridManager
:
gridManager
,
idFieldName
:
'id'
,
...
...
topsun/src/main/java/com/huigou/topsun/sap/costCenter/application/impl/CostCenterApplicationImpl.java
View file @
4955405a
...
@@ -59,6 +59,8 @@ public class CostCenterApplicationImpl extends FlowBroker implements CostCenterA
...
@@ -59,6 +59,8 @@ public class CostCenterApplicationImpl extends FlowBroker implements CostCenterA
queryModel
.
putDictionary
(
"kosar"
,
DictUtil
.
getDictionary
(
"KOSAR"
));
queryModel
.
putDictionary
(
"kosar"
,
DictUtil
.
getDictionary
(
"KOSAR"
));
queryModel
.
putDictionary
(
"prctr"
,
DictUtil
.
getDictionary
(
"PRCTR"
));
queryModel
.
putDictionary
(
"prctr"
,
DictUtil
.
getDictionary
(
"PRCTR"
));
queryModel
.
putDictionary
(
"TYPE"
,
DictUtil
.
getDictionary
(
"TYPE"
));
queryModel
.
putDictionary
(
"TYPE"
,
DictUtil
.
getDictionary
(
"TYPE"
));
queryModel
.
putDictionary
(
"isCostCenterHis"
,
DictUtil
.
getDictionary
(
"isCostCenterHis"
));
queryModel
.
putDictionary
(
"status"
,
BizBillStatus
.
getMap
());
Map
<
String
,
Object
>
map
=
this
.
sqlExecutorDao
.
executeSlicedQuery
(
queryModel
);
Map
<
String
,
Object
>
map
=
this
.
sqlExecutorDao
.
executeSlicedQuery
(
queryModel
);
return
map
;
return
map
;
}
}
...
...
topsun/src/main/java/com/huigou/topsun/sap/costCenter/application/impl/CostCenterDataExcelImport.java
View file @
4955405a
package
com
.
huigou
.
topsun
.
sap
.
costCenter
.
application
.
impl
;
package
com
.
huigou
.
topsun
.
sap
.
costCenter
.
application
.
impl
;
import
com.huigou.cache.DictUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.huigou.cache.SystemCache
;
import
com.huigou.context.Operator
;
import
com.huigou.context.OrgUnit
;
import
com.huigou.context.OrgUnit
;
import
com.huigou.context.ThreadLocalUtil
;
import
com.huigou.topsun.sap.costCenter.application.CostCenterApplication
;
import
com.huigou.topsun.sap.costCenter.application.CostCenterApplication
;
import
com.huigou.topsun.sap.costCenter.domain.CostCenter
;
import
com.huigou.topsun.sap.costCenter.domain.CostCenter
;
import
com.huigou.topsun.sap.costCenter.domain.TmpCostCenterData
;
import
com.huigou.topsun.sap.costCenter.domain.TmpCostCenterData
;
import
com.huigou.topsun.sap.costCenter.repository.CostCenterRepository
;
import
com.huigou.topsun.sap.costCenter.repository.TmpCostCenterDataRepository
;
import
com.huigou.topsun.sap.costCenter.repository.TmpCostCenterDataRepository
;
import
com.huigou.topsun.sap.fixedAssets.domain.TmpFixedAssessData
;
import
com.huigou.topsun.sap.fixedAssets.repository.TmpFixedAssessDataRepository
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bmp.opm.application.OrgApplication
;
import
com.huigou.uasp.bpm.ProcessAction
;
import
com.huigou.uasp.bmp.opm.domain.model.org.Org
;
import
com.huigou.uasp.bpm.ProcessStartModel
;
import
com.huigou.uasp.bpm.engine.application.WorkflowApplication
;
import
com.huigou.uasp.tool.dataimport.application.ExcelImportInterface
;
import
com.huigou.uasp.tool.dataimport.application.ExcelImportInterface
;
import
com.huigou.util.Constants
;
import
com.huigou.util.SDO
;
import
com.huigou.util.StringUtil
;
import
com.huigou.util.StringUtil
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Service
(
"costCenterDataExcelImport"
)
@Service
(
"costCenterDataExcelImport"
)
public
class
CostCenterDataExcelImport
implements
ExcelImportInterface
{
public
class
CostCenterDataExcelImport
implements
ExcelImportInterface
{
...
@@ -27,39 +36,109 @@ public class CostCenterDataExcelImport implements ExcelImportInterface {
...
@@ -27,39 +36,109 @@ public class CostCenterDataExcelImport implements ExcelImportInterface {
@Autowired
@Autowired
private
TmpCostCenterDataRepository
tmpCostCenterDataRepository
;
private
TmpCostCenterDataRepository
tmpCostCenterDataRepository
;
@Autowired
@Autowired
private
OrgApplication
orgApplication
;
private
CostCenterRepository
costCenterRepository
;
@Autowired
@Autowired
private
CostCenterApplication
costCenter
Application
;
private
WorkflowApplication
workflow
Application
;
@Override
@Override
public
void
executeImport
(
String
batchNumer
)
{
public
void
executeImport
(
String
batchNumer
)
{
List
<
TmpCostCenterData
>
centerDataList
=
tmpCostCenterDataRepository
.
findByBatchNumber
(
batchNumer
);
List
<
TmpCostCenterData
>
centerDataList
=
tmpCostCenterDataRepository
.
findByBatchNumber
(
batchNumer
);
if
(!
CollectionUtils
.
isEmpty
(
centerDataList
)){
if
(!
CollectionUtils
.
isEmpty
(
centerDataList
)){
List
<
CostCenter
>
costCenterList
=
new
ArrayList
<>();
for
(
TmpCostCenterData
tmpCostCenterData
:
centerDataList
)
{
for
(
TmpCostCenterData
tmpCostCenterData
:
centerDataList
)
{
if
(
StringUtil
.
isBlank
(
tmpCostCenterData
.
getKostl
())){
throw
new
RuntimeException
(
"成本中心编码不能为空"
);
}
if
(
tmpCostCenterData
.
getKostl
().
length
()!=
10
){
throw
new
RuntimeException
(
"成本中心编码只能是10位"
);
}
if
(
StringUtil
.
isBlank
(
tmpCostCenterData
.
getKtext
())){
throw
new
RuntimeException
(
"成本中心名称不能为空"
);
}
if
(
StringUtil
.
isBlank
(
tmpCostCenterData
.
getKosar
())){
throw
new
RuntimeException
(
"成本中心类型不能为空"
);
}
if
(
StringUtil
.
isBlank
(
tmpCostCenterData
.
getKhinr
())){
throw
new
RuntimeException
(
"层次结构范围不能为空"
);
}
if
(
StringUtil
.
isBlank
(
tmpCostCenterData
.
getPrctr
())){
throw
new
RuntimeException
(
"利润中心不能为空"
);
}
if
(
tmpCostCenterData
.
getDatab
()
==
null
){
throw
new
RuntimeException
(
"有效截至日不能为空"
);
}
if
(
tmpCostCenterData
.
getDatbi
()
==
null
){
throw
new
RuntimeException
(
"有效期自不能为空"
);
}
List
<
CostCenter
>
centerList
=
costCenterRepository
.
findByKostl
(
tmpCostCenterData
.
getKostl
());
if
(!
CollectionUtils
.
isEmpty
(
centerList
)){
centerList
.
forEach
(
costCenter
->
{
//判断相同成本中心编码的是不是已终止的单据,如果不是终止的提示已存在。
if
(
costCenter
.
getStatusId
()
!=
BizBillStatus
.
ABORTED
.
getId
()){
throw
new
RuntimeException
(
"已存在编码为:"
+
tmpCostCenterData
.
getKostl
()
+
"的成本中心"
);
}
});
}
CostCenter
costCenter
=
new
CostCenter
();
CostCenter
costCenter
=
new
CostCenter
();
BeanUtils
.
copyProperties
(
tmpCostCenterData
,
costCenter
);
BeanUtils
.
copyProperties
(
tmpCostCenterData
,
costCenter
);
costCenter
.
setIsDelete
(
0
);
costCenter
.
setIsDelete
(
0
);
costCenter
.
setIsEnable
(
1
);
costCenter
.
setIsEnable
(
1
);
//costCenter.setStatusId(BizBillStatus.COMPLETED.getId());
//Org org = orgApplication.loadMainOrgByLoginName(tmpCostCenterData.getCreatedCode());
//costCenter.setDefaultValues(new OrgUnit(org.getFullId(), org.getFullName()));
//costCenterApplication.saveCostCenter(costCenter);
costCenter
.
setId
(
null
);
costCenterList
.
add
(
costCenter
);
}
//发起流程
this
.
saveCostCenterImportVo
(
costCenterList
);
}
}
public
void
saveCostCenterImportVo
(
List
<
CostCenter
>
costCenterList
)
{
for
(
CostCenter
costCenter
:
costCenterList
)
{
//初始化用户信息
Operator
operator
=
ThreadLocalUtil
.
getOperator
();
costCenter
.
setDefaultValues
(
new
OrgUnit
(
operator
.
getFullId
(),
operator
.
getFullName
()));
String
isCostCenterHis
=
SystemCache
.
getParameter
(
"isCostCenterHis"
,
String
.
class
);
costCenter
.
setIsCostCenterHis
(
isCostCenterHis
);
//标识是不是历史数据导入,如果是,则不需要发起流程
if
(
"1"
.
equals
(
isCostCenterHis
)){
costCenter
.
setTYPE
(
"S"
);
costCenter
.
setTYPE
(
"S"
);
costCenter
.
setMESSAGE
(
"成本中心主数据创建成功!"
);
costCenter
.
setMESSAGE
(
"成本中心主数据创建成功!"
);
costCenter
.
setStatusId
(
BizBillStatus
.
COMPLETED
.
getId
());
costCenter
.
setStatusId
(
BizBillStatus
.
COMPLETED
.
getId
());
// String value = DictUtil.getDictionaryDetailValue("KOSAR", tmpCostCenterData.getKosar());
}
else
{
// if (StringUtil.isBlank(value)){
Map
<
String
,
Object
>
formData
=
BeanUtil
.
beanToMap
(
costCenter
);
// throw new RuntimeException("未识别的成本中心类型");
SDO
localSdo
=
this
.
buildSDO
(
formData
,
operator
);
// }
String
bizId
=
this
.
startProcessInstance
(
CostCenterApplication
.
PROCESS_DEFINITION_KEY
,
localSdo
);
//costCenter.setKosar(tmpCostCenterData.getKosar());
costCenter
.
setId
(
bizId
);
// String prctr = DictUtil.getDictionaryDetailValue("PRCTR", tmpCostCenterData.getPrctr());
costCenter
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
// if (StringUtil.isBlank(prctr)){
// throw new RuntimeException("未识别的利润中心类型");
// }
//costCenter.setPrctr(prctr);
if
(
StringUtil
.
isBlank
(
tmpCostCenterData
.
getCreatedCode
())){
throw
new
RuntimeException
(
"创建人编码不能为空"
);
}
Org
org
=
orgApplication
.
loadMainOrgByLoginName
(
tmpCostCenterData
.
getCreatedCode
());
costCenter
.
setDefaultValues
(
new
OrgUnit
(
org
.
getFullId
(),
org
.
getFullName
()));
costCenterApplication
.
saveCostCenter
(
costCenter
);
}
}
}
}
costCenterRepository
.
save
(
costCenterList
);
}
public
String
startProcessInstance
(
String
processDefinitionKey
,
SDO
localSdo
){
Map
<
String
,
Object
>
variables
=
new
HashMap
();
ThreadLocalUtil
.
putVariable
(
Constants
.
SDO
,
localSdo
);
variables
.
put
(
"startModel"
,
ProcessStartModel
.
MANUAL
.
getId
());
Operator
operator
=
localSdo
.
getOperator
();
variables
.
put
(
"executorFullId"
,
operator
.
getFullId
());
variables
.
put
(
"executorFullName"
,
operator
.
getFullName
());
ThreadLocalUtil
.
putOperator
(
operator
);
ThreadLocalUtil
.
putVariable
(
"client.ip"
,
"127.0.0.1"
);
ProcessInstance
processInstance
=
this
.
workflowApplication
.
startProcessInstanceByKey
(
processDefinitionKey
,
variables
);
return
processInstance
.
getBusinessKey
();
}
private
SDO
buildSDO
(
Map
<
String
,
Object
>
formData
,
Operator
operator
)
{
SDO
localSdo
=
new
SDO
();
// 将业务数据传递给工作流
formData
.
forEach
(
localSdo:
:
putProperty
);
// 将业务流程信息传递给工作流
localSdo
.
putProperty
(
"processAction"
,
ProcessAction
.
SAVE
);
localSdo
.
putProperty
(
"procUnitId"
,
"Apply"
);
localSdo
.
setOperator
(
operator
);
return
localSdo
;
}
}
}
}
topsun/src/main/java/com/huigou/topsun/sap/costCenter/controller/CostCenterController.java
View file @
4955405a
...
@@ -93,6 +93,13 @@ public class CostCenterController extends CommonController {
...
@@ -93,6 +93,13 @@ public class CostCenterController extends CommonController {
return
forward
(
"sapCostCenterDetail"
,
costCenterVo
);
return
forward
(
"sapCostCenterDetail"
,
costCenterVo
);
}
}
public
String
showLoadCostCenterHis
(){
SDO
sdo
=
this
.
getSDO
();
String
id
=
sdo
.
getId
();
CostCenterVo
costCenterVo
=
costCenterApplication
.
findCostCenterById
(
id
);
return
forward
(
"sapCostCenterHisDetail"
,
costCenterVo
);
}
/**
/**
* 根据id获取成本中心信息
* 根据id获取成本中心信息
*
*
...
@@ -121,6 +128,7 @@ public class CostCenterController extends CommonController {
...
@@ -121,6 +128,7 @@ public class CostCenterController extends CommonController {
costCenterVo
.
setId
(
null
);
costCenterVo
.
setId
(
null
);
costCenterVo
.
setReason
(
null
);
costCenterVo
.
setReason
(
null
);
costCenterVo
.
setTelePhone
(
null
);
costCenterVo
.
setTelePhone
(
null
);
costCenterVo
.
setIsCostCenterHis
(
"0"
);
return
forward
(
"sapCostCenterDetail"
,
costCenterVo
);
return
forward
(
"sapCostCenterDetail"
,
costCenterVo
);
}
}
...
...
topsun/src/main/java/com/huigou/topsun/sap/costCenter/domain/CostCenter.java
View file @
4955405a
...
@@ -138,6 +138,12 @@ public class CostCenter extends FlowBillAbstractEntity {
...
@@ -138,6 +138,12 @@ public class CostCenter extends FlowBillAbstractEntity {
@JsonProperty
(
"LOG_NO"
)
@JsonProperty
(
"LOG_NO"
)
private
String
LOG_NO
;
private
String
LOG_NO
;
/**
* 是否历史数据
*/
@Column
(
name
=
"is_cost_center_his"
)
private
String
isCostCenterHis
;
@Override
@Override
protected
String
getCodeRuleId
()
{
protected
String
getCodeRuleId
()
{
return
"sapCostCenter"
;
return
"sapCostCenter"
;
...
...
topsun/src/main/java/com/huigou/topsun/sap/costCenter/domain/TmpCostCenterData.java
View file @
4955405a
...
@@ -94,4 +94,16 @@ public class TmpCostCenterData extends AbstractPortalOrg {
...
@@ -94,4 +94,16 @@ public class TmpCostCenterData extends AbstractPortalOrg {
@Column
(
name
=
"created_name"
)
@Column
(
name
=
"created_name"
)
private
String
createdName
;
private
String
createdName
;
/**
* 联系方式
*/
@Column
(
name
=
"tele_phone"
)
private
String
telePhone
;
/**
* 创建原因 CHAR 100 手工输入
*/
@Column
(
name
=
"reason"
)
private
String
reason
;
}
}
topsun/src/main/java/com/huigou/topsun/sap/costCenter/domain/vo/CostCenterVo.java
View file @
4955405a
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.huigou.topsun.sap.costCenter.domain.CostCenter
;
import
com.huigou.topsun.sap.costCenter.domain.CostCenter
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -106,6 +107,11 @@ public class CostCenterVo implements Serializable {
...
@@ -106,6 +107,11 @@ public class CostCenterVo implements Serializable {
private
String
telePhone
;
private
String
telePhone
;
/**
* 是否历史数据
*/
private
String
isCostCenterHis
;
public
static
CostCenterVo
getCostCenterVo
(
CostCenter
costCenter
)
{
public
static
CostCenterVo
getCostCenterVo
(
CostCenter
costCenter
)
{
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
costCenter
),
CostCenterVo
.
class
);
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
costCenter
),
CostCenterVo
.
class
);
}
}
...
...
topsun/src/main/java/com/huigou/topsun/sap/suppliers/application/impl/SuppliersDataApplicationImpl.java
View file @
4955405a
...
@@ -356,6 +356,8 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
...
@@ -356,6 +356,8 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
//账户明细放18位后的值
//账户明细放18位后的值
bankVo
.
setBkref
(
bankn
.
substring
(
18
,
bankn
.
length
()));
bankVo
.
setBkref
(
bankn
.
substring
(
18
,
bankn
.
length
()));
}
}
//财务机构名称赋值组织名称1
bankVo
.
setBanka
(
suppliersInfoVo
.
getNameOrg1
());
bankVoList
.
add
(
bankVo
);
bankVoList
.
add
(
bankVo
);
}
}
suppliersInfoVo
.
setSuppliersBankList
(
bankVoList
);
suppliersInfoVo
.
setSuppliersBankList
(
bankVoList
);
...
...
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