Commit b398bded by fudahua

fix

parent e3429767
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.task;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.dto.StoreGroupDTO;
......@@ -104,10 +105,12 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
return;
}
TabHaobanDepartment department = departmentService.getByWxId(dealParamMqDTO.getData(), dataPre.getWxEnterpriseId());
DepartmentDTO dto = new DepartmentDTO();
if (department != null) {
logger.info("已经同步过了:{}", dataPre.getDataId());
dealException(dealParamMqDTO.getTaskId(), dealParamMqDTO.getData(), dataPre.getEnterpriseId(), dealParamMqDTO.getData() + ":该部门存在");
return;
dto = EntityUtil.changeEntityByJSON(DepartmentDTO.class, department);
// dealException(dealParamMqDTO.getTaskId(), dealParamMqDTO.getData(), dataPre.getEnterpriseId(), dealParamMqDTO.getData() + ":该部门存在");
}
logger.info("分组是否存在:{}", JSON.toJSONString(department));
......@@ -116,7 +119,6 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
boolean resultFlag = true;
try {
DepartmentDTO dto = new DepartmentDTO();
dto.setDepartmentName(qywxDepart.getName());
dto.setLevel(parent.getLevel() + 1);
dto.setWxEnterpriseId(dataPre.getWxEnterpriseId());
......@@ -132,7 +134,11 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
dto.setSort(qywxDepart.getOrder());
dto.setIsStore(0);
this.departmentService.add(dto);
if (dto.getDepartmentId()==null) {
this.departmentService.add(dto);
}else{
this.departmentService.edit(dto);
}
} catch (Exception e) {
resultFlag = false;
reason = "处理异常";
......
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