'提交代码'

dev-discount
199901012 4 years ago
parent 50fe314f9f
commit 0ca02ba3dc
  1. 115
      hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java
  2. 3
      hai-service/src/main/java/com/hai/common/exception/ErrorCode.java
  3. 30
      hai-service/src/main/java/com/hai/dao/HighCouponMapper.java
  4. 81
      hai-service/src/main/java/com/hai/dao/HighCouponRecycleMapper.java
  5. 7
      hai-service/src/main/java/com/hai/dao/HighCouponRecycleMapperExt.java
  6. 319
      hai-service/src/main/java/com/hai/dao/HighCouponRecycleSqlProvider.java
  7. 44
      hai-service/src/main/java/com/hai/dao/HighCouponSqlProvider.java
  8. 8
      hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferMapper.java
  9. 8
      hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferSqlProvider.java
  10. 55
      hai-service/src/main/java/com/hai/entity/HighCoupon.java
  11. 2
      hai-service/src/main/java/com/hai/entity/HighCouponCode.java
  12. 199
      hai-service/src/main/java/com/hai/entity/HighCouponExample.java
  13. 296
      hai-service/src/main/java/com/hai/entity/HighCouponRecycle.java
  14. 1253
      hai-service/src/main/java/com/hai/entity/HighCouponRecycleExample.java
  15. 9
      hai-service/src/main/java/com/hai/entity/HighGoodsPriceRefer.java
  16. 21
      hai-service/src/main/java/com/hai/entity/HighGoodsPriceReferExample.java
  17. 36
      hai-service/src/main/java/com/hai/enum_type/ApproveType.java
  18. 19
      hai-service/src/main/java/com/hai/service/HighApproveService.java
  19. 19
      hai-service/src/main/java/com/hai/service/HighCouponCodeService.java
  20. 33
      hai-service/src/main/java/com/hai/service/HighCouponService.java
  21. 36
      hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java
  22. 46
      hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java
  23. 27
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java
  24. 102
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java
  25. 71
      hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java

@ -5,15 +5,15 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject; import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.MemberValidateUtil; import com.hai.common.utils.MemberValidateUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighCoupon; import com.hai.entity.*;
import com.hai.entity.HighCouponHandsel; import com.hai.enum_type.ApproveType;
import com.hai.entity.HighMerchant;
import com.hai.entity.HighMerchantStore;
import com.hai.model.HighCouponModel; import com.hai.model.HighCouponModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.service.HighApproveService;
import com.hai.service.HighCouponService; import com.hai.service.HighCouponService;
import com.hai.service.HighMerchantService; import com.hai.service.HighMerchantService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -23,14 +23,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.time.Year;
import java.util.Date; import java.util.Date;
/** /**
@ -54,6 +50,9 @@ public class HighCouponController {
@Resource @Resource
private HighCouponService highCouponService; private HighCouponService highCouponService;
@Resource
private HighApproveService highApproveService;
@RequestMapping(value="/insertCoupon",method = RequestMethod.POST) @RequestMapping(value="/insertCoupon",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "增加卡卷") @ApiOperation(value = "增加卡卷")
@ -62,13 +61,14 @@ public class HighCouponController {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (highCoupon.getMerchantId() == null if (highCoupon.getMerchantId() == null
|| StringUtils.isNotBlank(highCoupon.getCouponKey()) || StringUtils.isBlank(highCoupon.getCouponName())
|| StringUtils.isNotBlank(highCoupon.getCouponName()) || StringUtils.isBlank(highCoupon.getCouponImg())
|| StringUtils.isNotBlank(highCoupon.getCouponValue()) || StringUtils.isBlank(highCoupon.getCouponCarouselImg())
|| StringUtils.isNotBlank(highCoupon.getCouponImg()) || StringUtils.isBlank(highCoupon.getCouponDesc())
|| StringUtils.isNotBlank(highCoupon.getCouponCarouselImg()) || highCoupon.getCouponPrice() == null
|| StringUtils.isNotBlank(highCoupon.getCouponDesc())
|| highCoupon.getCouponType() == null || highCoupon.getCouponType() == null
|| highCoupon.getSalesEndTime() == null
|| highCoupon.getRecycleDay() == null
|| highCoupon.getLimitNumber()== null || highCoupon.getLimitNumber()== null
|| highCoupon.getSalesPrice()== null || highCoupon.getSalesPrice()== null
|| highCoupon.getIsPresent() == null) { || highCoupon.getIsPresent() == null) {
@ -97,12 +97,14 @@ public class HighCouponController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, "");
} }
String setCouponKey = DateUtil.date2String(new Date(), "yyyyMMddhhmmss") + ((Math.random()*9+1)*10000); //订单号生成 年月日小时分秒 + 5位随机数
highCoupon.setCouponKey(setCouponKey);
highCoupon.setCompanyId(merchant.getCompanyId()); highCoupon.setCompanyId(merchant.getCompanyId());
highCoupon.setOperatorId(userInfoModel.getSecUser().getId()); highCoupon.setOperatorId(userInfoModel.getSecUser().getId());
highCoupon.setOperatorName(userInfoModel.getSecUser().getUserName()); highCoupon.setOperatorName(userInfoModel.getSecUser().getUserName());
highCoupon.setCreateTime(new Date()); highCoupon.setCreateTime(new Date());
highCoupon.setUpdateTime(new Date()); highCoupon.setUpdateTime(new Date());
highCoupon.setStatus(1); // 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 highCoupon.setStatus(1); // 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回
highCouponService.insertCoupon(highCoupon); highCouponService.insertCoupon(highCoupon);
return ResponseMsgUtil.success(highCoupon); return ResponseMsgUtil.success(highCoupon);
@ -120,14 +122,19 @@ public class HighCouponController {
try { try {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (highCoupon.getId() == null if (highCoupon.getMerchantId() == null
|| highCoupon.getMerchantId() == null || StringUtils.isBlank(highCoupon.getCouponName())
|| StringUtils.isNotBlank(highCoupon.getCouponKey()) || StringUtils.isBlank(highCoupon.getCouponImg())
|| StringUtils.isNotBlank(highCoupon.getCouponName()) || StringUtils.isBlank(highCoupon.getCouponCarouselImg())
|| StringUtils.isNotBlank(highCoupon.getCouponValue()) || StringUtils.isBlank(highCoupon.getCouponDesc())
|| StringUtils.isNotBlank(highCoupon.getCouponImg()) || highCoupon.getCouponPrice() == null
|| highCoupon.getCouponType() == null
|| highCoupon.getSalesEndTime() == null
|| highCoupon.getRecycleDay() == null
|| highCoupon.getLimitNumber()== null
|| highCoupon.getSalesPrice()== null
|| highCoupon.getIsPresent() == null) { || highCoupon.getIsPresent() == null) {
log.error("HighCouponController -> updateCoupon() error!","参数错误"); log.error("HighCouponController -> insertCoupon() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
@ -148,6 +155,13 @@ public class HighCouponController {
} }
} }
// 查询卡券
HighCouponModel coupon = highCouponService.getCouponById(highCoupon.getId());
if (coupon == null) {
log.error("HighCouponController -> updateCoupon() error!","未找到卡卷信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, "");
}
// 查询商户 // 查询商户
HighMerchant merchant = highMerchantService.getMerchantById(highCoupon.getCompanyId()); HighMerchant merchant = highMerchantService.getMerchantById(highCoupon.getCompanyId());
if (merchant == null) { if (merchant == null) {
@ -159,6 +173,7 @@ public class HighCouponController {
highCoupon.setOperatorId(userInfoModel.getSecUser().getId()); highCoupon.setOperatorId(userInfoModel.getSecUser().getId());
highCoupon.setOperatorName(userInfoModel.getSecUser().getUserName()); highCoupon.setOperatorName(userInfoModel.getSecUser().getUserName());
highCoupon.setUpdateTime(new Date()); highCoupon.setUpdateTime(new Date());
highCouponService.updateCoupon(highCoupon); highCouponService.updateCoupon(highCoupon);
return ResponseMsgUtil.success(highCoupon); return ResponseMsgUtil.success(highCoupon);
@ -168,4 +183,58 @@ public class HighCouponController {
} }
} }
@RequestMapping(value="/upShelfApprove",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "卡卷上架审批")
public ResponseData upShelfApprove(@RequestParam(name = "id", required = true) Long id, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
// 查询卡券
HighCouponModel coupon = highCouponService.getCouponById(id);
if (coupon == null) {
log.error("HighCouponController -> upShelfApprove() error!","未找到卡卷信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, "");
}
// 如果卡卷状态不处于 编辑中、已下架、审上架批驳回
if (coupon.getStatus() != 1 || coupon.getStatus() != 3 || coupon.getStatus() != 102) {
log.error("HighCouponController -> upShelfApprove() error!","卡卷状态错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_UNABLE_UP_SHELF, "");
}
HighApprove approve = new HighApprove();
approve.setObjectType(ApproveType.UP_SHELF_APPROVE.getType());
approve.setObjectId(id);
approve.setApproveSerialNo(DateUtil.date2String(new Date(), "MMddhhmmss") + ((Math.random()*9+1)*10000));
approve.setStatus(1);
approve.setCreateTime(new Date());
approve.setUpdateTime(new Date());
approve.setSubmitOperatorId(userInfoModel.getSecUser().getId());
approve.setSubmitOperatorName(userInfoModel.getSecUser().getUserName());
// 增加审批
highApproveService.insertApprove(approve);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighCouponController -> upShelfApprove() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/ofShelfApprove",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "卡卷下架")
public ResponseData ofShelfApprove(@RequestParam(name = "id", required = true) Long id) {
try {
highCouponService.ofShelfApprove(id);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighCouponController -> ofShelfApprove() error!",e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -80,6 +80,9 @@ public enum ErrorCode {
PHONE_NUM_EXISTED("2108","电话号码已被使用"), PHONE_NUM_EXISTED("2108","电话号码已被使用"),
MERCHANT_STATUS_ERROR("2109","商户状态不正常,请联系管理员"), MERCHANT_STATUS_ERROR("2109","商户状态不正常,请联系管理员"),
SELECT_HANDSEL_COUPON_ERROR("2110","请选择赠送卡卷名单"), SELECT_HANDSEL_COUPON_ERROR("2110","请选择赠送卡卷名单"),
NOT_FOUND_COUPON("2111","未找到卡卷信息"),
WRITE_COUPON_NUMBER_ERROR("2112","请填写卡卷数量"),
COUPON_UNABLE_UP_SHELF("2113","卡卷状态错误"),
STATUS_ERROR("3000","状态错误"), STATUS_ERROR("3000","状态错误"),

@ -41,9 +41,10 @@ public interface HighCouponMapper extends HighCouponMapperExt {
@Insert({ @Insert({
"insert into high_coupon (company_id, merchant_id, ", "insert into high_coupon (company_id, merchant_id, ",
"coupon_key, coupon_name, ", "coupon_key, coupon_name, ",
"coupon_value, coupon_img, ", "coupon_price, coupon_img, ",
"coupon_carousel_img, coupon_desc, ", "coupon_carousel_img, coupon_desc, ",
"coupon_type, limit_number, ", "coupon_type, sales_end_time, ",
"recycle_day, limit_number, ",
"sales_price, sales_count, ", "sales_price, sales_count, ",
"is_present, create_time, ", "is_present, create_time, ",
"update_time, operator_id, ", "update_time, operator_id, ",
@ -51,9 +52,10 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"ext_1, ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ", "values (#{companyId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ",
"#{couponKey,jdbcType=VARCHAR}, #{couponName,jdbcType=VARCHAR}, ", "#{couponKey,jdbcType=VARCHAR}, #{couponName,jdbcType=VARCHAR}, ",
"#{couponValue,jdbcType=VARCHAR}, #{couponImg,jdbcType=VARCHAR}, ", "#{couponPrice,jdbcType=DECIMAL}, #{couponImg,jdbcType=VARCHAR}, ",
"#{couponCarouselImg,jdbcType=VARCHAR}, #{couponDesc,jdbcType=VARCHAR}, ", "#{couponCarouselImg,jdbcType=VARCHAR}, #{couponDesc,jdbcType=VARCHAR}, ",
"#{couponType,jdbcType=INTEGER}, #{limitNumber,jdbcType=INTEGER}, ", "#{couponType,jdbcType=INTEGER}, #{salesEndTime,jdbcType=TIMESTAMP}, ",
"#{recycleDay,jdbcType=INTEGER}, #{limitNumber,jdbcType=INTEGER}, ",
"#{salesPrice,jdbcType=DECIMAL}, #{salesCount,jdbcType=INTEGER}, ", "#{salesPrice,jdbcType=DECIMAL}, #{salesCount,jdbcType=INTEGER}, ",
"#{isPresent,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP}, ", "#{isPresent,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ",
@ -74,11 +76,13 @@ public interface HighCouponMapper extends HighCouponMapperExt {
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
@Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_value", property="couponValue", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_price", property="couponPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="coupon_img", property="couponImg", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_img", property="couponImg", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_carousel_img", property="couponCarouselImg", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_carousel_img", property="couponCarouselImg", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_desc", property="couponDesc", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_desc", property="couponDesc", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_type", property="couponType", jdbcType=JdbcType.INTEGER), @Result(column="coupon_type", property="couponType", jdbcType=JdbcType.INTEGER),
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="recycle_day", property="recycleDay", jdbcType=JdbcType.INTEGER),
@Result(column="limit_number", property="limitNumber", jdbcType=JdbcType.INTEGER), @Result(column="limit_number", property="limitNumber", jdbcType=JdbcType.INTEGER),
@Result(column="sales_price", property="salesPrice", jdbcType=JdbcType.DECIMAL), @Result(column="sales_price", property="salesPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="sales_count", property="salesCount", jdbcType=JdbcType.INTEGER), @Result(column="sales_count", property="salesCount", jdbcType=JdbcType.INTEGER),
@ -96,10 +100,10 @@ public interface HighCouponMapper extends HighCouponMapperExt {
@Select({ @Select({
"select", "select",
"id, company_id, merchant_id, coupon_key, coupon_name, coupon_value, coupon_img, ", "id, company_id, merchant_id, coupon_key, coupon_name, coupon_price, coupon_img, ",
"coupon_carousel_img, coupon_desc, coupon_type, limit_number, sales_price, sales_count, ", "coupon_carousel_img, coupon_desc, coupon_type, sales_end_time, recycle_day, ",
"is_present, create_time, update_time, operator_id, operator_name, `status`, ", "limit_number, sales_price, sales_count, is_present, create_time, update_time, ",
"ext_1, ext_2, ext_3", "operator_id, operator_name, `status`, ext_1, ext_2, ext_3",
"from high_coupon", "from high_coupon",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -109,11 +113,13 @@ public interface HighCouponMapper extends HighCouponMapperExt {
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
@Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_value", property="couponValue", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_price", property="couponPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="coupon_img", property="couponImg", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_img", property="couponImg", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_carousel_img", property="couponCarouselImg", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_carousel_img", property="couponCarouselImg", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_desc", property="couponDesc", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_desc", property="couponDesc", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_type", property="couponType", jdbcType=JdbcType.INTEGER), @Result(column="coupon_type", property="couponType", jdbcType=JdbcType.INTEGER),
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="recycle_day", property="recycleDay", jdbcType=JdbcType.INTEGER),
@Result(column="limit_number", property="limitNumber", jdbcType=JdbcType.INTEGER), @Result(column="limit_number", property="limitNumber", jdbcType=JdbcType.INTEGER),
@Result(column="sales_price", property="salesPrice", jdbcType=JdbcType.DECIMAL), @Result(column="sales_price", property="salesPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="sales_count", property="salesCount", jdbcType=JdbcType.INTEGER), @Result(column="sales_count", property="salesCount", jdbcType=JdbcType.INTEGER),
@ -144,11 +150,13 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"merchant_id = #{merchantId,jdbcType=BIGINT},", "merchant_id = #{merchantId,jdbcType=BIGINT},",
"coupon_key = #{couponKey,jdbcType=VARCHAR},", "coupon_key = #{couponKey,jdbcType=VARCHAR},",
"coupon_name = #{couponName,jdbcType=VARCHAR},", "coupon_name = #{couponName,jdbcType=VARCHAR},",
"coupon_value = #{couponValue,jdbcType=VARCHAR},", "coupon_price = #{couponPrice,jdbcType=DECIMAL},",
"coupon_img = #{couponImg,jdbcType=VARCHAR},", "coupon_img = #{couponImg,jdbcType=VARCHAR},",
"coupon_carousel_img = #{couponCarouselImg,jdbcType=VARCHAR},", "coupon_carousel_img = #{couponCarouselImg,jdbcType=VARCHAR},",
"coupon_desc = #{couponDesc,jdbcType=VARCHAR},", "coupon_desc = #{couponDesc,jdbcType=VARCHAR},",
"coupon_type = #{couponType,jdbcType=INTEGER},", "coupon_type = #{couponType,jdbcType=INTEGER},",
"sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},",
"recycle_day = #{recycleDay,jdbcType=INTEGER},",
"limit_number = #{limitNumber,jdbcType=INTEGER},", "limit_number = #{limitNumber,jdbcType=INTEGER},",
"sales_price = #{salesPrice,jdbcType=DECIMAL},", "sales_price = #{salesPrice,jdbcType=DECIMAL},",
"sales_count = #{salesCount,jdbcType=INTEGER},", "sales_count = #{salesCount,jdbcType=INTEGER},",

@ -0,0 +1,81 @@
package com.hai.dao;
import com.hai.entity.HighCouponRecycle;
import com.hai.entity.HighCouponRecycleExample;
import java.util.List;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface HighCouponRecycleMapper extends HighCouponRecycleMapperExt {
@SelectProvider(type=HighCouponRecycleSqlProvider.class, method="countByExample")
long countByExample(HighCouponRecycleExample example);
@DeleteProvider(type=HighCouponRecycleSqlProvider.class, method="deleteByExample")
int deleteByExample(HighCouponRecycleExample example);
@Insert({
"insert into high_coupon_recycle (coupon_id, coupon_name, ",
"merchant_id, coupon_sales_code, ",
"coupon_code_id, user_id, ",
"user_phone, order_no, ",
"order_id, receive_time, ",
"create_time, `status`, ",
"ext_1, ext_3, ext_2)",
"values (#{couponId,jdbcType=BIGINT}, #{couponName,jdbcType=VARCHAR}, ",
"#{merchantId,jdbcType=BIGINT}, #{couponSalesCode,jdbcType=VARCHAR}, ",
"#{couponCodeId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ",
"#{userPhone,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ",
"#{orderId,jdbcType=BIGINT}, #{receiveTime,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighCouponRecycle record);
@InsertProvider(type=HighCouponRecycleSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighCouponRecycle record);
@SelectProvider(type=HighCouponRecycleSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT),
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT),
@Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR),
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
@Result(column="coupon_sales_code", property="couponSalesCode", jdbcType=JdbcType.VARCHAR),
@Result(column="coupon_code_id", property="couponCodeId", jdbcType=JdbcType.BIGINT),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="receive_time", property="receiveTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR)
})
List<HighCouponRecycle> selectByExample(HighCouponRecycleExample example);
@UpdateProvider(type=HighCouponRecycleSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighCouponRecycle record, @Param("example") HighCouponRecycleExample example);
@UpdateProvider(type=HighCouponRecycleSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighCouponRecycle record, @Param("example") HighCouponRecycleExample example);
}

@ -0,0 +1,7 @@
package com.hai.dao;
/**
* mapper扩展类
*/
public interface HighCouponRecycleMapperExt {
}

