From 1c9b1d48312fedbb6526e22e75ed8a922c5a52c8 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Mon, 29 Nov 2021 22:18:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HighDiscountPackageController.java | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) 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 59592009..da5abf0b 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java @@ -103,22 +103,28 @@ public class HighDiscountPackageController { if (StringUtils.isBlank(highDiscountPackage.getTitle()) || highDiscountPackage.getUsingAttribution() == null || highDiscountPackage.getSalesType() == null - || highDiscountPackage.getEffectiveTiem() == null - || highDiscountPackage.getPurchaseNum() == null - || highDiscountPackage.getPrice() == null || StringUtils.isBlank(highDiscountPackage.getBannerImg()) || StringUtils.isBlank(highDiscountPackage.getListImg()) || StringUtils.isBlank(highDiscountPackage.getDetailsImg()) ) { - log.error("HighAgentController -> insertAgent() error!","参数错误"); + log.error("HighAgentController -> insertCouponPackageInfo() error!","参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } if (userInfoModel.getBsCompany() == null) { - log.error("highCouponPackage -> highCouponPackageInfo() error!","该主角色没有权限"); + log.error("highCouponPackage -> insertCouponPackageInfo() error!","该主角色没有权限"); throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); } + if (highDiscountPackage.getSalesType() == 1) { + if (highDiscountPackage.getPurchaseNum() == null + || highDiscountPackage.getPrice() == null + ) { + log.error("HighAgentController -> insertCouponPackageInfo() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } + highDiscountPackage.setCompanyId(userInfoModel.getBsCompany().getId().intValue()); highDiscountPackage.setStatus(3); highDiscountPackage.setCreatedTime(new Date()); @@ -280,7 +286,18 @@ public class HighDiscountPackageController { HighDiscountPackageDetails highDiscountPackageDetails = highDiscountPackageDetailsService.findDetailsById(object.getInteger("discountPackageId")); - return ResponseMsgUtil.success(highDiscountPackageDetailsService.getDiscountPackageDetailsList(map)); + if (highDiscountPackageDetails == null || highDiscountPackageDetails.getStatus() == 2) { + log.error("highCouponPackage -> highCouponPackageInfo() error!","状态错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, ""); + } + + highDiscountPackageDetails.setStatus(2); + highDiscountPackageDetails.setUpdatedTime(new Date()); + highDiscountPackageDetails.setUpdatedUserId(userInfoModel.getSecUser().getId().intValue()); + + highDiscountPackageDetailsService.updateDiscountPackageDetails(highDiscountPackageDetails); + + return ResponseMsgUtil.success("删除成功"); } catch (Exception e) { log.error("HighOrderController --> getUserOrderList() error!", e); From 73c0a1bb42ad9f748ddffcbed5a037165acec09a Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 30 Nov 2021 00:13:53 +0800 Subject: [PATCH 2/2] =?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 --- .../main/java/com/bweb/controller/HighDiscountController.java | 2 ++ .../src/main/java/com/hai/entity/HighDiscountPackage.java | 2 +- .../java/com/hai/service/impl/HighDiscountServiceImpl.java | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) 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 03cc9c83..97e51846 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java @@ -192,6 +192,7 @@ public class HighDiscountController { public ResponseData getDiscountList(@RequestParam(name = "discountKey", required = false) String discountKey, @RequestParam(name = "discountName", required = false) String discountName, @RequestParam(name = "discountType", required = false) Integer discountType, + @RequestParam(name = "useScope", required = false) Integer useScope, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { @@ -204,6 +205,7 @@ public class HighDiscountController { Map map = new HashMap<>(); map.put("companyId", userInfoModel.getBsCompany().getId()); map.put("discountKey", discountKey); + map.put("useScope", useScope); map.put("discountName", discountName); map.put("discountType", discountType); diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java index 7d4d94e5..2841f2fb 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java @@ -77,7 +77,7 @@ public class HighDiscountPackage implements Serializable { /** * 创建时间 */ - private Date createdTime; + private Date createdTime; /** * 更新人 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountServiceImpl.java index 593a7371..67f3b98c 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountServiceImpl.java @@ -53,6 +53,9 @@ public class HighDiscountServiceImpl implements HighDiscountService { if (MapUtils.getInteger(map, "discountType") != null) { criteria.andDiscountTypeEqualTo(MapUtils.getInteger(map, "discountType")); } + if (MapUtils.getInteger(map, "useScope") != null) { + criteria.andUseScopeEqualTo(MapUtils.getInteger(map, "useScope")); + } if (MapUtils.getLong(map, "companyId") != null) { criteria.andCompanyIdEqualTo(MapUtils.getLong(map, "companyId")); }