master
胡锐 6 months ago
commit da5f454c87
  1. 2
      bweb/src/main/java/com/bweb/controller/BsUserController.java
  2. 4
      bweb/src/main/java/com/bweb/controller/discount/DiscountController.java
  3. 288
      bweb/src/main/java/com/bweb/controller/discount/DiscountPackageController.java
  4. 75
      cweb/src/main/java/com/cweb/controller/discount/DiscountController.java
  5. 32
      cweb/src/main/java/com/cweb/controller/goods/DeliveryAddressController.java
  6. 23
      service/src/main/java/com/hfkj/dao/CouponDiscountPackageDetailsMapper.java
  7. 14
      service/src/main/java/com/hfkj/dao/CouponDiscountPackageDetailsSqlProvider.java
  8. 26
      service/src/main/java/com/hfkj/dao/CouponDiscountPackageMapper.java
  9. 30
      service/src/main/java/com/hfkj/dao/CouponDiscountPackageRecordMapper.java
  10. 34
      service/src/main/java/com/hfkj/dao/CouponDiscountPackageRecordSqlProvider.java
  11. 22
      service/src/main/java/com/hfkj/dao/CouponDiscountPackageSqlProvider.java
  12. 22
      service/src/main/java/com/hfkj/entity/CouponDiscountPackage.java
  13. 16
      service/src/main/java/com/hfkj/entity/CouponDiscountPackageDetails.java
  14. 70
      service/src/main/java/com/hfkj/entity/CouponDiscountPackageDetailsExample.java
  15. 68
      service/src/main/java/com/hfkj/entity/CouponDiscountPackageExample.java
  16. 36
      service/src/main/java/com/hfkj/entity/CouponDiscountPackageRecord.java
  17. 124
      service/src/main/java/com/hfkj/entity/CouponDiscountPackageRecordExample.java
  18. 45
      service/src/main/java/com/hfkj/service/discount/CouponDiscountPackageService.java
  19. 2
      service/src/main/java/com/hfkj/service/discount/CouponDiscountService.java
  20. 30
      service/src/main/java/com/hfkj/service/discount/CouponDiscountUserRelService.java
  21. 230
      service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountPackageServiceImpl.java
  22. 2
      service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountServiceImpl.java
  23. 46
      service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountUserRelServiceImpl.java
  24. 16
      service/src/main/java/com/hfkj/service/goods/impl/GoodsUserAddressServiceImpl.java

