提交代码

dev-discount
胡锐 2 years ago
parent 83a3e6661a
commit f906a4dfb3
  1. 3
      hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java
  2. 96
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  3. 3
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  4. 34
      hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java
  5. 16
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  6. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  7. 114
      hai-cweb/src/main/java/com/cweb/controller/NotifyController.java
  8. 53
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  9. 23
      hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherMapper.java
  10. 42
      hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherSqlProvider.java
  11. 50
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  12. 40
      hai-service/src/main/java/com/hai/dao/HighUserCouponMapper.java
  13. 28
      hai-service/src/main/java/com/hai/dao/HighUserCouponSqlProvider.java
  14. 50
      hai-service/src/main/java/com/hai/entity/HighCouponCodeOther.java
  15. 200
      hai-service/src/main/java/com/hai/entity/HighCouponCodeOtherExample.java
  16. 32
      hai-service/src/main/java/com/hai/entity/HighUserCoupon.java
  17. 120
      hai-service/src/main/java/com/hai/entity/HighUserCouponExample.java
  18. 1
      hai-service/src/main/java/com/hai/enum_type/OrderPushType.java
  19. 58
      hai-service/src/main/java/com/hai/model/OrderCouponModel.java
  20. 2
      hai-service/src/main/java/com/hai/service/HighCouponAgentService.java
  21. 14
      hai-service/src/main/java/com/hai/service/HighCouponCodeOtherService.java
  22. 7
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  23. 7
      hai-service/src/main/java/com/hai/service/HighUserCouponService.java
  24. 19
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  25. 56
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeOtherServiceImpl.java
  26. 217
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  27. 14
      hai-service/src/main/java/com/hai/service/impl/HighUserCouponServiceImpl.java
  28. 53
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java

