mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 会员组
This commit is contained in:
@@ -9,132 +9,138 @@ import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员组对象 member_group
|
||||
*
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public class MemberGroup extends BaseEntity
|
||||
{
|
||||
public class MemberGroup extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 会员组编号 */
|
||||
/**
|
||||
* 会员组编号
|
||||
*/
|
||||
@Excel(name = "会员组编号")
|
||||
private String groupCode;
|
||||
|
||||
/** 运营商id */
|
||||
/**
|
||||
* 运营商id
|
||||
*/
|
||||
@Excel(name = "运营商id")
|
||||
private String merchantId;
|
||||
|
||||
/** 站点id */
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
@Excel(name = "站点id")
|
||||
private String stationId;
|
||||
|
||||
/** 会员组等级 */
|
||||
/**
|
||||
* 会员组等级
|
||||
*/
|
||||
@Excel(name = "会员组等级")
|
||||
private String groupLevel;
|
||||
|
||||
/** 类型(1-服务费折扣,2-电费折扣 ,3-电费和服务费一起折扣) */
|
||||
/**
|
||||
* 类型(1-服务费折扣,2-电费折扣 ,3-电费和服务费一起折扣)
|
||||
*/
|
||||
@Excel(name = "类型", readConverterExp = "1=-服务费折扣,2-电费折扣,,=3-电费和服务费一起折扣")
|
||||
private String groupType;
|
||||
|
||||
/** 折扣率 */
|
||||
/**
|
||||
* 折扣率
|
||||
*/
|
||||
@Excel(name = "折扣率")
|
||||
private BigDecimal discount;
|
||||
|
||||
/** 删除标识(0-正常;1-删除) */
|
||||
/**
|
||||
* 删除标识(0-正常;1-删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setGroupCode(String groupCode)
|
||||
{
|
||||
|
||||
public void setGroupCode(String groupCode) {
|
||||
this.groupCode = groupCode;
|
||||
}
|
||||
|
||||
public String getGroupCode()
|
||||
{
|
||||
public String getGroupCode() {
|
||||
return groupCode;
|
||||
}
|
||||
public void setMerchantId(String merchantId)
|
||||
{
|
||||
|
||||
public void setMerchantId(String merchantId) {
|
||||
this.merchantId = merchantId;
|
||||
}
|
||||
|
||||
public String getMerchantId()
|
||||
{
|
||||
public String getMerchantId() {
|
||||
return merchantId;
|
||||
}
|
||||
public void setStationId(String stationId)
|
||||
{
|
||||
|
||||
public void setStationId(String stationId) {
|
||||
this.stationId = stationId;
|
||||
}
|
||||
|
||||
public String getStationId()
|
||||
{
|
||||
public String getStationId() {
|
||||
return stationId;
|
||||
}
|
||||
public void setGroupLevel(String groupLevel)
|
||||
{
|
||||
|
||||
public void setGroupLevel(String groupLevel) {
|
||||
this.groupLevel = groupLevel;
|
||||
}
|
||||
|
||||
public String getGroupLevel()
|
||||
{
|
||||
public String getGroupLevel() {
|
||||
return groupLevel;
|
||||
}
|
||||
public void setGroupType(String groupType)
|
||||
{
|
||||
|
||||
public void setGroupType(String groupType) {
|
||||
this.groupType = groupType;
|
||||
}
|
||||
|
||||
public String getGroupType()
|
||||
{
|
||||
public String getGroupType() {
|
||||
return groupType;
|
||||
}
|
||||
public void setDiscount(BigDecimal discount)
|
||||
{
|
||||
|
||||
public void setDiscount(BigDecimal discount) {
|
||||
this.discount = discount;
|
||||
}
|
||||
|
||||
public BigDecimal getDiscount()
|
||||
{
|
||||
public BigDecimal getDiscount() {
|
||||
return discount;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
|
||||
.append("id", getId())
|
||||
.append("groupCode", getGroupCode())
|
||||
.append("merchantId", getMerchantId())
|
||||
.append("stationId", getStationId())
|
||||
.append("groupLevel", getGroupLevel())
|
||||
.append("groupType", getGroupType())
|
||||
.append("discount", getDiscount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
.append("id", getId())
|
||||
.append("groupCode", getGroupCode())
|
||||
.append("merchantId", getMerchantId())
|
||||
.append("stationId", getStationId())
|
||||
.append("groupLevel", getGroupLevel())
|
||||
.append("groupType", getGroupType())
|
||||
.append("discount", getDiscount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.MemberGroup;
|
||||
import com.jsowell.pile.vo.web.MemberGroupVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -59,4 +60,6 @@ public interface MemberGroupMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMemberGroupByIds(Long[] ids);
|
||||
|
||||
List<MemberGroupVO> queryMemberGroupList(MemberGroup memberGroup);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.MemberGroup;
|
||||
import com.jsowell.pile.vo.web.MemberGroupVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,7 +27,7 @@ public interface MemberGroupService
|
||||
* @param memberGroup 会员组
|
||||
* @return 会员组集合
|
||||
*/
|
||||
public List<MemberGroup> selectMemberGroupList(MemberGroup memberGroup);
|
||||
public List<MemberGroupVO> selectMemberGroupList(MemberGroup memberGroup);
|
||||
|
||||
/**
|
||||
* 新增会员组
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.id.IdUtils;
|
||||
import com.jsowell.pile.domain.MemberGroup;
|
||||
import com.jsowell.pile.mapper.MemberGroupMapper;
|
||||
import com.jsowell.pile.service.MemberGroupService;
|
||||
import com.jsowell.pile.vo.web.MemberGroupVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -38,8 +42,12 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
||||
* @return 会员组
|
||||
*/
|
||||
@Override
|
||||
public List<MemberGroup> selectMemberGroupList(MemberGroup memberGroup) {
|
||||
return memberGroupMapper.selectMemberGroupList(memberGroup);
|
||||
public List<MemberGroupVO> selectMemberGroupList(MemberGroup memberGroup) {
|
||||
List<MemberGroupVO> resultList = memberGroupMapper.queryMemberGroupList(memberGroup);
|
||||
if (CollectionUtils.isEmpty(resultList)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,10 +58,33 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
||||
*/
|
||||
@Override
|
||||
public int insertMemberGroup(MemberGroup memberGroup) {
|
||||
// 生成编号
|
||||
memberGroup.setGroupCode(generateGroupCode());
|
||||
memberGroup.setCreateTime(DateUtils.getNowDate());
|
||||
return memberGroupMapper.insertMemberGroup(memberGroup);
|
||||
}
|
||||
|
||||
// 生成编号
|
||||
private String generateGroupCode() {
|
||||
while (true) {
|
||||
String groupCode = IdUtils.get16UUID("32");
|
||||
// 通过walletCode查询是否已经存在
|
||||
MemberGroup memberGroup = selectByGroupCode(groupCode);
|
||||
if (memberGroup == null) {
|
||||
return groupCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据会员组编号查询
|
||||
* @param groupCode
|
||||
* @return
|
||||
*/
|
||||
public MemberGroup selectByGroupCode(String groupCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员组
|
||||
*
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.jsowell.pile.vo.web;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class MemberGroupVO {
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 会员组编号
|
||||
*/
|
||||
private String groupCode;
|
||||
|
||||
/**
|
||||
* 运营商id
|
||||
*/
|
||||
private String merchantId;
|
||||
|
||||
/**
|
||||
* 运营商名称
|
||||
*/
|
||||
private String merchantName;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 站点名称
|
||||
*/
|
||||
private String stationName;
|
||||
|
||||
/** 会员组等级 */
|
||||
private String groupLevel;
|
||||
|
||||
/** 类型(1-服务费折扣,2-电费折扣 ,3-电费和服务费一起折扣) */
|
||||
private String groupType;
|
||||
|
||||
/** 折扣率 */
|
||||
private BigDecimal discount;
|
||||
}
|
||||
Reference in New Issue
Block a user