mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-11 10:49:52 +08:00
update 会员组
This commit is contained in:
@@ -0,0 +1,98 @@
|
|||||||
|
package com.jsowell.pile.controller;
|
||||||
|
|
||||||
|
import com.jsowell.common.annotation.Log;
|
||||||
|
import com.jsowell.common.core.controller.BaseController;
|
||||||
|
import com.jsowell.common.core.domain.AjaxResult;
|
||||||
|
import com.jsowell.common.core.page.TableDataInfo;
|
||||||
|
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 org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员组Controller
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2023-12-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/member/memberGroup")
|
||||||
|
public class MemberGroupController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private MemberGroupService memberGroupService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员组列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('member:memberGroup:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(MemberGroup memberGroup)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<MemberGroup> list = memberGroupService.selectMemberGroupList(memberGroup);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出会员组列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('member:memberGroup:export')")
|
||||||
|
@Log(title = "会员组", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, MemberGroup memberGroup)
|
||||||
|
{
|
||||||
|
List<MemberGroup> list = memberGroupService.selectMemberGroupList(memberGroup);
|
||||||
|
ExcelUtil<MemberGroup> util = new ExcelUtil<MemberGroup>(MemberGroup.class);
|
||||||
|
util.exportExcel(response, list, "会员组数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员组详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('member:memberGroup:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(memberGroupService.selectMemberGroupById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员组
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('member:memberGroup:add')")
|
||||||
|
@Log(title = "会员组", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody MemberGroup memberGroup)
|
||||||
|
{
|
||||||
|
return toAjax(memberGroupService.insertMemberGroup(memberGroup));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员组
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('member:memberGroup:edit')")
|
||||||
|
@Log(title = "会员组", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody MemberGroup memberGroup)
|
||||||
|
{
|
||||||
|
return toAjax(memberGroupService.updateMemberGroup(memberGroup));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员组
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('member:memberGroup:remove')")
|
||||||
|
@Log(title = "会员组", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(memberGroupService.deleteMemberGroupByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
package com.jsowell.pile.domain;
|
||||||
|
|
||||||
|
import com.jsowell.common.annotation.Excel;
|
||||||
|
import com.jsowell.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员组对象 member_group
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2023-12-26
|
||||||
|
*/
|
||||||
|
public class MemberGroup extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 会员组编号 */
|
||||||
|
@Excel(name = "会员组编号")
|
||||||
|
private String groupCode;
|
||||||
|
|
||||||
|
/** 运营商id */
|
||||||
|
@Excel(name = "运营商id")
|
||||||
|
private String merchantId;
|
||||||
|
|
||||||
|
/** 站点id */
|
||||||
|
@Excel(name = "站点id")
|
||||||
|
private String stationId;
|
||||||
|
|
||||||
|
/** 会员组等级 */
|
||||||
|
@Excel(name = "会员组等级")
|
||||||
|
private String groupLevel;
|
||||||
|
|
||||||
|
/** 类型(1-服务费折扣,2-电费折扣 ,3-电费和服务费一起折扣) */
|
||||||
|
@Excel(name = "类型", readConverterExp = "1=-服务费折扣,2-电费折扣,,=3-电费和服务费一起折扣")
|
||||||
|
private String groupType;
|
||||||
|
|
||||||
|
/** 折扣率 */
|
||||||
|
@Excel(name = "折扣率")
|
||||||
|
private BigDecimal discount;
|
||||||
|
|
||||||
|
/** 删除标识(0-正常;1-删除) */
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setGroupCode(String groupCode)
|
||||||
|
{
|
||||||
|
this.groupCode = groupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupCode()
|
||||||
|
{
|
||||||
|
return groupCode;
|
||||||
|
}
|
||||||
|
public void setMerchantId(String merchantId)
|
||||||
|
{
|
||||||
|
this.merchantId = merchantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMerchantId()
|
||||||
|
{
|
||||||
|
return merchantId;
|
||||||
|
}
|
||||||
|
public void setStationId(String stationId)
|
||||||
|
{
|
||||||
|
this.stationId = stationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStationId()
|
||||||
|
{
|
||||||
|
return stationId;
|
||||||
|
}
|
||||||
|
public void setGroupLevel(String groupLevel)
|
||||||
|
{
|
||||||
|
this.groupLevel = groupLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupLevel()
|
||||||
|
{
|
||||||
|
return groupLevel;
|
||||||
|
}
|
||||||
|
public void setGroupType(String groupType)
|
||||||
|
{
|
||||||
|
this.groupType = groupType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupType()
|
||||||
|
{
|
||||||
|
return groupType;
|
||||||
|
}
|
||||||
|
public void setDiscount(BigDecimal discount)
|
||||||
|
{
|
||||||
|
this.discount = discount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getDiscount()
|
||||||
|
{
|
||||||
|
return discount;
|
||||||
|
}
|
||||||
|
public void setDelFlag(String delFlag)
|
||||||
|
{
|
||||||
|
this.delFlag = delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.jsowell.pile.mapper;
|
||||||
|
|
||||||
|
import com.jsowell.pile.domain.MemberGroup;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员组Mapper接口
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2023-12-26
|
||||||
|
*/
|
||||||
|
public interface MemberGroupMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询会员组
|
||||||
|
*
|
||||||
|
* @param id 会员组主键
|
||||||
|
* @return 会员组
|
||||||
|
*/
|
||||||
|
public MemberGroup selectMemberGroupById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员组列表
|
||||||
|
*
|
||||||
|
* @param memberGroup 会员组
|
||||||
|
* @return 会员组集合
|
||||||
|
*/
|
||||||
|
public List<MemberGroup> selectMemberGroupList(MemberGroup memberGroup);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员组
|
||||||
|
*
|
||||||
|
* @param memberGroup 会员组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMemberGroup(MemberGroup memberGroup);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员组
|
||||||
|
*
|
||||||
|
* @param memberGroup 会员组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMemberGroup(MemberGroup memberGroup);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员组
|
||||||
|
*
|
||||||
|
* @param id 会员组主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMemberGroupById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员组
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMemberGroupByIds(Long[] ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.jsowell.pile.service;
|
||||||
|
|
||||||
|
import com.jsowell.pile.domain.MemberGroup;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员组Service接口
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2023-12-26
|
||||||
|
*/
|
||||||
|
public interface MemberGroupService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询会员组
|
||||||
|
*
|
||||||
|
* @param id 会员组主键
|
||||||
|
* @return 会员组
|
||||||
|
*/
|
||||||
|
public MemberGroup selectMemberGroupById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员组列表
|
||||||
|
*
|
||||||
|
* @param memberGroup 会员组
|
||||||
|
* @return 会员组集合
|
||||||
|
*/
|
||||||
|
public List<MemberGroup> selectMemberGroupList(MemberGroup memberGroup);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员组
|
||||||
|
*
|
||||||
|
* @param memberGroup 会员组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMemberGroup(MemberGroup memberGroup);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员组
|
||||||
|
*
|
||||||
|
* @param memberGroup 会员组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMemberGroup(MemberGroup memberGroup);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员组
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的会员组主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMemberGroupByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员组信息
|
||||||
|
*
|
||||||
|
* @param id 会员组主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMemberGroupById(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
|
import com.jsowell.common.util.DateUtils;
|
||||||
|
import com.jsowell.pile.domain.MemberGroup;
|
||||||
|
import com.jsowell.pile.mapper.MemberGroupMapper;
|
||||||
|
import com.jsowell.pile.service.MemberGroupService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员组Service业务层处理
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2023-12-26
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MemberGroupServiceImpl implements MemberGroupService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private MemberGroupMapper memberGroupMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员组
|
||||||
|
*
|
||||||
|
* @param id 会员组主键
|
||||||
|
* @return 会员组
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public MemberGroup selectMemberGroupById(Long id)
|
||||||
|
{
|
||||||
|
return memberGroupMapper.selectMemberGroupById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员组列表
|
||||||
|
*
|
||||||
|
* @param memberGroup 会员组
|
||||||
|
* @return 会员组
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<MemberGroup> selectMemberGroupList(MemberGroup memberGroup)
|
||||||
|
{
|
||||||
|
return memberGroupMapper.selectMemberGroupList(memberGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员组
|
||||||
|
*
|
||||||
|
* @param memberGroup 会员组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertMemberGroup(MemberGroup memberGroup)
|
||||||
|
{
|
||||||
|
memberGroup.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return memberGroupMapper.insertMemberGroup(memberGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员组
|
||||||
|
*
|
||||||
|
* @param memberGroup 会员组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateMemberGroup(MemberGroup memberGroup)
|
||||||
|
{
|
||||||
|
memberGroup.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return memberGroupMapper.updateMemberGroup(memberGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员组
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的会员组主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMemberGroupByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return memberGroupMapper.deleteMemberGroupByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员组信息
|
||||||
|
*
|
||||||
|
* @param id 会员组主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMemberGroupById(Long id)
|
||||||
|
{
|
||||||
|
return memberGroupMapper.deleteMemberGroupById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.jsowell.pile.mapper.MemberGroupMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.jsowell.pile.domain.MemberGroup" id="MemberGroupResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="groupCode" column="group_code" />
|
||||||
|
<result property="merchantId" column="merchant_id" />
|
||||||
|
<result property="stationId" column="station_id" />
|
||||||
|
<result property="groupLevel" column="group_level" />
|
||||||
|
<result property="groupType" column="group_type" />
|
||||||
|
<result property="discount" column="discount" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<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
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectMemberGroupList" parameterType="com.jsowell.pile.domain.MemberGroup" resultMap="MemberGroupResult">
|
||||||
|
<include refid="selectMemberGroupVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="groupCode != null and groupCode != ''"> and group_code = #{groupCode}</if>
|
||||||
|
<if test="merchantId != null and merchantId != ''"> and merchant_id = #{merchantId}</if>
|
||||||
|
<if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
|
||||||
|
<if test="groupLevel != null and groupLevel != ''"> and group_level = #{groupLevel}</if>
|
||||||
|
<if test="groupType != null and groupType != ''"> and group_type = #{groupType}</if>
|
||||||
|
<if test="discount != null "> and discount = #{discount}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMemberGroupById" parameterType="Long" resultMap="MemberGroupResult">
|
||||||
|
<include refid="selectMemberGroupVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertMemberGroup" parameterType="com.jsowell.pile.domain.MemberGroup">
|
||||||
|
insert into member_group
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="groupCode != null">group_code,</if>
|
||||||
|
<if test="merchantId != null">merchant_id,</if>
|
||||||
|
<if test="stationId != null">station_id,</if>
|
||||||
|
<if test="groupLevel != null">group_level,</if>
|
||||||
|
<if test="groupType != null">group_type,</if>
|
||||||
|
<if test="discount != null">discount,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="delFlag != null">del_flag,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="groupCode != null">#{groupCode},</if>
|
||||||
|
<if test="merchantId != null">#{merchantId},</if>
|
||||||
|
<if test="stationId != null">#{stationId},</if>
|
||||||
|
<if test="groupLevel != null">#{groupLevel},</if>
|
||||||
|
<if test="groupType != null">#{groupType},</if>
|
||||||
|
<if test="discount != null">#{discount},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateMemberGroup" parameterType="com.jsowell.pile.domain.MemberGroup">
|
||||||
|
update member_group
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="groupCode != null">group_code = #{groupCode},</if>
|
||||||
|
<if test="merchantId != null">merchant_id = #{merchantId},</if>
|
||||||
|
<if test="stationId != null">station_id = #{stationId},</if>
|
||||||
|
<if test="groupLevel != null">group_level = #{groupLevel},</if>
|
||||||
|
<if test="groupType != null">group_type = #{groupType},</if>
|
||||||
|
<if test="discount != null">discount = #{discount},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteMemberGroupById" parameterType="Long">
|
||||||
|
delete from member_group where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMemberGroupByIds" parameterType="String">
|
||||||
|
delete from member_group where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
44
jsowell-ui/src/api/member/memberGroup.js
Normal file
44
jsowell-ui/src/api/member/memberGroup.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询会员组列表
|
||||||
|
export function listMemberGroup(query) {
|
||||||
|
return request({
|
||||||
|
url: '/member/memberGroup/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询会员组详细
|
||||||
|
export function getMemberGroup(id) {
|
||||||
|
return request({
|
||||||
|
url: '/member/memberGroup/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增会员组
|
||||||
|
export function addMemberGroup(data) {
|
||||||
|
return request({
|
||||||
|
url: '/member/memberGroup',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改会员组
|
||||||
|
export function updateMemberGroup(data) {
|
||||||
|
return request({
|
||||||
|
url: '/member/memberGroup',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除会员组
|
||||||
|
export function delMemberGroup(id) {
|
||||||
|
return request({
|
||||||
|
url: '/member/memberGroup/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
312
jsowell-ui/src/views/member/memberGroup/index.vue
Normal file
312
jsowell-ui/src/views/member/memberGroup/index.vue
Normal file
@@ -0,0 +1,312 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="会员组编号" prop="groupCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.groupCode"
|
||||||
|
placeholder="请输入会员组编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="运营商id" prop="merchantId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.merchantId"
|
||||||
|
placeholder="请输入运营商id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="站点id" prop="stationId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.stationId"
|
||||||
|
placeholder="请输入站点id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="会员组等级" prop="groupLevel">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.groupLevel"
|
||||||
|
placeholder="请输入会员组等级"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="折扣率" prop="discount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.discount"
|
||||||
|
placeholder="请输入折扣率"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>-->
|
||||||
|
|
||||||
|
<!-- <el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['member:memberGroup:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['member:memberGroup:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['member:memberGroup:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['member:memberGroup:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>-->
|
||||||
|
|
||||||
|
<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="discount" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['member:memberGroup:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['member:memberGroup:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改会员组对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="会员组编号" prop="groupCode">
|
||||||
|
<el-input v-model="form.groupCode" placeholder="请输入会员组编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="运营商id" prop="merchantId">
|
||||||
|
<el-input v-model="form.merchantId" placeholder="请输入运营商id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="站点id" prop="stationId">
|
||||||
|
<el-input v-model="form.stationId" placeholder="请输入站点id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="会员组等级" prop="groupLevel">
|
||||||
|
<el-input v-model="form.groupLevel" placeholder="请输入会员组等级" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="折扣率" prop="discount">
|
||||||
|
<el-input v-model="form.discount" placeholder="请输入折扣率" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="删除标识" prop="delFlag">
|
||||||
|
<el-input v-model="form.delFlag" placeholder="请输入删除标识" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listMemberGroup, getMemberGroup, delMemberGroup, addMemberGroup, updateMemberGroup } from "@/api/member/memberGroup";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "MemberGroup",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 会员组表格数据
|
||||||
|
memberGroupList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
groupCode: null,
|
||||||
|
merchantId: null,
|
||||||
|
stationId: null,
|
||||||
|
groupLevel: null,
|
||||||
|
groupType: null,
|
||||||
|
discount: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询会员组列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listMemberGroup(this.queryParams).then(response => {
|
||||||
|
this.memberGroupList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
groupCode: null,
|
||||||
|
merchantId: null,
|
||||||
|
stationId: null,
|
||||||
|
groupLevel: null,
|
||||||
|
groupType: null,
|
||||||
|
discount: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
delFlag: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加会员组";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getMemberGroup(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改会员组";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateMemberGroup(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addMemberGroup(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除会员组编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delMemberGroup(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('member/memberGroup/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `memberGroup_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user