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
62fcd276
Commit
62fcd276
authored
Jan 20, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# update
parent
5edec21a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
CostDto.java
...ces/src/main/java/com/bailuntec/cost/api/dto/CostDto.java
+2
-0
CostDomain.java
...main/java/com/blt/other/module/cost/model/CostDomain.java
+21
-9
No files found.
cost-interfaces/src/main/java/com/bailuntec/cost/api/dto/CostDto.java
View file @
62fcd276
...
@@ -223,4 +223,6 @@ public class CostDto {
...
@@ -223,4 +223,6 @@ public class CostDto {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
CostTemplateDto
costTemplate
;
private
CostTemplateDto
costTemplate
;
private
Boolean
isPic
;
}
}
cost-service/src/main/java/com/blt/other/module/cost/model/CostDomain.java
View file @
62fcd276
...
@@ -2,6 +2,7 @@ package com.blt.other.module.cost.model;
...
@@ -2,6 +2,7 @@ package com.blt.other.module.cost.model;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.common.SpringContextUtil
;
import
com.bailuntec.common.SpringContextUtil
;
import
com.bailuntec.common.StringUtils
;
import
com.bailuntec.cost.api.dto.CostAttach
;
import
com.bailuntec.cost.api.dto.CostAttach
;
import
com.bailuntec.cost.api.dto.CostDto
;
import
com.bailuntec.cost.api.dto.CostDto
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
...
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
...
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.database.mapper.StatusMapper
;
import
com.blt.other.database.mapper.StatusMapper
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.google.common.collect.Lists
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -22,8 +24,6 @@ import java.text.DecimalFormat;
...
@@ -22,8 +24,6 @@ import java.text.DecimalFormat;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"cost"
,
autoResultMap
=
true
)
@TableName
(
value
=
"cost"
,
autoResultMap
=
true
)
...
@@ -240,13 +240,16 @@ public class CostDomain implements Serializable {
...
@@ -240,13 +240,16 @@ public class CostDomain implements Serializable {
private
static
final
String
REGEX_CHINESE
=
"[\u4e00-\u9fa5]"
;
// 中文正则
private
static
final
String
REGEX_CHINESE
=
"[\u4e00-\u9fa5]"
;
// 中文正则
private
final
static
List
<
String
>
picFilter
=
Lists
.
newArrayList
(
"png"
,
"jpg"
,
"bmp,"
,
"gif"
);
public
CostDto
castToDto
()
{
public
CostDto
castToDto
()
{
StatusMapper
statusMapper
=
SpringContextUtil
.
getBean
(
StatusMapper
.
class
);
CostDto
costDto
=
new
CostDto
();
CostDto
costDto
=
new
CostDto
();
BeanUtils
.
copyProperties
(
this
,
costDto
);
BeanUtils
.
copyProperties
(
this
,
costDto
);
StatusMapper
statusMapper
=
SpringContextUtil
.
getBean
(
StatusMapper
.
class
);
/*字典翻译*/
/*字典翻译*/
costDto
.
setCostStatusDto
(
statusMapper
.
getStatusValue
(
"cost_status"
,
this
.
getCostStatus
()));
costDto
.
setCostStatusDto
(
statusMapper
.
getStatusValue
(
"cost_status"
,
this
.
getCostStatus
()));
if
(
null
!=
this
.
getIsLend
())
{
if
(
null
!=
this
.
getIsLend
())
{
...
@@ -258,21 +261,21 @@ public class CostDomain implements Serializable {
...
@@ -258,21 +261,21 @@ public class CostDomain implements Serializable {
if
(
null
!=
this
.
getLendStatus
())
{
if
(
null
!=
this
.
getLendStatus
())
{
costDto
.
setLendStatusDto
(
statusMapper
.
getStatusValue
(
"lend_status"
,
this
.
getLendStatus
()));
costDto
.
setLendStatusDto
(
statusMapper
.
getStatusValue
(
"lend_status"
,
this
.
getLendStatus
()));
}
}
// 抵个税
if
(
1
==
costDto
.
getCostForm
())
{
costDto
.
setIsTaxStr
(
statusMapper
.
getStatusValue
(
"is_tax"
,
costDto
.
getIsTax
()));
}
// 获取文件名
// 获取文件名
String
filePath
=
this
.
getFilePath
();
String
filePath
=
this
.
getFilePath
();
if
(
null
!=
filePath
&&
filePath
.
contains
(
"&"
))
{
if
(
null
!=
filePath
&&
filePath
.
contains
(
"&"
))
{
String
fileName
=
filePath
.
substring
(
filePath
.
lastIndexOf
(
"&"
)
+
1
);
String
fileName
=
filePath
.
substring
(
filePath
.
lastIndexOf
(
"&"
)
+
1
);
costDto
.
setFileName
(
fileName
);
costDto
.
setFileName
(
fileName
);
}
}
// 抵个税
if
(
1
==
costDto
.
getCostForm
())
{
costDto
.
setIsTaxStr
(
statusMapper
.
getStatusValue
(
"is_tax"
,
costDto
.
getIsTax
()));
}
// 币种
// 币种
costDto
.
setDicDto
(
CurUtils
.
getCurDto
(
costDto
.
getDic
()));
costDto
.
setDicDto
(
CurUtils
.
getCurDto
(
costDto
.
getDic
()));
costDto
.
setPayDicDto
(
CurUtils
.
getCurDto
(
costDto
.
getPayDic
()));
costDto
.
setPayDicDto
(
CurUtils
.
getCurDto
(
costDto
.
getPayDic
()));
//
DecimalFormat
df
=
new
DecimalFormat
(
"#0.00"
);
DecimalFormat
df
=
new
DecimalFormat
(
"#0.00"
);
if
(
null
!=
costDto
.
getAmount
())
{
if
(
null
!=
costDto
.
getAmount
())
{
String
format
=
df
.
format
(
costDto
.
getAmount
());
String
format
=
df
.
format
(
costDto
.
getAmount
());
...
@@ -282,6 +285,15 @@ public class CostDomain implements Serializable {
...
@@ -282,6 +285,15 @@ public class CostDomain implements Serializable {
String
format
=
df
.
format
(
costDto
.
getPayPlanAmount
());
String
format
=
df
.
format
(
costDto
.
getPayPlanAmount
());
costDto
.
setPayPlanAmountDto
(
format
);
costDto
.
setPayPlanAmountDto
(
format
);
}
}
if
(
StringUtils
.
isNotEmpty
(
filePath
))
{
int
i
=
filePath
.
lastIndexOf
(
'.'
);
String
extension
=
""
;
if
(
i
>
0
)
{
extension
=
filePath
.
substring
(
i
+
1
);
}
costDto
.
setIsPic
(
picFilter
.
contains
(
extension
));
}
return
costDto
;
return
costDto
;
}
}
...
...
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