@ -31,7 +31,7 @@ import java.util.Map;
**/
@Controller
@RequestMapping(value="/user")
@Api(value="系统菜单管理")
@Api(value="用户管理")
public class BsUserController {
private static Logger log = LoggerFactory.getLogger(BsUserController.class);
@Resource

@ -125,8 +125,8 @@ public class DiscountController {
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData getListDiscount(@RequestParam(value = "name" , required = false) String name,
@RequestParam(value = "type" , required = false) Integer type,
@RequestParam(value = "status" , required = false) Integer status,
@RequestParam(value = "type" , required = false) Integer type,
@RequestParam(value = "status" , required = false) Integer status,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {

@ -0,0 +1,288 @@
package com.bweb.controller.discount;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.SessionObject;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.OrderUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.*;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.discount.CouponDiscountPackageService;
import com.hfkj.service.discount.impl.CouponDiscountServiceImpl;
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.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value="/discountPackage")
@Api(value="优惠券包")
public class DiscountPackageController {
private static final Logger log = LoggerFactory.getLogger(DiscountPackageController.class);
@Resource
private CouponDiscountPackageService couponDiscountPackageService;
@Resource
private UserCenter userCenter;
@Resource
private CouponDiscountServiceImpl couponDiscountService;
@RequestMapping(value = "/getDiscountPackageList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取优惠券包列表")
public ResponseData getDiscountPackageList(
@RequestParam(name = "title", required = false) String title,
@RequestParam(name = "key", required = false) String key,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {
Map<String,Object> map = new HashMap<>();
map.put("title" , title);
map.put("key" , key);
map.put("status" , status);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(couponDiscountPackageService.getList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getDiscountPackageRecordList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取优惠券包记录列表")
public ResponseData getDiscountPackageRecordList(@RequestParam(name = "discountPackageId", required = false) Long discountPackageId) {
try {
Map<String,Object> map = new HashMap<>();
map.put("discountPackageId" , discountPackageId);
return ResponseMsgUtil.success(couponDiscountPackageService.getListRecordByMap(map));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/editCouponPackageInfo", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑优惠券包基本信息")
public ResponseData editCouponPackageInfo(@RequestBody CouponDiscountPackage body, HttpServletRequest request) {
try {
//发布人员
SessionObject sessionObject = userCenter.getSessionObject(request);
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject();
if (StringUtils.isBlank(body.getTitle())
|| body.getEffectiveTime() == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
CouponDiscountPackage discountPackage;
if (body.getId() != null) {
// 查询
discountPackage = couponDiscountPackageService.queryDetail(body.getId());
if (discountPackage == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, "");
}
} else {
discountPackage = new CouponDiscountPackage();
discountPackage.setCreatedUserId(userModel.getAccount().getId().intValue());
discountPackage.setKey(OrderUtil.generateOrderNo());
discountPackage.setStatus(1);
discountPackage.setTotalStock(0);
discountPackage.setCreatedTime(new Date());
}
discountPackage.setSurplusStock(body.getSurplusStock());
discountPackage.setTitle(body.getTitle());
discountPackage.setEffectiveTime(body.getEffectiveTime());
discountPackage.setUpdatedTime(new Date());
discountPackage.setUpdatedUserId(userModel.getAccount().getId().intValue());
if (body.getId() != null) {
couponDiscountPackageService.update(discountPackage);
} else {
couponDiscountPackageService.create(discountPackage);
}
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("HighAgentController --> insertCouponPackageInfo() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/insertCouponPackageDetail", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增优惠券包详情")
public ResponseData insertCouponPackageDetail(@RequestBody CouponDiscountPackageDetails discountPackageDetails, HttpServletRequest request) {
try {
if ( discountPackageDetails.getDiscountPackageId() == null
|| discountPackageDetails.getDiscountId() == null
|| discountPackageDetails.getNum() == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
CouponDiscount discount = couponDiscountService.queryDetail(discountPackageDetails.getDiscountId().longValue());
if (discount == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券不存在!");
}
CouponDiscountPackageDetails details = couponDiscountPackageService.discountPackageDetail(discountPackageDetails.getDiscountPackageId() , discountPackageDetails.getDiscountId());
if (details == null) {
discountPackageDetails.setStatus(1);
discountPackageDetails.setDiscountName(discount.getName());
discountPackageDetails.setDiscountImg(discount.getImg());
discountPackageDetails.setCreatedTime(new Date());
discountPackageDetails.setUpdatedTime(new Date());
couponDiscountPackageService.createDetail(discountPackageDetails);
} else {
details.setNum(discountPackageDetails.getNum() + details.getNum());
details.setUpdatedTime(new Date());
couponDiscountPackageService.updateDetail(details);
}
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("HighAgentController --> insertAgent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/deleteDetail", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "删除券包详情")
public ResponseData deleteDetail(@RequestParam(name = "detailId", required = false) Integer detailId) {
try {
couponDiscountPackageService.deleteDetail(detailId);
return ResponseMsgUtil.success("删除成功!");
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getDetailList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "券包详情列表")
public ResponseData getDetailList(@RequestParam(name = "discountPackageId", required = false) Integer discountPackageId) {
try {
return ResponseMsgUtil.success( couponDiscountPackageService.getDetailList(discountPackageId));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/delete", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "删除券包")
public ResponseData delete(@RequestParam(name = "id", required = false) Long id) {
try {
couponDiscountPackageService.delete(id , false);
return ResponseMsgUtil.success("删除成功!");
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/discountPackageAudit",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "券包上下架")
public ResponseData discountPackageAudit(@RequestParam(value = "id" , required = false) Long id) {
try {
CouponDiscountPackage discountPackage = couponDiscountPackageService.queryDetail(id);
if (discountPackage.getStatus() == 1) {
discountPackage.setStatus(2);
discountPackage.setUpdatedTime(new Date());
} else if (discountPackage.getStatus() == 2) {
discountPackage.setStatus(3);
discountPackage.setUpdatedTime(new Date());
}
couponDiscountPackageService.update(discountPackage);
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/giveDiscountPackage", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "赠送券包")
public ResponseData giveDiscountPackage(@RequestBody JSONObject body) {
try {
if ( body == null
|| body.getInteger("discountPackageId") == null
|| body.getString("phone") == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
couponDiscountPackageService.giveDiscountPackage(body.getInteger("discountPackageId") , body.getString("phone"));
return ResponseMsgUtil.success("成功!");
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,75 @@
package com.cweb.controller.discount;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.SessionObject;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.CouponDiscount;
import com.hfkj.entity.CouponDiscountGoodsRel;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.GoodsSpecs;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.model.UserSessionObject;
import com.hfkj.model.discount.DiscountGoodsModel;
import com.hfkj.service.discount.CouponDiscountService;
import com.hfkj.service.discount.CouponDiscountUserRelService;
import com.hfkj.service.goods.impl.GoodsMsgServiceImpl;
import com.hfkj.service.goods.impl.GoodsSpecsServiceImpl;
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.BeanUtils;
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 java.util.*;
@Controller
@RequestMapping(value="/discount")
@Api(value="优惠券")
public class DiscountController {
private static final Logger log = LoggerFactory.getLogger(DiscountController.class);
@Resource
private UserCenter userCenter;
@Resource
private CouponDiscountUserRelService discountUserRelService;
@RequestMapping(value = "/getListUserDiscount", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取用户优惠券列表")
public ResponseData getListUserDiscount(@RequestParam(value = "status", required = true) Integer status) {
try {
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
Map<String, Object> map = new HashMap<>();
map.put("userId", userSession.getUser().getId());
map.put("status", status);
return ResponseMsgUtil.success(discountUserRelService.getList(map));
} catch (Exception e) {
log.error("GoodsDetailController --> getListUser() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -9,6 +9,7 @@ import com.hfkj.entity.GoodsUserAddress;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject;
import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.goods.impl.GoodsUserAddressServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -30,6 +31,9 @@ public class DeliveryAddressController {
@Resource
private UserCenter userCenter;
@Resource
private GoodsUserAddressServiceImpl goodsUserAddressService;
@RequestMapping(value = "/getDeliveryAddressList", method = RequestMethod.GET)
@ResponseBody
@ -197,4 +201,32 @@ public class DeliveryAddressController {
}
}
@RequestMapping(value = "/getUserAddress", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取默认地址")
public ResponseData getUserAddress() {
try {
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
Map<String , Object> map = new HashMap<>();
map.put("userId" , userSession.getUser().getId());
map.put("whetherDefault" , true);
GoodsUserAddress userAddress = goodsUserAddressService.queryDetailByMap(map);
if (userAddress == null) {
log.error("GoodsDetailController -> findGoodsDetailById() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相信息");
}
return ResponseMsgUtil.success(userAddress);
} catch (Exception e) {
log.error("GoodsDetailController --> findGoodsDetailById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -40,15 +40,15 @@ public interface CouponDiscountPackageDetailsMapper extends CouponDiscountPackag
@Insert({
"insert into coupon_discount_package_details (discount_package_id, discount_id, ",
"discount_name, num, ",
"created_time, updated_time, ",
"`status`, ext_1, ext_2, ",
"ext_3)",
"discount_name, discount_img, ",
"num, created_time, ",
"updated_time, `status`, ",
"ext_1, ext_2, ext_3)",
"values (#{discountPackageId,jdbcType=INTEGER}, #{discountId,jdbcType=INTEGER}, ",
"#{discountName,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, ",
"#{createdTime,jdbcType=TIMESTAMP}, #{updatedTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
"#{discountName,jdbcType=VARCHAR}, #{discountImg,jdbcType=VARCHAR}, ",
"#{num,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, ",
"#{updatedTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(CouponDiscountPackageDetails record);
@ -63,6 +63,7 @@ public interface CouponDiscountPackageDetailsMapper extends CouponDiscountPackag
@Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.INTEGER),
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.INTEGER),
@Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_img", property="discountImg", jdbcType=JdbcType.VARCHAR),
@Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
@Result(column="created_time", property="createdTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="updated_time", property="updatedTime", jdbcType=JdbcType.TIMESTAMP),
@ -75,8 +76,8 @@ public interface CouponDiscountPackageDetailsMapper extends CouponDiscountPackag
@Select({
"select",
"id, discount_package_id, discount_id, discount_name, num, created_time, updated_time, ",
"`status`, ext_1, ext_2, ext_3",
"id, discount_package_id, discount_id, discount_name, discount_img, num, created_time, ",
"updated_time, `status`, ext_1, ext_2, ext_3",
"from coupon_discount_package_details",
"where id = #{id,jdbcType=INTEGER}"
})
@ -85,6 +86,7 @@ public interface CouponDiscountPackageDetailsMapper extends CouponDiscountPackag
@Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.INTEGER),
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.INTEGER),
@Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_img", property="discountImg", jdbcType=JdbcType.VARCHAR),
@Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
@Result(column="created_time", property="createdTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="updated_time", property="updatedTime", jdbcType=JdbcType.TIMESTAMP),
@ -109,6 +111,7 @@ public interface CouponDiscountPackageDetailsMapper extends CouponDiscountPackag
"set discount_package_id = #{discountPackageId,jdbcType=INTEGER},",
"discount_id = #{discountId,jdbcType=INTEGER},",
"discount_name = #{discountName,jdbcType=VARCHAR},",
"discount_img = #{discountImg,jdbcType=VARCHAR},",
"num = #{num,jdbcType=INTEGER},",
"created_time = #{createdTime,jdbcType=TIMESTAMP},",
"updated_time = #{updatedTime,jdbcType=TIMESTAMP},",

@ -40,6 +40,10 @@ public class CouponDiscountPackageDetailsSqlProvider {
sql.VALUES("discount_name", "#{discountName,jdbcType=VARCHAR}");
}
if (record.getDiscountImg() != null) {
sql.VALUES("discount_img", "#{discountImg,jdbcType=VARCHAR}");
}
if (record.getNum() != null) {
sql.VALUES("num", "#{num,jdbcType=INTEGER}");
}
@ -81,6 +85,7 @@ public class CouponDiscountPackageDetailsSqlProvider {
sql.SELECT("discount_package_id");
sql.SELECT("discount_id");
sql.SELECT("discount_name");
sql.SELECT("discount_img");
sql.SELECT("num");
sql.SELECT("created_time");
sql.SELECT("updated_time");
@ -121,6 +126,10 @@ public class CouponDiscountPackageDetailsSqlProvider {
sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}");
}
if (record.getDiscountImg() != null) {
sql.SET("discount_img = #{record.discountImg,jdbcType=VARCHAR}");
}
if (record.getNum() != null) {
sql.SET("num = #{record.num,jdbcType=INTEGER}");
}
@ -161,6 +170,7 @@ public class CouponDiscountPackageDetailsSqlProvider {
sql.SET("discount_package_id = #{record.discountPackageId,jdbcType=INTEGER}");
sql.SET("discount_id = #{record.discountId,jdbcType=INTEGER}");
sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}");
sql.SET("discount_img = #{record.discountImg,jdbcType=VARCHAR}");
sql.SET("num = #{record.num,jdbcType=INTEGER}");
sql.SET("created_time = #{record.createdTime,jdbcType=TIMESTAMP}");
sql.SET("updated_time = #{record.updatedTime,jdbcType=TIMESTAMP}");
@ -190,6 +200,10 @@ public class CouponDiscountPackageDetailsSqlProvider {
sql.SET("discount_name = #{discountName,jdbcType=VARCHAR}");
}
if (record.getDiscountImg() != null) {
sql.SET("discount_img = #{discountImg,jdbcType=VARCHAR}");
}
if (record.getNum() != null) {
sql.SET("num = #{num,jdbcType=INTEGER}");
}

@ -34,19 +34,19 @@ public interface CouponDiscountPackageMapper extends CouponDiscountPackageMapper
@Delete({
"delete from coupon_discount_package",
"where id = #{id,jdbcType=INTEGER}"
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Integer id);
int deleteByPrimaryKey(Long id);
@Insert({
"insert into coupon_discount_package (`key`, title, ",
"effective_tiem, created_user_id, ",
"effective_time, created_user_id, ",
"created_time, updated_user_id, ",
"updated_time, `status`, ",
"total_stock, surplus_stock, ",
"ext_1, ext_2, ext_3)",
"values (#{key,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, ",
"#{effectiveTiem,jdbcType=TIMESTAMP}, #{createdUserId,jdbcType=INTEGER}, ",
"#{effectiveTime,jdbcType=TIMESTAMP}, #{createdUserId,jdbcType=INTEGER}, ",
"#{createdTime,jdbcType=TIMESTAMP}, #{updatedUserId,jdbcType=INTEGER}, ",
"#{updatedTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{totalStock,jdbcType=INTEGER}, #{surplusStock,jdbcType=INTEGER}, ",
@ -61,10 +61,10 @@ public interface CouponDiscountPackageMapper extends CouponDiscountPackageMapper
@SelectProvider(type=CouponDiscountPackageSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="key", property="key", jdbcType=JdbcType.VARCHAR),
@Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
@Result(column="effective_tiem", property="effectiveTiem", jdbcType=JdbcType.TIMESTAMP),
@Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="created_user_id", property="createdUserId", jdbcType=JdbcType.INTEGER),
@Result(column="created_time", property="createdTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="updated_user_id", property="updatedUserId", jdbcType=JdbcType.INTEGER),
@ -80,16 +80,16 @@ public interface CouponDiscountPackageMapper extends CouponDiscountPackageMapper
@Select({
"select",
"id, `key`, title, effective_tiem, created_user_id, created_time, updated_user_id, ",
"id, `key`, title, effective_time, created_user_id, created_time, updated_user_id, ",
"updated_time, `status`, total_stock, surplus_stock, ext_1, ext_2, ext_3",
"from coupon_discount_package",
"where id = #{id,jdbcType=INTEGER}"
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="key", property="key", jdbcType=JdbcType.VARCHAR),
@Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
@Result(column="effective_tiem", property="effectiveTiem", jdbcType=JdbcType.TIMESTAMP),
@Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="created_user_id", property="createdUserId", jdbcType=JdbcType.INTEGER),
@Result(column="created_time", property="createdTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="updated_user_id", property="updatedUserId", jdbcType=JdbcType.INTEGER),
@ -101,7 +101,7 @@ public interface CouponDiscountPackageMapper extends CouponDiscountPackageMapper
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
CouponDiscountPackage selectByPrimaryKey(Integer id);
CouponDiscountPackage selectByPrimaryKey(Long id);
@UpdateProvider(type=CouponDiscountPackageSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") CouponDiscountPackage record, @Param("example") CouponDiscountPackageExample example);
@ -116,7 +116,7 @@ public interface CouponDiscountPackageMapper extends CouponDiscountPackageMapper
"update coupon_discount_package",
"set `key` = #{key,jdbcType=VARCHAR},",
"title = #{title,jdbcType=VARCHAR},",
"effective_tiem = #{effectiveTiem,jdbcType=TIMESTAMP},",
"effective_time = #{effectiveTime,jdbcType=TIMESTAMP},",
"created_user_id = #{createdUserId,jdbcType=INTEGER},",
"created_time = #{createdTime,jdbcType=TIMESTAMP},",
"updated_user_id = #{updatedUserId,jdbcType=INTEGER},",
@ -127,7 +127,7 @@ public interface CouponDiscountPackageMapper extends CouponDiscountPackageMapper
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=INTEGER}"
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(CouponDiscountPackage record);
}

@ -34,20 +34,20 @@ public interface CouponDiscountPackageRecordMapper extends CouponDiscountPackage
@Delete({
"delete from coupon_discount_package_record",
"where id = #{id,jdbcType=INTEGER}"
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Integer id);
int deleteByPrimaryKey(Long id);
@Insert({
"insert into coupon_discount_package_record (discount_package_title, discount_package_id, ",
"order_id, child_order_id, ",
"record_no, serial_no, ",
"order_id, order_no, ",
"child_order_id, serial_no, ",
"`type`, user_id, user_phone, ",
"created_time, `status`, ",
"ext_1, ext_2, ext_3)",
"values (#{discountPackageTitle,jdbcType=VARCHAR}, #{discountPackageId,jdbcType=INTEGER}, ",
"#{orderId,jdbcType=INTEGER}, #{childOrderId,jdbcType=INTEGER}, ",
"#{recordNo,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR}, ",
"#{orderId,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, ",
"#{childOrderId,jdbcType=INTEGER}, #{serialNo,jdbcType=VARCHAR}, ",
"#{type,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{userPhone,jdbcType=VARCHAR}, ",
"#{createdTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
@ -61,12 +61,12 @@ public interface CouponDiscountPackageRecordMapper extends CouponDiscountPackage
@SelectProvider(type=CouponDiscountPackageRecordSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_package_title", property="discountPackageTitle", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.INTEGER),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.INTEGER),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.INTEGER),
@Result(column="record_no", property="recordNo", jdbcType=JdbcType.VARCHAR),
@Result(column="serial_no", property="serialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
@ -81,19 +81,19 @@ public interface CouponDiscountPackageRecordMapper extends CouponDiscountPackage
@Select({
"select",
"id, discount_package_title, discount_package_id, order_id, child_order_id, record_no, ",
"id, discount_package_title, discount_package_id, order_id, order_no, child_order_id, ",
"serial_no, `type`, user_id, user_phone, created_time, `status`, ext_1, ext_2, ",
"ext_3",
"from coupon_discount_package_record",
"where id = #{id,jdbcType=INTEGER}"
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_package_title", property="discountPackageTitle", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.INTEGER),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.INTEGER),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.INTEGER),
@Result(column="record_no", property="recordNo", jdbcType=JdbcType.VARCHAR),
@Result(column="serial_no", property="serialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
@ -104,7 +104,7 @@ public interface CouponDiscountPackageRecordMapper extends CouponDiscountPackage
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
CouponDiscountPackageRecord selectByPrimaryKey(Integer id);
CouponDiscountPackageRecord selectByPrimaryKey(Long id);
@UpdateProvider(type=CouponDiscountPackageRecordSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") CouponDiscountPackageRecord record, @Param("example") CouponDiscountPackageRecordExample example);
@ -120,8 +120,8 @@ public interface CouponDiscountPackageRecordMapper extends CouponDiscountPackage
"set discount_package_title = #{discountPackageTitle,jdbcType=VARCHAR},",
"discount_package_id = #{discountPackageId,jdbcType=INTEGER},",
"order_id = #{orderId,jdbcType=INTEGER},",
"order_no = #{orderNo,jdbcType=VARCHAR},",
"child_order_id = #{childOrderId,jdbcType=INTEGER},",
"record_no = #{recordNo,jdbcType=VARCHAR},",
"serial_no = #{serialNo,jdbcType=VARCHAR},",
"`type` = #{type,jdbcType=INTEGER},",
"user_id = #{userId,jdbcType=INTEGER},",
@ -131,7 +131,7 @@ public interface CouponDiscountPackageRecordMapper extends CouponDiscountPackage
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=INTEGER}"
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(CouponDiscountPackageRecord record);
}

@ -40,12 +40,12 @@ public class CouponDiscountPackageRecordSqlProvider {
sql.VALUES("order_id", "#{orderId,jdbcType=INTEGER}");
}
if (record.getChildOrderId() != null) {
sql.VALUES("child_order_id", "#{childOrderId,jdbcType=INTEGER}");
if (record.getOrderNo() != null) {
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
}
if (record.getRecordNo() != null) {
sql.VALUES("record_no", "#{recordNo,jdbcType=VARCHAR}");
if (record.getChildOrderId() != null) {
sql.VALUES("child_order_id", "#{childOrderId,jdbcType=INTEGER}");
}
if (record.getSerialNo() != null) {
@ -97,8 +97,8 @@ public class CouponDiscountPackageRecordSqlProvider {
sql.SELECT("discount_package_title");
sql.SELECT("discount_package_id");
sql.SELECT("order_id");
sql.SELECT("order_no");
sql.SELECT("child_order_id");
sql.SELECT("record_no");
sql.SELECT("serial_no");
sql.SELECT("`type`");
sql.SELECT("user_id");
@ -126,7 +126,7 @@ public class CouponDiscountPackageRecordSqlProvider {
sql.UPDATE("coupon_discount_package_record");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=INTEGER}");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getDiscountPackageTitle() != null) {
@ -141,12 +141,12 @@ public class CouponDiscountPackageRecordSqlProvider {
sql.SET("order_id = #{record.orderId,jdbcType=INTEGER}");
}
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{record.childOrderId,jdbcType=INTEGER}");
if (record.getOrderNo() != null) {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
}
if (record.getRecordNo() != null) {
sql.SET("record_no = #{record.recordNo,jdbcType=VARCHAR}");
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{record.childOrderId,jdbcType=INTEGER}");
}
if (record.getSerialNo() != null) {
@ -193,12 +193,12 @@ public class CouponDiscountPackageRecordSqlProvider {
SQL sql = new SQL();
sql.UPDATE("coupon_discount_package_record");
sql.SET("id = #{record.id,jdbcType=INTEGER}");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("discount_package_title = #{record.discountPackageTitle,jdbcType=VARCHAR}");
sql.SET("discount_package_id = #{record.discountPackageId,jdbcType=INTEGER}");
sql.SET("order_id = #{record.orderId,jdbcType=INTEGER}");
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("child_order_id = #{record.childOrderId,jdbcType=INTEGER}");
sql.SET("record_no = #{record.recordNo,jdbcType=VARCHAR}");
sql.SET("serial_no = #{record.serialNo,jdbcType=VARCHAR}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("user_id = #{record.userId,jdbcType=INTEGER}");
@ -230,12 +230,12 @@ public class CouponDiscountPackageRecordSqlProvider {
sql.SET("order_id = #{orderId,jdbcType=INTEGER}");
}
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{childOrderId,jdbcType=INTEGER}");
if (record.getOrderNo() != null) {
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
}
if (record.getRecordNo() != null) {
sql.SET("record_no = #{recordNo,jdbcType=VARCHAR}");
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{childOrderId,jdbcType=INTEGER}");
}
if (record.getSerialNo() != null) {
@ -274,7 +274,7 @@ public class CouponDiscountPackageRecordSqlProvider {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=INTEGER}");
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}

@ -36,8 +36,8 @@ public class CouponDiscountPackageSqlProvider {
sql.VALUES("title", "#{title,jdbcType=VARCHAR}");
}
if (record.getEffectiveTiem() != null) {
sql.VALUES("effective_tiem", "#{effectiveTiem,jdbcType=TIMESTAMP}");
if (record.getEffectiveTime() != null) {
sql.VALUES("effective_time", "#{effectiveTime,jdbcType=TIMESTAMP}");
}
if (record.getCreatedUserId() != null) {
@ -92,7 +92,7 @@ public class CouponDiscountPackageSqlProvider {
}
sql.SELECT("`key`");
sql.SELECT("title");
sql.SELECT("effective_tiem");
sql.SELECT("effective_time");
sql.SELECT("created_user_id");
sql.SELECT("created_time");
sql.SELECT("updated_user_id");
@ -121,7 +121,7 @@ public class CouponDiscountPackageSqlProvider {
sql.UPDATE("coupon_discount_package");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=INTEGER}");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getKey() != null) {
@ -132,8 +132,8 @@ public class CouponDiscountPackageSqlProvider {
sql.SET("title = #{record.title,jdbcType=VARCHAR}");
}
if (record.getEffectiveTiem() != null) {
sql.SET("effective_tiem = #{record.effectiveTiem,jdbcType=TIMESTAMP}");
if (record.getEffectiveTime() != null) {
sql.SET("effective_time = #{record.effectiveTime,jdbcType=TIMESTAMP}");
}
if (record.getCreatedUserId() != null) {
@ -184,10 +184,10 @@ public class CouponDiscountPackageSqlProvider {
SQL sql = new SQL();
sql.UPDATE("coupon_discount_package");
sql.SET("id = #{record.id,jdbcType=INTEGER}");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("`key` = #{record.key,jdbcType=VARCHAR}");
sql.SET("title = #{record.title,jdbcType=VARCHAR}");
sql.SET("effective_tiem = #{record.effectiveTiem,jdbcType=TIMESTAMP}");
sql.SET("effective_time = #{record.effectiveTime,jdbcType=TIMESTAMP}");
sql.SET("created_user_id = #{record.createdUserId,jdbcType=INTEGER}");
sql.SET("created_time = #{record.createdTime,jdbcType=TIMESTAMP}");
sql.SET("updated_user_id = #{record.updatedUserId,jdbcType=INTEGER}");
@ -216,8 +216,8 @@ public class CouponDiscountPackageSqlProvider {
sql.SET("title = #{title,jdbcType=VARCHAR}");
}
if (record.getEffectiveTiem() != null) {
sql.SET("effective_tiem = #{effectiveTiem,jdbcType=TIMESTAMP}");
if (record.getEffectiveTime() != null) {
sql.SET("effective_time = #{effectiveTime,jdbcType=TIMESTAMP}");
}
if (record.getCreatedUserId() != null) {
@ -260,7 +260,7 @@ public class CouponDiscountPackageSqlProvider {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=INTEGER}");
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}

@ -16,7 +16,7 @@ public class CouponDiscountPackage implements Serializable {
/**
* 主键
*/
private Integer id;
private Long id;
/**
* 编码
@ -31,7 +31,7 @@ public class CouponDiscountPackage implements Serializable {
/**
* 有效期
*/
private Date effectiveTiem;
private Date effectiveTime;
/**
* 创建人
@ -85,11 +85,11 @@ public class CouponDiscountPackage implements Serializable {
private static final long serialVersionUID = 1L;
public Integer getId() {
public Long getId() {
return id;
}
public void setId(Integer id) {
public void setId(Long id) {
this.id = id;
}
@ -109,12 +109,12 @@ public class CouponDiscountPackage implements Serializable {
this.title = title;
}
public Date getEffectiveTiem() {
return effectiveTiem;
public Date getEffectiveTime() {
return effectiveTime;
}
public void setEffectiveTiem(Date effectiveTiem) {
this.effectiveTiem = effectiveTiem;
public void setEffectiveTime(Date effectiveTime) {
this.effectiveTime = effectiveTime;
}
public Integer getCreatedUserId() {
@ -212,7 +212,7 @@ public class CouponDiscountPackage implements Serializable {
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getKey() == null ? other.getKey() == null : this.getKey().equals(other.getKey()))
&& (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
&& (this.getEffectiveTiem() == null ? other.getEffectiveTiem() == null : this.getEffectiveTiem().equals(other.getEffectiveTiem()))
&& (this.getEffectiveTime() == null ? other.getEffectiveTime() == null : this.getEffectiveTime().equals(other.getEffectiveTime()))
&& (this.getCreatedUserId() == null ? other.getCreatedUserId() == null : this.getCreatedUserId().equals(other.getCreatedUserId()))
&& (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
&& (this.getUpdatedUserId() == null ? other.getUpdatedUserId() == null : this.getUpdatedUserId().equals(other.getUpdatedUserId()))
@ -232,7 +232,7 @@ public class CouponDiscountPackage implements Serializable {
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getKey() == null) ? 0 : getKey().hashCode());
result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
result = prime * result + ((getEffectiveTiem() == null) ? 0 : getEffectiveTiem().hashCode());
result = prime * result + ((getEffectiveTime() == null) ? 0 : getEffectiveTime().hashCode());
result = prime * result + ((getCreatedUserId() == null) ? 0 : getCreatedUserId().hashCode());
result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
result = prime * result + ((getUpdatedUserId() == null) ? 0 : getUpdatedUserId().hashCode());
@ -255,7 +255,7 @@ public class CouponDiscountPackage implements Serializable {
sb.append(", id=").append(id);
sb.append(", key=").append(key);
sb.append(", title=").append(title);
sb.append(", effectiveTiem=").append(effectiveTiem);
sb.append(", effectiveTime=").append(effectiveTime);
sb.append(", createdUserId=").append(createdUserId);
sb.append(", createdTime=").append(createdTime);
sb.append(", updatedUserId=").append(updatedUserId);

@ -33,6 +33,11 @@ public class CouponDiscountPackageDetails implements Serializable {
*/
private String discountName;
/**
* 优惠券图片
*/
private String discountImg;
/**
* 数量
*/
@ -102,6 +107,14 @@ public class CouponDiscountPackageDetails implements Serializable {
this.discountName = discountName;
}
public String getDiscountImg() {
return discountImg;
}
public void setDiscountImg(String discountImg) {
this.discountImg = discountImg;
}
public Integer getNum() {
return num;
}
@ -174,6 +187,7 @@ public class CouponDiscountPackageDetails implements Serializable {
&& (this.getDiscountPackageId() == null ? other.getDiscountPackageId() == null : this.getDiscountPackageId().equals(other.getDiscountPackageId()))
&& (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId()))
&& (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName()))
&& (this.getDiscountImg() == null ? other.getDiscountImg() == null : this.getDiscountImg().equals(other.getDiscountImg()))
&& (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum()))
&& (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
&& (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime()))
@ -191,6 +205,7 @@ public class CouponDiscountPackageDetails implements Serializable {
result = prime * result + ((getDiscountPackageId() == null) ? 0 : getDiscountPackageId().hashCode());
result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode());
result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode());
result = prime * result + ((getDiscountImg() == null) ? 0 : getDiscountImg().hashCode());
result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode());
result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode());
@ -211,6 +226,7 @@ public class CouponDiscountPackageDetails implements Serializable {
sb.append(", discountPackageId=").append(discountPackageId);
sb.append(", discountId=").append(discountId);
sb.append(", discountName=").append(discountName);
sb.append(", discountImg=").append(discountImg);
sb.append(", num=").append(num);
sb.append(", createdTime=").append(createdTime);
sb.append(", updatedTime=").append(updatedTime);

@ -375,6 +375,76 @@ public class CouponDiscountPackageDetailsExample {
return (Criteria) this;
}
public Criteria andDiscountImgIsNull() {
addCriterion("discount_img is null");
return (Criteria) this;
}
public Criteria andDiscountImgIsNotNull() {
addCriterion("discount_img is not null");
return (Criteria) this;
}
public Criteria andDiscountImgEqualTo(String value) {
addCriterion("discount_img =", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgNotEqualTo(String value) {
addCriterion("discount_img <>", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgGreaterThan(String value) {
addCriterion("discount_img >", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgGreaterThanOrEqualTo(String value) {
addCriterion("discount_img >=", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgLessThan(String value) {
addCriterion("discount_img <", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgLessThanOrEqualTo(String value) {
addCriterion("discount_img <=", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgLike(String value) {
addCriterion("discount_img like", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgNotLike(String value) {
addCriterion("discount_img not like", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgIn(List<String> values) {
addCriterion("discount_img in", values, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgNotIn(List<String> values) {
addCriterion("discount_img not in", values, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgBetween(String value1, String value2) {
addCriterion("discount_img between", value1, value2, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgNotBetween(String value1, String value2) {
addCriterion("discount_img not between", value1, value2, "discountImg");
return (Criteria) this;
}
public Criteria andNumIsNull() {
addCriterion("num is null");
return (Criteria) this;

@ -135,52 +135,52 @@ public class CouponDiscountPackageExample {
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
@ -325,63 +325,63 @@ public class CouponDiscountPackageExample {
return (Criteria) this;
}
public Criteria andEffectiveTiemIsNull() {
addCriterion("effective_tiem is null");
public Criteria andEffectiveTimeIsNull() {
addCriterion("effective_time is null");
return (Criteria) this;
}
public Criteria andEffectiveTiemIsNotNull() {
addCriterion("effective_tiem is not null");
public Criteria andEffectiveTimeIsNotNull() {
addCriterion("effective_time is not null");
return (Criteria) this;
}
public Criteria andEffectiveTiemEqualTo(Date value) {
addCriterion("effective_tiem =", value, "effectiveTiem");
public Criteria andEffectiveTimeEqualTo(Date value) {
addCriterion("effective_time =", value, "effectiveTime");
return (Criteria) this;
}
public Criteria andEffectiveTiemNotEqualTo(Date value) {
addCriterion("effective_tiem <>", value, "effectiveTiem");
public Criteria andEffectiveTimeNotEqualTo(Date value) {
addCriterion("effective_time <>", value, "effectiveTime");
return (Criteria) this;
}
public Criteria andEffectiveTiemGreaterThan(Date value) {
addCriterion("effective_tiem >", value, "effectiveTiem");
public Criteria andEffectiveTimeGreaterThan(Date value) {
addCriterion("effective_time >", value, "effectiveTime");
return (Criteria) this;
}
public Criteria andEffectiveTiemGreaterThanOrEqualTo(Date value) {
addCriterion("effective_tiem >=", value, "effectiveTiem");
public Criteria andEffectiveTimeGreaterThanOrEqualTo(Date value) {
addCriterion("effective_time >=", value, "effectiveTime");
return (Criteria) this;
}
public Criteria andEffectiveTiemLessThan(Date value) {
addCriterion("effective_tiem <", value, "effectiveTiem");
public Criteria andEffectiveTimeLessThan(Date value) {
addCriterion("effective_time <", value, "effectiveTime");
return (Criteria) this;
}
public Criteria andEffectiveTiemLessThanOrEqualTo(Date value) {
addCriterion("effective_tiem <=", value, "effectiveTiem");
public Criteria andEffectiveTimeLessThanOrEqualTo(Date value) {
addCriterion("effective_time <=", value, "effectiveTime");
return (Criteria) this;
}
public Criteria andEffectiveTiemIn(List<Date> values) {
addCriterion("effective_tiem in", values, "effectiveTiem");
public Criteria andEffectiveTimeIn(List<Date> values) {
addCriterion("effective_time in", values, "effectiveTime");
return (Criteria) this;
}
public Criteria andEffectiveTiemNotIn(List<Date> values) {
addCriterion("effective_tiem not in", values, "effectiveTiem");
public Criteria andEffectiveTimeNotIn(List<Date> values) {
addCriterion("effective_time not in", values, "effectiveTime");
return (Criteria) this;
}
public Criteria andEffectiveTiemBetween(Date value1, Date value2) {
addCriterion("effective_tiem between", value1, value2, "effectiveTiem");
public Criteria andEffectiveTimeBetween(Date value1, Date value2) {
addCriterion("effective_time between", value1, value2, "effectiveTime");
return (Criteria) this;
}
public Criteria andEffectiveTiemNotBetween(Date value1, Date value2) {
addCriterion("effective_tiem not between", value1, value2, "effectiveTiem");
public Criteria andEffectiveTimeNotBetween(Date value1, Date value2) {
addCriterion("effective_time not between", value1, value2, "effectiveTime");
return (Criteria) this;
}

@ -16,7 +16,7 @@ public class CouponDiscountPackageRecord implements Serializable {
/**
* 主键
*/
private Integer id;
private Long id;
/**
* 优惠券包名称
@ -34,14 +34,14 @@ public class CouponDiscountPackageRecord implements Serializable {
private Integer orderId;
/**
* 子订单id
* 订单号
*/
private Integer childOrderId;
private String orderNo;
/**
* 记录订单
* 子订单id
*/
private String recordNo;
private Integer childOrderId;
/**
* 记录序号
@ -90,11 +90,11 @@ public class CouponDiscountPackageRecord implements Serializable {
private static final long serialVersionUID = 1L;
public Integer getId() {
public Long getId() {
return id;
}
public void setId(Integer id) {
public void setId(Long id) {
this.id = id;
}
@ -122,20 +122,20 @@ public class CouponDiscountPackageRecord implements Serializable {
this.orderId = orderId;
}
public Integer getChildOrderId() {
return childOrderId;
public String getOrderNo() {
return orderNo;
}
public void setChildOrderId(Integer childOrderId) {
this.childOrderId = childOrderId;
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getRecordNo() {
return recordNo;
public Integer getChildOrderId() {
return childOrderId;
}
public void setRecordNo(String recordNo) {
this.recordNo = recordNo;
public void setChildOrderId(Integer childOrderId) {
this.childOrderId = childOrderId;
}
public String getSerialNo() {
@ -226,8 +226,8 @@ public class CouponDiscountPackageRecord implements Serializable {
&& (this.getDiscountPackageTitle() == null ? other.getDiscountPackageTitle() == null : this.getDiscountPackageTitle().equals(other.getDiscountPackageTitle()))
&& (this.getDiscountPackageId() == null ? other.getDiscountPackageId() == null : this.getDiscountPackageId().equals(other.getDiscountPackageId()))
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getChildOrderId() == null ? other.getChildOrderId() == null : this.getChildOrderId().equals(other.getChildOrderId()))
&& (this.getRecordNo() == null ? other.getRecordNo() == null : this.getRecordNo().equals(other.getRecordNo()))
&& (this.getSerialNo() == null ? other.getSerialNo() == null : this.getSerialNo().equals(other.getSerialNo()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
@ -247,8 +247,8 @@ public class CouponDiscountPackageRecord implements Serializable {
result = prime * result + ((getDiscountPackageTitle() == null) ? 0 : getDiscountPackageTitle().hashCode());
result = prime * result + ((getDiscountPackageId() == null) ? 0 : getDiscountPackageId().hashCode());
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getChildOrderId() == null) ? 0 : getChildOrderId().hashCode());
result = prime * result + ((getRecordNo() == null) ? 0 : getRecordNo().hashCode());
result = prime * result + ((getSerialNo() == null) ? 0 : getSerialNo().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
@ -271,8 +271,8 @@ public class CouponDiscountPackageRecord implements Serializable {
sb.append(", discountPackageTitle=").append(discountPackageTitle);
sb.append(", discountPackageId=").append(discountPackageId);
sb.append(", orderId=").append(orderId);
sb.append(", orderNo=").append(orderNo);
sb.append(", childOrderId=").append(childOrderId);
sb.append(", recordNo=").append(recordNo);
sb.append(", serialNo=").append(serialNo);
sb.append(", type=").append(type);
sb.append(", userId=").append(userId);

@ -135,52 +135,52 @@ public class CouponDiscountPackageRecordExample {
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
@ -375,133 +375,133 @@ public class CouponDiscountPackageRecordExample {
return (Criteria) this;
}
public Criteria andChildOrderIdIsNull() {
addCriterion("child_order_id is null");
public Criteria andOrderNoIsNull() {
addCriterion("order_no is null");
return (Criteria) this;
}
public Criteria andChildOrderIdIsNotNull() {
addCriterion("child_order_id is not null");
public Criteria andOrderNoIsNotNull() {
addCriterion("order_no is not null");
return (Criteria) this;
}
public Criteria andChildOrderIdEqualTo(Integer value) {
addCriterion("child_order_id =", value, "childOrderId");
public Criteria andOrderNoEqualTo(String value) {
addCriterion("order_no =", value, "orderNo");
return (Criteria) this;
}
public Criteria andChildOrderIdNotEqualTo(Integer value) {
addCriterion("child_order_id <>", value, "childOrderId");
public Criteria andOrderNoNotEqualTo(String value) {
addCriterion("order_no <>", value, "orderNo");
return (Criteria) this;
}
public Criteria andChildOrderIdGreaterThan(Integer value) {
addCriterion("child_order_id >", value, "childOrderId");
public Criteria andOrderNoGreaterThan(String value) {
addCriterion("order_no >", value, "orderNo");
return (Criteria) this;
}
public Criteria andChildOrderIdGreaterThanOrEqualTo(Integer value) {
addCriterion("child_order_id >=", value, "childOrderId");
public Criteria andOrderNoGreaterThanOrEqualTo(String value) {
addCriterion("order_no >=", value, "orderNo");
return (Criteria) this;
}
public Criteria andChildOrderIdLessThan(Integer value) {
addCriterion("child_order_id <", value, "childOrderId");
public Criteria andOrderNoLessThan(String value) {
addCriterion("order_no <", value, "orderNo");
return (Criteria) this;
}
public Criteria andChildOrderIdLessThanOrEqualTo(Integer value) {
addCriterion("child_order_id <=", value, "childOrderId");
public Criteria andOrderNoLessThanOrEqualTo(String value) {
addCriterion("order_no <=", value, "orderNo");
return (Criteria) this;
}
public Criteria andChildOrderIdIn(List<Integer> values) {
addCriterion("child_order_id in", values, "childOrderId");
public Criteria andOrderNoLike(String value) {
addCriterion("order_no like", value, "orderNo");
return (Criteria) this;
}
public Criteria andChildOrderIdNotIn(List<Integer> values) {
addCriterion("child_order_id not in", values, "childOrderId");
public Criteria andOrderNoNotLike(String value) {
addCriterion("order_no not like", value, "orderNo");
return (Criteria) this;
}
public Criteria andChildOrderIdBetween(Integer value1, Integer value2) {
addCriterion("child_order_id between", value1, value2, "childOrderId");
public Criteria andOrderNoIn(List<String> values) {
addCriterion("order_no in", values, "orderNo");
return (Criteria) this;
}
public Criteria andChildOrderIdNotBetween(Integer value1, Integer value2) {
addCriterion("child_order_id not between", value1, value2, "childOrderId");
public Criteria andOrderNoNotIn(List<String> values) {
addCriterion("order_no not in", values, "orderNo");
return (Criteria) this;
}
public Criteria andRecordNoIsNull() {
addCriterion("record_no is null");
public Criteria andOrderNoBetween(String value1, String value2) {
addCriterion("order_no between", value1, value2, "orderNo");
return (Criteria) this;
}
public Criteria andRecordNoIsNotNull() {
addCriterion("record_no is not null");
public Criteria andOrderNoNotBetween(String value1, String value2) {
addCriterion("order_no not between", value1, value2, "orderNo");
return (Criteria) this;
}
public Criteria andRecordNoEqualTo(String value) {
addCriterion("record_no =", value, "recordNo");
public Criteria andChildOrderIdIsNull() {
addCriterion("child_order_id is null");
return (Criteria) this;
}
public Criteria andRecordNoNotEqualTo(String value) {
addCriterion("record_no <>", value, "recordNo");
public Criteria andChildOrderIdIsNotNull() {
addCriterion("child_order_id is not null");
return (Criteria) this;
}
public Criteria andRecordNoGreaterThan(String value) {
addCriterion("record_no >", value, "recordNo");
public Criteria andChildOrderIdEqualTo(Integer value) {
addCriterion("child_order_id =", value, "childOrderId");
return (Criteria) this;
}
public Criteria andRecordNoGreaterThanOrEqualTo(String value) {
addCriterion("record_no >=", value, "recordNo");
public Criteria andChildOrderIdNotEqualTo(Integer value) {
addCriterion("child_order_id <>", value, "childOrderId");
return (Criteria) this;
}
public Criteria andRecordNoLessThan(String value) {
addCriterion("record_no <", value, "recordNo");
public Criteria andChildOrderIdGreaterThan(Integer value) {
addCriterion("child_order_id >", value, "childOrderId");
return (Criteria) this;
}
public Criteria andRecordNoLessThanOrEqualTo(String value) {
addCriterion("record_no <=", value, "recordNo");
public Criteria andChildOrderIdGreaterThanOrEqualTo(Integer value) {
addCriterion("child_order_id >=", value, "childOrderId");
return (Criteria) this;
}
public Criteria andRecordNoLike(String value) {
addCriterion("record_no like", value, "recordNo");
public Criteria andChildOrderIdLessThan(Integer value) {
addCriterion("child_order_id <", value, "childOrderId");
return (Criteria) this;
}
public Criteria andRecordNoNotLike(String value) {
addCriterion("record_no not like", value, "recordNo");
public Criteria andChildOrderIdLessThanOrEqualTo(Integer value) {
addCriterion("child_order_id <=", value, "childOrderId");
return (Criteria) this;
}
public Criteria andRecordNoIn(List<String> values) {
addCriterion("record_no in", values, "recordNo");
public Criteria andChildOrderIdIn(List<Integer> values) {
addCriterion("child_order_id in", values, "childOrderId");
return (Criteria) this;
}
public Criteria andRecordNoNotIn(List<String> values) {
addCriterion("record_no not in", values, "recordNo");
public Criteria andChildOrderIdNotIn(List<Integer> values) {
addCriterion("child_order_id not in", values, "childOrderId");
return (Criteria) this;
}
public Criteria andRecordNoBetween(String value1, String value2) {
addCriterion("record_no between", value1, value2, "recordNo");
public Criteria andChildOrderIdBetween(Integer value1, Integer value2) {
addCriterion("child_order_id between", value1, value2, "childOrderId");
return (Criteria) this;
}
public Criteria andRecordNoNotBetween(String value1, String value2) {
addCriterion("record_no not between", value1, value2, "recordNo");
public Criteria andChildOrderIdNotBetween(Integer value1, Integer value2) {
addCriterion("child_order_id not between", value1, value2, "childOrderId");
return (Criteria) this;
}

@ -2,6 +2,8 @@ package com.hfkj.service.discount;
import com.hfkj.entity.CouponDiscount;
import com.hfkj.entity.CouponDiscountPackage;
import com.hfkj.entity.CouponDiscountPackageDetails;
import com.hfkj.entity.CouponDiscountPackageRecord;
import java.util.List;
import java.util.Map;
@ -68,4 +70,47 @@ public interface CouponDiscountPackageService {
*/
List<CouponDiscountPackage> getList(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name getListRecordByMap
* @Description // 根据多条件查询列表
* @Date 15:13 2024/4/19
* @Param map
* @return java.util.List<com.hfkj.entity.CouponDiscountPackageRecord>
*/
List<CouponDiscountPackageRecord> getListRecordByMap(Map<String , Object> map);
void createRecord(CouponDiscountPackageRecord discountPackageRecord);
/**
* @Author Sum1Dream
* @Name create
* @Description // 创建
* @Date 15:11 2024/4/19
* @Param CouponDiscount
* @return void
*/
void createDetail(CouponDiscountPackageDetails discountPackageDetails);
void updateDetail(CouponDiscountPackageDetails discountPackageDetails);
List<CouponDiscountPackageDetails> getDetailList(Integer discountPackageId);
CouponDiscountPackageDetails discountPackageDetail(Integer discountPackageId , Integer discountId);
/**
* @Author Sum1Dream
* @Name delete
* @Description // 修改
* @Date 15:12 2024/4/19
* @Param id
* @return void
*/
void deleteDetail(Integer id);
void giveDiscountPackage(Integer discountPackageId , String phone);
}

@ -2,6 +2,7 @@ package com.hfkj.service.discount;
import com.hfkj.entity.CouponDiscount;
import com.hfkj.entity.CouponDiscountGoodsRel;
import com.hfkj.entity.CouponDiscountPackageDetails;
import java.util.List;
import java.util.Map;
@ -105,6 +106,7 @@ public interface CouponDiscountService {
*/
void deleteDiscountGoodsRel(Long id);
/**
* @Author Sum1Dream
* @Name deleteDiscountGoodsRelDiscountId

@ -0,0 +1,30 @@
package com.hfkj.service.discount;
import com.hfkj.entity.CouponDiscount;
import com.hfkj.entity.CouponDiscountUserRel;
import java.util.List;
import java.util.Map;
public interface CouponDiscountUserRelService {
/**
* @Author Sum1Dream
* @Name create
* @Description // 创建
* @Date 15:11 2024/4/19
* @Param CouponDiscount
* @return void
*/
void create(CouponDiscountUserRel couponDiscountUserRel);
/**
* @Author Sum1Dream
* @Name getList
* @Description // 根据多条件查询列表
* @Date 15:13 2024/4/19
* @Param map
* @return java.util.List<com.hfkj.entity.CouponDiscount>
*/
List<CouponDiscountUserRel> getList(Map<String , Object> map);
}

@ -0,0 +1,230 @@
package com.hfkj.service.discount.impl;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.OrderUtil;
import com.hfkj.dao.CouponDiscountPackageDetailsMapper;
import com.hfkj.dao.CouponDiscountPackageMapper;
import com.hfkj.dao.CouponDiscountPackageRecordMapper;
import com.hfkj.entity.*;
import com.hfkj.service.discount.CouponDiscountPackageService;
import com.hfkj.service.discount.CouponDiscountService;
import com.hfkj.service.discount.CouponDiscountUserRelService;
import com.hfkj.service.user.BsUserService;
import com.hfkj.sysenum.UserStatusEnum;
import io.swagger.models.auth.In;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
@Service("couponDiscountPackageService")
public class CouponDiscountPackageServiceImpl implements CouponDiscountPackageService {
@Resource
private CouponDiscountPackageMapper couponDiscountPackageMapper;
@Resource
private CouponDiscountPackageRecordMapper couponDiscountPackageRecordMapper;
@Resource
private CouponDiscountPackageDetailsMapper couponDiscountPackageDetailsMapper;
@Resource
private CouponDiscountUserRelService discountUserRelService;
@Resource
private BsUserService bsUserService;
@Resource
private CouponDiscountService discountService;
@Override
public void create(CouponDiscountPackage discountPackage) {
couponDiscountPackageMapper.insert(discountPackage);
}
@Override
public void update(CouponDiscountPackage discountPackage) {
couponDiscountPackageMapper.updateByPrimaryKeySelective(discountPackage);
}
@Override
public void delete(Long id, Boolean fullDelete) {
if (fullDelete) {
couponDiscountPackageMapper.deleteByPrimaryKey(id);
} else {
CouponDiscountPackage discountPackage = queryDetail(id);
discountPackage.setStatus(0);
discountPackage.setUpdatedTime(new Date());
update(discountPackage);
}
}
@Override
public CouponDiscountPackage queryDetail(Long id) {
return couponDiscountPackageMapper.selectByPrimaryKey(id);
}
@Override
public CouponDiscountPackage queryDetailByMap(Map<String, Object> map) {
return null;
}
@Override
public List<CouponDiscountPackage> getList(Map<String, Object> map) {
CouponDiscountPackageExample example = new CouponDiscountPackageExample();
CouponDiscountPackageExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(MapUtils.getString(map, "title"))) {
criteria.andTitleLike("%"+MapUtils.getString(map, "title")+"%");
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "key"))) {
criteria.andKeyEqualTo(MapUtils.getString(map, "key"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
} else {
criteria.andStatusNotEqualTo(0);
}
return couponDiscountPackageMapper.selectByExample(example);
}
@Override
public List<CouponDiscountPackageRecord> getListRecordByMap(Map<String, Object> map) {
CouponDiscountPackageRecordExample example = new CouponDiscountPackageRecordExample();
CouponDiscountPackageRecordExample.Criteria criteria = example.createCriteria();
if (MapUtils.getInteger(map, "discountPackageId") != null) {
criteria.andDiscountPackageIdEqualTo(MapUtils.getInteger(map, "discountPackageId"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
} else {
criteria.andStatusNotEqualTo(0);
}
return couponDiscountPackageRecordMapper.selectByExample(example);
}
@Override
public void createRecord(CouponDiscountPackageRecord discountPackageRecord) {
couponDiscountPackageRecordMapper.insert(discountPackageRecord);
}
@Override
public void createDetail(CouponDiscountPackageDetails discountPackageDetails) {
couponDiscountPackageDetailsMapper.insert(discountPackageDetails);
}
@Override
public void updateDetail(CouponDiscountPackageDetails discountPackageDetails) {
couponDiscountPackageDetailsMapper.updateByPrimaryKeySelective(discountPackageDetails);
}
@Override
public List<CouponDiscountPackageDetails> getDetailList(Integer discountPackageId) {
CouponDiscountPackageDetailsExample example = new CouponDiscountPackageDetailsExample();
example.createCriteria().andStatusEqualTo(1).andDiscountPackageIdEqualTo(discountPackageId);
return couponDiscountPackageDetailsMapper.selectByExample(example);
}
@Override
public CouponDiscountPackageDetails discountPackageDetail(Integer discountPackageId , Integer discountId) {
CouponDiscountPackageDetailsExample example = new CouponDiscountPackageDetailsExample();
example.createCriteria().andDiscountPackageIdEqualTo(discountPackageId).andDiscountIdEqualTo(discountId).andStatusEqualTo(1);
List<CouponDiscountPackageDetails> list = couponDiscountPackageDetailsMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override
public void deleteDetail(Integer id) {
couponDiscountPackageDetailsMapper.deleteByPrimaryKey(id);
}
@Override
public void giveDiscountPackage(Integer discountPackageId, String phone) {
CouponDiscountPackage discountPackage = queryDetail(Long.valueOf(discountPackageId));
BsUser bsUser = bsUserService.getUser(phone);
if (bsUser == null) {
bsUser = new BsUser();
bsUser.setPhone(phone);
bsUser.setStatus(UserStatusEnum.status1.getCode());
bsUserService.editData(bsUser);
}
if (discountPackage == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前券包不存在!");
}
CouponDiscountUserRel discountUserRel;
List<CouponDiscountPackageDetails> details = getDetailList(discountPackageId);
for (CouponDiscountPackageDetails detail : details) {
CouponDiscount discount = discountService.queryDetail(Long.valueOf(detail.getDiscountId()));
for (int i = 0; i < detail.getNum(); i++) {
discountUserRel = new CouponDiscountUserRel();
discountUserRel.setDiscountId(Long.valueOf(detail.getDiscountId()));
discountUserRel.setDiscountImg(detail.getDiscountImg());
discountUserRel.setDiscountName(detail.getDiscountName());
discountUserRel.setDiscountCondition(discount.getCondition());
discountUserRel.setDiscountPrice(discount.getPrice());
discountUserRel.setDiscountType(discount.getType());
discountUserRel.setDiscountPercentage(discount.getPercentage());
discountUserRel.setUserId(bsUser.getId());
discountUserRel.setStatus(1);
discountUserRel.setCreateTime(new Date());
// 计算使用有效期
Calendar userEndTime = Calendar.getInstance();
userEndTime.setTime(new Date());
userEndTime.set(Calendar.HOUR_OF_DAY, 23);
userEndTime.set(Calendar.MINUTE, 59);
userEndTime.set(Calendar.SECOND, 59);
userEndTime.add(Calendar.DATE, discount.getEffectiveDay());
if (userEndTime.getTime().compareTo(discount.getSalesEndTime()) > 0) {
discountUserRel.setUseEndTime(discount.getSalesEndTime());
} else {
discountUserRel.setUseEndTime(userEndTime.getTime());
}
discountUserRelService.create(discountUserRel);
}
}
CouponDiscountPackageRecord discountPackageRecord = new CouponDiscountPackageRecord();
discountPackageRecord.setDiscountPackageId(discountPackageId);
discountPackageRecord.setDiscountPackageTitle(discountPackage.getTitle());
discountPackageRecord.setType(2);
discountPackageRecord.setSerialNo(OrderUtil.generateOrderNo());
discountPackageRecord.setUserId(bsUser.getId().intValue());
discountPackageRecord.setUserPhone(bsUser.getPhone());
discountPackageRecord.setCreatedTime(new Date());
discountPackageRecord.setStatus(1);
createRecord(discountPackageRecord);
discountPackage.setSurplusStock(discountPackage.getSurplusStock() - 1);
update(discountPackage);
}
}

@ -98,6 +98,8 @@ public class CouponDiscountServiceImpl implements CouponDiscountService {
couponDiscountGoodsRelMapper.deleteByPrimaryKey(id);
}
@Override
public void deleteDiscountGoodsRelDiscountId(Long discountId) {
CouponDiscountGoodsRelExample example = new CouponDiscountGoodsRelExample();

@ -0,0 +1,46 @@
package com.hfkj.service.discount.impl;
import com.hfkj.dao.CouponDiscountUserRelMapper;
import com.hfkj.entity.CouponDiscountExample;
import com.hfkj.entity.CouponDiscountUserRel;
import com.hfkj.entity.CouponDiscountUserRelExample;
import com.hfkj.service.discount.CouponDiscountUserRelService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@Service("couponDiscountUserRelService")
public class CouponDiscountUserRelServiceImpl implements CouponDiscountUserRelService {
@Resource
private CouponDiscountUserRelMapper couponDiscountUserRelMapper;
@Override
public void create(CouponDiscountUserRel couponDiscountUserRel) {
couponDiscountUserRelMapper.insert(couponDiscountUserRel);
}
@Override
public List<CouponDiscountUserRel> getList(Map<String, Object> map) {
CouponDiscountUserRelExample example = new CouponDiscountUserRelExample();
CouponDiscountUserRelExample.Criteria criteria = example.createCriteria();
if (MapUtils.getInteger(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
}
return couponDiscountUserRelMapper.selectByExample(example);
}
}

@ -41,6 +41,22 @@ public class GoodsUserAddressServiceImpl implements GoodsUserAddressService {
@Override
public GoodsUserAddress queryDetailByMap(Map<String, Object> map) {
GoodsUserAddressExample example = new GoodsUserAddressExample();
GoodsUserAddressExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
}
if (MapUtils.getBoolean(map, "whetherDefault") != null) {
criteria.andWhetherDefaultEqualTo(MapUtils.getBoolean(map, "whetherDefault"));
}
List<GoodsUserAddress> list = goodsUserAddressMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}

Loading…
Cancel
Save