Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
a0e1bb3f
Commit
a0e1bb3f
authored
Jan 09, 2020
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master-invoice-modular' into master-invoice-modular
parents
3f9e700c
ed6ac5f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
40 deletions
+15
-40
InvoiceVo.java
...java/com/xxfc/platform/universal/entity/vo/InvoiceVo.java
+0
-1
InvoiceBiz.java
.../java/com/xxfc/platform/universal/service/InvoiceBiz.java
+3
-5
InvoiceDaoImpl.java
...atform/universal/service/invoice/impl/InvoiceDaoImpl.java
+12
-34
No files found.
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/vo/InvoiceVo.java
View file @
a0e1bb3f
...
@@ -2,7 +2,6 @@ package com.xxfc.platform.universal.entity.vo;
...
@@ -2,7 +2,6 @@ package com.xxfc.platform.universal.entity.vo;
import
com.xxfc.platform.universal.entity.OrderData
;
import
com.xxfc.platform.universal.entity.OrderData
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.ToString
;
import
java.util.List
;
import
java.util.List
;
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/InvoiceBiz.java
View file @
a0e1bb3f
package
com
.
xxfc
.
platform
.
universal
.
service
;
package
com
.
xxfc
.
platform
.
universal
.
service
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.order.entity.OrderInvoice
;
import
com.xxfc.platform.order.entity.OrderInvoice
;
import
com.xxfc.platform.order.feign.OrderFeign
;
import
com.xxfc.platform.order.feign.OrderFeign
;
...
@@ -24,9 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -24,9 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/invoice/impl/InvoiceDaoImpl.java
View file @
a0e1bb3f
...
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
...
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.universal.entity.Invoice
;
import
com.xxfc.platform.universal.entity.Invoice
;
...
@@ -19,7 +18,6 @@ import org.springframework.context.annotation.Primary;
...
@@ -19,7 +18,6 @@ import org.springframework.context.annotation.Primary;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.PostConstruct
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -82,17 +80,12 @@ public class InvoiceDaoImpl implements InvoiceDao {
...
@@ -82,17 +80,12 @@ public class InvoiceDaoImpl implements InvoiceDao {
// 唯一标识,由企业自己生成32位随机码
// 唯一标识,由企业自己生成32位随机码
String
senid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
String
senid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
String
result
=
sdk
.
sendPostSyncRequest
(
url
,
senid
,
appKey
,
appSecret
,
getTokenJS
(),
taxnum
,
method
,
content
);
String
result
=
sdk
.
sendPostSyncRequest
(
url
,
senid
,
appKey
,
appSecret
,
getTokenJS
(),
taxnum
,
method
,
content
);
try
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
List
<
Map
<
String
,
String
>>
mapList
=
(
List
<
Map
<
String
,
String
>>)
jsonObject
.
get
(
"result"
);
List
<
Map
<
String
,
String
>>
mapList
=
(
List
<
Map
<
String
,
String
>>)
jsonObject
.
get
(
"result"
);
if
(
CollectionUtil
.
isNotEmpty
(
mapList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
mapList
))
{
return
mapList
;
return
mapList
;
}
throw
new
BaseException
(
result
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
result
);
}
}
return
new
ArrayList
<>();
}
}
/**
/**
...
@@ -115,13 +108,9 @@ public class InvoiceDaoImpl implements InvoiceDao {
...
@@ -115,13 +108,9 @@ public class InvoiceDaoImpl implements InvoiceDao {
// 唯一标识,由企业自己生成32位随机码
// 唯一标识,由企业自己生成32位随机码
String
senid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
String
senid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
String
result
=
sdk
.
sendPostSyncRequest
(
url
,
senid
,
appKey
,
appSecret
,
getTokenJS
(),
taxnum
,
method
,
content
);
String
result
=
sdk
.
sendPostSyncRequest
(
url
,
senid
,
appKey
,
appSecret
,
getTokenJS
(),
taxnum
,
method
,
content
);
try
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
Map
<
String
,
String
>
resultMap
=
(
Map
<
String
,
String
>)
jsonObject
.
get
(
"result"
);
Map
<
String
,
String
>
resultMap
=
(
Map
<
String
,
String
>)
jsonObject
.
get
(
"result"
);
return
resultMap
.
get
(
"kpCode"
);
return
resultMap
.
get
(
"kpCode"
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
result
);
}
}
}
...
@@ -188,8 +177,9 @@ public class InvoiceDaoImpl implements InvoiceDao {
...
@@ -188,8 +177,9 @@ public class InvoiceDaoImpl implements InvoiceDao {
String
jsonString
=
JSON
.
toJSONString
(
orderMap
);
String
jsonString
=
JSON
.
toJSONString
(
orderMap
);
//调用第三方接口
//调用第三方接口
String
result
=
sdk
.
sendPostSyncRequest
(
invoiceUrl
,
senid
,
appKey2
,
appSecret2
,
token
,
taxnum2
,
method
,
jsonString
);
String
result
=
sdk
.
sendPostSyncRequest
(
invoiceUrl
,
senid
,
appKey2
,
appSecret2
,
token
,
taxnum2
,
method
,
jsonString
);
log
.
info
(
"第三方响应信息={}"
,
result
);
//把字符串json数据转换为map
//把字符串json数据转换为map
try
{
try
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
Map
<
String
,
String
>
data
=
(
Map
<
String
,
String
>)
jsonObject
.
get
(
"result"
);
Map
<
String
,
String
>
data
=
(
Map
<
String
,
String
>)
jsonObject
.
get
(
"result"
);
...
@@ -227,7 +217,7 @@ public class InvoiceDaoImpl implements InvoiceDao {
...
@@ -227,7 +217,7 @@ public class InvoiceDaoImpl implements InvoiceDao {
List
<
Map
<
String
,
Object
>>
mapList
=
(
List
<
Map
<
String
,
Object
>>)
jsonObject
.
get
(
"result"
);
List
<
Map
<
String
,
Object
>>
mapList
=
(
List
<
Map
<
String
,
Object
>>)
jsonObject
.
get
(
"result"
);
return
mapList
;
return
mapList
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
"发票请求流水号错误
-
"
);
throw
new
BaseException
(
"发票请求流水号错误"
);
}
}
}
}
return
null
;
return
null
;
...
@@ -245,7 +235,7 @@ public class InvoiceDaoImpl implements InvoiceDao {
...
@@ -245,7 +235,7 @@ public class InvoiceDaoImpl implements InvoiceDao {
/**
/**
* 获取诺诺发票token
* 获取诺诺发票token
*/
*/
p
rivate
String
getTokenFP
()
{
p
ublic
String
getTokenFP
()
{
return
getToken
(
appKey2
,
appSecret2
);
return
getToken
(
appKey2
,
appSecret2
);
}
}
...
@@ -263,20 +253,8 @@ public class InvoiceDaoImpl implements InvoiceDao {
...
@@ -263,20 +253,8 @@ public class InvoiceDaoImpl implements InvoiceDao {
redisTemplate
.
opsForValue
().
set
(
appKey
,
token
,
23
,
TimeUnit
.
HOURS
);
redisTemplate
.
opsForValue
().
set
(
appKey
,
token
,
23
,
TimeUnit
.
HOURS
);
}
}
return
token
;
return
token
;
}
@PostConstruct
public
void
deleteTokenJS
(){
System
.
out
.
println
(
"deleteTokenJS"
);
setToken
(
appKey
);
setToken
(
appKey2
);
}
private
void
setToken
(
String
appKey
)
{
redisTemplate
.
delete
(
appKey
);
}
}
}
}
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