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
3d2a4f9d
Commit
3d2a4f9d
authored
Oct 29, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
0dc76b10
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
1 deletion
+41
-1
CostTemplateColMapper.java
.../com/blt/other/module/cost/dao/CostTemplateColMapper.java
+4
-0
CostTemplateCol.java
...java/com/blt/other/module/cost/model/CostTemplateCol.java
+0
-1
CostTemplateColServiceImpl.java
...service/impl/costtemplate/CostTemplateColServiceImpl.java
+34
-0
CostTemplateColMapper.xml
.../src/main/resources/mapper/cost/CostTemplateColMapper.xml
+3
-0
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dao/CostTemplateColMapper.java
View file @
3d2a4f9d
...
...
@@ -3,6 +3,8 @@ package com.blt.other.module.cost.dao;
import
com.blt.other.module.cost.model.CostTemplateCol
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
* <p>
* 费用单模版 Mapper 接口
...
...
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
CostTemplateColMapper
extends
BaseMapper
<
CostTemplateCol
>
{
List
<
CostTemplateCol
>
selectByTemplateId
(
Integer
costTemplateId
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/CostTemplateCol.java
View file @
3d2a4f9d
...
...
@@ -63,7 +63,6 @@ public class CostTemplateCol implements Serializable {
private
String
companyScope
;
@TableField
(
exist
=
false
)
private
String
companyScopeStr
;
@TableField
(
exist
=
false
)
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costtemplate/CostTemplateColServiceImpl.java
View file @
3d2a4f9d
...
...
@@ -5,6 +5,7 @@ import com.bailuntec.common.StringUtils;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.cost.dao.CostTemplateColMapper
;
import
com.blt.other.module.cost.dto.CostTemplateColApiReq
;
import
com.blt.other.module.cost.model.CostTemplate
;
...
...
@@ -12,6 +13,7 @@ import com.blt.other.module.cost.model.CostTemplateCol;
import
com.blt.other.module.cost.service.ICostTemplateBaseColService
;
import
com.blt.other.module.cost.service.ICostTemplateColService
;
import
com.blt.other.module.cost.service.ICostTemplateService
;
import
com.google.common.collect.Lists
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -33,6 +35,8 @@ public class CostTemplateColServiceImpl extends ServiceImpl<CostTemplateColMappe
ICostTemplateService
costTemplateService
;
@Resource
ICostTemplateBaseColService
costTemplateBaseColService
;
@Resource
CostCompanyDao
costCompanyDao
;
@Override
public
void
delete
(
Integer
id
)
{
...
...
@@ -41,6 +45,13 @@ public class CostTemplateColServiceImpl extends ServiceImpl<CostTemplateColMappe
throw
new
BizRuntimeException
(
"unable to remove default costTemplateCol"
);
}
this
.
removeById
(
id
);
List
<
CostTemplateCol
>
costTemplateColList
=
baseMapper
.
selectByTemplateId
(
costTemplateCol
.
getCostTemplateId
());
CostTemplate
costTemplate
=
costTemplateService
.
getById
(
costTemplateCol
.
getCostTemplateId
());
costTemplate
.
setSetAutoCheck
(
ListUtil
.
isNotEmpty
(
costTemplateColList
.
stream
()
.
filter
(
item
->
item
.
getAutoRuleType
()
>
0
)
.
collect
(
Collectors
.
toList
())));
costTemplateService
.
updateById
(
costTemplate
);
}
@Override
...
...
@@ -48,15 +59,38 @@ public class CostTemplateColServiceImpl extends ServiceImpl<CostTemplateColMappe
if
(
costTemplateCol
.
getIsDefault
())
{
throw
new
BizRuntimeException
(
"unable to modify default costTemplateCol"
);
}
costTemplateCol
.
setCompanyScopeStr
(
this
.
getCompanyScopeStr
(
costTemplateCol
.
getCompanyScope
()));
this
.
updateById
(
costTemplateCol
);
if
(
costTemplateCol
.
getCostTemplateBaseCol
()
!=
null
)
{
costTemplateBaseColService
.
updateById
(
costTemplateCol
.
getCostTemplateBaseCol
());
}
}
@Override
public
void
add
(
CostTemplateCol
costTemplateCol
)
{
costTemplateCol
.
setCompanyScopeStr
(
this
.
getCompanyScopeStr
(
costTemplateCol
.
getCompanyScope
()));
this
.
save
(
costTemplateCol
);
CostTemplate
costTemplate
=
costTemplateService
.
getById
(
costTemplateCol
.
getCostTemplateId
());
costTemplate
.
setSetAutoCheck
(
true
);
costTemplateService
.
updateById
(
costTemplate
);
}
/**
* 获取公司主体范围中文
*
* @param companyScope 公司主体范围no 逗号分割
* @return 取公司主体范围中文 逗号分割
*/
private
String
getCompanyScopeStr
(
String
companyScope
)
{
return
Lists
.
newArrayList
(
companyScope
.
split
(
","
))
.
stream
()
.
map
(
companyNo
->
costCompanyDao
.
selectByNo
(
companyNo
).
getCompanyName
())
.
collect
(
Collectors
.
joining
(
","
));
}
@Override
...
...
bailuntec-cost-core/src/main/resources/mapper/cost/CostTemplateColMapper.xml
View file @
3d2a4f9d
...
...
@@ -2,4 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.blt.other.module.cost.dao.CostTemplateColMapper"
>
<select
id=
"selectByTemplateId"
resultType=
"com.blt.other.module.cost.model.CostTemplateCol"
>
select * from cost_template_col where cost_template_id = #{costTemplateId}
</select>
</mapper>
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