From 4940188ce82b4441c8aec5ef67da0511413d0073 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Mon, 5 Apr 2021 23:13:15 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HighDiscountAgentRelController.java | 2 +- .../bweb/controller/HighDiscountController.java | 14 +++++++++++--- .../com/cweb/controller/HighCouponController.java | 1 + .../hai/service/impl/HighCouponServiceImpl.java | 6 ++++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java index b7440e11..3a5acae4 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java @@ -105,7 +105,7 @@ public class HighDiscountAgentRelController { // 生成二维码 String qrCodeImg = DateUtil.date2String(new Date(),agent.getId() + discount.getId() + "yyyyMMddHHmmss") + IDGenerator.nextId(2) +".png"; - String qrCodeUrl = SysConst.getSysConfig().getAgentQrCode() + "/ " + qrCodeImg; + String qrCodeUrl = SysConst.getSysConfig().getAgentQrCode() + "/" + qrCodeImg; //参数 Map map = new HashMap<>(); 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 b57f9d17..894af706 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java @@ -88,6 +88,8 @@ public class HighDiscountController { highDiscount.setCompanyId(userInfoModel.getBsCompany().getId()); highDiscount.setOperatorId(userInfoModel.getSecUser().getId()); highDiscount.setOperatorName(userInfoModel.getSecUser().getUserName()); + highDiscount.setCreateTime(new Date()); + highDiscount.setUpdateTime(new Date()); highDiscount.setStatus(1); highDiscountService.insertDiscount(highDiscount); @@ -136,7 +138,7 @@ public class HighDiscountController { discount.setDiscountImg(highDiscount.getDiscountImg()); discount.setDiscountCarouselImg(highDiscount.getDiscountCarouselImg()); discount.setEffectiveDay(highDiscount.getEffectiveDay()); - + discount.setUpdateTime(new Date()); highDiscountService.updateDiscount(highDiscount); return ResponseMsgUtil.success("操作成功"); @@ -192,10 +194,16 @@ public class HighDiscountController { @RequestParam(name = "discountName", required = false) String discountName, @RequestParam(name = "discountType", required = false) Integer discountType, @RequestParam(name = "pageNum", required = true) Integer pageNum, - @RequestParam(name = "pageSize", required = true) Integer pageSize) { + @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { - + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + if (userInfoModel.getBsCompany() == null) { + log.error("HighDiscountController -> updateDiscount() error!","该主角色没有权限"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); + } Map map = new HashMap<>(); + map.put("companyId", userInfoModel.getBsCompany().getId()); map.put("discountKey", discountKey); map.put("discountName", discountName); map.put("discountType", discountType); 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 caf2ba04..49bb5d6c 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java @@ -81,6 +81,7 @@ public class HighCouponController { map.put("couponName", couponName); map.put("couponType", couponType); map.put("displayArea", displayArea); + map.put("notCouponSource", 2); 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/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 1d2b4166..b269061f 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 @@ -355,8 +355,10 @@ public class HighCouponServiceImpl implements HighCouponService { if (MapUtils.getInteger(map, "couponSource") != null) { criteria.andCouponSourceEqualTo(MapUtils.getInteger(map, "status")); - } else { - criteria.andCouponSourceNotEqualTo(2); + } + + if (MapUtils.getInteger(map, "notCouponSource") != null) { + criteria.andCouponSourceNotEqualTo(MapUtils.getInteger(map, "notCouponSource")); } example.setOrderByClause("create_time desc");