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
d438fb0f
Commit
d438fb0f
authored
Aug 19, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加修改费用单接口
parent
291282f2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
0 deletions
+65
-0
CostApi.java
...erfaces/src/main/java/com/bailuntec/cost/api/CostApi.java
+4
-0
CostApiController.java
...m/blt/other/module/cost/controller/CostApiController.java
+10
-0
CostApiService.java
...ava/com/blt/other/module/cost/service/CostApiService.java
+8
-0
CostApiServiceImpl.java
...lt/other/module/cost/service/impl/CostApiServiceImpl.java
+43
-0
No files found.
cost-interfaces/src/main/java/com/bailuntec/cost/api/CostApi.java
View file @
d438fb0f
...
@@ -31,6 +31,10 @@ public interface CostApi {
...
@@ -31,6 +31,10 @@ public interface CostApi {
@PostMapping
(
"/pushCost"
)
@PostMapping
(
"/pushCost"
)
CostResult
<
Void
>
pushCost
(
@RequestBody
CostInputDto
input
)
throws
Exception
;
CostResult
<
Void
>
pushCost
(
@RequestBody
CostInputDto
input
)
throws
Exception
;
@ApiOperation
(
"更新收付款单"
)
@PostMapping
(
"/update/{costNo}"
)
CostResult
<
Void
>
updateCode
(
@RequestBody
CostInputDto
input
,
@PathVariable
(
"costNo"
)
String
costNo
)
throws
Exception
;
@ApiOperation
(
"提交费用单"
)
@ApiOperation
(
"提交费用单"
)
@PostMapping
(
"submitAudit"
)
@PostMapping
(
"submitAudit"
)
CostResult
<
Void
>
submitAudit
(
@RequestParam
String
costNo
);
CostResult
<
Void
>
submitAudit
(
@RequestParam
String
costNo
);
...
...
cost-service/src/main/java/com/blt/other/module/cost/controller/CostApiController.java
View file @
d438fb0f
...
@@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
...
@@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.websocket.server.PathParam
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -80,6 +81,15 @@ public class CostApiController implements CostApi {
...
@@ -80,6 +81,15 @@ public class CostApiController implements CostApi {
}
}
@LoginIgnore
@LoginIgnore
@ApiOperation
(
"更新收付款单"
)
@Override
@PostMapping
(
"/update/{costNo}"
)
public
CostResult
<
Void
>
updateCode
(
@RequestBody
CostInputDto
input
,
@PathVariable
(
"costNo"
)
String
costNo
)
throws
Exception
{
String
msg
=
costApiService
.
updateCost
(
input
,
costNo
);
return
CostResult
.
successMsg
(
msg
);
}
@LoginIgnore
@Override
@Override
@ApiOperation
(
"提交费用单"
)
@ApiOperation
(
"提交费用单"
)
@PostMapping
(
"submitAudit"
)
@PostMapping
(
"submitAudit"
)
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/CostApiService.java
View file @
d438fb0f
...
@@ -26,6 +26,14 @@ public interface CostApiService {
...
@@ -26,6 +26,14 @@ public interface CostApiService {
String
generateCost
(
CostInputDto
input
)
throws
Exception
;
String
generateCost
(
CostInputDto
input
)
throws
Exception
;
/**
/**
* 更新费用单
* @param input
* @return
* @throws Exception
*/
String
updateCost
(
CostInputDto
input
,
String
costNo
)
throws
Exception
;
/**
* <p>
* <p>
* 根据费用单号列表
* 根据费用单号列表
* 查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单
* 查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostApiServiceImpl.java
View file @
d438fb0f
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
;
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
;
import
com.bailuntec.common.exception.BizException
;
import
com.bailuntec.cost.api.dto.*
;
import
com.bailuntec.cost.api.dto.*
;
import
com.bailuntec.cost.api.request.ManageCostListReq
;
import
com.bailuntec.cost.api.request.ManageCostListReq
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -215,6 +216,48 @@ public class CostApiServiceImpl implements CostApiService {
...
@@ -215,6 +216,48 @@ public class CostApiServiceImpl implements CostApiService {
}
}
@Override
@Override
public
String
updateCost
(
CostInputDto
input
,
String
costNo
)
throws
Exception
{
CostDomain
costDomain
=
costService
.
getCostByCostNo
(
costNo
);
if
(
costDomain
==
null
){
throw
new
Exception
(
"不存在费用单"
+
costNo
);
}
if
(!
costDomain
.
getCreateUserid
().
equals
(
input
.
getCreateUserid
())){
throw
new
Exception
(
"无权更改该费用单,该费用单不是您所创建"
);
}
if
(!
input
.
getCostForm
().
equals
(
costDomain
.
getCostForm
())){
throw
new
Exception
(
"不能更改费用单类型"
);
}
boolean
sameTypeId
=
input
.
getTypeId
().
equals
(
costDomain
.
getTypeId
());
BeanUtils
.
copyProperties
(
input
,
costDomain
);
//costType , not set AccountingSubjectName
if
(!
sameTypeId
)
{
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectById
(
input
.
getTypeId
());
if
(
costTypeDomain
==
null
)
{
throw
new
Exception
(
"费用系统中没有该费用类型"
);
}
costDomain
.
setTypeNo
(
costTypeDomain
.
getTypeNo
());
costDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
costDomain
.
setAccountingSubjectId
(
costTypeDomain
.
getAccountingSubjectId
());
costDomain
.
setAccountingSubjectNo
(
costTypeDomain
.
getAccountingSubjectNo
());
costDomain
.
setNsAccountingSubjectId
(
costTypeDomain
.
getNsAccountingSubjectId
());
//costDomain.setAccountingSubjectName()
}
//汇率
BigDecimal
toRmbRate
;
if
(
"CNY"
.
equals
(
input
.
getDic
()))
{
toRmbRate
=
BigDecimal
.
ONE
;
costDomain
.
setAmountRmb
(
input
.
getAmount
());
}
else
{
toRmbRate
=
CurUtils
.
getCur
(
input
.
getDic
(),
"CNY"
);
costDomain
.
setAmountRmb
(
input
.
getAmount
().
multiply
(
toRmbRate
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
}
costDomain
.
setToRmbRate
(
toRmbRate
);
costDao
.
update
(
costDomain
,
new
LambdaQueryWrapper
<
CostDomain
>()
.
eq
(
CostDomain:
:
getCostNo
,
costDomain
.
getCostNo
()));
return
"更新成功"
;
}
@Override
public
List
<
CostDomain
>
getNoPayCost
(
List
<
String
>
costNoList
)
{
public
List
<
CostDomain
>
getNoPayCost
(
List
<
String
>
costNoList
)
{
return
costDao
.
selectList
(
new
LambdaQueryWrapper
<
CostDomain
>()
return
costDao
.
selectList
(
new
LambdaQueryWrapper
<
CostDomain
>()
.
eq
(
CostDomain:
:
getCostForm
,
CostDomain
.
COST_FROM_1
)
.
eq
(
CostDomain:
:
getCostForm
,
CostDomain
.
COST_FROM_1
)
...
...
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