Commit f9d7df7e by qwmqiuwenmin

fix

parent 3a784794
......@@ -91,6 +91,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
logger.info("【部门新增】enterpriseDTO = {}",JSON.toJSONString(enterpriseDTO));
if(enterpriseDTO != null) {
if(application != null) {
Integer sort = department.getSort();
if(sort == null) {
int maxSort = departmentMapper.selectMaxSort(department.getParentDepartmentId());
department.setSort(maxSort + 1);
}
com.gic.wechat.api.dto.qywx.DepartmentDTO dto = new com.gic.wechat.api.dto.qywx.DepartmentDTO();
dto.setCorpid(enterpriseDTO.getCorpid());
dto.setName(department.getDepartmentName());
......
......@@ -133,6 +133,7 @@ public class MessageApiServiceImpl implements MessageApiService {
departmentDTO.setLevel(parentDepartment.getLevel() + 1);
departmentDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId());
departmentDTO.setWxDepartmentId(qywxCallBackDTO.getId()+"");
departmentDTO.setSort(qywxCallBackDTO.getOrder());
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