Bladeren bron

Merge branch 'refs/heads/master' into Data-Isolation

gongfuzhu 7 maanden geleden
bovenliggende
commit
338db36a5e
14 gewijzigde bestanden met toevoegingen van 49 en 16 verwijderingen
  1. 0 2
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/api/qiuxiang/QiuXiangApi.java
  2. 1 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/controller/PaymentController.java
  3. 1 1
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/controller/QiuXiangController.java
  4. 0 1
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/standard/StandarDeliveryJob.java
  5. 1 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/ypp/kfcDeliveryJob.java
  6. 1 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/CinemaPublish.java
  7. 1 1
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/HotelPublish.java
  8. 2 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/KfcPublish.java
  9. 1 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/PetrolStationPublish.java
  10. 1 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/TicketPublish.java
  11. 1 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/Video2Publish.java
  12. 9 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/PaymentService.java
  13. 29 10
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/YppService.java
  14. 1 1
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/impl/KfcServiceImpl.java

+ 0 - 2
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/api/qiuxiang/QiuXiangApi.java

@@ -185,7 +185,6 @@ public class QiuXiangApi {
     /**
      * 取消订单
      *
-     * @param token
      * @param orderId
      * @param reason
      * @return
@@ -202,7 +201,6 @@ public class QiuXiangApi {
     /**
      * 获取司机实时位置
      *
-     * @param token
      * @param orderId
      * @return
      */

+ 1 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/controller/PaymentController.java

@@ -248,6 +248,7 @@ public class PaymentController {
 
         SyncWithdrawals syncWithdrawals = new SyncWithdrawals();
         BeanUtils.copyProperties(jsonObject, syncWithdrawals);
+        paymentServer.syncWithdrawals(syncWithdrawals);
         return "SUCCESS";
     }
 

+ 1 - 1
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/controller/QiuXiangController.java

@@ -56,7 +56,7 @@ public class QiuXiangController {
     @RequestMapping(value = "cancelOrder", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE})
     public ResultContent cancelOrder(@RequestBody Map<String, String> orderRequest) {
 
-        return ResultContent.buildContent(qiuXiangService.cancelOrder(orderRequest.get("orderId"), orderRequest.get("reason")));
+        return qiuXiangService.cancelOrder(orderRequest.get("orderId"), orderRequest.get("reason"));
     }
 
     @ApiOperation("获取司机位置")

+ 0 - 1
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/standard/StandarDeliveryJob.java

@@ -58,7 +58,6 @@ public class StandarDeliveryJob {
                         resultContent.set(ResultContent.build(com.github.microservice.auth.client.content.ResultState.Fail));
                         return RepeatStatus.FINISHED;
                     }
-                    orderService2.delivery(goodsResultModel.getId());
                     resultContent.set(ResultContent.build(com.github.microservice.auth.client.content.ResultState.Success));
                     return RepeatStatus.FINISHED;
 

+ 1 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/ypp/kfcDeliveryJob.java

@@ -74,6 +74,7 @@ public class kfcDeliveryJob {
                     if (!subOrdersConfirmResponseModelResultContent.getState().equals(ResultState.Success)) {
                         log.info("分账失败:{}", JSONUtil.toJsonStr(goodsResultModel));
                         getResultContent().set(ResultContent.build(ResultState.Fail));
+                        return RepeatStatus.FINISHED;
                     }
 
 

+ 1 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/CinemaPublish.java

@@ -94,6 +94,7 @@ public class CinemaPublish implements ProductPublish {
                                 .salePrice(sellPrice)
                                 .locationPoint(locationModel)
                                 .meta(Map.of("cinemas", entry))
+                                .expireTimeSecond(60 * 60 * 24 * 30)
                                 .build()
                 ));
             } catch (Exception e) {

+ 1 - 1
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/HotelPublish.java

@@ -120,7 +120,7 @@ public class HotelPublish implements ProductPublish {
                                     .locationPoint(locationModel)
                                     .title(chineseName)
                                     .meta(Map.of("hotel", it))
-//                            .expireTimeSecond(60 * 60 * 24)
+                                    .expireTimeSecond(60 * 60 * 24 * 10)
                                     .build()));
                         }
                 );

