Commit 8b9d9709 by 林冲

Merge branch 'v5.8.2' into 'master'

上线合并

See merge request !7
2 parents 81627e56 432af3c8
......@@ -14,8 +14,8 @@
<properties>
<platform-merchants.api.version>5.5.1-SNAPSHOT</platform-merchants.api.version>
<smartcarlife.api.version>5.8.1-SNAPSHOT</smartcarlife.api.version>
<strategy.api.version>5.7.0-SNAPSHOT</strategy.api.version>
<pe-analysis.api.version>5.8.1-SNAPSHOT</pe-analysis.api.version>
<strategy.api.version>5.8.2-SNAPSHOT</strategy.api.version>
<pe-analysis.api.version>5.8.2-SNAPSHOT</pe-analysis.api.version>
</properties>
<dependencies>
......
......@@ -3,6 +3,7 @@ package cn.com.glsx.dj.config.dubbo;
import cn.com.glsx.dj.smartcarlife.remote.*;
import cn.com.glsx.dj.strategy.remote.StrategyInfoRemote;
import cn.com.glsx.dj.strategy.remote.ProjectGroupRemote;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......@@ -74,4 +75,9 @@ public class SmartCarLifeDubboConfig extends DubboConfig {
public StrategyInfoRemote strategyInfoRemote() {
return factory.builder(StrategyInfoRemote.class).check(check).timeout(timeout).version("1.0.0").build();
}
@Bean
public ProjectGroupRemote projectGroupRemote() {
return factory.builder(ProjectGroupRemote.class).check(check).timeout(timeout).version("1.0.0").build();
}
}
......@@ -6,10 +6,15 @@ import cn.com.glsx.dj.peanalysis.enums.LoginRoleEnum;
import cn.com.glsx.dj.peanalysis.remote.BusinessSceneAnalysisRemote;
import cn.com.glsx.dj.request.MerchantIdPermissionRequest;
import cn.com.glsx.dj.request.common.MerchantRequest;
import cn.com.glsx.dj.request.output.BusinessSceneProjectGroupQueryRequest;
import cn.com.glsx.dj.request.output.SceneBaseRequest;
import cn.com.glsx.dj.response.LoginUserInfoResponse;
import cn.com.glsx.dj.service.LoginService;
import cn.com.glsx.dj.smartcarlife.remote.ServiceMerchantRemote;
import cn.com.glsx.dj.strategy.dto.projectgroup.ProjectGroupOptionDTO;
import cn.com.glsx.dj.strategy.dto.projectgroup.ProjectGroupQueryDTO;
import cn.com.glsx.dj.strategy.dto.projectgroup.WarningTypeOptionDTO;
import cn.com.glsx.dj.strategy.remote.ProjectGroupRemote;
import cn.com.glsx.dj.util.CommonUtil;
import cn.com.glsx.dj.util.DateUtils;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
......@@ -21,6 +26,7 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.rop.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
......@@ -46,6 +52,8 @@ public class BusinessSceneAnalysisController {
@Resource
private BusinessSceneAnalysisRemote businessSceneAnalysisRemote;
@Resource
private ProjectGroupRemote projectGroupRemote;
@Autowired
private LoginService loginService;
@Autowired
......@@ -54,6 +62,38 @@ public class BusinessSceneAnalysisController {
private ServiceMerchantRemote serviceMerchantRemote;
@ApiOperation("BI-经营分析-项目组下拉列表")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.project.group.options")
public RopResponse<List<ProjectGroupOptionDTO>> listProjectGroupOptions(BusinessSceneProjectGroupQueryRequest request) {
try {
ProjectGroupQueryDTO queryDTO = new ProjectGroupQueryDTO();
queryDTO.setGroupName(StringUtils.trimToNull(request == null ? null : request.getGroupName()));
RpcResponse<List<ProjectGroupOptionDTO>> response = projectGroupRemote.listProjectGroups(queryDTO);
if (response.isSuccess()) {
return RopResponse.success(response.getResult());
}
return RopResponse.error(response.getMessage());
} catch (Exception e) {
log.error("项目组下拉列表接口异常", e);
return RopResponse.error(e.getMessage());
}
}
@ApiOperation("BI-经营分析-预警类型下拉列表")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.warning.type.options")
public RopResponse<List<WarningTypeOptionDTO>> listWarningTypeOptions(AbstractRopRequest request) {
try {
RpcResponse<List<WarningTypeOptionDTO>> response = projectGroupRemote.listWarningTypes();
if (response.isSuccess()) {
return RopResponse.success(response.getResult());
}
return RopResponse.error(response.getMessage());
} catch (Exception e) {
log.error("预警类型下拉列表接口异常", e);
return RopResponse.error(e.getMessage());
}
}
@ApiOperation("BI-总部视角/区域运营、销售视角----延保/权益/轻改-总产值、目标产值、达成率")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.output.scene", needInSession = NeedInSessionType.YES)
public RopResponse<SceneOutputResponse> sceneOutput(SceneBaseRequest request) {
......@@ -206,19 +246,30 @@ public class BusinessSceneAnalysisController {
merchantIdList = loginService.filterStoreTypeAndCategoryPermission(merchantIdList, request);
log.info("当前用户权限门店(过滤门店类型、经营品类):[{}]", merchantIdList);
List<Integer> maskMerchantIds = CommonUtil.convert2Integer(StringUtils.split(environment.getProperty("permission.mask.merchant.ids"), ",")) ;
req.setExcludeIds(maskMerchantIds);
// 添加兜底预警门店以及生态预警门店
// merchantIdList = loginService.filterDdyjMerchant(merchantIdList, req);
// merchantIdList = loginService.filterStyjMerchant(merchantIdList, req);
// 20260527 被预警类型过滤条件取代
// 添加兜底预警门店以及生态预警门店
merchantIdList = loginService.filterDdyjMerchant(merchantIdList, req);
merchantIdList = filterExcludeMerchantIds(merchantIdList, req);
log.info("当前用户权限门店(过滤屏蔽门店):[{}]", merchantIdList);
merchantIdList = loginService.filterStyjMerchant(merchantIdList, req);
return merchantIdList;
}
private List<Integer> filterExcludeMerchantIds(List<Integer> merchantIdList, SceneBaseReq req) {
List<Integer> maskMerchantIds = CommonUtil.convert2Integer(StringUtils.split(environment.getProperty("permission.mask.merchant.ids"), ",")) ;
log.info("屏蔽门店:[{}]", maskMerchantIds);
req.setExcludeIds(maskMerchantIds);
if (CollectionUtils.isNotEmpty(maskMerchantIds) && CollectionUtils.isNotEmpty(merchantIdList)) {
merchantIdList = merchantIdList.stream().filter(p -> !maskMerchantIds.contains(p)).collect(Collectors.toList());
log.info("当前用户权限门店(过滤屏蔽门店):[{}]", merchantIdList);
if (CollectionUtils.isEmpty(merchantIdList)) {
log.info("当前用户权限门店(过滤屏蔽门店)后为空,返回无权限[-1]");
return LoginService.NO_PERMISSION_LIST;
}
}
return merchantIdList;
}
......@@ -439,7 +490,7 @@ public class BusinessSceneAnalysisController {
}
}
@ApiOperation("BI-总部视角/区域运营、销售视角----延保/权益/轻改-查询门店是否鸿蒙")
@ApiOperation("BI-总部视角/区域运营、销售视角----延保/权益/轻改-查询门店是否鸿蒙-问界")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.store.special.brand", needInSession = NeedInSessionType.NO)
public RopResponse<Boolean> isHarmonyStore(MerchantRequest request) {
try {
......@@ -451,13 +502,13 @@ public class BusinessSceneAnalysisController {
}
List<Integer> merchantIds = merchant.stream().map(p -> p.getMerchantId()).collect(Collectors.toList());
List<String> brandIds = merchant.stream()
.map(p -> p.getMerchantBrandCars())
.map(p -> p.getMerchantBrandMain())
.filter(StringUtils::isNotBlank)
.flatMap(p -> Arrays.stream(p.split(";")))
.flatMap(p -> Arrays.stream(p.split(",")))
.collect(Collectors.toList());
log.info("merchant.id: {}, brandIds: {}", merchantIds, brandIds);
String harmonyBrandId = environment.getProperty("dj.pe.analysis.business.scene.harmony.brandId", String.class, "2978");
String harmonyBrandId = environment.getProperty("dj.pe.analysis.business.scene.harmony.brandId", String.class, "2695");
return RopResponse.success(brandIds.contains(harmonyBrandId));
} catch (Exception e) {
log.error("接口异常", e);
......
......@@ -12,6 +12,7 @@ import cn.com.glsx.dj.strategy.remote.StrategyInfoRemote;
import cn.com.glsx.dj.util.CommonUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
......@@ -88,7 +89,7 @@ public class StoreCommentController {
RpcResponse<RpcPagination<StrategyInfo>> response = strategyInfoRemote.selectStrategyInfoPage(pagination);
if (response.hasError()) {
log.error(response.getMessage());
return RopResponse.error(response.getError(), response.getMessage());
return RopResponse.error(response.getMessage());
}
LoginUserInfoResponse loginUserInfo = CommonUtil.getLoginUserInfo();
return CommonUtil.convertPaginationRopResponse(response, source -> {
......@@ -102,4 +103,23 @@ public class StoreCommentController {
return RopResponse.error(e.getMessage());
}
}
@ApiOperation("查询策略详情(学习、课程、带教申请、协同类策略:人员更换评估/商务政策更新评估/多品类拓张/流量问题改善)")
@ServiceMethod(method = "dj.api.pe.analysis.store.strategy.queryStrategyInfoById", needInSession = NeedInSessionType.YES)
public RopResponse<StrategyInfo> queryStrategyInfoById(CommonIdRequest request) {
try {
RpcResponse<StrategyInfo> response = strategyInfoRemote.queryStrategyInfoById(request.getId());
if (response.hasError()) {
log.error(response.getMessage());
return RopResponse.error(response.getMessage());
}
return RopResponse.success(response.getResult());
} catch (RpcServiceException e) {
log.error("=====查询策略详情 rpcServiceException:{}", e.getMessage());
return RopResponse.error(e);
} catch (Exception e) {
log.error("=====查询策略详情 exception:{}", e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
}
package cn.com.glsx.dj.request.output;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.io.Serializable;
/**
* BI 项目组下拉查询请求。
*/
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class BusinessSceneProjectGroupQueryRequest extends AbstractRopRequest implements Serializable {
private static final long serialVersionUID = -5764266957098661283L;
@ApiModelProperty(notes = "项目组名称,支持模糊查询")
private String groupName;
}
......@@ -93,6 +93,12 @@ public class SceneBaseRequest extends AbstractRopRequest implements Serializable
@ApiModelProperty(notes = "生态预警门店 1.是")
private Byte styjMerchantFlag;
@ApiModelProperty(notes = "项目组id")
private Integer projectGroupId;
@ApiModelProperty(notes = "预警类型")
private Integer warningType;
/**
* 构建门店过滤条件
*/
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!