Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-finance
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
base_platform_enterprise
gic-platform-finance
Commits
a3a0a192
Commit
a3a0a192
authored
Aug 09, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
转账审批
parent
e87a42df
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1096 additions
and
25 deletions
+1096
-25
.flattened-pom.xml
gic-platform-finance-api/.flattened-pom.xml
+1
-1
pom.xml
gic-platform-finance-service/pom.xml
+5
-0
T.java
...e-service/src/main/java/com/gic/finance/dao/mapper/T.java
+0
-4
TabTransferAccountsApprovalMapper.java
...finance/dao/mapper/TabTransferAccountsApprovalMapper.java
+62
-0
T.java
...nance-service/src/main/java/com/gic/finance/entity/T.java
+0
-4
TabTransferAccountsApproval.java
...a/com/gic/finance/entity/TabTransferAccountsApproval.java
+308
-0
TransferAccountsApprovalService.java
.../gic/finance/service/TransferAccountsApprovalService.java
+35
-0
T.java
...service/src/main/java/com/gic/finance/service/impl/T.java
+0
-4
TransferAccountsApprovalServiceImpl.java
...nce/service/impl/TransferAccountsApprovalServiceImpl.java
+50
-0
T.java
...e/src/main/java/com/gic/finance/service/outer/impl/T.java
+0
-4
TransferAccountsApprovalApiServiceImpl.java
...ce/outer/impl/TransferAccountsApprovalApiServiceImpl.java
+108
-0
dubbo-gic-platform-finance-service.xml
...src/main/resources/dubbo-gic-platform-finance-service.xml
+3
-0
TabTransferAccountsApprovalMapper.xml
...in/resources/mapper/TabTransferAccountsApprovalMapper.xml
+309
-0
pom.xml
gic-platform-finance-web/pom.xml
+5
-0
T.java
...e-web/src/main/java/com/gic/finance/web/controller/T.java
+0
-4
TransferAccountsApprovalController.java
...ce/web/controller/TransferAccountsApprovalController.java
+69
-0
GlobalExceptionHandler.java
...com/gic/finance/web/exception/GlobalExceptionHandler.java
+107
-0
T.java
...ce-web/src/main/java/com/gic/finance/web/exception/T.java
+0
-4
ResultControllerUtils.java
...java/com/gic/finance/web/utils/ResultControllerUtils.java
+30
-0
dubbo-gic-platform-finance-web.xml
...web/src/main/resources/dubbo-gic-platform-finance-web.xml
+4
-0
No files found.
gic-platform-finance-api/.flattened-pom.xml
View file @
a3a0a192
...
...
@@ -3,7 +3,7 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.gic
</groupId>
<artifactId>
gic-platform-
auth
-api
</artifactId>
<artifactId>
gic-platform-
finance
-api
</artifactId>
<version>
4.0-SNAPSHOT
</version>
<dependencies>
<dependency>
...
...
gic-platform-finance-service/pom.xml
View file @
a3a0a192
...
...
@@ -113,6 +113,11 @@
<artifactId>
gic-platform-auth-api
</artifactId>
<version>
${gic-platform-auth-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-platform-finance-api
</artifactId>
<version>
4.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
...
...
gic-platform-finance-service/src/main/java/com/gic/finance/dao/mapper/T.java
deleted
100644 → 0
View file @
e87a42df
package
com
.
gic
.
finance
.
dao
.
mapper
;
public
class
T
{
}
gic-platform-finance-service/src/main/java/com/gic/finance/dao/mapper/TabTransferAccountsApprovalMapper.java
0 → 100644
View file @
a3a0a192
package
com
.
gic
.
finance
.
dao
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.finance.entity.TabTransferAccountsApproval
;
public
interface
TabTransferAccountsApprovalMapper
{
/**
* 根据主键删除
*
* @param transferApprovalId 主键
* @return 更新条目数
*/
int
deleteByPrimaryKey
(
Integer
transferApprovalId
);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insert
(
TabTransferAccountsApproval
record
);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insertSelective
(
TabTransferAccountsApproval
record
);
/**
* 根据主键查询
*
* @param transferApprovalId 主键
* @return 实体对象
*/
TabTransferAccountsApproval
selectByPrimaryKey
(
Integer
transferApprovalId
);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKeySelective
(
TabTransferAccountsApproval
record
);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabTransferAccountsApproval
record
);
List
<
TabTransferAccountsApproval
>
listTransferAccountsApproval
(
@Param
(
"search"
)
String
search
,
@Param
(
"approvalStatus"
)
Integer
approvalStatus
,
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
}
\ No newline at end of file
gic-platform-finance-service/src/main/java/com/gic/finance/entity/T.java
deleted
100644 → 0
View file @
e87a42df
package
com
.
gic
.
finance
.
entity
;
public
class
T
{
}
gic-platform-finance-service/src/main/java/com/gic/finance/entity/TabTransferAccountsApproval.java
0 → 100644
View file @
a3a0a192
package
com
.
gic
.
finance
.
entity
;
import
java.util.Date
;
/**
* tab_transfer_accounts_approval
*/
public
class
TabTransferAccountsApproval
{
/**
*
*/
private
Integer
transferApprovalId
;
/**
* 关联订单流水号
*/
private
String
orderNumber
;
/**
* 关联订单平台方(商户类型)1:GIC 2: 好办
*/
private
Integer
platformType
;
/**
* 发起方1:商户 2:运维后台
*/
private
Integer
initiatorType
;
/**
* 发起方姓名
*/
private
String
initiatorName
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 计划金额
*/
private
Double
plannedAmount
;
/**
* 坏账金额
*/
private
Double
badAmount
;
/**
* 到账金额
*/
private
Double
accountAmount
;
/**
* 验证码
*/
private
String
verifyCode
;
/**
* 审批流水号
*/
private
String
approvalNumber
;
/**
* 审批状态 1:待审批 2:已取消 3:已驳回 4:审批通过
*/
private
Integer
approvalStatus
;
/**
* 审批人
*/
private
String
approvalId
;
/**
* 审批人姓名
*/
private
String
approvalName
;
/**
* 审批时间
*/
private
Date
approvalTime
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
/**
* 审批人手机号码
*/
private
String
approvalPhone
;
/**
* 审批人手机号国际区号
*/
private
String
approvalPhoneAreaCode
;
/**
* 商户名称
*/
private
String
enterpriseName
;
/**
* 公司名称
*/
private
String
companyName
;
/**
* 公司logo
*/
private
String
logo
;
/**
* 1:套餐包 2:拓展包 3:服务 4:短信套餐包 5:充值
*/
private
Integer
orderType
;
public
Integer
getTransferApprovalId
()
{
return
transferApprovalId
;
}
public
void
setTransferApprovalId
(
Integer
transferApprovalId
)
{
this
.
transferApprovalId
=
transferApprovalId
;
}
public
String
getOrderNumber
()
{
return
orderNumber
;
}
public
void
setOrderNumber
(
String
orderNumber
)
{
this
.
orderNumber
=
orderNumber
;
}
public
Integer
getPlatformType
()
{
return
platformType
;
}
public
void
setPlatformType
(
Integer
platformType
)
{
this
.
platformType
=
platformType
;
}
public
Integer
getInitiatorType
()
{
return
initiatorType
;
}
public
void
setInitiatorType
(
Integer
initiatorType
)
{
this
.
initiatorType
=
initiatorType
;
}
public
String
getInitiatorName
()
{
return
initiatorName
;
}
public
void
setInitiatorName
(
String
initiatorName
)
{
this
.
initiatorName
=
initiatorName
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Double
getPlannedAmount
()
{
return
plannedAmount
;
}
public
void
setPlannedAmount
(
Double
plannedAmount
)
{
this
.
plannedAmount
=
plannedAmount
;
}
public
Double
getBadAmount
()
{
return
badAmount
;
}
public
void
setBadAmount
(
Double
badAmount
)
{
this
.
badAmount
=
badAmount
;
}
public
Double
getAccountAmount
()
{
return
accountAmount
;
}
public
void
setAccountAmount
(
Double
accountAmount
)
{
this
.
accountAmount
=
accountAmount
;
}
public
String
getVerifyCode
()
{
return
verifyCode
;
}
public
void
setVerifyCode
(
String
verifyCode
)
{
this
.
verifyCode
=
verifyCode
;
}
public
String
getApprovalNumber
()
{
return
approvalNumber
;
}
public
void
setApprovalNumber
(
String
approvalNumber
)
{
this
.
approvalNumber
=
approvalNumber
;
}
public
Integer
getApprovalStatus
()
{
return
approvalStatus
;
}
public
void
setApprovalStatus
(
Integer
approvalStatus
)
{
this
.
approvalStatus
=
approvalStatus
;
}
public
String
getApprovalId
()
{
return
approvalId
;
}
public
void
setApprovalId
(
String
approvalId
)
{
this
.
approvalId
=
approvalId
;
}
public
String
getApprovalName
()
{
return
approvalName
;
}
public
void
setApprovalName
(
String
approvalName
)
{
this
.
approvalName
=
approvalName
;
}
public
Date
getApprovalTime
()
{
return
approvalTime
;
}
public
void
setApprovalTime
(
Date
approvalTime
)
{
this
.
approvalTime
=
approvalTime
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getApprovalPhone
()
{
return
approvalPhone
;
}
public
void
setApprovalPhone
(
String
approvalPhone
)
{
this
.
approvalPhone
=
approvalPhone
;
}
public
String
getApprovalPhoneAreaCode
()
{
return
approvalPhoneAreaCode
;
}
public
void
setApprovalPhoneAreaCode
(
String
approvalPhoneAreaCode
)
{
this
.
approvalPhoneAreaCode
=
approvalPhoneAreaCode
;
}
public
String
getEnterpriseName
()
{
return
enterpriseName
;
}
public
void
setEnterpriseName
(
String
enterpriseName
)
{
this
.
enterpriseName
=
enterpriseName
;
}
public
String
getCompanyName
()
{
return
companyName
;
}
public
void
setCompanyName
(
String
companyName
)
{
this
.
companyName
=
companyName
;
}
public
String
getLogo
()
{
return
logo
;
}
public
void
setLogo
(
String
logo
)
{
this
.
logo
=
logo
;
}
public
Integer
getOrderType
()
{
return
orderType
;
}
public
void
setOrderType
(
Integer
orderType
)
{
this
.
orderType
=
orderType
;
}
}
\ No newline at end of file
gic-platform-finance-service/src/main/java/com/gic/finance/service/TransferAccountsApprovalService.java
0 → 100644
View file @
a3a0a192
package
com
.
gic
.
finance
.
service
;
import
com.gic.finance.dto.TransferAccountsApprovalDTO
;
import
com.gic.finance.entity.TabTransferAccountsApproval
;
import
com.github.pagehelper.Page
;
/**
* 转账审批
* @author $user$
* @ClassName: $ClassName$
* @Description: $desc$
* @date $date$ $time$
*/
public
interface
TransferAccountsApprovalService
{
/**
* 发起审批
* @param transferAccountsApprovalDTO
* @return
*/
int
initiateApproval
(
TransferAccountsApprovalDTO
transferAccountsApprovalDTO
);
/**
* 主键查询
* @param transferApprovalId
* @return
*/
TabTransferAccountsApproval
getById
(
Integer
transferApprovalId
);
void
updateTransferAccountsApproval
(
TransferAccountsApprovalDTO
transferAccountsApprovalDTO
);
Page
<
TransferAccountsApprovalDTO
>
listTransferAccountsApproval
(
String
search
,
Integer
approvalStatus
,
Integer
enterpriseId
,
Integer
pageNum
,
Integer
pageSize
);
}
gic-platform-finance-service/src/main/java/com/gic/finance/service/impl/T.java
deleted
100644 → 0
View file @
e87a42df
package
com
.
gic
.
finance
.
service
.
impl
;
public
class
T
{
}
gic-platform-finance-service/src/main/java/com/gic/finance/service/impl/TransferAccountsApprovalServiceImpl.java
0 → 100644
View file @
a3a0a192
package
com
.
gic
.
finance
.
service
.
impl
;
import
java.util.Date
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.finance.dao.mapper.TabTransferAccountsApprovalMapper
;
import
com.gic.finance.dto.TransferAccountsApprovalDTO
;
import
com.gic.finance.entity.TabTransferAccountsApproval
;
import
com.gic.finance.service.TransferAccountsApprovalService
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
/**
* @author $user$
* @ClassName: $ClassName$
* @Description: $desc$
* @date $date$ $time$
*/
@Service
(
"transferAccountsApprovalService"
)
public
class
TransferAccountsApprovalServiceImpl
implements
TransferAccountsApprovalService
{
@Autowired
private
TabTransferAccountsApprovalMapper
tabTransferAccountsApprovalMapper
;
@Override
public
int
initiateApproval
(
TransferAccountsApprovalDTO
transferAccountsApprovalDTO
)
{
TabTransferAccountsApproval
transfer
=
EntityUtil
.
changeEntityNew
(
TabTransferAccountsApproval
.
class
,
transferAccountsApprovalDTO
);
tabTransferAccountsApprovalMapper
.
insertSelective
(
transfer
);
return
1
;
}
@Override
public
TabTransferAccountsApproval
getById
(
Integer
transferApprovalId
)
{
return
tabTransferAccountsApprovalMapper
.
selectByPrimaryKey
(
transferApprovalId
);
}
@Override
public
void
updateTransferAccountsApproval
(
TransferAccountsApprovalDTO
transferAccountsApprovalDTO
)
{
transferAccountsApprovalDTO
.
setUpdateTime
(
new
Date
());
TabTransferAccountsApproval
transfer
=
EntityUtil
.
changeEntityNew
(
TabTransferAccountsApproval
.
class
,
transferAccountsApprovalDTO
);
tabTransferAccountsApprovalMapper
.
updateByPrimaryKeySelective
(
transfer
);
}
@Override
public
Page
<
TransferAccountsApprovalDTO
>
listTransferAccountsApproval
(
String
search
,
Integer
approvalStatus
,
Integer
enterpriseId
,
Integer
pageNum
,
Integer
pageSize
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
return
null
;
}
}
gic-platform-finance-service/src/main/java/com/gic/finance/service/outer/impl/T.java
deleted
100644 → 0
View file @
e87a42df
package
com
.
gic
.
finance
.
service
.
outer
.
impl
;
public
class
T
{
}
gic-platform-finance-service/src/main/java/com/gic/finance/service/outer/impl/TransferAccountsApprovalApiServiceImpl.java
0 → 100644
View file @
a3a0a192
package
com
.
gic
.
finance
.
service
.
outer
.
impl
;
import
java.util.Date
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.finance.constant.TransferAccountApprovalStatusEnum
;
import
com.gic.finance.dto.TransferAccountsApprovalDTO
;
import
com.gic.finance.entity.TabTransferAccountsApproval
;
import
com.gic.finance.service.TransferAccountsApprovalApiService
;
import
com.gic.finance.service.TransferAccountsApprovalService
;
import
com.gic.store.utils.CreateSerialNumberUtils
;
import
com.gic.store.utils.valid.ValidUtil
;
/**
* 转账审批
* @author $user$
* @ClassName: $ClassName$
* @Description: $desc$
* @date $date$ $time$
*/
@Service
(
"transferAccountsApprovalApiService"
)
public
class
TransferAccountsApprovalApiServiceImpl
implements
TransferAccountsApprovalApiService
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
TransferAccountsApprovalApiServiceImpl
.
class
);
private
final
static
String
SERVICE_NAME
=
"转账审批"
;
@Autowired
private
TransferAccountsApprovalService
transferAccountsApprovalService
;
@Override
public
ServiceResponse
<
Integer
>
initiateApproval
(
TransferAccountsApprovalDTO
transferAccountsApprovalDTO
)
{
//valid param
ServiceResponse
paramValid
=
ValidUtil
.
allCheckValidate
(
transferAccountsApprovalDTO
,
TransferAccountsApprovalDTO
.
InitiateApprovalValid
.
class
);
if
(!
paramValid
.
isSuccess
())
{
return
paramValid
;
}
transferAccountsApprovalDTO
.
setCreateTime
(
new
Date
());
transferAccountsApprovalDTO
.
setUpdateTime
(
new
Date
());
transferAccountsApprovalDTO
.
setApprovalStatus
(
TransferAccountApprovalStatusEnum
.
TO_BE_APPROVED
.
getCode
());
//审批流水号生成
String
approvalSerialNumber
=
CreateSerialNumberUtils
.
createSerialNumber
();
LOGGER
.
info
(
"转账审批-发起审批-审批流水号:{}"
,
approvalSerialNumber
);
transferAccountsApprovalDTO
.
setApprovalNumber
(
approvalSerialNumber
);
transferAccountsApprovalService
.
initiateApproval
(
transferAccountsApprovalDTO
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
TransferAccountsApprovalDTO
>
getById
(
Integer
transferApprovalId
)
{
LOGGER
.
info
(
SERVICE_NAME
+
"-getById:{}"
,
transferApprovalId
);
TabTransferAccountsApproval
tab
=
transferAccountsApprovalService
.
getById
(
transferApprovalId
);
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"转账审批主键有误"
);
}
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityNew
(
TransferAccountsApprovalDTO
.
class
,
tab
));
}
@Override
public
ServiceResponse
<
Void
>
agreeApproval
(
Integer
transferApprovalId
,
Double
accountAmount
)
{
TabTransferAccountsApproval
tab
=
transferAccountsApprovalService
.
getById
(
transferApprovalId
);
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"转账审批主键有误"
);
}
TransferAccountsApprovalDTO
dto
=
new
TransferAccountsApprovalDTO
();
dto
.
setTransferApprovalId
(
transferApprovalId
);
dto
.
setAccountAmount
(
accountAmount
);
dto
.
setApprovalStatus
(
TransferAccountApprovalStatusEnum
.
AGREE
.
getCode
());
dto
.
setApprovalTime
(
new
Date
());
//todo 审批人等信息获取插入
transferAccountsApprovalService
.
updateTransferAccountsApproval
(
dto
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
rejectApproval
(
Integer
transferApprovalId
)
{
TabTransferAccountsApproval
tab
=
transferAccountsApprovalService
.
getById
(
transferApprovalId
);
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"转账审批主键有误"
);
}
TransferAccountsApprovalDTO
dto
=
new
TransferAccountsApprovalDTO
();
dto
.
setTransferApprovalId
(
transferApprovalId
);
dto
.
setApprovalStatus
(
TransferAccountApprovalStatusEnum
.
REJECT
.
getCode
());
dto
.
setApprovalTime
(
new
Date
());
//todo 审批人等信息获取插入
transferAccountsApprovalService
.
updateTransferAccountsApproval
(
dto
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Page
<
TransferAccountsApprovalDTO
>>
listTransferAccountsApproval
(
String
search
,
Integer
approvalStatus
,
Integer
enterpriseId
,
Integer
pageNum
,
Integer
pageSize
)
{
com
.
github
.
pagehelper
.
Page
page
=
transferAccountsApprovalService
.
listTransferAccountsApproval
(
search
,
approvalStatus
,
enterpriseId
,
pageNum
,
pageSize
);
Page
<
TransferAccountsApprovalDTO
>
resultPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
page
);
return
ServiceResponse
.
success
(
resultPage
);
}
@Override
public
ServiceResponse
<
TransferAccountsApprovalDTO
>
getDetailById
(
Integer
transferApprovalId
)
{
return
null
;
}
}
gic-platform-finance-service/src/main/resources/dubbo-gic-platform-finance-service.xml
View file @
a3a0a192
...
...
@@ -15,4 +15,7 @@
<dubbo:protocol
name=
"dubbo"
port=
"20330"
/>
<!--转账审批-->
<dubbo:service
interface=
"com.gic.finance.service.TransferAccountsApprovalApiService"
ref=
"transferAccountsApprovalApiService"
timeout=
"60000"
/>
</beans>
gic-platform-finance-service/src/main/resources/mapper/TabTransferAccountsApprovalMapper.xml
0 → 100644
View file @
a3a0a192
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.gic.finance.dao.mapper.TabTransferAccountsApprovalMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.finance.entity.TabTransferAccountsApproval"
>
<id
column=
"transfer_approval_id"
jdbcType=
"INTEGER"
property=
"transferApprovalId"
/>
<result
column=
"order_number"
jdbcType=
"VARCHAR"
property=
"orderNumber"
/>
<result
column=
"platform_type"
jdbcType=
"INTEGER"
property=
"platformType"
/>
<result
column=
"initiator_type"
jdbcType=
"INTEGER"
property=
"initiatorType"
/>
<result
column=
"initiator_name"
jdbcType=
"VARCHAR"
property=
"initiatorName"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"planned_amount"
jdbcType=
"DOUBLE"
property=
"plannedAmount"
/>
<result
column=
"bad_amount"
jdbcType=
"DOUBLE"
property=
"badAmount"
/>
<result
column=
"account_amount"
jdbcType=
"DOUBLE"
property=
"accountAmount"
/>
<result
column=
"verify_code"
jdbcType=
"VARCHAR"
property=
"verifyCode"
/>
<result
column=
"approval_number"
jdbcType=
"VARCHAR"
property=
"approvalNumber"
/>
<result
column=
"approval_status"
jdbcType=
"INTEGER"
property=
"approvalStatus"
/>
<result
column=
"approval_id"
jdbcType=
"VARCHAR"
property=
"approvalId"
/>
<result
column=
"approval_name"
jdbcType=
"VARCHAR"
property=
"approvalName"
/>
<result
column=
"approval_time"
jdbcType=
"TIMESTAMP"
property=
"approvalTime"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"approval_phone"
jdbcType=
"VARCHAR"
property=
"approvalPhone"
/>
<result
column=
"approval_phone_area_code"
jdbcType=
"VARCHAR"
property=
"approvalPhoneAreaCode"
/>
<result
column=
"enterprise_name"
jdbcType=
"VARCHAR"
property=
"enterpriseName"
/>
<result
column=
"company_name"
jdbcType=
"VARCHAR"
property=
"companyName"
/>
<result
column=
"logo"
jdbcType=
"VARCHAR"
property=
"logo"
/>
<result
column=
"order_type"
jdbcType=
"INTEGER"
property=
"orderType"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
transfer_approval_id, order_number, platform_type, initiator_type, initiator_name,
enterprise_id, planned_amount, bad_amount, account_amount, verify_code, approval_number,
approval_status, approval_id, approval_name, approval_time, create_time, update_time,
approval_phone, approval_phone_area_code, enterprise_name, company_name, logo, order_type
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_transfer_accounts_approval
where transfer_approval_id = #{transferApprovalId,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from tab_transfer_accounts_approval
where transfer_approval_id = #{transferApprovalId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.finance.entity.TabTransferAccountsApproval"
>
insert into tab_transfer_accounts_approval (transfer_approval_id, order_number,
platform_type, initiator_type, initiator_name,
enterprise_id, planned_amount, bad_amount,
account_amount, verify_code, approval_number,
approval_status, approval_id, approval_name,
approval_time, create_time, update_time,
approval_phone, approval_phone_area_code, enterprise_name,
company_name, logo, order_type
)
values (#{transferApprovalId,jdbcType=INTEGER}, #{orderNumber,jdbcType=VARCHAR},
#{platformType,jdbcType=INTEGER}, #{initiatorType,jdbcType=INTEGER}, #{initiatorName,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=INTEGER}, #{plannedAmount,jdbcType=DOUBLE}, #{badAmount,jdbcType=DOUBLE},
#{accountAmount,jdbcType=DOUBLE}, #{verifyCode,jdbcType=VARCHAR}, #{approvalNumber,jdbcType=VARCHAR},
#{approvalStatus,jdbcType=INTEGER}, #{approvalId,jdbcType=VARCHAR}, #{approvalName,jdbcType=VARCHAR},
#{approvalTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{approvalPhone,jdbcType=VARCHAR}, #{approvalPhoneAreaCode,jdbcType=VARCHAR}, #{enterpriseName,jdbcType=VARCHAR},
#{companyName,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.finance.entity.TabTransferAccountsApproval"
>
insert into tab_transfer_accounts_approval
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"transferApprovalId != null"
>
transfer_approval_id,
</if>
<if
test=
"orderNumber != null"
>
order_number,
</if>
<if
test=
"platformType != null"
>
platform_type,
</if>
<if
test=
"initiatorType != null"
>
initiator_type,
</if>
<if
test=
"initiatorName != null"
>
initiator_name,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"plannedAmount != null"
>
planned_amount,
</if>
<if
test=
"badAmount != null"
>
bad_amount,
</if>
<if
test=
"accountAmount != null"
>
account_amount,
</if>
<if
test=
"verifyCode != null"
>
verify_code,
</if>
<if
test=
"approvalNumber != null"
>
approval_number,
</if>
<if
test=
"approvalStatus != null"
>
approval_status,
</if>
<if
test=
"approvalId != null"
>
approval_id,
</if>
<if
test=
"approvalName != null"
>
approval_name,
</if>
<if
test=
"approvalTime != null"
>
approval_time,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"approvalPhone != null"
>
approval_phone,
</if>
<if
test=
"approvalPhoneAreaCode != null"
>
approval_phone_area_code,
</if>
<if
test=
"enterpriseName != null"
>
enterprise_name,
</if>
<if
test=
"companyName != null"
>
company_name,
</if>
<if
test=
"logo != null"
>
logo,
</if>
<if
test=
"orderType != null"
>
order_type,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"transferApprovalId != null"
>
#{transferApprovalId,jdbcType=INTEGER},
</if>
<if
test=
"orderNumber != null"
>
#{orderNumber,jdbcType=VARCHAR},
</if>
<if
test=
"platformType != null"
>
#{platformType,jdbcType=INTEGER},
</if>
<if
test=
"initiatorType != null"
>
#{initiatorType,jdbcType=INTEGER},
</if>
<if
test=
"initiatorName != null"
>
#{initiatorName,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"plannedAmount != null"
>
#{plannedAmount,jdbcType=DOUBLE},
</if>
<if
test=
"badAmount != null"
>
#{badAmount,jdbcType=DOUBLE},
</if>
<if
test=
"accountAmount != null"
>
#{accountAmount,jdbcType=DOUBLE},
</if>
<if
test=
"verifyCode != null"
>
#{verifyCode,jdbcType=VARCHAR},
</if>
<if
test=
"approvalNumber != null"
>
#{approvalNumber,jdbcType=VARCHAR},
</if>
<if
test=
"approvalStatus != null"
>
#{approvalStatus,jdbcType=INTEGER},
</if>
<if
test=
"approvalId != null"
>
#{approvalId,jdbcType=VARCHAR},
</if>
<if
test=
"approvalName != null"
>
#{approvalName,jdbcType=VARCHAR},
</if>
<if
test=
"approvalTime != null"
>
#{approvalTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"approvalPhone != null"
>
#{approvalPhone,jdbcType=VARCHAR},
</if>
<if
test=
"approvalPhoneAreaCode != null"
>
#{approvalPhoneAreaCode,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseName != null"
>
#{enterpriseName,jdbcType=VARCHAR},
</if>
<if
test=
"companyName != null"
>
#{companyName,jdbcType=VARCHAR},
</if>
<if
test=
"logo != null"
>
#{logo,jdbcType=VARCHAR},
</if>
<if
test=
"orderType != null"
>
#{orderType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.finance.entity.TabTransferAccountsApproval"
>
update tab_transfer_accounts_approval
<set>
<if
test=
"orderNumber != null"
>
order_number = #{orderNumber,jdbcType=VARCHAR},
</if>
<if
test=
"platformType != null"
>
platform_type = #{platformType,jdbcType=INTEGER},
</if>
<if
test=
"initiatorType != null"
>
initiator_type = #{initiatorType,jdbcType=INTEGER},
</if>
<if
test=
"initiatorName != null"
>
initiator_name = #{initiatorName,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"plannedAmount != null"
>
planned_amount = #{plannedAmount,jdbcType=DOUBLE},
</if>
<if
test=
"badAmount != null"
>
bad_amount = #{badAmount,jdbcType=DOUBLE},
</if>
<if
test=
"accountAmount != null"
>
account_amount = #{accountAmount,jdbcType=DOUBLE},
</if>
<if
test=
"verifyCode != null"
>
verify_code = #{verifyCode,jdbcType=VARCHAR},
</if>
<if
test=
"approvalNumber != null"
>
approval_number = #{approvalNumber,jdbcType=VARCHAR},
</if>
<if
test=
"approvalStatus != null"
>
approval_status = #{approvalStatus,jdbcType=INTEGER},
</if>
<if
test=
"approvalId != null"
>
approval_id = #{approvalId,jdbcType=VARCHAR},
</if>
<if
test=
"approvalName != null"
>
approval_name = #{approvalName,jdbcType=VARCHAR},
</if>
<if
test=
"approvalTime != null"
>
approval_time = #{approvalTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"approvalPhone != null"
>
approval_phone = #{approvalPhone,jdbcType=VARCHAR},
</if>
<if
test=
"approvalPhoneAreaCode != null"
>
approval_phone_area_code = #{approvalPhoneAreaCode,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseName != null"
>
enterprise_name = #{enterpriseName,jdbcType=VARCHAR},
</if>
<if
test=
"companyName != null"
>
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if
test=
"logo != null"
>
logo = #{logo,jdbcType=VARCHAR},
</if>
<if
test=
"orderType != null"
>
order_type = #{orderType,jdbcType=INTEGER},
</if>
</set>
where transfer_approval_id = #{transferApprovalId,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.finance.entity.TabTransferAccountsApproval"
>
update tab_transfer_accounts_approval
set order_number = #{orderNumber,jdbcType=VARCHAR},
platform_type = #{platformType,jdbcType=INTEGER},
initiator_type = #{initiatorType,jdbcType=INTEGER},
initiator_name = #{initiatorName,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
planned_amount = #{plannedAmount,jdbcType=DOUBLE},
bad_amount = #{badAmount,jdbcType=DOUBLE},
account_amount = #{accountAmount,jdbcType=DOUBLE},
verify_code = #{verifyCode,jdbcType=VARCHAR},
approval_number = #{approvalNumber,jdbcType=VARCHAR},
approval_status = #{approvalStatus,jdbcType=INTEGER},
approval_id = #{approvalId,jdbcType=VARCHAR},
approval_name = #{approvalName,jdbcType=VARCHAR},
approval_time = #{approvalTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
approval_phone = #{approvalPhone,jdbcType=VARCHAR},
approval_phone_area_code = #{approvalPhoneAreaCode,jdbcType=VARCHAR},
enterprise_name = #{enterpriseName,jdbcType=VARCHAR},
company_name = #{companyName,jdbcType=VARCHAR},
logo = #{logo,jdbcType=VARCHAR},
order_type = #{orderType,jdbcType=INTEGER}
where transfer_approval_id = #{transferApprovalId,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
gic-platform-finance-web/pom.xml
View file @
a3a0a192
...
...
@@ -122,6 +122,11 @@
<artifactId>
gic-redis-data
</artifactId>
<version>
${gic-redis-data}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-platform-finance-api
</artifactId>
<version>
4.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
...
...
gic-platform-finance-web/src/main/java/com/gic/finance/web/controller/T.java
deleted
100644 → 0
View file @
e87a42df
package
com
.
gic
.
finance
.
web
.
controller
;
public
class
T
{
}
gic-platform-finance-web/src/main/java/com/gic/finance/web/controller/TransferAccountsApprovalController.java
0 → 100644
View file @
a3a0a192
package
com
.
gic
.
finance
.
web
.
controller
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.web.qo.PageQO
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.response.EnterpriseRestResponse
;
import
com.gic.finance.dto.TransferAccountsApprovalDTO
;
import
com.gic.finance.service.TransferAccountsApprovalApiService
;
import
com.gic.finance.web.utils.ResultControllerUtils
;
/**
* 转账审批
* @ClassName: TransferAccountsApprovalController
* @Description:
* @author guojuxing
* @date 2019/8/9 5:05 PM
*/
@RestController
@RequestMapping
(
"/transfer-accounts-approval"
)
public
class
TransferAccountsApprovalController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
TransferAccountsApprovalController
.
class
);
@Autowired
private
TransferAccountsApprovalApiService
transferAccountsApprovalApiService
;
/**
* 发起审批
* @param dto
* @return
*/
@RequestMapping
(
"/initiate-approval"
)
public
RestResponse
initiateApproval
(
TransferAccountsApprovalDTO
dto
)
{
return
ResultControllerUtils
.
commonResult
(
transferAccountsApprovalApiService
.
initiateApproval
(
dto
));
}
@RequestMapping
(
"/get-approval"
)
public
RestResponse
getById
(
Integer
id
)
{
return
ResultControllerUtils
.
commonResult
(
transferAccountsApprovalApiService
.
getDetailById
(
id
));
}
@RequestMapping
(
"/agree-approval"
)
public
RestResponse
agreeApproval
(
Integer
id
,
Double
accountAmount
)
{
return
ResultControllerUtils
.
commonResult
(
transferAccountsApprovalApiService
.
agreeApproval
(
id
,
accountAmount
));
}
@RequestMapping
(
"/reject-approval"
)
public
RestResponse
rejectApproval
(
Integer
id
)
{
return
ResultControllerUtils
.
commonResult
(
transferAccountsApprovalApiService
.
rejectApproval
(
id
));
}
@RequestMapping
(
"/list-approval"
)
public
RestResponse
listTransferAccountsApproval
(
String
search
,
Integer
approvalStatus
,
Integer
enterpriseId
,
PageQO
pageQO
)
{
ServiceResponse
<
Page
<
TransferAccountsApprovalDTO
>>
result
=
transferAccountsApprovalApiService
.
listTransferAccountsApproval
(
search
,
approvalStatus
,
enterpriseId
,
pageQO
.
getCurrentPage
(),
pageQO
.
getPageSize
());
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
result
.
getResult
());
}
else
{
return
EnterpriseRestResponse
.
failure
(
result
);
}
}
}
gic-platform-finance-web/src/main/java/com/gic/finance/web/exception/GlobalExceptionHandler.java
0 → 100644
View file @
a3a0a192
package
com
.
gic
.
finance
.
web
.
exception
;
import
java.io.ByteArrayOutputStream
;
import
java.io.PrintWriter
;
import
java.util.List
;
import
java.util.Set
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.ConstraintViolation
;
import
javax.validation.ConstraintViolationException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.validation.BindException
;
import
org.springframework.validation.FieldError
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.finance.exception.FinanceException
;
import
com.gic.store.exception.StoreException
;
/**
* 全局异常处理类
*
* @author hua
*/
@ControllerAdvice
public
class
GlobalExceptionHandler
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
GlobalExceptionHandler
.
class
);
@ResponseBody
@ExceptionHandler
(
Exception
.
class
)
public
RestResponse
controllerException
(
HttpServletResponse
response
,
Exception
ex
)
{
logger
.
error
(
"err"
,
ex
);
RestResponse
failureResponse
=
getRestResponse
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
ErrorCode
.
SYSTEM_ERROR
.
getMsg
());
StringBuilder
sb
=
new
StringBuilder
();
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
try
(
PrintWriter
printWriter
=
new
PrintWriter
(
baos
))
{
ex
.
printStackTrace
(
printWriter
);
}
try
{
sb
.
append
(
baos
.
toString
());
}
catch
(
Exception
ignored
)
{
}
if
(
sb
.
length
()
==
0
)
{
sb
.
append
(
ex
.
getMessage
());
}
// 输出详细错误信息,便于调试
failureResponse
.
setDetailError
(
sb
.
toString
());
return
failureResponse
;
}
/**
* 参数校验异常统一处理
* @param e
* @return
*/
@ResponseBody
@ExceptionHandler
(
BindException
.
class
)
public
RestResponse
customException
(
BindException
e
)
{
List
<
FieldError
>
fieldErrors
=
e
.
getFieldErrors
();
StringBuilder
errorMessage
=
new
StringBuilder
();
fieldErrors
.
forEach
(
fieldError
->
{
errorMessage
.
append
(
fieldError
.
getDefaultMessage
())
.
append
(
","
);
});
return
getRestResponse
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
errorMessage
.
toString
());
}
@ResponseBody
@ExceptionHandler
(
ConstraintViolationException
.
class
)
public
RestResponse
constraintViolationException
(
ConstraintViolationException
e
)
{
Set
<
ConstraintViolation
<?>>
constraintViolations
=
e
.
getConstraintViolations
();
String
paramName
=
constraintViolations
.
iterator
().
next
().
getPropertyPath
().
toString
();
String
paramError
=
constraintViolations
.
iterator
().
next
().
getMessage
();
return
getRestResponse
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
getFailFastMsg
(
paramName
,
paramError
));
}
/**
* 自定义异常统一处理
* @param e
* @return
*/
@ResponseBody
@ExceptionHandler
(
StoreException
.
class
)
public
RestResponse
customException
(
StoreException
e
)
{
return
getRestResponse
(
e
.
getErrorCode
(),
e
.
getMessage
());
}
@ResponseBody
@ExceptionHandler
(
FinanceException
.
class
)
public
RestResponse
customException
(
FinanceException
e
)
{
return
getRestResponse
(
e
.
getErrorCode
(),
e
.
getMessage
());
}
private
RestResponse
getRestResponse
(
String
errorCode
,
String
message
)
{
return
RestResponse
.
failure
(
errorCode
,
message
);
}
private
static
String
getFailFastMsg
(
String
paramName
,
String
paramError
)
{
return
String
.
format
(
"%s:%s"
,
paramName
,
paramError
);
}
}
gic-platform-finance-web/src/main/java/com/gic/finance/web/exception/T.java
deleted
100644 → 0
View file @
e87a42df
package
com
.
gic
.
finance
.
web
.
exception
;
public
class
T
{
}
gic-platform-finance-web/src/main/java/com/gic/finance/web/utils/ResultControllerUtils.java
0 → 100644
View file @
a3a0a192
package
com
.
gic
.
finance
.
web
.
utils
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.finance.exception.FinanceException
;
/**
* controller统一返回工具类
* @ClassName: ResultControllerUtils
* @Description:
* @author guojuxing
* @date 2019/8/9 5:12 PM
*/
public
class
ResultControllerUtils
{
/**
* 统一返回成功结果
* @Title: commonResult
* @Description:
* @author guojuxing
* @param response
* @return java.lang.Object
*/
public
static
RestResponse
commonResult
(
ServiceResponse
response
)
{
if
(
response
.
isSuccess
())
{
return
RestResponse
.
success
(
response
.
getResult
());
}
else
{
throw
new
FinanceException
(
response
);
}
}
}
gic-platform-finance-web/src/main/resources/dubbo-gic-platform-finance-web.xml
View file @
a3a0a192
...
...
@@ -35,4 +35,7 @@
<dubbo:reference
interface=
"com.gic.store.service.ProvincesApiService"
id=
"provincesApiService"
timeout=
"60000"
/>
<dubbo:reference
interface=
"com.gic.store.service.StoreStatusSettingApiService"
id=
"storeStatusSettingApiService"
timeout=
"60000"
/>
<dubbo:reference
interface=
"com.gic.log.api.service.LogApiService"
id=
"logApiService"
timeout=
"60000"
/>
<!--转账审批-->
<dubbo:reference
interface=
"com.gic.finance.service.TransferAccountsApprovalApiService"
id=
"transferAccountsApprovalApiService"
timeout=
"60000"
/>
</beans>
\ No newline at end of file
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