新增 运营商--分润会员对应关系表、实体、Service

This commit is contained in:
Lemon
2024-09-13 10:43:43 +08:00
parent 554d29e727
commit 150354941c
18 changed files with 984 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
package com.jsowell.web.controller.pile;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jsowell.common.annotation.Log;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.pile.domain.shareprofit.ShareprofitGroup;
import com.jsowell.pile.service.IShareprofitGroupService;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.common.core.page.TableDataInfo;
/**
* 运营商分润组Controller
*
* @author jsowell
* @date 2024-09-12
*/
@RestController
@RequestMapping("/pile/shareprofitGroup")
public class ShareprofitGroupController extends BaseController {
@Autowired
private IShareprofitGroupService shareprofitGroupService;
/**
* 查询运营商分润组列表
*/
@PreAuthorize("@ss.hasPermi('pile:shareprofitGroup:list')")
@GetMapping("/list")
public TableDataInfo list(ShareprofitGroup shareprofitGroup) {
startPage();
List<ShareprofitGroup> list = shareprofitGroupService.selectShareprofitGroupList(shareprofitGroup);
return getDataTable(list);
}
/**
* 导出运营商分润组列表
*/
@PreAuthorize("@ss.hasPermi('pile:shareprofitGroup:export')")
@Log(title = "运营商分润组", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ShareprofitGroup shareprofitGroup) {
List<ShareprofitGroup> list = shareprofitGroupService.selectShareprofitGroupList(shareprofitGroup);
ExcelUtil<ShareprofitGroup> util = new ExcelUtil<ShareprofitGroup>(ShareprofitGroup.class);
util.exportExcel(response, list, "运营商分润组数据");
}
/**
* 获取运营商分润组详细信息
*/
@PreAuthorize("@ss.hasPermi('pile:shareprofitGroup:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(shareprofitGroupService.selectShareprofitGroupById(id));
}
/**
* 新增运营商分润组
*/
@PreAuthorize("@ss.hasPermi('pile:shareprofitGroup:add')")
@Log(title = "运营商分润组", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ShareprofitGroup shareprofitGroup) {
return toAjax(shareprofitGroupService.insertShareprofitGroup(shareprofitGroup));
}
/**
* 修改运营商分润组
*/
@PreAuthorize("@ss.hasPermi('pile:shareprofitGroup:edit')")
@Log(title = "运营商分润组", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ShareprofitGroup shareprofitGroup) {
return toAjax(shareprofitGroupService.updateShareprofitGroup(shareprofitGroup));
}
/**
* 删除运营商分润组
*/
@PreAuthorize("@ss.hasPermi('pile:shareprofitGroup:remove')")
@Log(title = "运营商分润组", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(shareprofitGroupService.deleteShareprofitGroupByIds(ids));
}
}

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-admin</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-admin/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-common</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-common/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-framework</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-framework/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-generator</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-generator/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-netty</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-netty/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,67 @@
package com.jsowell.pile.domain.shareprofit;
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;
/**
* 运营商--分润人关系对象 shareprofit_merchant_member_relation
*
* @author jsowell
* @date 2024-09-12
*/
public class ShareprofitMerchantMemberRelation extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 运营商id
*/
@Excel(name = "运营商id")
private Long merchantId;
/**
* 分润人电话号码
*/
@Excel(name = "分润人电话号码")
private String memberPhoneNumber;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setMerchantId(Long merchantId) {
this.merchantId = merchantId;
}
public Long getMerchantId() {
return merchantId;
}
public void setMemberPhoneNumber(String memberPhoneNumber) {
this.memberPhoneNumber = memberPhoneNumber;
}
public String getMemberPhoneNumber() {
return memberPhoneNumber;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
.append("id", getId())
.append("merchantId", getMerchantId())
.append("memberPhoneNumber", getMemberPhoneNumber())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@@ -0,0 +1,63 @@
package com.jsowell.pile.mapper;
import java.util.List;
import com.jsowell.pile.domain.shareprofit.ShareprofitMerchantMemberRelation;
import org.springframework.stereotype.Repository;
/**
* 运营商--分润人关系Mapper接口
*
* @author jsowell
* @date 2024-09-12
*/
@Repository
public interface ShareprofitMerchantMemberRelationMapper {
/**
* 查询运营商--分润人关系
*
* @param id 运营商--分润人关系主键
* @return 运营商--分润人关系
*/
public ShareprofitMerchantMemberRelation selectShareprofitMerchantMemberRelationById(Long id);
/**
* 查询运营商--分润人关系列表
*
* @param shareprofitMerchantMemberRelation 运营商--分润人关系
* @return 运营商--分润人关系集合
*/
public List<ShareprofitMerchantMemberRelation> selectShareprofitMerchantMemberRelationList(ShareprofitMerchantMemberRelation shareprofitMerchantMemberRelation);
/**
* 新增运营商--分润人关系
*
* @param shareprofitMerchantMemberRelation 运营商--分润人关系
* @return 结果
*/
public int insertShareprofitMerchantMemberRelation(ShareprofitMerchantMemberRelation shareprofitMerchantMemberRelation);
/**
* 修改运营商--分润人关系
*
* @param shareprofitMerchantMemberRelation 运营商--分润人关系
* @return 结果
*/
public int updateShareprofitMerchantMemberRelation(ShareprofitMerchantMemberRelation shareprofitMerchantMemberRelation);
/**
* 删除运营商--分润人关系
*
* @param id 运营商--分润人关系主键
* @return 结果
*/
public int deleteShareprofitMerchantMemberRelationById(Long id);
/**
* 批量删除运营商--分润人关系
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteShareprofitMerchantMemberRelationByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.shareprofit.ShareprofitMerchantMemberRelation;
/**
* 运营商--分润人关系Service接口
*
* @author jsowell
* @date 2024-09-12
*/
public interface IShareprofitMerchantMemberRelationService {
/**
* 查询运营商--分润人关系
*
* @param id 运营商--分润人关系主键
* @return 运营商--分润人关系
*/
public ShareprofitMerchantMemberRelation selectShareprofitMerchantMemberRelationById(Long id);
/**
* 查询运营商--分润人关系列表
*
* @param shareprofitMerchantMemberRelation 运营商--分润人关系
* @return 运营商--分润人关系集合
*/
public List<ShareprofitMerchantMemberRelation> selectShareprofitMerchantMemberRelationList(ShareprofitMerchantMemberRelation shareprofitMerchantMemberRelation);
/**
* 新增运营商--分润人关系
*
* @param shareprofitMerchantMemberRelation 运营商--分润人关系
* @return 结果
*/
public int insertShareprofitMerchantMemberRelation(ShareprofitMerchantMemberRelation shareprofitMerchantMemberRelation);
/**
* 修改运营商--分润人关系
*
* @param shareprofitMerchantMemberRelation 运营商--分润人关系
* @return 结果
*/
public int updateShareprofitMerchantMemberRelation(ShareprofitMerchantMemberRelation shareprofitMerchantMemberRelation);
/**
* 批量删除运营商--分润人关系
*
* @param ids 需要删除的运营商--分润人关系主键集合
* @return 结果
*/
public int deleteShareprofitMerchantMemberRelationByIds(Long[] ids);
/**
* 删除运营商--分润人关系信息
*
* @param id 运营商--分润人关系主键
* @return 结果
*/
public int deleteShareprofitMerchantMemberRelationById(Long id);
}

View File

@@ -0,0 +1,89 @@
package com.jsowell.pile.service.impl;
import java.util.List;
import com.jsowell.common.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jsowell.pile.mapper.ShareprofitMerchantMemberRelationMapper;
import com.jsowell.pile.domain.shareprofit.ShareprofitMerchantMemberRelation;
import com.jsowell.pile.service.IShareprofitMerchantMemberRelationService;
/**
* 运营商--分润人关系Service业务层处理
*
* @author jsowell
* @date 2024-09-12
*/
@Service
public class ShareprofitMerchantMemberRelationServiceImpl implements IShareprofitMerchantMemberRelationService {
@Autowired
private ShareprofitMerchantMemberRelationMapper shareprofitMerchantMemberRelationMapper;
/**
* 查询运营商--分润人关系
*
* @param id 运营商--分润人关系主键
* @return 运营商--分润人关系
*/
@Override
public ShareprofitMerchantMemberRelation selectShareprofitMerchantMemberRelationById(Long id) {
return shareprofitMerchantMemberRelationMapper.selectShareprofitMerchantMemberRelationById(id);
}
/**
* 查询运营商--分润人关系列表
*
* @param shareprofitMerchantMemberRelation 运营商--分润人关系
* @return 运营商--分润人关系
*/
@Override
public List<ShareprofitMerchantMemberRelation> selectShareprofitMerchantMemberRelationList(ShareprofitMerchantMemberRelation shareprofitMerchantMemberRelation) {
return shareprofitMerchantMemberRelationMapper.selectShareprofitMerchantMemberRelationList(shareprofitMerchantMemberRelation);
}
/**
* 新增运营商--分润人关系
*
* @param shareprofitMerchantMemberRelation 运营商--分润人关系
* @return 结果
*/
@Override
public int insertShareprofitMerchantMemberRelation(ShareprofitMerchantMemberRelation shareprofitMerchantMemberRelation) {
shareprofitMerchantMemberRelation.setCreateTime(DateUtils.getNowDate());
return shareprofitMerchantMemberRelationMapper.insertShareprofitMerchantMemberRelation(shareprofitMerchantMemberRelation);
}
/**
* 修改运营商--分润人关系
*
* @param shareprofitMerchantMemberRelation 运营商--分润人关系
* @return 结果
*/
@Override
public int updateShareprofitMerchantMemberRelation(ShareprofitMerchantMemberRelation shareprofitMerchantMemberRelation) {
return shareprofitMerchantMemberRelationMapper.updateShareprofitMerchantMemberRelation(shareprofitMerchantMemberRelation);
}
/**
* 批量删除运营商--分润人关系
*
* @param ids 需要删除的运营商--分润人关系主键
* @return 结果
*/
@Override
public int deleteShareprofitMerchantMemberRelationByIds(Long[] ids) {
return shareprofitMerchantMemberRelationMapper.deleteShareprofitMerchantMemberRelationByIds(ids);
}
/**
* 删除运营商--分润人关系信息
*
* @param id 运营商--分润人关系主键
* @return 结果
*/
@Override
public int deleteShareprofitMerchantMemberRelationById(Long id) {
return shareprofitMerchantMemberRelationMapper.deleteShareprofitMerchantMemberRelationById(id);
}
}

View File

@@ -0,0 +1,65 @@
<?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.ShareprofitMerchantMemberRelationMapper">
<resultMap type="com.jsowell.pile.domain.shareprofit.ShareprofitMerchantMemberRelation" id="ShareprofitMerchantMemberRelationResult">
<result property="id" column="id" />
<result property="merchantId" column="merchant_id" />
<result property="memberPhoneNumber" column="member_phone_number" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectShareprofitMerchantMemberRelationVo">
select id, merchant_id, member_phone_number, create_time from shareprofit_merchant_member_relation
</sql>
<select id="selectShareprofitMerchantMemberRelationList" parameterType="com.jsowell.pile.domain.shareprofit.ShareprofitMerchantMemberRelation" resultMap="ShareprofitMerchantMemberRelationResult">
<include refid="selectShareprofitMerchantMemberRelationVo"/>
<where>
<if test="merchantId != null "> and merchant_id = #{merchantId}</if>
<if test="memberPhoneNumber != null and memberPhoneNumber != ''"> and member_phone_number = #{memberPhoneNumber}</if>
</where>
</select>
<select id="selectShareprofitMerchantMemberRelationById" parameterType="Long" resultMap="ShareprofitMerchantMemberRelationResult">
<include refid="selectShareprofitMerchantMemberRelationVo"/>
where id = #{id}
</select>
<insert id="insertShareprofitMerchantMemberRelation" parameterType="com.jsowell.pile.domain.shareprofit.ShareprofitMerchantMemberRelation" useGeneratedKeys="true" keyProperty="id">
insert into shareprofit_merchant_member_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="merchantId != null">merchant_id,</if>
<if test="memberPhoneNumber != null">member_phone_number,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="merchantId != null">#{merchantId},</if>
<if test="memberPhoneNumber != null">#{memberPhoneNumber},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateShareprofitMerchantMemberRelation" parameterType="com.jsowell.pile.domain.shareprofit.ShareprofitMerchantMemberRelation">
update shareprofit_merchant_member_relation
<trim prefix="SET" suffixOverrides=",">
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="memberPhoneNumber != null">member_phone_number = #{memberPhoneNumber},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteShareprofitMerchantMemberRelationById" parameterType="Long">
delete from shareprofit_merchant_member_relation where id = #{id}
</delete>
<delete id="deleteShareprofitMerchantMemberRelationByIds" parameterType="String">
delete from shareprofit_merchant_member_relation where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-pile</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-pile/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-quartz</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-quartz/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-settlement</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-settlement/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-system</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-system/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>jsowell-thirdparty</id>
<classpath>
<dir name="D:/ideaProjects/jsowell-charger-web/jsowell-thirdparty/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询运营商分润组列表
export function listGroup(query) {
return request({
url: '/pile/shareprofitGroup/list',
method: 'get',
params: query
})
}
// 查询运营商分润组详细
export function getGroup(id) {
return request({
url: '/pile/shareprofitGroup/' + id,
method: 'get'
})
}
// 新增运营商分润组
export function addGroup(data) {
return request({
url: '/pile/shareprofitGroup',
method: 'post',
data: data
})
}
// 修改运营商分润组
export function updateGroup(data) {
return request({
url: '/pile/shareprofitGroup',
method: 'put',
data: data
})
}
// 删除运营商分润组
export function delGroup(id) {
return request({
url: '/pile/shareprofitGroup/' + id,
method: 'delete'
})
}

View File

@@ -0,0 +1,337 @@
<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="memberPhoneNumber">
<el-input
v-model="queryParams.memberPhoneNumber"
placeholder="请输入分润成员手机号码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="电费分润比例" prop="electricityFeeScale">
<el-input
v-model="queryParams.electricityFeeScale"
placeholder="请输入电费分润比例"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="服务费分润比例" prop="serviceFeeScale">
<el-input
v-model="queryParams.serviceFeeScale"
placeholder="请输入服务费分润比例"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否承担手续费(0-否1-是)" prop="undertakeHandlingCharge">
<el-input
v-model="queryParams.undertakeHandlingCharge"
placeholder="请输入是否承担手续费(0-否1-是)"
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="['pile:group: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="['pile:group: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="['pile:group: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="['pile:group:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="groupList" @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="memberPhoneNumber" />
<el-table-column label="电费分润比例" align="center" prop="electricityFeeScale" />
<el-table-column label="服务费分润比例" align="center" prop="serviceFeeScale" />
<el-table-column label="是否承担手续费(0-否1-是)" align="center" prop="undertakeHandlingCharge" />
<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="['pile:group:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['pile:group: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="memberPhoneNumber">
<el-input v-model="form.memberPhoneNumber" placeholder="请输入分润成员手机号码" />
</el-form-item>
<el-form-item label="电费分润比例" prop="electricityFeeScale">
<el-input v-model="form.electricityFeeScale" placeholder="请输入电费分润比例" />
</el-form-item>
<el-form-item label="服务费分润比例" prop="serviceFeeScale">
<el-input v-model="form.serviceFeeScale" placeholder="请输入服务费分润比例" />
</el-form-item>
<el-form-item label="是否承担手续费(0-否1-是)" prop="undertakeHandlingCharge">
<el-input v-model="form.undertakeHandlingCharge" placeholder="请输入是否承担手续费(0-否1-是)" />
</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 { listGroup, getGroup, delGroup, addGroup, updateGroup } from "@/api/pile/shareprofitGroup";
export default {
name: "shareprofitGroup",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 运营商分润组表格数据
groupList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
groupCode: null,
merchantId: null,
stationId: null,
memberPhoneNumber: null,
electricityFeeScale: null,
serviceFeeScale: null,
undertakeHandlingCharge: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询运营商分润组列表 */
getList() {
this.loading = true;
listGroup(this.queryParams).then(response => {
this.groupList = 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,
memberPhoneNumber: null,
electricityFeeScale: null,
serviceFeeScale: null,
undertakeHandlingCharge: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: 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
getGroup(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) {
updateGroup(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addGroup(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 delGroup(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('pile/group/export', {
...this.queryParams
}, `group_${new Date().getTime()}.xlsx`)
}
}
};
</script>