提交 beb4e67a 编写于 作者: [ [zmy2771345724]

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

......@@ -69,15 +69,16 @@ public class WeDepartmentController extends BaseController
weDepartmentService.updateWeDepartment(weDepartment);
return AjaxResult.success();
}
//
// /**
// * 删除企业微信组织架构相关
// */
// @PreAuthorize("@ss.hasPermi('wecom:department:remove')")
// @Log(title = "企业微信组织架构相关", businessType = BusinessType.DELETE)
// @DeleteMapping("/{ids}")
// public AjaxResult remove(@PathVariable Long[] ids)
// public AjaxResult remove(@PathVariable String[] ids)
// {
// return toAjax(weDepartmentService.deleteWeDepartmentByIds(ids));
// }
}
......@@ -116,8 +116,8 @@ public class WeUserController extends BaseController {
public TableDataInfo leaveUserAllocateList(WeLeaveUserVo weLeaveUserVo) {
startPage();
weLeaveUserVo.setIsActivate(WeConstans.WE_USER_IS_LEAVE);
weLeaveUserVo.setIsAllocate(WeConstans.LEAVE_ALLOCATE_STATE);
List<WeLeaveUserVo> list = this.weUserService.leaveNoAllocateUserList(weLeaveUserVo);
weLeaveUserVo.setIsAllocate(WeConstans.LEAVE_ALLOCATE_STATE);
List<WeLeaveUserVo> list = this.weUserService.leaveAllocateUserList(weLeaveUserVo);
return getDataTable(list);
}
......@@ -147,7 +147,7 @@ public class WeUserController extends BaseController {
@PutMapping({"/allocateLeaveUserAboutData"})
public AjaxResult allocateLeaveUserAboutData(@RequestBody WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo) {
weUserService.allocateLeaveUserAboutData(weLeaveUserInfoAllocateVo);
weUserService.allocateLeaveUserAboutData(weLeaveUserInfoAllocateVo);
return AjaxResult.success("离职分配成功");
}
......
......@@ -138,8 +138,8 @@ export default {
this.loading = false;
});
},
handleNodeClick(data, node) {
this.query.department = data.id;
handleNodeClick(data) {
data.id != 1 && (this.query.department = data.id);
this.getList(1);
},
edit(data, type) {
......
......@@ -42,9 +42,9 @@ export default {
};
},
created() {
this.getList();
this.group = this.$route.query;
this.query.groupId = this.group.id;
this.query.chatId = this.group.chatId;
this.getList();
},
methods: {
getList(page) {
......@@ -143,7 +143,7 @@ export default {
</el-input>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="群成员" align="center" prop="operId">
<el-table-column label="群成员" align="center" prop="memberName">
<template slot-scope="scope">
{{ scope.row.memberName }}
<!-- <span
......
......@@ -41,26 +41,6 @@ public class WeMaterial extends BaseEntity {
*/
private String digest;
/**
* 媒体id
*/
private String materialMediaId;
/**
* 媒体文件上传时间戳
*/
private String materialCreatedAt;
/**
* 视频封面媒体id
*/
private String coverMediaId;
/**
* 视频封面媒体文件上传时间戳
*/
private String coverCreatedAt;
/**
* 封面本地资源文件
*/
......
package com.linkwechat.wecom.domain.vo;
import lombok.Data;
import java.util.Date;
/**
* @description: 已分配员工信息
* @author: HaoN
* @create: 2020-10-28 00:13
**/
@Data
public class WeAllocateCustomersVo {
/**客户名称*/
private String customerName;
/**接替人名称*/
private String takeUserName;
/**分配时间*/
private Date allocateTime;
/**接替人所在部门*/
private String department;
}
......@@ -20,14 +20,4 @@ public class WeMaterialFileVO {
*/
private String materialUrl;
/**
* 媒体id
*/
private String materialMediaId;
/**
* 媒体文件上传时间戳
*/
private Long materialCreatedAt;
}
......@@ -14,13 +14,6 @@ import org.apache.ibatis.annotations.Param;
*/
public interface IWeDepartmentService extends IService<WeDepartment>
{
/**
* 查询企业微信组织架构相关
*
* @param id 企业微信组织架构相关ID
* @return 企业微信组织架构相关
*/
public WeDepartment selectWeDepartmentById(Long id);
/**
* 查询企业微信组织架构相关列表
......@@ -47,23 +40,16 @@ public interface IWeDepartmentService extends IService<WeDepartment>
/**
* 批量保存
* @param weDepartments
* @return
*/
public int batchInsertWeDepartment(List<WeDepartment> weDepartments);
/**
* 删除部门表所有数据
* @return
*/
public int deleteAllWeDepartment();
/**
* 同步部门
*/
public List<WeDepartment> synchWeDepartment();
// /**
// * 根据部门id删除部门
// * @param ids
// */
// public void deleteWeDepartmentByIds(String[] ids);
}
......@@ -2,6 +2,8 @@ package com.linkwechat.wecom.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.common.constant.HttpStatus;
import com.linkwechat.common.constant.WeConstans;
......@@ -10,10 +12,12 @@ import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.common.utils.bean.BeanUtils;
import com.linkwechat.wecom.client.WeDepartMentClient;
import com.linkwechat.wecom.domain.WeDepartment;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.dto.WeDepartMentDto;
import com.linkwechat.wecom.domain.dto.WeResultDto;
import com.linkwechat.wecom.mapper.WeDepartmentMapper;
import com.linkwechat.wecom.service.IWeDepartmentService;
import com.linkwechat.wecom.service.IWeUserService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -39,18 +43,11 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe
private WeDepartMentClient weDepartMentClient;
@Autowired
private IWeUserService weUserService;
/**
* 查询企业微信组织架构相关
*
* @param id 企业微信组织架构相关ID
* @return 企业微信组织架构相关
*/
@Override
public WeDepartment selectWeDepartmentById(Long id)
{
return weDepartmentMapper.selectWeDepartmentById(id);
}
/**
* 查询企业微信组织架构相关列表
......@@ -121,38 +118,6 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe
this.updateById(weDepartment);
}
// int returnCode=weDepartmentMapper.updateWeDepartment(weDepartment);
// if(returnCode>0){
//
// weDepartMentClient.updateWeDepartMent(
// weDepartment.transformDeartMentDto(weDepartment)
// );
//
//
// }
//
// return returnCode;
}
/**
* 批量保存
* @param weDepartments
* @return
*/
@Override
public int batchInsertWeDepartment(List<WeDepartment> weDepartments) {
return weDepartmentMapper.batchInsertWeDepartment(weDepartments);
}
/**
* 删除部门表所有数据
* @return
*/
@Override
public int deleteAllWeDepartment() {
return weDepartmentMapper.deleteAllWeDepartment();
}
......@@ -172,4 +137,33 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe
}
// /**
// * 根据部门id删除部门
// * @param ids
// */
// @Override
// public void deleteWeDepartmentByIds(String[] ids) {
//
// //查询当前部门下所有的子部门,如果存在,则不可以删除
// List<WeDepartment> weDepartments = this.list(new LambdaQueryWrapper<WeDepartment>()
// .in(WeDepartment::getParentId, ids));
// if(CollectionUtil.isNotEmpty(weDepartments)) {
// //抛出异常,请删除此部门下的成员或子部门后,再删除此部门
//
// }
//
//
// List<WeUser> weUsers = weUserService.selectWeUserList(WeUser.builder()
// .department(ids)
// .build());
// if(CollectionUtil.isNotEmpty(weUsers)){
// //该部门存在子部门或成员无法删除
//
// }
//
//
//
// }
}
......@@ -30,9 +30,6 @@ import java.util.Optional;
@Service
public class WeMaterialServiceImpl implements IWeMaterialService {
@Autowired
private WeMediaClient weMediaClient;
@Autowired
private WeMaterialMapper weMaterialMapper;
@Autowired
......@@ -56,15 +53,8 @@ public class WeMaterialServiceImpl implements IWeMaterialService {
if (!mediaType.isPresent()) {
throw new WeComException("媒体类型出错!");
}
WeMediaDto mediaDto = weMediaClient.upload(file, mediaType.get().getMediaType());
if (!WeConstans.WE_SUCCESS_CODE.equals(mediaDto.getErrcode())) {
throw new WeComException("临时素材上传失败!");
}
//构造返回结果
WeMaterialFileVO weMaterialFileVO
= WeMaterialFileVO.builder().materialUrl(url).materialMediaId(mediaDto.getMedia_id())
.materialCreatedAt(mediaDto.getCreated_at()).materialName(file.getOriginalFilename()).build();
return weMaterialFileVO;
return WeMaterialFileVO.builder().materialUrl(url).materialName(file.getOriginalFilename()).build();
} catch (Exception e) {
throw new WeComException("临时素材上传失败!");
}
......
......@@ -153,7 +153,7 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
*/
@Override
public List<WeLeaveUserVo> leaveAllocateUserList(WeLeaveUserVo weLeaveUserVo) {
return null;
return this.baseMapper.leaveAllocateUserList(weLeaveUserVo);
}
......@@ -171,6 +171,12 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
//分配群组
iWeGroupService.allocateWeGroup(weLeaveUserInfoAllocateVo);
//更新员工状态为已分配
this.updateById(WeUser.builder()
.userId(weLeaveUserInfoAllocateVo.getHandoverUserid())
.isAllocate(WeConstans.LEAVE_ALLOCATE_STATE)
.build());
}catch (Exception e){
throw new WeComException(e.getMessage());
}
......@@ -211,7 +217,7 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
weUsers.add(
WeUser.builder()
.userId(k)
.enable(WeConstans.WE_USER_IS_LEAVE)
.isActivate(WeConstans.WE_USER_IS_LEAVE)
.dimissionTime(new Date())
.build()
);
......
......@@ -12,81 +12,16 @@
wg.create_time,
wg.notice,
wu.user_name as groupLeaderName,
(SELECT COUNT(*) FROM we_group_member wgm WHERE wgm.chat_id=wg.chat_id) as memberNum
(SELECT COUNT(*) FROM we_group_member wgm WHERE wgm.chat_id=wg.chat_id) as memberNum,
wg.status
FROM
we_group wg
INNER JOIN we_user wu ON wg.`owner`=wu.user_id
LEFT JOIN we_user wu ON wg.`owner`=wu.user_id
<where>
<if test="groupName != null and groupName != ''"> and wg.group_name like concat('%', #{groupName}, '%')</if>
<if test="owner != null and owner != ''"> and owner = #{owner}</if>
</where>
</select>
<!-- <select id="selectWeGroupById" parameterType="Long" resultMap="WeGroupResult">-->
<!-- <include refid="selectWeGroupVo"/>-->
<!-- where id = #{id}-->
<!-- </select>-->
<!-- <insert id="insertWeGroup" parameterType="WeGroup">-->
<!-- insert into we_group-->
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
<!-- <if test="id != null">id,</if>-->
<!-- <if test="groupName != null">group_name,</if>-->
<!-- <if test="memberNum != null">member_num,</if>-->
<!-- <if test="groupLeader != null">group_leader,</if>-->
<!-- <if test="createTime != null">create_time,</if>-->
<!-- <if test="notice != null">notice,</if>-->
<!-- <if test="groupLeaderUserId != null and groupLeaderUserId !=''">group_leader_user_id,</if>-->
<!-- </trim>-->
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
<!-- <if test="id != null">#{id},</if>-->
<!-- <if test="groupName != null">#{groupName},</if>-->
<!-- <if test="memberNum != null">#{memberNum},</if>-->
<!-- <if test="groupLeader != null">#{groupLeader},</if>-->
<!-- <if test="createTime != null">#{createTime},</if>-->
<!-- <if test="notice != null">#{notice},</if>-->
<!-- <if test="groupLeaderUserId != null and groupLeaderUserId !=''">#{groupLeaderUserId},</if>-->
<!-- </trim>-->
<!-- </insert>-->
<!-- <update id="updateWeGroup" parameterType="WeGroup">-->
<!-- update we_group-->
<!-- <trim prefix="SET" suffixOverrides=",">-->
<!-- <if test="groupName != null">group_name = #{groupName},</if>-->
<!-- <if test="memberNum != null">member_num = #{memberNum},</if>-->
<!-- <if test="groupLeader != null">group_leader = #{groupLeader},</if>-->
<!-- <if test="createTime != null">create_time = #{createTime},</if>-->
<!-- <if test="notice != null">notice = #{notice},</if>-->
<!-- <if test="groupLeaderUserId != null and groupLeaderUserId !=''">group_leader_user_id =#{groupLeaderUserId},</if>-->
<!-- </trim>-->
<!-- where id = #{id}-->
<!-- </update>-->
<!-- <delete id="deleteWeGroupById" parameterType="Long">-->
<!-- delete from we_group where id = #{id}-->
<!-- </delete>-->
<!-- <delete id="deleteWeGroupByIds" parameterType="String">-->
<!-- delete from we_group where id in-->
<!-- <foreach item="id" collection="array" open="(" separator="," close=")">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- </delete>-->
<!-- <update id="batchLogicDeleteByIds" parameterType="String">-->
<!-- update we_group set del_flag=2-->
<!-- where id in-->
<!-- <foreach item="id" collection="ids" open="(" separator="," close=")">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- </update>-->
<!-- <insert id="batchInsetWeGroup" >-->
<!-- insert into we_group (id, group_name, member_num, group_leader, create_time, notice, group_leader_user_id)-->
<!-- values-->
<!-- <foreach collection="weGroups" item="weGroup" index="index" separator=",">-->
<!-- (#{weGroup.id},#{weGroup.groupName},#{weGroup.memberNum},#{weGroup.groupLeader},#{weGroup.createTime},#{weGroup.notice},#{weGroup.groupLeaderUserId})-->
<!-- </foreach>-->
<!-- </insert>-->
</mapper>
\ No newline at end of file
......@@ -11,10 +11,6 @@
<result property="content" column="content"/>
<result property="materialName" column="material_name"/>
<result property="digest" column="digest"/>
<result property="materialMediaId" column="material_media_id"/>
<result property="materialCreatedAt" column="material_created_at"/>
<result property="coverMediaId" column="cover_media_id"/>
<result property="coverCreatedAt" column="cover_created_at"/>
<result property="coverUrl" column="cover_url"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
......@@ -44,18 +40,6 @@
<if test="digest!=null">
digest,
</if>
<if test="materialMediaId!=null">
material_media_id,
</if>
<if test="materialCreatedAt!=null">
material_created_at,
</if>
<if test="coverMediaId!=null">
cover_media_id,
</if>
<if test="coverCreatedAt!=null">
cover_created_at,
</if>
<if test="coverUrl!=null">
cover_url,
</if>
......@@ -92,18 +76,6 @@
<if test="digest!=null">
#{digest},
</if>
<if test="materialMediaId!=null">
#{materialMediaId},
</if>
<if test="materialCreatedAt!=null">
#{materialCreatedAt},
</if>
<if test="coverMediaId!=null">
#{coverMediaId},
</if>
<if test="coverCreatedAt!=null">
#{coverCreatedAt},
</if>
<if test="coverUrl!=null">
#{coverUrl},
</if>
......@@ -142,18 +114,6 @@
<if test="digest!=null">
digest=#{digest},
</if>
<if test="materialMediaId!=null">
material_media_id=#{materialMediaId},
</if>
<if test="materialCreatedAt!=null">
material_created_at=#{materialCreatedAt},
</if>
<if test="coverMediaId!=null">
cover_media_id=#{coverMediaId},
</if>
<if test="coverCreatedAt!=null">
cover_created_at=#{coverCreatedAt},
</if>
<if test="coverUrl!=null">
cover_url=#{coverUrl},
</if>
......@@ -215,7 +175,7 @@
</select>
<sql id="material">
id,category_id,material_url,content,material_name,digest,material_media_id,material_created_at,cover_media_id,cover_created_at,cover_url,create_by,create_time,update_by,update_time
id,category_id,material_url,content,material_name,digest,cover_url,create_by,create_time,update_by,update_time
</sql>
</mapper>
\ No newline at end of file
......@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="wxAccount != null and wxAccount != ''"> and wx_account = #{wxAccount}</if>
<if test="department != null and department != '' and department != '1' "> and FIND_IN_SET(#{department},department)</if>
<if test="department != null and department.length > 0 "> and FIND_IN_SET(#{department},department)</if>
<if test="position != null and position != ''"> and position = #{position}</if>
<if test="isLeaderInDept != null "> and is_leader_in_dept = #{isLeaderInDept}</if>
<if test="joinTime != null "> and join_time = #{joinTime}</if>
......@@ -164,12 +164,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
wu.user_id,
wu.user_name,
wu.dimission_time,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department,
(SELECT COUNT(*) FROM we_allocate_customer wac WHERE wac.handover_userid=wu.user_id) as allocateCustomerNum,
(SELECT COUNT(*) FROM we_allocate_group wag WHERE wag.old_owner=wu.user_id) as allocateGroupNum,
wu.dimission_time
FROM
we_user wu
(SELECT COUNT(*) FROM we_allocate_group wag WHERE wag.old_owner=wu.user_id) as allocateGroupNum
FROM we_user wu
<where>
<if test="userName != null and userName !=''">and wu.user_name=#{userName}</if>
<if test="beginTime != null and beginTime !='' and endTime != null and endTime !=''">
......@@ -218,6 +217,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <select id="getAllocateCustomers">-->
<!-- SELECT-->
<!-- wc.`name`,-->
<!-- wu.user_name,-->
<!-- wac.allocate_time,-->
<!-- (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department-->
<!--FROM-->
<!-- we_allocate_customer wac-->
<!--LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid-->
<!--LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid-->
<!-- -->
<!-- </select>-->
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册