修改赠券内容

dev-discount
袁野 3 years ago
parent 090ab4c79d
commit 8a8a61aa9b
  1. 191
      hai-bweb/src/main/java/com/bweb/controller/HighCouponPackageController.java
  2. 28
      hai-service/src/main/java/com/hai/service/HighDiscountPackageDetailsService.java
  3. 13
      hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java
  4. 53
      hai-service/src/main/java/com/hai/service/impl/HighCouponPackageDetailsServiceImpl.java
  5. 57
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageDetailsServiceImpl.java
  6. 34
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java

@ -1,5 +1,6 @@
package com.bweb.controller; package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
@ -11,8 +12,10 @@ import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.service.HighCouponPackageService;
import com.hai.service.HighCouponService; import com.hai.service.HighCouponService;
import com.hai.service.HighDiscountPackageDetailsService;
import com.hai.service.HighDiscountPackageService;
import com.hai.service.HighDiscountService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
@ -47,15 +50,18 @@ public class HighCouponPackageController {
private UserCenter userCenter; private UserCenter userCenter;
@Resource @Resource
private HighCouponPackageService highCouponPackageService; private HighDiscountPackageService highDiscountPackageService;
@Resource @Resource
private HighDiscount highDiscount; private HighDiscountPackageDetailsService highDiscountPackageDetailsService;
@RequestMapping(value = "/getCouponPackageList", method = RequestMethod.GET) @Resource
private HighDiscountService highDiscountService;
@RequestMapping(value = "/getDiscountPackageList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "获取优惠券包列表") @ApiOperation(value = "获取优惠券包列表")
public ResponseData getCouponPackageList(@RequestParam(name = "usingAttribution", required = false) Integer usingAttribution, public ResponseData getDiscountPackageList(@RequestParam(name = "usingAttribution", required = false) Integer usingAttribution,
@RequestParam(name = "title", required = false) String title, @RequestParam(name = "title", required = false) String title,
@RequestParam(name = "salesType", required = false) Integer salesType, @RequestParam(name = "salesType", required = false) Integer salesType,
@RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "status", required = false) Integer status,
@ -75,7 +81,7 @@ public class HighCouponPackageController {
map.put("salesType" , salesType); map.put("salesType" , salesType);
map.put("status" , status); map.put("status" , status);
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highCouponPackageService.getCouponPackageList(map))); return ResponseMsgUtil.success(new PageInfo<>(highDiscountPackageService.getDiscountPackageList(map)));
} catch (Exception e) { } catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e); log.error("HighOrderController --> getUserOrderList() error!", e);
@ -84,25 +90,72 @@ public class HighCouponPackageController {
} }
@RequestMapping(value = "/highCouponPackageInfo", method = RequestMethod.POST) @RequestMapping(value = "/insertCouponPackageInfo", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "新增优惠券包基本信息") @ApiOperation(value = "新增优惠券包基本信息")
public ResponseData highCouponPackageInfo(@RequestBody HighCouponPackage highCouponPackage, HttpServletRequest request) { public ResponseData insertCouponPackageInfo(@RequestBody HighDiscountPackage highDiscountPackage, HttpServletRequest request) {
try {
//发布人员
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (StringUtils.isBlank(highDiscountPackage.getTitle())
|| highDiscountPackage.getUsingAttribution() == null
|| highDiscountPackage.getSalesType() == null
|| highDiscountPackage.getEffectiveTiem() == null
|| highDiscountPackage.getPurchaseNum() == null
|| highDiscountPackage.getPrice() == null
|| StringUtils.isBlank(highDiscountPackage.getBannerImg())
|| StringUtils.isBlank(highDiscountPackage.getListImg())
|| StringUtils.isBlank(highDiscountPackage.getDetailsImg())
) {
log.error("HighAgentController -> insertAgent() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (userInfoModel.getBsCompany() == null) {
log.error("highCouponPackage -> highCouponPackageInfo() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
highDiscountPackage.setCompanyId(userInfoModel.getBsCompany().getId().intValue());
highDiscountPackage.setStatus(3);
highDiscountPackage.setCreatedTime(new Date());
highDiscountPackage.setCreatedUserId(userInfoModel.getSecUser().getId().intValue());
highDiscountPackage.setUpdatedTime(new Date());
highDiscountPackage.setUpdatedUserId(userInfoModel.getSecUser().getId().intValue());
highDiscountPackageService.insertDiscountPackage(highDiscountPackage);
return ResponseMsgUtil.success(highDiscountPackage);
} catch (Exception e) {
log.error("HighAgentController --> insertAgent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/updateCouponPackageInfo", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改优惠券包基本信息")
public ResponseData updateCouponPackageInfo(@RequestBody HighDiscountPackage highDiscountPackage, HttpServletRequest request) {
try { try {
//发布人员 //发布人员
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (StringUtils.isBlank(highCouponPackage.getTitle()) if (StringUtils.isBlank(highDiscountPackage.getTitle())
|| highCouponPackage.getUsingAttribution() == null || highDiscountPackage.getUsingAttribution() == null
|| highCouponPackage.getSalesType() == null || highDiscountPackage.getSalesType() == null
|| highCouponPackage.getEffectiveTiem() == null || highDiscountPackage.getId() == null
|| highCouponPackage.getPurchaseNum() == null || highDiscountPackage.getEffectiveTiem() == null
|| highCouponPackage.getPrice() == null || highDiscountPackage.getPurchaseNum() == null
|| StringUtils.isBlank(highCouponPackage.getBannerImg()) || highDiscountPackage.getPrice() == null
|| StringUtils.isBlank(highCouponPackage.getListImg()) || StringUtils.isBlank(highDiscountPackage.getBannerImg())
|| StringUtils.isBlank(highCouponPackage.getDetailsImg()) || StringUtils.isBlank(highDiscountPackage.getListImg())
|| StringUtils.isBlank(highDiscountPackage.getDetailsImg())
) { ) {
log.error("HighAgentController -> insertAgent() error!","参数错误"); log.error("HighAgentController -> insertAgent() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -113,16 +166,20 @@ public class HighCouponPackageController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
} }
highCouponPackage.setCompanyId(userInfoModel.getBsCompany().getId().intValue()); HighDiscountPackage highDiscountPackages = highDiscountPackageService.findDiscountPackageById(highDiscountPackage.getId());
highCouponPackage.setStatus(3);
highCouponPackage.setCreatedTime(new Date());
highCouponPackage.setCreatedUserId(userInfoModel.getSecUser().getId().intValue());
highCouponPackage.setUpdatedTime(new Date());
highCouponPackage.setUpdatedUserId(userInfoModel.getSecUser().getId().intValue());
highCouponPackageService.insertCouponPackage(highCouponPackage); if (highDiscountPackages == null || highDiscountPackage.getStatus() == 1) {
log.error("highCouponPackage -> highCouponPackageInfo() error!","状态错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, "");
}
return ResponseMsgUtil.success(highCouponPackage); highDiscountPackages.setStatus(3);
highDiscountPackages.setUpdatedTime(new Date());
highDiscountPackages.setUpdatedUserId(userInfoModel.getSecUser().getId().intValue());
highDiscountPackageService.insertDiscountPackage(highDiscountPackage);
return ResponseMsgUtil.success(highDiscountPackage);
} catch (Exception e) { } catch (Exception e) {
log.error("HighAgentController --> insertAgent() error!", e); log.error("HighAgentController --> insertAgent() error!", e);
@ -133,15 +190,15 @@ public class HighCouponPackageController {
@RequestMapping(value = "/highCouponPackageRule", method = RequestMethod.POST) @RequestMapping(value = "/highCouponPackageRule", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "新增优惠券包规则信息") @ApiOperation(value = "新增优惠券包规则信息")
public ResponseData highCouponPackageRule(@RequestBody HighCouponPackageDetails highCouponPackageDetails, HttpServletRequest request) { public ResponseData highCouponPackageRule(@RequestBody HighDiscountPackageDetails highDiscountPackageDetails, HttpServletRequest request) {
try { try {
//发布人员 //发布人员
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if ( highCouponPackageDetails.getCouponPackageId() == null if ( highDiscountPackageDetails.getDiscountPackageId() == null
|| highCouponPackageDetails.getCouponId() == null || highDiscountPackageDetails.getDiscountId() == null
|| highCouponPackageDetails.getNum() == null || highDiscountPackageDetails.getNum() == null
) { ) {
log.error("HighAgentController -> insertAgent() error!","参数错误"); log.error("HighAgentController -> insertAgent() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -152,20 +209,23 @@ public class HighCouponPackageController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
} }
if (highCouponService.getCouponById(highCouponPackageDetails.getCouponId().longValue()) == null) { HighDiscount discount = highDiscountService.getDiscountById(highDiscountPackageDetails.getDiscountId().longValue());
if (discount == null || highDiscountPackageService.findDiscountPackageById(highDiscountPackageDetails.getDiscountPackageId()) == null) {
log.error("highCouponPackage -> highCouponPackageInfo() error!","优惠券 或者 优惠券包不存在");
throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, "优惠券 或者 优惠券包不存在");
} }
highCouponPackage.setCompanyId(userInfoModel.getBsCompany().getId().intValue()); highDiscountPackageDetails.setStatus(1);
highCouponPackage.setStatus(3); highDiscountPackageDetails.setDiscountName(discount.getDiscountName());
highCouponPackage.setCreatedTime(new Date()); highDiscountPackageDetails.setCreatedTime(new Date());
highCouponPackage.setCreatedUserId(userInfoModel.getSecUser().getId().intValue()); highDiscountPackageDetails.setCreatedUserId(userInfoModel.getSecUser().getId().intValue());
highCouponPackage.setUpdatedTime(new Date()); highDiscountPackageDetails.setUpdatedTime(new Date());
highCouponPackage.setUpdatedUserId(userInfoModel.getSecUser().getId().intValue()); highDiscountPackageDetails.setUpdatedUserId(userInfoModel.getSecUser().getId().intValue());
highCouponPackageService.insertCouponPackage(highCouponPackage); highDiscountPackageDetailsService.insertDiscountPackageDetails(highDiscountPackageDetails);
return ResponseMsgUtil.success(highCouponPackage); return ResponseMsgUtil.success(null);
} catch (Exception e) { } catch (Exception e) {
log.error("HighAgentController --> insertAgent() error!", e); log.error("HighAgentController --> insertAgent() error!", e);
@ -173,4 +233,59 @@ public class HighCouponPackageController {
} }
} }
@RequestMapping(value = "/getDiscountPackageRuleList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取优惠券包规则列表")
public ResponseData getDiscountPackageRuleList(@RequestParam(name = "discountPackageId", required = true) Integer discountPackageId,
HttpServletRequest request) {
try {
Map<String,Object> map = new HashMap<>();
//发布人员
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("highCouponPackage -> highCouponPackageInfo() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
map.put("discountPackageId", discountPackageId);
return ResponseMsgUtil.success(highDiscountPackageDetailsService.getDiscountPackageDetailsList(map));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/deleteDiscountPackageRule", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "删除优惠券包规则")
public ResponseData deleteDiscountPackageRule(@RequestBody JSONObject object, HttpServletRequest request) {
try {
Map<String,Object> map = new HashMap<>();
//发布人员
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("highCouponPackage -> highCouponPackageInfo() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
HighDiscountPackageDetails highDiscountPackageDetails = highDiscountPackageDetailsService.findDetailsById(object.getInteger("discountPackageId"));
return ResponseMsgUtil.success(highDiscountPackageDetailsService.getDiscountPackageDetailsList(map));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -1,26 +1,28 @@
package com.hai.service; package com.hai.service;
import com.hai.entity.HighDiscountPackageDetails;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @serviceName HighCouponPackageDetailsService.java * @serviceName HighDiscountPackageDetailsService.java
* @author Sum1Dream * @author Sum1Dream
* @version 1.0.0 * @version 1.0.0
* @Description // 优惠券包详情服务 * @Description // 优惠券包详情服务
* @createTime 3:11 下午 2021/11/25 * @createTime 3:11 下午 2021/11/25
**/ **/
public interface HighCouponPackageDetailsService { public interface HighDiscountPackageDetailsService {
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @name getCouponPackageDetailsList.java * @name getDiscountPackageDetailsList.java
* @Description // 获取优惠券包详情卢列表 * @Description // 获取优惠券包详情卢列表
* @Date 3:35 下午 2021/11/25 * @Date 3:35 下午 2021/11/25
* @Param [java.util.Map<java.lang.String,java.lang.Object>] * @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return java.util.List<com.hai.entity.HighCouponPackageDetails> * @return java.util.List<com.hai.entity.HighDiscountPackageDetails>
*/ */
List<HighCouponPackageDetails> getCouponPackageDetailsList(Map<String , Object> map); List<HighDiscountPackageDetails> getDiscountPackageDetailsList(Map<String , Object> map);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
@ -28,28 +30,28 @@ public interface HighCouponPackageDetailsService {
* @Description // 获取详情 * @Description // 获取详情
* @Date 3:36 下午 2021/11/25 * @Date 3:36 下午 2021/11/25
* @Param [java.lang.Integer] * @Param [java.lang.Integer]
* @return com.hai.entity.HighCouponPackageDetails * @return com.hai.entity.HighDiscountPackageDetails
*/ */
HighCouponPackageDetails findDetailsById(Integer id); HighDiscountPackageDetails findDetailsById(Integer id);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @name insertCouponPackageDetails.java * @name insertDiscountPackageDetails.java
* @Description // 新增优惠券包详情信息 * @Description // 新增优惠券包详情信息
* @Date 12:07 下午 2021/11/25 * @Date 12:07 下午 2021/11/25
* @Param [com.hai.entity.HighCouponPackage] * @Param [com.hai.entity.HighDiscountPackage]
* @return void * @return void
*/ */
void insertCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails); void insertDiscountPackageDetails(HighDiscountPackageDetails highDiscountPackageDetails);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @name updateCouponPackageDetails.java * @name updateDiscountPackageDetails.java
* @Description // 更新优惠券包详情信息 * @Description // 更新优惠券包详情信息
* @Date 12:07 下午 2021/11/25 * @Date 12:07 下午 2021/11/25
* @Param [com.hai.entity.HighCouponPackage] * @Param [com.hai.entity.HighDiscountPackage]
* @return void * @return void
*/ */
void updateCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails); void updateDiscountPackageDetails(HighDiscountPackageDetails highDiscountPackageDetails);
} }

@ -1,5 +1,8 @@
package com.hai.service; package com.hai.service;
import com.hai.entity.HighDiscount;
import com.hai.entity.HighDiscountPackage;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -10,7 +13,7 @@ import java.util.Map;
* @Description // 优惠券包接口服务 * @Description // 优惠券包接口服务
* @createTime 11:31 上午 2021/11/25 * @createTime 11:31 上午 2021/11/25
**/ **/
public interface HighCouponPackageService { public interface HighDiscountPackageService {
/** /**
* @Author Sum1Dream * @Author Sum1Dream
@ -20,7 +23,7 @@ public interface HighCouponPackageService {
* @Param [java.util.Map<java.lang.String,java.lang.Object>] * @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return java.util.List<com.hai.entity.HighCouponPackage> * @return java.util.List<com.hai.entity.HighCouponPackage>
*/ */
List<HighCouponPackage> getCouponPackageList(Map<String , Object> map); List<HighDiscountPackage> getDiscountPackageList(Map<String , Object> map);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
@ -30,7 +33,7 @@ public interface HighCouponPackageService {
* @Param [java.lang.Integer] * @Param [java.lang.Integer]
* @return com.hai.entity.HighCouponPackage * @return com.hai.entity.HighCouponPackage
*/ */
HighCouponPackage findCouponPackageById(Integer id); HighDiscountPackage findDiscountPackageById(Integer id);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
@ -40,7 +43,7 @@ public interface HighCouponPackageService {
* @Param [com.hai.entity.HighCouponPackage] * @Param [com.hai.entity.HighCouponPackage]
* @return void * @return void
*/ */
void insertCouponPackage(HighCouponPackage highCouponPackage); void insertDiscountPackage(HighDiscountPackage highDiscountPackage);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
@ -50,7 +53,7 @@ public interface HighCouponPackageService {
* @Param [com.hai.entity.HighCouponPackage] * @Param [com.hai.entity.HighCouponPackage]
* @return void * @return void
*/ */
void updateCouponPackage(HighCouponPackage highCouponPackage); void updateDiscountPackage(HighDiscountPackage highDiscountPackage);
} }

@ -1,53 +0,0 @@
package com.hai.service.impl;
import com.hai.service.HighCouponPackageDetailsService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @serviceName HighCouponPackageDetailsServiceImpl.java
* @author Sum1Dream
* @version 1.0.0
* @Description // 优惠券详情服务
* @createTime 3:38 下午 2021/11/25
**/
@Service("highCouponPackageDetailsService")
public class HighCouponPackageDetailsServiceImpl implements HighCouponPackageDetailsService {
@Resource
private HighCouponPackageDetailsMapper highCouponPackageDetailsMapper;
@Override
public List<HighCouponPackageDetails> getCouponPackageDetailsList(Map<String, Object> map) {
HighCouponPackageDetailsExample example = new HighCouponPackageDetailsExample();
HighCouponPackageDetailsExample.Criteria criteria = example.createCriteria();
if (MapUtils.getInteger(map, "couponPackageId") != null) {
criteria.andCouponPackageIdEqualTo(MapUtils.getInteger(map, "couponPackageId"));
}
criteria.andStatusEqualTo(1);
return highCouponPackageDetailsMapper.selectByExample(example);
}
@Override
public HighCouponPackageDetails findDetailsById(Integer id) {
return highCouponPackageDetailsMapper.selectByPrimaryKey(id);
}
@Override
public void insertCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails) {
highCouponPackageDetailsMapper.insert(highCouponPackageDetails);
}
@Override
public void updateCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails) {
highCouponPackageDetailsMapper.updateByPrimaryKey(highCouponPackageDetails);
}
}

@ -0,0 +1,57 @@
package com.hai.service.impl;
import com.hai.dao.HighDiscountPackageDetailsMapper;
import com.hai.entity.HighDiscountPackage;
import com.hai.entity.HighDiscountPackageDetails;
import com.hai.entity.HighDiscountPackageDetailsExample;
import com.hai.service.HighDiscountPackageDetailsService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @serviceName HighDiscountPackageDetailsServiceImpl.java
* @author Sum1Dream
* @version 1.0.0
* @Description // 优惠券详情服务
* @createTime 3:38 下午 2021/11/25
**/
@Service("highDiscountPackageDetailsService")
public class HighDiscountPackageDetailsServiceImpl implements HighDiscountPackageDetailsService {
@Resource
private HighDiscountPackageDetailsMapper highDiscountPackageDetailsMapper;
@Override
public List<HighDiscountPackageDetails> getDiscountPackageDetailsList(Map<String, Object> map) {
HighDiscountPackageDetailsExample example = new HighDiscountPackageDetailsExample();
HighDiscountPackageDetailsExample.Criteria criteria = example.createCriteria();
if (MapUtils.getInteger(map, "DiscountPackageId") != null) {
criteria.andDiscountPackageIdEqualTo(MapUtils.getInteger(map, "DiscountPackageId"));
}
criteria.andStatusEqualTo(1);
return highDiscountPackageDetailsMapper.selectByExample(example);
}
@Override
public HighDiscountPackageDetails findDetailsById(Integer id) {
return highDiscountPackageDetailsMapper.selectByPrimaryKey(id);
}
@Override
public void insertDiscountPackageDetails(HighDiscountPackageDetails highDiscountPackageDetails) {
highDiscountPackageDetailsMapper.insert(highDiscountPackageDetails);
}
@Override
public void updateDiscountPackageDetails(HighDiscountPackageDetails highDiscountPackageDetails) {
highDiscountPackageDetailsMapper.updateByPrimaryKey(highDiscountPackageDetails);
}
}

@ -1,6 +1,10 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.hai.service.HighCouponPackageService; import com.hai.dao.HighDiscountPackageMapper;
import com.hai.entity.HighDiscountPackage;
import com.hai.entity.HighDiscountPackageExample;
import com.hai.service.HighDiscountPackageService;
import com.hai.service.HighDiscountPackageService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -9,23 +13,23 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @serviceName HighCouponPackageServiceImpl.java * @serviceName HighDiscountPackageServiceImpl.java
* @author Sum1Dream * @author Sum1Dream
* @version 1.0.0 * @version 1.0.0
* @Description // 优惠券包 接口 * @Description // 优惠券包 接口
* @createTime 12:21 下午 2021/11/25 * @createTime 12:21 下午 2021/11/25
**/ **/
@Service("highCouponPackageService") @Service("highDiscountPackageService")
public class HighCouponPackageServiceImpl implements HighCouponPackageService { public class HighDiscountPackageServiceImpl implements HighDiscountPackageService {
@Resource @Resource
private HighCouponPackageMapper highCouponPackageMapper; private HighDiscountPackageMapper highDiscountPackageMapper;
@Override @Override
public List<HighCouponPackage> getCouponPackageList(Map<String, Object> map) { public List<HighDiscountPackage> getDiscountPackageList(Map<String, Object> map) {
HighCouponPackageExample example = new HighCouponPackageExample(); HighDiscountPackageExample example = new HighDiscountPackageExample();
HighCouponPackageExample.Criteria criteria = example.createCriteria(); HighDiscountPackageExample.Criteria criteria = example.createCriteria();
if (MapUtils.getInteger(map, "companyId") != null) { if (MapUtils.getInteger(map, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getInteger(map, "companyId")); criteria.andCompanyIdEqualTo(MapUtils.getInteger(map, "companyId"));
@ -51,21 +55,21 @@ public class HighCouponPackageServiceImpl implements HighCouponPackageService {
example.setOrderByClause("created_time desc"); example.setOrderByClause("created_time desc");
return highCouponPackageMapper.selectByExample(example); return highDiscountPackageMapper.selectByExample(example);
} }
@Override @Override
public HighCouponPackage findCouponPackageById(Integer id) { public HighDiscountPackage findDiscountPackageById(Integer id) {
return highCouponPackageMapper.selectByPrimaryKey(id); return highDiscountPackageMapper.selectByPrimaryKey(id);
} }
@Override @Override
public void insertCouponPackage(HighCouponPackage highCouponPackage) { public void insertDiscountPackage(HighDiscountPackage highDiscountPackage) {
highCouponPackageMapper.insert(highCouponPackage); highDiscountPackageMapper.insert(highDiscountPackage);
} }
@Override @Override
public void updateCouponPackage(HighCouponPackage highCouponPackage) { public void updateDiscountPackage(HighDiscountPackage highDiscountPackage) {
highCouponPackageMapper.updateByPrimaryKey(highCouponPackage); highDiscountPackageMapper.updateByPrimaryKey(highDiscountPackage);
} }
} }
Loading…
Cancel
Save