From 16ba17b367406c53a090fa88703b067a30d275b9 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Thu, 9 Dec 2021 17:52:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=A0=E5=88=B8=E6=B1=87?= =?UTF-8?q?=E8=81=94=E9=80=9A=E8=B5=A0=E9=80=81=E8=A7=84=E5=88=99=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=93=B6=E8=81=94=E4=B8=8D=E7=8E=B0=E5=AE=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HighDiscountController.java | 2 +- .../HighDiscountPackageController.java | 63 +++++++-- .../controller/HighOpenApiController.java | 6 +- .../bweb/controller/HighOrderController.java | 126 ++++++++++++++++++ .../HighUserDiscountController.java | 4 +- .../config/HuiLianTongUnionCardConfig.java | 2 +- .../hai/dao/HighDiscountUserRelMapperExt.java | 2 +- .../java/com/hai/dao/HighOrderMapperExt.java | 65 ++++++++- .../HighDiscountPackageRecordService.java | 26 ++++ .../com/hai/service/HighOrderService.java | 7 + .../HighDiscountPackageRecordServiceImpl.java | 55 ++++++++ .../impl/HighDiscountPackageServiceImpl.java | 10 +- .../service/impl/HighOrderServiceImpl.java | 23 ++++ .../impl/HltUnionCardVipServiceImpl.java | 17 ++- 14 files changed, 371 insertions(+), 37 deletions(-) create mode 100644 hai-service/src/main/java/com/hai/service/HighDiscountPackageRecordService.java create mode 100644 hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageRecordServiceImpl.java 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 97e51846..81e5744c 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java @@ -63,7 +63,7 @@ public class HighDiscountController { || highDiscount.getDiscountType() == null || highDiscount.getDiscountPrice() == null || highDiscount.getEffectiveDay() == null - || highDiscount.getUsingRange() == null + || highDiscount.getUseScope() == null || highDiscount.getSalesEndTime() == null) { log.error("HighDiscountController -> insertDiscount() error!","参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); 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 34cd9a75..eabb1b6d 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java @@ -15,6 +15,7 @@ import com.hai.model.UserInfoModel; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.models.auth.In; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,9 +53,13 @@ public class HighDiscountPackageController { @Resource private HighDiscountService highDiscountService; + @Resource private HighDiscountInventoryRecordService discountInventoryRecordService; + @Resource + private HighDiscountPackageRecordService discountPackageRecordService; + @RequestMapping(value = "/getDiscountPackageList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取优惠券包列表") @@ -131,9 +136,9 @@ public class HighDiscountPackageController { if (StringUtils.isBlank(highDiscountPackage.getTitle()) || highDiscountPackage.getSalesType() == null - || StringUtils.isBlank(highDiscountPackage.getBannerImg()) - || StringUtils.isBlank(highDiscountPackage.getListImg()) - || StringUtils.isBlank(highDiscountPackage.getDetailsImg()) +// || StringUtils.isBlank(highDiscountPackage.getBannerImg()) +// || StringUtils.isBlank(highDiscountPackage.getListImg()) +// || StringUtils.isBlank(highDiscountPackage.getDetailsImg()) ) { log.error("HighAgentController -> insertCouponPackageInfo() error!","参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); @@ -153,9 +158,11 @@ public class HighDiscountPackageController { } } - if (highDiscountPackageService.getCallExclusive(highDiscountPackage.getUsingAttribution() , userInfoModel.getBsCompany().getId().intValue()) != null) { - log.error("highCouponPackage -> insertCouponPackageInfo() error!","当前优惠券已存在"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前优惠券已存在"); + if (highDiscountPackage.getUsingAttribution() != null) { + if (highDiscountPackageService.getCallExclusive(highDiscountPackage.getUsingAttribution() , userInfoModel.getBsCompany().getId().intValue()) != null) { + log.error("highCouponPackage -> insertCouponPackageInfo() error!","当前优惠券已存在"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前优惠券已存在"); + } } highDiscountPackage.setCompanyId(userInfoModel.getBsCompany().getId().intValue()); @@ -219,11 +226,12 @@ public class HighDiscountPackageController { } } - HighDiscountPackage highDiscountPackage1 = highDiscountPackageService.getCallExclusive(highDiscountPackage.getUsingAttribution() , userInfoModel.getBsCompany().getId().intValue()); - - if (highDiscountPackage1 != null && highDiscountPackage1.getId() != highDiscountPackage.getId()) { - log.error("highCouponPackage -> updateCouponPackageInfo() error!","专属优惠券已存在"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "专属优惠券已存在"); + if (highDiscountPackage.getUsingAttribution() != null) { + HighDiscountPackage highDiscountPackage1 = highDiscountPackageService.getCallExclusive(highDiscountPackage.getUsingAttribution() , userInfoModel.getBsCompany().getId().intValue()); + if (highDiscountPackage1 != null && highDiscountPackage1.getId() != highDiscountPackage.getId()) { + log.error("highCouponPackage -> updateCouponPackageInfo() error!","专属优惠券已存在"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "专属优惠券已存在"); + } } highDiscountPackage.setStatus(3); @@ -232,6 +240,7 @@ public class HighDiscountPackageController { highDiscountPackage.setCompanyId(highDiscountPackages.getCompanyId()); highDiscountPackage.setCreatedUserId(highDiscountPackages.getCreatedUserId()); highDiscountPackage.setCreatedTime(highDiscountPackages.getCreatedTime()); + highDiscountPackage.setTotalStock(highDiscountPackage.getTotalStock()); highDiscountPackageService.updateDiscountPackage(highDiscountPackage); @@ -570,4 +579,36 @@ public class HighDiscountPackageController { } } + @RequestMapping(value = "/getDiscountPackageOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取优惠券包订单记录列表") + public ResponseData getDiscountPackageOrderList( + @RequestParam(name = "title", required = false) String title, + @RequestParam(name = "phone", required = false) String phone, + @RequestParam(name = "recordNo", required = false) String recordNo, + @RequestParam(name = "saleType", required = false) Integer saleType, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + Map map = new HashMap<>(); + + map.put("companyId", userInfoModel.getBsCompany().getId()); + map.put("title", title); + map.put("phone", phone); + map.put("recordNo", recordNo); + map.put("saleType", saleType); + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(discountPackageRecordService.getDiscountPackageRecord(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java index d68a8e5f..b03e50e6 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java @@ -44,10 +44,10 @@ public class HighOpenApiController { @Resource private HighUserService highUserService; - @RequestMapping(value = "/getUserOrderPreList", method = RequestMethod.GET) + @RequestMapping(value = "/getUserExclusiveDiscount", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取专属优惠券") - public ResponseData getUserOrderPreList(@RequestParam(name = "usingAttribution", required = false) Integer usingAttribution, + public ResponseData getUserExclusiveDiscount(@RequestParam(name = "useScope", required = false) Integer useScope, @RequestParam(name = "phone", required = true) String phone, @RequestParam(name = "year", required = false) String year) { try { @@ -61,7 +61,7 @@ public class HighOpenApiController { Map map = new HashMap<>(); map.put("userId", highUser.getId()); - map.put("usingAttribution", usingAttribution); + map.put("useScope", useScope); if (year != null) { map.put("createTimeS", year + "-01-01 00:00:00"); map.put("createTimeE", year + "-12-31 23:59:59"); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java index 370d8555..3be23e37 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -628,5 +628,131 @@ public class HighOrderController { } } + @RequestMapping(value = "/getDiscountPackageList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询优惠券包订单列表") + public ResponseData getDiscountPackageList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "merchantId", required = false) Long merchantId, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "memDiscountName", required = false) String memDiscountName, + @RequestParam(name = "memPhone", required = false) String memPhone, + @RequestParam(name = "payModel", required = false) Integer payModel, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "orderStatus", required = false) Integer orderStatus, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + Map map = new HashMap<>(); + // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 + if(userInfoModel.getSecUser().getObjectType() == 0) { + map.put("companyId", companyId); + + } else if (userInfoModel.getSecUser().getObjectType() == 1) { + + if (userInfoModel.getBsCompany().getId() == 3) { + map.put("companyId", 23); + } else { + map.put("companyId", userInfoModel.getBsCompany().getId()); + } + + map.put("merchantId", merchantId); + + } else if (userInfoModel.getSecUser().getObjectType() == 2) { + map.put("merchantId", userInfoModel.getMerchant().getId()); + } + + map.put("orderNo", orderNo); + map.put("paySerialNo", paySerialNo); + map.put("payModel", payModel); + map.put("memDiscountName", memDiscountName); + map.put("payType", payType); + map.put("memPhone", memPhone); + map.put("goodsType", 7); + map.put("orderStatus", orderStatus); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); + map.put("payTimeS", payTimeS); + map.put("payTimeE", payTimeE); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highOrderService.selectDiscountPackageOrderList(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/exportDiscountPackageList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "导出优惠券包订单列表") + public ResponseData exportDiscountPackageList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "merchantId", required = false) Long merchantId, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "payModel", required = false) Integer payModel, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "orderStatus", required = false) Integer orderStatus, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + HttpServletRequest request) { + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + Map map = new HashMap<>(); + // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 + if(userInfoModel.getSecUser().getObjectType() == 0) { + map.put("companyId", companyId); + map.put("merchantId", merchantId); + + } else if (userInfoModel.getSecUser().getObjectType() == 1) { + if (userInfoModel.getBsCompany().getId() == 3) { + map.put("companyId", 23); + } else { + map.put("companyId", userInfoModel.getBsCompany().getId()); + } + + map.put("merchantId", merchantId); + + } else if (userInfoModel.getSecUser().getObjectType() == 2) { + map.put("merchantId", userInfoModel.getMerchant().getId()); + } + + map.put("orderNo", orderNo); + map.put("paySerialNo", paySerialNo); + map.put("payModel", payModel); + map.put("payType", payType); + map.put("orderStatus", orderStatus); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); + map.put("goodsType", 7); + map.put("payTimeS", payTimeS); + map.put("payTimeE", payTimeE); + + String name = "/goodsOrder/商品订单" + System.currentTimeMillis() + ".xlsx"; + List list = highOrderService.selectDiscountPackageOrderList(map); + String fileName = SysConst.getSysConfig().getFileUrl() + name; + EasyExcel.write(fileName, ExportHighOrderModel.class).sheet("商品订单").doWrite(list); + return ResponseMsgUtil.success(name); + + } catch (Exception e) { + log.error("HighOrderController --> exportGoodsOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + } 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 0d2e938c..aeb78975 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java @@ -168,7 +168,7 @@ public class HighUserDiscountController { @RequestMapping(value = "/getUserExclusiveDiscount", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取用户专属优惠券") - public ResponseData getUserExclusiveDiscount(@RequestParam(name = "usingAttribution", required = false) Integer usingAttribution, + public ResponseData getUserExclusiveDiscount(@RequestParam(name = "useScope", required = false) Integer usingAttribution, @RequestParam(name = "year", required = false) String year, HttpServletRequest request) { try { @@ -180,7 +180,7 @@ public class HighUserDiscountController { Map map = new HashMap<>(); map.put("userId", userInfoModel.getHighUser().getId()); - map.put("usingAttribution", usingAttribution); + map.put("useScope", usingAttribution); if (year != null) { map.put("createTimeS", year + "-01-01 00:00:00"); map.put("createTimeE", year + "-12-31 23:59:59"); diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java index b620ef50..56cef103 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java @@ -114,7 +114,7 @@ public class HuiLianTongUnionCardConfig { dataMap.put("appId", signCode); // Md5加密 dataMap.put("sign", WxUtils.generateSignature(map, "621=@=HSG!Business#Controller!" , WXPayConstants.SignType.MD5)); - return request("tetcextra/TCheckEMsgUnionCardVipRights" , dataMap); + return request("tetcextra/TCheckEMsgVipRights" , dataMap); } catch (Exception e) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_TIMED_OUT, ""); 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 586dc2d6..c01ec8a3 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java @@ -31,7 +31,7 @@ public interface HighDiscountUserRelMapperExt { " high_discount_user_rel hdur join high_discount hd on hdur.discount_id = hd.id " + " WHERE" + " 1=1" + - " and hd.using_range = #{map.usingAttribution} " + + " and hd.use_scope = #{map.useScope} " + " and hdur.user_id = #{map.userId} ", " = #{map.createTimeS} ]]> ", " ", diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index 425a1e2e..09d8251a 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -104,7 +104,7 @@ public interface HighOrderMapperExt { " b.mem_name memName," + " b.mem_phone memPhone," + " case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + - " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," + + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' when 5 then '银联' end payType," + " b.pay_serial_no paySerialNo," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " b.mem_discount_name memDiscountName," + @@ -159,7 +159,7 @@ public interface HighOrderMapperExt { " b.mem_name memName," + " b.mem_phone memPhone," + " case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + - " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," + + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' when 5 then '银联' end payType," + " b.pay_serial_no paySerialNo," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " b.mem_discount_name memDiscountName," + @@ -210,7 +210,7 @@ public interface HighOrderMapperExt { " b.mem_name memName," + " b.mem_phone memPhone," + " case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + - " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," + + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' when 5 then '银联' end payType," + " b.pay_serial_no paySerialNo," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " b.mem_discount_name memDiscountName," + @@ -262,7 +262,7 @@ public interface HighOrderMapperExt { " b.mem_name memName," + " b.mem_phone memPhone," + " case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + - " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," + + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' when 5 then '银联' end payType," + " b.pay_serial_no paySerialNo," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " b.mem_discount_name memDiscountName," + @@ -313,7 +313,7 @@ public interface HighOrderMapperExt { " b.mem_name memName," + " b.mem_phone memPhone," + " case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + - " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," + + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' when 5 then '银联' end payType," + " b.pay_serial_no paySerialNo," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " b.mem_discount_name memDiscountName," + @@ -364,7 +364,7 @@ public interface HighOrderMapperExt { " b.mem_name memName," + " b.mem_phone memPhone," + " case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + - " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," + + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' when 5 then '银联' end payType," + " b.pay_serial_no paySerialNo," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " b.mem_discount_name memDiscountName," + @@ -622,4 +622,57 @@ public interface HighOrderMapperExt { ""}) List ExportPreOrderList(@Param("map") Map map); + @Select({""}) + List selectDiscountPackageOrderList(@Param("map") Map map); + } diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountPackageRecordService.java b/hai-service/src/main/java/com/hai/service/HighDiscountPackageRecordService.java new file mode 100644 index 00000000..b8b93449 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighDiscountPackageRecordService.java @@ -0,0 +1,26 @@ +package com.hai.service; + +import com.hai.entity.HighDiscountPackageRecord; + +import java.util.List; +import java.util.Map; + +/** + * @serviceName HighDiscountPackageRecordService.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 优惠券包订单列表 + * @createTime 11:41 上午 2021/12/9 + **/ +public interface HighDiscountPackageRecordService { + + /** + * @Author Sum1Dream + * @name getDiscountPackageRecord.java + * @Description // 优惠券包订单列表 + * @Date 11:40 上午 2021/12/9 + * @Param [java.util.Map] + * @return java.util.List + */ + List getDiscountPackageRecord(Map map); +} diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index 038becef..127106eb 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -245,4 +245,11 @@ public interface HighOrderService { */ List> getFinishGasOrder(); + /** + * 查询订单列表 + * @param map + * @return + */ + List selectDiscountPackageOrderList(Map map) throws Exception; + } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageRecordServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageRecordServiceImpl.java new file mode 100644 index 00000000..1279cd0b --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageRecordServiceImpl.java @@ -0,0 +1,55 @@ +package com.hai.service.impl; + +import com.hai.dao.HighDiscountPackageRecordMapper; +import com.hai.entity.HighDiscountPackageRecord; +import com.hai.entity.HighDiscountPackageRecordExample; +import com.hai.service.HighDiscountPackageRecordService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @serviceName HighDiscountPackageRecordServiceImpl.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // + * @createTime 12:12 下午 2021/12/9 + **/ +@Service("highDiscountPackageRecordService") +public class HighDiscountPackageRecordServiceImpl implements HighDiscountPackageRecordService { + + @Resource + private HighDiscountPackageRecordMapper discountPackageRecordMapper; + + @Override + public List getDiscountPackageRecord(Map map) { + + HighDiscountPackageRecordExample example = new HighDiscountPackageRecordExample(); + HighDiscountPackageRecordExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getString(map , "phone") != null) { + criteria.andExt1Like("%" + MapUtils.getString(map , "phone") + "%"); + } + if (MapUtils.getString(map , "title") != null) { + criteria.andDiscountPackageTitleLike("%" + MapUtils.getString(map , "phone") + "%"); + } + if (MapUtils.getString(map , "recordNo") != null) { + criteria.andRecordNoLike("%" + MapUtils.getString(map , "recordNo") + "%"); + } + if (MapUtils.getInteger(map , "saleType") != null) { + criteria.andSalesTypeEqualTo(MapUtils.getInteger(map , "saleType")); + } + if (MapUtils.getInteger(map , "companyId") != null) { + criteria.andCompanyIdEqualTo(MapUtils.getInteger(map , "companyId")); + } + + criteria.andStatusEqualTo(1); + + example.setOrderByClause("created_time"); + + return discountPackageRecordMapper.selectByExample(example); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java index 5b470a50..d14b45ad 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java @@ -95,8 +95,13 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic HighDiscountPackageExample example = new HighDiscountPackageExample(); HighDiscountPackageExample.Criteria criteria = example.createCriteria(); criteria.andUsingAttributionEqualTo(usingAttribution).andStatusNotEqualTo(4).andCompanyIdEqualTo(companyId); - ; - return highDiscountPackageMapper.selectByExample(example).get(0); + List list = highDiscountPackageMapper.selectByExample(example); + + if (list.size() == 0) { + return null; + } else { + return list.get(0); + } } @Override @@ -214,7 +219,6 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic discountInventoryRecordMapper.insert(discountInventoryRecord); // 设置库存 - highDiscountPackage.setSurplusStock(surplusStock + num); highDiscountPackage.setTotalStock(totalStock + num); highDiscountPackageMapper.updateByPrimaryKey(highDiscountPackage); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index f2c9cfcf..0c3065ee 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -1056,4 +1056,27 @@ public class HighOrderServiceImpl implements HighOrderService { example.createCriteria().andOrderIdEqualTo(orderId).andGiveawayTypeEqualTo(false); return highChildOrderMapper.selectByExample(example).get(0); } + + + @Override + public List selectDiscountPackageOrderList(Map map) throws Exception { + + if(MapUtils.getLong(map, "createTimeS") != null) { + map.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "createTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "createTimeE") != null) { + map.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "createTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "payTimeS") != null) { + map.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "payTimeE") != null) { + map.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + + return highOrderMapper.selectDiscountPackageOrderList(map); + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java index 55636bcb..6a12c999 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java @@ -41,12 +41,6 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService { @Resource private BsCompanyService bsCompanyService; - @Resource - private HighDiscountPackageDetailsService highDiscountPackageDetailsService; - - @Resource - private HighDiscountAgentRelService highDiscountAgentRelService; - @Resource private HighDiscountAgentCodeService highDiscountAgentCodeService; @@ -82,19 +76,25 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService { } boolean isVip = false; + // 1: 1-E信通会员权益,2-工会卡会员权益 + int equityLevel = 0; // 判断用户是否有会员权益 for (Object dataObject : cardInfoObject.getJSONArray("data")) { JSONObject d = (JSONObject) dataObject; - if (d.getInteger("level").equals(12)) { + if (d.getInteger("level").equals(1) || d.getInteger("level").equals(12)) { + isVip = true; + equityLevel = 1; + } else if (d.getInteger("level").equals(2)) { isVip = true; + equityLevel = 2; } } // 判断汇联通会员等级 1-E信通会员,2-工会卡会员,12-E信通和工会卡会员 if (isVip) { - List list = highDiscountPackageRecordMapper.CheckCouponsMonth(highUser.getId() , 1); + List list = highDiscountPackageRecordMapper.CheckCouponsMonth(highUser.getId() , equityLevel); // 判断当月是否赠送会员权益 if (list.size() > 0 ) { @@ -116,7 +116,6 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService { HighDiscountPackage highDiscountPackage = highDiscountPackages.get(0); - highDiscountPackage.setSurplusStock(highDiscountPackage.getSurplusStock() - 1); highDiscountPackageService.updateDiscountPackage(highDiscountPackage); // 查询优惠券包实际库存