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
410c2ebf
Commit
410c2ebf
authored
Aug 13, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
外部收付款接口
parent
6419080b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
157 additions
and
12 deletions
+157
-12
CostApi.java
...erfaces/src/main/java/com/bailuntec/cost/api/CostApi.java
+5
-4
CostInputDto.java
...rc/main/java/com/bailuntec/cost/api/dto/CostInputDto.java
+63
-0
CostApiController.java
...m/blt/other/module/cost/controller/CostApiController.java
+10
-4
CostApiService.java
...ava/com/blt/other/module/cost/service/CostApiService.java
+9
-4
CostApiServiceImpl.java
...lt/other/module/cost/service/impl/CostApiServiceImpl.java
+57
-0
application-test.yml
cost-service/src/main/resources/application-test.yml
+13
-0
No files found.
cost-interfaces/src/main/java/com/bailuntec/cost/api/CostApi.java
View file @
410c2ebf
package
com
.
bailuntec
.
cost
.
api
;
package
com
.
bailuntec
.
cost
.
api
;
import
com.bailuntec.cost.api.dto.CostDto
;
import
com.bailuntec.cost.api.dto.*
;
import
com.bailuntec.cost.api.dto.LogisticsCostDto
;
import
com.bailuntec.cost.api.dto.ManageCostDto
;
import
com.bailuntec.cost.api.dto.WageCostDto
;
import
com.bailuntec.cost.api.request.ManageCostListReq
;
import
com.bailuntec.cost.api.request.ManageCostListReq
;
import
com.bailuntec.cost.api.response.CostResult
;
import
com.bailuntec.cost.api.response.CostResult
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -30,6 +27,10 @@ public interface CostApi {
...
@@ -30,6 +27,10 @@ public interface CostApi {
@PostMapping
(
"/cost/api/pushLogisticsReceipt"
)
@PostMapping
(
"/cost/api/pushLogisticsReceipt"
)
CostResult
<
Void
>
pushLogisticsReceipt
(
@RequestBody
LogisticsCostDto
logisticsCostDto
)
throws
Exception
;
CostResult
<
Void
>
pushLogisticsReceipt
(
@RequestBody
LogisticsCostDto
logisticsCostDto
)
throws
Exception
;
@ApiOperation
(
"接收收付款单"
)
@PostMapping
(
"/pushCost"
)
CostResult
<
Void
>
pushCost
(
@RequestBody
CostInputDto
input
)
throws
Exception
;
@ApiOperation
(
"获取所有费用单和采购单"
)
@ApiOperation
(
"获取所有费用单和采购单"
)
@PostMapping
(
"/cost/api/manageCostList"
)
@PostMapping
(
"/cost/api/manageCostList"
)
CostResult
<
List
<
ManageCostDto
>>
manageCostList
(
@RequestBody
ManageCostListReq
req
);
CostResult
<
List
<
ManageCostDto
>>
manageCostList
(
@RequestBody
ManageCostListReq
req
);
...
...
cost-interfaces/src/main/java/com/bailuntec/cost/api/dto/CostInputDto.java
0 → 100644
View file @
410c2ebf
package
com
.
bailuntec
.
cost
.
api
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @Author: li.yanlin
* @Description:
* @Date: Created in
* @Modified by:
*/
@Data
public
class
CostInputDto
{
// 费用单编号
@ApiModelProperty
(
value
=
"主体编号"
,
required
=
true
)
private
String
companyNo
;
@ApiModelProperty
(
value
=
"费用类型ID"
,
required
=
true
)
private
Integer
typeId
;
@ApiModelProperty
(
value
=
"创建人id"
,
required
=
true
)
private
Integer
createUserid
;
@ApiModelProperty
(
"费用单备注"
)
private
String
costRemark
;
@ApiModelProperty
(
value
=
"文件地址"
,
required
=
true
)
private
String
filePath
;
@ApiModelProperty
(
value
=
"费用总金额"
,
required
=
true
)
private
BigDecimal
amount
;
@ApiModelProperty
(
value
=
"费用币种"
,
required
=
true
)
private
String
dic
;
@ApiModelProperty
(
value
=
"收款银行(平台)"
,
required
=
true
)
private
String
bankName
;
@ApiModelProperty
(
value
=
"收款账户"
,
required
=
true
)
private
String
bankCard
;
@ApiModelProperty
(
value
=
"收款用户名"
,
required
=
true
)
private
String
bankCardUser
;
@ApiModelProperty
(
value
=
"收款/付款单位"
,
required
=
true
)
private
String
bankCompany
;
@ApiModelProperty
(
value
=
"1 付款费用 2 收款费用"
,
required
=
true
)
private
Integer
costForm
;
@ApiModelProperty
(
"付款理由"
)
private
String
costReason
;
@ApiModelProperty
(
"项目"
)
private
String
projectType
;
@ApiModelProperty
(
"客户编号"
)
private
String
customerNum
;
@ApiModelProperty
(
value
=
"费用来源 1-默认 2-WMS 3-调拨系统 4-4k"
,
required
=
true
)
private
String
sourceFrom
;
}
cost-service/src/main/java/com/blt/other/module/cost/controller/CostApiController.java
View file @
410c2ebf
package
com
.
blt
.
other
.
module
.
cost
.
controller
;
package
com
.
blt
.
other
.
module
.
cost
.
controller
;
import
com.bailuntec.cost.api.CostApi
;
import
com.bailuntec.cost.api.CostApi
;
import
com.bailuntec.cost.api.dto.CostDto
;
import
com.bailuntec.cost.api.dto.*
;
import
com.bailuntec.cost.api.dto.LogisticsCostDto
;
import
com.bailuntec.cost.api.dto.ManageCostDto
;
import
com.bailuntec.cost.api.dto.WageCostDto
;
import
com.bailuntec.cost.api.request.ManageCostListReq
;
import
com.bailuntec.cost.api.request.ManageCostListReq
;
import
com.bailuntec.cost.api.response.CostResult
;
import
com.bailuntec.cost.api.response.CostResult
;
import
com.blt.other.common.annotation.LoginIgnore
;
import
com.blt.other.common.annotation.LoginIgnore
;
...
@@ -64,6 +61,15 @@ public class CostApiController implements CostApi {
...
@@ -64,6 +61,15 @@ public class CostApiController implements CostApi {
return
CostResult
.
successMsg
(
costNo
);
return
CostResult
.
successMsg
(
costNo
);
}
}
@LoginIgnore
@ApiOperation
(
"接收收付款单"
)
@Override
@PostMapping
(
"/pushCost"
)
public
CostResult
<
Void
>
pushCost
(
@RequestBody
CostInputDto
input
)
throws
Exception
{
String
costNo
=
costApiService
.
generateCost
(
input
);
return
CostResult
.
successMsg
(
costNo
);
}
@LoginIgnore
@LoginIgnore
@SneakyThrows
@SneakyThrows
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/CostApiService.java
View file @
410c2ebf
package
com
.
blt
.
other
.
module
.
cost
.
service
;
package
com
.
blt
.
other
.
module
.
cost
.
service
;
import
com.bailuntec.cost.api.dto.CostDto
;
import
com.bailuntec.cost.api.dto.*
;
import
com.bailuntec.cost.api.dto.LogisticsCostDto
;
import
com.bailuntec.cost.api.dto.ManageCostDto
;
import
com.bailuntec.cost.api.dto.WageCostDto
;
import
com.bailuntec.cost.api.request.ManageCostListReq
;
import
com.bailuntec.cost.api.request.ManageCostListReq
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
...
@@ -21,6 +18,14 @@ public interface CostApiService {
...
@@ -21,6 +18,14 @@ public interface CostApiService {
String
generateLogisticsCost
(
int
costForm
,
LogisticsCostDto
logisticsCostDto
)
throws
Exception
;
String
generateLogisticsCost
(
int
costForm
,
LogisticsCostDto
logisticsCostDto
)
throws
Exception
;
/**
/**
* 生成收付款单
* @param input
* @return
* @throws Exception
*/
String
generateCost
(
CostInputDto
input
)
throws
Exception
;
/**
* <p>
* <p>
* 根据费用单号列表
* 根据费用单号列表
* 查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单
* 查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostApiServiceImpl.java
View file @
410c2ebf
...
@@ -158,6 +158,63 @@ public class CostApiServiceImpl implements CostApiService {
...
@@ -158,6 +158,63 @@ public class CostApiServiceImpl implements CostApiService {
}
}
@Override
@Override
public
String
generateCost
(
CostInputDto
input
)
throws
Exception
{
CostDomain
costDomain
=
new
CostDomain
();
BeanUtils
.
copyProperties
(
input
,
costDomain
);
String
costNo
=
CostUtils
.
getIdNum
();
costDomain
.
setCostNo
(
costNo
);
// 0 待提交 1待审核 2待出纳付款 3被驳回 4已支付 5已作废
costDomain
.
setCostStatus
(
0
);
//company
CostCompanyDomain
costCompanyDomain
=
costCompanyDao
.
selectByNo
(
input
.
getCompanyNo
());
if
(
costCompanyDomain
==
null
)
{
throw
new
Exception
(
"费用系统中没有该主体信息"
);
}
costDomain
.
setCompanyName
(
costCompanyDomain
.
getCompanyName
());
costDomain
.
setCompanyValue
(
costCompanyDomain
.
getValue
());
//user
UserDomain
userDomain
=
userDao
.
selectByuserid
(
input
.
getCreateUserid
());
if
(
userDomain
==
null
)
{
throw
new
Exception
(
"费用系统中没有该用户信息,请先登录一次费用系统再进行推送!"
);
}
costDomain
.
setCreateUsername
(
userDomain
.
getUsername
());
costDomain
.
setCreateUsercode
(
userDomain
.
getUsercode
());
//costType , not set AccountingSubjectName
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
.
insert
(
costDomain
);
if
(
input
.
getCostForm
()
==
1
)
{
CostDetailDomain
costDetailDomain
=
new
CostDetailDomain
();
BeanUtils
.
copyProperties
(
costDomain
,
costDetailDomain
);
costDetailDomain
.
setDetailNo
(
costNo
+
"-1"
);
costDetailDao
.
insert
(
costDetailDomain
);
}
return
costNo
;
}
@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
)
...
...
cost-service/src/main/resources/application-test.yml
View file @
410c2ebf
...
@@ -33,6 +33,19 @@ spring:
...
@@ -33,6 +33,19 @@ spring:
port
:
465
port
:
465
main
:
main
:
allow-bean-definition-overriding
:
true
allow-bean-definition-overriding
:
true
rabbitmq
:
host
:
mq.bailuntec.com
port
:
5672
username
:
bailun
password
:
bailun2019
template
:
mandatory
:
true
publisher-confirms
:
true
publisher-returns
:
true
data
:
mongodb
:
uri
:
'
mongodb://admin:!%40#blt*mongo123@42.193.191.242:27018/?authSource=admin&readPreference=primary&appname=MongoDB%20Compass&ssl=false'
database
:
bailuntec-cost-test
#mybatis plus 配置
#mybatis plus 配置
mybatis-plus
:
mybatis-plus
:
...
...
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