修改赠券汇联通赠送规则,修复银联不现实

dev-discount
袁野 3 years ago
parent ed66ef1c47
commit 16ba17b367
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java
  2. 63
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java
  3. 6
      hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java
  4. 126
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  5. 4
      hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java
  6. 2
      hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java
  7. 2
      hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java
  8. 65
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  9. 26
      hai-service/src/main/java/com/hai/service/HighDiscountPackageRecordService.java
  10. 7
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  11. 55
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageRecordServiceImpl.java
  12. 10
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java
  13. 23
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  14. 17
      hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.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, "");

@ -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<String,Object> 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);
}
}
}

@ -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<String,Object> 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");

@ -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<String,Object> 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<String,Object> 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<HighOrderModel> 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);
}
}
}

@ -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<String,Object> 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");

@ -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, "");

@ -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" +
" <if test='map.usingAttribution != null'> and hd.using_range = #{map.usingAttribution} </if> " +
" <if test='map.useScope != null'> and hd.use_scope = #{map.useScope} </if> " +
" <if test='map.userId != null'> and hdur.user_id = #{map.userId} </if>",
" <if test='map.createTimeS != null'> <![CDATA[ and hdur.create_time >= #{map.createTimeS} ]]> </if>",
" <if test='map.createTimeE != null'> <![CDATA[ and hdur.create_time <= #{map.createTimeE} ]]> </if>",

@ -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 {
"</script>"})
List<HighOrderPreModel> ExportPreOrderList(@Param("map") Map<String,Object> map);
@Select({"<script>" +
" SELECT" +
" (select mer.merchant_name from high_merchant mer where EXISTS (select 1 from high_coupon cou where cou.id = a.goods_id and mer.id = cou.merchant_id)) merchantName," +
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' when 4 then 'KFC' when 5 then '电影票' when 6 then '话费充值' when 7 then '优惠券包' end goodsType, " +
" a.goods_name goodsName, " +
" a.goods_type goodsTypeId," +
" case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType," +
" b.order_no orderNo," +
" 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 '工会卡' 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," +
" b.deduction_price deductionPrice," +
" case a.giveaway_type when 0 then case when b.pay_gold is null then 0 else pay_gold end when 1 then 0 end payGold," +
" case a.giveaway_type when 0 then b.pay_price when 1 then 0 end payPrice," +
" case a.giveaway_type when 0 then case when b.pay_gold is not null then convert(b.pay_gold / 100,decimal(10,2)) else b.pay_real_price end when 1 then 0 end payRealPrice," +
" case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' when 6 then '退款中' when 7 then '退款失败' end orderStatus, " +
" b.order_status orderStatusId," +
" b.create_time createTime," +
" b.pay_time payTime," +
" b.cancel_time cancelTime," +
" b.refund_time refundTime," +
" b.refund_content refundContent," +
" b.refusal_refund_content refusalRefundContent" +
" FROM" +
" high_child_order a," +
" high_order b" +
" WHERE" +
" a.order_id = b.id" +
" and a.giveaway_type = 0" +
" and EXISTS (select 1 from high_coupon c where c.id = a.goods_id " +
" <if test='map.goodsType != null'> and a.goods_type = #{map.goodsType} </if> " +
" <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
" <if test='map.memDiscountName != null'> and c.coupon_name = #{map.memDiscountName} </if>",
" <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </if> )" +
" <if test='map.orderNo != null'> and b.order_no = #{map.orderNo}</if>",
" <if test='map.paySerialNo != null'> and b.pay_serial_no = #{map.paySerialNo} </if>",
" <if test='map.payModel != null'> and b.pay_model = #{map.payModel} </if>",
" <if test='map.payType != null'> and b.pay_type = #{map.payType} </if>",
" <if test='map.memPhone != null'> and b.mem_phone = #{map.memPhone} </if>",
" <if test='map.orderStatus != null'> and b.order_status in (#{map.orderStatus}) </if>",
" <if test='map.createTimeS != null'> <![CDATA[ and b.create_time >= #{map.createTimeS} ]]> </if>",
" <if test='map.createTimeE != null'> <![CDATA[ and b.create_time <= #{map.createTimeE} ]]> </if>",
" <if test='map.payTimeS != null'> <![CDATA[ and b.pay_time >= #{map.payTimeS} ]]> </if>",
" <if test='map.payTimeE != null'> <![CDATA[ and b.pay_time <= #{map.payTimeE} ]]> </if>",
" GROUP BY a.id" +
" ORDER BY b.create_time desc" +
"</script>"})
List<HighOrderModel> selectDiscountPackageOrderList(@Param("map") Map<String,Object> map);
}

@ -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<java.lang.String,java.lang.Object>]
* @return java.util.List<com.hai.entity.HighDiscountPackageRecord>
*/
List<HighDiscountPackageRecord> getDiscountPackageRecord(Map<String , Object> map);
}

@ -245,4 +245,11 @@ public interface HighOrderService {
*/
List<Map<String,Object>> getFinishGasOrder();
/**
* 查询订单列表
* @param map
* @return
*/
List<HighOrderModel> selectDiscountPackageOrderList(Map<String,Object> map) throws Exception;
}

@ -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<HighDiscountPackageRecord> getDiscountPackageRecord(Map<String, Object> 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);
}
}

@ -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<HighDiscountPackage> 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);
}

@ -1056,4 +1056,27 @@ public class HighOrderServiceImpl implements HighOrderService {
example.createCriteria().andOrderIdEqualTo(orderId).andGiveawayTypeEqualTo(false);
return highChildOrderMapper.selectByExample(example).get(0);
}
@Override
public List<HighOrderModel> selectDiscountPackageOrderList(Map<String, Object> 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);
}
}

@ -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<HighDiscountPackageRecord> list = highDiscountPackageRecordMapper.CheckCouponsMonth(highUser.getId() , 1);
List<HighDiscountPackageRecord> 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);
// 查询优惠券包实际库存

Loading…
Cancel
Save