Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/saas' into saas

zouxuan 3 anni fa
parent
commit
936bb042d9

+ 4 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantAssetsInfoDao.java

@@ -2,7 +2,6 @@ package com.ym.mec.biz.dal.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.biz.dal.entity.TenantAssetsInfo;
-import io.swagger.models.auth.In;
 import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
@@ -18,10 +17,9 @@ public interface TenantAssetsInfoDao extends BaseMapper<TenantAssetsInfo> {
 
     int insertBatch(@Param("entities") List<TenantAssetsInfo> entities);
 
-    int deductAmount(BigDecimal deductAmount, Integer tenantId);
+    int deductAmount(@Param("deductAmount") BigDecimal deductAmount, @Param("tenantId") Integer tenantId);
 
-    int checkDeductAmount(BigDecimal deductAmount, Integer tenantId);
-
-    Integer queryPeopleNum(Integer courseId);
-}
+    int checkDeductAmount(@Param("deductAmount") BigDecimal deductAmount, @Param("tenantId") Integer tenantId);
 
+    Integer queryPeopleNum(@Param("courseId") Integer courseId);
+}

+ 33 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysCoupon.java

@@ -8,13 +8,18 @@ import io.swagger.annotations.ApiModelProperty;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import javax.validation.constraints.Max;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PositiveOrZero;
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
 /**
  * 对应数据库表(sys_coupon):
  */
