Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-api
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangyingyang
2024-12-03 11:46:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7787a5c080fa2ac0b98d3100ae13101a79e0ac92
7787a5c0
1 parent
e82c3d11
fix
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
src/main/java/com/infoloop/tianting/service/impl/KdsServiceImpl.java
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
View file @
7787a5c
package
com
.
infoloop
.
tianting
.
service
.
client
;
import
com.fasterxml.jackson.core.JsonParser
;
import
com.fasterxml.jackson.core.JsonParser.Feature
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.MapperFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.PropertyNamingStrategy
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
com.infoloop.tianting.model.dto.PayDTO.PayInformRequestDto
;
import
com.infoloop.tianting.model.dto.PayDTO.PayResponseDto
;
import
com.infoloop.tianting.model.dto.PayDTO.ThirdPartyPayInformRequestDto
;
...
...
@@ -18,6 +23,8 @@ import okhttp3.Request;
import
okhttp3.RequestBody
;
import
okhttp3.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy
;
import
org.springframework.jmx.export.naming.IdentityNamingStrategy
;
import
org.springframework.stereotype.Service
;
@Service
...
...
@@ -31,14 +38,17 @@ public class PayServiceClient {
String
url
=
"http://10.2.5.162:21051/API/Microapp/CreateOrder?appid=Order0001"
;
String
clientId
=
"Order0001"
;
ObjectMapper
objectMapper
=
new
ObjectMapper
();
// objectMapper.configure(SerializationFeature.INDENT_OUTPUT, true);
objectMapper
.
setPropertyNamingStrategy
(
PropertyNamingStrategy
.
UPPER_CAMEL_CASE
);
ThirdPartyPayInformRequestDto
jsonData
=
new
ThirdPartyPayInformRequestDto
();
jsonData
.
setClientId
(
clientId
);
jsonData
.
setTradeId
(
payRequestDto
.
getOrderId
());
jsonData
.
setTradeId
(
payRequestDto
.
getOrderId
());
//payRequestDto.getOrderId()
String
requestDate
=
DateUtil
.
formatDate
(
LocalDateTime
.
now
(),
DateUtil
.
YMDHMS
);
jsonData
.
setRequestDate
(
requestDate
);
jsonData
.
setRequestSource
(
"OFWXApplet"
);
jsonData
.
setPayerOpenId
(
payRequestDto
.
getOpenId
());
jsonData
.
setHospitalCode
(
payRequestDto
.
getHospitalCode
());
jsonData
.
setHospitalCode
(
"AMCAREBJLD"
);
//payRequestDto.getHospitalCode()
jsonData
.
setPID
(
payRequestDto
.
getPhone
());
jsonData
.
setRemark
(
""
);
jsonData
.
setTransAmount
(
payRequestDto
.
getPrice
());
...
...
@@ -62,8 +72,12 @@ public class PayServiceClient {
}
String
payJsonData
=
payResponse
.
body
().
string
();
System
.
out
.
println
(
"pay json:"
+
payJsonData
);
objectMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
PayResponseDto
payResponseDto
=
objectMapper
.
readValue
(
payJsonData
,
PayResponseDto
.
class
);
ObjectMapper
objectMapper2
=
new
ObjectMapper
();
objectMapper2
.
configure
(
Feature
.
ALLOW_MISSING_VALUES
,
true
);
objectMapper2
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
objectMapper2
.
configure
(
MapperFeature
.
ACCEPT_CASE_INSENSITIVE_VALUES
,
false
);
PayResponseDto
payResponseDto
=
objectMapper2
.
readValue
(
payJsonData
,
PayResponseDto
.
class
);
return
payResponseDto
;
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getStackTrace
().
toString
());
...
...
src/main/java/com/infoloop/tianting/service/impl/KdsServiceImpl.java
View file @
7787a5c
...
...
@@ -75,6 +75,7 @@ public class KdsServiceImpl implements KdsService {
.
build
();
final
var
orderList
=
orderServiceRpcClient
.
getOrdersByCondition
(
queryOrderDto
);
List
<
Integer
>
orderIds
=
orderList
.
stream
()
.
filter
(
o
->
o
.
getStatus
()
==
OrderStatusEnum
.
ALL_SERVED
||
o
.
getStatus
()
==
OrderStatusEnum
.
PARTIAL_SERVED
||
o
.
getStatus
()
==
OrderStatusEnum
.
PREPARING
)
.
map
(
SingleClientCustomerOrderRpcResponse:
:
getId
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
...
...
Please
register
or
login
to post a comment