'提交代码'

dev-discount
199901012 4 years ago
parent 3933f99a31
commit 6bea3effaf
  1. 17
      hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java
  2. 7
      hai-service/src/main/java/com/hai/service/HighCouponService.java
  3. 14
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java

@ -109,7 +109,7 @@ public class HighCouponController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, "");
}
String setCouponKey = DateUtil.date2String(new Date(), "yyyyMMddhhmmss") + ((Math.random()*9+1)*10000); //订单号生成 年月日小时分秒 + 5位随机数
String setCouponKey = DateUtil.date2String(new Date(), "yyyyMMddhhmmss"); //订单号生成 年月日小时分秒 + 5位随机数
highCoupon.setCouponKey(setCouponKey);
highCoupon.setCompanyId(merchant.getCompanyId());
highCoupon.setOperatorId(userInfoModel.getSecUser().getId());
@ -255,6 +255,21 @@ public class HighCouponController {
}
}
@RequestMapping(value="/deleteCoupon",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "删除卡卷")
public ResponseData deleteCoupon(@RequestParam(name = "id", required = true) Long id) {
try {
highCouponService.ofShelfCoupon(id);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighCouponController -> deleteCoupon() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getCouponById",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id 查询卡卷")

@ -61,6 +61,13 @@ public interface HighCouponService {
**/
void ofShelfCoupon(Long id);
/**
* @Author 胡锐
* @Description 删除
* @Date 2021/3/22 19:25
**/
void deleteCoupon(Long id);
/**
* @Author 胡锐
* @Description 价格审批结果

@ -186,6 +186,20 @@ public class HighCouponServiceImpl implements HighCouponService {
highGoodsPriceReferService.couponAllInvalidKeepCurrent(coupon.getId());
}
@Override
public void deleteCoupon(Long id) {
HighCouponModel coupon = getCouponById(id);
if (coupon == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, "");
}
//状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回
if (coupon.getStatus() != 1 && coupon.getStatus() != 102) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_UNABLE_UP_SHELF, "");
}
coupon.setStatus(0);
highCouponMapper.updateByPrimaryKey(coupon);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void priceApproveResult(HighApprove highApprove) {

Loading…
Cancel
Save