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
450daa69
Commit
450daa69
authored
Dec 25, 2023
by
赵汉亭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成本中心ES查询接口
parent
79429ee9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
1 deletion
+55
-1
CostCenterApplication.java
...sun/sap/costCenter/application/CostCenterApplication.java
+2
-0
CostCenterApplicationImpl.java
...ostCenter/application/impl/CostCenterApplicationImpl.java
+7
-0
CostCenterController.java
...opsun/sap/costCenter/controller/CostCenterController.java
+35
-1
costCenter.xml
...ain/resources/config/topsun/sap/costCenter/costCenter.xml
+11
-0
No files found.
topsun/src/main/java/com/huigou/topsun/sap/costCenter/application/CostCenterApplication.java
View file @
450daa69
...
@@ -30,4 +30,6 @@ public interface CostCenterApplication {
...
@@ -30,4 +30,6 @@ public interface CostCenterApplication {
void
saveCostCenter
(
CostCenter
costCenter
);
void
saveCostCenter
(
CostCenter
costCenter
);
CostCenterVo
saveAndUpdate
(
CostCenter
costCenter
);
CostCenterVo
saveAndUpdate
(
CostCenter
costCenter
);
Map
<
String
,
Object
>
slicedCostCenterList
(
CostCenterQueryRequest
queryRequest
);
}
}
topsun/src/main/java/com/huigou/topsun/sap/costCenter/application/impl/CostCenterApplicationImpl.java
View file @
450daa69
...
@@ -69,6 +69,13 @@ public class CostCenterApplicationImpl extends FlowBroker implements CostCenterA
...
@@ -69,6 +69,13 @@ public class CostCenterApplicationImpl extends FlowBroker implements CostCenterA
}
}
@Override
public
Map
<
String
,
Object
>
slicedCostCenterList
(
CostCenterQueryRequest
queryRequest
)
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"slicedCostCenterList"
);
QueryModel
queryModel
=
sqlExecutorDao
.
getQueryModel
(
queryDescriptor
,
queryRequest
);
return
this
.
sqlExecutorDao
.
executeSlicedQuery
(
queryModel
);
}
@Override
@Override
protected
void
onEnd
(
DelegateExecution
delegateExecution
)
{
protected
void
onEnd
(
DelegateExecution
delegateExecution
)
{
super
.
onEnd
(
delegateExecution
);
super
.
onEnd
(
delegateExecution
);
...
...
topsun/src/main/java/com/huigou/topsun/sap/costCenter/controller/CostCenterController.java
View file @
450daa69
...
@@ -8,12 +8,20 @@ import com.huigou.topsun.sap.costCenter.domain.query.CostCenterQueryRequest;
...
@@ -8,12 +8,20 @@ import com.huigou.topsun.sap.costCenter.domain.query.CostCenterQueryRequest;
import
com.huigou.topsun.sap.costCenter.domain.vo.CostCenterVo
;
import
com.huigou.topsun.sap.costCenter.domain.vo.CostCenterVo
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bmp.common.easysearch.EasySearch
;
import
com.huigou.uasp.bmp.common.easysearch.domain.model.EasySearchParse
;
import
com.huigou.uasp.bmp.common.easysearch.domain.model.QuerySchemeField
;
import
com.huigou.uasp.bmp.opm.application.MemEasySearcher
;
import
com.huigou.uasp.bmp.opm.application.impl.MemEasySearcherImpl
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.util.SDO
;
import
com.huigou.util.SDO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @Auther: xin.lu
* @Auther: xin.lu
...
@@ -64,7 +72,7 @@ public class CostCenterController extends CommonController {
...
@@ -64,7 +72,7 @@ public class CostCenterController extends CommonController {
Operator
operator
=
getOperator
();
Operator
operator
=
getOperator
();
costCenter
.
setDefaultValues
(
new
OrgUnit
(
operator
.
getFullId
(),
operator
.
getFullName
()));
costCenter
.
setDefaultValues
(
new
OrgUnit
(
operator
.
getFullId
(),
operator
.
getFullName
()));
return
forward
(
"sapCostCenterDetail"
,
costCenter
);
return
forward
(
"sapCostCenterDetail"
,
costCenter
);
}
}
/**
/**
...
@@ -122,4 +130,30 @@ public class CostCenterController extends CommonController {
...
@@ -122,4 +130,30 @@ public class CostCenterController extends CommonController {
return
success
(
costCenterVo
);
return
success
(
costCenterVo
);
}
}
/**
* 成本中心ES查询接口
*/
@EasySearch
(
queryName
=
"queryCostCenter"
)
public
Map
<
String
,
Object
>
queryCostCenter
(
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
(
"id"
,
"id"
,
"hidden"
),
new
QuerySchemeField
(
"成本中心编码"
,
"kostl"
,
"string"
,
200L
),
new
QuerySchemeField
(
"名称"
,
"ktext"
,
"string"
,
200L
)
);
EasySearchParse
easySearchParse
=
new
EasySearchParse
();
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setWidth
(
400L
);
String
ktext
=
sdo
.
getString
(
"ktext"
);
CostCenterQueryRequest
queryRequest
=
sdo
.
toQueryRequest
(
CostCenterQueryRequest
.
class
);
queryRequest
.
setKtext
(
ktext
);
Map
<
String
,
Object
>
map
=
costCenterApplication
.
slicedCostCenterList
(
queryRequest
);
List
<
Map
<
String
,
Object
>>
mapList
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"Rows"
);
MemEasySearcher
<
Map
<
String
,
Object
>>
memEasySearcher
=
new
MemEasySearcherImpl
<>();
Map
<
String
,
Object
>
model
=
memEasySearcher
.
search
(
mapList
,
easySearchParse
,
pageRequest
,
null
);
return
model
;
}
}
}
topsun/src/main/resources/config/topsun/sap/costCenter/costCenter.xml
View file @
450daa69
...
@@ -5,4 +5,15 @@
...
@@ -5,4 +5,15 @@
select t.* from sap_cost_center t
select t.* from sap_cost_center t
</sql-query>
</sql-query>
</query>
</query>
<query
name=
"slicedCostCenterList"
label=
"成本中心表"
table=
"cost_center"
>
<sql-query>
select
t.id,
t.ktext,
t.kostl
from sap_cost_center t
</sql-query>
<condition
column=
"ktext"
name=
"ktext"
type=
"java.lang.String"
symbol=
"like"
alias=
"t"
/>
</query>
</query-mappings>
</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