gongfuzhu 1 năm trước cách đây
mục cha
commit
32c88651e2

+ 16 - 0
SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/request/XiaoJuQueryOrderPromotionListModel.java

@@ -0,0 +1,16 @@
+package com.zswl.cloud.springBatch.client.model.request;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class XiaoJuQueryOrderPromotionListModel {
+
+
+    private String storeId;
+
+    private Integer orderAmount;
+}

+ 2 - 2
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/controller/XiaoJuController.java

@@ -106,8 +106,8 @@ public class XiaoJuController {
     @ApiOperation("下单前查询最优可用券")
     @RequestMapping(value = "queryOrderPromotionList", method = RequestMethod.POST)
     @ResourceAuth(value = "user", type = AuthType.User)
-    public ResultContent<List<AllowancePromotionInfo>> queryOrderPromotionList(@RequestBody QueryCalPriceModel queryCalPriceModel) {
-        ResultContent<List<AllowancePromotionInfo>> listResultContent = xiaoJuService.queryOrderPromotionList(queryCalPriceModel);
+    public ResultContent<List<AllowancePromotionInfo>> queryOrderPromotionList(@RequestBody XiaoJuQueryOrderPromotionListModel xiaoJuQueryOrderPromotionListModel) {
+        ResultContent<List<AllowancePromotionInfo>> listResultContent = xiaoJuService.queryOrderPromotionList(xiaoJuQueryOrderPromotionListModel);
         return ResultContent.buildContent(listResultContent);
     }
 

+ 7 - 6
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/XiaoJuService.java

@@ -343,13 +343,14 @@ public class XiaoJuService {
 
 
     // 下单前查询最优可用券
-    public ResultContent<List<AllowancePromotionInfo>> queryOrderPromotionList(QueryCalPriceModel queryCalPriceModel) {
+    public ResultContent<List<AllowancePromotionInfo>> queryOrderPromotionList(XiaoJuQueryOrderPromotionListModel xiaoJuQueryOrderPromotionListModel) {
         String userId = authHelper.getCurrentUser().getUserId();
         QueryOrderPromotionListRequest request = new QueryOrderPromotionListRequest();
         request.setOutUserId(userId);
-        request.setStoreId(queryCalPriceModel.getStoreId());
+        request.setStoreId(xiaoJuQueryOrderPromotionListModel.getStoreId());
         request.setAllowanceType(2);
-        request.setOrderAmount(queryCalPriceModel.getAmount());
+        request.setMobile(authHelper.getCurrentUser().getPhone());
+        request.setOrderAmount(xiaoJuQueryOrderPromotionListModel.getOrderAmount());
 
         QueryClient queryClient = QueryClientFactory.create(oilConfig);
 
@@ -361,7 +362,7 @@ public class XiaoJuService {
             List<AllowancePromotionInfo> response = queryClient.promotion().queryOrderPromotionList(request);
             apiLog.setResponse(JSONUtil.toJsonStr(response));
             apiLogDao.save(apiLog);
-            return ResultContent.buildContent(response);
+            return ResultContent.build(ResultState.Success,response);
         } catch (Exception e) {
             e.printStackTrace();
             apiLog.setResponse(e.getCause().getMessage());
@@ -391,7 +392,7 @@ public class XiaoJuService {
             List<AllowancePromotionInfo> response = queryClient.promotion().queryStorePromotionList(request);
             apiLog.setResponse(JSONUtil.toJsonStr(response));
             apiLogDao.save(apiLog);
-            return ResultContent.buildContent(response);
+            return ResultContent.build(ResultState.Success,response);
         } catch (Exception e) {
             apiLog.setResponse(e.getCause().getMessage());
             apiLogDao.save(apiLog);
@@ -421,7 +422,7 @@ public class XiaoJuService {
             QueryUserPromotionListResponse response = queryClient.promotion().queryUserPromotionList(request);
             apiLog.setResponse(JSONUtil.toJsonStr(response));
             apiLogDao.save(apiLog);
-            return ResultContent.buildContent(response);
+            return ResultContent.build(ResultState.Success,response);
         } catch (Exception e) {
 
             e.printStackTrace();