Commit 0db06a43 by 陶光胜

观云台小程序

parent 5cb26ad4
...@@ -7,6 +7,7 @@ import com.gic.cloud.web.constant.StoreChannelEnum; ...@@ -7,6 +7,7 @@ import com.gic.cloud.web.constant.StoreChannelEnum;
import com.gic.cloud.web.utils.LevelUtil; import com.gic.cloud.web.utils.LevelUtil;
import com.gic.cloud.web.vo.BaseSalesVo; import com.gic.cloud.web.vo.BaseSalesVo;
import com.gic.cloud.web.vo.LevelVo; import com.gic.cloud.web.vo.LevelVo;
import com.gic.commons.util.CollectionUtil;
import com.gic.data.api.dto.BaseDTO; import com.gic.data.api.dto.BaseDTO;
import com.gic.data.api.dto.BaseSalesDTO; import com.gic.data.api.dto.BaseSalesDTO;
import com.gic.data.api.qo.common.CommonQO; import com.gic.data.api.qo.common.CommonQO;
...@@ -15,11 +16,17 @@ import com.gic.enterprise.service.WmStoreApiService; ...@@ -15,11 +16,17 @@ import com.gic.enterprise.service.WmStoreApiService;
import com.gic.mall.share.api.dto.shop.ShopDTO; import com.gic.mall.share.api.dto.shop.ShopDTO;
import com.gic.mall.share.api.enums.ShopTypeEnum; import com.gic.mall.share.api.enums.ShopTypeEnum;
import com.gic.mall.share.api.service.ShopApiService; import com.gic.mall.share.api.service.ShopApiService;
import com.gic.store.dto.ClerkDTO;
import com.gic.store.service.ClerkApiService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component @Component
public class GoDownComponent { public class GoDownComponent {
...@@ -31,6 +38,8 @@ public class GoDownComponent { ...@@ -31,6 +38,8 @@ public class GoDownComponent {
private StoreSearchUtils storeSearchUtils; private StoreSearchUtils storeSearchUtils;
@Autowired @Autowired
private DataAuthUtils dataAuthUtils; private DataAuthUtils dataAuthUtils;
@Autowired
private ClerkApiService clerkApiService;
public void parseTotal(ServiceResponse<?> response, BaseSalesVo vo){ public void parseTotal(ServiceResponse<?> response, BaseSalesVo vo){
if(response.isSuccess() && response.getResult() != null){ if(response.isSuccess() && response.getResult() != null){
...@@ -172,11 +181,28 @@ public class GoDownComponent { ...@@ -172,11 +181,28 @@ public class GoDownComponent {
} }
} }
if(channel == StoreChannelEnum.OFFLINE.getChannel()){ if(channel == StoreChannelEnum.OFFLINE.getChannel()){
List<ClerkDTO> clerkDTOS = new ArrayList<>();
if(level.intValue() == 8){
List<String> clerkIdList = page.getResult().stream().map(b -> {
BaseDTO baseSalesDTO = (BaseDTO) b;
return baseSalesDTO.getAreaId() == null ? baseSalesDTO.getId() : baseSalesDTO.getAreaId();
}).collect(Collectors.toList());
clerkDTOS = this.clerkApiService.listClerkByIds(enterpriseId, StringUtils.join(clerkIdList, ",")).getResult();
}
final Map<Integer, ClerkDTO> clerkDTOMap = CollectionUtil.toMap(clerkDTOS, "clerkId");
page.getResult().stream().forEach(b -> { page.getResult().stream().forEach(b -> {
BaseDTO baseSalesDTO = (BaseDTO) b; BaseDTO baseSalesDTO = (BaseDTO) b;
baseSalesDTO.setLevel(level); baseSalesDTO.setLevel(level);
baseSalesDTO.setChannel(StoreChannelEnum.OFFLINE.getChannel()); baseSalesDTO.setChannel(StoreChannelEnum.OFFLINE.getChannel());
baseSalesDTO.setHasChildren(level <= maxLevel ? 1 : 0); baseSalesDTO.setHasChildren(level <= maxLevel ? 1 : 0);
if(clerkDTOMap != null && level.intValue() == 8){
ClerkDTO clerkDTO = clerkDTOMap.get(baseSalesDTO.getAreaId() == null ? baseSalesDTO.getId() : baseSalesDTO.getAreaId());
if(clerkDTO != null){
baseSalesDTO.setName(clerkDTO.getClerkName());
}else{
baseSalesDTO.setName("未知");
}
}
}); });
} }
} }
......
...@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSON; ...@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.AttentionStoreDTO; import com.gic.cloud.dto.AttentionStoreDTO;
import com.gic.cloud.dto.DataAuthDTO;
import com.gic.cloud.service.DataAuthApiService;
import com.gic.cloud.service.StoreAttentionApiService; import com.gic.cloud.service.StoreAttentionApiService;
import com.gic.cloud.web.auth.DataAuthUtils; import com.gic.cloud.web.auth.DataAuthUtils;
import com.gic.cloud.web.auth.OnLineAuth; import com.gic.cloud.web.auth.OnLineAuth;
...@@ -56,6 +58,8 @@ public class StoreWidgetController { ...@@ -56,6 +58,8 @@ public class StoreWidgetController {
private StoreAttentionApiService storeAttentionApiService; private StoreAttentionApiService storeAttentionApiService;
@Autowired @Autowired
private StoreSearchUtils storeSearchUtils; private StoreSearchUtils storeSearchUtils;
@Autowired
private DataAuthApiService dataAuthApiService;
@RequestMapping("store-widget-index") @RequestMapping("store-widget-index")
public RestResponse storeWidgetIndex(Integer userId, Integer enterpriseId){ public RestResponse storeWidgetIndex(Integer userId, Integer enterpriseId){
...@@ -96,6 +100,10 @@ public class StoreWidgetController { ...@@ -96,6 +100,10 @@ public class StoreWidgetController {
if(CollectionUtils.isNotEmpty(result.getResult())){ if(CollectionUtils.isNotEmpty(result.getResult())){
vo.setAttentionCount(result.getTotalCount()); vo.setAttentionCount(result.getTotalCount());
} }
DataAuthDTO dataAuthDTO = this.dataAuthApiService.ggetDataAuthByUserId(enterpriseId, userId).getResult();
if(dataAuthDTO != null){
vo.setHasWgs(dataAuthDTO.getNoOwnerStore() == null ? 0 : dataAuthDTO.getNoOwnerStore());
}
return RestResponse.success(vo); return RestResponse.success(vo);
} }
......
...@@ -8,6 +8,7 @@ public class StoreWidgetIndexVo { ...@@ -8,6 +8,7 @@ public class StoreWidgetIndexVo {
private List<IndexItemVo> items; private List<IndexItemVo> items;
private Integer attentionCount = 0; private Integer attentionCount = 0;
private Integer singleRegion = 0; private Integer singleRegion = 0;
private Integer hasWgs = 0;
public Integer getType() { public Integer getType() {
return type; return type;
...@@ -40,4 +41,12 @@ public class StoreWidgetIndexVo { ...@@ -40,4 +41,12 @@ public class StoreWidgetIndexVo {
public void setSingleRegion(Integer singleRegion) { public void setSingleRegion(Integer singleRegion) {
this.singleRegion = singleRegion; this.singleRegion = singleRegion;
} }
public Integer getHasWgs() {
return hasWgs;
}
public void setHasWgs(Integer hasWgs) {
this.hasWgs = hasWgs;
}
} }
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