Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王衍超
cloud-fb
Commits
434b2779
Commit
434b2779
authored
Apr 07, 2021
by
焦凯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交合同后端
parent
9e6b8996
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
28 deletions
+33
-28
ContractDao.java
...ava/com/xyst/dinas/contract/internal/dao/ContractDao.java
+13
-6
ContractStatisticsQuery.java
.../xyst/dinas/contract/request/ContractStatisticsQuery.java
+19
-8
ContractController.java
.../java/com/xyst/dinas/contract/web/ContractController.java
+1
-1
Contract.mk
.../src/main/model/com/xyst/dinas/contract/query/Contract.mk
+0
-6
Contract.jmx
...main/resources/com/xyst/dinas/contract/query/Contract.jmx
+0
-7
No files found.
backend/xyst.dinas.contract/src/main/java/com/xyst/dinas/contract/internal/dao/ContractDao.java
View file @
434b2779
...
@@ -79,7 +79,9 @@ public class ContractDao {
...
@@ -79,7 +79,9 @@ public class ContractDao {
String
contractState
=
contractStatisticsQuery
.
getContractState
();
String
contractState
=
contractStatisticsQuery
.
getContractState
();
UUID
projectId
=
contractStatisticsQuery
.
getProjectId
();
UUID
projectId
=
contractStatisticsQuery
.
getProjectId
();
UUID
purchaseSandUnitId
=
contractStatisticsQuery
.
getPurchaseSandUnitId
();
UUID
purchaseSandUnitId
=
contractStatisticsQuery
.
getPurchaseSandUnitId
();
Date
signDate
=
contractStatisticsQuery
.
getSignDate
();
Date
signDateStart
=
contractStatisticsQuery
.
getSignStartDate
();
Date
signDateEnd
=
contractStatisticsQuery
.
getSignEndDate
();
Integer
approveState
=
contractStatisticsQuery
.
getApproveState
();
StringBuilder
hql
=
new
StringBuilder
(
"select "
);
StringBuilder
hql
=
new
StringBuilder
(
"select "
);
hql
.
append
(
"count(DISTINCT m.contractId), "
);
//合同总数
hql
.
append
(
"count(DISTINCT m.contractId), "
);
//合同总数
...
@@ -88,11 +90,14 @@ public class ContractDao {
...
@@ -88,11 +90,14 @@ public class ContractDao {
hql
.
append
(
"sum(case when m.contractState='COMPLETED' then 1 else 0 end) "
);
//已完成
hql
.
append
(
"sum(case when m.contractState='COMPLETED' then 1 else 0 end) "
);
//已完成
// hql.append("sum(case when m.contract_state=\"MODIFIED\" then 1 else 0 end) ");//已变更
// hql.append("sum(case when m.contract_state=\"MODIFIED\" then 1 else 0 end) ");//已变更
hql
.
append
(
"from "
).
append
(
ContractConstant
.
ENTITY_CONTRACT
).
append
(
" as m where 1=1 "
);
hql
.
append
(
"from "
).
append
(
ContractConstant
.
ENTITY_CONTRACT
).
append
(
" as m where 1=1 "
);
hql
.
append
(
"and (discard is null or discard = 0) "
);
if
(
contractName
!=
null
)
hql
.
append
(
"and contractName like :contractName "
);
if
(
contractName
!=
null
)
hql
.
append
(
"and contractName like :contractName "
);
if
(
contractState
!=
null
)
hql
.
append
(
"and contractState =:contractState "
);
if
(
contractState
!=
null
)
hql
.
append
(
"and contractState =:contractState "
);
if
(
projectId
!=
null
)
hql
.
append
(
"and projectId =:projectId "
);
if
(
projectId
!=
null
)
hql
.
append
(
"and projectId =:projectId "
);
if
(
purchaseSandUnitId
!=
null
)
hql
.
append
(
"and purchaseSandUnitId =:purchaseSandUnitId "
);
if
(
purchaseSandUnitId
!=
null
)
hql
.
append
(
"and purchaseSandUnitId =:purchaseSandUnitId "
);
if
(
signDate
!=
null
)
hql
.
append
(
"and signDate =:signDate "
);
if
(
signDateStart
!=
null
)
hql
.
append
(
"and signDateStart >=:signDateStart "
);
if
(
signDateEnd
!=
null
)
hql
.
append
(
"and signDateEnd <=:signDateEnd "
);
if
(
approveState
!=
null
)
hql
.
append
(
"and approveState <=:approveState "
);
return
template
.
execute
(
session
->
{
return
template
.
execute
(
session
->
{
Query
<
Tuple
>
query
=
session
.
createQuery
(
hql
.
toString
(),
Tuple
.
class
);
Query
<
Tuple
>
query
=
session
.
createQuery
(
hql
.
toString
(),
Tuple
.
class
);
...
@@ -100,7 +105,9 @@ public class ContractDao {
...
@@ -100,7 +105,9 @@ public class ContractDao {
if
(
contractState
!=
null
)
query
.
setParameter
(
"contractState"
,
contractState
);
if
(
contractState
!=
null
)
query
.
setParameter
(
"contractState"
,
contractState
);
if
(
projectId
!=
null
)
query
.
setParameter
(
"projectId"
,
projectId
);
if
(
projectId
!=
null
)
query
.
setParameter
(
"projectId"
,
projectId
);
if
(
purchaseSandUnitId
!=
null
)
query
.
setParameter
(
"purchaseSandUnitId"
,
purchaseSandUnitId
);
if
(
purchaseSandUnitId
!=
null
)
query
.
setParameter
(
"purchaseSandUnitId"
,
purchaseSandUnitId
);
if
(
signDate
!=
null
)
query
.
setParameter
(
"signDate"
,
signDate
);
if
(
signDateStart
!=
null
)
query
.
setParameter
(
"signDateStart"
,
signDateStart
);
if
(
signDateEnd
!=
null
)
query
.
setParameter
(
"signDateEnd"
,
signDateEnd
);
if
(
approveState
!=
null
)
query
.
setParameter
(
"approveState"
,
approveState
);
List
<
Tuple
>
list
=
query
.
list
();
List
<
Tuple
>
list
=
query
.
list
();
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
...
@@ -108,9 +115,9 @@ public class ContractDao {
...
@@ -108,9 +115,9 @@ public class ContractDao {
Tuple
tuple
=
list
.
get
(
0
);
Tuple
tuple
=
list
.
get
(
0
);
long
totalCount
=
tuple
.
get
(
0
,
Long
.
class
);
long
totalCount
=
tuple
.
get
(
0
,
Long
.
class
);
long
unExecuteCount
=
t
uple
.
get
(
1
,
Long
.
class
)
;
long
unExecuteCount
=
t
otalCount
>
0
?
tuple
.
get
(
1
,
Long
.
class
):
0
;
long
executingCount
=
t
uple
.
get
(
2
,
Long
.
class
)
;
long
executingCount
=
t
otalCount
>
0
?
tuple
.
get
(
2
,
Long
.
class
):
0
;
long
completedCount
=
t
uple
.
get
(
3
,
Long
.
class
)
;
long
completedCount
=
t
otalCount
>
0
?
tuple
.
get
(
3
,
Long
.
class
):
0
;
jsonObject
.
put
(
"totalCount"
,
totalCount
);
jsonObject
.
put
(
"totalCount"
,
totalCount
);
jsonObject
.
put
(
"unExecuteCount"
,
unExecuteCount
);
jsonObject
.
put
(
"unExecuteCount"
,
unExecuteCount
);
...
...
backend/xyst.dinas.contract/src/main/java/com/xyst/dinas/contract/request/ContractStatisticsQuery.java
View file @
434b2779
...
@@ -9,8 +9,9 @@ public class ContractStatisticsQuery {
...
@@ -9,8 +9,9 @@ public class ContractStatisticsQuery {
private
UUID
purchaseSandUnitId
;
private
UUID
purchaseSandUnitId
;
private
String
contractName
;
private
String
contractName
;
private
String
contractState
;
private
String
contractState
;
private
Date
signDate
;
private
Date
signStartDate
;
private
Date
signEndDate
;
private
Integer
approveState
;
public
UUID
getProjectId
()
{
public
UUID
getProjectId
()
{
return
projectId
;
return
projectId
;
...
@@ -36,13 +37,23 @@ public class ContractStatisticsQuery {
...
@@ -36,13 +37,23 @@ public class ContractStatisticsQuery {
public
void
setContractState
(
String
contractState
)
{
public
void
setContractState
(
String
contractState
)
{
this
.
contractState
=
contractState
;
this
.
contractState
=
contractState
;
}
}
public
Date
getSignDate
()
{
public
Date
getSign
Start
Date
()
{
return
signDate
;
return
sign
Start
Date
;
}
}
public
void
setSignDate
(
Date
signDate
)
{
public
void
setSignStartDate
(
Date
signStartDate
)
{
this
.
signDate
=
signDate
;
this
.
signStartDate
=
signStartDate
;
}
public
Date
getSignEndDate
()
{
return
signEndDate
;
}
public
void
setSignEndDate
(
Date
signEndDate
)
{
this
.
signEndDate
=
signEndDate
;
}
public
Integer
getApproveState
()
{
return
approveState
;
}
public
void
setApproveState
(
int
approveState
)
{
this
.
approveState
=
approveState
;
}
}
}
}
backend/xyst.dinas.contract/src/main/java/com/xyst/dinas/contract/web/ContractController.java
View file @
434b2779
...
@@ -134,7 +134,7 @@ public class ContractController {
...
@@ -134,7 +134,7 @@ public class ContractController {
}
}
// 统计查询:合同数量, 未执行,执行中,已完成
// 统计查询:合同数量, 未执行,执行中,已完成
@PostMapping
(
"/contract/
statistics
"
)
@PostMapping
(
"/contract/
count
"
)
public
String
statisticsQuery
(
@RequestBody
ContractStatisticsQuery
contractStatisticsQuery
)
{
public
String
statisticsQuery
(
@RequestBody
ContractStatisticsQuery
contractStatisticsQuery
)
{
//
//
JSONObject
statisticsQuery
=
contractDao
.
statisticsQuery
(
contractStatisticsQuery
);
JSONObject
statisticsQuery
=
contractDao
.
statisticsQuery
(
contractStatisticsQuery
);
...
...
backend/xyst.dinas.contract/src/main/model/com/xyst/dinas/contract/query/Contract.mk
View file @
434b2779
...
@@ -22,12 +22,6 @@
...
@@ -22,12 +22,6 @@
<defaultExecute></defaultExecute>
<defaultExecute></defaultExecute>
<hide></hide>
<hide></hide>
</innerScene>
</innerScene>
<innerScene title='默认部分'>
<id>cb80f579-e0d1-49b2-9528-8dff2466aef6</id>
<javaImplement>com.xyst.dinas.contract.internal.scene.ContractListDefaultScene</javaImplement>
<defaultExecute>true</defaultExecute>
<hide>true</hide>
</innerScene>
<field title='id'>
<field title='id'>
<name>id</name>
<name>id</name>
<type>uuid</type>
<type>uuid</type>
...
...
backend/xyst.dinas.contract/src/main/resources/com/xyst/dinas/contract/query/Contract.jmx
View file @
434b2779
...
@@ -27,13 +27,6 @@
...
@@ -27,13 +27,6 @@
<m:defaultExecute></m:defaultExecute>
<m:defaultExecute></m:defaultExecute>
<m:hide></m:hide>
<m:hide></m:hide>
</m:innerScene>
</m:innerScene>
<m:innerScene>
<m:id>
cb80f579-e0d1-49b2-9528-8dff2466aef6
</m:id>
<m:title>
默认部分
</m:title>
<m:javaImplement>
com.xyst.dinas.contract.internal.scene.ContractListDefaultScene
</m:javaImplement>
<m:defaultExecute>
true
</m:defaultExecute>
<m:hide>
true
</m:hide>
</m:innerScene>
</m:innerScenes>
</m:innerScenes>
<m:fields>
<m:fields>
<m:field>
<m:field>
...
...
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