Commit 35f55ef9 by fudahua

同步通讯录 微信同步gic

parent adc8e94b
......@@ -53,8 +53,8 @@ public class DepartmentServiceImpl implements DepartmentService {
throw new RuntimeException("父部门不存在");
}
tab.setChainId(pDepartment.getChainId() + Constant.ID_SEPARATOR + pDepartment.getDepartmentId());
tab.setChainName(pDepartment.getChainName() + Constant.NAME_SEPARATOR + tab.getDepartmentName());
tab.setLevel(pDepartment.getLevel() + 1);
tab.setChainName(pDepartment.getChainName() + Constant.NAME_SEPARATOR + pDepartment.getDepartmentName());
tab.setLevel(pDepartment.getLevel() + 1);
}
Integer isStore = department.getIsStore();
......
......@@ -90,6 +90,14 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
logger.info("处理企业微信部门:{}", JSONObject.toJSONString(dealParamMqDTO));
String reason = "";
TabHaobanDepartment parent = this.departmentService.getByWxId(dataPre.getpDataId(), dataPre.getWxEnterpriseId());
if (parent == null && dataPre.getpDataId().equals(0)) {
parent = new TabHaobanDepartment();
parent.setLevel(0);
parent.setDepartmentId("0");
parent.setChainId("0");
parent.setChainName("0");
}
if (parent == null) {
logger.info("不存在该父部门:c:{},p:{}", dataPre.getDataId(), dataPre.getpDataId());
dealException(dealParamMqDTO.getTaskId(), dealParamMqDTO.getData(), dataPre.getEnterpriseId(), "父部们不存在");
......@@ -114,6 +122,10 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
dto.setWxEnterpriseId(dataPre.getWxEnterpriseId());
dto.setWxDepartmentId(qywxDepart.getId() + "");
dto.setParentDepartmentId(parent.getDepartmentId());
dto.setChainId(parent.getChainId() + Constant.ID_SEPARATOR + parent.getDepartmentId());
dto.setChainName(parent.getChainName() + Constant.NAME_SEPARATOR + parent.getDepartmentName());
dto.setSort(qywxDepart.getOrder());
dto.setIsStore(0);
this.departmentService.add(dto);
......@@ -136,7 +148,9 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
public void dealException(String taskId, String dataId, String enterpriseId, String reason) {
logger.info("部门同步异常:{},{}", taskId, dataId);
preDealService.updateStatusByDataId(taskId, dataId, PreDealStatusEnum.exception.getVal(), reason);
logger.info("递归调用更新状态start==:{},d:{}", taskId, dataId);
changeChildStatus(taskId, dataId, enterpriseId, reason);
logger.info("递归调用更新状态end==:{},d:{}", taskId, dataId);
checkDepartmentTask(taskId);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment