Commit e5faab55 by qwmqiuwenmin

fix

parent 3614db44
......@@ -22,6 +22,7 @@ import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.service.*;
import com.gic.mq.sdk.GicMQClient;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import java.util.List;
......@@ -57,6 +58,8 @@ public class MessageApiServiceImpl implements MessageApiService {
private WxApplicationService wxApplicationService;
@Autowired
private Config config;
@Autowired
private QywxDepartmentApiService qywxDepartmentApiService;
@Override
public void gicMessageReceive(GicMessageDTO gicMessageDTO) {
......@@ -195,7 +198,20 @@ public class MessageApiServiceImpl implements MessageApiService {
}
departmentDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId());
departmentDTO.setWxDepartmentId(qywxCallBackDTO.getId()+"");
departmentDTO.setSort(qywxCallBackDTO.getOrder());
if(qywxCallBackDTO.getParentId() != null){
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listDepartment(qywxCallBackDTO.getAuthCorpId(), qywxCallBackDTO.getSuiteId(), qywxCallBackDTO.getParentId());
for (com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO2 : list) {
if(departmentDTO2.getId().equals(departmentDTO.getDepartmentId())){
departmentDTO.setSort(qywxCallBackDTO.getOrder());
}else{
TabHaobanDepartment tab = this.departmentService.getByWxId(departmentDTO2.getId() + "", enterprise.getWxEnterpriseId());
if(tab != null){
tab.setSort(departmentDTO2.getOrder());
this.departmentService.edit(EntityUtil.changeEntityByJSON(DepartmentDTO.class, tab));
}
}
}
}
if(qywxCallBackDTO.getChangeType().equals(WxEditType.ADDDEPART.getCode())){
String response = this.departmentService.add(departmentDTO);
log.info("微信同步新增部门:{}", JSON.toJSONString(response));
......
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