@ -0,0 +1,319 @@
package com.hai.dao;
import com.hai.entity.HighCouponRecycle;
import com.hai.entity.HighCouponRecycleExample.Criteria;
import com.hai.entity.HighCouponRecycleExample.Criterion;
import com.hai.entity.HighCouponRecycleExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class HighCouponRecycleSqlProvider {
public String countByExample(HighCouponRecycleExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("high_coupon_recycle");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(HighCouponRecycleExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("high_coupon_recycle");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(HighCouponRecycle record) {
SQL sql = new SQL();
sql.INSERT_INTO("high_coupon_recycle");
if (record.getCouponId() != null) {
sql.VALUES("coupon_id", "#{couponId,jdbcType=BIGINT}");
}
if (record.getCouponName() != null) {
sql.VALUES("coupon_name", "#{couponName,jdbcType=VARCHAR}");
}
if (record.getMerchantId() != null) {
sql.VALUES("merchant_id", "#{merchantId,jdbcType=BIGINT}");
}
if (record.getCouponSalesCode() != null) {
sql.VALUES("coupon_sales_code", "#{couponSalesCode,jdbcType=VARCHAR}");
}
if (record.getCouponCodeId() != null) {
sql.VALUES("coupon_code_id", "#{couponCodeId,jdbcType=BIGINT}");
}
if (record.getUserId() != null) {
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}");
}
if (record.getUserPhone() != null) {
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}");
}
if (record.getOrderNo() != null) {
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
}
if (record.getOrderId() != null) {
sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}");
}
if (record.getReceiveTime() != null) {
sql.VALUES("receive_time", "#{receiveTime,jdbcType=TIMESTAMP}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(HighCouponRecycleExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("coupon_id");
sql.SELECT("coupon_name");
sql.SELECT("merchant_id");
sql.SELECT("coupon_sales_code");
sql.SELECT("coupon_code_id");
sql.SELECT("user_id");
sql.SELECT("user_phone");
sql.SELECT("order_no");
sql.SELECT("order_id");
sql.SELECT("receive_time");
sql.SELECT("create_time");
sql.SELECT("`status`");
sql.SELECT("ext_1");
sql.SELECT("ext_3");
sql.SELECT("ext_2");
sql.FROM("high_coupon_recycle");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
HighCouponRecycle record = (HighCouponRecycle) parameter.get("record");
HighCouponRecycleExample example = (HighCouponRecycleExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("high_coupon_recycle");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getCouponId() != null) {
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}");
}
if (record.getCouponName() != null) {
sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}");
}
if (record.getMerchantId() != null) {
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}");
}
if (record.getCouponSalesCode() != null) {
sql.SET("coupon_sales_code = #{record.couponSalesCode,jdbcType=VARCHAR}");
}
if (record.getCouponCodeId() != null) {
sql.SET("coupon_code_id = #{record.couponCodeId,jdbcType=BIGINT}");
}
if (record.getUserId() != null) {
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
}
if (record.getUserPhone() != null) {
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
}
if (record.getOrderId() != null) {
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
}
if (record.getReceiveTime() != null) {
sql.SET("receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("high_coupon_recycle");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}");
sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}");
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}");
sql.SET("coupon_sales_code = #{record.couponSalesCode,jdbcType=VARCHAR}");
sql.SET("coupon_code_id = #{record.couponCodeId,jdbcType=BIGINT}");
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
sql.SET("receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
HighCouponRecycleExample example = (HighCouponRecycleExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
protected void applyWhere(SQL sql, HighCouponRecycleExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -44,8 +44,8 @@ public class HighCouponSqlProvider {
sql.VALUES("coupon_name", "#{couponName,jdbcType=VARCHAR}"); sql.VALUES("coupon_name", "#{couponName,jdbcType=VARCHAR}");
} }
if (record.getCouponValue() != null) { if (record.getCouponPrice() != null) {
sql.VALUES("coupon_value", "#{couponValue,jdbcType=VARCHAR}"); sql.VALUES("coupon_price", "#{couponPrice,jdbcType=DECIMAL}");
} }
if (record.getCouponImg() != null) { if (record.getCouponImg() != null) {
@ -64,6 +64,14 @@ public class HighCouponSqlProvider {
sql.VALUES("coupon_type", "#{couponType,jdbcType=INTEGER}"); sql.VALUES("coupon_type", "#{couponType,jdbcType=INTEGER}");
} }
if (record.getSalesEndTime() != null) {
sql.VALUES("sales_end_time", "#{salesEndTime,jdbcType=TIMESTAMP}");
}
if (record.getRecycleDay() != null) {
sql.VALUES("recycle_day", "#{recycleDay,jdbcType=INTEGER}");
}
if (record.getLimitNumber() != null) { if (record.getLimitNumber() != null) {
sql.VALUES("limit_number", "#{limitNumber,jdbcType=INTEGER}"); sql.VALUES("limit_number", "#{limitNumber,jdbcType=INTEGER}");
} }
@ -126,11 +134,13 @@ public class HighCouponSqlProvider {
sql.SELECT("merchant_id"); sql.SELECT("merchant_id");
sql.SELECT("coupon_key"); sql.SELECT("coupon_key");
sql.SELECT("coupon_name"); sql.SELECT("coupon_name");
sql.SELECT("coupon_value"); sql.SELECT("coupon_price");
sql.SELECT("coupon_img"); sql.SELECT("coupon_img");
sql.SELECT("coupon_carousel_img"); sql.SELECT("coupon_carousel_img");
sql.SELECT("coupon_desc"); sql.SELECT("coupon_desc");
sql.SELECT("coupon_type"); sql.SELECT("coupon_type");
sql.SELECT("sales_end_time");
sql.SELECT("recycle_day");
sql.SELECT("limit_number"); sql.SELECT("limit_number");
sql.SELECT("sales_price"); sql.SELECT("sales_price");
sql.SELECT("sales_count"); sql.SELECT("sales_count");
@ -180,8 +190,8 @@ public class HighCouponSqlProvider {
sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}");
} }
if (record.getCouponValue() != null) { if (record.getCouponPrice() != null) {
sql.SET("coupon_value = #{record.couponValue,jdbcType=VARCHAR}"); sql.SET("coupon_price = #{record.couponPrice,jdbcType=DECIMAL}");
} }
if (record.getCouponImg() != null) { if (record.getCouponImg() != null) {
@ -200,6 +210,14 @@ public class HighCouponSqlProvider {
sql.SET("coupon_type = #{record.couponType,jdbcType=INTEGER}"); sql.SET("coupon_type = #{record.couponType,jdbcType=INTEGER}");
} }
if (record.getSalesEndTime() != null) {
sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}");
}
if (record.getRecycleDay() != null) {
sql.SET("recycle_day = #{record.recycleDay,jdbcType=INTEGER}");
}
if (record.getLimitNumber() != null) { if (record.getLimitNumber() != null) {
sql.SET("limit_number = #{record.limitNumber,jdbcType=INTEGER}"); sql.SET("limit_number = #{record.limitNumber,jdbcType=INTEGER}");
} }
@ -261,11 +279,13 @@ public class HighCouponSqlProvider {
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}");
sql.SET("coupon_key = #{record.couponKey,jdbcType=VARCHAR}"); sql.SET("coupon_key = #{record.couponKey,jdbcType=VARCHAR}");
sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}");
sql.SET("coupon_value = #{record.couponValue,jdbcType=VARCHAR}"); sql.SET("coupon_price = #{record.couponPrice,jdbcType=DECIMAL}");
sql.SET("coupon_img = #{record.couponImg,jdbcType=VARCHAR}"); sql.SET("coupon_img = #{record.couponImg,jdbcType=VARCHAR}");
sql.SET("coupon_carousel_img = #{record.couponCarouselImg,jdbcType=VARCHAR}"); sql.SET("coupon_carousel_img = #{record.couponCarouselImg,jdbcType=VARCHAR}");
sql.SET("coupon_desc = #{record.couponDesc,jdbcType=VARCHAR}"); sql.SET("coupon_desc = #{record.couponDesc,jdbcType=VARCHAR}");
sql.SET("coupon_type = #{record.couponType,jdbcType=INTEGER}"); sql.SET("coupon_type = #{record.couponType,jdbcType=INTEGER}");
sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}");
sql.SET("recycle_day = #{record.recycleDay,jdbcType=INTEGER}");
sql.SET("limit_number = #{record.limitNumber,jdbcType=INTEGER}"); sql.SET("limit_number = #{record.limitNumber,jdbcType=INTEGER}");
sql.SET("sales_price = #{record.salesPrice,jdbcType=DECIMAL}"); sql.SET("sales_price = #{record.salesPrice,jdbcType=DECIMAL}");
sql.SET("sales_count = #{record.salesCount,jdbcType=INTEGER}"); sql.SET("sales_count = #{record.salesCount,jdbcType=INTEGER}");
@ -304,8 +324,8 @@ public class HighCouponSqlProvider {
sql.SET("coupon_name = #{couponName,jdbcType=VARCHAR}"); sql.SET("coupon_name = #{couponName,jdbcType=VARCHAR}");
} }
if (record.getCouponValue() != null) { if (record.getCouponPrice() != null) {
sql.SET("coupon_value = #{couponValue,jdbcType=VARCHAR}"); sql.SET("coupon_price = #{couponPrice,jdbcType=DECIMAL}");
} }
if (record.getCouponImg() != null) { if (record.getCouponImg() != null) {
@ -324,6 +344,14 @@ public class HighCouponSqlProvider {
sql.SET("coupon_type = #{couponType,jdbcType=INTEGER}"); sql.SET("coupon_type = #{couponType,jdbcType=INTEGER}");
} }
if (record.getSalesEndTime() != null) {
sql.SET("sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP}");
}
if (record.getRecycleDay() != null) {
sql.SET("recycle_day = #{recycleDay,jdbcType=INTEGER}");
}
if (record.getLimitNumber() != null) { if (record.getLimitNumber() != null) {
sql.SET("limit_number = #{limitNumber,jdbcType=INTEGER}"); sql.SET("limit_number = #{limitNumber,jdbcType=INTEGER}");
} }

@ -46,7 +46,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt
"operator_name, `status`, ", "operator_name, `status`, ",
"ext_1, ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{objectType,jdbcType=INTEGER}, #{objectId,jdbcType=BIGINT}, ", "values (#{objectType,jdbcType=INTEGER}, #{objectId,jdbcType=BIGINT}, ",
"#{newSalePrice,jdbcType=REAL}, #{promptlyType,jdbcType=BIT}, ", "#{newSalePrice,jdbcType=DECIMAL}, #{promptlyType,jdbcType=BIT}, ",
"#{effectiveTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, ", "#{effectiveTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ", "#{createTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ",
"#{operatorName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{operatorName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
@ -64,7 +64,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.REAL), @Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT), @Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT),
@Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR), @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@ -89,7 +89,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.REAL), @Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT), @Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT),
@Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR), @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@ -116,7 +116,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt
"update high_goods_price_refer", "update high_goods_price_refer",
"set object_type = #{objectType,jdbcType=INTEGER},", "set object_type = #{objectType,jdbcType=INTEGER},",
"object_id = #{objectId,jdbcType=BIGINT},", "object_id = #{objectId,jdbcType=BIGINT},",
"new_sale_price = #{newSalePrice,jdbcType=REAL},", "new_sale_price = #{newSalePrice,jdbcType=DECIMAL},",
"promptly_type = #{promptlyType,jdbcType=BIT},", "promptly_type = #{promptlyType,jdbcType=BIT},",
"effective_time = #{effectiveTime,jdbcType=TIMESTAMP},", "effective_time = #{effectiveTime,jdbcType=TIMESTAMP},",
"remark = #{remark,jdbcType=VARCHAR},", "remark = #{remark,jdbcType=VARCHAR},",

