Commit d60118b5 by [zmy2771345724]

Merge branch 'master' of https://gitee.com/LinkWeChat/link-wechat

2 parents 5ceaa671 6a3e5618
Showing 28 changed files with 764 additions and 252 deletions
...@@ -181,7 +181,7 @@ com.linkwechat ...@@ -181,7 +181,7 @@ com.linkwechat
#### 在线体验 #### 在线体验
演示演示(暂未开放):http://www.topitclub.cn/ 演示演示:http://106.13.201.219/ 演示账号/密码:test/123456
#### 开发进度 #### 开发进度
......
...@@ -39,7 +39,7 @@ public class WeCustomerController extends BaseController ...@@ -39,7 +39,7 @@ public class WeCustomerController extends BaseController
/** /**
* 查询企业微信客户列表 * 查询企业微信客户列表
*/ */
@PreAuthorize("@ss.hasPermi('wecom:customer:list')") @PreAuthorize("@ss.hasPermi('customerManage:customer:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(WeCustomer weCustomer) public TableDataInfo list(WeCustomer weCustomer)
{ {
...@@ -48,23 +48,36 @@ public class WeCustomerController extends BaseController ...@@ -48,23 +48,36 @@ public class WeCustomerController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/** /**
* 导出企业微信客户列表 * 根据员工ID获取客户
* @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:customer:export')") @PreAuthorize("@ss.hasPermi('customerManage:customer:list')")
@Log(title = "企业微信客户", businessType = BusinessType.EXPORT) @GetMapping("/getCustomersByUserId/{userId}")
@GetMapping("/export") public AjaxResult getCustomersByUserId(@PathVariable String userId){
public AjaxResult export(WeCustomer weCustomer)
{
List<WeCustomer> list = weCustomerService.selectWeCustomerList(weCustomer); return AjaxResult.success(weCustomerService.getCustomersByUserId(userId));
ExcelUtil<WeCustomer> util = new ExcelUtil<WeCustomer>(WeCustomer.class);
return util.exportExcel(list, "customer");
} }
// /**
// * 导出企业微信客户列表
// */
// @PreAuthorize("@ss.hasPermi('wecom:customer:export')")
// @Log(title = "企业微信客户", businessType = BusinessType.EXPORT)
// @GetMapping("/export")
// public AjaxResult export(WeCustomer weCustomer)
// {
// List<WeCustomer> list = weCustomerService.selectWeCustomerList(weCustomer);
// ExcelUtil<WeCustomer> util = new ExcelUtil<WeCustomer>(WeCustomer.class);
// return util.exportExcel(list, "customer");
// }
/** /**
* 获取企业微信客户详细信息 * 获取企业微信客户详细信息
*/ */
@PreAuthorize("@ss.hasPermi('wecom:customer:query')") @PreAuthorize("@ss.hasPermi('customerManage:customer:view')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
...@@ -89,7 +102,7 @@ public class WeCustomerController extends BaseController ...@@ -89,7 +102,7 @@ public class WeCustomerController extends BaseController
* 客户同步接口 * 客户同步接口
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:customer:synchWeCustomer')") @PreAuthorize("@ss.hasPermi('customerManage:customer:sync')")
@Log(title = "企业微信客户同步接口", businessType = BusinessType.DELETE) @Log(title = "企业微信客户同步接口", businessType = BusinessType.DELETE)
@GetMapping("/synchWeCustomer") @GetMapping("/synchWeCustomer")
public AjaxResult synchWeCustomer(){ public AjaxResult synchWeCustomer(){
...@@ -106,7 +119,7 @@ public class WeCustomerController extends BaseController ...@@ -106,7 +119,7 @@ public class WeCustomerController extends BaseController
* @param weMakeCustomerTag * @param weMakeCustomerTag
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:customer:makeLabel')") @PreAuthorize("@ss.hasPermi('customerManage/customer:makeTag')")
@Log(title = "客户打标签", businessType = BusinessType.UPDATE) @Log(title = "客户打标签", businessType = BusinessType.UPDATE)
@PostMapping("/makeLabel") @PostMapping("/makeLabel")
public AjaxResult makeLabel(@RequestBody WeMakeCustomerTag weMakeCustomerTag){ public AjaxResult makeLabel(@RequestBody WeMakeCustomerTag weMakeCustomerTag){
...@@ -121,7 +134,7 @@ public class WeCustomerController extends BaseController ...@@ -121,7 +134,7 @@ public class WeCustomerController extends BaseController
* 移除客户标签 * 移除客户标签
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:customer:removeLabel')") @PreAuthorize("@ss.hasPermi('customerManage:customer:removeTag')")
@Log(title = "移除客户标签", businessType = BusinessType.DELETE) @Log(title = "移除客户标签", businessType = BusinessType.DELETE)
@DeleteMapping("/removeLabel") @DeleteMapping("/removeLabel")
public AjaxResult removeLabel(@RequestBody WeMakeCustomerTag weMakeCustomerTag){ public AjaxResult removeLabel(@RequestBody WeMakeCustomerTag weMakeCustomerTag){
......
...@@ -33,7 +33,7 @@ public class WeDepartmentController extends BaseController ...@@ -33,7 +33,7 @@ public class WeDepartmentController extends BaseController
/** /**
* 查询企业微信组织架构相关列表 * 查询企业微信组织架构相关列表
*/ */
@PreAuthorize("@ss.hasPermi('wecom:department:list')") @PreAuthorize("@ss.hasPermi('contacts:organization:list')")
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("获取部门列表") @ApiOperation("获取部门列表")
public AjaxResult list() public AjaxResult list()
...@@ -47,7 +47,7 @@ public class WeDepartmentController extends BaseController ...@@ -47,7 +47,7 @@ public class WeDepartmentController extends BaseController
/** /**
* 新增企业微信组织架构相关 * 新增企业微信组织架构相关
*/ */
@PreAuthorize("@ss.hasPermi('wecom:department:add')") @PreAuthorize("@ss.hasPermi('contacts:organization:addMember')")
@Log(title = "企业微信组织架构相关", businessType = BusinessType.INSERT) @Log(title = "企业微信组织架构相关", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
@ApiOperation("添加部门") @ApiOperation("添加部门")
...@@ -60,7 +60,7 @@ public class WeDepartmentController extends BaseController ...@@ -60,7 +60,7 @@ public class WeDepartmentController extends BaseController
/** /**
* 修改企业微信组织架构相关 * 修改企业微信组织架构相关
*/ */
@PreAuthorize("@ss.hasPermi('wecom:department:edit')") @PreAuthorize("@ss.hasPermi('contacts:organization:editDep')")
@Log(title = "企业微信组织架构相关", businessType = BusinessType.UPDATE) @Log(title = "企业微信组织架构相关", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
@ApiOperation("更新部门") @ApiOperation("更新部门")
......
package com.linkwechat.web.controller.wecom; package com.linkwechat.web.controller.wecom;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.constant.WeConstans; import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.core.controller.BaseController; import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult; import com.linkwechat.common.core.domain.AjaxResult;
...@@ -11,6 +12,7 @@ import com.linkwechat.wecom.service.IWeGroupService; ...@@ -11,6 +12,7 @@ import com.linkwechat.wecom.service.IWeGroupService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -32,7 +34,7 @@ public class WeGroupController extends BaseController { ...@@ -32,7 +34,7 @@ public class WeGroupController extends BaseController {
@Autowired @Autowired
private IWeGroupMemberService weGroupMemberService; private IWeGroupMemberService weGroupMemberService;
@PreAuthorize("@ss.hasPermi('wecom:group:list')") @PreAuthorize("@ss.hasPermi('customerManage:group:list')")
@GetMapping({"/list"}) @GetMapping({"/list"})
public TableDataInfo list(WeGroup weGroup) { public TableDataInfo list(WeGroup weGroup) {
startPage(); startPage();
...@@ -40,7 +42,9 @@ public class WeGroupController extends BaseController { ...@@ -40,7 +42,9 @@ public class WeGroupController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@PreAuthorize("@ss.hasPermi('wecom:member:list')")
@PreAuthorize("@ss.hasPermi('customerManage:group:view')")
@GetMapping({"/members"}) @GetMapping({"/members"})
public TableDataInfo list(WeGroupMember weGroupMember) { public TableDataInfo list(WeGroupMember weGroupMember) {
startPage(); startPage();
...@@ -52,7 +56,7 @@ public class WeGroupController extends BaseController { ...@@ -52,7 +56,7 @@ public class WeGroupController extends BaseController {
* 同步客户群 * 同步客户群
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:group:synchWeGroup')") @PreAuthorize("@ss.hasPermi('customerManage:group:sync')")
@GetMapping({"/synchWeGroup"}) @GetMapping({"/synchWeGroup"})
public AjaxResult synchWeGroup(){ public AjaxResult synchWeGroup(){
...@@ -61,4 +65,19 @@ public class WeGroupController extends BaseController { ...@@ -61,4 +65,19 @@ public class WeGroupController extends BaseController {
return AjaxResult.success(WeConstans.SYNCH_TIP); return AjaxResult.success(WeConstans.SYNCH_TIP);
} }
/**
* 根据员工id获取员工相关群
* @param userId
* @return
*/
@PreAuthorize("@ss.hasPermi('customerManage:group:sync')")
@GetMapping({"/getGroupsByUserId/{userId}"})
public AjaxResult getGroupsByUserId(@PathVariable String userId){
return AjaxResult.success(weGroupService
.list(new LambdaQueryWrapper<WeGroup>().eq(WeGroup::getOwner,userId)));
}
} }
...@@ -36,7 +36,7 @@ public class WeTagGroupController extends BaseController ...@@ -36,7 +36,7 @@ public class WeTagGroupController extends BaseController
/** /**
* 查询标签组列表 * 查询标签组列表
*/ */
@PreAuthorize("@ss.hasPermi('wecom:group:list')") @PreAuthorize("@ss.hasPermi('customerManage:tag:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(WeTagGroup weTagGroup) public TableDataInfo list(WeTagGroup weTagGroup)
{ {
...@@ -51,7 +51,7 @@ public class WeTagGroupController extends BaseController ...@@ -51,7 +51,7 @@ public class WeTagGroupController extends BaseController
/** /**
* 新增标签组 * 新增标签组
*/ */
@PreAuthorize("@ss.hasPermi('wecom:group:add')") @PreAuthorize("@ss.hasPermi('customerManage:tag:add')")
@Log(title = "标签组", businessType = BusinessType.INSERT) @Log(title = "标签组", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody WeTagGroup weTagGroup) public AjaxResult add(@RequestBody WeTagGroup weTagGroup)
...@@ -64,7 +64,7 @@ public class WeTagGroupController extends BaseController ...@@ -64,7 +64,7 @@ public class WeTagGroupController extends BaseController
/** /**
* 修改标签组 * 修改标签组
*/ */
@PreAuthorize("@ss.hasPermi('wecom:group:edit')") @PreAuthorize("@ss.hasPermi('customerManage:tag:edit')")
@Log(title = "标签组", businessType = BusinessType.UPDATE) @Log(title = "标签组", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody WeTagGroup weTagGroup) public AjaxResult edit(@RequestBody WeTagGroup weTagGroup)
...@@ -76,7 +76,7 @@ public class WeTagGroupController extends BaseController ...@@ -76,7 +76,7 @@ public class WeTagGroupController extends BaseController
/** /**
* 删除标签组 * 删除标签组
*/ */
@PreAuthorize("@ss.hasPermi('wecom:group:remove')") @PreAuthorize("@ss.hasPermi('customerManage:tag:remove')")
@Log(title = "标签组", businessType = BusinessType.DELETE) @Log(title = "标签组", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) public AjaxResult remove(@PathVariable String[] ids)
...@@ -89,7 +89,7 @@ public class WeTagGroupController extends BaseController ...@@ -89,7 +89,7 @@ public class WeTagGroupController extends BaseController
* 同步标签 * 同步标签
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:group:synchWeTags')") @PreAuthorize("@ss.hasPermi('customerManage:tag:sync')")
@GetMapping("/synchWeTags") @GetMapping("/synchWeTags")
public AjaxResult synchWeTags(){ public AjaxResult synchWeTags(){
......
...@@ -7,6 +7,8 @@ import com.linkwechat.common.core.domain.AjaxResult; ...@@ -7,6 +7,8 @@ import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo; import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType; import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.WeUser; import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo;
import com.linkwechat.wecom.domain.vo.WeAllocateGroupsVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
import com.linkwechat.wecom.service.IWeCustomerService; import com.linkwechat.wecom.service.IWeCustomerService;
...@@ -39,7 +41,7 @@ public class WeUserController extends BaseController { ...@@ -39,7 +41,7 @@ public class WeUserController extends BaseController {
/** /**
* 查询通讯录相关客户列表 * 查询通讯录相关客户列表
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:list')") @PreAuthorize("@ss.hasPermi('contacts:organization:query')")
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("获取通讯录人员列表") @ApiOperation("获取通讯录人员列表")
public TableDataInfo list(WeUser weUser) public TableDataInfo list(WeUser weUser)
...@@ -55,7 +57,7 @@ public class WeUserController extends BaseController { ...@@ -55,7 +57,7 @@ public class WeUserController extends BaseController {
/** /**
* 获取通讯录相关客户详细信息 * 获取通讯录相关客户详细信息
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:query')") @PreAuthorize("@ss.hasPermi('contacts:organization:view')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
...@@ -65,7 +67,7 @@ public class WeUserController extends BaseController { ...@@ -65,7 +67,7 @@ public class WeUserController extends BaseController {
/** /**
* 新增通讯录相关客户 * 新增通讯录相关客户
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:add')") @PreAuthorize("@ss.hasPermi('contacts:organization:addMember')")
@Log(title = "通讯录相关客户", businessType = BusinessType.INSERT) @Log(title = "通讯录相关客户", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
@ApiOperation("新增通讯录客户") @ApiOperation("新增通讯录客户")
...@@ -78,7 +80,7 @@ public class WeUserController extends BaseController { ...@@ -78,7 +80,7 @@ public class WeUserController extends BaseController {
/** /**
* 修改通讯录相关客户 * 修改通讯录相关客户
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:edit')") @PreAuthorize("@ss.hasPermi('contacts:organization:edit')")
@Log(title = "更新通讯录客户", businessType = BusinessType.UPDATE) @Log(title = "更新通讯录客户", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
@ApiOperation("更新通讯录客户") @ApiOperation("更新通讯录客户")
...@@ -94,7 +96,7 @@ public class WeUserController extends BaseController { ...@@ -94,7 +96,7 @@ public class WeUserController extends BaseController {
* @param weUser * @param weUser
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:startOrStop')") @PreAuthorize("@ss.hasPermi('contacts:organization:forbidden')")
@Log(title = "启用禁用用户", businessType = BusinessType.UPDATE) @Log(title = "启用禁用用户", businessType = BusinessType.UPDATE)
@PutMapping("/startOrStop") @PutMapping("/startOrStop")
@ApiOperation("是否启用(1表示启用成员,0表示禁用成员)") @ApiOperation("是否启用(1表示启用成员,0表示禁用成员)")
...@@ -111,7 +113,7 @@ public class WeUserController extends BaseController { ...@@ -111,7 +113,7 @@ public class WeUserController extends BaseController {
* @param weLeaveUserVo * @param weLeaveUserVo
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:leaveUserAllocateList')") @PreAuthorize("@ss.hasPermi('customerManage:dimission:filter')")
@GetMapping({"/leaveUserAllocateList"}) @GetMapping({"/leaveUserAllocateList"})
public TableDataInfo leaveUserAllocateList(WeLeaveUserVo weLeaveUserVo) { public TableDataInfo leaveUserAllocateList(WeLeaveUserVo weLeaveUserVo) {
startPage(); startPage();
...@@ -127,7 +129,7 @@ public class WeUserController extends BaseController { ...@@ -127,7 +129,7 @@ public class WeUserController extends BaseController {
* @param weLeaveUserVo * @param weLeaveUserVo
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:leaveUserNoAllocateList')") @PreAuthorize("@ss.hasPermi('customerManage:dimission:query')")
@GetMapping({"/leaveUserNoAllocateList"}) @GetMapping({"/leaveUserNoAllocateList"})
public TableDataInfo leaveUserNoAllocateList(WeLeaveUserVo weLeaveUserVo) { public TableDataInfo leaveUserNoAllocateList(WeLeaveUserVo weLeaveUserVo) {
startPage(); startPage();
...@@ -143,7 +145,7 @@ public class WeUserController extends BaseController { ...@@ -143,7 +145,7 @@ public class WeUserController extends BaseController {
* @param weLeaveUserInfoAllocateVo * @param weLeaveUserInfoAllocateVo
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:allocateLeaveUserAboutData')") @PreAuthorize("@ss.hasPermi('customerManage:dimission:allocate')")
@PutMapping({"/allocateLeaveUserAboutData"}) @PutMapping({"/allocateLeaveUserAboutData"})
public AjaxResult allocateLeaveUserAboutData(@RequestBody WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo) { public AjaxResult allocateLeaveUserAboutData(@RequestBody WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo) {
...@@ -157,7 +159,7 @@ public class WeUserController extends BaseController { ...@@ -157,7 +159,7 @@ public class WeUserController extends BaseController {
* 同步成员 * 同步成员
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:synchWeUser')") @PreAuthorize("@ss.hasPermi('contacts:organization:sync')")
@GetMapping({"/synchWeUser"}) @GetMapping({"/synchWeUser"})
public AjaxResult synchWeUser(){ public AjaxResult synchWeUser(){
...@@ -172,7 +174,7 @@ public class WeUserController extends BaseController { ...@@ -172,7 +174,7 @@ public class WeUserController extends BaseController {
* 删除用户 * 删除用户
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('wecom:user:deleteUser')") @PreAuthorize("@ss.hasPermi('contacts:organization:removeMember')")
@DeleteMapping({"/{ids}"}) @DeleteMapping({"/{ids}"})
public AjaxResult deleteUser(@PathVariable String[] ids){ public AjaxResult deleteUser(@PathVariable String[] ids){
...@@ -184,6 +186,33 @@ public class WeUserController extends BaseController { ...@@ -184,6 +186,33 @@ public class WeUserController extends BaseController {
} }
/**
* 获取历史分配记录的成员
* @param weAllocateCustomersVo
* @return
*/
@PreAuthorize("@ss.hasPermi('wecom:user:getAllocateCustomers')")
@GetMapping({"/getAllocateCustomers"})
public TableDataInfo getAllocateCustomers(WeAllocateCustomersVo weAllocateCustomersVo){
startPage();
List<WeAllocateCustomersVo> list = weUserService.getAllocateCustomers(weAllocateCustomersVo);
return getDataTable(list);
}
/**
* 获取历史分配记录的群
* @param weAllocateGroupsVo
* @return
*/
@PreAuthorize("@ss.hasPermi('wecom:user:getAllocateGroups')")
@GetMapping({"/getAllocateGroups"})
public TableDataInfo getAllocateGroups(WeAllocateGroupsVo weAllocateGroupsVo){
startPage();
List<WeAllocateGroupsVo> list = weUserService.getAllocateGroups(weAllocateGroupsVo);
return getDataTable(list);
}
......
...@@ -2,7 +2,7 @@ import request from '@/utils/request' ...@@ -2,7 +2,7 @@ import request from '@/utils/request'
const service = config.services.wecom + '/user' const service = config.services.wecom + '/user'
/** /**
* 获取离职未分配员工列表 * 获取离职已分配员工列表
* @param {*} params * @param {*} params
* { * {
pageNum: pageNum:
...@@ -20,7 +20,7 @@ export function getList(params) { ...@@ -20,7 +20,7 @@ export function getList(params) {
} }
/** /**
* 获取离职已分配员工列表 * 获取离职未分配员工列表
* @param {*} params * @param {*} params
* { * {
pageNum: pageNum:
...@@ -52,3 +52,21 @@ export function allocate(data) { ...@@ -52,3 +52,21 @@ export function allocate(data) {
data data
}) })
} }
/**
* 离职已分配客户
* @param {*} params
{
"pageNum": 0,
"pageSize": 0,
"beginTime": "",
"endTime": "",
"handoverUserId": ""
}
*/
export function getAllocateCustomers(params) {
return request({
url: service + '/getAllocateCustomers',
params
})
}
...@@ -139,11 +139,11 @@ export default { ...@@ -139,11 +139,11 @@ export default {
}); });
}, },
handleNodeClick(data) { handleNodeClick(data) {
data.id != 1 && (this.query.department = data.id); this.query.department = data.id == 1 ? "" : data.id;
this.getList(1); this.getList(1);
}, },
edit(data, type) { edit(data, type) {
this.form = Object.assign({}, data || {}); this.form = Object.assign({}, data || { _new: true });
this.dialogVisible = true; this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true); type || !data ? (this.disabled = false) : (this.disabled = true);
}, },
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
let form = JSON.parse(JSON.stringify(this.form)); let form = JSON.parse(JSON.stringify(this.form));
form.department += ""; form.department += "";
form.isLeaderInDept += ""; form.isLeaderInDept += "";
api[form.userId ? "updateUser" : "addUser"](form) api[form._new ? "addUser" : "updateUser"](form)
.then(() => { .then(() => {
this.msgSuccess("操作成功"); this.msgSuccess("操作成功");
this.dialogVisible = false; this.dialogVisible = false;
...@@ -360,7 +360,7 @@ export default { ...@@ -360,7 +360,7 @@ export default {
@click="edit(scope.row, 0)" @click="edit(scope.row, 0)"
>查看</el-button> >查看</el-button>
<el-button <el-button
v-hasPermi="['contacts:organization:forbidden']" v-hasPermi="['contacts:organization:setStatus']"
v-if="scope.row.userId !== 1 && scope.row.enable < 2" v-if="scope.row.userId !== 1 && scope.row.enable < 2"
type="text" type="text"
@click="startOrStop(scope.row)" @click="startOrStop(scope.row)"
...@@ -373,7 +373,7 @@ export default { ...@@ -373,7 +373,7 @@ export default {
>编辑</el-button> >编辑</el-button>
<el-button <el-button
v-if="scope.row.enable < 2" v-if="scope.row.enable < 2"
v-hasPermi="['customerManage:tag:remove']" v-hasPermi="['contacts:organization:remove']"
@click="remove(scope.row.userId)" @click="remove(scope.row.userId)"
type="text" type="text"
>删除</el-button> >删除</el-button>
......
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
}, },
submit() { submit() {
this.Pvisible = false; this.Pvisible = false;
this.$emit("success", this.userList.splice(0)); this.$emit("success", this.userList);
}, },
}, },
}; };
......
<script>
import { getAllocateCustomers } from "@/api/customer/dimission";
import AllocatedStaffDetailList from "./allocatedStaffDetailList";
export default {
name: "AllocatedStaffDetail",
components: { AllocatedStaffDetailList },
props: {},
data() {
return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
handoverUserId: undefined,
beginTime: undefined,
endTime: undefined,
},
loading: false,
total: 0,
list: [],
dateRange: [], // 离职日期
// 日期快捷选项
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {
getList() {
this.$refs.AllocatedStaffDetailList.getList(1);
},
resetForm(formName) {
this.dateRange = [];
this.$refs["queryForm"].resetFields();
},
},
};
</script>
<template>
<div class="page">
<el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search">
<el-form-item label="离职日期">
<el-date-picker
v-model="dateRange"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="primary"
@click="getList(1)"
>查询</el-button>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="info"
@click="resetForm('queryForm')"
>重置</el-button>
</el-form-item>
</el-form>
<el-tabs value="first" type="card">
<el-tab-pane label="已分配客户" name="first">
<AllocatedStaffDetailList ref="AllocatedStaffDetailList" :dateRange="dateRange"></AllocatedStaffDetailList>
</el-tab-pane>
<el-tab-pane label="已分配群聊" name="second">
<AllocatedStaffDetailList ref="AllocatedStaffDetailList" :dateRange="dateRange"></AllocatedStaffDetailList>
</el-tab-pane>
</el-tabs>
</div>
</template>
<style lang="scss" scoped>
</style>
<script>
import { getAllocateCustomers } from "@/api/customer/dimission";
export default {
name: "AllocatedStaffDetailList",
components: {},
props: {
dateRange: {
type: Array,
default: () => [],
},
},
data() {
return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
handoverUserId: undefined,
beginTime: undefined,
endTime: undefined,
},
loading: false,
total: 0,
list: [],
};
},
watch: {},
computed: {},
created() {
this.query.handoverUserId = this.$route.query.userId;
this.getList();
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
}
page && (this.query.pageNum = page);
this.loading = true;
getAllocateCustomers(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
},
};
</script>
<template>
<div class="page">
<el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%">
<el-table-column prop="customerName" label="客户名称"></el-table-column>
<el-table-column prop="takeUserName" label="接替员工"></el-table-column>
<el-table-column prop="department" label="接替员工所属部门" show-overflow-tooltip></el-table-column>
<el-table-column prop="allocateTime" label="分配时间" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button
v-hasPermi="['customerManage:dimission:edit']"
@click="$router.push({path: '/customerManage/customerDetail', query: {id: scope.row.id}})"
type="text"
size="small"
>查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
</div>
</template>
<style lang="scss" scoped>
</style>
<script>
import { getList } from "@/api/customer/dimission";
export default {
name: "AllocatedStaffList",
components: {},
props: {},
data() {
return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
userName: undefined,
beginTime: undefined,
endTime: undefined,
},
loading: false,
total: 0,
list: [],
dialogVisibleSelectUser: false,
dateRange: [], // 离职日期
// 日期快捷选项
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
};
},
watch: {},
computed: {},
created() {
this.getList();
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
}
page && (this.query.pageNum = page);
this.loading = true;
getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
resetForm(formName) {
this.dateRange = [];
this.$refs["queryForm"].resetFields();
},
},
};
</script>
<template>
<div class="page">
<el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search">
<el-form-item label="已离职员工">
<el-input v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="离职日期">
<el-date-picker
v-model="dateRange"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="primary"
@click="getList(1)"
>查询</el-button>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="info"
@click="resetForm('queryForm')"
>重置</el-button>
</el-form-item>
</el-form>
<el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%">
<el-table-column type="index" label="序号" width="55"></el-table-column>
<el-table-column prop="userName" label="已离职员工"></el-table-column>
<el-table-column prop="department" label="所属部门"></el-table-column>
<el-table-column prop="allocateCustomerNum" label="已分配客户数" show-overflow-tooltip></el-table-column>
<el-table-column prop="allocateGroupNum" label="已分配群聊数" show-overflow-tooltip></el-table-column>
<el-table-column prop="dimissionTime" label="离职时间" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.dimissionTime }}</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button
v-hasPermi="['customerManage:dimission:edit']"
@click="$router.push({path: '/customerManage/allocatedStaffDetail', query: {userId: scope.row.userId}})"
type="text"
size="small"
>查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
</div>
</template>
<style lang="scss" scoped>
</style>
<script> <script>
import * as api from "@/api/customer/dimission"; import * as api from "@/api/customer/dimission";
import SelectUser from "./components/SelectUser"; import SelectUser from "../components/SelectUser";
export default { export default {
name: "Dimission", name: "Dimission",
...@@ -14,6 +14,7 @@ export default { ...@@ -14,6 +14,7 @@ export default {
pageSize: 10, pageSize: 10,
userName: undefined, userName: undefined,
beginTime: undefined, beginTime: undefined,
endTime: undefined,
}, },
loading: false, loading: false,
isMoreFilter: false, isMoreFilter: false,
...@@ -23,8 +24,44 @@ export default { ...@@ -23,8 +24,44 @@ export default {
region: "", region: "",
}, },
list: [], list: [],
multipleSelection: [], currentRow: {},
dialogVisibleSelectUser: false, dialogVisibleSelectUser: false,
dateRange: [], // 离职日期
// 日期快捷选项
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
}; };
}, },
watch: {}, watch: {},
...@@ -36,6 +73,10 @@ export default { ...@@ -36,6 +73,10 @@ export default {
methods: { methods: {
/** 查询 */ /** 查询 */
getList(page) { getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
}
page && (this.query.pageNum = page); page && (this.query.pageNum = page);
this.loading = true; this.loading = true;
api api
...@@ -60,21 +101,33 @@ export default { ...@@ -60,21 +101,33 @@ export default {
}); });
}, },
resetForm(formName) { resetForm(formName) {
this.dateRange = [];
this.$refs["queryForm"].resetFields(); this.$refs["queryForm"].resetFields();
}, },
showSelectDialog() {
if (this.currentRow.userId) {
this.dialogVisibleSelectUser = true;
} else {
this.$message.warning("请先选择一位员工");
}
},
allocate(userlist) { allocate(userlist) {
if (userlist.length > 1) {
this.dialogVisibleSelectUser = true;
return;
}
api api
.allocate({ .allocate({
handoverUserid: this.multipleSelection[0].id, handoverUserid: this.currentRow.userId,
takeoverUserid: userlist[0].id, takeoverUserid: userlist[0].userId,
}) })
.then(() => { .then(() => {
this.msgSuccess("操作成功"); this.msgSuccess("操作成功");
}); });
}, },
// 多选框选中数据 // 选中数据
handleSelectionChange(selection) { handleCurrentChange(val) {
this.multipleSelection = selection; this.currentRow = val;
}, },
}, },
}; };
...@@ -86,6 +139,17 @@ export default { ...@@ -86,6 +139,17 @@ export default {
<el-form-item label="已离职员工"> <el-form-item label="已离职员工">
<el-input v-model="query.userName" placeholder="请输入"></el-input> <el-input v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="离职日期">
<el-date-picker
v-model="dateRange"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label="离职日期"> <el-form-item label="离职日期">
<el-date-picker v-model="query.beginTime" type="date" placeholder="离职日期" align="right"></el-date-picker> <el-date-picker v-model="query.beginTime" type="date" placeholder="离职日期" align="right"></el-date-picker>
...@@ -111,13 +175,13 @@ export default { ...@@ -111,13 +175,13 @@ export default {
v-hasPermi="['customerManage:dimission:filter']" v-hasPermi="['customerManage:dimission:filter']"
type="primary" type="primary"
size="mini" size="mini"
@click="getList(1)" @click="$router.push({path: '/customerManage/allocatedStaffList'})"
>已分配的离职员工</el-button> >已分配的离职员工</el-button>
<el-button <el-button
v-hasPermi="['customerManage:dimission:allocate']" v-hasPermi="['customerManage:dimission:allocate']"
type="primary" type="primary"
size="mini" size="mini"
@click="dialogVisibleSelectUser = true" @click="showSelectDialog"
>分配给其他员工</el-button> >分配给其他员工</el-button>
</div> </div>
</div> </div>
...@@ -127,27 +191,22 @@ export default { ...@@ -127,27 +191,22 @@ export default {
:data="list" :data="list"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="handleSelectionChange" highlight-current-row
@current-change="handleCurrentChange"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="index" label="序号" width="55"></el-table-column>
<el-table-column prop="userName" label="已离职员工" width="120"></el-table-column> <el-table-column prop="userName" label="已离职员工"></el-table-column>
<el-table-column prop="department" label="所属部门" width="120"></el-table-column> <el-table-column prop="department" label="所属部门"></el-table-column>
<el-table-column prop="allocateCustomerNum" label="待分配客户数" show-overflow-tooltip></el-table-column> <el-table-column prop="allocateCustomerNum" label="待分配客户数" show-overflow-tooltip></el-table-column>
<el-table-column prop="allocateGroupNum" label="待分配群聊数" show-overflow-tooltip></el-table-column> <el-table-column prop="allocateGroupNum" label="待分配群聊数" show-overflow-tooltip></el-table-column>
<el-table-column prop="dimissionTime" label="离职时间" show-overflow-tooltip> <el-table-column prop="dimissionTime" label="离职时间" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.dimissionTime }}</template> <template slot-scope="scope">{{ scope.row.dimissionTime }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <!-- <el-table-column label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button
v-hasPermi="['customerManage:dimission:edit']"
@click="handleClick(scope.row)"
type="text"
size="small"
>查看</el-button>-->
<el-button v-hasPermi="['customerManage:dimission:edit']" type="text" size="small">编辑</el-button> <el-button v-hasPermi="['customerManage:dimission:edit']" type="text" size="small">编辑</el-button>
</template> </template>
</el-table-column> </el-table-column>-->
</el-table> </el-table>
<pagination <pagination
......
package com.linkwechat.wecom.domain.vo; package com.linkwechat.wecom.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
* @description: 已分配员工信息 * @description: 已分配客户信息
* @author: HaoN * @author: HaoN
* @create: 2020-10-28 00:13 * @create: 2020-10-28 00:13
**/ **/
@Data @Data
public class WeAllocateCustomersVo { public class WeAllocateCustomersVo extends BaseEntity {
/**客户名称*/ /**客户名称*/
private String customerName; private String customerName;
...@@ -18,8 +20,12 @@ public class WeAllocateCustomersVo { ...@@ -18,8 +20,12 @@ public class WeAllocateCustomersVo {
private String takeUserName; private String takeUserName;
/**分配时间*/ /**分配时间*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date allocateTime; private Date allocateTime;
/**接替人所在部门*/ /**接替人所在部门*/
private String department; private String department;
/**原拥有着*/
private String handoverUserId;
} }
package com.linkwechat.wecom.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* @description: 已分配群信息
* @author: HaoN
* @create: 2020-10-28 00:13
**/
@Data
public class WeAllocateGroupsVo extends BaseEntity {
/**群id*/
private String chatId;
/**群名称*/
private String groupName;
/**群客户数量*/
private Integer memberNum;
/**群主所在部门*/
private String department;
/**分配时间*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date allocateTime;
/**新群主名称*/
private String newOwnerName;
/**原群主id*/
private String oldOwner;
}
...@@ -4,6 +4,8 @@ import java.util.List; ...@@ -4,6 +4,8 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeCustomer; import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeUser;
import org.apache.ibatis.annotations.Param;
/** /**
* 企业微信客户Mapper接口 * 企业微信客户Mapper接口
...@@ -60,4 +62,12 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer> ...@@ -60,4 +62,12 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @return 结果 * @return 结果
*/ */
public int deleteWeCustomerByIds(Long[] ids); public int deleteWeCustomerByIds(Long[] ids);
/**
* 根据员工ID获取客户
* @param userId
* @return
*/
public List<WeUser> getCustomersByUserId(@Param("userId") String userId);
} }
...@@ -2,6 +2,8 @@ package com.linkwechat.wecom.mapper; ...@@ -2,6 +2,8 @@ package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeUser; import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo;
import com.linkwechat.wecom.domain.vo.WeAllocateGroupsVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -78,4 +80,21 @@ public interface WeUserMapper extends BaseMapper<WeUser> ...@@ -78,4 +80,21 @@ public interface WeUserMapper extends BaseMapper<WeUser>
* @return * @return
*/ */
public int batchInsertWeUser(@Param("weUsers") List<WeUser> weUsers); public int batchInsertWeUser(@Param("weUsers") List<WeUser> weUsers);
/**
* 获取历史分配记录的成员
* @param weAllocateCustomersVo
* @return
*/
public List<WeAllocateCustomersVo> getAllocateCustomers(WeAllocateCustomersVo weAllocateCustomersVo);
/**
* 获取历史分配群
* @param weAllocateGroupsVo
* @return
*/
public List<WeAllocateGroupsVo> getAllocateGroups(WeAllocateGroupsVo weAllocateGroupsVo);
} }
package com.linkwechat.wecom.service; package com.linkwechat.wecom.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomer; import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeMakeCustomerTag; import com.linkwechat.wecom.domain.vo.WeMakeCustomerTag;
import java.util.List;
/** /**
* 企业微信客户Service接口 * 企业微信客户Service接口
* *
...@@ -58,4 +59,12 @@ public interface IWeCustomerService extends IService<WeCustomer> ...@@ -58,4 +59,12 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @param weMakeCustomerTag * @param weMakeCustomerTag
*/ */
public void removeLabel(WeMakeCustomerTag weMakeCustomerTag); public void removeLabel(WeMakeCustomerTag weMakeCustomerTag);
/**
* 根据员工ID获取客户
* @param userId
* @return
*/
public List<WeUser> getCustomersByUserId(String userId);
} }
...@@ -2,6 +2,8 @@ package com.linkwechat.wecom.service; ...@@ -2,6 +2,8 @@ package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeUser; import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo;
import com.linkwechat.wecom.domain.vo.WeAllocateGroupsVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
...@@ -90,4 +92,20 @@ public interface IWeUserService extends IService<WeUser> ...@@ -90,4 +92,20 @@ public interface IWeUserService extends IService<WeUser>
*/ */
void deleteUser(String[] ids); void deleteUser(String[] ids);
/**
* 获取历史分配记录的成员
* @param weAllocateCustomersVo
* @return
*/
List<WeAllocateCustomersVo> getAllocateCustomers(WeAllocateCustomersVo weAllocateCustomersVo);
/**
* 获取历史分配群
* @param weAllocateGroupsVo
* @return
*/
List<WeAllocateGroupsVo> getAllocateGroups(WeAllocateGroupsVo weAllocateGroupsVo);
} }
...@@ -449,4 +449,15 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom ...@@ -449,4 +449,15 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
} }
/**
* 根据员工ID获取客户
* @param userId
* @return
*/
@Override
public List<WeUser> getCustomersByUserId(String userId) {
return this.baseMapper.getCustomersByUserId(userId);
}
} }
...@@ -14,6 +14,8 @@ import com.linkwechat.wecom.domain.dto.LeaveWeUserListsDto; ...@@ -14,6 +14,8 @@ import com.linkwechat.wecom.domain.dto.LeaveWeUserListsDto;
import com.linkwechat.wecom.domain.dto.WeDepartMentDto; import com.linkwechat.wecom.domain.dto.WeDepartMentDto;
import com.linkwechat.wecom.domain.dto.WeUserDto; import com.linkwechat.wecom.domain.dto.WeUserDto;
import com.linkwechat.wecom.domain.dto.WeUserListDto; import com.linkwechat.wecom.domain.dto.WeUserListDto;
import com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo;
import com.linkwechat.wecom.domain.vo.WeAllocateGroupsVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
import com.linkwechat.wecom.mapper.WeUserMapper; import com.linkwechat.wecom.mapper.WeUserMapper;
...@@ -232,4 +234,26 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen ...@@ -232,4 +234,26 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
} }
/**
* 获取历史分配记录的成员
* @param weAllocateCustomersVo
* @return
*/
@Override
public List<WeAllocateCustomersVo> getAllocateCustomers(WeAllocateCustomersVo weAllocateCustomersVo) {
return this.baseMapper.getAllocateCustomers(weAllocateCustomersVo);
}
/**
* 获取历史分配群
* @param weAllocateGroupsVo
* @return
*/
@Override
public List<WeAllocateGroupsVo> getAllocateGroups(WeAllocateGroupsVo weAllocateGroupsVo) {
return this.baseMapper.getAllocateGroups(weAllocateGroupsVo);
}
} }
...@@ -138,4 +138,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -138,4 +138,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<select id="getCustomersByUserId" resultType="com.linkwechat.wecom.domain.WeUser">
SELECT
wc.external_userid,
wc.`name`,
wc.avatar,
wc.type,
wc.gender,
wc.unionid,
wc.birthday,
wc.corp_name,
wc.corp_full_name,
wc.position
FROM
`we_flower_customer_rel` wfcr
LEFT JOIN we_customer wc ON wc.external_userid = wfcr.external_userid
WHERE
wfcr.user_id = #{userId}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -217,18 +217,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -217,18 +217,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <select id="getAllocateCustomers">--> <select id="getAllocateCustomers" parameterType="WeAllocateCustomersVo" resultType="com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo">
<!-- SELECT--> SELECT
<!-- wc.`name`,--> wc.`name` as customerName,
<!-- wu.user_name,--> wu.user_name as takeUserName,
<!-- wac.allocate_time,--> wac.allocate_time,
<!-- (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department--> (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
<!--FROM--> FROM
<!-- we_allocate_customer wac--> we_allocate_customer wac
<!--LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid--> LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid
<!--LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid--> LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid
<!-- --> <where>
<!-- </select>--> <if test="handoverUserId != null and handoverUserId !=''">and wac.handover_userid=#{handoverUserId}</if>
<if test="beginTime != null and beginTime !='' and endTime != null and endTime !=''">
DATE_FORMAT(wu.dimission_time,'%Y-%m-%d') BETWEEN #{beginTime} AND #{endTime}
</if>
</where>
</select>
<select id="getAllocateGroups" parameterType="WeAllocateGroupsVo" resultType="com.linkwechat.wecom.domain.vo.WeAllocateGroupsVo">
SELECT
wu.user_name as newOwnerName,
wg.chat_id,
wg.group_name,
(SELECT count(*) FROM we_group_member wgm WHERE wgm.chat_id=wg.chat_id) as memberNum,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department,
wag.allocate_time
FROM
we_allocate_group wag
LEFT JOIN we_group wg ON wag.chat_id=wg.chat_id
LEFT JOIN we_user wu ON wu.user_id=wag.new_owner
<where>
<if test="oldOwner != null and oldOwner !=''">and wag.old_owner=#{oldOwner}</if>
<if test="beginTime != null and beginTime !='' and endTime != null and endTime !=''">
DATE_FORMAT(wu.dimission_time,'%Y-%m-%d') BETWEEN #{beginTime} AND #{endTime}
</if>
</where>
</select>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<velocity.version>1.7</velocity.version> <velocity.version>1.7</velocity.version>
<jwt.version>0.9.0</jwt.version> <jwt.version>0.9.0</jwt.version>
<forest.version>1.4.0</forest.version> <forest.version>1.4.0</forest.version>
<lombok.version>1.16.18</lombok.version> <lombok.version>1.18.16</lombok.version>
<reflectasm.version>1.11.9</reflectasm.version> <reflectasm.version>1.11.9</reflectasm.version>
<hutool.version>5.4.1</hutool.version> <hutool.version>5.4.1</hutool.version>
<zxing.version>3.3.3</zxing.version> <zxing.version>3.3.3</zxing.version>
......
This diff could not be displayed because it is too large.
-- ----------------------------
-- 1、存储每一个已配置的 jobDetail 的详细信息
-- ----------------------------
drop table if exists QRTZ_JOB_DETAILS;
create table QRTZ_JOB_DETAILS (
sched_name varchar(120) not null,
job_name varchar(200) not null,
job_group varchar(200) not null,
description varchar(250) null,
job_class_name varchar(250) not null,
is_durable varchar(1) not null,
is_nonconcurrent varchar(1) not null,
is_update_data varchar(1) not null,
requests_recovery varchar(1) not null,
job_data blob null,
primary key (sched_name,job_name,job_group)
) engine=innodb;
-- ----------------------------
-- 2、 存储已配置的 Trigger 的信息
-- ----------------------------
drop table if exists QRTZ_TRIGGERS;
create table QRTZ_TRIGGERS (
sched_name varchar(120) not null,
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
job_name varchar(200) not null,
job_group varchar(200) not null,
description varchar(250) null,
next_fire_time bigint(13) null,
prev_fire_time bigint(13) null,
priority integer null,
trigger_state varchar(16) not null,
trigger_type varchar(8) not null,
start_time bigint(13) not null,
end_time bigint(13) null,
calendar_name varchar(200) null,
misfire_instr smallint(2) null,
job_data blob null,
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,job_name,job_group) references QRTZ_JOB_DETAILS(sched_name,job_name,job_group)
) engine=innodb;
-- ----------------------------
-- 3、 存储简单的 Trigger,包括重复次数,间隔,以及已触发的次数
-- ----------------------------
drop table if exists QRTZ_SIMPLE_TRIGGERS;
create table QRTZ_SIMPLE_TRIGGERS (
sched_name varchar(120) not null,
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
repeat_count bigint(7) not null,
repeat_interval bigint(12) not null,
times_triggered bigint(10) not null,
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
) engine=innodb;
-- ----------------------------
-- 4、 存储 Cron Trigger,包括 Cron 表达式和时区信息
-- ----------------------------
drop table if exists QRTZ_CRON_TRIGGERS;
create table QRTZ_CRON_TRIGGERS (
sched_name varchar(120) not null,
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
cron_expression varchar(200) not null,
time_zone_id varchar(80),
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
) engine=innodb;
-- ----------------------------
-- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型,JobStore 并不知道如何存储实例的时候)
-- ----------------------------
drop table if exists QRTZ_BLOB_TRIGGERS;
create table QRTZ_BLOB_TRIGGERS (
sched_name varchar(120) not null,
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
blob_data blob null,
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
) engine=innodb;
-- ----------------------------
-- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围
-- ----------------------------
drop table if exists QRTZ_CALENDARS;
create table QRTZ_CALENDARS (
sched_name varchar(120) not null,
calendar_name varchar(200) not null,
calendar blob not null,
primary key (sched_name,calendar_name)
) engine=innodb;
-- ----------------------------
-- 7、 存储已暂停的 Trigger 组的信息
-- ----------------------------
drop table if exists QRTZ_PAUSED_TRIGGER_GRPS;
create table QRTZ_PAUSED_TRIGGER_GRPS (
sched_name varchar(120) not null,
trigger_group varchar(200) not null,
primary key (sched_name,trigger_group)
) engine=innodb;
-- ----------------------------
-- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息
-- ----------------------------
drop table if exists QRTZ_FIRED_TRIGGERS;
create table QRTZ_FIRED_TRIGGERS (
sched_name varchar(120) not null,
entry_id varchar(95) not null,
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
instance_name varchar(200) not null,
fired_time bigint(13) not null,
sched_time bigint(13) not null,
priority integer not null,
state varchar(16) not null,
job_name varchar(200) null,
job_group varchar(200) null,
is_nonconcurrent varchar(1) null,
requests_recovery varchar(1) null,
primary key (sched_name,entry_id)
) engine=innodb;
-- ----------------------------
-- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例
-- ----------------------------
drop table if exists QRTZ_SCHEDULER_STATE;
create table QRTZ_SCHEDULER_STATE (
sched_name varchar(120) not null,
instance_name varchar(200) not null,
last_checkin_time bigint(13) not null,
checkin_interval bigint(13) not null,
primary key (sched_name,instance_name)
) engine=innodb;
-- ----------------------------
-- 10、 存储程序的悲观锁的信息(假如使用了悲观锁)
-- ----------------------------
drop table if exists QRTZ_LOCKS;
create table QRTZ_LOCKS (
sched_name varchar(120) not null,
lock_name varchar(40) not null,
primary key (sched_name,lock_name)
) engine=innodb;
drop table if exists QRTZ_SIMPROP_TRIGGERS;
create table QRTZ_SIMPROP_TRIGGERS (
sched_name varchar(120) not null,
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
str_prop_1 varchar(512) null,
str_prop_2 varchar(512) null,
str_prop_3 varchar(512) null,
int_prop_1 int null,
int_prop_2 int null,
long_prop_1 bigint null,
long_prop_2 bigint null,
dec_prop_1 numeric(13,4) null,
dec_prop_2 numeric(13,4) null,
bool_prop_1 varchar(1) null,
bool_prop_2 varchar(1) null,
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
) engine=innodb;
commit;
\ No newline at end of file \ No newline at end of file
This diff could not be displayed because it is too large.
File mode changed
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!