From 7596dd8281c6de16b7d3456e66a27bff94513add Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Sat, 27 Mar 2021 01:35:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighCouponController.java | 6 ++ .../bweb/controller/HighOrderController.java | 97 +++++++++++++++++++ .../excelListener/ImportCouponListener.java | 2 +- .../cweb/controller/HighCouponController.java | 2 + .../com/hai/service/HighAgentService.java | 11 +++ .../service/impl/HighCouponServiceImpl.java | 4 + 6 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java create mode 100644 hai-service/src/main/java/com/hai/service/HighAgentService.java diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java index 801d78f7..d19ab28e 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -81,6 +81,8 @@ public class HighCouponController { || StringUtils.isBlank(highCoupon.getCouponDesc()) || highCoupon.getCouponPrice() == null || highCoupon.getCouponType() == null + || highCoupon.getPayType() == null + || highCoupon.getDisplayArea() == null || highCoupon.getSalesEndTime() == null || highCoupon.getRecycleDay() == null || highCoupon.getLimitNumber()== null @@ -155,6 +157,8 @@ public class HighCouponController { || StringUtils.isBlank(highCoupon.getCouponDesc()) || highCoupon.getCouponPrice() == null || highCoupon.getCouponType() == null + || highCoupon.getPayType() == null + || highCoupon.getDisplayArea() == null || highCoupon.getSalesEndTime() == null || highCoupon.getRecycleDay() == null || highCoupon.getLimitNumber()== null @@ -326,6 +330,7 @@ public class HighCouponController { @RequestParam(name = "merchantId", required = false) Long merchantId, @RequestParam(name = "couponName", required = false) String couponName, @RequestParam(name = "couponType", required = false) Integer couponType, + @RequestParam(name = "displayArea", required = false) Integer displayArea, @RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { @@ -343,6 +348,7 @@ public class HighCouponController { map.put("merchantId", merchantId); map.put("couponName", couponName); map.put("couponType", couponType); + map.put("displayArea", displayArea); map.put("status", status); PageHelper.startPage(pageNum, pageSize); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java new file mode 100644 index 00000000..43a08209 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -0,0 +1,97 @@ +package com.bweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.DateUtil; +import com.hai.common.utils.IDGenerator; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighChildOrder; +import com.hai.entity.HighOrder; +import com.hai.model.HighCouponModel; +import com.hai.model.HighUserModel; +import com.hai.model.ResponseData; +import com.hai.service.HighCouponCodeService; +import com.hai.service.HighCouponService; +import com.hai.service.HighOrderService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @Auther: 袁野 + * @Description: + * @Date: 2021/3/26 23:08 + */ +@Controller +@RequestMapping(value = "/highOrder") +@Api(value = "订单接口") +public class HighOrderController { + + private static Logger log = LoggerFactory.getLogger(HighMerchantStoreController.class); + + @Autowired + private UserCenter userCenter; + + @Resource + private HighOrderService highOrderService; + + @Resource + private HighCouponService highCouponService; + + @Resource + private HighCouponCodeService highCouponCodeService; + + + + @RequestMapping(value = "/getOrderById", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据id查询订单详情") + public ResponseData getOrderById(@RequestParam(name = "orderId", required = true) Long orderId) { + try { + + return ResponseMsgUtil.success(highOrderService.getOrderById(orderId)); + + } catch (Exception e) { + log.error("HighOrderController --> getOrderById() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/getOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取用户订单") + public ResponseData getUserOrderList(@RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + + + + Map map = new HashMap<>(); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java b/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java index 467f2d50..d926e569 100644 --- a/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java +++ b/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java @@ -49,7 +49,7 @@ public class ImportCouponListener extends AnalysisEventListener collect = allCouponCode.stream().filter(o -> o.getSalesCode().equals(importCouponModel.getSalesCode())).collect(Collectors.toList()); - if (collect != null && collect.size() > 0) { + if (collect.size() > 0) { importCouponModel.setErrorMessage("销售码已存在"); errorData.add(importCouponModel); return; diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java b/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java index 2c6c5784..a8a21463 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java @@ -64,6 +64,7 @@ public class HighCouponController { @RequestParam(name = "merchantId", required = false) Long merchantId, @RequestParam(name = "couponName", required = false) String couponName, @RequestParam(name = "couponType", required = false) Integer couponType, + @RequestParam(name = "displayArea", required = false) Integer displayArea, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize) { try { @@ -75,6 +76,7 @@ public class HighCouponController { map.put("merchantId", merchantId); map.put("couponName", couponName); map.put("couponType", couponType); + map.put("displayArea", displayArea); map.put("status", 2); PageHelper.startPage(pageNum, pageSize); return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); diff --git a/hai-service/src/main/java/com/hai/service/HighAgentService.java b/hai-service/src/main/java/com/hai/service/HighAgentService.java new file mode 100644 index 00000000..f37d3f1e --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighAgentService.java @@ -0,0 +1,11 @@ +package com.hai.service; + +/** + * @ClassName: HighAgentService + * @Description: 代理商管理 + * @author: 袁野 + * @date: 2021/03/26 18:20 + * @Copyright: 2021 www.high.com Inc. All rights reserved. + */ +public interface HighAgentService { +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 495364de..2cbe4f05 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -338,6 +338,10 @@ public class HighCouponServiceImpl implements HighCouponService { criteria.andCouponTypeEqualTo(MapUtils.getInteger(map, "couponType")); } + if (MapUtils.getInteger(map, "displayArea") != null) { + criteria.andDisplayAreaEqualTo(MapUtils.getInteger(map, "displayArea")); + } + if (MapUtils.getInteger(map, "status") != null) { criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); }