Commit c91b4a32 by 墨竹

fix:报错修改

parent efdee5c5
......@@ -10,6 +10,8 @@ import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO;
import com.gic.haoban.manage.service.service.QywxErrorLogService;
import com.gic.haoban.manage.service.service.WxApplicationService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -24,6 +26,7 @@ import java.util.List;
*/
@Service
public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
private static final Logger logger = LogManager.getLogger(TabQywxErrorLogServiceImpl.class);
@Autowired
private TabQywxErrorLogMapper tabQywxErrorLogMapper;
......@@ -41,9 +44,14 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
tabQywxErrorLogBO.setWxEnterpriseId(tabHaobanWxApplication.getWxEnterpriseId());
}
}
wxEnterpriseId = tabQywxErrorLogBO.getWxEnterpriseId();
if (StringUtils.isBlank(wxEnterpriseId)) {
logger.error("企业微信id为空,corpid:{}", corpid);
return null;
}
tabQywxErrorLogBO.setId(UniqueIdUtils.uniqueLong());
tabQywxErrorLogBO.setCreateTime(new Date());
this.tabQywxErrorLogMapper.insert(EntityUtil.changeEntityByOrika(TabQywxErrorLog.class,tabQywxErrorLogBO));
this.tabQywxErrorLogMapper.insert(EntityUtil.changeEntityByOrika(TabQywxErrorLog.class, tabQywxErrorLogBO));
return tabQywxErrorLogBO;
}
......
......@@ -133,8 +133,8 @@ public class MessageApiServiceImpl implements MessageApiService {
String suiteId = dto.getSuiteId();
String authCorpId = dto.getAuthCorpId();
String staffThirdWxEnterpriseId = config.getStaffThirdWxEnterpriseId();
if (staffThirdWxEnterpriseId.contains(authCorpId) ) {
log.info("处理定制特殊企业同步:{}",authCorpId);
if (staffThirdWxEnterpriseId.contains(authCorpId)) {
log.info("处理定制特殊企业同步:{}", authCorpId);
if (CONTACT_APP.equals(suiteId) || SELF_APP.equals(suiteId)) {
log.info("自建和客户联系回调不处理");
return;
......@@ -292,7 +292,9 @@ public class MessageApiServiceImpl implements MessageApiService {
}
departmentIds.append(department.getDepartmentId()).append(",");
}
departmentIds = new StringBuilder(departmentIds.substring(0, departmentIds.length() - 1));
if (departmentIds.length() > 0) {
departmentIds = new StringBuilder(departmentIds.substring(0, departmentIds.length() - 1));
}
} else {
//部门没有修改
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedService.listStaffDepartmentByStaffId(staff.getStaffId());
......@@ -300,7 +302,9 @@ public class MessageApiServiceImpl implements MessageApiService {
for (TabHaobanStaffDepartmentRelated tabHaobanStaffDepartmentRelated : list) {
departmentIds.append(tabHaobanStaffDepartmentRelated.getDepartmentId()).append(",");
}
departmentIds = new StringBuilder(departmentIds.substring(0, departmentIds.length() - 1));
if (departmentIds.length() > 0) {
departmentIds = new StringBuilder(departmentIds.substring(0, departmentIds.length() - 1));
}
}
}
StaffDTO staffDTO = EntityUtil.changeEntityByJSON(StaffDTO.class, staff);
......@@ -317,7 +321,7 @@ public class MessageApiServiceImpl implements MessageApiService {
if (null != user) {
Integer status = user.getStatus();
// 1=已激活,2=已禁用,4=未激活,5=退出企业。
log.info("企业微信用户状态:{}",status);
log.info("企业微信用户状态:{}", status);
if (status == 1) {
log.info("企业微信用户存在,并且已激活无需删除:{}:{}", wxEnterpriseId, userid);
return;
......@@ -340,7 +344,7 @@ public class MessageApiServiceImpl implements MessageApiService {
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationApiService.listByStaffId(wxEnterpriseId, staffId);
if (CollectionUtils.isNotEmpty(staffClerkRelationDTOS)) {
for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) {
staffClerkRelationApiService.unbindByStaffAndClerkId(staffId,staffClerkRelationDTO.getClerkId());
staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, staffClerkRelationDTO.getClerkId());
}
}
}
......@@ -705,7 +709,7 @@ public class MessageApiServiceImpl implements MessageApiService {
if (null != user) {
Integer status = user.getStatus();
// 1=已激活,2=已禁用,4=未激活,5=退出企业。
log.info("企业微信用户状态:{}",status);
log.info("企业微信用户状态:{}", status);
if (status == 1) {
log.info("企业微信用户存在,并且已激活无需删除:{}:{}", wxEnterpriseId, userid);
return;
......@@ -728,7 +732,7 @@ public class MessageApiServiceImpl implements MessageApiService {
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationApiService.listByStaffId(wxEnterpriseId, staffId);
if (CollectionUtils.isNotEmpty(staffClerkRelationDTOS)) {
for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) {
staffClerkRelationApiService.unbindByStaffAndClerkId(staffId,staffClerkRelationDTO.getClerkId());
staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, staffClerkRelationDTO.getClerkId());
}
}
}
......
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