mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-08 03:50:13 +08:00
update 会员组
This commit is contained in:
@@ -8,6 +8,7 @@ import com.jsowell.common.enums.BusinessType;
|
||||
import com.jsowell.common.util.poi.ExcelUtil;
|
||||
import com.jsowell.pile.domain.MemberGroup;
|
||||
import com.jsowell.pile.service.MemberGroupService;
|
||||
import com.jsowell.pile.vo.web.MemberGroupVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -34,7 +35,7 @@ public class MemberGroupController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MemberGroup memberGroup) {
|
||||
startPage();
|
||||
List<MemberGroup> list = memberGroupService.selectMemberGroupList(memberGroup);
|
||||
List<MemberGroupVO> list = memberGroupService.selectMemberGroupList(memberGroup);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -45,9 +46,9 @@ public class MemberGroupController extends BaseController {
|
||||
@Log(title = "会员组", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MemberGroup memberGroup) {
|
||||
List<MemberGroup> list = memberGroupService.selectMemberGroupList(memberGroup);
|
||||
List<MemberGroupVO> list = memberGroupService.selectMemberGroupList(memberGroup);
|
||||
ExcelUtil<MemberGroup> util = new ExcelUtil<MemberGroup>(MemberGroup.class);
|
||||
util.exportExcel(response, list, "会员组数据");
|
||||
// util.exportExcel(response, list, "会员组数据");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -18,6 +18,10 @@
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, group_code, merchant_id, station_id, group_level, group_type, discount, create_by, create_time, update_by, update_time, del_flag
|
||||
</sql>
|
||||
|
||||
<sql id="selectMemberGroupVo">
|
||||
select id, group_code, merchant_id, station_id, group_level, group_type, discount, create_by, create_time, update_by, update_time, del_flag from member_group
|
||||
@@ -100,4 +104,21 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="queryMemberGroupList" resultType="com.jsowell.pile.vo.web.MemberGroupVO">
|
||||
select
|
||||
t1.id as id,
|
||||
t1.group_code as groupCode,
|
||||
t1.merchant_id as merchantId,
|
||||
t1.station_id as stationId,
|
||||
t1.group_level as groupLevel,
|
||||
t1.group_type as groupType,
|
||||
t1.discount as discount,
|
||||
t2.merchant_name as merchantName,
|
||||
t3.station_name as stationName
|
||||
from member_group t1
|
||||
left join pile_merchant_info t2 on t1.merchant_id = t2.id
|
||||
left join pile_station_info t3 on t3.id = t1.station_id
|
||||
where t1.del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -95,12 +95,21 @@
|
||||
|
||||
<el-table v-loading="loading" :data="memberGroupList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column label="会员组编号" align="center" prop="groupCode" />
|
||||
<el-table-column label="运营商id" align="center" prop="merchantId" />
|
||||
<el-table-column label="站点id" align="center" prop="stationId" />
|
||||
<el-table-column label="会员组等级" align="center" prop="groupLevel" />
|
||||
<el-table-column label="类型" align="center" prop="groupType" />
|
||||
<!--<el-table-column label="主键" align="center" prop="id" />-->
|
||||
<el-table-column label="集团编号" align="center" prop="groupCode" />
|
||||
<!--<el-table-column label="运营商id" align="center" prop="merchantId" />-->
|
||||
<el-table-column label="运营商名称" align="center" prop="merchantName" />
|
||||
<!--<el-table-column label="站点id" align="center" prop="stationId" />-->
|
||||
<el-table-column label="站点名称" align="center" prop="stationName" />
|
||||
<!--<el-table-column label="会员组等级" align="center" prop="groupLevel" />-->
|
||||
<el-table-column label="类型" align="center" prop="groupType" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.group_type"
|
||||
:value="scope.row.groupType"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="折扣率" align="center" prop="discount" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
@@ -176,8 +185,10 @@ import {getStationListByMerchantId} from "@/api/pile/station";
|
||||
|
||||
export default {
|
||||
name: "MemberGroup",
|
||||
dicts: ["group_type"],
|
||||
data() {
|
||||
return {
|
||||
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
||||
Reference in New Issue
Block a user