Commit 82018cba by 陶光胜

通知详情修改

parent b52f1363
package com.gic.enterprise.web.controller;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.ChannelResourceDTO;
......@@ -179,7 +180,10 @@ public class IndexModuleController {
result.add(map);
}
}
return RestResponse.success(result);
Map<String, Object> data = new HashMap<>();
data.put("data", result);
data.put("legend", this.getLegend(enterpriseId, null));
return RestResponse.success(data);
}
@RequestMapping("store-city-data")
......@@ -234,7 +238,10 @@ public class IndexModuleController {
}
}
}
return RestResponse.success(result);
Map<String, Object> data = new HashMap<>();
data.put("data", result);
data.put("legend", this.getLegend(enterpriseId, provinceId));
return RestResponse.success(data);
}
......@@ -345,12 +352,23 @@ public class IndexModuleController {
return RestResponse.success(result);
}
private void getLegend(Integer enterpriseId, String provinceId){
private List<Integer> getLegend(Integer enterpriseId, String provinceId){
Integer storeNum = this.getStoreNum(enterpriseId, null, provinceId);
List<Integer> legend = new ArrayList<>();
if(storeNum <=21){
int index = 1;
while (storeNum>0){
legend.add(index*1);
storeNum -= index*1;
index++;
}
}else {
int sig = storeNum%21 == 0 ? storeNum/21 : storeNum/21+1;
for(int i = 1; i<=6; i++){
legend.add(i*sig);
}
}
return legend;
}
private Integer getStoreNum(Integer enterpriseId, Integer status, String provinceId){
......
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