企业微信组织机构、成员同步优化
This commit is contained in:
parent
a357d733a0
commit
e6729167aa
|
|
@ -94,8 +94,8 @@ public class WxDepartmentController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "删除组织机构", businessType = BusinessType.DELETE)
|
@Log(title = "删除组织机构", businessType = BusinessType.DELETE)
|
||||||
@GetMapping("/delete/{id}")
|
@GetMapping("/delete")
|
||||||
public AjaxResult delete(@PathVariable("id") Long id) {
|
public AjaxResult delete(Long id) {
|
||||||
try {
|
try {
|
||||||
WxCpDepartmentService departmentService = WxCpConfiguration.getCpService(999999).getDepartmentService();
|
WxCpDepartmentService departmentService = WxCpConfiguration.getCpService(999999).getDepartmentService();
|
||||||
departmentService.delete(id);
|
departmentService.delete(id);
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ public class WxUserController {
|
||||||
return AjaxResult.error("全量新增成员成功【"+i+"】条,其余失败,错误码【"+ e.getError().getErrorCode()+"】,原因:"+ ErrorCodeText.errorMsg(e.getError().getErrorCode()));
|
return AjaxResult.error("全量新增成员成功【"+i+"】条,其余失败,错误码【"+ e.getError().getErrorCode()+"】,原因:"+ ErrorCodeText.errorMsg(e.getError().getErrorCode()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Log(title = "获取成员", businessType = BusinessType.UPDATE)
|
@Log(title = "更新成员", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public AjaxResult update(@RequestBody WxCpUser wxCpUser) {
|
public AjaxResult update(@RequestBody WxCpUser wxCpUser) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -105,14 +105,24 @@ public class WxUserController {
|
||||||
return AjaxResult.error("更新成员失败,错误码【"+ e.getError().getErrorCode()+"】,原因:"+ ErrorCodeText.errorMsg(e.getError().getErrorCode()));
|
return AjaxResult.error("更新成员失败,错误码【"+ e.getError().getErrorCode()+"】,原因:"+ ErrorCodeText.errorMsg(e.getError().getErrorCode()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "删除成员", businessType = BusinessType.DELETE)
|
@Log(title = "删除成员", businessType = BusinessType.DELETE)
|
||||||
@GetMapping("/delete")
|
@GetMapping("/delete")
|
||||||
|
public AjaxResult delete(String id) {
|
||||||
|
try {
|
||||||
|
WxCpUserService userService = WxCpConfiguration.getCpService(999999).getUserService();
|
||||||
|
userService.delete(id);
|
||||||
|
return AjaxResult.success("删除成员成功");
|
||||||
|
} catch (WxErrorException e) {
|
||||||
|
return AjaxResult.error("删除成员出错,错误码【"+ e.getError().getErrorCode()+"】,原因:"+ ErrorCodeText.errorMsg(e.getError().getErrorCode()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Log(title = "批量删除成员", businessType = BusinessType.DELETE)
|
||||||
|
@GetMapping("/deleteByIds")
|
||||||
public AjaxResult delete(@RequestBody String[] ids) {
|
public AjaxResult delete(@RequestBody String[] ids) {
|
||||||
try {
|
try {
|
||||||
WxCpUserService userService = WxCpConfiguration.getCpService(999999).getUserService();
|
WxCpUserService userService = WxCpConfiguration.getCpService(999999).getUserService();
|
||||||
userService.delete(ids);
|
userService.delete(ids);
|
||||||
return AjaxResult.success("删除成员成功");
|
return AjaxResult.success("批量删除成员");
|
||||||
} catch (WxErrorException e) {
|
} catch (WxErrorException e) {
|
||||||
return AjaxResult.error("删除成员出错,错误码【"+ e.getError().getErrorCode()+"】,原因:"+ ErrorCodeText.errorMsg(e.getError().getErrorCode()));
|
return AjaxResult.error("删除成员出错,错误码【"+ e.getError().getErrorCode()+"】,原因:"+ ErrorCodeText.errorMsg(e.getError().getErrorCode()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue