Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
customer-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QG
customer-service
Commits
acf6df7d
Commit
acf6df7d
authored
Mar 04, 2022
by
吴琼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态读取appllop配置
parent
902e9b8b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
209 deletions
+70
-209
Bootstrap.java
src/main/java/cn/quantgroup/customer/Bootstrap.java
+2
-0
ApolloConfigListener.java
...group/customer/config/container/ApolloConfigListener.java
+46
-0
TransactionReceiptRecord.java
.../quantgroup/customer/entity/TransactionReceiptRecord.java
+5
-5
TransactionReceiptRecordRepo.java
...uantgroup/customer/repo/TransactionReceiptRecordRepo.java
+2
-2
TransactionReceiptRecordRest.java
...uantgroup/customer/rest/TransactionReceiptRecordRest.java
+0
-59
TransactionReceiptRecordServiceImpl.java
...mer/service/impl/TransactionReceiptRecordServiceImpl.java
+15
-143
No files found.
src/main/java/cn/quantgroup/customer/Bootstrap.java
View file @
acf6df7d
package
cn
.
quantgroup
.
customer
;
import
com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig
;
import
com.github.tobato.fastdfs.FdfsClientConfig
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
...
...
@@ -15,6 +16,7 @@ import org.springframework.jmx.support.RegistrationPolicy;
@Configuration
@ServletComponentScan
@EnableAspectJAutoProxy
@EnableApolloConfig
@SpringBootApplication
(
scanBasePackages
=
{
"cn.quantgroup.customer"
})
public
class
Bootstrap
{
...
...
src/main/java/cn/quantgroup/customer/config/container/ApolloConfigListener.java
0 → 100644
View file @
acf6df7d
package
cn
.
quantgroup
.
customer
.
config
.
container
;
import
com.ctrip.framework.apollo.model.ConfigChangeEvent
;
import
com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.context.environment.EnvironmentChangeEvent
;
import
org.springframework.cloud.context.scope.refresh.RefreshScope
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.stereotype.Component
;
import
java.util.Set
;
/**
* 在此填写类的用途,注意事项
*
* @author xiaoshuai.ma
* @date 2022-02-18 2:29 下午
*/
@Component
@Slf4j
public
class
ApolloConfigListener
implements
ApplicationContextAware
{
private
ApplicationContext
applicationContext
;
@Autowired
RefreshScope
refreshScope
;
@ApolloConfigChangeListener
(
value
=
{
"application"
})
public
void
configChange
(
ConfigChangeEvent
event
)
{
Set
<
String
>
changedKeys
=
event
.
changedKeys
();
for
(
String
changedKey
:
changedKeys
)
{
log
.
info
(
"changed key = {}"
,
changedKey
);
log
.
info
(
"oldValue={},newValue= {}"
,
event
.
getChange
(
changedKey
).
getOldValue
(),
event
.
getChange
(
changedKey
).
getNewValue
());
this
.
applicationContext
.
publishEvent
(
new
EnvironmentChangeEvent
(
event
.
changedKeys
()));
refreshScope
.
refreshAll
();
}
}
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
this
.
applicationContext
=
applicationContext
;
}
}
src/main/java/cn/quantgroup/customer/entity/TransactionReceiptRecord.java
View file @
acf6df7d
...
...
@@ -27,22 +27,22 @@ public class TransactionReceiptRecord {
private
String
serialNo
;
@Column
(
name
=
"import_status"
)
private
Integer
importStatus
;
private
Integer
importStatus
=
0
;
@Column
(
name
=
"export_status"
)
private
Integer
exportStatus
;
private
Integer
exportStatus
=
0
;
@Column
(
name
=
"order_no"
)
private
String
orderNo
;
@Column
(
name
=
"batch_no"
)
private
Integer
batchNo
;
private
Integer
batchNo
=
0
;
@Column
(
name
=
"sign_status"
)
private
Integer
signStatus
;
private
Integer
signStatus
=
0
;
@Column
(
name
=
"export_batch_no"
)
private
Integer
exportBatchNo
;
private
Integer
exportBatchNo
=
0
;
public
TransactionReceiptRecord
()
{
...
...
src/main/java/cn/quantgroup/customer/repo/TransactionReceiptRecordRepo.java
View file @
acf6df7d
...
...
@@ -38,7 +38,7 @@ public interface TransactionReceiptRecordRepo extends JpaRepository<TransactionR
@Modifying
@Transactional
@Query
(
value
=
"update transaction_receipt_record set sign_status = ?1
where order_no =?2
"
,
nativeQuery
=
true
)
int
updatePDFStatusByOrderNo
(
Integer
status
,
String
orderNo
);
@Query
(
value
=
"update transaction_receipt_record set sign_status = ?1
,export_status = ?2 where order_no =?3 and import_status = 1 and export_status = 0
"
,
nativeQuery
=
true
)
int
updatePDFStatusByOrderNo
(
Integer
status
,
Integer
exportStatus
,
String
orderNo
);
}
src/main/java/cn/quantgroup/customer/rest/TransactionReceiptRecordRest.java
View file @
acf6df7d
...
...
@@ -72,65 +72,6 @@ public class TransactionReceiptRecordRest {
return
transactionReceiptRecordService
.
checkCanExport
();
}
@RequestMapping
(
"/test"
)
public
JsonResult
test
()
{
String
userIds
=
"70356056,70356055"
;
String
url
=
"http://passportapi-qa2.liangkebang.net/api/sync/listByUserIds"
;
Map
param
=
Maps
.
newHashMap
();
param
.
put
(
"userIds"
,
userIds
);
String
userResult
=
httpService
.
get
(
url
,
param
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
userResult
);
String
dataStr
=
jsonObject
.
getString
(
"data"
);
JSONArray
userArray
=
JSONArray
.
parseArray
(
dataStr
);
for
(
int
i
=
0
;
i
<
userArray
.
size
();
i
++){
JSONObject
object
=
(
JSONObject
)
userArray
.
get
(
i
);
}
return
JsonResult
.
buildSuccessResult
(
"success"
,
userArray
);
}
@RequestMapping
(
"/testKdsp"
)
public
JsonResult
testKdsp
()
{
String
url
=
"http://kdsp-operation-qa2.liangkebang.net/api/kdsp/op/fa-cui/transaction-proof/query"
;
try
{
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"Content-type"
,
"application/json"
);
header
.
put
(
"qg-tenant-id"
,
"560761"
);
Map
param
=
Maps
.
newHashMap
();
List
<
Map
>
paramList
=
new
ArrayList
<>();
//param.put("userId", 70356062);
//param.put("orderNo", "1495958974917529600");
param
.
put
(
"userId"
,
70356067
);
param
.
put
(
"orderNo"
,
"1496312159003762688"
);
paramList
.
add
(
param
);
//得到json字符串
String
result
=
httpService
.
post
(
url
,
header
,
paramList
);
//转换成json 对象
JSONObject
json
=
JSONObject
.
parseObject
(
result
);
String
jsonResult
=
json
.
getString
(
"data"
);
String
businessCode
=
json
.
getString
(
"businessCode"
);
if
(!
"0000"
.
equals
(
businessCode
)){
return
JsonResult
.
buildErrorStateResult
(
"订单信息查询报错"
);
}
if
(
jsonResult
!=
null
){
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonResult
);
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
"dataList"
);
if
(
jsonArray
.
isEmpty
()){
return
JsonResult
.
buildErrorStateResult
(
"未查询到对应的订单信息"
);
}
List
<
TransactionReceiptVO
>
transactionReceiptVOList
=
jsonArray
.
toJavaList
(
TransactionReceiptVO
.
class
);
//生成pdf
String
basicPath
=
"D:\\交易凭证0222"
;
String
filePath
=
basicPath
+
"\\"
+
"wuq"
;
FileToZip
.
mkdir
(
filePath
);
filePath
=
filePath
+
"\\"
+
"1493905629528739840"
+
".pdf"
;
transactionReceiptRecordService
.
generatePDF
(
transactionReceiptVOList
.
get
(
0
),
filePath
);
}
return
JsonResult
.
buildSuccessResult
(
"success"
,
null
);
}
catch
(
Exception
e
)
{
log
.
error
(
"[TransactionReceiptRecordServiceImpl][exportZipFile] 网络通讯异常,userId:{},ex:{}"
,
e
.
getMessage
());
return
JsonResult
.
buildErrorStateResult
(
e
.
getMessage
());
}
}
/**
* 后台更新交易凭证状态
* @return
...
...
src/main/java/cn/quantgroup/customer/service/impl/TransactionReceiptRecordServiceImpl.java
View file @
acf6df7d
This diff is collapsed.
Click to expand it.
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