Showing
2 changed files
with
19 additions
and
4 deletions
| 1 | package com.infoloop.tianting.service.client; | 1 | package com.infoloop.tianting.service.client; |
| 2 | 2 | ||
| 3 | +import com.fasterxml.jackson.core.JsonParser; | ||
| 4 | +import com.fasterxml.jackson.core.JsonParser.Feature; | ||
| 3 | import com.fasterxml.jackson.databind.DeserializationFeature; | 5 | import com.fasterxml.jackson.databind.DeserializationFeature; |
| 6 | +import com.fasterxml.jackson.databind.MapperFeature; | ||
| 4 | import com.fasterxml.jackson.databind.ObjectMapper; | 7 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 8 | +import com.fasterxml.jackson.databind.PropertyNamingStrategy; | ||
| 9 | +import com.fasterxml.jackson.databind.SerializationFeature; | ||
| 5 | import com.infoloop.tianting.model.dto.PayDTO.PayInformRequestDto; | 10 | import com.infoloop.tianting.model.dto.PayDTO.PayInformRequestDto; |
| 6 | import com.infoloop.tianting.model.dto.PayDTO.PayResponseDto; | 11 | import com.infoloop.tianting.model.dto.PayDTO.PayResponseDto; |
| 7 | import com.infoloop.tianting.model.dto.PayDTO.ThirdPartyPayInformRequestDto; | 12 | import com.infoloop.tianting.model.dto.PayDTO.ThirdPartyPayInformRequestDto; |
| ... | @@ -18,6 +23,8 @@ import okhttp3.Request; | ... | @@ -18,6 +23,8 @@ import okhttp3.Request; |
| 18 | import okhttp3.RequestBody; | 23 | import okhttp3.RequestBody; |
| 19 | import okhttp3.Response; | 24 | import okhttp3.Response; |
| 20 | import org.springframework.beans.factory.annotation.Autowired; | 25 | import org.springframework.beans.factory.annotation.Autowired; |
| 26 | +import org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy; | ||
| 27 | +import org.springframework.jmx.export.naming.IdentityNamingStrategy; | ||
| 21 | import org.springframework.stereotype.Service; | 28 | import org.springframework.stereotype.Service; |
| 22 | 29 | ||
| 23 | @Service | 30 | @Service |
| ... | @@ -31,14 +38,17 @@ public class PayServiceClient { | ... | @@ -31,14 +38,17 @@ public class PayServiceClient { |
| 31 | String url = "http://10.2.5.162:21051/API/Microapp/CreateOrder?appid=Order0001"; | 38 | String url = "http://10.2.5.162:21051/API/Microapp/CreateOrder?appid=Order0001"; |
| 32 | String clientId = "Order0001"; | 39 | String clientId = "Order0001"; |
| 33 | ObjectMapper objectMapper = new ObjectMapper(); | 40 | ObjectMapper objectMapper = new ObjectMapper(); |
| 41 | +// objectMapper.configure(SerializationFeature.INDENT_OUTPUT, true); | ||
| 42 | + objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE); | ||
| 43 | + | ||
| 34 | ThirdPartyPayInformRequestDto jsonData = new ThirdPartyPayInformRequestDto(); | 44 | ThirdPartyPayInformRequestDto jsonData = new ThirdPartyPayInformRequestDto(); |
| 35 | jsonData.setClientId(clientId); | 45 | jsonData.setClientId(clientId); |
| 36 | - jsonData.setTradeId(payRequestDto.getOrderId()); | 46 | + jsonData.setTradeId(payRequestDto.getOrderId()); //payRequestDto.getOrderId() |
| 37 | String requestDate = DateUtil.formatDate(LocalDateTime.now(), DateUtil.YMDHMS); | 47 | String requestDate = DateUtil.formatDate(LocalDateTime.now(), DateUtil.YMDHMS); |
| 38 | jsonData.setRequestDate(requestDate); | 48 | jsonData.setRequestDate(requestDate); |
| 39 | jsonData.setRequestSource("OFWXApplet"); | 49 | jsonData.setRequestSource("OFWXApplet"); |
| 40 | jsonData.setPayerOpenId(payRequestDto.getOpenId()); | 50 | jsonData.setPayerOpenId(payRequestDto.getOpenId()); |
| 41 | - jsonData.setHospitalCode(payRequestDto.getHospitalCode()); | 51 | + jsonData.setHospitalCode("AMCAREBJLD"); //payRequestDto.getHospitalCode() |
| 42 | jsonData.setPID(payRequestDto.getPhone()); | 52 | jsonData.setPID(payRequestDto.getPhone()); |
| 43 | jsonData.setRemark(""); | 53 | jsonData.setRemark(""); |
| 44 | jsonData.setTransAmount(payRequestDto.getPrice()); | 54 | jsonData.setTransAmount(payRequestDto.getPrice()); |
| ... | @@ -62,8 +72,12 @@ public class PayServiceClient { | ... | @@ -62,8 +72,12 @@ public class PayServiceClient { |
| 62 | } | 72 | } |
| 63 | String payJsonData = payResponse.body().string(); | 73 | String payJsonData = payResponse.body().string(); |
| 64 | System.out.println("pay json:"+payJsonData); | 74 | System.out.println("pay json:"+payJsonData); |
| 65 | - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | 75 | + ObjectMapper objectMapper2 = new ObjectMapper(); |
| 66 | - PayResponseDto payResponseDto = objectMapper.readValue(payJsonData, PayResponseDto.class); | 76 | + objectMapper2.configure(Feature.ALLOW_MISSING_VALUES, true); |
| 77 | + objectMapper2.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | ||
| 78 | + objectMapper2.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_VALUES, false); | ||
| 79 | + | ||
| 80 | + PayResponseDto payResponseDto = objectMapper2.readValue(payJsonData, PayResponseDto.class); | ||
| 67 | return payResponseDto; | 81 | return payResponseDto; |
| 68 | } catch (Exception e) { | 82 | } catch (Exception e) { |
| 69 | System.out.println(e.getStackTrace().toString()); | 83 | System.out.println(e.getStackTrace().toString()); | ... | ... |
| ... | @@ -75,6 +75,7 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -75,6 +75,7 @@ public class KdsServiceImpl implements KdsService { |
| 75 | .build(); | 75 | .build(); |
| 76 | final var orderList = orderServiceRpcClient.getOrdersByCondition(queryOrderDto); | 76 | final var orderList = orderServiceRpcClient.getOrdersByCondition(queryOrderDto); |
| 77 | List<Integer> orderIds = orderList.stream() | 77 | List<Integer> orderIds = orderList.stream() |
| 78 | + .filter(o -> o.getStatus() == OrderStatusEnum.ALL_SERVED || o.getStatus() == OrderStatusEnum.PARTIAL_SERVED || o.getStatus() == OrderStatusEnum.PREPARING) | ||
| 78 | .map(SingleClientCustomerOrderRpcResponse::getId) | 79 | .map(SingleClientCustomerOrderRpcResponse::getId) |
| 79 | .distinct() | 80 | .distinct() |
| 80 | .collect(Collectors.toList()); | 81 | .collect(Collectors.toList()); | ... | ... |
-
Please register or login to post a comment