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
3823de44
Commit
3823de44
authored
Aug 28, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开票户接口
parent
f333a134
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
242 additions
and
7 deletions
+242
-7
TabInvoiceAccountMapper.java
...a/com/gic/finance/dao/mapper/TabInvoiceAccountMapper.java
+18
-0
InvoiceAccountService.java
...n/java/com/gic/finance/service/InvoiceAccountService.java
+53
-0
InvoiceAccountServiceImpl.java
...m/gic/finance/service/impl/InvoiceAccountServiceImpl.java
+42
-0
InvoiceAccountApiServiceImpl.java
...ance/service/outer/impl/InvoiceAccountApiServiceImpl.java
+84
-0
InvoiceManageApiServiceImpl.java
...nance/service/outer/impl/InvoiceManageApiServiceImpl.java
+2
-2
TransferAccountsApprovalApiServiceImpl.java
...ce/outer/impl/TransferAccountsApprovalApiServiceImpl.java
+31
-5
TabInvoiceAccountMapper.xml
...ice/src/main/resources/mapper/TabInvoiceAccountMapper.xml
+12
-0
No files found.
gic-platform-finance-service/src/main/java/com/gic/finance/dao/mapper/TabInvoiceAccountMapper.java
View file @
3823de44
...
...
@@ -50,4 +50,21 @@ public interface TabInvoiceAccountMapper {
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabInvoiceAccount
record
);
/**
* 查询启用的那条数据,启用的只有一条
* @Title: getEnable
* @Description:
* @author guojuxing
* @return com.gic.finance.entity.TabInvoiceAccount
*/
TabInvoiceAccount
getEnable
();
/**
* 关闭状态
* @Title: closeStatus
* @Description:
* @author guojuxing
* @return int
*/
int
closeStatus
();
}
\ No newline at end of file
gic-platform-finance-service/src/main/java/com/gic/finance/service/InvoiceAccountService.java
0 → 100644
View file @
3823de44
package
com
.
gic
.
finance
.
service
;
import
com.gic.finance.dto.InvoiceAccountDTO
;
import
com.gic.finance.entity.TabInvoiceAccount
;
/**
* 开票管理-开票账户
* @ClassName: InvoiceAccountService
* @Description:
* @author guojuxing
* @date 2019/8/28 5:26 PM
*/
public
interface
InvoiceAccountService
{
/**
* 新增
* @Title: save
* @Description:
* @author guojuxing
* @param dto
* @return void
*/
void
save
(
InvoiceAccountDTO
dto
);
/**
* 查询启用的那条数据,启用的只有一条
* @Title: getEnable
* @Description:
* @author guojuxing
* @return com.gic.finance.entity.TabInvoiceAccount
*/
TabInvoiceAccount
getEnable
();
TabInvoiceAccount
getById
(
Integer
id
);
/**
* 更新
* @Title: update
* @Description:
* @author guojuxing
* @param dto
* @return void
*/
void
update
(
InvoiceAccountDTO
dto
);
/**
* 关闭
* @Title: closeStatus
* @Description:
* @author guojuxing
* @return void
*/
void
closeStatus
();
}
gic-platform-finance-service/src/main/java/com/gic/finance/service/impl/InvoiceAccountServiceImpl.java
0 → 100644
View file @
3823de44
package
com
.
gic
.
finance
.
service
.
impl
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.finance.dao.mapper.TabInvoiceAccountMapper
;
import
com.gic.finance.dto.InvoiceAccountDTO
;
import
com.gic.finance.entity.TabInvoiceAccount
;
import
com.gic.finance.service.InvoiceAccountService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
@Service
(
"invoiceAccountService"
)
public
class
InvoiceAccountServiceImpl
implements
InvoiceAccountService
{
@Autowired
private
TabInvoiceAccountMapper
tabInvoiceAccountMapper
;
@Override
public
void
save
(
InvoiceAccountDTO
dto
)
{
tabInvoiceAccountMapper
.
insert
(
EntityUtil
.
changeEntityNew
(
TabInvoiceAccount
.
class
,
dto
));
}
@Override
public
TabInvoiceAccount
getEnable
()
{
return
tabInvoiceAccountMapper
.
getEnable
();
}
@Override
public
TabInvoiceAccount
getById
(
Integer
id
)
{
return
tabInvoiceAccountMapper
.
selectByPrimaryKey
(
id
);
}
@Override
public
void
update
(
InvoiceAccountDTO
dto
)
{
dto
.
setUpdateTime
(
new
Date
());
tabInvoiceAccountMapper
.
updateByPrimaryKeySelective
(
EntityUtil
.
changeEntityNew
(
TabInvoiceAccount
.
class
,
dto
));
}
@Override
public
void
closeStatus
()
{
}
}
gic-platform-finance-service/src/main/java/com/gic/finance/service/outer/impl/InvoiceAccountApiServiceImpl.java
0 → 100644
View file @
3823de44
package
com
.
gic
.
finance
.
service
.
outer
.
impl
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.utils.valid.ValidParamsUtils
;
import
com.gic.finance.dto.InvoiceAccountDTO
;
import
com.gic.finance.entity.TabInvoiceAccount
;
import
com.gic.finance.service.InvoiceAccountApiService
;
import
com.gic.finance.service.InvoiceAccountService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
@Service
(
"invoiceAccountApiService"
)
public
class
InvoiceAccountApiServiceImpl
implements
InvoiceAccountApiService
{
@Autowired
private
InvoiceAccountService
invoiceAccountService
;
@Override
public
ServiceResponse
<
Void
>
save
(
InvoiceAccountDTO
invoiceAccountDTO
)
{
ServiceResponse
paramValid
=
ValidParamsUtils
.
allCheckValidate
(
invoiceAccountDTO
,
InvoiceAccountDTO
.
Save
.
class
);
if
(!
paramValid
.
isSuccess
())
{
return
paramValid
;
}
//关闭之前的
invoiceAccountService
.
closeStatus
();
invoiceAccountDTO
.
setCreateTime
(
new
Date
());
invoiceAccountDTO
.
setUpdateTime
(
new
Date
());
//启用默认
invoiceAccountDTO
.
setStatus
(
1
);
invoiceAccountService
.
save
(
invoiceAccountDTO
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
update
(
InvoiceAccountDTO
invoiceAccountDTO
)
{
ServiceResponse
paramValid
=
ValidParamsUtils
.
allCheckValidate
(
invoiceAccountDTO
,
InvoiceAccountDTO
.
Save
.
class
,
InvoiceAccountDTO
.
Edit
.
class
);
if
(!
paramValid
.
isSuccess
())
{
return
paramValid
;
}
TabInvoiceAccount
tab
=
invoiceAccountService
.
getById
(
invoiceAccountDTO
.
getInvoiceAccountId
());
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"主键有误"
);
}
invoiceAccountService
.
update
(
invoiceAccountDTO
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
enable
(
Integer
id
)
{
TabInvoiceAccount
tab
=
invoiceAccountService
.
getById
(
id
);
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"主键有误"
);
}
//关闭之前的
invoiceAccountService
.
closeStatus
();
InvoiceAccountDTO
dto
=
new
InvoiceAccountDTO
();
dto
.
setInvoiceAccountId
(
id
);
dto
.
setStatus
(
1
);
invoiceAccountService
.
update
(
dto
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
InvoiceAccountDTO
>
getById
(
Integer
invoiceAccountId
)
{
TabInvoiceAccount
tab
=
invoiceAccountService
.
getById
(
invoiceAccountId
);
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"主键有误"
);
}
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityNew
(
InvoiceAccountDTO
.
class
,
tab
));
}
@Override
public
ServiceResponse
<
InvoiceAccountDTO
>
getEnable
()
{
TabInvoiceAccount
tab
=
invoiceAccountService
.
getEnable
();
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"没有开启数据,请添加"
);
}
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityNew
(
InvoiceAccountDTO
.
class
,
tab
));
}
}
gic-platform-finance-service/src/main/java/com/gic/finance/service/outer/impl/InvoiceManageApiServiceImpl.java
View file @
3823de44
...
...
@@ -11,6 +11,7 @@ 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.enterprise.utils.valid.ValidParamsUtils
;
import
com.gic.finance.constant.InvoiceStatusEnum
;
import
com.gic.finance.dto.InvoiceManageDTO
;
import
com.gic.finance.entity.TabInvoiceManage
;
...
...
@@ -18,7 +19,6 @@ import com.gic.finance.qo.InvoiceManageListQueryQO;
import
com.gic.finance.service.InvoiceManageApiService
;
import
com.gic.finance.service.InvoiceManageService
;
import
com.gic.store.utils.CreateSerialNumberUtils
;
import
com.gic.store.utils.valid.ValidUtil
;
@Service
(
"invoiceManageApiService"
)
public
class
InvoiceManageApiServiceImpl
implements
InvoiceManageApiService
{
...
...
@@ -26,7 +26,7 @@ public class InvoiceManageApiServiceImpl implements InvoiceManageApiService{
private
InvoiceManageService
invoiceManageService
;
@Override
public
ServiceResponse
<
Void
>
applyInvoice
(
InvoiceManageDTO
invoiceManageDTO
)
{
ServiceResponse
paramResponse
=
Valid
Util
.
allCheckValidate
(
invoiceManageDTO
,
InvoiceManageDTO
.
ApplyInvoiceValid
.
class
);
ServiceResponse
paramResponse
=
Valid
ParamsUtils
.
allCheckValidate
(
invoiceManageDTO
,
InvoiceManageDTO
.
ApplyInvoiceValid
.
class
);
if
(!
paramResponse
.
isSuccess
())
{
return
paramResponse
;
}
...
...
gic-platform-finance-service/src/main/java/com/gic/finance/service/outer/impl/TransferAccountsApprovalApiServiceImpl.java
View file @
3823de44
...
...
@@ -6,6 +6,10 @@ import java.util.Date;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.dubbo.util.DubboContextUtil
;
import
com.gic.dubbo.util.DubboInvokeUtil
;
import
org.apache.dubbo.config.ApplicationConfig
;
import
org.apache.dubbo.config.ReferenceConfig
;
import
org.apache.dubbo.config.RegistryConfig
;
import
org.apache.dubbo.config.utils.ReferenceConfigCache
;
import
org.apache.dubbo.rpc.service.GenericService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -135,7 +139,7 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
dto
.
setApprovalTime
(
new
Date
());
//todo 审批人等信息获取插入
//
callBack(tab, accountAmount, TransferAccountApprovalStatusEnum.AGREE.getCode());
callBack
(
tab
,
accountAmount
,
TransferAccountApprovalStatusEnum
.
AGREE
.
getCode
());
transferAccountsApprovalService
.
updateTransferAccountsApproval
(
dto
);
return
ServiceResponse
.
success
();
}
...
...
@@ -200,12 +204,35 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
}
private
void
callBack
(
TabTransferAccountsApproval
tab
,
Double
accountAmount
,
int
status
)
{
ApplicationConfig
applicationConfig
=
new
ApplicationConfig
();
applicationConfig
.
setName
(
"dubbo-job"
);
RegistryConfig
registryConfig
=
new
RegistryConfig
();
registryConfig
.
setAddress
(
"zookeeper://10.105.220.75:2199"
);
registryConfig
.
setProtocol
(
"dubbo"
);
registryConfig
.
setId
(
"customRegistry"
);
registryConfig
.
setTimeout
(
30000
);
ReferenceConfig
<
GenericService
>
reference
=
new
ReferenceConfig
<
GenericService
>();
reference
.
setApplication
(
applicationConfig
);
reference
.
setRegistry
(
registryConfig
);
reference
.
setInterface
(
"com.gic.enterprise.service.BillingPayInfoApiService"
);
reference
.
setGeneric
(
true
);
reference
.
setCheck
(
false
);
reference
.
setAsync
(
false
);
reference
.
setTimeout
(
50000
);
reference
.
setRetries
(
0
);
reference
.
setGeneric
(
true
);
ReferenceConfigCache
cache
=
ReferenceConfigCache
.
getCache
();
GenericService
genericService
=
cache
.
get
(
reference
);
boolean
isBilling
=
tab
.
getOrderType
().
intValue
()
==
OrderTypeEnum
.
RECHARGE
.
getCode
()
||
tab
.
getOrderType
().
intValue
()
==
OrderTypeEnum
.
SHORT_MESSAGE_PACKAGE
.
getCode
();
//回调计费中心、短信套餐包
if
(
isBilling
)
{
String
taskService
=
"com.gic.enterprise.service.BillingPayInfoApiService"
;
String
taskMethod
=
"offlineCallBack"
;
JSONObject
param
=
new
JSONObject
();
param
.
put
(
"orderSerialNumber"
,
tab
.
getOrderNumber
());
param
.
put
(
"buyType"
,
tab
.
getOrderType
());
...
...
@@ -213,8 +240,7 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
param
.
put
(
"auditStatus"
,
status
);
param
.
put
(
"timeEnd"
,
new
SimpleDateFormat
(
"yyyyMMdd"
).
format
(
new
Date
()));
DubboContextUtil
.
initRegistryConfig
(
"10.105.220.75"
,
2199
);
GenericService
genericService
=
DubboInvokeUtil
.
getGenericService
(
taskService
);
genericService
.
$invoke
(
taskMethod
,
new
String
[]{
String
.
class
.
getName
()},
new
String
[]{
param
.
toJSONString
()});
Object
name
=
genericService
.
$invoke
(
"offlineCallBack"
,
new
String
[]{
String
.
class
.
getName
()},
new
String
[]{
param
.
toJSONString
()});
}
}
}
gic-platform-finance-service/src/main/resources/mapper/TabInvoiceAccountMapper.xml
View file @
3823de44
...
...
@@ -150,4 +150,15 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER}
</update>
<select
id=
"getEnable"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_invoice_account
where status = 1
</select>
<update
id=
"closeStatus"
>
update tab_invoice_account set status = 2
</update>
</mapper>
\ 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