+ 2 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/KfcPublish.java

@@ -97,6 +97,7 @@ public class KfcPublish implements ProductPublish {
                                             .locationPoint(locationModel)
                                             .title(it.getShopName())
                                             .meta(Map.of("shop", it, "ot", string))
+                                            .expireTimeSecond(60 * 60 * 24 * 10)
                                             .build()));
                         } catch (Exception e) {
                             e.printStackTrace();
@@ -126,6 +127,7 @@ public class KfcPublish implements ProductPublish {
                                                     .cover(new String[]{(String) imageUrl})
                                                     .salePrice(new BigDecimal(String.valueOf(priceHead)).multiply(BigDecimal.valueOf(100)).longValue())
                                                     .meta(Map.of("menus", jsonObject, "ot", string))
+                                                    .expireTimeSecond(60*60*24)
                                                     .build()));
 
                                 });

+ 1 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/PetrolStationPublish.java

@@ -95,6 +95,7 @@ public class PetrolStationPublish implements ProductPublish {
                                 .salePrice(Long.valueOf(min))
                                 .meta(Map.of("store", it))
                                 .locationPoint(locationModel)
+                                .expireTimeSecond(60 * 60 * 24 * 30)
                                 .build()));
             } catch (Exception e) {
                 log.info("错误店铺:{}", it);

+ 1 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/TicketPublish.java

@@ -93,6 +93,7 @@ public class TicketPublish implements ProductPublish {
                                     .salePrice(min)
                                     .meta(Map.of("scenic", it))
                                     .locationPoint(locationModel)
+                                    .expireTimeSecond(60 * 60 * 24 * 30)
                                     .build()));
                 } catch (Exception e) {
                     e.printStackTrace();

+ 1 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/Video2Publish.java

@@ -70,6 +70,7 @@ public class Video2Publish implements ProductPublish {
                                 .title(it.getItemName())
                                 .salePrice(multiply.longValue())
                                 .meta(Map.of("goods", it))
+                                .expireTimeSecond(60 * 60 * 24)
                                 .build()
                 ));
             } catch (Exception e) {

+ 9 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/PaymentService.java

@@ -7,12 +7,14 @@ import com.zhongshu.payment.client.model.*;
 import com.zhongshu.payment.client.model.order.AdminSeachOrderModel;
 import com.zhongshu.payment.client.model.order.v2.*;
 import com.zhongshu.payment.client.model.payment.QueryResponseModel;
+import com.zhongshu.payment.client.model.payment.withdrawals.zhongshu.SyncWithdrawals;
 import com.zhongshu.payment.client.model.payment.zswl.*;
 import com.zhongshu.payment.client.service.v2.OrderService2;
 import com.zhongshu.payment.client.service.v2.PaymentService2;
 import com.zhongshu.payment.client.type.Channel;
 import com.zhongshu.payment.client.type.JobFlowMap;
 import com.zhongshu.payment.client.type.JobFlowType;
+import com.zswl.cloud.springBtach.server.core.dao.ApiLogDao;
 import com.zswl.cloud.springBtach.server.core.job.standard.StandarPayJob;
 import lombok.SneakyThrows;
 import org.springframework.batch.core.Job;
@@ -53,6 +55,8 @@ public class PaymentService {
 
     @Resource
     private JobLauncher jobLauncher;
+    @Autowired
+    private ApiLogDao apiLogDao;
 
 
     @SneakyThrows
@@ -202,4 +206,9 @@ public class PaymentService {
     }
 
 
+    public String syncWithdrawals(SyncWithdrawals syncWithdrawals) {
+        paymentService2.queryWithdrawals(syncWithdrawals.getData().getBatchNo());
+        return "SUCCESS";
+    }
+
 }

+ 29 - 10
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/YppService.java

@@ -67,7 +67,7 @@ public class YppService {
         String orderNo = snowflake.nextIdStr();
         AccountDetailVo accountDetailVo = shopSetting.getContent();
         List<ShopInfoSimpleVo> shops = accountDetailVo.getShops();
-        if (shops.isEmpty()){
+        if (shops.isEmpty()) {
             return ResultContent.build(ResultState.Fail, "有票票店铺未创建");
         }
         // 分账信息
@@ -222,21 +222,40 @@ public class YppService {
                 String kfcState = String.valueOf(kfcData.get("orderState"));
                 String kfcRefundAmount = String.valueOf(kfcData.get("refundAmount"));
                 String kfcOrderId = String.valueOf(kfcData.get("id"));
-                ResultContent<GoodsResultModel> kfcChannelGoods = orderService2.findChannelGoods(JobFlowMap.YPP, kfcOrderId);
+                ResultContent<GoodsResultModel> kfcChannelGoods = orderService2.findChannelGoods(JobFlowMap.Kfc, kfcOrderId);
                 GoodsResultModel kfcgoodsResultModel = kfcChannelGoods.getContent();
                 UpdateGoodsModel kfcupdateGoodsModel = new UpdateGoodsModel();
                 kfcupdateGoodsModel.setId(kfcgoodsResultModel.getId());
                 JSONObject kfcentries = JSONUtil.parseObj(kfcgoodsResultModel.getExtend());
                 kfcentries.put("sync", syncOrderRequest.getData());
                 kfcupdateGoodsModel.setExtend(kfcentries);
-                if (kfcState.equals("3")) {
-                    kfcupdateGoodsModel.setGoodsState(OrderType.USED);
-                } else {
-                    ApplicantRefundParam2Model applicantRefundParam2Model = new ApplicantRefundParam2Model();
-                    applicantRefundParam2Model.setId(kfcgoodsResultModel.getId());
-                    applicantRefundParam2Model.setRemark("点餐退款:" + kfcRefundAmount);
-                    applicantRefundParam2Model.setUserId(kfcgoodsResultModel.getUserId());
-                    paymentService2.refund(applicantRefundParam2Model);
+                switch (kfcState) {
+
+                    case "3":
+                        kfcupdateGoodsModel.setGoodsState(OrderType.USED);
+                        break;
+                    case "6":
+                    case "8":
+                        ApplicantRefundParam2Model applicantRefundParam2Model = new ApplicantRefundParam2Model();
+                        applicantRefundParam2Model.setId(kfcgoodsResultModel.getId());
+                        applicantRefundParam2Model.setRemark("点餐退款:" + kfcRefundAmount);
+                        applicantRefundParam2Model.setUserId(kfcgoodsResultModel.getUserId());
+                        paymentService2.applicantRefund(applicantRefundParam2Model);
+                        RefundParam2Model refundParam2Model = new RefundParam2Model();
+                        refundParam2Model.setId(kfcgoodsResultModel.getId());
+                        refundParam2Model.setRefundAmount(BigDecimal.valueOf(Double.parseDouble(kfcRefundAmount)));
+                        refundParam2Model.setBuyShopAmount(BigDecimal.valueOf(Double.parseDouble(kfcRefundAmount)));
+                        refundParam2Model.setUseShopAmount(BigDecimal.ZERO);
+                        refundParam2Model.setPlatformAmount(BigDecimal.ZERO);
+                        refundParam2Model.setOrderType(OrderType.APPLY_REFUNDING);
+
+                        try {
+                            paymentService2.auditRefund(refundParam2Model);
+
+                        } catch (Exception e) {
+                        }
+
+                        break;
                 }
                 orderService2.updateGoods(kfcupdateGoodsModel);
 

+ 1 - 1
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/impl/KfcServiceImpl.java

@@ -98,7 +98,7 @@ public class KfcServiceImpl {
         String authAccount = accountDetailVo.getAuthAccount();
         SharePlatformVo sharePlatformVo = accountDetailVo.getSharePlatformVo();
 
-        kfcGoodsDetailRequest.setPhone(authHelper.getCurrentUser().getPhone());
+        kfcGoodsDetailRequest.setPhone(kfcGoodsDetailRequest.getPhone());
         CreateOrdereResponse createOrdereResponse = kfcApi.create_order(kfcGoodsDetailRequest);
         BigDecimal bigDecimal = BigDecimal.valueOf(createOrdereResponse.getData().getPayAmount());