xiaoyong931011
2021-03-11 819f0f2f11936ca80903d545db7cbf5631dcdc5b
分销员后台2
1 files added
5 files modified
310 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java 37 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java 14 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanApplyDto.java 33 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java 9 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml 37 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html 180 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java
@@ -3,19 +3,26 @@
import com.matrix.core.anotations.RemoveRequestToken;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.bean.ShoppingGoods;
import com.matrix.system.hive.bean.SysShopInfo;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
import com.matrix.system.fenxiao.dto.ShopSalesmanApplyDto;
import com.matrix.system.fenxiao.service.FenXiaoSettingService;
import com.matrix.system.fenxiao.service.ShopSalesmanApplyService;
import com.matrix.system.fenxiao.vo.FenXiaoSettingVo;
@@ -32,14 +39,30 @@
    @Autowired
    private ShopSalesmanApplyService shopSalesmanApplyService;
    /**
     * 修改公司维度的分销规则
    /**
     * 查询分销员审核记录
     */
//    @PostMapping(value = "/fxImgUpload")
//    public @ResponseBody
//    AjaxResult updateFenXiaoSetting(@RequestBody BusParameterSettings busParameterSettings) {
//        return fenXiaoSettingService.updateFenXiaoSettingByCompanyId(busParameterSettings);
//    }
    @ApiOperation(value = "查询分销员审核记录")
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK",  response = ShopSalesmanApplyVo.class)
    })
    @PostMapping(value = "/findShopSalesmanApplyList")
    public @ResponseBody
    AjaxResult findShopSalesmanApplyList(@RequestBody ShopSalesmanApplyDto shopSalesmanApplyDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(shopSalesmanApplyDto);
        if(StringUtils.isBlank(shopSalesmanApplyDto.getSort())){
            shopSalesmanApplyDto.setSort("createTime");
            shopSalesmanApplyDto.setOrder("desc");
        }
        List<ShopSalesmanApplyVo> rows = shopSalesmanApplyService.findShopSalesmanApplyList(shopSalesmanApplyDto);
        Integer total = shopSalesmanApplyService.findShopSalesmanApplyListTotal(shopSalesmanApplyDto);
        AjaxResult result = AjaxResult.buildSuccessInstance(rows, total);
        return result;
    }
    /**
     *获取分销员审核记录
     */
zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java
@@ -1,7 +1,15 @@
package com.matrix.system.fenxiao.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.system.fenxiao.dto.ShopSalesmanApplyDto;
import com.matrix.system.fenxiao.entity.ShopSalesmanApply;
import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo;
import com.matrix.system.shopXcx.vo.SalesmanVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @description 推广员申请记录
@@ -10,8 +18,12 @@
 */
public interface ShopSalesmanApplyDao extends BaseMapper<ShopSalesmanApply> {
    List<ShopSalesmanApplyVo> selectFenXiaoUserApplyByCompanyId(@Param("companyId")Long companyId);
    List<ShopSalesmanApplyVo> selectFenXiaoUserApplyByCompanyId(@Param("companyId") Long companyId);
    IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("openId") String openId);
    List<ShopSalesmanApplyVo> findShopSalesmanApplyList(@Param("record")ShopSalesmanApplyDto shopSalesmanApplyDto);
    Integer findShopSalesmanApplyListTotal(@Param("record")ShopSalesmanApplyDto shopSalesmanApplyDto);
}
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanApplyDto.java
New file
@@ -0,0 +1,33 @@
package com.matrix.system.fenxiao.dto;
import com.matrix.core.pojo.PaginationDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "ShopSalesmanApplyDto", description = "查询参数")
public class ShopSalesmanApplyDto extends PaginationDto {
    @ApiModelProperty(value ="审核状态")
    private Integer shenheState;
    @ApiModelProperty(hidden = true)
    private Long companyId;
    public Integer getShenheState() {
        return shenheState;
    }
    public void setShenheState(Integer shenheState) {
        this.shenheState = shenheState;
    }
    public Long getCompanyId() {
        return companyId;
    }
    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }
}
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
@@ -15,6 +15,7 @@
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao;
import com.matrix.system.fenxiao.dto.ShopSalesmanApplyDto;
import com.matrix.system.fenxiao.entity.ShopSalesmanApply;
import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo;
@@ -103,4 +104,12 @@
        List<ShopSalesmanApplyVo> shopSalesmanApplyVos = salesmanApplyDao.selectFenXiaoUserApplyByCompanyId(companyId);
        return shopSalesmanApplyVos;
    }
    public List<ShopSalesmanApplyVo> findShopSalesmanApplyList(ShopSalesmanApplyDto shopSalesmanApplyDto) {
        return salesmanApplyDao.findShopSalesmanApplyList(shopSalesmanApplyDto);
    }
    public Integer findShopSalesmanApplyListTotal(ShopSalesmanApplyDto shopSalesmanApplyDto) {
        return salesmanApplyDao.findShopSalesmanApplyListTotal(shopSalesmanApplyDto);
    }
}
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml
@@ -56,5 +56,42 @@
          AND a.is_sales = 1
    </select>
    <select id="findShopSalesmanApplyList" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo">
        SELECT
        b.nick_name
        FROM
        shop_salesman_apply a
        LEFT JOIN biz_user b ON a.user_id = b.user_id
        LEFT JOIN shop_salesman_grade g ON b.salesman_grade = g.id
        <where>
            and a.company_id=#{record.companyId}
            <if test="record.shenheState != null and record.shenheState != ''">
                and a.apply_status=#{shenheState}
            </if>
        </where>
        <if test="record.sort !=null">
            order by
            a.${record.sort} ${record.order}
        </if>
        <if test="record.offset >=0  and record.limit >0">
            limit
            #{record.offset},#{record.limit}
        </if>
    </select>
    <select id="findShopSalesmanApplyListTotal" resultType="java.lang.Integer">
        SELECT count(*)
        FROM
        shop_salesman_apply a
        LEFT JOIN biz_user b ON a.user_id = b.user_id
        LEFT JOIN shop_salesman_grade g ON b.salesman_grade = g.id
        <where>
            and a.company_id=#{record.companyId}
            <if test="record.shenheState != null and record.shenheState != ''">
                and a.apply_status=#{shenheState}
            </if>
        </where>
    </select>
</mapper>
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
@@ -29,53 +29,30 @@
        <el-row>
            <el-tabs v-model="activeName" >
                <el-tab-pane label="分销员管理" name="first">
                    <el-row>
                        <el-form ref="form" :model="form" inline >
                            <el-form-item label="交易类型" prop="fenxiaoGrade">
                                <el-select v-model="form.fenxiaoGrade" placeholder="请选择">
                                    <el-option
                                            v-for="item in fenxiaoGradeList"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value"
                                    >
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="分销员等级" prop="shenheState">
                                <el-select v-model="form.shenheState" placeholder="请选择">
                                    <el-option
                                            v-for="item in shenheStateList"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-row style="display:flex;align-items: center;">
                                <el-col>
                                    <el-button type="primary" @click="submits()">新增分销员</el-button>
                                </el-col>
                                <el-col style="display:flex;align-items: center;">
                                    <el-select v-model="fenxiaoGrade" placeholder="分销员等级">
                                        <el-option label="初始等级" value="1"></el-option>
                                        <el-option label="合伙人" value="2"></el-option>
                    <el-row style="display:flex;align-items: center;">
                        <el-col>
                            <el-button type="primary" @click="submits()">新增分销员</el-button>
                        </el-col>
                        <el-col>
                            <el-form ref="form" :model="form" inline >
                                <el-form-item label="审核状态" prop="shenheState">
                                    <el-select v-model="form.shenheState" placeholder="请选择">
                                        <el-option
                                                v-for="item in shenheStateList"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value"
                                        >
                                        </el-option>
                                    </el-select>
                                    <el-button type="primary" @click="search" >搜索</el-button>
                                    <el-button type="primary" @click="submits()">搜索</el-button>
                                    <el-button @click="resetForm('form')">重置</el-button>
                                </el-col>
                            </el-row>
                            <el-button type="primary" @click="search" >搜索</el-button>
                            <el-button @click="resetForm('form')">重置</el-button>
                        </el-form>
                                </el-form-item>
                                <el-button type="primary" @click="search" >搜索</el-button>
                                <el-button @click="resetForm('form')">重置</el-button>
                            </el-form>
                        </el-col>
                    </el-row>
                        <template>
                            <el-table id="proj" :data="fxyList.rows"  :height="height" stripe @sort-change="sortChange">
                            <el-table
                                    ref="multipleTable"
                                    :data="fxy"
@@ -87,53 +64,8 @@
                                        width="55">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        prop="nickname"
                                        label="分销员姓名"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="分销员姓名"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="邀请人"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="下级客户数"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="累计收益"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="待结算"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="等级"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="date"
                                        label="加入时间"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="状态"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="来源"
                                        width="180">
                                </el-table-column>
                                <el-table-column
@@ -227,6 +159,8 @@
<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script>
<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<script>
    //百度编辑器
@@ -237,7 +171,6 @@
        el: '#app',
        data: {
            fxy:[],
            shenheState: "",
            fenxiaoGrade: "",
            tableData:[],
            tgwa: "",
@@ -249,13 +182,7 @@
            mdjf:[],
            scjf:[],
            form:{
                name:null,
                datetimeArr:'',
                payMethod:'',
                flowType:'',
                orderNo:'',
                oprationMan:'',
                queryKey:'',
                shenheState:'',
                order:'',
                sort:''
            },
@@ -266,17 +193,18 @@
                {value:'2',label:'未审核'},
                {value:'3',label:'未通过'}
            ],
            shenheStateList:[
                {value:'',label:'全部'},
                {value:'1',label:'已审核'},
                {value:'2',label:'未审核'},
                {value:'3',label:'未通过'}
            ],
            fxyList:{
                rows:[],
                total:0,
                pageSize:10,
                currentPage:1,
            },
            height:'calc(100vh - 240px)',
        },
        created: function () {
            this.loadInfo();
            window.addEventListener("keydown", this.keydown);
            //初始化编辑器
            ue = UE.getEditor('description');
            //百度编辑器
@@ -310,16 +238,50 @@
            },
            loadParamSetting() {
                let _this = this;
                //加载配置
                let data=_this.getRequestParam();
                data.limit=_this.fxyList.pageSize;
                data.offset=_this.fxyList.pageSize
                AjaxProxy.requst({
                    app: _this,
                    data: {},
                    url: basePath + '/score/fenXiaoUser/fenXiaoUser',
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanApplyList',
                    callback: function (data) {
                        console.log("over");
                        _this.fxyList.rows = data.rows;
                        _this.fxyList.total=data.total;
                    }
                });
            },
            getRequestParam(){
                let _this = this;
                return   {
                    shenheState:_this.form.shenheState,
                    order:_this.form.order,
                    sort:_this.form.sort,
                }
            },
            search:function(){
                this.fxyList.currentPage=1;
                this.loadInfo();
            },
            keydown(evt){
                if(evt.keyCode==13) {
                    this.search();
                }
            },
            resetForm(formName) {
                this.$refs[formName].resetFields();
            },
            sortChange:function (column){
                if(column.order){
                    if(column.order.indexOf("desc")){
                        this.form.order="desc";
                    }else{
                        this.form.order="asc";
                    }
                    this.form.sort=column.prop;
                    this.loadInfo();
                }
            },
            submit() {
            }