Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-cost-system
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
bltdc
dc-cost-system
Commits
0be62102
Commit
0be62102
authored
Nov 17, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
16e8cc93
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
9 deletions
+50
-9
OaUser.java
...src/main/java/com/blt/other/module/auth/model/OaUser.java
+8
-4
CostLogServiceImpl.java
...lt/other/module/cost/service/impl/CostLogServiceImpl.java
+42
-4
OtherApplicationTests.java
...re/src/test/java/com/blt/other/OtherApplicationTests.java
+0
-1
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/model/OaUser.java
View file @
0be62102
...
...
@@ -2,11 +2,11 @@ package com.blt.other.module.auth.model;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.*
;
import
java.io.Serializable
;
/**
* <p>
...
...
@@ -18,9 +18,13 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"OaUser对象"
,
description
=
""
)
@ApiModel
(
value
=
"OaUser对象"
,
description
=
""
)
@AllArgsConstructor
@NoArgsConstructor
public
class
OaUser
implements
Serializable
{
public
static
final
OaUser
DEFAULT
=
new
OaUser
(-
1
,
-
1
,
"default"
,
"default"
,
"default"
,
-
1
,
-
1
,
-
1
);
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/CostLogServiceImpl.java
View file @
0be62102
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.module.auth.dao.CostReviewerMapper
;
import
com.blt.other.module.auth.dao.UserDao
;
import
com.blt.other.module.auth.model.CostReviewer
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.auth.service.IOaUserService
;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.cost.dao.CostDao
;
import
com.blt.other.module.cost.dao.CostLogDao
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostLogService
;
import
com.blt.other.module.database.model.CostCompanyDomain
;
import
com.blt.other.module.database.model.CostLogDomain
;
import
com.blt.other.module.database.model.UserDomain
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -56,6 +61,10 @@ public class CostLogServiceImpl implements CostLogService {
IOaUserService
oaUserService
;
@Resource
CostDao
costDao
;
@Resource
CostReviewerMapper
costReviewerMapper
;
@Resource
CostCompanyDao
costCompanyDao
;
@Override
public
Integer
saveByManage
(
String
costNo
,
String
updateMainNote
,
Integer
type
)
{
...
...
@@ -66,10 +75,39 @@ public class CostLogServiceImpl implements CostLogService {
CostDomain
costDomain
=
costDao
.
selectByCostNo
(
costNo
);
OaUser
oaUser
=
oaUserService
.
selectManage
(
costDomain
.
getCreateUserid
());
CostCompanyDomain
costCompany
=
costCompanyDao
.
selectByNo
(
costDomain
.
getCompanyNo
());
OaUser
reviewer
;
if
(
type
.
equals
(
CostLogDomain
.
DEPARTMENT_AUTO_PASS
))
{
reviewer
=
costReviewerMapper
.
selectList
(
new
LambdaQueryWrapper
<
CostReviewer
>()
.
eq
(
CostReviewer:
:
getType
,
CostReviewer
.
departmentReviewer
)
.
eq
(
CostReviewer:
:
getReferId
,
oaUser
.
getPrimaryDepartmentId
()))
.
stream
()
.
findAny
()
.
map
(
costReviewer
->
oaUserService
.
selectManage
(
costReviewer
.
getReviewerUserId
()))
.
orElse
(
OaUser
.
DEFAULT
);
}
else
if
(
type
.
equals
(
CostLogDomain
.
FINANCIAL_AUTO_PASS
))
{
reviewer
=
costReviewerMapper
.
selectList
(
new
LambdaQueryWrapper
<
CostReviewer
>()
.
eq
(
CostReviewer:
:
getType
,
CostReviewer
.
financialReviewer
)
.
eq
(
CostReviewer:
:
getReferId
,
costCompany
.
getId
()))
.
stream
()
.
findAny
()
.
map
(
costReviewer
->
oaUserService
.
selectManage
(
costReviewer
.
getReviewerUserId
()))
.
orElse
(
OaUser
.
DEFAULT
);
}
else
if
(
type
.
equals
(
CostLogDomain
.
FINAL_AUTO_PASS
))
{
reviewer
=
costReviewerMapper
.
selectList
(
new
LambdaQueryWrapper
<
CostReviewer
>()
.
eq
(
CostReviewer:
:
getType
,
CostReviewer
.
finalReviewer
)
.
eq
(
CostReviewer:
:
getReferId
,
costCompany
.
getId
()))
.
stream
()
.
findAny
()
.
map
(
costReviewer
->
oaUserService
.
selectManage
(
costReviewer
.
getReviewerUserId
()))
.
orElse
(
OaUser
.
DEFAULT
);
}
else
{
throw
new
BizRuntimeException
(
"invalid param"
);
}
costLog
.
setUpdateUsercode
(
oaUs
er
.
getUserCode
());
costLog
.
setUpdateUsername
(
oaUs
er
.
getUserName
());
costLog
.
setUpdateUserid
(
oaUs
er
.
getOaUserId
());
costLog
.
setUpdateUsercode
(
review
er
.
getUserCode
());
costLog
.
setUpdateUsername
(
review
er
.
getUserName
());
costLog
.
setUpdateUserid
(
review
er
.
getOaUserId
());
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
costLog
.
setUpdateNote
(
sdf
.
format
(
costLog
.
getUpdateTime
())
+
" "
+
updateMainNote
+
" 更新人:"
+
oaUser
.
getUserName
());
...
...
bailuntec-cost-core/src/test/java/com/blt/other/OtherApplicationTests.java
View file @
0be62102
...
...
@@ -10,7 +10,6 @@ import com.blt.other.module.auth.model.OaUser;
import
com.blt.other.module.auth.service.IOaDepartmentService
;
import
com.blt.other.module.auth.service.IOaUserService
;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.database.model.CostCompanyDomain
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
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