Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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-enterprise
Commits
d0bbcc23
Commit
d0bbcc23
authored
Aug 16, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
init
parents
8da3cf7b
92222b69
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
320 additions
and
4 deletions
+320
-4
BillingAccountDTO.java
...c/main/java/com/gic/enterprise/dto/BillingAccountDTO.java
+105
-0
BillingAccountApiService.java
.../com/gic/enterprise/service/BillingAccountApiService.java
+23
-0
TabBillingAccountMapper.java
...om/gic/enterprise/dao/mapper/TabBillingAccountMapper.java
+12
-0
TabBillingAccount.java
...ain/java/com/gic/enterprise/entity/TabBillingAccount.java
+29
-0
BillingAccountService.java
...ava/com/gic/enterprise/service/BillingAccountService.java
+22
-0
BillingAccountServiceImpl.java
...ic/enterprise/service/impl/BillingAccountServiceImpl.java
+17
-0
BillingAccountApiServiceImpl.java
...nterprise/service/outer/BillingAccountApiServiceImpl.java
+30
-0
dubbo-gic-platform-enterprise-service.xml
.../main/resources/dubbo-gic-platform-enterprise-service.xml
+3
-0
TabBillingAccountMapper.xml
...ice/src/main/resources/mapper/TabBillingAccountMapper.xml
+35
-4
BillingAccountController.java
...c/enterprise/web/controller/BillingAccountController.java
+40
-0
dubbo-gic-platform-enterprise-web.xml
.../src/main/resources/dubbo-gic-platform-enterprise-web.xml
+4
-0
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/BillingAccountDTO.java
0 → 100644
View file @
d0bbcc23
package
com
.
gic
.
enterprise
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 账户
* @ClassName: BillingAccountDTO
* @Description:
* @author guojuxing
* @date 2019/8/16 3:13 PM
*/
public
class
BillingAccountDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
3522330358092424524L
;
/**
*
*/
private
Integer
accountId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 账户余额
*/
private
Double
accountBalance
;
/**
* 授信额度
*/
private
Integer
creditLine
;
/**
* 1:自动续充, 0:手动充
*/
private
Integer
autoRecharge
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
Integer
getAccountId
()
{
return
accountId
;
}
public
void
setAccountId
(
Integer
accountId
)
{
this
.
accountId
=
accountId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Double
getAccountBalance
()
{
return
accountBalance
;
}
public
void
setAccountBalance
(
Double
accountBalance
)
{
this
.
accountBalance
=
accountBalance
;
}
public
Integer
getCreditLine
()
{
return
creditLine
;
}
public
void
setCreditLine
(
Integer
creditLine
)
{
this
.
creditLine
=
creditLine
;
}
public
Integer
getAutoRecharge
()
{
return
autoRecharge
;
}
public
void
setAutoRecharge
(
Integer
autoRecharge
)
{
this
.
autoRecharge
=
autoRecharge
;
}
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
;
}
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/BillingAccountApiService.java
0 → 100644
View file @
d0bbcc23
package
com
.
gic
.
enterprise
.
service
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.enterprise.dto.BillingAccountDTO
;
/**
* 计费中心账户
* @ClassName: BillingAccountApiService
* @Description:
* @author guojuxing
* @date 2019/8/16 3:16 PM
*/
public
interface
BillingAccountApiService
{
/**
* 根据商户ID查询余额账户
* @Title: getByEnterpriseId
* @Description:
* @author guojuxing
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.enterprise.dto.BillingAccountDTO>
*/
ServiceResponse
<
BillingAccountDTO
>
getByEnterpriseId
(
Integer
enterpriseId
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/dao/mapper/TabBillingAccountMapper.java
View file @
d0bbcc23
package
com
.
gic
.
enterprise
.
dao
.
mapper
;
import
com.gic.enterprise.entity.TabBillingAccount
;
import
org.apache.ibatis.annotations.Param
;
public
interface
TabBillingAccountMapper
{
/**
...
...
@@ -50,4 +51,14 @@ public interface TabBillingAccountMapper {
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabBillingAccount
record
);
/**
* 根据商户ID查询余额账户
* @Title: selectByEnterpriseId
* @Description:
* @author guojuxing
* @param enterpriseId
* @return com.gic.enterprise.entity.TabBillingAccount
*/
TabBillingAccount
selectByEnterpriseId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/entity/TabBillingAccount.java
View file @
d0bbcc23
package
com
.
gic
.
enterprise
.
entity
;
import
java.util.Date
;
/**
* tab_billing_account
*/
...
...
@@ -29,6 +31,16 @@ public class TabBillingAccount {
*/
private
Integer
autoRecharge
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
Integer
getAccountId
()
{
return
accountId
;
}
...
...
@@ -68,4 +80,20 @@ public class TabBillingAccount {
public
void
setAutoRecharge
(
Integer
autoRecharge
)
{
this
.
autoRecharge
=
autoRecharge
;
}
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
;
}
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/BillingAccountService.java
0 → 100644
View file @
d0bbcc23
package
com
.
gic
.
enterprise
.
service
;
import
com.gic.enterprise.entity.TabBillingAccount
;
/**
* 计费中心账户
* @ClassName: BillingAccountService
* @Description:
* @author guojuxing
* @date 2019/8/16 3:18 PM
*/
public
interface
BillingAccountService
{
/**
* 根据商户ID查询余额账户
* @Title: getByEnterpriseId
* @Description:
* @author guojuxing
* @param enterpriseId
* @return com.gic.enterprise.entity.TabBillingAccount
*/
TabBillingAccount
getByEnterpriseId
(
Integer
enterpriseId
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/BillingAccountServiceImpl.java
0 → 100644
View file @
d0bbcc23
package
com
.
gic
.
enterprise
.
service
.
impl
;
import
com.gic.enterprise.dao.mapper.TabBillingAccountMapper
;
import
com.gic.enterprise.entity.TabBillingAccount
;
import
com.gic.enterprise.service.BillingAccountService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
(
"billingAccountService"
)
public
class
BillingAccountServiceImpl
implements
BillingAccountService
{
@Autowired
private
TabBillingAccountMapper
tabBillingAccountMapper
;
@Override
public
TabBillingAccount
getByEnterpriseId
(
Integer
enterpriseId
)
{
return
tabBillingAccountMapper
.
selectByEnterpriseId
(
enterpriseId
);
}
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/BillingAccountApiServiceImpl.java
0 → 100644
View file @
d0bbcc23
package
com
.
gic
.
enterprise
.
service
.
outer
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.dto.BillingAccountDTO
;
import
com.gic.enterprise.entity.TabBillingAccount
;
import
com.gic.enterprise.entity.TabEnterprise
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.service.BillingAccountApiService
;
import
com.gic.enterprise.service.BillingAccountService
;
import
com.gic.enterprise.service.EnterpriseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
(
"billingAccountApiService"
)
public
class
BillingAccountApiServiceImpl
implements
BillingAccountApiService
{
@Autowired
private
BillingAccountService
billingAccountService
;
@Autowired
private
EnterpriseService
enterpriseService
;
@Override
public
ServiceResponse
<
BillingAccountDTO
>
getByEnterpriseId
(
Integer
enterpriseId
)
{
TabEnterprise
tabEnterprise
=
enterpriseService
.
getEnterpriseById
(
enterpriseId
);
if
(
tabEnterprise
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"商户ID有误"
);
}
TabBillingAccount
account
=
billingAccountService
.
getByEnterpriseId
(
enterpriseId
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityNew
(
BillingAccountDTO
.
class
,
account
));
}
}
gic-platform-enterprise-service/src/main/resources/dubbo-gic-platform-enterprise-service.xml
View file @
d0bbcc23
...
...
@@ -30,5 +30,8 @@
<!--支付信息-->
<dubbo:service
interface=
"com.gic.enterprise.service.BillingPayInfoApiService"
ref=
"billingPayInfoApiService"
timeout=
"60000"
/>
<dubbo:service
interface=
"com.gic.enterprise.service.PackApiService"
ref=
"packApiService"
timeout=
"6000"
/>
<!--计费中心余额账户-->
<dubbo:service
interface=
"com.gic.enterprise.service.BillingAccountApiService"
ref=
"billingAccountApiService"
timeout=
"6000"
/>
<dubbo:service
interface=
"com.gic.enterprise.service.PackageApiService"
ref=
"packApiService"
timeout=
"6000"
/>
</beans>
gic-platform-enterprise-service/src/main/resources/mapper/TabBillingAccountMapper.xml
View file @
d0bbcc23
...
...
@@ -7,9 +7,11 @@
<result
column=
"account_balance"
jdbcType=
"DOUBLE"
property=
"accountBalance"
/>
<result
column=
"credit_line"
jdbcType=
"INTEGER"
property=
"creditLine"
/>
<result
column=
"auto_recharge"
jdbcType=
"INTEGER"
property=
"autoRecharge"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
account_id, enterprise_id, account_balance, credit_line, auto_recharge
account_id, enterprise_id, account_balance, credit_line, auto_recharge
, create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -23,9 +25,10 @@
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.enterprise.entity.TabBillingAccount"
>
insert into tab_billing_account (account_id, enterprise_id, account_balance,
credit_line, auto_recharge)
credit_line, auto_recharge
, create_time, update_time
)
values (#{accountId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{accountBalance,jdbcType=DOUBLE},
#{creditLine,jdbcType=INTEGER}, #{autoRecharge,jdbcType=INTEGER})
#{creditLine,jdbcType=INTEGER}, #{autoRecharge,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.enterprise.entity.TabBillingAccount"
>
insert into tab_billing_account
...
...
@@ -45,6 +48,12 @@
<if
test=
"autoRecharge != null"
>
auto_recharge,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"accountId != null"
>
...
...
@@ -62,6 +71,12 @@
<if
test=
"autoRecharge != null"
>
#{autoRecharge,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.enterprise.entity.TabBillingAccount"
>
...
...
@@ -79,6 +94,12 @@
<if
test=
"autoRecharge != null"
>
auto_recharge = #{autoRecharge,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where account_id = #{accountId,jdbcType=INTEGER}
</update>
...
...
@@ -87,7 +108,16 @@
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
account_balance = #{accountBalance,jdbcType=DOUBLE},
credit_line = #{creditLine,jdbcType=INTEGER},
auto_recharge = #{autoRecharge,jdbcType=INTEGER}
auto_recharge = #{autoRecharge,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where account_id = #{accountId,jdbcType=INTEGER}
</update>
<select
id=
"selectByEnterpriseId"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_billing_account
where enterprise_id = #{enterpriseId}
</select>
</mapper>
\ No newline at end of file
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/BillingAccountController.java
0 → 100644
View file @
d0bbcc23
package
com
.
gic
.
enterprise
.
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.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.service.BillingAccountApiService
;
import
com.gic.enterprise.service.PackApiService
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
/**
* 计费中心余额账户
* @ClassName: BillingAccountController
* @Description:
* @author guojuxing
* @date 2019/8/16 3:53 PM
*/
@RestController
@RequestMapping
(
"/billing-account"
)
public
class
BillingAccountController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
BillingAccountController
.
class
);
@Autowired
private
BillingAccountApiService
billingAccountApiService
;
@Autowired
private
PackApiService
packApiService
;
@RequestMapping
(
"/billing-account-info"
)
public
RestResponse
billingAccountInfo
()
{
Integer
enterprise
=
1111
;
return
ResultControllerUtils
.
commonResult
(
billingAccountApiService
.
getByEnterpriseId
(
enterprise
));
}
@RequestMapping
(
"/list-package-type"
)
public
RestResponse
listPackageType
()
{
return
ResultControllerUtils
.
commonResult
(
packApiService
.
listAllSmsPackage
());
}
}
gic-platform-enterprise-web/src/main/resources/dubbo-gic-platform-enterprise-web.xml
View file @
d0bbcc23
...
...
@@ -41,4 +41,7 @@
<!--发票管理-->
<dubbo:reference
interface=
"com.gic.finance.service.InvoiceManageApiService"
id=
"invoiceManageApiService"
timeout=
"60000"
/>
<!--计费中心余额账户-->
<dubbo:reference
interface=
"com.gic.enterprise.service.BillingAccountApiService"
id=
"billingAccountApiService"
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