-public class SysCoupon extends BaseEntity {
+public class SysCoupon extends BaseEntity implements Serializable{
 
 	private Integer id;
 
@@ -27,9 +32,19 @@ public class SysCoupon extends BaseEntity {
 	@ApiModelProperty("状态:0停用,1启用")
 	private Integer status;
 
+    @NotNull(message = "请选择一个优惠券发放的类型!")
+    @PositiveOrZero(message = "优惠券发放类型不正确!")
+    @Max(value = 1,message = "优惠券发放类型不正确!")
+    @ApiModelProperty(value = "0手动领取  1手动发放")
+    private Integer issuanceType;
+
 	@ApiModelProperty("券类型:FULL_REDUCTION(满减券),DISCOUNT(折扣券)")
 	private CouponTypeEnum type;
 
+    @NotBlank(message = "优惠券详细分类不能为空!")
+    @ApiModelProperty(value = "详情CouponDetailTypeEnum枚举类")
+    private String typeDetail;
+
 	@ApiModelProperty("面值")
 	private java.math.BigDecimal faceValue;
 
@@ -232,7 +247,23 @@ public class SysCoupon extends BaseEntity {
 		this.updateTime = updateTime;
 	}
 
-	@Override
+    public Integer getIssuanceType() {
+        return issuanceType;
+    }
+
+    public void setIssuanceType(Integer issuanceType) {
+        this.issuanceType = issuanceType;
+    }
+
+    public String getTypeDetail() {
+        return typeDetail;
+    }
+
+    public void setTypeDetail(String typeDetail) {
+        this.typeDetail = typeDetail;
+    }
+
+    @Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 	}

+ 56 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/CouponDetailTypeEnum.java

@@ -0,0 +1,56 @@
+package com.ym.mec.biz.dal.enums;
+
+/**
+ * 优惠券明细类型
+ *
+ * @author hgw
+ * Created by 2021-12-29
+ */
+public enum CouponDetailTypeEnum {
+
+    //商品-其他类型优惠券
+    OTHER("OTHER", "其他"),
+    //乐器
+    MUSICAL("MUSICAL", "乐器"),
+    //乐保
+    MAINTENANCE("MAINTENANCE", "乐保服务"),
+    //辅件
+    ACCESSORIES("ACCESSORIES", "辅件"),
+    //教材
+    TEACHING("TEACHING", "教谱"),
+    //网管课
+    PRACTICE("PRACTICE", "网管课"),
+    //声部课 = 单技课 SINGLE、集训单技课 TRAINING_SINGLE
+    SINGLE("SINGLE,", "声部课"),
+    //合奏课 = 合奏课 MIX、集训合奏课 TRAINING_MIX ,
+    MIX("MIX", "合奏课"),
+    //VIP = vip课 VIP +乐理课 THEORY_COURSE
+    VIP("VIP", "VIP");
+
+    private String code;
+
+    private String msg;
+
+    CouponDetailTypeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public String getCode() {
+        return this.code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+
+}

+ 8 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/SysCouponService.java

@@ -12,12 +12,18 @@ public interface SysCouponService extends BaseService<Integer, SysCoupon> {
     void updateCoupon(SysCoupon sysCoupon);
 
     /**
+     * @param couponId: 优惠券编号
+     * @return void
      * @describe 优惠券低库存警告
      * @author Joburgess
      * @date 2021/9/8 0008
-     * @param couponId: 优惠券编号
-     * @return void
      */
     void stockWarning(Integer couponId, String couponName);
 
+    /**
+     * 新增优惠券
+     *
+     * @param sysCoupon
+     */
+    long add(SysCoupon sysCoupon);
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -4108,7 +4108,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			try {
 				tenantAssetsInfoService.deductAmount(updateList);
 			}catch (Exception e){
-				LOGGER.error("deductAmount  >>>>>>>>>",e);
+				LOGGER.error("deductAmount  >>>>>>>>>",e.getCause());
 			}
 			List<Long> courseIds = updateList.stream().map(CourseSchedule::getId).collect(Collectors.toList());
 			List<CourseSchedule> beMergeCourses = courseScheduleDao.getBeMergeCourseWithMainCourseIds(courseIds);

+ 145 - 97
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysCouponServiceImpl.java

@@ -21,106 +21,154 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.*;
 
 @Service
-public class SysCouponServiceImpl extends BaseServiceImpl<Integer, SysCoupon>  implements SysCouponService {
-	
-	@Autowired
-	private SysCouponDao sysCouponDao;
-	@Autowired
-	private SysMessageService sysMessageService;
+public class SysCouponServiceImpl extends BaseServiceImpl<Integer, SysCoupon> implements SysCouponService {
 
-	@Override
-	public BaseDAO<Integer, SysCoupon> getDAO() {
-		return sysCouponDao;
-	}
+    @Autowired
+    private SysCouponDao sysCouponDao;
+    @Autowired
+    private SysMessageService sysMessageService;
 
-	@Override
-	public PageInfo<SysCoupon> queryPage(SysCouponQueryInfo queryInfo) {
-		PageInfo<SysCoupon> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-		Map<String, Object> params = new HashMap<String, Object>();
-		MapUtil.populateMap(params, queryInfo);
+    @Override
+    public BaseDAO<Integer, SysCoupon> getDAO() {
+        return sysCouponDao;
+    }
 
-		List<SysCoupon> dataList = new ArrayList<>();
-		int count = this.findCount(params);
-		if (count > 0) {
-			pageInfo.setTotal(count);
-			params.put("offset", pageInfo.getOffset());
-			dataList = this.getDAO().queryPage(params);
-		}
-		pageInfo.setRows(dataList);
-		return pageInfo;
-	}
+    @Override
+    public PageInfo<SysCoupon> queryPage(SysCouponQueryInfo queryInfo) {
+        PageInfo<SysCoupon> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<String, Object>();
+        MapUtil.populateMap(params, queryInfo);
 
-	@Override
-	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-	public void updateCoupon(SysCoupon sysCoupon) {
-		SysCoupon oldCoupon = sysCouponDao.lockCoupon(sysCoupon.getId());
-		if(Objects.isNull(oldCoupon)){
-			throw new BizException("优惠券信息不存在");
-		}
-		//如果已经有人领取,则只能修改库存总量与预警值
-		if(oldCoupon.getConsumeNum()>0){
-			if(oldCoupon.getStatus()==0){
-				oldCoupon.setStockCount(sysCoupon.getStockCount());
-				oldCoupon.setWarningStockNum(sysCoupon.getWarningStockNum());
-			}
-			if(oldCoupon.getStockCount()==-1){
-				oldCoupon.setWarningStockNum(-1);
-			}
-			oldCoupon.setStatus(sysCoupon.getStatus());
-			if(oldCoupon.getStockCount()-oldCoupon.getConsumeNum()>oldCoupon.getWarningStockNum()){
-				oldCoupon.setWarningStatus(0);
-			}
-			sysCouponDao.update(oldCoupon);
-		}else{
-			switch (sysCoupon.getType()){
-				case DISCOUNT:
-					if(Objects.isNull(sysCoupon.getFaceValue())){
-						throw new BizException("请指定折扣比例");
-					}
-					sysCoupon.setFullAmount(null);
-					break;
-				case FULL_REDUCTION:
-					if(Objects.isNull(sysCoupon.getFaceValue())){
-						throw new BizException("请指定优惠金额");
-					}
-					if(Objects.isNull(sysCoupon.getFullAmount())){
-						throw new BizException("请指定达标金额");
-					}
-					break;
-				default:
-					throw new BizException("请指定优惠券类型");
-			}
-			switch (sysCoupon.getEffectiveType()){
-				case DAYS:
-					if(Objects.isNull(sysCoupon.getDeadline())){
-						throw new BizException("请指定有效天数");
-					}
-					sysCoupon.setEffectiveStartTime(null);
-					sysCoupon.setEffectiveExpireTime(null);
-					break;
-				case TIME_BUCKET:
-					if(Objects.isNull(sysCoupon.getEffectiveStartTime())||Objects.isNull(sysCoupon.getEffectiveExpireTime())){
-						throw new BizException("请指定有效时间段");
-					}
-					sysCoupon.setDeadline(null);
-					break;
-				default:
-					throw new BizException("请指定有效期类型");
-			}
-			if(sysCoupon.getStockCount()==-1){
-				sysCoupon.setWarningStockNum(-1);
-			}
-			sysCouponDao.update(sysCoupon);
-		}
-	}
+        List<SysCoupon> dataList = new ArrayList<>();
+        int count = this.findCount(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = this.getDAO().queryPage(params);
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+    public void updateCoupon(SysCoupon sysCoupon) {
+        SysCoupon oldCoupon = sysCouponDao.lockCoupon(sysCoupon.getId());
+        if (Objects.isNull(oldCoupon)) {
+            throw new BizException("优惠券信息不存在");
+        }
+        //如果已经有人领取,则只能修改库存总量与预警值
+        if (oldCoupon.getConsumeNum() > 0) {
+            if (oldCoupon.getStatus() == 0) {
+                oldCoupon.setStockCount(sysCoupon.getStockCount());
+                oldCoupon.setWarningStockNum(sysCoupon.getWarningStockNum());
+            }
+            if (oldCoupon.getStockCount() == -1) {
+                oldCoupon.setWarningStockNum(-1);
+            }
+            oldCoupon.setStatus(sysCoupon.getStatus());
+            if (oldCoupon.getStockCount() - oldCoupon.getConsumeNum() > oldCoupon.getWarningStockNum()) {
+                oldCoupon.setWarningStatus(0);
+            }
+            sysCouponDao.update(oldCoupon);
+        } else {
+            switch (sysCoupon.getType()) {
+                case DISCOUNT:
+                    if (Objects.isNull(sysCoupon.getFaceValue())) {
+                        throw new BizException("请指定折扣比例");
+                    }
+                    sysCoupon.setFullAmount(null);
+                    break;
+                case FULL_REDUCTION:
+                    if (Objects.isNull(sysCoupon.getFaceValue())) {
+                        throw new BizException("请指定优惠金额");
+                    }
+                    if (Objects.isNull(sysCoupon.getFullAmount())) {
+                        throw new BizException("请指定达标金额");
+                    }
+                    break;
+                default:
+                    throw new BizException("请指定优惠券类型");
+            }
+            switch (sysCoupon.getEffectiveType()) {
+                case DAYS:
+                    if (Objects.isNull(sysCoupon.getDeadline())) {
+                        throw new BizException("请指定有效天数");
+                    }
+                    sysCoupon.setEffectiveStartTime(null);
+                    sysCoupon.setEffectiveExpireTime(null);
+                    break;
+                case TIME_BUCKET:
+                    if (Objects.isNull(sysCoupon.getEffectiveStartTime()) || Objects.isNull(sysCoupon.getEffectiveExpireTime())) {
+                        throw new BizException("请指定有效时间段");
+                    }
+                    sysCoupon.setDeadline(null);
+                    break;
+                default:
+                    throw new BizException("请指定有效期类型");
+            }
+            if (sysCoupon.getStockCount() == -1) {
+                sysCoupon.setWarningStockNum(-1);
+            }
+            sysCouponDao.update(sysCoupon);
+        }
+    }
+
+    @Async
+    @Override
+    public void stockWarning(Integer couponId, String couponName) {
+        Map<Integer, String> teacherPhoneMap = new HashMap<>();
+        teacherPhoneMap.put(2112251, "13618651329");
+        sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.COUPON_STOCK_WARNING,
+                teacherPhoneMap, null, 0, null, null,
+                couponName);
+    }
+
+    /**
+     * 新增优惠券
+     *
+     * @param sysCoupon
+     */
+    public long add(SysCoupon sysCoupon) {
+        sysCoupon.setStatus(0);
+        sysCoupon.setConsumeNum(0);
+        sysCoupon.setWarningStatus(0);
+        if (Objects.isNull(sysCoupon.getType())) {
+            throw new BizException("请指定优惠券类型");
+        }
+
+        switch (sysCoupon.getType()) {
+            case DISCOUNT:
+                if (Objects.isNull(sysCoupon.getFaceValue())) {
+                    throw new BizException("请指定折扣比例");
+                }
+                break;
+            case FULL_REDUCTION:
+                if (Objects.isNull(sysCoupon.getFaceValue())) {
+                    throw new BizException("请指定优惠金额");
+                }
+                if (Objects.isNull(sysCoupon.getFullAmount())) {
+                    throw new BizException("请指定达标金额");
+                }
+                break;
+            default:
+                throw new BizException("请指定优惠券类型");
+        }
+        switch (sysCoupon.getEffectiveType()) {
+            case DAYS:
+                if (Objects.isNull(sysCoupon.getDeadline())) {
+                    throw new BizException("请指定有效天数");
+                }
+                break;
+            case TIME_BUCKET:
+                if (Objects.isNull(sysCoupon.getEffectiveStartTime()) || Objects.isNull(sysCoupon.getEffectiveExpireTime())) {
+                    throw new BizException("请指定有效时间段");
+                }
+                break;
+            default:
+                throw new BizException("请指定有效期类型");
+        }
+        return sysCouponDao.insert(sysCoupon);
+    }
 
-	@Async
-	@Override
-	public void stockWarning(Integer couponId, String couponName) {
-		Map<Integer, String> teacherPhoneMap = new HashMap<>();
-		teacherPhoneMap.put(2112251, "13618651329");
-		sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.COUPON_STOCK_WARNING,
-				teacherPhoneMap, null, 0, null, null,
-				couponName);
-	}
 }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantAssetsInfoServiceImpl.java

@@ -104,12 +104,14 @@ public class TenantAssetsInfoServiceImpl extends ServiceImpl<TenantAssetsInfoDao
         //校验课程 筛选出线上课
         dto = getOnlineCourse(dto);
         if (CollectionUtils.isEmpty(dto)) {
+            log.info("deductAmount >>>>>>courseData is null {}", dto);
             return;
         }
         //开始扣费
         dto.forEach(course -> {
             log.info("deductAmount >>>>>> {}", course);
             if (Objects.isNull(course.getTenantId())) {
+                log.info("deductAmount getTenantId is null>>>>>> {}", course);
                 return;
             }
             //获取总人数 ,+1算上老师
@@ -134,6 +136,7 @@ public class TenantAssetsInfoServiceImpl extends ServiceImpl<TenantAssetsInfoDao
             BigDecimal coursePrice = minutePrice.multiply(courseDate, new MathContext(2, RoundingMode.HALF_UP));
             //写流水
             insertRecord(course, coursePrice, 1);
+            log.info("deductAmount >>>>>> coursePrice {}  tenantId {}", coursePrice, course.getTenantId());
             //扣余额
             baseMapper.deductAmount(coursePrice, course.getTenantId());
         });
@@ -148,6 +151,7 @@ public class TenantAssetsInfoServiceImpl extends ServiceImpl<TenantAssetsInfoDao
      * @param state       扣费状态 1扣费  3未扣费
      */
     private void insertRecord(CourseSchedule course, BigDecimal coursePrice, Integer state) {
+        log.info("deductAmount  insertRecord >>>>>> {}  coursePrice {} state {}", course, coursePrice, state);
         //写入流水
         TenantCloudCourseRecord record = new TenantCloudCourseRecord();
         record.setCourseId(course.getId().intValue());

+ 6 - 2
mec-biz/src/main/resources/config/mybatis/SysCouponMapper.xml

@@ -11,7 +11,9 @@
 		<result column="name_" property="name" />
 		<result column="description_" property="description" />
 		<result column="status_" property="status" />
+        <result column="issuance_type_" jdbcType="INTEGER" property="issuanceType"/>
 		<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="type_detail_" jdbcType="VARCHAR" property="typeDetail"/>
 		<result column="face_value_" property="faceValue" />
 		<result column="full_amount_" property="fullAmount" />
 		<result column="limit_exchange_num_" property="limitExchangeNum" />
@@ -42,10 +44,12 @@
 
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysCoupon" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sys_coupon (id_,name_,description_,status_,type_,face_value_,full_amount_,limit_exchange_num_,effective_type_,deadline_,
+		INSERT INTO sys_coupon (id_,name_,description_,status_,issuance_type_,type_,type_detail_,face_value_,full_amount_,limit_exchange_num_,effective_type_,deadline_,
 		                        effective_start_time_, effective_expire_time_,end_date_,start_date_,stock_count_,consume_num_,warning_stock_num_,
 		                        create_time_,update_time_,tenant_id_)
-		                        VALUES(#{id},#{name},#{description},#{status},#{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{faceValue},#{fullAmount},#{limitExchangeNum},
+		                        VALUES(#{id},#{name},#{description},#{status},#{issuanceType},
+		                               #{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+		                               #{typeDetail},#{faceValue},#{fullAmount},#{limitExchangeNum},
 		                               #{effectiveType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{deadline},
 		                               #{effectiveStartTime},#{effectiveExpireTime},#{endDate},#{startDate},#{stockCount},#{consumeNum},#{warningStockNum},
 		                               NOW(), NOW(),#{tenantId})

+ 39 - 74
mec-web/src/main/java/com/ym/mec/web/controller/SysCouponController.java

@@ -1,6 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.biz.dal.dao.SysCouponDao;
 import com.ym.mec.biz.dal.entity.SysCoupon;
 import com.ym.mec.biz.dal.page.SysCouponQueryInfo;
 import com.ym.mec.biz.service.SysCouponService;
@@ -14,6 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.Valid;
 import java.util.Objects;
 
 @RequestMapping("sysCoupon")
@@ -21,81 +21,46 @@ import java.util.Objects;
 @RestController
 public class SysCouponController extends BaseController {
 
-	@Autowired
-	private SysCouponService sysCouponService;
-	@Autowired
-	private SysCouponDao sysCouponDao;
+    @Autowired
+    private SysCouponService sysCouponService;
 
-	@ApiOperation("新增")
-	@PostMapping(value = "add")
-	@PreAuthorize("@pcs.hasPermissions('sysCoupon/add')")
-	public HttpResponseResult add(SysCoupon sysCoupon) {
-		sysCoupon.setStatus(0);
-		sysCoupon.setConsumeNum(0);
-		sysCoupon.setWarningStatus(0);
-		if(Objects.isNull(sysCoupon.getType())){
-			return failed("请指定优惠券类型");
-		}
-		switch (sysCoupon.getType()){
-			case DISCOUNT:
-				if(Objects.isNull(sysCoupon.getFaceValue())){
-					return failed("请指定折扣比例");
-				}
-				break;
-			case FULL_REDUCTION:
-				if(Objects.isNull(sysCoupon.getFaceValue())){
-					return failed("请指定优惠金额");
-				}
-				if(Objects.isNull(sysCoupon.getFullAmount())){
-					return failed("请指定达标金额");
-				}
-				break;
-			default:
-				return failed("请指定优惠券类型");
-		}
-		switch (sysCoupon.getEffectiveType()){
-			case DAYS:
-				if(Objects.isNull(sysCoupon.getDeadline())){
-					return failed("请指定有效天数");
-				}
-				break;
-			case TIME_BUCKET:
-				if(Objects.isNull(sysCoupon.getEffectiveStartTime())||Objects.isNull(sysCoupon.getEffectiveExpireTime())){
-					return failed("请指定有效时间段");
-				}
-				break;
-			default:
-				return failed("请指定有效期类型");
-		}
-		return succeed(sysCouponService.insert(sysCoupon));
-	}
+    @ApiOperation("新增")
+    @PostMapping(value = "add")
+//    @PreAuthorize("@pcs.hasPermissions('sysCoupon/add')")
+    public HttpResponseResult add(@Valid SysCoupon sysCoupon) {
+        try {
+            return succeed(sysCouponService.add(sysCoupon));
+        } catch (Exception e) {
+            return failed(e.getMessage());
+        }
+    }
 
-	@ApiOperation("修改")
-	@PostMapping(value = "updateCoupon")
-	@PreAuthorize("@pcs.hasPermissions('sysCoupon/updateCoupon')")
-	public HttpResponseResult updateCoupon(SysCoupon sysCoupon) {
-		sysCouponService.updateCoupon(sysCoupon);
-		return succeed();
-	}
+    @ApiOperation("修改")
+    @PostMapping(value = "updateCoupon")
+    @PreAuthorize("@pcs.hasPermissions('sysCoupon/updateCoupon')")
+    public HttpResponseResult updateCoupon(SysCoupon sysCoupon) {
+        sysCouponService.updateCoupon(sysCoupon);
+        return succeed();
+    }
 
-	@ApiOperation("删除")
-	@PostMapping(value = "delete")
-	@PreAuthorize("@pcs.hasPermissions('sysCoupon/delete')")
-	public HttpResponseResult del(Integer id) {
-		SysCoupon sysCoupon = sysCouponService.get(id);
-		if(Objects.isNull(sysCoupon)){
-			return failed("优惠券信息不存在");
-		}
-		if(sysCoupon.getConsumeNum()>0){
-			return failed("此优惠券已消耗,暂不可删除");
-		}
-		return succeed(sysCouponService.delete(id));
-	}
+    @ApiOperation("删除")
+    @PostMapping(value = "delete")
+    @PreAuthorize("@pcs.hasPermissions('sysCoupon/delete')")
+    public HttpResponseResult del(Integer id) {
+        SysCoupon sysCoupon = sysCouponService.get(id);
+        if (Objects.isNull(sysCoupon)) {
+            return failed("优惠券信息不存在");
+        }
+        if (sysCoupon.getConsumeNum() > 0) {
+            return failed("此优惠券已消耗,暂不可删除");
+        }
+        return succeed(sysCouponService.delete(id));
+    }
 
-	@ApiOperation("分页查询")
-	@RequestMapping(value = "queryPage")
-	@PreAuthorize("@pcs.hasPermissions('sysCoupon/queryPage')")
-	public HttpResponseResult queryPage(SysCouponQueryInfo queryInfo) {
-		return succeed(sysCouponService.queryPage(queryInfo));
-	}
+    @ApiOperation("分页查询")
+    @RequestMapping(value = "queryPage")
+    @PreAuthorize("@pcs.hasPermissions('sysCoupon/queryPage')")
+    public HttpResponseResult queryPage(SysCouponQueryInfo queryInfo) {
+        return succeed(sysCouponService.queryPage(queryInfo));
+    }
 }