Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2ba553fb
authored
Dec 10, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[add] 项目管理菜单添加接口,区分合同管理的接口
1 parent
b8a5a8eb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
14 deletions
src/main/java/vion/controller/ContractController.java
src/main/java/vion/controller/ContractPaymentController.java
src/main/java/vion/service/IContractService.java
src/main/java/vion/service/impl/ContractServiceImpl.java
src/main/java/vion/controller/ContractController.java
View file @
2ba553f
...
...
@@ -59,12 +59,6 @@ public class ContractController {
return
contractService
.
listPart
(
dto
);
}
@GetMapping
(
"/contractMain"
)
@SaCheckPermission
(
value
=
"contract:listMain"
,
orRole
=
"admin"
)
public
Page
<
ContractVO
>
listMain
(
ContractDTO
dto
)
{
return
contractService
.
listByMain
(
dto
);
}
@GetMapping
(
"/contract/{id}"
)
@SaCheckPermission
(
value
=
"contract:query"
,
orRole
=
"admin"
)
public
ContractVO
getById
(
@PathVariable
Long
id
)
{
...
...
@@ -73,13 +67,13 @@ public class ContractController {
// region 项目管理单独使用接口
@GetMapping
(
"/contractMainByPro"
)
@SaCheckPermission
(
value
=
"contract:listMain"
,
orRole
=
"admin"
)
@SaCheckPermission
(
value
=
"contract:listMain
ByPro
"
,
orRole
=
"admin"
)
public
Page
<
ContractVO
>
listMainByPro
(
ContractDTO
dto
)
{
return
contractService
.
listByMain
(
dto
);
return
contractService
.
listByMain
ByPro
(
dto
);
}
@GetMapping
(
"/contractByPro/{id}"
)
@SaCheckPermission
(
value
=
"contract:query"
,
orRole
=
"admin"
)
@SaCheckPermission
(
value
=
"contract:query
ByPro
"
,
orRole
=
"admin"
)
public
ContractVO
getByIdByPro
(
@PathVariable
Long
id
)
{
return
contractService
.
getVOById
(
id
);
}
...
...
src/main/java/vion/controller/ContractPaymentController.java
View file @
2ba553f
...
...
@@ -36,7 +36,7 @@ public class ContractPaymentController {
// region 项目管理单独使用接口
@GetMapping
(
"/contractPaymentByPro/{id}"
)
@SaCheckPermission
(
value
=
"contractPayment:query"
,
orRole
=
"admin"
)
@SaCheckPermission
(
value
=
"contractPayment:query
ByPro
"
,
orRole
=
"admin"
)
public
List
<
ContractPaymentVO
>
getPaymentByIdByPro
(
@PathVariable
Long
id
)
{
return
converter
.
convert
(
contractPaymentService
.
lambdaQuery
().
eq
(
ContractPayment:
:
getContractId
,
id
).
orderByAsc
(
ContractPayment:
:
getPaymentType
).
list
(),
ContractPaymentVO
.
class
);
}
...
...
src/main/java/vion/service/IContractService.java
View file @
2ba553f
...
...
@@ -23,7 +23,7 @@ public interface IContractService extends MPJBaseService<Contract> {
Page
<
ContractVO
>
listPart
(
ContractDTO
dto
);
Page
<
ContractVO
>
listByMain
(
ContractDTO
dto
);
Page
<
ContractVO
>
listByMain
ByPro
(
ContractDTO
dto
);
ContractVO
getVOById
(
Long
id
);
...
...
src/main/java/vion/service/impl/ContractServiceImpl.java
View file @
2ba553f
...
...
@@ -150,8 +150,8 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
}
@Override
public
Page
<
ContractVO
>
listByMain
(
ContractDTO
dto
)
{
Result
result
=
getResult
(
dto
);
public
Page
<
ContractVO
>
listByMain
ByPro
(
ContractDTO
dto
)
{
Result
result
=
getResult
ByPro
(
dto
);
Page
<
ContractVO
>
page
=
Page
.
of
(
dto
.
getPageNum
(),
dto
.
getPageSize
());
Opt
.
ofNullable
(
dto
.
getOrderItem
())
...
...
@@ -734,7 +734,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
List
<
Long
>
contractIdList
=
dto
.
getSwitchFlag
()
==
1
?
contractStoreService
.
listObjs
(
Wrappers
.<
RContractStore
>
lambdaQuery
()
.
select
(
RContractStore:
:
getContractId
),
o
->
Long
.
valueOf
(
o
.
toString
()))
:
List
Util
.
empty
();
:
List
.
of
();
// 根据产品线查出关联的合同
List
<
Long
>
lineContractIdList
=
Opt
.
ofEmptyAble
(
dto
.
getProductLines
())
.
map
(
pl
->
Db
.
listObjs
(
Wrappers
.
lambdaQuery
(
Store
.
class
).
in
(
Store:
:
getProductLine
,
pl
),
Store:
:
getId
))
...
...
@@ -826,6 +826,61 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
return
new
Result
(
roleCodeList
,
wrapper
);
}
private
Result
getResultByPro
(
ContractDTO
dto
)
{
// 查询已关联项目的合同id
List
<
Long
>
contractIdList
=
dto
.
getSwitchFlag
()
==
1
?
contractStoreService
.
listObjs
(
Wrappers
.<
RContractStore
>
lambdaQuery
()
.
select
(
RContractStore:
:
getContractId
),
o
->
Long
.
valueOf
(
o
.
toString
()))
:
List
.
of
();
// 根据产品线查出关联的合同
List
<
Long
>
lineContractIdList
=
Opt
.
ofEmptyAble
(
dto
.
getProductLines
())
.
map
(
pl
->
Db
.
listObjs
(
Wrappers
.
lambdaQuery
(
Store
.
class
).
in
(
Store:
:
getProductLine
,
pl
),
Store:
:
getId
))
.
map
(
storeIds
->
contractStoreService
.
listObjs
(
Wrappers
.<
RContractStore
>
lambdaQuery
().
select
(
RContractStore:
:
getContractId
).
in
(
RContractStore:
:
getStoreId
,
storeIds
),
o
->
Long
.
valueOf
(
o
.
toString
())))
.
orElse
(
new
ArrayList
<>());
// 根据查询条件的销售人查询关联的合同
List
<
Long
>
contractUserIdList1
=
Opt
.
ofBlankAble
(
dto
.
getSaleName
())
.
map
(
name
->
contractUserService
.
listObjs
(
Wrappers
.<
RContractUser
>
lambdaQuery
()
.
select
(
RContractUser:
:
getContractId
).
eq
(
RContractUser:
:
getUsername
,
name
),
o
->
Long
.
valueOf
(
o
.
toString
())))
.
orElse
(
new
ArrayList
<>());
// 根据查询条件的销售人查询其销售的合同
List
<
Long
>
contractUserIdList2
=
Opt
.
ofBlankAble
(
dto
.
getSaleName
())
.
map
(
name
->
this
.
listObjs
(
Wrappers
.<
Contract
>
lambdaQuery
()
.
select
(
Contract:
:
getId
).
eq
(
Contract:
:
getSaleName
,
name
),
o
->
Long
.
valueOf
(
o
.
toString
())))
.
orElse
(
new
ArrayList
<>());
Collection
<
Long
>
queryContractUserIdList
=
ListUtil
.
addAllIfNotContains
(
contractUserIdList1
,
contractUserIdList2
);
Set
<
Long
>
finalIdSet
;
if
(
StrUtil
.
isNotBlank
(
dto
.
getSaleName
())
&&
CollUtil
.
isNotEmpty
(
dto
.
getProductLines
()))
{
finalIdSet
=
CollUtil
.
intersectionDistinct
(
lineContractIdList
,
queryContractUserIdList
);
}
else
{
finalIdSet
=
CollUtil
.
unionDistinct
(
lineContractIdList
,
queryContractUserIdList
);
}
if
((
StrUtil
.
isNotBlank
(
dto
.
getSaleName
())
||
CollUtil
.
isNotEmpty
(
dto
.
getProductLines
()))
&&
CollUtil
.
isEmpty
(
finalIdSet
))
{
finalIdSet
.
add
(-
1L
);
}
// 前端传参中的 saleName 字段已单独处理,这里置空,不参与下一步的 converter.convert
dto
.
setSaleName
(
null
);
MPJLambdaWrapper
<
Contract
>
wrapper
=
new
MPJLambdaWrapper
<>(
converter
.
convert
(
dto
,
Contract
.
class
))
.
selectAll
(
Contract
.
class
)
.
in
(
CollUtil
.
isNotEmpty
(
finalIdSet
),
Contract:
:
getId
,
finalIdSet
)
.
notIn
(
CollUtil
.
isNotEmpty
(
contractIdList
),
Contract:
:
getId
,
contractIdList
)
.
between
(
ArrayUtil
.
isAllNotNull
(
dto
.
getSignDateStart
(),
dto
.
getSignDateEnd
()),
Contract:
:
getSignDate
,
dto
.
getSignDateStart
(),
dto
.
getSignDateEnd
());
if
(
StrUtil
.
isNotBlank
(
dto
.
getOperator
())
&&
ObjUtil
.
isNotNull
(
dto
.
getAmount
()))
{
String
ope
=
dto
.
getOperator
();
if
(
">"
.
equals
(
ope
))
{
wrapper
.
gt
(
getCol
(
dto
),
dto
.
getAmount
());
}
else
if
(
"<"
.
equals
(
ope
))
{
wrapper
.
lt
(
getCol
(
dto
),
dto
.
getAmount
());
}
else
{
wrapper
.
eq
(
getCol
(
dto
),
dto
.
getAmount
());
}
}
return
new
Result
(
Set
.
of
(),
wrapper
);
}
private
SFunction
<
Contract
,
Object
>
getCol
(
ContractDTO
dto
)
{
if
(
dto
.
getTotalAmount
()
!=
null
)
{
return
Contract:
:
getTotalAmount
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment