Commit 26d637e5 by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-data-cloud into developer
parents ea3d86f2 8e813eff
......@@ -72,6 +72,8 @@ public class IndexController {
indexDTO.setOptUserName(realName);
if (StringUtils.isNotBlank(relModuleIds)) {
indexDTO.setRelModuleIdList(Lists.newArrayList(relModuleIds.split(",")));
} else {
indexDTO.setRelModuleIdList(null);
}
ServiceResponse<Void> serviceResponse = indexApiService.updateIndex(indexDTO, updateType, reason);
return ResultControllerUtils.commonResult(serviceResponse);
......
......@@ -58,6 +58,7 @@ public class IndexDescEnterpriseServiceImpl implements IndexDescEnterpriseServic
TabIndexDescEnterprise indexDescEnterprise = new TabIndexDescEnterprise();
indexDescEnterprise.setIndexDescEnterpriseId(Integer.valueOf(s));
indexDescEnterprise.setSort(i);
indexDescEnterprise.setIndexStatus(1);
tabIndexDescEnterpriseMapper.updateByPrimaryKeySelective(indexDescEnterprise);
}
}
......
......@@ -24,9 +24,9 @@ public class IndexModuleRelServiceImpl implements IndexModuleRelService {
@Override
public void save(Integer businessId, List<String> moduleIdList, Integer type) {
// 把所有关联status设置为0
tabIndexModuleRelMapper.delByBusinessId(businessId, type);
if (CollectionUtils.isNotEmpty(moduleIdList)) {
// 把所有关联status设置为0
tabIndexModuleRelMapper.delByBusinessId(businessId, type);
// 插入不存在的关联
for (String moduleId : moduleIdList) {
TabIndexModuleRel rel = new TabIndexModuleRel();
......
......@@ -108,6 +108,12 @@ public class IndexServiceImpl implements IndexService {
return null;
}
indexQO.setIndexIdList(indexIdList);
return tabIndexMapper.listIndex(indexQO).get(0);
indexQO.setCode(indexCode);
Page<TabIndex> page = tabIndexMapper.listIndex(indexQO);
if (CollectionUtils.isEmpty(page)) {
return null;
} else {
return page.get(0);
}
}
}
......@@ -82,10 +82,8 @@ public class IndexDescApiServiceImpl implements IndexDescApiService {
String[] idsArr = ids.split(",");
indexDescEnterpriseService.batchUpdate(idsArr);
List<String> existList = Arrays.asList(idsArr);
if (existList.size() < indexDescDTOList.size()) {
List<Integer> deleteList = indexDescDTOList.stream().map(IndexDescDTO::getIndexDescEnterpriseId).filter(e -> !existList.contains(e.toString())).collect(Collectors.toList());
indexDescEnterpriseService.deleteList(deleteList);
}
List<Integer> deleteList = indexDescDTOList.stream().map(IndexDescDTO::getIndexDescEnterpriseId).filter(e -> !existList.contains(e.toString())).collect(Collectors.toList());
indexDescEnterpriseService.deleteList(deleteList);
return EnterpriseServiceResponse.success();
}
......
package com.gic.cloud.web.controller;
import com.gic.cloud.web.auth.DataAuthUtils;
import com.gic.data.api.qo.consumestructure.AgeConsumeAreaQO;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -9,8 +7,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.gic.cloud.web.auth.DataAuthUtils;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.data.api.qo.consumestructure.AgeConsumeShareQO;
import com.gic.data.api.qo.consumestructure.*;
import com.gic.data.api.service.consumestructure.ConsumeStructureApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
......@@ -60,4 +59,59 @@ public class ConsumeStructureController {
params.setMemberCardIdList(dataAuthUtils.getMbrAreaId(params.getUserId(), params.getEnterpriseId()));
return ResultControllerUtils.commonResult(consumeStructureApiService.pageAgeConsumeArea(params));
}
@RequestMapping("get-grade-consume-trend")
public RestResponse getGradeConsumeTrend(GradeConsumeTrendQO params) {
log.info("消费构成-等级-趋势参数:{}", JSON.toJSONString(params));
params.setOnlineStoreIdList(storeSearchUtils.onLineStoreSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
params.setStoreInfoIdList(storeSearchUtils.storeSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
return ResultControllerUtils.commonResult(consumeStructureApiService.queryGradeConsumeTrend(params));
}
@RequestMapping("get-grade-consume-survey")
public RestResponse getGradeConsumeSurvey(GradeConsumeTrendQO params) {
log.info("消费构成-等级-概况参数:{}", JSON.toJSONString(params));
params.setOnlineStoreIdList(storeSearchUtils.onLineStoreSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
params.setStoreInfoIdList(storeSearchUtils.storeSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
return ResultControllerUtils.commonResult(consumeStructureApiService.queryGradeConsumeSurvey(params));
}
@RequestMapping("get-grade-consume-area")
public RestResponse queryGradeConsumeArea(GradeConsumeAreaQO params) {
log.info("消费构成-等级-区域参数:{}", JSON.toJSONString(params));
params.setOnlineStoreIdList(storeSearchUtils.onLineStoreSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
params.setStoreInfoIdList(storeSearchUtils.storeSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
if (params.getLevel() != null) {
params.setLevel(storeSearchUtils.getLevel(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()).getLevel());
}
params.setGroupIdList(storeSearchUtils.getChildrenStoreGroupIdList(params.getParentId()));
return ResultControllerUtils.commonResult(consumeStructureApiService.pageGradeConsumeArea(params));
}
@RequestMapping("get-birth-consume-rate")
public RestResponse getBirthConsumeRate(BirthConsumeRateQO params) {
log.info("消费构成-生日会员-占比参数:{}", JSON.toJSONString(params));
params.setOnlineStoreIdList(storeSearchUtils.onLineStoreSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
params.setStoreInfoIdList(storeSearchUtils.storeSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
params.setMemberCardIdList(dataAuthUtils.getMbrAreaId(params.getUserId(), params.getEnterpriseId()));
return ResultControllerUtils.commonResult(consumeStructureApiService.getBirthConsumeRate(params));
}
@RequestMapping("get-birth-consume-trend")
public RestResponse getBirthConsumeTrend(BirthConsumeRateQO params) {
log.info("消费构成-生日会员-趋势参数:{}", JSON.toJSONString(params));
params.setOnlineStoreIdList(storeSearchUtils.onLineStoreSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
params.setStoreInfoIdList(storeSearchUtils.storeSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
params.setMemberCardIdList(dataAuthUtils.getMbrAreaId(params.getUserId(), params.getEnterpriseId()));
return ResultControllerUtils.commonResult(consumeStructureApiService.queryBirthConsumeTrend(params));
}
@RequestMapping("get-birth-consume-survey")
public RestResponse getBirthConsumeSurvey(BirthConsumeRateQO params) {
log.info("消费构成-生日会员-概况参数:{}", JSON.toJSONString(params));
params.setOnlineStoreIdList(storeSearchUtils.onLineStoreSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
params.setStoreInfoIdList(storeSearchUtils.storeSearch(params.getUserId(), params.getEnterpriseId(), params.getSearchJson()));
params.setMemberCardIdList(dataAuthUtils.getMbrAreaId(params.getUserId(), params.getEnterpriseId()));
return ResultControllerUtils.commonResult(consumeStructureApiService.queryBirthConsumeSurvey(params));
}
}
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