导粉记录
This commit is contained in:
parent
574c8b424e
commit
17df1db9e2
@ -79,8 +79,8 @@ public class SysCustomerController extends BaseController {
|
||||
for (SysCustomer sysCus : list) {
|
||||
if (StringUtils.isNotEmpty(sysCus.getPhone())) {
|
||||
sysCus.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone()));
|
||||
sysCus.setEncId(sysCus.getId() != null ? AesUtils.encrypt(sysCus.getId() + "", null) : "");
|
||||
}
|
||||
sysCus.setEncId(sysCus.getId() != null ? AesUtils.encrypt(sysCus.getId() + "", null) : "");
|
||||
}
|
||||
}
|
||||
return getDataTable(list);
|
||||
|
@ -1,8 +1,12 @@
|
||||
package com.stdiet.web.controller.custom;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.custom.domain.SysImportFanWxAccount;
|
||||
import com.stdiet.custom.domain.SysWxSaleAccount;
|
||||
import com.stdiet.custom.service.ISysImportFanWxAccountService;
|
||||
import com.stdiet.custom.service.ISysWxSaleAccountService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -39,6 +43,9 @@ public class SysImportFanRecordController extends BaseController
|
||||
@Autowired
|
||||
private ISysWxSaleAccountService sysWxSaleAccountService;
|
||||
|
||||
@Autowired
|
||||
private ISysImportFanWxAccountService sysImportFanWxAccountService;
|
||||
|
||||
/**
|
||||
* 查询导粉管理列表
|
||||
*/
|
||||
@ -109,12 +116,16 @@ public class SysImportFanRecordController extends BaseController
|
||||
|
||||
/**
|
||||
* 获取可接粉的微信号以及对应销售
|
||||
* @param sysWxSaleAccount
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:importFanRecord:add')")
|
||||
@GetMapping(value = "/getWxAccountAndSale")
|
||||
public TableDataInfo getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount){
|
||||
return getDataTable(sysWxSaleAccountService.getWxAccountAndSale(sysWxSaleAccount));
|
||||
public AjaxResult getWxAccountAndSale(SysImportFanWxAccount sysImportFanWxAccount){
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
List<SysWxSaleAccount> list = sysWxSaleAccountService.getWxAccountAndSale();
|
||||
List<Map<String,Object>> fanNumList = sysImportFanWxAccountService.getTotalImportFanNum(sysImportFanWxAccount);
|
||||
result.put("wxSaleAccountList", list);
|
||||
result.put("fanNumList", fanNumList);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 导粉记录中对应微信记录对象 sys_import_fan_wx_account
|
||||
*
|
||||
@ -32,4 +35,8 @@ public class SysImportFanWxAccount extends BaseEntity
|
||||
|
||||
/** 删除标识 0未删除 1已删除 */
|
||||
private Long delFlag;
|
||||
|
||||
//导粉日期
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date importFanDate;
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package com.stdiet.custom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.custom.domain.SysImportFanWxAccount;
|
||||
|
||||
/**
|
||||
@ -65,4 +67,11 @@ public interface SysImportFanWxAccountMapper
|
||||
* @return
|
||||
*/
|
||||
public SysImportFanWxAccount getWxAccountByFanRecordId(SysImportFanWxAccount sysImportFanWxAccount);
|
||||
|
||||
/**
|
||||
* 根据微信号查询
|
||||
* @param sysImportFanWxAccount
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getTotalImportFanNum(SysImportFanWxAccount sysImportFanWxAccount);
|
||||
}
|
@ -74,8 +74,7 @@ public interface SysWxSaleAccountMapper
|
||||
|
||||
/**
|
||||
* 获取可接粉的微信号以及分配的销售昵称
|
||||
* @param sysWxSaleAccount
|
||||
* @return
|
||||
*/
|
||||
List<SysWxSaleAccount> getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount);
|
||||
List<SysWxSaleAccount> getWxAccountAndSale();
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.custom.domain.SysImportFanWxAccount;
|
||||
import com.stdiet.custom.domain.SysWxSaleAccount;
|
||||
|
||||
/**
|
||||
* 导粉记录中对应微信记录Service接口
|
||||
@ -65,4 +68,10 @@ public interface ISysImportFanWxAccountService
|
||||
* @return
|
||||
*/
|
||||
public SysImportFanWxAccount getWxAccountByFanRecordId(SysImportFanWxAccount sysImportFanWxAccount);
|
||||
|
||||
/**
|
||||
* 根据日期统计微信号导粉数量
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getTotalImportFanNum(SysImportFanWxAccount sysImportFanWxAccount);
|
||||
}
|
@ -75,8 +75,7 @@ public interface ISysWxSaleAccountService
|
||||
|
||||
/**
|
||||
* 获取可接粉的微信号以及分配的销售昵称
|
||||
* @param sysWxSaleAccount
|
||||
* @return
|
||||
*/
|
||||
List<SysWxSaleAccount> getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount);
|
||||
List<SysWxSaleAccount> getWxAccountAndSale();
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.custom.domain.SysWxSaleAccount;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysImportFanWxAccountMapper;
|
||||
@ -102,4 +105,13 @@ public class SysImportFanWxAccountServiceImpl implements ISysImportFanWxAccountS
|
||||
public SysImportFanWxAccount getWxAccountByFanRecordId(SysImportFanWxAccount sysImportFanWxAccount){
|
||||
return sysImportFanWxAccountMapper.getWxAccountByFanRecordId(sysImportFanWxAccount);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据日期统计微信号导粉数量
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getTotalImportFanNum(SysImportFanWxAccount sysImportFanWxAccount){
|
||||
return sysImportFanWxAccountMapper.getTotalImportFanNum(sysImportFanWxAccount);
|
||||
}
|
||||
}
|
@ -9,7 +9,9 @@ import com.stdiet.custom.service.ISysWxSaleAccountService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信账号Service业务层处理
|
||||
@ -134,7 +136,7 @@ public class SysWxSaleAccountServiceImpl implements ISysWxSaleAccountService {
|
||||
* @param sysWxSaleAccount
|
||||
* @return
|
||||
*/
|
||||
public List<SysWxSaleAccount> getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount){
|
||||
return sysWxSaleAccountMapper.getWxAccountAndSale(sysWxSaleAccount);
|
||||
public List<SysWxSaleAccount> getWxAccountAndSale(){
|
||||
return sysWxSaleAccountMapper.getWxAccountAndSale();
|
||||
}
|
||||
}
|
@ -124,8 +124,8 @@
|
||||
from sys_import_fan_wx_account fwc
|
||||
left join sys_wx_sale_account wa on wa.id = fwc.import_wx_account_id and wa.del_flag = 0
|
||||
left join sys_wx_distribution swd on swd.wechat_account = wa.id and swd.del_flag = 0
|
||||
left join sys_user su on swd.user_id = su.id and su.del_flag = 0
|
||||
where fwc.del_flag = 0
|
||||
left join sys_user su on swd.user_id = su.user_id and su.del_flag = 0
|
||||
where fwc.del_flag = 0 and fwc.import_fan_record_id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -87,4 +87,22 @@
|
||||
and import_wx_account_id = #{importWxAccountId} order by id desc limit 1
|
||||
</select>
|
||||
|
||||
<!-- 根据微信号ID查询导粉多少 -->
|
||||
<select id="getTotalImportFanNum" parameterType="SysImportFanWxAccount" resultType="Map">
|
||||
select w.import_wx_account_id as wxAccountId,sum(w.import_fan_num) as fanNum
|
||||
from
|
||||
(
|
||||
select fwa.import_wx_account_id,fwa.import_fan_num from sys_import_fan_wx_account fwa
|
||||
left join sys_import_fan_record ifr on fwa.import_fan_record_id = ifr.id and ifr.del_flag = 0
|
||||
where fwa.del_flag = 0
|
||||
<if test="importFanDate != null">
|
||||
and ifr.import_fan_date = #{importFanDate}
|
||||
</if>
|
||||
<if test="importWxAccountId != null">
|
||||
and fwa.import_wx_account_id = #{importWxAccountId}
|
||||
</if>
|
||||
) w
|
||||
group by w.import_wx_account_id order by w.import_wx_account_id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -139,14 +139,13 @@
|
||||
</insert>
|
||||
|
||||
<!-- 查询可以接粉的微信号以及对应销售,用于导粉记录管理 -->
|
||||
<select id="getWxAccountAndSale" parameterType="SysWxSaleAccount" resultMap="SysWxSaleAccountResult">
|
||||
<select id="getWxAccountAndSale" resultMap="SysWxSaleAccountResult">
|
||||
select wa.id, wa.wx_account, su.nick_name as sale_name
|
||||
from sys_wx_sale_account wa
|
||||
left join sys_wx_distribution swd on wa.id = swd.wechat_account and swd.del_flag = 0
|
||||
LEFT JOIN sys_user su ON su.user_id = swd.user_id AND su.del_flag = 0
|
||||
where wa.del_flag = 0 and wa.status = 0
|
||||
<if test="wxAccount != null and wxAccount != ''">and wa.wx_account like concat('%', #{wxAccount}, '%')</if>
|
||||
order by wa.id desc
|
||||
order by su.user_id asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -4,7 +4,7 @@
|
||||
<div style="height: 500px; overflow: auto">
|
||||
<el-table v-loading="loading" :data="wxAccountList">
|
||||
<!--<el-table-column label="微信昵称" align="center" prop="wxNickName" />-->
|
||||
<el-table-column label="微信号" align="center" prop="wxAccount" width="120"/>
|
||||
<el-table-column label="微信号" align="center" prop="wxAccount" width="160"/>
|
||||
<el-table-column label="销售" align="center" prop="saleName" width="120"/>
|
||||
<el-table-column label="已导粉数量" align="center" prop="importFanNum" width="120"/>
|
||||
<el-table-column label="进粉渠道" align="center" prop="importFanChannel" >
|
||||
@ -48,7 +48,7 @@
|
||||
<el-input-number v-model="scope.row.fanNum" :min="1" :max="10000" label="导粉数量" style="width:160px"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="normal"
|
||||
@ -91,7 +91,9 @@ export default {
|
||||
wxAccountList:[],
|
||||
fanChanneloptions:[],
|
||||
//当日直播间
|
||||
liveSchedukList:[]
|
||||
liveSchedukList:[],
|
||||
//总导粉统计
|
||||
fanNumList:[]
|
||||
};
|
||||
},
|
||||
created(){
|
||||
@ -129,16 +131,17 @@ export default {
|
||||
//获取所有可接粉的微信号
|
||||
getListWxAccount() {
|
||||
this.loading = true;
|
||||
getWxAccountAndSale().then((response) => {
|
||||
response.rows.forEach((item,index) => {
|
||||
getWxAccountAndSale({'importFanDate': this.data.importFanDate}).then((response) => {
|
||||
response.data.wxSaleAccountList.forEach((item,index) => {
|
||||
item.fanNum = 1;
|
||||
})
|
||||
this.wxAccountList = response.rows;
|
||||
item.importFanNum = this.getTotalFanNum(response.data.fanNumList, item.id);
|
||||
});
|
||||
this.wxAccountList = response.data.wxSaleAccountList;
|
||||
this.fanNumList = response.data.fanNumList;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getAllLiveSchedulByDate(){
|
||||
console.log("--");
|
||||
getAllLiveSchedulByDate({'liveSchedulDate':this.data.importFanDate}).then((response) => {
|
||||
response.data.forEach((item,index) => {
|
||||
item.liveRoomName = item.liveNutritionistName + " " + item.liveRoomName;
|
||||
@ -146,6 +149,18 @@ export default {
|
||||
this.liveSchedukList = response.data;
|
||||
});
|
||||
},
|
||||
getTotalFanNum(fanNumList, wxAccountId){
|
||||
if(wxAccountId == null || fanNumList == null){
|
||||
return 0;
|
||||
}
|
||||
let num = 0;
|
||||
fanNumList.forEach((item,index) => {
|
||||
if(item.wxAccountId == wxAccountId){
|
||||
num = item.fanNum;
|
||||
}
|
||||
});
|
||||
return num;
|
||||
},
|
||||
addImportFanRecord(row){
|
||||
//账号渠道、进粉数量不能为空
|
||||
if(row.importFanChannel == undefined || row.importFanChannel == null){
|
||||
@ -177,6 +192,7 @@ export default {
|
||||
row.importFanChannel = null;
|
||||
row.fanNum = 1;
|
||||
row.importFanLive = null;
|
||||
row.importFanNum += row.fanNum;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -92,10 +92,29 @@
|
||||
<el-table-column label="进粉账号渠道" align="center" prop="importFanChannelName" />
|
||||
<el-table-column label="所属直播间" align="center" prop="liveRoomName" >
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.liveRoomName + "—" + scope.row.liveNutritionistName}}
|
||||
{{(scope.row.liveRoomName != null || scope.row.liveNutritionistName != null) ? (scope.row.liveRoomName + "—" + scope.row.liveNutritionistName) : ""}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="导粉总数" align="center" prop="wxAccountList" :formatter="getTotalFanNum">
|
||||
</el-table-column>
|
||||
<el-table-column label="导粉微信号" align="center" prop="wxAccountList" >
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
placement="left"
|
||||
width="390"
|
||||
trigger="click">
|
||||
<el-table :data="scope.row.wxAccountList" style="width:370;height: 400px;overflow: auto;">
|
||||
<el-table-column width="100" property="saleName" label="销售" align="center"></el-table-column>
|
||||
<el-table-column width="160" property="wxAccount" label="微信号" align="center"></el-table-column>
|
||||
<el-table-column width="80" property="importFanNum" label="导粉数量" align="center"></el-table-column>
|
||||
</el-table>
|
||||
<el-button slot="reference">详情</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -112,7 +131,7 @@
|
||||
v-hasPermi="['custom:importFanRecord:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
@ -334,6 +353,15 @@ export default {
|
||||
this.$refs.importFanRef.showDialog(data,()=>{
|
||||
this.getList();
|
||||
}, this.fanChanneloptions);
|
||||
},
|
||||
getTotalFanNum(row, column){
|
||||
let fanNum = 0;
|
||||
if(row.wxAccountList != null){
|
||||
row.wxAccountList.forEach((item,index) => {
|
||||
fanNum += item.importFanNum == null ? 0 : item.importFanNum;
|
||||
});
|
||||
}
|
||||
return fanNum;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user