|
|
|
@@ -28,9 +28,13 @@ import com.xueyi.system.api.staff.domain.dto.DmStaffDto; |
|
|
|
import com.xueyi.system.api.staff.domain.po.DmStaffPo; |
|
|
|
import com.xueyi.system.authority.service.ISysLoginService; |
|
|
|
import com.xueyi.system.organize.service.ISysEnterpriseService; |
|
|
|
import com.xueyi.system.resource.domain.dto.DmResourcesDto; |
|
|
|
import com.xueyi.system.resource.service.IDmResourcesService; |
|
|
|
import com.xueyi.system.staff.domain.query.DmStaffQuery; |
|
|
|
import com.xueyi.system.api.staff.domain.vo.DmStaffFeature; |
|
|
|
import com.xueyi.system.staff.service.IDmStaffService; |
|
|
|
import com.xueyi.tenant.api.tenant.domain.po.SysEnterpriseStaff; |
|
|
|
import com.xueyi.tenant.api.tenant.feign.RemoteTenantService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
@@ -65,6 +69,13 @@ public class DmStaffController extends BaseController<DmStaffQuery, DmStaffDto, |
|
|
|
@Autowired |
|
|
|
ISysEnterpriseService enterpriseService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
IDmResourcesService resourcesService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
RemoteTenantService tenantService; |
|
|
|
|
|
|
|
/** 定义节点名称 */ |
|
|
|
@Override |
|
|
|
protected String getNodeName() { |
|
|
|
@@ -124,7 +135,16 @@ public class DmStaffController extends BaseController<DmStaffQuery, DmStaffDto, |
|
|
|
Long tenantId = Long.parseLong(String.valueOf(SecurityContextHolder.getLocalMap().get("enterprise_id"))); |
|
|
|
SysEnterpriseDto enterpriseDto = enterpriseService.selectById(tenantId); |
|
|
|
Source source = SourceUtil.getSourceCache(enterpriseDto.getStrategyId()); |
|
|
|
|
|
|
|
if (dmStaff.getResourceId() != null) { |
|
|
|
DmResourcesDto dto = resourcesService.selectById(dmStaff.getResourceId()); |
|
|
|
if (dto != null) { |
|
|
|
dmStaff.setResourceId(dto.getId()); |
|
|
|
} |
|
|
|
SysEnterpriseStaff enterpriseStaff = new SysEnterpriseStaff(); |
|
|
|
enterpriseStaff.setPhone(dmStaff.getPhone()); |
|
|
|
enterpriseStaff.setTenantId(SecurityContextHolder.getEnterpriseId()); |
|
|
|
tenantService.saveEnterpriseStaff(enterpriseStaff, SecurityConstants.INNER); |
|
|
|
} |
|
|
|
AjaxResult result = super.add(dmStaff); |
|
|
|
if (dmStaff.getBirthDate() != null) { |
|
|
|
DmWebSocketMessageVo vo = new DmWebSocketMessageVo(); |
|
|
|
|