Merge remote-tracking branch 'origin/feature/20200402_init_dev' into feature/20200402_init_dev
commit
3a80623e09
@ -1,15 +1,198 @@
|
||||
<template>
|
||||
<div>
|
||||
<p>IncreaseStaffManager</p>
|
||||
<Row style="margin-top: 20px;width: 100%;background-color: #F7F8FA;">
|
||||
<i-col span="24" style="text-align: left;padding-left: 10px;">
|
||||
<Row class="row-style">
|
||||
<i-col span="1" style="text-align: right;">
|
||||
<span class="region">区域选择</span>
|
||||
</i-col>
|
||||
<i-col span="4" style="padding-left: 10px;">
|
||||
<Select v-model="selectedRegion" filterable style="width: 200px;">
|
||||
<Option v-for="item in regionList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||
</Select>
|
||||
</i-col>
|
||||
<i-col span="1" style="text-align: right;">
|
||||
<span class="region">店铺选择</span>
|
||||
</i-col>
|
||||
<i-col span="4" style="padding-left: 10px;">
|
||||
<Select v-model="selectedStore" filterable style="width: 200px;">
|
||||
<Option v-for="item in storeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||
</Select>
|
||||
</i-col>
|
||||
<i-col span="2">
|
||||
<Button type="primary">查询</Button>
|
||||
</i-col>
|
||||
<i-col span="12" style="text-align: right;padding-right: 20px;">
|
||||
<Button type="primary" style="margin-right: 10px;">批量下载</Button>
|
||||
<Button type="primary" style="margin-right: 10px;">批量添加</Button>
|
||||
<Button type="primary">添加推广人员</Button>
|
||||
</i-col>
|
||||
</Row>
|
||||
</i-col>
|
||||
</Row>
|
||||
|
||||
<Table :columns="columns1" :data="data1" style="margin-top: 20px;">
|
||||
<template slot-scope="{ row, index }" slot="qrCodeAction">
|
||||
<Button ghost type="primary" size="small" style="margin-right: 5px" @click="show(index)">预览</Button>
|
||||
<Button ghost type="primary" size="small" @click="download(index)">下载</Button>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row, index }" slot="state">
|
||||
<i-switch size="large" :value="row.qrCodeState" @on-change="onSwitchChangeLister(row, index)">
|
||||
<span slot="open">开启</span>
|
||||
<span slot="close">关闭</span>
|
||||
</i-switch>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row, index }" slot="action">
|
||||
<Button ghost type="primary" size="small" style="margin-right: 5px" @click="open(index)">开通门店企微号</Button>
|
||||
<Button ghost type="error" size="small" @click="remove(index)">删除微信号</Button>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "IncreaseStaffManager"
|
||||
name: "IncreaseStaffManager",
|
||||
data () {
|
||||
return {
|
||||
selectedRegion: null,
|
||||
regionList: [],
|
||||
selectedStore: null,
|
||||
storeList: [],
|
||||
columns1: [
|
||||
{
|
||||
title: '序号',
|
||||
key: 'id',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
key: 'name',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '员工ID',
|
||||
key: 'code',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
key: 'phone',
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
title: '店铺',
|
||||
key: 'storeName',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '角色',
|
||||
key: 'role',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '客户数',
|
||||
key: 'customerNum',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '推广码',
|
||||
slot: 'qrCodeAction',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '推广码',
|
||||
key: 'qrCodeState',
|
||||
width: 150,
|
||||
slot: 'state'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
slot: 'action',
|
||||
}
|
||||
],
|
||||
data1: [
|
||||
{
|
||||
id: 1,
|
||||
name: '王老吉',
|
||||
code: 'D1',
|
||||
phone: '13112345678',
|
||||
storeName: '店铺1',
|
||||
role: 1,
|
||||
customerNum: 999,
|
||||
qrCodeState: true
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '王老吉2',
|
||||
code: 'D2',
|
||||
phone: '13112345678',
|
||||
storeName: '店铺2',
|
||||
role: 2,
|
||||
customerNum: 999,
|
||||
qrCodeState: true
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '王老吉3',
|
||||
code: 'D3',
|
||||
phone: '13112345678',
|
||||
storeName: '店铺3',
|
||||
role: 3,
|
||||
customerNum: 999,
|
||||
qrCodeState: false
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '王老吉4',
|
||||
code: 'D4',
|
||||
phone: '13112345678',
|
||||
storeName: '店铺4',
|
||||
role: 3,
|
||||
customerNum: 999,
|
||||
qrCodeState: false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 日期选择
|
||||
onChangeDateLister: function () {
|
||||
|
||||
},
|
||||
// 预览二维码
|
||||
show: function () {
|
||||
|
||||
},
|
||||
// 下载二维码
|
||||
download: function () {
|
||||
|
||||
},
|
||||
// 开通企业微信号
|
||||
open: function () {
|
||||
|
||||
},
|
||||
// 删除
|
||||
remove: function () {
|
||||
|
||||
},
|
||||
// switch开关
|
||||
onSwitchChangeLister: function () {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.region {
|
||||
font-size: 14px;
|
||||
line-height: 32px;
|
||||
}
|
||||
.row-style {
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,15 +1,150 @@
|
||||
<template>
|
||||
<div>
|
||||
<p>IncreaseStoreManager</p>
|
||||
<Row style="margin-top: 20px;width: 100%;background-color: #F7F8FA;">
|
||||
<i-col span="24" style="text-align: left;padding-left: 10px;">
|
||||
<Row class="row-style">
|
||||
<i-col span="1" style="text-align: right;">
|
||||
<span class="region">区域选择</span>
|
||||
</i-col>
|
||||
<i-col span="4" style="padding-left: 10px;">
|
||||
<Select v-model="selectedRegion" filterable style="width: 200px;">
|
||||
<Option v-for="item in regionList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||
</Select>
|
||||
</i-col>
|
||||
<i-col span="1" style="text-align: right;">
|
||||
<span class="region">店铺选择</span>
|
||||
</i-col>
|
||||
<i-col span="4" style="padding-left: 10px;">
|
||||
<Select v-model="selectedStore" filterable style="width: 200px;">
|
||||
<Option v-for="item in storeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||
</Select>
|
||||
</i-col>
|
||||
<i-col span="2">
|
||||
<Button type="primary">查询</Button>
|
||||
</i-col>
|
||||
<i-col span="12" style="text-align: right;padding-right: 20px;">
|
||||
<Button type="primary" style="margin-right: 10px;">批量下载</Button>
|
||||
<Button type="primary" style="margin-right: 10px;">批量开通</Button>
|
||||
</i-col>
|
||||
</Row>
|
||||
</i-col>
|
||||
</Row>
|
||||
|
||||
<Table :columns="columns1" :data="data1" style="margin-top: 20px;">
|
||||
<template slot-scope="{ row, index }" slot="qrCodeAction">
|
||||
<Button ghost type="primary" size="small" style="margin-right: 5px" @click="show(index)">预览</Button>
|
||||
<Button ghost type="primary" size="small" @click="download(index)">下载</Button>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row, index }" slot="action">
|
||||
<Button ghost type="primary" size="small" style="margin-right: 5px" @click="open(index)">开通门店企微号</Button>
|
||||
<Button ghost type="error" size="small" @click="remove(index)">删除微信号</Button>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "IncreaseStoreManager"
|
||||
name: "IncreaseStoreManager",
|
||||
data () {
|
||||
return {
|
||||
selectedRegion: null,
|
||||
regionList: [],
|
||||
selectedStore: null,
|
||||
storeList: [],
|
||||
columns1: [
|
||||
{
|
||||
title: '序号',
|
||||
key: 'id',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '门店名称',
|
||||
key: 'storeName'
|
||||
},
|
||||
{
|
||||
title: '门店企业号',
|
||||
key: 'storeWx'
|
||||
},
|
||||
{
|
||||
title: '员工数',
|
||||
key: 'staffNum',
|
||||
},
|
||||
{
|
||||
title: '客户数',
|
||||
key: 'customerNum',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '推广码',
|
||||
slot: 'qrCodeAction',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
slot: 'action',
|
||||
}
|
||||
],
|
||||
data1: [
|
||||
{
|
||||
id: 1,
|
||||
storeName: '店铺1',
|
||||
storeWx: 'D1',
|
||||
staffNum: 10,
|
||||
customerNum: 999
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
storeName: '店铺2',
|
||||
storeWx: 'D2',
|
||||
staffNum: 10,
|
||||
customerNum: 999
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
storeName: '店铺3',
|
||||
storeWx: 'D3',
|
||||
staffNum: 10,
|
||||
customerNum: 999
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
storeName: '店铺4',
|
||||
storeWx: 'D4',
|
||||
staffNum: 10,
|
||||
customerNum: 999
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onChangeDateLister: function () {
|
||||
|
||||
},
|
||||
show: function () {
|
||||
|
||||
},
|
||||
download: function () {
|
||||
|
||||
},
|
||||
open: function () {
|
||||
|
||||
},
|
||||
remove: function () {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.region {
|
||||
font-size: 14px;
|
||||
line-height: 32px;
|
||||
}
|
||||
.row-style {
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.kiisoo.ic.department.constant;
|
||||
|
||||
/**
|
||||
* @Description: 部门静态类
|
||||
* @Auther: yechenhao
|
||||
* @Date: 2020/4/8 0002 21:14
|
||||
* @Version: v1
|
||||
*/
|
||||
public class Constants {
|
||||
/**
|
||||
* 企业微信主部门id
|
||||
*/
|
||||
public static Long MAIN_DEPARTMENT_ID = 1L;
|
||||
/**
|
||||
* 根层级
|
||||
*/
|
||||
public static int LEVEL_ONE = 1;
|
||||
/**
|
||||
* 根层级
|
||||
*/
|
||||
public static int LEVEL_TWO = 2;
|
||||
}
|
@ -1,16 +1,16 @@
|
||||
package com.kiisoo.ic.employee.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.kiisoo.ic.employee.entity.PoiStoreStaffDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description 店铺人员表mapper
|
||||
* @Author yinliujing
|
||||
* @Version V1.0.0
|
||||
* @Date 2020/4/7
|
||||
*/
|
||||
@Repository
|
||||
public interface PoiStoreStaffDOMapper extends BaseMapper<PoiStoreStaffDO> {
|
||||
|
||||
}
|
||||
//package com.kiisoo.ic.employee.mapper;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
//import com.kiisoo.ic.employee.entity.PoiStoreStaffDO;
|
||||
//import org.springframework.stereotype.Repository;
|
||||
//
|
||||
///**
|
||||
// * @Description 店铺人员表mapper
|
||||
// * @Author yinliujing
|
||||
// * @Version V1.0.0
|
||||
// * @Date 2020/4/7
|
||||
// */
|
||||
//@Repository
|
||||
//public interface PoiStoreStaffDOMapper extends BaseMapper<PoiStoreStaffDO> {
|
||||
//
|
||||
//}
|
||||
|
@ -1,86 +1,87 @@
|
||||
package com.kiisoo.ic.employee.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kiisoo.ic.config.WxCpConfiguration;
|
||||
import com.kiisoo.ic.employee.entity.PoiStoreStaffDO;
|
||||
import com.kiisoo.ic.employee.entity.QrCodeDO;
|
||||
import com.kiisoo.ic.employee.entity.QrCodeVO;
|
||||
import com.kiisoo.ic.employee.mapper.PoiStoreStaffDOMapper;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.cp.api.WxCpService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 推广码业务
|
||||
* @Auther: yinliujing
|
||||
* @Date: 2020/4/7 0002 14:06
|
||||
* @Version: v1
|
||||
*/
|
||||
@Service
|
||||
public class QrCodeService {
|
||||
WxCpService mainService = WxCpConfiguration.getCpService(1000037);
|
||||
@Autowired
|
||||
private PoiStoreStaffDOMapper poiStoreStaffDOMapper;
|
||||
|
||||
public QrCodeVO getQrCode(QrCodeDO qrCodeDO) throws Exception {
|
||||
//获取token
|
||||
String token = mainService.getAccessToken();
|
||||
qrCodeDO.setAccess_token(token);
|
||||
//获取configId
|
||||
String configId = getConfigId(qrCodeDO);
|
||||
//获取配置实体
|
||||
QrCodeVO qrCodeVO = getContactWay(token, configId);
|
||||
return qrCodeVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置客户联系「联系我」方式
|
||||
*
|
||||
* @param qrCodeDO
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
public String getConfigId(QrCodeDO qrCodeDO) throws WxErrorException {
|
||||
String url = mainService.getWxCpConfigStorage().getApiUrl("/cgi-bin/externalcontact/add_contact_way");
|
||||
String result = mainService.post(url, qrCodeDO.toJson());
|
||||
JSONObject parseObject = JSON.parseObject(result);
|
||||
String configId = parseObject.getString("config_id");
|
||||
return configId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业已配置的「联系我」方式
|
||||
*
|
||||
* @param token
|
||||
* @param configId
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
public QrCodeVO getContactWay(String token, String configId) throws WxErrorException {
|
||||
String url = mainService.getWxCpConfigStorage().getApiUrl("/cgi-bin/externalcontact/get_contact_way");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("config_id", configId);
|
||||
map.put("access_token", token);
|
||||
String result = mainService.post(url, JSON.toJSONString(map));
|
||||
JSONObject parseObject = JSON.parseObject(result);
|
||||
QrCodeVO qrCodeVO = JSONObject.parseObject(parseObject.getString("contact_way"), QrCodeVO.class);
|
||||
return qrCodeVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加店铺人员表
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int saveStoreStaff(PoiStoreStaffDO poiStoreStaffDO) throws Exception {
|
||||
return poiStoreStaffDOMapper.insert(poiStoreStaffDO);
|
||||
}
|
||||
}
|
||||
//package com.kiisoo.ic.employee.service;
|
||||
//
|
||||
//import com.alibaba.fastjson.JSON;
|
||||
//import com.alibaba.fastjson.JSONObject;
|
||||
//import com.kiisoo.ic.config.WxCpConfiguration;
|
||||
//import com.kiisoo.ic.employee.entity.PoiStoreStaffDO;
|
||||
//import com.kiisoo.ic.employee.entity.QrCodeDO;
|
||||
//import com.kiisoo.ic.employee.entity.QrCodeVO;
|
||||
////import com.kiisoo.ic.employee.mapper.PoiStoreStaffDOMapper;
|
||||
//import com.kiisoo.ic.store.mapper.PoiStoreStaffDOMapper;
|
||||
//import me.chanjar.weixin.common.error.WxErrorException;
|
||||
//import me.chanjar.weixin.cp.api.WxCpService;
|
||||
//import org.springframework.beans.BeanUtils;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//
|
||||
//import java.util.HashMap;
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * @Description: 推广码业务
|
||||
// * @Auther: yinliujing
|
||||
// * @Date: 2020/4/7 0002 14:06
|
||||
// * @Version: v1
|
||||
// */
|
||||
//@Service
|
||||
//public class QrCodeService {
|
||||
// WxCpService mainService = WxCpConfiguration.getCpService(1000037);
|
||||
// @Autowired
|
||||
// private PoiStoreStaffDOMapper poiStoreStaffDOMapper;
|
||||
//
|
||||
// public QrCodeVO getQrCode(QrCodeDO qrCodeDO) throws Exception {
|
||||
// //获取token
|
||||
// String token = mainService.getAccessToken();
|
||||
// qrCodeDO.setAccess_token(token);
|
||||
// //获取configId
|
||||
// String configId = getConfigId(qrCodeDO);
|
||||
// //获取配置实体
|
||||
// QrCodeVO qrCodeVO = getContactWay(token, configId);
|
||||
// return qrCodeVO;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 配置客户联系「联系我」方式
|
||||
// *
|
||||
// * @param qrCodeDO
|
||||
// * @return
|
||||
// * @throws WxErrorException
|
||||
// */
|
||||
// public String getConfigId(QrCodeDO qrCodeDO) throws WxErrorException {
|
||||
// String url = mainService.getWxCpConfigStorage().getApiUrl("/cgi-bin/externalcontact/add_contact_way");
|
||||
// String result = mainService.post(url, qrCodeDO.toJson());
|
||||
// JSONObject parseObject = JSON.parseObject(result);
|
||||
// String configId = parseObject.getString("config_id");
|
||||
// return configId;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取企业已配置的「联系我」方式
|
||||
// *
|
||||
// * @param token
|
||||
// * @param configId
|
||||
// * @return
|
||||
// * @throws WxErrorException
|
||||
// */
|
||||
// public QrCodeVO getContactWay(String token, String configId) throws WxErrorException {
|
||||
// String url = mainService.getWxCpConfigStorage().getApiUrl("/cgi-bin/externalcontact/get_contact_way");
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
// map.put("config_id", configId);
|
||||
// map.put("access_token", token);
|
||||
// String result = mainService.post(url, JSON.toJSONString(map));
|
||||
// JSONObject parseObject = JSON.parseObject(result);
|
||||
// QrCodeVO qrCodeVO = JSONObject.parseObject(parseObject.getString("contact_way"), QrCodeVO.class);
|
||||
// return qrCodeVO;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 添加店铺人员表
|
||||
// * @return
|
||||
// * @throws WxErrorException
|
||||
// */
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public int saveStoreStaff(PoiStoreStaffDO poiStoreStaffDO) throws Exception {
|
||||
// return poiStoreStaffDOMapper.insert(poiStoreStaffDO);
|
||||
// }
|
||||
//}
|
||||
|
Loading…
Reference in New Issue