Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-cost
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
huluobin
bailuntec-cost
Commits
728a9486
Commit
728a9486
authored
Jan 27, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 更新
parent
738072ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
39 deletions
+22
-39
Dockerfile
cost-service/src/main/docker/Dockerfile
+0
-10
RequestBakFilter.java
...in/java/com/blt/other/common/filter/RequestBakFilter.java
+1
-1
AbstractCostService.java
...er/module/cost/service/impl/cost/AbstractCostService.java
+21
-28
No files found.
cost-service/src/main/docker/Dockerfile
View file @
728a9486
...
@@ -8,15 +8,5 @@ https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/community" > /etc/apk/repositori
...
@@ -8,15 +8,5 @@ https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/community" > /etc/apk/repositori
RUN
apk
--update
add curl bash ttf-dejavu
&&
\
RUN
apk
--update
add curl bash ttf-dejavu
&&
\
rm
-rf
/var/cache/apk/
*
rm
-rf
/var/cache/apk/
*
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.6/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.6/community"
>>
/etc/apk/repositories
\
&&
apk update upgrade
\
&&
apk add
--no-cache
procps unzip curl bash tzdata
\
&&
apk add ttf-dejavu
\
&&
ln
-sf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
\
&&
echo
"Asia/Shanghai"
>
/etc/timezone
RUN
apk add
--update
ttf-dejavu fontconfig
&&
rm
-rf
/var/cache/apk/
*
ENTRYPOINT
["java","-Xms1G","-Xmx1G","-jar","-Dspring.profiles.active=test","/cost-service-1.0-SNAPSHOT.jar"]
ENTRYPOINT
["java","-Xms1G","-Xmx1G","-jar","-Dspring.profiles.active=test","/cost-service-1.0-SNAPSHOT.jar"]
EXPOSE
8082
EXPOSE
8082
cost-service/src/main/java/com/blt/other/common/filter/RequestBakFilter.java
View file @
728a9486
...
@@ -16,7 +16,7 @@ import java.io.IOException;
...
@@ -16,7 +16,7 @@ import java.io.IOException;
*/
*/
@Component
@Component
@ServletComponentScan
@ServletComponentScan
@WebFilter
(
urlPatterns
=
{
"/
purchase/other/
*"
},
filterName
=
"requestBakFilter"
)
@WebFilter
(
urlPatterns
=
{
"/*"
},
filterName
=
"requestBakFilter"
)
public
class
RequestBakFilter
implements
Filter
{
public
class
RequestBakFilter
implements
Filter
{
@Override
@Override
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/cost/AbstractCostService.java
View file @
728a9486
...
@@ -200,40 +200,33 @@ public abstract class AbstractCostService implements CostService {
...
@@ -200,40 +200,33 @@ public abstract class AbstractCostService implements CostService {
@Override
@Override
public
void
resetCost
(
String
costNo
)
{
public
void
resetCost
(
String
costNo
)
{
List
<
CostDetailDomain
>
costDetailDomains
=
costDetailDao
.
selectListByCostNo
(
costNo
);
List
<
CostDetailDomain
>
costDetailDomains
=
costDetailDao
.
selectListByCostNo
(
costNo
);
CostDetailDomain
costDetailDomain
=
costDetailDomains
.
get
(
0
);
BigDecimal
amount
=
new
BigDecimal
(
0
);
if
(
costDetailDomains
.
stream
().
collect
(
Collectors
.
groupingBy
(
CostDetailDomain:
:
getDic
)).
keySet
().
size
()
>
1
)
{
if
(
ListUtil
.
isNotEmpty
(
costDetailDomains
))
{
throw
new
RuntimeException
(
"请统一货币单位"
);
}
//费用单总金额重新计算
if
(
costDetailDomains
.
stream
().
collect
(
Collectors
.
groupingBy
(
CostDetailDomain:
:
getTypeId
)).
keySet
().
size
()
>
1
)
{
if
(
costDetailDomains
.
stream
().
collect
(
Collectors
.
groupingBy
(
CostDetailDomain:
:
getDic
)).
keySet
().
size
()
>
1
)
{
throw
new
RuntimeException
(
"请统一费用类型"
);
throw
new
RuntimeException
(
"请统一货币单位"
);
}
}
for
(
CostDetailDomain
domain
:
costDetailDomains
)
{
amount
=
amount
.
add
(
domain
.
getAmount
());
}
CostDomain
costDomain
=
this
.
getCostByCostNo
(
costNo
);
costDomain
.
setAmount
(
amount
);
BigDecimal
toRmbRate
=
CurUtils
.
getCur
(
costDomain
.
getDic
(),
"CNY"
);
costDomain
.
setToRmbRate
(
toRmbRate
);
costDomain
.
setAmountRmb
(
costDomain
.
getAmount
().
multiply
(
toRmbRate
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
CostDetailDomain
costDetailDomain
=
costDetailDomains
.
get
(
0
);
CostDomain
costDomain
=
this
.
getCostByCostNo
(
costNo
);
costDomain
.
setAmount
(
costDetailDomains
.
stream
().
map
(
CostDetailDomain:
:
getAmount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectById
(
costDetailDomain
.
getTypeId
());
BigDecimal
toRmbRate
=
CurUtils
.
getCur
(
costDomain
.
getDic
(),
"CNY"
);
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectById
(
costTypeDomain
.
getAccountingSubjectId
());
costDomain
.
setToRmbRate
(
toRmbRate
);
costDomain
.
setAmountRmb
(
costDomain
.
getAmount
().
multiply
(
toRmbRate
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
costDomain
.
setTypeId
(
costTypeDomain
.
getId
());
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectById
(
costDetailDomain
.
getTypeId
());
costDomain
.
setTypeNo
(
costTypeDomain
.
getTypeNo
());
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectById
(
costTypeDomain
.
getAccountingSubjectId
());
costDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
costDomain
.
setAccountingSubjectNo
(
accountingSubject
.
getSubjectNo
());
costDomain
.
setAccountingSubjectName
(
accountingSubject
.
getName
());
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDomain
.
setTypeId
(
costTypeDomain
.
getId
());
costDomain
.
setTypeNo
(
costTypeDomain
.
getTypeNo
());
costDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
costDomain
.
setAccountingSubjectNo
(
accountingSubject
.
getSubjectNo
());
costDomain
.
setAccountingSubjectName
(
accountingSubject
.
getName
());
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
costDao
.
updateById
(
costDomain
);
}
}
}
@Override
@Override
...
...
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