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
b0543c49
Commit
b0543c49
authored
Dec 26, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
付款计划详情 一级科目
parent
1b6044af
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
119 additions
and
24 deletions
+119
-24
CostPlanTempDomain.java
...java/com/blt/other/database/model/CostPlanTempDomain.java
+7
-1
CostTypeController.java
.../blt/other/module/cost/controller/CostTypeController.java
+6
-1
CostTypeDao.java
.../main/java/com/blt/other/module/cost/dao/CostTypeDao.java
+3
-0
AddItemReq.java
...ava/com/blt/other/module/cost/dto/request/AddItemReq.java
+15
-3
ResetItemReq.java
...a/com/blt/other/module/cost/dto/request/ResetItemReq.java
+19
-3
CostDetailDomain.java
...ava/com/blt/other/module/cost/model/CostDetailDomain.java
+8
-2
CostDomain.java
...main/java/com/blt/other/module/cost/model/CostDomain.java
+0
-1
CostTypeService.java
...va/com/blt/other/module/cost/service/CostTypeService.java
+8
-0
CostTypeServiceImpl.java
...t/other/module/cost/service/impl/CostTypeServiceImpl.java
+5
-1
CostPlanNewPayServiceImpl.java
...cost/service/impl/costplan/CostPlanNewPayServiceImpl.java
+5
-3
CostPlanTempServiceImpl.java
...e/cost/service/impl/costplan/CostPlanTempServiceImpl.java
+26
-9
CostTypeMapper.xml
...ec-cost-core/src/main/resources/mapper/CostTypeMapper.xml
+17
-0
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/database/model/CostPlanTempDomain.java
View file @
b0543c49
...
...
@@ -4,6 +4,7 @@ import com.bailuntec.common.SpringContextUtil;
import
com.bailuntec.cost.api.dto.CostPlanTempDto
;
import
com.blt.other.common.util.PathUtil
;
import
com.blt.other.module.cost.dao.CostTypeKindDao
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -22,8 +23,13 @@ public class CostPlanTempDomain {
private
String
dic
;
// 币种
private
String
typeNo
;
// 大类编号
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
public
CostPlanTempDto
castToDto
(){
public
CostPlanTempDto
castToDto
()
{
CostTypeKindDao
costTypeKindDao
=
SpringContextUtil
.
getBean
(
CostTypeKindDao
.
class
);
CostPlanTempDto
dto
=
new
CostPlanTempDto
();
BeanUtils
.
copyProperties
(
this
,
dto
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/CostTypeController.java
View file @
b0543c49
...
...
@@ -36,7 +36,6 @@ public class CostTypeController {
return
CostResult
.
success
(
page
);
}
@ApiOperation
(
"获取费用类型详情"
)
@PostMapping
(
"/queryDetail"
)
public
CostResult
<
CostTypeResult
>
queryDetail
(
@RequestParam
Integer
id
)
{
...
...
@@ -44,6 +43,12 @@ public class CostTypeController {
return
CostResult
.
success
(
result
);
}
@ApiOperation
(
"根据编码获取费用类型详情"
)
@PostMapping
(
"/queryByNo"
)
public
CostResult
<
CostTypeResult
>
queryByNo
(
@RequestParam
String
typeNo
)
{
CostTypeResult
result
=
costTypeService
.
queryByNo
(
typeNo
);
return
CostResult
.
success
(
result
);
}
@ApiOperation
(
"删除费用类型详情"
)
@PostMapping
(
"/deleteById"
)
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dao/CostTypeDao.java
View file @
b0543c49
...
...
@@ -22,4 +22,7 @@ public interface CostTypeDao extends BaseMapper<CostTypeDomain> {
//获取费用类型详情
CostTypeResult
queryDetail
(
Integer
id
);
//获取费用类型详情
CostTypeResult
queryByNo
(
String
typeNo
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/AddItemReq.java
View file @
b0543c49
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
...
...
@@ -19,15 +20,26 @@ import java.math.BigDecimal;
public
class
AddItemReq
{
// 费用单表 id
private
Integer
id
;
@ApiModelProperty
(
"费用计划编号"
)
private
String
costPlanNo
;
// 费用计划编号
@ApiModelProperty
(
"计划缓存编号"
)
private
String
tempNo
;
// 计划缓存编号
private
String
kindNo
;
// 种类编号
@ApiModelProperty
(
"文件地址"
)
private
String
filePath
;
// 文件地址
@ApiModelProperty
(
"费用金额"
)
private
BigDecimal
amount
;
// 费用总金额
@ApiModelProperty
(
"付款理由"
)
private
String
costReason
;
// 付款理由
@ApiModelProperty
(
"币种"
)
private
String
dic
;
// 币种
@ApiModelProperty
(
"费用类型编号"
)
private
String
typeNo
;
// 大类编号
private
BigDecimal
planAmount
;
// private MultipartFile fileSelect;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/ResetItemReq.java
View file @
b0543c49
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -19,15 +20,30 @@ import java.math.BigDecimal;
public
class
ResetItemReq
{
private
Integer
id
;
private
Boolean
delecteFile
;
private
MultipartFile
fileSelect2
;
@ApiModelProperty
(
"费用计划编号"
)
private
String
costPlanNo
;
// 费用计划编号
@ApiModelProperty
(
"计划缓存编号"
)
private
String
tempNo
;
// 计划缓存编号
private
String
kindNo
;
// 种类编号
@ApiModelProperty
(
"文件地址"
)
private
String
filePath
;
// 文件地址
@ApiModelProperty
(
"费用金额"
)
private
BigDecimal
amount
;
// 费用总金额
@ApiModelProperty
(
"付款理由"
)
private
String
costReason
;
// 付款理由
@ApiModelProperty
(
"币种"
)
private
String
dic
;
// 币种
@ApiModelProperty
(
"费用类型编号"
)
private
String
typeNo
;
// 大类编号
private
Boolean
delecteFile
;
private
MultipartFile
fileSelect2
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/CostDetailDomain.java
View file @
b0543c49
package
com
.
blt
.
other
.
module
.
cost
.
model
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
...
...
@@ -15,8 +16,13 @@ public class CostDetailDomain {
private
String
companyName
;
// 主体名称
private
String
typeNo
;
// 类型编号
private
String
typeName
;
// 类型标题
private
String
kindNo
;
// 种类编号
private
String
kindName
;
// 种类标题
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
private
Integer
createUserid
;
// 创建人 id
private
String
createUsercode
;
// 创建人编号
private
String
createUsername
;
// 创建人名称
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/CostDomain.java
View file @
b0543c49
...
...
@@ -219,7 +219,6 @@ public class CostDomain implements Serializable {
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
//-------------
@TableField
(
exist
=
false
)
private
CostTemplate
costTemplate
;
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/CostTypeService.java
View file @
b0543c49
...
...
@@ -47,4 +47,12 @@ public interface CostTypeService extends IService<CostTypeDomain> {
* @param id id
*/
void
deleteById
(
Integer
id
);
/**
* 根据编码获取费用费用详情
*
* @param typeNo typeNo
* @return res
*/
CostTypeResult
queryByNo
(
String
typeNo
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/CostTypeServiceImpl.java
View file @
b0543c49
...
...
@@ -13,7 +13,6 @@ import com.blt.other.module.cost.dto.request.CostTypeAddReq;
import
com.blt.other.module.cost.dto.request.CostTypeModifyReq
;
import
com.blt.other.module.cost.dto.request.CostTypeQueryPageReq
;
import
com.blt.other.module.cost.dto.response.CostTypeResult
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.service.CostTypeService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
...
...
@@ -84,6 +83,11 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
baseMapper
.
deleteById
(
id
);
}
@Override
public
CostTypeResult
queryByNo
(
String
typeNo
)
{
return
baseMapper
.
queryByNo
(
typeNo
);
}
/**
* 根据ui类型获取费用类型 对应的费用模版类型
*
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewPayServiceImpl.java
View file @
b0543c49
...
...
@@ -3,12 +3,12 @@ package com.blt.other.module.cost.service.impl.costplan;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.database.model.CostPlanDomain
;
import
com.blt.other.database.model.CostPlanTempDomain
;
import
com.blt.other.module.cost.model.CostDetailDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostPlanService
;
import
com.blt.other.module.cost.utils.CostUtils
;
import
com.blt.other.database.model.CostPlanDomain
;
import
com.blt.other.database.model.CostPlanTempDomain
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -75,7 +75,6 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
throw
new
RuntimeException
(
"存在有金额、但是没有选择类型的子项目"
);
}
// 将 List<CostPlanTempDomain> 转为 List<CostDetailDomain>
AtomicInteger
index
=
new
AtomicInteger
(
1
);
List
<
CostDetailDomain
>
costDetailDomainList
=
costPlanTempDomains
.
stream
().
map
(
costPlanTempDomain
->
this
.
tempToDetail
(
costPlanTempDomain
,
costPlanDomain
,
index
.
getAndIncrement
())
...
...
@@ -106,6 +105,9 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
costDomain
.
setCostNo
(
costNo
);
costDomain
.
setTypeNo
(
typeNo
);
costDomain
.
setTypeName
(
costDetailDomains
.
get
(
0
).
getTypeName
());
costDomain
.
setAccountingSubjectNo
(
costDetailDomains
.
get
(
0
).
getAccountingSubjectNo
());
costDomain
.
setAccountingSubjectName
(
costDetailDomains
.
get
(
0
).
getAccountingSubjectName
());
// CostTypeDomain costTypeDomain = costTypeDao.selectByTypeNo(typeNo);
// costDomain.setSubjectCode(costTypeDomain.getSubjectCode());
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanTempServiceImpl.java
View file @
b0543c49
...
...
@@ -4,24 +4,29 @@ import com.bailuntec.cost.api.dto.CostPlanTempDto;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.common.util.PathUtil
;
import
com.blt.other.database.model.CostPlanDomain
;
import
com.blt.other.database.model.CostPlanTempDomain
;
import
com.blt.other.database.model.CostTypeDomain
;
import
com.blt.other.database.model.CostTypeKindDomain
;
import
com.blt.other.module.cost.dao.AccountingSubjectMapper
;
import
com.blt.other.module.cost.dao.CostPlanDao
;
import
com.blt.other.module.cost.dao.CostPlanTempDao
;
import
com.blt.other.module.cost.dao.CostTypeDao
;
import
com.blt.other.module.cost.dto.request.AddItemReq
;
import
com.blt.other.module.cost.dto.request.AddItemResp
;
import
com.blt.other.module.cost.dto.request.ResetItemReq
;
import
com.blt.other.module.cost.dto.response.GetCostTempByPlanNoResp
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.service.CostPlanTempService
;
import
com.blt.other.module.cost.service.CostTypeKindService
;
import
com.blt.other.module.cost.utils.CostFileUtil
;
import
com.blt.other.database.model.CostPlanDomain
;
import
com.blt.other.database.model.CostPlanTempDomain
;
import
com.blt.other.database.model.CostTypeKindDomain
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.lang.NonNull
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -67,18 +72,25 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
}
}
@Resource
AccountingSubjectMapper
accountingSubjectMapper
;
@Resource
CostTypeDao
costTypeDao
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
AddItemResp
doSave
(
AddItemReq
req
)
{
CostTypeKindDomain
kindByKindNo
=
costTypeKindService
.
getKindByKindNo
(
req
.
getKindNo
());
req
.
setTypeNo
(
kindByKindNo
.
getTypeNo
());
CostPlanTempDomain
costPlanTempDomain
=
new
CostPlanTempDomain
();
BeanUtils
.
copyProperties
(
req
,
costPlanTempDomain
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
req
.
getTypeNo
());
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectByNo
(
costTypeDomain
.
getAccountingSubjectNo
());
costPlanTempDomain
.
setTempNo
(
this
.
createNo
());
costPlanTempDomain
.
setAccountingSubjectNo
(
accountingSubject
.
getSubjectNo
());
costPlanTempDomain
.
setAccountingSubjectName
(
accountingSubject
.
getName
());
this
.
checkDic
(
costPlanTempDomain
);
...
...
@@ -156,12 +168,17 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
@Override
public
CostPlanTempDomain
resetItem
(
ResetItemReq
req
)
{
CostTypeKindDomain
kindByKindNo
=
costTypeKindService
.
getKindByKindNo
(
req
.
getKindNo
());
req
.
setTypeNo
(
kindByKindNo
.
getTypeNo
());
CostPlanTempDomain
costPlanTempDomain
=
new
CostPlanTempDomain
();
com
.
bailuntec
.
common
.
BeanUtils
.
copyProperties
(
req
,
costPlanTempDomain
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
req
.
getTypeNo
());
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectByNo
(
costTypeDomain
.
getAccountingSubjectNo
());
costPlanTempDomain
.
setTempNo
(
this
.
createNo
());
costPlanTempDomain
.
setAccountingSubjectNo
(
accountingSubject
.
getSubjectNo
());
costPlanTempDomain
.
setAccountingSubjectName
(
accountingSubject
.
getName
());
if
(
req
.
getDelecteFile
())
{
costPlanTempDao
.
deletedFilePath
(
req
.
getTempNo
());
}
...
...
bailuntec-cost-core/src/main/resources/mapper/CostTypeMapper.xml
View file @
b0543c49
...
...
@@ -47,5 +47,22 @@
left join accounting_subject t2 on t1.accounting_subject_no = t2.subject_no
where t1.id = #{id}
</select>
<select
id=
"queryByNo"
resultType=
"com.blt.other.module.cost.dto.response.CostTypeResult"
>
select t1.id,
t1.type_no,
t1.type_name,
t1.description,
t1.accounting_subject_no,
t2.name as accounting_subject_name,
t1.create_time,
t1.update_user,
t1.update_user_id,
t1.last_update_time,
t1.create_user_id,
t1.create_user
from cost_type t1
left join accounting_subject t2 on t1.accounting_subject_no = t2.subject_no
where t1.type_no = #{typeNo}
</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