Commit ecad121f by 墨竹

fix:报错修改

parent 82873826
......@@ -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,6 +44,11 @@ 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));
......
......@@ -264,7 +264,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());
......@@ -272,7 +274,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);
......
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