Commit faacd64d by 陶光胜

观云台小程序

parent acc20215
......@@ -102,4 +102,18 @@ public class DataAuthUtils {
return new ArrayList<>();
}
public List<Long> getMbrArea(Integer userId, Integer enterpriseId){
ServiceResponse<DataAuthDTO> response = this.dataAuthApiService.ggetDataAuthByUserId(enterpriseId, userId);
if(response.isSuccess() && response.getResult() != null){
ServiceResponse<List<OwnerMemberCardDTO>> result = memberCardApiService.getAll(enterpriseId);
List<String> cards = Arrays.asList(response.getResult().getMemberCardAuth().split("_"));
if(result.isSuccess() && CollectionUtils.isNotEmpty(result.getResult())){
return result.getResult().stream().filter(dto ->cards.contains(dto.getCardConfigId()+"")).map(ownerMemberCardDTO -> ownerMemberCardDTO.getCardConfigId()).collect(Collectors.toList());
}
}
ArrayList<Long> list = new ArrayList<>();
list.add(-9999l);
return list;
}
}
package com.gic.cloud.web.controller;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.web.qo.DateTypeQo;
import com.gic.cloud.web.vo.BaseSalesVo;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.data.api.dto.BaseSalesDTO;
import com.gic.data.api.dto.BaseSalesParamsDTO;
import com.gic.data.api.service.BaseSalesApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -41,8 +44,20 @@ public class BaseSalesController {
dto.setPageNum(pageNum);
dto.setPageSize(pageSize);
ServiceResponse<Page<BaseSalesDTO>> response = this.baseSalesApiService.pageBaseSales(dto);
return RestResponse.success(response.getResult());
BaseSalesVo vo = new BaseSalesVo();
vo.setPage(response.getResult());
dto.setCountType(2);//合计
ServiceResponse<Page<BaseSalesDTO>> response1 = this.baseSalesApiService.pageBaseSales(dto);
if(response1.isSuccess() && response1.getResult() != null && CollectionUtils.isNotEmpty(response1.getResult().getResult())){
vo.setTotal(response1.getResult().getResult().get(0));
}
if(channel == 1 && parentId == null){
dto.setCountType(3); //无归属
ServiceResponse<Page<BaseSalesDTO>> response2 = this.baseSalesApiService.pageBaseSales(dto);
if(response2.isSuccess() && response2.getResult() != null && CollectionUtils.isNotEmpty(response2.getResult().getResult())){
vo.setWgs(response2.getResult().getResult().get(0));
}
}
return RestResponse.success(vo);
}
}
package com.gic.cloud.web.vo;
import com.gic.api.base.commons.Page;
import com.gic.data.api.dto.BaseSalesDTO;
public class BaseSalesVo {
private Page<BaseSalesDTO> page;
private BaseSalesDTO total;
private BaseSalesDTO wgs;
public Page<BaseSalesDTO> getPage() {
return page;
}
public void setPage(Page<BaseSalesDTO> page) {
this.page = page;
}
public BaseSalesDTO getTotal() {
return total;
}
public void setTotal(BaseSalesDTO total) {
this.total = total;
}
public BaseSalesDTO getWgs() {
return wgs;
}
public void setWgs(BaseSalesDTO wgs) {
this.wgs = wgs;
}
}
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