fix bug orgId not send
parent
083bebf2ac
commit
2621c69085
|
|
@ -1,18 +1,11 @@
|
|||
package org.qinan.safetyeval.adapter.web;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.qinan.safetyeval.client.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.qinan.safetyeval.client.api.OrgDepartmentApi;
|
||||
import org.qinan.safetyeval.client.co.OrgDepartmentCO;
|
||||
import org.qinan.safetyeval.client.dto.OrgDepartmentAddCmd;
|
||||
import org.qinan.safetyeval.client.dto.OrgDepartmentModifyCmd;
|
||||
import org.qinan.safetyeval.client.dto.OrgDepartmentPageQuery;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.qinan.safetyeval.client.dto.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import org.qinan.safetyeval.client.co.QualFilingChangeCO;
|
|||
import org.qinan.safetyeval.client.co.QualFilingChangeComplianceCheckResultCO;
|
||||
import org.qinan.safetyeval.client.co.QualFilingChangeOrgCO;
|
||||
import org.qinan.safetyeval.client.dto.*;
|
||||
import org.qinan.safetyeval.infrastructure.utils.RequestHandlerUtil;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ public class QualFilingChangeController {
|
|||
@ApiOperation("分页查询备案变更-机构端")
|
||||
@GetMapping("/org/page")
|
||||
public PageResponse<QualFilingChangeOrgCO> orgPage(@Validated QualFilingChangePageQuery query) {
|
||||
Long orgId = RequestHandlerUtil.getOrgId();
|
||||
Long orgId = ThreadLocalUserInfoAdapter.getOrgId();
|
||||
query.setOrgId(orgId);
|
||||
return qualFilingChangeApi.orgPage(query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.qinan.safetyeval.domain.entity.OrgDepartmentEntity;
|
|||
import org.qinan.safetyeval.domain.query.OrgDepartmentQuery;
|
||||
import org.qinan.safetyeval.domain.query.PageResult;
|
||||
import org.qinan.safetyeval.domain.service.OrgDepartmentDomainService;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -75,7 +76,7 @@ public class OrgDepartmentExecutor implements OrgDepartmentApi {
|
|||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setTenantId(AuthUserContextAdapter.getCurrentTenantId());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setParentId(query.getParentId());
|
||||
domainQuery.setDeptName(query.getDeptName());
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.qinan.safetyeval.domain.entity.OrgEquipmentEntity;
|
|||
import org.qinan.safetyeval.domain.query.OrgEquipmentQuery;
|
||||
import org.qinan.safetyeval.domain.query.PageResult;
|
||||
import org.qinan.safetyeval.domain.service.OrgEquipmentDomainService;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -95,7 +96,7 @@ public class OrgEquipmentExecutor implements OrgEquipmentApi {
|
|||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setTenantId(AuthUserContextAdapter.getCurrentTenantId());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setDeviceName(query.getDeviceName());
|
||||
domainQuery.setInstrumentType(query.getInstrumentType());
|
||||
domainQuery.setDeviceType(query.getDeviceType());
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.qinan.safetyeval.domain.entity.OrgPersonnelCertEntity;
|
|||
import org.qinan.safetyeval.domain.query.OrgPersonnelCertQuery;
|
||||
import org.qinan.safetyeval.domain.query.PageResult;
|
||||
import org.qinan.safetyeval.domain.service.OrgPersonnelCertDomainService;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -91,7 +92,7 @@ public class OrgPersonnelCertExecutor implements OrgPersonnelCertApi {
|
|||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setTenantId(AuthUserContextAdapter.getCurrentTenantId());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setPersonnelId(query.getPersonnelId());
|
||||
domainQuery.setCertName(query.getCertName());
|
||||
domainQuery.setCertTypeCode(query.getCertTypeCode());
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.qinan.safetyeval.domain.entity.OrgPersonnelChangeEntity;
|
|||
import org.qinan.safetyeval.domain.query.OrgPersonnelChangeQuery;
|
||||
import org.qinan.safetyeval.domain.query.PageResult;
|
||||
import org.qinan.safetyeval.domain.service.OrgPersonnelChangeDomainService;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -74,7 +75,7 @@ public class OrgPersonnelChangeExecutor implements OrgPersonnelChangeApi {
|
|||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setTenantId(AuthUserContextAdapter.getCurrentTenantId());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setPersonnelId(query.getPersonnelId());
|
||||
domainQuery.setChangeItem(query.getChangeItem());
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.jjb.saas.system.client.user.facade.UserFacade;
|
|||
import com.jjb.saas.system.client.user.request.FacadeUserAddCmd;
|
||||
import com.jjb.saas.system.client.user.request.UserAddCmd;
|
||||
import com.jjb.saas.system.client.user.request.UserUpdatePasswordCmd;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.zcloud.gbscommon.utils.MD5;
|
||||
|
|
@ -135,7 +136,7 @@ public class OrgPersonnelExecutor implements OrgPersonnelApi {
|
|||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setTenantId(AuthUserContextAdapter.getCurrentTenantId());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setDeptId(query.getDeptId());
|
||||
domainQuery.setPostId(query.getPostId());
|
||||
domainQuery.setUserName(query.getUserName());
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.qinan.safetyeval.domain.entity.OrgPositionEntity;
|
|||
import org.qinan.safetyeval.domain.query.OrgPositionQuery;
|
||||
import org.qinan.safetyeval.domain.query.PageResult;
|
||||
import org.qinan.safetyeval.domain.service.OrgPositionDomainService;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -71,7 +72,7 @@ public class OrgPositionExecutor implements OrgPositionApi {
|
|||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setTenantId(AuthUserContextAdapter.getCurrentTenantId());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setDeptId(query.getDeptId());
|
||||
domainQuery.setPositionName(query.getPositionName());
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import org.qinan.safetyeval.domain.entity.OrgQualificationEntity;
|
|||
import org.qinan.safetyeval.domain.query.OrgQualificationQuery;
|
||||
import org.qinan.safetyeval.domain.query.PageResult;
|
||||
import org.qinan.safetyeval.domain.service.OrgQualificationDomainService;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -90,7 +91,7 @@ public class OrgQualificationExecutor implements OrgQualificationApi {
|
|||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setTenantId(AuthUserContextAdapter.getCurrentTenantId());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setCertName(query.getCertName());
|
||||
domainQuery.setCertNo(query.getCertNo());
|
||||
domainQuery.setEnableFlag(query.getEnableFlag());
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import org.qinan.safetyeval.domain.query.OrgResignApplyQuery;
|
|||
import org.qinan.safetyeval.domain.query.PageResult;
|
||||
import org.qinan.safetyeval.domain.service.OrgResignApplyDomainService;
|
||||
import org.qinan.safetyeval.app.support.OrgPersonnelViewEnricher;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -105,7 +106,7 @@ public class OrgResignApplyExecutor implements OrgResignApplyApi {
|
|||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setTenantId(AuthUserContextAdapter.getCurrentTenantId());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setPersonnelId(query.getPersonnelId());
|
||||
domainQuery.setAuditStatusCode(query.getAuditStatusCode());
|
||||
domainQuery.setApplicantName(query.getApplicantName());
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ import org.qinan.safetyeval.domain.query.QualFilingChangeQuery;
|
|||
import org.qinan.safetyeval.domain.service.QualFilingChangeDomainService;
|
||||
import org.qinan.safetyeval.domain.service.QualFilingDomainService;
|
||||
import org.qinan.safetyeval.domain.service.QualFilingReviewDomainService;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.mapper.QualFilingChangeMapper;
|
||||
import org.qinan.safetyeval.infrastructure.utils.RequestHandlerUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -172,7 +172,7 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
|||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setTenantId(AuthUserContextAdapter.getCurrentTenantId());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setFilingNo(query.getFilingNo());
|
||||
domainQuery.setFilingStatusCode(query.getFilingStatusCode());
|
||||
PageResult<QualFilingChangeEntity> pageResult = qualFilingChangeDomainService.page(domainQuery);
|
||||
|
|
@ -186,7 +186,7 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
|||
QualFilingChangeQuery domainQuery = new QualFilingChangeQuery();
|
||||
domainQuery.setPageNum(query.getCurrent());
|
||||
domainQuery.setPageSize(query.getSize());
|
||||
domainQuery.setOrgId(query.getOrgId());
|
||||
domainQuery.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
domainQuery.setFilingNo(query.getFilingNo());
|
||||
domainQuery.setFilingStatusCode(query.getFilingStatusCode());
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
|||
|
||||
// 变更基本信息
|
||||
QualFilingChangeEntity entity = qualFilingChangeCmdConvertor.convertCmdToE(cmd.getQualFilingChangeAddCmd());
|
||||
entity.setOrgId(RequestHandlerUtil.getOrgId());
|
||||
entity.setOrgId(ThreadLocalUserInfoAdapter.getOrgId());
|
||||
|
||||
// 变更承诺书
|
||||
QualFilingCommitmentChangeE commitmentEntity = qualFilingCommitmentChangeCmdConvertor.convertCmdToE(cmd.getQualFilingCommitmentChangeAddCmd());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package org.qinan.safetyeval.infrastructure.adapter;
|
||||
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
/**
|
||||
* 基于 ThreadLocal 的用户信息适配器默认实现
|
||||
* <p>
|
||||
|
|
@ -32,4 +36,17 @@ public class ThreadLocalUserInfoAdapter {
|
|||
public static void clear() {
|
||||
ORG_ID.remove();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* holder
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static Long getOrgId() {
|
||||
String orgInfoId = ((ServletRequestAttributes) RequestContextHolder
|
||||
.getRequestAttributes()).getRequest().getHeader("orgInfoId");
|
||||
return StringUtils.isBlank(orgInfoId) ? null : Long.valueOf(orgInfoId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
package org.qinan.safetyeval.infrastructure.utils;
|
||||
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
@UtilityClass
|
||||
public class RequestHandlerUtil {
|
||||
|
||||
|
||||
/**
|
||||
* holder
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static Long getOrgId() {
|
||||
String orgInfoId = ((ServletRequestAttributes) RequestContextHolder
|
||||
.getRequestAttributes()).getRequest().getHeader("orgInfoId");
|
||||
return StringUtils.isBlank(orgInfoId) ? null : Long.valueOf(orgInfoId);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue