Browse Source

bug修复

cs 2 years ago
parent
commit
cf9941440b

+ 7 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -2767,7 +2767,7 @@ public class WeiXinCorpController {
             }
         }else {
             String orderId = "";
-            if (jsonObject.getString("OrderId")!=null){
+            if (jsonObject.has("OrderId")){
                 orderId = jsonObject.getString("OrderId");
             }else {
                 orderId = jsonObject.getString("NewOrderId");
@@ -2779,6 +2779,8 @@ public class WeiXinCorpController {
             HttpEntity<JSONObject> detailEntity = new HttpEntity<>(detailMap, headers);
             ResponseEntity<String> detailResponseEntity = restTemplate.postForEntity(detailUrl, detailEntity, String.class);
             String body = detailResponseEntity.getBody();
+            System.out.println("+++++++++++++++++++++++++++++++订单详情信息");
+            System.out.println(body);
             JSONObject orderDetail = JSONObject.parseObject(body);
             if (orderDetail.getInteger("errcode")==0){
                 wxOrder.setOrderid(orderDetail.getString("orderid"));
@@ -2797,13 +2799,13 @@ public class WeiXinCorpController {
                 wxOrder.setPrice(orderDetail.getDouble("price"));
                 wxOrder.setUserCount(orderDetail.getInteger("user_count"));
                 wxOrder.setOrderPeriod(orderDetail.getInteger("order_period"));
-                LocalDateTime order_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("order_time")/1000,0,ZoneOffset.ofHours(8));
+                LocalDateTime order_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("order_time"),0,ZoneOffset.ofHours(8));
                 wxOrder.setOrderTime(order_time);
-                LocalDateTime paid_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("paid_time")/1000,0,ZoneOffset.ofHours(8));
+                LocalDateTime paid_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("paid_time"),0,ZoneOffset.ofHours(8));
                 wxOrder.setPaidTime(paid_time);
-                LocalDateTime begin_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("begin_time")/1000,0,ZoneOffset.ofHours(8));
+                LocalDateTime begin_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("begin_time"),0,ZoneOffset.ofHours(8));
                 wxOrder.setBeginTime(begin_time);
-                LocalDateTime end_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("end_time")/1000,0,ZoneOffset.ofHours(8));
+                LocalDateTime end_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("end_time"),0,ZoneOffset.ofHours(8));
                 wxOrder.setEndTime(end_time);
                 wxOrder.setOrderFrom(orderDetail.getInteger("order_from"));
                 wxOrder.setOperatorCorpid(orderDetail.getString("operator_corpid"));