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
4cbf42d9
Commit
4cbf42d9
authored
Jan 22, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# fee miniapp
parent
80e2ab03
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
106 additions
and
7 deletions
+106
-7
CostDetailDto.java
...c/main/java/com/bailuntec/cost/api/dto/CostDetailDto.java
+59
-0
CostDto.java
...ces/src/main/java/com/bailuntec/cost/api/dto/CostDto.java
+3
-0
CostDetailDomain.java
...ava/com/blt/other/module/cost/model/CostDetailDomain.java
+7
-0
CostDomain.java
...main/java/com/blt/other/module/cost/model/CostDomain.java
+9
-0
CostDetailService.java
.../com/blt/other/module/cost/service/CostDetailService.java
+3
-2
AppCostServiceImpl.java
...lt/other/module/cost/service/impl/AppCostServiceImpl.java
+5
-0
CostDetailServiceImpl.java
...other/module/cost/service/impl/CostDetailServiceImpl.java
+20
-5
No files found.
cost-interfaces/src/main/java/com/bailuntec/cost/api/dto/CostDetailDto.java
0 → 100644
View file @
4cbf42d9
package
com
.
bailuntec
.
cost
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/1/22 1:51 下午
*/
@Data
public
class
CostDetailDto
{
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"费用详情编号"
)
private
String
detailNo
;
@ApiModelProperty
(
"费用单编号"
)
private
String
costNo
;
@ApiModelProperty
(
"类型编号"
)
private
String
typeNo
;
@ApiModelProperty
(
"类型标题"
)
private
String
typeName
;
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
@ApiModelProperty
(
"创建人id"
)
private
Integer
createUserid
;
@ApiModelProperty
(
"创建人名称"
)
private
String
createUsername
;
@ApiModelProperty
(
"付款理由"
)
private
String
costReason
;
@ApiModelProperty
(
"费用详情金额"
)
private
BigDecimal
amount
;
@ApiModelProperty
(
"币种"
)
private
String
dic
;
@ApiModelProperty
(
"借支单-借支类型"
)
private
String
lendType
;
@ApiModelProperty
(
"文件地址"
)
private
String
filePath
;
@ApiModelProperty
(
"项目"
)
private
String
projectType
;
@ApiModelProperty
(
"客户编号"
)
private
String
customerNum
;
}
cost-interfaces/src/main/java/com/bailuntec/cost/api/dto/CostDto.java
View file @
4cbf42d9
...
@@ -225,4 +225,7 @@ public class CostDto {
...
@@ -225,4 +225,7 @@ public class CostDto {
private
Boolean
isPic
;
private
Boolean
isPic
;
@TableField
(
exist
=
false
)
private
List
<
CostDetailDto
>
costDetailList
;
}
}
cost-service/src/main/java/com/blt/other/module/cost/model/CostDetailDomain.java
View file @
4cbf42d9
package
com
.
blt
.
other
.
module
.
cost
.
model
;
package
com
.
blt
.
other
.
module
.
cost
.
model
;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.cost.api.dto.CostDetailDto
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
...
@@ -52,5 +54,10 @@ public class CostDetailDomain {
...
@@ -52,5 +54,10 @@ public class CostDetailDomain {
private
String
customerNum
;
private
String
customerNum
;
public
CostDetailDto
castToDto
()
{
CostDetailDto
costDetailDto
=
new
CostDetailDto
();
BeanUtils
.
copyProperties
(
this
,
costDetailDto
);
return
costDetailDto
;
}
}
}
cost-service/src/main/java/com/blt/other/module/cost/model/CostDomain.java
View file @
4cbf42d9
package
com
.
blt
.
other
.
module
.
cost
.
model
;
package
com
.
blt
.
other
.
module
.
cost
.
model
;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.common.ListUtil
;
import
com.bailuntec.common.SpringContextUtil
;
import
com.bailuntec.common.SpringContextUtil
;
import
com.bailuntec.common.StringUtils
;
import
com.bailuntec.common.StringUtils
;
import
com.bailuntec.cost.api.dto.CostAttach
;
import
com.bailuntec.cost.api.dto.CostAttach
;
...
@@ -24,6 +25,7 @@ import java.text.DecimalFormat;
...
@@ -24,6 +25,7 @@ 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.stream.Collectors
;
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"cost"
,
autoResultMap
=
true
)
@TableName
(
value
=
"cost"
,
autoResultMap
=
true
)
...
@@ -238,6 +240,10 @@ public class CostDomain implements Serializable {
...
@@ -238,6 +240,10 @@ public class CostDomain implements Serializable {
private
String
costCurrentReviewer
;
private
String
costCurrentReviewer
;
@TableField
(
exist
=
false
)
private
List
<
CostDetailDomain
>
costDetailDomainList
;
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"
);
private
final
static
List
<
String
>
picFilter
=
Lists
.
newArrayList
(
"png"
,
"jpg"
,
"bmp,"
,
"gif"
);
...
@@ -293,6 +299,9 @@ public class CostDomain implements Serializable {
...
@@ -293,6 +299,9 @@ public class CostDomain implements Serializable {
}
}
costDto
.
setIsPic
(
picFilter
.
contains
(
extension
));
costDto
.
setIsPic
(
picFilter
.
contains
(
extension
));
}
}
if
(
ListUtil
.
isNotEmpty
(
costDetailDomainList
))
{
costDto
.
setCostDetailList
(
costDetailDomainList
.
stream
().
map
(
CostDetailDomain:
:
castToDto
).
collect
(
Collectors
.
toList
()));
}
return
costDto
;
return
costDto
;
}
}
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/CostDetailService.java
View file @
4cbf42d9
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.blt.other.module.cost.dto.request.ResetReq
;
import
com.blt.other.module.cost.dto.request.ResetReq
;
import
com.blt.other.module.cost.dto.response.ResetResp
;
import
com.blt.other.module.cost.dto.response.ResetResp
;
import
com.blt.other.module.cost.model.CostDetailDomain
;
import
com.blt.other.module.cost.model.CostDetailDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
import
java.util.List
;
import
java.util.List
;
...
@@ -13,9 +14,9 @@ public interface CostDetailService extends IService<CostDetailDomain> {
...
@@ -13,9 +14,9 @@ public interface CostDetailService extends IService<CostDetailDomain> {
CostDetailDomain
getCostDetailByDetailNo
(
String
detailNo
);
CostDetailDomain
getCostDetailByDetailNo
(
String
detailNo
);
void
deleteFilePath
(
String
detailNo
);
Integer
update
(
CostDetailDomain
domain
);
Integer
update
(
CostDetailDomain
domain
);
ResetResp
reset
(
ResetReq
req
);
ResetResp
reset
(
ResetReq
req
);
void
setDetail
(
List
<
CostDomain
>
costDomainList
);
}
}
cost-service/src/main/java/com/blt/other/module/cost/service/impl/AppCostServiceImpl.java
View file @
4cbf42d9
...
@@ -12,6 +12,7 @@ import com.blt.other.module.cost.dto.request.AppCostPassReq;
...
@@ -12,6 +12,7 @@ import com.blt.other.module.cost.dto.request.AppCostPassReq;
import
com.blt.other.module.cost.dto.request.AppCostRejectReq
;
import
com.blt.other.module.cost.dto.request.AppCostRejectReq
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.AppCostService
;
import
com.blt.other.module.cost.service.AppCostService
;
import
com.blt.other.module.cost.service.CostDetailService
;
import
com.blt.other.module.cost.service.impl.costcheck.*
;
import
com.blt.other.module.cost.service.impl.costcheck.*
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -30,11 +31,14 @@ public class AppCostServiceImpl implements AppCostService {
...
@@ -30,11 +31,14 @@ public class AppCostServiceImpl implements AppCostService {
@Resource
@Resource
CostDao
costDao
;
CostDao
costDao
;
@Resource
CostDetailService
costDetailService
;
@Override
@Override
public
Page
<
CostDto
>
appCheckCostList
(
AppCheckCostListReq
req
)
{
public
Page
<
CostDto
>
appCheckCostList
(
AppCheckCostListReq
req
)
{
IPage
<
CostDomain
>
costDomainIPage
=
new
Page
<>(
req
.
getPageNum
(),
req
.
getPageSize
());
IPage
<
CostDomain
>
costDomainIPage
=
new
Page
<>(
req
.
getPageNum
(),
req
.
getPageSize
());
costDetailService
.
setDetail
(
costDomainIPage
.
getRecords
());
return
(
Page
<
CostDto
>)
costDao
.
appCheckCostList
(
costDomainIPage
,
req
).
convert
(
CostDomain:
:
castToDto
);
return
(
Page
<
CostDto
>)
costDao
.
appCheckCostList
(
costDomainIPage
,
req
).
convert
(
CostDomain:
:
castToDto
);
}
}
...
@@ -53,6 +57,7 @@ public class AppCostServiceImpl implements AppCostService {
...
@@ -53,6 +57,7 @@ public class AppCostServiceImpl implements AppCostService {
@Override
@Override
public
Page
<
CostDto
>
appCostList
(
AppCostListReq
req
)
{
public
Page
<
CostDto
>
appCostList
(
AppCostListReq
req
)
{
IPage
<
CostDomain
>
costDomainIPage
=
new
Page
<>(
req
.
getPageNum
(),
req
.
getPageSize
());
IPage
<
CostDomain
>
costDomainIPage
=
new
Page
<>(
req
.
getPageNum
(),
req
.
getPageSize
());
costDetailService
.
setDetail
(
costDomainIPage
.
getRecords
());
return
(
Page
<
CostDto
>)
costDao
.
appCostList
(
costDomainIPage
,
req
).
convert
(
CostDomain:
:
castToDto
);
return
(
Page
<
CostDto
>)
costDao
.
appCostList
(
costDomainIPage
,
req
).
convert
(
CostDomain:
:
castToDto
);
}
}
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostDetailServiceImpl.java
View file @
4cbf42d9
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
;
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.common.ListUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.common.util.PathUtil
;
import
com.blt.other.common.util.PathUtil
;
...
@@ -12,6 +13,7 @@ import com.blt.other.module.cost.dto.request.ResetReq;
...
@@ -12,6 +13,7 @@ import com.blt.other.module.cost.dto.request.ResetReq;
import
com.blt.other.module.cost.dto.response.ResetResp
;
import
com.blt.other.module.cost.dto.response.ResetResp
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.model.CostDetailDomain
;
import
com.blt.other.module.cost.model.CostDetailDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostDetailService
;
import
com.blt.other.module.cost.service.CostDetailService
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.utils.CostFileUtil
;
import
com.blt.other.module.cost.utils.CostFileUtil
;
...
@@ -20,6 +22,8 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -20,6 +22,8 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
CostDetailServiceImpl
extends
ServiceImpl
<
CostDetailDao
,
CostDetailDomain
>
implements
CostDetailService
{
public
class
CostDetailServiceImpl
extends
ServiceImpl
<
CostDetailDao
,
CostDetailDomain
>
implements
CostDetailService
{
...
@@ -39,11 +43,6 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
...
@@ -39,11 +43,6 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
return
costDetailDao
.
selectByDetailNo
(
detailNo
);
return
costDetailDao
.
selectByDetailNo
(
detailNo
);
}
}
@Override
public
void
deleteFilePath
(
String
detailNo
)
{
costDetailDao
.
deletedFilePath
(
detailNo
);
}
@Transactional
@Transactional
@Override
@Override
...
@@ -88,4 +87,20 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
...
@@ -88,4 +87,20 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
resetResp
.
setSuccess
(
true
);
resetResp
.
setSuccess
(
true
);
return
resetResp
;
return
resetResp
;
}
}
@Override
public
void
setDetail
(
List
<
CostDomain
>
costDomainList
)
{
if
(
ListUtil
.
isNotEmpty
(
costDomainList
))
{
List
<
String
>
costNoList
=
costDomainList
.
stream
().
map
(
CostDomain:
:
getCostNo
).
collect
(
Collectors
.
toList
());
List
<
CostDetailDomain
>
costDetailDomainList
=
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
CostDetailDomain
>()
.
in
(
CostDetailDomain:
:
getCostNo
,
costNoList
));
Map
<
String
,
List
<
CostDetailDomain
>>
costDetailDomainMap
=
costDetailDomainList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
CostDetailDomain:
:
getCostNo
));
costDomainList
.
forEach
(
costDomain
->
costDomain
.
setCostDetailDomainList
(
costDetailDomainMap
.
get
(
costDomain
.
getCostNo
())));
}
}
}
}
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