@ -464,12 +464,13 @@ public class HighCouponAgentController {
JSONObject jsonObject = JSONObject.parseObject(reqBody);
Long couponAgentCodeId = jsonObject.getLong("couponAgentCodeId");
String phone = jsonObject.getString("phone");
String remark = jsonObject.getString("remark");
if (couponAgentCodeId == null) {
log.error("HighMerchantStoreController -> useCouponCode() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
return ResponseMsgUtil.success(highCouponAgentService.generateCode(couponAgentCodeId,remark));
return ResponseMsgUtil.success(highCouponAgentService.generateCode(couponAgentCodeId,phone,remark));
} catch (Exception e) {
log.error("HighCouponAgentController --> generateCode() error!", e);

@ -21,10 +21,7 @@ import com.hai.entity.HighOrder;
import com.hai.entity.HighTyAgent;
import com.hai.entity.HighTySalesman;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.HighOrderModel;
import com.hai.model.OrderRefundModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.model.*;
import com.hai.service.HighCouponCodeService;
import com.hai.service.HighOrderService;
import com.hai.service.HighTyAgentService;
@ -119,30 +116,83 @@ public class HighOrderController {
@RequestMapping(value = "/getOrderCouponList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取卡券订单列表")
public ResponseData getUserOrderList(@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "couponId", required = false) Integer couponId,
@RequestParam(name = "salesCode", required = false) Integer salesCode,
HttpServletRequest request) {
@ApiOperation(value = "查询卡券订单列表")
public ResponseData getOrderCouponList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "couponName", required = false) String couponName,
@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 = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
try {
Map<String,Object> map = new HashMap<>();
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("HighCouponController -> getCouponList() error!","权限不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
// map.put("companyId", userInfoModel.getBsCompany().getId());
map.put("couponId", couponId);
map.put("salesCode", salesCode);
map.put("status", status);
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("couponName", couponName);
map.put("payType", payType);
map.put("orderStatus", orderStatus);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highCouponCodeService.getCouponCodeList(map)));
return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getOrderCouponList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/exportOrderCouponExcel", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出卡券订单")
public ResponseData exportOrderCouponExcel(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "couponName", required = false) String couponName,
@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 = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
HttpServletRequest request) {
try {
Map<String,Object> map = new HashMap<>();
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("couponName", couponName);
map.put("payType", payType);
map.put("orderStatus", orderStatus);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
List<OrderCouponModel> list = highOrderService.getOrderCouponList(map);
String fileName = "/temporary/" + System.currentTimeMillis() + ".xlsx";
EasyExcel.write(SysConst.getSysConfig().getFileUrl() + fileName, OrderCouponModel.class)
.sheet("卡券订单")
.doWrite(list);
return ResponseMsgUtil.success(fileName);
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);

@ -124,6 +124,9 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/highGas/*")
.excludePathPatterns("/wechat/*")
.excludePathPatterns("/tuanyou/*")
.excludePathPatterns("/notify/*")
.excludePathPatterns("/highOrder/getOrderByOrderNo")
.excludePathPatterns("/coupon/getUserCouponByOrderNo")
.excludePathPatterns("/unionPay/*")
.excludePathPatterns("/highGas/*")
.excludePathPatterns("/common/*")

@ -212,6 +212,38 @@ public class HighCouponController {
}
}
@RequestMapping(value = "/getUserCouponByOrderNo", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据订单号 查询用户卡券")
public ResponseData getUserCouponByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo, HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
HighOrder order = orderService.getOrderByOrderNo(orderNo);
if (order == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单");
}
// 查询最新一张可用的卡券
HighUserCoupon newCoupon = highUserCouponService.getUserCouponByOrder(userInfoModel.getHighUser().getId(), order.getId());
if (newCoupon != null) {
Map<String, Object> map = new HashMap<>();
map.put("highUserCoupon", newCoupon);
map.put("couponInfo", highCouponService.getCouponById(newCoupon.getCouponId()));
map.put("couponCodeInfo", highCouponCodeService.getCouponCodeById(newCoupon.getCouponCodeId()));
return ResponseMsgUtil.success(map);
}
return ResponseMsgUtil.success(null);
} catch (Exception e) {
log.error("HighCouponController --> getUserNewCouponDetail() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getVerifyQRCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取核销二维码")
@ -226,7 +258,7 @@ public class HighCouponController {
// 查询最新一张可用的卡券
HighUserCoupon userCoupon = highUserCouponService.getDetailById(userCouponId);
if (userCoupon == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "生成失败");
}
if (!userCoupon.getStatus().equals(1)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态异常,无法生成");

@ -208,7 +208,7 @@ public class HighOrderController {
childOrder.setGoodsPrice(coupon.getDiscountPrice());
}
// 贵州中石化
if (coupon.getCouponSource() != 4) {
if (coupon.getCouponSource() != 4 && coupon.getCouponSource() != 5) {
if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) <= 0) {
log.error("HighOrderController --> addOrder() error!", "卡卷库存数量不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "系统维护中");
@ -569,6 +569,20 @@ public class HighOrderController {
}
}
@RequestMapping(value = "/getOrderByOrderNo", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据订单号查询订单详情")
public ResponseData getOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) {
try {
return ResponseMsgUtil.success(highOrderService.getOrderByOrderNo(orderNo));
} catch (Exception e) {
log.error("HighOrderController --> getOrderByOrderNo() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getOrderById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询订单详情")

File diff suppressed because one or more lines are too long

@ -0,0 +1,114 @@
package com.cweb.controller;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.alibaba.fastjson.JSONObject;
import com.cweb.config.SysConst;
import com.cweb.config.WxMaConfiguration;
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.*;
import com.hai.config.ChongQingCNPCService;
import com.hai.config.CommonSysConst;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*;
import com.hai.enum_type.OrderPushType;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.HighCouponCodeOtherService;
import com.hai.service.HighUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
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 javax.servlet.http.HttpServletResponse;
import java.util.*;
@Controller
@RequestMapping(value = "/notify")
@Api(value = "通知")
public class NotifyController {
private static final Logger log = LoggerFactory.getLogger(NotifyController.class);
@Resource
private HighCouponCodeOtherService couponCodeOtherService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@RequestMapping(value = "/cqCnpcNotify", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "重庆中石油通知")
public Object cqCnpcNotify(@RequestBody String paramsStr) {
System.out.println(paramsStr);
log.info(paramsStr);
try {
if (StringUtils.isNotBlank(paramsStr)) {
JSONObject sendMessage = JSONObject.parseObject(paramsStr).getJSONObject("sendMessage");
JSONObject body = ChongQingCNPCService.decryptBody(sendMessage.getString("body"));
couponCodeOtherService.cqCnpcUseNotify(body);
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type10.getType());
highGasOrderPush.setOrderNo(body.getString("tradeId"));
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent("核销回调");
highGasOrderPush.setReturnContent(paramsStr);
highGasOrderPushMapper.insert(highGasOrderPush);
Map<String, Object> param = new HashMap<>();
param.put("status", 1);
param.put("msg", "成功");
String verifyCode = AESTool.Encrypt(JSONObject.toJSONString(param), CommonSysConst.getSysConfig().getChongQingCnpcMerKey());
Map<String, Object> returnContent = new HashMap<>();
Map<String, Object> returnPostMessage = new HashMap<>();
Map<String, Object> returnHead = new HashMap<>();
returnHead.put("verifyCode", MD5Util.encode((verifyCode + CommonSysConst.getSysConfig().getChongQingCnpcMerKey()).getBytes()).toLowerCase());
returnHead.put("requestType", "couponNotice");
returnPostMessage.put("head", returnHead);
returnPostMessage.put("body", verifyCode);
returnContent.put("postMessage", returnPostMessage);
return returnContent;
} else {
Map<String, Object> param = new HashMap<>();
param.put("status", 0);
param.put("msg", "解析参数错误");
String verifyCode = AESTool.Encrypt(JSONObject.toJSONString(param), CommonSysConst.getSysConfig().getChongQingCnpcMerKey());
Map<String, Object> returnContent = new HashMap<>();
Map<String, Object> returnPostMessage = new HashMap<>();
Map<String, Object> returnHead = new HashMap<>();
returnHead.put("verifyCode", MD5Util.encode((verifyCode + CommonSysConst.getSysConfig().getChongQingCnpcMerKey()).getBytes()).toLowerCase());
returnHead.put("requestType", "couponNotice");
returnPostMessage.put("head", returnHead);
returnPostMessage.put("body", verifyCode);
returnContent.put("postMessage", returnPostMessage);
return returnContent;
}
} catch (Exception e) {
return null;
// return ResponseMsgUtil.exception(e);
}
}
}

@ -226,6 +226,8 @@ public class UnionPayController {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
@ -247,6 +249,55 @@ public class UnionPayController {
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
} else if (coupon.getCouponSource() == 5) {
// 给用户发码
JSONObject sendResponse = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), order.getOrderNo(), highChildOrder.getSaleCount(), order.getMemPhone());
// 推送记录
JSONObject sendRequest = new JSONObject();
sendRequest.put("requestCode", coupon.getCouponKey());
sendRequest.put("tradeId", order.getOrderNo());
sendRequest.put("ticketSum", highChildOrder.getSaleCount());
sendRequest.put("phone", order.getMemPhone());
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type10.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(sendRequest.toJSONString());
highGasOrderPush.setReturnContent(sendResponse.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
JSONObject couponDetail = sendResponse.getJSONObject("ticketDetail");
JSONArray codeList = sendResponse.getJSONArray("codeList");
for (Object data : codeList) {
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(2);
couponCodeOther.setOrderId(order.getId());
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode"));
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data)));
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
highUserCoupon.setCreateTime(new Date());
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo());
highUserCoupon.setUseEndTime(couponCodeOther.getValidEndDate());
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);
}
} else {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
@ -254,6 +305,8 @@ public class UnionPayController {
highCouponCodeService.updateCouponCode(code);
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(code.getMerchantId());
highUserCoupon.setCouponId(code.getCouponId());
highUserCoupon.setUserId(order.getMemId());

@ -44,15 +44,17 @@ public interface HighCouponCodeOtherMapper extends HighCouponCodeOtherMapperExt
"cou_type_code, cou_no, ",
"`status`, active_time, ",
"valid_start_date, valid_end_date, ",
"create_time, ext_1, ",
"ext_2, ext_3)",
"use_time, station_code, ",
"station_name, create_time, ",
"ext_1, ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{couponAgentCodeId,jdbcType=BIGINT}, ",
"#{orderId,jdbcType=BIGINT}, #{childOrderId,jdbcType=BIGINT}, ",
"#{couTypeCode,jdbcType=VARCHAR}, #{couNo,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{activeTime,jdbcType=TIMESTAMP}, ",
"#{validStartDate,jdbcType=TIMESTAMP}, #{validEndDate,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{useTime,jdbcType=TIMESTAMP}, #{stationCode,jdbcType=VARCHAR}, ",
"#{stationName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighCouponCodeOther record);
@ -74,6 +76,9 @@ public interface HighCouponCodeOtherMapper extends HighCouponCodeOtherMapperExt
@Result(column="active_time", property="activeTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="valid_start_date", property="validStartDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="valid_end_date", property="validEndDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="use_time", property="useTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="station_code", property="stationCode", jdbcType=JdbcType.VARCHAR),
@Result(column="station_name", property="stationName", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@ -84,8 +89,8 @@ public interface HighCouponCodeOtherMapper extends HighCouponCodeOtherMapperExt
@Select({
"select",
"id, `type`, coupon_agent_code_id, order_id, child_order_id, cou_type_code, cou_no, ",
"`status`, active_time, valid_start_date, valid_end_date, create_time, ext_1, ",
"ext_2, ext_3",
"`status`, active_time, valid_start_date, valid_end_date, use_time, station_code, ",
"station_name, create_time, ext_1, ext_2, ext_3",
"from high_coupon_code_other",
"where id = #{id,jdbcType=BIGINT}"
})
@ -101,6 +106,9 @@ public interface HighCouponCodeOtherMapper extends HighCouponCodeOtherMapperExt
@Result(column="active_time", property="activeTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="valid_start_date", property="validStartDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="valid_end_date", property="validEndDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="use_time", property="useTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="station_code", property="stationCode", jdbcType=JdbcType.VARCHAR),
@Result(column="station_name", property="stationName", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@ -129,6 +137,9 @@ public interface HighCouponCodeOtherMapper extends HighCouponCodeOtherMapperExt
"active_time = #{activeTime,jdbcType=TIMESTAMP},",
"valid_start_date = #{validStartDate,jdbcType=TIMESTAMP},",
"valid_end_date = #{validEndDate,jdbcType=TIMESTAMP},",
"use_time = #{useTime,jdbcType=TIMESTAMP},",
"station_code = #{stationCode,jdbcType=VARCHAR},",
"station_name = #{stationName,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",

@ -68,6 +68,18 @@ public class HighCouponCodeOtherSqlProvider {
sql.VALUES("valid_end_date", "#{validEndDate,jdbcType=TIMESTAMP}");
}
if (record.getUseTime() != null) {
sql.VALUES("use_time", "#{useTime,jdbcType=TIMESTAMP}");
}
if (record.getStationCode() != null) {
sql.VALUES("station_code", "#{stationCode,jdbcType=VARCHAR}");
}
if (record.getStationName() != null) {
sql.VALUES("station_name", "#{stationName,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
@ -104,6 +116,9 @@ public class HighCouponCodeOtherSqlProvider {
sql.SELECT("active_time");
sql.SELECT("valid_start_date");
sql.SELECT("valid_end_date");
sql.SELECT("use_time");
sql.SELECT("station_code");
sql.SELECT("station_name");
sql.SELECT("create_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
@ -169,6 +184,18 @@ public class HighCouponCodeOtherSqlProvider {
sql.SET("valid_end_date = #{record.validEndDate,jdbcType=TIMESTAMP}");
}
if (record.getUseTime() != null) {
sql.SET("use_time = #{record.useTime,jdbcType=TIMESTAMP}");
}
if (record.getStationCode() != null) {
sql.SET("station_code = #{record.stationCode,jdbcType=VARCHAR}");
}
if (record.getStationName() != null) {
sql.SET("station_name = #{record.stationName,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
@ -204,6 +231,9 @@ public class HighCouponCodeOtherSqlProvider {
sql.SET("active_time = #{record.activeTime,jdbcType=TIMESTAMP}");
sql.SET("valid_start_date = #{record.validStartDate,jdbcType=TIMESTAMP}");
sql.SET("valid_end_date = #{record.validEndDate,jdbcType=TIMESTAMP}");
sql.SET("use_time = #{record.useTime,jdbcType=TIMESTAMP}");
sql.SET("station_code = #{record.stationCode,jdbcType=VARCHAR}");
sql.SET("station_name = #{record.stationName,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
@ -258,6 +288,18 @@ public class HighCouponCodeOtherSqlProvider {
sql.SET("valid_end_date = #{validEndDate,jdbcType=TIMESTAMP}");
}
if (record.getUseTime() != null) {
sql.SET("use_time = #{useTime,jdbcType=TIMESTAMP}");
}
if (record.getStationCode() != null) {
sql.SET("station_code = #{stationCode,jdbcType=VARCHAR}");
}
if (record.getStationName() != null) {
sql.SET("station_name = #{stationName,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}

@ -1284,4 +1284,54 @@ public interface HighOrderMapperExt {
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<HighOrder> integralRebateOrder();
@Select({"<script>" +
" select" +
" b.order_no orderNo," +
" b.mem_phone memPhone," +
" a.goods_name couponName," +
" b.total_price totalPrice," +
" b.deduction_price deductionPrice," +
" b.payable_price payablePrice," +
" b.pay_gold payGold," +
" b.pay_price payPrice," +
" CASE b.pay_type " +
" WHEN 1 THEN '支付宝' " +
" WHEN 2 THEN '微信'" +
" WHEN 3 THEN '积分抵扣'" +
" WHEN 4 THEN '贵州汇联通工会卡'" +
" WHEN 5 THEN '银联'" +
" WHEN 6 THEN '银联分期'" +
" WHEN 7 THEN '嗨森逛油卡'" +
" ELSE '未知' END payType," +
" 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 '退款拒绝'" +
" ELSE '未知' END orderStatus," +
" b.create_time createTime," +
" b.pay_time payTime," +
" b.finish_time finishTime" +
" from high_child_order a" +
" LEFT JOIN high_order b on b.id = a.order_id" +
" where a.goods_type = 1" +
" <if test='param.orderNo != null'> and b.order_no like concat('%', #{param.orderNo}, '%') </if>" +
" <if test='param.memPhone != null'> and b.mem_phone like concat('%', #{param.memPhone}, '%') </if>" +
" <if test='param.couponName != null'> and a.goods_name like concat('%', #{param.couponName}, '%') </if>" +
" <if test='param.payType != null'> and b.pay_type = #{param.payType} </if>" +
" <if test='param.orderStatus != null'> and b.order_status = #{param.orderStatus} </if>" +
" <if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>" +
" <if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </if>" +
" <if test='param.payTimeS != null'> <![CDATA[ and b.pay_time >= #{param.payTimeS} ]]> </if>" +
" <if test='param.payTimeE != null'> <![CDATA[ and b.pay_time <= #{param.payTimeE} ]]> </if>" +
" <if test='param.finishTimeS != null'> <![CDATA[ and b.finish_time >= #{param.finishTimeS} ]]> </if>" +
" <if test='param.finishTimeE != null'> <![CDATA[ and b.finish_time <= #{param.finishTimeE} ]]> </if>" +
" ORDER BY b.create_time desc" +
"</script>"})
List<OrderCouponModel> queryOrderCoupon(@Param("param") Map<String, Object> param);
}

@ -40,21 +40,21 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt {
@Insert({
"insert into high_user_coupon (merchant_id, coupon_id, ",
"user_id, coupon_code_id, ",
"store_id, create_time, ",
"consume_time, use_end_time, ",
"qr_code_img, `status`, ",
"`source`, source_id, ",
"ext_1, ext_2, ext_3, ",
"ext_4)",
"user_id, order_id, child_order_id, ",
"coupon_code_id, store_id, ",
"create_time, consume_time, ",
"use_end_time, qr_code_img, ",
"`status`, `source`, ",
"source_id, ext_1, ext_2, ",
"ext_3, ext_4)",
"values (#{merchantId,jdbcType=BIGINT}, #{couponId,jdbcType=BIGINT}, ",
"#{userId,jdbcType=BIGINT}, #{couponCodeId,jdbcType=BIGINT}, ",
"#{storeId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{consumeTime,jdbcType=TIMESTAMP}, #{useEndTime,jdbcType=TIMESTAMP}, ",
"#{qrCodeImg,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{source,jdbcType=INTEGER}, #{sourceId,jdbcType=BIGINT}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ",
"#{ext4,jdbcType=VARCHAR})"
"#{userId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{childOrderId,jdbcType=BIGINT}, ",
"#{couponCodeId,jdbcType=BIGINT}, #{storeId,jdbcType=BIGINT}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{consumeTime,jdbcType=TIMESTAMP}, ",
"#{useEndTime,jdbcType=TIMESTAMP}, #{qrCodeImg,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{source,jdbcType=INTEGER}, ",
"#{sourceId,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighUserCoupon record);
@ -69,6 +69,8 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt {
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="coupon_code_id", property="couponCodeId", jdbcType=JdbcType.BIGINT),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@ -87,9 +89,9 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt {
@Select({
"select",
"id, merchant_id, coupon_id, user_id, coupon_code_id, store_id, create_time, ",
"consume_time, use_end_time, qr_code_img, `status`, `source`, source_id, ext_1, ",
"ext_2, ext_3, ext_4",
"id, merchant_id, coupon_id, user_id, order_id, child_order_id, coupon_code_id, ",
"store_id, create_time, consume_time, use_end_time, qr_code_img, `status`, `source`, ",
"source_id, ext_1, ext_2, ext_3, ext_4",
"from high_user_coupon",
"where id = #{id,jdbcType=BIGINT}"
})
@ -98,6 +100,8 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt {
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="coupon_code_id", property="couponCodeId", jdbcType=JdbcType.BIGINT),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@ -128,6 +132,8 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt {
"set merchant_id = #{merchantId,jdbcType=BIGINT},",
"coupon_id = #{couponId,jdbcType=BIGINT},",
"user_id = #{userId,jdbcType=BIGINT},",
"order_id = #{orderId,jdbcType=BIGINT},",
"child_order_id = #{childOrderId,jdbcType=BIGINT},",
"coupon_code_id = #{couponCodeId,jdbcType=BIGINT},",
"store_id = #{storeId,jdbcType=BIGINT},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",

@ -40,6 +40,14 @@ public class HighUserCouponSqlProvider {
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}");
}
if (record.getOrderId() != null) {
sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}");
}
if (record.getChildOrderId() != null) {
sql.VALUES("child_order_id", "#{childOrderId,jdbcType=BIGINT}");
}
if (record.getCouponCodeId() != null) {
sql.VALUES("coupon_code_id", "#{couponCodeId,jdbcType=BIGINT}");
}
@ -105,6 +113,8 @@ public class HighUserCouponSqlProvider {
sql.SELECT("merchant_id");
sql.SELECT("coupon_id");
sql.SELECT("user_id");
sql.SELECT("order_id");
sql.SELECT("child_order_id");
sql.SELECT("coupon_code_id");
sql.SELECT("store_id");
sql.SELECT("create_time");
@ -151,6 +161,14 @@ public class HighUserCouponSqlProvider {
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
}
if (record.getOrderId() != null) {
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
}
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
}
if (record.getCouponCodeId() != null) {
sql.SET("coupon_code_id = #{record.couponCodeId,jdbcType=BIGINT}");
}
@ -215,6 +233,8 @@ public class HighUserCouponSqlProvider {
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}");
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}");
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
sql.SET("coupon_code_id = #{record.couponCodeId,jdbcType=BIGINT}");
sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
@ -250,6 +270,14 @@ public class HighUserCouponSqlProvider {
sql.SET("user_id = #{userId,jdbcType=BIGINT}");
}
if (record.getOrderId() != null) {
sql.SET("order_id = #{orderId,jdbcType=BIGINT}");
}
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{childOrderId,jdbcType=BIGINT}");
}
if (record.getCouponCodeId() != null) {
sql.SET("coupon_code_id = #{couponCodeId,jdbcType=BIGINT}");
}

@ -19,7 +19,7 @@ public class HighCouponCodeOther implements Serializable {
private Long id;
/**
* 类型 1 汇联通
* 类型 1 贵州中石化 2 重庆中石油
*/
private Integer type;
@ -68,6 +68,21 @@ public class HighCouponCodeOther implements Serializable {
*/
private Date validEndDate;
/**
* 核销时间
*/
private Date useTime;
/**
* 核销站点编号
*/
private String stationCode;
/**
* 核销站点名称
*/
private String stationName;
/**
* 创建时间
*/
@ -169,6 +184,30 @@ public class HighCouponCodeOther implements Serializable {
this.validEndDate = validEndDate;
}
public Date getUseTime() {
return useTime;
}
public void setUseTime(Date useTime) {
this.useTime = useTime;
}
public String getStationCode() {
return stationCode;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public Date getCreateTime() {
return createTime;
}
@ -224,6 +263,9 @@ public class HighCouponCodeOther implements Serializable {
&& (this.getActiveTime() == null ? other.getActiveTime() == null : this.getActiveTime().equals(other.getActiveTime()))
&& (this.getValidStartDate() == null ? other.getValidStartDate() == null : this.getValidStartDate().equals(other.getValidStartDate()))
&& (this.getValidEndDate() == null ? other.getValidEndDate() == null : this.getValidEndDate().equals(other.getValidEndDate()))
&& (this.getUseTime() == null ? other.getUseTime() == null : this.getUseTime().equals(other.getUseTime()))
&& (this.getStationCode() == null ? other.getStationCode() == null : this.getStationCode().equals(other.getStationCode()))
&& (this.getStationName() == null ? other.getStationName() == null : this.getStationName().equals(other.getStationName()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
@ -245,6 +287,9 @@ public class HighCouponCodeOther implements Serializable {
result = prime * result + ((getActiveTime() == null) ? 0 : getActiveTime().hashCode());
result = prime * result + ((getValidStartDate() == null) ? 0 : getValidStartDate().hashCode());
result = prime * result + ((getValidEndDate() == null) ? 0 : getValidEndDate().hashCode());
result = prime * result + ((getUseTime() == null) ? 0 : getUseTime().hashCode());
result = prime * result + ((getStationCode() == null) ? 0 : getStationCode().hashCode());
result = prime * result + ((getStationName() == null) ? 0 : getStationName().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
@ -269,6 +314,9 @@ public class HighCouponCodeOther implements Serializable {
sb.append(", activeTime=").append(activeTime);
sb.append(", validStartDate=").append(validStartDate);
sb.append(", validEndDate=").append(validEndDate);
sb.append(", useTime=").append(useTime);
sb.append(", stationCode=").append(stationCode);
sb.append(", stationName=").append(stationName);
sb.append(", createTime=").append(createTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);

@ -805,6 +805,206 @@ public class HighCouponCodeOtherExample {
return (Criteria) this;
}
public Criteria andUseTimeIsNull() {
addCriterion("use_time is null");
return (Criteria) this;
}
public Criteria andUseTimeIsNotNull() {
addCriterion("use_time is not null");
return (Criteria) this;
}
public Criteria andUseTimeEqualTo(Date value) {
addCriterion("use_time =", value, "useTime");
return (Criteria) this;
}
public Criteria andUseTimeNotEqualTo(Date value) {
addCriterion("use_time <>", value, "useTime");
return (Criteria) this;
}
public Criteria andUseTimeGreaterThan(Date value) {
addCriterion("use_time >", value, "useTime");
return (Criteria) this;
}
public Criteria andUseTimeGreaterThanOrEqualTo(Date value) {
addCriterion("use_time >=", value, "useTime");
return (Criteria) this;
}
public Criteria andUseTimeLessThan(Date value) {
addCriterion("use_time <", value, "useTime");
return (Criteria) this;
}
public Criteria andUseTimeLessThanOrEqualTo(Date value) {
addCriterion("use_time <=", value, "useTime");
return (Criteria) this;
}
public Criteria andUseTimeIn(List<Date> values) {
addCriterion("use_time in", values, "useTime");
return (Criteria) this;
}
public Criteria andUseTimeNotIn(List<Date> values) {
addCriterion("use_time not in", values, "useTime");
return (Criteria) this;
}
public Criteria andUseTimeBetween(Date value1, Date value2) {
addCriterion("use_time between", value1, value2, "useTime");
return (Criteria) this;
}
public Criteria andUseTimeNotBetween(Date value1, Date value2) {
addCriterion("use_time not between", value1, value2, "useTime");
return (Criteria) this;
}
public Criteria andStationCodeIsNull() {
addCriterion("station_code is null");
return (Criteria) this;
}
public Criteria andStationCodeIsNotNull() {
addCriterion("station_code is not null");
return (Criteria) this;
}
public Criteria andStationCodeEqualTo(String value) {
addCriterion("station_code =", value, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeNotEqualTo(String value) {
addCriterion("station_code <>", value, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeGreaterThan(String value) {
addCriterion("station_code >", value, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeGreaterThanOrEqualTo(String value) {
addCriterion("station_code >=", value, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeLessThan(String value) {
addCriterion("station_code <", value, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeLessThanOrEqualTo(String value) {
addCriterion("station_code <=", value, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeLike(String value) {
addCriterion("station_code like", value, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeNotLike(String value) {
addCriterion("station_code not like", value, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeIn(List<String> values) {
addCriterion("station_code in", values, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeNotIn(List<String> values) {
addCriterion("station_code not in", values, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeBetween(String value1, String value2) {
addCriterion("station_code between", value1, value2, "stationCode");
return (Criteria) this;
}
public Criteria andStationCodeNotBetween(String value1, String value2) {
addCriterion("station_code not between", value1, value2, "stationCode");
return (Criteria) this;
}
public Criteria andStationNameIsNull() {
addCriterion("station_name is null");
return (Criteria) this;
}
public Criteria andStationNameIsNotNull() {
addCriterion("station_name is not null");
return (Criteria) this;
}
public Criteria andStationNameEqualTo(String value) {
addCriterion("station_name =", value, "stationName");
return (Criteria) this;
}
public Criteria andStationNameNotEqualTo(String value) {
addCriterion("station_name <>", value, "stationName");
return (Criteria) this;
}
public Criteria andStationNameGreaterThan(String value) {
addCriterion("station_name >", value, "stationName");
return (Criteria) this;
}
public Criteria andStationNameGreaterThanOrEqualTo(String value) {
addCriterion("station_name >=", value, "stationName");
return (Criteria) this;
}
public Criteria andStationNameLessThan(String value) {
addCriterion("station_name <", value, "stationName");
return (Criteria) this;
}
public Criteria andStationNameLessThanOrEqualTo(String value) {
addCriterion("station_name <=", value, "stationName");
return (Criteria) this;
}
public Criteria andStationNameLike(String value) {
addCriterion("station_name like", value, "stationName");
return (Criteria) this;
}
public Criteria andStationNameNotLike(String value) {
addCriterion("station_name not like", value, "stationName");
return (Criteria) this;
}
public Criteria andStationNameIn(List<String> values) {
addCriterion("station_name in", values, "stationName");
return (Criteria) this;
}
public Criteria andStationNameNotIn(List<String> values) {
addCriterion("station_name not in", values, "stationName");
return (Criteria) this;
}
public Criteria andStationNameBetween(String value1, String value2) {
addCriterion("station_name between", value1, value2, "stationName");
return (Criteria) this;
}
public Criteria andStationNameNotBetween(String value1, String value2) {
addCriterion("station_name not between", value1, value2, "stationName");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;

@ -35,6 +35,16 @@ public class HighUserCoupon implements Serializable {
*/
private Long userId;
/**
* 交易id
*/
private Long orderId;
/**
* 子订单id
*/
private Long childOrderId;
/**
* 卡卷销售码id
*/
@ -132,6 +142,22 @@ public class HighUserCoupon implements Serializable {
this.userId = userId;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Long getChildOrderId() {
return childOrderId;
}
public void setChildOrderId(Long childOrderId) {
this.childOrderId = childOrderId;
}
public Long getCouponCodeId() {
return couponCodeId;
}
@ -252,6 +278,8 @@ public class HighUserCoupon implements Serializable {
&& (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId()))
&& (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
&& (this.getChildOrderId() == null ? other.getChildOrderId() == null : this.getChildOrderId().equals(other.getChildOrderId()))
&& (this.getCouponCodeId() == null ? other.getCouponCodeId() == null : this.getCouponCodeId().equals(other.getCouponCodeId()))
&& (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
@ -275,6 +303,8 @@ public class HighUserCoupon implements Serializable {
result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode());
result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
result = prime * result + ((getChildOrderId() == null) ? 0 : getChildOrderId().hashCode());
result = prime * result + ((getCouponCodeId() == null) ? 0 : getCouponCodeId().hashCode());
result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
@ -301,6 +331,8 @@ public class HighUserCoupon implements Serializable {
sb.append(", merchantId=").append(merchantId);
sb.append(", couponId=").append(couponId);
sb.append(", userId=").append(userId);
sb.append(", orderId=").append(orderId);
sb.append(", childOrderId=").append(childOrderId);
sb.append(", couponCodeId=").append(couponCodeId);
sb.append(", storeId=").append(storeId);
sb.append(", createTime=").append(createTime);

@ -365,6 +365,126 @@ public class HighUserCouponExample {
return (Criteria) this;
}
public Criteria andOrderIdIsNull() {
addCriterion("order_id is null");
return (Criteria) this;
}
public Criteria andOrderIdIsNotNull() {
addCriterion("order_id is not null");
return (Criteria) this;
}
public Criteria andOrderIdEqualTo(Long value) {
addCriterion("order_id =", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdNotEqualTo(Long value) {
addCriterion("order_id <>", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdGreaterThan(Long value) {
addCriterion("order_id >", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdGreaterThanOrEqualTo(Long value) {
addCriterion("order_id >=", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdLessThan(Long value) {
addCriterion("order_id <", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdLessThanOrEqualTo(Long value) {
addCriterion("order_id <=", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdIn(List<Long> values) {
addCriterion("order_id in", values, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdNotIn(List<Long> values) {
addCriterion("order_id not in", values, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdBetween(Long value1, Long value2) {
addCriterion("order_id between", value1, value2, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdNotBetween(Long value1, Long value2) {
addCriterion("order_id not between", value1, value2, "orderId");
return (Criteria) this;
}
public Criteria andChildOrderIdIsNull() {
addCriterion("child_order_id is null");
return (Criteria) this;
}
public Criteria andChildOrderIdIsNotNull() {
addCriterion("child_order_id is not null");
return (Criteria) this;
}
public Criteria andChildOrderIdEqualTo(Long value) {
addCriterion("child_order_id =", value, "childOrderId");
return (Criteria) this;
}
public Criteria andChildOrderIdNotEqualTo(Long value) {
addCriterion("child_order_id <>", value, "childOrderId");
return (Criteria) this;
}
public Criteria andChildOrderIdGreaterThan(Long value) {
addCriterion("child_order_id >", value, "childOrderId");
return (Criteria) this;
}
public Criteria andChildOrderIdGreaterThanOrEqualTo(Long value) {
addCriterion("child_order_id >=", value, "childOrderId");
return (Criteria) this;
}
public Criteria andChildOrderIdLessThan(Long value) {
addCriterion("child_order_id <", value, "childOrderId");
return (Criteria) this;
}
public Criteria andChildOrderIdLessThanOrEqualTo(Long value) {
addCriterion("child_order_id <=", value, "childOrderId");
return (Criteria) this;
}
public Criteria andChildOrderIdIn(List<Long> values) {
addCriterion("child_order_id in", values, "childOrderId");
return (Criteria) this;
}
public Criteria andChildOrderIdNotIn(List<Long> values) {
addCriterion("child_order_id not in", values, "childOrderId");
return (Criteria) this;
}
public Criteria andChildOrderIdBetween(Long value1, Long value2) {
addCriterion("child_order_id between", value1, value2, "childOrderId");
return (Criteria) this;
}
public Criteria andChildOrderIdNotBetween(Long value1, Long value2) {
addCriterion("child_order_id not between", value1, value2, "childOrderId");
return (Criteria) this;
}
public Criteria andCouponCodeIdIsNull() {
addCriterion("coupon_code_id is null");
return (Criteria) this;

@ -16,6 +16,7 @@ public enum OrderPushType {
type7(7 , "汇联通会员充值订单"),
type8(8 , "星巴克订单"),
type9(9 , "会员充值订单"),
type10(10 , "重庆中石油"),
;
private Integer type;

@ -0,0 +1,58 @@
package com.hai.model;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @className: OrderCouponModel
* @author: HuRui
* @date: 2022/9/30
**/
@Data
public class OrderCouponModel {
@ExcelProperty(value = "交易订单号")
private String orderNo;
@ExcelProperty(value = "客户电话")
private String memPhone;
@ExcelProperty(value = "卡券名称")
private String couponName;
@ExcelProperty(value = "总价格")
private BigDecimal totalPrice;
@ExcelProperty(value = "优惠价格")
private BigDecimal deductionPrice;
@ExcelProperty(value = "应付金额")
private BigDecimal payablePrice;
@ExcelProperty(value = "积分抵扣")
private Long payGold;
@ExcelProperty(value = "实付金额")
private BigDecimal payPrice;
@ExcelProperty(value = "支付方式")
private String payType;
@ExcelProperty(value = "支付卡号")
private String memCardNo;
@ExcelProperty(value = "订单状态")
private String orderStatus;
@ExcelProperty(value = "创建时间")
private Date createTime;
@ExcelProperty(value = "支付时间")
private Date payTime;
@ExcelProperty(value = "完成时间")
private Date finishTime;
}

@ -79,7 +79,7 @@ public interface HighCouponAgentService {
* @Description 生成二维码
* @Date 2021/4/21 22:35
**/
Map<String, Object> generateCode(Long couponAgentCodeId,String remark) throws Exception;
Map<String, Object> generateCode(Long couponAgentCodeId,String phone,String remark) throws Exception;
/**
* @Author 胡锐

@ -1,5 +1,7 @@
package com.hai.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighCouponCodeOther;
import java.util.List;
@ -7,6 +9,12 @@ import java.util.Map;
public interface HighCouponCodeOtherService {
/**
* 修改
* @param couponCodeOther
*/
void update(HighCouponCodeOther couponCodeOther);
/**
* 查询列表
* @param map
@ -28,4 +36,10 @@ public interface HighCouponCodeOtherService {
*/
HighCouponCodeOther getDetailByCouNo(String couNo);
/**
* 重庆中石化核销回调
* @param param
*/
void cqCnpcUseNotify(JSONObject param);
}

@ -589,5 +589,12 @@ public interface HighOrderService {
* @return java.util.List<com.hai.entity.HighOrder>
*/
List<HighOrder> orderListByAgentId(Map<String , Object> map) throws Exception;
/**
* 查询卡券订单
* @param param
* @return
*/
List<OrderCouponModel> getOrderCouponList(Map<String, Object> param) throws Exception;
}

@ -56,6 +56,13 @@ public interface HighUserCouponService {
**/
HighUserCoupon getUserNewCoupon(Long userId,Long couponId);
/**
* @Author 胡锐
* @Description 查询最新一张可用的卡券
* @Date 2021/4/20 21:01
**/
HighUserCoupon getUserCouponByOrder(Long userId,Long orderId);
/**
* @Author 胡锐
* @Description 查询用户列表

@ -8,6 +8,7 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.MemberValidateUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.ChongQingCNPCService;
import com.hai.config.HuiLianTongConfig;
@ -293,7 +294,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public Map<String, Object> generateCode(Long couponAgentCodeId,String remark) throws Exception {
public Map<String, Object> generateCode(Long couponAgentCodeId,String phone,String remark) throws Exception {
// 查询卡券销售码
HighCouponAgentCode couponAgentCode = getCodeById(couponAgentCodeId);
if (couponAgentCode == null) {
@ -302,6 +303,8 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
if (couponAgentCode.getStatus() != 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "销售码已被销售");
}
couponAgentCode.setConvertUserPhone(phone);
couponAgentCode.setCouponCode(System.currentTimeMillis()+"");
couponAgentCode.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用
couponAgentCode.setRemark(remark);
couponAgentCode.setSalesTime(new Date());
@ -326,10 +329,16 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
highCouponCodeService.updateCouponCode(couponCode);
}
if (coupon.getCouponSource().equals(5)) {
if (StringUtils.isBlank(phone)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请填写客户手机号");
}
if (!MemberValidateUtil.validatePhone(phone)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号格式错误");
}
// 给用户发码
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), couponAgentCode.getCouponCode(), 1, "");
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), couponAgentCode.getConvertCode(), 1, phone);
JSONObject couponDetail = response.getJSONObject("ticketDetail");
JSONArray codeList = response.getJSONArray("codeList");
@ -338,8 +347,8 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
couponCodeOther.setType(2);
couponCodeOther.setCouponAgentCodeId(couponAgentCodeId);
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode"));
couponCodeOther.setCouNo(String.valueOf(data));
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data)));
couponCodeOther.setActiveTime(new Date());
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd"));
couponCodeOther.setStatus(20);

@ -1,13 +1,18 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.DateUtil;
import com.hai.dao.HighCouponAgentCodeMapper;
import com.hai.dao.HighCouponCodeOtherMapper;
import com.hai.entity.HighCouponCodeOther;
import com.hai.entity.HighCouponCodeOtherExample;
import com.hai.dao.HighUserCouponMapper;
import com.hai.entity.*;
import com.hai.service.HighCouponCodeOtherService;
import com.hai.service.HighOrderService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -17,6 +22,20 @@ public class HighCouponCodeOtherServiceImpl implements HighCouponCodeOtherServic
@Resource
private HighCouponCodeOtherMapper highCouponCodeOtherMapper;
@Resource
private HighUserCouponMapper highUserCouponMapper;
@Resource
private HighCouponAgentCodeMapper highCouponAgentCodeMapper;
@Resource
private HighOrderService highOrderService;
@Override
public void update(HighCouponCodeOther couponCodeOther) {
highCouponCodeOtherMapper.updateByPrimaryKey(couponCodeOther);
}
@Override
public List<HighCouponCodeOther> getList(Map<String, Object> map) {
HighCouponCodeOtherExample example = new HighCouponCodeOtherExample();
@ -57,4 +76,37 @@ public class HighCouponCodeOtherServiceImpl implements HighCouponCodeOtherServic
}
return null;
}
@Override
public void cqCnpcUseNotify(JSONObject param) {
HighCouponCodeOther couponCodeOther = getDetailByCouNo(param.getString("couponNo"));
if (couponCodeOther != null) {
couponCodeOther.setUseTime(DateUtil.format(param.getString("useTime"), "yyyyMMddHHmmss"));
couponCodeOther.setStationCode(param.getString("stationCode"));
couponCodeOther.setStationName(param.getString("stationName"));
couponCodeOther.setStatus(40);
update(couponCodeOther);
if (couponCodeOther.getChildOrderId() != null) {
HighUserCouponExample userCouponExample = new HighUserCouponExample();
userCouponExample.createCriteria().andQrCodeImgEqualTo(couponCodeOther.getCouNo()).andStatusEqualTo(1);
List<HighUserCoupon> list = highUserCouponMapper.selectByExample(userCouponExample);
if (list.size() > 0) {
HighUserCoupon userCoupon = list.get(0);
userCoupon.setStatus(2);
userCoupon.setConsumeTime(couponCodeOther.getUseTime());
highUserCouponMapper.updateByPrimaryKey(userCoupon);
}
highOrderService.childOrderComplete(couponCodeOther.getChildOrderId());
}
if (couponCodeOther.getCouponAgentCodeId() != null) {
HighCouponAgentCode agentCode = highCouponAgentCodeMapper.selectByPrimaryKey(couponCodeOther.getCouponAgentCodeId());
if (agentCode == null) {
agentCode.setStatus(3);
highCouponAgentCodeMapper.updateByPrimaryKey(agentCode);
}
}
}
}
}

@ -196,7 +196,7 @@ public class HighOrderServiceImpl implements HighOrderService {
if (childOrder.getGoodsType() == 1) {
// 查询卡券
HighCoupon couponDetail = highCouponService.getCouponDetail(childOrder.getGoodsId());
if (couponDetail.getCouponSource() != 4) {
if (couponDetail.getCouponSource() != 4 && couponDetail.getCouponSource() != 5) {
// 查询待销售
List<HighCouponCode> list = highCouponCodeService.getNoSaleCode(childOrder.getGoodsId());
if (list == null || list.size() == 0) {
@ -459,6 +459,8 @@ public class HighOrderServiceImpl implements HighOrderService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(orderId);
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(highOrder.getMemId());
@ -475,16 +477,32 @@ public class HighOrderServiceImpl implements HighOrderService {
// 给用户发码
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), highOrder.getOrderNo(), highChildOrder.getSaleCount(), highOrder.getMemPhone());
// 推送记录
JSONObject request = new JSONObject();
request.put("requestCode", coupon.getCouponKey());
request.put("tradeId", highOrder.getOrderNo());
request.put("ticketSum", highChildOrder.getSaleCount());
request.put("phone", highOrder.getMemPhone());
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type10.getType());
highGasOrderPush.setOrderNo(highOrder.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(request.toJSONString());
highGasOrderPush.setReturnContent(response.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
JSONObject couponDetail = response.getJSONObject("ticketDetail");
JSONArray codeList = response.getJSONArray("codeList");
for (Object data : codeList) {
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(1);
couponCodeOther.setType(2);
couponCodeOther.setOrderId(highOrder.getId());
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode"));
couponCodeOther.setCouNo(String.valueOf(data));
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data)));
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd"));
@ -496,6 +514,8 @@ public class HighOrderServiceImpl implements HighOrderService {
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setOrderId(orderId);
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setUserId(highOrder.getMemId());
highUserCoupon.setCreateTime(new Date());
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo());
@ -503,6 +523,7 @@ public class HighOrderServiceImpl implements HighOrderService {
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);
}
} else {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
@ -511,6 +532,8 @@ public class HighOrderServiceImpl implements HighOrderService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(orderId);
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(code.getMerchantId());
highUserCoupon.setCouponId(code.getCouponId());
highUserCoupon.setUserId(highOrder.getMemId());
@ -764,6 +787,8 @@ public class HighOrderServiceImpl implements HighOrderService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
@ -785,6 +810,55 @@ public class HighOrderServiceImpl implements HighOrderService {
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
} else if (coupon.getCouponSource() == 5) {
// 给用户发码
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), order.getOrderNo(), highChildOrder.getSaleCount(), order.getMemPhone());
// 推送记录
JSONObject request = new JSONObject();
request.put("requestCode", coupon.getCouponKey());
request.put("tradeId", order.getOrderNo());
request.put("ticketSum", highChildOrder.getSaleCount());
request.put("phone", order.getMemPhone());
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type10.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(request.toJSONString());
highGasOrderPush.setReturnContent(response.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
JSONObject couponDetail = response.getJSONObject("ticketDetail");
JSONArray codeList = response.getJSONArray("codeList");
for (Object data : codeList) {
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(2);
couponCodeOther.setOrderId(order.getId());
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode"));
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data)));
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
highUserCoupon.setCreateTime(new Date());
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo());
highUserCoupon.setUseEndTime(couponCodeOther.getValidEndDate());
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);
}
} else {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
@ -793,6 +867,8 @@ public class HighOrderServiceImpl implements HighOrderService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(code.getMerchantId());
highUserCoupon.setCouponId(code.getCouponId());
highUserCoupon.setUserId(order.getMemId());
@ -1076,6 +1152,8 @@ public class HighOrderServiceImpl implements HighOrderService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
@ -1097,6 +1175,55 @@ public class HighOrderServiceImpl implements HighOrderService {
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
} else if (coupon.getCouponSource() == 5) {
// 给用户发码
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), order.getOrderNo(), highChildOrder.getSaleCount(), order.getMemPhone());
// 推送记录
JSONObject request = new JSONObject();
request.put("requestCode", coupon.getCouponKey());
request.put("tradeId", order.getOrderNo());
request.put("ticketSum", highChildOrder.getSaleCount());
request.put("phone", order.getMemPhone());
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type10.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(request.toJSONString());
highGasOrderPush.setReturnContent(response.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
JSONObject couponDetail = response.getJSONObject("ticketDetail");
JSONArray codeList = response.getJSONArray("codeList");
for (Object data : codeList) {
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(2);
couponCodeOther.setOrderId(order.getId());
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode"));
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data)));
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
highUserCoupon.setCreateTime(new Date());
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo());
highUserCoupon.setUseEndTime(couponCodeOther.getValidEndDate());
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);
}
} else {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
@ -1105,6 +1232,8 @@ public class HighOrderServiceImpl implements HighOrderService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(code.getMerchantId());
highUserCoupon.setCouponId(code.getCouponId());
highUserCoupon.setUserId(order.getMemId());
@ -1339,6 +1468,8 @@ public class HighOrderServiceImpl implements HighOrderService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
@ -1360,6 +1491,55 @@ public class HighOrderServiceImpl implements HighOrderService {
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
} else if (coupon.getCouponSource() == 5) {
// 给用户发码
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), order.getOrderNo(), highChildOrder.getSaleCount(), order.getMemPhone());
// 推送记录
JSONObject request = new JSONObject();
request.put("requestCode", coupon.getCouponKey());
request.put("tradeId", order.getOrderNo());
request.put("ticketSum", highChildOrder.getSaleCount());
request.put("phone", order.getMemPhone());
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type10.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(request.toJSONString());
highGasOrderPush.setReturnContent(response.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
JSONObject couponDetail = response.getJSONObject("ticketDetail");
JSONArray codeList = response.getJSONArray("codeList");
for (Object data : codeList) {
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(2);
couponCodeOther.setOrderId(order.getId());
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode"));
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data)));
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
highUserCoupon.setCreateTime(new Date());
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo());
highUserCoupon.setUseEndTime(couponCodeOther.getValidEndDate());
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);
}
} else {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
@ -1368,6 +1548,8 @@ public class HighOrderServiceImpl implements HighOrderService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(code.getMerchantId());
highUserCoupon.setCouponId(code.getCouponId());
highUserCoupon.setUserId(order.getMemId());
@ -3157,4 +3339,33 @@ public class HighOrderServiceImpl implements HighOrderService {
return list;
}
@Override
public List<OrderCouponModel> getOrderCouponList(Map<String, Object> param) throws Exception {
if (MapUtils.getLong(param, "createTimeS") != null) {
param.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeS")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "createTimeE") != null) {
param.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeE")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "payTimeS") != null) {
param.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeS")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "payTimeE") != null) {
param.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeE")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "finishTimeS") != null) {
param.put("finishTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "finishTimeS")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "finishTimeE") != null) {
param.put("finishTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "finishTimeE")), DateUtil.Y_M_D_HMS));
}
return highOrderMapper.queryOrderCoupon(param);
}
}

@ -88,6 +88,18 @@ public class HighUserCouponServiceImpl implements HighUserCouponService {
return null;
}
@Override
public HighUserCoupon getUserCouponByOrder(Long userId, Long orderId) {
HighUserCouponExample example = new HighUserCouponExample();
example.createCriteria().andUserIdEqualTo(userId).andOrderIdEqualTo(orderId).andStatusEqualTo(1);
example.setOrderByClause("create_time desc");
List<HighUserCoupon> couponList = highUserCouponMapper.selectByExample(example);
if (couponList != null && couponList.size() > 0) {
return couponList.get(0);
}
return null;
}
@Override
public List<HighUserCoupon> getUserCouponList(Map<String, Object> map) {
HighUserCouponExample example = new HighUserCouponExample();
@ -174,6 +186,8 @@ public class HighUserCouponServiceImpl implements HighUserCouponService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(userCoupon.getOrderId());
highUserCoupon.setChildOrderId(userCoupon.getChildOrderId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(userId);

@ -228,6 +228,8 @@ public class GoodsOrderServiceImpl implements PayService {
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
@ -241,6 +243,55 @@ public class GoodsOrderServiceImpl implements PayService {
} else if (coupon.getCouponSource() == 5) {
// 给用户发码
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), order.getOrderNo(), highChildOrder.getSaleCount(), order.getMemPhone());
// 推送记录
JSONObject request = new JSONObject();
request.put("requestCode", coupon.getCouponKey());
request.put("tradeId", order.getOrderNo());
request.put("ticketSum", highChildOrder.getSaleCount());
request.put("phone", order.getMemPhone());
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type10.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(request.toJSONString());
highGasOrderPush.setReturnContent(response.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
JSONObject couponDetail = response.getJSONObject("ticketDetail");
JSONArray codeList = response.getJSONArray("codeList");
for (Object data : codeList) {
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(2);
couponCodeOther.setOrderId(order.getId());
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode"));
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data)));
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(order.getMemId());
highUserCoupon.setCreateTime(new Date());
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo());
highUserCoupon.setUseEndTime(couponCodeOther.getValidEndDate());
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);
}
} else {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
@ -248,6 +299,8 @@ public class GoodsOrderServiceImpl implements PayService {
highCouponCodeService.updateCouponCode(code);
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setOrderId(order.getId());
highUserCoupon.setChildOrderId(highChildOrder.getId());
highUserCoupon.setMerchantId(code.getMerchantId());
highUserCoupon.setCouponId(code.getCouponId());
highUserCoupon.setUserId(order.getMemId());

Loading…
Cancel
Save