From 25b32d61bfbc796b39a6d013d7bc6533fc42dd6a Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Tue, 7 Dec 2021 10:11:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=B5=A0=E5=88=B8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HighDiscountController.java | 1 - .../HighDiscountPackageController.java | 5 ++- .../HighUserDiscountController.java | 38 +++++++++++++++++-- .../hai/dao/HighDiscountUserRelMapperExt.java | 5 ++- .../model/HighUserDiscountUnicomModel.java | 13 +++++++ .../HighDiscountAgentCodeServiceImpl.java | 2 +- .../service/impl/HighDiscountServiceImpl.java | 4 +- .../impl/HltUnionCardVipServiceImpl.java | 2 +- 8 files changed, 56 insertions(+), 14 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java index ab40285d..97e51846 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java @@ -208,7 +208,6 @@ public class HighDiscountController { map.put("useScope", useScope); map.put("discountName", discountName); map.put("discountType", discountType); - map.put("useScope", useScope); PageHelper.startPage(pageNum,pageSize); return ResponseMsgUtil.success(new PageInfo<>(highDiscountService.getDiscount(map))); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java index 4610c9b8..4ccd39ce 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java @@ -218,8 +218,9 @@ public class HighDiscountPackageController { } } + HighDiscountPackage highDiscountPackage1 = highDiscountPackageService.getCallExclusive(highDiscountPackage.getUsingAttribution() , userInfoModel.getBsCompany().getId().intValue()); - if (highDiscountPackageService.getCallExclusive(highDiscountPackage.getUsingAttribution() , userInfoModel.getBsCompany().getId().intValue()) != null) { + if (highDiscountPackage1 != null && highDiscountPackage1.getId() != highDiscountPackage.getId()) { log.error("highCouponPackage -> updateCouponPackageInfo() error!","专属优惠券已存在"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "专属优惠券已存在"); } @@ -489,7 +490,7 @@ public class HighDiscountPackageController { try { Map map = new HashMap<>(); - + map.put("discountPackageId" , id); return ResponseMsgUtil.success(highDiscountPackageDetailsService.getDiscountPackageDetailsList(map)); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java index 8434e566..e0dc89e8 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java @@ -9,15 +9,13 @@ import com.hai.common.exception.SysCode; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; -import com.hai.entity.HighDiscount; -import com.hai.entity.HighDiscountAgentCode; -import com.hai.entity.HighDiscountCouponRel; -import com.hai.entity.HighDiscountUserRel; +import com.hai.entity.*; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.service.HighDiscountAgentCodeService; import com.hai.service.HighDiscountCouponRelService; import com.hai.service.HighDiscountUserRelService; +import com.hai.service.HighOpenApiService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -56,6 +54,9 @@ public class HighUserDiscountController { @Resource private HighDiscountCouponRelService highDiscountCouponRelService; + @Resource + private HighOpenApiService highOpenApiService; + @RequestMapping(value="/receiveDiscount",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "用户领取优惠券") @@ -163,4 +164,33 @@ public class HighUserDiscountController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value = "/getUserOrderPreList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取用户预约订单") + public ResponseData getUserOrderPreList(@RequestParam(name = "usingAttribution", required = false) Integer usingAttribution, + @RequestParam(name = "year", required = false) String year, + HttpServletRequest request) { + try { + + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + + Map map = new HashMap<>(); + map.put("userId", userInfoModel.getHighUser().getId()); + map.put("usingAttribution", usingAttribution); + if (year != null) { + map.put("createTimeS", year + "-01-01 00:00:00"); + map.put("createTimeE", year + "-12-31 23:59:59"); + } + + return ResponseMsgUtil.success(highOpenApiService.getUserCouponsList(map)); + + } catch (Exception e) { + log.error("HighOrderController --> getUserPreOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java index 45cd8278..586dc2d6 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java @@ -17,12 +17,13 @@ public interface HighDiscountUserRelMapperExt { @Select({"