Commit be7ef9c0 by HaoN

完成本地系统中针对通讯录用户,组织架构,数据的增删改查功能,但不包括数据同步企业微信服务器端的功能

1 parent d6d163a1
Showing 30 changed files with 1178 additions and 208 deletions
...@@ -75,11 +75,10 @@ ...@@ -75,11 +75,10 @@
<!--企业微信模块--> <!--企业微信模块-->
<!-- 企业微信模块--> <!-- <dependency>-->
<dependency> <!-- <groupId>com.linkwechat</groupId>-->
<groupId>com.linkwechat</groupId> <!-- <artifactId>linkwe-wecom</artifactId>-->
<artifactId>linkwe-wecom</artifactId> <!-- </dependency>-->
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -6,7 +6,7 @@ import com.linkwechat.common.core.domain.AjaxResult; ...@@ -6,7 +6,7 @@ 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.WeCorpAccount; import com.linkwechat.wecom.domain.WeCorpAccount;
import com.linkwechat.wecom.service.IWxCorpAccountService; import com.linkwechat.wecom.service.IWeCorpAccountService;
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.*; import org.springframework.web.bind.annotation.*;
...@@ -21,20 +21,20 @@ import java.util.List; ...@@ -21,20 +21,20 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("/wecom/corp") @RequestMapping("/wecom/corp")
public class WxCorpAccountController extends BaseController public class WeCorpAccountController extends BaseController
{ {
@Autowired @Autowired
private IWxCorpAccountService wxCorpAccountService; private IWeCorpAccountService weCorpAccountService;
/** /**
* 查询企业id相关配置列表 * 查询企业id相关配置列表
*/ */
@PreAuthorize("@ss.hasPermi('wechat:corp:list')") @PreAuthorize("@ss.hasPermi('wechat:corp:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(WeCorpAccount wxCorpAccount) public TableDataInfo list(WeCorpAccount weCorpAccount)
{ {
startPage(); startPage();
List<WeCorpAccount> list = wxCorpAccountService.selectWxCorpAccountList(wxCorpAccount); List<WeCorpAccount> list = weCorpAccountService.selectWeCorpAccountList(weCorpAccount);
return getDataTable(list); return getDataTable(list);
} }
...@@ -58,7 +58,7 @@ public class WxCorpAccountController extends BaseController ...@@ -58,7 +58,7 @@ public class WxCorpAccountController extends BaseController
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
return AjaxResult.success(wxCorpAccountService.selectWxCorpAccountById(id)); return AjaxResult.success(weCorpAccountService.selectWeCorpAccountById(id));
} }
/** /**
...@@ -67,9 +67,9 @@ public class WxCorpAccountController extends BaseController ...@@ -67,9 +67,9 @@ public class WxCorpAccountController extends BaseController
@PreAuthorize("@ss.hasPermi('wechat:corp:add')") @PreAuthorize("@ss.hasPermi('wechat:corp:add')")
@Log(title = "企业id相关配置", businessType = BusinessType.INSERT) @Log(title = "企业id相关配置", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody WeCorpAccount wxCorpAccount) public AjaxResult add(@RequestBody WeCorpAccount weCorpAccount)
{ {
return toAjax(wxCorpAccountService.insertWxCorpAccount(wxCorpAccount)); return toAjax(weCorpAccountService.insertWeCorpAccount(weCorpAccount));
} }
/** /**
...@@ -78,9 +78,9 @@ public class WxCorpAccountController extends BaseController ...@@ -78,9 +78,9 @@ public class WxCorpAccountController extends BaseController
@PreAuthorize("@ss.hasPermi('wechat:corp:edit')") @PreAuthorize("@ss.hasPermi('wechat:corp:edit')")
@Log(title = "企业id相关配置", businessType = BusinessType.UPDATE) @Log(title = "企业id相关配置", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody WeCorpAccount wxCorpAccount) public AjaxResult edit(@RequestBody WeCorpAccount weCorpAccount)
{ {
return toAjax(wxCorpAccountService.updateWxCorpAccount(wxCorpAccount)); return toAjax(weCorpAccountService.updateWeCorpAccount(weCorpAccount));
} }
/** /**
...@@ -91,7 +91,7 @@ public class WxCorpAccountController extends BaseController ...@@ -91,7 +91,7 @@ public class WxCorpAccountController extends BaseController
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(wxCorpAccountService.deleteWxCorpAccountByIds(ids)); return toAjax(weCorpAccountService.deleteWeCorpAccountByIds(ids));
} }
} }
package com.linkwechat.web.controller.wecom;
import java.util.List;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.utils.poi.ExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.linkwechat.wecom.domain.WeDepartment;
import com.linkwechat.wecom.service.IWeDepartmentService;
/**
* 企业微信组织架构相关Controller
*
* @author ruoyi
* @date 2020-09-01
*/
@RestController
@RequestMapping("/wecom/department")
public class WeDepartmentController extends BaseController
{
@Autowired
private IWeDepartmentService weDepartmentService;
/**
* 查询企业微信组织架构相关列表
*/
@PreAuthorize("@ss.hasPermi('wecom:department:list')")
@GetMapping("/list")
public TableDataInfo list(WeDepartment weDepartment)
{
startPage();
List<WeDepartment> list = weDepartmentService.selectWeDepartmentList(weDepartment);
return getDataTable(list);
}
/**
* 导出企业微信组织架构相关列表
*/
@PreAuthorize("@ss.hasPermi('wecom:department:export')")
@Log(title = "企业微信组织架构相关", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeDepartment weDepartment)
{
List<WeDepartment> list = weDepartmentService.selectWeDepartmentList(weDepartment);
ExcelUtil<WeDepartment> util = new ExcelUtil<WeDepartment>(WeDepartment.class);
return util.exportExcel(list, "department");
}
/**
* 获取企业微信组织架构相关详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:department:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(weDepartmentService.selectWeDepartmentById(id));
}
/**
* 新增企业微信组织架构相关
*/
@PreAuthorize("@ss.hasPermi('wecom:department:add')")
@Log(title = "企业微信组织架构相关", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeDepartment weDepartment)
{
return toAjax(weDepartmentService.insertWeDepartment(weDepartment));
}
/**
* 修改企业微信组织架构相关
*/
@PreAuthorize("@ss.hasPermi('wecom:department:edit')")
@Log(title = "企业微信组织架构相关", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeDepartment weDepartment)
{
return toAjax(weDepartmentService.updateWeDepartment(weDepartment));
}
/**
* 删除企业微信组织架构相关
*/
@PreAuthorize("@ss.hasPermi('wecom:department:remove')")
@Log(title = "企业微信组织架构相关", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(weDepartmentService.deleteWeDepartmentByIds(ids));
}
}
package com.linkwechat.web.controller.wecom;
import java.util.List;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.utils.poi.ExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.service.IWeUserService;
/**
* 通讯录相关客户Controller
*
* @author ruoyi
* @date 2020-08-31
*/
@RestController
@RequestMapping("/wecom/user")
public class WeUserController extends BaseController
{
@Autowired
private IWeUserService weUserService;
/**
* 查询通讯录相关客户列表
*/
@PreAuthorize("@ss.hasPermi('wecom:user:list')")
@GetMapping("/list")
public TableDataInfo list(WeUser weUser)
{
startPage();
List<WeUser> list = weUserService.selectWeUserList(weUser);
return getDataTable(list);
}
/**
* 导出通讯录相关客户列表
*/
@PreAuthorize("@ss.hasPermi('wecom:user:export')")
@Log(title = "通讯录相关客户", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeUser weUser)
{
List<WeUser> list = weUserService.selectWeUserList(weUser);
ExcelUtil<WeUser> util = new ExcelUtil<WeUser>(WeUser.class);
return util.exportExcel(list, "user");
}
/**
* 获取通讯录相关客户详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:user:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(weUserService.selectWeUserById(id));
}
/**
* 新增通讯录相关客户
*/
@PreAuthorize("@ss.hasPermi('wecom:user:add')")
@Log(title = "通讯录相关客户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeUser weUser)
{
return toAjax(weUserService.insertWeUser(weUser));
}
/**
* 修改通讯录相关客户
*/
@PreAuthorize("@ss.hasPermi('wecom:user:edit')")
@Log(title = "通讯录相关客户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeUser weUser)
{
return toAjax(weUserService.updateWeUser(weUser));
}
/**
* 删除通讯录相关客户
*/
@PreAuthorize("@ss.hasPermi('wecom:user:remove')")
@Log(title = "通讯录相关客户", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(weUserService.deleteWeUserByIds(ids));
}
}
...@@ -124,6 +124,11 @@ ...@@ -124,6 +124,11 @@
<artifactId>spring-boot-starter-forest</artifactId> <artifactId>spring-boot-starter-forest</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file \ No newline at end of file
...@@ -63,7 +63,7 @@ public class CaptchaConfig ...@@ -63,7 +63,7 @@ public class CaptchaConfig
// KAPTCHA_SESSION_KEY // KAPTCHA_SESSION_KEY
properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCodeMath"); properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCodeMath");
// 验证码文本生成器 // 验证码文本生成器
properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.ruoyi.framework.config.KaptchaTextCreator"); properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.linkwechat.framework.config.KaptchaTextCreator");
// 验证码文本字符间距 默认为2 // 验证码文本字符间距 默认为2
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3"); properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3");
// 验证码文本字符长度 默认为5 // 验证码文本字符长度 默认为5
......
...@@ -2,7 +2,7 @@ package com.linkwechat.wecom.client; ...@@ -2,7 +2,7 @@ package com.linkwechat.wecom.client;
import com.dtflys.forest.annotation.Query; import com.dtflys.forest.annotation.Query;
import com.dtflys.forest.annotation.Request; import com.dtflys.forest.annotation.Request;
import com.linkwechat.wecom.domain.WeAccessToken; import com.linkwechat.wecom.domain.dto.WeAccessTokenDtoDto;
/** /**
* @description: 获取企业微信Token相关 * @description: 获取企业微信Token相关
...@@ -20,6 +20,6 @@ public interface WeAccessTokenClient { ...@@ -20,6 +20,6 @@ public interface WeAccessTokenClient {
* @return * @return
*/ */
@Request(url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken") @Request(url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken")
WeAccessToken getToken(@Query("corpid")String corpId, @Query("corpsecret") String corpSecret); WeAccessTokenDtoDto getToken(@Query("corpid")String corpId, @Query("corpsecret") String corpSecret);
} }
\ No newline at end of file \ No newline at end of file
...@@ -3,8 +3,8 @@ package com.linkwechat.wecom.client; ...@@ -3,8 +3,8 @@ package com.linkwechat.wecom.client;
import com.dtflys.forest.annotation.DataObject; import com.dtflys.forest.annotation.DataObject;
import com.dtflys.forest.annotation.Query; import com.dtflys.forest.annotation.Query;
import com.dtflys.forest.annotation.Request; import com.dtflys.forest.annotation.Request;
import com.linkwechat.wecom.domain.WeDepartMent; import com.linkwechat.wecom.domain.dto.WeDepartMentDtoDto;
import com.linkwechat.wecom.domain.WeResult; import com.linkwechat.wecom.domain.dto.WeResultDto;
/** /**
* @description: 企业微信部门相关客户端 * @description: 企业微信部门相关客户端
...@@ -21,7 +21,7 @@ public interface WeDepartMentClient { ...@@ -21,7 +21,7 @@ public interface WeDepartMentClient {
@Request(url="https://qyapi.weixin.qq.com/cgi-bin/department/create", @Request(url="https://qyapi.weixin.qq.com/cgi-bin/department/create",
type = "POST" type = "POST"
) )
WeResult createWeDepartMent(@DataObject WeDepartMent weDepartMent); WeResultDto createWeDepartMent(@DataObject WeDepartMentDtoDto weDepartMent);
...@@ -33,7 +33,7 @@ public interface WeDepartMentClient { ...@@ -33,7 +33,7 @@ public interface WeDepartMentClient {
@Request(url="https://qyapi.weixin.qq.com/cgi-bin/department/update", @Request(url="https://qyapi.weixin.qq.com/cgi-bin/department/update",
type = "POST" type = "POST"
) )
WeResult updateWeDepartMent(@DataObject WeDepartMent weDepartMent); WeResultDto updateWeDepartMent(@DataObject WeDepartMentDtoDto weDepartMent);
/** /**
...@@ -42,7 +42,7 @@ public interface WeDepartMentClient { ...@@ -42,7 +42,7 @@ public interface WeDepartMentClient {
* @return * @return
*/ */
@Request(url = "https://qyapi.weixin.qq.com/cgi-bin/department/delete") @Request(url = "https://qyapi.weixin.qq.com/cgi-bin/department/delete")
WeResult deleteWeDepartMent(@Query("id") String departMnentId); WeResultDto deleteWeDepartMent(@Query("id") String departMnentId);
/** /**
...@@ -50,7 +50,7 @@ public interface WeDepartMentClient { ...@@ -50,7 +50,7 @@ public interface WeDepartMentClient {
* @return * @return
*/ */
@Request(url = "https://qyapi.weixin.qq.com/cgi-bin/department/list") @Request(url = "https://qyapi.weixin.qq.com/cgi-bin/department/list")
WeDepartMent weDepartMents(); WeDepartMentDtoDto weDepartMents();
} }
\ No newline at end of file \ No newline at end of file
package com.linkwechat.wecom.domain; package com.linkwechat.wecom.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.linkwechat.common.annotation.Excel; import com.linkwechat.common.annotation.Excel;
import com.linkwechat.common.core.domain.BaseEntity; import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
/** /**
* 企业id相关配置对象 wx_corp_account * 企业id相关配置对象 wx_corp_account
...@@ -11,6 +10,7 @@ import com.linkwechat.common.core.domain.BaseEntity; ...@@ -11,6 +10,7 @@ import com.linkwechat.common.core.domain.BaseEntity;
* @author ruoyi * @author ruoyi
* @date 2020-08-24 * @date 2020-08-24
*/ */
@Data
public class WeCorpAccount extends BaseEntity public class WeCorpAccount extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -37,74 +37,5 @@ public class WeCorpAccount extends BaseEntity ...@@ -37,74 +37,5 @@ public class WeCorpAccount extends BaseEntity
/** 删除标志(0代表存在 2代表删除) */ /** 删除标志(0代表存在 2代表删除) */
private String delFlag; private String delFlag;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCompanyName(String companyName)
{
this.companyName = companyName;
}
public String getCompanyName()
{
return companyName;
}
public void setCorpId(String corpId)
{
this.corpId = corpId;
}
public String getCorpId()
{
return corpId;
}
public void setCorpSecret(String corpSecret)
{
this.corpSecret = corpSecret;
}
public String getCorpSecret()
{
return corpSecret;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("companyName", getCompanyName())
.append("corpId", getCorpId())
.append("corpSecret", getCorpSecret())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
} }
package com.linkwechat.wecom.domain;
import com.linkwechat.common.annotation.Excel;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 企业微信组织架构相关对象 we_department
*
* @author ruoyi
* @date 2020-09-01
*/
@Data
public class WeDepartment extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 部门名称 */
@Excel(name = "部门名称")
private String name;
/** 部门英文名称 */
@Excel(name = "部门英文名称")
private String nameEn;
/** $column.columnComment */
@Excel(name = "部门英文名称")
private Long parentId;
/** 是否激活(1:是;2:否)该字段主要表示当前信息是否同步微信 */
@Excel(name = "是否激活", readConverterExp = "1=:是;2:否")
private Long isActivate;
/** 在父部门中的次序值。order值大的排序靠前。 */
@Excel(name = "在父部门中的次序值。order值大的排序靠前。")
private Long order;
}
package com.linkwechat.wecom.domain; package com.linkwechat.wecom.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linkwechat.common.annotation.Excel;
import com.linkwechat.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/** /**
* @description: 通讯录用户 * 通讯录相关客户对象 we_user
* @author: HaoN *
* @create: 2020-08-28 10:45 * @author ruoyi
**/ * @date 2020-08-31
public class WeUser { */
public class WeUser extends BaseEntity
//成员头像的mediaid,通过素材管理接口上传图片获得的mediaid {
private String avatar_mediaid; private static final long serialVersionUID = 1L;
//姓名 /** $column.columnComment */
private String name; private Long id;
//昵称
/** 头像地址 */
@Excel(name = "头像地址")
private String headImageUrl;
/** 用户名称 */
@Excel(name = "用户名称")
private String userName;
/** 用户昵称 */
@Excel(name = "用户昵称")
private String alias; private String alias;
//账号
private String userid;
//性别。1表示男性,2表示女性 /** 账号 */
private String gender; @Excel(name = "账号")
private String userId;
//手机号码。企业内必须唯一,mobile/email二者不能同时为空 /** 性别。1表示男性,2表示女性 */
@Excel(name = "性别。1表示男性,2表示女性")
private Integer gender;
/** 手机号 */
@Excel(name = "手机号")
private String mobile; private String mobile;
//邮箱 /** 邮箱 */
@Excel(name = "邮箱")
private String email; private String email;
//成员所属部门id列表,不超过100个 /** 个人微信号 */
private Long[] department; @Excel(name = "个人微信号")
private String wxAccount;
/** 用户所属部门,使用逗号隔开,字符串格式存储 */
@Excel(name = "用户所属部门,使用逗号隔开,字符串格式存储")
private String department;
//职位 /** 职务 */
@Excel(name = "职务")
private String position; private String position;
//身份:表示在所在的部门内是否为上级。1表示为上级,0表示非上级。 /** 1表示为上级,0表示普通成员(非上级)。 */
private Long[] is_leader_in_dept; @Excel(name = "1表示为上级,0表示普通成员(非上级)。")
private Long isLeaderInDept;
/** 入职时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入职时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date joinTime;
/** 是否启用(1表示启用成员,0表示禁用成员) */
@Excel(name = "是否启用(1表示启用成员,0表示禁用成员)")
private Long enable;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
//启用/禁用成员。1表示启用成员,0表示禁用成员 /** QQ号 */
private Integer enable; @Excel(name = "QQ号")
private String qqAccount;
//座机。32字节以内,由纯数字或’-‘号组成。 /** 座机 */
@Excel(name = "座机")
private String telephone; private String telephone;
//地址 /** 地址 */
@Excel(name = "地址")
private String address; private String address;
/** 生日 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
private Date birthday;
// /** 是否激活(1:是;2:否)该字段主要表示当前信息是否同步微信 */
// private Long main_department; @Excel(name = "是否激活", readConverterExp = "1=:是;2:否")
// private boolean to_invite; private Long isActivate;
// private String external_position;
} }
package com.linkwechat.wecom.domain; package com.linkwechat.wecom.domain.dto;
import lombok.Data;
/** /**
* @description: accessToken相关 * @description: accessToken相关
* @author: HaoN * @author: HaoN
* @create: 2020-08-27 15:54 * @create: 2020-08-27 15:54
**/ **/
public class WeAccessToken extends WeResult{ @Data
public class WeAccessTokenDtoDto extends WeResultDto {
private String access_token; private String access_token;
private Long expires_in; private Long expires_in;
} }
package com.linkwechat.wecom.domain; package com.linkwechat.wecom.domain.dto;
import lombok.Data;
import java.util.List; import java.util.List;
...@@ -7,14 +9,16 @@ import java.util.List; ...@@ -7,14 +9,16 @@ import java.util.List;
* @author: HaoN * @author: HaoN
* @create: 2020-08-27 15:54 * @create: 2020-08-27 15:54
**/ **/
public class WeDepartMent extends WeResult { @Data
public class WeDepartMentDtoDto extends WeResultDto {
private List<DeartMent> deartMents; private List<DeartMentDto> deartMents;
class DeartMent{ @Data
class DeartMentDto{
private String name; private String name;
......
package com.linkwechat.wecom.domain; package com.linkwechat.wecom.domain.dto;
import lombok.Data;
/** /**
* @description: 统一返回体 * @description: 统一返回体
* @author: HaoN * @author: HaoN
* @create: 2020-08-27 15:59 * @create: 2020-08-27 15:59
**/ **/
public class WeResult { @Data
public class WeResultDto {
private Long id; private Long id;
private Integer errcode; private Integer errcode;
private String errmsg; private String errmsg;
......
package com.linkwechat.wecom.domain.dto;
import lombok.Data;
/**
* @description: 通讯录用户
* @author: HaoN
* @create: 2020-08-28 10:45
**/
@Data
public class WeUserDto {
//成员头像的mediaid,通过素材管理接口上传图片获得的mediaid
private String avatar_mediaid;
//姓名
private String name;
//昵称
private String alias;
//账号
private String userid;
//性别。1表示男性,2表示女性
private String gender;
//手机号码。企业内必须唯一,mobile/email二者不能同时为空
private String mobile;
//邮箱
private String email;
//成员所属部门id列表,不超过100个
private Long[] department;
//职位
private String position;
//身份:表示在所在的部门内是否为上级。1表示为上级,0表示非上级。
private Long[] is_leader_in_dept;
//启用/禁用成员。1表示启用成员,0表示禁用成员
private Integer enable;
//座机。32字节以内,由纯数字或’-‘号组成。
private String telephone;
//地址
private String address;
}
...@@ -9,7 +9,7 @@ import com.linkwechat.wecom.domain.WeCorpAccount; ...@@ -9,7 +9,7 @@ import com.linkwechat.wecom.domain.WeCorpAccount;
* @author ruoyi * @author ruoyi
* @date 2020-08-24 * @date 2020-08-24
*/ */
public interface WxCorpAccountMapper public interface WeCorpAccountMapper
{ {
/** /**
* 查询企业id相关配置 * 查询企业id相关配置
...@@ -17,7 +17,7 @@ public interface WxCorpAccountMapper ...@@ -17,7 +17,7 @@ public interface WxCorpAccountMapper
* @param id 企业id相关配置ID * @param id 企业id相关配置ID
* @return 企业id相关配置 * @return 企业id相关配置
*/ */
public WeCorpAccount selectWxCorpAccountById(Long id); public WeCorpAccount selectWeCorpAccountById(Long id);
/** /**
* 查询企业id相关配置列表 * 查询企业id相关配置列表
...@@ -25,7 +25,7 @@ public interface WxCorpAccountMapper ...@@ -25,7 +25,7 @@ public interface WxCorpAccountMapper
* @param wxCorpAccount 企业id相关配置 * @param wxCorpAccount 企业id相关配置
* @return 企业id相关配置集合 * @return 企业id相关配置集合
*/ */
public List<WeCorpAccount> selectWxCorpAccountList(WeCorpAccount wxCorpAccount); public List<WeCorpAccount> selectWeCorpAccountList(WeCorpAccount wxCorpAccount);
/** /**
* 新增企业id相关配置 * 新增企业id相关配置
...@@ -33,7 +33,7 @@ public interface WxCorpAccountMapper ...@@ -33,7 +33,7 @@ public interface WxCorpAccountMapper
* @param wxCorpAccount 企业id相关配置 * @param wxCorpAccount 企业id相关配置
* @return 结果 * @return 结果
*/ */
public int insertWxCorpAccount(WeCorpAccount wxCorpAccount); public int insertWeCorpAccount(WeCorpAccount wxCorpAccount);
/** /**
* 修改企业id相关配置 * 修改企业id相关配置
...@@ -41,7 +41,7 @@ public interface WxCorpAccountMapper ...@@ -41,7 +41,7 @@ public interface WxCorpAccountMapper
* @param wxCorpAccount 企业id相关配置 * @param wxCorpAccount 企业id相关配置
* @return 结果 * @return 结果
*/ */
public int updateWxCorpAccount(WeCorpAccount wxCorpAccount); public int updateWeCorpAccount(WeCorpAccount wxCorpAccount);
/** /**
* 删除企业id相关配置 * 删除企业id相关配置
...@@ -49,7 +49,7 @@ public interface WxCorpAccountMapper ...@@ -49,7 +49,7 @@ public interface WxCorpAccountMapper
* @param id 企业id相关配置ID * @param id 企业id相关配置ID
* @return 结果 * @return 结果
*/ */
public int deleteWxCorpAccountById(Long id); public int deleteWeCorpAccountById(Long id);
/** /**
* 批量删除企业id相关配置 * 批量删除企业id相关配置
...@@ -57,5 +57,5 @@ public interface WxCorpAccountMapper ...@@ -57,5 +57,5 @@ public interface WxCorpAccountMapper
* @param ids 需要删除的数据ID * @param ids 需要删除的数据ID
* @return 结果 * @return 结果
*/ */
public int deleteWxCorpAccountByIds(Long[] ids); public int deleteWeCorpAccountByIds(Long[] ids);
} }
package com.linkwechat.wecom.mapper;
import java.util.List;
import com.linkwechat.wecom.domain.WeDepartment;
/**
* 企业微信组织架构相关Mapper接口
*
* @author ruoyi
* @date 2020-09-01
*/
public interface WeDepartmentMapper
{
/**
* 查询企业微信组织架构相关
*
* @param id 企业微信组织架构相关ID
* @return 企业微信组织架构相关
*/
public WeDepartment selectWeDepartmentById(Long id);
/**
* 查询企业微信组织架构相关列表
*
* @param weDepartment 企业微信组织架构相关
* @return 企业微信组织架构相关集合
*/
public List<WeDepartment> selectWeDepartmentList(WeDepartment weDepartment);
/**
* 新增企业微信组织架构相关
*
* @param weDepartment 企业微信组织架构相关
* @return 结果
*/
public int insertWeDepartment(WeDepartment weDepartment);
/**
* 修改企业微信组织架构相关
*
* @param weDepartment 企业微信组织架构相关
* @return 结果
*/
public int updateWeDepartment(WeDepartment weDepartment);
/**
* 删除企业微信组织架构相关
*
* @param id 企业微信组织架构相关ID
* @return 结果
*/
public int deleteWeDepartmentById(Long id);
/**
* 批量删除企业微信组织架构相关
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeDepartmentByIds(Long[] ids);
}
package com.linkwechat.wecom.mapper;
import java.util.List;
import com.linkwechat.wecom.domain.WeUser;
/**
* 通讯录相关客户Mapper接口
*
* @author ruoyi
* @date 2020-08-31
*/
public interface WeUserMapper
{
/**
* 查询通讯录相关客户
*
* @param id 通讯录相关客户ID
* @return 通讯录相关客户
*/
public WeUser selectWeUserById(Long id);
/**
* 查询通讯录相关客户列表
*
* @param weUser 通讯录相关客户
* @return 通讯录相关客户集合
*/
public List<WeUser> selectWeUserList(WeUser weUser);
/**
* 新增通讯录相关客户
*
* @param weUser 通讯录相关客户
* @return 结果
*/
public int insertWeUser(WeUser weUser);
/**
* 修改通讯录相关客户
*
* @param weUser 通讯录相关客户
* @return 结果
*/
public int updateWeUser(WeUser weUser);
/**
* 删除通讯录相关客户
*
* @param id 通讯录相关客户ID
* @return 结果
*/
public int deleteWeUserById(Long id);
/**
* 批量删除通讯录相关客户
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeUserByIds(Long[] ids);
}
...@@ -9,7 +9,7 @@ import com.linkwechat.wecom.domain.WeCorpAccount; ...@@ -9,7 +9,7 @@ import com.linkwechat.wecom.domain.WeCorpAccount;
* @author ruoyi * @author ruoyi
* @date 2020-08-24 * @date 2020-08-24
*/ */
public interface IWxCorpAccountService public interface IWeCorpAccountService
{ {
/** /**
* 查询企业id相关配置 * 查询企业id相关配置
...@@ -17,7 +17,7 @@ public interface IWxCorpAccountService ...@@ -17,7 +17,7 @@ public interface IWxCorpAccountService
* @param id 企业id相关配置ID * @param id 企业id相关配置ID
* @return 企业id相关配置 * @return 企业id相关配置
*/ */
public WeCorpAccount selectWxCorpAccountById(Long id); public WeCorpAccount selectWeCorpAccountById(Long id);
/** /**
* 查询企业id相关配置列表 * 查询企业id相关配置列表
...@@ -25,7 +25,7 @@ public interface IWxCorpAccountService ...@@ -25,7 +25,7 @@ public interface IWxCorpAccountService
* @param wxCorpAccount 企业id相关配置 * @param wxCorpAccount 企业id相关配置
* @return 企业id相关配置集合 * @return 企业id相关配置集合
*/ */
public List<WeCorpAccount> selectWxCorpAccountList(WeCorpAccount wxCorpAccount); public List<WeCorpAccount> selectWeCorpAccountList(WeCorpAccount wxCorpAccount);
/** /**
* 新增企业id相关配置 * 新增企业id相关配置
...@@ -33,7 +33,7 @@ public interface IWxCorpAccountService ...@@ -33,7 +33,7 @@ public interface IWxCorpAccountService
* @param wxCorpAccount 企业id相关配置 * @param wxCorpAccount 企业id相关配置
* @return 结果 * @return 结果
*/ */
public int insertWxCorpAccount(WeCorpAccount wxCorpAccount); public int insertWeCorpAccount(WeCorpAccount wxCorpAccount);
/** /**
* 修改企业id相关配置 * 修改企业id相关配置
...@@ -41,7 +41,7 @@ public interface IWxCorpAccountService ...@@ -41,7 +41,7 @@ public interface IWxCorpAccountService
* @param wxCorpAccount 企业id相关配置 * @param wxCorpAccount 企业id相关配置
* @return 结果 * @return 结果
*/ */
public int updateWxCorpAccount(WeCorpAccount wxCorpAccount); public int updateWeCorpAccount(WeCorpAccount wxCorpAccount);
/** /**
* 批量删除企业id相关配置 * 批量删除企业id相关配置
...@@ -49,7 +49,7 @@ public interface IWxCorpAccountService ...@@ -49,7 +49,7 @@ public interface IWxCorpAccountService
* @param ids 需要删除的企业id相关配置ID * @param ids 需要删除的企业id相关配置ID
* @return 结果 * @return 结果
*/ */
public int deleteWxCorpAccountByIds(Long[] ids); public int deleteWeCorpAccountByIds(Long[] ids);
/** /**
* 删除企业id相关配置信息 * 删除企业id相关配置信息
...@@ -57,14 +57,14 @@ public interface IWxCorpAccountService ...@@ -57,14 +57,14 @@ public interface IWxCorpAccountService
* @param id 企业id相关配置ID * @param id 企业id相关配置ID
* @return 结果 * @return 结果
*/ */
public int deleteWxCorpAccountById(Long id); public int deleteWeCorpAccountById(Long id);
/** // /**
* 获取有效的企业id // * 获取有效的企业id
* // *
* @return 结果 // * @return 结果
*/ // */
public WeCorpAccount findValidWxCorpAccount(); // public WeCorpAccount findValidWeCorpAccount();
} }
package com.linkwechat.wecom.service;
import java.util.List;
import com.linkwechat.wecom.domain.WeDepartment;
/**
* 企业微信组织架构相关Service接口
*
* @author ruoyi
* @date 2020-09-01
*/
public interface IWeDepartmentService
{
/**
* 查询企业微信组织架构相关
*
* @param id 企业微信组织架构相关ID
* @return 企业微信组织架构相关
*/
public WeDepartment selectWeDepartmentById(Long id);
/**
* 查询企业微信组织架构相关列表
*
* @param weDepartment 企业微信组织架构相关
* @return 企业微信组织架构相关集合
*/
public List<WeDepartment> selectWeDepartmentList(WeDepartment weDepartment);
/**
* 新增企业微信组织架构相关
*
* @param weDepartment 企业微信组织架构相关
* @return 结果
*/
public int insertWeDepartment(WeDepartment weDepartment);
/**
* 修改企业微信组织架构相关
*
* @param weDepartment 企业微信组织架构相关
* @return 结果
*/
public int updateWeDepartment(WeDepartment weDepartment);
/**
* 批量删除企业微信组织架构相关
*
* @param ids 需要删除的企业微信组织架构相关ID
* @return 结果
*/
public int deleteWeDepartmentByIds(Long[] ids);
/**
* 删除企业微信组织架构相关信息
*
* @param id 企业微信组织架构相关ID
* @return 结果
*/
public int deleteWeDepartmentById(Long id);
}
package com.linkwechat.wecom.service;
import java.util.List;
import com.linkwechat.wecom.domain.WeUser;
/**
* 通讯录相关客户Service接口
*
* @author ruoyi
* @date 2020-08-31
*/
public interface IWeUserService
{
/**
* 查询通讯录相关客户
*
* @param id 通讯录相关客户ID
* @return 通讯录相关客户
*/
public WeUser selectWeUserById(Long id);
/**
* 查询通讯录相关客户列表
*
* @param weUser 通讯录相关客户
* @return 通讯录相关客户集合
*/
public List<WeUser> selectWeUserList(WeUser weUser);
/**
* 新增通讯录相关客户
*
* @param weUser 通讯录相关客户
* @return 结果
*/
public int insertWeUser(WeUser weUser);
/**
* 修改通讯录相关客户
*
* @param weUser 通讯录相关客户
* @return 结果
*/
public int updateWeUser(WeUser weUser);
/**
* 批量删除通讯录相关客户
*
* @param ids 需要删除的通讯录相关客户ID
* @return 结果
*/
public int deleteWeUserByIds(Long[] ids);
/**
* 删除通讯录相关客户信息
*
* @param id 通讯录相关客户ID
* @return 结果
*/
public int deleteWeUserById(Long id);
}
package com.linkwechat.wecom.service.impl; package com.linkwechat.wecom.service.impl;
import com.linkwechat.wecom.client.WeAccessTokenClient; import com.linkwechat.wecom.client.WeAccessTokenClient;
import com.linkwechat.wecom.domain.WeAccessToken; import com.linkwechat.wecom.domain.dto.WeAccessTokenDtoDto;
import com.linkwechat.wecom.domain.WeCorpAccount; import com.linkwechat.wecom.domain.WeCorpAccount;
import com.linkwechat.wecom.service.IWeAccessTokenService; import com.linkwechat.wecom.service.IWeAccessTokenService;
import com.linkwechat.wecom.service.IWxCorpAccountService; import com.linkwechat.wecom.service.IWeCorpAccountService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,7 +22,7 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService { ...@@ -22,7 +22,7 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
private WeAccessTokenClient accessTokenClient; private WeAccessTokenClient accessTokenClient;
@Autowired @Autowired
private IWxCorpAccountService iWxCorpAccountService; private IWeCorpAccountService iWxCorpAccountService;
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
...@@ -32,19 +32,19 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService { ...@@ -32,19 +32,19 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
*/ */
@Override @Override
public void findToken() { public void findToken() {
WeCorpAccount wxCorpAccount // WeCorpAccount wxCorpAccount
= iWxCorpAccountService.findValidWxCorpAccount(); // = iWxCorpAccountService.findValidWxCorpAccount();
if(null == wxCorpAccount){ // if(null == wxCorpAccount){
//返回错误异常,让用户绑定企业id相关信息 // //返回错误异常,让用户绑定企业id相关信息
} // }
WeAccessToken accessToken // WeAccessTokenDtoDto accessToken
= accessTokenClient.getToken(wxCorpAccount.getCorpId(), wxCorpAccount.getCorpSecret()); // = accessTokenClient.getToken(wxCorpAccount.getCorpId(), wxCorpAccount.getCorpSecret());
if(null != accessToken){ // if(null != accessToken){
//token存入redis中(清空原有的token) // //token存入redis中(清空原有的token)
// redisTemplate.opsForValue().set(); //// redisTemplate.opsForValue().set();
//
//
} // }
} }
......
...@@ -2,10 +2,10 @@ package com.linkwechat.wecom.service.impl; ...@@ -2,10 +2,10 @@ package com.linkwechat.wecom.service.impl;
import java.util.List; import java.util.List;
import com.linkwechat.common.utils.DateUtils; import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.wecom.service.IWxCorpAccountService; import com.linkwechat.wecom.service.IWeCorpAccountService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WxCorpAccountMapper; import com.linkwechat.wecom.mapper.WeCorpAccountMapper;
import com.linkwechat.wecom.domain.WeCorpAccount; import com.linkwechat.wecom.domain.WeCorpAccount;
/** /**
...@@ -15,10 +15,10 @@ import com.linkwechat.wecom.domain.WeCorpAccount; ...@@ -15,10 +15,10 @@ import com.linkwechat.wecom.domain.WeCorpAccount;
* @date 2020-08-24 * @date 2020-08-24
*/ */
@Service @Service
public class WxCorpAccountServiceImpl implements IWxCorpAccountService public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
{
@Autowired @Autowired
private WxCorpAccountMapper wxCorpAccountMapper; private WeCorpAccountMapper weCorpAccountMapper;
/** /**
* 查询企业id相关配置 * 查询企业id相关配置
...@@ -27,9 +27,9 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService ...@@ -27,9 +27,9 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService
* @return 企业id相关配置 * @return 企业id相关配置
*/ */
@Override @Override
public WeCorpAccount selectWxCorpAccountById(Long id) public WeCorpAccount selectWeCorpAccountById(Long id)
{ {
return wxCorpAccountMapper.selectWxCorpAccountById(id); return weCorpAccountMapper.selectWeCorpAccountById(id);
} }
/** /**
...@@ -39,9 +39,9 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService ...@@ -39,9 +39,9 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService
* @return 企业id相关配置 * @return 企业id相关配置
*/ */
@Override @Override
public List<WeCorpAccount> selectWxCorpAccountList(WeCorpAccount wxCorpAccount) public List<WeCorpAccount> selectWeCorpAccountList(WeCorpAccount wxCorpAccount)
{ {
return wxCorpAccountMapper.selectWxCorpAccountList(wxCorpAccount); return weCorpAccountMapper.selectWeCorpAccountList(wxCorpAccount);
} }
/** /**
...@@ -51,10 +51,10 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService ...@@ -51,10 +51,10 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertWxCorpAccount(WeCorpAccount wxCorpAccount) public int insertWeCorpAccount(WeCorpAccount wxCorpAccount)
{ {
wxCorpAccount.setCreateTime(DateUtils.getNowDate()); wxCorpAccount.setCreateTime(DateUtils.getNowDate());
return wxCorpAccountMapper.insertWxCorpAccount(wxCorpAccount); return weCorpAccountMapper.insertWeCorpAccount(wxCorpAccount);
} }
/** /**
...@@ -64,10 +64,10 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService ...@@ -64,10 +64,10 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateWxCorpAccount(WeCorpAccount wxCorpAccount) public int updateWeCorpAccount(WeCorpAccount wxCorpAccount)
{ {
wxCorpAccount.setUpdateTime(DateUtils.getNowDate()); wxCorpAccount.setUpdateTime(DateUtils.getNowDate());
return wxCorpAccountMapper.updateWxCorpAccount(wxCorpAccount); return weCorpAccountMapper.updateWeCorpAccount(wxCorpAccount);
} }
/** /**
...@@ -77,9 +77,9 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService ...@@ -77,9 +77,9 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteWxCorpAccountByIds(Long[] ids) public int deleteWeCorpAccountByIds(Long[] ids)
{ {
return wxCorpAccountMapper.deleteWxCorpAccountByIds(ids); return weCorpAccountMapper.deleteWeCorpAccountByIds(ids);
} }
/** /**
...@@ -89,19 +89,19 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService ...@@ -89,19 +89,19 @@ public class WxCorpAccountServiceImpl implements IWxCorpAccountService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteWxCorpAccountById(Long id) public int deleteWeCorpAccountById(Long id)
{ {
return wxCorpAccountMapper.deleteWxCorpAccountById(id); return weCorpAccountMapper.deleteWeCorpAccountById(id);
} }
/** // /**
* 获取有效的企业id // * 获取有效的企业id
* // *
* @return 结果 // * @return 结果
*/ // */
@Override // @Override
public WeCorpAccount findValidWxCorpAccount() { // public WeCorpAccount findValidWeCorpAccount() {
return null; // return null;
} // }
} }
package com.linkwechat.wecom.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WeDepartmentMapper;
import com.linkwechat.wecom.domain.WeDepartment;
import com.linkwechat.wecom.service.IWeDepartmentService;
/**
* 企业微信组织架构相关Service业务层处理
*
* @author ruoyi
* @date 2020-09-01
*/
@Service
public class WeDepartmentServiceImpl implements IWeDepartmentService
{
@Autowired
private WeDepartmentMapper weDepartmentMapper;
/**
* 查询企业微信组织架构相关
*
* @param id 企业微信组织架构相关ID
* @return 企业微信组织架构相关
*/
@Override
public WeDepartment selectWeDepartmentById(Long id)
{
return weDepartmentMapper.selectWeDepartmentById(id);
}
/**
* 查询企业微信组织架构相关列表
*
* @param weDepartment 企业微信组织架构相关
* @return 企业微信组织架构相关
*/
@Override
public List<WeDepartment> selectWeDepartmentList(WeDepartment weDepartment)
{
return weDepartmentMapper.selectWeDepartmentList(weDepartment);
}
/**
* 新增企业微信组织架构相关
*
* @param weDepartment 企业微信组织架构相关
* @return 结果
*/
@Override
public int insertWeDepartment(WeDepartment weDepartment)
{
return weDepartmentMapper.insertWeDepartment(weDepartment);
}
/**
* 修改企业微信组织架构相关
*
* @param weDepartment 企业微信组织架构相关
* @return 结果
*/
@Override
public int updateWeDepartment(WeDepartment weDepartment)
{
return weDepartmentMapper.updateWeDepartment(weDepartment);
}
/**
* 批量删除企业微信组织架构相关
*
* @param ids 需要删除的企业微信组织架构相关ID
* @return 结果
*/
@Override
public int deleteWeDepartmentByIds(Long[] ids)
{
return weDepartmentMapper.deleteWeDepartmentByIds(ids);
}
/**
* 删除企业微信组织架构相关信息
*
* @param id 企业微信组织架构相关ID
* @return 结果
*/
@Override
public int deleteWeDepartmentById(Long id)
{
return weDepartmentMapper.deleteWeDepartmentById(id);
}
}
package com.linkwechat.wecom.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WeUserMapper;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.service.IWeUserService;
/**
* 通讯录相关客户Service业务层处理
*
* @author ruoyi
* @date 2020-08-31
*/
@Service
public class WeUserServiceImpl implements IWeUserService
{
@Autowired
private WeUserMapper weUserMapper;
/**
* 查询通讯录相关客户
*
* @param id 通讯录相关客户ID
* @return 通讯录相关客户
*/
@Override
public WeUser selectWeUserById(Long id)
{
return weUserMapper.selectWeUserById(id);
}
/**
* 查询通讯录相关客户列表
*
* @param weUser 通讯录相关客户
* @return 通讯录相关客户
*/
@Override
public List<WeUser> selectWeUserList(WeUser weUser)
{
return weUserMapper.selectWeUserList(weUser);
}
/**
* 新增通讯录相关客户
*
* @param weUser 通讯录相关客户
* @return 结果
*/
@Override
public int insertWeUser(WeUser weUser)
{
return weUserMapper.insertWeUser(weUser);
}
/**
* 修改通讯录相关客户
*
* @param weUser 通讯录相关客户
* @return 结果
*/
@Override
public int updateWeUser(WeUser weUser)
{
return weUserMapper.updateWeUser(weUser);
}
/**
* 批量删除通讯录相关客户
*
* @param ids 需要删除的通讯录相关客户ID
* @return 结果
*/
@Override
public int deleteWeUserByIds(Long[] ids)
{
return weUserMapper.deleteWeUserByIds(ids);
}
/**
* 删除通讯录相关客户信息
*
* @param id 通讯录相关客户ID
* @return 结果
*/
@Override
public int deleteWeUserById(Long id)
{
return weUserMapper.deleteWeUserById(id);
}
}
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WxCorpAccountMapper"> <mapper namespace="com.linkwechat.wecom.mapper.WeCorpAccountMapper">
<resultMap type="WxCorpAccount" id="WxCorpAccountResult"> <resultMap type="WeCorpAccount" id="WeCorpAccountResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="companyName" column="company_name" /> <result property="companyName" column="company_name" />
<result property="corpId" column="corp_id" /> <result property="corpId" column="corp_id" />
...@@ -17,12 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -17,12 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
</resultMap> </resultMap>
<sql id="selectWxCorpAccountVo"> <sql id="selectWeCorpAccountVo">
select id, company_name, corp_id, corp_secret, status, del_flag, create_by, create_time, update_by, update_time from wx_corp_account select id, company_name, corp_id, corp_secret, status, del_flag, create_by, create_time, update_by, update_time from wx_corp_account
</sql> </sql>
<select id="selectWxCorpAccountList" parameterType="WxCorpAccount" resultMap="WxCorpAccountResult"> <select id="selectWeCorpAccountList" parameterType="WeCorpAccount" resultMap="WeCorpAccountResult">
<include refid="selectWxCorpAccountVo"/> <include refid="selectWeCorpAccountVo"/>
<where> <where>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if> <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="corpId != null and corpId != ''"> and corp_id = #{corpId}</if> <if test="corpId != null and corpId != ''"> and corp_id = #{corpId}</if>
...@@ -31,12 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -31,12 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectWxCorpAccountById" parameterType="Long" resultMap="WxCorpAccountResult"> <select id="selectWeCorpAccountById" parameterType="Long" resultMap="WeCorpAccountResult">
<include refid="selectWxCorpAccountVo"/> <include refid="selectWeCorpAccountVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertWxCorpAccount" parameterType="WxCorpAccount" useGeneratedKeys="true" keyProperty="id"> <insert id="insertWeCorpAccount" parameterType="WeCorpAccount" useGeneratedKeys="true" keyProperty="id">
insert into wx_corp_account insert into wx_corp_account
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyName != null">company_name,</if> <if test="companyName != null">company_name,</if>
...@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
</insert> </insert>
<update id="updateWxCorpAccount" parameterType="WxCorpAccount"> <update id="updateWeCorpAccount" parameterType="WeCorpAccount">
update wx_corp_account update wx_corp_account
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="companyName != null">company_name = #{companyName},</if> <if test="companyName != null">company_name = #{companyName},</if>
...@@ -78,11 +78,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -78,11 +78,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteWxCorpAccountById" parameterType="Long"> <delete id="deleteWeCorpAccountById" parameterType="Long">
delete from wx_corp_account where id = #{id} delete from wx_corp_account where id = #{id}
</delete> </delete>
<delete id="deleteWxCorpAccountByIds" parameterType="String"> <delete id="deleteWeCorpAccountByIds" parameterType="String">
delete from wx_corp_account where id in delete from wx_corp_account where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeDepartmentMapper">
<resultMap type="WeDepartment" id="WeDepartmentResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="nameEn" column="name_en" />
<result property="parentId" column="parent_id" />
<result property="isActivate" column="is_activate" />
<result property="order" column="order" />
</resultMap>
<sql id="selectWeDepartmentVo">
select id, name, name_en, parent_id, is_activate, order from we_department
</sql>
<select id="selectWeDepartmentList" parameterType="WeDepartment" resultMap="WeDepartmentResult">
<include refid="selectWeDepartmentVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="nameEn != null and nameEn != ''"> and name_en = #{nameEn}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="isActivate != null "> and is_activate = #{isActivate}</if>
<if test="order != null "> and order = #{order}</if>
</where>
</select>
<select id="selectWeDepartmentById" parameterType="Long" resultMap="WeDepartmentResult">
<include refid="selectWeDepartmentVo"/>
where id = #{id}
</select>
<insert id="insertWeDepartment" parameterType="WeDepartment">
insert into we_department
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="nameEn != null">name_en,</if>
<if test="parentId != null">parent_id,</if>
<if test="isActivate != null">is_activate,</if>
<if test="order != null">order,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="nameEn != null">#{nameEn},</if>
<if test="parentId != null">#{parentId},</if>
<if test="isActivate != null">#{isActivate},</if>
<if test="order != null">#{order},</if>
</trim>
</insert>
<update id="updateWeDepartment" parameterType="WeDepartment">
update we_department
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="nameEn != null">name_en = #{nameEn},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="isActivate != null">is_activate = #{isActivate},</if>
<if test="order != null">order = #{order},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeDepartmentById" parameterType="Long">
delete from we_department where id = #{id}
</delete>
<delete id="deleteWeDepartmentByIds" parameterType="String">
delete from we_department where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeUserMapper">
<resultMap type="WeUser" id="WeUserResult">
<result property="id" column="id" />
<result property="headImageUrl" column="head_image_url" />
<result property="userName" column="user_name" />
<result property="alias" column="alias" />
<result property="userId" column="user_id" />
<result property="gender" column="gender" />
<result property="mobile" column="mobile" />
<result property="email" column="email" />
<result property="wxAccount" column="wx_account" />
<result property="department" column="department" />
<result property="position" column="position" />
<result property="isLeaderInDept" column="is_leader_in_dept" />
<result property="joinTime" column="join_time" />
<result property="enable" column="enable" />
<result property="idCard" column="id_card" />
<result property="qqAccount" column="qq_account" />
<result property="telephone" column="telephone" />
<result property="address" column="address" />
<result property="birthday" column="birthday" />
<result property="remark" column="remark" />
<result property="isActivate" column="is_activate" />
</resultMap>
<sql id="selectWeUserVo">
select id, head_image_url, user_name, alias, user_id, gender, mobile, email, wx_account, department, position, is_leader_in_dept, join_time, enable, id_card, qq_account, telephone, address, birthday, remark, is_activate from we_user
</sql>
<select id="selectWeUserList" parameterType="WeUser" resultMap="WeUserResult">
<include refid="selectWeUserVo"/>
<where>
<if test="headImageUrl != null and headImageUrl != ''"> and head_image_url = #{headImageUrl}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="alias != null and alias != ''"> and alias = #{alias}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="gender != null "> and gender = #{gender}</if>
<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 = #{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>
<if test="enable != null "> and enable = #{enable}</if>
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
<if test="qqAccount != null and qqAccount != ''"> and qq_account = #{qqAccount}</if>
<if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
<if test="isActivate != null "> and is_activate = #{isActivate}</if>
</where>
</select>
<select id="selectWeUserById" parameterType="Long" resultMap="WeUserResult">
<include refid="selectWeUserVo"/>
where id = #{id}
</select>
<insert id="insertWeUser" parameterType="WeUser">
insert into we_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="headImageUrl != null">head_image_url,</if>
<if test="userName != null">user_name,</if>
<if test="alias != null">alias,</if>
<if test="userId != null">user_id,</if>
<if test="gender != null">gender,</if>
<if test="mobile != null and mobile != ''">mobile,</if>
<if test="email != null">email,</if>
<if test="wxAccount != null">wx_account,</if>
<if test="department != null">department,</if>
<if test="position != null">position,</if>
<if test="isLeaderInDept != null">is_leader_in_dept,</if>
<if test="joinTime != null">join_time,</if>
<if test="enable != null">enable,</if>
<if test="idCard != null">id_card,</if>
<if test="qqAccount != null">qq_account,</if>
<if test="telephone != null">telephone,</if>
<if test="address != null">address,</if>
<if test="birthday != null">birthday,</if>
<if test="remark != null">remark,</if>
<if test="isActivate != null">is_activate,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="headImageUrl != null">#{headImageUrl},</if>
<if test="userName != null">#{userName},</if>
<if test="alias != null">#{alias},</if>
<if test="userId != null">#{userId},</if>
<if test="gender != null">#{gender},</if>
<if test="mobile != null and mobile != ''">#{mobile},</if>
<if test="email != null">#{email},</if>
<if test="wxAccount != null">#{wxAccount},</if>
<if test="department != null">#{department},</if>
<if test="position != null">#{position},</if>
<if test="isLeaderInDept != null">#{isLeaderInDept},</if>
<if test="joinTime != null">#{joinTime},</if>
<if test="enable != null">#{enable},</if>
<if test="idCard != null">#{idCard},</if>
<if test="qqAccount != null">#{qqAccount},</if>
<if test="telephone != null">#{telephone},</if>
<if test="address != null">#{address},</if>
<if test="birthday != null">#{birthday},</if>
<if test="remark != null">#{remark},</if>
<if test="isActivate != null">#{isActivate},</if>
</trim>
</insert>
<update id="updateWeUser" parameterType="WeUser">
update we_user
<trim prefix="SET" suffixOverrides=",">
<if test="headImageUrl != null">head_image_url = #{headImageUrl},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="alias != null">alias = #{alias},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="gender != null">gender = #{gender},</if>
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
<if test="email != null">email = #{email},</if>
<if test="wxAccount != null">wx_account = #{wxAccount},</if>
<if test="department != null">department = #{department},</if>
<if test="position != null">position = #{position},</if>
<if test="isLeaderInDept != null">is_leader_in_dept = #{isLeaderInDept},</if>
<if test="joinTime != null">join_time = #{joinTime},</if>
<if test="enable != null">enable = #{enable},</if>
<if test="idCard != null">id_card = #{idCard},</if>
<if test="qqAccount != null">qq_account = #{qqAccount},</if>
<if test="telephone != null">telephone = #{telephone},</if>
<if test="address != null">address = #{address},</if>
<if test="birthday != null">birthday = #{birthday},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="isActivate != null">is_activate = #{isActivate},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeUserById" parameterType="Long">
delete from we_user where id = #{id}
</delete>
<delete id="deleteWeUserByIds" parameterType="String">
delete from we_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file \ No newline at end of file
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,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>
</properties> </properties>
<!-- 依赖声明 --> <!-- 依赖声明 -->
...@@ -197,6 +198,14 @@ ...@@ -197,6 +198,14 @@
<version>${forest.version}</version> <version>${forest.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
File mode changed
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!