Commit f810151c by 陶光胜

门店控件查询

parent 2a3587a7
......@@ -150,4 +150,14 @@ public interface IndexDescApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


*/
ServiceResponse<Void> init(Integer enterpriseId);
/***
* init
* @Title: init
* @Description: 初始化红点数据
* @author taogs
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> init();
}
......@@ -84,4 +84,15 @@ public interface IndexModuleRelService {
* @return java.util.List<java.lang.String>


*/
List<String> listRelModuleId(Integer type);
}
/**
* listAllIndex
* @Title: listAllIndex
* @Description: 获取所有的指标
* @author taogs
* @param type
* @return java.util.List<java.lang.Integer>
* @throws
*/
List<Integer> listAllIndex(Integer type);
}
\ No newline at end of file
......@@ -67,4 +67,14 @@ public interface UpdateTipService {
* @return java.util.Map<java.lang.Integer,com.gic.cloud.entity.TabUpdateTips>


*/
Map<Integer, TabUpdateTips> mapByIndexIdAndUser(List<Integer> indexIdList, int type, Integer userId);
/**
* init
* @Title: init
* @Description: 初始化红点
* @author taogs
* @return void
* @throws
*/
void init();
}
......@@ -77,4 +77,11 @@ public class IndexModuleRelServiceImpl implements IndexModuleRelService {
return Optional.ofNullable(relList).orElse(Collections.emptyList())
.stream().map(TabIndexModuleRel::getModuleId).collect(Collectors.toList());
}
@Override
public List<Integer> listAllIndex(Integer type) {
List<TabIndexModuleRel> relList = tabIndexModuleRelMapper.listModuleIdByBusinessIds(null, type);
return Optional.ofNullable(relList).orElse(Collections.emptyList())
.stream().map(TabIndexModuleRel::getBusinessId).collect(Collectors.toList());
}
}
......@@ -3,17 +3,11 @@ package com.gic.cloud.service.impl;
import com.gic.auth.service.UserApiService;
import com.gic.cloud.constants.LogAndUpdateTipsTypeEnum;
import com.gic.cloud.dao.mapper.TabUpdateTipsMapper;
import com.gic.cloud.entity.TabDataExplain;
import com.gic.cloud.entity.TabIndex;
import com.gic.cloud.entity.TabSysUser;
import com.gic.cloud.entity.TabUpdateTips;
import com.gic.cloud.entity.*;
import com.gic.cloud.qo.DataExplainQo;
import com.gic.cloud.qo.IndexQo;
import com.gic.cloud.qo.UserQo;
import com.gic.cloud.service.DataExplainService;
import com.gic.cloud.service.IndexService;
import com.gic.cloud.service.UpdateTipService;
import com.gic.cloud.service.UserService;
import com.gic.cloud.service.*;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -39,6 +33,8 @@ public class UpdateTipServiceImpl implements UpdateTipService {
private IndexService indexService;
@Autowired
private DataExplainService dataExplainService;
@Autowired
private IndexModuleRelService indexModuleRelService;
@Override
public void insertBySaveUser(Integer userId) {
......@@ -100,4 +96,20 @@ public class UpdateTipServiceImpl implements UpdateTipService {
}
@Override
public void init() {
List<Integer> list = userApiService.listAllUser(null).getResult();
List<Integer> indexIdList = indexModuleRelService.listAllIndex(1);
for (Integer userId : list) {
for(Integer businessId : indexIdList){
TabUpdateTips tabUpdateTips = new TabUpdateTips();
tabUpdateTips.setUserId(userId);
tabUpdateTips.setBusinessId(businessId);
tabUpdateTips.setShowStatus(1);
tabUpdateTips.setType(1);
tabUpdateTipsMapper.insertSelective(tabUpdateTips);
}
}
}
}
......@@ -137,4 +137,10 @@ public class IndexDescApiServiceImpl implements IndexDescApiService {
this.indexDescService.init(enterpriseId);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> init() {
this.updateTipService.init();
return ServiceResponse.success();
}
}
......@@ -78,4 +78,9 @@ public class IndexDescController {
ServiceResponse<DataExplainDTO> serviceResponse = dataExplainApiService.listByModule(moduleId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("init")
public RestResponse init(){
indexDescApiService.init();
return RestResponse.success();
}
}
\ No newline at end of file
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