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
46d02f20
Commit
46d02f20
authored
Nov 27, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d2f5311b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
5 deletions
+93
-5
OaUser.java
...src/main/java/com/blt/other/module/auth/model/OaUser.java
+8
-2
CostDomain.java
...main/java/com/blt/other/module/cost/model/CostDomain.java
+5
-0
AbstractCostService.java
...er/module/cost/service/impl/cost/AbstractCostService.java
+23
-2
log4j2.xml
bailuntec-cost-core/src/main/resources/log4j2.xml
+38
-0
deploy-cost-prod.sh
bailuntec-cost-core/src/main/shell/deploy-cost-prod.sh
+19
-1
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/model/OaUser.java
View file @
46d02f20
package
com
.
blt
.
other
.
module
.
auth
.
model
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
...
...
@@ -23,7 +27,7 @@ import java.io.Serializable;
@NoArgsConstructor
public
class
OaUser
implements
Serializable
{
public
static
final
OaUser
DEFAULT
=
new
OaUser
(-
1
,
-
1
,
"default"
,
"default"
,
"default"
,
-
1
,
-
1
,
-
1
);
public
static
final
OaUser
DEFAULT
=
new
OaUser
(-
1
,
-
1
,
"default"
,
"default"
,
"default"
,
-
1
,
-
1
,
-
1
,
null
);
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -48,5 +52,7 @@ public class OaUser implements Serializable {
@ApiModelProperty
(
value
=
"公司id"
)
private
Integer
companyId
;
@TableField
(
exist
=
false
)
private
OaDepartment
primaryDepartment
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/CostDomain.java
View file @
46d02f20
...
...
@@ -222,6 +222,11 @@ public class CostDomain implements Serializable {
@ApiModelProperty
(
"借支单,还款申请金额,包括已还的和申请中 ,借支单币种。"
)
private
BigDecimal
repaymentAppliedAmount
;
@TableField
(
exist
=
false
)
private
Integer
primaryDepartmentId
;
@TableField
(
exist
=
false
)
private
String
primaryDepartmentName
;
public
CostDto
castToDto
()
{
StatusMapper
statusMapper
=
SpringContextUtil
.
getBean
(
StatusMapper
.
class
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/cost/AbstractCostService.java
View file @
46d02f20
...
...
@@ -16,8 +16,10 @@ import com.blt.other.common.util.CurUtils;
import
com.blt.other.common.util.MoneyUtil
;
import
com.blt.other.common.util.SessionUtils
;
import
com.blt.other.module.auth.dao.CostReviewerMapper
;
import
com.blt.other.module.auth.dao.OaDepartmentMapper
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.model.CostReviewer
;
import
com.blt.other.module.auth.model.OaDepartment
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.auth.service.UserService
;
import
com.blt.other.module.cost.dao.*
;
...
...
@@ -46,6 +48,7 @@ import java.math.BigDecimal;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -79,6 +82,8 @@ public abstract class AbstractCostService implements CostService {
CostLogService
costLogService
;
@Resource
CostUrlProperties
costUrlProperties
;
@Resource
OaDepartmentMapper
oaDepartmentMapper
;
@Override
public
Integer
saveNewCost
(
CostDomain
costDomain
)
{
...
...
@@ -103,6 +108,22 @@ public abstract class AbstractCostService implements CostService {
return
result
;
}
void
setPrimaryDepartment
(
List
<
CostDomain
>
costDomains
)
{
List
<
OaUser
>
oaUserList
=
oaUserMapper
.
selectBatchIds
(
costDomains
.
stream
().
map
(
CostDomain:
:
getCreateUserid
).
collect
(
Collectors
.
toList
()));
Map
<
Integer
,
OaDepartment
>
departmentMap
=
oaDepartmentMapper
.
selectBatchIds
(
oaUserList
.
stream
().
map
(
OaUser:
:
getPrimaryDepartmentId
).
collect
(
Collectors
.
toList
()))
.
stream
()
.
collect
(
Collectors
.
toMap
(
OaDepartment:
:
getDepartmentId
,
oaDepartment
->
oaDepartment
));
Map
<
Integer
,
OaUser
>
oaUserMap
=
oaUserList
.
stream
()
.
peek
(
oaUser
->
oaUser
.
setPrimaryDepartment
(
departmentMap
.
get
(
oaUser
.
getPrimaryDepartmentId
())))
.
collect
(
Collectors
.
toMap
(
OaUser:
:
getOaUserId
,
oaUser
->
oaUser
));
costDomains
.
forEach
(
costDomain
->
{
costDomain
.
setPrimaryDepartmentId
(
oaUserMap
.
get
(
costDomain
.
getCreateUserid
()).
getPrimaryDepartmentId
())
costDomain
.
setPrimaryDepartmentName
(
oaUserMap
.
get
(
costDomain
.
getCreateUserid
()).
getPrimaryDepartment
().
getName
());
});
}
@Resource
CostReviewerMapper
costReviewerMapper
;
@Resource
...
...
@@ -260,7 +281,7 @@ public abstract class AbstractCostService implements CostService {
costNo
=
costNo
.
split
(
"-"
)[
0
];
}
applycallbackDomain
.
setCostNo
(
costNo
);
if
(
com
.
bailuntec
.
common
.
StringUtils
.
isNotEmpty
(
applyCallbackUrlVo
.
getData
().
getMessage
()))
{
if
(
com
.
bailuntec
.
common
.
StringUtils
.
isNotEmpty
(
applyCallbackUrlVo
.
getData
().
getMessage
()))
{
applycallbackDomain
.
setMessage
(
applyCallbackUrlVo
.
getData
().
getMessage
().
toUpperCase
());
}
applycallbackDomain
.
setApplyno
(
applycallbackDomain
.
getApplyno
().
toUpperCase
());
...
...
@@ -288,7 +309,7 @@ public abstract class AbstractCostService implements CostService {
costNo
=
split
[
0
];
}
costCashiercallbackDomain
.
setCostNo
(
costNo
);
if
(
com
.
bailuntec
.
common
.
StringUtils
.
isNotEmpty
(
costCashiercallbackDomain
.
getMessage
()))
{
if
(
com
.
bailuntec
.
common
.
StringUtils
.
isNotEmpty
(
costCashiercallbackDomain
.
getMessage
()))
{
costCashiercallbackDomain
.
setMessage
(
costCashiercallbackDomain
.
getMessage
().
toUpperCase
());
}
...
...
bailuntec-cost-core/src/main/resources/log4j2.xml
0 → 100644
View file @
46d02f20
<?xml version="1.0" encoding="UTF-8"?>
<Configuration
debug=
"off"
>
<Properties>
<Property
name=
"CATALINA_BASE_LOGPATH"
>
${sys:LOG_HOME}/logs
</Property>
<Property
name=
"logName"
>
business.api
</Property>
</Properties>
<Appenders>
<Console
name=
"CONSOLE"
target=
"SYSTEM_OUT"
>
<patternLayout
charset=
"UTF-8"
pattern=
"[${logName}]%d{HH:mm:ss.SSS}:%4p %t [%l] - %m%n"
/>
</Console>
<RollingRandomAccessFile
name=
"FILE"
fileName=
"${CATALINA_BASE_LOGPATH}/${logName}.log"
filePattern=
"${CATALINA_BASE_LOGPATH}/${logName}.%date{yyyy-MM-dd}-%i.zip"
>
<PatternLayout
charset=
"UTF-8"
pattern=
"%d{HH:mm:ss.SSS}:%4p [%X{traceId}] %t [%l] - %m%n"
/>
<Policies>
<TimeBasedTriggeringPolicy
modulate=
"true"
interval=
"1"
/>
<SizeBasedTriggeringPolicy
size=
"100 MB"
/>
</Policies>
<DefaultRolloverStrategy>
<Delete
basePath=
"${CATALINA_BASE_LOGPATH}"
maxDepth=
"1"
>
<IfFileName
glob=
"${logName}*.log"
/>
<IfLastModified
age=
"30d"
/>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<!-- <AsyncLogger name="org.springframework" level="DEBUG" includeLocation="true" /> -->
<AsyncLogger
name=
"com.blt"
level=
"DEBUG"
includeLocation=
"true"
/>
<AsyncLogger
name=
"io.lettuce"
level=
"ERROR"
includeLocation=
"true"
/>
<AsyncRoot
level=
"INFO"
includeLocation=
"true"
>
<appender-ref
ref=
"FILE"
/>
<!-- <appender-ref ref="CONSOLE"/>-->
</AsyncRoot>
</Loggers>
</Configuration>
bailuntec-cost-core/src/main/shell/deploy-cost-prod.sh
View file @
46d02f20
...
...
@@ -9,4 +9,22 @@ mvn clean package -U -Dmaven.test.skip=true -Dmaven.compile.fork=true
# shellcheck disable=SC2009
ps
-ef
|
grep
cost-core |
grep
-v
grep
|
grep
prod | awk
'{print $2}'
| xargs
kill
-9
# 运行
nohup java
-Xms2G
-Xmx2G
-jar
-Dspring
.profiles.active
=
prod /home/ubuntu/data/other/dc-cost-system/bailuntec-cost-core/target/bailuntec-cost-core-1.0-SNAPSHOT.jar &
nohup java
\
-Xms2G
\
-Xmx2G
\
-XX
:NewSize
=
512m
\
-XX
:MetaspaceSize
=
128m
\
-XX
:MaxDirectMemorySize
=
2G
\
-XX
:+UseG1GC
\
-XX
:+AggressiveOpts
\
-Dfile
.encoding
=
UTF-8
\
-Djava
.net.preferIPv4Stack
=
true
\
-Djava
.net.preferIPv4Addresses
\
-Duser
.timezone
=
Asia/Shanghai
\
-DLOG_HOME
=
/home/ubuntu/data/other/dc-cost-system/bailuntec-cost-core
\
-Dspring
.profiles.active
=
prod
\
-jar
/home/ubuntu/data/other/dc-cost-system/bailuntec-cost-core/target/bailuntec-cost-core-1.0-SNAPSHOT.jar
>
/dev/null 2>&1 &
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