微信支付
This commit is contained in:
parent
41cec3cec4
commit
66a1d58753
|
|
@ -70,10 +70,14 @@ public class WxDepartmentController {
|
||||||
@PostMapping("/insertList")
|
@PostMapping("/insertList")
|
||||||
public AjaxResult insertList(@RequestBody List<WxCpDepart> wxCpDeparts) {
|
public AjaxResult insertList(@RequestBody List<WxCpDepart> wxCpDeparts) {
|
||||||
this.logger.info("全量新增组织机构");
|
this.logger.info("全量新增组织机构");
|
||||||
|
int i=0;
|
||||||
|
int u=0;
|
||||||
|
WxCpDepart temp=null;
|
||||||
try {
|
try {
|
||||||
WxCpDepartmentService departmentService = WxCpConfiguration.getCpService(999999).getDepartmentService();
|
WxCpDepartmentService departmentService = WxCpConfiguration.getCpService(999999).getDepartmentService();
|
||||||
for (WxCpDepart wxCpDepart : wxCpDeparts) {
|
for (WxCpDepart wxCpDepart : wxCpDeparts) {
|
||||||
List<WxCpDepart> list =null;
|
List<WxCpDepart> list =null;
|
||||||
|
temp=wxCpDepart;
|
||||||
try {
|
try {
|
||||||
list = departmentService.list(wxCpDepart.getId());
|
list = departmentService.list(wxCpDepart.getId());
|
||||||
} catch (WxErrorException e) {
|
} catch (WxErrorException e) {
|
||||||
|
|
@ -81,13 +85,15 @@ public class WxDepartmentController {
|
||||||
}
|
}
|
||||||
if(list!=null&& list.size()>0){
|
if(list!=null&& list.size()>0){
|
||||||
departmentService.update(wxCpDepart);
|
departmentService.update(wxCpDepart);
|
||||||
|
u++;
|
||||||
}else{
|
}else{
|
||||||
Integer id = departmentService.create(wxCpDepart);
|
Integer id = departmentService.create(wxCpDepart);
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.success(wxCpDeparts.size(),"全量新增组织机构成功");
|
return AjaxResult.success(wxCpDeparts.size(),"全量同步组织机构成功,新增【"+i+"】条,更新【"+u+"】条");
|
||||||
} catch (WxErrorException e) {
|
} catch (WxErrorException e) {
|
||||||
return AjaxResult.error("全量新增组织机构失败,错误码【"+ e.getError().getErrorCode()+"】,原因:"+ ErrorCodeText.errorMsg(e.getError().getErrorCode()));
|
return AjaxResult.error("全量新增组织机构失败,新增成功【\"+i+\"】条,更新成功【\"+u+\"】条。出错部门名称信息【"+(temp!=null?temp.toString():"部门信息为空")+"】,错误码【"+ e.getError().getErrorCode()+"】,原因:"+ ErrorCodeText.errorMsg(e.getError().getErrorCode()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Log(title = "获取组织机构", businessType = BusinessType.UPDATE)
|
@Log(title = "获取组织机构", businessType = BusinessType.UPDATE)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue