Commit 8f519367 authored by suhuiguang's avatar suhuiguang

1.接收机构转为登记机关

parent 073d9697
......@@ -6,7 +6,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.ReportAnalysisSearchDTO;
import com.yeejoin.amos.boot.module.jg.api.vo.JgBizCountBaseVo;
import com.yeejoin.amos.boot.module.jg.api.vo.JgBizEquipStateCountVo;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -42,9 +41,10 @@ public interface IReportAnalysisService {
/**
* 查询当前登录人的管辖机构树,显示本级级所有下级
* @param selectedOrgInfo 登录人信息
* @param isReg 是否需要转换为登记机关
* @return List<CompanyBo>
*/
List<CompanyBo> getReceiveCompanyTreeWithAuth(ReginParams selectedOrgInfo);
List<CompanyBo> getReceiveCompanyTreeWithAuth(ReginParams selectedOrgInfo, boolean isReg);
/**
* 业务类型枚举
......
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IReportAnalysisService;
import com.yeejoin.amos.boot.module.jg.api.vo.JgBizCountBaseVo;
import com.yeejoin.amos.boot.module.jg.api.vo.JgBizEquipStateCountVo;
import com.yeejoin.amos.boot.module.ymt.api.common.StringUtil;
import com.yeejoin.amos.feign.rule.model.FactBaseModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
......@@ -86,10 +87,18 @@ public class ReportAnalysisController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/receive-reg/tree")
@ApiOperation("查询当前登录人的管辖机构树,显示本级及所有下级,将接收机构转化为登记机关")
public ResponseModel<List<CompanyBo>> getReceiveCompanyRegTreeWithAuth() {
List<CompanyBo> result = reportAnalysisService.getReceiveCompanyTreeWithAuth(getSelectedOrgInfo(), true);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/receive-company/tree")
@ApiOperation("查询当前登录人的管辖机构树,显示本级及所有下级")
@ApiOperation("查询当前登录人的管辖机构树,显示本级及所有下级,接收机构")
public ResponseModel<List<CompanyBo>> getReceiveCompanyTreeWithAuth() {
List<CompanyBo> result = reportAnalysisService.getReceiveCompanyTreeWithAuth(getSelectedOrgInfo());
List<CompanyBo> result = reportAnalysisService.getReceiveCompanyTreeWithAuth(getSelectedOrgInfo(), false);
return ResponseHelper.buildResponse(result);
}
......
......@@ -94,7 +94,8 @@ public class ReportAnalysisServiceImpl implements IReportAnalysisService {
* 缓存根节点的数据的接收机构数据
*/
public void initRootOrgReceiveTree2Redis() {
getCompanyBos(rootOrgCode);
getCompanyBos(rootOrgCode ,true);
getCompanyBos(rootOrgCode ,false);
}
private void initEquipCategoryCache() {
......@@ -295,8 +296,8 @@ public class ReportAnalysisServiceImpl implements IReportAnalysisService {
}
@Override
public List<CompanyBo> getReceiveCompanyTreeWithAuth(ReginParams selectedOrgInfo) {
return getCompanyBos(selectedOrgInfo.getCompany().getOrgCode());
public List<CompanyBo> getReceiveCompanyTreeWithAuth(ReginParams selectedOrgInfo, boolean isReg) {
return getCompanyBos(selectedOrgInfo.getCompany().getOrgCode(), isReg);
}
@Override
......@@ -304,12 +305,14 @@ public class ReportAnalysisServiceImpl implements IReportAnalysisService {
return JgBizCountBaseVo.BizType.getBizTypeListByGroup(groupKey);
}
private List<CompanyBo> getCompanyBos(String orgCode) {
private List<CompanyBo> getCompanyBos(String orgCode, boolean isReg) {
List<CompanyBo> companyBoList = commonMapper.queryJGCompanyCodeName(orgCode);
// 设置接收机构名称与使用标志上登记机构名称一样
this.setCompany2RealName(companyBoList);
if(isReg){
this.setCompany2RealName(companyBoList);
}
synchronized (this) {
String redisKey = this.buildRedisKey(orgCode);
String redisKey = this.buildRedisKey(orgCode, isReg);
if (redisUtils.hasKey(redisKey)) {
return JSONObject.parseArray(redisUtils.get(redisKey).toString(), CompanyBo.class);
} else {
......@@ -333,8 +336,8 @@ public class ReportAnalysisServiceImpl implements IReportAnalysisService {
return comList2ComTree;
}
private String buildRedisKey(String currentPersonOrgCode) {
return RECEIVE_COUNT_SEARCH_REDIS_KEY + ":" + currentPersonOrgCode;
private String buildRedisKey(String currentPersonOrgCode, boolean isReg) {
return RECEIVE_COUNT_SEARCH_REDIS_KEY + ":" + isReg + currentPersonOrgCode;
}
......
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