临时提交
This commit is contained in:
parent
2958d17e19
commit
7255481fc6
smart-switch-service/src/main/java/com/ruoyi/ss
transactionBill/domain/vo
vipLevel/service
smart-switch-web/src/main/java/com/ruoyi/web/controller/app
|
@ -0,0 +1,22 @@
|
|||
package com.ruoyi.ss.transactionBill.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 预存金额VO
|
||||
*/
|
||||
@Data
|
||||
public class PrepayPriceVO {
|
||||
|
||||
@ApiModelProperty("原价")
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
@ApiModelProperty("应付金额")
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@ApiModelProperty("减免金额")
|
||||
private BigDecimal discountAmount;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.ss.vipLevel.service;
|
||||
|
||||
import com.ruoyi.ss.vipLevel.domain.VipLevel;
|
||||
import com.ruoyi.ss.vipLevel.domain.VipLevelVO;
|
||||
|
||||
public interface VipLevelConverter {
|
||||
|
||||
/**
|
||||
* 商户修改会员等级
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
VipLevel toPoByMchEdit(VipLevelVO data);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.ruoyi.ss.vipLevel.service;
|
||||
|
||||
import com.ruoyi.ss.vipLevel.domain.VipLevelVO;
|
||||
|
||||
public interface VipLevelValidator {
|
||||
|
||||
void afterValid(VipLevelVO vo);
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.ruoyi.ss.vipLevel.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.ss.vipLevel.domain.VipLevel;
|
||||
import com.ruoyi.ss.vipLevel.domain.VipLevelVO;
|
||||
import com.ruoyi.ss.vipLevel.service.VipLevelConverter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class VipLevelConverterImpl implements VipLevelConverter {
|
||||
|
||||
@Override
|
||||
public VipLevel toPoByMchEdit(VipLevelVO data) {
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
VipLevel po = new VipLevel();
|
||||
// 商户id
|
||||
po.setMchId(SecurityUtils.getUserId());
|
||||
// 其他数据
|
||||
po.setId(data.getId());
|
||||
po.setPrice(data.getPrice());
|
||||
po.setTime(data.getTime());
|
||||
po.setDescription(data.getDescription());
|
||||
po.setLimitType(data.getLimitType());
|
||||
po.setLimitCount(data.getLimitCount());
|
||||
po.setStatus(data.getStatus());
|
||||
po.setName(data.getName());
|
||||
po.setOriginalPrice(data.getOriginalPrice());
|
||||
po.setLimitTotal(data.getLimitTotal());
|
||||
po.setDiscount(data.getDiscount());
|
||||
po.setStoreId(data.getStoreId());
|
||||
|
||||
return po;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.ss.vipLevel.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.common.utils.ServiceUtil;
|
||||
import com.ruoyi.ss.vipLevel.domain.VipLevelVO;
|
||||
import com.ruoyi.ss.vipLevel.domain.enums.VipLevelLimitType;
|
||||
import com.ruoyi.ss.vipLevel.service.VipLevelValidator;
|
||||
|
||||
@Service
|
||||
public class VipLevelValidatorImpl implements VipLevelValidator {
|
||||
|
||||
@Override
|
||||
public void afterValid(VipLevelVO vo) {
|
||||
ServiceUtil.assertion(vo == null, "VIP等级定价不存在");
|
||||
|
||||
// 判断限制次数是否必填
|
||||
if (!VipLevelLimitType.NONE.getType().equals(vo.getLimitType())) {
|
||||
ServiceUtil.assertion(vo.getLimitCount() == null, "限制次数不能为空");
|
||||
ServiceUtil.assertion(vo.getLimitCount() <= 0, "限制次数不能小于等于0");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.ruoyi.web.controller.app;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.ss.vipLevel.domain.VipLevelQuery;
|
||||
import com.ruoyi.ss.vipLevel.domain.VipLevelVO;
|
||||
import com.ruoyi.ss.vipLevel.domain.enums.VipLevelStatus;
|
||||
import com.ruoyi.ss.vipLevel.service.VipLevelService;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/app/vipLevel")
|
||||
public class AppVipLevelController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private VipLevelService vipLevelService;
|
||||
|
||||
@ApiOperation("查询在售的会员等级列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(VipLevelQuery query) {
|
||||
startPage();
|
||||
query.setStatus(VipLevelStatus.ON_SALE.getStatus());
|
||||
List<VipLevelVO> list = vipLevelService.selectVipLevelList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user