update 功能安全中心 企业用户编辑联系人

This commit is contained in:
lijiarao
2024-07-05 10:42:24 +08:00
parent 0edd743ee5
commit e8fcba719f
@@ -123,10 +123,17 @@ public class SafetyCenterSubitemService extends ServiceImpl<SafetyCenterSubitemM
}
//判重,公司是否重复
String companyId = safetyCenterSubitem.getCompanyId();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String companyId;
//如果是企业用户,使用自己的公司id
if (sysUser.getIsCompanyUser()) {
companyId = sysUser.getCompanyId();
safetyCenterSubitem.setCompanyId(companyId);
}else {
companyId = safetyCenterSubitem.getCompanyId();
}
PayCompanyManagement companyManagement = payCompanyManagementService.getById(companyId);
String companyName = companyManagement.getCompanyName();
LambdaQueryWrapper<SafetyCenterSubitem> wrapper = new LambdaQueryWrapper<>();
wrapper.ne(SafetyCenterSubitem::getId,subitemId);
wrapper.eq(SafetyCenterSubitem::getProjectId,projectId);