@ -37,7 +37,7 @@ public class HighGoodsPriceReferSqlProvider {
} }
if (record.getNewSalePrice() != null) { if (record.getNewSalePrice() != null) {
sql.VALUES("new_sale_price", "#{newSalePrice,jdbcType=REAL}"); sql.VALUES("new_sale_price", "#{newSalePrice,jdbcType=DECIMAL}");
} }
if (record.getPromptlyType() != null) { if (record.getPromptlyType() != null) {
@ -133,7 +133,7 @@ public class HighGoodsPriceReferSqlProvider {
} }
if (record.getNewSalePrice() != null) { if (record.getNewSalePrice() != null) {
sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=REAL}"); sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=DECIMAL}");
} }
if (record.getPromptlyType() != null) { if (record.getPromptlyType() != null) {
@ -187,7 +187,7 @@ public class HighGoodsPriceReferSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}"); sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}");
sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}");
sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=REAL}"); sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=DECIMAL}");
sql.SET("promptly_type = #{record.promptlyType,jdbcType=BIT}"); sql.SET("promptly_type = #{record.promptlyType,jdbcType=BIT}");
sql.SET("effective_time = #{record.effectiveTime,jdbcType=TIMESTAMP}"); sql.SET("effective_time = #{record.effectiveTime,jdbcType=TIMESTAMP}");
sql.SET("remark = #{record.remark,jdbcType=VARCHAR}"); sql.SET("remark = #{record.remark,jdbcType=VARCHAR}");
@ -217,7 +217,7 @@ public class HighGoodsPriceReferSqlProvider {
} }
if (record.getNewSalePrice() != null) { if (record.getNewSalePrice() != null) {
sql.SET("new_sale_price = #{newSalePrice,jdbcType=REAL}"); sql.SET("new_sale_price = #{newSalePrice,jdbcType=DECIMAL}");
} }
if (record.getPromptlyType() != null) { if (record.getPromptlyType() != null) {

@ -1,6 +1,7 @@
package com.hai.entity; package com.hai.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
@ -41,7 +42,7 @@ public class HighCoupon implements Serializable {
/** /**
* 卡券面值 * 卡券面值
*/ */
private String couponValue; private BigDecimal couponPrice;
/** /**
* 卡券图片 * 卡券图片
@ -63,6 +64,16 @@ public class HighCoupon implements Serializable {
*/ */
private Integer couponType; private Integer couponType;
/**
* 销售截止日期
*/
private Date salesEndTime;
/**
* 归库天数
*/
private Integer recycleDay;
/** /**
* 限购数量 * 限购数量
*/ */
@ -71,7 +82,7 @@ public class HighCoupon implements Serializable {
/** /**
* 销售价格 * 销售价格
*/ */
private Long salesPrice; private BigDecimal salesPrice;
/** /**
* 销售数量 * 销售数量
@ -156,12 +167,12 @@ public class HighCoupon implements Serializable {
this.couponName = couponName; this.couponName = couponName;
} }
public String getCouponValue() { public BigDecimal getCouponPrice() {
return couponValue; return couponPrice;
} }
public void setCouponValue(String couponValue) { public void setCouponPrice(BigDecimal couponPrice) {
this.couponValue = couponValue; this.couponPrice = couponPrice;
} }
public String getCouponImg() { public String getCouponImg() {
@ -196,6 +207,22 @@ public class HighCoupon implements Serializable {
this.couponType = couponType; this.couponType = couponType;
} }
public Date getSalesEndTime() {
return salesEndTime;
}
public void setSalesEndTime(Date salesEndTime) {
this.salesEndTime = salesEndTime;
}
public Integer getRecycleDay() {
return recycleDay;
}
public void setRecycleDay(Integer recycleDay) {
this.recycleDay = recycleDay;
}
public Integer getLimitNumber() { public Integer getLimitNumber() {
return limitNumber; return limitNumber;
} }
@ -204,11 +231,11 @@ public class HighCoupon implements Serializable {
this.limitNumber = limitNumber; this.limitNumber = limitNumber;
} }
public Long getSalesPrice() { public BigDecimal getSalesPrice() {
return salesPrice; return salesPrice;
} }
public void setSalesPrice(Long salesPrice) { public void setSalesPrice(BigDecimal salesPrice) {
this.salesPrice = salesPrice; this.salesPrice = salesPrice;
} }
@ -309,11 +336,13 @@ public class HighCoupon implements Serializable {
&& (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId())) && (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId()))
&& (this.getCouponKey() == null ? other.getCouponKey() == null : this.getCouponKey().equals(other.getCouponKey())) && (this.getCouponKey() == null ? other.getCouponKey() == null : this.getCouponKey().equals(other.getCouponKey()))
&& (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName())) && (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName()))
&& (this.getCouponValue() == null ? other.getCouponValue() == null : this.getCouponValue().equals(other.getCouponValue())) && (this.getCouponPrice() == null ? other.getCouponPrice() == null : this.getCouponPrice().equals(other.getCouponPrice()))
&& (this.getCouponImg() == null ? other.getCouponImg() == null : this.getCouponImg().equals(other.getCouponImg())) && (this.getCouponImg() == null ? other.getCouponImg() == null : this.getCouponImg().equals(other.getCouponImg()))
&& (this.getCouponCarouselImg() == null ? other.getCouponCarouselImg() == null : this.getCouponCarouselImg().equals(other.getCouponCarouselImg())) && (this.getCouponCarouselImg() == null ? other.getCouponCarouselImg() == null : this.getCouponCarouselImg().equals(other.getCouponCarouselImg()))
&& (this.getCouponDesc() == null ? other.getCouponDesc() == null : this.getCouponDesc().equals(other.getCouponDesc())) && (this.getCouponDesc() == null ? other.getCouponDesc() == null : this.getCouponDesc().equals(other.getCouponDesc()))
&& (this.getCouponType() == null ? other.getCouponType() == null : this.getCouponType().equals(other.getCouponType())) && (this.getCouponType() == null ? other.getCouponType() == null : this.getCouponType().equals(other.getCouponType()))
&& (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime()))
&& (this.getRecycleDay() == null ? other.getRecycleDay() == null : this.getRecycleDay().equals(other.getRecycleDay()))
&& (this.getLimitNumber() == null ? other.getLimitNumber() == null : this.getLimitNumber().equals(other.getLimitNumber())) && (this.getLimitNumber() == null ? other.getLimitNumber() == null : this.getLimitNumber().equals(other.getLimitNumber()))
&& (this.getSalesPrice() == null ? other.getSalesPrice() == null : this.getSalesPrice().equals(other.getSalesPrice())) && (this.getSalesPrice() == null ? other.getSalesPrice() == null : this.getSalesPrice().equals(other.getSalesPrice()))
&& (this.getSalesCount() == null ? other.getSalesCount() == null : this.getSalesCount().equals(other.getSalesCount())) && (this.getSalesCount() == null ? other.getSalesCount() == null : this.getSalesCount().equals(other.getSalesCount()))
@ -337,11 +366,13 @@ public class HighCoupon implements Serializable {
result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode()); result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode());
result = prime * result + ((getCouponKey() == null) ? 0 : getCouponKey().hashCode()); result = prime * result + ((getCouponKey() == null) ? 0 : getCouponKey().hashCode());
result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode()); result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode());
result = prime * result + ((getCouponValue() == null) ? 0 : getCouponValue().hashCode()); result = prime * result + ((getCouponPrice() == null) ? 0 : getCouponPrice().hashCode());
result = prime * result + ((getCouponImg() == null) ? 0 : getCouponImg().hashCode()); result = prime * result + ((getCouponImg() == null) ? 0 : getCouponImg().hashCode());
result = prime * result + ((getCouponCarouselImg() == null) ? 0 : getCouponCarouselImg().hashCode()); result = prime * result + ((getCouponCarouselImg() == null) ? 0 : getCouponCarouselImg().hashCode());
result = prime * result + ((getCouponDesc() == null) ? 0 : getCouponDesc().hashCode()); result = prime * result + ((getCouponDesc() == null) ? 0 : getCouponDesc().hashCode());
result = prime * result + ((getCouponType() == null) ? 0 : getCouponType().hashCode()); result = prime * result + ((getCouponType() == null) ? 0 : getCouponType().hashCode());
result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode());
result = prime * result + ((getRecycleDay() == null) ? 0 : getRecycleDay().hashCode());
result = prime * result + ((getLimitNumber() == null) ? 0 : getLimitNumber().hashCode()); result = prime * result + ((getLimitNumber() == null) ? 0 : getLimitNumber().hashCode());
result = prime * result + ((getSalesPrice() == null) ? 0 : getSalesPrice().hashCode()); result = prime * result + ((getSalesPrice() == null) ? 0 : getSalesPrice().hashCode());
result = prime * result + ((getSalesCount() == null) ? 0 : getSalesCount().hashCode()); result = prime * result + ((getSalesCount() == null) ? 0 : getSalesCount().hashCode());
@ -368,11 +399,13 @@ public class HighCoupon implements Serializable {
sb.append(", merchantId=").append(merchantId); sb.append(", merchantId=").append(merchantId);
sb.append(", couponKey=").append(couponKey); sb.append(", couponKey=").append(couponKey);
sb.append(", couponName=").append(couponName); sb.append(", couponName=").append(couponName);
sb.append(", couponValue=").append(couponValue); sb.append(", couponPrice=").append(couponPrice);
sb.append(", couponImg=").append(couponImg); sb.append(", couponImg=").append(couponImg);
sb.append(", couponCarouselImg=").append(couponCarouselImg); sb.append(", couponCarouselImg=").append(couponCarouselImg);
sb.append(", couponDesc=").append(couponDesc); sb.append(", couponDesc=").append(couponDesc);
sb.append(", couponType=").append(couponType); sb.append(", couponType=").append(couponType);
sb.append(", salesEndTime=").append(salesEndTime);
sb.append(", recycleDay=").append(recycleDay);
sb.append(", limitNumber=").append(limitNumber); sb.append(", limitNumber=").append(limitNumber);
sb.append(", salesPrice=").append(salesPrice); sb.append(", salesPrice=").append(salesPrice);
sb.append(", salesCount=").append(salesCount); sb.append(", salesCount=").append(salesCount);

@ -64,7 +64,7 @@ public class HighCouponCode implements Serializable {
private Date consumeTime; private Date consumeTime;
/** /**
* 状态1.待销售 2.未使用 3.已使用 4.已过期 * 状态1.待销售 2.未使用 3.已使用
*/ */
private Integer status; private Integer status;

@ -1,5 +1,6 @@
package com.hai.entity; package com.hai.entity;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -445,73 +446,63 @@ public class HighCouponExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueIsNull() { public Criteria andCouponPriceIsNull() {
addCriterion("coupon_value is null"); addCriterion("coupon_price is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueIsNotNull() { public Criteria andCouponPriceIsNotNull() {
addCriterion("coupon_value is not null"); addCriterion("coupon_price is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueEqualTo(String value) { public Criteria andCouponPriceEqualTo(BigDecimal value) {
addCriterion("coupon_value =", value, "couponValue"); addCriterion("coupon_price =", value, "couponPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueNotEqualTo(String value) { public Criteria andCouponPriceNotEqualTo(BigDecimal value) {
addCriterion("coupon_value <>", value, "couponValue"); addCriterion("coupon_price <>", value, "couponPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueGreaterThan(String value) { public Criteria andCouponPriceGreaterThan(BigDecimal value) {
addCriterion("coupon_value >", value, "couponValue"); addCriterion("coupon_price >", value, "couponPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueGreaterThanOrEqualTo(String value) { public Criteria andCouponPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("coupon_value >=", value, "couponValue"); addCriterion("coupon_price >=", value, "couponPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueLessThan(String value) { public Criteria andCouponPriceLessThan(BigDecimal value) {
addCriterion("coupon_value <", value, "couponValue"); addCriterion("coupon_price <", value, "couponPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueLessThanOrEqualTo(String value) { public Criteria andCouponPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("coupon_value <=", value, "couponValue"); addCriterion("coupon_price <=", value, "couponPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueLike(String value) { public Criteria andCouponPriceIn(List<BigDecimal> values) {
addCriterion("coupon_value like", value, "couponValue"); addCriterion("coupon_price in", values, "couponPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueNotLike(String value) { public Criteria andCouponPriceNotIn(List<BigDecimal> values) {
addCriterion("coupon_value not like", value, "couponValue"); addCriterion("coupon_price not in", values, "couponPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueIn(List<String> values) { public Criteria andCouponPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("coupon_value in", values, "couponValue"); addCriterion("coupon_price between", value1, value2, "couponPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCouponValueNotIn(List<String> values) { public Criteria andCouponPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("coupon_value not in", values, "couponValue"); addCriterion("coupon_price not between", value1, value2, "couponPrice");
return (Criteria) this;
}
public Criteria andCouponValueBetween(String value1, String value2) {
addCriterion("coupon_value between", value1, value2, "couponValue");
return (Criteria) this;
}
public Criteria andCouponValueNotBetween(String value1, String value2) {
addCriterion("coupon_value not between", value1, value2, "couponValue");
return (Criteria) this; return (Criteria) this;
} }
@ -785,6 +776,126 @@ public class HighCouponExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesEndTimeIsNull() {
addCriterion("sales_end_time is null");
return (Criteria) this;
}
public Criteria andSalesEndTimeIsNotNull() {
addCriterion("sales_end_time is not null");
return (Criteria) this;
}
public Criteria andSalesEndTimeEqualTo(Date value) {
addCriterion("sales_end_time =", value, "salesEndTime");
return (Criteria) this;
}
public Criteria andSalesEndTimeNotEqualTo(Date value) {
addCriterion("sales_end_time <>", value, "salesEndTime");
return (Criteria) this;
}
public Criteria andSalesEndTimeGreaterThan(Date value) {
addCriterion("sales_end_time >", value, "salesEndTime");
return (Criteria) this;
}
public Criteria andSalesEndTimeGreaterThanOrEqualTo(Date value) {
addCriterion("sales_end_time >=", value, "salesEndTime");
return (Criteria) this;
}
public Criteria andSalesEndTimeLessThan(Date value) {
addCriterion("sales_end_time <", value, "salesEndTime");
return (Criteria) this;
}
public Criteria andSalesEndTimeLessThanOrEqualTo(Date value) {
addCriterion("sales_end_time <=", value, "salesEndTime");
return (Criteria) this;
}
public Criteria andSalesEndTimeIn(List<Date> values) {
addCriterion("sales_end_time in", values, "salesEndTime");
return (Criteria) this;
}
public Criteria andSalesEndTimeNotIn(List<Date> values) {
addCriterion("sales_end_time not in", values, "salesEndTime");
return (Criteria) this;
}
public Criteria andSalesEndTimeBetween(Date value1, Date value2) {
addCriterion("sales_end_time between", value1, value2, "salesEndTime");
return (Criteria) this;
}
public Criteria andSalesEndTimeNotBetween(Date value1, Date value2) {
addCriterion("sales_end_time not between", value1, value2, "salesEndTime");
return (Criteria) this;
}
public Criteria andRecycleDayIsNull() {
addCriterion("recycle_day is null");
return (Criteria) this;
}
public Criteria andRecycleDayIsNotNull() {
addCriterion("recycle_day is not null");
return (Criteria) this;
}
public Criteria andRecycleDayEqualTo(Integer value) {
addCriterion("recycle_day =", value, "recycleDay");
return (Criteria) this;
}
public Criteria andRecycleDayNotEqualTo(Integer value) {
addCriterion("recycle_day <>", value, "recycleDay");
return (Criteria) this;
}
public Criteria andRecycleDayGreaterThan(Integer value) {
addCriterion("recycle_day >", value, "recycleDay");
return (Criteria) this;
}
public Criteria andRecycleDayGreaterThanOrEqualTo(Integer value) {
addCriterion("recycle_day >=", value, "recycleDay");
return (Criteria) this;
}
public Criteria andRecycleDayLessThan(Integer value) {
addCriterion("recycle_day <", value, "recycleDay");
return (Criteria) this;
}
public Criteria andRecycleDayLessThanOrEqualTo(Integer value) {
addCriterion("recycle_day <=", value, "recycleDay");
return (Criteria) this;
}
public Criteria andRecycleDayIn(List<Integer> values) {
addCriterion("recycle_day in", values, "recycleDay");
return (Criteria) this;
}
public Criteria andRecycleDayNotIn(List<Integer> values) {
addCriterion("recycle_day not in", values, "recycleDay");
return (Criteria) this;
}
public Criteria andRecycleDayBetween(Integer value1, Integer value2) {
addCriterion("recycle_day between", value1, value2, "recycleDay");
return (Criteria) this;
}
public Criteria andRecycleDayNotBetween(Integer value1, Integer value2) {
addCriterion("recycle_day not between", value1, value2, "recycleDay");
return (Criteria) this;
}
public Criteria andLimitNumberIsNull() { public Criteria andLimitNumberIsNull() {
addCriterion("limit_number is null"); addCriterion("limit_number is null");
return (Criteria) this; return (Criteria) this;
@ -855,52 +966,52 @@ public class HighCouponExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceEqualTo(Long value) { public Criteria andSalesPriceEqualTo(BigDecimal value) {
addCriterion("sales_price =", value, "salesPrice"); addCriterion("sales_price =", value, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceNotEqualTo(Long value) { public Criteria andSalesPriceNotEqualTo(BigDecimal value) {
addCriterion("sales_price <>", value, "salesPrice"); addCriterion("sales_price <>", value, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceGreaterThan(Long value) { public Criteria andSalesPriceGreaterThan(BigDecimal value) {
addCriterion("sales_price >", value, "salesPrice"); addCriterion("sales_price >", value, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceGreaterThanOrEqualTo(Long value) { public Criteria andSalesPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("sales_price >=", value, "salesPrice"); addCriterion("sales_price >=", value, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceLessThan(Long value) { public Criteria andSalesPriceLessThan(BigDecimal value) {
addCriterion("sales_price <", value, "salesPrice"); addCriterion("sales_price <", value, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceLessThanOrEqualTo(Long value) { public Criteria andSalesPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("sales_price <=", value, "salesPrice"); addCriterion("sales_price <=", value, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceIn(List<Long> values) { public Criteria andSalesPriceIn(List<BigDecimal> values) {
addCriterion("sales_price in", values, "salesPrice"); addCriterion("sales_price in", values, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceNotIn(List<Long> values) { public Criteria andSalesPriceNotIn(List<BigDecimal> values) {
addCriterion("sales_price not in", values, "salesPrice"); addCriterion("sales_price not in", values, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceBetween(Long value1, Long value2) { public Criteria andSalesPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("sales_price between", value1, value2, "salesPrice"); addCriterion("sales_price between", value1, value2, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSalesPriceNotBetween(Long value1, Long value2) { public Criteria andSalesPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("sales_price not between", value1, value2, "salesPrice"); addCriterion("sales_price not between", value1, value2, "salesPrice");
return (Criteria) this; return (Criteria) this;
} }

@ -0,0 +1,296 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* high_coupon_recycle
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class HighCouponRecycle implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 卡卷
*/
private Long couponId;
/**
* 卡卷名称
*/
private String couponName;
/**
* 商户
*/
private Long merchantId;
/**
* 销售码
*/
private String couponSalesCode;
/**
* 销售码id
*/
private Long couponCodeId;
/**
* 用户id
*/
private Long userId;
/**
* 用户手机号
*/
private String userPhone;
/**
* 订单流水号
*/
private String orderNo;
/**
* 订单id
*/
private Long orderId;
/**
* 领取时间
*/
private Date receiveTime;
/**
* 创建时间
*/
private Date createTime;
/**
* 状态1.过期 2.退款
*/
private Integer status;
private String ext1;
private String ext3;
private String ext2;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getCouponId() {
return couponId;
}
public void setCouponId(Long couponId) {
this.couponId = couponId;
}
public String getCouponName() {
return couponName;
}
public void setCouponName(String couponName) {
this.couponName = couponName;
}
public Long getMerchantId() {
return merchantId;
}
public void setMerchantId(Long merchantId) {
this.merchantId = merchantId;
}
public String getCouponSalesCode() {
return couponSalesCode;
}
public void setCouponSalesCode(String couponSalesCode) {
this.couponSalesCode = couponSalesCode;
}
public Long getCouponCodeId() {
return couponCodeId;
}
public void setCouponCodeId(Long couponCodeId) {
this.couponCodeId = couponCodeId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserPhone() {
return userPhone;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Date getReceiveTime() {
return receiveTime;
}
public void setReceiveTime(Date receiveTime) {
this.receiveTime = receiveTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
HighCouponRecycle other = (HighCouponRecycle) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId()))
&& (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName()))
&& (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId()))
&& (this.getCouponSalesCode() == null ? other.getCouponSalesCode() == null : this.getCouponSalesCode().equals(other.getCouponSalesCode()))
&& (this.getCouponCodeId() == null ? other.getCouponCodeId() == null : this.getCouponCodeId().equals(other.getCouponCodeId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone()))
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
&& (this.getReceiveTime() == null ? other.getReceiveTime() == null : this.getReceiveTime().equals(other.getReceiveTime()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode());
result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode());
result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode());
result = prime * result + ((getCouponSalesCode() == null) ? 0 : getCouponSalesCode().hashCode());
result = prime * result + ((getCouponCodeId() == null) ? 0 : getCouponCodeId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode());
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
result = prime * result + ((getReceiveTime() == null) ? 0 : getReceiveTime().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", couponId=").append(couponId);
sb.append(", couponName=").append(couponName);
sb.append(", merchantId=").append(merchantId);
sb.append(", couponSalesCode=").append(couponSalesCode);
sb.append(", couponCodeId=").append(couponCodeId);
sb.append(", userId=").append(userId);
sb.append(", userPhone=").append(userPhone);
sb.append(", orderNo=").append(orderNo);
sb.append(", orderId=").append(orderId);
sb.append(", receiveTime=").append(receiveTime);
sb.append(", createTime=").append(createTime);
sb.append(", status=").append(status);
sb.append(", ext1=").append(ext1);
sb.append(", ext3=").append(ext3);
sb.append(", ext2=").append(ext2);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -1,6 +1,7 @@
package com.hai.entity; package com.hai.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
@ -31,7 +32,7 @@ public class HighGoodsPriceRefer implements Serializable {
/** /**
* 新销售价格 * 新销售价格
*/ */
private Float newSalePrice; private BigDecimal newSalePrice;
/** /**
* 及时生效 0 1 * 及时生效 0 1
@ -64,7 +65,7 @@ public class HighGoodsPriceRefer implements Serializable {
private String operatorName; private String operatorName;
/** /**
* 状态: 0:删除 1:未生效 2:已生效 3:已失效 101.审批中 102.审批驳回 * 状态: 0:删除 1:待编辑 2:待生效 3:已生效 4:已失效 101.审批中 102.审批驳回
*/ */
private Integer status; private Integer status;
@ -100,11 +101,11 @@ public class HighGoodsPriceRefer implements Serializable {
this.objectId = objectId; this.objectId = objectId;
} }
public Float getNewSalePrice() { public BigDecimal getNewSalePrice() {
return newSalePrice; return newSalePrice;
} }
public void setNewSalePrice(Float newSalePrice) { public void setNewSalePrice(BigDecimal newSalePrice) {
this.newSalePrice = newSalePrice; this.newSalePrice = newSalePrice;
} }

@ -1,5 +1,6 @@
package com.hai.entity; package com.hai.entity;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -315,52 +316,52 @@ public class HighGoodsPriceReferExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceEqualTo(Float value) { public Criteria andNewSalePriceEqualTo(BigDecimal value) {
addCriterion("new_sale_price =", value, "newSalePrice"); addCriterion("new_sale_price =", value, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceNotEqualTo(Float value) { public Criteria andNewSalePriceNotEqualTo(BigDecimal value) {
addCriterion("new_sale_price <>", value, "newSalePrice"); addCriterion("new_sale_price <>", value, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceGreaterThan(Float value) { public Criteria andNewSalePriceGreaterThan(BigDecimal value) {
addCriterion("new_sale_price >", value, "newSalePrice"); addCriterion("new_sale_price >", value, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceGreaterThanOrEqualTo(Float value) { public Criteria andNewSalePriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("new_sale_price >=", value, "newSalePrice"); addCriterion("new_sale_price >=", value, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceLessThan(Float value) { public Criteria andNewSalePriceLessThan(BigDecimal value) {
addCriterion("new_sale_price <", value, "newSalePrice"); addCriterion("new_sale_price <", value, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceLessThanOrEqualTo(Float value) { public Criteria andNewSalePriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("new_sale_price <=", value, "newSalePrice"); addCriterion("new_sale_price <=", value, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceIn(List<Float> values) { public Criteria andNewSalePriceIn(List<BigDecimal> values) {
addCriterion("new_sale_price in", values, "newSalePrice"); addCriterion("new_sale_price in", values, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceNotIn(List<Float> values) { public Criteria andNewSalePriceNotIn(List<BigDecimal> values) {
addCriterion("new_sale_price not in", values, "newSalePrice"); addCriterion("new_sale_price not in", values, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceBetween(Float value1, Float value2) { public Criteria andNewSalePriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("new_sale_price between", value1, value2, "newSalePrice"); addCriterion("new_sale_price between", value1, value2, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNewSalePriceNotBetween(Float value1, Float value2) { public Criteria andNewSalePriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("new_sale_price not between", value1, value2, "newSalePrice"); addCriterion("new_sale_price not between", value1, value2, "newSalePrice");
return (Criteria) this; return (Criteria) this;
} }

@ -0,0 +1,36 @@
package com.hai.enum_type;
/**
* @Auther: 胡锐
* @Description:
* @Date: 2021/3/14 20:41
*/
public enum ApproveType {
UP_SHELF_APPROVE(1, "卡卷上架审批")
;
private Integer type;
private String name;
ApproveType(int type, String name) {
this.type = type;
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,19 @@
package com.hai.service;
import com.hai.entity.HighApprove;
/**
* @Auther: 胡锐
* @Description:
* @Date: 2021/3/14 20:46
*/
public interface HighApproveService {
/**
* @Author 胡锐
* @Description 增加审批
* @Date 2021/3/14 20:46
**/
void insertApprove(HighApprove highApprove);
}

@ -0,0 +1,19 @@
package com.hai.service;
import com.hai.entity.HighCouponCode;
/**
* @Auther: 胡锐
* @Description: 卡券销售码
* @Date: 2021/3/14 17:44
*/
public interface HighCouponCodeService {
/**
* @Author 胡锐
* @Description 增加
* @Date 2021/3/14 17:44
**/
void insertCouponCode(HighCouponCode highCouponCode);
}

@ -12,16 +12,45 @@ public interface HighCouponService {
/** /**
* @Author 胡锐 * @Author 胡锐
* @Description 增加 * @Description 增加卡卷业务
* @Date 2021/3/11 22:05 * @Date 2021/3/11 22:05
**/ **/
void insertCoupon(HighCouponModel highCouponModel); void insertCoupon(HighCouponModel highCouponModel);
/** /**
* @Author 胡锐 * @Author 胡锐
* @Description 修改 * @Description 修改卡卷业务
* @Date 2021/3/12 20:41 * @Date 2021/3/12 20:41
**/ **/
void updateCoupon(HighCouponModel highCouponModel); void updateCoupon(HighCouponModel highCouponModel);
/**
* @Author 胡锐
* @Description 修改卡卷信息
* @Date 2021/3/14 20:52
**/
void update(HighCoupon highCoupon);
/**
* @Author 胡锐
* @Description 卡卷上架
* @Date 2021/3/14 22:46
**/
void upShelfApprove(Long id);
/**
* @Author 胡锐
* @Description 卡卷下架
* @Date 2021/3/14 20:56
**/
void ofShelfApprove(Long id);
/**
* @Author 胡锐
* @Description 根据id查询
* @Date 2021/3/14 16:58
**/
HighCouponModel getCouponById(Long id);
} }

@ -0,0 +1,36 @@
package com.hai.service;
import com.hai.entity.HighGoodsPriceRefer;
import java.util.List;
import java.util.Map;
/**
* @Auther: 胡锐
* @Description: 产品销售价格配置
* @Date: 2021/3/14 16:25
*/
public interface HighGoodsPriceReferService {
/**
* @Author 胡锐
* @Description 增加
* @Date 2021/3/14 16:26
**/
void insertPriceRefer(HighGoodsPriceRefer highGoodsPriceRefer);
/**
* @Author 胡锐
* @Description 卡卷价格 处于待编辑已生效待生效审批中 全部失效
* @Date 2021/3/14 20:14
**/
void couponAllPriceInvalid(Long couponId);
/**
* @Author 胡锐
* @Description 卡卷价格 处于待编辑待生效审批中 全部失效但保留当前生效的价格
* @Date 2021/3/14 21:00
**/
void couponAllInvalidKeepCurrent(Long couponId);
}

@ -0,0 +1,46 @@
package com.hai.service.impl;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.dao.HighApproveMapper;
import com.hai.entity.HighApprove;
import com.hai.entity.HighCoupon;
import com.hai.enum_type.ApproveType;
import com.hai.model.HighCouponModel;
import com.hai.service.HighApproveService;
import com.hai.service.HighCouponService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.Objects;
/**
* @Auther: 胡锐
* @Description:
* @Date: 2021/3/14 20:47
*/
@Service("highApproveService")
public class HighApproveServiceImpl implements HighApproveService {
@Resource
private HighApproveMapper highApproveMapper;
@Resource
private HighCouponService highCouponService;
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertApprove(HighApprove highApprove) {
// 卡卷上架审批
if (Objects.equals(highApprove.getObjectType(), ApproveType.UP_SHELF_APPROVE.getType())) {
highCouponService.upShelfApprove(highApprove.getObjectId());
}
highApproveMapper.insert(highApprove);
}
}

@ -0,0 +1,27 @@
package com.hai.service.impl;
import com.hai.dao.HighCouponCodeMapper;
import com.hai.entity.HighCoupon;
import com.hai.entity.HighCouponCode;
import com.hai.model.HighCouponModel;
import com.hai.service.HighCouponCodeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @Auther: 胡锐
* @Description:
* @Date: 2021/3/14 17:45
*/
@Service("highCouponCodeService")
public class HighCouponCodeServiceImpl implements HighCouponCodeService {
@Resource
private HighCouponCodeMapper highCouponCodeMapper;
@Override
public void insertCouponCode(HighCouponCode highCouponCode) {
highCouponCodeMapper.insert(highCouponCode);
}
}

@ -1,13 +1,22 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.dao.HighCouponHandselMapper; import com.hai.dao.HighCouponHandselMapper;
import com.hai.dao.HighCouponMapper; import com.hai.dao.HighCouponMapper;
import com.hai.entity.HighCoupon; import com.hai.entity.HighCoupon;
import com.hai.entity.HighCouponCode;
import com.hai.entity.HighCouponHandsel; import com.hai.entity.HighCouponHandsel;
import com.hai.entity.HighGoodsPriceRefer;
import com.hai.model.HighCouponHandselModel; import com.hai.model.HighCouponHandselModel;
import com.hai.model.HighCouponModel; import com.hai.model.HighCouponModel;
import com.hai.service.HighCouponCodeService;
import com.hai.service.HighCouponService; import com.hai.service.HighCouponService;
import com.hai.service.HighGoodsPriceReferService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -28,10 +37,14 @@ public class HighCouponServiceImpl implements HighCouponService {
@Resource @Resource
private HighCouponHandselMapper highCouponHandselMapper; private HighCouponHandselMapper highCouponHandselMapper;
@Resource
private HighGoodsPriceReferService highGoodsPriceReferService;
@Resource
private HighCouponCodeService highCouponCodeService;
@Override @Override
@Transactional @Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertCoupon(HighCouponModel highCouponModel) { public void insertCoupon(HighCouponModel highCouponModel) {
highCouponMapper.insert(highCouponModel); highCouponMapper.insert(highCouponModel);
@ -42,10 +55,23 @@ public class HighCouponServiceImpl implements HighCouponService {
highCouponHandselMapper.insert(handsel); highCouponHandselMapper.insert(handsel);
} }
} }
HighGoodsPriceRefer goodsPriceRefer = new HighGoodsPriceRefer();
goodsPriceRefer.setObjectType(1);
goodsPriceRefer.setObjectId(highCouponModel.getId());
goodsPriceRefer.setNewSalePrice(highCouponModel.getSalesPrice());
goodsPriceRefer.setPromptlyType(true);
goodsPriceRefer.setEffectiveTime(new Date());
goodsPriceRefer.setRemark("【创建产品】初始销售价格");
goodsPriceRefer.setStatus(1); // 状态: 0:删除 1:待编辑 2:未生效 3:已生效 4:已失效 101.审批中 102.审批驳回
goodsPriceRefer.setCreateTime(new Date());
goodsPriceRefer.setOperatorId(highCouponModel.getOperatorId());
goodsPriceRefer.setOperatorName(highCouponModel.getOperatorName());
highGoodsPriceReferService.insertPriceRefer(goodsPriceRefer);
} }
@Override @Override
@Transactional @Transactional(propagation= Propagation.REQUIRES_NEW)
public void updateCoupon(HighCouponModel highCouponModel) { public void updateCoupon(HighCouponModel highCouponModel) {
highCouponMapper.updateByPrimaryKey(highCouponModel); highCouponMapper.updateByPrimaryKey(highCouponModel);
@ -63,5 +89,77 @@ public class HighCouponServiceImpl implements HighCouponService {
} }
} }
} }
// 查询卡卷 如果卡卷销售价格进行了修改
HighCouponModel coupon = getCouponById(highCouponModel.getId());
if (!coupon.getCouponPrice().equals(highCouponModel.getCouponPrice())) {
// 所有价格失效
highGoodsPriceReferService.couponAllPriceInvalid(highCouponModel.getId());
// 增加新价格
HighGoodsPriceRefer goodsPriceRefer = new HighGoodsPriceRefer();
goodsPriceRefer.setObjectType(1);
goodsPriceRefer.setObjectId(highCouponModel.getId());
goodsPriceRefer.setNewSalePrice(highCouponModel.getSalesPrice());
goodsPriceRefer.setPromptlyType(true);
goodsPriceRefer.setEffectiveTime(new Date());
goodsPriceRefer.setRemark("【修改卡卷】修改销售价格");
goodsPriceRefer.setStatus(1); // 状态: 0:删除 1:待编辑 2:未生效 3:已生效 4:已失效 101.审批中 102.审批驳回
goodsPriceRefer.setCreateTime(new Date());
goodsPriceRefer.setOperatorId(highCouponModel.getOperatorId());
goodsPriceRefer.setOperatorName(highCouponModel.getOperatorName());
highGoodsPriceReferService.insertPriceRefer(goodsPriceRefer);
}
}
@Override
public void update(HighCoupon highCoupon) {
highCouponMapper.updateByPrimaryKey(highCoupon);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void upShelfApprove(Long id) {
// 查询卡卷
HighCouponModel coupon = getCouponById(id);
if (coupon == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, "");
}
coupon.setStatus(101); // 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回
coupon.setUpdateTime(new Date());
update(coupon);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void ofShelfApprove(Long id) {
HighCouponModel coupon = getCouponById(id);
if (coupon == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, "");
}
//状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回
if (coupon.getStatus() != 2) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_UNABLE_UP_SHELF, "");
}
coupon.setStatus(3);
highCouponMapper.updateByPrimaryKey(coupon);
// 卡卷价格全部失效。但保留当前生效的价格
highGoodsPriceReferService.couponAllInvalidKeepCurrent(coupon.getId());
}
@Override
public HighCouponModel getCouponById(Long id) {
HighCoupon highCoupon = highCouponMapper.selectByPrimaryKey(id);
if (highCoupon == null) {
return null;
}
HighCouponModel model = new HighCouponModel();
BeanUtils.copyProperties(highCoupon, model);
return model;
} }
} }

@ -0,0 +1,71 @@
package com.hai.service.impl;
import com.hai.dao.HighGoodsPriceReferMapper;
import com.hai.entity.HighGoodsPriceRefer;
import com.hai.entity.HighGoodsPriceReferExample;
import com.hai.entity.HighMerchant;
import com.hai.service.HighGoodsPriceReferService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @Auther: 胡锐
* @Description: 产品销售价格配置
* @Date: 2021/3/14 16:26
*/
@Service("highGoodsPriceReferService")
public class HighGoodsPriceReferServiceImpl implements HighGoodsPriceReferService {
@Resource
private HighGoodsPriceReferMapper highGoodsPriceReferMapper;
@Override
public void insertPriceRefer(HighGoodsPriceRefer highGoodsPriceRefer) {
highGoodsPriceReferMapper.insert(highGoodsPriceRefer);
}
@Override
public void couponAllPriceInvalid(Long couponId) {
List<Integer> statusList = new ArrayList<>();
statusList.add(1);
statusList.add(2);
statusList.add(3);
statusList.add(101);
HighGoodsPriceReferExample example = new HighGoodsPriceReferExample();
example.createCriteria().andObjectIdEqualTo(couponId).andStatusIn(statusList);
List<HighGoodsPriceRefer> referList = highGoodsPriceReferMapper.selectByExample(example);
if (referList != null && referList.size() > 0) {
for (HighGoodsPriceRefer refer : referList) {
refer.setStatus(4);
highGoodsPriceReferMapper.updateByPrimaryKey(refer);
}
}
}
@Override
public void couponAllInvalidKeepCurrent(Long couponId) {
List<Integer> statusList = new ArrayList<>();
statusList.add(1);
statusList.add(2);
statusList.add(101);
HighGoodsPriceReferExample example = new HighGoodsPriceReferExample();
example.createCriteria().andObjectIdEqualTo(couponId).andStatusIn(statusList);
List<HighGoodsPriceRefer> referList = highGoodsPriceReferMapper.selectByExample(example);
if (referList != null && referList.size() > 0) {
for (HighGoodsPriceRefer refer : referList) {
refer.setStatus(4);
highGoodsPriceReferMapper.updateByPrimaryKey(refer);
}
}
}
}
Loading…
Cancel
Save